aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorAlbert Krewinkel2014-07-18 08:23:49 +0000
committerKatsumi Yamaoka2014-07-18 08:23:49 +0000
commit32a608307c53bd8bb1e29015bc36438f0ff0c572 (patch)
tree060e684462501f40f081bf4638ba73e98c0eae2c /lisp
parent0e6040770c6d7c819f985e1a665dce3e78751480 (diff)
downloademacs-32a608307c53bd8bb1e29015bc36438f0ff0c572.tar.gz
emacs-32a608307c53bd8bb1e29015bc36438f0ff0c572.zip
* 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.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/gnus-msg.el14
2 files changed, 14 insertions, 5 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index e3c978331ec..cdfe4f4dea8 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
12013-07-17 Albert Krewinkel <albert@zeitkraut.de>
2
3 * gnus-msg.el (gnus-configure-posting-style):
4 Allow string replacements in values when matching against a header.
5
12014-07-07 Katsumi Yamaoka <yamaoka@jpl.org> 62014-07-07 Katsumi Yamaoka <yamaoka@jpl.org>
2 7
3 * gnus-start.el (gnus-dribble-read-file): Don't stop the auto-saving of 8 * gnus-start.el (gnus-dribble-read-file): Don't stop the auto-saving of
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index 1c8635c5992..469b9d2cf81 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -1826,7 +1826,7 @@ this is a reply."
1826 (with-current-buffer gnus-summary-buffer 1826 (with-current-buffer gnus-summary-buffer
1827 gnus-posting-styles) 1827 gnus-posting-styles)
1828 gnus-posting-styles)) 1828 gnus-posting-styles))
1829 style match attribute value v results 1829 style match attribute value v results matched-string
1830 filep name address element) 1830 filep name address element)
1831 ;; If the group has a posting-style parameter, add it at the end with a 1831 ;; If the group has a posting-style parameter, add it at the end with a
1832 ;; regexp matching everything, to be sure it takes precedence over all 1832 ;; regexp matching everything, to be sure it takes precedence over all
@@ -1846,7 +1846,9 @@ this is a reply."
1846 (when (cond 1846 (when (cond
1847 ((stringp match) 1847 ((stringp match)
1848 ;; Regexp string match on the group name. 1848 ;; Regexp string match on the group name.
1849 (string-match match group)) 1849 (when (string-match match group)
1850 (setq matched-string group)
1851 t))
1850 ((eq match 'header) 1852 ((eq match 'header)
1851 ;; Obsolete format of header match. 1853 ;; Obsolete format of header match.
1852 (and (gnus-buffer-live-p gnus-article-copy) 1854 (and (gnus-buffer-live-p gnus-article-copy)
@@ -1875,7 +1877,8 @@ this is a reply."
1875 (nnheader-narrow-to-headers) 1877 (nnheader-narrow-to-headers)
1876 (let ((header (message-fetch-field (nth 1 match)))) 1878 (let ((header (message-fetch-field (nth 1 match))))
1877 (and header 1879 (and header
1878 (string-match (nth 2 match) header))))))) 1880 (string-match (nth 2 match) header)
1881 (setq matched-string header)))))))
1879 (t 1882 (t
1880 ;; This is a form to be evalled. 1883 ;; This is a form to be evalled.
1881 (eval match))))) 1884 (eval match)))))
@@ -1896,10 +1899,11 @@ this is a reply."
1896 (setq v 1899 (setq v
1897 (cond 1900 (cond
1898 ((stringp value) 1901 ((stringp value)
1899 (if (and (stringp match) 1902 (if (and matched-string
1900 (gnus-string-match-p "\\\\[&[:digit:]]" value) 1903 (gnus-string-match-p "\\\\[&[:digit:]]" value)
1901 (match-beginning 1)) 1904 (match-beginning 1))
1902 (gnus-match-substitute-replacement value nil nil group) 1905 (gnus-match-substitute-replacement value nil nil
1906 matched-string)
1903 value)) 1907 value))
1904 ((or (symbolp value) 1908 ((or (symbolp value)
1905 (functionp value)) 1909 (functionp value))