X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fmenubar-items.el;h=487617a0d6f1e17b4b80d02d3359d28924939077;hb=b7cc79289dac1e8c0a36632863d8688c713be8a6;hp=75abd1be9483328a247a44721fa7d86a280ea0a9;hpb=02f4d2761a98c5cb9d5b423d2361160a5d8c9ee4;p=chise%2Fxemacs-chise.git.1 diff --git a/lisp/menubar-items.el b/lisp/menubar-items.el index 75abd1b..487617a 100644 --- a/lisp/menubar-items.el +++ b/lisp/menubar-items.el @@ -54,12 +54,18 @@ ;;; Code: -(defun Menubar-items-truncate-list (list n) +(defun Menubar-items-truncate-history (list count label-length) + "Truncate a history LIST to first COUNT items. +Return a list of (label value) lists with labels truncated to last +LABEL-LENGTH characters of value." (mapcar #'(lambda (x) - (if (<= (length x) 50) x (concat "..." (substring x -50)))) - (if (<= (length list) n) + (if (<= (length x) label-length) + (list x x) + (list + (concat "..." (substring x (- label-length))) x))) + (if (<= (length list) count) list - (butlast list (- (length list) n))))) + (butlast list (- (length list) count))))) (defun submenu-generate-accelerator-spec (list &optional omit-chars-list) "Add auto-generated accelerator specifications to a submenu. @@ -141,7 +147,7 @@ which will not be used as accelerators." ["Save %_As..." write-file] ["Save So%_me Buffers" save-some-buffers] "-----" - ,@(if (eq system-type 'windows-nt) + ,@(if (valid-specifier-tag-p 'msprinter) '(["Page Set%_up..." generic-page-setup])) ["%_Print" generic-print-buffer :active (or (valid-specifier-tag-p 'msprinter) @@ -150,7 +156,7 @@ which will not be used as accelerators." :suffix (if (region-active-p) "Selection..." (if put-buffer-names-in-file-menu (concat (buffer-name) "...") "..."))] - ,@(unless (eq system-type 'windows-nt) + ,@(unless (valid-specifier-tag-p 'msprinter) '(["Prett%_y-Print" ps-print-buffer-with-faces :active (fboundp 'ps-print-buffer-with-faces) :suffix (if put-buffer-names-in-file-menu (buffer-name) "")])) @@ -435,10 +441,11 @@ which will not be used as accelerators." menu (let ((items (submenu-generate-accelerator-spec - (mapcar #'(lambda (string) - (vector string - (list 'grep string))) - (Menubar-items-truncate-list grep-history 10))))) + (mapcar #'(lambda (label-value) + (vector (first label-value) + (list 'grep (second label-value)))) + (Menubar-items-truncate-history + grep-history 10 50))))) (append menu '("---") items)))) ["%_Grep..." grep :active (fboundp 'grep)] ["%_Kill Grep" kill-compilation @@ -543,10 +550,11 @@ which will not be used as accelerators." menu (let ((items (submenu-generate-accelerator-spec - (mapcar #'(lambda (string) - (vector string - (list 'compile string))) - (Menubar-items-truncate-list compile-history 10))))) + (mapcar #'(lambda (label-value) + (vector (first label-value) + (list 'compile (second label-value)))) + (Menubar-items-truncate-history + compile-history 10 50))))) (append menu '("---") items)))) ["%_Compile..." compile :active (fboundp 'compile)] ["%_Repeat Compilation" recompile :active (fboundp 'recompile)] @@ -889,6 +897,14 @@ which will not be used as accelerators." :active (and (boundp 'browse-url-browser-function) (fboundp 'browse-url-w3) (fboundp 'w3-fetch))] + ["Emacs-%_W3 (gnudoit)" + (customize-set-variable 'browse-url-browser-function 'browse-url-w3-gnudoit) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function + 'browse-url-w3-gnudoit)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-w3-gnudoit))] ["%_Netscape" (customize-set-variable 'browse-url-browser-function 'browse-url-netscape) @@ -944,14 +960,66 @@ which will not be used as accelerators." (eq browse-url-browser-function 'browse-url-grail)) :active (and (boundp 'browse-url-browser-function) (fboundp 'browse-url-grail))] - ["%_Kfm" + ["%_KDE" + (customize-set-variable 'browse-url-browser-function + 'browse-url-kde) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-kde)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-kde))] + ["Mo%_zilla" + (customize-set-variable 'browse-url-browser-function + 'browse-url-gnome-moz) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-gnome-moz)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-gnome-moz))] + ["G%_aleon" + (customize-set-variable 'browse-url-browser-function + 'browse-url-galeon) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-galeon)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-galeon))] + ["%_Opera" + (customize-set-variable 'browse-url-browser-function + 'browse-url-opera) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-opera)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-opera))] + ["%_MMM" + (customize-set-variable 'browse-url-browser-function + 'browse-url-mmm) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-mmm)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-mmm))] + ["MS-Windows Default %_Browser" + (customize-set-variable 'browse-url-browser-function + 'browse-url-default-windows-browser) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function + 'browse-url-default-windows-browser)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'mswindows-shell-execute) + (fboundp 'browse-url-default-windows-browser))] + ["G%_eneric Browser" (customize-set-variable 'browse-url-browser-function - 'browse-url-kfm) + 'browse-url-generic) :style radio :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-kfm)) + (eq browse-url-browser-function 'browse-url-generic)) :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-kfm))] + (boundp 'browse-url-generic-program) + browse-url-generic-program + (fboundp 'browse-url-generic))] )) ("%_Troubleshooting" ["%_Debug on Error" @@ -1484,8 +1552,8 @@ which will not be used as accelerators." ["Find %_Packages" finder-by-keyword] ["View %_Splash Screen" xemacs-splash-buffer] ["%_Unix Manual..." manual-entry]) - ["Send %_Bug Report..." report-emacs-bug - :active (fboundp 'report-emacs-bug)]))) + ["Send %_Bug Report..." report-xemacs-bug + :active (fboundp 'report-xemacs-bug)]))) (defun maybe-add-init-button ()