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: Juri Linkov
Subject: bug#9054: 24.0.50; show source in other window
Date: Wed, 29 Sep 2021 20:47:48 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

>>> - In comments and strings it might be nice to advertise selecting the
>>>    entire comment or string.
>>
>> This is a great idea.  I missed such ability for a long time
>> to be able to select the entire string.  Now this is implemented
>> using a new thing-at-point target 'list-or-string'.
>
> And no such thing for comments?  Instead of
>
> (nth 3 (save-excursion (syntax-ppss pos)
>
> I'd use something like
>
> (let ((state (save-excursion (syntax-ppss pos))))
>   (cond
>    ((nth 3 state)
>     ... use (nth 8 state) and parse until end of string)
>    ((nth 4 state)
>     ... use (nth 8 state) and parse until end of comment)))
>
> and thus immediately get type, start and end of the syntactic entity at
> pos.

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)'.

>>> - Choosing All, in particular, will practically always relocate point
>>>    and scroll the window.  This might be confusing - many people might
>>>    not understand the combined effect of our "point is always visible"
>>>    and "point is at one end of the active region" paradigms - so we
>>>    should provide some way to retract that action and restore the window
>>>    point and start position afterwards.  Maybe None could do that by
>>>    default but where should List followed by Defun followed by None
>>>    scroll to?
>>
>> Good idea, but not implementable.  This supposes that selecting All
>> should remember the old position of point, then None could restore it.
>> But what if the user selected the entire buffer with the key 'C-x h',
>> then selected None?
>
> 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.





reply via email to

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