From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Harald Hanche-Olsen Newsgroups: gmane.emacs.help Subject: Re: How to deactivate mark? Date: Tue, 06 Apr 2010 15:46:51 -0400 Organization: Norwegian university of science and technology Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1273003784 30573 80.91.229.12 (4 May 2010 20:09:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 4 May 2010 20:09:44 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 04 22:09:43 2010 connect(): No such file or directory 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.69) (envelope-from ) id 1O9OR0-00062Q-J1 for geh-help-gnu-emacs@m.gmane.org; Tue, 04 May 2010 22:09:39 +0200 Original-Received: from localhost ([127.0.0.1]:37943 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9OQo-00066L-JG for geh-help-gnu-emacs@m.gmane.org; Tue, 04 May 2010 16:09:26 -0400 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!uio.no!ntnu.no!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-NNTP-Posting-Host: euler.math.ntnu.no Original-X-Trace: orkan.itea.ntnu.no 1270583210 22125 129.241.15.252 (6 Apr 2010 19:46:50 GMT) Original-X-Complaints-To: usenet@ntnu.no Original-NNTP-Posting-Date: Tue, 6 Apr 2010 19:46:50 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (darwin) Cancel-Lock: sha1:K1yQGzLV1deLyhuto+ayL9T96gc= Original-Xref: usenet.stanford.edu gnu.emacs.help:177654 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:73124 Archived-At: + Uday S Reddy : > I tried to define a command called narrow-to-defun as follows: > > (defun narrow-to-defun () > "Narrow to the current defun around point" > (interactive) > (mark-defun) > (narrow-to-region (point) (mark)) > ) > > Unfortunately, running the command makes the mark "active," thereby > highlighting the defun at the end of the execution. I have tried > various tricks to get the mark to turn off - like calling > deactivate-mark, binding deactivate-mark to t locally, binding > transient-mark-mode to nil etc. But none of them is able to turn off > the active mark at the end. > > What am I missing? Adding (deactivate-mark) to the end of your definition works for me. Did you forget to evaluate the defun after adding this bit? (I forget it all the time.) -- * Harald Hanche-Olsen - It is undesirable to believe a proposition when there is no ground whatsoever for supposing it is true. -- Bertrand Russell