GNU bug report logs -
#32062
12.1.1; LaTeX-outline-name can't handle long lines or braces in titles
Previous Next
Reported by: Omar <omar.antolin <at> gmail.com>
Date: Thu, 5 Jul 2018 17:01:02 UTC
Severity: normal
Found in version 12.1.1
Done: Arash Esbati <arash <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Omar Antolín Camarena <omar.antolin <at> gmail.com> writes:
> The function you propose looks fine to me (I mean, it would, it's very
> similar to what I use!).
Thanks for your respone.
> I guess the point about (TeX-search-syntax-table ?\{ ?\}) is to be
> more lenient about mismatched non-brace delimiters? That's a good
> idea.
Exactly, so that a lonesome ] doesn't get in the way. One other
addition was the `replace-regexp-in-string' part in order to avoid
linebreaks in the Imenu. I think I will wait another day or two if
there are other comments and then install this version:
--8<---------------cut here---------------start------------->8---
(defun LaTeX-outline-name ()
"Guess a name for the current header line."
(save-excursion
(search-forward "{" nil t)
(let ((beg (point)))
(backward-char)
(condition-case nil
(with-syntax-table (TeX-search-syntax-table ?\{ ?\})
(forward-sexp)
(backward-char))
(error (forward-sentence)))
(replace-regexp-in-string "[\n\r][ ]*" " "
(buffer-substring beg (point))))))
--8<---------------cut here---------------end--------------->8---
Best, Arash
This bug report was last modified 1 year and 75 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.