From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: [rutt+news@cis.ohio-state.edu: [patch] factor out comment-or-uncomment feature from comment-dwim] Date: 12 Apr 2002 11:45:20 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <5x4rihi72n.fsf@kfs2.cua.dk> References: <200204072343.g37NhcO20159@aztec.santafe.edu> <200204082213.g38MDMd12225@rum.cs.yale.edu> <200204101423.g3AENc220897@aztec.santafe.edu> <200204101636.g3AGas725787@rum.cs.yale.edu> <5xpu17p7on.fsf@kfs2.cua.dk> <5xg02260fy.fsf@kfs2.cua.dk> <200204120312.g3C3CrF22317@aztec.santafe.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1018601129 2461 127.0.0.1 (12 Apr 2002 08:45:29 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 12 Apr 2002 08:45:29 +0000 (UTC) Cc: emacs-devel@gnu.org, rutt+news@cis.ohio-state.edu Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16vwgT-0000da-00 for ; Fri, 12 Apr 2002 10:45:29 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16vwwe-0001tZ-00 for ; Fri, 12 Apr 2002 11:02:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16vwg9-0002mh-00; Fri, 12 Apr 2002 04:45:09 -0400 Original-Received: from mail.filanet.dk ([195.215.206.179]) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 16vwfX-0002jh-00; Fri, 12 Apr 2002 04:44:31 -0400 Original-Received: from kfs2.cua.dk.cua.dk (kfs2.local.filanet.dk [192.168.1.182]) by mail.filanet.dk (Postfix) with SMTP id 4D30B7C047; Fri, 12 Apr 2002 08:44:29 +0000 (GMT) Original-To: rms@gnu.org In-Reply-To: <200204120312.g3C3CrF22317@aztec.santafe.edu> Original-Lines: 70 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:2571 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:2571 Richard Stallman writes: > This is a significant deviation from the old behaviour of C-u C-SPC, > but the new functionality is much easier to use...! > > I think it is good, but I think we should also look at the idea > of changing C-x C-x in a similar way: > doing it twice would temporarily enable transient-mark-mode. I don't see any problems doing that, and I think it is complements the changes to C-SPC very well. Here is a version which does that: (defun exchange-point-and-mark () "Put the mark where point is now, and point where the mark is now. This command works even when the mark is not active, and it reactivates the mark. If the command is repeated immediately, `transient-mark-mode' is enabled temporarily." (interactive nil) (let ((omark (mark t))) (if (null omark) (error "No mark set in this buffer")) (set-mark (point)) (goto-char omark) (if (and (not transient-mark-mode) (eq this-command last-command)) (setq transient-mark-mode 'lambda)) nil)) Should I install it (together with the new set-mark-command)? This is still requires some of Stefan's original suggestion: --- simple.el 7 Apr 2002 10:10:23 -0000 1.533 +++ simple.el 8 Apr 2002 22:06:00 -0000 @@ -2233,11 +2270,19 @@ "Deactivate the mark by setting `mark-active' to nil. \(That makes a difference only in Transient Mark mode.) Also runs the hook `deactivate-mark-hook'." - (if transient-mark-mode - (progn + (cond + ((eq transient-mark-mode 'lambda) + (setq transient-mark-mode nil)) + (transient-mark-mode (setq mark-active nil) (run-hooks 'deactivate-mark-hook)))) --- keyboard.c 3 Apr 2002 08:36:56 -0000 1.669 +++ keyboard.c 8 Apr 2002 22:05:22 -0000 @@ -1718,9 +1721,15 @@ { if (!NILP (Vdeactivate_mark) && !NILP (Vtransient_mark_mode)) { + /* We could also call `deactivate'mark'. */ + if (EQ (Vtransient_mark_mode, Qlambda)) + Vtransient_mark_mode = Qnil; + else + { current_buffer->mark_active = Qnil; call1 (Vrun_hooks, intern ("deactivate-mark-hook")); } + } else if (current_buffer != prev_buffer || MODIFF != prev_modiff) call1 (Vrun_hooks, intern ("activate-mark-hook")); } -- Kim F. Storm http://www.cua.dk