unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#37470: 26.3; [PATCH] Default value and type of message-make-forward-subject-function
@ 2019-09-20  9:08 Damien Cassou
  2019-09-20 10:02 ` Robert Pluim
  2019-09-20 17:28 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 5+ messages in thread
From: Damien Cassou @ 2019-09-20  9:08 UTC (permalink / raw)
  To: 37470

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

Please find attached a patch fixing the default value and type of
message-make-forward-subject-function.

-- 
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Change-default-value-of-message-make-forward-subject.patch --]
[-- Type: text/x-patch, Size: 1919 bytes --]

From f50141be18a15233d45069484b004492b2956cf9 Mon Sep 17 00:00:00 2001
From: Damien Cassou <damien@cassou.me>
Date: Fri, 20 Sep 2019 11:04:26 +0200
Subject: [PATCH] Change default value of message-make-forward-subject-function

* lisp/gnus/message.el (message-make-forward-subject-function): Change
default value to be a list so it's easier for users to add
functions. Change the type so the customize interface allows selecting
multiple provided functions instead of just one.
---
 lisp/gnus/message.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 48d79107ea..3d0d7bc631 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -532,7 +532,7 @@ message-user-organization-file
   :group 'message-headers)
 
 (defcustom message-make-forward-subject-function
-  #'message-forward-subject-name-subject
+  (list #'message-forward-subject-name-subject)
   "List of functions called to generate subject headers for forwarded messages.
 The subject generated by the previous function is passed into each
 successive function.
@@ -547,10 +547,11 @@ message-make-forward-subject-function
       to it."
   :group 'message-forwarding
   :link '(custom-manual "(message)Forwarding")
-  :type '(radio (function-item message-forward-subject-author-subject)
-		(function-item message-forward-subject-fwd)
-		(function-item message-forward-subject-name-subject)
-		(repeat :tag "List of functions" function)))
+  :type '(repeat :tag "List of functions"
+                 (radio (function-item message-forward-subject-author-subject)
+                        (function-item message-forward-subject-fwd)
+                        (function-item message-forward-subject-name-subject)
+                        (function))))
 
 (defcustom message-forward-as-mime nil
   "Non-nil means forward messages as an inline/rfc822 MIME section.
-- 
2.21.0


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

* bug#37470: 26.3; [PATCH] Default value and type of message-make-forward-subject-function
  2019-09-20  9:08 bug#37470: 26.3; [PATCH] Default value and type of message-make-forward-subject-function Damien Cassou
@ 2019-09-20 10:02 ` Robert Pluim
  2019-09-20 10:22   ` Damien Cassou
  2019-09-20 17:28 ` Lars Ingebrigtsen
  1 sibling, 1 reply; 5+ messages in thread
From: Robert Pluim @ 2019-09-20 10:02 UTC (permalink / raw)
  To: Damien Cassou; +Cc: 37470

>>>>> On Fri, 20 Sep 2019 11:08:42 +0200, Damien Cassou <damien@cassou.me> said:

    Damien> Please find attached a patch fixing the default value and type of
    Damien> message-make-forward-subject-function.
    Damien> +  :type '(repeat :tag "List of functions"
    Damien> +                 (radio (function-item message-forward-subject-author-subject)
    Damien> +                        (function-item message-forward-subject-fwd)
    Damien> +                        (function-item message-forward-subject-name-subject)
    Damien> +                        (function))))

I donʼt see how this could work: 'radio allows selecting only one from
the list. How about something like this:

