emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* export of emphasized link
@ 2010-05-30 12:53 Michael Brand
  2010-06-01  7:44 ` Carsten Dominik
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Brand @ 2010-05-30 12:53 UTC (permalink / raw)
  To: Org Mode

Hi all,

An org-mode line with an emphasized link like that one taken from current Worg:
----------------------------------------------------------------------
*Drop an email to [[mailto:bzg%20AT%20altern%20DOT%20org][Bastien]]* 
mentioning your username on repo.or.cz
----------------------------------------------------------------------
shows the bold face in the Emacs Org buffer like expected. But it does not 
convert the emphasis and still shows `*' when exported to some formats:
- HTML: not converted
- LaTeX: could not check because of a missing setup on my side,
                    from the source code I guess that it converts
- DocBook: not converted
- ...: don't know about other formats and what they should support

After removing org-bracket-link-regexp from org-html-expand and 
org-docbook-expand the HTML and DocBook exports _are_ converted and look 
similar to the highlighting in the Emacs Org buffer. But the doc string of 
both functions tell:
"If there are links in the string, don't modify these."
Why should links be modified in org-mode but not in HTML or DocBook?

If there will be any change I would also like this:
----------------------------------------------------------------------
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3285,6 +3285,7 @@ example *bold*, _underlined_ and /italic/.  This variable
  characters, the face to be used by font-lock for highlighting in Org-mode
  Emacs buffers, and the HTML tags to be used for this.
  For LaTeX export, see the variable `org-export-latex-emphasis-alist'.
+For DocBook export, see the variable `org-export-docbook-emphasis-alist'.
  Use customize to modify this, or restart Emacs after changing it."
    :group 'org-appearance
    :set 'org-set-emph-re
----------------------------------------------------------------------

And: wouldn't it be nice for maintenance to have only one function for some 
sets of functions like
- org-html-expand, org-docbook-expand and possibly more
- org-html-do-expand, org-docbook-do-expand and possibly more
- org-export-html-convert-emphasize, org-export-docbook-convert-emphasize and 
possibly more
- org-export-html-convert-sub-super, org-export-docbook-convert-sub-super and 
possibly more
- possibly more
because they have almost all code in common.

Michael

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

* Re: export of emphasized link
  2010-05-30 12:53 export of emphasized link Michael Brand
@ 2010-06-01  7:44 ` Carsten Dominik
  2010-06-01  8:53   ` Bastien
  2010-06-01 17:03   ` Michael Brand
  0 siblings, 2 replies; 4+ messages in thread
From: Carsten Dominik @ 2010-06-01  7:44 UTC (permalink / raw)
  To: Michael Brand; +Cc: Org Mode

Hi Michael,

On May 30, 2010, at 2:53 PM, Michael Brand wrote:

> Hi all,
>
> An org-mode line with an emphasized link like that one taken from  
> current Worg:
> ----------------------------------------------------------------------
> *Drop an email to [[mailto:bzg%20AT%20altern%20DOT%20org][Bastien]]*  
> mentioning your username on repo.or.cz

I would write this as

    *Drop an email to* [[mailto:bzg%20AT%20altern%20DOT%20org][Bastien]]

i.e. take the link out of the bold section.

> ----------------------------------------------------------------------
> shows the bold face in the Emacs Org buffer like expected. But it  
> does not convert the emphasis and still shows `*' when exported to  
> some formats:
> - HTML: not converted
> - LaTeX: could not check because of a missing setup on my side,
>                   from the source code I guess that it converts
> - DocBook: not converted
> - ...: don't know about other formats and what they should support
>
> After removing org-bracket-link-regexp from org-html-expand

What do you mean by this sentence?  What exactly did you do?

