summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/progmodes/etags.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 651c824275d..dd84754f389 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -805,7 +805,8 @@ If no tags table is loaded, do nothing and return nil."
beg)
(when pattern
(save-excursion
- (forward-char (1- (length pattern)))
+ ;; Avoid end-of-buffer error.
+ (goto-char (+ (point) (length pattern) -1))
;; The find-tag function might be overly optimistic.
(when (search-backward pattern nil t)
(setq beg (point))