From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=) Newsgroups: gmane.emacs.help Subject: Re: Is transient-mark-mode for newbies? Date: Thu, 18 Oct 2007 01:28:09 +0200 Organization: Chalmers University of Technology, Sweden Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1192664690 9290 80.91.229.12 (17 Oct 2007 23:44:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Oct 2007 23:44:50 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 18 01:44:50 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IiIZG-0007sy-6q for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Oct 2007 01:44:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IiIZ8-0006Mi-SR for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Oct 2007 19:44:42 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.swip.net!swipnet!newsfeed.sunet.se!news01.sunet.se!129.16.222.141.MISMATCH!gide.ita.chalmers.se!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 42 Original-NNTP-Posting-Host: remote4.student.chalmers.se Original-X-Trace: gide.ita.chalmers.se 1192663689 3505 129.16.29.77 (17 Oct 2007 23:28:09 GMT) Original-X-Complaints-To: usenet@gide.ita.chalmers.se Original-NNTP-Posting-Date: Wed, 17 Oct 2007 23:28:09 +0000 (UTC) Mail-Copies-To: never User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux) Cancel-Lock: sha1:6Ke12G7tNLPtWr8oBsN6w5J50iw= Original-Xref: shelby.stanford.edu gnu.emacs.help:153011 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:48513 Archived-At: Stefan Monnier 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