Hrvoje Niksic <hniksic(a)srce.hr> writes:
* You should make an obsolete isearch- alias so that old compiled
code
that uses the `with-caps-disable-folding' macro doesn't fail;
OK.
* FSF Emacs has a different version of
`isearch-no-upper-case-p',
which perhaps works better. (our has a "fixme" comment.)
OK. I'll look at it.
> The other one is one more argument (regexp-flag) to the macro
> with-caps-disable-folding, which is moved away from isearch too.
>
> I think we can afford those changes: they lead to only 2 other
> modifications in the core lisp packages, and none of the packages I
> have installed (almost all of them) use those functions.
This is problematic. For all I know, there can be valid user code
that uses that macro. Adding an argument will make all that code
fail. I think you should choose a different name, or perhaps a new
macro (`with-caps-disable-folding-regexp'?)
I know this is problematic, but I envisioned the other possibilities,
and came up with the conclusion that risking a user-code breakage (this is not
the first time it could happen) is the best choice. Here's why: The macro
_currently assumes a regular expression_. In Emacs, there are currently 2
philosophies co-existing for string/regexp routines:
- either we have a regexp-flag, that's the change I proposed,
- or we have two functions, one for strings and one for regexps. But
there, it's always the string function that has the generic name
(like query-replace or search-forward), and the regexp function that
has a derived name (like re-search-forward, or query-replace-regexp).
If we decide to adopt the second philosophy, user code will be broken all the
same because `with-caps-disable-folding' will turn out to deal with strings,
and the new one (with the old behavior) will be named
`re-with-caps-disable-folding', or `with-caps-disable-folding-regexp'.[1]
I don't want to introduce a new convention just for this macro. I
don't want to call the new one with-caps-disable-folding-string. That's why I
think that risking user-code breakage is the best solution. We did far worse
with the `concat' interface change (which I totally agree with).
The argument that the changes are affordable because the packages
don't use the macro does not stand because we don't know how much user
code uses the macros. What we call "packages" is but one part of Lisp
code written by our users. With your changes, otherwise perfectly
valid code using documented interface will fail in various obscure
ways.
See above. I'm not sure how much user code actually know and use this
macro. What's more, the change is not /that/ complicated to upgrade. Again,
changing all occurences of concat was much more of a pain.
You should write a modification of the
`with-caps-disable-folding' macro and
use it consistently.
I think I'll write another macro for use in interactive functions
rather. Something like `interactive-with-caps-disable-folding'
Footnotes:
[1] One day, I'd like to see a coherent naming convention appear: either
`re-foobar', or `foobar-regexp', but only one. With the number of symbols
we're reaching in XEmacs, I find it very important to be strict on naming
conventions. Stricter than we are now. I have some other pedantic changes in
mind, like renaming all *-hook variables to *-hooks
--
/ / _ _ Didier Verna
http://www.inf.enst.fr/~verna/
- / / - / / /_/ / E.N.S.T. INF C201.1 mailto:vernaļ¼ inf.enst.fr
/_/ / /_/ / /__ / 46 rue Barrault Tel. (33) 01 45 81 73 46
75634 Paris cedex 13 Fax. (33) 01 45 81 31 19