[Top][All Lists]

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

RE: patch for thingatpt.el

From: Drew Adams
Subject: RE: patch for thingatpt.el
Date: Sat, 7 Jun 2008 14:06:28 -0700

> just for curiosity: could you tell in which
> circumstances you use something like "nearest point"?
> Saw that implemented already in your code, so
> you will know the reason.

I use `*-nearest-point' functions typically to pick up a default value for use
in completion by a command. I use `symbol-nearest-point' and
`symbol-name-nearest-point' more often than other `*-nearest-point' functions.

Places where I use `*-nearest-point':

grep, make-face, find-dired, where-is, describe-function, describe-command,
describe-variable, describe-option, descibe-option-of-type,
Info-goto-emacs-command-node, name-last-kbd-macro, insert-kbd-macro,
enable-command, disable-command, query-replace, query-replace-regexp,
query-replace-regexp-eval, replace-string, replace-regexp, keep-lines,
flush-lines, how-many, occur, multi-occur, multi-occur-in-matching-buffers,
read-variable, read-any-variable, synonyms, synonyms-no-read,
synonyms-definition, synonyms-definition-no-read, synonyms-definition-mouse,
thing-region, cycle-thing-region, cancel-function-timers 

(For those of the above that are standard functions, I have my own version that
uses `*-nearest-point'.)

And in Icicles, you can use `M-.' in the minibuffer to yank different kinds of
thing from at or near point to the minibuffer. I use `*-nearest-point' there

> Simply can't imagine, in the case being nearby some
> form, why not use forward-word or backward-word,
> resp. skip-chars-... that kind of simple things?

Do you mean as a user or as part of the definition of some command? If the
former, then why should a user need to fiddle with the exact cursor position,
just to be able to pick up a default value? If you mean the latter, then that's
just what `*-nearest-point' does.

See the recent bug with subject "describe-* and M-x should see past quote mark"
as an example. Stefan presumably (I haven't checked) fixed this by maneuvering
around a quote mark at point, to get to the symbol. That kind of maneuvering is
unnecessary as a one-off fix if you just use `*-nearest-point'.

That's the kind of thing that `*-nearest-point' is designed for. Quote marks,
parens, spaces, etc. are some of the stuff that might be under the cursor when
it is near a name that could serve as a good default value.

reply via email to

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