Bug: Cannot insert multiple multi-line elisp links [9.4.4 (release_9.4.4 @ /usr/share/emacs/27.2/lisp/org/)]

2021-08-08 Thread Tim Landscheidt
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.



Re: [ANN] icsorg - node script to import events into org

2021-08-08 Thread Tim Cross


Eric S Fraga  writes:

> This looks very nice.  It would be good if a link and short description
> (e.g. your email contents) were added to the page you cite on Worg.

I don't have access to worg, but if anyone would like to update that
page and add my email (which they are free to edit) I would appreciate
it.




Re: citations: rx problems with emacs-26.3

2021-08-08 Thread Maxim Nikulin

On 08/08/2021 03:27, Nicolas Goaziou wrote:

Maxim Nikulin writes:


It seems, rx e.g. in emacs-26.3 does not support all features used in
oc.el and oc-csl.el. Loading an org file using git master, I get
a warning


Eager macro-expansion failure: (error "rx form ‘regexp’ requires args satisfying 
‘stringp’")



diff --git a/lisp/oc-basic.el b/lisp/oc-basic.el


Thanks. Could you send the patch again with a proper commit message,
using git format-patch?


I going to do it. For a while, I have noticed another problem with a lot 
of pcase branches in `org-cite-natbib--style-to-command' in and my 
experience is not enough to resolve it. On attempt to byte-compile-file
the following error is reported after significant delay (and CPU fan 
becomes more noisy)


oc-natbib.el:108:9:Error: Bytecode overflow

I have tried to comment out some conditions

ls -l lisp/oc-natbib.elc
-rw-rw-r-- 1 ubuntu ubuntu 241882 Aug  8 13:23 lisp/oc-natbib.elc

If more branches are commented out

-rw-rw-r-- 1 ubuntu ubuntu 8525 Aug  8 13:20 lisp/oc-natbib.el

Looks like a kind of combinatorics explosion. It seems, if Emacs-25.2 
and 26.3 are considered as supported, this function should be rewritten 
to avoid issues with byte compilation.







Re: Bug: Cannot insert multiple multi-line elisp links [9.4.4 (release_9.4.4 @ /usr/share/emacs/27.2/lisp/org/)]

2021-08-08 Thread Tim Landscheidt
(Sidenote: The issue can be worked around by replacing "\n"
with (make-string 1 10).)




Re: citations: rx problems with emacs-26.3

2021-08-08 Thread Nicolas Goaziou
Hello,

Maxim Nikulin  writes:

> On 08/08/2021 03:27, Nicolas Goaziou wrote:
>> Maxim Nikulin writes:
>>>
>>> It seems, rx e.g. in emacs-26.3 does not support all features used in
>>> oc.el and oc-csl.el. Loading an org file using git master, I get
>>> a warning
>>>
 Eager macro-expansion failure: (error "rx form ‘regexp’ requires args 
 satisfying ‘stringp’")
>>>
 diff --git a/lisp/oc-basic.el b/lisp/oc-basic.el
>> Thanks. Could you send the patch again with a proper commit message,
>> using git format-patch?
>
> I going to do it. For a while, I have noticed another problem with
> a lot of pcase branches in `org-cite-natbib--style-to-command' in and
> my experience is not enough to resolve it. On attempt to
> byte-compile-file
> the following error is reported after significant delay (and CPU fan
> becomes more noisy)
>
> oc-natbib.el:108:9:Error: Bytecode overflow

Fixed. Thank you.

Regards,
-- 
Nicolas Goaziou



Re: [PATCH] Rename headline to heading

2021-08-08 Thread Tom Gillespie
Hi André,
Thanks for taking a first pass at this. I think that this patch is
difficult to review. Could you break it into two separate patches, one
for documentation (non-code, e.g. docstring and comment) changes and
one for code changes?  That way we could more easily see where we may
need to mitigate the kind of issues Maxim noticed. Best!
Tom



org-attach-sync uses directory-empty-p (new in Emacs 28)

2021-08-08 Thread Kyle Meyer
Hi Marco,

In 61e083732 (org-attach: Possibly delete empty attach directory,
2021-07-09), you added a call to directory-empty-p.  This function was
introduced in Emacs's 0806075520 (Add directory-empty-p and new argument
COUNT for directory-files-*, 2020-11-02) and hasn't yet made it into a
release.

Could you update org-attach-sync to avoid using directory-empty-p (e.g.,
by inlining it or by adding a compatibility alias)?

Thanks.