Re: [BUG] org-mode binds C-c C-TAB, which seems illegal [9.5 (9.5-g0a86ad @ /home/il/.config/emacs/elpa/org-9.5/)]

2021-11-17 Thread Timothy


I think that the two actions we may want to take here are:
1. Replace "C-TAB" with "C-" in the keybinding
2. Change the keybinding to something else that doesn't use control+tab
   for instance, "C-c M-TAB" seems to be available.

Which option seems preferable?

--
Timothy



Re: Subject: [PATCH] Fix DISPLAY error on exporting org with plantuml to html

2021-11-17 Thread Timothy


Hi Sun,

> [snipped patch description]
> Please help review the patch. Thanks.
> [2. text/x-patch; 
> 0001-Fix-DISPLAY-error-on-exporting-org-with-plantuml-to-.patch]...

Thanks for your patience. This looks quite straight-forward. I don't use
or have plantuml so I'm in a poor position to test.

However, I can use google, and it seems that -Djava.awt.headless=true
just uses Java for some graphics operations which are normally delegated
to the system graphics stack.

This seems rather safe to me, and so I'd be inclined to take your word
that this is a beneficial change and merge the patch.

All the best,
Timothy



Re: Subject: [PATCH] Fix DISPLAY error on exporting org with plantuml to html

2021-11-17 Thread Sun Lin
Hi Timothy,

Thank you so much!

B.R.
Lin



Re: [Problems with org-ref-helm-insert-ref-link and org-id-get-create]

2021-11-17 Thread Uwe Brauer
>>> "JK" == John Kitchin  writes:

> Probably M-x org-ref-insert-ref-link will do what you want. A lot of things
> got "simplified" in version 3 to leverage completing-read more natively.
> helm-mode should work with org-ref-insert-ref-link.

I see. I think I got it to work, but the navigation is not entirely
clear to me, if I fire up that function a buffer pops up with possible
labels but how do I do something like scroll-up and scroll-down?

> See https://github.com/jkitchin/org-ref#configuration for some details on
> how to configure v3 with helm.

Honestly I miss a bit the old behaviour, when calling a ref function.[1]

So I checked out the org-ref-2 branch from the github repository.

But still there the function org-ref-helm-insert-cite-link is gone and
other related org-ref-helm functions. Is this correct?
 

Footnotes:
[1]  I mean the helm menu that popped up



smime.p7s
Description: S/MIME cryptographic signature


Re: Subject: [PATCH] Fix DISPLAY error on exporting org with plantuml to html

2021-11-17 Thread Sun Lin
Hi Bastien,

> Hi,
> I will - but please be aware that we have a policy of waiting at least
> one month before bumping a thread:
> https://orgmode.org/worg/org-mailing-list.html#i-didnt-receive-an-answer
> Thanks,
> Bastien

Please help the patch, thanks.

Lin    From 5e04a800691b04edd940dd124987336f6f30dd62 Mon Sep 17 00:00:00 2001
From: Lin Sun 
Date: Sat, 16 Oct 2021 03:01:18 +
Subject: [PATCH] Fix DISPLAY error on exporting org with plantuml to html

* org-babel-execute:plantuml: using headless mode for org calling plantuml for exporting to html
---
 lisp/ob-plantuml.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/ob-plantuml.el b/lisp/ob-plantuml.el
