* Is transient-mark-mode for newbies?
@ 2007-10-11 13:32 weber
2007-10-11 14:47 ` Bastien
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: weber @ 2007-10-11 13:32 UTC (permalink / raw)
To: help-gnu-emacs
Or, in other words, are there commands or tricks possible only when
transient-mark-mode is off?
Regards,
weber
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Is transient-mark-mode for newbies?
2007-10-11 13:32 Is transient-mark-mode for newbies? weber
@ 2007-10-11 14:47 ` Bastien
2007-10-11 15:28 ` Drew Adams
2007-10-12 3:11 ` Barry Margolin
2 siblings, 0 replies; 15+ messages in thread
From: Bastien @ 2007-10-11 14:47 UTC (permalink / raw)
To: weber; +Cc: help-gnu-emacs
weber <hugows@gmail.com> writes:
> Or, in other words, are there commands or tricks possible only when
> transient-mark-mode is off?
I'm not sure to understand. But maybe C-SPC C-SPC might help: it
activates `transient-mark-mode' temporarily.
,----[ set-mark-command ]
| C-SPC runs the command set-mark-command
| which is an interactive compiled Lisp function in `simple.el'.
| It is bound to C-@, C-SPC.
| (set-mark-command arg)
|
| Set the mark where point is, or jump to the mark.
| Setting the mark also alters the region, which is the text
| between point and mark; this is the closest equivalent in
| Emacs to what some editors call the "selection".
|
| With no prefix argument, set the mark at point, and push the
| old mark position on local mark ring. Also push the old mark on
| global mark ring, if the previous mark was set in another buffer.
|
| Immediately repeating this command activates `transient-mark-mode' temporarily.
`----
--
Bastien
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: Is transient-mark-mode for newbies?
2007-10-11 13:32 Is transient-mark-mode for newbies? weber
2007-10-11 14:47 ` Bastien
@ 2007-10-11 15:28 ` Drew Adams
2007-10-12 3:11 ` Barry Margolin
2 siblings, 0 replies; 15+ messages in thread
From: Drew Adams @ 2007-10-11 15:28 UTC (permalink / raw)
To: weber, help-gnu-emacs
> Or, in other words, are there commands or tricks possible only when
> transient-mark-mode is off?
IMO, it's fine for newbies - and for everyone else. Some of us have been
trying to get it to be the default behavior for years.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Is transient-mark-mode for newbies?
[not found] <mailman.1954.1192116594.18990.help-gnu-emacs@gnu.org>
@ 2007-10-11 18:09 ` Mathias Dahl
2007-10-11 19:02 ` Eric Hanchrow
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: Mathias Dahl @ 2007-10-11 18:09 UTC (permalink / raw)
To: help-gnu-emacs
"Drew Adams" <drew.adams@oracle.com> writes:
>> Or, in other words, are there commands or tricks possible only when
>> transient-mark-mode is off?
>
> IMO, it's fine for newbies - and for everyone else. Some of us have been
> trying to get it to be the default behavior for years.
I tried it for a long time but got pissed off by getting the region
highlighted when I did not want to, one time too many. For example
when using C-x C-x to switch point and mark. Maybe that would have
been possible to turn off, don't know, I was too lazy to find out I
guess.
/Mathias
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Is transient-mark-mode for newbies?
2007-10-11 18:09 ` Mathias Dahl
@ 2007-10-11 19:02 ` Eric Hanchrow
2007-10-11 20:36 ` Harald Hanche-Olsen
[not found] ` <mailman.1957.1192129728.18990.help-gnu-emacs@gnu.org>
2 siblings, 0 replies; 15+ messages in thread
From: Eric Hanchrow @ 2007-10-11 19:02 UTC (permalink / raw)
To: help-gnu-emacs
>>>>> "Mathias" == Mathias Dahl <brakjoller@gmail.com> writes:
Mathias> I tried [transient-mark-mode] for a long time but got
Mathias> pissed off by getting the region highlighted when I did
Mathias> not want to, one time too many. For example when using
Mathias> C-x C-x to switch point and mark.
I use C-u C-SPC for that; it seems to work about as well.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Is transient-mark-mode for newbies?
2007-10-11 18:09 ` Mathias Dahl
2007-10-11 19:02 ` Eric Hanchrow
@ 2007-10-11 20:36 ` Harald Hanche-Olsen
2007-10-12 7:11 ` Mathias Dahl
[not found] ` <mailman.1957.1192129728.18990.help-gnu-emacs@gnu.org>
2 siblings, 1 reply; 15+ messages in thread
From: Harald Hanche-Olsen @ 2007-10-11 20:36 UTC (permalink / raw)
To: help-gnu-emacs
+ Mathias Dahl <brakjoller@gmail.com>:
> I tried it for a long time but got pissed off by getting the region
> highlighted when I did not want to, one time too many. For example
> when using C-x C-x to switch point and mark.
Then hit C-g to turn off the highlight.
--
* Harald Hanche-Olsen <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
when there is no ground whatsoever for supposing it is true.
-- Bertrand Russell
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Is transient-mark-mode for newbies?
2007-10-11 13:32 Is transient-mark-mode for newbies? weber
2007-10-11 14:47 ` Bastien
2007-10-11 15:28 ` Drew Adams
@ 2007-10-12 3:11 ` Barry Margolin
2007-10-12 7:54 ` Johan Bockgård
2 siblings, 1 reply; 15+ messages in thread
From: Barry Margolin @ 2007-10-12 3:11 UTC (permalink / raw)
To: help-gnu-emacs
In article <1192109562.973390.221400@g4g2000hsf.googlegroups.com>,
weber <hugows@gmail.com> wrote:
> Or, in other words, are there commands or tricks possible only when
> transient-mark-mode is off?
> Regards,
> weber
I've been using various versions of Emacs for over 25 years. I just
last week enabled transient-mark-mode. I decided that I like the way
that many commands will automatically switch from operating on the
entire buffer to just the region when it's visible.
Also, I just installed TSUCHIYA Masatoshi's shell-command.el, mainly for
its feature of enabling completion in the M-! and M-| prompts. But it
extends the above automatic behavior to M-|, a command I use very
frequently. If the region isn't visible, M-| automatically operates on
the entire buffer, saving me from having to type C-x h over and over.
BTW, your question appears to presume that t-m-m was created to emulate
Windows/Mac-style marking with the mouse. In fact, it goes back to the
ZMACS editor on the MIT Lisp Machines, which was written around 1980.
GNU Emacs didn't have this originally because it was designed for text
terminals, and highlighting the region on the fly was difficult on many
types of terminals; it wasn't until it was adapted to window systems
that this style could be resurrected with no overhead.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Is transient-mark-mode for newbies?
2007-10-11 20:36 ` Harald Hanche-Olsen
@ 2007-10-12 7:11 ` Mathias Dahl
2007-10-12 8:36 ` Johan Bockgård
0 siblings, 1 reply; 15+ messages in thread
From: Mathias Dahl @ 2007-10-12 7:11 UTC (permalink / raw)
To: help-gnu-emacs
Harald Hanche-Olsen <hanche@math.ntnu.no> writes:
> + Mathias Dahl <brakjoller@gmail.com>:
>
>> I tried it for a long time but got pissed off by getting the region
>> highlighted when I did not want to, one time too many. For example
>> when using C-x C-x to switch point and mark.
>
> Then hit C-g to turn off the highlight.
Well, that's the thing, I don't want to have to do any of those
tricks, C-g, M-w or whatever, to get rid of it. I guess I want it to
magically guess when I want it active, and that is quite hard. So I
keep transient-mark-mode off.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Is transient-mark-mode for newbies?
[not found] ` <mailman.1957.1192129728.18990.help-gnu-emacs@gnu.org>
@ 2007-10-12 7:16 ` Mathias Dahl
0 siblings, 0 replies; 15+ messages in thread
From: Mathias Dahl @ 2007-10-12 7:16 UTC (permalink / raw)
To: help-gnu-emacs
Eric Hanchrow <offby1@blarg.net> writes:
> Mathias> I tried [transient-mark-mode] for a long time but got
> Mathias> pissed off by getting the region highlighted when I did
> Mathias> not want to, one time too many. For example when using
> Mathias> C-x C-x to switch point and mark.
>
> I use C-u C-SPC for that; it seems to work about as well.
I use that too, a lot, to jump around, but I didn't think about it as
doing the same job.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Is transient-mark-mode for newbies?
2007-10-12 3:11 ` Barry Margolin
@ 2007-10-12 7:54 ` Johan Bockgård
0 siblings, 0 replies; 15+ messages in thread
From: Johan Bockgård @ 2007-10-12 7:54 UTC (permalink / raw)
To: help-gnu-emacs
Barry Margolin <barmar@alum.mit.edu> writes:
> BTW, your question appears to presume that t-m-m was created to emulate
> Windows/Mac-style marking with the mouse. In fact, it goes back to the
> ZMACS editor on the MIT Lisp Machines, which was written around 1980.
In XEmacs the feature is even known as `zmacs-regions'.
--
Johan Bockgård
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Is transient-mark-mode for newbies?
2007-10-12 7:11 ` Mathias Dahl
@ 2007-10-12 8:36 ` Johan Bockgård
2007-10-15 15:21 ` Mathias Dahl
2007-10-17 18:31 ` Stefan Monnier
0 siblings, 2 replies; 15+ messages in thread
From: Johan Bockgård @ 2007-10-12 8:36 UTC (permalink / raw)
To: help-gnu-emacs
Mathias Dahl <brakjoller@gmail.com> writes:
> Well, that's the thing, I don't want to have to do any of those
> tricks, C-g, M-w or whatever, to get rid of it. I guess I want it to
> magically guess when I want it active, and that is quite hard. So I
> keep transient-mark-mode off.
I use temporary transient mark mode for mark commands
(progn
'#1=((after transient-mark activate)
"Activate Transient Mark mode temporarily."
(setq transient-mark-mode 'only))
(defadvice mark-sexp . #1#)
(defadvice mark-word . #1#)
(defadvice mark-paragraph . #1#)
(defadvice mark-defun . #1#)
(defadvice mark-end-of-sentence . #1#)
(defadvice mark-page . #1#)
(defadvice mark-whole-buffer . #1#)
(defadvice LaTeX-mark-environment . #1#)
(defadvice LaTeX-mark-section . #1#))
The mark commands set the mark at a place away from point, and
highlighting shows more clearly what's going on. Especially in Emacs 22,
where repeating a mark command extends the region.
--
Johan Bockgård
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Is transient-mark-mode for newbies?
2007-10-12 8:36 ` Johan Bockgård
@ 2007-10-15 15:21 ` Mathias Dahl
2007-10-15 16:17 ` Tassilo Horn
2007-10-17 18:31 ` Stefan Monnier
1 sibling, 1 reply; 15+ messages in thread
From: Mathias Dahl @ 2007-10-15 15:21 UTC (permalink / raw)
To: help-gnu-emacs
bojohan+news@dd.chalmers.se (Johan Bockgård) writes:
> I use temporary transient mark mode for mark commands
>
> (progn
> '#1=((after transient-mark activate)
> "Activate Transient Mark mode temporarily."
> (setq transient-mark-mode 'only))
> (defadvice mark-sexp . #1#)
> (defadvice mark-word . #1#)
> (defadvice mark-paragraph . #1#)
> (defadvice mark-defun . #1#)
> (defadvice mark-end-of-sentence . #1#)
> (defadvice mark-page . #1#)
> (defadvice mark-whole-buffer . #1#)
>
> (defadvice LaTeX-mark-environment . #1#)
> (defadvice LaTeX-mark-section . #1#))
WTF! What IS that stuff?! I thought you had yanked some text by
mistake, but that actually works! :) Can anyone explain how/why? What
puzzles me the most is the "thing" that looks like a declaration
('#1=).
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Is transient-mark-mode for newbies?
2007-10-15 15:21 ` Mathias Dahl
@ 2007-10-15 16:17 ` Tassilo Horn
0 siblings, 0 replies; 15+ messages in thread
From: Tassilo Horn @ 2007-10-15 16:17 UTC (permalink / raw)
To: help-gnu-emacs
Mathias Dahl <brakjoller@gmail.com> writes:
> bojohan+news@dd.chalmers.se (Johan Bockgård) writes:
>
>> I use temporary transient mark mode for mark commands
>>
>> (progn
>> '#1=((after transient-mark activate)
>> "Activate Transient Mark mode temporarily."
>> (setq transient-mark-mode 'only))
>> (defadvice mark-sexp . #1#)
>> (defadvice mark-word . #1#)
>> (defadvice mark-paragraph . #1#)
>> (defadvice mark-defun . #1#)
>> (defadvice mark-end-of-sentence . #1#)
>> (defadvice mark-page . #1#)
>> (defadvice mark-whole-buffer . #1#)
>>
>> (defadvice LaTeX-mark-environment . #1#)
>> (defadvice LaTeX-mark-section . #1#))
>
> WTF! What IS that stuff?!
,----[ (info "(elisp)Circular Objects") ]
| To represent shared or circular structures within a complex of Lisp
| objects, you can use the reader constructs `#N=' and `#N#'.
|
| Use `#N=' before an object to label it for later reference;
| subsequently, you can use `#N#' to refer the same object in another
| place. Here, N is some integer.
`----
I didn't know that, too. Really not bad. :)
Bye,
Tassilo
--
No person, no idea, and no religion deserves to be illegal to insult,
not even the Church of Emacs. (Richard M. Stallman)
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Is transient-mark-mode for newbies?
2007-10-12 8:36 ` Johan Bockgård
2007-10-15 15:21 ` Mathias Dahl
@ 2007-10-17 18:31 ` Stefan Monnier
2007-10-17 23:28 ` Johan Bockgård
1 sibling, 1 reply; 15+ messages in thread
From: Stefan Monnier @ 2007-10-17 18:31 UTC (permalink / raw)
To: help-gnu-emacs
> (progn
> '#1=((after transient-mark activate)
> "Activate Transient Mark mode temporarily."
> (setq transient-mark-mode 'only))
> (defadvice mark-sexp . #1#)
> (defadvice mark-word . #1#)
> (defadvice mark-paragraph . #1#)
> (defadvice mark-defun . #1#)
> (defadvice mark-end-of-sentence . #1#)
> (defadvice mark-page . #1#)
> (defadvice mark-whole-buffer . #1#)
> (defadvice LaTeX-mark-environment . #1#)
> (defadvice LaTeX-mark-section . #1#))
Naughty boy!
A more conventional version could look like:
(macrolet ((advise (&rest commands)
`(progn
,@(mapcar (lambda (command)
`(defadvice ,(after transient-mark activate)
"Activate Transient Mark mode temporarily."
(setq transient-mark-mode 'only)))
commands))))
(advise mark-sexp
mark-word
mark-paragraph
mark-defun
mark-end-of-sentence
mark-page
mark-whole-buffer
LaTeX-mark-environment
LaTeX-mark-section))
-- Stefan
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Is transient-mark-mode for newbies?
2007-10-17 18:31 ` Stefan Monnier
@ 2007-10-17 23:28 ` Johan Bockgård
0 siblings, 0 replies; 15+ messages in thread
From: Johan Bockgård @ 2007-10-17 23:28 UTC (permalink / raw)
To: help-gnu-emacs
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> Naughty boy!
>
> A more conventional version could look like:
>
> (macrolet ((advise (&rest commands)
> `(progn
> ,@(mapcar (lambda (command)
> `(defadvice ,(after transient-mark activate)
`(defadvice ,command (after transient-mark activate)
> "Activate Transient Mark mode temporarily."
> (setq transient-mark-mode 'only)))
> commands))))
> (advise mark-sexp
> mark-word
> mark-paragraph
> mark-defun
> mark-end-of-sentence
> mark-page
> mark-whole-buffer
> LaTeX-mark-environment
> LaTeX-mark-section))
In fact, I already had this similar version that doesn't need macrolet
((macro
. (lambda (&rest args)
`(progn ,@(mapcar
(lambda (sym)
`(defadvice ,sym (after transient-mark activate)
"Activate Transient Mark mode temporarily."
(setq transient-mark-mode 'only)))
args))))
mark-sexp mark-word mark-paragraph mark-defun
mark-end-of-sentence mark-page mark-whole-buffer
LaTeX-mark-environment LaTeX-mark-section)
--
Naughty Boy
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2007-10-17 23:28 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-11 13:32 Is transient-mark-mode for newbies? weber
2007-10-11 14:47 ` Bastien
2007-10-11 15:28 ` Drew Adams
2007-10-12 3:11 ` Barry Margolin
2007-10-12 7:54 ` Johan Bockgård
[not found] <mailman.1954.1192116594.18990.help-gnu-emacs@gnu.org>
2007-10-11 18:09 ` Mathias Dahl
2007-10-11 19:02 ` Eric Hanchrow
2007-10-11 20:36 ` Harald Hanche-Olsen
2007-10-12 7:11 ` Mathias Dahl
2007-10-12 8:36 ` Johan Bockgård
2007-10-15 15:21 ` Mathias Dahl
2007-10-15 16:17 ` Tassilo Horn
2007-10-17 18:31 ` Stefan Monnier
2007-10-17 23:28 ` Johan Bockgård
[not found] ` <mailman.1957.1192129728.18990.help-gnu-emacs@gnu.org>
2007-10-12 7:16 ` Mathias Dahl
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).