* [PATCH] unicode nbsp in org-emphasis-regexp-components
@ 2010-10-22 22:39 Łukasz Stelmach
2010-10-24 16:05 ` Carsten Dominik
0 siblings, 1 reply; 3+ messages in thread
From: Łukasz Stelmach @ 2010-10-22 22:39 UTC (permalink / raw)
To: emacs-orgmode
Hi.
The Unicode contains a NON-BREAK SPACE character at position 0xA0. IMHO
org-mode's emphasis code should by default treat this (any other?)
character the same as normal space. When i write:
It was a /big bang/.
I'd like the "big bang" to be put in italic especially when exported to
HTML. (I don't know if it goes properly through all the mailing systems
but I put the "\u00A0" between "a" and "/" above.)
--8<---------------cut here---------------start------------->8---
diff --git a/lisp/org.el b/lisp/org.el
index 6ea9d25..b8cd38e 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3419,7 +3419,7 @@ After a match, the match groups contain these elements:
"\\([" post "]\\|$\\)")))))
(defcustom org-emphasis-regexp-components
- '(" \t('\"{" "- \t.,:!?;'\")}\\" " \t\r\n,\"'" "." 1)
+ '(" \t('\"{\u00A0" "- \t.,:!?;'\")}\\" " \t\r\n,\"'" "." 1)
"Components used to build the regular expression for emphasis.
This is a list with 6 entries. Terminology: In an emphasis string
like \" *strong word* \", we call the initial space PREMATCH, the final
--8<---------------cut here---------------end--------------->8---
--
Miłego dnia,
Łukasz Stelmach
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] unicode nbsp in org-emphasis-regexp-components
2010-10-22 22:39 [PATCH] unicode nbsp in org-emphasis-regexp-components Łukasz Stelmach
@ 2010-10-24 16:05 ` Carsten Dominik
2010-10-24 21:05 ` Łukasz Stelmach
0 siblings, 1 reply; 3+ messages in thread
From: Carsten Dominik @ 2010-10-24 16:05 UTC (permalink / raw)
To: Łukasz Stelmach; +Cc: emacs-orgmode
Hi Lukasz,
I am aftraid that this will break flavors of Emacs which do not
support unicode characters, like Emacs 22. Org-mode still supports
Emacs 22. And I do not know how to write this in a way that it
will remaind compatible. Do you?
- Carsten
On Oct 23, 2010, at 12:39 AM, Łukasz Stelmach wrote:
> Hi.
>
> The Unicode contains a NON-BREAK SPACE character at position 0xA0.
> IMHO
> org-mode's emphasis code should by default treat this (any other?)
> character the same as normal space. When i write:
>
> It was a /big bang/.
>
> I'd like the "big bang" to be put in italic especially when exported
> to
> HTML. (I don't know if it goes properly through all the mailing
> systems
> but I put the "\u00A0" between "a" and "/" above.)
>
> --8<---------------cut here---------------start------------->8---
> diff --git a/lisp/org.el b/lisp/org.el
> index 6ea9d25..b8cd38e 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -3419,7 +3419,7 @@ After a match, the match groups contain these
> elements:
> "\\([" post "]\\|$\\)")))))
>
> (defcustom org-emphasis-regexp-components
> - '(" \t('\"{" "- \t.,:!?;'\")}\\" " \t\r\n,\"'" "." 1)
> + '(" \t('\"{\u00A0" "- \t.,:!?;'\")}\\" " \t\r\n,\"'" "." 1)
> "Components used to build the regular expression for emphasis.
> This is a list with 6 entries. Terminology: In an emphasis string
> like \" *strong word* \", we call the initial space PREMATCH, the
> final
> --8<---------------cut here---------------end--------------->8---
>
> --
> Miłego dnia,
> Łukasz Stelmach
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] unicode nbsp in org-emphasis-regexp-components
2010-10-24 16:05 ` Carsten Dominik
@ 2010-10-24 21:05 ` Łukasz Stelmach
0 siblings, 0 replies; 3+ messages in thread
From: Łukasz Stelmach @ 2010-10-24 21:05 UTC (permalink / raw)
To: emacs-orgmode
Carsten Dominik <carsten.dominik@gmail.com> writes:
> On Oct 23, 2010, at 12:39 AM, Łukasz Stelmach wrote:
>
>> The Unicode contains a NON-BREAK SPACE character at position 0xA0.
>> IMHO org-mode's emphasis code should by default treat this (any
>> other?) character the same as normal space. When i write:
>>
>> It was a /big bang/.
>>
>> I'd like the "big bang" to be put in italic especially when exported
>> to HTML. (I don't know if it goes properly through all the mailing
>> systems but I put the "\u00A0" between "a" and "/" above.)
>>
[...]
>>
>
> I am aftraid that this will break flavors of Emacs which do not
> support unicode characters, like Emacs 22. Org-mode still supports
> Emacs 22. And I do not know how to write this in a way that it
> will remaind compatible. Do you?
How about simply checking the Emacs version?
(defcustom org-emphasis-regexp-components
(if (<= 23 (string-to-number (car (split-string emacs-version "\\."))))
'(" \t('\"{\u00A0" "- \t.,:!?;'\")}\\" " \t\r\n,\"'" "." 1)
'(" \t('\"{" "- \t.,:!?;'\")}\\" " \t\r\n,\"'" "." 1))
[...]
The problem with earlier version is that although most, if not all, ISO
Latin pages put `NO-BREAK SPACE' at 0xA0 some may use different
codepages. But they can do this also in newer Emacsen if they haven't
converted their files yet, can't they?
If you think putting `A0' in that regexp may break things, then I'd
suggest putting a note about it somewhere for people who'd like to
customise it for themselves.
--
Miłego dnia,
Łukasz Stelmach
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-10-24 21:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-22 22:39 [PATCH] unicode nbsp in org-emphasis-regexp-components Łukasz Stelmach
2010-10-24 16:05 ` Carsten Dominik
2010-10-24 21:05 ` Łukasz Stelmach
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).