From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tomas Nordin Newsgroups: gmane.emacs.bugs Subject: bug#29346: dwim transpose-subr opportunity? Date: Fri, 17 Nov 2017 23:00:29 +0100 Message-ID: <87a7zkwooy.fsf@fliptop> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1510956077 16124 195.159.176.226 (17 Nov 2017 22:01:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 17 Nov 2017 22:01:17 +0000 (UTC) To: 29346@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 17 23:01:13 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFohA-0003jE-GX for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Nov 2017 23:01:08 +0100 Original-Received: from localhost ([::1]:47992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFohH-0006YM-Um for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Nov 2017 17:01:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFoh7-0006Xo-Fm for bug-gnu-emacs@gnu.org; Fri, 17 Nov 2017 17:01:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFoh4-00063O-Ez for bug-gnu-emacs@gnu.org; Fri, 17 Nov 2017 17:01:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36724) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eFoh4-00062l-CA for bug-gnu-emacs@gnu.org; Fri, 17 Nov 2017 17:01:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eFoh4-0004TD-4Q for bug-gnu-emacs@gnu.org; Fri, 17 Nov 2017 17:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tomas Nordin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Nov 2017 22:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 29346 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.151095606117167 (code B ref -1); Fri, 17 Nov 2017 22:01:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Nov 2017 22:01:01 +0000 Original-Received: from localhost ([127.0.0.1]:45405 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFoh2-0004Sp-V7 for submit@debbugs.gnu.org; Fri, 17 Nov 2017 17:01:01 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:41537) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFoh1-0004Sd-3n for submit@debbugs.gnu.org; Fri, 17 Nov 2017 17:00:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFogu-0005lK-PA for submit@debbugs.gnu.org; Fri, 17 Nov 2017 17:00:53 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:48015) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFogu-0005l1-M7 for submit@debbugs.gnu.org; Fri, 17 Nov 2017 17:00:52 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60741) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFogt-0006Vv-IN for bug-gnu-emacs@gnu.org; Fri, 17 Nov 2017 17:00:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFogn-0005db-AF for bug-gnu-emacs@gnu.org; Fri, 17 Nov 2017 17:00:51 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]:37873) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFogn-0005R1-3w for bug-gnu-emacs@gnu.org; Fri, 17 Nov 2017 17:00:45 -0500 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 9811520961 for ; Fri, 17 Nov 2017 23:00:33 +0100 (CET) Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 3ydsVm5mqCz101B for ; Fri, 17 Nov 2017 23:00:30 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:140032 Archived-At: Hello List Not a bug report but maybe a feature request. I was wondering if there is an opportunity for a dwim feature of the transpose- set of functions by something like the following: 1 file changed, 1 insertion(+), 1 deletion(-) lisp/simple.el | 2 +- modified lisp/simple.el @@ -6967,7 +6967,7 @@ transpose-subr (progn (funcall mover (- x)) (point)))))) pos1 pos2) (cond - ((= arg 0) + ((or (= arg 0) (use-region-p)) (save-excursion (setq pos1 (funcall aux 1)) (goto-char (or (mark) (error "No mark set in this buffer"))) The intention is that a 0 number prefix argument is not necessary if there is a region so that use-region-p is non-nil. I have tried it in some various ways and to me it seem to work, but I don't know all the delicate ways in which those commands might be used. What do you think? It gets a bit silly as suggested though, I guess the logic should be something like (or (= arg 0) (and transpose-dwim (use-region-p))) Best regards -- Tomas