From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: charles@aurox.ch (Charles A. Roelli) Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master b88e7c8: Make transpose-regions interactive (Bug#30343) Date: Sun, 11 Mar 2018 18:23:13 +0100 Message-ID: References: <20180311105533.30002.78782@vcs0.savannah.gnu.org> <20180311105534.3DAFD23CF3@vcs0.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1520788223 18638 195.159.176.226 (11 Mar 2018 17:10:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Mar 2018 17:10:23 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 11 18:10:19 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 1ev4UC-0004ht-AS for ged-emacs-devel@m.gmane.org; Sun, 11 Mar 2018 18:10:16 +0100 Original-Received: from localhost ([::1]:55008 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ev4WF-0001Nu-Ag for ged-emacs-devel@m.gmane.org; Sun, 11 Mar 2018 13:12:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ev4Vg-0001NQ-7Z for emacs-devel@gnu.org; Sun, 11 Mar 2018 13:11:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ev4Vd-0004KB-24 for emacs-devel@gnu.org; Sun, 11 Mar 2018 13:11:48 -0400 Original-Received: from sinyavsky.aurox.ch ([37.35.109.145]:34424) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ev4Vc-0004JG-OX for emacs-devel@gnu.org; Sun, 11 Mar 2018 13:11:44 -0400 Original-Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id A37BC226C8 for ; Sun, 11 Mar 2018 17:12:23 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= references:subject:subject:in-reply-to:to:from:from:message-id :date:date; s=dkim; t=1520788340; x=1521652341; bh=ItaeLHMXcFWl2 A4sJR05jKHytrElfDCBdlOrTNYKwR4=; b=mSE8jQkD0FMRVItuJuyzZ73OoGkwe VR9rINxw2v/3UHCqoYZ+ZUO2O86IL2OCrfllZp8pKI3GfdekuXWeeJrJcbxARgB1 +Q+VHotvpaFr7GlZZ1lg/eb4uZ5QC8Tq3r7ZIsacTMXuj9YgmZwslgCNjTxUqu8L M5SwbTTxVkn5uU= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Original-Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id qQGitWBU7R3E for ; Sun, 11 Mar 2018 17:12:20 +0000 (UTC) Original-Received: from gray (125.85.192.178.dynamic.wline.res.cust.swisscom.ch [178.192.85.125]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id A99C6226BC; Sun, 11 Mar 2018 17:12:20 +0000 (UTC) In-reply-to: (message from Stefan Monnier on Sun, 11 Mar 2018 12:05:11 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 37.35.109.145 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:223622 Archived-At: > From: Stefan Monnier > Date: Sun, 11 Mar 2018 12:05:11 -0400 > > > -DEFUN ("transpose-regions", Ftranspose_regions, Stranspose_regions, 4, 5, 0, > > +DEFUN ("transpose-regions", Ftranspose_regions, Stranspose_regions, 4, 5, > > + "(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))))", > > Am I the only one who dislikes seeing such Elisp code hidden within our > C files? It's not great, no. (If anybody wants to move it to Lisp, feel free.) As a tangent, it would be interesting to automatically activate Emacs Lisp mode in the interactive argument of the DEFUN macro (if that is possible), as a trial for the "multi major mode" support that was recently brought up. Even if that does seem a bit contradictory w.r.t. what was expressed above. ;)