X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fmenubar-items.el;h=088c4995ff9f35f872e824bf833bf74b3a23b1c1;hb=dedc107f8c0af33a05ff7b131c673ab71670b1cd;hp=487617a0d6f1e17b4b80d02d3359d28924939077;hpb=499b5ad5e2308fd04e3654aaa462d099f1769fd1;p=chise%2Fxemacs-chise.git- diff --git a/lisp/menubar-items.el b/lisp/menubar-items.el index 487617a..088c499 100644 --- a/lisp/menubar-items.el +++ b/lisp/menubar-items.el @@ -54,18 +54,10 @@ ;;; Code: -(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) label-length) - (list x x) - (list - (concat "..." (substring x (- label-length))) x))) - (if (<= (length list) count) - list - (butlast list (- (length list) count))))) +(defun menu-truncate-list (list n) + (if (<= (length list) n) + list + (butlast list (- (length list) n)))) (defun submenu-generate-accelerator-spec (list &optional omit-chars-list) "Add auto-generated accelerator specifications to a submenu. @@ -147,19 +139,15 @@ which will not be used as accelerators." ["Save %_As..." write-file] ["Save So%_me Buffers" save-some-buffers] "-----" - ,@(if (valid-specifier-tag-p 'msprinter) - '(["Page Set%_up..." generic-page-setup])) ["%_Print" generic-print-buffer :active (or (valid-specifier-tag-p 'msprinter) (and (not (eq system-type 'windows-nt)) - (fboundp 'lpr-region))) - :suffix (if (region-active-p) "Selection..." - (if put-buffer-names-in-file-menu (concat (buffer-name) "...") - "..."))] - ,@(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) "")])) + (fboundp 'lpr-buffer))) + :suffix (if put-buffer-names-in-file-menu (concat (buffer-name) "...") + "...")] + ["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) "")] "-----" ["%_Revert Buffer" revert-buffer :active (or buffer-file-name revert-buffer-function) @@ -238,8 +226,7 @@ which will not be used as accelerators." ("%_View" ["%_New Frame" make-frame] - ["Frame on Other Displa%_y..." make-frame-on-display - :active (fboundp 'make-frame-on-display)] + ["Frame on Other Displa%_y..." make-frame-on-display] ["%_Delete Frame" delete-frame :active (not (eq (next-frame (selected-frame) 'nomini 'window-system) (selected-frame)))] @@ -441,11 +428,10 @@ which will not be used as accelerators." menu (let ((items (submenu-generate-accelerator-spec - (mapcar #'(lambda (label-value) - (vector (first label-value) - (list 'grep (second label-value)))) - (Menubar-items-truncate-history - grep-history 10 50))))) + (mapcar #'(lambda (string) + (vector string + (list 'grep string))) + (menu-truncate-list grep-history 10))))) (append menu '("---") items)))) ["%_Grep..." grep :active (fboundp 'grep)] ["%_Kill Grep" kill-compilation @@ -550,11 +536,10 @@ which will not be used as accelerators." menu (let ((items (submenu-generate-accelerator-spec - (mapcar #'(lambda (label-value) - (vector (first label-value) - (list 'compile (second label-value)))) - (Menubar-items-truncate-history - compile-history 10 50))))) + (mapcar #'(lambda (string) + (vector string + (list 'compile string))) + (menu-truncate-list compile-history 10))))) (append menu '("---") items)))) ["%_Compile..." compile :active (fboundp 'compile)] ["%_Repeat Compilation" recompile :active (fboundp 'recompile)] @@ -718,10 +703,16 @@ which will not be used as accelerators." :style toggle :selected (and (boundp 'pending-delete-mode) pending-delete-mode) :active (boundp 'pending-delete-mode)] - ["`%_kill-line' Kills Whole Line at %_Beg" - (customize-set-variable 'kill-whole-line (not kill-whole-line)) - :style toggle - :selected kill-whole-line] + ("`%_kill-line' Behavior..." + ["Kill %_Whole Line" + (customize-set-variable 'kill-whole-line 'always) + :style radio :selected (eq kill-whole-line 'always)] + ["Kill to %_End of Line" + (customize-set-variable 'kill-whole-line nil) + :style radio :selected (eq kill-whole-line nil)] + ["Kill Whole Line at %_Beg, Otherwise to End" + (customize-set-variable 'kill-whole-line t) + :style radio :selected (eq kill-whole-line t)]) ["Size for %_Block-Movement Commands..." (customize-set-variable 'block-movement-size (read-number "Block Movement Size: " @@ -733,17 +724,6 @@ which will not be used as accelerators." :style toggle :selected (and (boundp 'viper-mode) viper-mode) :active (fboundp 'toggle-viper-mode)] "----" - ["S%_hifted Motion Keys Select Region" - (customize-set-variable 'shifted-motion-keys-select-region - (not shifted-motion-keys-select-region)) - :style toggle - :selected shifted-motion-keys-select-region] - ["%_After Shifted Motion, Unshifted Motion Keys Deselect" - (customize-set-variable 'unshifted-motion-keys-deselect-region - (not unshifted-motion-keys-deselect-region)) - :style toggle - :selected unshifted-motion-keys-deselect-region] - "----" ["%_Set Key..." global-set-key] ["%_Unset Key..." global-unset-key] "---" @@ -897,14 +877,6 @@ 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) @@ -960,66 +932,14 @@ 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))] - ["%_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" + ["%_Kfm" (customize-set-variable 'browse-url-browser-function - 'browse-url-generic) + 'browse-url-kfm) :style radio :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-generic)) + (eq browse-url-browser-function 'browse-url-kfm)) :active (and (boundp 'browse-url-browser-function) - (boundp 'browse-url-generic-program) - browse-url-generic-program - (fboundp 'browse-url-generic))] + (fboundp 'browse-url-kfm))] )) ("%_Troubleshooting" ["%_Debug on Error" @@ -1497,7 +1417,7 @@ which will not be used as accelerators." ("%_Help" ["%_About XEmacs..." about-xemacs] "-----" - ["What's %_New in XEmacs" view-emacs-news] + ["XEmacs %_News" view-emacs-news] ["%_Obtaining XEmacs" describe-distribution] "-----" ("%_Info (Online Docs)" @@ -1515,18 +1435,13 @@ which will not be used as accelerators." ("%_Tutorials" :filter tutorials-menu-filter) ("%_Samples" - ["Sample %_init.el" - (find-file (locate-data-file "sample.init.el")) - :active (locate-data-file "sample.init.el")] - ["Sample .%_gtkrc" - (find-file (locate-data-file "sample.gtkrc")) - :included (featurep 'gtk) - :active (locate-data-file "sample.gtkrc")] + ["Sample .%_emacs" + (find-file (locate-data-file "sample.emacs")) + :active (locate-data-file "sample.emacs")] ["Sample .%_Xdefaults" (find-file (locate-data-file "sample.Xdefaults")) - :included (featurep 'x) :active (locate-data-file "sample.Xdefaults")] - ["Sample %_enriched" + ["Sample e%_nriched" (find-file (locate-data-file "enriched.doc")) :active (locate-data-file "enriched.doc")]) ("%_Commands & Keys" @@ -1552,8 +1467,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-xemacs-bug - :active (fboundp 'report-xemacs-bug)]))) + ["Send %_Bug Report..." report-emacs-bug + :active (fboundp 'report-emacs-bug)]))) (defun maybe-add-init-button ()