aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJan Djärv <[email protected]>2007-09-02 16:51:22 +0000
committerJan Djärv <[email protected]>2007-09-02 16:51:22 +0000
commit5db55b9e50a9b498b1ac3a8cf28202783464a40a (patch)
treea87344c3478e6c7cfc077d83a7f60c4c4778bd24 /lisp
parent2154c9647a473689a392875d8bfa307a5694ff38 (diff)
(x-gtk-stock-map): Map diropen to system-file-manager.
(icon-map-list): New variable. (x-gtk-map-stock): Use icon-map-list.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/term/x-win.el26
2 files changed, 29 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 51b087327e..fa58cca220 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2007-09-02 Jan Dj,Ad(Brv <[email protected]>
+
+ * term/x-win.el (x-gtk-stock-map): Map diropen to system-file-manager.
+ (icon-map-list): New variable.
+ (x-gtk-map-stock): Use icon-map-list.
+
2007-09-02 Romain Francoise <[email protected]>
* log-view.el (log-view-current-file): Balance parens.
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index bde34f4b0d..259e4e0dfa 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -2569,7 +2569,7 @@ order until succeed.")
'(
("etc/images/new" . "gtk-new")
("etc/images/open" . "gtk-open")
- ("etc/images/diropen" . "gtk-directory")
+ ("etc/images/diropen" . "n:system-file-manager")
("etc/images/close" . "gtk-close")
("etc/images/save" . "gtk-save")
("etc/images/saveas" . "gtk-save-as")
@@ -2589,17 +2589,37 @@ order until succeed.")
("etc/images/search" . "gtk-find")
("etc/images/exit" . "gtk-quit"))
"How icons for tool bars are mapped to Gtk+ stock items.
-Emacs must be compiled with the Gtk+ toolkit for this to have any effect."
+Emacs must be compiled with the Gtk+ toolkit for this to have any effect.
+A value that begins with n: denotes a named icon instead of a stock icon."
:version "23.1"
:type 'alist
:group 'x)
+(defvar icon-map-list '(x-gtk-stock-map)
+ "*A list of alists that maps icon file names to stock/named icons.
+The alists are searched in the order they appear. The first match is used.
+The keys in the alists are file names without extension and with two directory
+components. For example, to map /usr/share/emacs/22.1.1/etc/images/open.xpm
+to stock item gtk-open, use:
+
+ (\"etc/images/open\" . \"gtk-open\")
+
+Themes also have named icons. To map to one of those, use n: before the name:
+
+ (\"etc/images/diropen\" . \"n:system-file-manager\")
+
+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 (assoc-string (or key file-sans) x-gtk-stock-map)))
+ (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))))
(provide 'x-win)