Mercurial > hg > xemacs-beta
diff lisp/prim/modeline.el @ 70:131b0175ea99 r20-0b30
Import from CVS: tag r20-0b30
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:02:59 +0200 |
parents | e04119814345 |
children | 0d2f883870bc |
line wrap: on
line diff
--- a/lisp/prim/modeline.el Mon Aug 13 09:00:04 2007 +0200 +++ b/lisp/prim/modeline.el Mon Aug 13 09:02:59 2007 +0200 @@ -17,7 +17,7 @@ ;; You should have received a copy of the GNU General Public License ;; along with XEmacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Synched up with: Not in FSF. @@ -293,34 +293,32 @@ (defun modeline-minor-mode-menu (event) (interactive "e") - (save-excursion - (set-buffer (event-buffer event)) - (popup-menu-and-execute-in-window - (cons (format "Minor Mode Commands for %S:" - (buffer-name (event-buffer event))) - (apply 'nconc - (mapcar - #'(lambda (x) - (let* ((toggle-sym (car x)) - (toggle-fun - (or (get toggle-sym - 'modeline-toggle-function) - (and (fboundp toggle-sym) - (commandp toggle-sym) - toggle-sym)))) - (if (not toggle-fun) nil - (list (vector - (concat (if (and (boundp toggle-sym) - (symbol-value toggle-sym)) - "turn off " "turn on ") - (if (symbolp toggle-fun) - (symbol-name toggle-fun) - (symbol-name toggle-sym))) - - toggle-fun - t))))) - minor-mode-alist))) - event))) + (popup-menu-and-execute-in-window + (cons (format "Minor Mode Commands for %S:" + (buffer-name (event-buffer event))) + (apply 'nconc + (mapcar + #'(lambda (x) + (let* ((toggle-sym (car x)) + (toggle-fun + (or (get toggle-sym + 'modeline-toggle-function) + (and (fboundp toggle-sym) + (commandp toggle-sym) + toggle-sym)))) + (if (not toggle-fun) nil + (list (vector + (concat (if (and (boundp toggle-sym) + (symbol-value toggle-sym)) + "turn off " "turn on ") + (if (symbolp toggle-fun) + (symbol-name toggle-fun) + (symbol-name toggle-sym))) + + toggle-fun + t))))) + minor-mode-alist))) + event)) (defvar modeline-minor-mode-map (make-sparse-keymap 'modeline-minor-mode-map) "Keymap consulted for mouse-clicks on the minor-mode modeline list.") @@ -396,7 +394,7 @@ (defvar modeline-modified-map (make-sparse-keymap 'modeline-modified-map) "Keymap consulted for mouse-clicks on the modeline-modified string.") (define-key modeline-modified-map 'button2 - (make-modeline-command-wrapper 'vc-toggle-read-only)) + (make-modeline-command-wrapper 'toggle-read-only)) (defvar modeline-modified-extent (make-extent nil nil) "Extent covering the modeline-modified string.") @@ -421,21 +419,20 @@ (set-extent-property modeline-narrowed-extent 'help-echo "button2 widens the buffer") -(setq-default modeline-format - (list (purecopy "") - (cons modeline-modified-extent - 'modeline-modified) - (cons modeline-buffer-id-extent - 'modeline-buffer-identification) - (purecopy " ") - 'global-mode-string - (purecopy " %[(") - (cons modeline-minor-mode-extent - (list "" 'mode-name 'minor-mode-alist)) - (cons modeline-narrowed-extent "%n") - 'modeline-process - (purecopy ")%]----") - (purecopy '(line-number-mode "L%l--")) - (purecopy '(column-number-mode "C%c--")) - (purecopy '(-3 . "%p")) - (purecopy "-%-"))) +(setq-default + modeline-format + (list + (purecopy "") + (cons modeline-modified-extent 'modeline-modified) + (cons modeline-buffer-id-extent 'modeline-buffer-identification) + (purecopy " ") + 'global-mode-string + (purecopy " %[(") + (cons modeline-minor-mode-extent (list "" 'mode-name 'minor-mode-alist)) + (cons modeline-narrowed-extent "%n") + 'modeline-process + (purecopy ")%]----") + (purecopy '(line-number-mode "L%l--")) + (purecopy '(column-number-mode "C%c--")) + (purecopy '(-3 . "%p")) + (purecopy "-%-")))