[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/textmodes/reftex-parse.el
From: |
Juanma Barranquero |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/textmodes/reftex-parse.el |
Date: |
Tue, 04 Feb 2003 08:30:48 -0500 |
Index: emacs/lisp/textmodes/reftex-parse.el
diff -c emacs/lisp/textmodes/reftex-parse.el:1.14
emacs/lisp/textmodes/reftex-parse.el:1.15
*** emacs/lisp/textmodes/reftex-parse.el:1.14 Tue Aug 27 05:54:41 2002
--- emacs/lisp/textmodes/reftex-parse.el Tue Feb 4 08:30:45 2003
***************
*** 146,152 ****
(unless (assq 'xr docstruct)
(let* ((allxr (reftex-all-assq 'xr-doc docstruct))
(alist (mapcar
! (lambda (x)
(if (setq tmp (reftex-locate-file (nth 2 x) "tex"
master-dir))
(cons (nth 1 x) tmp)
--- 146,152 ----
(unless (assq 'xr docstruct)
(let* ((allxr (reftex-all-assq 'xr-doc docstruct))
(alist (mapcar
! (lambda (x)
(if (setq tmp (reftex-locate-file (nth 2 x) "tex"
master-dir))
(cons (nth 1 x) tmp)
***************
*** 157,163 ****
(alist (delq nil alist))
(allprefix (delq nil (mapcar 'car alist)))
(regexp (if allprefix
! (concat "\\`\\("
(mapconcat 'identity allprefix "\\|")
"\\)")
"\\\\\\\\\\\\"))) ; this will never match
--- 157,163 ----
(alist (delq nil alist))
(allprefix (delq nil (mapcar 'car alist)))
(regexp (if allprefix
! (concat "\\`\\("
(mapconcat 'identity allprefix "\\|")
"\\)")
"\\\\\\\\\\\\"))) ; this will never match
***************
*** 258,264 ****
;; It's an include or input
(setq include-file (reftex-match-string 7))
;; Test if this file should be ignored
! (unless (delq nil (mapcar
(lambda (x) (string-match x include-file))
reftex-no-include-regexps))
;; Parse it
--- 258,264 ----
;; It's an include or input
(setq include-file (reftex-match-string 7))
;; Test if this file should be ignored
! (unless (delq nil (mapcar
(lambda (x) (string-match x include-file))
reftex-no-include-regexps))
;; Parse it
***************
*** 307,316 ****
(push (cons 'bib tmp) docstruct))
(goto-char 1)
! (when (re-search-forward
"\\(\\`\\|[\n\r]\\)[ \t]*\\\\begin{thebibliography}" nil t)
(push (cons 'thebib file) docstruct))
!
;; Find external document specifications
(goto-char 1)
(while (re-search-forward "[\n\r][
\t]*\\\\externaldocument\\(\\[\\([^]]*\\)\\]\\)?{\\([^}]+\\)}" nil t)
--- 307,316 ----
(push (cons 'bib tmp) docstruct))
(goto-char 1)
! (when (re-search-forward
"\\(\\`\\|[\n\r]\\)[ \t]*\\\\begin{thebibliography}" nil t)
(push (cons 'thebib file) docstruct))
!
;; Find external document specifications
(goto-char 1)
(while (re-search-forward "[\n\r][
\t]*\\\\externaldocument\\(\\[\\([^]]*\\)\\]\\)?{\\([^}]+\\)}" nil t)
***************
*** 329,335 ****
(defun reftex-locate-bibliography-files (master-dir &optional files)
;; Scan buffer for bibliography macro and return file list.
!
(unless files
(save-excursion
(goto-char (point-min))
--- 329,335 ----
(defun reftex-locate-bibliography-files (master-dir &optional files)
;; Scan buffer for bibliography macro and return file list.
!
(unless files
(save-excursion
(goto-char (point-min))
***************
*** 339,349 ****
"\\(^\\)[^%]*\\\\\\("
(mapconcat 'identity reftex-bibliography-commands "\\|")
"\\){[ \t]*\\([^}]+\\)") nil t)
! (setq files
(split-string (reftex-match-string 3)
"[ \t\n\r]*,[ \t\n\r]*")))))
(when files
! (setq files
(mapcar
(lambda (x)
(if (or (member x reftex-bibfile-ignore-list)
--- 339,349 ----
"\\(^\\)[^%]*\\\\\\("
(mapconcat 'identity reftex-bibliography-commands "\\|")
"\\){[ \t]*\\([^}]+\\)") nil t)
! (setq files
(split-string (reftex-match-string 3)
"[ \t\n\r]*,[ \t\n\r]*")))))
(when files
! (setq files
(mapcar
(lambda (x)
(if (or (member x reftex-bibfile-ignore-list)
***************
*** 397,409 ****
(unnumbered (or star (< level 0)))
(level (abs level))
(section-number (reftex-section-number level unnumbered))
! (text1 (save-match-data
(save-excursion
(reftex-context-substring prefix))))
(literal (buffer-substring-no-properties
(1- (match-beginning 3))
(min (point-max) (+ (match-end 0) (length text1) 1))))
! ;; Literal can be too short since text1 too short. No big problem.
(text (reftex-nicify-text text1)))
;; Add section number and indentation
--- 397,409 ----
(unnumbered (or star (< level 0)))
(level (abs level))
(section-number (reftex-section-number level unnumbered))
! (text1 (save-match-data
(save-excursion
(reftex-context-substring prefix))))
(literal (buffer-substring-no-properties
(1- (match-beginning 3))
(min (point-max) (+ (match-end 0) (length text1) 1))))
! ;; Literal can be too short since text1 too short. No big problem.
(text (reftex-nicify-text text1)))
;; Add section number and indentation
***************
*** 453,459 ****
(throw 'exit nil)))
(itag (nth 1 entry))
(prefix (nth 2 entry))
! (index-tag
(cond ((stringp itag) itag)
((integerp itag)
(progn (goto-char boa)
--- 453,459 ----
(throw 'exit nil)))
(itag (nth 1 entry))
(prefix (nth 2 entry))
! (index-tag
(cond ((stringp itag) itag)
((integerp itag)
(progn (goto-char boa)
***************
*** 475,490 ****
(key-end (if (string-match reftex-index-key-end-re arg)
(1+ (match-beginning 0))))
(rawkey (substring arg 0 key-end))
!
(key (if prefix (concat prefix rawkey) rawkey))
(sortkey (downcase key))
! (showkey (mapconcat 'identity
(split-string key reftex-index-level-re)
" ! ")))
(goto-char end-of-args)
;; 0 1 2 3 4 5 6 7 8 9
(list 'index index-tag context file bom arg key showkey sortkey
key-end))))
!
(defun reftex-short-context (env parse &optional bound derive)
;; Get about one line of useful context for the label definition at point.
--- 475,490 ----
(key-end (if (string-match reftex-index-key-end-re arg)
(1+ (match-beginning 0))))
(rawkey (substring arg 0 key-end))
!
(key (if prefix (concat prefix rawkey) rawkey))
(sortkey (downcase key))
! (showkey (mapconcat 'identity
(split-string key reftex-index-level-re)
" ! ")))
(goto-char end-of-args)
;; 0 1 2 3 4 5 6 7 8 9
(list 'index index-tag context file bom arg key showkey sortkey
key-end))))
!
(defun reftex-short-context (env parse &optional bound derive)
;; Get about one line of useful context for the label definition at point.
***************
*** 607,613 ****
((match-end 10)
;; Index entry
(when reftex-support-index
! (let* ((index-info (save-excursion
(reftex-index-info-safe nil)))
(list (member (list 'bof (buffer-file-name))
docstruct))
--- 607,613 ----
((match-end 10)
;; Index entry
(when reftex-support-index
! (let* ((index-info (save-excursion
(reftex-index-info-safe nil)))
(list (member (list 'bof (buffer-file-name))
docstruct))
***************
*** 617,623 ****
;; Check all index entries with equal text
(while (and list (not (eq endelt (car list))))
(when (and (eq (car (car list)) 'index)
! (string= (nth 2 index-info)
(nth 2 (car list))))
(incf n)
(setq dist (abs (- (point) (nth 4 (car list)))))
--- 617,623 ----
;; Check all index entries with equal text
(while (and list (not (eq endelt (car list))))
(when (and (eq (car (car list)) 'index)
! (string= (nth 2 index-info)
(nth 2 (car list))))
(incf n)
(setq dist (abs (- (point) (nth 4 (car list)))))
***************
*** 690,696 ****
level (nth 5 entry))
;; Insert the section info
(push entry (cdr tail))
!
;; We are done unless we use section numbers
(unless (nth 1 reftex-label-menu-flags) (throw 'exit nil))
--- 690,696 ----
level (nth 5 entry))
;; Insert the section info
(push entry (cdr tail))
!
;; We are done unless we use section numbers
(unless (nth 1 reftex-label-menu-flags) (throw 'exit nil))
***************
*** 721,727 ****
(setq entry (reftex-index-info-safe buffer-file-name))
;; FIXME: (add-to-list 'index-tags (nth 1 index-entry))
(push entry (cdr tail))))))))))
!
(error nil))
)
--- 721,727 ----
(setq entry (reftex-index-info-safe buffer-file-name))
;; FIXME: (add-to-list 'index-tags (nth 1 index-entry))
(push entry (cdr tail))))))))))
!
(error nil))
)
***************
*** 872,878 ****
reftex-special-env-parsers))
specials rtn)
;; Call all functions
! (setq specials (mapcar
(lambda (fun)
(save-excursion
(setq rtn (and fun (funcall fun bound)))
--- 872,878 ----
reftex-special-env-parsers))
specials rtn)
;; Call all functions
! (setq specials (mapcar
(lambda (fun)
(save-excursion
(setq rtn (and fun (funcall fun bound)))
***************
*** 882,888 ****
(setq specials (delq nil specials))
;; Sort
(setq specials (sort specials (lambda (a b) (> (cdr a) (cdr b)))))
! (if (eq which t)
specials
(car specials))))))
--- 882,888 ----
(setq specials (delq nil specials))
;; Sort
(setq specials (sort specials (lambda (a b) (> (cdr a) (cdr b)))))
! (if (eq which t)
specials
(car specials))))))
***************
*** 920,928 ****
;; Do the real thing.
(let ((cnt 1))
!
(when (reftex-move-to-next-arg)
!
(while (< cnt n)
(while (and (member cnt opt-args)
(eq (following-char) ?\{))
--- 920,928 ----
;; Do the real thing.
(let ((cnt 1))
!
(when (reftex-move-to-next-arg)
!
(while (< cnt n)
(while (and (member cnt opt-args)
(eq (following-char) ?\{))
***************
*** 947,953 ****
(condition-case nil
(while (memq (following-char) '(?\[ ?\{))
(forward-list 1))
! (error nil)))
(defun reftex-context-substring (&optional to-end)
;; Return up to 150 chars from point
--- 947,953 ----
(condition-case nil
(while (memq (following-char) '(?\[ ?\{))
(forward-list 1))
! (error nil)))
(defun reftex-context-substring (&optional to-end)
;; Return up to 150 chars from point
***************
*** 977,983 ****
(error (point-max))))))
(t
;; no list - just grab 150 characters
! (buffer-substring-no-properties (point)
(min (+ (point) 150) (point-max))))))
;; Variable holding the vector with section numbers
--- 977,983 ----
(error (point-max))))))
(t
;; no list - just grab 150 characters
! (buffer-substring-no-properties (point)
(min (+ (point) 150) (point-max))))))
;; Variable holding the vector with section numbers
***************
*** 1014,1020 ****
;; not included in the numbering of other sectioning levels.
(when level
(when (and (> level -1) (not star))
! (aset reftex-section-numbers
level (1+ (aref reftex-section-numbers level))))
(setq idx (1+ level))
(when (not star)
--- 1014,1020 ----
;; not included in the numbering of other sectioning levels.
(when level
(when (and (> level -1) (not star))
! (aset reftex-section-numbers
level (1+ (aref reftex-section-numbers level))))
(setq idx (1+ level))
(when (not star)
***************
*** 1040,1046 ****
(setq string (replace-match "" nil nil string)))
(if (and appendix
(string-match "\\`[0-9]+" string))
! (setq string
(concat
(char-to-string
(1- (+ ?A (string-to-int (match-string 0 string)))))
--- 1040,1046 ----
(setq string (replace-match "" nil nil string)))
(if (and appendix
(string-match "\\`[0-9]+" string))
! (setq string
(concat
(char-to-string
(1- (+ ?A (string-to-int (match-string 0 string)))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/textmodes/reftex-parse.el,
Juanma Barranquero <=