GNU bug report logs -
#61400
Different filling for verbatim macros
Previous Next
Reported by: Arash Esbati <arash <at> gnu.org>
Date: Fri, 10 Feb 2023 08:53:01 UTC
Severity: normal
Done: Arash Esbati <arash <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
>>>>> Tassilo Horn <tsdh <at> gnu.org> writes:
>> It moves the point to different positions. In the example above, put
>> point after \path{bar} and do:
>>
>> M-: (fill-move-to-break-point (line-beginning-position)) RET
>>
>> and the point before and. Now go after \verb|bar| and do the same, no
>> is point after and. Can you reproduce this?
> Yes, I can.
I can as well.
> Hm, (fill-nobreak-p) returns nil only on the \ of the \verb|bar| but
> returns non-nil on each \ of the other verbatim macros. (I can't look
> any further now so it's your turn again. ;-))
I did repeated edebug and found that `LaTeX-verbatim-p' is the culprit.
When the point is just before \path{bar}, (LaTeX-verbatim-p) returns
non-nil and `fill-nobreak-bredicate' hook tells "Don't break here". On
the other hand, if the poinst is just before \verb|bar|,
(LaTeX-verbatim-p) returns nil.
Here is current definition of `LaTeX-verbatim-p':
,----
| (defun LaTeX-verbatim-p (&optional pos)
| "Return non-nil if position POS is in a verbatim-like construct."
| (when pos (goto-char pos))
| (save-match-data
| (or (progn
| (syntax-propertize (point))
| (nth 3 (syntax-ppss)))
| (member (LaTeX-current-verbatim-macro)
| (LaTeX-verbatim-macros-with-delims))
| (member (TeX-current-macro) (LaTeX-verbatim-macros-with-braces))
| (member (LaTeX-current-environment) (LaTeX-verbatim-environments)))))
`----
After all, the difference comes from subtle difference between
`LaTeX-current-verbatim-macro' and `TeX-current-macro'. When the point
is just before the leading backslash, they returns:
| path | verb |
-----------------------------+-------+-------|
LaTeX-current-verbatim-macro | "" | "" |
TeX-current-macro | "path"| "verb"|
In this context, it doesn't seem appropriate `TeX-current-macro' returns
non-nil.
Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
This bug report was last modified 2 years and 156 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.