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, 25 Mar 2018 22:29:29 +0200

> Date: Sun, 25 Mar 2018 18:41:47 +0300
> From: Eli Zaretskii <address@hidden>
>
> > >   . having it in C doesn't make hacking harder because one can always
> > >     override functions in Emacs, 
> > 
> > Good point.  Is this written in the Elisp manual anywhere?
> 
> Yes, it's documented where we describe 'defun':
> 
>      Be careful not to redefine existing functions unintentionally.
>      ‘defun’ redefines even primitive functions such as ‘car’ without
>      any hesitation or notification.  Emacs does not prevent you from
>      doing this, because redefining a function is sometimes done
>      deliberately, and there is no way to distinguish deliberate
>      redefinition from unintentional redefinition.

Thanks, this seems correct.
 
> > I searched for "override functions" and "override primitives" in the
> > index, but did not find a result.
> 
> I would index this as "redefining functions", at least in addition to
> "overriding", if not instead of it.

I think both are good, although an index entry for "overriding
functions" could also point to the "advice" documentation, since
"overriding" is a less precise term than "redefining".
 
> > Instead of defining transpose-regions (and its interactive spec) in
> > Lisp (as the reverted patch did), we could take the current
> > interactive spec of transpose-regions and use that to make a preloaded
> > function named "read-two-regions" in simple.el.  That would allow its
> > reuse by other commands, too.
> 
> Where would such a function be useful?

Nothing specific comes to mind.  There is one pair of commands that
already reads multiple regions: ediff-regions-linewise and -wordwise,
so it's not unlikely that there could be other applications.



reply via email to

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