emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/gnus/gnus-ems.el,v


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/gnus/gnus-ems.el,v
Date: Sun, 28 Oct 2007 09:19:13 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Miles Bader <miles>     07/10/28 09:18:40

Index: lisp/gnus/gnus-ems.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/gnus/gnus-ems.el,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- lisp/gnus/gnus-ems.el       13 Aug 2007 13:41:19 -0000      1.27
+++ lisp/gnus/gnus-ems.el       28 Oct 2007 09:18:31 -0000      1.28
@@ -38,21 +38,17 @@
 (defvar gnus-down-mouse-2 [down-mouse-2])
 (defvar gnus-widget-button-keymap nil)
 (defvar gnus-mode-line-modified
-  (if (or (featurep 'xemacs)
-         (< emacs-major-version 20))
+  (if (featurep 'xemacs)
       '("--**-" . "-----")
     '("**" "--")))
 
 (eval-and-compile
   (autoload 'gnus-xmas-define "gnus-xmas")
   (autoload 'gnus-xmas-redefine "gnus-xmas")
-  (autoload 'appt-select-lowest-window "appt")
   (autoload 'gnus-get-buffer-create "gnus")
   (autoload 'nnheader-find-etc-directory "nnheader"))
 
 (autoload 'smiley-region "smiley")
-;; Fixme: shouldn't require message
-(autoload 'message-text-with-property "message")
 
 (defun gnus-kill-all-overlays ()
   "Delete all overlays in the current buffer."
@@ -73,12 +69,6 @@
        valstr)))
 
 (eval-and-compile
-  (defalias 'gnus-char-width
-    (if (fboundp 'char-width)
-       'char-width
-      (lambda (ch) 1)))) ;; A simple hack.
-
-(eval-and-compile
   (if (featurep 'xemacs)
       (gnus-xmas-define)
     (defvar gnus-mouse-face-prop 'mouse-face
@@ -149,6 +139,18 @@
        gnus-mouse-face-prop gnus-mouse-face)
       (insert " " gnus-tmp-subject-or-nil "\n")))))
 
+;; Clone of `appt-select-lowest-window' in appt.el.
+(defun gnus-select-lowest-window ()
+"Select the lowest window on the frame."
+  (let ((lowest-window (selected-window))
+       (bottom-edge (nth 3 (window-edges))))
+    (walk-windows (lambda (w)
+                   (let ((next-bottom-edge (nth 3 (window-edges w))))
+                     (when (< bottom-edge next-bottom-edge)
+                       (setq bottom-edge next-bottom-edge
+                             lowest-window w)))))
+    (select-window lowest-window)))
+
 (defun gnus-region-active-p ()
   "Say whether the region is active."
   (and (boundp 'transient-mark-mode)
@@ -160,16 +162,6 @@
   "Non-nil means the mark and region are currently active in this buffer."
   mark-active) ; aliased to region-exists-p in XEmacs.
 
-(if (fboundp 'add-minor-mode)
-    (defalias 'gnus-add-minor-mode 'add-minor-mode)
-  (defun gnus-add-minor-mode (mode name map &rest rest)
-    (set (make-local-variable mode) t)
-    (unless (assq mode minor-mode-alist)
-      (push `(,mode ,name) minor-mode-alist))
-    (unless (assq mode minor-mode-map-alist)
-      (push (cons mode map)
-           minor-mode-map-alist))))
-
 (defun gnus-x-splash ()
   "Show a splash screen using a pixmap in the current buffer."
   (interactive)
@@ -289,13 +281,26 @@
     glyph))
 
 (defun gnus-remove-image (image &optional category)
-  (dolist (position (message-text-with-property 'display))
-    (when (and (equal (get-text-property position 'display) image)
-              (equal (get-text-property position 'gnus-image-category)
+  "Remove the image matching IMAGE and CATEGORY found first."
+  (let ((start (point-min))
+       val end)
+    (while (and (not end)
+               (or (setq val (get-text-property start 'display))
+                   (and (setq start
+                              (next-single-property-change start 'display))
+                        (setq val (get-text-property start 'display)))))
+      (setq end (or (next-single-property-change start 'display)
+                   (point-max)))
+      (if (and (equal val image)
+              (equal (get-text-property start 'gnus-image-category)
                      category))
-      (put-text-property position (1+ position) 'display nil)
-      (when (get-text-property position 'gnus-image-text-deletable)
-       (delete-region position (1+ position))))))
+         (progn
+           (put-text-property start end 'display nil)
+           (when (get-text-property start 'gnus-image-text-deletable)
+             (delete-region start end)))
+       (unless (= end (point-max))
+         (setq start end
+               end nil))))))
 
 (provide 'gnus-ems)
 




reply via email to

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