emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* intra links and worg
@ 2014-02-06 12:54 Alan Schmitt
  2014-02-06 16:31 ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Schmitt @ 2014-02-06 12:54 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I'm proof reading the ox-koma-letter tutorial on worg
(http://orgmode.org/worg/exporters/koma-letter-export.html) and I notice
that links inside the file are not exported as links, but as italics.
For instance,

--8<---------------cut here---------------start------------->8---
1. using Org option lines, as show in the [[*A%20simple%20letter%20example][simple letter example]] above,
--8<---------------cut here---------------end--------------->8---

is exported as

--8<---------------cut here---------------start------------->8---
<li>using Org option lines, as show in the <i>simple letter example</i> above,
</li>
--8<---------------cut here---------------end--------------->8---

Do we need to do something differently for such intra links?

Thanks,

Alan

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

* Re: intra links and worg
  2014-02-06 12:54 intra links and worg Alan Schmitt
@ 2014-02-06 16:31 ` Bastien
  2014-02-06 18:30   ` Alan Schmitt
  0 siblings, 1 reply; 6+ messages in thread
From: Bastien @ 2014-02-06 16:31 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode

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

Hi Alan,

if you can, please test this quick patch.

All tests pass fine but it's not the definitive patch as there
are other issues in this areas we need to check first.  But
tests will help, as always.

Thanks!


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix-org-escape-chars-in-links.patch --]
[-- Type: text/x-diff, Size: 1246 bytes --]

diff --git a/lisp/org.el b/lisp/org.el
index 27aeccb..50fa5ce 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -9834,17 +9834,18 @@ If optional argument MERGE is set, merge TABLE into
 	      (setq table (cons defchr table)))) org-link-escape-chars))
    ((null table)
     (setq table org-link-escape-chars)))
-  (mapconcat
-   (lambda (char)
-     (if (or (member char table)
-	     (and (or (< char 32) (= char ?\%) (> char 126))
-		  org-url-hexify-p))
-	 (mapconcat (lambda (sequence-element)
-		      (format "%%%.2X" sequence-element))
-		    (or (encode-coding-char char 'utf-8)
-			(error "Unable to percent escape character: %s"
-			       (char-to-string char))) "")
-       (char-to-string char))) text ""))
+  (if (string-match "^\*[[:alnum:]]+" text) text
+    (mapconcat
+     (lambda (char)
+       (if (or (member char table)
+	       (and (or (< char 32) (= char ?\%) (> char 126))
+		    org-url-hexify-p))
+	   (mapconcat (lambda (sequence-element)
+			(format "%%%.2X" sequence-element))
+		      (or (encode-coding-char char 'utf-8)
+			  (error "Unable to percent escape character: %s"
+				 (char-to-string char))) "")
+	 (char-to-string char))) text "")))
 
 (defun org-link-escape-browser (text)
   (if (org-string-match-p

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


-- 
 Bastien

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

* Re: intra links and worg
  2014-02-06 16:31 ` Bastien
@ 2014-02-06 18:30   ` Alan Schmitt
  2014-02-06 21:42     ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Schmitt @ 2014-02-06 18:30 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Hi Bastien,

Bastien <bzg@gnu.org> writes:

> Hi Alan,
>
> if you can, please test this quick patch.
>
> All tests pass fine but it's not the definitive patch as there
> are other issues in this areas we need to check first.  But
> tests will help, as always.

I tried it and it does not change anything on worg. It works on a simple
test file, but I'm wondering if some file specific options for worg may
change this. Here is the header with which I'm trying this:

--8<---------------cut here---------------start------------->8---
#+OPTIONS:    H:3 num:nil toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t TeX:t LaTeX:t skip:nil d:(HIDE) tags:not-in-toc todo:nil
#+STARTUP:    align fold nodlcheck hidestars oddeven lognotestate
#+SEQ_TODO:   TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@)
#+TAGS:       Write(w) Update(u) Fix(f) Check(c)
#+TITLE:      Creating letters with KOMA-Script =scrlttr2= and Org-mode
#+AUTHOR:     Viktor Rosenfeld and Rasmus Pank Roulund
#+EMAIL:      v.rosenfeld@gmx.de
#+LANGUAGE:   en
#+PRIORITIES: A C B
#+CATEGORY:   worg
--8<---------------cut here---------------end--------------->8---

Thanks,

Alan

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

* Re: intra links and worg
  2014-02-06 18:30   ` Alan Schmitt
@ 2014-02-06 21:42     ` Bastien
  2014-02-07 10:47       ` Alan Schmitt
  0 siblings, 1 reply; 6+ messages in thread
From: Bastien @ 2014-02-06 21:42 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode

Hi Alan,

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> I tried it and it does not change anything on worg.

The purpose of the patch is so that C-c C-l on a headline
will then insert a link without escaping whitespaces:

* Headline with whitespaces

[[*Headline with whitespaces][Headline with whitespaces]]

Whereas now it does this:

* Headline with whitespaces

[[*Headline%20with%20whitespaces][Headline with whitespaces]]

So if Worg pages contain escaped sequences, they will be exported
with italics.

-- 
 Bastien

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

* Re: intra links and worg
  2014-02-06 21:42     ` Bastien
@ 2014-02-07 10:47       ` Alan Schmitt
  2014-05-26 14:07         ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Schmitt @ 2014-02-07 10:47 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Bastien <bzg@gnu.org> writes:

> Hi Alan,
>
> Alan Schmitt <alan.schmitt@polytechnique.org> writes:
>
>> I tried it and it does not change anything on worg.
>
> The purpose of the patch is so that C-c C-l on a headline
> will then insert a link without escaping whitespaces:
>
> * Headline with whitespaces
>
> [[*Headline with whitespaces][Headline with whitespaces]]
>
> Whereas now it does this:
>
> * Headline with whitespaces
>
> [[*Headline%20with%20whitespaces][Headline with whitespaces]]
>
> So if Worg pages contain escaped sequences, they will be exported
> with italics.

Ah, thanks, I see now. It does work indeed.

Alan

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

* Re: intra links and worg
  2014-02-07 10:47       ` Alan Schmitt
@ 2014-05-26 14:07         ` Bastien
  0 siblings, 0 replies; 6+ messages in thread
From: Bastien @ 2014-05-26 14:07 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode

Hi Alan,

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> Ah, thanks, I see now. It does work indeed.

I've now applied a slightly modified version of the patch I sent.

Thanks,

-- 
 Bastien

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

end of thread, other threads:[~2014-05-26 14:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-06 12:54 intra links and worg Alan Schmitt
2014-02-06 16:31 ` Bastien
2014-02-06 18:30   ` Alan Schmitt
2014-02-06 21:42     ` Bastien
2014-02-07 10:47       ` Alan Schmitt
2014-05-26 14:07         ` 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).