emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp ChangeLog mail/footnote.el


From: Stefan Monnier
Subject: [Emacs-diffs] emacs/lisp ChangeLog mail/footnote.el
Date: Thu, 03 Sep 2009 02:21:41 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        09/09/03 02:21:40

Modified files:
        lisp           : ChangeLog 
        lisp/mail      : footnote.el 

Log message:
        (footnote-prefix): Make it a defcustom.
        (footnote-mode-map): Move initialization into the declaration.
        (footnote-minor-mode-map): Define it rather than changing global-map.
        (footnote-mode): Use define-minor-mode.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.16087&r2=1.16088
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/mail/footnote.el?cvsroot=emacs&r1=1.28&r2=1.29

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.16087
retrieving revision 1.16088
diff -u -b -r1.16087 -r1.16088
--- ChangeLog   2 Sep 2009 11:15:56 -0000       1.16087
+++ ChangeLog   3 Sep 2009 02:21:37 -0000       1.16088
@@ -1,3 +1,11 @@
+2009-09-03  Eduard Wiebe  <address@hidden>
+           Stefan Monnier  <address@hidden>
+
+       * mail/footnote.el (footnote-prefix): Make it a defcustom.
+       (footnote-mode-map): Move initialization into the declaration.
+       (footnote-minor-mode-map): Define it rather than changing global-map.
+       (footnote-mode): Use define-minor-mode.
+
 2009-09-02  Michael Albinus  <address@hidden>
 
        * net/tramp.el (tramp-handle-file-attributes-with-ls)
@@ -12,16 +20,14 @@
        (tramp-method-out-of-band-p): Additional parameter SIZE.
        (tramp-do-copy-or-rename-file, tramp-handle-file-local-copy)
        (tramp-handle-write-region): Use it.
-       (tramp-handle-insert-directory): Use "?\ " for compatibility
-       reasons.
+       (tramp-handle-insert-directory): Use "?\ " for compatibility reasons.
        (tramp-handle-vc-registered): Check, whether the first run did
        return files to be tested.
        (tramp-advice-make-auto-save-file-name): Do not call directly
        `tramp-handle-make-auto-save-file-name', because this would bypass
        the locking mechanism.
 
-       * net/tramp-compat.el (top): Autoload used functions from
-       tramp.el.
+       * net/tramp-compat.el (top): Autoload used functions from tramp.el.
        (file-remote-p, process-file, start-file-process, set-file-times)
        (tramp-compat-file-attributes): Compatibility functions shall not
        call directly `tramp-handle-*', because this would bypass the
@@ -71,8 +77,7 @@
        MI command -var-evaluate-expression.
        (gdb-var-list-children-regexp): Update from regexp-1 in gdb-ui.el
        and tweak for case of string child.
-       (gdb-var-list-children-handler): Update from handler-1 in
-       gdb-ui.el.
+       (gdb-var-list-children-handler): Update from handler-1 in gdb-ui.el.
 
 2009-09-01  Glenn Morris  <address@hidden>
 
@@ -187,7 +192,8 @@
 
        * emacs-lisp/byte-run.el (define-obsolete-face-alias): New macro.
 
-       * apropos.el (apropos-symbols-internal): Handle (obsolete) face aliases.
+       * apropos.el (apropos-symbols-internal):
+       Handle (obsolete) face aliases.
 
        * faces.el (describe-face): Adjust the output format to be more like
        describe-variable, and to mention (obsolete) face aliases.
@@ -233,7 +239,7 @@
        * net/ldap.el (ldap-search-internal): Use with-current-buffer and push.
 
        * net/imap.el (imap-send-command): Simplify.
-       (imap-wait-for-tag): point-max - buffer-size.
+       (imap-wait-for-tag): point-max -> buffer-size.
 
        * net/ange-ftp.el (internal-ange-ftp-mode): Use define-derived-mode.
 

Index: mail/footnote.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/mail/footnote.el,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- mail/footnote.el    5 Jan 2009 03:22:32 -0000       1.28
+++ mail/footnote.el    3 Sep 2009 02:21:40 -0000       1.29
@@ -84,8 +84,14 @@
   :type 'integer
   :group 'footnote)
 
-(defvar footnote-prefix [(control ?c) ?!]
-  "*When not using `message-mode', the prefix to bind in `mode-specific-map'")
+(defcustom footnote-prefix [(control ?c) ?!]
+  "Prefix key to use for Footnote command in Footnote minor mode.
+The value of this variable is checked as part of loading Footnote mode.
+After that, changing the prefix key requires manipulating keymaps."
+  ;; FIXME: the type should be a key-sequence, but it seems Custom
+  ;; doesn't support that yet.
+  ;; :type  'string
+  )
 
 ;;; Interface variables that probably shouldn't be changed
 
