diff options
| author | Stefan Monnier | 2009-09-03 02:21:37 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2009-09-03 02:21:37 +0000 |
| commit | 734db3841680b1eed09eff8e1b902e879298042d (patch) | |
| tree | 427a9806da36e197528a3c92d2452815ec4aa44a | |
| parent | 7cef7ce343169850e48de169cf702a0b87886e6a (diff) | |
| download | emacs-734db3841680b1eed09eff8e1b902e879298042d.tar.gz emacs-734db3841680b1eed09eff8e1b902e879298042d.zip | |
(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.
| -rw-r--r-- | lisp/ChangeLog | 22 | ||||
| -rw-r--r-- | lisp/mail/footnote.el | 79 |
2 files changed, 42 insertions, 59 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 58139d07651..fb0d97bd3ab 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2009-09-03 Eduard Wiebe <usenet@pusto.de> | ||
| 2 | Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 3 | |||
| 4 | * mail/footnote.el (footnote-prefix): Make it a defcustom. | ||
| 5 | (footnote-mode-map): Move initialization into the declaration. | ||
| 6 | (footnote-minor-mode-map): Define it rather than changing global-map. | ||
| 7 | (footnote-mode): Use define-minor-mode. | ||
| 8 | |||
| 1 | 2009-09-02 Michael Albinus <michael.albinus@gmx.de> | 9 | 2009-09-02 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 10 | ||
| 3 | * net/tramp.el (tramp-handle-file-attributes-with-ls) | 11 | * net/tramp.el (tramp-handle-file-attributes-with-ls) |
| @@ -12,16 +20,14 @@ | |||
| 12 | (tramp-method-out-of-band-p): Additional parameter SIZE. | 20 | (tramp-method-out-of-band-p): Additional parameter SIZE. |
| 13 | (tramp-do-copy-or-rename-file, tramp-handle-file-local-copy) | 21 | (tramp-do-copy-or-rename-file, tramp-handle-file-local-copy) |
| 14 | (tramp-handle-write-region): Use it. | 22 | (tramp-handle-write-region): Use it. |
| 15 | (tramp-handle-insert-directory): Use "?\ " for compatibility | 23 | (tramp-handle-insert-directory): Use "?\ " for compatibility reasons. |
| 16 | reasons. | ||
| 17 | (tramp-handle-vc-registered): Check, whether the first run did | 24 | (tramp-handle-vc-registered): Check, whether the first run did |
| 18 | return files to be tested. | 25 | return files to be tested. |
| 19 | (tramp-advice-make-auto-save-file-name): Do not call directly | 26 | (tramp-advice-make-auto-save-file-name): Do not call directly |
| 20 | `tramp-handle-make-auto-save-file-name', because this would bypass | 27 | `tramp-handle-make-auto-save-file-name', because this would bypass |
| 21 | the locking mechanism. | 28 | the locking mechanism. |
| 22 | 29 | ||
| 23 | * net/tramp-compat.el (top): Autoload used functions from | 30 | * net/tramp-compat.el (top): Autoload used functions from tramp.el. |
| 24 | tramp.el. | ||
| 25 | (file-remote-p, process-file, start-file-process, set-file-times) | 31 | (file-remote-p, process-file, start-file-process, set-file-times) |
| 26 | (tramp-compat-file-attributes): Compatibility functions shall not | 32 | (tramp-compat-file-attributes): Compatibility functions shall not |
| 27 | call directly `tramp-handle-*', because this would bypass the | 33 | call directly `tramp-handle-*', because this would bypass the |
| @@ -71,8 +77,7 @@ | |||
| 71 | MI command -var-evaluate-expression. | 77 | MI command -var-evaluate-expression. |
| 72 | (gdb-var-list-children-regexp): Update from regexp-1 in gdb-ui.el | 78 | (gdb-var-list-children-regexp): Update from regexp-1 in gdb-ui.el |
| 73 | and tweak for case of string child. | 79 | and tweak for case of string child. |
| 74 | (gdb-var-list-children-handler): Update from handler-1 in | 80 | (gdb-var-list-children-handler): Update from handler-1 in gdb-ui.el. |
| 75 | gdb-ui.el. | ||
| 76 | 81 | ||
| 77 | 2009-09-01 Glenn Morris <rgm@gnu.org> | 82 | 2009-09-01 Glenn Morris <rgm@gnu.org> |
| 78 | 83 | ||
| @@ -187,7 +192,8 @@ | |||
| 187 | 192 | ||
| 188 | * emacs-lisp/byte-run.el (define-obsolete-face-alias): New macro. | 193 | * emacs-lisp/byte-run.el (define-obsolete-face-alias): New macro. |
| 189 | 194 | ||
| 190 | * apropos.el (apropos-symbols-internal): Handle (obsolete) face aliases. | 195 | * apropos.el (apropos-symbols-internal): |
| 196 | Handle (obsolete) face aliases. | ||
| 191 | 197 | ||
| 192 | * faces.el (describe-face): Adjust the output format to be more like | 198 | * faces.el (describe-face): Adjust the output format to be more like |
| 193 | describe-variable, and to mention (obsolete) face aliases. | 199 | describe-variable, and to mention (obsolete) face aliases. |
| @@ -233,7 +239,7 @@ | |||
| 233 | * net/ldap.el (ldap-search-internal): Use with-current-buffer and push. | 239 | * net/ldap.el (ldap-search-internal): Use with-current-buffer and push. |
| 234 | 240 | ||
| 235 | * net/imap.el (imap-send-command): Simplify. | 241 | * net/imap.el (imap-send-command): Simplify. |
| 236 | (imap-wait-for-tag): point-max - buffer-size. | 242 | (imap-wait-for-tag): point-max -> buffer-size. |
| 237 | 243 | ||
| 238 | * net/ange-ftp.el (internal-ange-ftp-mode): Use define-derived-mode. | 244 | * net/ange-ftp.el (internal-ange-ftp-mode): Use define-derived-mode. |
| 239 | 245 | ||
diff --git a/lisp/mail/footnote.el b/lisp/mail/footnote.el index 8a38f82d02f..16a6adc1007 100644 --- a/lisp/mail/footnote.el +++ b/lisp/mail/footnote.el | |||
| @@ -84,8 +84,14 @@ displaying footnotes." | |||
| 84 | :type 'integer | 84 | :type 'integer |
| 85 | :group 'footnote) | 85 | :group 'footnote) |
| 86 | 86 | ||
| 87 | (defvar footnote-prefix [(control ?c) ?!] | 87 | (defcustom footnote-prefix [(control ?c) ?!] |
| 88 | "*When not using `message-mode', the prefix to bind in `mode-specific-map'") | 88 | "Prefix key to use for Footnote command in Footnote minor mode. |
| 89 | The value of this variable is checked as part of loading Footnote mode. | ||
| 90 | After that, changing the prefix key requires manipulating keymaps." | ||
| 91 | ;; FIXME: the type should be a key-sequence, but it seems Custom | ||
| 92 | ;; doesn't support that yet. | ||
| 93 | ;; :type 'string | ||
| 94 | ) | ||
| 89 | 95 | ||
| 90 | ;;; Interface variables that probably shouldn't be changed | 96 | ;;; Interface variables that probably shouldn't be changed |
| 91 | 97 | ||
| @@ -143,10 +149,6 @@ has no effect on buffers already displaying footnotes." | |||
| 143 | (defvar footnote-mouse-highlight 'highlight | 149 | (defvar footnote-mouse-highlight 'highlight |
| 144 | "Text property name to enable mouse over highlight.") | 150 | "Text property name to enable mouse over highlight.") |
| 145 | 151 | ||
| 146 | (defvar footnote-mode nil | ||
| 147 | "Variable indicating whether footnote minor mode is active.") | ||
| 148 | (make-variable-buffer-local 'footnote-mode) | ||
| 149 | |||
| 150 | ;;; Default styles | 152 | ;;; Default styles |
| 151 | ;;; NUMERIC | 153 | ;;; NUMERIC |
| 152 | (defconst footnote-numeric-regexp "[0-9]+" | 154 | (defconst footnote-numeric-regexp "[0-9]+" |
| @@ -743,47 +745,32 @@ being set it is automatically widened." | |||
| 743 | (widen)) | 745 | (widen)) |
| 744 | (goto-char (cadr (assq note footnote-pointer-marker-alist)))))) | 746 | (goto-char (cadr (assq note footnote-pointer-marker-alist)))))) |
| 745 | 747 | ||
| 746 | (defvar footnote-mode-map nil | 748 | (defvar footnote-mode-map |
| 747 | "Keymap used for footnote minor mode.") | 749 | (let ((map (make-sparse-keymap))) |
| 748 | 750 | (define-key map "a" 'Footnote-add-footnote) | |
| 749 | ;; Set up our keys | 751 | (define-key map "b" 'Footnote-back-to-message) |
| 750 | (unless footnote-mode-map | 752 | (define-key map "c" 'Footnote-cycle-style) |
| 751 | (setq footnote-mode-map (make-sparse-keymap)) | 753 | (define-key map "d" 'Footnote-delete-footnote) |
| 752 | (define-key footnote-mode-map "a" 'Footnote-add-footnote) | 754 | (define-key map "g" 'Footnote-goto-footnote) |
| 753 | (define-key footnote-mode-map "b" 'Footnote-back-to-message) | 755 | (define-key map "r" 'Footnote-renumber-footnotes) |
| 754 | (define-key footnote-mode-map "c" 'Footnote-cycle-style) | 756 | (define-key map "s" 'Footnote-set-style) |
| 755 | (define-key footnote-mode-map "d" 'Footnote-delete-footnote) | 757 | map)) |
| 756 | (define-key footnote-mode-map "g" 'Footnote-goto-footnote) | 758 | |
| 757 | (define-key footnote-mode-map "r" 'Footnote-renumber-footnotes) | 759 | (defvar footnote-minor-mode-map |
| 758 | (define-key footnote-mode-map "s" 'Footnote-set-style)) | 760 | (let ((map (make-sparse-keymap))) |
| 759 | 761 | (define-key map footnote-prefix footnote-mode-map) | |
| 760 | (defvar footnote-minor-mode-map nil | 762 | map) |
| 761 | "Keymap used for binding footnote minor mode.") | 763 | "Keymap used for binding footnote minor mode.") |
| 762 | 764 | ||
| 763 | (unless footnote-minor-mode-map | ||
| 764 | (define-key global-map footnote-prefix footnote-mode-map)) | ||
| 765 | |||
| 766 | ;;;###autoload | 765 | ;;;###autoload |
| 767 | (defun footnote-mode (&optional arg) | 766 | (define-minor-mode footnote-mode |
| 768 | "Toggle footnote minor mode. | 767 | "Toggle footnote minor mode. |
| 769 | \\<message-mode-map> | ||
| 770 | This minor mode provides footnote support for `message-mode'. To get | 768 | This minor mode provides footnote support for `message-mode'. To get |
| 771 | started, play around with the following keys: | 769 | started, play around with the following keys: |
| 772 | key binding | 770 | \\{footnote-minor-mode-map}" |
| 773 | --- ------- | 771 | :lighter footnote-mode-line-string |
| 774 | \\[Footnote-add-footnote] Footnote-add-footnote | 772 | :keymap footnote-minor-mode-map |
| 775 | \\[Footnote-back-to-message] Footnote-back-to-message | ||
| 776 | \\[Footnote-delete-footnote] Footnote-delete-footnote | ||
| 777 | \\[Footnote-goto-footnote] Footnote-goto-footnote | ||
| 778 | \\[Footnote-renumber-footnotes] Footnote-renumber-footnotes | ||
| 779 | \\[Footnote-cycle-style] Footnote-cycle-style | ||
| 780 | \\[Footnote-set-style] Footnote-set-style | ||
| 781 | " | ||
| 782 | (interactive "*P") | ||
| 783 | ;; (filladapt-mode t) | 773 | ;; (filladapt-mode t) |
| 784 | (setq footnote-mode | ||
| 785 | (if (null arg) (not footnote-mode) | ||
| 786 | (> (prefix-numeric-value arg) 0))) | ||
| 787 | (when footnote-mode | 774 | (when footnote-mode |
| 788 | ;; (Footnote-setup-keybindings) | 775 | ;; (Footnote-setup-keybindings) |
| 789 | (make-local-variable 'footnote-style) | 776 | (make-local-variable 'footnote-style) |
| @@ -793,9 +780,6 @@ key binding | |||
| 793 | (make-local-variable 'footnote-section-tag-regexp) | 780 | (make-local-variable 'footnote-section-tag-regexp) |
| 794 | (make-local-variable 'footnote-start-tag) | 781 | (make-local-variable 'footnote-start-tag) |
| 795 | (make-local-variable 'footnote-end-tag) | 782 | (make-local-variable 'footnote-end-tag) |
| 796 | (if (fboundp 'force-mode-line-update) | ||
| 797 | (force-mode-line-update) | ||
| 798 | (set-buffer-modified-p (buffer-modified-p))) | ||
| 799 | 783 | ||
| 800 | (when (boundp 'filladapt-token-table) | 784 | (when (boundp 'filladapt-token-table) |
| 801 | ;; add tokens to filladapt to match footnotes | 785 | ;; add tokens to filladapt to match footnotes |
| @@ -808,14 +792,7 @@ key binding | |||
| 808 | (unless (assoc bullet-regexp filladapt-token-table) | 792 | (unless (assoc bullet-regexp filladapt-token-table) |
| 809 | (setq filladapt-token-table | 793 | (setq filladapt-token-table |
| 810 | (append filladapt-token-table | 794 | (append filladapt-token-table |
| 811 | (list (list bullet-regexp 'bullet))))))) | 795 | (list (list bullet-regexp 'bullet))))))))) |
| 812 | |||
| 813 | (run-hooks 'footnote-mode-hook))) | ||
| 814 | |||
| 815 | (unless (assq 'footnote-mode minor-mode-alist) | ||
| 816 | (setq minor-mode-alist | ||
| 817 | (cons '(footnote-mode footnote-mode-line-string) | ||
| 818 | minor-mode-alist))) | ||
| 819 | 796 | ||
| 820 | (provide 'footnote) | 797 | (provide 'footnote) |
| 821 | 798 | ||