all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ken Raeburn <raeburn@raeburn.org>
To: Miles Bader <miles@gnu.org>
Cc: Emacs Dev <emacs-devel@gnu.org>
Subject: Re: Last call for lua-mode contributors
Date: Thu, 19 Jan 2012 12:15:07 -0500	[thread overview]
Message-ID: <E24079C5-D39C-4F27-B075-8664DD9662DF@raeburn.org> (raw)
In-Reply-To: <buo4nvt7hqe.fsf@dhlpc061.dev.necel.com>

On Jan 17, 2012, at 23:32, Miles Bader wrote:
> immerrr again <immerrr+lua@gmail.com> 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	other threads:[~2012-01-19 17:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAERznn_UcioQzHojyW=JaDsSHkfihAP3b0YfcUz_NT2cLefTTg@mail.gmail.com>
     [not found] ` <CAERznn9+Y8OFPBNSDk=S_wRF+eP0u4_zfzUQjA9=Y=f=zf+MKw@mail.gmail.com>
2012-01-18  4:32   ` Last call for lua-mode contributors Miles Bader
2012-01-19 17:15     ` Ken Raeburn [this message]
2012-01-19 18:57       ` Underscores and word commands Stefan Monnier
2012-01-19 20:39         ` John Yates
2012-01-20 21:25           ` Stefan Monnier
2012-01-20  5:12       ` Last call for lua-mode contributors Miles Bader
2012-01-20  7:12         ` Ken Raeburn
2012-01-20 14:17     ` Stefan Monnier
2012-01-21  3:20       ` Miles Bader

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E24079C5-D39C-4F27-B075-8664DD9662DF@raeburn.org \
    --to=raeburn@raeburn.org \
    --cc=emacs-devel@gnu.org \
    --cc=miles@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.