emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Entities
@ 2012-05-09  2:52 Mark E. Shoulson
  2012-05-23 21:53 ` Entities Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Mark E. Shoulson @ 2012-05-09  2:52 UTC (permalink / raw)
  To: org-mode mailing list

[-- Attachment #1: Type: text/html, Size: 1863 bytes --]

[-- Attachment #2: 0001-Fix-for-displaying-certain-pretty-entities.patch --]
[-- Type: text/x-patch, Size: 1488 bytes --]

From 5070e37aaae6f952bab022c71212fabb7549105e Mon Sep 17 00:00:00 2001
From: Mark Shoulson <mark@kli.org>
Date: Tue, 8 May 2012 15:15:10 -0400
Subject: [PATCH] Fix for displaying certain "pretty" entities
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------1.7.7.6"

This is a multi-part message in MIME format.
--------------1.7.7.6
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit


* org.el (org-fontify-entities): fix bug: The entities \sup[123] and
\there4 were not "prettified" when org-pretty-entities was enabled.

TINYCHANGE
---
 lisp/org.el |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


--------------1.7.7.6
Content-Type: text/x-patch; name="0001-Fix-for-displaying-certain-pretty-entities.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-Fix-for-displaying-certain-pretty-entities.patch"

diff --git a/lisp/org.el b/lisp/org.el
index 66f9c3e..1d2955f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5954,7 +5954,7 @@ needs to be inserted at a specific position in the font-lock sequence.")
     (when org-pretty-entities
       (catch 'match
 	(while (re-search-forward
-		"\\\\\\(frac[13][24]\\|[a-zA-Z]+\\)\\($\\|{}\\|[^[:alpha:]\n]\\)"
+		"\\\\\\(there4\\|sup[123]\\|frac[13][24]\\|[a-zA-Z]+\\)\\($\\|{}\\|[^[:alpha:]\n]\\)"
 		limit t)
 	  (if (and (not (org-in-indented-comment-line))
 		   (setq ee (org-entity-get (match-string 1)))

--------------1.7.7.6--



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-Add-entities-for-_.patch --]
[-- Type: text/x-patch; name="0002-Add-entities-for-_.patch", Size: 1563 bytes --]

From 58d18562f39ed64a547fa2d60510cae5983bcbef Mon Sep 17 00:00:00 2001
From: Mark Shoulson <mark@kli.org>
Date: Tue, 8 May 2012 15:22:48 -0400
Subject: [PATCH] Add entities for /, +, _, =
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------1.7.7.6"

This is a multi-part message in MIME format.
--------------1.7.7.6
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit


* org-entities.el (org-entities): add new entities for characters
which could cause formatting changes if typed directly.
---
 lisp/org-entities.el |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)


--------------1.7.7.6
Content-Type: text/x-patch; name="0001-Add-entities-for-_.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-Add-entities-for-_.patch"

diff --git a/lisp/org-entities.el b/lisp/org-entities.el
index 8b5b3f3..fce3b68 100644
--- a/lisp/org-entities.el
+++ b/lisp/org-entities.el
@@ -260,6 +260,10 @@ loaded, add these packages to `org-export-latex-packages-alist'."
     ("lt" "\\textless{}" nil "&lt;" "<" "<" "<")
     ("gt" "\\textgreater{}" nil "&gt;" ">" ">" ">")
     ("tilde" "\\~{}" nil "&tilde;" "~" "~" "~")
+    ("slash" "/" nil "/" "/" "/" "/")
+    ("plus" "+" nil "+" "+" "+" "+")
+    ("under" "\\_" nil "_" "_" "_" "_")
+    ("equal" "=" nil "=" "=" "=" "=")
     ("dagger" "\\textdagger{}" nil "&dagger;" "[dagger]" "[dagger]" "†")
     ("Dagger" "\\textdaggerdbl{}" nil "&Dagger;" "[doubledagger]" "[doubledagger]" "‡")
 

--------------1.7.7.6--



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

* Re: Entities
  2012-05-09  2:52 Entities Mark E. Shoulson
