[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/menu-bar.el
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/menu-bar.el |
Date: |
Wed, 11 Sep 2002 17:56:50 -0400 |
Index: emacs/lisp/menu-bar.el
diff -c emacs/lisp/menu-bar.el:1.227 emacs/lisp/menu-bar.el:1.228
*** emacs/lisp/menu-bar.el:1.227 Fri Sep 6 16:27:59 2002
--- emacs/lisp/menu-bar.el Wed Sep 11 17:56:50 2002
***************
*** 563,569 ****
:button (:toggle . (and (default-boundp ',fname)
(default-value ',fname)))))
! (defmacro menu-bar-make-toggle (name variable doc message help &optional
props &rest body)
`(progn
(defun ,name ()
,(concat "Toggle whether to " (downcase (substring help 0 1))
--- 563,569 ----
:button (:toggle . (and (default-boundp ',fname)
(default-value ',fname)))))
! (defmacro menu-bar-make-toggle (name variable doc message help &rest body)
`(progn
(defun ,name ()
,(concat "Toggle whether to " (downcase (substring help 0 1))
***************
*** 576,595 ****
(get (or (get ',variable 'custom-get) 'default-value)))
(funcall set ',variable (not (funcall get ',variable))))))
(message ,message "enabled")
! (message ,message "disabled")))
! ;; The function `customize-mark-as-set' must only be called when
! ;; a variable is set interactively, as the purpose is to mark it
! ;; as a candidate for "Save Options", and we do not want to save
! ;; options the user have already set explicitly in his init
! ;; file. Unfortunately, he could very likely call the function
! ;; defined above there. So we put `customize-mark-as-set' in a
! ;; lambda expression.
! ;; -- Per Abrahamsen <address@hidden> 2002-02-11.
! '(menu-item ,doc (lambda ()
! (interactive)
! (,name)
! (customize-mark-as-set ',variable))
! ,@(if props props)
:help ,help
:button (:toggle . (and (default-boundp ',variable)
(default-value ',variable))))))
--- 576,588 ----
(get (or (get ',variable 'custom-get) 'default-value)))
(funcall set ',variable (not (funcall get ',variable))))))
(message ,message "enabled")
! (message ,message "disabled"))
! ;; The function `customize-mark-as-set' must only be called when
! ;; a variable is set interactively, as the purpose is to mark it as
! ;; a candidate for "Save Options", and we do not want to save options
! ;; the user have already set explicitly in his init file.
! (if (interactive-p) (customize-mark-as-set ',variable)))
! '(menu-item ,doc ,name
:help ,help
:button (:toggle . (and (default-boundp ',variable)
(default-value ',variable))))))
***************
*** 637,650 ****
(defvar menu-bar-showhide-menu (make-sparse-keymap "Show/Hide"))
(define-key menu-bar-showhide-menu [column-number-mode]
! (menu-bar-make-toggle toggle-column-number-mode column-number-mode
! "Show Column Numbers" "Column number mode %s"
! "Show the current column number in the mode line"))
(define-key menu-bar-showhide-menu [line-number-mode]
! (menu-bar-make-toggle toggle-line-number-mode line-number-mode
! "Show Line Numbers" "Line number mode %s"
! "Show the current line number in the mode line"))
(define-key menu-bar-showhide-menu [linecolumn-separator]
'("--"))
--- 630,643 ----
(defvar menu-bar-showhide-menu (make-sparse-keymap "Show/Hide"))
(define-key menu-bar-showhide-menu [column-number-mode]
! (menu-bar-make-mm-toggle column-number-mode
! "Show Column Numbers"
! "Show the current column number in the mode line"))
(define-key menu-bar-showhide-menu [line-number-mode]
! (menu-bar-make-mm-toggle line-number-mode
! "Show Line Numbers"
! "Show the current line number in the mode line"))
(define-key menu-bar-showhide-menu [linecolumn-separator]
'("--"))
***************
*** 850,856 ****
"Use Directory Names in Buffer Names"
"Directory name in buffer names (uniquify) %s"
"Uniquify buffer names by adding parent directory names"
- () ; no props
(require 'uniquify)
(setq uniquify-buffer-name-style
(if (not uniquify-buffer-name-style)
--- 843,848 ----
***************
*** 908,920 ****
(define-key menu-bar-options-menu [highlight-paren-mode]
(menu-bar-make-mm-toggle show-paren-mode
"Paren Match Highlighting"
! "Highlight matching/mismatched parentheses at cursor
(Show Paren mode)"))
(define-key menu-bar-options-menu [transient-mark-mode]
! (menu-bar-make-toggle toggle-transient-mark-mode transient-mark-mode
! "Active Region Highlighting"
! "Transient Mark mode %s"
! "Make text in active region stand out in color
(Transient Mark mode)"
! (:enable (not cua-mode))))
(define-key menu-bar-options-menu [toggle-global-lazy-font-lock-mode]
(menu-bar-make-mm-toggle global-font-lock-mode
"Syntax Highlighting"
--- 900,911 ----
(define-key menu-bar-options-menu [highlight-paren-mode]
(menu-bar-make-mm-toggle show-paren-mode
"Paren Match Highlighting"
! "Highlight matching/mismatched parentheses at cursor
(Show Paren mode)"))
(define-key menu-bar-options-menu [transient-mark-mode]
! (menu-bar-make-mm-toggle transient-mark-mode
! "Active Region Highlighting"
! "Make text in active region stand out in color
(Transient Mark mode)"
! (:enable (not cua-mode))))
(define-key menu-bar-options-menu [toggle-global-lazy-font-lock-mode]
(menu-bar-make-mm-toggle global-font-lock-mode
"Syntax Highlighting"
***************
*** 1540,1560 ****
(menu-bar-update-buffers)
;; this version is too slow
! ;;;(defun format-buffers-menu-line (buffer)
! ;;; "Returns a string to represent the given buffer in the Buffer menu.
! ;;;nil means the buffer shouldn't be listed. You can redefine this."
! ;;; (if (string-match "\\` " (buffer-name buffer))
! ;;; nil
! ;;; (save-excursion
! ;;; (set-buffer buffer)
! ;;; (let ((size (buffer-size)))
! ;;; (format "%s%s %-19s %6s %-15s %s"
! ;;; (if (buffer-modified-p) "*" " ")
! ;;; (if buffer-read-only "%" " ")
! ;;; (buffer-name)
! ;;; size
! ;;; mode-name
! ;;; (or (buffer-file-name) ""))))))
;;; Set up a menu bar menu for the minibuffer.
--- 1531,1551 ----
(menu-bar-update-buffers)
;; this version is too slow
! ;;(defun format-buffers-menu-line (buffer)
! ;; "Returns a string to represent the given buffer in the Buffer menu.
! ;;nil means the buffer shouldn't be listed. You can redefine this."
! ;; (if (string-match "\\` " (buffer-name buffer))
! ;; nil
! ;; (save-excursion
! ;; (set-buffer buffer)
! ;; (let ((size (buffer-size)))
! ;; (format "%s%s %-19s %6s %-15s %s"
! ;; (if (buffer-modified-p) "*" " ")
! ;; (if buffer-read-only "%" " ")
! ;; (buffer-name)
! ;; size
! ;; mode-name
! ;; (or (buffer-file-name) ""))))))
;;; Set up a menu bar menu for the minibuffer.