emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master b88e7c8: Make transpose-regions interactive (Bu


From: Richard Copley
Subject: Re: [Emacs-diffs] master b88e7c8: Make transpose-regions interactive (Bug#30343)
Date: Thu, 15 Mar 2018 20:20:19 +0000



On 11 March 2018 at 18:13, Eli Zaretskii <address@hidden> wrote:
> From: Stefan Monnier <address@hidden>
> Date: Sun, 11 Mar 2018 12:05:11 -0400
> Cc: "Charles A. Roelli" <address@hidden>
>
> > -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.)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]