Subject: bug#69141: closed (Re: bug#69141: [PATCH] Allow attaching files at point using 'gnus-dired-attach')

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 19 Feb 2024 19:04:02 +0000

Your bug report

#69141: [PATCH] Allow attaching files at point using 'gnus-dired-attach'

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
69141: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69141
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#69141: [PATCH] Allow attaching files at point using 'gnus-dired-attach'
From: Philip Kaludercic <[email-masked]>
To: Eric Abrahamsen <[email-masked]>
Cc: [email-masked]
Date: Mon, 19 Feb 2024 19:02:47 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Eric Abrahamsen <[email-masked]> writes:

> On 02/19/24 15:54 PM, Philip Kaludercic wrote:
>> Eric Abrahamsen <[email-masked]> writes:
>>
>>> Philip Kaludercic <[email-masked]> writes:
>>>
>>>> I use this command frequently, and am just as frequently mildly annoyed
>>>> that attachments are always added at the bottom of the message buffer,
>>>> instead of at point as is the case with 'mml-attach-file' (usually this
>>>> is mild enough that I'd immediately forget about it).  This patch allows
>>>> disabling the behaviour:
>>>
>>> This looks fine to me, thank you. Would you add a :version to the
>>> defcustom, and also a mention (with index entry) in the Gnus manual,
>>> "Interaction with other modes -> Dired"?
>>>
>>> I guess 'mail is a fine group for the defcustom, kind of hard to say.
>>
>> How does this look like:
>
> Looks good! Thanks.

Pushed, thank you for your comments.

Subject: [PATCH] Allow attaching files at point using 'gnus-dired-attach'
From: Philip Kaludercic <[email-masked]>
To: [email-masked]
Date: Thu, 15 Feb 2024 11:12:16 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

I use this command frequently, and am just as frequently mildly annoyed
that attachments are always added at the bottom of the message buffer,
instead of at point as is the case with 'mml-attach-file' (usually this
is mild enough that I'd immediately forget about it).  This patch allows
disabling the behaviour:

>From 9a5e9c51e74a278580eb670769b6093388a6109a Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <[email-masked]>
Date: Thu, 15 Feb 2024 12:10:12 +0100
Subject: [PATCH] Allow attaching files at point using 'gnus-dired-attach'

* lisp/gnus/gnus-dired.el (gnus-dired-attach-at-end): Add option.
(gnus-dired-attach): Respect it.
---
 lisp/gnus/gnus-dired.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/gnus/gnus-dired.el b/lisp/gnus/gnus-dired.el
index 48c1aef968b..740caab349d 100644
--- a/lisp/gnus/gnus-dired.el
+++ b/lisp/gnus/gnus-dired.el
@@ -111,6 +111,11 @@ gnus-dired-mail-buffers
 
 (autoload 'gnus-completing-read "gnus-util")
 
+(defcustom gnus-dired-attach-at-end t
+  "Non-nil means that files should be attached at the end of a buffer."
+  :group 'mail ;; dired?
+  :type 'boolean)
+
 ;; Method to attach files to a mail composition.
 (defun gnus-dired-attach (files-to-attach)
   "Attach dired's marked files to a gnus message composition.
@@ -161,7 +166,8 @@ gnus-dired-attach
 
       ;; set buffer to destination buffer, and attach files
       (set-buffer destination)
-      (goto-char (point-max))		;attach at end of buffer
+      (when gnus-dired-attach-at-end
+        (goto-char (point-max)))		;attach at end of buffer
       (while files-to-attach
 	(mml-attach-file (car files-to-attach)
 			 (or (mm-default-file-type (car files-to-attach))
-- 
2.43.0