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: Charles A. Roelli
Subject: Re: [Emacs-diffs] master b88e7c8: Make transpose-regions interactive (Bug#30343)
Date: Sun, 11 Mar 2018 18:23:13 +0100

> From: Stefan Monnier <address@hidden>
> 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. ;)



reply via email to

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