unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* tags, yet again
@ 2005-08-30  3:47 Ian Zimmerman
  2005-08-30 16:49 ` Kevin Rodgers
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Zimmerman @ 2005-08-30  3:47 UTC (permalink / raw)



Does anyone actually understand the algorithm for selecting a location
to jump to with Alt-. ?

The documentation for find-tag-noselect says:
When there are multiple matches for a tag, more exact matches are found first.

But, I've frequently seen Alt-. to jump to a differently capitalized version
of the symbol under point first, even when there's an exact match available.
I thought the following hack would fix it:

(defadvice tag-exact-match-p (around tag-exact-case-sensitive
                                     activate compile)
  "Exact means exact, ie. case-sensitive."
  (let ((case-fold-search nil))
    ad-do-it))

But _no_, it still happens <groan>.  This is actually a longstanding gripe
which made me abandon tags in favor of other similar mechanisms like imenu
and id-utils.  But tags do have some endearing qualities, and there's the
mystery aspect of the situation.  So, how to make the exact match to be
selected first, _always_?

-- 
Optimist: We're only two weeks behind schedule.
Pessimist: The schedule is a whole two weeks ahead of us.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: tags, yet again
  2005-08-30  3:47 tags, yet again Ian Zimmerman
@ 2005-08-30 16:49 ` Kevin Rodgers
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2005-08-30 16:49 UTC (permalink / raw)


Ian Zimmerman wrote:
 > Does anyone actually understand the algorithm for selecting a location
 > to jump to with Alt-. ?
 >
 > The documentation for find-tag-noselect says:
 > When there are multiple matches for a tag, more exact matches are 
found first.

The source for find-tag-noselect says:

	   ;; find-tag-in-order does the real work.

And the source for find-tag-in-order says:

;; Internal tag finding function.

;; PATTERN is a string to pass to second arg SEARCH-FORWARD-FUNC, and to
;; any member of the function list ORDER (third arg).  If ORDER is nil,
;; use saved state to continue a previous search.

;; Fourth arg MATCHING is a string, an English '-ing' word, to be used in
;; an error message.

;; Fifth arg NEXT-LINE-AFTER-FAILURE-P is non-nil if after a failed match,
;; point should be moved to the next line.

;; Algorithm is as follows.  For each qualifier-func in ORDER, go to
;; beginning of tags file, and perform inner loop: for each naive match for
;; PATTERN found using SEARCH-FORWARD-FUNC, qualify the naive match using
;; qualifier-func.  If it qualifies, go to the specified line in the
;; specified source file and return.  Qualified matches are remembered to
;; avoid repetition.  State is saved so that the loop can be continued.

 > But, I've frequently seen Alt-. to jump to a differently capitalized 
version
 > of the symbol under point first, even when there's an exact match 
available.

,----[ C-h v tags-case-fold-search RET ]
| tags-case-fold-search's value is default
|
| Documentation:
| *Whether tags operations should be case-sensitive.
| A value of t means case-insensitive, a value of nil means case-sensitive.
| Any other value means use the setting of `case-fold-search'.
|
| You can customize this variable.
|
| Defined in `etags'.
`----

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-08-30 16:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-30  3:47 tags, yet again Ian Zimmerman
2005-08-30 16:49 ` Kevin Rodgers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).