[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is transient-mark-mode for newbies?
From: |
Johan Bockgård |
Subject: |
Re: Is transient-mark-mode for newbies? |
Date: |
Thu, 18 Oct 2007 01:28:09 +0200 |
User-agent: |
Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux) |
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
- Re: Is transient-mark-mode for newbies?, (continued)
Message not available