emacs-pretest-bug
[Top][All Lists]
Advanced

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

minor modes


From: Dave Love
Subject: minor modes
Date: 16 Apr 2003 18:11:53 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

A few things connected with minor modes:

I don't understand `minor-mode-list'.  It clearly isn't `List of all
minor mode functions.' per the doc string, since it's apparently only
updated by the deprecated `add-minor-mode'

I derived a list of those defined with `define-minor-mode' as below
(with which to build a minor-modes Custom group).

Trying to implement such a group emphasizes that I think the doc
strings used/generated by `define-minor-mode' need changing.  In a
Custom group, the doc presented for the mode variables normally isn't
very helpful, since it typically indirects to a function's doc, rather
than showing a direct explanation of what the mode does.  I think the
explanation should somehow be added to the doc of the variable
directly.  Ideally the single line of doc that's initially shown in
Custom should say what the mode does, not that the option toggles an
unexplained mode.  E.g. for `delete-selection-mode', it might be
something like "Typed text replaces the selection.".

*** cus-dep.el.~1.30.~  Wed Feb  5 18:51:23 2003
--- cus-dep.el  Wed Apr 16 12:45:00 2003
***************
*** 33,38 ****
--- 33,41 ----
  (defvar generated-custom-dependencies-file "cus-load.el"
    "File \\[cusom-make-dependencies] puts custom dependencies into.")
  
+ ;; Defined elsewhere, but only gets a few entries.
+ (defvar minor-mode-list nil)
+ 
  (defun custom-make-dependencies ()
    "Batch function to extract custom dependencies from .el files.
  Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
***************
*** 66,80 ****
                     nil t))
                  (setq name (intern name)))
              (condition-case nil
!                 (while (re-search-forward
!                         "^(def\\(custom\\|face\\|group\\)" nil t)
!                   (beginning-of-line)
!                   (let ((expr (read (current-buffer))))
!                     (condition-case nil
!                         (let ((custom-dont-initialize t))
!                           (eval expr)
!                           (put (nth 1 expr) 'custom-where name))
!                       (error nil))))
                (error nil))))))))
    (message "Generating %s..." generated-custom-dependencies-file)
    (set-buffer (find-file-noselect generated-custom-dependencies-file))
--- 69,89 ----
                     nil t))
                  (setq name (intern name)))
              (condition-case nil
!                 (progn
!                   (while (re-search-forward
!                           "^(def\\(custom\\|face\\|group\\)" nil t)
!                     (beginning-of-line)
!                     (let ((expr (read (current-buffer))))
!                       (condition-case nil
!                           (let ((custom-dont-initialize t))
!                             (eval expr)
!                             (put (nth 1 expr) 'custom-where name))
!                         (error nil))))
!                   (while (re-search-forward "^(define-minor-mode" nil t)
!                     (let ((name (read (current-buffer))))
!                       (add-to-list 'minor-mode-list name)
!                       (custom-add-to-group 'minor-modes name
!                                            'custom-variable))))
                (error nil))))))))
    (message "Generating %s..." generated-custom-dependencies-file)
    (set-buffer (find-file-noselect generated-custom-dependencies-file))
***************
*** 169,174 ****
--- 178,189 ----
            (if version-alist "'" ""))
      (prin1 version-alist (current-buffer))
      (insert "\n \"For internal use by custom.\")\n"))
+ 
+   (insert ?\n)
+   (dolist (mode minor-mode-list)
+     (insert "(custom-add-to-group 'minor-modes '")
+     (prin1 mode (current-buffer))
+     (insert " 'custom-variable)\n"))
  
    (insert "\
  




reply via email to

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