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

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

tabbar-mode breaks debugging with match data


From: Stephen Berman
Subject: tabbar-mode breaks debugging with match data
Date: Sun, 13 Mar 2005 21:57:35 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

First, I have to apologize to Richard and anyone else who took time
with my bug report under the subject "Debugging with match data": as
Richard implied and I now confirm, the bug I reported doesn't occur
with Emacs -Q.  My only excuse is that I really did think I had tested
it with Emacs -Q, but obviously must have misremembered.  However, to
my surprise, it turns out that tabbar-mode causes the bug.  Even
though tabbar.el <http://sourceforge.net/projects/emhacks/> is not
(yet) part of Emacs, I'm reporting it here both to follow up and
rectify my initial report and also because I believe David Ponce, the
author of tabbar.el, regular reads this list.  Here's the bug again,
in the proper context:

Start Emacs -Q
Load the file tabbar.el (version 1.46 is the latest from CVS)
Type `M-x tabbar-mode' to enable tabbar-mode
In *scratch* evalling this code:

(with-current-buffer (get-buffer-create "*test*")
    (switch-to-buffer "*test*")
    (insert  "My test string")
    (re-search-backward (concat "My " "\\(.+\\)" " string"))
    (insert "This is a " (match-string 1) "\.\n"))

results in a buffer *test* containing these lines:

This is a test.
My test string

Now go back to *scratch* and instrument the code for Edebug (C-u
M-C-x), then step through it.  The bug is that `(match-string 1)'
returns nil, which at the next step raises the error "Wrong type
argument: char-or-string-p, nil".  Disabling tabbar-mode (`M-x
tabbar-mode') and again stepping through the code with Edebug,
`(match-string 1)' now correctly returns "test" and the correct buffer
output results. The above code is just and example; as far I can tell,
any of the match data functions returns nil, i.e., it appears that the
match data are erased, or not saved, when tabbar-mode is enabled.

I don't have time right now to debug tabbar.el, so I hope David reads
this and is able to find the bug.  I make heavy use of tabbar.el and
think it would make a very good contribution to Emacs -- when this bug
is fixed!

Steve Berman





reply via email to

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