Omar Antolín Camarena <[email protected]> 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



_______________________________________________
bug-auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-auctex

Reply via email to