diff options
| author | Richard M. Stallman | 1995-06-29 03:11:37 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-06-29 03:11:37 +0000 |
| commit | 25b048eebc7942db291916152b80a0918c798083 (patch) | |
| tree | b82cdf19284338e6dbaace0ebf9f74c348f3223b | |
| parent | 6ac403a48fb85781b0a52afc7b2991c80d3b1dda (diff) | |
| download | emacs-25b048eebc7942db291916152b80a0918c798083.tar.gz emacs-25b048eebc7942db291916152b80a0918c798083.zip | |
Make more menu-enables check (not buffer-read-only).
Add minibuffer local menu bar menus.
| -rw-r--r-- | lisp/menu-bar.el | 57 |
1 files changed, 50 insertions, 7 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index ba07f0999b2..079de741c85 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el | |||
| @@ -235,17 +235,20 @@ | |||
| 235 | (message "Select a region with the mouse does `copy' automatically") | 235 | (message "Select a region with the mouse does `copy' automatically") |
| 236 | (kill-ring-save beg end))) | 236 | (kill-ring-save beg end))) |
| 237 | 237 | ||
| 238 | (put 'fill-region 'menu-enable 'mark-active) | 238 | (put 'fill-region 'menu-enable '(and mark-active (not buffer-read-only))) |
| 239 | (put 'kill-region 'menu-enable 'mark-active) | 239 | (put 'kill-region 'menu-enable '(and mark-active (not buffer-read-only))) |
| 240 | (put 'menu-bar-kill-ring-save 'menu-enable 'mark-active) | 240 | (put 'menu-bar-kill-ring-save 'menu-enable 'mark-active) |
| 241 | (put 'yank 'menu-enable '(x-selection-exists-p)) | 241 | (put 'yank 'menu-enable '(and (x-selection-exists-p) (not buffer-read-only))) |
| 242 | (put 'yank-menu 'menu-enable '(cdr yank-menu)) | 242 | (put 'yank-menu 'menu-enable '(and (cdr yank-menu) (not buffer-read-only))) |
| 243 | (put 'delete-region 'menu-enable '(and mark-active | 243 | (put 'delete-region 'menu-enable '(and mark-active |
| 244 | (not buffer-read-only) | ||
| 244 | (not (mouse-region-match)))) | 245 | (not (mouse-region-match)))) |
| 245 | (put 'undo 'menu-enable '(if (eq last-command 'undo) | 246 | (put 'undo 'menu-enable '(and (not buffer-read-only) |
| 246 | pending-undo-list | 247 | (if (eq last-command 'undo) |
| 247 | (consp buffer-undo-list))) | 248 | pending-undo-list |
| 249 | (consp buffer-undo-list)))) | ||
| 248 | (put 'query-replace 'menu-enable '(not buffer-read-only)) | 250 | (put 'query-replace 'menu-enable '(not buffer-read-only)) |
| 251 | (put 'query-replace-regexp 'menu-enable '(not buffer-read-only)) | ||
| 249 | 252 | ||
| 250 | (autoload 'ispell-menu-map "ispell" nil t 'keymap) | 253 | (autoload 'ispell-menu-map "ispell" nil t 'keymap) |
| 251 | 254 | ||
| @@ -590,6 +593,46 @@ A large number or nil slows down menu responsiveness.") | |||
| 590 | ;;; mode-name | 593 | ;;; mode-name |
| 591 | ;;; (or (buffer-file-name) "")))))) | 594 | ;;; (or (buffer-file-name) "")))))) |
| 592 | 595 | ||
| 596 | ;;; Set up a menu bar menu for the minibuffer. | ||
| 597 | |||
| 598 | (mapcar | ||
| 599 | (function | ||
| 600 | (lambda (map) | ||
| 601 | (define-key map [menu-bar minibuf] | ||
| 602 | (cons "Minibuf" (make-sparse-keymap "Minibuf"))))) | ||
| 603 | (list minibuffer-local-ns-map | ||
| 604 | minibuffer-local-must-match-map | ||
| 605 | minibuffer-local-isearch-map | ||
| 606 | minibuffer-local-map | ||
| 607 | minibuffer-local-completion-map)) | ||
| 608 | |||
| 609 | (mapcar | ||
| 610 | (function | ||
| 611 | (lambda (map) | ||
| 612 | (define-key map [menu-bar minibuf ?\?] | ||
| 613 | '("List Completions" . minibuffer-completion-help)) | ||
| 614 | (define-key map [menu-bar minibuf space] | ||
| 615 | '("Complete Word" . minibuffer-complete-word)) | ||
| 616 | (define-key map [menu-bar minibuf tab] | ||
| 617 | '("Complete" . 'minibuffer-complete)) | ||
| 618 | )) | ||
| 619 | (list minibuffer-local-must-match-map | ||
| 620 | minibuffer-local-completion-map)) | ||
| 621 | |||
| 622 | (mapcar | ||
| 623 | (function | ||
| 624 | (lambda (map) | ||
| 625 | (define-key map [menu-bar minibuf quit] | ||
| 626 | '("Quit" . keyboard-escape-quit)) | ||
| 627 | (define-key map [menu-bar minibuf return] | ||
| 628 | '("Enter" . exit-minibuffer)) | ||
| 629 | )) | ||
| 630 | (list minibuffer-local-ns-map | ||
| 631 | minibuffer-local-must-match-map | ||
| 632 | minibuffer-local-isearch-map | ||
| 633 | minibuffer-local-map | ||
| 634 | minibuffer-local-completion-map)) | ||
| 635 | |||
| 593 | (defvar menu-bar-mode nil) | 636 | (defvar menu-bar-mode nil) |
| 594 | 637 | ||
| 595 | (defun menu-bar-mode (flag) | 638 | (defun menu-bar-mode (flag) |