From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: 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 1287693792 4059 80.91.229.12 (21 Oct 2010 20:43:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 21 Oct 2010 20:43:12 +0000 (UTC) Cc: 7260@debbugs.gnu.org, rms@gnu.org, emacs-devel@gnu.org To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 21 22:43:10 2010 Return-path: Envelope-to: geb-bug-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 1P91ye-0007Md-RL for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Oct 2010 22:43:09 +0200 Original-Received: from localhost ([127.0.0.1]:58642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P91ye-0001kI-0k for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Oct 2010 16:43:08 -0400 Original-Received: from [140.186.70.92] (port=58355 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P91yJ-0001dz-94 for bug-gnu-emacs@gnu.org; Thu, 21 Oct 2010 16:42:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P91yE-00075Q-4C for bug-gnu-emacs@gnu.org; Thu, 21 Oct 2010 16:42:47 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57257) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P91yD-00075L-UL for bug-gnu-emacs@gnu.org; Thu, 21 Oct 2010 16:42:42 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1P91k2-0002ca-G7; Thu, 21 Oct 2010 16:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Magne Ingebrigtsen Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Oct 2010 20:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7260 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7260-submit@debbugs.gnu.org id=B7260.128769283210061 (code B ref 7260); Thu, 21 Oct 2010 20:28:02 +0000 Original-Received: (at 7260) by debbugs.gnu.org; 21 Oct 2010 20:27:12 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P91jD-0002cE-2d for submit@debbugs.gnu.org; Thu, 21 Oct 2010 16:27:11 -0400 Original-Received: from smtp.getmail.no ([84.208.15.66]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P91jB-0002c7-CY for 7260@debbugs.gnu.org; Thu, 21 Oct 2010 16:27: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> for 7260@debbugs.gnu.org; Thu, 21 Oct 2010 22:30:23 +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 A6B801EA560C_CC0A2DFB for <7260@debbugs.gnu.org>; Thu, 21 Oct 2010 20:30:23 +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 595DC1EA27C9_CC0A2DFF for <7260@debbugs.gnu.org>; 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> for 7260@debbugs.gnu.org; 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 21 Oct 2010 16:28:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:41057 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