all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Drew Adams" <drew.adams@oracle.com>
Cc: Emacs-Devel <emacs-devel@gnu.org>
Subject: Re: FW: commands to select things of different kinds
Date: Sun, 09 Mar 2008 23:32:14 -0400	[thread overview]
Message-ID: <jwvwsobtfu0.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <001c01c88204$f5891160$0600a8c0@us.oracle.com> (Drew Adams's message of "Sun, 9 Mar 2008 08:45:18 -0800")

> 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: rms@gnu.org
>> 
>> >     > 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	other threads:[~2008-03-10  3:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-09 16:45 FW: commands to select things of different kinds Drew Adams
2008-03-10  3:32 ` Stefan Monnier [this message]
2008-03-10  4:30   ` Drew Adams
  -- strict thread matches above, loose matches on Subject: below --
2008-04-18 22:06 Drew Adams
2008-04-19  3:42 ` Stefan Monnier
2008-04-19 20:11   ` Juri Linkov
2008-04-19 20:22     ` David Kastrup
2008-04-19 23:18       ` Richard Stallman
2008-04-19 20:35     ` Drew Adams
2008-04-19 22:54       ` Juri Linkov
2008-04-19 23:22         ` Drew Adams
2008-04-20 23:52           ` Juri Linkov
2008-04-21  0:13             ` Drew Adams
2008-04-21  1:03             ` Stefan Monnier

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=jwvwsobtfu0.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@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.