[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-commit] emacs/lisp/mh-e mh-utils.el mh-letter.el mh-fol...
From: |
Bill Wohler |
Subject: |
[Emacs-commit] emacs/lisp/mh-e mh-utils.el mh-letter.el mh-fol... |
Date: |
Tue, 14 Mar 2006 19:21:48 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Branch:
Changes by: Bill Wohler <address@hidden> 06/03/14 19:21:48
Modified files:
lisp/mh-e : mh-utils.el mh-letter.el mh-folder.el mh-e.el
mh-compat.el ChangeLog
Log message:
* mh-compat.el (mh-image-load-path-for-library): Incorporate changes
from image-load-path-for-library, which are:
(image-load-path-for-library): Pass value of path rather than symbol.
Always return list of directories. Guarantee that image directory
comes first.
* mh-e.el (image-load-path): Define on those Emacsen that lack it to
avoid compile and run-time errors.
* mh-folder.el (mh-folder-mode): Use new idiom for setting
image-load-path.
* mh-letter.el (mh-letter-mode): Ditto.
* mh-utils.el (mh-logo-display): Ditto.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/lisp/mh-e/mh-utils.el.diff?tr1=1.61&tr2=1.62&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/lisp/mh-e/mh-letter.el.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/lisp/mh-e/mh-folder.el.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/lisp/mh-e/mh-e.el.diff?tr1=1.80&tr2=1.81&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/lisp/mh-e/mh-compat.el.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/lisp/mh-e/ChangeLog.diff?tr1=1.180&tr2=1.181&r1=text&r2=text
Patches:
Index: emacs/lisp/mh-e/ChangeLog
diff -u emacs/lisp/mh-e/ChangeLog:1.180 emacs/lisp/mh-e/ChangeLog:1.181
--- emacs/lisp/mh-e/ChangeLog:1.180 Mon Mar 13 01:05:27 2006
+++ emacs/lisp/mh-e/ChangeLog Tue Mar 14 19:21:48 2006
@@ -1,3 +1,21 @@
+2006-03-14 Bill Wohler <address@hidden>
+
+ * mh-compat.el (mh-image-load-path-for-library): Incorporate
+ changes from image-load-path-for-library, which are:
+ (image-load-path-for-library): Pass value of path rather than
+ symbol. Always return list of directories. Guarantee that image
+ directory comes first.
+
+ * mh-e.el (image-load-path): Define on those Emacsen that lack it
+ to avoid compile and run-time errors.
+
+ * mh-folder.el (mh-folder-mode): Use new idiom for setting
+ image-load-path.
+
+ * mh-letter.el (mh-letter-mode): Ditto.
+
+ * mh-utils.el (mh-logo-display): Ditto.
+
2006-03-12 Bill Wohler <address@hidden>
* mh-utils.el (mh-folder-list): Fix docstring (closes SF
Index: emacs/lisp/mh-e/mh-compat.el
diff -u emacs/lisp/mh-e/mh-compat.el:1.11 emacs/lisp/mh-e/mh-compat.el:1.12
--- emacs/lisp/mh-e/mh-compat.el:1.11 Sat Mar 11 01:59:13 2006
+++ emacs/lisp/mh-e/mh-compat.el Tue Mar 14 19:21:48 2006
@@ -119,30 +119,30 @@
image-load-path-for-library (library image &optional path no-error)
"Return a suitable search path for images relative to LIBRARY.
-Images for LIBRARY are searched for in \"../../etc/images\" and
-\"../etc/images\" relative to the files in \"lisp/LIBRARY\" as
-well as in `image-load-path' and `load-path'.
-
-This function returns the value of `load-path' augmented with the
-directory containing IMAGE. If PATH is given, it is used instead
-of `load-path'. If PATH is t, just return the directory that
-contains IMAGE.
-
-If NO-ERROR is non-nil, return nil if a suitable path can't be
-found rather than signaling an error.
+First it searches for IMAGE in a path suitable for LIBRARY, which
+includes \"../../etc/images\" and \"../etc/images\" relative to
+the library file itself, followed by `image-load-path' and
+`load-path'.
+
+Then this function returns a list of directories which contains
+first the directory in which IMAGE was found, followed by the
+value of `load-path'. If PATH is given, it is used instead of
+`load-path'.
+
+If NO-ERROR is non-nil and a suitable path can't be found, don't
+signal an error. Instead, return a list of directories as before,
+except that nil appears in place of the image directory.
Here is an example that uses a common idiom to provide
compatibility with versions of Emacs that lack the variable
`image-load-path':
- (let ((load-path
- (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\"))
- (image-load-path
- (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\"
'image-load-path)))
- (mh-tool-bar-folder-buttons-init))
+ ;; Avoid errors on Emacsen without `image-load-path'.
+ (if (not (boundp 'image-load-path)) (defvar image-load-path nil))
-This function is used by Emacs versions that don't have
-`image-load-path-for-library'."
+ (let* ((load-path (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\"))
+ (image-load-path (cons (car load-path) image-load-path)))
+ (mh-tool-bar-folder-buttons-init))"
(unless library (error "No library specified"))
(unless image (error "No image specified"))
(let ((image-directory))
@@ -184,26 +184,13 @@
dir (expand-file-name "../" dir)))
(setq image-directory dir)))))
(no-error
- ;; In this case we will return nil.
(message "Could not find image %s for library %s" image library))
(t
(error "Could not find image %s for library %s" image library)))
- ;; Return the directory, nil if no-error was non-nil and a
- ;; suitable path could not be found, or an augmented
- ;; `image-load-path' or `load-path'.
- (cond ((or (null image-directory)
- (eq path t))
- image-directory)
- ((and path (symbolp path))
- (nconc (list image-directory)
- (delete image-directory
- (if (boundp path)
- (copy-sequence (symbol-value path))
- nil))))
- (t
- (nconc (list image-directory)
- (delete image-directory (copy-sequence load-path)))))))
+ ;; Return an augmented `path' or `load-path'.
+ (nconc (list image-directory)
+ (delete image-directory (copy-sequence (or path load-path))))))
(mh-defun-compat mh-image-search-load-path
image-search-load-path (file &optional path)
Index: emacs/lisp/mh-e/mh-e.el
diff -u emacs/lisp/mh-e/mh-e.el:1.80 emacs/lisp/mh-e/mh-e.el:1.81
--- emacs/lisp/mh-e/mh-e.el:1.80 Fri Mar 10 16:56:16 2006
+++ emacs/lisp/mh-e/mh-e.el Tue Mar 14 19:21:48 2006
@@ -325,6 +325,9 @@
;; Etc. (alphabetical)
+;; Avoid errors on Emacsen without image-load-path.
+(if (not (boundp 'image-load-path)) (defvar image-load-path nil))
+
(defvar mh-flists-present-flag nil
"Non-nil means that we have \"flists\".")
Index: emacs/lisp/mh-e/mh-folder.el
diff -u emacs/lisp/mh-e/mh-folder.el:1.8 emacs/lisp/mh-e/mh-folder.el:1.9
--- emacs/lisp/mh-e/mh-folder.el:1.8 Sun Mar 5 20:11:53 2006
+++ emacs/lisp/mh-e/mh-folder.el Tue Mar 14 19:21:48 2006
@@ -591,9 +591,8 @@
\\{mh-folder-mode-map}"
(mh-do-in-gnu-emacs
(unless mh-folder-buttons-init-flag
- (let ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm"))
- (image-load-path (mh-image-load-path-for-library
- "mh-e" "mh-logo.xpm" 'image-load-path)))
+ (let* ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm"))
+ (image-load-path (cons (car load-path) image-load-path)))
(mh-tool-bar-folder-buttons-init)
(setq mh-folder-buttons-init-flag t)))
(set (make-local-variable 'tool-bar-map) mh-folder-tool-bar-map))
Index: emacs/lisp/mh-e/mh-letter.el
diff -u emacs/lisp/mh-e/mh-letter.el:1.9 emacs/lisp/mh-e/mh-letter.el:1.10
--- emacs/lisp/mh-e/mh-letter.el:1.9 Sun Mar 5 20:11:53 2006
+++ emacs/lisp/mh-e/mh-letter.el Tue Mar 14 19:21:48 2006
@@ -313,9 +313,8 @@
(make-local-variable 'mh-sent-from-msg)
(mh-do-in-gnu-emacs
(unless mh-letter-buttons-init-flag
- (let ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm"))
- (image-load-path (mh-image-load-path-for-library
- "mh-e" "mh-logo.xpm" 'image-load-path)))
+ (let* ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm"))
+ (image-load-path (cons (car load-path) image-load-path)))
(mh-tool-bar-letter-buttons-init)
(setq mh-letter-buttons-init-flag t)))
(set (make-local-variable 'tool-bar-map) mh-letter-tool-bar-map))
Index: emacs/lisp/mh-e/mh-utils.el
diff -u emacs/lisp/mh-e/mh-utils.el:1.61 emacs/lisp/mh-e/mh-utils.el:1.62
--- emacs/lisp/mh-e/mh-utils.el:1.61 Mon Mar 13 01:05:27 2006
+++ emacs/lisp/mh-e/mh-utils.el Tue Mar 14 19:21:48 2006
@@ -131,9 +131,8 @@
(defun mh-logo-display ()
"Modify mode line to display MH-E logo."
(mh-do-in-gnu-emacs
- (let ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm"))
- (image-load-path (mh-image-load-path-for-library
- "mh-e" "mh-logo.xpm" 'image-load-path)))
+ (let* ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm"))
+ (image-load-path (cons (car load-path) image-load-path)))
(add-text-properties
0 2
`(display ,(or mh-logo-cache