Merge changes made in Gnus master
authorGnus developers <ding@gnus.org>
Tue, 25 Dec 2012 22:12:59 +0000 (22:12 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Tue, 25 Dec 2012 22:12:59 +0000 (22:12 +0000)
2012-12-25  Lars Ingebrigtsen  <larsi@gnus.org>
* gnus-sum.el (gnus-set-global-variables): Don't copy over the summary
  buffer to the article buffer here, because that clobbers multiple
  article buffers.
* gnus-art.el (gnus-article-setup-buffer): Make sure that the article
  buffer always points to the right summary buffer.

2012-12-25  John Wiegley  <jwiegley@gmail.com>
* auth-source.el (auth-source-netrc-parse): Allow using "password" as
  the password (bug#12097).

2012-12-25  Lars Ingebrigtsen  <larsi@gnus.org>
* shr.el (shr-tag-a): Don't tagify <A> elements that don't have HREFs
  (bug#13263).
* gnus-salt.el (gnus-highlight-selected-tree): Check whether the Tree
  buffer exists before using it (bug#12475).
* gnus-agent.el (gnus-agent-fetch-articles): Don't fetch articles from
  offline groups (bug#11937).
* message.el (message-yank-original): When using customize to set the
  value of `message-cite-style', the variable it set to a symbol that's
  the name of the variable, which must then be dereferenced (bug#12616).

2012-09-13  Wolfgang Jenkner  <wjenkner@inode.at>
* lisp/gnus-spec.el (gnus-face-face-function): Initialize the value of
  the `face' property with a list whose car is the face specified in the
  format string and whose cdr is (nil).
* lisp/gnus-util.el
  (gnus-put-text-property-excluding-characters-with-faces): Change
  accordingly.
  (gnus-get-text-property-excluding-characters-with-faces): New function.
* lisp/gnus-sum.el (gnus-summary-highlight-line):
* lisp/gnus-salt.el (gnus-tree-highlight-node):
* lisp/gnus-group.el (gnus-group-highlight-line): Use it.

lisp/gnus/ChangeLog
lisp/gnus/auth-source.el
lisp/gnus/gnus-agent.el
lisp/gnus/gnus-art.el
lisp/gnus/gnus-group.el
lisp/gnus/gnus-salt.el
lisp/gnus/gnus-spec.el
lisp/gnus/gnus-sum.el
lisp/gnus/gnus-util.el
lisp/gnus/message.el
lisp/gnus/shr.el

index a1a64cc..2916b40 100644 (file)
@@ -1,3 +1,45 @@
+2012-12-25  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus-sum.el (gnus-set-global-variables): Don't copy over the summary
+       buffer to the article buffer here, because that clobbers multiple
+       article buffers.
+
+       * gnus-art.el (gnus-article-setup-buffer): Make sure that the article
+       buffer always points to the right summary buffer.
+
+2012-12-25  John Wiegley  <jwiegley@gmail.com>
+
+       * auth-source.el (auth-source-netrc-parse): Allow using "password" as
+       the password (bug#12097).
+
+2012-12-25  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * shr.el (shr-tag-a): Don't tagify <A> elements that don't have HREFs
+       (bug#13263).
+
+       * gnus-salt.el (gnus-highlight-selected-tree): Check whether the Tree
+       buffer exists before using it (bug#12475).
+
+       * gnus-agent.el (gnus-agent-fetch-articles): Don't fetch articles from
+       offline groups (bug#11937).
+
+       * message.el (message-yank-original): When using customize to set the
+       value of `message-cite-style', the variable it set to a symbol that's
+       the name of the variable, which must then be dereferenced (bug#12616).
+
+2012-12-25  Wolfgang Jenkner  <wjenkner@inode.at>
+
+       * lisp/gnus-spec.el (gnus-face-face-function): Initialize the value of
+       the `face' property with a list whose car is the face specified in the
+       format string and whose cdr is (nil).
+       * lisp/gnus-util.el
+       (gnus-put-text-property-excluding-characters-with-faces): Change
+       accordingly.
+       (gnus-get-text-property-excluding-characters-with-faces): New function.
+       * lisp/gnus-sum.el (gnus-summary-highlight-line):
+       * lisp/gnus-salt.el (gnus-tree-highlight-node):
+       * lisp/gnus-group.el (gnus-group-highlight-line): Use it.
+
 2012-12-25  Lars Ingebrigtsen  <larsi@gnus.org>
 
        * nnimap.el (nnimap-authenticator): Expand to allow specifying the
@@ -8,7 +50,7 @@
        mark state when moving articles.  Otherwise unticked articles will get
        their ticks back after moving.
 
-2012-12-24  Lars Ingebrigtsen  <larsi@gnus.org>
+2012-12-25  Lars Ingebrigtsen  <larsi@gnus.org>
 
        * gnus-srvr.el (gnus-browse-delete-group): Fix syntax error.
 
        to nil to allow re-selecting groups that gain articles.
        (gnus-bug-group-download-format-alist): Update the URL.
 
-2012-12-23  Andreas Schwab  <schwab@suse.de>
+2012-12-25  Andreas Schwab  <schwab@suse.de>
 
        * shr.el (shr-tag-em): Render em as italic, not bold.
 
-2012-12-23  Lars Ingebrigtsen  <larsi@gnus.org>
+2012-12-25  Lars Ingebrigtsen  <larsi@gnus.org>
 
        * gnus-int.el (gnus-backend-trace): Factor out into its own function
        for reuse.
@@ -38,7 +80,7 @@
        (gnus-finish-retrieve-group-infos): Add backend tracing.
        (gnus-backend-trace): Also note the elapsed seconds.
 
-2012-12-22  Philipp Haselwarter  <philipp@haselwarter.org>
+2012-12-25  Philipp Haselwarter  <philipp@haselwarter.org>
 
        * gnus-sync.el (gnus-sync-file-encrypt-to, gnus-sync-save): Set
        epa-file-encrypt-to from variable to avoid querying.
index 4c5e5ff..b5b0c77 100644 (file)
@@ -1008,7 +1008,7 @@ Note that the MAX parameter is used so we can exit the parse early."
                     (while (and (zerop (forward-line 1))
                                 (looking-at "$")))
                     (narrow-to-region (point) (point)))
-                   ((member elem tokens)
+                   ((and (member elem tokens) (null pair))
                     ;; Tokens that don't have a following value are ignored,
                     ;; except "default".
                     (when (and pair (or (cdr pair)
index 60d6102..297c654 100644 (file)
@@ -1489,7 +1489,8 @@ downloaded into the agent."
 
 (defun gnus-agent-fetch-articles (group articles)
   "Fetch ARTICLES from GROUP and put them into the Agent."
-  (when articles
+  (when (and articles
+            (gnus-online (gnus-group-method group)))
     (gnus-agent-load-alist group)
     (let* ((alist gnus-agent-article-alist)
            (headers (if (< (length articles) 2) nil gnus-newsgroup-headers))
index 43c8ca7..53e3d67 100644 (file)
@@ -4539,18 +4539,17 @@ commands:
            (gnus-article-mode))
          (setq truncate-lines gnus-article-truncate-lines)
          (current-buffer))
-      (with-current-buffer (gnus-get-buffer-create name)
-       (gnus-article-mode)
-       (setq truncate-lines gnus-article-truncate-lines)
-       (make-local-variable 'gnus-summary-buffer)
-       (setq gnus-summary-buffer
-             (gnus-summary-buffer-name gnus-newsgroup-name))
-       (gnus-summary-set-local-parameters gnus-newsgroup-name)
-       (when article-lapsed-timer
-         (gnus-stop-date-timer))
-       (when gnus-article-update-date-headers
-         (gnus-start-date-timer gnus-article-update-date-headers))
-       (current-buffer)))))
+      (let ((summary gnus-summary-buffer))
+       (with-current-buffer (gnus-get-buffer-create name)
+         (gnus-article-mode)
+         (setq truncate-lines gnus-article-truncate-lines)
+         (set (make-local-variable 'gnus-summary-buffer) summary)
+         (gnus-summary-set-local-parameters gnus-newsgroup-name)
+         (when article-lapsed-timer
+           (gnus-stop-date-timer))
+         (when gnus-article-update-date-headers
+           (gnus-start-date-timer gnus-article-update-date-headers))
+         (current-buffer))))))
 
 (defun gnus-article-stop-animations ()
   (dolist (timer (and (boundp 'timer-list)
index 2fc87f0..80183c2 100644 (file)
@@ -1667,7 +1667,7 @@ and ends at END."
   (let ((face (cdar (gnus-group-update-eval-form
                       group
                       gnus-group-highlight))))
-    (unless (eq face (get-text-property beg 'face))
+    (unless (eq face (gnus-get-text-property-excluding-characters-with-faces beg 'face))
       (let ((inhibit-read-only t))
         (gnus-put-text-property-excluding-characters-with-faces
          beg end 'face
index 760a7a0..cb4101b 100644 (file)
@@ -659,7 +659,7 @@ Two predefined functions are available:
        (while (and list
                    (not (eval (caar list))))
          (setq list (cdr list)))))
-    (unless (eq (setq face (cdar list)) (get-text-property beg 'face))
+    (unless (eq (setq face (cdar list)) (gnus-get-text-property-excluding-characters-with-faces beg 'face))
       (gnus-put-text-property-excluding-characters-with-faces
        beg end 'face
        (if (boundp face) (symbol-value face) face)))))
@@ -828,31 +828,33 @@ Two predefined functions are available:
 
 (defun gnus-highlight-selected-tree (article)
   "Highlight the selected article in the tree."
-  (let ((buf (current-buffer))
-       region)
-    (set-buffer gnus-tree-buffer)
-    (when (setq region (gnus-tree-article-region article))
-      (when (or (not gnus-selected-tree-overlay)
-               (gnus-extent-detached-p gnus-selected-tree-overlay))
-       ;; Create a new overlay.
-       (gnus-overlay-put
-        (setq gnus-selected-tree-overlay
-              (gnus-make-overlay (point-min) (1+ (point-min))))
-        'face gnus-selected-tree-face))
-      ;; Move the overlay to the article.
-      (gnus-move-overlay
-       gnus-selected-tree-overlay (goto-char (car region)) (cdr region))
-      (gnus-tree-minimize)
-      (gnus-tree-recenter)
-      (let ((selected (selected-window)))
-       (when (gnus-get-buffer-window (set-buffer gnus-tree-buffer) t)
-         (select-window (gnus-get-buffer-window (set-buffer gnus-tree-buffer) t))
-         (gnus-horizontal-recenter)
-         (select-window selected))))
-;; If we remove this save-excursion, it updates the wrong mode lines?!?
-    (with-current-buffer gnus-tree-buffer
-      (gnus-set-mode-line 'tree))
-    (set-buffer buf)))
+  (when (buffer-live-p gnus-tree-buffer)
+    (let ((buf (current-buffer))
+         region)
+      (set-buffer gnus-tree-buffer)
+      (when (setq region (gnus-tree-article-region article))
+       (when (or (not gnus-selected-tree-overlay)
+                 (gnus-extent-detached-p gnus-selected-tree-overlay))
+         ;; Create a new overlay.
+         (gnus-overlay-put
+          (setq gnus-selected-tree-overlay
+                (gnus-make-overlay (point-min) (1+ (point-min))))
+          'face gnus-selected-tree-face))
+       ;; Move the overlay to the article.
+       (gnus-move-overlay
+        gnus-selected-tree-overlay (goto-char (car region)) (cdr region))
+       (gnus-tree-minimize)
+       (gnus-tree-recenter)
+       (let ((selected (selected-window)))
+         (when (gnus-get-buffer-window (set-buffer gnus-tree-buffer) t)
+           (select-window
+            (gnus-get-buffer-window (set-buffer gnus-tree-buffer) t))
+           (gnus-horizontal-recenter)
+           (select-window selected))))
+      ;; If we remove this save-excursion, it updates the wrong mode lines?!?
+      (with-current-buffer gnus-tree-buffer
+       (gnus-set-mode-line 'tree))
+      (set-buffer buf))))
 
 (defun gnus-tree-highlight-article (article face)
   (with-current-buffer (gnus-get-tree-buffer)
index f40177d..22d4627 100644 (file)
@@ -265,7 +265,14 @@ Return a list of updated types."
 (defun gnus-face-face-function (form type)
   `(gnus-add-text-properties
     (point) (progn ,@form (point))
-    '(gnus-face t face ,(symbol-value (intern (format "gnus-face-%d" type))))))
+    (cons 'face
+         (cons
+          ;; Delay consing the value of the `face' property until
+          ;; `gnus-add-text-properties' runs, since it will be modified
+          ;; by `gnus-put-text-property-excluding-characters-with-faces'.
+          (list ',(symbol-value (intern (format "gnus-face-%d" type))) nil)
+          ;; Redundant now, but still convenient.
+          '(gnus-face t)))))
 
 (defun gnus-balloon-face-function (form type)
   `(gnus-put-text-property
index 7c3bf9f..429dd55 100644 (file)
@@ -3493,8 +3493,8 @@ If the setup was successful, non-nil is returned."
          (set-buffer buffer)
          (setq gnus-summary-buffer (current-buffer))
          (not gnus-newsgroup-prepared))
-      ;; Fix by Sudish Joseph <joseph@cis.ohio-state.edu>
-      (setq gnus-summary-buffer (set-buffer (gnus-get-buffer-create buffer)))
+      (set-buffer (gnus-get-buffer-create buffer))
+      (setq gnus-summary-buffer (current-buffer))
       (gnus-summary-mode group)
       (when (gnus-group-quit-config group)
        (set (make-local-variable 'gnus-single-article-buffer) nil))
@@ -3552,11 +3552,7 @@ buffer that was in action when the last article was fetched."
            (if (consp (car locals))
                (set (caar locals) (pop vlist))
              (set (car locals) (pop vlist)))
-           (setq locals (cdr locals))))
-       ;; The article buffer also has local variables.
-       (when (gnus-buffer-live-p gnus-article-buffer)
-         (set-buffer gnus-article-buffer)
-         (setq gnus-summary-buffer summary))))))
+           (setq locals (cdr locals))))))))
 
 (defun gnus-summary-article-unread-p (article)
   "Say whether ARTICLE is unread or not."
@@ -7874,7 +7870,6 @@ If STOP is non-nil, just stop when reaching the end of the message.
 
 Also see the variable `gnus-article-skip-boring'."
   (interactive "P")
-  (setq gnus-summary-buffer (current-buffer))
   (gnus-set-global-variables)
   (let ((article (gnus-summary-article-number))
        (article-window (get-buffer-window gnus-article-buffer t))
@@ -12524,7 +12519,7 @@ If REVERSE, save parts that do not match TYPE."
                         (memq article gnus-newsgroup-undownloaded)
                         (not (memq article gnus-newsgroup-cached)))))
     (let ((face (funcall (gnus-summary-highlight-line-0))))
-      (unless (eq face (get-text-property beg 'face))
+      (unless (eq face (gnus-get-text-property-excluding-characters-with-faces beg 'face))
        (gnus-put-text-property-excluding-characters-with-faces
         beg (point-at-eol) 'face
         (setq face (if (boundp face) (symbol-value face) face)))
index 7b1e2b5..1c22bdf 100644 (file)
@@ -866,18 +866,29 @@ If there's no subdirectory, delete DIRECTORY as well."
          (setq beg (point)))
        (gnus-overlay-put (gnus-make-overlay beg (point)) prop val)))))
 
-(defun gnus-put-text-property-excluding-characters-with-faces (beg end
-                                                                  prop val)
-  "The same as `put-text-property', but don't put props on characters with the `gnus-face' property."
-  (let ((b beg))
-    (while (/= b end)
-      (when (get-text-property b 'gnus-face)
-       (setq b (next-single-property-change b 'gnus-face nil end)))
-      (when (/= b end)
+(defun gnus-put-text-property-excluding-characters-with-faces (beg end prop val)
+  "The same as `put-text-property', except where `gnus-face' is set.
+If so, and PROP is `face', set the second element of its value to VAL.
+Otherwise, do nothing."
+  (while (< beg end)
+    ;; Property values are compared with `eq'.
+    (let ((stop (next-single-property-change beg 'face nil end)))
+      (if (get-text-property beg 'gnus-face)
+         (when (eq prop 'face)
+           (setcar (cdr (get-text-property beg 'face)) val))
        (inline
-         (gnus-put-text-property
-          b (setq b (next-single-property-change b 'gnus-face nil end))
-          prop val))))))
+         (gnus-put-text-property beg stop prop val)))
+      (setq beg stop))))
+
+(defun gnus-get-text-property-excluding-characters-with-faces (pos prop)
+  "The same as `get-text-property', except where `gnus-face' is set.
+If so, and PROP is `face', return the second element of its value.
+Otherwise, return the value."
+  (let ((val (get-text-property pos prop)))
+    (if (and (get-text-property pos 'gnus-face)
+            (eq prop 'face))
+       (cadr val)
+      (get-text-property pos prop))))
 
 (defmacro gnus-faces-at (position)
   "Return a list of faces at POSITION."
index 24159d4..2995daa 100644 (file)
@@ -3814,7 +3814,9 @@ prefix, and don't delete any headers."
   (interactive "P")
   ;; eval the let forms contained in message-cite-style
   (eval
-   `(let ,message-cite-style
+   `(let ,(if (symbolp message-cite-style)
+             (symbol-value message-cite-style)
+           message-cite-style)
       (message--yank-original-internal ',arg))))
 
 (defun message-yank-buffer (buffer)
index 322c1d5..2ccbbc1 100644 (file)
@@ -931,7 +931,8 @@ ones, in case fg and bg are nil."
        (start (point))
        shr-start)
     (shr-generic cont)
-    (shr-urlify (or shr-start start) (shr-expand-url url) title)))
+    (when url
+      (shr-urlify (or shr-start start) (shr-expand-url url) title))))
 
 (defun shr-tag-object (cont)
   (let ((start (point))