all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#28277: emacs -nw bug?
@ 2017-08-29 12:46 Richard Banach
  2017-08-29 15:56 ` Glenn Morris
  2019-10-30 16:43 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 9+ messages in thread
From: Richard Banach @ 2017-08-29 12:46 UTC (permalink / raw)
  To: 28277, richard.banach

hi,

I use   emacs -nw  and see what looks like a bug

* in tex mode, if I type   $\it identifiername$   it doesn't recognise
the second $ as closing the scope of \it ... and wants to underline
everything that follows ... i haven't found how to turn this off

regards,

richard.





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

* bug#28277: emacs -nw bug?
  2017-08-29 12:46 bug#28277: emacs -nw bug? Richard Banach
@ 2017-08-29 15:56 ` Glenn Morris
  2017-08-29 16:36   ` Richard Banach
  2019-10-30 16:43 ` Lars Ingebrigtsen
  1 sibling, 1 reply; 9+ messages in thread
From: Glenn Morris @ 2017-08-29 15:56 UTC (permalink / raw)
  To: Richard Banach; +Cc: 28277

Richard Banach wrote:

> I use   emacs -nw  and see what looks like a bug
>
> * in tex mode, if I type   $\it identifiername$   it doesn't recognise
> the second $ as closing the scope of \it ... and wants to underline
> everything that follows ... i haven't found how to turn this off

Thanks for the report. This is not specific to emacs -nw.
Relevant forms that tex-mode does understand are:

$foo$
\textit{foo}
{\it foo}

I'm not sure what you are trying to achieve with an \it inside math mode?
I don't think I've seen that form used before.






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

* bug#28277: emacs -nw bug?
  2017-08-29 15:56 ` Glenn Morris
@ 2017-08-29 16:36   ` Richard Banach
  2017-08-29 16:53     ` Glenn Morris
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Banach @ 2017-08-29 16:36 UTC (permalink / raw)
  To: richard.banach, rgm; +Cc: 28277

Glenn Morris <rgm@gnu.org> wrote:

| Richard Banach wrote:
|
| > I use   emacs -nw  and see what looks like a bug
| >
| > * in tex mode, if I type   $\it identifiername$   it doesn't recognise
| > the second $ as closing the scope of \it ... and wants to underline
| > everything that follows ... i haven't found how to turn this off
|
| Thanks for the report. This is not specific to emacs -nw.
| Relevant forms that tex-mode does understand are:
|
| $foo$
| \textit{foo}
| {\it foo}
|
| I'm not sure what you are trying to achieve with an \it inside math mode?
| I don't think I've seen that form used before.


hi,

here's the explanation .....

ideally, you could use

  \usepackage{oz}

which gives exactly the result i'd like inside any  $_math_scope_$

unfortunately, publishers (springer, elsevier,etc) as a rule don't
recognise oz and remove it, without compensating ... result ugly

you can do it the hard way ....

  $\mathit{identifiername}$

or slightly less good

  $\textit{identifiername}$

or (same)

  ${\it identifiername}$

or (lazy way)

  $\it identifiername$

the last three of which give basically the same results, but
the last of which requires the least typing (if, like me, you're
a bit annoyed at not being able to have \usepackage{oz})

cheers,

richard.

ps. in ordinary emacs (i.e. not -nw) it doesn't try to underline
\it stuff, so the problem doesn't arise visually (in my installation)





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

* bug#28277: emacs -nw bug?
  2017-08-29 16:36   ` Richard Banach
@ 2017-08-29 16:53     ` Glenn Morris
  2017-08-30  9:45       ` Richard Banach
  0 siblings, 1 reply; 9+ messages in thread
From: Glenn Morris @ 2017-08-29 16:53 UTC (permalink / raw)
  To: Richard Banach; +Cc: 28277

Richard Banach wrote:

> or (lazy way)
>
>   $\it identifiername$

If you want to be lazy :), it seems that AUCTeX (available from
elpa.gnu.org) handles that form. Otherwise I'd use one of the
non-deprecated formats.





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

* bug#28277: emacs -nw bug?
  2017-08-29 16:53     ` Glenn Morris
@ 2017-08-30  9:45       ` Richard Banach
  2017-08-30 16:48         ` Glenn Morris
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Banach @ 2017-08-30  9:45 UTC (permalink / raw)
  To: richard.banach, rgm; +Cc: 28277

Glenn Morris <rgm@gnu.org> wrote:

| Richard Banach wrote:
|
| > or (lazy way)
| >
| >   $\it identifiername$
|
| If you want to be lazy :), it seems that AUCTeX (available from
| elpa.gnu.org) handles that form. Otherwise I'd use one of the
| non-deprecated formats.

it seems a little overzealous that the editor is more politically correct
than the implementation .... :-)

but anyway, is there an easy way of simply turning off all underlining?
... i mean ... who needs it anyway ..... ?????

cheers,

richard.





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

* bug#28277: emacs -nw bug?
  2017-08-30  9:45       ` Richard Banach
@ 2017-08-30 16:48         ` Glenn Morris
  0 siblings, 0 replies; 9+ messages in thread
From: Glenn Morris @ 2017-08-30 16:48 UTC (permalink / raw)
  To: Richard Banach; +Cc: 28277

Richard Banach wrote:

> it seems a little overzealous that the editor is more politically correct
> than the implementation .... :-)

It's only accidentally stricter through laziness/oversight.
Maybe someone will fix it, but it doesn't seem very important.

> but anyway, is there an easy way of simply turning off all underlining?
> ... i mean ... who needs it anyway ..... ?????

I guess you can M-x customize-face italic.





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

* bug#28277: emacs -nw bug?
  2017-08-29 12:46 bug#28277: emacs -nw bug? Richard Banach
  2017-08-29 15:56 ` Glenn Morris
