Mercurial > hg > xemacs-beta
comparison lisp/menubar-items.el @ 438:84b14dcb0985 r21-2-27
Import from CVS: tag r21-2-27
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:32:25 +0200 |
parents | 3ecd8885ac67 |
children | 8de8e3f6228a |
comparison
equal
deleted
inserted
replaced
437:e2a4e8b94b82 | 438:84b14dcb0985 |
---|---|
91 ["Undo" advertised-undo | 91 ["Undo" advertised-undo |
92 :active (and (not (eq buffer-undo-list t)) | 92 :active (and (not (eq buffer-undo-list t)) |
93 (or buffer-undo-list pending-undo-list)) | 93 (or buffer-undo-list pending-undo-list)) |
94 :suffix (if (or (eq last-command 'undo) | 94 :suffix (if (or (eq last-command 'undo) |
95 (eq last-command 'advertised-undo)) | 95 (eq last-command 'advertised-undo)) |
96 "More" "")] | 96 "More" "")] |
97 ["Redo" redo | 97 ["Redo" redo |
98 :included (fboundp 'redo) | 98 :included (fboundp 'redo) |
99 :active (not (or (eq buffer-undo-list t) | 99 :active (not (or (eq buffer-undo-list t) |
100 (eq last-buffer-undo-list nil) | 100 (eq last-buffer-undo-list nil) |
101 (not (or (eq last-buffer-undo-list buffer-undo-list) | 101 (not (or (eq last-buffer-undo-list buffer-undo-list) |
102 (and (null (car-safe buffer-undo-list)) | 102 (and (null (car-safe buffer-undo-list)) |
103 (eq last-buffer-undo-list | 103 (eq last-buffer-undo-list |
104 (cdr-safe buffer-undo-list))))) | 104 (cdr-safe buffer-undo-list))))) |
105 (or (eq buffer-undo-list pending-undo-list) | 105 (or (eq buffer-undo-list pending-undo-list) |
106 (eq (cdr buffer-undo-list) pending-undo-list)))) | 106 (eq (cdr buffer-undo-list) pending-undo-list)))) |
107 :suffix (if (eq last-command 'redo) "More" "")] | 107 :suffix (if (eq last-command 'redo) "More" "")] |
108 ["Cut" kill-primary-selection | 108 ["Cut" kill-primary-selection |
109 :active (selection-owner-p)] | 109 :active (selection-owner-p)] |
110 ["Copy" copy-primary-selection | 110 ["Copy" copy-primary-selection |
111 :active (selection-owner-p)] | 111 :active (selection-owner-p)] |
632 (progn | 632 (progn |
633 (customize-set-variable 'bar-cursor t) | 633 (customize-set-variable 'bar-cursor t) |
634 (force-cursor-redisplay)) | 634 (force-cursor-redisplay)) |
635 :style radio | 635 :style radio |
636 :selected (eq bar-cursor t)] | 636 :selected (eq bar-cursor t)] |
637 ["Bar cursor (2 pixels)" | 637 ["Bar cursor (2 pixels)" |
638 (progn | 638 (progn |
639 (customize-set-variable 'bar-cursor 2) | 639 (customize-set-variable 'bar-cursor 2) |
640 (force-cursor-redisplay)) | 640 (force-cursor-redisplay)) |
641 :style radio | 641 :style radio |
642 :selected (and bar-cursor (not (eq bar-cursor t)))] | 642 :selected (and bar-cursor (not (eq bar-cursor t)))] |
643 "------" | 643 "------" |
644 ["Line Numbers" | 644 ["Line Numbers" |
645 (progn | 645 (progn |
646 (customize-set-variable 'line-number-mode (not line-number-mode)) | 646 (customize-set-variable 'line-number-mode (not line-number-mode)) |
647 (redraw-modeline)) | 647 (redraw-modeline)) |
648 :style toggle :selected line-number-mode] | 648 :style toggle :selected line-number-mode] |
649 ["Column Numbers" | 649 ["Column Numbers" |
650 (progn | 650 (progn |
651 (customize-set-variable 'column-number-mode | 651 (customize-set-variable 'column-number-mode |
652 (not column-number-mode)) | 652 (not column-number-mode)) |
653 (redraw-modeline)) | 653 (redraw-modeline)) |
654 :style toggle :selected column-number-mode] | 654 :style toggle :selected column-number-mode] |
655 ) | 655 ) |
656 ("Menubar Appearance" | 656 ("Menubar Appearance" |
657 ["Buffers Menu Length..." | 657 ["Buffers Menu Length..." |
658 (customize-set-variable | 658 (customize-set-variable |
659 'buffers-menu-max-size | 659 'buffers-menu-max-size |
1140 "For use as a value of `buffers-menu-sort-function'. | 1140 "For use as a value of `buffers-menu-sort-function'. |
1141 Sorts the buffers in alphabetical order by name, but puts buffers beginning | 1141 Sorts the buffers in alphabetical order by name, but puts buffers beginning |
1142 with a star at the end of the list." | 1142 with a star at the end of the list." |
1143 (let* ((nam1 (buffer-name buf1)) | 1143 (let* ((nam1 (buffer-name buf1)) |
1144 (nam2 (buffer-name buf2)) | 1144 (nam2 (buffer-name buf2)) |
1145 (inv1p (not (null (string-match "\\` " nam1)))) | |
1146 (inv2p (not (null (string-match "\\` " nam2)))) | |
1145 (star1p (not (null (string-match "\\`*" nam1)))) | 1147 (star1p (not (null (string-match "\\`*" nam1)))) |
1146 (star2p (not (null (string-match "\\`*" nam2))))) | 1148 (star2p (not (null (string-match "\\`*" nam2))))) |
1147 (if (not (eq star1p star2p)) | 1149 (cond ((not (eq inv1p inv2p)) |
1148 (not star1p) | 1150 (not inv1p)) |
1149 (string-lessp nam1 nam2)))) | 1151 ((not (eq star1p star2p)) |
1152 (not star1p)) | |
1153 (t | |
1154 (string-lessp nam1 nam2))))) | |
1150 | 1155 |
1151 (defun sort-buffers-menu-by-mode-then-alphabetically (buf1 buf2) | 1156 (defun sort-buffers-menu-by-mode-then-alphabetically (buf1 buf2) |
1152 "For use as a value of `buffers-menu-sort-function'. | 1157 "For use as a value of `buffers-menu-sort-function'. |
1153 Sorts first by major mode and then alphabetically by name, but puts buffers | 1158 Sorts first by major mode and then alphabetically by name, but puts buffers |
1154 beginning with a star at the end of the list." | 1159 beginning with a star at the end of the list." |
1155 (let* ((nam1 (buffer-name buf1)) | 1160 (let* ((nam1 (buffer-name buf1)) |
1156 (nam2 (buffer-name buf2)) | 1161 (nam2 (buffer-name buf2)) |
1162 (inv1p (not (null (string-match "\\` " nam1)))) | |
1163 (inv2p (not (null (string-match "\\` " nam2)))) | |
1157 (star1p (not (null (string-match "\\`*" nam1)))) | 1164 (star1p (not (null (string-match "\\`*" nam1)))) |
1158 (star2p (not (null (string-match "\\`*" nam2)))) | 1165 (star2p (not (null (string-match "\\`*" nam2)))) |
1159 (mode1 (symbol-value-in-buffer 'major-mode buf1)) | 1166 (mode1 (symbol-value-in-buffer 'major-mode buf1)) |
1160 (mode2 (symbol-value-in-buffer 'major-mode buf2))) | 1167 (mode2 (symbol-value-in-buffer 'major-mode buf2))) |
1161 (cond ((not (eq star1p star2p)) (not star1p)) | 1168 (cond ((not (eq inv1p inv2p)) |
1169 (not inv1p)) | |
1170 ((not (eq star1p star2p)) | |
1171 (not star1p)) | |
1162 ((and star1p star2p (string-lessp nam1 nam2))) | 1172 ((and star1p star2p (string-lessp nam1 nam2))) |
1163 ((string-lessp mode1 mode2) t) | 1173 ((string-lessp mode1 mode2) |
1164 ((string-lessp mode2 mode1) nil) | 1174 t) |
1165 (t (string-lessp nam1 nam2))))) | 1175 ((string-lessp mode2 mode1) |
1176 nil) | |
1177 (t | |
1178 (string-lessp nam1 nam2))))) | |
1166 | 1179 |
1167 ;; this version is too slow on some machines. | 1180 ;; this version is too slow on some machines. |
1168 (defun slow-format-buffers-menu-line (buffer) | 1181 (defun slow-format-buffers-menu-line (buffer) |
1169 "For use as a value of `buffers-menu-format-buffer-line-function'. | 1182 "For use as a value of `buffers-menu-format-buffer-line-function'. |
1170 This returns a string containing a bunch of info about the buffer." | 1183 This returns a string containing a bunch of info about the buffer." |
1542 | 1555 |
1543 ;;; backwards compatibility | 1556 ;;; backwards compatibility |
1544 (provide 'x-menubar) | 1557 (provide 'x-menubar) |
1545 (provide 'menubar-items) | 1558 (provide 'menubar-items) |
1546 | 1559 |
1547 ;;; x-menubar.el ends here. | 1560 ;;; menubar-items.el ends here. |