X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fmenubar-items.el;h=7dab08ca7bb42436427856aa0dbdcaaa0196689e;hb=e714bc316e9cb4e651289624616cf86a10af4767;hp=31e54a65a721d52376b35fdd5657763f55e74f72;hpb=98a6e4055a1fa624c592ac06f79287d55196ca37;p=chise%2Fxemacs-chise.git- diff --git a/lisp/menubar-items.el b/lisp/menubar-items.el index 31e54a6..7dab08c 100644 --- a/lisp/menubar-items.el +++ b/lisp/menubar-items.el @@ -54,10 +54,12 @@ ;;; Code: -(defun menu-truncate-list (list n) - (if (<= (length list) n) - list - (butlast list (- (length list) n)))) +(defun Menubar-items-truncate-list (list n) + (mapcar #'(lambda (x) + (if (<= (length x) 50) x (concat "..." (substring x -50)))) + (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. @@ -226,7 +228,8 @@ which will not be used as accelerators." ("%_View" ["%_New Frame" make-frame] - ["Frame on Other Displa%_y..." make-frame-on-display] + ["Frame on Other Displa%_y..." make-frame-on-display + :active (fboundp 'make-frame-on-display)] ["%_Delete Frame" delete-frame :active (not (eq (next-frame (selected-frame) 'nomini 'window-system) (selected-frame)))] @@ -401,13 +404,13 @@ which will not be used as accelerators." ;; hack-o-matic, we can't force a load of package-base here ;; since it triggers dialog box interactions which we can't ;; deal with while using a menu - ("Using %_Custom" + ("Using %_Custom" :filter (lambda (&rest junk) (if package-get-base (submenu-generate-accelerator-spec (cdr (custom-menu-create 'packages))) '("Please load Package Index")))) - + ["%_Help" (Info-goto-node "(xemacs)Packages")]) ("%_Internet" ["Read Mail %_1 (VM)..." vm @@ -431,7 +434,7 @@ which will not be used as accelerators." (mapcar #'(lambda (string) (vector string (list 'grep string))) - (menu-truncate-list grep-history 10))))) + (Menubar-items-truncate-list grep-history 10))))) (append menu '("---") items)))) ["%_Grep..." grep :active (fboundp 'grep)] ["%_Kill Grep" kill-compilation @@ -539,7 +542,7 @@ which will not be used as accelerators." (mapcar #'(lambda (string) (vector string (list 'compile string))) - (menu-truncate-list compile-history 10))))) + (Menubar-items-truncate-list compile-history 10))))) (append menu '("---") items)))) ["%_Compile..." compile :active (fboundp 'compile)] ["%_Repeat Compilation" recompile :active (fboundp 'recompile)] @@ -703,16 +706,10 @@ 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' 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)]) + ["`%_kill-line' Kills Whole Line at %_Beg" + (customize-set-variable 'kill-whole-line (not kill-whole-line)) + :style toggle + :selected kill-whole-line] ["Size for %_Block-Movement Commands..." (customize-set-variable 'block-movement-size (read-number "Block Movement Size: " @@ -724,6 +721,17 @@ 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] "---" @@ -932,7 +940,7 @@ 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" + ["%_Kfm" (customize-set-variable 'browse-url-browser-function 'browse-url-kfm) :style radio @@ -940,7 +948,7 @@ which will not be used as accelerators." (eq browse-url-browser-function 'browse-url-kfm)) :active (and (boundp 'browse-url-browser-function) (fboundp 'browse-url-kfm))] - )) + )) ("%_Troubleshooting" ["%_Debug on Error" (customize-set-variable 'debug-on-error (not debug-on-error)) @@ -968,17 +976,32 @@ which will not be used as accelerators." (not scrollbars-visible-p)) :style toggle :selected scrollbars-visible-p])) - ["%_3D Modeline" - (customize-set-variable 'modeline-3d-p - (not modeline-3d-p)) - :style toggle - :selected modeline-3d-p] ["%_Wrap Long Lines" (progn;; becomes buffer-local (setq truncate-lines (not truncate-lines)) (customize-set-variable 'truncate-lines truncate-lines)) :style toggle :selected (not truncate-lines)] + "----" + ["%_3D Modeline" + (customize-set-variable 'modeline-3d-p + (not modeline-3d-p)) + :style toggle + :selected modeline-3d-p] + ("Modeline %_Horizontal Scrolling" + ["%_None" + (customize-set-variable 'modeline-scrolling-method nil) + :style radio + :selected (not modeline-scrolling-method)] + ["As %_Text" + (customize-set-variable 'modeline-scrolling-method t) + :style radio + :selected (eq modeline-scrolling-method t)] + ["As %_Scrollbar" + (customize-set-variable 'modeline-scrolling-method 'scrollbar) + :style radio + :selected (eq modeline-scrolling-method 'scrollbar)] + ) ,@(if (featurep 'toolbar) '("---" ["%_Toolbars Visible" @@ -1105,7 +1128,7 @@ which will not be used as accelerators." (not column-number-mode)) (redraw-modeline)) :style toggle :selected column-number-mode] - + ("\"Other %_Window\" Location" ["%_Always in Same Frame" (customize-set-variable @@ -1156,7 +1179,7 @@ which will not be used as accelerators." :selected (and (boundp 'gnuserv-frame) (eq gnuserv-frame t)) :active (boundp 'gnuserv-frame)] ) - ) + ) ("%_Menubars" ["%_Frame-Local Font Menu" (customize-set-variable 'font-menu-this-frame-only-p @@ -1420,13 +1443,18 @@ which will not be used as accelerators." ("%_Tutorials" :filter tutorials-menu-filter) ("%_Samples" - ["Sample .%_emacs" - (find-file (locate-data-file "sample.emacs")) - :active (locate-data-file "sample.emacs")] + ["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 .%_Xdefaults" (find-file (locate-data-file "sample.Xdefaults")) + :included (featurep 'x) :active (locate-data-file "sample.Xdefaults")] - ["Sample e%_nriched" + ["Sample %_enriched" (find-file (locate-data-file "enriched.doc")) :active (locate-data-file "enriched.doc")]) ("%_Commands & Keys"