Commit 9db3bfae authored by Martin Rudalics's avatar Martin Rudalics
Browse files

(find-tag-default): Simplify using exclusively

parent 248c21c5
2008-01-26 Martin Rudalics <>
* subr.el (find-tag-default): Simplify using exclusively
2008-01-26 Michael Albinus <>
* vc.el (vc-directory, vc-update-change-log): Remove check for
......@@ -2127,26 +2127,29 @@ Note that this should end with a directory separator.")
(defun find-tag-default ()
"Determine default tag to search for, based on text at point.
If there is no plausible default, return nil."
(while (looking-at "\\sw\\|\\s_")
(forward-char 1))
(if (or (re-search-backward "\\sw\\|\\s_"
(save-excursion (beginning-of-line) (point))
(re-search-forward "\\(\\sw\\|\\s_\\)+"
(save-excursion (end-of-line) (point))
(goto-char (match-end 0))
(condition-case nil
(progn (forward-sexp -1)
(while (looking-at "\\s'")
(forward-char 1))
(error nil)))
(let (from to bound)
(when (or (progn
;; Look at text around `point'.
(skip-syntax-backward "w_") (setq from (point)))
(skip-syntax-forward "w_") (setq to (point)))
(> to from))
;; Look between `line-beginning-position' and `point'.
(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'.
(and (setq bound (line-end-position))
(skip-syntax-forward "^w_" bound)
(< (setq from (point)) bound)
(skip-syntax-forward "w_")
(setq to (point)))))
(buffer-substring-no-properties from to))))
(defun play-sound (sound)
"SOUND is a list of the form `(sound KEYWORD VALUE...)'.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment