diff options
| author | Dave Love | 1999-12-12 16:04:25 +0000 |
|---|---|---|
| committer | Dave Love | 1999-12-12 16:04:25 +0000 |
| commit | 409f8a3f94499a64d162a34cd0c347565f854a0b (patch) | |
| tree | b414b29e5f961f9bba32380077aee26d52b07da0 | |
| parent | d8eccf12babe66afa07529569ef5ce6800561ae1 (diff) | |
| download | emacs-409f8a3f94499a64d162a34cd0c347565f854a0b.tar.gz emacs-409f8a3f94499a64d162a34cd0c347565f854a0b.zip | |
Require cl when compiling. Don't autoload kemap and minor-mode-alist
stuff. Don't set zmacs-region-stays.
(footnote-insert-text-marker, Footnote-insert-pointer-marker): Avoid
`acons'.
(footnote-mode-line-string, Footnote-add-footnote): Remove autoload
cookie.
| -rw-r--r-- | lisp/mail/footnote.el | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/lisp/mail/footnote.el b/lisp/mail/footnote.el index 3563a893178..7576269c9f5 100644 --- a/lisp/mail/footnote.el +++ b/lisp/mail/footnote.el | |||
| @@ -6,25 +6,23 @@ | |||
| 6 | ;; Keywords: mail, news | 6 | ;; Keywords: mail, news |
| 7 | ;; Version: 0.19 | 7 | ;; Version: 0.19 |
| 8 | 8 | ||
| 9 | ;; This file is part of XEmacs. | 9 | ;; This file is part of GNU Emacs. |
| 10 | 10 | ||
| 11 | ;; XEmacs is free software; you can redistribute it and/or modify it | 11 | ;; GNU Emacs is free software; you can redistribute it and/or modify it |
| 12 | ;; under the terms of the GNU General Public License as published by | 12 | ;; under the terms of the GNU General Public License as published by |
| 13 | ;; the Free Software Foundation; either version 2, or (at your option) | 13 | ;; the Free Software Foundation; either version 2, or (at your option) |
| 14 | ;; any later version. | 14 | ;; any later version. |
| 15 | 15 | ||
| 16 | ;; XEmacs is distributed in the hope that it will be useful, but | 16 | ;; GNU Emacs is distributed in the hope that it will be useful, but |
| 17 | ;; WITHOUT ANY WARRANTY; without even the implied warranty of | 17 | ;; WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 18 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 19 | ;; General Public License for more details. | 19 | ;; General Public License for more details. |
| 20 | 20 | ||
| 21 | ;; You should have received a copy of the GNU General Public License | 21 | ;; You should have received a copy of the GNU General Public License |
| 22 | ;; along with XEmacs; see the file COPYING. If not, write to the Free | 22 | ;; along with GNU Emacs; see the file COPYING. If not, write to the Free |
| 23 | ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | 23 | ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 24 | ;; 02111-1307, USA. | 24 | ;; 02111-1307, USA. |
| 25 | 25 | ||
| 26 | ;;; Synched up with: Not in FSF | ||
| 27 | |||
| 28 | ;;; Commentary: | 26 | ;;; Commentary: |
| 29 | 27 | ||
| 30 | ;; This file provides footnote[1] support for message-mode in emacsen. | 28 | ;; This file provides footnote[1] support for message-mode in emacsen. |
| @@ -59,11 +57,14 @@ | |||
| 59 | 57 | ||
| 60 | ;;; Code: | 58 | ;;; Code: |
| 61 | 59 | ||
| 60 | (eval-when-compile | ||
| 61 | (require 'cl) | ||
| 62 | (defvar filladapt-token-table)) | ||
| 63 | |||
| 62 | (defgroup footnote nil | 64 | (defgroup footnote nil |
| 63 | "Support for footnotes in mail and news messages." | 65 | "Support for footnotes in mail and news messages." |
| 64 | :group 'message) | 66 | :group 'message) |
| 65 | 67 | ||
| 66 | ;;;###autoload | ||
| 67 | (defcustom footnote-mode-line-string " FN" | 68 | (defcustom footnote-mode-line-string " FN" |
| 68 | "*String to display in modes section of the mode-line." | 69 | "*String to display in modes section of the mode-line." |
| 69 | :group 'footnote) | 70 | :group 'footnote) |
| @@ -112,7 +113,6 @@ like 'hebrew, 'greek-lower, and 'greek-upper." | |||
| 112 | :type 'integer | 113 | :type 'integer |
| 113 | :group 'footnote) | 114 | :group 'footnote) |
| 114 | 115 | ||
| 115 | ;;;###autoload | ||
| 116 | (defvar footnote-prefix [(control ?c) ?!] | 116 | (defvar footnote-prefix [(control ?c) ?!] |
| 117 | "*When not using message mode, the prefix to bind in `mode-specific-map'") | 117 | "*When not using message mode, the prefix to bind in `mode-specific-map'") |
| 118 | 118 | ||
| @@ -456,7 +456,7 @@ styles." | |||
| 456 | (unless (assq arg footnote-text-marker-alist) | 456 | (unless (assq arg footnote-text-marker-alist) |
| 457 | (set-marker marker locn) | 457 | (set-marker marker locn) |
| 458 | (setq footnote-text-marker-alist | 458 | (setq footnote-text-marker-alist |
| 459 | (acons arg marker footnote-text-marker-alist)) | 459 | (cons (cons arg marker) footnote-text-marker-alist)) |
| 460 | (setq footnote-text-marker-alist | 460 | (setq footnote-text-marker-alist |
| 461 | (Footnote-sort footnote-text-marker-alist))))) | 461 | (Footnote-sort footnote-text-marker-alist))))) |
| 462 | 462 | ||
| @@ -469,7 +469,7 @@ styles." | |||
| 469 | (setf alist | 469 | (setf alist |
| 470 | (cons marker (cdr alist))) | 470 | (cons marker (cdr alist))) |
| 471 | (setq footnote-pointer-marker-alist | 471 | (setq footnote-pointer-marker-alist |
| 472 | (acons arg (list marker) footnote-pointer-marker-alist)) | 472 | (cons (cons arg (list marker)) footnote-pointer-marker-alist)) |
| 473 | (setq footnote-pointer-marker-alist | 473 | (setq footnote-pointer-marker-alist |
| 474 | (Footnote-sort footnote-pointer-marker-alist))))) | 474 | (Footnote-sort footnote-pointer-marker-alist))))) |
| 475 | 475 | ||
| @@ -564,7 +564,6 @@ Nil is returned if the cursor is not over a footnote." | |||
| 564 | (setq i (1+ i))) | 564 | (setq i (1+ i))) |
| 565 | rc))) | 565 | rc))) |
| 566 | 566 | ||
| 567 | ;;;###autoload | ||
| 568 | (defun Footnote-add-footnote (&optional arg) | 567 | (defun Footnote-add-footnote (&optional arg) |
| 569 | "Add a numbered footnote. | 568 | "Add a numbered footnote. |
| 570 | The number the footnote receives is dependent upon the relative location | 569 | The number the footnote receives is dependent upon the relative location |
| @@ -658,7 +657,6 @@ delete the footnote with that number." | |||
| 658 | With no parameter, jump to the text of the footnote under (point). With arg | 657 | With no parameter, jump to the text of the footnote under (point). With arg |
| 659 | specified, jump to the text of that footnote." | 658 | specified, jump to the text of that footnote." |
| 660 | (interactive "P") | 659 | (interactive "P") |
| 661 | (setq zmacs-region-stays t) | ||
| 662 | (let (footnote) | 660 | (let (footnote) |
| 663 | (if arg | 661 | (if arg |
| 664 | (setq footnote (assq arg footnote-text-marker-alist)) | 662 | (setq footnote (assq arg footnote-text-marker-alist)) |
| @@ -679,19 +677,16 @@ If the cursor is not over the text of a footnote, point is not changed. | |||
| 679 | If the buffer was narrowed due to `footnote-narrow-to-footnotes-when-editing' | 677 | If the buffer was narrowed due to `footnote-narrow-to-footnotes-when-editing' |
| 680 | being set it is automatically widened." | 678 | being set it is automatically widened." |
| 681 | (interactive "P") | 679 | (interactive "P") |
| 682 | (setq zmacs-region-stays t) | ||
| 683 | (let ((note (Footnote-text-under-cursor))) | 680 | (let ((note (Footnote-text-under-cursor))) |
| 684 | (when note | 681 | (when note |
| 685 | (when footnote-narrow-to-footnotes-when-editing | 682 | (when footnote-narrow-to-footnotes-when-editing |
| 686 | (widen)) | 683 | (widen)) |
| 687 | (goto-char (cadr (assq note footnote-pointer-marker-alist)))))) | 684 | (goto-char (cadr (assq note footnote-pointer-marker-alist)))))) |
| 688 | 685 | ||
| 689 | ;;;###autoload | ||
| 690 | (defvar footnote-mode-map nil | 686 | (defvar footnote-mode-map nil |
| 691 | "Keymap used for footnote minor mode.") | 687 | "Keymap used for footnote minor mode.") |
| 692 | 688 | ||
| 693 | ;; Set up our keys | 689 | ;; Set up our keys |
| 694 | ;;;###autoload | ||
| 695 | (unless footnote-mode-map | 690 | (unless footnote-mode-map |
| 696 | (setq footnote-mode-map (make-sparse-keymap)) | 691 | (setq footnote-mode-map (make-sparse-keymap)) |
| 697 | (define-key footnote-mode-map "a" 'Footnote-add-footnote) | 692 | (define-key footnote-mode-map "a" 'Footnote-add-footnote) |
| @@ -702,11 +697,9 @@ being set it is automatically widened." | |||
| 702 | (define-key footnote-mode-map "r" 'Footnote-renumber-footnotes) | 697 | (define-key footnote-mode-map "r" 'Footnote-renumber-footnotes) |
| 703 | (define-key footnote-mode-map "s" 'Footnote-set-style)) | 698 | (define-key footnote-mode-map "s" 'Footnote-set-style)) |
| 704 | 699 | ||
| 705 | ;;;###autoload | ||
| 706 | (defvar footnote-minor-mode-map nil | 700 | (defvar footnote-minor-mode-map nil |
| 707 | "Keymap used for binding footnote minor mode.") | 701 | "Keymap used for binding footnote minor mode.") |
| 708 | 702 | ||
| 709 | ;;;###autoload | ||
| 710 | (unless footnote-minor-mode-map | 703 | (unless footnote-minor-mode-map |
| 711 | (define-key global-map footnote-prefix footnote-mode-map)) | 704 | (define-key global-map footnote-prefix footnote-mode-map)) |
| 712 | 705 | ||
| @@ -726,7 +719,6 @@ key binding | |||
| 726 | " | 719 | " |
| 727 | (interactive "*P") | 720 | (interactive "*P") |
| 728 | ;; (filladapt-mode t) | 721 | ;; (filladapt-mode t) |
| 729 | (setq zmacs-region-stays t) | ||
| 730 | (setq footnote-mode | 722 | (setq footnote-mode |
| 731 | (if (null arg) (not footnote-mode) | 723 | (if (null arg) (not footnote-mode) |
| 732 | (> (prefix-numeric-value arg) 0))) | 724 | (> (prefix-numeric-value arg) 0))) |
| @@ -752,15 +744,6 @@ key binding | |||
| 752 | 744 | ||
| 753 | (run-hooks 'footnote-mode-hook))) | 745 | (run-hooks 'footnote-mode-hook))) |
| 754 | 746 | ||
| 755 | ;; install on minor-mode-alist | ||
| 756 | ;;;###autoload | ||
| 757 | (when (fboundp 'add-minor-mode) | ||
| 758 | ;; XEmacs | ||
| 759 | (add-minor-mode 'footnote-mode | ||
| 760 | footnote-mode-line-string | ||
| 761 | footnote-minor-mode-map)) | ||
| 762 | |||
| 763 | ;; Emacs -- don't autoload | ||
| 764 | (unless (assq 'footnote-mode minor-mode-alist) | 747 | (unless (assq 'footnote-mode minor-mode-alist) |
| 765 | (setq minor-mode-alist | 748 | (setq minor-mode-alist |
| 766 | (cons '(footnote-mode footnote-mode-line-string) | 749 | (cons '(footnote-mode footnote-mode-line-string) |