all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bastien <bzg@altern.org>
To: Glenn Morris <rgm@gnu.org>
Cc: 16390@debbugs.gnu.org
Subject: bug#16390: 24.3.50; [PATCH] texinfo-mode does not fontify @math{2^{61}} correctly
Date: Wed, 08 Jan 2014 00:32:07 +0100	[thread overview]
Message-ID: <87iotvz7uw.fsf@bzg.ath.cx> (raw)
In-Reply-To: <68wqibh513.fsf@fencepost.gnu.org> (Glenn Morris's message of "Tue, 07 Jan 2014 16:10:32 -0500")

[-- Attachment #1: Type: text/plain, Size: 495 bytes --]

Glenn Morris <rgm@gnu.org> writes:

> Bastien Guerry wrote:
>
>> The patch fixes this for @math only.
>
> No it doesn't.
> Even if you fix the obvious 2/1 typo that makes it raise an error during
> redisplay, it will make lines like
>
>  @math{e} is used.  If @var{arg} or @var{base} is negative, @code{log}
>
> look awful.

Yes.  Attached is another patch that works, but looks ugly.
Let me know if there is another more elegant way to check for
the optional presence of balanced curly brace.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: texinfo.el.patch --]
[-- Type: text/x-diff, Size: 1308 bytes --]

=== modified file 'lisp/textmodes/texinfo.el'
*** lisp/textmodes/texinfo.el	2014-01-01 07:43:34 +0000
--- lisp/textmodes/texinfo.el	2014-01-07 23:20:40 +0000
***************
*** 366,373 ****
      ;; their arguments frequently include a @@, and we don't want that
      ;; to overwrite the normal fontification of the argument.
      ("@\\(file\\|email\\){\\([^}]+\\)" 2 font-lock-string-face keep)
!     ("@\\(samp\\|code\\|var\\|math\\|env\\|command\\|option\\){\\([^}]+\\)"
       2 font-lock-variable-name-face keep)
      ("@\\(cite\\|x?ref\\|pxref\\|dfn\\|inforef\\){\\([^}]+\\)"
       2 font-lock-constant-face)
      ("@\\(anchor\\){\\([^}]+\\)" 2 font-lock-type-face)
--- 366,375 ----
      ;; their arguments frequently include a @@, and we don't want that
      ;; to overwrite the normal fontification of the argument.
      ("@\\(file\\|email\\){\\([^}]+\\)" 2 font-lock-string-face keep)
!     ("@\\(samp\\|code\\|var\\|env\\|command\\|option\\){\\([^}]+\\)"
       2 font-lock-variable-name-face keep)
+     ;; @math allows nested braces like @math{2^{12}}
+     ("@math{\\([^{}]*{?[^{}]*}?[^{}]*\\)}" 1 font-lock-variable-name-face)
      ("@\\(cite\\|x?ref\\|pxref\\|dfn\\|inforef\\){\\([^}]+\\)"
       2 font-lock-constant-face)
      ("@\\(anchor\\){\\([^}]+\\)" 2 font-lock-type-face)


[-- Attachment #3: Type: text/plain, Size: 14 bytes --]


-- 
 Bastien

  reply	other threads:[~2014-01-07 23:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07 18:05 bug#16390: 24.3.50; [PATCH] texinfo-mode does not fontify @math{2^{61}} correctly Bastien Guerry
2014-01-07 21:10 ` Glenn Morris
2014-01-07 23:32   ` Bastien [this message]
2014-01-08  7:32     ` Glenn Morris
2014-01-08  8:28       ` Bastien
2016-02-24  3:36     ` Lars Ingebrigtsen
2016-02-24 14:56       ` Bastien Guerry

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=87iotvz7uw.fsf@bzg.ath.cx \
    --to=bzg@altern.org \
    --cc=16390@debbugs.gnu.org \
    --cc=rgm@gnu.org \
    /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.