emacs-devel
[Top][All Lists]
Advanced

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

RE: find-tag-default


From: Drew Adams
Subject: RE: find-tag-default
Date: Mon, 24 May 2004 09:49:57 -0700

Belated, and possibly irrelevant, but FYI -

Library thingatpt+.el provides additions and enhancements to thingatpt.el:

1) An optional syntax-table argument is used to determine the bounds.

2) New functions (e.g. symbol-nearest-point) don't require point to be on
the name you want. Here's how "nearest" is defined:

    The nearest symbol on the same line is returned, if there is any.
        Between two symbols equidistant from point on the same line, the
        leftmost is considered nearer.
    Otherwise, neighboring lines are tried in sequence:
        previous, next, 2nd previous, 2nd next, 3rd previous, 3rd next, etc.
        This means that between two symbols equidistant from point in
        lines above and below it, the symbol in the line above point
        (previous Nth) is considered nearer to it.

The code is here: http://www.emacswiki.org/elisp/thingatpt-plus.el.

You might consider using a similar "nearest" functionality in Emacs. In my
own code, I use it in commands like describe-variable. I prefer to have a
default value in the minibuffer for such commands (I use backward-kill-sexp,
bound to C-M-backspace, to remove it if it's inappropriate). I find that
"nearest" usually DTRT.

 - Drew

-----Original Message-----
From: Richard Stallman

    Currently there are different methods for obtaining an identifier
    at point:
    - `find-tag-default' and `find-tag-default-function' from etags.el
    - `symbol-at-point' from thingatpt.el
    - info-look.el which has the most advanced implementation since
      it defines regular expressions and parsing rules for guessing
      the default identifier for 20 major modes (and one special
      function `info-lookup-guess-c-symbol' for C mode).

    So to create right contents of `identifier-at-point' these packages
    could be generalized.

Is it clear that using the info-look code would be best for everything
that uses the other two functions?

If so, let's do that.





reply via email to

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