index fc62160..7d92227 100644
--- a/lisp/ob-plantuml.el
+++ b/lisp/ob-plantuml.el
@@ -122,6 +122,7 @@ This function is called by `org-babel-execute-src-block'."
 ((not (file-exists-p org-plantuml-jar-path))
  (error "Could not find plantuml.jar at %s" org-plantuml-jar-path))
 (t (list java
+	 "-Djava.awt.headless=true"
 	 "-jar"
 	 (shell-quote-argument (expand-file-name org-plantuml-jar-path))
 	 (full-body (org-babel-plantuml-make-body body params))
-- 
2.7.0



Re: [BUG] org-mode binds C-c C-TAB, which seems illegal [9.5 (9.5-g0a86ad @ /home/il/.config/emacs/elpa/org-9.5/)]

2021-11-17 Thread Kévin Le Gouguec
Ingo Lohmar  writes:

> It seems the change was introduced in
> 565361eb698b0b39c1d823ad1565f5bd88fa2034 and persists.
>
> Can people actually enter "C-c C-TAB" into their emacs (how?), or has
> everybody has just bound another key in their config?

Mmm, I can't seem to input C-c C-TAB either.  IIUC (but maybe I don't),
this makes sense because

- Emacs translates the function key  into the control character
  TAB=^I when no modifiers are added.  I.e. this can be triggered by
  hitting  or +i:

> (local-set-key (kbd "TAB") (lambda () (interactive) (message "TAB-ish!")))

- But Emacs can't translate + into "C-TAB", because C-TAB
  means "control+control+i", which I guess is not representable at the
  key code level or something?  Hopefully someone can explain this
  better.

(?\C-\t does return something though, and it's consistent with what (kbd
"C-TAB") returns, so I guess there's no reason why Emacs couldn't
translate C- to C-TAB like it does  to TAB? 路)

FWIW, however you decide to fix this, I'd be very grateful if org-cycle
remained bound to TAB, since I'm one of those weirdos who actually hits
+i for TAB instead of …



Re: c47b535bb origin/main org-element: Remove dependency on ‘org-emphasis-regexp-components’

2021-11-17 Thread Samuel Wales
i think i found it useful, long ago, when it was ok/tolerated to
change the var, and probably still, to /"do this"/ and /this,/.

although the latter seems weird to me now so i must not now understand
what i was doing.

i think changing the var was at least in a faq or on worg or so, so it
might be needed to compare user's value with standard-value.


On 11/17/21, Max Nikulin  wrote:
> On 17/11/2021 04:56, Samuel Wales wrote:
>> might be useful to know whether a default regexp change could satisfy
>> everybody?  in my case i remove " and , from third re.
>
> Samuel, I have seen your next message, but it still may be helpful to
> have an example (for a case if you will meet the problem again).
>
> These regexps will always fail under some conditions, since it is not
> strict markup. An example is emphasis terminated inside link target
>
> /A link [[https://orgmode.org/?oops=true][Org Mode]]
>
> On 16/11/2021 14:43, Ihor Radchenko wrote:
>> Max Nikulin writes:
>>
>>> Better docs and some restriction on defcustom values were discussed
>>> earlier:
>>> https://list.orgmode.org/87k0oyd3pw@nicolasgoaziou.fr/
>>> Nicolas Goaziou. Re: Using backticks for the inline code delimeter? Mon,
>>> 19 Apr 2021 11:27:07 +0200
>>>
>>> Sorry, I have not prepared a patch. I am not confident with defcustom
>>> fine tuning and have not experimented with it since that time.
>>
>> Maybe something like the attached?
>
> Thank you, Ihor. Another reason why I have not tried to do it myself is
> that it is necessary to test behavior for users who customized markers.
> The change should not be fatal for them. I have not checked it with you
> patch yet.
>
> I was considering some way to warn users if improper customization is
> detected (unexpected marker is noticed). It should be noticeable to make
> user aware of export issues but not too annoying.
>
>> +The characters in the alist must not be changed.  They do not affect
>> +the actual Org syntax, just fontification.
>
> Since this is known point of abuses, maybe stronger words are appropriate.
>
> Do not change makers and do not add new ones to use custom markers for
> existing styles or to introduce new styles. Org syntax is not meant to
> be configurable and such modifications will not work with export. If you
> are interested in fontification of custom markup inside Emacs only,
> there are other ways to achieve desired effect.
>
> In addition, I do not like the following phrase in the manual:
>
>> To narrow down the list of available markup syntax, you can customize
>> org-emphasis-alist.
>
>
>


-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html



Re: [org-cite] CSL processor, APA Style, and no-date citations

2021-11-17 Thread Joost Kremers


On Wed, Nov 17 2021, Bruce D'Arcus wrote:
> I don't believe so, unless there's some good latex -> html solution
> I'm not aware of.

There's (at least) tex4ht and lwarp, but to what extent they support biblatex, I
don't know.

-- 
Joost Kremers
Life has its moments



Re: [Problems with org-ref-helm-insert-ref-link and org-id-get-create]

2021-11-17 Thread John Kitchin
Probably M-x org-ref-insert-ref-link will do what you want. A lot of things
got "simplified" in version 3 to leverage completing-read more natively.
helm-mode should work with org-ref-insert-ref-link.

See https://github.com/jkitchin/org-ref#configuration for some details on
how to configure v3 with helm.


John

---
Professor John Kitchin (he/him/his)
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Wed, Nov 17, 2021 at 4:41 PM Uwe Brauer  wrote:

> >>> "JK" == John Kitchin  writes:
>
> > it usually takes up to 4 hours to propagate to MELPA.  I can't reproduce
> > the error you report.  At least, with a fresh emacs and install from
> MELPA
> > everything seems to load and work fine, even with emacs 29.  There seem
> to
> > be many issues with native-compiling on the most modern emacs, are you
> > using that?
>
> I think, I succeeded cloning and installing directly from your github
> repository, but now the function I was using for a long time
>
> org-ref-helm-insert-cite-link
>
> Seems to be gone, what happened?
>


Re: [Problems with org-ref-helm-insert-ref-link and org-id-get-create]

2021-11-17 Thread Uwe Brauer
>>> "JK" == John Kitchin  writes:

> it usually takes up to 4 hours to propagate to MELPA.  I can't reproduce
> the error you report.  At least, with a fresh emacs and install from MELPA
> everything seems to load and work fine, even with emacs 29.  There seem to
> be many issues with native-compiling on the most modern emacs, are you
> using that?

I think, I succeeded cloning and installing directly from your github
repository, but now the function I was using for a long time 

org-ref-helm-insert-cite-link

Seems to be gone, what happened?


smime.p7s
Description: S/MIME cryptographic signature


Re: [BUG] org-occur doesn't hide unmatching top-levels [9.5 (release_9.5-225-g494c20.dirty @ /Users/carlos/Install/Source/org-mode/lisp/)]

2021-11-17 Thread Carlos Pita
As a concrete example:

* a
ca
* b
** ba
cba
** bb
cbb
** bc
cbc
* c
cc

Then C-c / / cbb:

* a...
* b...
** bb
cbb
...
* c...

This is also true going deeper into the hierarchy:

* a
ca
* b
** ba
cba
** bb
*** bba
cbba
*** bbb
cbbb
*** bbc
cbbc
** bc
cbc
* c
cc

Then C-c / / cbbb:

* a...
* b...
** bb...
*** cbbb
cbbb
...
* c...

It's just the top-level that gets a special treatment.



Re: [BUG] org-mode binds C-c C-TAB, which seems illegal [9.5 (9.5-g0a86ad @ /home/il/.config/emacs/elpa/org-9.5/)]

2021-11-17 Thread Ingo Lohmar
On Fri, Oct 01 2021 23:16 (+0200), Ingo Lohmar wrote:

> Remember to cover the basics, that is, what you expected to happen and
> what in fact did happen.  You don't know how to make a good report?  See
>
>  https://orgmode.org/manual/Feedback.html#Feedback
>
> Your bug report will be posted to the Org mailing list.
> 
>
> In 9.5, org-key-map binds org-force-cycle-archived to (kbd "C-c C-TAB").
> At least on my machine, this specification is illegal: it generates an
> entry in org-key-map, but the key presses yield an "undefined" message.
>
> Binding the command to (kbd "C-c C-") instead works, but not on a
> tty.
>
> It's been my understanding that "TAB" is the ascii control character,
> identical to C-i, and hence "C-TAB" cannot work.  "" is the GUI
> system's key event (in my case, X), and does not work on a terminal.
>
> Emacs  : GNU Emacs 28.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 
> 3.24.24, cairo version 1.16.0)
>  of 2021-09-02
> Package: Org mode version 9.5 (9.5-g0a86ad @ 
> /home/il/.config/emacs/elpa/org-9.5/)

Hi all,

it seems that the above bug report has gone unnoticed.

It seems the change was introduced in
565361eb698b0b39c1d823ad1565f5bd88fa2034 and persists.

Can people actually enter "C-c C-TAB" into their emacs (how?), or has
everybody has just bound another key in their config?

Best,
Ingo



Re: [BUG] Weird sparse tree folding [9.5 (release_9.5-225-g494c20.dirty @ /Users/carlos/Install/Source/org-mode/lisp/)]

2021-11-17 Thread Carlos Pita
Hi Ihor,

> > Maybe I'm not getting how this is supposed to work, but it makes no
> > sense to me.
>
> M-x org-reveal (C-c C-r)

Thanks for the tip, I didn't know about this and it indeed seems
useful in order to avoid unfolding everything else.

That said, my report was about the expansion of:

* a...
** b3

c3

...

to:

* a...
** b3

c3

...
c4
...

when pressing TAB at the beginning of the first ...

That seems wrong to me, at least I'm not finding any way to make sense of it.

Maybe it's just that TAB should be disallowed there, I don't know.

Best regards,
Carlos



Re: [BUG] org-occur doesn't hide unmatching top-levels [9.5 (release_9.5-225-g494c20.dirty @ /Users/carlos/Install/Source/org-mode/lisp/)]

2021-11-17 Thread Carlos Pita
Hi Ihor,

> Can you elaborate? If the docstring is not clear enough, we can easily
> improve it.

Consider for example:

minimal   show current headline; if point is not on headline, also
show entry

So if you have:

* a
* b
** b1
** b2
** b3
* c

I see no reason why a match inside b2 will hide b1 and b3 but not a
and c (I'm referring to the headings, not the contents). The only way
to change the documentation to convey that is to state an explicit
exception for the top level, but that seems extremely ad hoc. Perhaps
there is a rationale, some presumption about what is in the top-level
take makes it a valuable context no matter what the preferred context
detail is set to, but if that's the case I find it too opinionated.

Best regards,
Carlos



Re: [Problems with org-ref-helm-insert-ref-link and org-id-get-create]

2021-11-17 Thread Uwe Brauer
>>> "JK" == John Kitchin  writes:

> it usually takes up to 4 hours to propagate to MELPA.  I can't reproduce
> the error you report.  At least, with a fresh emacs and install from MELPA
> everything seems to load and work fine, even with emacs 29.  There seem to
> be many issues with native-compiling on the most modern emacs, are you
> using that?

I am running 
emacs-repository-version  "846ff294206c922da4c48396e440e90179ffe070"
* commit 846ff294206c922da4c48396e440e90179ffe070 (HEAD -> master, 
origin/master, origin/HEAD)
| Author: Lars Ingebrigtsen 
| Date:   Mon Nov 8 08:01:07 2021 +0100

So that could be the problem.

I just tried https://github.com/jkitchin/org-ref.git
but make fails as well (cask not found). I opened an issue on github. I
will restart emacs and try it again.


smime.p7s
Description: S/MIME cryptographic signature


Re: [Problems with org-ref-helm-insert-ref-link and org-id-get-create]

2021-11-17 Thread John Kitchin
it usually takes up to 4 hours to propagate to MELPA.  I can't reproduce
the error you report.  At least, with a fresh emacs and install from MELPA
everything seems to load and work fine, even with emacs 29.  There seem to
be many issues with native-compiling on the most modern emacs, are you
using that?

John

---
Professor John Kitchin (he/him/his)
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Wed, Nov 17, 2021 at 1:58 PM Uwe Brauer  wrote:

>
> > in the most current version (3) of org-ref, the labels that are found are
> > defined in org-ref-ref-label-regexps. At the moment there isn't a pattern
> > for ID. No particular reason, I haven't used ID like that for many
> years. I
> > added and pushed that to the current repo just now.
>
> Thanks, that is in MELPA already?
>
> BTW, I downloaded the latest MELPA org-ref pkg and obtained the
> following error (running emacs 29, master a couple of days ago)
> ,
> |
> | Debugger entered--Lisp error: (wrong-type-argument listp "gls")
> |   cl-first("gls")
> |   (org-link-set-parameters (cl-first command) :follow
> |   #'or-follow-glossary :face 'org-ref-glossary-face-fn :help-echo
> |   'or-glossary-tooltip  :export #'(lambda (path _ format) (cond ((memq
> format '(latex beamer)) (format "\\%s{%s}" (cl-first command) path)) (t
> (format "%s" path)
> |   (let ((command (car --dolist-tail--))) (org-link-set-parameters
> (cl-first command) :follow #'or-follow-glossary :face
> 'org-ref-glossary-face-fn :help-echo 'or-glossary-tooltip :export #'(lambda
> (path _ format) (cond ((memq format '...) (format "\\%s{%s}" (cl-first
> command) path)) (t (format "%s" path) (setq --dolist-tail-- (cdr
> --dolist-tail--)))
> |   (while --dolist-tail-- (let ((command (car --dolist-tail--)))
> (org-link-set-parameters (cl-first command) :follow #'or-follow-glossary
> :face 'org-ref-glossary-face-fn :help-echo 'or-glossary-tooltip :export
> #'(lambda (path _ format) (cond ((memq format ...) (format "\\%s{%s}" ...
> path)) (t (format "%s" path) (setq --dolist-tail-- (cdr
> --dolist-tail--
> |   (let ((--dolist-tail-- org-ref-glossary-gls-commands)) (while
> --dolist-tail-- (let ((command (car --dolist-tail--)))
> (org-link-set-parameters (cl-first command) :follow #'or-follow-glossary
> :face 'org-ref-glossary-face-fn :help-echo 'or-glossary-tooltip :export
> #'(lambda (path _ format) (cond (... ...) (t ... (setq --dolist-tail--
> (cdr --dolist-tail--)
> |   eval-buffer(# nil
> "/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." nil t)  ; Reading
> at buffer position 10359
> |
>  
> load-with-code-conversion("/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..."
> "/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." nil t)
> |   load("/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." nil t)
> |   #f(compiled-function (c) # -0x142f0bcbab31255a>)(("/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..."
> . 1136))
> |   mapc(#f(compiled-function (c) #)
> (("/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." . 911)
> ("/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." . 912)
> ("/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." . 913)
> ("/home/oub/.emacs.d/elpa/org-ref-2020.1229/doi-..." . 1130)
> ("/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." . 1135)
> ("/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." . 1136)
> ("/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." . 1139)
> ("/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." . 1292)
> ("/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." . 1341)))
> |   package--reload-previously-loaded(#s(package-desc :name org-ref
> :version (2020 1229) :summary "citations, cross-references and
> bibliographies in ..." :reqs ((dash (0)) (s (0)) (f (0)) (htmlize (0))
> (hydra (0)) (avy (0)) (parsebib (0)) (bibtex-completion (0)) (citeproc
> (0))) :kind nil :archive nil :dir
> "/home/oub/.emacs.d/elpa/org-ref-2020.1229" :extras ((:url . "
> https://github.com/jkitchin/org-ref;) (:keywords "org-mode" "cite" "ref"
> "label") (:maintainer "John Kitchin" . "jkitc...@andrew.cmu.edu")
> (:authors ("John Kitchin" . "jkitc...@andrew.cmu.edu")) (:commit .
> "c87b4155cd2f60ca3a9bed2e6e366c1fa47aec33")) :signed nil))
> |   package-activate-1(#s(package-desc :name org-ref :version (2020
> 1229) :summary "citations, cross-references and bibliographies in ..."
> :reqs ((dash (0)) (s (0)) (f (0)) (htmlize (0)) (hydra (0)) (avy (0))
> (parsebib (0)) (bibtex-completion (0)) (citeproc (0))) :kind nil :archive
> nil :dir "/home/oub/.emacs.d/elpa/org-ref-2020.1229" :extras ((:url . "
> https://github.com/jkitchin/org-ref;) (:keywords "org-mode" "cite" "ref"
> "label") (:maintainer "John Kitchin" . "jkitc...@andrew.cmu.edu")
> (:authors ("John Kitchin" . "jkitc...@andrew.cmu.edu")) (:commit .
> 

Re: insert automatically a reference to a section header and a link

2021-11-17 Thread Stefan Nobis
Uwe Brauer  writes:

> Yes, but, what do you do, if you have a 10 header and each has 20
> subheaders.

I avoid writing such complex documents for the moment. :)

[Some custom functions]
> Thanks but this did not work! 

Sorry. The code is meant as an inspiration, not to be used out-of-the
box. I never tested the functions outside my highly adjusted default
configuration.

As I read in another post you seem to be a helm user. Therefore it
might be a better idea to use helm helper functions. I assume, helm
has also some function to jump around in Org files, with headings as
targets. If you find such a function, try to copy and adapt (as I did
with the similar `counsel-outline' function): I assume such a function
will use some helper function to collect the candidates for completion
and after the user selected a candidate there is code to jump to the
selected destination. Just try to change this part so that instead of
jumping, a link is inserted at the proper place (that's the part my
function `sn/org-insert-internal-link-action' is responsible for).

Maybe someone with more knowledge about helm might help you with a
complete solution.

-- 
Until the next mail...,
Stefan.



Re: insert automatically a reference to a section header and a link

2021-11-17 Thread Stefan Nobis
Juan Manuel Macías  writes:

> In Org 9.5 there is a new variable `org-latex-reference-command'.

Thanks for the reminder! I once read about it, but forgot to use it
after upgrading to 9.5. :)

