GNU bug report logs - #5189
BibTeX mode problems: non-existent directories, faulty regexp-opt

Previous Next

Package: emacs;

Reported by: Michael Ernst <michael.ernst <at> gmail.com>

Date: Sat, 12 Dec 2009 06:50:03 UTC

Severity: normal

Tags: moreinfo, unreproducible

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 5189 in the body.
You can then email your comments to 5189 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#5189; Package emacs. (Sat, 12 Dec 2009 06:50:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Ernst <michael.ernst <at> gmail.com>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sat, 12 Dec 2009 06:50:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Michael Ernst <michael.ernst <at> gmail.com>
To: Roland Winkler <roland.winkler <at> physik.uni-erlangen.de>
Cc: bug-gnu-emacs <bug-gnu-emacs <at> gnu.org>
Subject: BibTeX mode problems:  non-existent directories, faulty regexp-opt
Date: Fri, 11 Dec 2009 22:40:14 -0800 (PST)
bibtex.el uses regexp-opt, which introduces new capturing parentheses that
throw off variables like bibtex-type-in-head, which is a regexp
subexpression number.  (Really, regexp-opt should be rewritten to only use
non-capturing parentheses!)

The below patch corrects the problem.

                    -Michael Ernst


My patches are against:
  GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.18.3) of 2009-11-10 on vernadsky, modified by Debian
but the problem also exists in the Emacs CVS repository.

ChangeLog entry:

2009-12-11  Michael Ernst  <mernst <at> alum.mit.edu>

	* bibtex.el (bibtex-entry-type): Remove regexp-opt, which throws
	off regexp subexpression numbering.


diff -u /home/mernst/emacs/fixes/bibtex.el-orig /home/mernst/emacs/fixes/bibtex.el
--- /home/mernst/emacs/fixes/bibtex.el-orig	2009-12-11 22:13:59.000000000 -0800
+++ /home/mernst/emacs/fixes/bibtex.el	2009-12-11 22:15:28.000000000 -0800
@@ -1219,7 +1219,7 @@
 
 (defvar bibtex-entry-type
   (concat "@[ \t]*\\(?:"
-          (regexp-opt (mapcar 'car bibtex-entry-field-alist)) "\\)")
+          (mapconcat 'car bibtex-entry-field-alist "\\|") "\\)")
   "Regexp matching the type of a BibTeX entry.")
 
 (defvar bibtex-entry-head





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#5189; Package emacs. (Sat, 12 Dec 2009 16:00:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Roland Winkler" <Roland.Winkler <at> physik.uni-erlangen.de>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sat, 12 Dec 2009 16:00:05 GMT) Full text and rfc822 format available.

Message #10 received at 5189 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Roland Winkler" <Roland.Winkler <at> physik.uni-erlangen.de>
To: Michael Ernst <michael.ernst <at> gmail.com>
Cc: 5189 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: BibTeX mode problems:  non-existent directories, faulty regexp-opt
Date: Sat, 12 Dec 2009 09:53:19 -0600
Hi Michael

Thanks for the bug report!

First of all, I am including an email I recently got from Stefan
Monnier as it applies to your bug report, too. (Oh well, you are not
the only one doing this...)

(And I am CC'ing this email to 5189 <at> debbugs.gnu.org so
that hopefully we do not get yet more bug reports.)

On Sun Dec 6 2009 Stefan Monnier wrote:
> Please, please, pretty please don't ever Cc: to
> emacs-pretest-bug <at> gnu.org or bug-gnu-emacs <at> gnu.org: instead, send your
> email directly there and nowhere else.
> 
> It's not your fault, but this leads to messed up bug-reports if people
> reply to the message they got (and then Cc emacs-pretest-bug <at> gnu.org or
> bug-gnu-emacs <at> gnu.org along the way as well, thus creating more
> bug-reports in the tracker).
> 
> Hopefully we'll figure some way to address this brain-damage, but for
> now, we have to live with this restriction,

Now on your report:

> bibtex.el uses regexp-opt, which introduces new capturing
> parentheses that throw off variables like bibtex-type-in-head,
> which is a regexp subexpression number. (Really, regexp-opt should
> be rewritten to only use non-capturing parentheses!)

I cannot reproduce this. For me, regexp-opt does give "shy group"
constructs \(?: ... \) that work fine with subexpression numbers
like bibtex-type-in-head. Can you give a more specific test case
based on emacs --no-init-file that gives you incorrect behavior?
It appears to me that you might load some code that redefines
regexp-opt before loading bibtex-mode.

Also the subject line of your report mentions "non-existent
directories". Can you be more specific?

Roland



Added tag(s) unreproducible and moreinfo. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Mon, 14 Dec 2009 17:20:05 GMT) Full text and rfc822 format available.

Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Sun, 10 Jul 2011 01:32:02 GMT) Full text and rfc822 format available.

Notification sent to Michael Ernst <michael.ernst <at> gmail.com>:
bug acknowledged by developer. (Sun, 10 Jul 2011 01:32:03 GMT) Full text and rfc822 format available.

Message #17 received at 5189-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 5189-done <at> debbugs.gnu.org
Subject: Re: bug#5189: BibTeX mode problems:  non-existent directories,
	faulty regexp-opt
Date: Sat, 09 Jul 2011 21:31:52 -0400
This bug is being closed because it could not be reproduced and there
was no response to a request for more information.
If you reply with the requested information it can be reopened.

You can view the whole report at http://debbugs.gnu.org/BUGNUMBER

"Roland Winkler" wrote:

> I cannot reproduce this. For me, regexp-opt does give "shy group"
> constructs \(?: ... \) that work fine with subexpression numbers
> like bibtex-type-in-head. Can you give a more specific test case
> based on emacs --no-init-file that gives you incorrect behavior?
> It appears to me that you might load some code that redefines
> regexp-opt before loading bibtex-mode.
>
> Also the subject line of your report mentions "non-existent
> directories". Can you be more specific?




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 07 Aug 2011 11:24:21 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 14 days ago.

Previous Next


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