unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#69141: [PATCH] Allow attaching files at point using 'gnus-dired-attach'
@ 2024-02-15 11:12 Philip Kaludercic
  2024-02-17 18:10 ` Eric Abrahamsen
  0 siblings, 1 reply; 11+ messages in thread
From: Philip Kaludercic @ 2024-02-15 11:12 UTC (permalink / raw)
  To: 69141

[-- Attachment #1: Type: text/plain, Size: 314 bytes --]

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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] Allow attaching files at point using 'gnus-dired-attach' --]
[-- Type: text/x-patch, Size: 1416 bytes --]

From 9a5e9c51e74a278580eb670769b6093388a6109a Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@posteo.net>
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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-02-26 10:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-15 11:12 bug#69141: [PATCH] Allow attaching files at point using 'gnus-dired-attach' Philip Kaludercic
2024-02-17 18:10 ` Eric Abrahamsen
2024-02-19 15:54   ` Philip Kaludercic
2024-02-19 16:21     ` Eric Abrahamsen
2024-02-19 19:02       ` Philip Kaludercic
2024-02-19 16:52     ` Eli Zaretskii
2024-02-19 19:00     ` Stefan Kangas
2024-02-19 19:02       ` Philip Kaludercic
2024-02-19 20:33         ` Stefan Kangas
2024-02-20  2:22           ` Visuwesh
2024-02-26 10:15           ` Philip Kaludercic

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).