Mercurial > emacs
annotate lisp/mail/supercite.el @ 63989:a1d03660a223
(edebug-eval-defun): Remove unnecessary quotes.
author | Juri Linkov <juri@jurta.org> |
---|---|
date | Mon, 04 Jul 2005 01:06:17 +0000 |
parents | eb399d132bf4 |
children | 72c3c77d111e |
rev | line source |
---|---|
4850 | 1 ;;; supercite.el --- minor mode for citing mail and news replies |
2 | |
60916
480134f8cd16
* mail/supercite.el: Replace `illegal' with `invalid'.
Werner LEMBERG <wl@gnu.org>
parents:
58952
diff
changeset
|
3 ;; Copyright (C) 1993, 1997, 2003, 2004, 2005 Free Software Foundation, Inc. |
12859
90c22a02c12b
(sc-attribs-extract-namestring): If name has <...>,
Richard M. Stallman <rms@gnu.org>
parents:
12425
diff
changeset
|
4 |
57160 | 5 ;; Author: 1993 Barry A. Warsaw <bwarsaw@python.org> |
62924 | 6 ;; Maintainer: Glenn Morris <gmorris@ast.cam.ac.uk> |
4850 | 7 ;; Created: February 1993 |
8 ;; Last Modified: 1993/09/22 18:58:46 | |
5140 | 9 ;; Keywords: mail, news |
4850 | 10 |
11 ;; supercite.el revision: 3.54 | |
12 | |
13 ;; This file is part of GNU Emacs. | |
14 | |
15 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
16 ;; it under the terms of the GNU General Public License as published by | |
17 ;; the Free Software Foundation; either version 2, or (at your option) | |
18 ;; any later version. | |
19 | |
20 ;; GNU Emacs is distributed in the hope that it will be useful, | |
21 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
23 ;; GNU General Public License for more details. | |
24 | |
25 ;; You should have received a copy of the GNU General Public License | |
14169 | 26 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
27 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
28 ;; Boston, MA 02111-1307, USA. | |
4850 | 29 |
30 ;; LCD Archive Entry | |
24612
8f10db1e779a
(sc-attrib-selection-list): Fix custom type
Dave Love <fx@gnu.org>
parents:
24426
diff
changeset
|
31 ;; supercite|Barry A. Warsaw|supercite-help@python.org |
4850 | 32 ;; |Mail and news reply citation package |
33 ;; |1993/09/22 18:58:46|3.1| | |
34 | |
38436
b174db545cfd
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
28437
diff
changeset
|
35 ;;; Commentary: |
b174db545cfd
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
28437
diff
changeset
|
36 |
b174db545cfd
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
28437
diff
changeset
|
37 ;;; Code: |
4850 | 38 |
39 | |
40 (require 'regi) | |
21861 | 41 (require 'sendmail) ;; For mail-header-end. |
4850 | 42 |
43 ;; start user configuration variables | |
44 ;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv | |
45 | |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
46 (defgroup supercite nil |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
47 "Supercite package" |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
48 :prefix "sc-" |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
49 :group 'mail |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
50 :group 'news) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
51 |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
52 (defgroup supercite-frames nil |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
53 "Supercite (regi) frames" |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
54 :prefix "sc-" |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
55 :group 'supercite) |
4850 | 56 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
57 (defgroup supercite-attr nil |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
58 "Supercite attributions" |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
59 :prefix "sc-" |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
60 :group 'supercite) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
61 |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
62 (defgroup supercite-cite nil |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
63 "Supercite citings" |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
64 :prefix "sc-" |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
65 :group 'supercite) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
66 |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
67 (defgroup supercite-hooks nil |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
68 "Hooking into supercite" |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
69 :prefix "sc-" |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
70 :group 'supercite) |
4850 | 71 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
72 (defcustom sc-auto-fill-region-p t |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
73 "*If non-nil, automatically fill each paragraph after it has been cited." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
74 :type 'boolean |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
75 :group 'supercite) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
76 |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
77 (defcustom sc-blank-lines-after-headers 1 |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
78 "*Number of blank lines to leave after mail headers have been nuked. |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
79 Set to nil, to use whatever blank lines happen to occur naturally." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
80 :type '(choice (const :tag "leave" nil) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
81 integer) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
82 :group 'supercite) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
83 |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
84 (defcustom sc-citation-leader " " |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
85 "*String comprising first part of a citation." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
86 :type 'string |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
87 :group 'supercite-cite) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
88 |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
89 (defcustom sc-citation-delimiter ">" |
4850 | 90 "*String comprising third part of a citation. |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
91 This string is used in both nested and non-nested citations." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
92 :type 'string |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
93 :group 'supercite-cite) |
4850 | 94 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
95 (defcustom sc-citation-separator " " |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
96 "*String comprising fourth and last part of a citation." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
97 :type 'string |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
98 :group 'supercite-cite) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
99 |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
100 (defcustom sc-citation-leader-regexp "[ \t]*" |
4850 | 101 "*Regexp describing citation leader for a cited line. |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
102 This should NOT have a leading `^' character." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
103 :type 'regexp |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
104 :group 'supercite-cite) |
4850 | 105 |
106 ;; Nemacs and Mule users note: please see the texinfo manual for | |
107 ;; suggestions on setting these variables. | |
28437 | 108 (defcustom sc-citation-root-regexp "[-._[:alnum:]]*" |
4850 | 109 "*Regexp describing variable root part of a citation for a cited line. |
110 This should NOT have a leading `^' character. See also | |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
111 `sc-citation-nonnested-root-regexp'." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
112 :type 'regexp |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
113 :group 'supercite-cite) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
114 |
28437 | 115 (defcustom sc-citation-nonnested-root-regexp "[-._[:alnum:]]+" |
4850 | 116 "*Regexp describing the variable root part of a nested citation. |
117 This should NOT have a leading `^' character. This variable is | |
14007
c6476f4bb121
(sc-citation-nonnested-root-regexp,
Karl Heuer <kwzh@gnu.org>
parents:
13813
diff
changeset
|
118 related to `sc-citation-root-regexp' but whereas that variable |
4850 | 119 describes both nested and non-nested citation roots, this variable |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
120 describes only nested citation roots." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
121 :type 'regexp |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
122 :group 'supercite-cite) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
123 |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
124 (defcustom sc-citation-delimiter-regexp "[>]+" |
4850 | 125 "*Regexp describing citation delimiter for a cited line. |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
126 This should NOT have a leading `^' character." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
127 :type 'regexp |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
128 :group 'supercite-cite) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
129 |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
130 (defcustom sc-citation-separator-regexp "[ \t]*" |
4850 | 131 "*Regexp describing citation separator for a cited line. |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
132 This should NOT have a leading `^' character." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
133 :type 'regexp |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
134 :group 'supercite-cite) |
4850 | 135 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
136 (defcustom sc-cite-blank-lines-p nil |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
137 "*If non-nil, put a citation on blank lines." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
138 :type 'boolean |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
139 :group 'supercite-cite) |
4850 | 140 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
141 (defcustom sc-cite-frame-alist '() |
4850 | 142 "*Alist for frame selection during citing. |
143 Each element of this list has the following form: | |
144 (INFOKEY ((REGEXP . FRAME) | |
145 (REGEXP . FRAME) | |
146 (...))) | |
147 | |
148 Where INFOKEY is a key for `sc-mail-field', REGEXP is a regular | |
58952
5c34e026a96e
(sc-cite-frame-alist): Doc fix.
Juri Linkov <juri@jurta.org>
parents:
58583
diff
changeset
|
149 expression to match against the INFOKEY's value. FRAME is |
5c34e026a96e
(sc-cite-frame-alist): Doc fix.
Juri Linkov <juri@jurta.org>
parents:
58583
diff
changeset
|
150 a citation frame, or a symbol that represents the name of |
5c34e026a96e
(sc-cite-frame-alist): Doc fix.
Juri Linkov <juri@jurta.org>
parents:
58583
diff
changeset
|
151 a variable whose value is a citation frame." |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
152 :type '(repeat (list symbol (repeat (cons regexp |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
153 (choice (repeat (repeat sexp)) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
154 symbol))))) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
155 :group 'supercite-frames) |
62315
c37dfc8054d6
(sc-cite-frame-alist, sc-uncite-frame-alist)
Richard M. Stallman <rms@gnu.org>
parents:
61282
diff
changeset
|
156 (put 'sc-cite-frame-alist 'risky-local-variable t) |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
157 |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
158 (defcustom sc-uncite-frame-alist '() |
4850 | 159 "*Alist for frame selection during unciting. |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
160 See the variable `sc-cite-frame-alist' for details." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
161 :type '(repeat (list symbol (repeat (cons regexp |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
162 (choice (repeat (repeat sexp)) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
163 symbol))))) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
164 :group 'supercite-frames) |
62315
c37dfc8054d6
(sc-cite-frame-alist, sc-uncite-frame-alist)
Richard M. Stallman <rms@gnu.org>
parents:
61282
diff
changeset
|
165 (put 'sc-uncite-frame-alist 'risky-local-variable t) |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
166 |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
167 (defcustom sc-recite-frame-alist '() |
4850 | 168 "*Alist for frame selection during reciting. |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
169 See the variable `sc-cite-frame-alist' for details." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
170 :type '(repeat (list symbol (repeat (cons regexp |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
171 (choice (repeat (repeat sexp)) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
172 symbol))))) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
173 :group 'supercite-frames) |
62315
c37dfc8054d6
(sc-cite-frame-alist, sc-uncite-frame-alist)
Richard M. Stallman <rms@gnu.org>
parents:
61282
diff
changeset
|
174 (put 'sc-recite-frame-alist 'risky-local-variable t) |
4850 | 175 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
176 (defcustom sc-default-cite-frame |
4850 | 177 '(;; initialize fill state and temporary variables when entering |
178 ;; frame. this makes things run much faster | |
179 (begin (progn | |
180 (sc-fill-if-different) | |
181 (setq sc-tmp-nested-regexp (sc-cite-regexp "") | |
182 sc-tmp-nonnested-regexp (sc-cite-regexp) | |
183 sc-tmp-dumb-regexp | |
184 (concat "\\(" | |
185 (sc-cite-regexp "") | |
186 "\\)" | |
187 (sc-cite-regexp sc-citation-nonnested-root-regexp)) | |
188 ))) | |
189 ;; blank lines mean paragraph separators, so fill the last cited | |
190 ;; paragraph, unless sc-cite-blank-lines-p is non-nil, in which | |
191 ;; case we treat blank lines just like any other line. | |
192 ("^[ \t]*$" (if sc-cite-blank-lines-p | |
193 (sc-cite-line) | |
194 (sc-fill-if-different ""))) | |
195 ;; do nothing if looking at a reference tag. make sure that the | |
196 ;; tag string isn't the empty string since this will match every | |
197 ;; line. it cannot be nil. | |
198 (sc-reference-tag-string (if (string= sc-reference-tag-string "") | |
199 (list 'continue) | |
200 nil)) | |
201 ;; this regexp catches nested citations in which the author cited | |
202 ;; a non-nested citation with a dumb citer. | |
203 (sc-tmp-dumb-regexp (sc-cite-coerce-dumb-citer)) | |
204 ;; if we are looking at a nested citation then add a citation level | |
205 (sc-tmp-nested-regexp (sc-add-citation-level)) | |
206 ;; if we're looking at a non-nested citation, coerce it to our style | |
207 (sc-tmp-nonnested-regexp (sc-cite-coerce-cited-line)) | |
208 ;; we must be looking at an uncited line. if we are in nested | |
209 ;; citations, just add a citation level | |
210 (sc-nested-citation-p (sc-add-citation-level)) | |
211 ;; we're looking at an uncited line and we are in non-nested | |
212 ;; citations, so cite it with a non-nested citation | |
213 (t (sc-cite-line)) | |
214 ;; be sure when we're done that we fill the last cited paragraph. | |
215 (end (sc-fill-if-different "")) | |
216 ) | |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
217 "*Default REGI frame for citing a region." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
218 :type '(repeat (repeat sexp)) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
219 :group 'supercite-frames) |
62315
c37dfc8054d6
(sc-cite-frame-alist, sc-uncite-frame-alist)
Richard M. Stallman <rms@gnu.org>
parents:
61282
diff
changeset
|
220 (put 'sc-default-cite-frame 'risky-local-variable t) |
4850 | 221 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
222 (defcustom sc-default-uncite-frame |
4850 | 223 '(;; do nothing on a blank line |
224 ("^[ \t]*$" nil) | |
225 ;; if the line is cited, uncite it | |
226 ((sc-cite-regexp) (sc-uncite-line)) | |
227 ) | |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
228 "*Default REGI frame for unciting a region." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
229 :type '(repeat (repeat sexp)) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
230 :group 'supercite-frames) |
62315
c37dfc8054d6
(sc-cite-frame-alist, sc-uncite-frame-alist)
Richard M. Stallman <rms@gnu.org>
parents:
61282
diff
changeset
|
231 (put 'sc-default-uncite-frame 'risky-local-variable t) |
4850 | 232 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
233 (defcustom sc-default-recite-frame |
4850 | 234 '(;; initialize fill state when entering frame |
235 (begin (sc-fill-if-different)) | |
236 ;; do nothing on a blank line | |
237 ("^[ \t]*$" nil) | |
238 ;; if we're looking at a cited line, recite it | |
239 ((sc-cite-regexp) (sc-recite-line (sc-cite-regexp))) | |
240 ;; otherwise, the line is uncited, so just cite it | |
241 (t (sc-cite-line)) | |
242 ;; be sure when we're done that we fill the last cited paragraph. | |
243 (end (sc-fill-if-different "")) | |
244 ) | |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
245 "*Default REGI frame for reciting a region." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
246 :type '(repeat (repeat sexp)) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
247 :group 'supercite-frames) |
62315
c37dfc8054d6
(sc-cite-frame-alist, sc-uncite-frame-alist)
Richard M. Stallman <rms@gnu.org>
parents:
61282
diff
changeset
|
248 (put 'sc-default-recite-frame 'risky-local-variable t) |
4850 | 249 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
250 (defcustom sc-cite-region-limit t |
4850 | 251 "*This variable controls automatic citation of yanked text. |
60924
fb2b49a3a4e0
* mail/supercite.el: Replace `legal' with `valid'.
Werner LEMBERG <wl@gnu.org>
parents:
60916
diff
changeset
|
252 Valid values are: |
4850 | 253 |
254 non-nil -- cite the entire region, regardless of its size | |
255 nil -- do not cite the region at all | |
256 <integer> -- a number indicating the threshold for citation. When | |
257 the number of lines in the region is greater than this | |
258 value, a warning message will be printed and the region | |
259 will not be cited. Lines in region are counted with | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
43791
diff
changeset
|
260 `count-lines'. |
4850 | 261 |
262 The gathering of attribution information is not affected by the value | |
263 of this variable. The number of lines in the region is calculated | |
264 *after* all mail headers are removed. This variable is only consulted | |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
265 during the initial citing via `sc-cite-original'." |
22592
17e17690ab4e
(sc-cite-region-limit): Use `other' widget
Andreas Schwab <schwab@suse.de>
parents:
21861
diff
changeset
|
266 :type '(choice (const :tag "do not cite" nil) |
17e17690ab4e
(sc-cite-region-limit): Use `other' widget
Andreas Schwab <schwab@suse.de>
parents:
21861
diff
changeset
|
267 (integer :tag "citation threshold") |
17e17690ab4e
(sc-cite-region-limit): Use `other' widget
Andreas Schwab <schwab@suse.de>
parents:
21861
diff
changeset
|
268 (other :tag "always cite" t)) |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
269 :group 'supercite-cite) |
4850 | 270 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
271 (defcustom sc-confirm-always-p t |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
272 "*If non-nil, always confirm attribution string before citing text body." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
273 :type 'boolean |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
274 :group 'supercite-attr) |
4850 | 275 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
276 (defcustom sc-default-attribution "Anon" |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
277 "*String used when author's attribution cannot be determined." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
278 :type 'string |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
279 :group 'supercite-attr) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
280 (defcustom sc-default-author-name "Anonymous" |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
281 "*String used when author's name cannot be determined." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
282 :type 'string |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
283 :group 'supercite-attr) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
284 (defcustom sc-downcase-p nil |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
285 "*Non-nil means downcase the attribution and citation strings." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
286 :type 'boolean |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
287 :group 'supercite-attr |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
288 :group 'supercite-cite) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
289 (defcustom sc-electric-circular-p t |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
290 "*If non-nil, treat electric references as circular." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
291 :type 'boolean |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
292 :group 'supercite-attr) |
4850 | 293 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
294 (defcustom sc-electric-mode-hook nil |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
295 "*Hook for `sc-electric-mode' electric references mode." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
296 :type 'hook |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
297 :group 'supercite-hooks) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
298 (defcustom sc-electric-references-p nil |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
299 "*Use electric references if non-nil." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
300 :type 'boolean |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
301 :group 'supercite) |
4850 | 302 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
303 (defcustom sc-fixup-whitespace-p nil |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
304 "*If non-nil, delete all leading white space before citing." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
305 :type 'boolean |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
306 :group 'supercite) |
4850 | 307 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
308 (defcustom sc-load-hook nil |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
309 "*Hook which gets run once after Supercite loads." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
310 :type 'hook |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
311 :group 'supercite-hooks) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
312 (defcustom sc-pre-hook nil |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
313 "*Hook which gets run before each invocation of `sc-cite-original'." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
314 :type 'hook |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
315 :group 'supercite-hooks) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
316 (defcustom sc-post-hook nil |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
317 "*Hook which gets run after each invocation of `sc-cite-original'." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
318 :type 'hook |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
319 :group 'supercite-hooks) |
4850 | 320 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
321 (defcustom sc-mail-warn-if-non-rfc822-p t |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
322 "*Warn if mail headers don't conform to RFC822." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
323 :type 'boolean |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
324 :group 'supercite-attr) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
325 (defcustom sc-mumble "" |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
326 "*Value returned by `sc-mail-field' if field isn't in mail headers." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
327 :type 'string |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
328 :group 'supercite-attr) |
4850 | 329 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
330 (defcustom sc-name-filter-alist |
4850 | 331 '(("^\\(Mr\\|Mrs\\|Ms\\|Dr\\)[.]?$" . 0) |
332 ("^\\(Jr\\|Sr\\)[.]?$" . last) | |
333 ("^ASTS$" . 0) | |
334 ("^[I]+$" . last)) | |
335 "*Name list components which are filtered out as noise. | |
336 This variable contains an association list where each element is of | |
337 the form: (REGEXP . POSITION). | |
338 | |
339 REGEXP is a regular expression which matches the name list component. | |
340 Match is performed using `string-match'. POSITION is the position in | |
341 the name list which can match the regular expression, starting at zero | |
342 for the first element. Use `last' to match the last element in the | |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
343 list and `any' to match all elements." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
344 :type '(repeat (cons regexp (choice (const last) (const any) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
345 (integer :tag "position")))) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
346 :group 'supercite-attr) |
4850 | 347 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
348 (defcustom sc-nested-citation-p nil |
4850 | 349 "*Controls whether to use nested or non-nested citation style. |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
350 Non-nil uses nested citations, nil uses non-nested citations." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
351 :type 'boolean |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
352 :group 'supercite) |
4850 | 353 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
354 (defcustom sc-nuke-mail-headers 'all |
4850 | 355 "*Controls mail header nuking. |
60924
fb2b49a3a4e0
* mail/supercite.el: Replace `legal' with `valid'.
Werner LEMBERG <wl@gnu.org>
parents:
60916
diff
changeset
|
356 Used in conjunction with `sc-nuke-mail-header-list'. Valid values are: |
4850 | 357 |
358 `all' -- nuke all mail headers | |
359 `none' -- don't nuke any mail headers | |
360 `specified' -- nuke headers specified in `sc-nuke-mail-header-list' | |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
361 `keep' -- keep headers specified in `sc-nuke-mail-header-list'" |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
362 :type '(choice (const all) (const none) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
363 (const specified) (const keep)) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
364 :group 'supercite) |
4850 | 365 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
366 (defcustom sc-nuke-mail-header-list nil |
4850 | 367 "*List of mail header regexps to remove or keep in body of reply. |
368 This list contains regular expressions describing the mail headers to | |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
369 keep or nuke, depending on the value of `sc-nuke-mail-headers'." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
370 :type '(repeat regexp) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
371 :group 'supercite) |
4850 | 372 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
373 (defcustom sc-preferred-attribution-list |
4850 | 374 '("sc-lastchoice" "x-attribution" "firstname" "initials" "lastname") |
375 "*Specifies what to use as the attribution string. | |
376 Supercite creates a list of possible attributions when it scans the | |
377 mail headers from the original message. Each attribution choice is | |
378 associated with a key in an attribution alist. Supercite tries to | |
379 pick a \"preferred\" attribution by matching the attribution alist | |
380 keys against the elements in `sc-preferred-attribution-list' in order. | |
381 The first non-empty string value found is used as the preferred | |
382 attribution. | |
383 | |
384 Note that Supercite now honors the X-Attribution: mail field. If | |
385 present in the original message, the value of this field should always | |
386 be used to select the most preferred attribution since it reflects how | |
387 the original author would like to be distinguished. It should be | |
388 considered bad taste to put any attribution preference key before | |
389 \"x-attribution\" in this list, except perhaps for \"sc-lastchoice\" | |
7639 | 390 \(see below). |
4850 | 391 |
392 Supercite remembers the last attribution used when reciting an already | |
393 cited paragraph. This attribution will always be saved with the | |
394 \"sc-lastchoice\" key, which can be used in this list. Note that the | |
395 last choice is always reset after every call of `sc-cite-original'. | |
396 | |
397 Barring error conditions, the following preferences are always present | |
398 in the attribution alist: | |
399 | |
400 \"emailname\" -- email terminus name | |
401 \"initials\" -- initials of author | |
402 \"firstname\" -- first name of author | |
403 \"lastname\" -- last name of author | |
404 \"middlename-1\" -- first middle name of author | |
405 \"middlename-2\" -- second middle name of author | |
406 ... | |
407 | |
408 Middle name indexes can be any positive integer greater than 0, | |
409 although it is unlikely that many authors will supply more than one | |
410 middle name, if that many. The string of all middle names is | |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
411 associated with the key \"middlenames\"." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
412 :type '(repeat string) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
413 :group 'supercite-attr) |
4850 | 414 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
415 (defcustom sc-attrib-selection-list nil |
4850 | 416 "*An alist for selecting preferred attribution based on mail headers. |
417 Each element of this list has the following form: | |
418 | |
419 (INFOKEY ((REGEXP . ATTRIBUTION) | |
420 (REGEXP . ATTRIBUTION) | |
421 (...))) | |
422 | |
423 Where INFOKEY is a key for `sc-mail-field', REGEXP is a regular | |
424 expression to match against the INFOKEY's value. ATTRIBUTION can be a | |
425 string or a list. If its a string, then it is the attribution that is | |
426 selected by `sc-select-attribution'. If it is a list, it is `eval'd | |
427 and the return value must be a string, which is used as the selected | |
428 attribution. Note that the variable `sc-preferred-attribution-list' | |
429 must contain an element of the string \"sc-consult\" for this variable | |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
430 to be consulted during attribution selection." |
24613
83a507b08fe1
(sc-scan-info-alist): Revert last change.
Dave Love <fx@gnu.org>
parents:
24612
diff
changeset
|
431 :type '(repeat (list string |
83a507b08fe1
(sc-scan-info-alist): Revert last change.
Dave Love <fx@gnu.org>
parents:
24612
diff
changeset
|
432 (repeat (cons regexp |
83a507b08fe1
(sc-scan-info-alist): Revert last change.
Dave Love <fx@gnu.org>
parents:
24612
diff
changeset
|
433 (choice (sexp :tag "List to eval") |
83a507b08fe1
(sc-scan-info-alist): Revert last change.
Dave Love <fx@gnu.org>
parents:
24612
diff
changeset
|
434 string))))) |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
435 :group 'supercite-attr) |
62315
c37dfc8054d6
(sc-cite-frame-alist, sc-uncite-frame-alist)
Richard M. Stallman <rms@gnu.org>
parents:
61282
diff
changeset
|
436 (put 'sc-attrib-selection-list 'risky-local-variable t) |
4850 | 437 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
438 (defcustom sc-attribs-preselect-hook nil |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
439 "*Hook to run before selecting an attribution." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
440 :type 'hook |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
441 :group 'supercite-attr |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
442 :group 'supercite-hooks) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
443 (defcustom sc-attribs-postselect-hook nil |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
444 "*Hook to run after selecting an attribution, but before confirmation." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
445 :type 'hook |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
446 :group 'supercite-attr |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
447 :group 'supercite-hooks) |
4850 | 448 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
449 (defcustom sc-pre-cite-hook nil |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
450 "*Hook to run before citing a region of text." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
451 :type 'hook |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
452 :group 'supercite-cite |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
453 :group 'supercite-hooks) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
454 (defcustom sc-pre-uncite-hook nil |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
455 "*Hook to run before unciting a region of text." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
456 :type 'hook |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
457 :group 'supercite-cite |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
458 :group 'supercite-hooks) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
459 (defcustom sc-pre-recite-hook nil |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
460 "*Hook to run before reciting a region of text." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
461 :type 'hook |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
462 :group 'supercite-cite |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
463 :group 'supercite-hooks) |
4850 | 464 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
465 (defcustom sc-preferred-header-style 4 |
4850 | 466 "*Index into `sc-rewrite-header-list' specifying preferred header style. |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
467 Index zero accesses the first function in the list." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
468 :type 'integer |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
469 :group 'supercite) |
4850 | 470 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
471 (defcustom sc-reference-tag-string ">>>>> " |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
472 "*String used at the beginning of built-in reference headers." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
473 :type 'string |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
474 :group 'supercite) |
4850 | 475 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
476 (defcustom sc-rewrite-header-list |
4850 | 477 '((sc-no-header) |
478 (sc-header-on-said) | |
479 (sc-header-inarticle-writes) | |
480 (sc-header-regarding-adds) | |
481 (sc-header-attributed-writes) | |
482 (sc-header-author-writes) | |
483 (sc-header-verbose) | |
484 (sc-no-blank-line-or-header) | |
485 ) | |
486 "*List of reference header rewrite functions. | |
487 The variable `sc-preferred-header-style' controls which function in | |
488 this list is chosen for automatic reference header insertions. | |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
489 Electric reference mode will cycle through this list of functions." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
490 :type '(repeat sexp) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
491 :group 'supercite) |
62315
c37dfc8054d6
(sc-cite-frame-alist, sc-uncite-frame-alist)
Richard M. Stallman <rms@gnu.org>
parents:
61282
diff
changeset
|
492 (put 'sc-rewrite-header-list 'risky-local-variable t) |
4850 | 493 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
494 (defcustom sc-titlecue-regexp "\\s +-+\\s +" |
4850 | 495 "*Regular expression describing the separator between names and titles. |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
496 Set to nil to treat entire field as a name." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
497 :type '(choice (const :tag "entire field as name" nil) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
498 regexp) |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
499 :group 'supercite-attr) |
4850 | 500 |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
501 (defcustom sc-use-only-preference-p nil |
4850 | 502 "*Controls what happens when the preferred attribution cannot be found. |
503 If non-nil, then `sc-default-attribution' will be used. If nil, then | |
504 some secondary scheme will be employed to find a suitable attribution | |
17489
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
505 string." |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
506 :type 'boolean |
cb41a5b41836
Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
507 :group 'supercite-attr) |
4850 | 508 |
509 ;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
510 ;; end user configuration variables | |
511 | |
512 (defconst sc-version "3.1" | |
513 "Supercite version number.") | |
22646
d5b24acb8f9b
(sc-help-address): Use an alias at gnu.org.
Richard M. Stallman <rms@gnu.org>
parents:
22592
diff
changeset
|
514 (defconst sc-help-address "bug-supercite@gnu.org" |
4850 | 515 "Address accepting submissions of bug reports.") |
516 | |
517 (defvar sc-mail-info nil | |
518 "Alist of mail header information gleaned from reply buffer.") | |
519 (defvar sc-attributions nil | |
520 "Alist of attributions for use when citing.") | |
521 | |
522 (defvar sc-tmp-nested-regexp nil | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
523 "Temporary regexp describing nested citations.") |
4850 | 524 (defvar sc-tmp-nonnested-regexp nil |
525 "Temporary regexp describing non-nested citations.") | |
526 (defvar sc-tmp-dumb-regexp nil | |
527 "Temp regexp describing non-nested citation cited with a nesting citer.") | |
528 | |
529 (make-variable-buffer-local 'sc-mail-info) | |
530 (make-variable-buffer-local 'sc-attributions) | |
531 | |
532 | |
533 ;; ====================================================================== | |
534 ;; supercite keymaps | |
535 | |
536 (defvar sc-mode-map-prefix "\C-c\C-p" | |
537 "*Key binding to install Supercite keymap. | |
538 If this is nil, Supercite keymap is not installed.") | |
539 | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
540 (defvar sc-T-keymap |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
541 (let ((map (make-sparse-keymap))) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
542 (define-key map "a" 'sc-S-preferred-attribution-list) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
543 (define-key map "b" 'sc-T-mail-nuke-blank-lines) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
544 (define-key map "c" 'sc-T-confirm-always) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
545 (define-key map "d" 'sc-T-downcase) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
546 (define-key map "e" 'sc-T-electric-references) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
547 (define-key map "f" 'sc-T-auto-fill-region) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
548 (define-key map "h" 'sc-T-describe) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
549 (define-key map "l" 'sc-S-cite-region-limit) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
550 (define-key map "n" 'sc-S-mail-nuke-mail-headers) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
551 (define-key map "N" 'sc-S-mail-header-nuke-list) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
552 (define-key map "o" 'sc-T-electric-circular) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
553 (define-key map "p" 'sc-S-preferred-header-style) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
554 (define-key map "s" 'sc-T-nested-citation) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
555 (define-key map "u" 'sc-T-use-only-preferences) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
556 (define-key map "w" 'sc-T-fixup-whitespace) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
557 (define-key map "?" 'sc-T-describe) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
558 map) |
4850 | 559 "Keymap for sub-keymap of setting and toggling functions.") |
560 | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
561 (defvar sc-mode-map |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
562 (let ((map (make-sparse-keymap))) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
563 (define-key map "c" 'sc-cite-region) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
564 (define-key map "f" 'sc-mail-field-query) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
565 (define-key map "g" 'sc-mail-process-headers) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
566 (define-key map "h" 'sc-describe) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
567 (define-key map "i" 'sc-insert-citation) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
568 (define-key map "o" 'sc-open-line) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
569 (define-key map "r" 'sc-recite-region) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
570 (define-key map "\C-p" 'sc-raw-mode-toggle) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
571 (define-key map "u" 'sc-uncite-region) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
572 (define-key map "v" 'sc-version) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
573 (define-key map "w" 'sc-insert-reference) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
574 (define-key map "\C-t" sc-T-keymap) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
575 (define-key map "\C-b" 'sc-submit-bug-report) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
576 (define-key map "?" 'sc-describe) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
577 map) |
4850 | 578 "Keymap for Supercite quasi-mode.") |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
43791
diff
changeset
|
579 |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
580 (defvar sc-electric-mode-map |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
581 (let ((map (make-sparse-keymap))) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
582 (define-key map "p" 'sc-eref-prev) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
583 (define-key map "n" 'sc-eref-next) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
584 (define-key map "s" 'sc-eref-setn) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
585 (define-key map "j" 'sc-eref-jump) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
586 (define-key map "x" 'sc-eref-abort) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
587 (define-key map "q" 'sc-eref-abort) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
588 (define-key map "\r" 'sc-eref-exit) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
589 (define-key map "\n" 'sc-eref-exit) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
590 (define-key map "g" 'sc-eref-goto) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
591 (define-key map "?" 'describe-mode) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
592 (define-key map "\C-h" 'describe-mode) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
593 (define-key map [f1] 'describe-mode) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
594 (define-key map [help] 'describe-mode) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
595 map) |
4850 | 596 "Keymap for `sc-electric-mode' electric references mode.") |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
597 |
4850 | 598 |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
599 (defvar sc-minibuffer-local-completion-map |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
600 (let ((map (copy-keymap minibuffer-local-completion-map))) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
601 (define-key map "\C-t" 'sc-toggle-fn) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
602 (define-key map " " 'self-insert-command) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
603 map) |
4850 | 604 "Keymap for minibuffer confirmation of attribution strings.") |
605 | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
606 (defvar sc-minibuffer-local-map |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
607 (let ((map (copy-keymap minibuffer-local-map))) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
608 (define-key map "\C-t" 'sc-toggle-fn) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
609 map) |
4850 | 610 "Keymap for minibuffer confirmation of attribution strings.") |
611 | |
612 | |
613 ;; ====================================================================== | |
614 ;; utility functions | |
615 | |
616 (defun sc-ask (alist) | |
617 "Ask a question in the minibuffer requiring a single character answer. | |
618 This function is kind of an extension of `y-or-n-p' where a single | |
619 letter is used to answer a question. Question is formed from ALIST | |
620 which has members of the form: (WORD . LETTER). WORD is the long | |
621 word form, while LETTER is the letter for selecting that answer. The | |
622 selected letter is returned, or nil if the question was not answered. | |
623 Note that WORD is a string and LETTER is a character. All LETTERs in | |
624 the list should be unique." | |
625 (let* ((prompt (concat | |
626 (mapconcat (function (lambda (elt) (car elt))) alist ", ") | |
627 "? (" | |
628 (mapconcat | |
629 (function | |
630 (lambda (elt) (char-to-string (cdr elt)))) alist "/") | |
631 ") ")) | |
632 (p prompt) | |
633 (event | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
634 (if (fboundp 'allocate-event) |
4850 | 635 (allocate-event) |
636 nil))) | |
637 (while (stringp p) | |
638 (if (let ((cursor-in-echo-area t) | |
639 (inhibit-quit t)) | |
640 (message "%s" p) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
641 (setq event (read-event)) |
4850 | 642 (prog1 quit-flag (setq quit-flag nil))) |
643 (progn | |
644 (message "%s%s" p (single-key-description event)) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
645 (and (fboundp 'deallocate-event) |
4850 | 646 (deallocate-event event)) |
647 (setq quit-flag nil) | |
648 (signal 'quit '()))) | |
649 (let ((char | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
650 (if (featurep 'xemacs) |
4850 | 651 (let* ((key (and (key-press-event-p event) (event-key event))) |
652 (char (and key (event-to-character event)))) | |
653 char) | |
654 event)) | |
655 elt) | |
656 (if char (setq char (downcase char))) | |
657 (cond | |
658 ((setq elt (rassq char alist)) | |
659 (message "%s%s" p (car elt)) | |
660 (setq p (cdr elt))) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
661 ((and (fboundp 'button-release-event-p) |
4850 | 662 (button-release-event-p event)) ; ignore them |
663 nil) | |
664 (t | |
665 (message "%s%s" p (single-key-description event)) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
666 (if (featurep 'xemacs) |
4850 | 667 (ding nil 'y-or-n-p) |
668 (ding)) | |
669 (discard-input) | |
670 (if (eq p prompt) | |
671 (setq p (concat "Try again. " prompt))))))) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
672 (and (fboundp 'deallocate-event) |
4850 | 673 (deallocate-event event)) |
674 p)) | |
675 | |
676 (defun sc-scan-info-alist (alist) | |
677 "Find a match in the info alist that matches a regexp in ALIST." | |
678 (let ((sc-mumble "") | |
679 rtnvalue) | |
680 (while alist | |
681 (let* ((elem (car alist)) | |
682 (infokey (car elem)) | |
683 (infoval (sc-mail-field infokey)) | |
684 (mlist (car (cdr elem)))) | |
685 (while mlist | |
686 (let* ((ml-elem (car mlist)) | |
687 (regexp (car ml-elem)) | |
688 (thing (cdr ml-elem))) | |
689 (if (string-match regexp infoval) | |
690 ;; we found a match, time to return | |
24613
83a507b08fe1
(sc-scan-info-alist): Revert last change.
Dave Love <fx@gnu.org>
parents:
24612
diff
changeset
|
691 (setq rtnvalue thing |
4850 | 692 mlist nil |
693 alist nil) | |
694 ;; else we didn't find a match | |
695 (setq mlist (cdr mlist)) | |
696 ))) ;end of mlist loop | |
697 (setq alist (cdr alist)) | |
698 )) ;end of alist loop | |
699 rtnvalue)) | |
700 | |
701 | |
702 ;; ====================================================================== | |
703 ;; extract mail field information from headers in reply buffer | |
704 | |
705 ;; holder variables for bc happiness | |
706 (defvar sc-mail-headers-start nil | |
707 "Start of header fields.") | |
708 (defvar sc-mail-headers-end nil | |
709 "End of header fields.") | |
710 (defvar sc-mail-field-history nil | |
711 "For minibuffer completion on mail field queries.") | |
712 (defvar sc-mail-field-modification-history nil | |
713 "For minibuffer completion on mail field modifications.") | |
714 (defvar sc-mail-glom-frame | |
715 '((begin (setq sc-mail-headers-start (point))) | |
716 ("^x-attribution:[ \t]+.*$" (sc-mail-fetch-field t) nil t) | |
717 ("^\\S +:.*$" (sc-mail-fetch-field) nil t) | |
718 ("^$" (list 'abort '(step . 0))) | |
719 ("^[ \t]+" (sc-mail-append-field)) | |
720 (sc-mail-warn-if-non-rfc822-p (sc-mail-error-in-mail-field)) | |
721 (end (setq sc-mail-headers-end (point)))) | |
722 "Regi frame for glomming mail header information.") | |
63056
095901aead41
(sc-mail-glom-frame): Mark as risky.
Richard M. Stallman <rms@gnu.org>
parents:
62924
diff
changeset
|
723 (put 'sc-mail-glom-frame 'risky-local-variable t) |
4850 | 724 |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
725 (defvar curline) ; dynamic bondage |
28437 | 726 |
4850 | 727 ;; regi functions |
728 (defun sc-mail-fetch-field (&optional attribs-p) | |
729 "Insert a key and value into `sc-mail-info' alist. | |
730 If optional ATTRIBS-P is non-nil, the key/value pair is placed in | |
731 `sc-attributions' too." | |
732 (if (string-match "^\\(\\S *\\)\\s *:\\s +\\(.*\\)$" curline) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
733 (let* ((key (downcase (match-string-no-properties 1 curline))) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
734 (val (match-string-no-properties 2 curline)) |
4850 | 735 (keyval (cons key val))) |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
736 (push keyval sc-mail-info) |
4850 | 737 (if attribs-p |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
738 (push keyval sc-attributions)))) |
4850 | 739 nil) |
740 | |
741 (defun sc-mail-append-field () | |
742 "Append a continuation line onto the last fetched mail field's info." | |
743 (let ((keyval (car sc-mail-info))) | |
744 (if (and keyval (string-match "^\\s *\\(.*\\)$" curline)) | |
11556
a83ee7a1e0fd
Made sc-string-text to strip of text properties of buffer text, so string
Simon Marshall <simon@gnu.org>
parents:
9845
diff
changeset
|
745 (setcdr keyval (concat (cdr keyval) " " |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
746 (match-string-no-properties 1 curline))))) |
4850 | 747 nil) |
748 | |
749 (defun sc-mail-error-in-mail-field () | |
750 "Issue warning that mail headers don't conform to RFC 822." | |
751 (let* ((len (min (length curline) 10)) | |
752 (ellipsis (if (< len (length curline)) "..." "")) | |
753 (msg "Mail header \"%s%s\" doesn't conform to RFC 822. skipping...")) | |
754 (message msg (substring curline 0 len) ellipsis)) | |
755 (beep) | |
756 (sit-for 2) | |
757 nil) | |
758 | |
759 ;; mail header nuking | |
760 (defvar sc-mail-last-header-nuked-p nil | |
761 "True if the last header was nuked.") | |
762 | |
763 (defun sc-mail-nuke-line () | |
764 "Nuke the current mail header line." | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
765 (delete-region (line-beginning-position) (line-beginning-position 2)) |
4850 | 766 '((step . -1))) |
767 | |
768 (defun sc-mail-nuke-header-line () | |
769 "Delete current-line and set up for possible continuation." | |
770 (setq sc-mail-last-header-nuked-p t) | |
771 (sc-mail-nuke-line)) | |
772 | |
773 (defun sc-mail-nuke-continuation-line () | |
774 "Delete a continuation line if the last header line was deleted." | |
775 (if sc-mail-last-header-nuked-p | |
776 (sc-mail-nuke-line))) | |
777 | |
778 (defun sc-mail-cleanup-blank-lines () | |
779 "Leave some blank lines after original mail headers are nuked. | |
780 The number of lines left is specified by `sc-blank-lines-after-headers'." | |
781 (if sc-blank-lines-after-headers | |
782 (save-restriction | |
783 (widen) | |
784 (skip-chars-backward " \t\n") | |
785 (forward-line 1) | |
786 (delete-blank-lines) | |
787 (beginning-of-line) | |
788 (if (looking-at "[ \t]*$") | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
789 (delete-region (line-beginning-position) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
790 (line-beginning-position 2))) |
4850 | 791 (insert-char ?\n sc-blank-lines-after-headers))) |
792 nil) | |
793 | |
794 (defun sc-mail-build-nuke-frame () | |
795 "Build the regiframe for nuking mail headers." | |
796 (let (every-func entry-func nonentry-func) | |
797 (cond | |
798 ((eq sc-nuke-mail-headers 'all) | |
799 (setq every-func '(progn (forward-line -1) (sc-mail-nuke-line)))) | |
800 ((eq sc-nuke-mail-headers 'specified) | |
801 (setq entry-func '(sc-mail-nuke-header-line) | |
802 nonentry-func '(setq sc-mail-last-header-nuked-p nil))) | |
803 ((eq sc-nuke-mail-headers 'keep) | |
804 (setq entry-func '(setq sc-mail-last-header-nuked-p nil) | |
805 nonentry-func '(sc-mail-nuke-header-line))) | |
806 ;; we never get far enough to interpret a frame if s-n-m-h == 'none | |
807 ((eq sc-nuke-mail-headers 'none)) | |
60916
480134f8cd16
* mail/supercite.el: Replace `illegal' with `invalid'.
Werner LEMBERG <wl@gnu.org>
parents:
58952
diff
changeset
|
808 (t (error "Invalid value for sc-nuke-mail-headers: %s" |
4850 | 809 sc-nuke-mail-headers)) |
810 ) ; end-cond | |
811 (append | |
812 (and entry-func | |
813 (regi-mapcar sc-nuke-mail-header-list entry-func nil t)) | |
814 (and nonentry-func (list (list "^\\S +:.*$" nonentry-func))) | |
815 (and (not every-func) | |
816 '(("^[ \t]+" (sc-mail-nuke-continuation-line)))) | |
817 '((begin (setq sc-mail-last-header-zapped-p nil))) | |
818 '((end (sc-mail-cleanup-blank-lines))) | |
819 (and every-func (list (list 'every every-func))) | |
820 ))) | |
821 | |
822 ;; mail processing and zapping. this is the top level entry defun to | |
823 ;; all header processing. | |
824 (defun sc-mail-process-headers (start end) | |
825 "Process original mail message's mail headers. | |
826 After processing, mail headers may be nuked. Header information is | |
827 stored in `sc-mail-info', and any old information is lost unless an | |
828 error occurs." | |
829 (interactive "r") | |
830 (let ((info (copy-alist sc-mail-info)) | |
831 (attribs (copy-alist sc-attributions))) | |
832 (setq sc-mail-info nil | |
833 sc-attributions nil) | |
834 (regi-interpret sc-mail-glom-frame start end) | |
835 (if (null sc-mail-info) | |
836 (progn | |
837 (message "No mail headers found! Restoring old information.") | |
838 (setq sc-mail-info info | |
839 sc-attributions attribs)) | |
840 (regi-interpret (sc-mail-build-nuke-frame) | |
841 sc-mail-headers-start sc-mail-headers-end) | |
842 ))) | |
843 | |
844 | |
845 ;; let the user change mail field information | |
846 (defun sc-mail-field (field) | |
847 "Return the mail header field value associated with FIELD. | |
848 If there was no mail header with FIELD as its key, return the value of | |
849 `sc-mumble'. FIELD is case insensitive." | |
61044
17207b620cf3
(sc-mail-field): Use assoc-string.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60924
diff
changeset
|
850 (or (cdr (assoc-string field sc-mail-info 'case-fold)) sc-mumble)) |
4850 | 851 |
852 (defun sc-mail-field-query (arg) | |
853 "View the value of a mail field. | |
854 With `\\[universal-argument]', prompts for action on mail field. | |
855 Action can be one of: View, Modify, Add, or Delete." | |
856 (interactive "P") | |
857 (let* ((alist '(("view" . ?v) ("modify" . ?m) ("add" . ?a) ("delete" . ?d))) | |
858 (action (if (not arg) ?v (sc-ask alist))) | |
859 key) | |
860 (if (not action) | |
861 () | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
862 (setq key (completing-read |
4850 | 863 (concat (car (rassq action alist)) |
864 " information key: ") | |
865 sc-mail-info nil | |
866 (if (eq action ?a) nil 'noexit) | |
867 nil 'sc-mail-field-history)) | |
868 (cond | |
869 ((eq action ?v) | |
870 (message "%s: %s" key (cdr (assoc key sc-mail-info)))) | |
871 ((eq action ?d) | |
872 (setq sc-mail-info (delq (assoc key sc-mail-info) sc-mail-info))) | |
873 ((eq action ?m) | |
874 (let ((keyval (assoc key sc-mail-info))) | |
875 ;; first put initial value onto list if not already there | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
876 (if (not (member (cdr keyval) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
877 sc-mail-field-modification-history)) |
4850 | 878 (setq sc-mail-field-modification-history |
879 (cons (cdr keyval) sc-mail-field-modification-history))) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
880 (setcdr keyval (read-string |
4850 | 881 (concat key ": ") (cdr keyval) |
882 'sc-mail-field-modification-history)))) | |
883 ((eq action ?a) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
884 (push (cons key (read-string (concat key ": "))) sc-mail-info)) |
4850 | 885 )))) |
886 | |
887 | |
888 ;; ====================================================================== | |
889 ;; attributions | |
890 | |
891 (defvar sc-attribution-confirmation-history nil | |
892 "History for confirmation of attribution strings.") | |
893 (defvar sc-citation-confirmation-history nil | |
894 "History for confirmation of attribution prefixes.") | |
895 | |
896 (defun sc-attribs-%@-addresses (from &optional delim) | |
897 "Extract the author's email terminus from email address FROM. | |
898 Match addresses of the style ``name%[stuff].'' when called with DELIM | |
899 of \"%\" and addresses of the style ``[stuff]name@[stuff]'' when | |
900 called with DELIM \"@\". If DELIM is nil or not provided, matches | |
901 addresses of the style ``name''." | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
902 (and (string-match (concat "[-[:alnum:]_.]+" delim) from 0) |
4850 | 903 (substring from |
904 (match-beginning 0) | |
905 (- (match-end 0) (if (null delim) 0 1))))) | |
906 | |
907 (defun sc-attribs-!-addresses (from) | |
908 "Extract the author's email terminus from email address FROM. | |
909 Match addresses of the style ``[stuff]![stuff]...!name[stuff].''" | |
910 (let ((eos (length from)) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
911 (mstart (string-match "![-[:alnum:]_.]+\\([^-![:alnum:]_.]\\|$\\)" |
4850 | 912 from 0)) |
913 (mend (match-end 0))) | |
914 (and mstart | |
915 (substring from (1+ mstart) (- mend (if (= mend eos) 0 1))) | |
916 ))) | |
917 | |
918 (defun sc-attribs-<>-addresses (from) | |
919 "Extract the author's email terminus from email address FROM. | |
920 Match addresses of the style ``<name[stuff]>.''" | |
921 (and (string-match "<\\(.*\\)>" from) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
922 (match-string 1 from))) |
4850 | 923 |
924 (defun sc-get-address (from author) | |
925 "Get the full email address path from FROM. | |
926 AUTHOR is the author's name (which is removed from the address)." | |
927 (let ((eos (length from))) | |
61044
17207b620cf3
(sc-mail-field): Use assoc-string.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60924
diff
changeset
|
928 (if (string-match (concat "\\`\"?" (regexp-quote author) |
17207b620cf3
(sc-mail-field): Use assoc-string.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60924
diff
changeset
|
929 "\"?\\s +") from 0) |
4850 | 930 (let ((address (substring from (match-end 0) eos))) |
931 (if (and (= (aref address 0) ?<) | |
932 (= (aref address (1- (length address))) ?>)) | |
933 (substring address 1 (1- (length address))) | |
934 address)) | |
28437 | 935 (if (string-match "[-[:alnum:]!@%._]+" from 0) |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
936 (match-string 0 from) |
4850 | 937 "") |
938 ))) | |
939 | |
940 (defun sc-attribs-emailname (from) | |
941 "Get the email terminus name from FROM." | |
942 (or | |
943 (sc-attribs-%@-addresses from "%") | |
944 (sc-attribs-%@-addresses from "@") | |
945 (sc-attribs-!-addresses from) | |
946 (sc-attribs-<>-addresses from) | |
947 (sc-attribs-%@-addresses from) | |
948 (substring from 0 10))) | |
949 | |
950 (defun sc-name-substring (string start end extend) | |
951 "Extract the specified substring of STRING from START to END. | |
952 EXTEND is the number of characters on each side to extend the | |
953 substring." | |
954 (and start | |
955 (let ((sos (+ start extend)) | |
956 (eos (- end extend))) | |
957 (substring string sos | |
958 (or (string-match sc-titlecue-regexp string sos) eos) | |
959 )))) | |
960 | |
961 (defun sc-attribs-extract-namestring (from) | |
962 "Extract the name string from FROM. | |
963 This should be the author's full name minus an optional title." | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
964 ;; FIXME: we probably should use mail-extract-address-components. |
4850 | 965 (let ((namestring |
966 (or | |
12859
90c22a02c12b
(sc-attribs-extract-namestring): If name has <...>,
Richard M. Stallman <rms@gnu.org>
parents:
12425
diff
changeset
|
967 ;; If there is a <...> in the name, |
90c22a02c12b
(sc-attribs-extract-namestring): If name has <...>,
Richard M. Stallman <rms@gnu.org>
parents:
12425
diff
changeset
|
968 ;; treat everything before that as the full name. |
90c22a02c12b
(sc-attribs-extract-namestring): If name has <...>,
Richard M. Stallman <rms@gnu.org>
parents:
12425
diff
changeset
|
969 ;; Even if it contains parens, use the whole thing. |
13813
7d18fdd1acf4
(sc-attribs-extract-namestring): Do look for
Karl Heuer <kwzh@gnu.org>
parents:
12859
diff
changeset
|
970 ;; On the other hand, we do look for quotes in the usual way. |
12859
90c22a02c12b
(sc-attribs-extract-namestring): If name has <...>,
Richard M. Stallman <rms@gnu.org>
parents:
12425
diff
changeset
|
971 (and (string-match " *<.*>" from 0) |
13813
7d18fdd1acf4
(sc-attribs-extract-namestring): Do look for
Karl Heuer <kwzh@gnu.org>
parents:
12859
diff
changeset
|
972 (let ((before-angles |
7d18fdd1acf4
(sc-attribs-extract-namestring): Do look for
Karl Heuer <kwzh@gnu.org>
parents:
12859
diff
changeset
|
973 (sc-name-substring from 0 (match-beginning 0) 0))) |
7d18fdd1acf4
(sc-attribs-extract-namestring): Do look for
Karl Heuer <kwzh@gnu.org>
parents:
12859
diff
changeset
|
974 (if (string-match "\".*\"" before-angles 0) |
7d18fdd1acf4
(sc-attribs-extract-namestring): Do look for
Karl Heuer <kwzh@gnu.org>
parents:
12859
diff
changeset
|
975 (sc-name-substring |
7d18fdd1acf4
(sc-attribs-extract-namestring): Do look for
Karl Heuer <kwzh@gnu.org>
parents:
12859
diff
changeset
|
976 before-angles (match-beginning 0) (match-end 0) 1) |
7d18fdd1acf4
(sc-attribs-extract-namestring): Do look for
Karl Heuer <kwzh@gnu.org>
parents:
12859
diff
changeset
|
977 before-angles))) |
4850 | 978 (sc-name-substring |
979 from (string-match "(.*)" from 0) (match-end 0) 1) | |
980 (sc-name-substring | |
981 from (string-match "\".*\"" from 0) (match-end 0) 1) | |
982 (sc-name-substring | |
28437 | 983 from (string-match "\\([-.[:alnum:]_]+\\s +\\)+<" from 0) |
4850 | 984 (match-end 1) 0) |
985 (sc-attribs-emailname from)))) | |
986 ;; strip off any leading or trailing whitespace | |
987 (if namestring | |
988 (let ((bos 0) | |
989 (eos (1- (length namestring)))) | |
990 (while (and (<= bos eos) | |
991 (memq (aref namestring bos) '(32 ?\t))) | |
992 (setq bos (1+ bos))) | |
993 (while (and (> eos bos) | |
994 (memq (aref namestring eos) '(32 ?\t))) | |
995 (setq eos (1- eos))) | |
996 (substring namestring bos (1+ eos)))))) | |
997 | |
998 (defun sc-attribs-chop-namestring (namestring) | |
999 "Convert NAMESTRING to a list of names. | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1000 example: (sc-attribs-chop-namestring \"John Xavier Doe\") |
4850 | 1001 => (\"John\" \"Xavier\" \"Doe\")" |
1002 (if (string-match "\\([ \t]*\\)\\([^ \t._]+\\)\\([ \t]*\\)" namestring) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1003 (cons (match-string 2 namestring) |
4850 | 1004 (sc-attribs-chop-namestring (substring namestring (match-end 3))) |
1005 ))) | |
1006 | |
1007 (defun sc-attribs-strip-initials (namelist) | |
1008 "Extract the author's initials from the NAMELIST." | |
1009 (mapconcat | |
1010 (function | |
1011 (lambda (name) | |
1012 (if (< 0 (length name)) | |
1013 (substring name 0 1)))) | |
1014 namelist "")) | |
1015 | |
1016 (defun sc-guess-attribution (&optional string) | |
1017 "Guess attribution string on current line. | |
1018 If attribution cannot be guessed, nil is returned. Optional STRING if | |
1019 supplied, is used instead of the line point is on in the current buffer." | |
1020 (let ((start 0) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1021 (string (or string (buffer-substring (line-beginning-position) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1022 (line-end-position)))) |
4850 | 1023 attribution) |
1024 (and | |
1025 (= start (or (string-match sc-citation-leader-regexp string start) -1)) | |
1026 (setq start (match-end 0)) | |
1027 (= start (or (string-match sc-citation-root-regexp string start) 1)) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1028 (setq attribution (match-string 0 string) |
4850 | 1029 start (match-end 0)) |
1030 (= start (or (string-match sc-citation-delimiter-regexp string start) -1)) | |
1031 (setq start (match-end 0)) | |
1032 (= start (or (string-match sc-citation-separator-regexp string start) -1)) | |
1033 attribution))) | |
1034 | |
1035 (defun sc-attribs-filter-namelist (namelist) | |
1036 "Filter out noise in NAMELIST according to `sc-name-filter-alist'." | |
1037 (let ((elements (length namelist)) | |
1038 (position -1) | |
1039 keepers filtered-list) | |
1040 (mapcar | |
1041 (function | |
1042 (lambda (name) | |
1043 (setq position (1+ position)) | |
1044 (let ((keep-p t)) | |
1045 (mapcar | |
1046 (function | |
1047 (lambda (filter) | |
1048 (let ((regexp (car filter)) | |
1049 (pos (cdr filter))) | |
1050 (if (and (string-match regexp name) | |
1051 (or (and (numberp pos) | |
1052 (= pos position)) | |
1053 (and (eq pos 'last) | |
1054 (= position (1- elements))) | |
1055 (eq pos 'any))) | |
1056 (setq keep-p nil)) | |
1057 ))) | |
1058 sc-name-filter-alist) | |
1059 (if keep-p | |
1060 (setq keepers (cons position keepers))) | |
1061 ))) | |
1062 namelist) | |
1063 (mapcar | |
1064 (function | |
1065 (lambda (position) | |
1066 (setq filtered-list (cons (nth position namelist) filtered-list)) | |
1067 )) | |
1068 keepers) | |
1069 filtered-list)) | |
1070 | |
1071 (defun sc-attribs-chop-address (from) | |
1072 "Extract attribution information from FROM. | |
1073 This populates the `sc-attributions' with the list of possible attributions." | |
1074 (if (and (stringp from) | |
1075 (< 0 (length from))) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
43791
diff
changeset
|
1076 (let* ((sc-mumble "") |
4850 | 1077 (namestring (sc-attribs-extract-namestring from)) |
1078 (namelist (sc-attribs-filter-namelist | |
1079 (sc-attribs-chop-namestring namestring))) | |
1080 (revnames (reverse (cdr namelist))) | |
1081 (firstname (car namelist)) | |
1082 (midnames (reverse (cdr revnames))) | |
1083 (lastname (car revnames)) | |
1084 (initials (sc-attribs-strip-initials namelist)) | |
1085 (emailname (sc-attribs-emailname from)) | |
1086 (n 1) | |
1087 author middlenames) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
43791
diff
changeset
|
1088 |
4850 | 1089 ;; put basic information |
1090 (setq | |
1091 ;; put middle names and build sc-author entry | |
1092 middlenames (mapconcat | |
1093 (function | |
1094 (lambda (midname) | |
1095 (let ((key-attribs (format "middlename-%d" n)) | |
1096 (key-mail (format "sc-middlename-%d" n))) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1097 (push (cons key-attribs midname) sc-attributions) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1098 (push (cons key-mail midname) sc-mail-info) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1099 (setq n (1+ n)) |
4850 | 1100 midname))) |
1101 midnames " ") | |
1102 | |
1103 author (concat firstname " " middlenames (and midnames " ") lastname) | |
1104 | |
1105 sc-attributions (append | |
1106 (list | |
1107 (cons "firstname" firstname) | |
1108 (cons "lastname" lastname) | |
1109 (cons "emailname" emailname) | |
1110 (cons "initials" initials)) | |
1111 sc-attributions) | |
1112 sc-mail-info (append | |
1113 (list | |
1114 (cons "sc-firstname" firstname) | |
1115 (cons "sc-middlenames" middlenames) | |
1116 (cons "sc-lastname" lastname) | |
1117 (cons "sc-emailname" emailname) | |
1118 (cons "sc-initials" initials) | |
1119 (cons "sc-author" author) | |
1120 (cons "sc-from-address" (sc-get-address | |
1121 (sc-mail-field "from") | |
1122 namestring)) | |
1123 (cons "sc-reply-address" (sc-get-address | |
1124 (sc-mail-field "reply-to") | |
1125 namestring)) | |
1126 (cons "sc-sender-address" (sc-get-address | |
1127 (sc-mail-field "sender") | |
1128 namestring)) | |
1129 ) | |
1130 sc-mail-info) | |
1131 )) | |
1132 ;; from string is empty | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1133 (push (cons "sc-author" sc-default-author-name) sc-mail-info))) |
4850 | 1134 |
1135 (defvar sc-attrib-or-cite nil | |
1136 "Used to toggle between attribution input or citation input.") | |
1137 | |
1138 (defun sc-toggle-fn () | |
1139 "Toggle between attribution selection and citation selection. | |
1140 Only used during confirmation." | |
1141 (interactive) | |
1142 (setq sc-attrib-or-cite (not sc-attrib-or-cite)) | |
1143 (throw 'sc-reconfirm t)) | |
1144 | |
1145 (defun sc-select-attribution () | |
1146 "Select an attribution from `sc-attributions'. | |
1147 | |
1148 Variables involved in selection process include: | |
1149 `sc-preferred-attribution-list' | |
1150 `sc-use-only-preference-p' | |
1151 `sc-confirm-always-p' | |
1152 `sc-default-attribution' | |
1153 `sc-attrib-selection-list'. | |
1154 | |
1155 Runs the hook `sc-attribs-preselect-hook' before selecting an | |
1156 attribution and the hook `sc-attribs-postselect-hook' after making the | |
1157 selection but before querying is performed. During | |
1158 `sc-attribs-postselect-hook' the variable `citation' is bound to the | |
1159 auto-selected citation string and the variable `attribution' is bound | |
1160 to the auto-selected attribution string." | |
1161 (run-hooks 'sc-attribs-preselect-hook) | |
1162 (let ((query-p sc-confirm-always-p) | |
1163 attribution citation | |
1164 (attriblist sc-preferred-attribution-list)) | |
1165 | |
1166 ;; first cruise through sc-preferred-attribution-list looking for | |
1167 ;; a match in either sc-attributions or sc-mail-info. if the | |
1168 ;; element is "sc-consult", then we have to do the alist | |
1169 ;; consultation phase | |
1170 (while attriblist | |
1171 (let* ((preferred (car attriblist))) | |
1172 (cond | |
1173 ((string= preferred "sc-consult") | |
1174 ;; we've been told to consult the attribution vs. mail | |
1175 ;; header key alist. we do this until we find a match in | |
1176 ;; the sc-attrib-selection-list. if we do not find a match, | |
1177 ;; we continue scanning attriblist | |
1178 (let ((attrib (sc-scan-info-alist sc-attrib-selection-list))) | |
1179 (cond | |
1180 ((not attrib) | |
1181 (setq attriblist (cdr attriblist))) | |
1182 ((stringp attrib) | |
1183 (setq attribution attrib | |
1184 attriblist nil)) | |
1185 ((listp attrib) | |
62903
9cca67e822b5
(sc-select-attribution): Only use a list element from
Glenn Morris <rgm@gnu.org>
parents:
62765
diff
changeset
|
1186 (setq attribution (eval attrib)) |
9cca67e822b5
(sc-select-attribution): Only use a list element from
Glenn Morris <rgm@gnu.org>
parents:
62765
diff
changeset
|
1187 (if (stringp attribution) |
9cca67e822b5
(sc-select-attribution): Only use a list element from
Glenn Morris <rgm@gnu.org>
parents:
62765
diff
changeset
|
1188 (setq attriblist nil) |
9cca67e822b5
(sc-select-attribution): Only use a list element from
Glenn Morris <rgm@gnu.org>
parents:
62765
diff
changeset
|
1189 (setq attribution nil |
9cca67e822b5
(sc-select-attribution): Only use a list element from
Glenn Morris <rgm@gnu.org>
parents:
62765
diff
changeset
|
1190 attriblist (cdr attriblist)))) |
4850 | 1191 (t (error "%s did not evaluate to a string or list!" |
1192 "sc-attrib-selection-list")) | |
1193 ))) | |
1194 ((setq attribution (cdr (assoc preferred sc-attributions))) | |
1195 (setq attriblist nil)) | |
1196 (t | |
1197 (setq attriblist (cdr attriblist))) | |
1198 ))) | |
1199 | |
1200 ;; if preference was not found, we may use a secondary method to | |
1201 ;; find a valid attribution | |
1202 (if (and (not attribution) | |
1203 (not sc-use-only-preference-p)) | |
1204 ;; secondary method tries to find a preference in this order | |
1205 ;; 1. sc-lastchoice | |
1206 ;; 2. x-attribution | |
1207 ;; 3. firstname | |
1208 ;; 4. lastname | |
1209 ;; 5. initials | |
1210 ;; 6. first non-empty attribution in alist | |
1211 (setq attribution | |
1212 (or (cdr (assoc "sc-lastchoice" sc-attributions)) | |
1213 (cdr (assoc "x-attribution" sc-attributions)) | |
1214 (cdr (assoc "firstname" sc-attributions)) | |
1215 (cdr (assoc "lastname" sc-attributions)) | |
1216 (cdr (assoc "initials" sc-attributions)) | |
1217 (cdr (car sc-attributions))))) | |
1218 | |
1219 ;; still couldn't find an attribution. we're now limited to using | |
1220 ;; the default attribution, but we'll force a query when this happens | |
1221 (if (not attribution) | |
1222 (setq attribution sc-default-attribution | |
1223 query-p t)) | |
1224 | |
1225 ;; create the attribution prefix | |
1226 (setq citation (sc-make-citation attribution)) | |
1227 | |
1228 ;; run the post selection hook before querying the user | |
1229 (run-hooks 'sc-attribs-postselect-hook) | |
1230 | |
1231 ;; query for confirmation | |
1232 (if query-p | |
1233 (let* ((query-alist (mapcar (function (lambda (entry) | |
1234 (list (cdr entry)))) | |
1235 sc-attributions)) | |
1236 (minibuffer-local-completion-map | |
1237 sc-minibuffer-local-completion-map) | |
1238 (minibuffer-local-map sc-minibuffer-local-map) | |
1239 (initial attribution) | |
1240 (completer-disable t) ; in case completer.el is used | |
1241 choice) | |
1242 (setq sc-attrib-or-cite nil) ; nil==attribution, t==citation | |
1243 (while | |
1244 (catch 'sc-reconfirm | |
43791
2e05b93ba14a
(sc-select-attribution): Accept whatever value we get in CHOICE; there
Richard M. Stallman <rms@gnu.org>
parents:
42206
diff
changeset
|
1245 (progn |
2e05b93ba14a
(sc-select-attribution): Accept whatever value we get in CHOICE; there
Richard M. Stallman <rms@gnu.org>
parents:
42206
diff
changeset
|
1246 (setq choice |
2e05b93ba14a
(sc-select-attribution): Accept whatever value we get in CHOICE; there
Richard M. Stallman <rms@gnu.org>
parents:
42206
diff
changeset
|
1247 (if sc-attrib-or-cite |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1248 (read-string |
43791
2e05b93ba14a
(sc-select-attribution): Accept whatever value we get in CHOICE; there
Richard M. Stallman <rms@gnu.org>
parents:
42206
diff
changeset
|
1249 "Enter citation prefix: " |
2e05b93ba14a
(sc-select-attribution): Accept whatever value we get in CHOICE; there
Richard M. Stallman <rms@gnu.org>
parents:
42206
diff
changeset
|
1250 citation |
2e05b93ba14a
(sc-select-attribution): Accept whatever value we get in CHOICE; there
Richard M. Stallman <rms@gnu.org>
parents:
42206
diff
changeset
|
1251 'sc-citation-confirmation-history) |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1252 (completing-read |
43791
2e05b93ba14a
(sc-select-attribution): Accept whatever value we get in CHOICE; there
Richard M. Stallman <rms@gnu.org>
parents:
42206
diff
changeset
|
1253 "Complete attribution name: " |
2e05b93ba14a
(sc-select-attribution): Accept whatever value we get in CHOICE; there
Richard M. Stallman <rms@gnu.org>
parents:
42206
diff
changeset
|
1254 query-alist nil nil |
2e05b93ba14a
(sc-select-attribution): Accept whatever value we get in CHOICE; there
Richard M. Stallman <rms@gnu.org>
parents:
42206
diff
changeset
|
1255 (cons initial 0) |
2e05b93ba14a
(sc-select-attribution): Accept whatever value we get in CHOICE; there
Richard M. Stallman <rms@gnu.org>
parents:
42206
diff
changeset
|
1256 'sc-attribution-confirmation-history) |
2e05b93ba14a
(sc-select-attribution): Accept whatever value we get in CHOICE; there
Richard M. Stallman <rms@gnu.org>
parents:
42206
diff
changeset
|
1257 )) |
2e05b93ba14a
(sc-select-attribution): Accept whatever value we get in CHOICE; there
Richard M. Stallman <rms@gnu.org>
parents:
42206
diff
changeset
|
1258 nil))) |
4850 | 1259 (if sc-attrib-or-cite |
1260 ;; since the citation was chosen, we have to guess at | |
1261 ;; the attribution | |
1262 (setq citation choice | |
1263 attribution (or (sc-guess-attribution citation) | |
1264 citation)) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
43791
diff
changeset
|
1265 |
4850 | 1266 (setq citation (sc-make-citation choice) |
1267 attribution choice)) | |
1268 )) | |
1269 | |
1270 ;; its possible that the user wants to downcase the citation and | |
1271 ;; attribution | |
1272 (if sc-downcase-p | |
1273 (setq citation (downcase citation) | |
1274 attribution (downcase attribution))) | |
1275 | |
1276 ;; set up mail info alist | |
1277 (let* ((ckey "sc-citation") | |
1278 (akey "sc-attribution") | |
1279 (ckeyval (assoc ckey sc-mail-info)) | |
1280 (akeyval (assoc akey sc-mail-info))) | |
1281 (if ckeyval | |
1282 (setcdr ckeyval citation) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1283 (push (cons ckey citation) sc-mail-info)) |
4850 | 1284 (if akeyval |
1285 (setcdr akeyval attribution) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1286 (push (cons akey attribution) sc-mail-info))) |
4850 | 1287 |
1288 ;; set the sc-lastchoice attribution | |
1289 (let* ((lkey "sc-lastchoice") | |
1290 (lastchoice (assoc lkey sc-attributions))) | |
1291 (if lastchoice | |
1292 (setcdr lastchoice attribution) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1293 (push (cons lkey attribution) sc-attributions))) |
4850 | 1294 )) |
1295 | |
1296 | |
1297 ;; ====================================================================== | |
1298 ;; filladapt hooks for supercite 3.1. you shouldn't need anything | |
1299 ;; extra to make gin-mode understand supercited lines. Even this | |
1300 ;; stuff might not be entirely necessary... | |
1301 | |
1302 (defun sc-cite-regexp (&optional root-regexp) | |
1303 "Return a regexp describing a Supercited line. | |
1304 The regexp is the concatenation of `sc-citation-leader-regexp', | |
1305 `sc-citation-root-regexp', `sc-citation-delimiter-regexp', and | |
1306 `sc-citation-separator-regexp'. If optional ROOT-REGEXP is supplied, | |
1307 use it instead of `sc-citation-root-regexp'." | |
1308 (concat sc-citation-leader-regexp | |
1309 (or root-regexp sc-citation-root-regexp) | |
1310 sc-citation-delimiter-regexp | |
1311 sc-citation-separator-regexp)) | |
1312 | |
1313 (defun sc-make-citation (attribution) | |
1314 "Make a non-nested citation from ATTRIBUTION." | |
1315 (concat sc-citation-leader | |
1316 attribution | |
1317 sc-citation-delimiter | |
1318 sc-citation-separator)) | |
1319 | |
63945
eb399d132bf4
(filladapt-prefix-table): Add defvar.
Richard M. Stallman <rms@gnu.org>
parents:
63056
diff
changeset
|
1320 (defvar filladapt-prefix-table) |
eb399d132bf4
(filladapt-prefix-table): Add defvar.
Richard M. Stallman <rms@gnu.org>
parents:
63056
diff
changeset
|
1321 |
4850 | 1322 (defun sc-setup-filladapt () |
1323 "Setup `filladapt-prefix-table' to handle Supercited paragraphs." | |
1324 (let* ((fa-sc-elt 'filladapt-supercite-included-text) | |
1325 (elt (rassq fa-sc-elt filladapt-prefix-table))) | |
1326 (if elt (setcar elt (sc-cite-regexp)) | |
1327 (message "Filladapt doesn't seem to know about Supercite.") | |
1328 (beep)))) | |
1329 | |
1330 | |
1331 ;; ====================================================================== | |
1332 ;; citing and unciting regions of text | |
1333 | |
1334 (defvar sc-fill-begin 1 | |
1335 "Buffer position to begin filling.") | |
1336 (defvar sc-fill-line-prefix "" | |
1337 "Fill prefix of previous line") | |
1338 | |
1339 ;; filling | |
1340 (defun sc-fill-if-different (&optional prefix) | |
1341 "Fill the region bounded by `sc-fill-begin' and point. | |
1342 Only fill if optional PREFIX is different than `sc-fill-line-prefix'. | |
1343 If `sc-auto-fill-region-p' is nil, do not fill region. If PREFIX is | |
1344 not supplied, initialize fill variables. This is useful for a regi | |
1345 `begin' frame-entry." | |
1346 (if (not prefix) | |
1347 (setq sc-fill-line-prefix "" | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1348 sc-fill-begin (line-beginning-position)) |
4850 | 1349 (if (and sc-auto-fill-region-p |
1350 (not (string= prefix sc-fill-line-prefix))) | |
1351 (let ((fill-prefix sc-fill-line-prefix)) | |
1352 (if (not (string= fill-prefix "")) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1353 (fill-region sc-fill-begin (line-beginning-position))) |
4850 | 1354 (setq sc-fill-line-prefix prefix |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1355 sc-fill-begin (line-beginning-position)))) |
4850 | 1356 ) |
1357 nil) | |
1358 | |
1359 (defun sc-cite-coerce-cited-line () | |
1360 "Coerce a Supercited line to look like our style." | |
1361 (let* ((attribution (sc-guess-attribution)) | |
1362 (regexp (sc-cite-regexp attribution)) | |
1363 (prefix (sc-make-citation attribution))) | |
1364 (if (and attribution | |
1365 (looking-at regexp)) | |
1366 (progn | |
1367 (delete-region | |
1368 (match-beginning 0) | |
1369 (save-excursion | |
1370 (goto-char (match-end 0)) | |
1371 (if (bolp) (forward-char -1)) | |
1372 (point))) | |
1373 (insert prefix) | |
1374 (sc-fill-if-different prefix))) | |
1375 nil)) | |
1376 | |
1377 (defun sc-cite-coerce-dumb-citer () | |
1378 "Coerce a non-nested citation that's been cited with a dumb nesting citer." | |
1379 (delete-region (match-beginning 1) (match-end 1)) | |
1380 (beginning-of-line) | |
1381 (sc-cite-coerce-cited-line)) | |
1382 | |
1383 (defun sc-guess-nesting (&optional string) | |
1384 "Guess the citation nesting on the current line. | |
1385 If nesting cannot be guessed, nil is returned. Optional STRING if | |
1386 supplied, is used instead of the line point is on in the current | |
1387 buffer." | |
1388 (let ((start 0) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1389 (string (or string (buffer-substring (line-beginning-position) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1390 (line-end-position)))) |
4850 | 1391 nesting) |
1392 (and | |
1393 (= start (or (string-match sc-citation-leader-regexp string start) -1)) | |
1394 (setq start (match-end 0)) | |
1395 (= start (or (string-match sc-citation-delimiter-regexp string start) -1)) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1396 (setq nesting (match-string 0 string) |
4850 | 1397 start (match-end 0)) |
1398 (= start (or (string-match sc-citation-separator-regexp string start) -1)) | |
1399 nesting))) | |
1400 | |
1401 (defun sc-add-citation-level () | |
14007
c6476f4bb121
(sc-citation-nonnested-root-regexp,
Karl Heuer <kwzh@gnu.org>
parents:
13813
diff
changeset
|
1402 "Add a citation level for nested citation style w/ coercion." |
4850 | 1403 (let* ((nesting (sc-guess-nesting)) |
1404 (citation (make-string (1+ (length nesting)) | |
1405 (string-to-char sc-citation-delimiter))) | |
1406 (prefix (concat sc-citation-leader citation sc-citation-separator))) | |
1407 (if (looking-at (sc-cite-regexp "")) | |
1408 (delete-region (match-beginning 0) (match-end 0))) | |
1409 (insert prefix) | |
1410 (sc-fill-if-different prefix))) | |
1411 | |
1412 (defun sc-cite-line (&optional citation) | |
1413 "Cite a single line of uncited text. | |
1414 Optional CITATION overrides any citation automatically selected." | |
1415 (if sc-fixup-whitespace-p | |
1416 (fixup-whitespace)) | |
1417 (let ((prefix (or citation | |
1418 (cdr (assoc "sc-citation" sc-mail-info)) | |
1419 sc-default-attribution))) | |
1420 (insert prefix) | |
1421 (sc-fill-if-different prefix)) | |
1422 nil) | |
1423 | |
1424 (defun sc-uncite-line () | |
1425 "Remove citation from current line." | |
1426 (let ((cited (looking-at (sc-cite-regexp)))) | |
1427 (if cited | |
1428 (delete-region (match-beginning 0) (match-end 0)))) | |
1429 nil) | |
1430 | |
1431 (defun sc-recite-line (regexp) | |
1432 "Remove citation matching REGEXP from current line and recite line." | |
1433 (let ((cited (looking-at (concat "^" regexp))) | |
1434 (prefix (cdr (assoc "sc-citation" sc-mail-info)))) | |
1435 (if cited | |
1436 (delete-region (match-beginning 0) (match-end 0))) | |
1437 (insert (or prefix sc-default-attribution)) | |
1438 (sc-fill-if-different prefix)) | |
1439 nil) | |
1440 | |
1441 ;; interactive functions | |
57933
59c9a776a021
(sc-cite-region): Don't use interactive-p. Add arg INTERACTIVE.
Richard M. Stallman <rms@gnu.org>
parents:
57160
diff
changeset
|
1442 (defun sc-cite-region (start end &optional confirm-p interactive) |
4850 | 1443 "Cite a region delineated by START and END. |
1444 If optional CONFIRM-P is non-nil, the attribution is confirmed before | |
1445 its use in the citation string. This function first runs | |
57933
59c9a776a021
(sc-cite-region): Don't use interactive-p. Add arg INTERACTIVE.
Richard M. Stallman <rms@gnu.org>
parents:
57160
diff
changeset
|
1446 `sc-pre-cite-hook'. |
59c9a776a021
(sc-cite-region): Don't use interactive-p. Add arg INTERACTIVE.
Richard M. Stallman <rms@gnu.org>
parents:
57160
diff
changeset
|
1447 |
59c9a776a021
(sc-cite-region): Don't use interactive-p. Add arg INTERACTIVE.
Richard M. Stallman <rms@gnu.org>
parents:
57160
diff
changeset
|
1448 When called interactively, the optional arg INTERACTIVE is non-nil, |
59c9a776a021
(sc-cite-region): Don't use interactive-p. Add arg INTERACTIVE.
Richard M. Stallman <rms@gnu.org>
parents:
57160
diff
changeset
|
1449 and that means call `sc-select-attribution' too." |
59c9a776a021
(sc-cite-region): Don't use interactive-p. Add arg INTERACTIVE.
Richard M. Stallman <rms@gnu.org>
parents:
57160
diff
changeset
|
1450 (interactive "r\nP\np") |
4850 | 1451 (undo-boundary) |
58952
5c34e026a96e
(sc-cite-frame-alist): Doc fix.
Juri Linkov <juri@jurta.org>
parents:
58583
diff
changeset
|
1452 (let ((frame (sc-scan-info-alist sc-cite-frame-alist)) |
4850 | 1453 (sc-confirm-always-p (if confirm-p t sc-confirm-always-p))) |
58952
5c34e026a96e
(sc-cite-frame-alist): Doc fix.
Juri Linkov <juri@jurta.org>
parents:
58583
diff
changeset
|
1454 (if (and frame (symbolp frame)) |
5c34e026a96e
(sc-cite-frame-alist): Doc fix.
Juri Linkov <juri@jurta.org>
parents:
58583
diff
changeset
|
1455 (setq frame (symbol-value frame))) |
5c34e026a96e
(sc-cite-frame-alist): Doc fix.
Juri Linkov <juri@jurta.org>
parents:
58583
diff
changeset
|
1456 (or frame (setq frame sc-default-cite-frame)) |
4850 | 1457 (run-hooks 'sc-pre-cite-hook) |
57933
59c9a776a021
(sc-cite-region): Don't use interactive-p. Add arg INTERACTIVE.
Richard M. Stallman <rms@gnu.org>
parents:
57160
diff
changeset
|
1458 (if interactive |
4850 | 1459 (sc-select-attribution)) |
1460 (regi-interpret frame start end))) | |
1461 | |
1462 (defun sc-uncite-region (start end) | |
1463 "Uncite a region delineated by START and END. | |
1464 First runs `sc-pre-uncite-hook'." | |
1465 (interactive "r") | |
1466 (undo-boundary) | |
58952
5c34e026a96e
(sc-cite-frame-alist): Doc fix.
Juri Linkov <juri@jurta.org>
parents:
58583
diff
changeset
|
1467 (let ((frame (sc-scan-info-alist sc-uncite-frame-alist))) |
5c34e026a96e
(sc-cite-frame-alist): Doc fix.
Juri Linkov <juri@jurta.org>
parents:
58583
diff
changeset
|
1468 (if (and frame (symbolp frame)) |
5c34e026a96e
(sc-cite-frame-alist): Doc fix.
Juri Linkov <juri@jurta.org>
parents:
58583
diff
changeset
|
1469 (setq frame (symbol-value frame))) |
5c34e026a96e
(sc-cite-frame-alist): Doc fix.
Juri Linkov <juri@jurta.org>
parents:
58583
diff
changeset
|
1470 (or frame (setq frame sc-default-uncite-frame)) |
4850 | 1471 (run-hooks 'sc-pre-uncite-hook) |
1472 (regi-interpret frame start end))) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
43791
diff
changeset
|
1473 |
4850 | 1474 (defun sc-recite-region (start end) |
1475 "Recite a region delineated by START and END. | |
1476 First runs `sc-pre-recite-hook'." | |
1477 (interactive "r") | |
1478 (let ((sc-confirm-always-p t)) | |
1479 (sc-select-attribution)) | |
1480 (undo-boundary) | |
58952
5c34e026a96e
(sc-cite-frame-alist): Doc fix.
Juri Linkov <juri@jurta.org>
parents:
58583
diff
changeset
|
1481 (let ((frame (sc-scan-info-alist sc-recite-frame-alist))) |
5c34e026a96e
(sc-cite-frame-alist): Doc fix.
Juri Linkov <juri@jurta.org>
parents:
58583
diff
changeset
|
1482 (if (and frame (symbolp frame)) |
5c34e026a96e
(sc-cite-frame-alist): Doc fix.
Juri Linkov <juri@jurta.org>
parents:
58583
diff
changeset
|
1483 (setq frame (symbol-value frame))) |
5c34e026a96e
(sc-cite-frame-alist): Doc fix.
Juri Linkov <juri@jurta.org>
parents:
58583
diff
changeset
|
1484 (or frame (setq frame sc-default-recite-frame)) |
4850 | 1485 (run-hooks 'sc-pre-recite-hook) |
1486 (regi-interpret frame start end))) | |
1487 | |
1488 | |
1489 ;; ====================================================================== | |
1490 ;; building headers | |
1491 | |
1492 (defun sc-hdr (prefix field &optional sep return-nil-p) | |
1493 "Returns a concatenation of PREFIX and FIELD. | |
1494 If FIELD is not a string or is the empty string, the empty string will | |
1495 be returned. Optional third argument SEP is concatenated on the end if | |
1496 it is a string. Returns empty string, unless optional RETURN-NIL-P is | |
1497 non-nil." | |
1498 (if (and (stringp field) | |
1499 (not (string= field ""))) | |
1500 (concat prefix field (or sep "")) | |
1501 (and (not return-nil-p) ""))) | |
1502 | |
1503 (defun sc-whofrom () | |
1504 "Return the value of (sc-mail-field \"from\") or nil." | |
1505 (let ((sc-mumble nil)) | |
1506 (sc-mail-field "from"))) | |
1507 | |
1508 (defun sc-no-header () | |
1509 "Does nothing. Use this instead of nil to get a blank header." | |
1510 ()) | |
1511 | |
1512 (defun sc-no-blank-line-or-header() | |
14007
c6476f4bb121
(sc-citation-nonnested-root-regexp,
Karl Heuer <kwzh@gnu.org>
parents:
13813
diff
changeset
|
1513 "Similar to `sc-no-header' except it removes the preceding blank line." |
4850 | 1514 (if (not (bobp)) |
1515 (if (and (eolp) | |
1516 (progn (forward-line -1) | |
21861 | 1517 (or (= (point) (mail-header-end)) |
4850 | 1518 (and (eq major-mode 'mh-letter-mode) |
1519 (mh-in-header-p))))) | |
1520 (progn (forward-line) | |
1521 (let ((kill-lines-magic t)) | |
1522 (kill-line)))))) | |
1523 | |
1524 (defun sc-header-on-said () | |
1525 "\"On <date>, <from> said:\" unless: | |
1526 1. the \"from\" field cannot be found, in which case nothing is inserted; | |
1527 2. the \"date\" field is missing in which case only the from part is printed." | |
1528 (let ((sc-mumble "") | |
1529 (whofrom (sc-whofrom))) | |
1530 (if whofrom | |
1531 (insert sc-reference-tag-string | |
1532 (sc-hdr "On " (sc-mail-field "date") ", ") | |
1533 whofrom " said:\n")))) | |
1534 | |
1535 (defun sc-header-inarticle-writes () | |
1536 "\"In article <message-id>, <from> writes:\" | |
1537 Treats \"message-id\" and \"from\" fields similar to `sc-header-on-said'." | |
1538 (let ((sc-mumble "") | |
1539 (whofrom (sc-mail-field "from"))) | |
1540 (if whofrom | |
1541 (insert sc-reference-tag-string | |
1542 (sc-hdr "In article " (sc-mail-field "message-id") ", ") | |
1543 whofrom " writes:\n")))) | |
1544 | |
1545 (defun sc-header-regarding-adds () | |
1546 "\"Regarding <subject>; <from> adds:\" | |
1547 Treats \"subject\" and \"from\" fields similar to `sc-header-on-said'." | |
1548 (let ((sc-mumble "") | |
1549 (whofrom (sc-whofrom))) | |
1550 (if whofrom | |
1551 (insert sc-reference-tag-string | |
1552 (sc-hdr "Regarding " (sc-mail-field "subject") "; ") | |
1553 whofrom " adds:\n")))) | |
1554 | |
1555 (defun sc-header-attributed-writes () | |
1556 "\"<sc-attribution>\" == <sc-author> <address> writes: | |
1557 Treats these fields in a similar manner to `sc-header-on-said'." | |
1558 (let ((sc-mumble "") | |
1559 (whofrom (sc-whofrom))) | |
1560 (if whofrom | |
1561 (insert sc-reference-tag-string | |
1562 (sc-hdr "\"" (sc-mail-field "sc-attribution") "\" == ") | |
1563 (sc-hdr "" (sc-mail-field "sc-author") " ") | |
1564 (or (sc-hdr "<" (sc-mail-field "sc-from-address") ">" t) | |
1565 (sc-hdr "<" (sc-mail-field "sc-reply-address") ">" t) | |
1566 "") | |
1567 " writes:\n")))) | |
1568 | |
1569 (defun sc-header-author-writes () | |
1570 "<sc-author> writes:" | |
1571 (let ((sc-mumble "") | |
1572 (whofrom (sc-whofrom))) | |
1573 (if whofrom | |
1574 (insert sc-reference-tag-string | |
1575 (sc-hdr "" (sc-mail-field "sc-author")) | |
1576 " writes:\n")))) | |
1577 | |
1578 (defun sc-header-verbose () | |
1579 "Very verbose, some say gross." | |
1580 (let ((sc-mumble "") | |
1581 (whofrom (sc-whofrom)) | |
1582 (tag sc-reference-tag-string)) | |
1583 (if whofrom | |
1584 (insert (sc-hdr (concat tag "On ") (sc-mail-field "date") ",\n") | |
1585 (or (sc-hdr tag (sc-mail-field "sc-author") "\n" t) | |
1586 (concat tag whofrom "\n")) | |
1587 (sc-hdr (concat tag "from the organization of ") | |
1588 (sc-mail-field "organization") "\n") | |
1589 (let ((rtag (concat tag "who can be reached at: "))) | |
1590 (or (sc-hdr rtag (sc-mail-field "sc-from-address") "\n" t) | |
1591 (sc-hdr rtag (sc-mail-field "sc-reply-address") "\n" t) | |
1592 "")) | |
1593 (sc-hdr | |
1594 (concat tag "(whose comments are cited below with \"") | |
1595 (sc-mail-field "sc-citation") "\"),\n") | |
1596 (sc-hdr (concat tag "had this to say in article ") | |
1597 (sc-mail-field "message-id") "\n") | |
1598 (sc-hdr (concat tag "in newsgroups ") | |
1599 (sc-mail-field "newsgroups") "\n") | |
1600 (sc-hdr (concat tag "concerning the subject of ") | |
1601 (sc-mail-field "subject") "\n") | |
1602 (sc-hdr (concat tag "(see ") | |
1603 (sc-mail-field "references") | |
1604 " for more details)\n") | |
1605 )))) | |
1606 | |
1607 | |
1608 ;; ====================================================================== | |
1609 ;; header rewrites | |
1610 | |
1611 (defconst sc-electric-bufname " *sc-erefs* " | |
1612 "Supercite electric reference mode's buffer name.") | |
1613 (defvar sc-eref-style 0 | |
1614 "Current electric reference style.") | |
1615 | |
1616 (defun sc-valid-index-p (index) | |
1617 "Returns INDEX if it is a valid index into `sc-rewrite-header-list'. | |
1618 Otherwise returns nil." | |
1619 ;; a number, and greater than or equal to zero | |
1620 ;; less than or equal to the last index | |
1621 (and (natnump index) | |
1622 (< index (length sc-rewrite-header-list)) | |
1623 index)) | |
1624 | |
1625 (defun sc-eref-insert-selected (&optional nomsg) | |
1626 "Insert the selected reference header in the current buffer. | |
1627 Optional NOMSG, if non-nil, inhibits printing messages, unless an | |
1628 error occurs." | |
1629 (let ((ref (nth sc-eref-style sc-rewrite-header-list))) | |
1630 (condition-case err | |
1631 (progn | |
1632 (eval ref) | |
1633 (let ((lines (count-lines (point-min) (point-max)))) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
43791
diff
changeset
|
1634 (or nomsg (message "Ref header %d [%d line%s]: %s" |
4850 | 1635 sc-eref-style lines |
1636 (if (= lines 1) "" "s") | |
1637 ref)))) | |
1638 (void-function | |
1639 (progn (message | |
1640 "Symbol's function definition is void: %s (Header %d)" | |
1641 (car (cdr err)) sc-eref-style) | |
1642 (beep) | |
1643 )) | |
1644 ))) | |
1645 | |
1646 (defun sc-electric-mode (&optional arg) | |
1647 " | |
1648 Mode for viewing Supercite reference headers. Commands are: | |
1649 \n\\{sc-electric-mode-map} | |
1650 | |
1651 `sc-electric-mode' is not intended to be run interactively, but rather | |
1652 accessed through Supercite's electric reference feature. See | |
1653 `sc-insert-reference' for more details. Optional ARG is the initial | |
1654 header style to use, unless not supplied or invalid, in which case | |
1655 `sc-preferred-header-style' is used." | |
1656 | |
1657 (let ((info sc-mail-info)) | |
1658 | |
1659 (setq sc-eref-style | |
1660 (or (sc-valid-index-p arg) | |
1661 (sc-valid-index-p sc-preferred-header-style) | |
1662 0)) | |
1663 | |
1664 (get-buffer-create sc-electric-bufname) | |
1665 ;; set up buffer and enter command loop | |
1666 (save-excursion | |
1667 (save-window-excursion | |
1668 (pop-to-buffer sc-electric-bufname) | |
1669 (kill-all-local-variables) | |
1670 (let ((sc-mail-info info) | |
1671 (buffer-read-only t) | |
1672 (mode-name "SC Electric Refs") | |
1673 (major-mode 'sc-electric-mode)) | |
1674 (use-local-map sc-electric-mode-map) | |
1675 (sc-eref-show sc-eref-style) | |
62765
db1434c1a2f5
(sc-electric-mode): Use run-mode-hooks.
Lute Kamstra <lute@gnu.org>
parents:
62315
diff
changeset
|
1676 (run-mode-hooks 'sc-electric-mode-hook) |
4850 | 1677 (recursive-edit) |
1678 ))) | |
1679 | |
1680 (and sc-eref-style | |
1681 (sc-eref-insert-selected)) | |
1682 (kill-buffer sc-electric-bufname) | |
1683 )) | |
1684 | |
1685 ;; functions for electric reference mode | |
1686 (defun sc-eref-show (index) | |
1687 "Show reference INDEX in `sc-rewrite-header-list'." | |
1688 (let ((msg "No %ing reference headers in list.") | |
1689 (last (length sc-rewrite-header-list))) | |
1690 (setq sc-eref-style | |
1691 (cond | |
1692 ((sc-valid-index-p index) index) | |
1693 ((< index 0) | |
1694 (if sc-electric-circular-p | |
1695 (1- last) | |
1696 (progn (error msg "preced") 0))) | |
1697 ((>= index last) | |
1698 (if sc-electric-circular-p | |
1699 0 | |
1700 (progn (error msg "follow") (1- last)))) | |
1701 )) | |
1702 (save-excursion | |
1703 (set-buffer sc-electric-bufname) | |
1704 (let ((buffer-read-only nil)) | |
1705 (erase-buffer) | |
1706 (goto-char (point-min)) | |
1707 (sc-eref-insert-selected) | |
1708 ;; now shrink the window to just contain the electric reference | |
1709 ;; header. | |
1710 (let ((hdrlines (count-lines (point-min) (point-max))) | |
1711 (winlines (1- (window-height)))) | |
1712 (if (/= hdrlines winlines) | |
1713 (if (> hdrlines winlines) | |
1714 ;; we have to enlarge the window | |
1715 (enlarge-window (- hdrlines winlines)) | |
1716 ;; we have to shrink the window | |
1717 (shrink-window (- winlines (max hdrlines window-min-height))) | |
1718 ))) | |
1719 )))) | |
1720 | |
1721 (defun sc-eref-next () | |
1722 "Display next reference in other buffer." | |
1723 (interactive) | |
1724 (sc-eref-show (1+ sc-eref-style))) | |
1725 | |
1726 (defun sc-eref-prev () | |
1727 "Display previous reference in other buffer." | |
1728 (interactive) | |
1729 (sc-eref-show (1- sc-eref-style))) | |
1730 | |
1731 (defun sc-eref-setn () | |
1732 "Set reference header selected as preferred." | |
1733 (interactive) | |
1734 (setq sc-preferred-header-style sc-eref-style) | |
1735 (message "Preferred reference style set to header %d." sc-eref-style)) | |
1736 | |
1737 (defun sc-eref-goto (refnum) | |
1738 "Show reference style indexed by REFNUM. | |
1739 If REFNUM is an invalid index, don't go to that reference and return | |
1740 nil." | |
1741 (interactive "NGoto Reference: ") | |
1742 (if (sc-valid-index-p refnum) | |
1743 (sc-eref-show refnum) | |
1744 (error "Invalid reference: %d. (Range: [%d .. %d])" | |
1745 refnum 0 (1- (length sc-rewrite-header-list))) | |
1746 )) | |
1747 | |
1748 (defun sc-eref-jump () | |
1749 "Set reference header to preferred header." | |
1750 (interactive) | |
1751 (sc-eref-show sc-preferred-header-style)) | |
1752 | |
1753 (defun sc-eref-abort () | |
1754 "Exit from electric reference mode without inserting reference." | |
1755 (interactive) | |
1756 (setq sc-eref-style nil) | |
1757 (exit-recursive-edit)) | |
1758 | |
1759 (defun sc-eref-exit () | |
1760 "Exit from electric reference mode and insert selected reference." | |
1761 (interactive) | |
1762 (exit-recursive-edit)) | |
1763 | |
1764 (defun sc-insert-reference (arg) | |
1765 "Insert, at point, a reference header in the body of the reply. | |
1766 Numeric ARG indicates which header style from `sc-rewrite-header-list' | |
1767 to use when rewriting the header. No supplied ARG indicates use of | |
1768 `sc-preferred-header-style'. | |
1769 | |
1770 With just `\\[universal-argument]', electric reference insert mode is | |
1771 entered, regardless of the value of `sc-electric-references-p'. See | |
1772 `sc-electric-mode' for more information." | |
1773 (interactive "P") | |
1774 (if (consp arg) | |
1775 (sc-electric-mode) | |
1776 (let ((preference (or (sc-valid-index-p arg) | |
1777 (sc-valid-index-p sc-preferred-header-style) | |
1778 sc-preferred-header-style | |
1779 0))) | |
1780 (if sc-electric-references-p | |
1781 (sc-electric-mode preference) | |
1782 (sc-eref-insert-selected t) | |
1783 )))) | |
1784 | |
1785 | |
1786 ;; ====================================================================== | |
1787 ;; variable toggling | |
1788 | |
1789 (defun sc-raw-mode-toggle () | |
1790 "Toggle, in one fell swoop, two important SC variables: | |
1791 `sc-fixup-whitespace-p' and `sc-auto-fill-region-p'" | |
1792 (interactive) | |
1793 (setq sc-fixup-whitespace-p (not sc-fixup-whitespace-p) | |
1794 sc-auto-fill-region-p (not sc-auto-fill-region-p)) | |
11571
771bd7ddd4cc
(sc-raw-mode-toggle): Use force-mode-line-update.
Karl Heuer <kwzh@gnu.org>
parents:
11556
diff
changeset
|
1795 (force-mode-line-update)) |
4850 | 1796 |
1797 (defun sc-toggle-var (variable) | |
1798 "Boolean toggle VARIABLE's value. | |
42206 | 1799 VARIABLE must be a bound symbol. nil values change to t, non-nil |
4850 | 1800 values are changed to nil." |
1801 (message "%s changed from %s to %s" | |
1802 variable (symbol-value variable) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1803 (set variable (not (symbol-value variable))))) |
4850 | 1804 |
1805 (defun sc-set-variable (var) | |
1806 "Set the Supercite VARIABLE. | |
1807 This function mimics `set-variable', except that the variable to set | |
1808 is determined non-interactively. The value is queried for in the | |
1809 minibuffer exactly the same way that `set-variable' does it. | |
1810 | |
1811 You can see the current value of the variable when the minibuffer is | |
1812 querying you by typing `C-h'. Note that the format is changed | |
1813 slightly from that used by `set-variable' -- the current value is | |
1814 printed just after the variable's name instead of at the bottom of the | |
1815 help window." | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1816 (let* ((minibuffer-help-form '(funcall myhelp)) |
4850 | 1817 (myhelp |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1818 (lambda () |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1819 (with-output-to-temp-buffer "*Help*" |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1820 (prin1 var) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1821 (if (boundp var) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1822 (let ((print-length 20)) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1823 (princ "\t(Current value: ") |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1824 (prin1 (symbol-value var)) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1825 (princ ")"))) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1826 (princ "\n\nDocumentation:\n") |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1827 (princ (substring (documentation-property |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1828 var |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1829 'variable-documentation) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1830 1)) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1831 (with-current-buffer standard-output |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1832 (help-mode)) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1833 nil)))) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1834 (set var (eval-minibuffer (format "Set %s to value: " var))))) |
4850 | 1835 |
1836 (defmacro sc-toggle-symbol (rootname) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1837 `(defun ,(intern (concat "sc-T-" rootname)) () |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1838 (interactive) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1839 (sc-toggle-var ',(intern (concat "sc-" rootname "-p"))))) |
4850 | 1840 |
1841 (defmacro sc-setvar-symbol (rootname) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1842 `(defun ,(intern (concat "sc-S-" rootname)) () |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1843 (interactive) |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1844 (sc-set-variable ',(intern (concat "sc-" rootname))))) |
4850 | 1845 |
1846 (sc-toggle-symbol "confirm-always") | |
1847 (sc-toggle-symbol "downcase") | |
1848 (sc-toggle-symbol "electric-references") | |
1849 (sc-toggle-symbol "auto-fill-region") | |
1850 (sc-toggle-symbol "mail-nuke-blank-lines") | |
1851 (sc-toggle-symbol "nested-citation") | |
1852 (sc-toggle-symbol "electric-circular") | |
1853 (sc-toggle-symbol "use-only-preferences") | |
1854 (sc-toggle-symbol "fixup-whitespace") | |
1855 | |
1856 (sc-setvar-symbol "preferred-attribution-list") | |
1857 (sc-setvar-symbol "preferred-header-style") | |
1858 (sc-setvar-symbol "mail-nuke-mail-headers") | |
1859 (sc-setvar-symbol "mail-header-nuke-list") | |
1860 (sc-setvar-symbol "cite-region-limit") | |
1861 | |
1862 (defun sc-T-describe () | |
1863 " | |
1864 | |
1865 Supercite provides a number of key bindings which simplify the process | |
1866 of setting or toggling certain variables controlling its operation. | |
1867 | |
1868 Note on function names in this list: all functions of the form | |
1869 `sc-S-<name>' actually call `sc-set-variable' on the corresponding | |
1870 `sc-<name>' variable. All functions of the form `sc-T-<name>' call | |
1871 `sc-toggle-var' on the corresponding `sc-<name>-p' variable. | |
1872 | |
1873 \\{sc-T-keymap}" | |
1874 (interactive) | |
1875 (describe-function 'sc-T-describe)) | |
1876 | |
1877 | |
1878 ;; ====================================================================== | |
1879 ;; published interface to mail and news readers | |
1880 | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1881 (define-minor-mode sc-minor-mode |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1882 "Supercite minor mode." |
61282
73d56a93d9fd
(sc-minor-mode): Specify :group.
Lute Kamstra <lute@gnu.org>
parents:
61044
diff
changeset
|
1883 :group 'supercite |
73d56a93d9fd
(sc-minor-mode): Specify :group.
Lute Kamstra <lute@gnu.org>
parents:
61044
diff
changeset
|
1884 :lighter (" SC" (sc-auto-fill-region-p |
73d56a93d9fd
(sc-minor-mode): Specify :group.
Lute Kamstra <lute@gnu.org>
parents:
61044
diff
changeset
|
1885 (":f" (sc-fixup-whitespace-p "w")) |
73d56a93d9fd
(sc-minor-mode): Specify :group.
Lute Kamstra <lute@gnu.org>
parents:
61044
diff
changeset
|
1886 (sc-fixup-whitespace-p ":w"))) |
73d56a93d9fd
(sc-minor-mode): Specify :group.
Lute Kamstra <lute@gnu.org>
parents:
61044
diff
changeset
|
1887 :keymap `((,sc-mode-map-prefix . ,sc-mode-map))) |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1888 |
7370
ecb09a00d330
(sc-cite-original): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents:
5286
diff
changeset
|
1889 ;;;###autoload |
4850 | 1890 (defun sc-cite-original () |
1891 "Workhorse citing function which performs the initial citation. | |
1892 This is callable from the various mail and news readers' reply | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1893 function according to the agreed upon standard. See the associated |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1894 info node `(SC)Top' for more details. |
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1895 `sc-cite-original' does not do any yanking of the |
4850 | 1896 original message but it does require a few things: |
1897 | |
1898 1) The reply buffer is the current buffer. | |
1899 | |
1900 2) The original message has been yanked and inserted into the | |
1901 reply buffer. | |
1902 | |
1903 3) Verbose mail headers from the original message have been | |
1904 inserted into the reply buffer directly before the text of the | |
1905 original message. | |
1906 | |
1907 4) Point is at the beginning of the verbose headers. | |
1908 | |
1909 5) Mark is at the end of the body of text to be cited. | |
1910 | |
1911 For Emacs 19's, the region need not be active (and typically isn't | |
1912 when this function is called. Also, the hook `sc-pre-hook' is run | |
1913 before, and `sc-post-hook' is run after the guts of this function." | |
1914 (run-hooks 'sc-pre-hook) | |
1915 | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1916 (sc-minor-mode 1) |
4850 | 1917 |
1918 (undo-boundary) | |
1919 | |
1920 ;; grab point and mark since the region is probably not active when | |
1921 ;; this function gets automatically called. we want point to be a | |
1922 ;; mark so any deleting before point works properly | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1923 (let* ((zmacs-regions nil) ; for XEemacs |
24876 | 1924 (mark-active t) ; for Emacs |
4850 | 1925 (point (point-marker)) |
1926 (mark (copy-marker (mark-marker)))) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
43791
diff
changeset
|
1927 |
4850 | 1928 ;; make sure point comes before mark, not all functions are |
1929 ;; interactive "r" | |
1930 (if (< mark point) | |
1931 (let ((tmp point)) | |
1932 (setq point mark | |
1933 mark tmp))) | |
1934 | |
1935 ;; first process mail headers, and populate sc-mail-info | |
1936 (sc-mail-process-headers point mark) | |
1937 | |
1938 ;; now get possible attributions | |
1939 (sc-attribs-chop-address (or (sc-mail-field "from") | |
1940 (sc-mail-field "reply") | |
1941 (sc-mail-field "reply-to") | |
1942 (sc-mail-field "sender"))) | |
1943 ;; select the attribution | |
1944 (sc-select-attribution) | |
1945 | |
1946 ;; cite the region, but first check the value of sc-cite-region-limit | |
1947 (let ((linecnt (count-lines point mark))) | |
1948 (and sc-cite-region-limit | |
1949 (if (or (not (numberp sc-cite-region-limit)) | |
1950 (<= linecnt sc-cite-region-limit)) | |
1951 (progn | |
1952 ;; cite the region and insert the header rewrite | |
1953 (sc-cite-region point mark) | |
1954 (goto-char point) | |
1955 (let ((sc-eref-style (or sc-preferred-header-style 0))) | |
1956 (if sc-electric-references-p | |
1957 (sc-electric-mode sc-eref-style) | |
1958 (sc-eref-insert-selected t)))) | |
1959 (beep) | |
1960 (message | |
1961 "Region not cited. %d lines exceeds sc-cite-region-limit: %d" | |
1962 linecnt sc-cite-region-limit)))) | |
1963 | |
1964 ;; finally, free the point-marker | |
1965 (set-marker point nil) | |
1966 (set-marker mark nil) | |
1967 ) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1968 (run-hooks 'sc-post-hook)) |
4850 | 1969 |
1970 | |
1971 ;; ====================================================================== | |
1972 ;; bug reporting and miscellaneous commands | |
1973 | |
1974 (defun sc-open-line (arg) | |
1975 "Like `open-line', but insert the citation prefix at the front of the line. | |
1976 With numeric ARG, inserts that many new lines." | |
1977 (interactive "p") | |
1978 (save-excursion | |
1979 (let ((start (point)) | |
1980 (prefix (or (progn (beginning-of-line) | |
1981 (if (looking-at (sc-cite-regexp)) | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
1982 (match-string 0))) |
4850 | 1983 ""))) |
1984 (goto-char start) | |
1985 (open-line arg) | |
1986 (forward-line 1) | |
1987 (while (< 0 arg) | |
1988 (insert prefix) | |
1989 (forward-line 1) | |
1990 (setq arg (1- arg)) | |
1991 )))) | |
1992 | |
1993 (defun sc-insert-citation (arg) | |
1994 "Insert citation string at beginning of current line if not already cited. | |
1995 With `\\[universal-argument]' insert citation even if line is already | |
1996 cited." | |
1997 (interactive "P") | |
1998 (save-excursion | |
1999 (beginning-of-line) | |
2000 (if (or (not (looking-at (sc-cite-regexp))) | |
2001 (looking-at "^[ \t]*$") | |
2002 (consp arg)) | |
2003 (insert (sc-mail-field "sc-citation")) | |
38436
b174db545cfd
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
28437
diff
changeset
|
2004 (error "Line is already cited")))) |
4850 | 2005 |
57933
59c9a776a021
(sc-cite-region): Don't use interactive-p. Add arg INTERACTIVE.
Richard M. Stallman <rms@gnu.org>
parents:
57160
diff
changeset
|
2006 (defun sc-version (message) |
4850 | 2007 "Echo the current version of Supercite in the minibuffer. |
57933
59c9a776a021
(sc-cite-region): Don't use interactive-p. Add arg INTERACTIVE.
Richard M. Stallman <rms@gnu.org>
parents:
57160
diff
changeset
|
2008 If MESSAGE is non-nil (interactively, with no prefix argument), |
4850 | 2009 inserts the version string in the current buffer instead." |
57933
59c9a776a021
(sc-cite-region): Don't use interactive-p. Add arg INTERACTIVE.
Richard M. Stallman <rms@gnu.org>
parents:
57160
diff
changeset
|
2010 (interactive (not current-prefix-arg)) |
4850 | 2011 (let ((verstr (format "Using Supercite.el %s" sc-version))) |
57933
59c9a776a021
(sc-cite-region): Don't use interactive-p. Add arg INTERACTIVE.
Richard M. Stallman <rms@gnu.org>
parents:
57160
diff
changeset
|
2012 (if message |
59c9a776a021
(sc-cite-region): Don't use interactive-p. Add arg INTERACTIVE.
Richard M. Stallman <rms@gnu.org>
parents:
57160
diff
changeset
|
2013 (message verstr) |
59c9a776a021
(sc-cite-region): Don't use interactive-p. Add arg INTERACTIVE.
Richard M. Stallman <rms@gnu.org>
parents:
57160
diff
changeset
|
2014 (insert "`sc-version' says: " verstr)))) |
4850 | 2015 |
2016 (defun sc-describe () | |
2017 " | |
2018 Supercite is a package which provides a flexible mechanism for citing | |
2019 email and news replies. Please see the associated texinfo file for | |
51174
26b66dee5902
Use `push' and replace `regi-pos' by equivalents.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50759
diff
changeset
|
2020 more information. Info node `(SC)Top'." |
4850 | 2021 (interactive) |
2022 (describe-function 'sc-describe)) | |
2023 | |
2024 (defun sc-submit-bug-report () | |
2025 "Submit a bug report on Supercite via mail." | |
2026 (interactive) | |
2027 (require 'reporter) | |
2028 (and | |
2029 (y-or-n-p "Do you want to submit a report on Supercite? ") | |
2030 (reporter-submit-bug-report | |
2031 sc-help-address | |
2032 (concat "Supercite version " sc-version) | |
2033 (list | |
2034 'sc-attrib-selection-list | |
2035 'sc-auto-fill-region-p | |
2036 'sc-blank-lines-after-headers | |
2037 'sc-citation-leader | |
2038 'sc-citation-delimiter | |
2039 'sc-citation-separator | |
2040 'sc-citation-leader-regexp | |
2041 'sc-citation-root-regexp | |
2042 'sc-citation-nonnested-root-regexp | |
2043 'sc-citation-delimiter-regexp | |
2044 'sc-citation-separator-regexp | |
2045 'sc-cite-region-limit | |
2046 'sc-confirm-always-p | |
2047 'sc-default-attribution | |
2048 'sc-default-author-name | |
2049 'sc-downcase-p | |
2050 'sc-electric-circular-p | |
2051 'sc-electric-references-p | |
2052 'sc-fixup-whitespace-p | |
2053 'sc-mail-warn-if-non-rfc822-p | |
2054 'sc-mumble | |
2055 'sc-name-filter-alist | |
2056 'sc-nested-citation-p | |
2057 'sc-nuke-mail-headers | |
2058 'sc-nuke-mail-header-list | |
2059 'sc-preferred-attribution-list | |
2060 'sc-preferred-header-style | |
2061 'sc-reference-tag-string | |
2062 'sc-rewrite-header-list | |
2063 'sc-titlecue-regexp | |
2064 'sc-use-only-preference-p | |
2065 )))) | |
2066 | |
2067 | |
2068 ;; useful stuff | |
2069 (provide 'supercite) | |
2070 (run-hooks 'sc-load-hook) | |
2071 | |
61044
17207b620cf3
(sc-mail-field): Use assoc-string.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60924
diff
changeset
|
2072 ;; arch-tag: a5d5bfa6-3bd5-4414-8c65-0afc83e45cd3 |
4850 | 2073 ;;; supercite.el ends here |