+2009-09-03 Eduard Wiebe <usenet@pusto.de>
+ Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * 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 <michael.albinus@gmx.de>
* net/tramp.el (tramp-handle-file-attributes-with-ls)
(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
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 <rgm@gnu.org>
* 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.
* 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.
: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
(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]+"
(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)
(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
(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)