Re: strange error exporting to ascii

2023-12-22 Thread Ihor Radchenko
"Fraga, Eric"  writes:

> On Friday, 22 Dec 2023 at 13:53, Ihor Radchenko wrote:
>> Looks like your #+bibliography does not follow
>>
>> #+BIBLIOGRAPHY: /home/user/Literature/foo.bib plain option:-d
>>
>> format.
>
> It does not but the documentation does not say anything about a format
> at all like this.  What are the two items following the bib file?

I have no clue. The error you are seeing is coming from
`org-bibtex-process-bib-files', which is not a part of Org mode - it is
defined in ox-bibtex.el from org-contrib (unmaintained!!!).

> I do have
> #+cite_export: csl "/somepath/style.csl"
> as well as a BIBLIOGRAPHY entry with just a file name.
>
> In any case, I modified the bibliography line and it then complained
> about no bibtex2html (which didn't seem to be needed before?).  I
> installed that package and now the export complains about that command
> failing.  I seem to be going down a rabbit hole.

This is also something from ox-bibtex.el. I suspect that you do not need
ox-bibtex.el. It is an old library predating Org's native citation support.

Also, merely loading ox-bibtex.el changes Org export behaviour. Be careful.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: strange error exporting to ascii

2023-12-22 Thread Fraga, Eric
On Friday, 22 Dec 2023 at 15:58, Ihor Radchenko wrote:
> This is a problem with Org mode compilation. Try to reinstall.

Problem persists.  I've done

make update

restart emacs: fails to export.  Then

make cleanall
make

and restart emacs but also fails to export, both times with same error
message:

 Debugger entered--Lisp error: (invalid-function org-element-with-buffer-copy)
  org-element-with-buffer-copy([...])
  org-cite-parse-elements("Alba, E.; Tomassini, M. 
[[https://doi.org/10.1109/...;)
  org-cite-csl-render-bibliography([...])
  org-cite-export-bibliography([...])


Extra data point: using older version of org (on a different computer),
having removed ox-bibtex requirement, is able to export to both ascii
and odt.

-- 
: Eric S Fraga, with org release_9.6.13-1003-g872c1b in Emacs 30.0.50


Re: strange error exporting to ascii

2023-12-22 Thread Fraga, Eric
Another data point: if I do a

make cleanall

and then start emacs without org compiled, exporting (to both targets)
works, although there are complaints initially about the autoload file
not being present etc.

Slow, mind you. ;-) But I can live with this in the short term so I can
get my work done!

So there seems to be some compilation bug maybe?  I will build Emacs
from git as the version I'm using was built in September (I don't update
during term time as I depend on Emacs and org for my teaching).  I'll
report back after doing so.

Thank you for helping me out.

-- 
: Eric S Fraga, with org release_9.6.7-13-g99cc96 in Emacs 30.0.50


Re: [PATCH] ob-C.el compile-only header argument, was Re: How to use mpirun with C or C++ Org-babel?

2023-12-22 Thread Ihor Radchenko
Leo Butler  writes:

>> What will happen if we have something like :results value or :results
>> output instead of :results file link?
>
> Originally, I felt that only ":results file" makes sense. I have adopted
> your suggestion, though, and added test cases so that the compiler
> stderr output is caught.

Thanks! This makes sense, but now the default behaviour (when no :results
type is specified) is unexpected.

When you have something like

#+begin_src C :compile-only t :file foo :includes "stdio.h"
printf("This is test");
#+end_src

, executing should yield file link, even though it is not explicitly
specified.

And when you have compilation error,

#+begin_src C :compile-only t :file foo :includes "stdio.h"
printf("This is test")
#+end_src

the result may be empty - buffer displayed by `org-babel-eval' is
probably enough.

Basically, Org babel promises DWIM behavior when :results type is not
explicitly stated.

P.S. In my testing, I wrote

#+begin_src C :compile-only t :file foo :includes "stdio.h"
(printf "This is test")
#+end_src

and was staring at the compilation error for a good minute, trying to
understand what the hell did I do wrongly 臘.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Unable to install from elpa

2023-12-22 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Let's first try to report and see what the reply is.
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63800

This is now semi-fixed on ELPA. Not for Org mode, but for other built-in
packages. Org mode in particular is not (yet). See
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63800#98

