[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#9054: 24.0.50; show source in other window
From: |
Juri Linkov |
Subject: |
bug#9054: 24.0.50; show source in other window |
Date: |
Sun, 03 Oct 2021 20:36:25 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) |
>> 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.
I tried to add a new 'thing-at-point' target 'comment',
but then discovered that it's already supported by
(thing-at-point 'comment)
because it automatically calls '(forward-comment 1)' and '(forward-comment -1)'.
However, it seems currently 'forward-comment' is broken -
it does nothing inside comments. Maybe there is a bug?
Meanwhile, I moved Defun/List/Symbol selection items to prog-mode,
and added Paragraph/Sentence/Word selection items to text-mode
as well as to strings/comments in prog-mode. Please check
if everything is correct.
- bug#9054: 24.0.50; show source in other window,
Juri Linkov <=