From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master b88e7c8: Make transpose-regions interactive (Bug#30343) Date: Thu, 29 Mar 2018 14:38:15 +0300 Message-ID: <834lkzdsd4.fsf@gnu.org> References: <20180311105533.30002.78782@vcs0.savannah.gnu.org> <20180311105534.3DAFD23CF3@vcs0.savannah.gnu.org> <83woyiscns.fsf@gnu.org> <87po44jb7w.fsf@red-bean.com> <20180311105533.30002.78782@vcs0.savannah.gnu.org> <20180311105534.3DAFD23CF3@vcs0.savannah.gnu.org> <83woyiscns.fsf@gnu.org> <87a7v2zb27.fsf@red-bean.com> <838tallwpg.fsf@gnu.org> <83605kgo1w.fsf@gnu.org> <87o9j87zgv.fsf@mail.linkov.net> <87r2o3pjmm.fsf@red-bean.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1522323457 21373 195.159.176.226 (29 Mar 2018 11:37:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 29 Mar 2018 11:37:37 +0000 (UTC) Cc: emacs-devel@gnu.org, juri@linkov.net To: Karl Fogel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 29 13:37:32 2018 Return-path: Envelope-to: ged-emacs-devel@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 1f1Vs4-0005TB-IS for ged-emacs-devel@m.gmane.org; Thu, 29 Mar 2018 13:37:32 +0200 Original-Received: from localhost ([::1]:43929 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f1Vu8-0002te-0B for ged-emacs-devel@m.gmane.org; Thu, 29 Mar 2018 07:39:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f1Vt5-0002sJ-H5 for emacs-devel@gnu.org; Thu, 29 Mar 2018 07:38:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f1Vt2-0005BF-BK for emacs-devel@gnu.org; Thu, 29 Mar 2018 07:38:35 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40359) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f1Vt2-0005BB-8P; Thu, 29 Mar 2018 07:38:32 -0400 Original-Received: from [176.228.60.248] (port=2149 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1f1Vt1-0002Pl-LE; Thu, 29 Mar 2018 07:38:32 -0400 In-reply-to: <87r2o3pjmm.fsf@red-bean.com> (message from Karl Fogel on Wed, 28 Mar 2018 23:53:53 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:224147 Archived-At: > From: Karl Fogel > Date: Wed, 28 Mar 2018 23:53:53 -0500 > Cc: emacs-devel@gnu.org > > >(put 'transpose-regions > > 'interactive-form > > '(if (< (length mark-ring) 2) > > (error "Other region must be marked before transposing two regions") > > (let* ((num (if current-prefix-arg > > (prefix-numeric-value current-prefix-arg) > > 0)) > > (ring-length (length mark-ring)) > > (eltnum (mod num ring-length)) > > (eltnum2 (mod (1+ num) ring-length))) > > (list (point) (mark) (elt mark-ring eltnum) (elt mark-ring eltnum2))))) > > Personally, I think I'd prefer to have the interactive form together with the rest of the function definition, even if that's in C. I agree. My reason is that this separation makes finding all the pieces of the puzzle significantly harder. > What would you think of mentioning this trick in doc/lispref/internals.texi, in the text for "@item interactive"? The property is already prominently described, so just a cross-reference to one of those places should be enough.