all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Ernst <michael.ernst@gmail.com>
To: Roland Winkler <roland.winkler@physik.uni-erlangen.de>
Cc: bug-gnu-emacs <bug-gnu-emacs@gnu.org>
Subject: bug#5189: BibTeX mode problems:  non-existent directories, faulty regexp-opt
Date: Fri, 11 Dec 2009 22:40:14 -0800 (PST)	[thread overview]
Message-ID: <20091211.224014.140377569.michael.ernst@gmail.com> (raw)

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







             reply	other threads:[~2009-12-12  6:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-12  6:40 Michael Ernst [this message]
2009-12-12 15:53 ` bug#5189: BibTeX mode problems: non-existent directories, faulty regexp-opt Roland Winkler
2011-07-10  1:31   ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091211.224014.140377569.michael.ernst@gmail.com \
    --to=michael.ernst@gmail.com \
    --cc=5189@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=roland.winkler@physik.uni-erlangen.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.