I now updated Org's readme file to describe installation via M-x
list-packages.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=11c626b52
Fixed. As much as we can on Org side.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: strange error exporting to ascii

2023-12-22 Thread Fraga, Eric
Hi Ihor,

thank you for the response.

On Friday, 22 Dec 2023 at 13:53, Ihor Radchenko wrote:
> Looks like your #+bibliography does not follow
>
> #+BIBLIOGRAPHY: /home/user/Literature/foo.bib plain option:-d
>
> format.

It does not but the documentation does not say anything about a format
at all like this.  What are the two items following the bib file?

I do have
#+cite_export: csl "/somepath/style.csl"
as well as a BIBLIOGRAPHY entry with just a file name.

In any case, I modified the bibliography line and it then complained
about no bibtex2html (which didn't seem to be needed before?).  I
installed that package and now the export complains about that command
failing.  I seem to be going down a rabbit hole.

Thanks again,
eric

-- 
: Eric S Fraga, with org release_9.6.8-771-gdf0539 in Emacs 30.0.50


Re: strange error exporting to ascii

2023-12-22 Thread Ihor Radchenko
"Fraga, Eric"  writes:

> Ah!  Interesting.  I had forgotten about requiring ox-bibtex in my
> configuration files.  I've now removed it but now get a new error
> (elided):
>
> Debugger entered--Lisp error: (invalid-function org-element-with-buffer-copy)
>   org-element-with-buffer-copy(:to-buffer # 
> :drop-contents t :drop-visibility t :drop-narrowing t :drop-locals t nil nil 
> [...])
>   org-cite-parse-elements("Alba, E.; Tomassini, M. 
> [[https://doi.org/10.1109/...;)
>   org-cite-csl-render-bibliography([...])

This is a problem with Org mode compilation. Try to reinstall.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [PATCH] Re: [feature request] startup variable for link display

2023-12-22 Thread Ihor Radchenko
Rudolf Adamkovič  writes:

>> #+startup: showlinks
>> and
>> #+startup: compresslinks
>
> Why not continue with established terminology?
>
> #+STARTUP: descriptivelinks
> #+STARTUP: literallinks

I do not have a strong opinion here.
I used "show" following showstars/showeverything/etc and because it is
shorter. "hide" did not fit though, which is why I went with "compress".

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] orgmode.org is not up-to-date with the latest orgweb master

2023-12-22 Thread Ihor Radchenko
Bastien Guerry  writes:

>> Bastien, may you please check the publish scripts?
>
> I've launched it, the translation is online now.

Thanks!
Fixed.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: strange error exporting to ascii

2023-12-22 Thread Fraga, Eric
On Friday, 22 Dec 2023 at 15:14, Ihor Radchenko wrote:

[...]

> This is also something from ox-bibtex.el. I suspect that you do not need
> ox-bibtex.el. It is an old library predating Org's native citation support.
>
> Also, merely loading ox-bibtex.el changes Org export behaviour. Be careful.

Ah!  Interesting.  I had forgotten about requiring ox-bibtex in my
configuration files.  I've now removed it but now get a new error
(elided):

Debugger entered--Lisp error: (invalid-function org-element-with-buffer-copy)
  org-element-with-buffer-copy(:to-buffer # :drop-contents 
t :drop-visibility t :drop-narrowing t :drop-locals t nil nil [...])
  org-cite-parse-elements("Alba, E.; Tomassini, M. 
[[https://doi.org/10.1109/...;)
  org-cite-csl-render-bibliography([...])

for both exports to ascii and odt, although slightly different text in
the org-cite-parse-elements function.

Export to LaTeX continues to work.

-- 
: Eric S Fraga, with org release_9.6.8-771-gdf0539 in Emacs 30.0.50


Re: [PATCH] Re: [feature request] startup variable for link display

2023-12-22 Thread Rudolf Adamkovič
Ihor Radchenko  writes:

> #+startup: showlinks
> and
> #+startup: compresslinks

Why not continue with established terminology?

#+STARTUP: descriptivelinks
#+STARTUP: literallinks

Rudy
-- 
"It is no paradox to say that in our most theoretical moods we may be
nearest to our most practical applications."
--- Alfred North Whitehead, 1861-1947

Rudolf Adamkovič  [he/him]
Studenohorská 25
84103 Bratislava
Slovakia



Re: strange error exporting to ascii

2023-12-22 Thread Ihor Radchenko
"Fraga, Eric"  writes:

> So there seems to be some compilation bug maybe?  I will build Emacs
> from git as the version I'm using was built in September (I don't update
> during term time as I depend on Emacs and org for my teaching).  I'll
> report back after doing so.

This is most likely a bug with internal dependencies.
I need some time to figure out how to approach it.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



[PATCH] Re: [feature request] startup variable for link display

2023-12-22 Thread Ihor Radchenko
"Fraga, Eric"  writes:

> Assuming I have not missed something, is there a variable I can set on
> visiting an org buffer/file that ensures that links are displayed fully?
>
> Once I've loaded an org file, I can
>
>M-x org-toggle-link-display RET.
>
> but I would like certain files to start up with links displayed.
>
> If not already possible, it would be nice to either set a file local
> variable or have, say:
>
> #+startup: displaylinks

I went with

#+startup: showlinks
and
#+startup: compresslinks

See the attached patch.
Please test.

>From f180be291a81062a5c6344876c172282969d4c66 Mon Sep 17 00:00:00 2001
Message-ID: 
From: Ihor Radchenko 
Date: Fri, 22 Dec 2023 13:04:04 +0100
Subject: [PATCH] Allow per-buffer setting of org-link-descriptive via
 #+STARTUP options

* lisp/org.el (org-startup-options): Add new startup options to set
`org-link-descriptive'.
(org-mode): Move #+startup keyword parsing before setting up link
visibility.
* doc/org-manual.org (Link Format):
(Summary of In-Buffer Settings): Document the new startup option.
* etc/ORG-NEWS (~org-link-descriptive~ can now be set per-buffer via
=#+STARTUP= options): Announce the new feature.

Link: https://orgmode.org/list/87bkst1nfl@ucl.ac.uk
---
 doc/org-manual.org | 14 +-
 etc/ORG-NEWS   |  8 
 lisp/org.el| 24 +---
 3 files changed, 34 insertions(+), 12 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index cfa59ec37..da9d8c837 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -3172,7 +3172,8 @@ ** Link Format
 incomplete and the internals are again displayed as plain text.
 Inserting the missing bracket hides the link internals again.  To show
 the internal structure of all links, use the menu: Org \rarr
-Hyperlinks \rarr Literal links.
+Hyperlinks \rarr Literal links, customize ~org-link-descriptive~, or use
+=showlinks= [[*Summary of In-Buffer Settings][startup option]].
 
 ** Internal Links
 :PROPERTIES:
@@ -20229,6 +20230,17 @@ ** Summary of In-Buffer Settings
   | =inlineimages=   | Show inline images.   |
   | =noinlineimages= | Do not show inline images on startup. |
 
+  #+vindex: org-link-descriptive
+  Bracket links in Org buffers are displayed hiding the link path and
+  brackets.  For example, =[[https://orgmode.org][Org Website]]= is,
+  by default, displayed as "Org Website", hiding the link itself and
+  just displaying its description.  Alternatively, the links can be
+  displayed in full.  The corresponding variable is
+  ~org-link-descriptive~.
+
+  | =compresslinks= | Hide path and brackets in links. |
+  | =showlinks= | Do not hide anything.|
+
   #+vindex: org-log-done
   #+vindex: org-log-note-clock-out
   #+vindex: org-log-repeat
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 6c81221c1..9b3f83705 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -362,6 +362,14 @@ The change is breaking when ~org-use-property-inheritance~ is set to ~t~.
 
 The =TEST= parameter is better served by Emacs debugging tools.
 ** New and changed options
+*** ~org-link-descriptive~ can now be set per-buffer via =#+STARTUP= options
+
+In addition to ~org-link-descriptive~ custom option, link display can
+now be controlled per-buffer as:
+
+: #+STARTUP: showlinks
+: #+STARTUP: compresslinks
+
 *** New variable ~org-clock-out-removed-last-clock~
 
 The variable is intended to be used by ~org-clock-out-hook~.  It is a
diff --git a/lisp/org.el b/lisp/org.el
index 6e6e075b4..7f7bc3000 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -4061,6 +4061,8 @@ (defconst org-startup-options
 ("align" org-startup-align-all-tables t)
 ("noalign" org-startup-align-all-tables nil)
 ("shrink" org-startup-shrink-all-tables t)
+("compresslinks" org-link-descriptive t)
+("showlinks" org-link-descriptive nil)
 ("inlineimages" org-startup-with-inline-images t)
 ("noinlineimages" org-startup-with-inline-images nil)
 ("latexpreview" org-startup-with-latex-preview t)
@@ -4847,6 +4849,17 @@ (define-derived-mode org-mode outline-mode "Org"
   (org-load-modules-maybe)
   (when org-agenda-file-menu-enabled
 (org-install-agenda-files-menu))
+  (setq-local outline-regexp org-outline-regexp)
+  (setq-local outline-level 'org-outline-level)
+  ;; Initialize cache.
+  (org-element-cache-reset)
+  (when (and org-element-cache-persistent
+ org-element-use-cache)
+(org-persist-load
+ `((elisp org-element--cache) (version ,org-element-cache-version))
+ (current-buffer)
+ 'match-hash :read-related t))
+  (org-set-regexps-and-options)
   (when (and org-link-descriptive
  (eq org-fold-core-style 'overlays))
 (add-to-invisibility-spec '(org-link)))
@@ -4857,8 +4870,6 @@ (define-derived-mode org-mode outline-mode "Org"
   (if org-link-descriptive
   (org-fold-core-set-folding-spec-property (car org-link--link-folding-spec) :visible nil)
 (org-fold-core-set-folding-spec-property (car 

Re: strange error exporting to ascii

2023-12-22 Thread Ihor Radchenko
"Fraga, Eric"  writes:

> So, long story short, I try to export the original document to ascii and
> I get an error related to citations.  Having seen some updates to
> exporting citations on the list over the past few weeks, I figured I
> should upgrade org to the latest version.  Now exporting to LaTeX still
> works just fine but exporting to ascii still does not work (with the
> same error: see backtrace-ascii.txt attached) *and* exporting to ODT now
> no longer works (see backtrace-odt.txt).
>
> Any suggestions?  I have not tried emacs -Q because that is non-trivial
> due to my configuration but will do so if nothing obvious jumps out to
> anybody.

Looks like your #+bibliography does not follow

#+BIBLIOGRAPHY: /home/user/Literature/foo.bib plain option:-d

format.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: strange error exporting to ascii

2023-12-22 Thread Fraga, Eric
On Friday, 22 Dec 2023 at 16:36, Ihor Radchenko wrote:
>
> This is most likely a bug with internal dependencies.
> I need some time to figure out how to approach it.

Okay, thank you.

For the record, I've re-built Emacs from git and the problem persists so
it's not (necessarily) Emacs itself.

And no rush, by the way: I have a working solution which is what
matters!

Thanks again,
eric

-- 
: Eric S Fraga, with org release_9.6.13-1003-g872c1b in Emacs 30.0.50


[BUG] ox-beamer uses ox-latex private functions

2023-12-22 Thread Niall Dooley
In three separate places (lines 779, 825 and 874) ox-beamer uses
ox-latex private functions namely:

line779: `org-latex--wrap-label'
line 825: `org-latex--insert-compiler'
line 874: `org-latex--format-spec'

I appreciate ox-beamer is a backend backend derived from ox-latex but
isn't this bad practice if these private functions were to change in
future?

Emacs: GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.24, cairo version 1.16.0) of 2023-02-23, modified by Debian
Package: Org mode version 9.7-pre (release_9.6.9-818-gac108a)



[QUESTION] Should KEYWORD values in org-export-options-alist be lowercase?

2023-12-22 Thread Niall Dooley
Should the KEYWORD values in `org-export-options-alist' that are
uppercase be lowercase to reflect what users see say when using a
template and/or for consistency?

Similarly, for the KEYWORD values in :options-alist in
`org-export-define-backend' for example in ox-latex.el?

For example the TITLE keyword from the following alist:

(:title "TITLE" nil nil parse)

appears as

#+title:

using the default template.



Re: [QUESTION] Should KEYWORD values in org-export-options-alist be lowercase?

2023-12-22 Thread Ihor Radchenko
Niall Dooley  writes:

> Should the KEYWORD values in `org-export-options-alist' that are
> uppercase be lowercase to reflect what users see say when using a
> template and/or for consistency?
>
> Similarly, for the KEYWORD values in :options-alist in
> `org-export-define-backend' for example in ox-latex.el?

Keyword names are case-insensitive. So, it does not matter.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at