@ 2012-05-23 21:53 ` Nicolas Goaziou
  2012-05-24  1:22   ` [PATCH] Fix for displaying entities ending in a number Mark E. Shoulson
  2012-05-24  2:02   ` [PATCH] Add entities for /, +, _, = Mark E. Shoulson
  0 siblings, 2 replies; 8+ messages in thread
From: Nicolas Goaziou @ 2012-05-23 21:53 UTC (permalink / raw)
  To: Mark E. Shoulson; +Cc: org-mode mailing list

Hello,

"Mark E. Shoulson" <mark@kli.org> writes:

> There's a small bug in rendering the entities when org-pretty-entities
> is on (I get the feeling that org-pretty-entities is not a very
> commonly-used feature). The entities \sup1 \sup2 \sup3 and \there4 are
> not rendered properly. The regex detecting entities apparently doesn't
> catch numbers at the end, except for the special case of fractions. I've
> added the others to the special-casing and attach a patch for it; I
> hope I managed to include the changelog properly (is git format-patch -
> -attach the way to go?).

This looks good. You should add a title to your patch, like "Fix
detection of entities ending with a number" or "org-entities: Add some
entities".

Also, please capitalize the word after the colons.

> Also attached is another patch that might or might not be useful.
> Sometimes it can be a problem when you can't type, say, asterisks
> around a word when you NEED asterisks around the word, not a boldface
> word (I'd been getting around it by using Unicode characters that look
> like asterisks, like ∗). The way to do it right is to use the \ast
> entity, which expands to the right thing but doesn't affect
> formatting. There's also already a \tilde entity, to allow putting in
> tildes without accidentally setting something verbatim. I added
> entities for the remaining markup characters: \plus, \under, \equal,
> and \slash. \under might be particularly handy when avoiding
> subscripting (which raises the question of if there should be an
> \asciicirc (or something) entity for ^ also).

I think they are all useful. Though, asciicirc already exists as circ.

Could you modify slightly your changelogs before I apply the patches?

Thank you.


Regards,

-- 
Nicolas Goaziou

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

* [PATCH] Fix for displaying entities ending in a number
  2012-05-23 21:53 ` Entities Nicolas Goaziou