> and org-docbook-expand the HTML and DocBook exports _are_ converted  
> and look similar to the highlighting in the Emacs Org buffer. But  
> the doc string of both functions tell:
> "If there are links in the string, don't modify these."
> Why should links be modified in org-mode but not in HTML or DocBook?
>
> If there will be any change I would also like this:
> ----------------------------------------------------------------------
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -3285,6 +3285,7 @@ example *bold*, _underlined_ and /italic/.   
> This variable
> characters, the face to be used by font-lock for highlighting in Org- 
> mode
> Emacs buffers, and the HTML tags to be used for this.
> For LaTeX export, see the variable `org-export-latex-emphasis-alist'.
> +For DocBook export, see the variable `org-export-docbook-emphasis- 
> alist'.
> Use customize to modify this, or restart Emacs after changing it."
>   :group 'org-appearance
>   :set 'org-set-emph-re
> ----------------------------------------------------------------------

I have applied this patch.

>
> And: wouldn't it be nice for maintenance to have only one function  
> for some sets of functions like
> - org-html-expand, org-docbook-expand and possibly more
> - org-html-do-expand, org-docbook-do-expand and possibly more
> - org-export-html-convert-emphasize, org-export-docbook-convert- 
> emphasize and possibly more
> - org-export-html-convert-sub-super, org-export-docbook-convert-sub- 
> super and possibly more
> - possibly more
> because they have almost all code in common.

Yes, that would be nice.  It would also be nice if all exporters
would basically use the same code - but this is not how things
happened, unfortunately.

- Carsten

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

* Re: export of emphasized link
  2010-06-01  7:44 ` Carsten Dominik
@ 2010-06-01  8:53   ` Bastien
  2010-06-01 17:03   ` Michael Brand
  1 sibling, 0 replies; 4+ messages in thread
From: Bastien @ 2010-06-01  8:53 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Michael Brand, Org Mode

Carsten Dominik <carsten.dominik@gmail.com> writes:

> I would write this as
>
>    *Drop an email to* [[mailto:bzg%20AT%20altern%20DOT%20org][Bastien]]
>
> i.e. take the link out of the bold section.

Done. 

-- 
 Bastien

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

* Re: export of emphasized link
  2010-06-01  7:44 ` Carsten Dominik
  2010-06-01  8:53   ` Bastien
@ 2010-06-01 17:03   ` Michael Brand
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Brand @ 2010-06-01 17:03 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Org Mode

On 10-06-01 09:44 , Carsten Dominik wrote:
>> After removing org-bracket-link-regexp from org-html-expand
>
> What do you mean by this sentence? What exactly did you do?

To understand the implementation I tried the following temporary
change (the line prefix `:' will bypass the nice patch extract
http://patchwork.newartisans.com/project/org-mode/list
for this time I hope):
------------------------------------------------------------
:--- a/lisp/org-html.el
:+++ b/lisp/org-html.el
:@@ -2025,8 +2025,7 @@ that uses these same face definitions."
: (defun org-html-expand (string)
:   "Prepare STRING for HTML export.  Applies all active conversions.
: If there are links in the string, don't modify these."
:-  (let* ((re (concat org-bracket-link-regexp "\\|"
:-                    (org-re "[ \t]+\\(:[[:alnum:]_@:]+:\\)[ \t]*$")))
:+  (let* ((re (org-re "[ \t]+\\(:[[:alnum:]_@:]+:\\)[ \t]*$"))
:         m s l res)
:     (if (string-match "^[ \t]*\\+-[-+]*\\+[ \t]*$" string)
:        string
------------------------------------------------------------

With this trial the export to HTML of emphasized links is supported.
But this should not happen as I understand the doc string of
org-html-expand and org-docbook-expand:
"If there are links in the string, don't modify these."
Why should emphasized links not be supported for the export to HTML
and DocBook (and maybe more export formats?) while the org-mode
buffer display (and maybe some export formats?) supports them?

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

end of thread, other threads:[~2010-06-01 17:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-30 12:53 export of emphasized link Michael Brand
2010-06-01  7:44 ` Carsten Dominik
2010-06-01  8:53   ` Bastien
2010-06-01 17:03   ` Michael Brand

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