aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love2000-06-19 14:55:15 +0000
committerDave Love2000-06-19 14:55:15 +0000
commit10013d74edbfcbf69ac194e6c2c0b74e6c8302ca (patch)
treec17f3a32169351ca59b43e91006f4d48c1ff638f
parent998e9f8cb3ee57ab87b9cc7eedf3e8687d4b3406 (diff)
downloademacs-10013d74edbfcbf69ac194e6c2c0b74e6c8302ca.tar.gz
emacs-10013d74edbfcbf69ac194e6c2c0b74e6c8302ca.zip
(menu-bar-options-save): New function.
(menu-bar-options-menu): Use it. (menu-bar-options-menu) <toggle-global-lazy-font-lock-mode>: Simplify.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/menu-bar.el72
2 files changed, 54 insertions, 25 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e001ecc3935..690e3cec040 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12000-06-19 Dave Love <fx@gnu.org>
2
3 * menu-bar.el (menu-bar-options-save): New function.
4 (menu-bar-options-menu): Use it.
5 (menu-bar-options-menu) <toggle-global-lazy-font-lock-mode>:
6 Simplify.
7
12000-06-19 Andreas Schwab <schwab@suse.de> 82000-06-19 Andreas Schwab <schwab@suse.de>
2 9
3 * progmodes/etags.el (tags-query-replace): Put new parameters 10 * progmodes/etags.el (tags-query-replace): Put new parameters
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index d1ff2a21db3..231de3dcb3b 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -517,6 +517,32 @@ Do the same for the keys of the same name."
517(define-key menu-bar-options-menu [customize] 517(define-key menu-bar-options-menu [customize]
518 (list 'menu-item "Customize Emacs" menu-bar-custom-menu 518 (list 'menu-item "Customize Emacs" menu-bar-custom-menu
519 :help "Full customization of every Emacs feature")) 519 :help "Full customization of every Emacs feature"))
520
521(defun menu-bar-options-save ()
522 "Save current values of Options menu items using Custom."
523 (interactive)
524 (dolist (elt '(debug-on-quit debug-on-error auto-compression-mode
525 case-fold-search truncate-lines show-paren-mode
526 transient-mark-mode global-font-lock-mode
527 current-language-environment default-input-method))
528 (if (default-value elt)
529 (customize-save-variable elt (default-value elt))))
530 (if (memq 'turn-on-auto-fill text-mode-hook)
531 (customize-save-variable 'text-mode-hook
532 (default-value 'text-mode-hook)))
533 (if (featurep 'saveplace)
534 (customize-save-variable 'save-place (default-value 'save-place)))
535 (if (featurep 'uniquify)
536 (customize-save-variable 'uniquify-buffer-name-style
537 (default-value 'uniquify-buffer-name-style))))
538
539(define-key menu-bar-options-menu [save]
540 '(menu-item "Save options" menu-bar-options-save
541 :help "Save options set from the menu above"))
542
543(define-key menu-bar-options-menu [custom-separator]
544 '("--"))
545
520(define-key menu-bar-options-menu [mule] 546(define-key menu-bar-options-menu [mule]
521 ;; It is better not to use backquote here, 547 ;; It is better not to use backquote here,
522 ;; because that makes a bootstrapping problem 548 ;; because that makes a bootstrapping problem
@@ -556,7 +582,8 @@ Do the same for the keys of the same name."
556 "Saving place in files %s" 582 "Saving place in files %s"
557 "Save Emacs state for next session" 583 "Save Emacs state for next session"
558 (require 'saveplace) 584 (require 'saveplace)
559 (setq-default save-place (not (default-value save-place))))) 585 (setq-default save-place
586 (not (default-value save-place)))))
560(define-key menu-bar-options-menu [uniquify] 587(define-key menu-bar-options-menu [uniquify]
561 (menu-bar-make-toggle toggle-uniquify-buffer-names uniquify-buffer-name-style 588 (menu-bar-make-toggle toggle-uniquify-buffer-names uniquify-buffer-name-style
562 "Use Directory Names in Buffer Names" 589 "Use Directory Names in Buffer Names"
@@ -602,14 +629,7 @@ Do the same for the keys of the same name."
602 "Highlight Syntax (Global Font Lock)" 629 "Highlight Syntax (Global Font Lock)"
603 "Syntax Highlighting %s" 630 "Syntax Highlighting %s"
604 "Highlights text based on language syntax" 631 "Highlights text based on language syntax"
605 ;; Make sure a support mode is used; 632 global-font-lock-mode))
606 ;; otherwise Font Lock will be too slow.
607 (require 'font-lock)
608 (if (not global-font-lock-mode)
609 (or font-lock-support-mode
610 (setq font-lock-support-mode 'lazy-lock-mode)))
611 (global-font-lock-mode)))
612
613 633
614 634
615;; The "Tools" menu items 635;; The "Tools" menu items
@@ -1022,16 +1042,16 @@ key (or menu-item)"))
1022 ;; Now make the actual list of items, 1042 ;; Now make the actual list of items,
1023 ;; ending with the list-buffers item. 1043 ;; ending with the list-buffers item.
1024 (nconc (mapcar (lambda (pair) 1044 (nconc (mapcar (lambda (pair)
1025 ;; This is somewhat risque, to use 1045 ;; This is somewhat risque, to use
1026 ;; the buffer name itself as the event 1046 ;; the buffer name itself as the event
1027 ;; type to define, but it works. 1047 ;; type to define, but it works.
1028 ;; It would not work to use the buffer 1048 ;; It would not work to use the buffer
1029 ;; since a buffer as an event has its 1049 ;; since a buffer as an event has its
1030 ;; own meaning. 1050 ;; own meaning.
1031 (nconc (list (buffer-name (cdr pair)) 1051 (nconc (list (buffer-name (cdr pair))
1032 (car pair) 1052 (car pair)
1033 (cons nil nil)) 1053 (cons nil nil))
1034 'menu-bar-select-buffer)) 1054 'menu-bar-select-buffer))
1035 alist) 1055 alist)
1036 (list menu-bar-buffers-menu-list-buffers-entry))))) 1056 (list menu-bar-buffers-menu-list-buffers-entry)))))
1037 1057
@@ -1044,12 +1064,14 @@ key (or menu-item)"))
1044 (frames-menu 1064 (frames-menu
1045 (cons 'keymap 1065 (cons 'keymap
1046 (cons "Select Frame" 1066 (cons "Select Frame"
1047 (mapcar (lambda (frame) 1067 (mapcar
1048 (nconc (list frame 1068 (lambda (frame)
1049 (cdr (assq 'name 1069 (nconc
1050 (frame-parameters frame))) 1070 (list frame
1051 (cons nil nil)) 1071 (cdr (assq 'name
1052 'menu-bar-select-frame)) 1072 (frame-parameters frame)))
1073 (cons nil nil))
1074 'menu-bar-select-frame))
1053 frames))))) 1075 frames)))))
1054 ;; Put it underneath the Buffers menu. 1076 ;; Put it underneath the Buffers menu.
1055 (setq buffers-menu (cons (cons 'frames (cons name frames-menu)) 1077 (setq buffers-menu (cons (cons 'frames (cons name frames-menu))