unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#5189: BibTeX mode problems:  non-existent directories, faulty regexp-opt
@ 2009-12-12  6:40 Michael Ernst
  2009-12-12 15:53 ` Roland Winkler
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Ernst @ 2009-12-12  6:40 UTC (permalink / raw)
  To: Roland Winkler; +Cc: bug-gnu-emacs

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@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







^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#5189: BibTeX mode problems:  non-existent directories, faulty regexp-opt
  2009-12-12  6:40 bug#5189: BibTeX mode problems: non-existent directories, faulty regexp-opt Michael Ernst
@ 2009-12-12 15:53 ` Roland Winkler
  2011-07-10  1:31   ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: Roland Winkler @ 2009-12-12 15:53 UTC (permalink / raw)
  To: Michael Ernst; +Cc: 5189

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@emacsbugs.donarmstrong.com 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@gnu.org or bug-gnu-emacs@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@gnu.org or
> bug-gnu-emacs@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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#5189: BibTeX mode problems:  non-existent directories, faulty regexp-opt
  2009-12-12 15:53 ` Roland Winkler
@ 2011-07-10  1:31   ` Glenn Morris
  0 siblings, 0 replies; 3+ messages in thread
From: Glenn Morris @ 2011-07-10  1:31 UTC (permalink / raw)
  To: 5189-done


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?





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-10  1:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-12  6:40 bug#5189: BibTeX mode problems: non-existent directories, faulty regexp-opt Michael Ernst
2009-12-12 15:53 ` Roland Winkler
2011-07-10  1:31   ` Glenn Morris

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).