From 9934a10e5b0d61a1f7d8bf93d11798b8ef988361 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 15 Mar 2006 22:05:25 +0000 Subject: [PATCH] Synch to No Gnus 200603151423. --- lisp/ChangeLog | 14 ++++++++++++++ lisp/gmm-utils.el | 54 ++++++++++++++++++++++------------------------------ lisp/gnus-group.el | 9 +++++---- lisp/gnus-sum.el | 9 +++++---- lisp/message.el | 17 +++++++++-------- 5 files changed, 56 insertions(+), 47 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index aca80a9..cdcfe89 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,17 @@ +2006-03-15 Reiner Steib + + * gmm-utils.el (gmm-image-load-path-for-library): Sync with + image.el, revision 1.59, in Emacs. Pass value of path rather than + symbol. Always return list of directories. Guarantee that image + directory comes first. + + * message.el (message-make-tool-bar): Adjust to new API of + `gmm-image-load-path-for-library'. + + * gnus-sum.el (gnus-summary-make-tool-bar): Ditto. + + * gnus-group.el (gnus-group-make-tool-bar): Ditto. + 2006-03-15 Andreas Seltenreich * gnus-art.el (gnus-article-only-boring-p): Bind diff --git a/lisp/gmm-utils.el b/lisp/gmm-utils.el index 0620ea7..5b6e049 100644 --- a/lisp/gmm-utils.el +++ b/lisp/gmm-utils.el @@ -304,30 +304,32 @@ This function returns nil on those systems." (defun gmm-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'. +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'. -This function returns the value of `load-path' augmented with the -path to IMAGE. If PATH is given, it is used instead of -`load-path'. If PATH is t, return a single image directory -instead of a 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, don't signal an error if no suitable path -can be found. +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)) + ;; Shush compiler. + (defvar image-load-path) -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) + (when (boundp 'image-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)) @@ -354,7 +356,7 @@ This function is used by Emacs versions that don't have ((let ((img image) (dir (or ;; Images in image-load-path. - (gmm-image-search-load-path image) + (gmm-image-search-load-path image) ;; "gmm-" prefix! ;; Images in load-path. (locate-library image))) parent) @@ -369,23 +371,13 @@ This function is used by Emacs versions that don't have dir (expand-file-name "../" dir))) (setq image-directory dir))))) (no-error - ;; In this case we will return a nil element - (gmm-message 1 "Could not find image %s for library %s" image library)) + (message "Could not find image %s for library %s" image library)) (t (error "Could not find image %s for library %s" image library))) - ;; Return augmented `image-load-path' or `load-path'. - (cond ((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)))))) (defun gmm-customize-mode (&optional mode) "Customize customization group for MODE. diff --git a/lisp/gnus-group.el b/lisp/gnus-group.el index 694f101..50209da 100644 --- a/lisp/gnus-group.el +++ b/lisp/gnus-group.el @@ -1122,6 +1122,8 @@ See `gmm-tool-bar-from-list' for the format of the list." :set 'gnus-group-tool-bar-update :group 'gnus-group) +(defvar image-load-path) + (defun gnus-group-make-tool-bar (&optional force) "Make a group mode tool bar from `gnus-group-tool-bar'. When FORCE, rebuild the tool bar." @@ -1135,10 +1137,9 @@ When FORCE, rebuild the tool bar." (gmm-image-load-path-for-library "gnus" "gnus/toggle-subscription.xpm" nil t)) - (image-load-path - (gmm-image-load-path-for-library "gnus" - "gnus/toggle-subscription.xpm" - 'image-load-path t)) + (image-load-path (cons (car load-path) + (when (boundp 'image-load-path) + image-load-path))) (map (gmm-tool-bar-from-list gnus-group-tool-bar gnus-group-tool-bar-zap-list 'gnus-group-mode-map))) diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index b125a4e..86a3f5d 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -2748,6 +2748,8 @@ See `gmm-tool-bar-from-list' for the format of the list." :set 'gnus-summary-tool-bar-update :group 'gnus-summary) +(defvar image-load-path) + (defun gnus-summary-make-tool-bar (&optional force) "Make a summary mode tool bar from `gnus-summary-tool-bar'. When FORCE, rebuild the tool bar." @@ -2759,10 +2761,9 @@ When FORCE, rebuild the tool bar." (gmm-image-load-path-for-library "gnus" "mail/save.xpm" nil t)) - (image-load-path - (gmm-image-load-path-for-library "gnus" - "mail/save.xpm" - 'image-load-path t)) + (image-load-path (cons (car load-path) + (when (boundp 'image-load-path) + image-load-path))) (map (gmm-tool-bar-from-list gnus-summary-tool-bar gnus-summary-tool-bar-zap-list 'gnus-summary-mode-map))) diff --git a/lisp/message.el b/lisp/message.el index cc5a210..bc01bbd 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -7516,6 +7516,8 @@ See `gmm-tool-bar-from-list' for the format of the list." :set 'message-tool-bar-update :group 'message) +(defvar image-load-path) + (defun message-make-tool-bar (&optional force) "Make a message mode tool bar from `message-tool-bar-list'. When FORCE, rebuild the tool bar." @@ -7524,14 +7526,13 @@ When FORCE, rebuild the tool bar." tool-bar-mode (or (not message-tool-bar-map) force)) (setq message-tool-bar-map - (let ((load-path - (gmm-image-load-path-for-library "message" - "mail/save-draft.xpm" - nil t)) - (image-load-path - (gmm-image-load-path-for-library "message" - "mail/save-draft.xpm" - 'image-load-path t))) + (let* ((load-path + (gmm-image-load-path-for-library "message" + "mail/save-draft.xpm" + nil t)) + (image-load-path (cons (car load-path) + (when (boundp 'image-load-path) + image-load-path)))) (gmm-tool-bar-from-list message-tool-bar message-tool-bar-zap-list 'message-mode-map)))) -- 1.7.10.4