[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r117548: * lisp/gnus/gnus-msg.el (gnus-configure-pos
From: |
Katsumi Yamaoka |
Subject: |
[Emacs-diffs] trunk r117548: * lisp/gnus/gnus-msg.el (gnus-configure-posting-style): |
Date: |
Fri, 18 Jul 2014 08:24:00 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 117548
revision-id: address@hidden
parent: address@hidden
author: Albert Krewinkel <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Fri 2014-07-18 08:23:49 +0000
message:
* lisp/gnus/gnus-msg.el (gnus-configure-posting-style):
Allow string replacements in values when matching against a header.
* doc/misc/gnus.texi (Posting Styles): Document the possibility to
perform string replacements when matching against headers.
modified:
doc/misc/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-6331
doc/misc/gnus.texi gnus.texi-20091113204419-o5vbwnq5f7feedwu-6305
lisp/gnus/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1433
lisp/gnus/gnus-msg.el gnusmsg.el-20091113204419-o5vbwnq5f7feedwu-1127
=== modified file 'doc/misc/ChangeLog'
--- a/doc/misc/ChangeLog 2014-07-09 02:04:12 +0000
+++ b/doc/misc/ChangeLog 2014-07-18 08:23:49 +0000
@@ -1,3 +1,8 @@
+2014-07-18 Albert Krewinkel <address@hidden>
+
+ * gnus.texi (Posting Styles): Document the possibility to perform
+ string replacements when matching against headers.
+
2014-07-09 Stephen Berman <address@hidden>
* todo-mode.texi (Levels of Organization): Comment out statement
=== modified file 'doc/misc/gnus.texi'
--- a/doc/misc/gnus.texi 2014-06-10 02:20:31 +0000
+++ b/doc/misc/gnus.texi 2014-07-18 08:23:49 +0000
@@ -12813,10 +12813,12 @@
from date id references chars lines xref extra.
In the case of a string value, if the @code{match} is a regular
-expression, a @samp{gnus-match-substitute-replacement} is proceed on
-the value to replace the positional parameters @address@hidden by the
-corresponding parenthetical matches (see @xref{Replacing Match,,
-Replacing the Text that Matched, elisp, The Emacs Lisp Reference Manual}.)
+expression, or if it takes the form @code{(header @var{match}
address@hidden)}, a @samp{gnus-match-substitute-replacement} is proceed
+on the value to replace the positional parameters @address@hidden by
+the corresponding parenthetical matches (see @xref{Replacing Match,,
+Replacing the Text that Matched, elisp, The Emacs Lisp Reference
+Manual}.)
@vindex message-reply-headers
@@ -12848,6 +12850,10 @@
;; @r{If I'm replying to Larsi, set the Organization header.}
((header "from" "larsi.*org")
(Organization "Somewhere, Inc."))
+ ;; @r{Reply to a message from the same subaddress the message}
+ ;; @r{was sent to.}
+ ((header "x-original-to" "me\\(\\+.+\\)@@example.org")
+ (address "me\\1@@example.org"))
((posting-from-work-p) ;; @r{A user defined function}
(signature-file "~/.work-signature")
(address "user@@bar.foo")
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog 2014-07-07 05:47:59 +0000
+++ b/lisp/gnus/ChangeLog 2014-07-18 08:23:49 +0000
@@ -1,3 +1,8 @@
+2013-07-17 Albert Krewinkel <address@hidden>
+
+ * gnus-msg.el (gnus-configure-posting-style):
+ Allow string replacements in values when matching against a header.
+
2014-07-07 Katsumi Yamaoka <address@hidden>
* gnus-start.el (gnus-dribble-read-file): Don't stop the auto-saving of
=== modified file 'lisp/gnus/gnus-msg.el'
--- a/lisp/gnus/gnus-msg.el 2014-02-06 05:43:50 +0000
+++ b/lisp/gnus/gnus-msg.el 2014-07-18 08:23:49 +0000
@@ -1826,7 +1826,7 @@
(with-current-buffer gnus-summary-buffer
gnus-posting-styles)
gnus-posting-styles))
- style match attribute value v results
+ style match attribute value v results matched-string
filep name address element)
;; If the group has a posting-style parameter, add it at the end with a
;; regexp matching everything, to be sure it takes precedence over all
@@ -1846,7 +1846,9 @@
(when (cond
((stringp match)
;; Regexp string match on the group name.
- (string-match match group))
+ (when (string-match match group)
+ (setq matched-string group)
+ t))
((eq match 'header)
;; Obsolete format of header match.
(and (gnus-buffer-live-p gnus-article-copy)
@@ -1875,7 +1877,8 @@
(nnheader-narrow-to-headers)
(let ((header (message-fetch-field (nth 1 match))))
(and header
- (string-match (nth 2 match) header)))))))
+ (string-match (nth 2 match) header)
+ (setq matched-string header)))))))
(t
;; This is a form to be evalled.
(eval match)))))
@@ -1896,10 +1899,11 @@
(setq v
(cond
((stringp value)
- (if (and (stringp match)
+ (if (and matched-string
(gnus-string-match-p "\\\\[&[:digit:]]" value)
(match-beginning 1))
- (gnus-match-substitute-replacement value nil nil group)
+ (gnus-match-substitute-replacement value nil nil
+ matched-string)
value))
((or (symbolp value)
(functionp value))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r117548: * lisp/gnus/gnus-msg.el (gnus-configure-posting-style):,
Katsumi Yamaoka <=