[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: change-log-goto-source: recognising . within tag names
From: |
martin rudalics |
Subject: |
Re: change-log-goto-source: recognising . within tag names |
Date: |
Fri, 20 Mar 2009 20:48:47 +0100 |
User-agent: |
Thunderbird 2.0.0.16 (Windows/20080708) |
> change-log-goto-source is a great function for finding the definition of
> a function mentioned in a changelog. I'm looking for some help though
> getting it to work recognising tags in the language R (a popular
> statistics environment). In R, function names are often include the
> period character, e.g. t.test(). When using change-log-goto-source on
> these kinds of tags, the correct tag is not found because . is of the
> syntax class 'punctuation', and it looks to me like the tags must be made
> of elements of syntax class 'word'.
`word' or `symbol'.
> How to fix this? I tried changing the regexp, but this didn't work:
>
> (defconst change-log-tag-re
> "(\\(\\(?:\\sw\\|\\s_\\|\\.\\)+\\(?:[,
\t]+\\(?:\\sw\\|\\s_\\|\\.\\)+\\)*\\))"
> "Regexp matching a tag name in change log entries.")
This won't be sufficient because `find-tag-default' (which is called by
`change-log-search-tag-name-1') also works on symbols only and
`change-log-mode' is derived from `text-mode' :-(
I'm afraid `change-log-search-tag-name' is too clever when trying to
find a suitable tag. Usually, it seems sufficient to search for the
previous and next property change of the `change-log-list' text property
near `point' and return the corresponding string. Maybe we should
provide a `change-log-search-tag-name-function' people could set to do
the job. Or, simply set the `syntax-table' text property to `symbol'
for periods preceded _and_ followed by word/symbol characters.
martin