unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#21154: 24.5.50; LaTeX mode complains about mismatched parentheses on end commands
@ 2015-07-29  0:43 Jeff Clough
  2016-04-30 12:13 ` Marcin Borkowski
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Clough @ 2015-07-29  0:43 UTC (permalink / raw)
  To: 21154


When writing LaTeX, typing the closing curly brace of an end
command (\end{document} for instance) causes a "Mismatched parentheses"
complaint to appear in the minibuffer, even when this seems to be false.

Steps to reproduce:

Create a new ".tex" file with the following contents (note the missing
curly brace at the very end...

\documentclass{article}
\begin{document}
\end{document

Watch the minibuffer, type the closing curly brace, and witness the
complaint. The only ever appears to happen on an end command, and it
happens on every single end command no matter where it appears.



In GNU Emacs 24.5.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8)
 of 2015-07-02 on jeff-Inspiron-3537
Repository revision: a5e6f33b4c8222ad62fdd7ff4bb0f8c5fac432c1
Windowing system distributor `The X.Org Foundation', version 11.0.11600000
System Description:	Ubuntu 14.04.2 LTS

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Shell

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  global-visual-line-mode: t
  visual-line-mode: t
  transient-mark-mode: t

Recent messages:
Reading active file via nndraft...done
Checking new news...done
No news is good news
Are you sure you want to quit reading news? (y or n) y
Saving file /home/jeff/.newsrc...
Wrote /home/jeff/.newsrc
Saving /home/jeff/.newsrc.eld...
Saving file /home/jeff/.newsrc.eld...
Wrote /home/jeff/.newsrc.eld
Saving /home/jeff/.newsrc.eld...done

Load-path shadows:
None found.

Features:
(shadow emacsbug mule-util smiley gnus-cite gnus-async gnus-bcklg
gnus-draft gnus-ml pcmpl-unix mailalias mail-extr sort nndraft nnmh
nnfolder utf-7 gnutls network-stream starttls nnimap parse-time tls utf7
netrc gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg
gnus-art mm-uu mml2015 epg-config mm-view mml-smime smime dig mailcap
nntp gnus-cache gnus-sum nnoo gnus-group gnus-undo nnmail mail-source
smtpmail auth-source eieio byte-opt bytecomp byte-compile cl-extra cconv
eieio-core password-cache sendmail gnus-start gnus-spec gnus-int
gnus-range message rfc822 mml 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
mail-prsvr wid-edit manoj-dark-theme ob-sh shell ob-python server
web-mode advice help-fns derived disp-table ox-odt rng-loc rng-uri
rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns
nxml-enc xmltok nxml-util ox-latex ox-icalendar ox-html ox-ascii
ox-publish ox org-element edmacro kmacro cl-loaddefs cl-lib org
org-macro org-footnote org-pcomplete pcomplete org-list org-faces
org-entities noutline outline easy-mmode org-version ob-emacs-lisp ob
ob-tangle ob-ref ob-lob ob-table ob-exp org-src ob-keys ob-comint comint
ansi-color ring ob-core ob-eval org-compat org-macs org-loaddefs
format-spec find-func cal-menu easymenu calendar cal-loaddefs time-date
tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
x-win x-dnd 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
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 16 281425 21885)
 (symbols 48 36524 20)
 (miscs 40 131 300)
 (strings 32 67759 8501)
 (string-bytes 1 2153683)
 (vectors 16 28380)
 (vector-slots 8 597568 11077)
 (floats 8 286 597)
 (intervals 56 572 110)
 (buffers 960 21)
 (heap 1024 29658 8203))





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

* bug#21154: 24.5.50; LaTeX mode complains about mismatched parentheses on end commands
  2015-07-29  0:43 bug#21154: 24.5.50; LaTeX mode complains about mismatched parentheses on end commands Jeff Clough
@ 2016-04-30 12:13 ` Marcin Borkowski
  2016-05-02 10:32   ` Marcin Borkowski
  0 siblings, 1 reply; 4+ messages in thread
From: Marcin Borkowski @ 2016-04-30 12:13 UTC (permalink / raw)
  To: Jeff Clough; +Cc: 21154

On 2015-07-28, at 20:43, Jeff Clough <jvc@ijmp.net> wrote:

