unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#54233: 29.0.50; [PATCH] Missing symbols in tex--prettify-symbols-alist
@ 2022-03-03 11:48 Arash Esbati
  2022-03-03 13:55 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Arash Esbati @ 2022-03-03 11:48 UTC (permalink / raw)
  To: 54233

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

Hi all,

I'd like to propose the following change to
`tex--prettify-symbols-alist'.  It adds support for macros formerly
provided by textcomp package which are now part of LaTeX kernel.  I will
prepare a format-patch once this change is accepted.

Any comments welcome.

Best, Arash

[-- Attachment #2: tex-prettify.diff --]
[-- Type: text/x-patch, Size: 5898 bytes --]

diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index ab94036d01..b0aa39a23f 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -3568,28 +3568,118 @@ tex--prettify-symbols-alist
     ("\\ordmasculine" . ?º)
     ("\\lambdabar" . ?ƛ)
     ("\\celsius" . ?℃)
-    ("\\textmu" . ?µ)
-    ("\\textfractionsolidus" . ?⁄)
-    ("\\textbigcircle" . ?⃝)
-    ("\\textmusicalnote" . ?♪)
-    ("\\textdied" . ?✝)
-    ("\\textcolonmonetary" . ?₡)
-    ("\\textwon" . ?₩)
-    ("\\textnaira" . ?₦)
-    ("\\textpeso" . ?₱)
-    ("\\textlira" . ?₤)
-    ("\\textrecipe" . ?℞)
-    ("\\textinterrobang" . ?‽)
-    ("\\textpertenthousand" . ?‱)
-    ("\\textbaht" . ?฿)
-    ("\\textnumero" . ?№)
-    ("\\textdiscount" . ?⁒)
-    ("\\textestimated" . ?℮)
-    ("\\textopenbullet" . ?◦)
-    ("\\textlquill" . 8261)		; Literal ?⁅ breaks indentation.
-    ("\\textrquill" . 8262)             ; Literal ?⁆ breaks indentation.
-    ("\\textcircledP" . ?℗)
-    ("\\textreferencemark" . ?※))
+    ;; Text symbols formerly part of textcomp package:
+    ("\\textdollar" . ?$) ; "0024
+    ("\\textborn" . ?*) ; "002A
+    ("\\textless" . ?<) ; "003C
+    ("\\textgreater" . ?>) ; "003E
+    ("\\textbackslash" . ?\\) ; "005C
+    ("\\textasciicircum" . ?^) ; "005E
+    ("\\textunderscore" . ?_) ; "005F
+    ("\\textbraceleft" . ?\{) ; "007B
+    ("\\textbar" . ?|) ; "007C
+    ("\\textbraceright" . ?\}) ; "007D
+    ("\\textasciitilde" . ?~) ; "007E
+    ("\\textexclamdown" . ?¡) ; "00A1
+    ("\\textcent" . ?¢) ; "00A2
+    ("\\textsterling" . ?£) ; "00A3
+    ("\\textcurrency" . ?¤) ; "00A4
+    ("\\textyen" . ?¥) ; "00A5
+    ("\\textbrokenbar" . ?¦) ; "00A6
+    ("\\textsection" . ?§) ; "00A7
+    ("\\textasciidieresis" . ?¨) ; "00A8
+    ("\\textcopyright" . ?©) ; "00A9
+    ("\\textordfeminine" . ?ª) ; "00AA
+    ("\\guillemetleft" . ?«) ; "00AB
+    ("\\guillemotleft" . ?«) ; "00AB
+    ("\\textlnot" . ?¬) ; "00AC
+    ("\\textregistered" . ?®) ; "00AE
+    ("\\textasciimacron" . ?¯) ; "00AF
+    ("\\textdegree" . ?°) ; "00B0
+    ("\\textpm" . ?±) ; "00B1
+    ("\\texttwosuperior" . ?²) ; "00B2
+    ("\\textthreesuperior" . ?³) ; "00B3
+    ("\\textasciiacute" . ?´) ; "00B4
+    ("\\textmu" . ?µ) ; "00B5
+    ("\\textparagraph" . ?¶) ; "00B6
+    ("\\textpilcrow" . ?¶) ; "00B6
+    ("\\textperiodcentered" . ?·) ; "00B7
+    ("\\textonesuperior" . ?¹) ; "00B9
+    ("\\textordmasculine" . ?º) ; "00BA
+    ("\\guillemetright" . ?») ; "00BB
+    ("\\guillemotright" . ?») ; "00BB
+    ("\\textonequarter" . ?¼) ; "00BC
+    ("\\textonehalf" . ?½) ; "00BD
+    ("\\textthreequarters" . ?¾) ; "00BE
+    ("\\textquestiondown" . ?¿) ; "00BF
+    ("\\texttimes" . ?×) ; "00D7
+    ("\\textdiv" . ?÷) ; "00F7
+    ("\\textflorin" . ?ƒ) ; "0192
+    ("\\textasciicaron" . ?ˇ) ; "02C7
+    ("\\textasciibreve" . ?˘) ; "02D8
+    ("\\textacutedbl" . ?˝) ; "02DD
+    ("\\textgravedbl" . 757) ; "02F5
+    ("\\texttildelow" . 759) ; "02F7
+    ("\\textbaht" . ?฿) ; "0E3F
+    ("\\textendash" . ?–) ; "2013
+    ("\\textemdash" . ?—) ; "2014
+    ("\\textbardbl" . ?‖) ; "2016
+    ("\\textquoteleft" . 8216) ; "2018 ?‘
+    ("\\textquoteright" . 8217) ; "2019 ?’
+    ("\\quotesinglbase" . 8218) ; "201A ?‚
+    ("\\textquotedblleft" . 8220) ; "201C ?“
+    ("\\textquotedblright" . 8221) ; "201D ?”
+    ("\\quotedblbase" . 8222) ; "201E ?„
+    ("\\textdagger" . ?†) ; "2020
+    ("\\textdied" . ?†) ; "2020
+    ("\\textdaggerdbl" . ?‡) ; "2021
+    ("\\textbullet" . ?•) ; "2022
+    ("\\textellipsis" . ?…) ; "2026
+    ("\\textperthousand" . ?‰) ; "2030
+    ("\\textpertenthousand" . ?‱) ; "2031
+    ("\\guilsinglleft" . ?‹) ; "2039
+    ("\\guilsinglright" . ?›) ; "203A
+    ("\\textreferencemark" . ?※) ; "203B
+    ("\\textinterrobang" . ?‽) ; "203D
+    ("\\textfractionsolidus" . ?⁄) ; "2044
+    ("\\textlquill" . 8261) ; "2045 Literal ?⁅ breaks indentation
+    ("\\textrquill" . 8262) ; "2046 Literal ?⁆ breaks indentation
+    ("\\textdiscount" . ?⁒) ; "2052
+    ("\\textcolonmonetary" . ?₡) ; "20A1
+    ("\\textlira" . ?₤) ; "20A4
+    ("\\textnaira" . ?₦) ; "20A6
+    ("\\textwon" . ?₩) ; "20A9
+    ("\\textdong" . ?₫) ; "20AB
+    ("\\texteuro" . ?€) ; "20AC
+    ("\\textpeso" . ?₱) ; "20B1
+    ("\\textguarani" . ?₲) ; "20B2
+    ("\\textcelsius" . ?℃) ; "2103
+    ("\\textnumero" . ?№) ; "2116
+    ("\\textcircledP" . ?℗) ; "2117
+    ("\\textrecipe" . ?℞) ; "211E
+    ("\\textservicemark" . ?℠) ; "2120
+    ("\\texttrademark" . ?™) ; "2122
+    ("\\textohm" . ?Ω) ; "2126
+    ("\\textmho" . ?℧) ; "2127
+    ("\\textestimated" . ?℮) ; "212E
+    ("\\textleftarrow" . ?←) ; "2190
+    ("\\textuparrow" . ?↑) ; "2191
+    ("\\textrightarrow" . ?→) ; "2192
+    ("\\textdownarrow" . ?↓) ; "2193
+    ("\\textminus" . ?−) ; "2212
+    ("\\textsurd" . ?√) ; "221A
+    ("\\textlangle" . 9001) ; "2329 Literal ?〈 breaks indentation
+    ("\\textrangle" . 9002) ; "232A Literal ?〉 breaks indentation
+    ("\\textblank" . ?␢) ; "2422
+    ("\\textvisiblespace" . ?␣) ; "2423
+    ("\\textopenbullet" . ?◦) ; "25E6
+    ("\\textbigcircle" . ?◯) ; "25EF
+    ("\\textmusicalnote" . ?♪) ; "266A
+    ("\\textmarried" . ?⚭) ; "26AD
+    ("\\textdivorced" . ?⚮) ; "26AE
+    ("\\textlbrackdbl" . 10214) ; "27E6 Literal ?⟦ breaks indentation
+    ("\\textrbrackdbl" . 10215) ; "27E7 Literal ?⟧ breaks indentation
+    ("\\textinterrobangdown" . ?⸘)) ; "2E18
   "A `prettify-symbols-alist' usable for (La)TeX modes.")
 
 (defun tex--prettify-symbols-compose-p (_start end _match)

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

* bug#54233: 29.0.50; [PATCH] Missing symbols in tex--prettify-symbols-alist
  2022-03-03 11:48 bug#54233: 29.0.50; [PATCH] Missing symbols in tex--prettify-symbols-alist Arash Esbati
@ 2022-03-03 13:55 ` Lars Ingebrigtsen
  2022-03-03 15:34   ` Arash Esbati
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2022-03-03 13:55 UTC (permalink / raw)
  To: Arash Esbati; +Cc: 54233

Arash Esbati <arash@gnu.org> writes:

> I'd like to propose the following change to
> `tex--prettify-symbols-alist'.  It adds support for macros formerly
> provided by textcomp package which are now part of LaTeX kernel.  I will
> prepare a format-patch once this change is accepted.

[...]

> +    ;; Text symbols formerly part of textcomp package:
> +    ("\\textdollar" . ?$) ; "0024
> +    ("\\textborn" . ?*) ; "002A
> +    ("\\textless" . ?<) ; "003C

Is there any point in adding the numerical code to all these lines?  And
if we want that, I think this should be two patches -- one that adds the
new symbols, and one that adds codes to the old lines, otherwise it's
difficult to say what's changed functionally.

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





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

* bug#54233: 29.0.50; [PATCH] Missing symbols in tex--prettify-symbols-alist
  2022-03-03 13:55 ` Lars Ingebrigtsen
@ 2022-03-03 15:34   ` Arash Esbati
  2022-03-04 15:37     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Arash Esbati @ 2022-03-03 15:34 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 54233

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Is there any point in adding the numerical code to all these lines?

It's for reference only to show which character LaTeX will pick.  One
difference I found between the current implementation and my patch is
the entry for \textdied.  Current implementation is:

  character: ✝ (displayed as ✝) (codepoint 10013, #o23435, #x271d)
   to input: type "C-x 8 RET 271d" or "C-x 8 RET LATIN CROSS"

LaTeX does (and my change too):

  character: † (displayed as †) (codepoint 8224, #o20040, #x2020)
   to input: type "C-x 8 RET 2020" or "C-x 8 RET DAGGER"

One could now argue that the current implementation is better for
prettifying, but I would say to stick with LaTeX does to keep the
difference between final product and what you see in the editor low.
But that's only me.

> And if we want that, I think this should be two patches -- one that
> adds the new symbols,

I can provide a new patch and delete the code points, just let me know.

Best, Arash





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

* bug#54233: 29.0.50; [PATCH] Missing symbols in tex--prettify-symbols-alist
  2022-03-03 15:34   ` Arash Esbati
@ 2022-03-04 15:37     ` Lars Ingebrigtsen
  2022-03-17 10:24       ` Arash Esbati
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2022-03-04 15:37 UTC (permalink / raw)
  To: Arash Esbati; +Cc: 54233

Arash Esbati <arash@gnu.org> writes:

>> Is there any point in adding the numerical code to all these lines?
>
> It's for reference only to show which character LaTeX will pick.  One
> difference I found between the current implementation and my patch is
> the entry for \textdied.  Current implementation is:
>
>   character: ✝ (displayed as ✝) (codepoint 10013, #o23435, #x271d)
>    to input: type "C-x 8 RET 271d" or "C-x 8 RET LATIN CROSS"
>
> LaTeX does (and my change too):
>
>   character: † (displayed as †) (codepoint 8224, #o20040, #x2020)
>    to input: type "C-x 8 RET 2020" or "C-x 8 RET DAGGER"

Adding a comment noting that this is DAGGER might be appropriate for
that one, since it seems confusable.

>> And if we want that, I think this should be two patches -- one that
>> adds the new symbols,
>
> I can provide a new patch and delete the code points, just let me know.

Yes, please do.  

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





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

* bug#54233: 29.0.50; [PATCH] Missing symbols in tex--prettify-symbols-alist
  2022-03-04 15:37     ` Lars Ingebrigtsen
@ 2022-03-17 10:24       ` Arash Esbati
  2022-03-17 10:32         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Arash Esbati @ 2022-03-17 10:24 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 54233

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

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Arash Esbati <arash@gnu.org> writes:
>>
>> I can provide a new patch and delete the code points, just let me know.
>
> Yes, please do.  

Please find attached the next try.  Let me know if it's Ok and I push it
to Emacs master.

Best, Arash

[-- Attachment #2: tex-prettify.diff --]
[-- Type: text/x-patch, Size: 4970 bytes --]

diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index aa6fd24518..da4d7cc442 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -3563,28 +3563,122 @@ tex--prettify-symbols-alist
     ("\\ordmasculine" . ?º)
     ("\\lambdabar" . ?ƛ)
     ("\\celsius" . ?℃)
+    ;; Text symbols formerly part of textcomp package:
+    ("\\textdollar" . ?$)
+    ("\\textborn" . ?*)
+    ("\\textless" . ?<)
+    ("\\textgreater" . ?>)
+    ("\\textbackslash" . ?\\)
+    ("\\textasciicircum" . ?^)
+    ("\\textunderscore" . ?_)
+    ("\\textbraceleft" . ?\{)
+    ("\\textbar" . ?|)
+    ("\\textbraceright" . ?\})
+    ("\\textasciitilde" . ?~)
+    ("\\textexclamdown" . ?¡)
+    ("\\textcent" . ?¢)
+    ("\\textsterling" . ?£)
+    ("\\textcurrency" . ?¤)
+    ("\\textyen" . ?¥)
+    ("\\textbrokenbar" . ?¦)
+    ("\\textsection" . ?§)
+    ("\\textasciidieresis" . ?¨)
+    ("\\textcopyright" . ?©)
+    ("\\textordfeminine" . ?ª)
+    ("\\guillemetleft" . ?«)
+    ("\\guillemotleft" . ?«)
+    ("\\textlnot" . ?¬)
+    ("\\textregistered" . ?®)
+    ("\\textasciimacron" . ?¯)
+    ("\\textdegree" . ?°)
+    ("\\textpm" . ?±)
+    ("\\texttwosuperior" . ?²)
+    ("\\textthreesuperior" . ?³)
+    ("\\textasciiacute" . ?´)
     ("\\textmu" . ?µ)
+    ("\\textparagraph" . ?¶)
+    ("\\textpilcrow" . ?¶)
+    ("\\textperiodcentered" . ?·)
+    ("\\textonesuperior" . ?¹)
+    ("\\textordmasculine" . ?º)
+    ("\\guillemetright" . ?»)
+    ("\\guillemotright" . ?»)
+    ("\\textonequarter" . ?¼)
+    ("\\textonehalf" . ?½)
+    ("\\textthreequarters" . ?¾)
+    ("\\textquestiondown" . ?¿)
+    ("\\texttimes" . ?×)
+    ("\\textdiv" . ?÷)
+    ("\\textflorin" . ?ƒ)
+    ("\\textasciicaron" . ?ˇ)
+    ("\\textasciibreve" . ?˘)
+    ("\\textacutedbl" . ?˝)
+    ("\\textgravedbl" . 757)
+    ("\\texttildelow" . 759)
+    ("\\textbaht" . ?฿)
+    ("\\textendash" . ?–)
+    ("\\textemdash" . ?—)
+    ("\\textbardbl" . ?‖)
+    ("\\textquoteleft" . 8216)
+    ("\\textquoteright" . 8217)
+    ("\\quotesinglbase" . 8218)
+    ("\\textquotedblleft" . 8220)
+    ("\\textquotedblright" . 8221)
+    ("\\quotedblbase" . 8222)
+    ;; \textdagger and \textdied are replaced with DAGGER (#x2020) and
+    ;; not with LATIN CROSS (#x271d)
+    ("\\textdagger" . ?†)
+    ("\\textdied" . ?†)
+    ("\\textdaggerdbl" . ?‡)
+    ("\\textbullet" . ?•)
+    ("\\textellipsis" . ?…)
+    ("\\textperthousand" . ?‰)
+    ("\\textpertenthousand" . ?‱)
+    ("\\guilsinglleft" . ?‹)
+    ("\\guilsinglright" . ?›)
+    ("\\textreferencemark" . ?※)
+    ("\\textinterrobang" . ?‽)
     ("\\textfractionsolidus" . ?⁄)
-    ("\\textbigcircle" . ?⃝)
-    ("\\textmusicalnote" . ?♪)
-    ("\\textdied" . ?✝)
+    ("\\textlquill" . 8261) ; Literal ?⁅ breaks indentation
+    ("\\textrquill" . 8262) ; Literal ?⁆ breaks indentation
+    ("\\textdiscount" . ?⁒)
     ("\\textcolonmonetary" . ?₡)
-    ("\\textwon" . ?₩)
+    ("\\textlira" . ?₤)
     ("\\textnaira" . ?₦)
+    ("\\textwon" . ?₩)
+    ("\\textdong" . ?₫)
+    ("\\texteuro" . ?€)
     ("\\textpeso" . ?₱)
-    ("\\textlira" . ?₤)
-    ("\\textrecipe" . ?℞)
-    ("\\textinterrobang" . ?‽)
-    ("\\textpertenthousand" . ?‱)
-    ("\\textbaht" . ?฿)
+    ("\\textguarani" . ?₲)
+    ("\\textcelsius" . ?℃)
     ("\\textnumero" . ?№)
-    ("\\textdiscount" . ?⁒)
+    ("\\textcircledP" . ?℗)
+    ("\\textrecipe" . ?℞)
+    ("\\textservicemark" . ?℠)
+    ("\\texttrademark" . ?™)
+    ("\\textohm" . ?Ω)
+    ("\\textmho" . ?℧)
     ("\\textestimated" . ?℮)
+    ("\\textleftarrow" . ?←)
+    ("\\textuparrow" . ?↑)
+    ("\\textrightarrow" . ?→)
+    ("\\textdownarrow" . ?↓)
+    ("\\textminus" . ?−)
+    ("\\textsurd" . ?√)
+    ("\\textlangle" . 9001) ; Literal ?〈 breaks indentation
+    ("\\textrangle" . 9002) ; Literal ?〉 breaks indentation
+    ("\\textblank" . ?␢)
+    ("\\textvisiblespace" . ?␣)
     ("\\textopenbullet" . ?◦)
-    ("\\textlquill" . 8261)		; Literal ?⁅ breaks indentation.
-    ("\\textrquill" . 8262)             ; Literal ?⁆ breaks indentation.
-    ("\\textcircledP" . ?℗)
-    ("\\textreferencemark" . ?※))
+    ;; \textbigcircle is replaced with LARGE CIRCLE (#x25ef) and not
+    ;; with COMBINING ENCLOSING CIRCLE (#x20dd)
+    ("\\textbigcircle" . ?◯)
+    ("\\textmusicalnote" . ?♪)
+    ("\\textmarried" . ?⚭)
+    ("\\textdivorced" . ?⚮)
+    ("\\textlbrackdbl" . 10214) ; Literal ?⟦ breaks indentation
+    ("\\textrbrackdbl" . 10215) ; Literal ?⟧ breaks indentation
+    ("\\textinterrobangdown" . ?⸘))
   "A `prettify-symbols-alist' usable for (La)TeX modes.")
 
 (defun tex--prettify-symbols-compose-p (_start end _match)

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

* bug#54233: 29.0.50; [PATCH] Missing symbols in tex--prettify-symbols-alist
  2022-03-17 10:24       ` Arash Esbati
@ 2022-03-17 10:32         ` Lars Ingebrigtsen
  2022-03-17 10:51           ` Arash Esbati
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2022-03-17 10:32 UTC (permalink / raw)
  To: Arash Esbati; +Cc: 54233

Arash Esbati <arash@gnu.org> writes:

> Please find attached the next try.  Let me know if it's Ok and I push it
> to Emacs master.

Looks good to me; please go ahead.

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





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

* bug#54233: 29.0.50; [PATCH] Missing symbols in tex--prettify-symbols-alist
  2022-03-17 10:32         ` Lars Ingebrigtsen
@ 2022-03-17 10:51           ` Arash Esbati
  0 siblings, 0 replies; 7+ messages in thread
From: Arash Esbati @ 2022-03-17 10:51 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 54233

close 54233 29.1
quit

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Looks good to me; please go ahead.

Thanks, pushed.  I'm closing this report.

Best, Arash





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

end of thread, other threads:[~2022-03-17 10:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-03 11:48 bug#54233: 29.0.50; [PATCH] Missing symbols in tex--prettify-symbols-alist Arash Esbati
2022-03-03 13:55 ` Lars Ingebrigtsen
2022-03-03 15:34   ` Arash Esbati
2022-03-04 15:37     ` Lars Ingebrigtsen
2022-03-17 10:24       ` Arash Esbati
2022-03-17 10:32         ` Lars Ingebrigtsen
2022-03-17 10:51           ` Arash Esbati

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