aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Blandy1991-04-12 20:25:03 +0000
committerJim Blandy1991-04-12 20:25:03 +0000
commit14c5b7212d09ee8c53670d9a8145ac71824ef50b (patch)
tree5f0970ea86d03a2c1825139c0c24c4c9493f213e
parent573f9b32b9337b57289b77e3dfe8c447e023d9d6 (diff)
downloademacs-14c5b7212d09ee8c53670d9a8145ac71824ef50b.tar.gz
emacs-14c5b7212d09ee8c53670d9a8145ac71824ef50b.zip
*** empty log message ***
-rw-r--r--lisp/register.el27
-rw-r--r--lisp/textmodes/refbib.el71
2 files changed, 42 insertions, 56 deletions
diff --git a/lisp/register.el b/lisp/register.el
index fd901f99f4a..4eef728bef0 100644
--- a/lisp/register.el
+++ b/lisp/register.el
@@ -29,8 +29,7 @@ A list represents a rectangle; its elements are strings.")
29 (cdr (assq char register-alist))) 29 (cdr (assq char register-alist)))
30 30
31(defun set-register (char value) 31(defun set-register (char value)
32 "Set contents of Emacs register named CHAR to VALUE. 32 "Set contents of Emacs register named CHAR to VALUE. Returns VALUE."
33Returns VALUE."
34 (let ((aelt (assq char register-alist))) 33 (let ((aelt (assq char register-alist)))
35 (if aelt 34 (if aelt
36 (setcdr aelt value) 35 (setcdr aelt value)
@@ -136,20 +135,16 @@ Interactively, second arg is non-nil if prefix arg is supplied."
136 (if (not arg) (exchange-point-and-mark))) 135 (if (not arg) (exchange-point-and-mark)))
137 136
138(defun copy-to-register (char start end &optional delete-flag) 137(defun copy-to-register (char start end &optional delete-flag)
139 "Copy region into register REG. 138 "Copy region into register REG. With prefix arg, delete as well.
140With prefix arg, delete as well. 139Called from program, takes four args: REG, START, END and DELETE-FLAG.
141Called from program, takes four args:
142REG, START, END and DELETE-FLAG.
143START and END are buffer positions indicating what to copy." 140START and END are buffer positions indicating what to copy."
144 (interactive "cCopy to register: \nr\nP") 141 (interactive "cCopy to register: \nr\nP")
145 (set-register char (buffer-substring start end)) 142 (set-register char (buffer-substring start end))
146 (if delete-flag (delete-region start end))) 143 (if delete-flag (delete-region start end)))
147 144
148(defun append-to-register (char start end &optional delete-flag) 145(defun append-to-register (char start end &optional delete-flag)
149 "Append region to text in register REG. 146 "Append region to text in register REG. With prefix arg, delete as well.
150With prefix arg, delete as well. 147Called from program, takes four args: REG, START, END and DELETE-FLAG.
151Called from program, takes four args:
152REG, START, END and DELETE-FLAG.
153START and END are buffer positions indicating what to append." 148START and END are buffer positions indicating what to append."
154 (interactive "cAppend to register: \nr\nP") 149 (interactive "cAppend to register: \nr\nP")
155 (or (stringp (get-register char)) 150 (or (stringp (get-register char))
@@ -159,10 +154,8 @@ START and END are buffer positions indicating what to append."
159 (if delete-flag (delete-region start end))) 154 (if delete-flag (delete-region start end)))
160 155
161(defun prepend-to-register (char start end &optional delete-flag) 156(defun prepend-to-register (char start end &optional delete-flag)
162 "Prepend region to text in register REG. 157 "Prepend region to text in register REG. With prefix arg, delete as well.
163With prefix arg, delete as well. 158Called from program, takes four args: REG, START, END and DELETE-FLAG.
164Called from program, takes four args:
165REG, START, END and DELETE-FLAG.
166START and END are buffer positions indicating what to prepend." 159START and END are buffer positions indicating what to prepend."
167 (interactive "cPrepend to register: \nr\nP") 160 (interactive "cPrepend to register: \nr\nP")
168 (or (stringp (get-register char)) 161 (or (stringp (get-register char))
@@ -172,10 +165,8 @@ START and END are buffer positions indicating what to prepend."
172 (if delete-flag (delete-region start end))) 165 (if delete-flag (delete-region start end)))
173 166
174(defun copy-rectangle-to-register (char start end &optional delete-flag) 167(defun copy-rectangle-to-register (char start end &optional delete-flag)
175 "Copy rectangular region into register REG. 168 "Copy rectangular region into register REG. With prefix arg, delete as well.
176With prefix arg, delete as well. 169Called from program, takes four args: REG, START, END and DELETE-FLAG.
177Called from program, takes four args:
178REG, START, END and DELETE-FLAG.
179START and END are buffer positions giving two corners of rectangle." 170START and END are buffer positions giving two corners of rectangle."
180 (interactive "cCopy rectangle to register: \nr\nP") 171 (interactive "cCopy rectangle to register: \nr\nP")
181 (set-register char 172 (set-register char
diff --git a/lisp/textmodes/refbib.el b/lisp/textmodes/refbib.el
index 3b376cdd90b..149c2f7e5c6 100644
--- a/lisp/textmodes/refbib.el
+++ b/lisp/textmodes/refbib.el
@@ -84,22 +84,22 @@ BibTeX macro \"ijcai7\".")
84(defvar r2b-proceedings-list 84(defvar r2b-proceedings-list
85 '() 85 '()
86 " Assoc list of books or journals which are really conference proceedings, 86 " Assoc list of books or journals which are really conference proceedings,
87but whose name and whose abbrev expansion (as defined in r2b-journal-abbrevs 87but whose name and whose abbrev expansion (as defined in `r2b-journal-abbrevs'
88and r2b-booktitle-abbrevs) does not contain the words 'conference' or 88and `r2b-booktitle-abbrevs') does not contain the words \"conference\" or
89'proceedings'. (Those cases are handled automatically.) 89\"proceedings\". (Those cases are handled automatically.)
90The entry must match the given data exactly. 90The entry must match the given data exactly.
91 Because titles are capitalized before matching, the items in this list 91 Because titles are capitalized before matching, the items in this list
92should begin with a capital letter. 92should begin with a capital letter.
93 For example, suppose the title \"Ijcai81\" is used for the proceedings of 93 For example, suppose the title \"Ijcai81\" is used for the proceedings of
94a conference, and it's expansion is the BibTeX macro \"ijcai7\". Then 94a conference, and it's expansion is the BibTeX macro \"ijcai7\". Then
95r2b-proceedings-list should be '((\"Ijcai81\") ...). If instead its 95`r2b-proceedings-list' should be '((\"Ijcai81\") ...). If instead its
96expansion were \"Proceedings of the Seventh International Conference 96expansion were \"Proceedings of the Seventh International Conference
97on Artificial Intelligence\", then you would NOT need to include Ijcai81 97on Artificial Intelligence\", then you would NOT need to include Ijcai81
98in r2b-proceedings-list (although it wouldn't cause an error).") 98in `r2b-proceedings-list' (although it wouldn't cause an error).")
99 99
100(defvar r2b-additional-stop-words 100(defvar r2b-additional-stop-words
101 "Some\\|What" 101 "Some\\|What"
102 "Words other than the capitialize-title-stop-words 102 "Words other than the `capitialize-title-stop-words'
103which are not to be used to build the citation key") 103which are not to be used to build the citation key")
104 104
105 105
@@ -121,7 +121,7 @@ word in the title)")
121 (concat "\\(" capitalize-title-stop-words "\\)\\(\\b\\|'\\)")) 121 (concat "\\(" capitalize-title-stop-words "\\)\\(\\b\\|'\\)"))
122 122
123(defun capitalize-title-region (begin end) 123(defun capitalize-title-region (begin end)
124 "Like capitalize-region, but don't capitalize stop words, except the first" 124 "Like `capitalize-region', but don't capitalize stop words, except the first."
125 (interactive "r") 125 (interactive "r")
126 (let ((case-fold-search nil) (orig-syntax-table (syntax-table))) 126 (let ((case-fold-search nil) (orig-syntax-table (syntax-table)))
127 (unwind-protect 127 (unwind-protect
@@ -144,7 +144,7 @@ word in the title)")
144 144
145 145
146(defun capitalize-title (s) 146(defun capitalize-title (s)
147 "Like capitalize, but don't capitalize stop words, except the first" 147 "Like capitalize, but don't capitalize stop words, except the first."
148 (save-excursion 148 (save-excursion
149 (set-buffer (get-buffer-create "$$$Scratch$$$")) 149 (set-buffer (get-buffer-create "$$$Scratch$$$"))
150 (erase-buffer) 150 (erase-buffer)
@@ -154,7 +154,7 @@ word in the title)")
154 154
155;********************************************************* 155;*********************************************************
156(defun r2b-reset () 156(defun r2b-reset ()
157 "unbind defvars, for debugging" 157 "Unbind defvars, for debugging."
158 (interactive) 158 (interactive)
159 (makunbound 'r2b-journal-abbrevs) 159 (makunbound 'r2b-journal-abbrevs)
160 (makunbound 'r2b-booktitle-abbrevs) 160 (makunbound 'r2b-booktitle-abbrevs)
@@ -162,8 +162,7 @@ word in the title)")
162 (makunbound 'capitalize-title-stop-words) 162 (makunbound 'capitalize-title-stop-words)
163 (makunbound 'capitalize-title-stop-regexp) 163 (makunbound 'capitalize-title-stop-regexp)
164 (makunbound 'r2b-additional-stop-words) 164 (makunbound 'r2b-additional-stop-words)
165 (makunbound 'r2b-stop-regexp) 165 (makunbound 'r2b-stop-regexp))
166 )
167 166
168(defvar r2b-stop-regexp 167(defvar r2b-stop-regexp
169 (concat "\\`\\(\\(" 168 (concat "\\`\\(\\("
@@ -175,11 +174,10 @@ word in the title)")
175 (if r2b-trace-on 174 (if r2b-trace-on
176 (progn 175 (progn
177 (apply (function message) args) 176 (apply (function message) args)
178 (sit-for 0) 177 (sit-for 0))))
179 )))
180 178
181(defun r2b-match (exp) 179(defun r2b-match (exp)
182 "returns string matched in current buffer" 180 "Returns string matched in current buffer."
183 (buffer-substring (match-beginning exp) (match-end exp))) 181 (buffer-substring (match-beginning exp) (match-end exp)))
184 182
185(defvar r2b-out-buf-name "*Out*" "*output from refer-to-bibtex" ) 183(defvar r2b-out-buf-name "*Out*" "*output from refer-to-bibtex" )
@@ -223,12 +221,11 @@ word in the title)")
223 )) 221 ))
224 222
225(defun r2b-clear-variables () 223(defun r2b-clear-variables ()
226 "set all global vars used by r2b to nil" 224 "Set all global vars used by r2b to nil."
227 (let ((vars r2b-variables)) 225 (let ((vars r2b-variables))
228 (while vars 226 (while vars
229 (set (car vars) nil) 227 (set (car vars) nil)
230 (setq vars (cdr vars))) 228 (setq vars (cdr vars)))))
231 ))
232 229
233(defun r2b-warning (&rest args) 230(defun r2b-warning (&rest args)
234 (setq r2b-error-found t) 231 (setq r2b-error-found t)
@@ -236,8 +233,7 @@ word in the title)")
236 (princ "\n" r2b-log) 233 (princ "\n" r2b-log)
237 (princ "\n" r2b-out-buf) 234 (princ "\n" r2b-out-buf)
238 (princ "% " r2b-out-buf) 235 (princ "% " r2b-out-buf)
239 (princ (apply (function format) args) r2b-out-buf) 236 (princ (apply (function format) args) r2b-out-buf))
240 )
241 237
242(defun r2b-get-field (var field &optional unique required capitalize) 238(defun r2b-get-field (var field &optional unique required capitalize)
243 "Set VAR to string value of FIELD, if any. If none, VAR is set to 239 "Set VAR to string value of FIELD, if any. If none, VAR is set to
@@ -278,7 +274,7 @@ title if CAPITALIZE is true. Returns value of VAR."
278 )) 274 ))
279 275
280(defun r2b-set-match (var n regexp string ) 276(defun r2b-set-match (var n regexp string )
281 "set VAR to the Nth subpattern in REGEXP matched by STRING, or nil if none" 277 "Set VAR to the Nth subpattern in REGEXP matched by STRING, or nil if none."
282 (set var 278 (set var
283 (if (and (stringp string) (string-match regexp string)) 279 (if (and (stringp string) (string-match regexp string))
284 (substring string (match-beginning n) (match-end n)) 280 (substring string (match-beginning n) (match-end n))
@@ -291,7 +287,7 @@ title if CAPITALIZE is true. Returns value of VAR."
291 ("sep") ("oct") ("nov") ("dec"))) 287 ("sep") ("oct") ("nov") ("dec")))
292 288
293(defun r2b-convert-month () 289(defun r2b-convert-month ()
294 "Try to convert r2bv-month to a standard 3 letter name" 290 "Try to convert `r2bv-month' to a standard 3 letter name."
295 (if r2bv-month 291 (if r2bv-month
296 (let ((months r2b-month-abbrevs)) 292 (let ((months r2b-month-abbrevs))
297 (if (string-match "[^0-9]" r2bv-month) 293 (if (string-match "[^0-9]" r2bv-month)
@@ -316,7 +312,7 @@ title if CAPITALIZE is true. Returns value of VAR."
316 ) 312 )
317 313
318(defun r2b-snarf-input () 314(defun r2b-snarf-input ()
319 "parse buffer into global variables" 315 "Parse buffer into global variables."
320 (let ((case-fold-search t)) 316 (let ((case-fold-search t))
321 (r2b-trace "snarfing...") 317 (r2b-trace "snarfing...")
322 (sit-for 0) 318 (sit-for 0)
@@ -376,9 +372,9 @@ title if CAPITALIZE is true. Returns value of VAR."
376 372
377 373
378(defun r2b-put-field (field data &optional abbrevs) 374(defun r2b-put-field (field data &optional abbrevs)
379 "print bibtex FIELD = {DATA} if DATA not null; precede 375 "Print bibtex FIELD = {DATA} if DATA not null; precede
380with a comma and newline; if ABBREVS list is given, then 376with a comma and newline; if ABBREVS list is given, then
381try to replace the {DATA} with an abbreviation" 377try to replace the {DATA} with an abbreviation."
382 (if data 378 (if data
383 (let (match nodelim multi-line index) 379 (let (match nodelim multi-line index)
384 (cond 380 (cond
@@ -433,7 +429,7 @@ try to replace the {DATA} with an abbreviation"
433 429
434 430
435(defun r2b-require (vars) 431(defun r2b-require (vars)
436 "If any of VARS is null, set to empty string and log error" 432 "If any of VARS is null, set to empty string and log error."
437 (cond 433 (cond
438 ((null vars)) 434 ((null vars))
439 ((listp vars) (r2b-require (car vars)) (r2b-require (cdr vars))) 435 ((listp vars) (r2b-require (car vars)) (r2b-require (cdr vars)))
@@ -448,11 +444,11 @@ try to replace the {DATA} with an abbreviation"
448 444
449 445
450(defmacro r2b-moveq (new old) 446(defmacro r2b-moveq (new old)
451 "set NEW to OLD and set OLD to nil" 447 "Set NEW to OLD and set OLD to nil."
452 (list 'progn (list 'setq new old) (list 'setq old 'nil))) 448 (list 'progn (list 'setq new old) (list 'setq old 'nil)))
453 449
454(defun r2b-isa-proceedings (name) 450(defun r2b-isa-proceedings (name)
455 "return t if NAME is the name of proceedings" 451 "Return t if NAME is the name of proceedings."
456 (and 452 (and
457 name 453 name
458 (or 454 (or
@@ -464,8 +460,8 @@ try to replace the {DATA} with an abbreviation"
464 ))) 460 )))
465 461
466(defun r2b-isa-university (name) 462(defun r2b-isa-university (name)
467 "return t if NAME is a university or similar organization, 463 "Return t if NAME is a university or similar organization,
468but not a publisher" 464but not a publisher."
469 (and 465 (and
470 name 466 name
471 (string-match "university" name) 467 (string-match "university" name)
@@ -474,7 +470,7 @@ but not a publisher"
474 )) 470 ))
475 471
476(defun r2b-barf-output () 472(defun r2b-barf-output ()
477 "generate bibtex based on global variables" 473 "Generate bibtex based on global variables."
478 (let ((standard-output r2b-out-buf) (case-fold-search t) match) 474 (let ((standard-output r2b-out-buf) (case-fold-search t) match)
479 475
480 (r2b-trace "...barfing") 476 (r2b-trace "...barfing")
@@ -604,8 +600,8 @@ but not a publisher"
604 600
605 601
606(defun r2b-convert-record (output-name) 602(defun r2b-convert-record (output-name)
607 "transform current bib entry and append to buffer OUTPUT; 603 "Transform current bib entry and append to buffer OUTPUT;
608do M-x r2b-help for more info" 604do \"M-x r2b-help\" for more info."
609 (interactive 605 (interactive
610 (list (read-string "Output to buffer: " r2b-out-buf-name))) 606 (list (read-string "Output to buffer: " r2b-out-buf-name)))
611 (let (rec-end rec-begin not-done) 607 (let (rec-end rec-begin not-done)
@@ -641,8 +637,8 @@ do M-x r2b-help for more info"
641 637
642 638
643(defun r2b-convert-buffer (output-name) 639(defun r2b-convert-buffer (output-name)
644 "transform current buffer and append to buffer OUTPUT; 640 "Transform current buffer and append to buffer OUTPUT;
645do M-x r2b-help for more info" 641do \"M-x r2b-help\" for more info."
646 (interactive 642 (interactive
647 (list (read-string "Output to buffer: " r2b-out-buf-name))) 643 (list (read-string "Output to buffer: " r2b-out-buf-name)))
648 (save-excursion 644 (save-excursion
@@ -703,7 +699,7 @@ To see this message again, perform
703 699
704 700
705(defun r2b-help () 701(defun r2b-help ()
706 "print help message" 702 "Print help message."
707 (interactive) 703 (interactive)
708 (with-output-to-temp-buffer "*Help*" 704 (with-output-to-temp-buffer "*Help*"
709 (princ r2b-help-message))) 705 (princ r2b-help-message)))
@@ -712,4 +708,3 @@ To see this message again, perform
712 (r2b-help)) 708 (r2b-help))
713 709
714(message "r2b loaded") 710(message "r2b loaded")
715