@@ -143,10 +149,6 @@
 (defvar footnote-mouse-highlight 'highlight
   "Text property name to enable mouse over highlight.")
 
-(defvar footnote-mode nil
-  "Variable indicating whether footnote minor mode is active.")
-(make-variable-buffer-local 'footnote-mode)
-
 ;;; Default styles
 ;;; NUMERIC
 (defconst footnote-numeric-regexp "[0-9]+"
@@ -743,47 +745,32 @@
        (widen))
       (goto-char (cadr (assq note footnote-pointer-marker-alist))))))
 
-(defvar footnote-mode-map nil
-  "Keymap used for footnote minor mode.")
-
-;; Set up our keys
-(unless footnote-mode-map
-  (setq footnote-mode-map (make-sparse-keymap))
-  (define-key footnote-mode-map "a" 'Footnote-add-footnote)
-  (define-key footnote-mode-map "b" 'Footnote-back-to-message)
-  (define-key footnote-mode-map "c" 'Footnote-cycle-style)
-  (define-key footnote-mode-map "d" 'Footnote-delete-footnote)
-  (define-key footnote-mode-map "g" 'Footnote-goto-footnote)
-  (define-key footnote-mode-map "r" 'Footnote-renumber-footnotes)
-  (define-key footnote-mode-map "s" 'Footnote-set-style))
-
-(defvar footnote-minor-mode-map nil
+(defvar footnote-mode-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map "a" 'Footnote-add-footnote)
+    (define-key map "b" 'Footnote-back-to-message)
+    (define-key map "c" 'Footnote-cycle-style)
+    (define-key map "d" 'Footnote-delete-footnote)
+    (define-key map "g" 'Footnote-goto-footnote)
+    (define-key map "r" 'Footnote-renumber-footnotes)
+    (define-key map "s" 'Footnote-set-style)
+    map))
+
+(defvar footnote-minor-mode-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map footnote-prefix footnote-mode-map)
+    map)
   "Keymap used for binding footnote minor mode.")
 
-(unless footnote-minor-mode-map
-  (define-key global-map footnote-prefix footnote-mode-map))
-
 ;;;###autoload
-(defun footnote-mode (&optional arg)
+(define-minor-mode footnote-mode
   "Toggle footnote minor mode.
-\\<message-mode-map>
 This minor mode provides footnote support for `message-mode'.  To get
 started, play around with the following keys:
-key            binding
----            -------
-\\[Footnote-add-footnote]              Footnote-add-footnote
-\\[Footnote-back-to-message]           Footnote-back-to-message
-\\[Footnote-delete-footnote]           Footnote-delete-footnote
-\\[Footnote-goto-footnote]             Footnote-goto-footnote
-\\[Footnote-renumber-footnotes]                Footnote-renumber-footnotes
-\\[Footnote-cycle-style]               Footnote-cycle-style
-\\[Footnote-set-style]         Footnote-set-style
-"
-  (interactive "*P")
+\\{footnote-minor-mode-map}"
+  :lighter    footnote-mode-line-string
+  :keymap     footnote-minor-mode-map
   ;; (filladapt-mode t)
-  (setq footnote-mode
-       (if (null arg) (not footnote-mode)
-         (> (prefix-numeric-value arg) 0)))
   (when footnote-mode
     ;; (Footnote-setup-keybindings)
     (make-local-variable 'footnote-style)
@@ -793,9 +780,6 @@
     (make-local-variable 'footnote-section-tag-regexp)
     (make-local-variable 'footnote-start-tag)
     (make-local-variable 'footnote-end-tag)
-    (if (fboundp 'force-mode-line-update)
-       (force-mode-line-update)
-      (set-buffer-modified-p (buffer-modified-p)))
 
     (when (boundp 'filladapt-token-table)
       ;; add tokens to filladapt to match footnotes
@@ -808,14 +792,7 @@
        (unless (assoc bullet-regexp filladapt-token-table)
          (setq filladapt-token-table
                (append filladapt-token-table
-                       (list (list bullet-regexp 'bullet)))))))
-
-    (run-hooks 'footnote-mode-hook)))
-
-(unless (assq 'footnote-mode minor-mode-alist)
-  (setq minor-mode-alist
-       (cons '(footnote-mode footnote-mode-line-string)
-             minor-mode-alist)))
+                       (list (list bullet-regexp 'bullet)))))))))
 
 (provide 'footnote)
 




reply via email to

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