bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#9054: 24.0.50; show source in other window


From: martin rudalics
Subject: bug#9054: 24.0.50; show source in other window
Date: Thu, 30 Sep 2021 18:18:44 +0200

> I tried to implement the 'thing' for comments, but can't find a function
> that moves to the end of the comment.  In case of string, such function is
> simply '(forward-sexp)'.

It's 'parse-partial-sexp' with OLDSTATE the state just produced by
'syntax-ppss' and COMMENTSTOP set to 'syntax-table'.  Same for the
string case.  I'd do it lazily since the context menu is modal and it's
unlikely that some timer-based function changes the buffer under its
feet.  Thus save the old state while the menu is active and do the call
when the user wants to mark the comment or string.

>> What would be bad about that?  Anyway, you could add some variable you'd
>> set via 'All' or whatever causes pos to move off-screen and have 'None'
>> inspect that flag to tell whether it should go back.  Clearing the active
>> region would clear that variable too.
>
> But there are too many ways to clear the active region.

Hmm...  The original position would be the one before the region was
made active.  Then you may expand the active region in various ways.
When it's deactivated without deleting the text it contains, go back to
the original position.  But maybe I'm missing some detail.

martin





reply via email to

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