Fix thread marking on dummy roots
[gnus] / lisp / gnus-art.el
index 076f949..2fa8fdf 100644 (file)
@@ -6198,9 +6198,14 @@ Provided for backwards compatibility."
 
 (defun gnus-shr-put-image (data alt &optional flags)
   "Put image DATA with a string ALT.  Enable image to be deleted."
-  (let ((image (shr-put-image data (propertize (or alt "*")
-                                              'gnus-image-category 'shr)
-                             flags)))
+  (let ((image (if flags
+                  (shr-put-image data (propertize (or alt "*")
+                                                  'gnus-image-category 'shr)
+                                 flags)
+                ;; Old `shr-put-image' doesn't take the optional `flags'
+                ;; argument.
+                (shr-put-image data (propertize (or alt "*")
+                                                'gnus-image-category 'shr)))))
     (when image
       (gnus-add-image 'shr image))))
 
@@ -6948,7 +6953,8 @@ If given a prefix, show the hidden text instead."
          (set-buffer buf))))))
 
 (defun gnus-block-private-groups (group)
-  (if (gnus-news-group-p group)
+  (if (or (gnus-news-group-p group)
+         (gnus-member-of-valid 'global group))
       ;; Block nothing in news groups.
       nil
     ;; Block everything anywhere else.
@@ -7172,15 +7178,17 @@ groups."
          "\\(?:"
          ;; Match paired parentheses, e.g. in Wikipedia URLs:
          ;; http://thread.gmane.org/47B4E3B2.3050402@gmail.com
-         "[" chars punct "]+" "(" "[" chars punct "]+" "[" chars "]*)" "[" chars "]*"
+         "[" chars punct "]+" "(" "[" chars punct "]+" "[" chars "]*)"
+         "\\(?:" "[" chars punct "]+" "[" chars "]" "\\)?"
          "\\|"
-         "[" chars punct     "]+" "[" chars "]"
+         "[" chars punct "]+" "[" chars "]"
          "\\)"))
      (concat ;; XEmacs 21.4 doesn't support POSIX.
       "\\([-a-z0-9_=!?#$@~%&*+\\/:;.,]\\|\\w\\)+"
       "\\([-a-z0-9_=#$@~%&*+\\/]\\|\\w\\)"))
    "\\)")
   "Regular expression that matches URLs."
+  :version "24.4"
   :group 'gnus-article-buttons
   :type 'regexp)
 
@@ -7867,7 +7875,9 @@ url is put as the `gnus-button-url' overlay property on the button."
          (let (gnus-article-mouse-face widget-mouse-face)
            (while points
              (gnus-article-add-button (pop points) (pop points)
-                                      'gnus-button-push beg)))
+                                      'gnus-button-push
+                                      (list beg (assq 'gnus-button-url-regexp
+                                                      gnus-button-alist)))))
          (let ((overlay (gnus-make-overlay start end)))
            (gnus-overlay-put overlay 'evaporate t)
            (gnus-overlay-put overlay 'gnus-button-url
@@ -8412,6 +8422,8 @@ For example:
        (not (gnus-treat-predicate (car val))))
        ((eq pred 'typep)
        (equal (car val) gnus-treat-type))
+       ((functionp pred)
+       (funcall pred))
        (t
        (error "%S is not a valid predicate" pred)))))
    ((eq val t)