emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-25 e72a26e 1/2: Make find-tag-default-bounds more st


From: Dmitry Gutov
Subject: [Emacs-diffs] emacs-25 e72a26e 1/2: Make find-tag-default-bounds more strict
Date: Tue, 23 Feb 2016 00:29:21 +0000

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

    Make find-tag-default-bounds more strict
    
    * lisp/subr.el (find-tag-default-bounds): Delegate to
    bounds-of-thing-at-point (bug#22692).
---
 lisp/subr.el |   24 +-----------------------
 1 files changed, 1 insertions(+), 23 deletions(-)

diff --git a/lisp/subr.el b/lisp/subr.el
index cf26fe3..dde7691 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2626,29 +2626,7 @@ See also `locate-user-emacs-file'.")
   "Determine the boundaries of the default tag, based on text at point.
 Return a cons cell with the beginning and end of the found tag.
 If there is no plausible default, return nil."
-  (let (from to bound)
-    (when (or (progn
-               ;; Look at text around `point'.
-               (save-excursion
-                 (skip-syntax-backward "w_") (setq from (point)))
-               (save-excursion
-                 (skip-syntax-forward "w_") (setq to (point)))
-               (> to from))
-             ;; Look between `line-beginning-position' and `point'.
-             (save-excursion
-               (and (setq bound (line-beginning-position))
-                    (skip-syntax-backward "^w_" bound)
-                    (> (setq to (point)) bound)
-                    (skip-syntax-backward "w_")
-                    (setq from (point))))
-             ;; Look between `point' and `line-end-position'.
-             (save-excursion
-               (and (setq bound (line-end-position))
-                    (skip-syntax-forward "^w_" bound)
-                    (< (setq from (point)) bound)
-                    (skip-syntax-forward "w_")
-                    (setq to (point)))))
-      (cons from to))))
+  (bounds-of-thing-at-point 'symbol))
 
 (defun find-tag-default ()
   "Determine default tag to search for, based on text at point.



reply via email to

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