X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fmenubar-items.el;h=4439044cf3f4adb9d7052da44e64e55d4c101d59;hb=fd3b637227a2cc7bce0abebc2f314ffd2398b18c;hp=1d400ab022afb22a9773b6f3e8e651a78d875b57;hpb=d3dd71489ab2730d79536ebdc3c56cca82766e9d;p=chise%2Fxemacs-chise.git- diff --git a/lisp/menubar-items.el b/lisp/menubar-items.el index 1d400ab..4439044 100644 --- a/lisp/menubar-items.el +++ b/lisp/menubar-items.el @@ -93,17 +93,17 @@ (or buffer-undo-list pending-undo-list)) :suffix (if (or (eq last-command 'undo) (eq last-command 'advertised-undo)) - "More" "")] + "More" "")] ["Redo" redo :included (fboundp 'redo) :active (not (or (eq buffer-undo-list t) - (eq last-buffer-undo-list nil) - (not (or (eq last-buffer-undo-list buffer-undo-list) - (and (null (car-safe buffer-undo-list)) - (eq last-buffer-undo-list - (cdr-safe buffer-undo-list))))) - (or (eq buffer-undo-list pending-undo-list) - (eq (cdr buffer-undo-list) pending-undo-list)))) + (eq last-buffer-undo-list nil) + (not (or (eq last-buffer-undo-list buffer-undo-list) + (and (null (car-safe buffer-undo-list)) + (eq last-buffer-undo-list + (cdr-safe buffer-undo-list))))) + (or (eq buffer-undo-list pending-undo-list) + (eq (cdr buffer-undo-list) pending-undo-list)))) :suffix (if (eq last-command 'redo) "More" "")] ["Cut" kill-primary-selection :active (selection-owner-p)] @@ -143,7 +143,7 @@ ("Set language environment") "--" ["Toggle input method" toggle-input-method] - ["Select input method" select-input-method] + ["Select input method" set-input-method] ["Describe input method" describe-input-method] "--" ["Describe current coding systems" @@ -237,10 +237,16 @@ (package-get-download-menu))) ["Update Package Index" package-get-update-base] ["List & Install" pui-list-packages] - ("Using Custom" - ("Select" :filter (lambda (&rest junk) - (cdr (custom-menu-create 'packages)))) - ["Update" package-get-custom]) + ["Update Installed Packages" package-get-update-all] + ;; hack-o-matic, we can't force a laod of package-base here + ;; since it triggers dialog box interactions which we can't + ;; deal while using a menu + ("Using Custom" + :filter (lambda (&rest junk) + (if package-get-base + (cdr (custom-menu-create 'packages)) + '(["Please load Package Index" (lamda (&rest junk) ()) nil])))) + ["Help" (Info-goto-node "(xemacs)Packages")]) "---" @@ -628,24 +634,24 @@ (force-cursor-redisplay)) :style radio :selected (eq bar-cursor t)] - ["Bar cursor (2 pixels)" - (progn - (customize-set-variable 'bar-cursor 2) - (force-cursor-redisplay)) - :style radio - :selected (and bar-cursor (not (eq bar-cursor t)))] - "------" - ["Line Numbers" - (progn - (customize-set-variable 'line-number-mode (not line-number-mode)) - (redraw-modeline)) - :style toggle :selected line-number-mode] - ["Column Numbers" - (progn - (customize-set-variable 'column-number-mode - (not column-number-mode)) - (redraw-modeline)) - :style toggle :selected column-number-mode] + ["Bar cursor (2 pixels)" + (progn + (customize-set-variable 'bar-cursor 2) + (force-cursor-redisplay)) + :style radio + :selected (and bar-cursor (not (eq bar-cursor t)))] + "------" + ["Line Numbers" + (progn + (customize-set-variable 'line-number-mode (not line-number-mode)) + (redraw-modeline)) + :style toggle :selected line-number-mode] + ["Column Numbers" + (progn + (customize-set-variable 'column-number-mode + (not column-number-mode)) + (redraw-modeline)) + :style toggle :selected column-number-mode] ) ("Menubar Appearance" ["Buffers Menu Length..." @@ -731,6 +737,32 @@ :selected (eq default-toolbar-position 'right)] ) ))) + ,@(if (featurep 'gutter) + '(("Gutter Appearance" + ["Visible" + (customize-set-variable 'gutter-visible-p + (not gutter-visible-p)) + :style toggle + :selected gutter-visible-p] + ("Default Location" + ["Top" + (customize-set-variable 'default-gutter-position 'top) + :style radio + :selected (eq default-gutter-position 'top)] + ["Bottom" + (customize-set-variable 'default-gutter-position 'bottom) + :style radio + :selected (eq default-gutter-position 'bottom)] + ["Left" + (customize-set-variable 'default-gutter-position 'left) + :style radio + :selected (eq default-gutter-position 'left)] + ["Right" + (customize-set-variable 'default-gutter-position 'right) + :style radio + :selected (eq default-gutter-position 'right)] + ) + ))) ("Mouse" ["Avoid Text..." (customize-set-variable 'mouse-avoidance-mode @@ -949,7 +981,8 @@ ["No Warranty" describe-no-warranty] ["XEmacs License" describe-copying] ["The Latest Version" describe-distribution]) - ["Send Bug Report..." report-emacs-bug])))) + ["Send Bug Report..." report-emacs-bug + :active (fboundp 'report-emacs-bug)])))) (defun maybe-add-init-button () @@ -957,7 +990,7 @@ Adds `Load .emacs' button to menubar when starting up with -q." ;; by Stig@hackvan.com (cond - (init-file-user nil) + (load-user-init-file-p nil) ((file-exists-p (expand-file-name ".emacs" "~")) (add-menu-button nil ["Load .emacs" @@ -1075,7 +1108,7 @@ returns a whole bunch of info about a buffer." 'sort-buffers-menu-by-mode-then-alphabetically "*If non-nil, a function to sort the list of buffers in the buffers menu. It will be passed two arguments (two buffers to compare) and should return -T if the first is \"less\" than the second. One possible value is +t if the first is \"less\" than the second. One possible value is `sort-buffers-menu-alphabetically'; another is `sort-buffers-menu-by-mode-then-alphabetically'." :type '(choice (const :tag "None" nil) @@ -1109,11 +1142,16 @@ Sorts the buffers in alphabetical order by name, but puts buffers beginning with a star at the end of the list." (let* ((nam1 (buffer-name buf1)) (nam2 (buffer-name buf2)) + (inv1p (not (null (string-match "\\` " nam1)))) + (inv2p (not (null (string-match "\\` " nam2)))) (star1p (not (null (string-match "\\`*" nam1)))) (star2p (not (null (string-match "\\`*" nam2))))) - (if (not (eq star1p star2p)) - (not star1p) - (string-lessp nam1 nam2)))) + (cond ((not (eq inv1p inv2p)) + (not inv1p)) + ((not (eq star1p star2p)) + (not star1p)) + (t + (string-lessp nam1 nam2))))) (defun sort-buffers-menu-by-mode-then-alphabetically (buf1 buf2) "For use as a value of `buffers-menu-sort-function'. @@ -1121,15 +1159,23 @@ Sorts first by major mode and then alphabetically by name, but puts buffers beginning with a star at the end of the list." (let* ((nam1 (buffer-name buf1)) (nam2 (buffer-name buf2)) + (inv1p (not (null (string-match "\\` " nam1)))) + (inv2p (not (null (string-match "\\` " nam2)))) (star1p (not (null (string-match "\\`*" nam1)))) (star2p (not (null (string-match "\\`*" nam2)))) (mode1 (symbol-value-in-buffer 'major-mode buf1)) (mode2 (symbol-value-in-buffer 'major-mode buf2))) - (cond ((not (eq star1p star2p)) (not star1p)) + (cond ((not (eq inv1p inv2p)) + (not inv1p)) + ((not (eq star1p star2p)) + (not star1p)) ((and star1p star2p (string-lessp nam1 nam2))) - ((string-lessp mode1 mode2) t) - ((string-lessp mode2 mode1) nil) - (t (string-lessp nam1 nam2))))) + ((string-lessp mode1 mode2) + t) + ((string-lessp mode2 mode1) + nil) + (t + (string-lessp nam1 nam2))))) ;; this version is too slow on some machines. (defun slow-format-buffers-menu-line (buffer) @@ -1491,10 +1537,18 @@ The menu is computed by combining `global-popup-menu' and `mode-popup-menu'." (defun xemacs-splash-buffer () "Redisplay XEmacs splash screen in a buffer." (interactive) - (let ((buffer (get-buffer-create "*Splash*"))) + (let ((buffer (get-buffer-create "*Splash*")) + tmout) (set-buffer buffer) + (setq buffer-read-only t) (erase-buffer buffer) - (startup-splash-frame) + (setq tmout (display-splash-frame)) + (when tmout + (make-local-hook 'kill-buffer-hook) + (add-hook 'kill-buffer-hook + `(lambda () + (disable-timeout ,tmout)) + nil t)) (pop-to-buffer buffer) (delete-other-windows))) @@ -1503,4 +1557,4 @@ The menu is computed by combining `global-popup-menu' and `mode-popup-menu'." (provide 'x-menubar) (provide 'menubar-items) -;;; x-menubar.el ends here. +;;; menubar-items.el ends here.