[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: |
Mon, 04 Oct 2021 20:28:17 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) |
>> 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?
>
> IIUC 'forward-comment' is context-agnostic - you can safely use it only
> at top level. So in the case at hand you would have to run it from the
> 8th element of the return value of 'syntax-ppss'. That's why I would
> run 'syntax-ppss' from the current mouse position using the return value
> of 'syntax-ppss' as OLDSTATE to avoid scanning text twice.
It still needs to scan twice because for thing-at-point it should be
implemented as two functions:
(put 'comment 'beginning-op 'thing-at-point--beginning-of-comment)
(put 'comment 'end-op 'thing-at-point--end-of-comment)
> BTW, I've recently seen this
>
> Debugger entered--Lisp error: (args-out-of-range #<buffer *Help*> 1 2461677)
> parse-partial-sexp(1 2461677)
> syntax-ppss(2461677)
> context-menu-region((keymap #("Context Menu" 0 12 (hide t))
> context-menu-map()
> describe-buffer-bindings(#<buffer *info*> nil)
> describe-bindings()
> funcall-interactively(describe-bindings)
> call-interactively(describe-bindings nil nil)
> command-execute(describe-bindings)
>
> Any ideas as to what could have happened here? I must have been hitting
> C-h b by accident - as a rule I never call 'describe-bindings' - but
> 2461677 looks slightly preposterous ...
It seems you still using old source code? Because recently this was fixed
in event-end to use (window-point).