diff options
| author | Richard M. Stallman | 1995-04-24 15:26:19 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-04-24 15:26:19 +0000 |
| commit | 1f50590a16da70a29fd97ea684112aa82a1e2673 (patch) | |
| tree | cbef507ebd01efac41e38a429b66bff849d8dcf1 | |
| parent | 125a8d7091d604217366dc10e7501b4c8679ce6d (diff) | |
| download | emacs-1f50590a16da70a29fd97ea684112aa82a1e2673.tar.gz emacs-1f50590a16da70a29fd97ea684112aa82a1e2673.zip | |
Disable many Files menu items in minibuffer.
(menu-bar-search-menu): Add ... to many items.
Add a query-replace-regexp item.
(nonincremental-repeat-search-forward): Renamed from noninteractive...
(nonincremental-repeat-search-backward): Likewise.
(nonincremental-repeat-re-search-forward): Likewise.
(nonincremental-repeat-re-search-backward): Likewise.
| -rw-r--r-- | lisp/menu-bar.el | 47 |
1 files changed, 33 insertions, 14 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 693cba220fd..3b83a88cc88 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el | |||
| @@ -109,7 +109,7 @@ | |||
| 109 | (define-key menu-bar-files-menu [kill-buffer] | 109 | (define-key menu-bar-files-menu [kill-buffer] |
| 110 | '("Kill Current Buffer" . kill-this-buffer)) | 110 | '("Kill Current Buffer" . kill-this-buffer)) |
| 111 | (define-key menu-bar-files-menu [insert-file] | 111 | (define-key menu-bar-files-menu [insert-file] |
| 112 | '("Insert File" . insert-file)) | 112 | '("Insert File..." . insert-file)) |
| 113 | (define-key menu-bar-files-menu [revert-buffer] | 113 | (define-key menu-bar-files-menu [revert-buffer] |
| 114 | '("Revert Buffer" . revert-buffer)) | 114 | '("Revert Buffer" . revert-buffer)) |
| 115 | (define-key menu-bar-files-menu [write-file] | 115 | (define-key menu-bar-files-menu [write-file] |
| @@ -154,30 +154,32 @@ | |||
| 154 | (isearch-update-ring string t) | 154 | (isearch-update-ring string t) |
| 155 | (re-search-backward string))) | 155 | (re-search-backward string))) |
| 156 | 156 | ||
| 157 | (defun noninteractive-repeat-search-forward () | 157 | (defun nonincremental-repeat-search-forward () |
| 158 | "Search forward for the previous search string." | 158 | "Search forward for the previous search string." |
| 159 | (interactive) | 159 | (interactive) |
| 160 | (search-forward (car search-ring))) | 160 | (search-forward (car search-ring))) |
| 161 | 161 | ||
| 162 | (defun noninteractive-repeat-search-backward () | 162 | (defun nonincremental-repeat-search-backward () |
| 163 | "Search backward for the previous search string." | 163 | "Search backward for the previous search string." |
| 164 | (interactive) | 164 | (interactive) |
| 165 | (search-backward (car search-ring))) | 165 | (search-backward (car search-ring))) |
| 166 | 166 | ||
| 167 | (defun noninteractive-repeat-re-search-forward () | 167 | (defun nonincremental-repeat-re-search-forward () |
| 168 | "Search forward for the previous regular expression." | 168 | "Search forward for the previous regular expression." |
| 169 | (interactive) | 169 | (interactive) |
| 170 | (re-search-forward (car regexp-search-ring))) | 170 | (re-search-forward (car regexp-search-ring))) |
| 171 | 171 | ||
| 172 | (defun noninteractive-repeat-re-search-backward () | 172 | (defun nonincremental-repeat-re-search-backward () |
| 173 | "Search backward for the previous regular expression." | 173 | "Search backward for the previous regular expression." |
| 174 | (interactive) | 174 | (interactive) |
| 175 | (re-search-backward (car regexp-search-ring))) | 175 | (re-search-backward (car regexp-search-ring))) |
| 176 | 176 | ||
| 177 | (define-key menu-bar-search-menu [query-replace-regexp] | ||
| 178 | '("Query Replace Regexp..." . query-replace-regexp)) | ||
| 177 | (define-key menu-bar-search-menu [query-replace] | 179 | (define-key menu-bar-search-menu [query-replace] |
| 178 | '("Query Replace" . query-replace)) | 180 | '("Query Replace..." . query-replace)) |
| 179 | (define-key menu-bar-search-menu [find-tag] | 181 | (define-key menu-bar-search-menu [find-tag] |
| 180 | '("Find Tag" . find-tag)) | 182 | '("Find Tag..." . find-tag)) |
| 181 | (put 'find-tag 'menu-enable 'tags-table-list) | 183 | (put 'find-tag 'menu-enable 'tags-table-list) |
| 182 | (define-key menu-bar-search-menu [bookmark] | 184 | (define-key menu-bar-search-menu [bookmark] |
| 183 | '("Bookmarks" . menu-bar-bookmark-map)) | 185 | '("Bookmarks" . menu-bar-bookmark-map)) |
| @@ -198,13 +200,13 @@ | |||
| 198 | '("--")) | 200 | '("--")) |
| 199 | 201 | ||
| 200 | (define-key menu-bar-search-menu [re-search-back] | 202 | (define-key menu-bar-search-menu [re-search-back] |
| 201 | '("Regexp Search Backwards" . nonincremental-re-search-backward)) | 203 | '("Regexp Search Backwards..." . nonincremental-re-search-backward)) |
| 202 | (define-key menu-bar-search-menu [search-back] | 204 | (define-key menu-bar-search-menu [search-back] |
| 203 | '("Search Backwards" . nonincremental-search-backward)) | 205 | '("Search Backwards..." . nonincremental-search-backward)) |
| 204 | (define-key menu-bar-search-menu [re-search-fwd] | 206 | (define-key menu-bar-search-menu [re-search-fwd] |
| 205 | '("Regexp Search" . nonincremental-re-search-forward)) | 207 | '("Regexp Search..." . nonincremental-re-search-forward)) |
| 206 | (define-key menu-bar-search-menu [search-fwd] | 208 | (define-key menu-bar-search-menu [search-fwd] |
| 207 | '("Search" . nonincremental-search-forward)) | 209 | '("Search..." . nonincremental-search-forward)) |
| 208 | 210 | ||
| 209 | (if (fboundp 'start-process) | 211 | (if (fboundp 'start-process) |
| 210 | (define-key menu-bar-edit-menu [spell] '("Spell" . ispell-menu-map))) | 212 | (define-key menu-bar-edit-menu [spell] '("Spell" . ispell-menu-map))) |
| @@ -327,9 +329,27 @@ Do the same for the keys of the same name." | |||
| 327 | (or (string-match "^ " (buffer-name (car buffers))) | 329 | (or (string-match "^ " (buffer-name (car buffers))) |
| 328 | (setq count (1+ count))) | 330 | (setq count (1+ count))) |
| 329 | (setq buffers (cdr buffers))) | 331 | (setq buffers (cdr buffers))) |
| 330 | (> count 1))) | 332 | (and (not (window-minibuffer-p (selected-window))) |
| 333 | (> count 1)))) | ||
| 334 | |||
| 335 | (put 'kill-this-buffer 'menu-enable '(kill-this-buffer-enabled-p)) | ||
| 336 | |||
| 337 | (put 'save-buffer 'menu-enable | ||
| 338 | '(and (buffer-modified-p) | ||
| 339 | (not (window-minibuffer-p (selected-window))))) | ||
| 340 | |||
| 341 | (put 'write-file 'menu-enable | ||
| 342 | '(not (window-minibuffer-p (selected-window)))) | ||
| 343 | |||
| 344 | (put 'find-file 'menu-enable | ||
| 345 | '(not (window-minibuffer-p (selected-window)))) | ||
| 346 | |||
| 347 | (put 'dired 'menu-enable | ||
| 348 | '(not (window-minibuffer-p (selected-window)))) | ||
| 349 | |||
| 350 | (put 'insert-file 'menu-enable | ||
| 351 | '(not (window-minibuffer-p (selected-window)))) | ||
| 331 | 352 | ||
| 332 | (put 'save-buffer 'menu-enable '(buffer-modified-p)) | ||
| 333 | (put 'revert-buffer 'menu-enable | 353 | (put 'revert-buffer 'menu-enable |
| 334 | '(or revert-buffer-function revert-buffer-insert-file-contents-function | 354 | '(or revert-buffer-function revert-buffer-insert-file-contents-function |
| 335 | (and (buffer-file-name) | 355 | (and (buffer-file-name) |
| @@ -344,7 +364,6 @@ Do the same for the keys of the same name." | |||
| 344 | (setq count (1+ count))) | 364 | (setq count (1+ count))) |
| 345 | (setq frames (cdr frames))) | 365 | (setq frames (cdr frames))) |
| 346 | (> count 1))) | 366 | (> count 1))) |
| 347 | (put 'kill-this-buffer 'menu-enable '(kill-this-buffer-enabled-p)) | ||
| 348 | 367 | ||
| 349 | (put 'advertised-undo 'menu-enable | 368 | (put 'advertised-undo 'menu-enable |
| 350 | '(and (not (eq t buffer-undo-list)) | 369 | '(and (not (eq t buffer-undo-list)) |