emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* freemind.el does not convert org links to links in Freemind
@ 2012-09-11 13:35 Bill Day
  2012-09-18  7:30 ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Bill Day @ 2012-09-11 13:35 UTC (permalink / raw)
  To: emacs-orgmode

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

I am using org-mode 7.9.1 and Freemind 0.9.0.  Freemind.el seems to convert
nodes from org to Freemind with no problem, but it simply copies the code
for links from org to Freemind without converting it.

Has anyone else had this problem?

Any workarounds?

-- 
Bill Day
williamson.day@gmail.com

[-- Attachment #2: Type: text/html, Size: 387 bytes --]

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

* Re: freemind.el does not convert org links to links in Freemind
  2012-09-11 13:35 freemind.el does not convert org links to links in Freemind Bill Day
@ 2012-09-18  7:30 ` Bastien
  2012-09-19  2:12   ` Bill Day
  0 siblings, 1 reply; 6+ messages in thread
From: Bastien @ 2012-09-18  7:30 UTC (permalink / raw)
  To: Bill Day; +Cc: emacs-orgmode

Hi Bill,

Bill Day <williamson.day@gmail.com> writes:

> I am using org-mode 7.9.1 and Freemind 0.9.0.  Freemind.el seems to
> convert nodes from org to Freemind with no problem, but it simply
> copies the code for links from org to Freemind without converting
> it. 

I'm not sure i understand -- are you talking about org-freemind.el?

http://orgmode.org/w/?p=org-mode.git;a=blob_plain;f=lisp/org-freemind.el;hb=HEAD

> Has anyone else had this problem?

AFAIU I don't.

This link in .org:

  A [[http://orgmode.org][link]].

gets exported as

  A <a href="http://orgmode.org">link</a>.

in .mm

HTH,

-- 
 Bastien

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

* Re: freemind.el does not convert org links to links in Freemind
  2012-09-18  7:30 ` Bastien
@ 2012-09-19  2:12   ` Bill Day
  2012-09-19  7:24     ` Bastien
  2012-09-19  8:23     ` Bill Day
  0 siblings, 2 replies; 6+ messages in thread
From: Bill Day @ 2012-09-19  2:12 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

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

Sorry, yes, I mistyped -- it is org-freemind.el.

When I type:

* Mind Map
** test [[http://orgmode.org][Org Mode]]

I get this:

<map version="0.9.0">
<!-- To view this file, download free mind mapping software FreeMind from
http://freemind.sourceforge.net -->
<node text="Mind Map">
<node text="test [[http://orgmode.org][Org Mode]]">
</node>
</node>
</map>

Is this the expected behavior?


On Tue, Sep 18, 2012 at 3:30 AM, Bastien <bzg@altern.org> wrote:

> Hi Bill,
>
> Bill Day <williamson.day@gmail.com> writes:
>
> > I am using org-mode 7.9.1 and Freemind 0.9.0.  Freemind.el seems to
> > convert nodes from org to Freemind with no problem, but it simply
> > copies the code for links from org to Freemind without converting
> > it.
>
> I'm not sure i understand -- are you talking about org-freemind.el?
>
>
> http://orgmode.org/w/?p=org-mode.git;a=blob_plain;f=lisp/org-freemind.el;hb=HEAD
>
> > Has anyone else had this problem?
>
> AFAIU I don't.
>
> This link in .org:
>
>   A [[http://orgmode.org][link]].
>
> gets exported as
>
>   A <a href="http://orgmode.org">link</a>.
>
> in .mm
>
> HTH,
>
> --
>  Bastien
>



-- 
Bill Day
williamson.day@gmail.com

[-- Attachment #2: Type: text/html, Size: 2236 bytes --]

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

* Re: freemind.el does not convert org links to links in Freemind
  2012-09-19  2:12   ` Bill Day
@ 2012-09-19  7:24     ` Bastien
  2012-09-19  8:23     ` Bill Day
  1 sibling, 0 replies; 6+ messages in thread
From: Bastien @ 2012-09-19  7:24 UTC (permalink / raw)
  To: Bill Day; +Cc: emacs-orgmode

Hi Bill,

Bill Day <williamson.day@gmail.com> writes:

> Sorry, yes, I mistyped -- it is org-freemind.el.
>
> When I type:
>
> * Mind Map
> ** test [[http://orgmode.org][Org Mode]]
>
> I get this:
>
> <map version="0.9.0">
> <!-- To view this file, download free mind mapping software FreeMind
> from http://freemind.sourceforge.net -->
> <node text="Mind Map">
> <node text="test [[http://orgmode.org][Org Mode]]">
> </node>
> </node>
> </map>
>
> Is this the expected behavior?

Nope.  I fixed this by inserting the label of the link instead.

So you should get 

<node text="test Org Mode (link)">

HTH,

-- 
 Bastien

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

* Re: freemind.el does not convert org links to links in Freemind
  2012-09-19  2:12   ` Bill Day
  2012-09-19  7:24     ` Bastien
@ 2012-09-19  8:23     ` Bill Day
  2012-09-19  8:47       ` Bastien
  1 sibling, 1 reply; 6+ messages in thread
From: Bill Day @ 2012-09-19  8:23 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

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

This is how Freedmind natively outputs the same link:

<map version="0.9.0">
<!-- To view this file, download free mind mapping software FreeMind from
http://freemind.sourceforge.net -->
<node CREATED="1348041631372" ID="ID_319286743" MODIFIED="1348042704516"
TEXT="Mind Map">
<node CREATED="1348041642465" ID="ID_207824320" LINK="http://orgmode.org"
MODIFIED="1348041668536" POSITION="right" TEXT="test"/>
</node>
</map>

I am not much at reading elisp, but it seems that the following code in
org-freemind.el might be intended to achieve the above result.

(defun org-freemind-convert-links-helper (matched)
  "Helper for `org-freemind-convert-links-from-org'.
MATCHED is the link just matched."
  (let* ((link (match-string 1 matched))
         (text (match-string 2 matched))
         (ext (file-name-extension link))
         (col-pos (org-string-match-p ":" link))
         (is-img (and (image-type-from-file-name link)
                      (let ((url-type (substring link 0 col-pos)))
                        (member url-type '("file" "http" "https")))))
     )
    (if is-img
        ;; Fix-me: I can't find a way to get the border to "shrink
        ;; wrap" around the image using <div>.
        ;;
        ;; (concat "<div style=\"border: solid 1px #ddd; width:auto;\">"
        ;;         "<img src=\"" link "\" alt=\"" text "\" />"
        ;;         "<br />"
        ;;         "<i>" text "</i>"
        ;;         "</div>")
        (concat "<table border=\"0\" style=\"border: solid 1px
#ddd;\"><tr><td>"
                "<img src=\"" link "\" alt=\"" text "\" />"
                "<br />"
                "<i>" text "</i>"
                "</td></tr></table>")
      (concat "<a href=\"" link "\">" text "</a>"))))

(defun org-freemind-convert-links-from-org (org-str)
  "Convert org links in ORG-STR to freemind links and return the result."
  (let ((fm-str (replace-regexp-in-string
                 ;;(rx (not (any "[\""))
                 ;;    (submatch
                 ;;     "http"
                 ;;     (opt ?\s)
                 ;;     "://"
                 ;;     (1+
                 ;;      (any "-%.?@a-zA-Z0-9()_/:~=&#"))))
         "[^\"[]\\(http ?://[--:#%&()=?-Z_a-z~]+\\)"
                 "[[\\1][\\1]]"
                 org-str
                 nil ;; fixedcase
                 nil ;; literal
                 1   ;; subexp
                 )))
    (replace-regexp-in-string
     ;;(rx "[["
     ;;     (submatch (*? nonl))
     ;; "]["
     ;; (submatch (*? nonl))
     ;; "]]")
     "\\[\\[\\(.*?\\)]\\[\\(.*?\\)]]"
     ;;"<a href=\"\\1\">\\2</a>"
     'org-freemind-convert-links-helper
     fm-str t t)))


I am not trying to muddy the waters here, it is just that when I type a
link into org-mode, I do not seem to get a usable freemind link as a result.


On Tue, Sep 18, 2012 at 10:12 PM, Bill Day <williamson.day@gmail.com> wrote:

> Sorry, yes, I mistyped -- it is org-freemind.el.
>
> When I type:
>
> * Mind Map
> ** test [[http://orgmode.org][Org Mode]]
>
> I get this:
>
> <map version="0.9.0">
> <!-- To view this file, download free mind mapping software FreeMind from
> http://freemind.sourceforge.net -->
> <node text="Mind Map">
> <node text="test [[http://orgmode.org][Org Mode]]">
> </node>
> </node>
> </map>
>
> Is this the expected behavior?
>
>
>
> On Tue, Sep 18, 2012 at 3:30 AM, Bastien <bzg@altern.org> wrote:
>
>> Hi Bill,
>>
>> Bill Day <williamson.day@gmail.com> writes:
>>
>> > I am using org-mode 7.9.1 and Freemind 0.9.0.  Freemind.el seems to
>> > convert nodes from org to Freemind with no problem, but it simply
>> > copies the code for links from org to Freemind without converting
>> > it.
>>
>> I'm not sure i understand -- are you talking about org-freemind.el?
>>
>>
>> http://orgmode.org/w/?p=org-mode.git;a=blob_plain;f=lisp/org-freemind.el;hb=HEAD
>>
>> > Has anyone else had this problem?
>>
>> AFAIU I don't.
>>
>> This link in .org:
>>
>>   A [[http://orgmode.org][link]].
>>
>> gets exported as
>>
>>   A <a href="http://orgmode.org">link</a>.
>>
>> in .mm
>>
>> HTH,
>>
>> --
>>  Bastien
>>
>
>
>
> --
> Bill Day
> williamson.day@gmail.com
>



-- 
Bill Day
williamson.day@gmail.com

[-- Attachment #2: Type: text/html, Size: 6719 bytes --]

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

* Re: freemind.el does not convert org links to links in Freemind
  2012-09-19  8:23     ` Bill Day
@ 2012-09-19  8:47       ` Bastien
  0 siblings, 0 replies; 6+ messages in thread
From: Bastien @ 2012-09-19  8:47 UTC (permalink / raw)
  To: Bill Day; +Cc: emacs-orgmode

Hi Bill,

Bill Day <williamson.day@gmail.com> writes:

> This is how Freedmind natively outputs the same link:

Thanks -- I've now implemented this.

I won't fix org-freemind.el any further though, first because
going through the code is quite adventurous (congrats for your
courage here) and second because I think org-e-freemind.el is
under its way.

Thanks for giving the helpful example,

-- 
 Bastien

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

end of thread, other threads:[~2012-09-19  8:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-11 13:35 freemind.el does not convert org links to links in Freemind Bill Day
2012-09-18  7:30 ` Bastien
2012-09-19  2:12   ` Bill Day
2012-09-19  7:24     ` Bastien
2012-09-19  8:23     ` Bill Day
2012-09-19  8:47       ` 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).