Mercurial > hg > xemacs-beta
comparison lisp/x11/x-toolbar.el @ 173:8eaf7971accc r20-3b13
Import from CVS: tag r20-3b13
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:49:09 +0200 |
parents | 5a88923fcbfe |
children | 6075d714658b |
comparison
equal
deleted
inserted
replaced
172:a38aed19690b | 173:8eaf7971accc |
---|---|
23 ;; | 23 ;; |
24 ;; Miscellaneous toolbar functions, useful for users to redefine, in | 24 ;; Miscellaneous toolbar functions, useful for users to redefine, in |
25 ;; order to get different behaviour. | 25 ;; order to get different behaviour. |
26 ;; | 26 ;; |
27 | 27 |
28 (eval-when-compile | |
29 (require 'pending-del)) | |
30 | |
28 (defgroup toolbar nil | 31 (defgroup toolbar nil |
29 "Configure XEmacs Toolbar functions and properties" | 32 "Configure XEmacs Toolbar functions and properties" |
30 :group 'environment) | 33 :group 'environment) |
31 | 34 |
32 (defcustom toolbar-open-function 'find-file | 35 (defcustom toolbar-open-function 'find-file |
95 (function :tag "Other")) | 98 (function :tag "Other")) |
96 :group 'toolbar) | 99 :group 'toolbar) |
97 | 100 |
98 (defun toolbar-paste () | 101 (defun toolbar-paste () |
99 (interactive) | 102 (interactive) |
103 ;; This horrible kludge is for pending-delete to work correctly. | |
104 (and (boundp 'pending-delete) | |
105 pending-delete | |
106 (let ((this-command toolbar-paste-function)) | |
107 (pending-delete-pre-hook))) | |
100 (call-interactively toolbar-paste-function)) | 108 (call-interactively toolbar-paste-function)) |
101 | 109 |
102 (defcustom toolbar-undo-function 'undo | 110 (defcustom toolbar-undo-function 'undo |
103 "*Function to call when the undo icon is selected." | 111 "*Function to call when the undo icon is selected." |
104 :type '(radio (function-item undo) | 112 :type '(radio (function-item undo) |
340 (toolbar-compile-icon . "compile") | 348 (toolbar-compile-icon . "compile") |
341 (toolbar-debug-icon . "debug") | 349 (toolbar-debug-icon . "debug") |
342 (toolbar-news-icon . "news"))) | 350 (toolbar-news-icon . "news"))) |
343 | 351 |
344 (defun init-x-toolbar () | 352 (defun init-x-toolbar () |
353 (toolbar-add-item-data init-x-toolbar-list ) | |
354 ;; do this now because errors will occur if the icon symbols | |
355 ;; are not initted | |
356 (set-specifier default-toolbar initial-toolbar-spec)) | |
357 | |
358 (defun toolbar-add-item-data ( icon-list &optional icon-dir ) | |
359 (if (eq icon-dir nil) | |
360 (setq icon-dir toolbar-icon-directory)) | |
345 (mapcar | 361 (mapcar |
346 (lambda (cons) | 362 (lambda (cons) |
347 (let ((prefix (expand-file-name (cdr cons) toolbar-icon-directory))) | 363 (let ((prefix (expand-file-name (cdr cons) icon-dir))) |
348 (set (car cons) | 364 (set (car cons) |
349 (if (featurep 'xpm) | 365 (if (featurep 'xpm) |
350 (toolbar-make-button-list | 366 (toolbar-make-button-list |
351 (concat prefix "-up.xpm") | 367 (concat prefix "-up.xpm") |
352 nil | 368 nil |
357 (toolbar-make-button-list | 373 (toolbar-make-button-list |
358 (concat prefix "-up.xbm") | 374 (concat prefix "-up.xbm") |
359 (concat prefix "-dn.xbm") | 375 (concat prefix "-dn.xbm") |
360 (concat prefix "-xx.xbm") | 376 (concat prefix "-xx.xbm") |
361 ))))) | 377 ))))) |
362 init-x-toolbar-list) | 378 icon-list ) |
363 ;; do this now because errors will occur if the icon symbols | 379 ) |
364 ;; are not initted | 380 |
365 (set-specifier default-toolbar initial-toolbar-spec)) | |
366 | |
367 (defvar initial-toolbar-spec | 381 (defvar initial-toolbar-spec |
368 '(;;[toolbar-last-win-icon pop-window-configuration | 382 '(;;[toolbar-last-win-icon pop-window-configuration |
369 ;;(frame-property (selected-frame) | 383 ;;(frame-property (selected-frame) |
370 ;; 'window-config-stack) t "Most recent window config"] | 384 ;; 'window-config-stack) t "Most recent window config"] |
371 ;; #### Illicit knowledge? | 385 ;; #### Illicit knowledge? |