From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Richard Copley Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master b88e7c8: Make transpose-regions interactive (Bug#30343) Date: Thu, 15 Mar 2018 20:20:19 +0000 Message-ID: References: <20180311105533.30002.78782@vcs0.savannah.gnu.org> <20180311105534.3DAFD23CF3@vcs0.savannah.gnu.org> <83woyiscns.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a113d307a4ed2be0567793a3b" X-Trace: blaine.gmane.org 1521145140 13556 195.159.176.226 (15 Mar 2018 20:19:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 15 Mar 2018 20:19:00 +0000 (UTC) Cc: charles@aurox.ch, Stefan Monnier , Emacs Development To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 15 21:18:56 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 1ewZKx-0003QQ-FF for ged-emacs-devel@m.gmane.org; Thu, 15 Mar 2018 21:18:55 +0100 Original-Received: from localhost ([::1]:53223 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewZN0-0001Im-M3 for ged-emacs-devel@m.gmane.org; Thu, 15 Mar 2018 16:21:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40263) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewZMt-0001IU-OR for emacs-devel@gnu.org; Thu, 15 Mar 2018 16:20:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ewZMs-0007Lk-Nd for emacs-devel@gnu.org; Thu, 15 Mar 2018 16:20:55 -0400 Original-Received: from mail-oi0-x232.google.com ([2607:f8b0:4003:c06::232]:39951) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ewZMp-0007IP-Ro; Thu, 15 Mar 2018 16:20:51 -0400 Original-Received: by mail-oi0-x232.google.com with SMTP id c12so6815084oic.7; Thu, 15 Mar 2018 13:20:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=uOT/9JBHRo190DXE2Uc2R4OTDp3ebOVm6Xj03wi8xRM=; b=ZycZxWIduT5yWsZFRraoNXXDgB2uj0dS86j9HQwMR7C3FqQq4WM4jm5eCYURHJ9Dmt nYFYp4VvmbcRQniKE9DY99/Cfh0PhywOdjzVl9pctdOKeGJUsRj+C4E/TElmRrEeXuKS CReYiyXVvOiQKjA/rdakfQwbXIIzmk1pcead5W+92wYdVaBx6VShl0rUmPpaLmlNFM4h KU+hvcY4/FqCvZmYR1aZeWUResT39SHkrcEusSFHfhhUpAB8qIzrjuOeBUgDc0/21qwj YgEOSsJtAIcgTh7PRMTeP8EXE0KcOucap+NEHWHBqznmwfyBXULuw1YhQsB2LgmJi6L+ dFCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=uOT/9JBHRo190DXE2Uc2R4OTDp3ebOVm6Xj03wi8xRM=; b=lFhx1e/M5PGbc4dkrnsYG4zpq+uC+FqOMvBhMscMgHiTnwnEwgdacAY11tbqHKjHji TGJektlYLK/DAo8ZmB1fzyNB9eRx1gM2nTYvYQmZqBIrEcPNwyHFo7K4AmdVdsUxsHYz Ls4513OPcD/PUnr5DLWRRtegIuPzIjbV3QP/NP2Embgp0yWG5dT/YOE/A0UC042GJ6gs 9XsnEnl8s4SZYhBO/RdM3ESg3yg8pABUwvEHgNIpURtJAjSBlL1djJ00bOpdjEtUEnyO CxqLIgGKI8WbSEY0eT4McLHDvvNREC6HangnmNe4oj4eIT7BgHCO+pZqRRRp5uKyrmjs RrpA== X-Gm-Message-State: AElRT7ETa9knzaisg/NXzkBlPOcTg6j2CjJeXRxfXaHgqHIOIxZFVQ2G SE86S6FJUF/MMCgBC6u7G+Zu4ceC9oWENkKGn7D6ZsUJ X-Google-Smtp-Source: AG47ELuPfMfBbA4rUkWan+xPZbwATEPEhRiBizhTCxXhAi5LjylQhMGLHlshMkloEQyjBlgXYx5FSsuO07SHQHHAztc= X-Received: by 10.202.88.135 with SMTP id m129mr5706570oib.106.1521145250499; Thu, 15 Mar 2018 13:20:50 -0700 (PDT) Original-Received: by 2002:a9d:44ce:0:0:0:0:0 with HTTP; Thu, 15 Mar 2018 13:20:19 -0700 (PDT) In-Reply-To: <83woyiscns.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::232 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:223767 Archived-At: --001a113d307a4ed2be0567793a3b Content-Type: text/plain; charset="UTF-8" On 11 March 2018 at 18:13, Eli Zaretskii wrote: > > From: Stefan Monnier > > Date: Sun, 11 Mar 2018 12:05:11 -0400 > > Cc: "Charles A. Roelli" > > > > > -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? > > I have no problems with that. > > I agree with Eli, it seems fine to me, but I'm not sure what the alternative is. If it's to move the body of the interactive spec into a function in an elisp file, and replace the spec with a call to that function, it seems overly complicated. (It also feel like a layering violation, but that can only be true if there is a rule or guideline saying so and I don't know of any.) --001a113d307a4ed2be0567793a3b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On 11 March 2018 at 18:13, Eli Zaretskii <eliz@gnu.org> wrot= e:
> From: Stefan Monnier <monnier@IRO.UMontreal.CA>
> Date: Sun, 11 Mar 2018 12:05:11 -0400
> Cc: "Charles A. Roelli" <charles@aurox.ch>
>
> > -DEFUN ("transpose-regions", Ftranspose_regions, Strans= pose_regions, 4, 5, 0,
> > +DEFUN ("transpose-regions", Ftranspose_regions, Strans= pose_regions, 4, 5,
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0"(if (< (length mark-ring) 2)= \
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0(error \"Other region must be ma= rked before transposing two regions\")\
> > +=C2=A0 =C2=A0 =C2=A0(let* ((num (if current-prefix-arg\
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 (prefix-numeric-value current-prefix-arg)\
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A00))\
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (ring-length (length m= ark-ring))\
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (eltnum (mod num ring-= length))\
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (eltnum2 (mod (1+ num)= ring-length)))\
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0(list (point) (mark) (elt mark-ring e= ltnum) (elt mark-ring eltnum2))))",
>
> Am I the only one who dislikes seeing such Elisp code hidden within ou= r
> C files?

I have no problems with that.

=C2=A0
I agree with Eli, it seems fine to me, but I'm not = sure what the
alternative is. If it's to move the body of the intera= ctive spec into
a function in an elisp file, and replace the spec with a= call to that
function, it seems overly complicated. (It also feel like = a layering
violation, but that can only be true if there is a rule or gu= ideline
saying so and I don't know of any.)
--001a113d307a4ed2be0567793a3b--