GNU bug report logs - #32062
12.1.1; LaTeX-outline-name can't handle long lines or braces in titles

Previous Next

Package: auctex;

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


Message #11 received at 32062 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Omar Antolín Camarena <omar.antolin <at> gmail.com>
Cc: 32062 <at> debbugs.gnu.org
Subject: Re: bug#32062: 12.1.1; LaTeX-outline-name can't handle long lines
 or braces in titles
Date: Wed, 06 Mar 2024 14:48:56 +0100
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 74 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.