emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp/gnus gnus.el gnus-sum.el ChangeLog


From: Katsumi Yamaoka
Subject: [Emacs-diffs] emacs/lisp/gnus gnus.el gnus-sum.el ChangeLog
Date: Mon, 19 Oct 2009 23:21:05 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Katsumi Yamaoka <yamaoka>       09/10/19 23:21:05

Modified files:
        lisp/gnus      : gnus.el gnus-sum.el ChangeLog 

Log message:
        Synch with Gnus trunk:
        2009-10-19  Katsumi Yamaoka  <address@hidden>
        
         * gnus-sum.el (gnus-summary-show-thread): Remove useless goto-char.
         (gnus-summary-show-thread, gnus-summary-hide-thread): Indent.
        
        2009-10-16  Katsumi Yamaoka  <address@hidden>
        
         * 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.
        
        2009-10-14  Reiner Steib  <address@hidden>
        
         * gnus-sum.el (gnus-remove-overlays): Add doc string and alias.
        
        2009-10-14  Dan Nicolaescu  <address@hidden>
        
         * gnus-sum.el (gnus-remove-overlays): Compatibility code for Emacs 21
         and XEmacs that don't have `remove-overlays'.
        
        2009-10-14  Stefan Monnier  <address@hidden>
        
         * gnus-sum.el (gnus-summary-mode, gnus-summary-show-all-threads)
         (gnus-summary-show-thread, gnus-summary-hide-thread): Get rid of
         selective display.  Use overlays instead.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/gnus/gnus.el?cvsroot=emacs&r1=1.80&r2=1.81
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/gnus/gnus-sum.el?cvsroot=emacs&r1=1.143&r2=1.144
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/gnus/ChangeLog?cvsroot=emacs&r1=1.834&r2=1.835

Patches:
Index: gnus.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/gnus/gnus.el,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -b -r1.80 -r1.81
--- gnus.el     2 Sep 2009 03:04:17 -0000       1.80
+++ gnus.el     19 Oct 2009 23:21:04 -0000      1.81
@@ -318,11 +318,13 @@
 (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: gnus-sum.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/gnus/gnus-sum.el,v
retrieving revision 1.143
retrieving revision 1.144
diff -u -b -r1.143 -r1.144
--- gnus-sum.el 2 Sep 2009 03:29:50 -0000       1.143
+++ gnus-sum.el 19 Oct 2009 23:21:04 -0000      1.144
@@ -3069,8 +3069,7 @@
   (setq buffer-read-only t             ;Disable modification
        show-trailing-whitespace nil)
   (setq truncate-lines t)
-  (setq selective-display t)
-  (setq selective-display-ellipses t)  ;Display `...'
+  (add-to-invisibility-spec '(gnus-sum . t))
   (gnus-summary-set-display-table)
   (gnus-set-default-directory)
   (make-local-variable 'gnus-summary-line-format)
@@ -11278,29 +11277,44 @@
     (gnus-message 6 "Threading is now %s" (if gnus-show-threads "on" "off"))
     (gnus-summary-position-point)))
 
+(if (fboundp 'remove-overlays)
+    (defalias 'gnus-remove-overlays 'remove-overlays)
+  (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 (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."
   (interactive)
-  (save-excursion
-    (let ((buffer-read-only nil))
-      (subst-char-in-region (point-min) (point-max) ?\^M ?\n t)))
+  (gnus-remove-overlays (point-min) (point-max) 'invisible 'gnus-sum)
   (gnus-summary-position-point))
 
 (defun gnus-summary-show-thread ()
   "Show thread subtrees.
 Returns nil if no thread was there to be shown."
   (interactive)
-  (let ((buffer-read-only nil)
-       (orig (point))
+  (let* ((orig (point))
        (end (point-at-eol))
        ;; Leave point at bol
-       (beg (progn (beginning-of-line) (point))))
-    (prog1
-       ;; Any hidden lines here?
-       (search-forward "\r" end t)
-      (subst-char-in-region beg end ?\^M ?\n t)
+        (beg (progn (beginning-of-line) (if (bobp) (point) (1- (point)))))
+        (eoi (when (eq (get-char-property end 'invisible) 'gnus-sum)
+               (if (fboundp 'next-single-char-property-change)
+                   (or (next-single-char-property-change end 'invisible)
+                       (point-max))
+                 (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)
-      (gnus-summary-position-point))))
+      (gnus-summary-position-point)
+      eoi)))
 
 (defun gnus-summary-maybe-hide-threads ()
   "If requested, hide the threads that should be hidden."
@@ -11349,22 +11363,26 @@
 will not be hidden.
 Returns nil if no threads were there to be hidden."
   (interactive)
-  (let ((buffer-read-only nil)
-       (start (point))
+  (let ((start (point))
+       (starteol (line-end-position))
        (article (gnus-summary-article-number)))
     (goto-char start)
     ;; Go forward until either the buffer ends or the subthread ends.
     (when (and (not (eobp))
               (or (zerop (gnus-summary-next-thread 1 t))
                   (goto-char (point-max))))
-      (prog1
          (if (and (> (point) start)
+              ;; FIXME: this should actually search for a non-invisible \n.
                   (search-backward "\n" start t))
              (progn
-               (subst-char-in-region start (point) ?\n ?\^M)
+           (when (> (point) starteol)
+             (gnus-remove-overlays starteol (point) 'invisible 'gnus-sum)
+             (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)))))
+       nil))))
 
 (defun gnus-summary-go-to-next-thread (&optional previous)
   "Go to the same level (or less) next thread.

Index: ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/gnus/ChangeLog,v
retrieving revision 1.834
retrieving revision 1.835
diff -u -b -r1.834 -r1.835
--- ChangeLog   4 Oct 2009 01:32:08 -0000       1.834
+++ ChangeLog   19 Oct 2009 23:21:05 -0000      1.835
@@ -1,3 +1,34 @@
+2009-10-19  Katsumi Yamaoka  <address@hidden>
+
+       * gnus-sum.el (gnus-summary-show-thread): Remove useless goto-char.
+       (gnus-summary-show-thread, gnus-summary-hide-thread): Indent.
+
+2009-10-16  Katsumi Yamaoka  <address@hidden>
+
+       * 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.
+
+2009-10-14  Reiner Steib  <address@hidden>
+
+       * gnus-sum.el (gnus-remove-overlays): Add doc string and alias.
+
+2009-10-14  Dan Nicolaescu  <address@hidden>
+
+       * gnus-sum.el (gnus-remove-overlays): Compatibility code for Emacs 21
+       and XEmacs that don't have `remove-overlays'.
+
+2009-10-14  Stefan Monnier  <address@hidden>
+
+       * gnus-sum.el (gnus-summary-mode, gnus-summary-show-all-threads)
+       (gnus-summary-show-thread, gnus-summary-hide-thread): Get rid of
+       selective display.  Use overlays instead.
+
 2009-10-04  Juanma Barranquero  <address@hidden>
 
        * spam-stat.el (spam-stat-strip-xref): Fix typo in docstring.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]