;; Copyright (C) 1993, 1997 Free Software Foundation, Inc.
;; Author: 1993 Barry A. Warsaw, Century Computing, Inc. <bwarsaw@cen.com>
-;; Maintainer: supercite-help@python.org
+;; Maintainer: Mark Senn <mds@ecn.purdue.edu>
;; Created: February 1993
;; Last Modified: 1993/09/22 18:58:46
;; Keywords: mail, news
;; Boston, MA 02111-1307, USA.
;; LCD Archive Entry
-;; supercite|Barry A. Warsaw|supercite-help@anthem.nlm.nih.gov
+;; supercite|Barry A. Warsaw|supercite-help@python.org
;; |Mail and news reply citation package
;; |1993/09/22 18:58:46|3.1|
-;; Code:
+;;; Commentary:
+
+;;; Code:
\f
(require 'regi)
;; Nemacs and Mule users note: please see the texinfo manual for
;; suggestions on setting these variables.
-(defcustom sc-citation-root-regexp "[-._a-zA-Z0-9]*"
+(defcustom sc-citation-root-regexp "[-._[:alnum:]]*"
"*Regexp describing variable root part of a citation for a cited line.
This should NOT have a leading `^' character. See also
`sc-citation-nonnested-root-regexp'."
:type 'regexp
:group 'supercite-cite)
-(defcustom sc-citation-nonnested-root-regexp "[-._a-zA-Z0-9]+"
+(defcustom sc-citation-nonnested-root-regexp "[-._[:alnum:]]+"
"*Regexp describing the variable root part of a nested citation.
This should NOT have a leading `^' character. This variable is
related to `sc-citation-root-regexp' but whereas that variable
attribution. Note that the variable `sc-preferred-attribution-list'
must contain an element of the string \"sc-consult\" for this variable
to be consulted during attribution selection."
- :type '(repeat (list symbol (repeat (cons regexp
- (choice (repeat (repeat sexp))
- symbol)))))
+ :type '(repeat (list string
+ (repeat (cons regexp
+ (choice (sexp :tag "List to eval")
+ string)))))
:group 'supercite-attr)
(defcustom sc-attribs-preselect-hook nil
(defconst sc-emacs-features
(let ((version 'v18)
(flavor 'GNU))
- (if (string= (substring emacs-version 0 2) "19")
+ (if (not
+ (string= (substring emacs-version 0 2) "18"))
(setq version 'v19))
(if (string-match "Lucid" emacs-version)
(setq flavor 'Lucid))
"A list describing what version of Emacs we're running on.
Known flavors are:
-All GNU18's: (v18 GNU)
-FSF19.x : (v19 GNU)
-Lucid19.x : (v19 Lucid)")
+Emacs 18 : (v18 GNU)
+Emacs 19 or later : (v19 GNU)
+Lucid 19 or later : (v19 Lucid)")
(defvar sc-tmp-nested-regexp nil
"Compatibility between Emacs 18 and 19 `read-string'.
In version 18, the HISTORY argument is ignored."
(if (memq 'v19 sc-emacs-features)
- ;; maybe future versions will take a `history' argument:
- (read-string prompt initial-contents)
+ (read-string prompt initial-contents history)
(read-string prompt initial-contents)))
(if (fboundp 'match-string)
(setq event (read-char)))
((memq 'Lucid sc-emacs-features)
(next-command-event event))
- (t ; must be FSF19
+ (t ; must be Emacs 19
(setq event (read-event))))
(prog1 quit-flag (setq quit-flag nil)))
(progn
(end (setq sc-mail-headers-end (point))))
"Regi frame for glomming mail header information.")
+(eval-when-compile (defvar curline)) ; dynamic bondage
+
;; regi functions
(defun sc-mail-fetch-field (&optional attribs-p)
"Insert a key and value into `sc-mail-info' alist.
(= (aref address (1- (length address))) ?>))
(substring address 1 (1- (length address)))
address))
- (if (string-match "[-a-zA-Z0-9!@%._]+" from 0)
+ (if (string-match "[-[:alnum:]!@%._]+" from 0)
(sc-submatch 0 from)
"")
)))
(sc-name-substring
from (string-match "\".*\"" from 0) (match-end 0) 1)
(sc-name-substring
- from (string-match "\\([-.a-zA-Z0-9_]+\\s +\\)+<" from 0)
+ from (string-match "\\([-.[:alnum:]_]+\\s +\\)+<" from 0)
(match-end 1) 0)
(sc-attribs-emailname from))))
;; strip off any leading or trailing whitespace
(setq sc-attrib-or-cite nil) ; nil==attribution, t==citation
(while
(catch 'sc-reconfirm
- (string= "" (setq choice
- (if sc-attrib-or-cite
- (sc-read-string
- "Enter citation prefix: "
- citation
- 'sc-citation-confirmation-history)
- (sc-completing-read
- "Complete attribution name: "
- query-alist nil nil
- (cons initial 0)
- 'sc-attribution-confirmation-history)
- )))))
+ (progn
+ (setq choice
+ (if sc-attrib-or-cite
+ (sc-read-string
+ "Enter citation prefix: "
+ citation
+ 'sc-citation-confirmation-history)
+ (sc-completing-read
+ "Complete attribution name: "
+ query-alist nil nil
+ (cons initial 0)
+ 'sc-attribution-confirmation-history)
+ ))
+ nil)))
(if sc-attrib-or-cite
;; since the citation was chosen, we have to guess at
;; the attribution
(defun sc-toggle-var (variable)
"Boolean toggle VARIABLE's value.
-VARIABLE must be a bound symbol. Nil values change to t, non-nil
+VARIABLE must be a bound symbol. nil values change to t, non-nil
values are changed to nil."
(message "%s changed from %s to %s"
variable (symbol-value variable)
- (set-variable variable (not (eval-expression variable))))
+ (set variable (not (symbol-value variable))))
(sc-set-mode-string))
(defun sc-set-variable (var)
;; this function gets automatically called. we want point to be a
;; mark so any deleting before point works properly
(let* ((zmacs-regions nil) ; for Lemacs
- (mark-active t) ; for FSFmacs
+ (mark-active t) ; for Emacs
(point (point-marker))
(mark (copy-marker (mark-marker))))
(looking-at "^[ \t]*$")
(consp arg))
(insert (sc-mail-field "sc-citation"))
- (error "Line is already cited."))))
+ (error "Line is already cited"))))
(defun sc-version (arg)
"Echo the current version of Supercite in the minibuffer.