XEmacs 21.4.5 "Civil Service".
[chise/xemacs-chise.git.1] / lisp / menubar-items.el
index 088c499..ad67f0d 100644 (file)
 
 ;;; 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.
@@ -139,15 +141,19 @@ which will not be used as accelerators."
       ["Save %_As..." write-file]
       ["Save So%_me Buffers" save-some-buffers]
       "-----"
+      ,@(if (eq system-type 'windows-nt)
+         '(["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-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) "")]
+                       (fboundp 'lpr-region)))
+       :suffix (if (region-active-p) "Selection..."
+                (if put-buffer-names-in-file-menu (concat (buffer-name) "...")
+                  "..."))]
+      ,@(unless (eq system-type 'windows-nt)
+         '(["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)
@@ -226,7 +232,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)))]
@@ -431,7 +438,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 +546,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 +710,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 +725,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]
        "---"
@@ -1417,7 +1429,7 @@ which will not be used as accelerators."
      ("%_Help"
       ["%_About XEmacs..." about-xemacs]
       "-----"
-      ["XEmacs %_News" view-emacs-news]
+      ["What's %_New in XEmacs" view-emacs-news]
       ["%_Obtaining XEmacs" describe-distribution]
       "-----"
       ("%_Info (Online Docs)"
@@ -1435,13 +1447,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"
@@ -1467,8 +1484,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)])))
 
 \f
 (defun maybe-add-init-button ()