emacs-devel
[Top][All Lists]
Advanced

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

Re: FW: commands to select things of different kinds


From: Stefan Monnier
Subject: Re: FW: commands to select things of different kinds
Date: Sun, 09 Mar 2008 23:32:14 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

> Resending, at Richard's request. 

Could you digest it into a single thread of text.  The current mess of
forward and backward quoting is just unreadable.


        Stefan


>> -----Original Message-----
>> From: Richard Stallman Sent: Wednesday, July 18, 2007 1:54 PM
>> To: Drew Adams
>> 
>> Not really; haven't thought much about it. As I said, 
>> I've been using
>> `C-M-SPC' for `mark-thing' (stealing from `mark-sexp') 
>> and `M-@' for
>> `cycle-thing-region' (stealing from `mark-word').
>> 
>> Those might be a good replacement, because I would expect people don't
>> use those two bindings very much.  But we have to ask people first.

>> -----Original Message-----
>> From: Drew Adams Sent: Tuesday, July 17, 2007 9:52 PM
>> To: address@hidden
>> 
>> >     > If the region is not yet active, then you are prompted (with
>> >     > completion) for the type of thing to select. The default type
>> >     > is `sexp'.
>> > 
>> >     For the first such thing, the region is not active, so you 
>> >     are prompted. For subsequent (successive) things, there is
>> >     no prompt - the same type is used as the last. When you are
>> >     prompted, `sexp' is the default type.
>> > 
>> > I see.  Maybe it is a good idea.  If people like it, we can 
>> install it
>> > in Emacs.
>> > 
>> > Do you have suggested bindings for these two commands?
>> 
>> Not really; haven't thought much about it. As I said, I've 
>> been using `C-M-SPC' for `mark-thing' (stealing from 
>> `mark-sexp') and `M-@' for `cycle-thing-region' (stealing 
>> from `mark-word'). But, as I also said, I'm not suggesting 
>> changing those bindings for Emacs.
>> 
>> I think these commands are mainly useful for Transient Mark 
>> mode, if that helps. Perhaps there are some bindings that 
>> normally make less sense in t-m mode, which could therefore 
>> be recuperated. I don't know.

>> -----Original Message----- 
>> From: Drew Adams Sent: Monday, July 16, 2007 12:17 AM
>> To: Emacs-Devel
>> 
>> Any interest in these commands? They let you select (that is, 
>> mark) various
>> things at or near point. They are most useful in Transient 
>> Mark mode - they
>> act differently depending on whether the mark is active.
>> 
>> * `mark-thing' selects successive things, starting at point. 
>> The mark is put
>> at the same place that command 'forward-'thing would put it 
>> (using the same
>> prefix argument). If the region is not yet active, then you 
>> are prompted
>> (with completion) for the type of thing to select. The default type is
>> `sexp'.
>> 
>> * `cycle-thing-region' selects one thing at or near point 
>> (just the thing,
>> not from point through the thing, even if the thing is not exactly at
>> point). Repeat it to cycle among the thing types - one thing 
>> of the current
>> type is selected at each invocation. The default order of 
>> types is `word',
>> `sexp', `list', `line', `sentence', `paragraph', `page', 
>> `defun', `number',
>> `form'. That order is customizable, and a major mode could 
>> also change it to
>> put the most commonly used types first.
>> 
>> I bind `mark-thing' to `C-M-SPC' as a replacement for `mark-sexp'.
>> 
>> I bind `cycle-thing-region' to `M-@' as a replacement for 
>> `mark-word'. (By
>> default, it does what `mark-word' does without a prefix arg. Unlike,
>> `mark-thing', however, `cycle-thing-region' does not accept a 
>> prefix arg.)
>> 
>> I don't propose these bindings for Emacs generally, but if you use
>> transient-mark mode you might want to give them a try.
>> 
>> To select successive things in transient-mark mode, you can use
>> `cycle-thing-region' as an alternative to completion for 
>> choosing the thing
>> type for `mark-thing' - but you need to use `C-x C-x' between 
>> the two. That
>> is, you can use 'M-@ C-x C-x C-M-SPC' to select successive 
>> words, 'M-@ M-@
>> C-x C-x C-M-SPC' for successive symbols, and so on.
>> 
>> The code is attached.







reply via email to

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