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: Fri, 13 Sep 2002 10:16:02 -0400

Index: emacs/lisp/emacs-lisp/easy-mmode.el
diff -c emacs/lisp/emacs-lisp/easy-mmode.el:1.41 
emacs/lisp/emacs-lisp/easy-mmode.el:1.42
*** emacs/lisp/emacs-lisp/easy-mmode.el:1.41    Mon Aug 26 12:40:49 2002
--- emacs/lisp/emacs-lisp/easy-mmode.el Fri Sep 13 10:16:02 2002
***************
*** 90,100 ****
    It will be executed after any toggling but before running the hooks.
    BODY can start with a list of CL-style keys specifying additional arguments.
    The following keyword arguments are supported:
! :group   Followed by the group name to use for any generated `defcustom'.
! :global  If non-nil specifies that the minor mode is not meant to be
!          buffer-local.  By default, the variable is made buffer-local.
! :init-value  Same as the INIT-VALUE argument.
! :lighter  Same as the LIGHTER argument."
    ;; Allow skipping the first three args.
    (cond
     ((keywordp init-value)
--- 90,101 ----
    It will be executed after any toggling but before running the hooks.
    BODY can start with a list of CL-style keys specifying additional arguments.
    The following keyword arguments are supported:
! :group GROUP  Group name to use for any generated `defcustom'.
! :global GLOBAL        If non-nil specifies that the minor mode is not meant 
to be
!                       buffer-local.  By default, the variable is made 
buffer-local.
! :init-value VAL       Same as the INIT-VALUE argument.
! :lighter SPEC Same as the LIGHTER argument.
! :require SYM  Same as defcustom's :require argument."
    ;; Allow skipping the first three args.
    (cond
     ((keywordp init-value)
***************
*** 109,114 ****
--- 110,116 ----
         (globalp nil)
         (group nil)
         (extra-args nil)
+        (require t)
         (keymap-sym (if (and keymap (symbolp keymap)) keymap
                       (intern (concat mode-name "-map"))))
         (hook (intern (concat mode-name "-hook")))
***************
*** 123,128 ****
--- 125,131 ----
        (:global (setq globalp (pop body)))
        (:extra-args (setq extra-args (pop body)))
        (:group (setq group (nconc group (list :group (pop body)))))
+       (:require (setq require (pop body)))
        (t (pop body))))
  
      (unless group
***************
*** 159,170 ****
               :initialize 'custom-initialize-default
               ,@group
               :type 'boolean
!              ,@(when curfile
!                  (list
!                   :require
!                   (list 'quote
!                         (intern (file-name-nondirectory
!                                  (file-name-sans-extension curfile)))))))))
  
         ;; The actual function.
         (defun ,mode (&optional arg ,@extra-args)
--- 162,173 ----
               :initialize 'custom-initialize-default
               ,@group
               :type 'boolean
!              ,@(cond
!                 ((not (and curfile require)) nil)
!                 ((not (eq require t)) `(:require ,require))
!                 (t `(:require
!                      ',(intern (file-name-nondirectory
!                                 (file-name-sans-extension curfile)))))))))
  
         ;; The actual function.
         (defun ,mode (&optional arg ,@extra-args)
***************
*** 224,230 ****
                               (symbol-value ',keymap-sym))))
         
         ;; If the mode is global, call the function according to the default.
!        ,(if globalp
            `(if (and load-file-name ,mode)
                 (eval-after-load load-file-name '(,mode 1)))))))
  
--- 227,233 ----
                               (symbol-value ',keymap-sym))))
         
         ;; If the mode is global, call the function according to the default.
!        ,(if (and globalp (null init-value))
            `(if (and load-file-name ,mode)
                 (eval-after-load load-file-name '(,mode 1)))))))
  




reply via email to

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