* gnus.el (gnus-overlay-get): New alias to overlay-get.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 16 Oct 2009 07:05:30 +0000 (07:05 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 16 Oct 2009 07:05:30 +0000 (07:05 +0000)
(gnus-overlays-in): New alias to overlays-in.

* gnus-sum.el (gnus-remove-overlays): Use gnus-overlays-in, gnus-overlay-get,
 and gnus-delete-overlay.
(gnus-summary-show-thread): Make it work as well for systems in which
 next-single-char-property-change is not available.
(gnus-summary-hide-thread): Use gnus-make-overlay and gnus-overlay-put.

* gnus-xmas.el (gnus-xmas-overlays-in): New function.
(gnus-overlay-get): New alias to extent-property.
(gnus-overlays-in): New alias to gnus-xmas-overlays-in.

* dgnushack.el: Autoload add-to-invisibility-spec for XEmacs 21.4 and SXEmacs.

* lpath.el: Fbind next-single-char-property-change for XEmacs 21.4 and SXEmacs.

lisp/ChangeLog
lisp/dgnushack.el
lisp/gnus-sum.el
lisp/gnus-xmas.el
lisp/gnus.el
lisp/lpath.el

index 856fe9f..f73cf5d 100644 (file)
@@ -1,3 +1,24 @@
+2009-10-16  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus.el (gnus-overlay-get): New alias to overlay-get.
+       (gnus-overlays-in): New alias to overlays-in.
+
+       * gnus-sum.el (gnus-remove-overlays): Use gnus-overlays-in,
+       gnus-overlay-get, and gnus-delete-overlay.
+       (gnus-summary-show-thread): Make it work as well for systems in which
+       next-single-char-property-change is not available.
+       (gnus-summary-hide-thread): Use gnus-make-overlay and gnus-overlay-put.
+
+       * gnus-xmas.el (gnus-xmas-overlays-in): New function.
+       (gnus-overlay-get): New alias to extent-property.
+       (gnus-overlays-in): New alias to gnus-xmas-overlays-in.
+
+       * dgnushack.el: Autoload add-to-invisibility-spec for XEmacs 21.4 and
+       SXEmacs.
+
+       * lpath.el: Fbind next-single-char-property-change for XEmacs 21.4 and
+       SXEmacs.
+
 2009-10-14  Reiner Steib  <Reiner.Steib@gmx.de>
 
        * gnus-sum.el (gnus-remove-overlays): Add doc string and alias.
index caaaf05..874207a 100644 (file)
@@ -207,6 +207,10 @@ fixed in Emacs 22."
     (autoload 'Info-index-next "info" nil t)
     (autoload 'Info-menu "info" nil t)
     (autoload 'ad-add-advice "advice")
+    (unless (and (emacs-version>= 21 5)
+                (not (featurep 'sxemacs)))
+      ;; calendar/auto-autoloads.el provides it.
+      (autoload 'add-to-invisibility-spec "dummy"))
     (autoload 'annotations-at "annotations")
     (autoload 'apropos "apropos" nil t)
     (autoload 'apropos-command "apropos" nil t)
index 67e86d1..642ed3d 100644 (file)
@@ -11282,9 +11282,9 @@ If ARG is positive number, turn showing conversation threads on."
   (defun gnus-remove-overlays (beg end name val)
     "Clear BEG and END of overlays whose property NAME has value VAL.
 For compatibility with Emacs 21 and XEmacs."
-    (dolist (ov (overlays-in beg end))
-      (when (overlay-get ov val)
-       (delete-overlay ov)))))
+    (dolist (ov (gnus-overlays-in beg end))
+      (when (eq (gnus-overlay-get ov name) val)
+       (gnus-delete-overlay ov)))))
 
 (defun gnus-summary-show-all-threads ()
   "Show all threads."
@@ -11301,8 +11301,16 @@ Returns nil if no thread was there to be shown."
        ;; Leave point at bol
          (beg (progn (beginning-of-line) (if (bobp) (point) (1- (point)))))
          (eoi (when (eq (get-char-property end 'invisible) 'gnus-sum)
-                (or (next-single-char-property-change end 'invisible)
-                    (point-max)))))
+               (if (fboundp 'next-single-char-property-change)
+                   (or (next-single-char-property-change end 'invisible)
+                       (point-max))
+                 (goto-char end)
+                 (while (progn
+                          (end-of-line 2)
+                          (and (not (eobp))
+                               (eq (get-char-property (point) 'invisible)
+                                   'gnus-sum))))
+                 (point)))))
     (when eoi
       (gnus-remove-overlays beg eoi 'invisible 'gnus-sum)
       (goto-char orig)
@@ -11370,9 +11378,9 @@ Returns nil if no threads were there to be hidden."
              (progn
             (when (> (point) starteol)
               (gnus-remove-overlays starteol (point) 'invisible 'gnus-sum)
-              (let ((ol (make-overlay starteol (point) nil t nil)))
-                (overlay-put ol 'invisible 'gnus-sum)
-                (overlay-put ol 'evaporate t)))
+              (let ((ol (gnus-make-overlay starteol (point) nil t nil)))
+               (gnus-overlay-put ol 'invisible 'gnus-sum)
+               (gnus-overlay-put ol 'evaporate t)))
                (gnus-summary-goto-subject article))
            (goto-char start)
         nil))))
index 2389ea4..008d588 100644 (file)
@@ -224,6 +224,10 @@ call it with the value of the `gnus-data' text property."
                 (delete-extent extent)
                 nil)))
 
+(defun gnus-xmas-overlays-in (beg end)
+  "Return a list of the extents that overlap the region BEG ... END."
+  (mapcar-extents #'identity nil nil beg end))
+
 (defun gnus-xmas-window-top-edge (&optional window)
   (nth 1 (window-pixel-edges window)))
 
@@ -410,11 +414,13 @@ FRONT-ADVANCE and REAR-ADVANCE are ignored."
       (make-extent beg end buffer)))
 
   (defalias 'gnus-delete-overlay 'delete-extent)
+  (defalias 'gnus-overlay-get 'extent-property)
   (defalias 'gnus-overlay-put 'set-extent-property)
   (defalias 'gnus-move-overlay 'gnus-xmas-move-overlay)
   (defalias 'gnus-overlay-buffer 'extent-object)
   (defalias 'gnus-overlay-start 'extent-start-position)
   (defalias 'gnus-overlay-end 'extent-end-position)
+  (defalias 'gnus-overlays-in 'gnus-xmas-overlays-in)
   (defalias 'gnus-kill-all-overlays 'gnus-xmas-kill-all-overlays)
   (defalias 'gnus-extent-detached-p 'extent-detached-p)
   (defalias 'gnus-add-text-properties 'gnus-xmas-add-text-properties)
index ec72817..0773984 100644 (file)
@@ -318,11 +318,13 @@ be set in `.emacs' instead."
 (unless (featurep 'gnus-xmas)
   (defalias 'gnus-make-overlay 'make-overlay)
   (defalias 'gnus-delete-overlay 'delete-overlay)
+  (defalias 'gnus-overlay-get 'overlay-get)
   (defalias 'gnus-overlay-put 'overlay-put)
   (defalias 'gnus-move-overlay 'move-overlay)
   (defalias 'gnus-overlay-buffer 'overlay-buffer)
   (defalias 'gnus-overlay-start 'overlay-start)
   (defalias 'gnus-overlay-end 'overlay-end)
+  (defalias 'gnus-overlays-in 'overlays-in)
   (defalias 'gnus-extent-detached-p 'ignore)
   (defalias 'gnus-extent-start-open 'ignore)
   (defalias 'gnus-mail-strip-quoted-names 'mail-strip-quoted-names)
index 74aa3ed..b88667a 100644 (file)
@@ -85,8 +85,9 @@
     (maybe-fbind
      '(custom-autoload
        decode-char display-graphic-p display-images-p display-visual-class
-       get-display-table put-display-table select-frame-set-input-focus
-       unicode-precedence-list unicode-to-char w32-focus-frame x-focus-frame))
+       get-display-table next-single-char-property-change put-display-table
+       select-frame-set-input-focus unicode-precedence-list unicode-to-char
+       w32-focus-frame x-focus-frame))
     (maybe-bind
      '(default-file-name-coding-system scroll-margin)))