diff options
| author | Jan Djärv | 2007-09-02 17:00:06 +0000 |
|---|---|---|
| committer | Jan Djärv | 2007-09-02 17:00:06 +0000 |
| commit | 4b59f2d8609f171a9a875e9f1003fbb50a1d3202 (patch) | |
| tree | 4dad5214d0ece2309b6ea255ac66d05761efb47e | |
| parent | 7a079cee9f40c982af9ee699c966d576b29a9946 (diff) | |
| download | emacs-4b59f2d8609f171a9a875e9f1003fbb50a1d3202.tar.gz emacs-4b59f2d8609f171a9a875e9f1003fbb50a1d3202.zip | |
(x-gtk-stock-map, icon-map-list): New variables.
(x-gtk-map-stock): New function.
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/term/x-win.el | 57 |
2 files changed, 65 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0d92d7a0d02..ccf0fa4f624 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2007-09-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * info.el (info-tool-bar-map): Add :rtl keyword to right/left-arrow and | ||
| 4 | prev/next-node. | ||
| 5 | |||
| 6 | * term/x-win.el (x-gtk-stock-map, icon-map-list): New variables. | ||
| 7 | (x-gtk-map-stock): New function. | ||
| 8 | |||
| 1 | 2007-09-02 Glenn Morris <rgm@gnu.org> | 9 | 2007-09-02 Glenn Morris <rgm@gnu.org> |
| 2 | 10 | ||
| 3 | * comint.el (comint-mode): Don't set scroll-conservatively. | 11 | * comint.el (comint-mode): Don't set scroll-conservatively. |
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index a3fad5894fa..34fa275b8b5 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el | |||
| @@ -2556,5 +2556,62 @@ order until succeed.") | |||
| 2556 | (and (fboundp 'menu-bar-open) | 2556 | (and (fboundp 'menu-bar-open) |
| 2557 | (global-set-key [f10] 'x-menu-bar-open)) | 2557 | (global-set-key [f10] 'x-menu-bar-open)) |
| 2558 | 2558 | ||
| 2559 | (defcustom x-gtk-stock-map | ||
| 2560 | '( | ||
| 2561 | ("etc/images/new" . "gtk-new") | ||
| 2562 | ("etc/images/open" . "gtk-open") | ||
| 2563 | ("etc/images/diropen" . "n:system-file-manager") | ||
| 2564 | ("etc/images/close" . "gtk-close") | ||
| 2565 | ("etc/images/save" . "gtk-save") | ||
| 2566 | ("etc/images/saveas" . "gtk-save-as") | ||
| 2567 | ("etc/images/undo" . "gtk-undo") | ||
| 2568 | ("etc/images/cut" . "gtk-cut") | ||
| 2569 | ("etc/images/copy" . "gtk-copy") | ||
| 2570 | ("etc/images/paste" . "gtk-paste") | ||
| 2571 | ("etc/images/search" . "gtk-find") | ||
| 2572 | ("etc/images/print" . "gtk-print") | ||
| 2573 | ("etc/images/preferences" . "gtk-preferences") | ||
| 2574 | ("etc/images/help" . "gtk-help") | ||
| 2575 | ("etc/images/left-arrow" . "gtk-go-back") | ||
| 2576 | ("etc/images/right-arrow" . "gtk-go-forward") | ||
| 2577 | ("etc/images/home" . "gtk-home") | ||
| 2578 | ("etc/images/jump-to" . "gtk-jump-to") | ||
| 2579 | ("etc/images/index" . "gtk-index") | ||
| 2580 | ("etc/images/search" . "gtk-find") | ||
| 2581 | ("etc/images/exit" . "gtk-quit")) | ||
| 2582 | "How icons for tool bars are mapped to Gtk+ stock items. | ||
| 2583 | Emacs must be compiled with the Gtk+ toolkit for this to have any effect. | ||
| 2584 | A value that begins with n: denotes a named icon instead of a stock icon." | ||
| 2585 | :version "23.1" | ||
| 2586 | :type 'alist | ||
| 2587 | :group 'x) | ||
| 2588 | |||
| 2589 | (defvar icon-map-list '(x-gtk-stock-map) | ||
| 2590 | "*A list of alists that maps icon file names to stock/named icons. | ||
| 2591 | The alists are searched in the order they appear. The first match is used. | ||
| 2592 | The keys in the alists are file names without extension and with two directory | ||
| 2593 | components. For example, to map /usr/share/emacs/22.1.1/etc/images/open.xpm | ||
| 2594 | to stock item gtk-open, use: | ||
| 2595 | |||
| 2596 | (\"etc/images/open\" . \"gtk-open\") | ||
| 2597 | |||
| 2598 | Themes also have named icons. To map to one of those, use n: before the name: | ||
| 2599 | |||
| 2600 | (\"etc/images/diropen\" . \"n:system-file-manager\") | ||
| 2601 | |||
| 2602 | The list elements are either the symbol name for the alist or the alist itself.") | ||
| 2603 | |||
| 2604 | (defun x-gtk-map-stock (file) | ||
| 2605 | "Map icon with file name FILE to a Gtk+ stock name, using `x-gtk-stock-map'." | ||
| 2606 | (let* ((file-sans (file-name-sans-extension file)) | ||
| 2607 | (key (and (string-match "/\\([^/]+/[^/]+/[^/]+$\\)" file-sans) | ||
| 2608 | (match-string 1 file-sans))) | ||
| 2609 | (value)) | ||
| 2610 | (mapc (lambda (elem) | ||
| 2611 | (let ((assoc (if (symbolp elem) (symbol-value elem) elem))) | ||
| 2612 | (or value (setq value (assoc-string (or key file-sans) assoc))))) | ||
| 2613 | icon-map-list) | ||
| 2614 | (and value (cdr value)))) | ||
| 2615 | |||
| 2559 | ;; arch-tag: f1501302-db8b-4d95-88e3-116697d89f78 | 2616 | ;; arch-tag: f1501302-db8b-4d95-88e3-116697d89f78 |
| 2560 | ;;; x-win.el ends here | 2617 | ;;; x-win.el ends here |