From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: bug#7260: 24.0.50; DEL screwed up Date: Thu, 21 Oct 2010 22:30:20 +0200 Message-ID: References: <87k4lb9u8g.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7BIT X-Trace: dough.gmane.org 1287693612 3141 80.91.229.12 (21 Oct 2010 20:40:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 21 Oct 2010 20:40:12 +0000 (UTC) Cc: emacs-devel@gnu.org, rms@gnu.org, 7260@debbugs.gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 21 22:40:08 2010 Return-path: Envelope-to: ged-emacs-devel@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 1P91ve-0006KK-Fc for ged-emacs-devel@m.gmane.org; Thu, 21 Oct 2010 22:40:02 +0200 Original-Received: from localhost ([127.0.0.1]:40982 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P91nm-00050p-0h for ged-emacs-devel@m.gmane.org; Thu, 21 Oct 2010 16:31:54 -0400 Original-Received: from [140.186.70.92] (port=41362 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P91n6-0004fa-CE for emacs-devel@gnu.org; Thu, 21 Oct 2010 16:31:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P91n4-0004ju-LL for emacs-devel@gnu.org; Thu, 21 Oct 2010 16:31:12 -0400 Original-Received: from smtp.getmail.no ([84.208.15.66]:36795) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P91n4-0004jk-Bq; Thu, 21 Oct 2010 16:31:10 -0400 Original-Received: from get-mta-scan02.get.basefarm.net ([10.5.16.4]) by get-mta-out02.get.basefarm.net (Sun Java(tm) System Messaging Server 7.0-0.04 64bit (built Jun 20 2008)) with ESMTP id <0LAN00C9EQANXX60@get-mta-out02.get.basefarm.net>; Thu, 21 Oct 2010 22:30:24 +0200 (MEST) Original-Received: from get-mta-scan02.get.basefarm.net (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id A0B7E1EA580E_CC0A2E0B; Thu, 21 Oct 2010 20:30:24 +0000 (GMT) Original-Received: from smtp.getmail.no (unknown [10.5.16.4]) by get-mta-scan02.get.basefarm.net (Sophos Email Appliance) with ESMTP id 5B1D71EA27CC_CC0A2DFF; Thu, 21 Oct 2010 20:30:23 +0000 (GMT) Original-Received: from quimbies.gnus.org ([84.215.34.171]) by get-mta-in02.get.basefarm.net (Sun Java(tm) System Messaging Server 7.0-0.04 64bit (built Jun 20 2008)) with ESMTP id <0LAN00G7JQANQ230@get-mta-in02.get.basefarm.net>; Thu, 21 Oct 2010 22:30:23 +0200 (MEST) Original-Received: from larsi by quimbies.gnus.org with local (Exim 4.72) (envelope-from ) id 1P91mJ-0005cg-1i; Thu, 21 Oct 2010 22:30:23 +0200 In-reply-to: <87k4lb9u8g.fsf@stupidchicken.com> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEV5UjslGAxVOSe7k2MZ DgYKBwI4Jxda1ZmBAAACcElEQVQ4jV3UwW7jIBAG4AlEPpcs5kymFWcaS3suFc553TU9196G93+E /Qc722qRkkb+xAxmZkrmvtL+N+exlDnTF7haKzjnUnJucCEij49SkMVCdiDS7ClGjlxdRbCxQTXc FvYMKiDekqzAyp9bjtUPQww1cDAOguBPO2gAV6YQjADR+RsogaWF+tpBLRRzNX3LoaxxC6B6jeR4 l8W0U+GhYwG3eqRY5Oecc6IhIg1/JoODhiqPzTjlZBB40Eq2uPbU4lPSHS4qANoRAEu2OTkBRDvs N4mD4rsfdxjo+A1cHct/O2zKAmyzqzvQVig8RnhvcxXAVVCXBWrl8wYrb6AbuDuYHWIE5JTMCfcB YJM9U9RaHx6ekTXb7QBO2dkrVFsPx5eDhMpXXOE5Y4eApLh4Yg6IUuuH2nZIvdZQnVlOgCwwNSDK +3qRgqJcIQvQPxjXauyYvoHBy6Iyc4frte91Dem+Y0TjlXEOuHb7plDDf4AeLmXqvDIuXbhW1zUY sQXkgiezjBFNsnZ2asnHNM5ZzmtseSTFvEHZ1rRc8R7lNyrA3TV9QTEnNn35BVDdw/kbpAeFUNNA OurIaNA7TK+dzJLGMGjc3AqYG8zpKPAjklT09krlXce+kZVjvyBJJNW/U1r15Vae5C3n+XoKbR5D PxN7T/3bEG+Qq75UL2MqMCg63yatCZNB9NNhGCOgoBkUHfJJDR3GUx1fMZ5624H17MI6KJapc9L2 Xi3IgZLOK8J4xR9L/aPO6LvqcnvBCf1F0g+o+XDEoLilJ8yIc/i3IAD6oCc0JIaEthUfd3iM5zaf GIOom0gheK1+6BqYv0vKx/uIgAhoAAAAAElFTkSuQmCC X-Now-Playing: Sandy Denny's _The North Star Grassman and the Ravens_: "Blackwaterside" X-detected-operating-system: by eggs.gnu.org: Solaris 10 (1203?) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:131957 Archived-At: Chong Yidong writes: > Ah yes, now I recall: the idea was to flip the meaning of ARG in > exchange-point-and-mark, yes? Yup. > This is not a bad idea in principle. But the effects may be strange. > It would mean that, when the mark is active, you need to do C-u C-x > C-x to exchange point and mark without deactivating the mark, which is > inconvenient. So this may need tweaking. Ah, yes, true. > For this change, please post your proposed change as a patch to > emacs-devel, for others to comment, instead of checking it in directly. Sure. I've spelled out all the cases instead of using the (xor arg (not (region-active-p))) logic for clarity. It seems to do the trick in all the use cases (transient with active mark, without active mark, with and without prefix, and non-transient with and without prefix). Unless there was some combination I forgot to check. === modified file 'lisp/simple.el' *** lisp/simple.el 2010-10-19 15:43:27 +0000 --- lisp/simple.el 2010-10-21 20:27:22 +0000 *************** *** 3966,3993 **** 'exchange-dot-and-mark 'exchange-point-and-mark "23.3") (defun exchange-point-and-mark (&optional arg) "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 Transient Mark mode is on, a prefix ARG deactivates the mark ! if it is active, and otherwise avoids reactivating it. If ! Transient Mark mode is off, a prefix ARG enables Transient Mark ! mode temporarily." (interactive "P") (let ((omark (mark t)) (temp-highlight (eq (car-safe transient-mark-mode) 'only))) (if (null omark) (error "No mark set in this buffer")) (deactivate-mark) ! (set-mark (point)) (goto-char omark) (if set-mark-default-inactive (deactivate-mark)) (cond (temp-highlight (setq transient-mark-mode (cons 'only transient-mark-mode))) ! ((or (and arg (region-active-p)) ; (xor arg (not (region-active-p))) ! (not (or arg (region-active-p)))) ! (deactivate-mark)) ! (t (activate-mark))) nil)) (defcustom shift-select-mode t --- 3966,3999 ---- 'exchange-dot-and-mark 'exchange-point-and-mark "23.3") (defun exchange-point-and-mark (&optional arg) "Put the mark where point is now, and point where the mark is now. ! If Transient Mark mode is on, a prefix ARG activates the mark if ! it is inactive. If Transient Mark mode is off, a prefix ARG ! enables Transient Mark mode temporarily." (interactive "P") (let ((omark (mark t)) + (active (region-active-p)) (temp-highlight (eq (car-safe transient-mark-mode) 'only))) (if (null omark) (error "No mark set in this buffer")) (deactivate-mark) ! (push-mark (point)) (goto-char omark) (if set-mark-default-inactive (deactivate-mark)) (cond (temp-highlight (setq transient-mark-mode (cons 'only transient-mark-mode))) ! ;; Transient mode and active region -- activate. ! ((and active ! (not arg)) ! (activate-mark)) ! ;; Transient mode and no prefix -- leave deactivated. ! ((and (not active) ! (not arg)) ! ) ! ;; Non-transient mode, but prefix -- activate. ! ((and (not transient-mark-mode) ! arg) ! (activate-mark))) nil)) (defcustom shift-select-mode t -- (domestic pets only, the antidote for overdose, milk.) larsi@gnus.org * Lars Magne Ingebrigtsen