;; |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
(defconst sc-emacs-features
(let ((version 'v18)
(flavor 'GNU))
- (if (or
- (string= (substring emacs-version 0 2) "19")
- (string= (substring emacs-version 0 2) "20"))
+ (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:
-Emacs 18 : (v18 GNU)
-Emacs 19 or 20 : (v19 GNU)
-Lucid 19 or 20 : (v19 Lucid)")
+Emacs 18 : (v18 GNU)
+Emacs 19 or later : (v19 GNU)
+Lucid 19 or later : (v19 Lucid)")
(defvar sc-tmp-nested-regexp nil
(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)
(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.