@ 2019-10-30 16:43 ` Lars Ingebrigtsen
  2019-11-04 14:53   ` Richard Banach
  2020-08-10 14:28   ` Lars Ingebrigtsen
  1 sibling, 2 replies; 9+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-30 16:43 UTC (permalink / raw)
  To: Richard Banach; +Cc: 28277

richard.banach@manchester.ac.uk (Richard Banach) writes:

> I use   emacs -nw  and see what looks like a bug
>
> * in tex mode, if I type   $\it identifiername$   it doesn't recognise
> the second $ as closing the scope of \it ... and wants to underline
> everything that follows ... i haven't found how to turn this off

The following patch fixes the problem -- but I'm not sure whether it
could cause any regressions.

Is

\it foobar $math-stuff$

or something like it possible?  It's been a while since I wrote any TeX.


diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index f277defecf..9d9490602a 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -593,7 +593,7 @@ tex-font-lock-keywords-2
 	    ;; Miscellany.
 	    (slash "\\\\")
 	    (opt " *\\(\\[[^]]*\\] *\\)*")
-	    (args "\\(\\(?:[^{}&\\]+\\|\\\\.\\|{[^}]*}\\)+\\)")
+	    (args "\\(\\(?:[^${}&\\]+\\|\\\\.\\|{[^}]*}\\)+\\)")
 	    (arg "{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)"))
        (list
 	;;


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





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

* bug#28277: emacs -nw bug?
  2019-10-30 16:43 ` Lars Ingebrigtsen
@ 2019-11-04 14:53   ` Richard Banach
  2020-08-10 14:28   ` Lars Ingebrigtsen
  1 sibling, 0 replies; 9+ messages in thread
From: Richard Banach @ 2019-11-04 14:53 UTC (permalink / raw)
  To: richard.banach, larsi; +Cc: 28277

hi,

thanks for the suggestion .......

ages ago, someone suggested

===============================================

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(custom-enabled-themes nil))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(italic ((t (:underline nil))))
 '(underline ((t (:underline t)))))

===============================================

... and it seems to work fine :-)

richard.

===============================================
===============================================

Lars Ingebrigtsen <larsi@gnus.org> wrote:

| richard.banach@manchester.ac.uk (Richard Banach) writes:
|
| > I use   emacs -nw  and see what looks like a bug
| >
| > * in tex mode, if I type   $\it identifiername$   it doesn't recognise
| > the second $ as closing the scope of \it ... and wants to underline
| > everything that follows ... i haven't found how to turn this off
|
| The following patch fixes the problem -- but I'm not sure whether it
| could cause any regressions.
|
| Is
|
| \it foobar $math-stuff$
|
| or something like it possible?  It's been a while since I wrote any TeX.
|
|
| diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
| index f277defecf..9d9490602a 100644
| --- a/lisp/textmodes/tex-mode.el
| +++ b/lisp/textmodes/tex-mode.el
| @@ -593,7 +593,7 @@ tex-font-lock-keywords-2
|  	    ;; Miscellany.
|  	    (slash "\\\\")
|  	    (opt " *\\(\\[[^]]*\\] *\\)*")
| -	    (args "\\(\\(?:[^{}&\\]+\\|\\\\.\\|{[^}]*}\\)+\\)")
| +	    (args "\\(\\(?:[^${}&\\]+\\|\\\\.\\|{[^}]*}\\)+\\)")
|  	    (arg "{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)"))
|         (list
|  	;;
|
|
| -- 
| (domestic pets only, the antidote for overdose, milk.)
|    bloggy blog: http://lars.ingebrigtsen.no





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

* bug#28277: emacs -nw bug?
  2019-10-30 16:43 ` Lars Ingebrigtsen
  2019-11-04 14:53   ` Richard Banach
@ 2020-08-10 14:28   ` Lars Ingebrigtsen
  1 sibling, 0 replies; 9+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-10 14:28 UTC (permalink / raw)
  To: Richard Banach; +Cc: 28277

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

Lars Ingebrigtsen <larsi@gnus.org> writes:

> -	    (args "\\(\\(?:[^{}&\\]+\\|\\\\.\\|{[^}]*}\\)+\\)")
> +	    (args "\\(\\(?:[^${}&\\]+\\|\\\\.\\|{[^}]*}\\)+\\)")

I've now applied this patch.  It changes this:


[-- Attachment #2: Type: image/png, Size: 8652 bytes --]

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


into this:


[-- Attachment #4: Type: image/png, Size: 3955 bytes --]

[-- Attachment #5: Type: text/plain, Size: 213 bytes --]


(Note final $.)

There's no regressions in the test cases, but we don't have great
coverage here, either...

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

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

end of thread, other threads:[~2020-08-10 14:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-29 12:46 bug#28277: emacs -nw bug? Richard Banach
2017-08-29 15:56 ` Glenn Morris
2017-08-29 16:36   ` Richard Banach
2017-08-29 16:53     ` Glenn Morris
2017-08-30  9:45       ` Richard Banach
2017-08-30 16:48         ` Glenn Morris
2019-10-30 16:43 ` Lars Ingebrigtsen
2019-11-04 14:53   ` Richard Banach
2020-08-10 14:28   ` Lars Ingebrigtsen

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.