-- 
Until the next mail...,
Stefan.



Re: [Problems with org-ref-helm-insert-ref-link and org-id-get-create]

2021-11-17 Thread Uwe Brauer

> in the most current version (3) of org-ref, the labels that are found are
> defined in org-ref-ref-label-regexps. At the moment there isn't a pattern
> for ID. No particular reason, I haven't used ID like that for many years. I
> added and pushed that to the current repo just now.

Thanks, that is in MELPA already?

BTW, I downloaded the latest MELPA org-ref pkg and obtained the
following error (running emacs 29, master a couple of days ago)
,
| 
| Debugger entered--Lisp error: (wrong-type-argument listp "gls")
|   cl-first("gls")
|   (org-link-set-parameters (cl-first command) :follow
|   #'or-follow-glossary :face 'org-ref-glossary-face-fn :help-echo
|   'or-glossary-tooltip  :export #'(lambda (path _ format) (cond ((memq format 
'(latex beamer)) (format "\\%s{%s}" (cl-first command) path)) (t (format "%s" 
path)
|   (let ((command (car --dolist-tail--))) (org-link-set-parameters (cl-first 
command) :follow #'or-follow-glossary :face 'org-ref-glossary-face-fn 
:help-echo 'or-glossary-tooltip :export #'(lambda (path _ format) (cond ((memq 
format '...) (format "\\%s{%s}" (cl-first command) path)) (t (format "%s" 
path) (setq --dolist-tail-- (cdr --dolist-tail--)))
|   (while --dolist-tail-- (let ((command (car --dolist-tail--))) 
(org-link-set-parameters (cl-first command) :follow #'or-follow-glossary :face 
'org-ref-glossary-face-fn :help-echo 'or-glossary-tooltip :export #'(lambda 
(path _ format) (cond ((memq format ...) (format "\\%s{%s}" ... path)) (t 
(format "%s" path) (setq --dolist-tail-- (cdr --dolist-tail--
|   (let ((--dolist-tail-- org-ref-glossary-gls-commands)) (while 
--dolist-tail-- (let ((command (car --dolist-tail--))) (org-link-set-parameters 
(cl-first command) :follow #'or-follow-glossary :face 'org-ref-glossary-face-fn 
:help-echo 'or-glossary-tooltip :export #'(lambda (path _ format) (cond (... 
...) (t ... (setq --dolist-tail-- (cdr --dolist-tail--)
|   eval-buffer(# nil 
"/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." nil t)  ; Reading at 
buffer position 10359
|   
load-with-code-conversion("/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..."
 "/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." nil t)
|   load("/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." nil t)
|   #f(compiled-function (c) #)(("/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." 
. 1136))
|   mapc(#f(compiled-function (c) #) 
(("/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." . 911) 
("/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." . 912) 
("/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." . 913) 
("/home/oub/.emacs.d/elpa/org-ref-2020.1229/doi-..." . 1130) 
("/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." . 1135) 
("/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." . 1136) 
("/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." . 1139) 
("/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." . 1292) 
("/home/oub/.emacs.d/elpa/org-ref-2020.1229/org-..." . 1341)))
|   package--reload-previously-loaded(#s(package-desc :name org-ref :version 
(2020 1229) :summary "citations, cross-references and bibliographies in 
..." :reqs ((dash (0)) (s (0)) (f (0)) (htmlize (0)) (hydra (0)) (avy (0)) 
(parsebib (0)) (bibtex-completion (0)) (citeproc (0))) :kind nil :archive nil 
:dir "/home/oub/.emacs.d/elpa/org-ref-2020.1229" :extras ((:url . 
"https://github.com/jkitchin/org-ref;) (:keywords "org-mode" "cite" "ref" 
"label") (:maintainer "John Kitchin" . "jkitc...@andrew.cmu.edu") (:authors 
("John Kitchin" . "jkitc...@andrew.cmu.edu")) (:commit . 
"c87b4155cd2f60ca3a9bed2e6e366c1fa47aec33")) :signed nil))
|   package-activate-1(#s(package-desc :name org-ref :version (2020 1229) 
:summary "citations, cross-references and bibliographies in ..." :reqs ((dash 
(0)) (s (0)) (f (0)) (htmlize (0)) (hydra (0)) (avy (0)) (parsebib (0)) 
(bibtex-completion (0)) (citeproc (0))) :kind nil :archive nil :dir 
"/home/oub/.emacs.d/elpa/org-ref-2020.1229" :extras ((:url . 
"https://github.com/jkitchin/org-ref;) (:keywords "org-mode" "cite" "ref" 
"label") (:maintainer "John Kitchin" . "jkitc...@andrew.cmu.edu") (:authors 
("John Kitchin" . "jkitc...@andrew.cmu.edu")) (:commit . 
"c87b4155cd2f60ca3a9bed2e6e366c1fa47aec33")) :signed nil) :reload :deps)
|   package-unpack(#s(package-desc :name org-ref :version (2020 1229) 
:summary "citations, cross-references and bibliographies in ..." :reqs ((dash 
(0)) (s (0)) (f (0)) (htmlize (0)) (hydra (0)) (avy (0)) (parsebib (0)) 
(bibtex-completion (0)) (citeproc (0))) :kind tar :archive "melpa" :dir nil 
:extras ((:commit . "c87b4155cd2f60ca3a9bed2e6e366c1fa47aec33") (:authors 
("John Kitchin" . "jkitc...@andrew.cmu.edu")) (:maintainer "John Kitchin" . 
"jkitc...@andrew.cmu.edu") (:keywords "org-mode" "cite" "ref" "label") (:url . 
"https://github.com/jkitchin/org-ref;)) :signed nil))
|   #f(compiled-function ( good-sigs) #)(nil)
|   #f(compiled-function () #)()
|   

Re: insert automatically a reference to a section header and a link

2021-11-17 Thread Juan Manuel Macías
Stefan Nobis writes:

> #+begin_src emacs-lisp
>   (defun sn/ox-latex-filter-special-ref-vref (text backend info)
> (when (org-export-derived-backend-p backend 'latex)
>   (replace-regexp-in-string "ref{" "vref{" text)))
>   
>   (add-to-list 'org-export-filter-link-functions 
> #'sn/ox-latex-filter-special-ref-vref)
> #+end_src

In Org 9.5 there is a new variable `org-latex-reference-command'. You
can do something like:

(setq org-latex-reference-command "\\vref{%s}")

Best regards,

Juan Manuel 



Re: [org-cite] CSL processor, APA Style, and no-date citations

2021-11-17 Thread John Kitchin
in org-ref there is a natbib-bbl preprocessor for this. It works with
bibtex (not biblatex) though.

You can see how it works here:
https://www.youtube.com/watch?v=lq3LspE-rAs=PL0sMmOaE_gs3E0OjExoI7vlCAVygj6S4I=8

You would have to use another preprocessor to convert org-cites to org-ref
links, or adapt the code in
https://github.com/jkitchin/org-ref/blob/master/org-ref-natbib-bbl-citeproc.el
to work off of the org-cites.

John

---
Professor John Kitchin (he/him/his)
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Wed, Nov 17, 2021 at 12:53 PM Bruce D'Arcus  wrote:

> On Wed, Nov 17, 2021 at 12:47 PM Rudolf Adamkovič  wrote:
>
> > In the meantime, can I use the BibLaTeX backend (or something else) for
> *HTML* export?
>
> I don't believe so, unless there's some good latex -> html solution
> I'm not aware of.
>
> Bruce
>
>


Re: [Problems with org-ref-helm-insert-ref-link and org-id-get-create] (was: insert automatically a reference to a section header and a link)

2021-11-17 Thread John Kitchin
in the most current version (3) of org-ref, the labels that are found are
defined in org-ref-ref-label-regexps. At the moment there isn't a pattern
for ID. No particular reason, I haven't used ID like that for many years. I
added and pushed that to the current repo just now.

John

---
Professor John Kitchin (he/him/his)
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Wed, Nov 17, 2021 at 11:55 AM Uwe Brauer  wrote:

>
> Please look at this example
>
> * new
>:PROPERTIES:
>:ID:   43b3de77-4074-47f2-9a4a-9cddebb33951
>:END:
>
> ** Inverse problem
>:PROPERTIES:
>:CUSTOM_ID: sec:one
>:END:
>
>
> ** new title
>:PROPERTIES:
>:ID:   f3c76e50-5be9-47f2-bad4-257166670481
>:END:
>
> Two ids were generated by org-id-get-create. I thought that could be
> another solution to my problem.
>
> However, strangely enough org-ref-helm-insert-ref-link
> does not find these two IDs it only finds CUSTOM_ID.
>
> @John: you are the author of that package, why doesn't the function find
> the ID?
>
> Regards
>
> Uwe
>
>
>
>
>
>
>


Re: [org-cite] CSL processor, APA Style, and no-date citations

2021-11-17 Thread Bruce D'Arcus
On Wed, Nov 17, 2021 at 12:47 PM Rudolf Adamkovič  wrote:

> In the meantime, can I use the BibLaTeX backend (or something else) for 
> *HTML* export?

I don't believe so, unless there's some good latex -> html solution
I'm not aware of.

Bruce



Re: [org-cite] CSL processor, APA Style, and no-date citations

2021-11-17 Thread Rudolf Adamkovič
András Simonyi  writes:

> this looks like a citeproc-el bug indeed -- could you post a bug
> report on the GitHub project page?

Done. Opened 3 GitHub issues:

- Fix "literal" authors (#72)
- Fix title capitalization (#71)
- Support no-date citations (#70)

In the meantime, can I use the BibLaTeX backend (or something else) for *HTML* 
export?

Rudy
-- 
"Logic is a science of the necessary laws of thought, without which no 
employment of the understanding and the reason takes place." -- Immanuel Kant, 
1785

Rudolf Adamkovič 
Studenohorská 25
84103 Bratislava
Slovakia

[he/him]



Re: insert automatically a reference to a section header and a link

2021-11-17 Thread Uwe Brauer
>>> "ESF" == Eric S Fraga  writes:

> On Wednesday, 17 Nov 2021 at 17:00, Uwe Brauer wrote:
>> While
>> 
>> ** That <>  

> Well, you could write

> ** That
> <>
Right, good idea

> to get what you like in terms of LaTeX export.

> I tend to put the label on the headline so that I can see it when I am
> in outline view.  Personal taste.

That is also true. In any case, thanks!


smime.p7s
Description: S/MIME cryptographic signature


Re: insert automatically a reference to a section header and a link

2021-11-17 Thread Uwe Brauer
>>> "SN" == Stefan Nobis  writes:
> Uwe Brauer  writes:
>> I am not following you. You insert a header as in 

>> * Intro

>> Now you want to refer to it with a link

>> As we have seen in section ...

>> So what precisely are you typing?

> I type "As we have seen in section [[*Intro]]" (literally, I tend to
> not use any keybindings or function to insert the link). This (the
> "*Intro" inside double square brackets) is called an internal link to
> headlines and they are a default feature of Org:

Yes, but, what do you do, if you have a 10 header and each has 20
subheaders. How do you remember all these names?
Besides your approach is not automatic.

> https://orgmode.org/manual/Internal-Links.html#Internal-Links


> If you need internal links to headings more often and do not want to
> type the whole heading text manually, you can use functions like this
> (inspired by `worf-goto' and `counsel-outline'; if you do not use
> ivy/swiper/counsel, the code should at least give the basic idea):

> #+begin_src emacs-lisp
> (defun sn/org-insert-internal-link ()
>   "Use ivy to insert a link to a heading in the current `org-mode' document."
>   (interactive)
>   (let ((settings (cdr (assq major-mode counsel-outline-settings
> (ivy-read "Heading: " (counsel-outline-candidates settings)
>   :action 'sn/org-insert-internal-link-action)))

> (defun sn/org-insert-internal-link-action (x)
>   "Insert link for `sn/worf-insert-internal-link'"
>   (save-excursion
> (goto-char (cdr x))
> (call-interactively 'org-store-link))
>   (org-insert-last-stored-link 1)
>   (delete-char -1))
> #+end_src

Thanks but this did not work! 


I copied,  In a separate file:
#+begin_src 
(require 'counsel)
(require 'worf)

(defun sn/org-insert-internal-link ()
  "Use ivy to insert a link to a heading in the current `org-mode' document."
  (interactive)
  (let ((settings (cdr (assq major-mode counsel-outline-settings
(ivy-read "Heading: " (counsel-outline-candidates settings)
  :action 'sn/org-insert-internal-link-action)))

(defun sn/org-insert-internal-link-action (x)
  "Insert link for `sn/worf-insert-internal-link'"
  (save-excursion
(goto-char (cdr x))
(call-interactively 'org-store-link))
  (org-insert-last-stored-link 1)
  (delete-char -1))
#+end_src

When I loaded the file I obtained:

ivy-configure: Keyword argument :init-fn not one of (:initial-input :height 
:occur :update-fn :unwind-fn :index-fn :sort-fn :format-fn 
:display-transformer-fn :more-chars :grep-p :exit-codes)

When I tried to install worf, I obtained 
#+begin_src 
Compiling file /home/oub/.emacs.d/elpa/worf-20211014.1207/elpa.el at Wed Nov 17 
17:59:27 2021
Entering directory ‘/home/oub/.emacs.d/elpa/worf-20211014.1207/’

Compiling file /home/oub/.emacs.d/elpa/worf-20211014.1207/worf.el at Wed Nov 17 
17:59:27 2021
worf.el:143:1: Error: Keyword argument :init-fn not one of (:initial-input 
:height :occur :update-fn :unwind-fn :index-fn :sort-fn :format-fn 
:display-transformer-fn :more-chars :grep-p :exit-codes)
#+end_src

When I called your first function I obtained
#+begin_src 
Debugger entered--Lisp error: (void-variable counsel-outline-settings)
  (assq major-mode counsel-outline-settings)
  (cdr (assq major-mode counsel-outline-settings))
  (let ((settings (cdr (assq major-mode counsel-outline-settings
  (ivy-read "Heading: " (counsel-outline-candidates settings) :action
  'sn/org-insert-internal-link-action))  
  sn/org-insert-internal-link() 
  funcall-interactively(sn/org-insert-internal-link)
  call-interactively(sn/org-insert-internal-link record nil)
  command-execute(sn/org-insert-internal-link record)
  execute-extended-command(nil "sn/org-insert-internal-link" "sn/or")
  funcall-interactively(execute-extended-command nil 
"sn/org-insert-internal-link" "sn/or")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

#+end_src

So something is not right here!

Uwe 


smime.p7s
Description: S/MIME cryptographic signature


Re: insert automatically a reference to a section header and a link

2021-11-17 Thread Uwe Brauer
>>> "ESF" == Eric S Fraga  writes:

> On Wednesday, 17 Nov 2021 at 16:55, Uwe Brauer wrote:
> "SN" == Stefan Nobis  writes:
>>> As seen in [[*Intro]] there is not much to say.
>> 
>> I am not following you. You insert a header as in
>> 
>> * Intro
>> 
>> 
>> Now you want to refer to it with a link

> The point is that the link uses the heading text itself (see the *in the
> link) to automatically find the heading.  No need to put an explicit
> label on the heading.

I am sorry, I still don't get this.
What I want is to insert, as convenient as possible a link to a
headings.
I usually use org-ref-helm-insert-ref-link for this. This function
however needs a label of sorts.

So how is your workflow?

Suppose you have 20 headers and subheaders. How to you generate a link
to subheader 6 of header 3 without a link?



smime.p7s
Description: S/MIME cryptographic signature


[Problems with org-ref-helm-insert-ref-link and org-id-get-create] (was: insert automatically a reference to a section header and a link)

2021-11-17 Thread Uwe Brauer


Please look at this example

* new 
   :PROPERTIES:
   :ID:   43b3de77-4074-47f2-9a4a-9cddebb33951
   :END:

** Inverse problem
   :PROPERTIES:
   :CUSTOM_ID: sec:one
   :END:


** new title 
   :PROPERTIES:
   :ID:   f3c76e50-5be9-47f2-bad4-257166670481
   :END:

Two ids were generated by org-id-get-create. I thought that could be
another solution to my problem.

However, strangely enough org-ref-helm-insert-ref-link
does not find these two IDs it only finds CUSTOM_ID.

@John: you are the author of that package, why doesn't the function find
the ID?

Regards

Uwe 








Re: c47b535bb origin/main org-element: Remove dependency on ‘org-emphasis-regexp-components’

2021-11-17 Thread Max Nikulin

On 17/11/2021 04:56, Samuel Wales wrote:

might be useful to know whether a default regexp change could satisfy
everybody?  in my case i remove " and , from third re.


Samuel, I have seen your next message, but it still may be helpful to 
have an example (for a case if you will meet the problem again).


These regexps will always fail under some conditions, since it is not 
strict markup. An example is emphasis terminated inside link target


/A link [[https://orgmode.org/?oops=true][Org Mode]]

On 16/11/2021 14:43, Ihor Radchenko wrote:

Max Nikulin writes:


Better docs and some restriction on defcustom values were discussed earlier:
https://list.orgmode.org/87k0oyd3pw@nicolasgoaziou.fr/
Nicolas Goaziou. Re: Using backticks for the inline code delimeter? Mon,
19 Apr 2021 11:27:07 +0200

Sorry, I have not prepared a patch. I am not confident with defcustom
fine tuning and have not experimented with it since that time.


Maybe something like the attached?


Thank you, Ihor. Another reason why I have not tried to do it myself is 
that it is necessary to test behavior for users who customized markers. 
The change should not be fatal for them. I have not checked it with you 
patch yet.


I was considering some way to warn users if improper customization is 
detected (unexpected marker is noticed). It should be noticeable to make 
user aware of export issues but not too annoying.



+The characters in the alist must not be changed.  They do not affect
+the actual Org syntax, just fontification.


Since this is known point of abuses, maybe stronger words are appropriate.

Do not change makers and do not add new ones to use custom markers for 
existing styles or to introduce new styles. Org syntax is not meant to 
be configurable and such modifications will not work with export. If you 
are interested in fontification of custom markup inside Emacs only, 
there are other ways to achieve desired effect.


In addition, I do not like the following phrase in the manual:


To narrow down the list of available markup syntax, you can customize 
org-emphasis-alist.





Re: insert automatically a reference to a section header and a link

2021-11-17 Thread Eric S Fraga
On Wednesday, 17 Nov 2021 at 17:00, Uwe Brauer wrote:
> While
>
> ** That <>  

Well, you could write

--8<---cut here---start->8---
** That
<>
--8<---cut here---end--->8---

to get what you like in terms of LaTeX export.

I tend to put the label on the headline so that I can see it when I am
in outline view.  Personal taste.

-- 
: Eric S Fraga, with org release_9.5-230-g2bbac4 in Emacs 29.0.50
: Latest paper written in org: https://arxiv.org/abs/2106.05096



Re: insert automatically a reference to a section header and a link

2021-11-17 Thread Stefan Nobis
Uwe Brauer  writes:

> I am not following you. You insert a header as in 

> * Intro

> Now you want to refer to it with a link

> As we have seen in section ...

> So what precisely are you typing?

I type "As we have seen in section [[*Intro]]" (literally, I tend to
not use any keybindings or function to insert the link). This (the
"*Intro" inside double square brackets) is called an internal link to
headlines and they are a default feature of Org:

https://orgmode.org/manual/Internal-Links.html#Internal-Links

BTW: I mostly export to PDF via LaTeX and usually use the combination
of cleveref with varioref. Therefore I prefer to type "As we have seen
in [[*Intro]]" (leaving out "section") and let Org generate a
"\vref{...}" reference. To achive this, I need little bit of extra
setup (and do not forget to add the necessary usepackage commands
either locally in the Org file or add it to
org-latex-default-packages-alist):

#+begin_src emacs-lisp
  (defun sn/ox-latex-filter-special-ref-vref (text backend info)
(when (org-export-derived-backend-p backend 'latex)
  (replace-regexp-in-string "ref{" "vref{" text)))
  
  (add-to-list 'org-export-filter-link-functions 
#'sn/ox-latex-filter-special-ref-vref)
#+end_src

If you need internal links to headings more often and do not want to
type the whole heading text manually, you can use functions like this
(inspired by `worf-goto' and `counsel-outline'; if you do not use
ivy/swiper/counsel, the code should at least give the basic idea):

#+begin_src emacs-lisp
(defun sn/org-insert-internal-link ()
  "Use ivy to insert a link to a heading in the current `org-mode' document."
  (interactive)
  (let ((settings (cdr (assq major-mode counsel-outline-settings
(ivy-read "Heading: " (counsel-outline-candidates settings)
  :action 'sn/org-insert-internal-link-action)))

(defun sn/org-insert-internal-link-action (x)
  "Insert link for `sn/worf-insert-internal-link'"
  (save-excursion
(goto-char (cdr x))
(call-interactively 'org-store-link))
  (org-insert-last-stored-link 1)
  (delete-char -1))
#+end_src

-- 
Until the next mail...,
Stefan.



Re: [org-cite] CSL processor, APA Style, and no-date citations

2021-11-17 Thread András Simonyi
Dear All,

On Wed, 17 Nov 2021 at 16:07, Bruce D'Arcus  wrote:
>
> On Wed, Nov 17, 2021 at 9:59 AM Rudolf Adamkovič  wrote:
>
> > I would like to start using the new citations with the APA Style. To cite 
> > in APA, I use a CSL file. Everything works well with Pandoc, but with Org, 
> > all citations with no "date" BibTeX field render as "$AUTHOR" instead of 
> > "$AUTHOR (n.d.)" both in-text and in the reference list. This renders Org 
> > unusable with APA Style. What can I do?
>
> I'm guessing that's a little bug in citeproc-el.
>
> If Andras doesn't reply here, you might add this to the issue tracker there?
>
> Bruce

this looks like a citeproc-el bug indeed -- could you post a bug
report on the GitHub project page?

thanks in advance,
András



Re: insert automatically a reference to a section header and a link

2021-11-17 Thread Uwe Brauer

> Stefan Nobis writes:

> Completely agree. I also tend to use `org-super-link'
> (https://github.com/toshism/org-super-links). 

Interesting. This package is not in MELPA, but I will download and test
it.


> It can be run with helm-org-ql, so if there are a lot of headings in
> the document, I just have to navigate through them using helm-org-ql,
> and insert a link at point to the chosen candidate. And in the
> destination header a back link is also inserted.



> Best regards,

> Juan Manuel 




smime.p7s
Description: S/MIME cryptographic signature


Re: [PATCH] ob-clojure.el: Add support for babashka and nbb backend

2021-11-17 Thread Max Nikulin

On 15/11/2021 23:05, Daniel Kraus wrote:

Max Nikulin writes:

Attached is the patch changed the logic to use a temp file with org-babel-eval.


Thank you for contribution. I do not have strong objection any more. I 
am not familiar with babel internals, so I leave further discussion to 
maintainers.


If you have not signed copyright assignment yet, likely you should do it 
to proceed (I am unsure concerning precise rules concerning line 
counting). See https://orgmode.org/contribute.html and 
https://orgmode.org/worg/org-contribute.html for details.



Somehow it doesn't feel too great to create unnecessary temp files
but I looked how other babel backends do it and e.g. ob-js and ob-haskell
use the same logic.


Code fragment might be huge enough to exceed limit on arguments length, 
so I think that file is safer. Some interpreters and compilers generates 
more meaningful errors and stacktraces when act on a file. Another 
option is to feed content to process standard input. With `call-process' 
or an related command it should be possible to implement any variant, 
including raw argument without intermediate shell pass. See info 
"(elisp) Synchronous Processes" or 
https://www.gnu.org/software/emacs/manual/html_node/elisp/Synchronous-Processes.html



+(with-temp-file script-file
+  (insert expanded))
+(org-babel-eval
+ (format "%s %s" bb (org-babel-process-file-name script-file))
+ "")))


Since other babel packages use the same approach, I will not argue. By 
the way, isn't second argument of `org-babel-eval' intended for code 
that may be executed without a temporary file?


Some babel languages support sessions. I have no idea if it is 
applicable to babashka.





Re: insert automatically a reference to a section header and a link

2021-11-17 Thread Eric S Fraga
On Wednesday, 17 Nov 2021 at 16:55, Uwe Brauer wrote:
 "SN" == Stefan Nobis  writes:
>>   As seen in [[*Intro]] there is not much to say.
>
> I am not following you. You insert a header as in
>
> * Intro
>
>
> Now you want to refer to it with a link

The point is that the link uses the heading text itself (see the *in the
link) to automatically find the heading.  No need to put an explicit
label on the heading.

-- 
: Eric S Fraga, with org release_9.5-230-g2bbac4 in Emacs 29.0.50
: Latest paper written in org: https://arxiv.org/abs/2106.05096



Re: insert automatically a reference to a section header and a link

2021-11-17 Thread Uwe Brauer
>>> "ESF" == Eric S Fraga  writes:

> On Wednesday, 17 Nov 2021 at 14:58, Uwe Brauer wrote:
>> Right, but how do you do this automatically?

> John's given you an answer along the lines of what you wanted but I
> would suggest that sometimes we over-complicate things?

Hm not sure

> LaTeX needs help because it's a lot more verbose.  Org, however, has a
> very simple markup ("It's all text" ;-)) and just typing what you want
> is often quicker!  Instead of key bindings to remember, I know I can
> simply type

> RET * <> heading RET

> and I'm done...

Well you should try auctex+reftex, it is just easier and (faster) if all
this is done automatically.

In auctex, you can also do this as you describe and I found that
terrible and was very relived to find out about reftex, that insert
labels automatically (and systematically)

> Likewise, typing the reference is simply typing [[label]].

> And both bits above benefit from electric-pair-mode...

> But I'm glad you found your solution in any case!

There is just a small problem with this approach.

When exported to latex 



** Hello 
   :PROPERTIES:
   :CUSTOM_ID: sec:wo
   :END:

Is exported as 


\subsection{Hello}
\label{sec:wo}


While

** That <>  

Is exported as 

\subsection{That \label{sec:That}}
\label{sec:org213d0b6}


The first one is much nicer and more in line with the logic of latex,
the second however is not bad (since it generates correct pdf files when
compiled)

I might think how to generalize John's approach.

Uwe 


smime.p7s
Description: S/MIME cryptographic signature


Re: insert automatically a reference to a section header and a link

2021-11-17 Thread Uwe Brauer
>>> "SN" == Stefan Nobis  writes:

> Uwe Brauer  writes:
>> I wonder why this was not implemented or asked for.

> Hmmm... for me, the default way to link to headings is just fine, I
> seldom need more control over the generated labels:

> #+begin_src org
>   ,* Intro

>   Lorem ipsum dolor sit amet...

>   ,* Another section

>   As seen in [[*Intro]] there is not much to say.
> #+end_src

I am not following you. You insert a header as in 

* Intro


Now you want to refer to it with a link

As we have seen in section ...

So what precisely are you typing?

All I can say is this to motivate this feature: 


I am a long time user of auctex+reftex, and the functionality to have
labels added (in a systematic way) automatically is a *great* time
saver if you want to add clickable references (links)

So I am curious to see how you do that.




Re: insert automatically a reference to a section header and a link

2021-11-17 Thread Juan Manuel Macías
Stefan Nobis writes:

> Hmmm... for me, the default way to link to headings is just fine, I
> seldom need more control over the generated labels:
>
> #+begin_src org
>   ,* Intro
>
>   Lorem ipsum dolor sit amet...
>
>   ,* Another section
>
>   As seen in [[*Intro]] there is not much to say.
> #+end_src

Completely agree. I also tend to use `org-super-link'
(https://github.com/toshism/org-super-links). It can be run with
helm-org-ql, so if there are a lot of headings in the document, I just
have to navigate through them using helm-org-ql, and insert a link at
point to the chosen candidate. And in the destination header a back link
is also inserted.

Best regards,

Juan Manuel 



Re: insert automatically a reference to a section header and a link

2021-11-17 Thread Stefan Nobis
Uwe Brauer  writes:

> I wonder why this was not implemented or asked for.

Hmmm... for me, the default way to link to headings is just fine, I
seldom need more control over the generated labels:

#+begin_src org
  ,* Intro

  Lorem ipsum dolor sit amet...

  ,* Another section

  As seen in [[*Intro]] there is not much to say.
#+end_src


-- 
Until the next mail...,
Stefan.



Re: [org-cite] CSL processor, APA Style, and no-date citations

2021-11-17 Thread Bruce D'Arcus
On Wed, Nov 17, 2021 at 9:59 AM Rudolf Adamkovič  wrote:

> I would like to start using the new citations with the APA Style. To cite in 
> APA, I use a CSL file. Everything works well with Pandoc, but with Org, all 
> citations with no "date" BibTeX field render as "$AUTHOR" instead of "$AUTHOR 
> (n.d.)" both in-text and in the reference list. This renders Org unusable 
> with APA Style. What can I do?

I'm guessing that's a little bug in citeproc-el.

If Andras doesn't reply here, you might add this to the issue tracker there?

Bruce



Re: insert automatically a reference to a section header and a link

2021-11-17 Thread Eric S Fraga
On Wednesday, 17 Nov 2021 at 14:58, Uwe Brauer wrote:
> Right, but how do you do this automatically?

John's given you an answer along the lines of what you wanted but I
would suggest that sometimes we over-complicate things?

LaTeX needs help because it's a lot more verbose.  Org, however, has a
very simple markup ("It's all text" ;-)) and just typing what you want
is often quicker!  Instead of key bindings to remember, I know I can
simply type

RET * <> heading RET

and I'm done...

Likewise, typing the reference is simply typing [[label]].

And both bits above benefit from electric-pair-mode...

But I'm glad you found your solution in any case!

-- 
: Eric S Fraga, with org release_9.5-230-g2bbac4 in Emacs 29.0.50
: Latest paper written in org: https://arxiv.org/abs/2106.05096



[org-cite] CSL processor, APA Style, and no-date citations

2021-11-17 Thread Rudolf Adamkovič
I would like to start using the new citations with the APA Style. To cite in 
APA, I use a CSL file. Everything works well with Pandoc, but with Org, all 
citations with no "date" BibTeX field render as "$AUTHOR" instead of "$AUTHOR 
(n.d.)" both in-text and in the reference list. This renders Org unusable with 
APA Style. What can I do?

Emacs configuration:

(add-to-list 'package-selected-packages 'citeproc)
(with-eval-after-load 'oc
  (require 'ox)
  (require 'oc-csl))

Document configuration:

#+CITE_EXPORT: csl apa.csl

CSL file:

https://github.com/citation-style-language/styles/blob/master/apa.csl

Rudy
-- 
"I love deadlines. I love the whooshing noise they make as they go by." -- 
Douglas Adams, The Salmon of Doubt

Rudolf Adamkovič 
Studenohorská 25
84103 Bratislava
Slovakia

[he/him]



Re: Bug: org-no-popups disregards display-buffer-fallback-action 9.4.6

2021-11-17 Thread Max Nikulin

On 15/11/2021 14:49, Jan Seeger wrote:

On 13.11.21 14:15, Max Nikulin wrote:

My thought is that I have a perfectly good window manager that allows me 
to manage Emacs frames.
... Thus, I prefer to have my 
window manager manage Emacs frames, instead of adding yet another way to 
switch between multiple things being displayed at the same time, which I 
would have to do using Emacs windows.


My current configuration is as follows:

(setq display-buffer-base-action '((display-buffer-reuse-window 
display-buffer-pop-up-frame)
    (reusable-frames . 0)))
(setq display-buffer-alist
   `(("\\*Packages\\*" display-buffer-pop-up-frame)
     ("\\*stdin.*\\*" display-buffer-same-window)
     ("\\*Help\\*" display-buffer-pop-up-frame)
     ("\\*.*\\*" display-buffer-pop-up-window)))


Thank you for sharing this. I have tried such setup. Behavior of Org 
windows is terrible. "Standard" Emacs windows may be a bit strange 
sometimes, but it is not really annoying.


If there is a *Help* buffer on the screen, another one is created if 
help is called from some other buffer. Content of help frames is 
synchronized. I suppose, second help frame on the same screen may be 
avoided by adjusting configuration. (Side note: sometimes I do not mind 
to have several help buffers showing different content, so I do not like 
current limitation of help facilities.)


Frame may be split into halves by e.g. debugger window, C-h e, etc. It 
does not matter whether it is full-screen or half-screen frame (OK, in 
first case it split by vertical line, in second one by horizontal). Next 
similar buffer is opened in new frame. I would expect that either always 
new frame is created or decision depends on window size, not on number 
of windows (1 or 2) in the frame.


I have tried your suggestion


(defmacro org-no-popups ( body)
  "Suppress popup windows and evaluate BODY."
  `(let ((display-buffer-overriding-action '(display-buffer-pop-up-window)))
 ,@body))


It requires more work. C-c C-j org-goto is obviously broken with your 
config due to recent changes. It fixes only first step of org-capture 
(template selection) is fixed, window with buffer for capture is created 
in the current frame, but new clone of frame is created.


I am still in doubts whether `display-buffer-overriding-action' or 
ACTION argument of `display-buffer' should be used.


Actually I think that even org-capture should have two different 
options: with new frame or withing existing frame. Maybe I will explain 
it in detail in other part of this thread is response to Eric's message.





Re: [BUG] Weird sparse tree folding [9.5 (release_9.5-225-g494c20.dirty @ /Users/carlos/Install/Source/org-mode/lisp/)]

2021-11-17 Thread Ihor Radchenko
Carlos Pita  writes:

> The new three dots are not expandable.
>
> Maybe I'm not getting how this is supposed to work, but it makes no
> sense to me.

M-x org-reveal (C-c C-r)



Re: [BUG] Agenda query trailing spaces [9.5 (release_9.5-225-g494c20.dirty @ /Users/carlos/Install/Source/org-mode/lisp/)]

2021-11-17 Thread Ihor Radchenko
Carlos Pita  writes:

> when I press [ or ] to add additional words to the agenda query but then
> immediately abort the prompt with C-g without actually adding any new
> word, a trailing extra space is added to the query. After doing the same
> n times, the query includes n trailing spaces.

Confirmed

However, this behaviour seems to be partially intentional. It was
explicitly introduced in 774964adb. So, the fix may not be
straightforward. Someone needs to study the relevant agenda code.

Best,
Ihor




Re: [BUG] org-occur doesn't hide unmatching top-levels [9.5 (release_9.5-225-g494c20.dirty @ /Users/carlos/Install/Source/org-mode/lisp/)]

2021-11-17 Thread Ihor Radchenko
Carlos Pita  writes:

> Hi all,
>
> I don't see any clear reason why org-occur should hide unmatching
> entries except at the top level, where it merely folds them. For files
> containing lots of top-level entries this requires tree demoting in
> order to hide irrelevant information, but this imposes constraints on
> the tree structure that are not related to its author's goals.

The reason is because nobody implemented this feature.
Note that you can also use org-agenda for the same purpose.

> I've been playing with org-show-context-detail and it doesn't seem to be
> any option which actually hides top levels, though the description of
> some options seem to imply that they should, I believe.

Can you elaborate? If the docstring is not clear enough, we can easily
improve it.

Best,
Ihor



Re: insert automatically a reference to a section header and a link

2021-11-17 Thread Uwe Brauer
>>> "JK" == John Kitchin  writes:

> there is nothing like that that I know of. You can write your own, in org
> (following Eric's use of radio targets) it might look like this.

> (defun my-heading ()
>   (interactive)
>   (let* ((title (string-trim (read-string "title: ")))
> (tokens (split-string title " " t))
> (label (format "<>"
> (string-join
> (seq-take tokens (min 3 (length tokens)))
> "-"
> (insert (format "%s %s" label title

> you could also insert the leading * if you prefer.

Aha! Brilliant thanks!
I will use
(format "%s %s" title label)
and think about inserting *.

I wonder why this was not implemented or asked for.

I googled but did not find anything.


smime.p7s
Description: S/MIME cryptographic signature


Re: insert automatically a reference to a section header and a link

2021-11-17 Thread John Kitchin
there is nothing like that that I know of. You can write your own, in org
(following Eric's use of radio targets) it might look like this.

(defun my-heading ()
  (interactive)
  (let* ((title (string-trim (read-string "title: ")))
(tokens (split-string title " " t))
(label (format "<>"
(string-join
(seq-take tokens (min 3 (length tokens)))
"-"
(insert (format "%s %s" label title

you could also insert the leading * if you prefer.

John

---
Professor John Kitchin (he/him/his)
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Wed, Nov 17, 2021 at 8:59 AM Uwe Brauer  wrote:

>
> >>> "ESF" == Eric S Fraga  writes:
>
> > On Wednesday, 17 Nov 2021 at 08:36, Uwe Brauer wrote:
> >> In auctex+reftex it is possible that when I insert a new section header
> >> a reference label is inserted automatically:
>
> > I do the following usually:
>
> > * <> Introduction
>
> Right, but how do you do this automatically?
>
> Maybe I did not explain this clearly enough: in auctex+reftex, when I
> fire up the command LaTeX-section, I am
>
> 1. Asked for the title
>
> 2. And then the title *and* a label is inserted automatically. (I
>can configure what is inserted to a certain extend). Usually I
>obtain \section{Alternativa de Fredholm}
>\label{sec:altern-de-fredh}
>
>
> I am looking for a similar functionality in org mode
>
> > In section [[introduction]], I show something.
>
> > I prefer visible labels instead of custom IDs although the latter works
> > as well but you need to say [[id:introduction]].
>
> > HTH,
> > eric
>
>
>


Re: insert automatically a reference to a section header and a link

2021-11-17 Thread Uwe Brauer


>>> "ESF" == Eric S Fraga  writes:

> On Wednesday, 17 Nov 2021 at 08:36, Uwe Brauer wrote:
>> In auctex+reftex it is possible that when I insert a new section header
>> a reference label is inserted automatically:

> I do the following usually:

> * <> Introduction

Right, but how do you do this automatically?

Maybe I did not explain this clearly enough: in auctex+reftex, when I
fire up the command LaTeX-section, I am

1. Asked for the title

2. And then the title *and* a label is inserted automatically. (I
   can configure what is inserted to a certain extend). Usually I
   obtain \section{Alternativa de Fredholm}
   \label{sec:altern-de-fredh}


I am looking for a similar functionality in org mode

> In section [[introduction]], I show something.

> I prefer visible labels instead of custom IDs although the latter works
> as well but you need to say [[id:introduction]].

> HTH,
> eric




Re: Should be possible to export list items emphasized by default?

2021-11-17 Thread Juan Manuel Macías
Ypo writes:

> /1. Introduction/
>
> It doesn't work as a list item
>
> 1. /Introduction/
>
> It works as a list item but, when exporting, it doesn't export the
> whole item emphasized.

If I have understood correctly, you want to export the label emphasized
as well, not just the item content... It does not make much sense to
emphasize a label within a list by direct formatting: the style of the
labels must be homogeneous and consistent. On the other hand, the style
for a list environment must be modified in LaTeX globally. The easy way
is to use the enumitem package. For example, if you want all labels in
italics:

#+LaTeX_Header: \usepackage{enumitem}

#+ATTR_LaTeX: :options [label=\emph{\arabic*}.]
1. /foo/
2. /bar/
3. /baz/

The :options attribute pass an optional argument to the `enumerate'
environment, with all the options for the environment (a list of comma
separated keyval values):

\begin{enumerate}[label=\emph{\arabic*}.]
\item \emph{foo}
\item \emph{bar}
\item \emph{baz}
\end{enumerate}

See: https://www.ctan.org/pkg/enumitem

Best regards,

Juan Manuel



Re: [BUG] Unregistered buffer modifications detected [9.5 (9.5-g49e2f6 @ /Users/myuser/.emacs.d/straight/29/straight/build/org/)]

2021-11-17 Thread Max Nikulin

On 17/11/2021 13:05, Aaron Jensen wrote:


I don't recall what I was doing at the time, it was during a meeting.


You press C-h l that calls view-lossage and look into help buffer later.

This command helped me to realize what was the cause of 
https://list.orgmode.org/smre9o$hn1$1...@ciao.gmane.io/





Re: table and Cyrillic characters: org-element--cache: Unregistered buffer modifications detected. Resetting

2021-11-17 Thread Ihor Radchenko
Max Nikulin  writes:

> Unintentionally I pressed some keys and it appeared again
> ...
> C-\ russian-computer RET
> ||
>
> By "|" I mean Shift+\ that inserts "/" with russian-computer input method.

I pushed yet another workaround.

That part of code is turning into one giant FIXME and I do not see
anything better than patching Emacs itself. Hopefully, not many more
built-in places in Emacs are doing similar silent modifications.

Best,
Ihor





Re: [BUG] Unregistered buffer modifications detected [9.5 (9.5-g49e2f6 @ /Users/myuser/.emacs.d/straight/29/straight/build/org/)]

2021-11-17 Thread Ihor Radchenko
Aaron Jensen  writes:

> Here's another on c47b535bb:
>
> https://gist.github.com/aaronjensen/348d879f79099c0d9b660bad199f25af
>
> I don't recall what I was doing at the time, it was during a meeting.

I do not see anything meaningful in the backtrace, except that "Current
command: nil" is probably related to some third-party package. If there
is nothing obvious in your config that may be responsible, you can set
org-element--cache-diagnostics-modifications to nil to suppress the
warning.

Best,
Ihor



Re: insert automatically a reference to a section header and a link

2021-11-17 Thread Eric S Fraga
On Wednesday, 17 Nov 2021 at 08:36, Uwe Brauer wrote:
> In auctex+reftex it is possible that when I insert a new section header
> a reference label is inserted automatically:

I do the following usually:

--8<---cut here---start->8---
* <> Introduction

In section [[introduction]], I show something.
--8<---cut here---end--->8---

I prefer visible labels instead of custom IDs although the latter works
as well but you need to say [[id:introduction]].

HTH,
eric

-- 
: Eric S Fraga, with org release_9.5-230-g2bbac4 in Emacs 29.0.50
: Latest paper written in org: https://arxiv.org/abs/2106.05096



Re: insert automatically a reference to a section header and a link

2021-11-17 Thread Uwe Brauer
>>> "UB" == Uwe Brauer  writes:

> Hi

> In auctex+reftex it is possible that when I insert a new section header
> a reference label is inserted automatically:


> 1. Example
>\subsection{Inverse problem}
>\label{sec:one}

> 2. And then using  reftex-reference 
>I can insert \ref{sec:one}  


> So the equivalent of 1. in org mode would be to automatically insert

> ** Inverse problem
>:PROPERTIES:
>:CUSTOM_ID: sec:one
>:END:

> Can this be done?

> And then what would be the equivalent to 2? It is not org-insert-link,
> as far as I can see.

To answer at least one of my questions:

org-ref-helm-insert-ref-link 
is the equivalent to reftex-reference.

But I cannot see how to configure org, so that it automatically insert a
section header link.


smime.p7s
Description: S/MIME cryptographic signature