emacs-devel
[Top][All Lists]
Advanced

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

Re: Pushing the mark from a primitive like goto-char


From: Philipp Stephani
Subject: Re: Pushing the mark from a primitive like goto-char
Date: Tue, 5 Jan 2021 20:52:44 +0100

Am Di., 5. Jan. 2021 um 20:19 Uhr schrieb Stefan Monnier
<monnier@iro.umontreal.ca>:
>
> >>>> I'd then try to make it behave like 'M-g g' in this regard.
> >>>
> >>> Some interactive versions of low-level primitives have the suffix
> >>> `...-command' in their names, so a command like 'M-g g' and bound to
> >>> 'M-g c' could be named 'goto-char-command'.
> >>
> >> I was more concerned about not pushing the mark when the region is
> >> already active so one can use M-g c to extend the region.  BTW, is there
> >> a reason why 'goto-map' is so terribly unpopulated?
> >>
> >
> > This sounds like a good idea:
> >
> > - Create a 'goto-char-command' command in ELisp.
> >
> > - Move the interactive spec that is in 'goto-char' to this new command
> >   and make it push the mark smartly (e.g. be careful when a region is
> >   active).  Then call 'goto-char'.
> >
> > - Rebind 'M-g c' to 'goto-char-command'.
> >
> > - Announce the new command.
> >
> > What do you think? Could it break something? Thanks.
>
> Actually, now that I think about it: do we really need a new command, or
> can we instead arrange to do all the mark-handling from within the
> interactive spec?
>


I think that would be too confusing. The interactive specification
should only gather input, but not perform state changes.



reply via email to

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