diff options
| -rw-r--r-- | lisp/menu-bar.el | 55 |
1 files changed, 49 insertions, 6 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 254bdeecaae..6281d7e5453 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el | |||
| @@ -1250,6 +1250,52 @@ mail status in mode line")) | |||
| 1250 | :enable (not (truncated-partial-width-window-p)))) | 1250 | :enable (not (truncated-partial-width-window-p)))) |
| 1251 | menu)) | 1251 | menu)) |
| 1252 | 1252 | ||
| 1253 | (defvar menu-bar-search-options-menu | ||
| 1254 | (let ((menu (make-sparse-keymap "Search Options"))) | ||
| 1255 | |||
| 1256 | (dolist (x '((character-fold-to-regexp "Fold Characters" "Character folding") | ||
| 1257 | (isearch-symbol-regexp "Whole Symbols" "Whole symbol") | ||
| 1258 | (word-search-regexp "Whole Words" "Whole word"))) | ||
| 1259 | (bindings--define-key menu (vector (nth 0 x)) | ||
| 1260 | `(menu-item ,(nth 1 x) | ||
| 1261 | (lambda () | ||
| 1262 | (interactive) | ||
| 1263 | (setq search-default-mode #',(nth 0 x)) | ||
| 1264 | (message ,(format "%s search enabled" (nth 2 x)))) | ||
| 1265 | :help ,(format "Enable %s search" (downcase (nth 2 x))) | ||
| 1266 | :button (:radio . (eq search-default-mode #',(nth 0 x)))))) | ||
| 1267 | |||
| 1268 | (bindings--define-key menu [regexp-search] | ||
| 1269 | '(menu-item "Regular Expression" | ||
| 1270 | (lambda () | ||
| 1271 | (interactive) | ||
| 1272 | (setq search-default-mode t) | ||
| 1273 | (message "Regular-expression search enabled")) | ||
| 1274 | :help "Enable regular-expression search" | ||
| 1275 | :button (:radio . (eq search-default-mode t)))) | ||
| 1276 | |||
| 1277 | (bindings--define-key menu [regular-search] | ||
| 1278 | '(menu-item "Literal Search" | ||
| 1279 | (lambda () | ||
| 1280 | (interactive) | ||
| 1281 | (when search-default-mode | ||
| 1282 | (setq search-default-mode nil) | ||
| 1283 | (when (symbolp search-default-mode) | ||
| 1284 | (message "Literal search enabled")))) | ||
| 1285 | :help "Disable special search modes" | ||
| 1286 | :button (:radio . (not search-default-mode)))) | ||
| 1287 | |||
| 1288 | (bindings--define-key menu [custom-separator] | ||
| 1289 | menu-bar-separator) | ||
| 1290 | (bindings--define-key menu [case-fold-search] | ||
| 1291 | (menu-bar-make-toggle | ||
| 1292 | toggle-case-fold-search case-fold-search | ||
| 1293 | "Ignore Case" | ||
| 1294 | "Case-Insensitive Search %s" | ||
| 1295 | "Ignore letter-case in search commands")) | ||
| 1296 | |||
| 1297 | menu)) | ||
| 1298 | |||
| 1253 | (defvar menu-bar-options-menu | 1299 | (defvar menu-bar-options-menu |
| 1254 | (let ((menu (make-sparse-keymap "Options"))) | 1300 | (let ((menu (make-sparse-keymap "Options"))) |
| 1255 | (bindings--define-key menu [customize] | 1301 | (bindings--define-key menu [customize] |
| @@ -1361,12 +1407,9 @@ mail status in mode line")) | |||
| 1361 | (:visible (and (boundp 'cua-enable-cua-keys) | 1407 | (:visible (and (boundp 'cua-enable-cua-keys) |
| 1362 | (not cua-enable-cua-keys))))) | 1408 | (not cua-enable-cua-keys))))) |
| 1363 | 1409 | ||
| 1364 | (bindings--define-key menu [case-fold-search] | 1410 | (bindings--define-key menu [search-options] |
| 1365 | (menu-bar-make-toggle | 1411 | `(menu-item "Default Search Options" |
| 1366 | toggle-case-fold-search case-fold-search | 1412 | ,menu-bar-search-options-menu)) |
| 1367 | "Ignore Case for Search" | ||
| 1368 | "Case-Insensitive Search %s" | ||
| 1369 | "Ignore letter-case in search commands")) | ||
| 1370 | 1413 | ||
| 1371 | (bindings--define-key menu [line-wrapping] | 1414 | (bindings--define-key menu [line-wrapping] |
| 1372 | `(menu-item "Line Wrapping in This Buffer" | 1415 | `(menu-item "Line Wrapping in This Buffer" |