emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug: Cannot insert multiple multi-line elisp links [9.4.4 (release_9.4.4


From: Tim Landscheidt
Subject: Bug: Cannot insert multiple multi-line elisp links [9.4.4 (release_9.4.4 @ /usr/share/emacs/27.2/lisp/org/)]
Date: Sun, 08 Aug 2021 08:13:41 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

With Emacs 27.2, I want to generate a list of stuff with em-
bedded Emacs Lisp scripts to work on it.  The Emacs Lisp
scripts have newlines as string literals in them.

When I evaluate:

| #+BEGIN_SRC elisp :results raw :var number-of-lines=1
|   (mapconcat
|    (lambda (i)
|      (concat
|       (org-link-make-string (concat "elisp:" (prin1-to-string `(message 
"Hello, World %d!\n" ,i))) (format "Test #1.%d" i))
|       "\n"))
|    (number-sequence 1 number-of-lines)
|    "")
| #+END_SRC

for the first time with C-c C-c, I get:

| #+RESULTS:
| [[elisp:(message "Hello, World %d!
| " 1)][Test #1.1]]

which, if shown in org-mode, is and works exactly correct.

(When I rerun C-C C-c, I get:

| #+RESULTS:
| [[elisp:(message "Hello, World %d!
| " 1)][Test #1.1]]
| " 1)][Test #1.1]]

which is not correct, but does not bother me much.)

When I evalute:

| #+BEGIN_SRC elisp :results raw :var number-of-lines=10
|   (mapconcat
|    (lambda (i)
|      (concat
|       (org-link-make-string (concat "elisp:" (prin1-to-string `(message 
"Hello, World %d!\n" ,i))) (format "Test #1.%d" i))
|       "\n"))
|    (number-sequence 1 number-of-lines)
|    "")
| #+END_SRC

I get:

| #+RESULTS:
| [[elisp:(message "Hello, World %d!
| " 1)][Test #1.1]]
| [[elisp:(message "Hello, World %d!
| " 2)][Test #1.2]]
| [[elisp:(message "Hello, World %d!
| " 3)][Test #1.3]]
| [[elisp:(message "Hello, World %d!
| " 4)][Test #1.4]]
| [[elisp:(message "Hello, World %d!
| " 5)][Test #1.5]]
| [[elisp:(message "Hello, World %d!
| " 6)][Test #1.6]]
| [[elisp:(message "Hello, World %d!
| " 7)][Test #1.7]]
| [[elisp:(message "Hello, World %d!
| " 8)][Test #1.8]]
| [[elisp:(message "Hello, World %d!
| " 9)][Test #1.9]]
| [[elisp:(message "Hello, World %d!
| " 10)][Test #1.10]]

where the last link ("Test #1.10") is not recognized by
org-mode and not clickable.

My guess is that org-link-make-string should escape new-
lines, but does not, and the org-mode parser is liberal
enough to "fix" some links, but not all.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]