@ 2012-05-24  1:22   ` Mark E. Shoulson
  2012-05-25 15:00     ` Nicolas Goaziou
  2012-05-24  2:02   ` [PATCH] Add entities for /, +, _, = Mark E. Shoulson
  1 sibling, 1 reply; 8+ messages in thread
From: Mark E. Shoulson @ 2012-05-24  1:22 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: org-mode mailing list

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

On 05/23/2012 05:53 PM, Nicolas Goaziou wrote:
> Hello,
>
> "Mark E. Shoulson"<mark@kli.org>  writes:
>
>> There's a small bug in rendering the entities when org-pretty-entities
>> is on (I get the feeling that org-pretty-entities is not a very
>> commonly-used feature). The entities \sup1 \sup2 \sup3 and \there4 are
>> not rendered properly. The regex detecting entities apparently doesn't
>> catch numbers at the end, except for the special case of fractions. I've
>> added the others to the special-casing and attach a patch for it; I
>> hope I managed to include the changelog properly (is git format-patch -
>> -attach the way to go?).
> This looks good. You should add a title to your patch, like "Fix
> detection of entities ending with a number" or "org-entities: Add some
> entities".
>
> Also, please capitalize the word after the colons.

I was trying to copy the format seen in other patches on the list; I 
guess I missed some details.  I've set the subject of this thread as 
I've seen done with other patches, and I attach only a single patch, as 
requested by the website, and created the changelog with C-x 4 a and 
everything.  I hope I got it right.

Other patch follows under separate cover.

>
> Could you modify slightly your changelogs before I apply the patches?
>
> Thank you.
>
>
> Regards,
>


[-- Attachment #2: 0001-Fix-for-displaying-entities-ending-in-a-number.patch --]
[-- Type: text/x-patch, Size: 1006 bytes --]

From 9b8e1b56c5c60720f985ea2b26952702c6c730a6 Mon Sep 17 00:00:00 2001
From: Mark Shoulson <mark@kli.org>
Date: Wed, 23 May 2012 20:17:40 -0400
Subject: [PATCH] Fix for displaying entities ending in a number

* lisp/org.el (org-fontify-entities): Fix bug: The entities \sup[123] and
  \there4 were not "prettified" when org-pretty-entities was enabled.

TINYCHANGE
---
 lisp/org.el |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 0b00851..c44c7ab 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5966,7 +5966,7 @@ needs to be inserted at a specific position in the font-lock sequence.")
     (when org-pretty-entities
       (catch 'match
 	(while (re-search-forward
-		"\\\\\\(frac[13][24]\\|[a-zA-Z]+\\)\\($\\|{}\\|[^[:alpha:]\n]\\)"
+		"\\\\\\(there4\\|sup[123]\\|frac[13][24]\\|[a-zA-Z]+\\)\\($\\|{}\\|[^[:alpha:]\n]\\)"
 		limit t)
 	  (if (and (not (org-in-indented-comment-line))
 		   (setq ee (org-entity-get (match-string 1)))
-- 
1.7.7.6


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

* [PATCH] Add entities for /, +, _, =
  2012-05-23 21:53 ` Entities Nicolas Goaziou
  2012-05-24  1:22   ` [PATCH] Fix for displaying entities ending in a number Mark E. Shoulson
@ 2012-05-24  2:02   ` Mark E. Shoulson
  2012-05-25 15:04     ` Nicolas Goaziou
  1 sibling, 1 reply; 8+ messages in thread
From: Mark E. Shoulson @ 2012-05-24  2:02 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: org-mode mailing list

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

On 05/23/2012 05:53 PM, Nicolas Goaziou wrote:
> Hello,
>
> "Mark E. Shoulson"<mark@kli.org>  writes:
>> Also attached is another patch that might or might not be useful.
>> Sometimes it can be a problem when you can't type, say, asterisks
>> around a word when you NEED asterisks around the word, not a boldface
>> word (I'd been getting around it by using Unicode characters that look
>> like asterisks, like ∗). The way to do it right is to use the \ast
>> entity, which expands to the right thing but doesn't affect
>> formatting. There's also already a \tilde entity, to allow putting in
>> tildes without accidentally setting something verbatim. I added
>> entities for the remaining markup characters: \plus, \under, \equal,
>> and \slash. \under might be particularly handy when avoiding
>> subscripting (which raises the question of if there should be an
>> \asciicirc (or something) entity for ^ also).
> I think they are all useful. Though, asciicirc already exists as circ.

I hadn't counted \circ because it expands under Unicode to ˆ (U+02C6) 
and not to the true ascii circumflex ^ (U+005E); the point of these 
entities is to represent ascii characters that otherwise would confuse 
things.  Maybe \circ should expand to ^; maybe there should be another 
entity for it (maybe neither).

Anyway; attaching the relevant patch (changelog tweaked), once again 
hoping I got the formatting and everything right.

~mark


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-entities-for-_.patch --]
[-- Type: text/x-patch; name="0001-Add-entities-for-_.patch", Size: 1122 bytes --]

From 4d6c4ccc90fd181f446ff4c7d56f5c980ec9d940 Mon Sep 17 00:00:00 2001
From: Mark Shoulson <mark@kli.org>
Date: Wed, 23 May 2012 21:53:35 -0400
Subject: [PATCH] Add entities for /, +, _, =

* org-entities.el (org-entities): Add new entities for characters
  which could cause formatting changes if typed directly.
---
 lisp/org-entities.el |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/lisp/org-entities.el b/lisp/org-entities.el
index 8b5b3f3..fce3b68 100644
--- a/lisp/org-entities.el
+++ b/lisp/org-entities.el
@@ -260,6 +260,10 @@ loaded, add these packages to `org-export-latex-packages-alist'."
     ("lt" "\\textless{}" nil "&lt;" "<" "<" "<")
     ("gt" "\\textgreater{}" nil "&gt;" ">" ">" ">")
     ("tilde" "\\~{}" nil "&tilde;" "~" "~" "~")
+    ("slash" "/" nil "/" "/" "/" "/")
+    ("plus" "+" nil "+" "+" "+" "+")
+    ("under" "\\_" nil "_" "_" "_" "_")
+    ("equal" "=" nil "=" "=" "=" "=")
     ("dagger" "\\textdagger{}" nil "&dagger;" "[dagger]" "[dagger]" "†")
     ("Dagger" "\\textdaggerdbl{}" nil "&Dagger;" "[doubledagger]" "[doubledagger]" "‡")
 
-- 
1.7.7.6


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

* Re: [PATCH] Fix for displaying entities ending in a number
  2012-05-24  1:22   ` [PATCH] Fix for displaying entities ending in a number Mark E. Shoulson
@ 2012-05-25 15:00     ` Nicolas Goaziou
  0 siblings, 0 replies; 8+ messages in thread
