mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-01 11:14:55 +00:00
(x-gtk-map-stock): Check if FILE is a string.
This commit is contained in:
parent
1fbf538610
commit
70b838b729
@ -1,3 +1,7 @@
|
||||
2007-11-22 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
|
||||
|
||||
* term/x-win.el (x-gtk-map-stock): Check if FILE is a string.
|
||||
|
||||
2007-11-21 Juanma Barranquero <lekktu@gmail.com>
|
||||
|
||||
* textmodes/paragraphs.el (forward-sentence): Doc fix.
|
||||
|
@ -2603,15 +2603,18 @@ The list elements are either the symbol name for the alist or the alist itself."
|
||||
|
||||
(defun x-gtk-map-stock (file)
|
||||
"Map icon with file name FILE to a Gtk+ stock name, using `x-gtk-stock-map'."
|
||||
(let* ((file-sans (file-name-sans-extension file))
|
||||
(key (and (string-match "/\\([^/]+/[^/]+/[^/]+$\\)" file-sans)
|
||||
(match-string 1 file-sans)))
|
||||
(value))
|
||||
(mapc (lambda (elem)
|
||||
(let ((assoc (if (symbolp elem) (symbol-value elem) elem)))
|
||||
(or value (setq value (assoc-string (or key file-sans) assoc)))))
|
||||
icon-map-list)
|
||||
(and value (cdr value))))
|
||||
(if (stringp file)
|
||||
(let* ((file-sans (file-name-sans-extension file))
|
||||
(key (and (string-match "/\\([^/]+/[^/]+/[^/]+$\\)" file-sans)
|
||||
(match-string 1 file-sans)))
|
||||
(value))
|
||||
(mapc (lambda (elem)
|
||||
(let ((assoc (if (symbolp elem) (symbol-value elem) elem)))
|
||||
(or value (setq value (assoc-string (or key file-sans)
|
||||
assoc)))))
|
||||
icon-map-list)
|
||||
(and value (cdr value)))
|
||||
nil))
|
||||
|
||||
;; arch-tag: f1501302-db8b-4d95-88e3-116697d89f78
|
||||
;;; x-win.el ends here
|
||||
|
Loading…
Reference in New Issue
Block a user