emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 f60a3b0 1/3: Fix etags completion near eob


From: Dmitry Gutov
Subject: [Emacs-diffs] emacs-25 f60a3b0 1/3: Fix etags completion near eob
Date: Sun, 15 Nov 2015 23:32:58 +0000

branch: emacs-25
commit f60a3b086cb30e1b794f586fe1da5947869e29fc
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Fix etags completion near eob
    
    * lisp/progmodes/etags.el (tags-completion-at-point-function):
    Use `goto-char', to avoid the end-of-buffer error (bug#20061).
---
 lisp/progmodes/etags.el |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 651c824..dd84754 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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]