GNU bug report logs - #16881
24.3.50; line 584 of tex-mode.el [^'\">{]+ is not working correctly

Previous Next

Package: emacs;

Reported by: Keith David Bershatsky <esq <at> lawlist.com>

Date: Tue, 25 Feb 2014 17:45:02 UTC

Severity: minor

Found in version 24.3.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.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 16881 in the body.
You can then email your comments to 16881 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-gnu-emacs <at> gnu.org:
bug#16881; Package emacs. (Tue, 25 Feb 2014 17:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Keith David Bershatsky <esq <at> lawlist.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 25 Feb 2014 17:45:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Keith David Bershatsky <esq <at> lawlist.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; line 584 of tex-mode.el [^'\">{]+ is not working correctly
Date: Tue, 25 Feb 2014 09:44:16 -0800
Lines 583 to to 586 of tex-mode.el contain a regexp for ``TeX'' quotes.

``This example works.''

``This example doesn't work.''

The problem is caused by line 584 of tex-mode.el:  "[^'\">{]+"

When concatenated, the current regexp looks like this:

\\(\"[<`]\\|<<\\|``\\|«\\)[^'\">{]+\\(\"['>]\\|''\\|>>\\|»\\)

If the author intended this regexp to permit an apostrophe within quoted text, then the regexp is broken.  In my opinion, the regexp should be fixed to permit an apostrophe within the quoted text.

One possible solution would be to replace line 584 of tex-mode.el with something like:  "\\(.*\\)"

Inasmuch as this regexp is being examined at this time, please consider also having different colors for the beginning and ending quotes:

  (list (concat (regexp-opt `("``" "\"<" "\"`" "<<" "«") t)
          "\\(.*\\)"
          (regexp-opt `("''" "\">" "\"'" ">>" "»") t))
       '(1 font-lock-keyword-face)
       '(2 font-lock-string-face)
       '(3 font-lock-keyword-face))

Thanks,

Keith

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

In GNU Emacs 24.3.50.1 (x86_64-apple-darwin10.8.0, NS apple-appkit-1038.36)
 of 2014-02-16 on MP.local
Repository revision: 116453 michael.albinus <at> gmx.de-20140216172300-zwab4d5ltv4hbpot
Windowing system distributor `Apple', version 10.3.1038
Configured using:
 `configure --with-ns'

Important settings:
  locale-coding-system: utf-8-unix

Major mode: Text

Minor modes in effect:
  whitespace-mode: t
  linum-mode: t
  hl-line-mode: t
  lawlist-delete-selection-mode: t
  global-lawlist-scroll-bar-mode: t
  lawlist-scroll-bar-mode: t
  flyspell-mode: t
  shell-dirtrack-mode: t
  desktop-save-mode: t
  tabbar-mode: t
  highlight-parentheses-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  visual-line-mode: t
  transient-mark-mode: t

Recent input:
<escape> x t x <backspace> e x - m o d e C-g <escape> 
x l o a d - l i b r a r y <return> t e x - m o d e 
<return> <escape> x s-v C-g C-h v s-v <return> <C-M-s-f11> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> s-f s t r 
i n g <escape> <s-left> <left> <left> <left> <M-left> 
<M-left> <M-left> <M-left> <M-left> <M-left> <M-left> 
<left> <right> <S-s-left> <S-right> <S-right> <S-right> 
s-c s-w <escape> x C-g s-v <s-left> <return> <return> 
<up> <up> T h i s SPC e x a m p l e SPC w o r k s . 
<s-left> ` ` <s-right> ' ' <return> <return> ` ` T 
h i s SPC e x a m p l e SPC d o e s n ' t SPC w o r 
k . ' ' <down> <right> <S-s-right> s-c <escape> x r 
e - b u i l d e r <return> s-v <M-left> <M-left> <M-left> 
<M-left> <M-left> <M-left> <M-left> <M-left> <M-left> 
<right> <right> <M-S-left> <M-S-left> <M-S-left> <M-S-left> 
<S-left> <S-left> <S-left> <S-left> s-c <M-S-right> 
<M-S-right> <M-S-right> <M-S-right> <M-S-right> <M-S-right> 
<S-right> <S-right> . * <down-mouse-1> <mouse-1> <down-mouse-1> 
<mouse-1> <s-right> <return> <return> <return> s-v 
<return> <return> v a r i a b l e : SPC SPC s-v <up> 
<up> <up> <return> l i n e SPC 5 8 4 : SPC SPC <backspace> 
<backspace> <backspace> SPC o f SPC t e x - m o d e 
. e l : SPC SPC <kp-delete> <escape> x r e p o r t 
<return> <return> b u g <return>

Recent messages:
3 matches
Mark set
Saving file /Users/HOME/.0.data/.0.emacs/.scratch...
Wrote /Users/HOME/.0.data/.0.emacs/.scratch
Mark set
Saving file /Users/HOME/.0.data/.0.emacs/.scratch...
Wrote /Users/HOME/.0.data/.0.emacs/.scratch
Saving file /Users/HOME/.0.data/.0.emacs/.scratch...
Wrote /Users/HOME/.0.data/.0.emacs/.scratch
Making completion list...

Load-path shadows:
/Users/HOME/.0.data/.0.emacs/elpa/flim/md4 hides /Users/HOME/.0.data/.0.emacs/Emacs_02_16_2014.app/Contents/Resources/lisp/md4
/Users/HOME/.0.data/.0.emacs/elpa/flim/hex-util hides /Users/HOME/.0.data/.0.emacs/Emacs_02_16_2014.app/Contents/Resources/lisp/hex-util
/Users/HOME/.0.data/.0.emacs/elpa/flim/sasl hides /Users/HOME/.0.data/.0.emacs/Emacs_02_16_2014.app/Contents/Resources/lisp/net/sasl
/Users/HOME/.0.data/.0.emacs/elpa/flim/sasl-ntlm hides /Users/HOME/.0.data/.0.emacs/Emacs_02_16_2014.app/Contents/Resources/lisp/net/sasl-ntlm
/Users/HOME/.0.data/.0.emacs/elpa/flim/sasl-digest hides /Users/HOME/.0.data/.0.emacs/Emacs_02_16_2014.app/Contents/Resources/lisp/net/sasl-digest
/Users/HOME/.0.data/.0.emacs/elpa/flim/sasl-cram hides /Users/HOME/.0.data/.0.emacs/Emacs_02_16_2014.app/Contents/Resources/lisp/net/sasl-cram
/Users/HOME/.0.data/.0.emacs/elpa/flim/ntlm hides /Users/HOME/.0.data/.0.emacs/Emacs_02_16_2014.app/Contents/Resources/lisp/net/ntlm
/Users/HOME/.0.data/.0.emacs/elpa/flim/hmac-md5 hides /Users/HOME/.0.data/.0.emacs/Emacs_02_16_2014.app/Contents/Resources/lisp/net/hmac-md5
/Users/HOME/.0.data/.0.emacs/elpa/flim/hmac-def hides /Users/HOME/.0.data/.0.emacs/Emacs_02_16_2014.app/Contents/Resources/lisp/net/hmac-def
/Users/HOME/.0.data/.0.emacs/elpa/wanderlust/rfc2368 hides /Users/HOME/.0.data/.0.emacs/Emacs_02_16_2014.app/Contents/Resources/lisp/mail/rfc2368
/Users/HOME/.0.data/.0.emacs/elpa/wanderlust/utf7 hides /Users/HOME/.0.data/.0.emacs/Emacs_02_16_2014.app/Contents/Resources/lisp/gnus/utf7
/Users/HOME/.0.data/.0.emacs/elpa/semi/smime hides /Users/HOME/.0.data/.0.emacs/Emacs_02_16_2014.app/Contents/Resources/lisp/gnus/smime
/Users/HOME/.0.data/.0.emacs/elpa/semi/pgg hides /Users/HOME/.0.data/.0.emacs/Emacs_02_16_2014.app/Contents/Resources/lisp/obsolete/pgg
/Users/HOME/.0.data/.0.emacs/elpa/semi/pgg-pgp5 hides /Users/HOME/.0.data/.0.emacs/Emacs_02_16_2014.app/Contents/Resources/lisp/obsolete/pgg-pgp5
/Users/HOME/.0.data/.0.emacs/elpa/semi/pgg-pgp hides /Users/HOME/.0.data/.0.emacs/Emacs_02_16_2014.app/Contents/Resources/lisp/obsolete/pgg-pgp
/Users/HOME/.0.data/.0.emacs/elpa/semi/pgg-parse hides /Users/HOME/.0.data/.0.emacs/Emacs_02_16_2014.app/Contents/Resources/lisp/obsolete/pgg-parse
/Users/HOME/.0.data/.0.emacs/elpa/semi/pgg-gpg hides /Users/HOME/.0.data/.0.emacs/Emacs_02_16_2014.app/Contents/Resources/lisp/obsolete/pgg-gpg
/Users/HOME/.0.data/.0.emacs/elpa/semi/pgg-def hides /Users/HOME/.0.data/.0.emacs/Emacs_02_16_2014.app/Contents/Resources/lisp/obsolete/pgg-def
/Users/HOME/.0.data/.0.emacs/elpa/utilities/longlines hides /Users/HOME/.0.data/.0.emacs/Emacs_02_16_2014.app/Contents/Resources/lisp/obsolete/longlines

Features:
(shadow wl-mime mime-edit pgg-parse pccl pccl-20 signature mime-setup
mail-mime-setup semi-setup mime-pgp pgg-def mime-play filename
mime-image modb-standard elmo-imap4 time-stamp emacsbug re-builder
misearch multi-isearch tex-mode bbdb-autoloads init-wl wl-demo
wl-draft eword-encode wl-template sendmail elmo-net elmo-cache
elmo-map elmo-dop wl-news wl-address wl-thread wl-folder wl wl-e21
wl-spam wl-action wl-summary wl-refile wl-util pp elmo-flag
elmo-localdir wl-message elmo-mime mmelmo-buffer mmelmo-imap mime-view
mime-conf calist semi-def mmimap mime-parse mmbuffer mmgeneric
elmo-multi elmo-spam elsp-header elsp-generic elmo elmo-signal
wl-highlight wl-vars wl-version epg-config elmo-msgdb modb
modb-generic modb-entity luna mime elmo-util emu invisible inv-23 poem
poem-e20 poem-e20_3 utf7 eword-decode mel mime-def alist std11
mcharset mcs-20 mcs-e20 pces pces-e20 pces-20 broken pcustom elmo-date
elmo-vars elmo-version path-util poe pym static apel-ver product
w3m-load mime-w3m w3m browse-url doc-view jka-compr image-mode
w3m-hist w3m-fb bookmark-w3m w3m-ems w3m-ccl ccl w3m-favicon w3m-image
w3m-proc w3m-util disp-table whitespace linum hl-line
multiple-cursors-autoloads package savehist lawlist-calculator
ps-print ps-def lpr flyspell ispell auto-save-buffers-enhanced bbdb
timezone find-func dired-aux dired yasnippet help-mode
multiple-cursors mc-separate-operations rectangular-region-mode
mc-mark-more thingatpt mc-cycle-cursors mc-edit-lines
multiple-cursors-core rect saveplace lawlist-tex-mode pcase compile
shell pcomplete comint ansi-color ring skeleton compare-w desktop
frameset init-tabbar tabbar lawlist-org lawlist-calendar advice
edmacro kmacro derived org-toodledo mailcap-toodledo lawlist-tls
http-post-simple url-http tls url-auth url-gw url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util url-parse auth-source eieio byte-opt bytecomp byte-compile
cconv eieio-core password-cache url-vars mailcap json xml w3mexcerpt
noutline outline easy-mmode gnus-sum nnoo gnus-group gnus-undo nnmail
mail-source gnus-start gnus-spec gnus-int gnus-range message cl-macs
gv format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev
gmm-utils mailheader gnus-win gnus gnus-ems nnheader gnus-util
mail-utils mm-util help-fns mail-prsvr wid-edit cl cl-loaddefs cl-lib
highlight-parentheses redo time-date tooltip electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode
register page menu-bar rfn-eshadow timer select scroll-bar mouse
jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
cocoa ns multi-tty emacs)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16881; Package emacs. (Wed, 26 Feb 2014 00:52:02 GMT) Full text and rfc822 format available.

Message #8 received at 16881 <at> debbugs.gnu.org (full text, mbox):

From: Keith David Bershatsky <esq <at> lawlist.com>
To: 16881 <at> debbugs.gnu.org
Subject: Re:  bug#16881: Acknowledgement (24.3.50;
 line 584 of tex-mode.el [^'\">{]+ is not working correctly)
Date: Tue, 25 Feb 2014 16:51:02 -0800
The proposed new regexp that I submitted with my initial bug report was much too broad -- i.e., it did not stop at the first pair of ending quotes.

Here is a revised draft which seems to be working better:

  ;; Text between `` quotes ''.
  (list (concat (regexp-opt `("``" "\"<" "\"`" "<<" "«") t)
          "\\(\\(.\\|\n\\)+?\\)"
          (regexp-opt `("''" "\">" "\"'" ">>" "»") t))
       '(1 font-lock-keyword-face)
       '(2 font-lock-string-face)
       '(4 font-lock-keyword-face))

Thanks,

Keith




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16881; Package emacs. (Sat, 29 May 2021 11:47:02 GMT) Full text and rfc822 format available.

Message #11 received at 16881 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Keith David Bershatsky <esq <at> lawlist.com>
Cc: 16881 <at> debbugs.gnu.org
Subject: Re: bug#16881: 24.3.50; line 584 of tex-mode.el [^'\">{]+ is not
 working correctly
Date: Sat, 29 May 2021 13:46:27 +0200
Keith David Bershatsky <esq <at> lawlist.com> writes:

> The proposed new regexp that I submitted with my initial bug report was much too broad -- i.e., it did not stop at the first pair of ending quotes.
>
> Here is a revised draft which seems to be working better:
>
>   ;; Text between `` quotes ''.
>   (list (concat (regexp-opt `("``" "\"<" "\"`" "<<" "«") t)
>           "\\(\\(.\\|\n\\)+?\\)"
>           (regexp-opt `("''" "\">" "\"'" ">>" "»") t))
>        '(1 font-lock-keyword-face)
>        '(2 font-lock-string-face)
>        '(4 font-lock-keyword-face))

Thanks; I pushed this change to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 16881 <at> debbugs.gnu.org and Keith David Bershatsky <esq <at> lawlist.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 29 May 2021 11:47:02 GMT) Full text and rfc822 format available.

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

This bug report was last modified 2 years and 302 days ago.

Previous Next


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