> When writing LaTeX, typing the closing curly brace of an end
> command (\end{document} for instance) causes a "Mismatched parentheses"
> complaint to appear in the minibuffer, even when this seems to be false.
>
> Steps to reproduce:
>
> Create a new ".tex" file with the following contents (note the missing
> curly brace at the very end...
>
> \documentclass{article}
> \begin{document}
> \end{document
>
> Watch the minibuffer, type the closing curly brace, and witness the
> complaint. The only ever appears to happen on an end command, and it
> happens on every single end command no matter where it appears.

Confirmed on GNU Emacs 25.1.50.9 (commit a3b46e0).  I'll try to
investigate it.

Best,

-- 
Marcin





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

* bug#21154: 24.5.50; LaTeX mode complains about mismatched parentheses on end commands
  2016-04-30 12:13 ` Marcin Borkowski
@ 2016-05-02 10:32   ` Marcin Borkowski
  2016-05-06 12:56     ` Marcin Borkowski
  0 siblings, 1 reply; 4+ messages in thread
From: Marcin Borkowski @ 2016-05-02 10:32 UTC (permalink / raw)
  To: Jeff Clough; +Cc: 21154

On 2016-04-30, at 14:13, Marcin Borkowski <mbork@mbork.pl> wrote:

> On 2015-07-28, at 20:43, Jeff Clough <jvc@ijmp.net> wrote:
>
>> When writing LaTeX, typing the closing curly brace of an end
>> command (\end{document} for instance) causes a "Mismatched parentheses"
>> complaint to appear in the minibuffer, even when this seems to be false.
>>
>> Steps to reproduce:
>>
>> Create a new ".tex" file with the following contents (note the missing
>> curly brace at the very end...
>>
>> \documentclass{article}
>> \begin{document}
>> \end{document
>>
>> Watch the minibuffer, type the closing curly brace, and witness the
>> complaint. The only ever appears to happen on an end command, and it
>> happens on every single end command no matter where it appears.
>
> Confirmed on GNU Emacs 25.1.50.9 (commit a3b46e0).  I'll try to
> investigate it.

Here's my conjecture: the problematic message is displayed by
`blink-matching-open'.  After cursory examination, it seems that the
problem is caused by the fact that `forward-sexp-function' in tex-mode
is trying to be smart and jumps to the beginning of the environment when
after "\end{...}".  Since there is no opening brace there,
`blink-matching-open' thinks there's a mismatch.

I'll try to come up with a patch.

Incidentally, AUC-TeX does not have this problem.

Best,

-- 
Marcin





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

* bug#21154: 24.5.50; LaTeX mode complains about mismatched parentheses on end commands
  2016-05-02 10:32   ` Marcin Borkowski
@ 2016-05-06 12:56     ` Marcin Borkowski
  0 siblings, 0 replies; 4+ messages in thread
From: Marcin Borkowski @ 2016-05-06 12:56 UTC (permalink / raw)
  To: Jeff Clough; +Cc: 21154


On 2016-05-02, at 12:32, Marcin Borkowski <mbork@mbork.pl> wrote:

> On 2016-04-30, at 14:13, Marcin Borkowski <mbork@mbork.pl> wrote:
>
>> On 2015-07-28, at 20:43, Jeff Clough <jvc@ijmp.net> wrote:
>>
>>> When writing LaTeX, typing the closing curly brace of an end
>>> command (\end{document} for instance) causes a "Mismatched parentheses"
>>> complaint to appear in the minibuffer, even when this seems to be false.
>>>
>>> Steps to reproduce:
>>>
>>> Create a new ".tex" file with the following contents (note the missing
>>> curly brace at the very end...
>>>
>>> \documentclass{article}
>>> \begin{document}
>>> \end{document
>>>
>>> Watch the minibuffer, type the closing curly brace, and witness the
>>> complaint. The only ever appears to happen on an end command, and it
>>> happens on every single end command no matter where it appears.
>>
>> Confirmed on GNU Emacs 25.1.50.9 (commit a3b46e0).  I'll try to
>> investigate it.
>
> Here's my conjecture: the problematic message is displayed by
> `blink-matching-open'.  After cursory examination, it seems that the
> problem is caused by the fact that `forward-sexp-function' in tex-mode
> is trying to be smart and jumps to the beginning of the environment when
> after "\end{...}".  Since there is no opening brace there,
> `blink-matching-open' thinks there's a mismatch.
>
> I'll try to come up with a patch.
>
> Incidentally, AUC-TeX does not have this problem.

OK, so it seems a tad harder than I thought.  I mean, making a patch
that works is easy; making a patch that works _and_ doesn't break
anything else may be slightly tricky.

My proposal is to temporarily bind `forward-sexp-function' to nil in
`blink-matching-open' so that it finds the opening brace correctly.
(Effectively, making `forward-sexp' fall back to `scan-sexps'.)  Could
anyone imagine a situation where this would break something?  There
doesn't seem to exist a lot of modes in core Emacs which set
`forward-sexp-function' to a non-nil value, so I may just look at all
occurences of that variable in the codebase if that is reasonable.

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University





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

end of thread, other threads:[~2016-05-06 12:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-29  0:43 bug#21154: 24.5.50; LaTeX mode complains about mismatched parentheses on end commands Jeff Clough
2016-04-30 12:13 ` Marcin Borkowski
2016-05-02 10:32   ` Marcin Borkowski
2016-05-06 12:56     ` Marcin Borkowski

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).