diff --git i/lisp/gnus/message.el w/lisp/gnus/message.el
index 48d79107ea..1a1cb79039 100644
--- i/lisp/gnus/message.el
+++ w/lisp/gnus/message.el
@@ -532,7 +532,7 @@ message-user-organization-file
   :group 'message-headers)
 
 (defcustom message-make-forward-subject-function
-  #'message-forward-subject-name-subject
+  (list #'message-forward-subject-name-subject)
   "List of functions called to generate subject headers for forwarded messages.
 The subject generated by the previous function is passed into each
 successive function.
@@ -547,10 +547,11 @@ message-make-forward-subject-function
       to it."
   :group 'message-forwarding
   :link '(custom-manual "(message)Forwarding")
-  :type '(radio (function-item message-forward-subject-author-subject)
-		(function-item message-forward-subject-fwd)
-		(function-item message-forward-subject-name-subject)
-		(repeat :tag "List of functions" function)))
+  :type '(set :tag "List of functions"
+              (function-item message-forward-subject-author-subject)
+              (function-item message-forward-subject-fwd)
+              (function-item message-forward-subject-name-subject)
+              (repeat :tag "User functions" :inline t (function :tag "Function"))))
 
 (defcustom message-forward-as-mime nil
   "Non-nil means forward messages as an inline/rfc822 MIME section.





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

* bug#37470: 26.3; [PATCH] Default value and type of message-make-forward-subject-function
  2019-09-20 10:02 ` Robert Pluim
@ 2019-09-20 10:22   ` Damien Cassou
  2019-09-20 12:14     ` Robert Pluim
  0 siblings, 1 reply; 5+ messages in thread
From: Damien Cassou @ 2019-09-20 10:22 UTC (permalink / raw)
  To: Robert Pluim; +Cc: 37470

Hi Robert,

Robert Pluim <rpluim@gmail.com> writes:
>>>>>> On Fri, 20 Sep 2019 11:08:42 +0200, Damien Cassou <damien@cassou.me> said:
>
>     Damien> Please find attached a patch fixing the default value and type of
>     Damien> message-make-forward-subject-function.
>     Damien> +  :type '(repeat :tag "List of functions"
>     Damien> +                 (radio (function-item message-forward-subject-author-subject)
>     Damien> +                        (function-item message-forward-subject-fwd)
>     Damien> +                        (function-item message-forward-subject-name-subject)
>     Damien> +                        (function))))
>
> I donʼt see how this could work: 'radio allows selecting only one from
> the list.


but the 'radio is embedded within a 'repeat which seems to be exactly
what I want.


> How about something like this:
> +  :type '(set :tag "List of functions"
> +              (function-item message-forward-subject-author-subject)
> +              (function-item message-forward-subject-fwd)
> +              (function-item message-forward-subject-name-subject)
> +              (repeat :tag "User functions" :inline t (function :tag "Function"))))


this doesn't work because order of functions has a meaning (e.g., adding
"Fwd:" before the author or after the author).

-- 
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill





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

* bug#37470: 26.3; [PATCH] Default value and type of message-make-forward-subject-function
  2019-09-20 10:22   ` Damien Cassou
@ 2019-09-20 12:14     ` Robert Pluim
  0 siblings, 0 replies; 5+ messages in thread
From: Robert Pluim @ 2019-09-20 12:14 UTC (permalink / raw)
  To: Damien Cassou; +Cc: 37470

>>>>> On Fri, 20 Sep 2019 12:22:21 +0200, Damien Cassou <damien@cassou.me> said:
    Damien> but the 'radio is embedded within a 'repeat which seems to be exactly
    Damien> what I want.

Oh, I misunderstood what you wanted. Yes, your way works fine.

Robert





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

* bug#37470: 26.3; [PATCH] Default value and type of message-make-forward-subject-function
  2019-09-20  9:08 bug#37470: 26.3; [PATCH] Default value and type of message-make-forward-subject-function Damien Cassou
  2019-09-20 10:02 ` Robert Pluim
@ 2019-09-20 17:28 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-20 17:28 UTC (permalink / raw)
  To: Damien Cassou; +Cc: 37470

Damien Cassou <damien@cassou.me> writes:

> Please find attached a patch fixing the default value and type of
> message-make-forward-subject-function.

[...]

>  (defcustom message-make-forward-subject-function
> -  #'message-forward-subject-name-subject
> +  (list #'message-forward-subject-name-subject)
>    "List of functions called to generate subject headers for forwarded
> message

Looks good to me; applied to the trunk.  (I added a :version tag since
the default changed syntactically.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2019-09-20 17:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-20  9:08 bug#37470: 26.3; [PATCH] Default value and type of message-make-forward-subject-function Damien Cassou
2019-09-20 10:02 ` Robert Pluim
2019-09-20 10:22   ` Damien Cassou
2019-09-20 12:14     ` Robert Pluim
2019-09-20 17:28 ` Lars Ingebrigtsen

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).