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: Karl Fogel
Subject: Re: [Emacs-diffs] master b88e7c8: Make transpose-regions interactive (Bug#30343)
Date: Fri, 16 Mar 2018 10:23:31 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Richard Copley <address@hidden> writes:
>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.)

One solution would be to rename the C-defined function to 
Ftranspose_regions_internal (with no interactive spec), and move the entry 
point `transpose-regions' out to Lisp with the same interactive spec.  The Lisp 
function would just invoke `transpose-regions-internal'.

I'd be happy to do this, if there's consensus that it's a good solution.  

(I wrote the original non-interactive Ftranspose_regions, so am perhaps 
motivated by nostalgia.  Interestingly, while checking my memory to make sure, 
I discovered that although src/ChangeLog.4 has the correct record for 
1994-04-29, in the git history that change is recorded as being authored by RMS 
-- commit b229b8d187a.  This suggests that there was some information lossage 
in a VC-system conversion somewhere along the way.  I don't know if we knew 
that already or not.)

I looked for all other C-defined functions that have a Lisp expression starting 
with "(" for their interactive spec in the DEFUN, i.e., are not just using the 
standard code-letter strings for `interactive'.  There appear to be a very 
small number of such functions:

  - Finsert_char
  - Ftranspose_regions
  - Frename_buffer
  - Fupcase_region
  - Fdowncase_region
  - Fdelete_file
  - Fset_file_modes

Of these, Ftranspose_regions is certainly the most complex, with Fdelete_file 
and Frename_buffer as runners up.  The others are relatively simple.  Maybe 
it's fine to just rely on our collective aesthetic judgement to say that the 
one in Ftranspose_regions is too complex to be tolerated, while the others are 
okay.

Best regards,
-Karl



reply via email to

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