Mercurial > hg > xemacs-beta
comparison lisp/menubar-items.el @ 284:558f606b08ae r21-0b40
Import from CVS: tag r21-0b40
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:34:13 +0200 |
parents | c42ec1d1cded |
children | e11d67e05968 |
comparison
equal
deleted
inserted
replaced
283:fa3d41851a08 | 284:558f606b08ae |
---|---|
717 ["Avoid Text..." | 717 ["Avoid Text..." |
718 (customize-set-variable 'mouse-avoidance-mode | 718 (customize-set-variable 'mouse-avoidance-mode |
719 (if mouse-avoidance-mode nil 'banish)) | 719 (if mouse-avoidance-mode nil 'banish)) |
720 :style toggle | 720 :style toggle |
721 :selected (and (boundp 'mouse-avoidance-mode) mouse-avoidance-mode) | 721 :selected (and (boundp 'mouse-avoidance-mode) mouse-avoidance-mode) |
722 :active (and (boundp 'mouse-avoidance-mode) | 722 :active (and (boundp 'mouse-avoidance-mode) |
723 window-system (eq (device-type) 'x))] | 723 (device-on-window-system-p))] |
724 ["strokes-mode" | 724 ["strokes-mode" |
725 (customize-set-variable 'strokes-mode (not strokes-mode)) | 725 (customize-set-variable 'strokes-mode (not strokes-mode)) |
726 :style toggle | 726 :style toggle |
727 :selected (and (boundp 'strokes-mode) strokes-mode) | 727 :selected (and (boundp 'strokes-mode) strokes-mode) |
728 :active (and (boundp 'strokes-mode) | 728 :active (and (boundp 'strokes-mode) |
729 window-system (eq (device-type) 'x))] | 729 (device-on-window-system-p))] |
730 ) | 730 ) |
731 ("Open URLs With" | 731 ("Open URLs With" |
732 ["Emacs-W3" | 732 ["Emacs-W3" |
733 (customize-set-variable 'browse-url-browser-function 'browse-url-w3) | 733 (customize-set-variable 'browse-url-browser-function 'browse-url-w3) |
734 :style radio | 734 :style radio |
1326 :active (and (not (eq buffer-undo-list t)) | 1326 :active (and (not (eq buffer-undo-list t)) |
1327 (or buffer-undo-list pending-undo-list)) | 1327 (or buffer-undo-list pending-undo-list)) |
1328 :suffix (if (or (eq last-command 'undo) | 1328 :suffix (if (or (eq last-command 'undo) |
1329 (eq last-command 'advertised-undo)) | 1329 (eq last-command 'advertised-undo)) |
1330 "More" "")] | 1330 "More" "")] |
1331 ["Cut" x-kill-primary-selection | 1331 ["Cut" kill-primary-selection |
1332 :active (and (eq 'x (device-type (selected-device))) | 1332 :active (selection-owner-p)] |
1333 (x-selection-owner-p))] | 1333 ["Copy" copy-primary-selection |
1334 ["Copy" x-copy-primary-selection | 1334 :active (selection-owner-p)] |
1335 :active (and (eq 'x (device-type (selected-device))) | 1335 ["Paste" yank-clipboard-selection |
1336 (x-selection-owner-p))] | 1336 :active (selection-exists-p 'CLIPBOARD)] |
1337 ["Paste" x-yank-clipboard-selection | 1337 ["Clear" delete-primary-selection |
1338 :active (and (eq 'x (device-type (selected-device))) | 1338 :active (selection-owner-p)] |
1339 (x-selection-exists-p 'CLIPBOARD))] | |
1340 ["Clear" x-delete-primary-selection | |
1341 :active (and (eq 'x (device-type (selected-device))) | |
1342 (x-selection-owner-p))] | |
1343 "-----" | 1339 "-----" |
1344 ["Select Block" mark-paragraph] | 1340 ["Select Block" mark-paragraph] |
1345 ["Split Window" (split-window)] | 1341 ["Split Window" split-window-vertically] |
1346 ["Unsplit Window" delete-other-windows] | 1342 ["Unsplit Window" delete-other-windows] |
1347 )) | 1343 )) |
1348 | 1344 |
1349 (defvar global-popup-menu nil | 1345 (defvar global-popup-menu nil |
1350 "The global popup menu. This is present in all modes. | 1346 "The global popup menu. This is present in all modes. |
1373 The menu is computed by combining `global-popup-menu' and `mode-popup-menu'." | 1369 The menu is computed by combining `global-popup-menu' and `mode-popup-menu'." |
1374 (interactive "@_") | 1370 (interactive "@_") |
1375 (run-hooks 'activate-popup-menu-hook) | 1371 (run-hooks 'activate-popup-menu-hook) |
1376 (popup-menu | 1372 (popup-menu |
1377 (cond ((and global-popup-menu mode-popup-menu) | 1373 (cond ((and global-popup-menu mode-popup-menu) |
1374 ;; Merge global-popup-menu and mode-popup-menu | |
1378 (check-menu-syntax mode-popup-menu) | 1375 (check-menu-syntax mode-popup-menu) |
1379 (let* ((title (car mode-popup-menu)) | 1376 (let* ((title (car mode-popup-menu)) |
1380 (items (cdr mode-popup-menu)) | 1377 (items (cdr mode-popup-menu)) |
1381 filters) | 1378 mode-filters) |
1382 ;; Strip keywords from local menu for attaching them at the top | 1379 ;; Strip keywords from local menu for attaching them at the top |
1383 (while (and items | 1380 (while (and items |
1384 (symbolp (car items))) | 1381 (keywordp (car items))) |
1385 (setq items (append filters (list (car items)))) | 1382 ;; Push both keyword and its argument. |
1386 (setq items (cdr items))) | 1383 (push (pop items) mode-filters) |
1387 ;; If filters contains a keyword already present in | 1384 (push (pop items) mode-filters)) |
1388 ;; `global-popup-menu' you will probably lose. | 1385 (setq mode-filters (nreverse mode-filters)) |
1386 ;; If mode-filters contains a keyword already present in | |
1387 ;; `global-popup-menu', you will probably lose. | |
1389 (append (list (car global-popup-menu)) | 1388 (append (list (car global-popup-menu)) |
1390 filters | 1389 mode-filters |
1391 (cdr global-popup-menu) | 1390 (cdr global-popup-menu) |
1392 '("---" "---") | 1391 '("---" "---") |
1393 (if popup-menu-titles (list title)) | 1392 (if popup-menu-titles (list title)) |
1394 (if popup-menu-titles '("---" "---")) | 1393 (if popup-menu-titles '("---" "---")) |
1395 items))) | 1394 items))) |
1396 (t | 1395 (t |
1397 (or mode-popup-menu | 1396 (or mode-popup-menu |
1398 global-popup-menu | 1397 global-popup-menu |
1399 (error "No menu here.")))))) | 1398 (error "No menu defined in this buffer")))))) |
1400 | 1399 |
1401 (defun popup-buffer-menu (event) | 1400 (defun popup-buffer-menu (event) |
1402 "Pop up a copy of the Buffers menu (from the menubar) where the mouse is clicked." | 1401 "Pop up a copy of the Buffers menu (from the menubar) where the mouse is clicked." |
1403 (interactive "e") | 1402 (interactive "e") |
1404 (let ((window (and (event-over-text-area-p event) (event-window event))) | 1403 (let ((window (and (event-over-text-area-p event) (event-window event))) |