emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#22077: closed (Possible bug in `reftex-what-index-


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#22077: closed (Possible bug in `reftex-what-index-tag')
Date: Fri, 04 Dec 2015 20:16:02 +0000

Your message dated Fri, 04 Dec 2015 21:15:19 +0100
with message-id <address@hidden>
and subject line Re: bug#22077: Possible bug in `reftex-what-index-tag'
has caused the debbugs.gnu.org bug report #22077,
regarding Possible bug in `reftex-what-index-tag'
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
22077: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22077
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Possible bug in `reftex-what-index-tag' Date: Wed, 02 Dec 2015 22:33:53 +0100 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5
Hi all,

please consider the following example:

--8<---------------cut here---------------start------------->8---
\documentclass{article}

\usepackage{index}
\newindex{aut}{adx}{and}{Name Index}

\begin{document}
`C-c C-m index RET aut RET' enters `\index[aut]' in buffer
and exits with `(wrong-type-argument integer-or-marker-p nil)'.
\end{document}
--8<---------------cut here---------------end--------------->8---

Debugger says:

--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  reftex-what-index-tag()
  TeX-arg-index(nil)
  TeX-parse-argument(nil TeX-arg-index)
  TeX-parse-arguments(([TeX-arg-index-tag] TeX-arg-index))
  TeX-parse-macro("index" ([TeX-arg-index-tag] TeX-arg-index))
  TeX-insert-macro("index")
  call-interactively(TeX-insert-macro nil nil)
  command-execute(TeX-insert-macro)
--8<---------------cut here---------------end--------------->8---

If I get this correctly, the problem is in `(match-end 1)' part of
`reftex-what-index-tag' defined in `reftex-auc.el':

--8<---------------cut here---------------start------------->8---
(defun reftex-what-index-tag ()
  ;; Look backward to find out what index the macro at point belongs to
  (let ((macro (save-excursion
                 (and (re-search-backward "\\\\[a-zA-Z*]+" nil t)
                      (match-string 0))))
        tag entry)
    (when (and macro
               (setq entry (assoc macro reftex-index-macro-alist)))
      (setq tag (nth 1 entry))
      (cond
       ((stringp tag) tag)
       ((integerp tag)
        (save-excursion
          (goto-char (match-end 1))
          (or (reftex-nth-arg tag (nth 6 entry)) "idx")))
       (t "idx")))))
--8<---------------cut here---------------end--------------->8---

I think it should be `(match-end 0)' since the last search had no
parenthesized expression in regexp.  In short:

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/textmodes/reftex-auc.el b/lisp/textmodes/reftex-auc.el
index bbad065..151be59 100644
--- a/lisp/textmodes/reftex-auc.el
+++ b/lisp/textmodes/reftex-auc.el
@@ -137,7 +137,7 @@ reftex-what-index-tag
        ((stringp tag) tag)
        ((integerp tag)
         (save-excursion
-          (goto-char (match-end 1))
+          (goto-char (match-end 0))
           (or (reftex-nth-arg tag (nth 6 entry)) "idx")))
        (t "idx")))))
--8<---------------cut here---------------end--------------->8---

Any comments?  I could make a proper patch for this.

Best, Arash




--- End Message ---
--- Begin Message --- Subject: Re: bug#22077: Possible bug in `reftex-what-index-tag' Date: Fri, 04 Dec 2015 21:15:19 +0100 User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux)
Ups, forgotten to close...

Bye,
Tassilo


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]