unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Keep region active after command
@ 2011-02-19 18:12 Fabian Ezequiel Gallina
  2011-02-19 21:19 ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Fabian Ezequiel Gallina @ 2011-02-19 18:12 UTC (permalink / raw)
  To: Emacs-Devel devel

What would be the best way to keep the region active after a command?

What I'm willing to do is to keep the region active after
python-indent-shift-left and python-indent-shift-right are called.


Regards,
-- 
Fabián E. Gallina
http://www.from-the-cloud.com



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Keep region active after command
  2011-02-19 18:12 Keep region active after command Fabian Ezequiel Gallina
@ 2011-02-19 21:19 ` Stefan Monnier
  2011-02-19 21:48   ` Lennart Borgman
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2011-02-19 21:19 UTC (permalink / raw)
  To: Fabian Ezequiel Gallina; +Cc: Emacs-Devel devel

> What would be the best way to keep the region active after a command?
> What I'm willing to do is to keep the region active after
> python-indent-shift-left and python-indent-shift-right are called.

The region is deactivated if `deactivate-mark' is non-nil at the end of
the command and this variable is set by buffer-modifying functions, so
let-binding deactivate-mark around those functions (or around the whole
command's body) is usually the way to do it.


        Stefan



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Keep region active after command
  2011-02-19 21:19 ` Stefan Monnier
@ 2011-02-19 21:48   ` Lennart Borgman
  2011-02-19 22:26     ` Chong Yidong
  0 siblings, 1 reply; 8+ messages in thread
From: Lennart Borgman @ 2011-02-19 21:48 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Emacs-Devel devel, Fabian Ezequiel Gallina

On Sat, Feb 19, 2011 at 10:19 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>> What would be the best way to keep the region active after a command?
>> What I'm willing to do is to keep the region active after
>> python-indent-shift-left and python-indent-shift-right are called.
>
> The region is deactivated if `deactivate-mark' is non-nil at the end of
> the command and this variable is set by buffer-modifying functions, so
> let-binding deactivate-mark around those functions (or around the whole
> command's body) is usually the way to do it.


Wouldn't it be good to have a general command like
dont-deactivate-mark-after-next-command?



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Keep region active after command
  2011-02-19 21:48   ` Lennart Borgman
@ 2011-02-19 22:26     ` Chong Yidong
  2011-02-19 22:36       ` Lennart Borgman
  0 siblings, 1 reply; 8+ messages in thread
From: Chong Yidong @ 2011-02-19 22:26 UTC (permalink / raw)
  To: Lennart Borgman
  Cc: Fabian Ezequiel Gallina, Stefan Monnier, Emacs-Devel devel

Lennart Borgman <lennart.borgman@gmail.com> writes:

> Wouldn't it be good to have a general command like
> dont-deactivate-mark-after-next-command?

No.  Having a function that just sets a variable to nil is silly.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Keep region active after command
  2011-02-19 22:26     ` Chong Yidong
@ 2011-02-19 22:36       ` Lennart Borgman
  2011-02-20  1:16         ` Miles Bader
  0 siblings, 1 reply; 8+ messages in thread
From: Lennart Borgman @ 2011-02-19 22:36 UTC (permalink / raw)
  To: Chong Yidong; +Cc: Fabian Ezequiel Gallina, Stefan Monnier, Emacs-Devel devel

On Sat, Feb 19, 2011 at 11:26 PM, Chong Yidong <cyd@stupidchicken.com> wrote:
> Lennart Borgman <lennart.borgman@gmail.com> writes:
>
>> Wouldn't it be good to have a general command like
>> dont-deactivate-mark-after-next-command?
>
> No.  Having a function that just sets a variable to nil is silly.

?? Please give an argument!



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Keep region active after command
  2011-02-19 22:36       ` Lennart Borgman
@ 2011-02-20  1:16         ` Miles Bader
  2011-02-20  1:29           ` Lennart Borgman
  0 siblings, 1 reply; 8+ messages in thread
From: Miles Bader @ 2011-02-20  1:16 UTC (permalink / raw)
  To: Lennart Borgman
  Cc: Chong Yidong, Emacs-Devel devel, Stefan Monnier,
	Fabian Ezequiel Gallina

Lennart Borgman <lennart.borgman@gmail.com> writes:
>> No.  Having a function that just sets a variable to nil is silly.
>
> ?? Please give an argument!

Because the user may as well just write (setq foo nil)...

If "foo" were obscure/weird, then maybe a set-to-nil function with a
clearer name could be useful useful, but in this case the variable's
meaning is quite clear.

-miles

-- 
Love is the difficult realization that something other than oneself is real.
[Iris Murdoch]



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Keep region active after command
  2011-02-20  1:16         ` Miles Bader
@ 2011-02-20  1:29           ` Lennart Borgman
  2011-02-20  3:59             ` Miles Bader
  0 siblings, 1 reply; 8+ messages in thread
From: Lennart Borgman @ 2011-02-20  1:29 UTC (permalink / raw)
  To: Miles Bader
  Cc: Chong Yidong, Emacs-Devel devel, Stefan Monnier,
	Fabian Ezequiel Gallina

On Sun, Feb 20, 2011 at 2:16 AM, Miles Bader <miles@gnu.org> wrote:
> Lennart Borgman <lennart.borgman@gmail.com> writes:
>>> No.  Having a function that just sets a variable to nil is silly.
>>
>> ?? Please give an argument!
>
> Because the user may as well just write (setq foo nil)...

Can't that be done instead of using any command ... ;-)



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Keep region active after command
  2011-02-20  1:29           ` Lennart Borgman
@ 2011-02-20  3:59             ` Miles Bader
  0 siblings, 0 replies; 8+ messages in thread
From: Miles Bader @ 2011-02-20  3:59 UTC (permalink / raw)
  To: Lennart Borgman
  Cc: Chong Yidong, Fabian Ezequiel Gallina, Stefan Monnier,
	Emacs-Devel devel

Lennart Borgman <lennart.borgman@gmail.com> writes:
>>>> No.  Having a function that just sets a variable to nil is silly.
>>>
>>> ?? Please give an argument!
>>
>> Because the user may as well just write (setq foo nil)...
>
> Can't that be done instead of using any command ... ;-)

Er, by "user" I mean the command.

-miles

-- 
Optimist, n. A proponent of the doctrine that black is white.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-02-20  3:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-19 18:12 Keep region active after command Fabian Ezequiel Gallina
2011-02-19 21:19 ` Stefan Monnier
2011-02-19 21:48   ` Lennart Borgman
2011-02-19 22:26     ` Chong Yidong
2011-02-19 22:36       ` Lennart Borgman
2011-02-20  1:16         ` Miles Bader
2011-02-20  1:29           ` Lennart Borgman
2011-02-20  3:59             ` Miles Bader

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).