emacs-devel
[Top][All Lists]
Advanced

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

Re: Last call for lua-mode contributors


From: Ken Raeburn
Subject: Re: Last call for lua-mode contributors
Date: Thu, 19 Jan 2012 12:15:07 -0500

On Jan 17, 2012, at 23:32, Miles Bader wrote:
> immerrr again <address@hidden> writes:
>> As some of you might know, lua-mode, Emacs major mode for editing Lua, is
>> undergoing integration to Emacs mainline.
> 
> Hopefully lua-mode's bogus handling of symbols vs. words will finally
> be fixed as a result.....
> 
> [lua-mode redefines "_" as a word-component; it shouldn't, as it
> really messes with users' instincts, and makes Emacs commands less
> useful.  Historically this was often done by language-modes as an
> simple (though misguided) expedient to allow them to safely use "\<"
> and \>" in regexps matching keywords, but nowadays they shouldn't do
> that, they should leave "_" alone and use "\_<" and "\_>" instead.]

My "instincts" have long been to interpret "word" as "identifier or keyword" in 
programming modes, to the point of customizing the syntax tables at startup to 
make "_" a word component.  Not for regular expressions, but for word-motion 
commands; I like the fact that I can skip over one identifier with M-f no 
matter how many underscores it contains -- string_to_widget, stringToWidget, 
string2widget, and stringtowidget are all treated the same.  It's also more 
useful in constructing keyboard macros that kill-word identifiers and later 
yank them from the kill ring; typing in a regexp search would be much more 
annoying.

I haven't made the customization yet at my new (well, ~2 years) job -- but 
that's because our coding standards use camelCaseAndNoUnderscores so the 
word-motion commands already work on identifiers and not on (English) words.  
(Though I've been dealing with Linux code lately, so it may be time to make the 
change.)  If I often wanted to deal with the individual English words making up 
an identifier, the handling of underscore wouldn't be enough to make Emacs work 
correctly.

I realize I'm much closer to the power-user end of the spectrum than most 
typical users, but among those heavily using programming modes, is this such a 
strange mind-set?

(I have no particular opinion on lua-mode specifically.)

Ken


reply via email to

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