emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/easy-mmode.el


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/emacs-lisp/easy-mmode.el
Date: Wed, 14 Aug 2002 21:06:05 -0400

Index: emacs/lisp/emacs-lisp/easy-mmode.el
diff -c emacs/lisp/emacs-lisp/easy-mmode.el:1.39 
emacs/lisp/emacs-lisp/easy-mmode.el:1.40
*** emacs/lisp/emacs-lisp/easy-mmode.el:1.39    Mon Aug 12 21:49:13 2002
--- emacs/lisp/emacs-lisp/easy-mmode.el Wed Aug 14 21:06:05 2002
***************
*** 107,113 ****
    (let* ((mode-name (symbol-name mode))
         (pretty-name (easy-mmode-pretty-mode-name mode lighter))
         (globalp nil)
-        (togglep t) ;; This should never be nil -- rms.
         (group nil)
         (extra-args nil)
         (keymap-sym (if (and keymap (symbolp keymap)) keymap
--- 107,112 ----
***************
*** 172,187 ****
         ,(or doc
              (format (concat "Toggle %s on or off.
  Interactively, with no prefix argument, toggle the mode.
! With universal prefix ARG " (unless togglep "(or if ARG is nil) ") "turn mode 
on.
  With zero or negative ARG turn mode off.
  \\{%s}") pretty-name keymap-sym))
!        ;; Make no arg by default in an interactive call,
!        ;; so that repeating the command toggles again.
!        (interactive "P")
         (setq ,mode
!              (if arg
!                  (> (prefix-numeric-value arg) 0)
!                ,(if togglep `(not ,mode) t)))
         ,@body
         ;; The on/off hooks are here for backward compatibility only.
         (run-hooks ',hook (if ,mode ',hook-on ',hook-off))
--- 171,192 ----
         ,(or doc
              (format (concat "Toggle %s on or off.
  Interactively, with no prefix argument, toggle the mode.
! With universal prefix ARG turn mode on.
  With zero or negative ARG turn mode off.
  \\{%s}") pretty-name keymap-sym))
!        ;; Use `toggle' rather than (if ,mode 0 1) so that using
!        ;; repeat-command still does the toggling correctly.
!        (interactive (list (or current-prefix-arg 'toggle)))
         (setq ,mode
!              (cond
!               ((eq arg 'toggle) (not ,mode))
!               (arg (> (prefix-numeric-value arg) 0))
!               (t
!                (if (null ,mode) t
!                  (message
!                   "Toggling %s off; better pass an explicit argument."
!                   ',mode)
!                  nil))))
         ,@body
         ;; The on/off hooks are here for backward compatibility only.
         (run-hooks ',hook (if ,mode ',hook-on ',hook-off))
***************
*** 266,274 ****
         ;; Setup hook to handle future mode changes and new buffers.
         (if ,global-mode
             (progn
!              (add-hook 'find-file-hooks ',buffers)
               (add-hook 'change-major-mode-hook ',cmmh))
!          (remove-hook 'find-file-hooks ',buffers)
           (remove-hook 'change-major-mode-hook ',cmmh))
  
         ;; Go through existing buffers.
--- 271,279 ----
         ;; Setup hook to handle future mode changes and new buffers.
         (if ,global-mode
             (progn
!              (add-hook 'find-file-hook ',buffers)
               (add-hook 'change-major-mode-hook ',cmmh))
!          (remove-hook 'find-file-hook ',buffers)
           (remove-hook 'change-major-mode-hook ',cmmh))
  
         ;; Go through existing buffers.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]