]> code.delx.au - gnu-emacs/blobdiff - lisp/mail/footnote.el
Update copyright year to 2015
[gnu-emacs] / lisp / mail / footnote.el
index 0f1669562de3772bc7b0645dc86ee52db502cfa4..ea674434a2fbfc5bfcd05fd205d1fcdc9f357f12 100644 (file)
@@ -1,6 +1,6 @@
 ;;; footnote.el --- footnote support for message mode  -*- coding: utf-8;-*-
 
-;; Copyright (C) 1997, 2000-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2000-2015 Free Software Foundation, Inc.
 
 ;; Author: Steven L Baur <steve@xemacs.org>
 ;; Keywords: mail, news
@@ -35,9 +35,8 @@
 
 ;;; Code:
 
-(eval-when-compile
-  (require 'cl)
-  (defvar filladapt-token-table))
+(eval-when-compile (require 'cl-lib))
+(defvar filladapt-token-table)
 
 (defgroup footnote nil
   "Support for footnotes in mail and news messages."
@@ -46,6 +45,7 @@
 
 (defcustom footnote-mode-line-string " FN"
   "String to display in modes section of the mode-line."
+  :type 'string
   :group 'footnote)
 
 (defcustom footnote-mode-hook nil
@@ -87,10 +87,8 @@ displaying footnotes."
   "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
-  )
+  :type 'key-sequence
+  :group 'footnote)
 
 ;;; Interface variables that probably shouldn't be changed
 
@@ -126,10 +124,12 @@ has no effect on buffers already displaying footnotes."
   :type 'string
   :group 'footnote)
 
-(defvar footnote-signature-separator (if (boundp 'message-signature-separator)
-                                        message-signature-separator
-                                      "^-- $")
-  "*String used to recognize .signatures.")
+(defcustom footnote-signature-separator (if (boundp 'message-signature-separator)
+                                           message-signature-separator
+                                         "^-- $")
+  "Regexp used by Footnote mode to recognize signatures."
+  :type 'regexp
+  :group 'footnote)
 
 ;;; Private variables
 
@@ -294,14 +294,14 @@ Use a range of Latin-1 non-ASCII characters for footnoting."
 ;; Unicode
 
 (defconst footnote-unicode-string "⁰¹²³⁴⁵⁶⁷⁸⁹"
-  "String of unicode footnoting characters.")
+  "String of Unicode footnoting characters.")
 
 (defconst footnote-unicode-regexp (concat "[" footnote-unicode-string "]+")
-  "Regexp for unicode footnoting characters.")
+  "Regexp for Unicode footnoting characters.")
 
 (defun Footnote-unicode (n)
   "Unicode footnote style.
-Use unicode characters for footnoting."
+Use Unicode characters for footnoting."
   (let (modulus result done)
     (while (not done)
       (setq modulus (mod n 10)
@@ -348,7 +348,7 @@ buffer use the command `Footnote-set-style'."
 
 ;;; Style utilities & functions
 (defun Footnote-style-p (style)
-  "Return non-nil if style is a valid style known to footnote-mode."
+  "Return non-nil if style is a valid style known to `footnote-mode'."
   (assq style footnote-style-alist))
 
 (defun Footnote-index-to-string (index)
@@ -642,12 +642,12 @@ If the variable `footnote-narrow-to-footnotes-when-editing' is set,
 the buffer is narrowed to the footnote body.  The restriction is removed
 by using `Footnote-back-to-message'."
   (interactive "*P")
-  (let (num)
-    (if footnote-text-marker-alist
-       (if (< (point) (cadar (last footnote-pointer-marker-alist)))
-           (setq num (Footnote-make-hole))
-         (setq num (1+ (caar (last footnote-text-marker-alist)))))
-      (setq num 1))
+  (let ((num
+         (if footnote-text-marker-alist
+             (if (< (point) (cl-cadar (last footnote-pointer-marker-alist)))
+                 (Footnote-make-hole)
+               (1+ (caar (last footnote-text-marker-alist))))
+           1)))
     (message "Adding footnote %d" num)
     (Footnote-insert-footnote num)
     (insert-before-markers (make-string footnote-body-tag-spacing ? ))