aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris2011-06-29 19:50:20 -0700
committerGlenn Morris2011-06-29 19:50:20 -0700
commit887a0b3446c5bd285d4a146bd85d6b9e69379c74 (patch)
tree54f127f520ecff018983f843a3ab15694fe626c4 /lisp
parentd61bdd5d048255710d909b9a6cc28baea5ee5692 (diff)
downloademacs-887a0b3446c5bd285d4a146bd85d6b9e69379c74.tar.gz
emacs-887a0b3446c5bd285d4a146bd85d6b9e69379c74.zip
Silence reftex-parse compilation.
* lisp/textmodes/reftex-parse.el (index-tags): Declare. Nuke trailing whitespace.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/textmodes/reftex-parse.el55
2 files changed, 33 insertions, 26 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f4b5019d8e6..e3f146e3ab0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12011-06-30 Glenn Morris <rgm@gnu.org>
2
3 * textmodes/reftex-parse.el (index-tags): Declare.
4
12011-06-30 Chong Yidong <cyd@stupidchicken.com> 52011-06-30 Chong Yidong <cyd@stupidchicken.com>
2 6
3 * cus-edit.el (customize-push-and-save): New function. 7 * cus-edit.el (customize-push-and-save): New function.
diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el
index 6ffbf7a4621..b0f22085064 100644
--- a/lisp/textmodes/reftex-parse.el
+++ b/lisp/textmodes/reftex-parse.el
@@ -146,7 +146,7 @@
146 (unless (assq 'xr docstruct) 146 (unless (assq 'xr docstruct)
147 (let* ((allxr (reftex-all-assq 'xr-doc docstruct)) 147 (let* ((allxr (reftex-all-assq 'xr-doc docstruct))
148 (alist (mapcar 148 (alist (mapcar
149 (lambda (x) 149 (lambda (x)
150 (if (setq tmp (reftex-locate-file (nth 2 x) "tex" 150 (if (setq tmp (reftex-locate-file (nth 2 x) "tex"
151 master-dir)) 151 master-dir))
152 (cons (nth 1 x) tmp) 152 (cons (nth 1 x) tmp)
@@ -157,7 +157,7 @@
157 (alist (delq nil alist)) 157 (alist (delq nil alist))
158 (allprefix (delq nil (mapcar 'car alist))) 158 (allprefix (delq nil (mapcar 'car alist)))
159 (regexp (if allprefix 159 (regexp (if allprefix
160 (concat "\\`\\(" 160 (concat "\\`\\("
161 (mapconcat 'identity allprefix "\\|") 161 (mapconcat 'identity allprefix "\\|")
162 "\\)") 162 "\\)")
163 "\\\\\\\\\\\\"))) ; this will never match 163 "\\\\\\\\\\\\"))) ; this will never match
@@ -189,6 +189,9 @@ of master file."
189 (push file file-list)) 189 (push file file-list))
190 (nreverse file-list))) 190 (nreverse file-list)))
191 191
192;; Bound in the caller, reftex-do-parse.
193(defvar index-tags)
194
192(defun reftex-parse-from-file (file docstruct master-dir) 195(defun reftex-parse-from-file (file docstruct master-dir)
193 ;; Scan the buffer for labels and save them in a list. 196 ;; Scan the buffer for labels and save them in a list.
194 (let ((regexp (reftex-everything-regexp)) 197 (let ((regexp (reftex-everything-regexp))
@@ -259,7 +262,7 @@ of master file."
259 ;; It's an include or input 262 ;; It's an include or input
260 (setq include-file (reftex-match-string 7)) 263 (setq include-file (reftex-match-string 7))
261 ;; Test if this file should be ignored 264 ;; Test if this file should be ignored
262 (unless (delq nil (mapcar 265 (unless (delq nil (mapcar
263 (lambda (x) (string-match x include-file)) 266 (lambda (x) (string-match x include-file))
264 reftex-no-include-regexps)) 267 reftex-no-include-regexps))
265 ;; Parse it 268 ;; Parse it
@@ -308,10 +311,10 @@ of master file."
308 (push (cons 'bib tmp) docstruct)) 311 (push (cons 'bib tmp) docstruct))
309 312
310 (goto-char 1) 313 (goto-char 1)
311 (when (re-search-forward 314 (when (re-search-forward
312 "\\(\\`\\|[\n\r]\\)[ \t]*\\\\begin{thebibliography}" nil t) 315 "\\(\\`\\|[\n\r]\\)[ \t]*\\\\begin{thebibliography}" nil t)
313 (push (cons 'thebib file) docstruct)) 316 (push (cons 'thebib file) docstruct))
314 317
315 ;; Find external document specifications 318 ;; Find external document specifications
316 (goto-char 1) 319 (goto-char 1)
317 (while (re-search-forward "[\n\r][ \t]*\\\\externaldocument\\(\\[\\([^]]*\\)\\]\\)?{\\([^}]+\\)}" nil t) 320 (while (re-search-forward "[\n\r][ \t]*\\\\externaldocument\\(\\[\\([^]]*\\)\\]\\)?{\\([^}]+\\)}" nil t)
@@ -330,7 +333,7 @@ of master file."
330 333
331(defun reftex-locate-bibliography-files (master-dir &optional files) 334(defun reftex-locate-bibliography-files (master-dir &optional files)
332 ;; Scan buffer for bibliography macro and return file list. 335 ;; Scan buffer for bibliography macro and return file list.
333 336
334 (unless files 337 (unless files
335 (save-excursion 338 (save-excursion
336 (goto-char (point-min)) 339 (goto-char (point-min))
@@ -340,11 +343,11 @@ of master file."
340 "\\(^\\)[^%\n\r]*\\\\\\(" 343 "\\(^\\)[^%\n\r]*\\\\\\("
341 (mapconcat 'identity reftex-bibliography-commands "\\|") 344 (mapconcat 'identity reftex-bibliography-commands "\\|")
342 "\\){[ \t]*\\([^}]+\\)") nil t) 345 "\\){[ \t]*\\([^}]+\\)") nil t)
343 (setq files 346 (setq files
344 (split-string (reftex-match-string 3) 347 (split-string (reftex-match-string 3)
345 "[ \t\n\r]*,[ \t\n\r]*"))))) 348 "[ \t\n\r]*,[ \t\n\r]*")))))
346 (when files 349 (when files
347 (setq files 350 (setq files
348 (mapcar 351 (mapcar
349 (lambda (x) 352 (lambda (x)
350 (if (or (member x reftex-bibfile-ignore-list) 353 (if (or (member x reftex-bibfile-ignore-list)
@@ -398,13 +401,13 @@ of master file."
398 (unnumbered (or star (< level 0))) 401 (unnumbered (or star (< level 0)))
399 (level (abs level)) 402 (level (abs level))
400 (section-number (reftex-section-number level unnumbered)) 403 (section-number (reftex-section-number level unnumbered))
401 (text1 (save-match-data 404 (text1 (save-match-data
402 (save-excursion 405 (save-excursion
403 (reftex-context-substring prefix)))) 406 (reftex-context-substring prefix))))
404 (literal (buffer-substring-no-properties 407 (literal (buffer-substring-no-properties
405 (1- (match-beginning 3)) 408 (1- (match-beginning 3))
406 (min (point-max) (+ (match-end 0) (length text1) 1)))) 409 (min (point-max) (+ (match-end 0) (length text1) 1))))
407 ;; Literal can be too short since text1 too short. No big problem. 410 ;; Literal can be too short since text1 too short. No big problem.
408 (text (reftex-nicify-text text1))) 411 (text (reftex-nicify-text text1)))
409 412
410 ;; Add section number and indentation 413 ;; Add section number and indentation
@@ -454,7 +457,7 @@ of master file."
454 (throw 'exit nil))) 457 (throw 'exit nil)))
455 (itag (nth 1 entry)) 458 (itag (nth 1 entry))
456 (prefix (nth 2 entry)) 459 (prefix (nth 2 entry))
457 (index-tag 460 (index-tag
458 (cond ((stringp itag) itag) 461 (cond ((stringp itag) itag)
459 ((integerp itag) 462 ((integerp itag)
460 (progn (goto-char boa) 463 (progn (goto-char boa)
@@ -476,16 +479,16 @@ of master file."
476 (key-end (if (string-match reftex-index-key-end-re arg) 479 (key-end (if (string-match reftex-index-key-end-re arg)
477 (1+ (match-beginning 0)))) 480 (1+ (match-beginning 0))))
478 (rawkey (substring arg 0 key-end)) 481 (rawkey (substring arg 0 key-end))
479 482
480 (key (if prefix (concat prefix rawkey) rawkey)) 483 (key (if prefix (concat prefix rawkey) rawkey))
481 (sortkey (downcase key)) 484 (sortkey (downcase key))
482 (showkey (mapconcat 'identity 485 (showkey (mapconcat 'identity
483 (split-string key reftex-index-level-re) 486 (split-string key reftex-index-level-re)
484 " ! "))) 487 " ! ")))
485 (goto-char end-of-args) 488 (goto-char end-of-args)
486 ;; 0 1 2 3 4 5 6 7 8 9 489 ;; 0 1 2 3 4 5 6 7 8 9
487 (list 'index index-tag context file bom arg key showkey sortkey key-end)))) 490 (list 'index index-tag context file bom arg key showkey sortkey key-end))))
488 491
489(defun reftex-short-context (env parse &optional bound derive) 492(defun reftex-short-context (env parse &optional bound derive)
490 ;; Get about one line of useful context for the label definition at point. 493 ;; Get about one line of useful context for the label definition at point.
491 494
@@ -608,7 +611,7 @@ of master file."
608 ((match-end 10) 611 ((match-end 10)
609 ;; Index entry 612 ;; Index entry
610 (when reftex-support-index 613 (when reftex-support-index
611 (let* ((index-info (save-excursion 614 (let* ((index-info (save-excursion
612 (reftex-index-info-safe nil))) 615 (reftex-index-info-safe nil)))
613 (list (member (list 'bof (buffer-file-name)) 616 (list (member (list 'bof (buffer-file-name))
614 docstruct)) 617 docstruct))
@@ -618,7 +621,7 @@ of master file."
618 ;; Check all index entries with equal text 621 ;; Check all index entries with equal text
619 (while (and list (not (eq endelt (car list)))) 622 (while (and list (not (eq endelt (car list))))
620 (when (and (eq (car (car list)) 'index) 623 (when (and (eq (car (car list)) 'index)
621 (string= (nth 2 index-info) 624 (string= (nth 2 index-info)
622 (nth 2 (car list)))) 625 (nth 2 (car list))))
623 (incf n) 626 (incf n)
624 (setq dist (abs (- (point) (nth 4 (car list))))) 627 (setq dist (abs (- (point) (nth 4 (car list)))))
@@ -691,7 +694,7 @@ of master file."
691 level (nth 5 entry)) 694 level (nth 5 entry))
692 ;; Insert the section info 695 ;; Insert the section info
693 (push entry (cdr tail)) 696 (push entry (cdr tail))
694 697
695 ;; We are done unless we use section numbers 698 ;; We are done unless we use section numbers
696 (unless (nth 1 reftex-label-menu-flags) (throw 'exit nil)) 699 (unless (nth 1 reftex-label-menu-flags) (throw 'exit nil))
697 700
@@ -722,7 +725,7 @@ of master file."
722 (setq entry (reftex-index-info-safe buffer-file-name)) 725 (setq entry (reftex-index-info-safe buffer-file-name))
723 ;; FIXME: (add-to-list 'index-tags (nth 1 index-entry)) 726 ;; FIXME: (add-to-list 'index-tags (nth 1 index-entry))
724 (push entry (cdr tail)))))))))) 727 (push entry (cdr tail))))))))))
725 728
726 (error nil)) 729 (error nil))
727 ) 730 )
728 731
@@ -875,7 +878,7 @@ of master file."
875 reftex-special-env-parsers)) 878 reftex-special-env-parsers))
876 specials rtn) 879 specials rtn)
877 ;; Call all functions 880 ;; Call all functions
878 (setq specials (mapcar 881 (setq specials (mapcar
879 (lambda (fun) 882 (lambda (fun)
880 (save-excursion 883 (save-excursion
881 (setq rtn (and fun (funcall fun bound))) 884 (setq rtn (and fun (funcall fun bound)))
@@ -885,7 +888,7 @@ of master file."
885 (setq specials (delq nil specials)) 888 (setq specials (delq nil specials))
886 ;; Sort 889 ;; Sort
887 (setq specials (sort specials (lambda (a b) (> (cdr a) (cdr b))))) 890 (setq specials (sort specials (lambda (a b) (> (cdr a) (cdr b)))))
888 (if (eq which t) 891 (if (eq which t)
889 specials 892 specials
890 (car specials)))))) 893 (car specials))))))
891 894
@@ -923,9 +926,9 @@ of master file."
923 926
924 ;; Do the real thing. 927 ;; Do the real thing.
925 (let ((cnt 1)) 928 (let ((cnt 1))
926 929
927 (when (reftex-move-to-next-arg) 930 (when (reftex-move-to-next-arg)
928 931
929 (while (< cnt n) 932 (while (< cnt n)
930 (while (and (member cnt opt-args) 933 (while (and (member cnt opt-args)
931 (eq (following-char) ?\{)) 934 (eq (following-char) ?\{))
@@ -950,7 +953,7 @@ of master file."
950 (condition-case nil 953 (condition-case nil
951 (while (memq (following-char) '(?\[ ?\{)) 954 (while (memq (following-char) '(?\[ ?\{))
952 (forward-list 1)) 955 (forward-list 1))
953 (error nil))) 956 (error nil)))
954 957
955(defun reftex-context-substring (&optional to-end) 958(defun reftex-context-substring (&optional to-end)
956 ;; Return up to 150 chars from point 959 ;; Return up to 150 chars from point
@@ -979,7 +982,7 @@ of master file."
979 (error (point-max)))))) 982 (error (point-max))))))
980 (t 983 (t
981 ;; no list - just grab 150 characters 984 ;; no list - just grab 150 characters
982 (buffer-substring-no-properties (point) 985 (buffer-substring-no-properties (point)
983 (min (+ (point) 150) (point-max)))))) 986 (min (+ (point) 150) (point-max))))))
984 987
985;; Variable holding the vector with section numbers 988;; Variable holding the vector with section numbers
@@ -1016,7 +1019,7 @@ of master file."
1016 ;; not included in the numbering of other sectioning levels. 1019 ;; not included in the numbering of other sectioning levels.
1017 (when level 1020 (when level
1018 (when (and (> level -1) (not star)) 1021 (when (and (> level -1) (not star))
1019 (aset reftex-section-numbers 1022 (aset reftex-section-numbers
1020 level (1+ (aref reftex-section-numbers level)))) 1023 level (1+ (aref reftex-section-numbers level))))
1021 (setq idx (1+ level)) 1024 (setq idx (1+ level))
1022 (when (not star) 1025 (when (not star)
@@ -1042,7 +1045,7 @@ of master file."
1042 (setq string (replace-match "" nil nil string))) 1045 (setq string (replace-match "" nil nil string)))
1043 (if (and appendix 1046 (if (and appendix
1044 (string-match "\\`[0-9]+" string)) 1047 (string-match "\\`[0-9]+" string))
1045 (setq string 1048 (setq string
1046 (concat 1049 (concat
1047 (char-to-string 1050 (char-to-string
1048 (1- (+ ?A (string-to-number (match-string 0 string))))) 1051 (1- (+ ?A (string-to-number (match-string 0 string)))))