From: Nicolas Goaziou @ 2012-05-25 15:00 UTC (permalink / raw)
  To: Mark E. Shoulson; +Cc: org-mode mailing list

Hello,

"Mark E. Shoulson" <mark@kli.org> writes:

> I was trying to copy the format seen in other patches on the list;
> I guess I missed some details.  I've set the subject of this thread as
> I've seen done with other patches, and I attach only a single patch,
> as requested by the website, and created the changelog with C-x
> 4 a and everything.  I hope I got it right.

That's perfect.

I have applied your patch. Thank you.


Regards,

-- 
Nicolas Goaziou

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

* Re: [PATCH] Add entities for /, +, _, =
  2012-05-24  2:02   ` [PATCH] Add entities for /, +, _, = Mark E. Shoulson
@ 2012-05-25 15:04     ` Nicolas Goaziou
  2012-05-25 20:40       ` Mark E. Shoulson
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2012-05-25 15:04 UTC (permalink / raw)
  To: Mark E. Shoulson; +Cc: org-mode mailing list

Hello,

"Mark E. Shoulson" <mark@kli.org> writes:

> I hadn't counted \circ because it expands under Unicode to ˆ (U+02C6)
> and not to the true ascii circumflex ^ (U+005E); the point of these
> entities is to represent ascii characters that otherwise would confuse
> things.  Maybe \circ should expand to ^; maybe there should be another
> entity for it (maybe neither).

You're right, there could be another entity for ^. asciicirc is good
enough as a name.  Would you want to make a patch for it?

Also, you may want to consider signing FSF papers for more important
contributions.

> Anyway; attaching the relevant patch (changelog tweaked), once again
> hoping I got the formatting and everything right.

Applied. Thanks again.


Regards,

-- 
Nicolas Goaziou

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

* Re: [PATCH] Add entities for /, +, _, =
  2012-05-25 15:04     ` Nicolas Goaziou
@ 2012-05-25 20:40       ` Mark E. Shoulson
  2012-05-25 21:23         ` Bastien
  0 siblings, 1 reply; 8+ messages in thread
From: Mark E. Shoulson @ 2012-05-25 20:40 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: org-mode mailing list

On 05/25/2012 11:04 AM, Nicolas Goaziou wrote:
> Hello,
> You're right, there could be another entity for ^. asciicirc is good
> enough as a name.  Would you want to make a patch for it?
>
> Also, you may want to consider signing FSF papers for more important
> contributions.
>
>
Yes, I'll do both those things, so don't worry about the patch.  Might 
have to wait until next week though.

~mark

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

* Re: [PATCH] Add entities for /, +, _, =
  2012-05-25 20:40       ` Mark E. Shoulson
@ 2012-05-25 21:23         ` Bastien
  0 siblings, 0 replies; 8+ messages in thread
From: Bastien @ 2012-05-25 21:23 UTC (permalink / raw)
  To: Mark E. Shoulson; +Cc: org-mode mailing list, Nicolas Goaziou

Hi Mark,

"Mark E. Shoulson" <mark@kli.org> writes:

> On 05/25/2012 11:04 AM, Nicolas Goaziou wrote:
>> Hello,
>> You're right, there could be another entity for ^. asciicirc is good
>> enough as a name.  Would you want to make a patch for it?
>>
>> Also, you may want to consider signing FSF papers for more important
>> contributions.
>
> Yes, I'll do both those things, so don't worry about the patch.  Might have
> to wait until next week though.

Thanks for doing this.  Note that the process of getting your papers
from FSF might take some time.

Best,

-- 
 Bastien

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

end of thread, other threads:[~2012-05-25 23:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-09  2:52 Entities Mark E. Shoulson
2012-05-23 21:53 ` Entities Nicolas Goaziou
2012-05-24  1:22   ` [PATCH] Fix for displaying entities ending in a number Mark E. Shoulson
2012-05-25 15:00     ` Nicolas Goaziou
2012-05-24  2:02   ` [PATCH] Add entities for /, +, _, = Mark E. Shoulson
2012-05-25 15:04     ` Nicolas Goaziou
2012-05-25 20:40       ` Mark E. Shoulson
2012-05-25 21:23         ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).