branch: elpa
commit 40c2c26c0be82fb9ae164db40c96efea50cd3d8f
Author: Mosè Giordano <[email protected]>
Commit: Mosè Giordano <[email protected]>
Allow for negative offsets in region backward search
* tex.el (TeX-source-correlate-handle-TeX-region): Use the same regexp
used in `preview-parse-messages', that is also XEmacs compatible and
allows for negative offsets. This makes backward search work also
when using `TeX-command-buffer' and `LaTeX-command-section'. Reported
by Qiang Yin.
---
tex.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tex.el b/tex.el
index b85a72a..c946851 100644
--- a/tex.el
+++ b/tex.el
@@ -1838,7 +1838,9 @@ file and LINE to (+ LINE offset-of-region). Else, return
nil."
(with-current-buffer (or (find-buffer-visiting file)
(find-file-noselect file))
(goto-char 0)
- (when (re-search-forward "!offset(\\([[:digit:]]+\\))" nil t)
+ ;; Same regexp used in `preview-parse-messages'. XXX: XEmacs doesn't
+ ;; support regexp classes, so we can't use "[:digit:]" here.
+ (when (re-search-forward "!offset(\\([---0-9]+\\))" nil t)
(let ((offset (string-to-int (match-string-no-properties 1))))
(when TeX-region-orig-buffer
(list (expand-file-name (buffer-file-name TeX-region-orig-buffer))