help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Is transient-mark-mode for newbies?


From: Stefan Monnier
Subject: Re: Is transient-mark-mode for newbies?
Date: Wed, 17 Oct 2007 14:31:40 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux)

>     (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


reply via email to

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