Re: Subject: cannot export asynchronously because of org-fold-core--update-buffer-folds

2024-03-18 Thread Alan Schmitt
Hello,

On 2024-03-17 19:05, Nasser Alkmim  writes:

> Hi Alan, how did you effectively solve the problem?

Here is the contents of my export-init file:

(setq user-emacs-directory "/Users/schmitta/projets/plain-emacs-config/")

(add-to-list 'load-path (expand-file-name "straight/build/org/" 
user-emacs-directory))

(setq-default indent-tabs-mode nil)

(setq org-latex-src-block-backend 'minted)
(setq org-latex-pdf-process
  '("latexmk -pdflatex='%latex --shell-escape -8bit' -pdf -quiet %f"))
(setq org-export-async-debug t)
(require 'ox-beamer)
(add-to-list 'org-beamer-environments-extra
 '("onlyenv" "O" "\\begin{onlyenv}%a" "\\end{onlyenv}"))

Best,

Alan
 


signature.asc
Description: PGP signature


Re: Subject: cannot export asynchronously because of org-fold-core--update-buffer-folds

2024-03-09 Thread Alan Schmitt
Hi Pedro,
On 2024-03-08 18:07, Pedro Andres Aranda Gutierrez  writes:

> I’m very interested on how your document header looks like. Can you please 
> send mee a file with your header
> and a couple of dummy slides? I’m not able to reproduce the problem…

The document header was not the problem, as it happened with any
file. The core of the issue is that the org version used to initiate the
export must be the same than the org version run in the asynchronous
export process, as bytecode from org is passed between them (and in my
case this bytecode was mentioning a recently introduced org function
that is not available in the org shipped with emacs). Making sure the
async init file loaded the same org version than the one I use everyday
solved the problem.

Alan


signature.asc
Description: PGP signature


Re: cannot export asynchronously because of org-fold-core--update-buffer-folds

2024-03-07 Thread Alan Schmitt
On 2024-03-07 12:35, Ihor Radchenko  writes:

> Alan Schmitt  writes:
>
>> I’m trying to export a file asynchronously to beamer/pdf, and I have a
>> strange error. Here is the contents of the *Org Export Process* buffer:
>>
>> Debugger entered--Lisp error: (void-function 
>> org-fold-core--update-buffer-folds)
>> ...
>> To make sure I have a reproducible export, I set
>> org-export-async-init-file to a file with the following contents:
>> ...
>> (require 'ox-latex)
>> ...
>> I assume the problem is that there is a version mismatch between the org
>
> Yes, looks like it. If you are using custom
> `org-export-async-init-file', you need to make sure that Org mode
> available to that init file has the same version as the Org mode that
> initiates export process. Basically, you need to set the right
> load-path.

Thank you, I can confirm that this fixes it.

>> I’m using to start the export and the org in the async process, but I do
>> not understand how they would interact. In particular, I don’t
>> understand why there is a mention of byte-compiled code in the error
>> trace.
>
> byte-compiled code is a function passed by Org mode to the async Emacs.
> That function takes care about re-creating the right Elisp environment
> inside the async process.

Ah, ok, I understand better now. Thanks again!

Alan


signature.asc
Description: PGP signature


Re: Subject: cannot export asynchronously because of org-fold-core--update-buffer-folds

2024-03-07 Thread Alan Schmitt
Hi Pedro,

On 2024-03-07 10:03, Pedro Andres Aranda Gutierrez  writes:

> could you please try to add
>
> #+LATEX_CLASS: beamer
> #+LATEX_CLASS_OPTIONS: [presentation,aspectratio=169]
>
> instead of
>
> (require 'ox-latex)
>
> (add-to-list 'org-latex-classes
>  '("my-beamer"
>"\\documentclass\[presentation,aspectratio=169\]\{beamer\}
> [NO-DEFAULT-PACKAGES]"
>("\\section\{%s\}" . "\\section*\{%s\}")
>("\\subsection\{%s\}" . "\\subsection*\{%s\}")
>("\\subsubsection\{%s\}" . "\\subsubsection*\{%s\}")))
>
> and see if that makes any difference?

Thank you for the suggestion. I tried this and it does not help, I have
the same error. I do not know how to debug it since the error happens in
compiled code whose origin is not given…

The surprising part is that the problematic function was introduced very
recently
(https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=87c9f9b5db2e14fe0c5254105b7b90b01bbf8d61)
but it seems to be used in the asynchronous export that does not load
any package, so there I should be using the orgmode version shipped with
emacs…

Alan


signature.asc
Description: PGP signature


cannot export asynchronously because of org-fold-core--update-buffer-folds

2024-03-06 Thread Alan Schmitt
Hello,

I’m trying to export a file asynchronously to beamer/pdf, and I have a
strange error. Here is the contents of the *Org Export Process* buffer:

Debugger entered--Lisp error: (void-function org-fold-core--update-buffer-folds)
  org-fold-core--update-buffer-folds()
  #f(compiled-function () #)()
  funcall(#f(compiled-function () #))
  (progn nil (progn (setq kill-emacs-hook nil) (setq 
org-babel-confirm-evaluate-answer-no t)) (require 'ox) (funcall 
'#f(compiled-function () #)) 
(restore-buffer-modified-p nil) (print (let ((output (org-export-as 'beamer nil 
nil nil '(:output-file "slides.tex" (let ((temp-buffer (generate-new-buffer 
" *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect 
(progn (insert output) (if ... nil ...) (let ... ...)) (and (buffer-name 
temp-buffer) (kill-buffer temp-buffer) (or (condition-case nil (progn 
(funcall 'org-latex-compile "slides.tex")) (error nil)) "slides.tex"
  (unwind-protect (progn nil (progn (setq kill-emacs-hook nil) (setq 
org-babel-confirm-evaluate-answer-no t)) (require 'ox) (funcall 
'#f(compiled-function () #)) 
(restore-buffer-modified-p nil) (print (let ((output (org-export-as 'beamer nil 
nil nil '...))) (let ((temp-buffer (generate-new-buffer " *temp*" t))) 
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ... ... 
...) (and ... ... (or (condition-case nil (progn (funcall ... 
"slides.tex")) (error nil)) "slides.tex" (and (buffer-name temp-buffer) 
(kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn nil 
(progn (setq kill-emacs-hook nil) (setq org-babel-confirm-evaluate-answer-no 
t)) (require 'ox) (funcall '#f(compiled-function () #)) (restore-buffer-modified-p nil) (print (let ((output 
(org-export-as ... nil nil nil ...))) (let ((temp-buffer ...)) 
(save-current-buffer (set-buffer temp-buffer) (unwind-protect ... ...))) (or 
(condition-case nil (progn ...) (error nil)) "slides.tex" (and (buffer-name 
temp-buffer) (kill-buffer temp-buffer
  (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer 
(set-buffer temp-buffer) (unwind-protect (progn nil (progn (setq 
kill-emacs-hook nil) (setq org-babel-confirm-evaluate-answer-no t)) (require 
'ox) (funcall '#f(compiled-function () #)) 
(restore-buffer-modified-p nil) (print (let ((output ...)) (let (...) 
(save-current-buffer ... ...)) (or (condition-case nil ... ...) 
"slides.tex" (and (buffer-name temp-buffer) (kill-buffer temp-buffer)
  
load-with-code-conversion("/private/var/folders/p6/3p2365qn1dx08q33rqwnr2hh00..."
 "/private/var/folders/p6/3p2365qn1dx08q33rqwnr2hh00..." nil t)
  command-line-1(("-l" "/Users/schmitta/work/skeletons/research/talks/Effe..." 
"-l" "/var/folders/p6/3p2365qn1dx08q33rqwnr2hhgn/T/o..."))
  command-line()
  normal-top-level()

To make sure I have a reproducible export, I set
org-export-async-init-file to a file with the following contents:

;;; export-init.el --- description -*- lexical-binding: t; -*-

;;; Commentary:

;;; Code:

(setq-default indent-tabs-mode nil)
(setq debug-on-error t)

(require 'ox-latex)

(add-to-list 'org-latex-classes
 '("my-beamer"
   "\\documentclass\[presentation,aspectratio=169\]\{beamer\}
[NO-DEFAULT-PACKAGES]"
   ("\\section\{%s\}" . "\\section*\{%s\}")
   ("\\subsection\{%s\}" . "\\subsection*\{%s\}")
   ("\\subsubsection\{%s\}" . "\\subsubsection*\{%s\}")))

(require 'ox-beamer)

(setq org-latex-listings 'minted)

(setq org-latex-pdf-process
  '("latexmk -pdflatex='%latex --shell-escape -8bit' -pdf -quiet %f"))

(setq org-export-async-debug t)

(provide 'export-init)
;;; export-init.el ends here


I assume the problem is that there is a version mismatch between the org
I’m using to start the export and the org in the async process, but I do
not understand how they would interact. In particular, I don’t
understand why there is a mention of byte-compiled code in the error
trace.

If it matters, the emacs with which I’m initializing the export with is
started with the --init-directory option.

How can I track where this error comes from?

Thanks,

Alan


signature.asc
Description: PGP signature


Re: [BUG] CUSTOM_id ignored on blocks by ox-beamer

2023-02-09 Thread Alan Schmitt
Hello Ihor,

On 2023-01-19 10:21, Ihor Radchenko  writes:

> Please add a changelog entry detailing the definitions where the changes
> happened. See https://orgmode.org/worg/org-contribute.html#commit-messages
>
...
> Please document the new %l option in the docstring of
> `org-beamer-environments-extra' and add a notice to etc/ORG-NEWS file.

Here is an updated patch.



signature.asc
Description: PGP signature
>From c480b26f9cb536b68b00930a19d59485f9221ef7 Mon Sep 17 00:00:00 2001
From: Alan Schmitt 
Date: Sun, 8 Jan 2023 17:20:31 +0100
Subject: [PATCH] lisp/ox-beamer.el: add labels to latex export

* ox-beamer.el (org-beamer-environments-default): add label escape to
some environments
(org-beamer--format-block): generate label string for label escape
(org-beamer-environments-extra): document label escape

A new escape %l is available to be used in `org-beamer-environments-*'
to insert the label of the current block, obtained using
`org-babel--get-label'
---
 etc/ORG-NEWS  |  5 +
 lisp/ox-beamer.el | 10 ++
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index c5e9cd568..47806484e 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -79,6 +79,11 @@ document header:
 The face ~org-agenda-calendar-daterange~ is used to show entries with
 a date range in the agenda.  It inherits from the default face in
 order to remain backward-compatible.
+*** New escape in ~org-beamer-environments-extra~ for labels in Beamer export
+The escape ~%l~ in ~org-beamer-environments-extra~ inserts the label
+obtained from ~org-beamer--get-label~.  This is added to the default
+environments "theorem", "definition", "example", and "exampleblock" in
+~org-beamer-environments-default~.
 
 ** New features
 *** ~org-metaup~ and ~org-metadown~ now act on headings in region
diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index 689bf1559..5df78d5a4 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -116,6 +116,7 @@ openThe opening template for the environment, with the following escapes
 %r   the raw headline text (i.e. without any processing)
 %H   if there is headline text, that raw text in {} braces
 %U   if there is headline text, that raw text in [] brackets
+%l   the label, obtained from `org-beamer--get-label'
 close   The closing string of the environment."
   :group 'org-export-beamer
   :version "24.4"
@@ -178,10 +179,10 @@ through `org-beamer-environments-extra' variable.")
 ("quotation"  "q" "\\begin{quotation}%a %% %h""\\end{quotation}")
 ("quote"  "Q" "\\begin{quote}%a %% %h""\\end{quote}")
 ("structureenv"   "s" "\\begin{structureenv}%a %% %h" "\\end{structureenv}")
-("theorem""t" "\\begin{theorem}%a[%h]""\\end{theorem}")
-("definition" "d" "\\begin{definition}%a[%h]" "\\end{definition}")
-("example""e" "\\begin{example}%a[%h]""\\end{example}")
-("exampleblock"   "E" "\\begin{exampleblock}%a{%h}"   "\\end{exampleblock}")
+("theorem""t" "\\begin{theorem}%a[%h]%l""\\end{theorem}")
+("definition" "d" "\\begin{definition}%a[%h]%l" "\\end{definition}")
+("example""e" "\\begin{example}%a[%h]%l""\\end{example}")
+("exampleblock"   "E" "\\begin{exampleblock}%a{%h}%l"   "\\end{exampleblock}")
 ("proof"  "p" "\\begin{proof}%a[%h]"  "\\end{proof}")
 ("beamercolorbox" "o" "\\begin{beamercolorbox}%o{%h}" "\\end{beamercolorbox}"))
   "Environments triggered by properties in Beamer export.
@@ -578,6 +579,7 @@ used as a communication channel."
 		(cons "O" (or raw-options ""))
 		(cons "h" title)
 		(cons "r" raw-title)
+(cons "l" (format "\\label{%s}" (org-beamer--get-label headline info)))
 		(cons "H" (if (equal raw-title "") ""
 			(format "{%s}" raw-title)))
 		(cons "U" (if (equal raw-title "") ""
-- 
2.39.1


Best,

Alan


Re: [BUG] CUSTOM_id ignored on blocks by ox-beamer

2023-01-15 Thread Alan Schmitt
Hello,

Please let me know if there is something I should do to help integrate
this patch.

Best,

Alan

On 2023-01-08 17:25, Alan Schmitt  writes:

> Hello,
>
> On 2023-01-05 09:26, Ihor Radchenko  writes:
>
>> If you look inside `org-beamer--format-block', it uses
>> `org-beamer-environments-default' and `org-beamer-environments-extra' to
>> format the blocks. See docstring for the latter for details.
>>
>> The code responsible for LaTeX block generation is
>>
>>  (when (nth 2 env-format) ; when we non-column block
>>   (concat
>>(org-fill-template ...) ; opening \begin lines
>>contents ; block body
>>... ; block closing \end lines
>>)
>>
>> org-fill-template is using the template from the
>> `org-beamer-environments-*' replacing %-chars as described in the
>> docstring.
>>
>> In order to handle CUSTOM_ID property, you can
>> (1) Introduce a new %-substitude to be handled in org-fill-template
>> call. It will insert block ID. (for example, using
>> `org-beamer--get-label')
>> (2) modify `org-beamer-environments-default' to insert label
>> appropriately.
>>
>> Patches welcome!
>
> Thank you for the detailed instructions. Here is my attempt at this.
> I’ve tested it and it works.
>
>>From 1747786c7106d0d90d9e8752e361552afacb2d4d Mon Sep 17 00:00:00 2001
> From: Alan Schmitt 
> Date: Sun, 8 Jan 2023 17:20:31 +0100
> Subject: [PATCH] Add labels to latex export of beamer blocks
>
> A new option %l is available to be used in `org-beamer-environments-*'
> to insert the label of the current block, obtained using
> `org-babel--get-label'
> ---
>  lisp/ox-beamer.el | 9 +
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
> index 689bf1559..3518a0f50 100644
> --- a/lisp/ox-beamer.el
> +++ b/lisp/ox-beamer.el
> @@ -178,10 +178,10 @@ through `org-beamer-environments-extra' variable.")
>  ("quotation"  "q" "\\begin{quotation}%a %% %h""\\end{quotation}")
>  ("quote"  "Q" "\\begin{quote}%a %% %h""\\end{quote}")
>  ("structureenv"   "s" "\\begin{structureenv}%a %% %h" 
> "\\end{structureenv}")
> -("theorem""t" "\\begin{theorem}%a[%h]""\\end{theorem}")
> -("definition" "d" "\\begin{definition}%a[%h]" 
> "\\end{definition}")
> -("example""e" "\\begin{example}%a[%h]""\\end{example}")
> -("exampleblock"   "E" "\\begin{exampleblock}%a{%h}"   
> "\\end{exampleblock}")
> +("theorem""t" "\\begin{theorem}%a[%h]%l""\\end{theorem}")
> +("definition" "d" "\\begin{definition}%a[%h]%l" 
> "\\end{definition}")
> +("example""e" "\\begin{example}%a[%h]%l""\\end{example}")
> +("exampleblock"   "E" "\\begin{exampleblock}%a{%h}%l"   
> "\\end{exampleblock}")
>  ("proof"  "p" "\\begin{proof}%a[%h]"  "\\end{proof}")
>  ("beamercolorbox" "o" "\\begin{beamercolorbox}%o{%h}" 
> "\\end{beamercolorbox}"))
>"Environments triggered by properties in Beamer export.
> @@ -578,6 +578,7 @@ used as a communication channel."
>   (cons "O" (or raw-options ""))
>   (cons "h" title)
>   (cons "r" raw-title)
> +(cons "l" (format "\\label{%s}" (org-beamer--get-label 
> headline info)))
>   (cons "H" (if (equal raw-title "") ""
>   (format "{%s}" raw-title)))
>   (cons "U" (if (equal raw-title "") ""
> -- 
> 2.39.0
>
>
> Best,
>
> Alan


signature.asc
Description: PGP signature


Re: [BUG] CUSTOM_id ignored on blocks by ox-beamer

2023-01-08 Thread Alan Schmitt
Hello,

On 2023-01-05 09:26, Ihor Radchenko  writes:

> If you look inside `org-beamer--format-block', it uses
> `org-beamer-environments-default' and `org-beamer-environments-extra' to
> format the blocks. See docstring for the latter for details.
>
> The code responsible for LaTeX block generation is
>
>  (when (nth 2 env-format) ; when we non-column block
>   (concat
>(org-fill-template ...) ; opening \begin lines
>contents ; block body
>... ; block closing \end lines
>)
>
> org-fill-template is using the template from the
> `org-beamer-environments-*' replacing %-chars as described in the
> docstring.
>
> In order to handle CUSTOM_ID property, you can
> (1) Introduce a new %-substitude to be handled in org-fill-template
> call. It will insert block ID. (for example, using
> `org-beamer--get-label')
> (2) modify `org-beamer-environments-default' to insert label
> appropriately.
>
> Patches welcome!

Thank you for the detailed instructions. Here is my attempt at this.
I’ve tested it and it works.



signature.asc
Description: PGP signature
>From 1747786c7106d0d90d9e8752e361552afacb2d4d Mon Sep 17 00:00:00 2001
From: Alan Schmitt 
Date: Sun, 8 Jan 2023 17:20:31 +0100
Subject: [PATCH] Add labels to latex export of beamer blocks

A new option %l is available to be used in `org-beamer-environments-*'
to insert the label of the current block, obtained using
`org-babel--get-label'
---
 lisp/ox-beamer.el | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index 689bf1559..3518a0f50 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -178,10 +178,10 @@ through `org-beamer-environments-extra' variable.")
 ("quotation"  "q" "\\begin{quotation}%a %% %h""\\end{quotation}")
 ("quote"  "Q" "\\begin{quote}%a %% %h""\\end{quote}")
 ("structureenv"   "s" "\\begin{structureenv}%a %% %h" "\\end{structureenv}")
-("theorem""t" "\\begin{theorem}%a[%h]""\\end{theorem}")
-("definition" "d" "\\begin{definition}%a[%h]" "\\end{definition}")
-("example""e" "\\begin{example}%a[%h]""\\end{example}")
-("exampleblock"   "E" "\\begin{exampleblock}%a{%h}"   "\\end{exampleblock}")
+("theorem""t" "\\begin{theorem}%a[%h]%l""\\end{theorem}")
+("definition" "d" "\\begin{definition}%a[%h]%l" "\\end{definition}")
+("example""e" "\\begin{example}%a[%h]%l""\\end{example}")
+("exampleblock"   "E" "\\begin{exampleblock}%a{%h}%l"   "\\end{exampleblock}")
 ("proof"  "p" "\\begin{proof}%a[%h]"  "\\end{proof}")
 ("beamercolorbox" "o" "\\begin{beamercolorbox}%o{%h}" "\\end{beamercolorbox}"))
   "Environments triggered by properties in Beamer export.
@@ -578,6 +578,7 @@ used as a communication channel."
 		(cons "O" (or raw-options ""))
 		(cons "h" title)
 		(cons "r" raw-title)
+(cons "l" (format "\\label{%s}" (org-beamer--get-label headline info)))
 		(cons "H" (if (equal raw-title "") ""
 			(format "{%s}" raw-title)))
 		(cons "U" (if (equal raw-title "") ""
-- 
2.39.0


Best,

Alan


CUSTOM_id ignored on blocks by ox-beamer

2023-01-04 Thread alan . schmitt
Hello,

I’m writing course slides in org-mode (exported currently to beamer, but
I want to also have html export in the long run), and I have trouble
linking blocks (for theorems or definitions), as the CUSTOM_ID property
is ignored by ox-beamer on blocks.

I see this issue has already been raised on the list
(https://list.orgmode.org/87lflg9ts2@nicolasgoaziou.fr/T/), and
looking at the code it seems that it still needs to be modified.
Unfortunately the code for org-beamer--format-block is quite complex and
I do not see how to change it to add a label. Could someone on the list
please give me a hand?

Best,

Alan


signature.asc
Description: PGP signature


Re: org-sbe recent changes?

2022-11-01 Thread Alan Schmitt
On 2022-11-01 02:16, Ihor Radchenko  writes:

> Fixed on main.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=9987451252fa64af65d0a0a014f41812f4402c02

Thanks a lot!

Alan


signature.asc
Description: PGP signature


Re: org-sbe recent changes?

2022-10-31 Thread Alan Schmitt
Hello,

On 2022-10-31 01:24, Ihor Radchenko  writes:

> May you simplify your example to demonstrate the problem reproducibly
> (not only on your system with your files)?
> See https://orgmode.org/manual/Feedback.html#Feedback

Of course, sorry I did not do it. Here is a minimal example:

#+name: foo
#+begin_src emacs-lisp
3
#+end_src

| Name  | Test |
|---+--|
| Hello |  |
#+TBLFM: @2$2..@>$2='(org-sbe foo)


When I evaluate the formula, I get #ERROR instead of 3 in the cell. This
is with org 9.6. I have another emacs setup with 9.5.5 and there I have
the correct result.

Best,

Alan


signature.asc
Description: PGP signature


Re: org-sbe recent changes?

2022-10-30 Thread Alan Schmitt
If it matters, everything works with org version 9.5.5, but it break
with org 9.6.

Alan


signature.asc
Description: PGP signature


org-sbe recent changes?

2022-10-30 Thread alan . schmitt
Hello,

I’ve been using ledger and an org-mode table to track my finances for a
long time, and today it broke: when I evaluate a table macro, I get an
#ERROR instead of the computed value.

The code I’m using is still the one from here:
https://alan.petitepomme.net/tips/ledger_and_org.html

Basically I define a function like this (I added the message part for 
debugging):

#+name: call_ledger
#+begin_src emacs-lisp :var lcmd="bal" :var bucket="Quotidien" :var 
prefix="Expenses:" :var period=()
  (let* ((name (org-trim bucket))
 (bname (concat "'^" prefix name "'"))
 (ledger "ledger -f ~/Documents/Org/mescomptes.ledger")
 (parg (when period (concat " -p '" period "'")))
 (cutcmd "tail -1 | cut -d ' ' -f 2")
 (cmd
  (concat ledger " -J " parg " " lcmd " " bname " | " cutcmd))
 (res (org-trim (shell-command-to-string cmd
(message res)
(if (equal res "") 0 res))
#+end_src

Then I call it in a table that looks like this (removing a lot of stuff
for privacy reasons):

| Bucket | Planned | Remaining |
|+-+---+
| Achat Maison   |1000 | #ERROR|
|+-+---+
| Total  |1000 | #ERROR|
#+TBLFM: @2$3..@>>$3='(org-sbe call_ledger (bucket $$1) (prefix 
"\"Bucket:Expenses:\""))

It used to work, but now I get an #ERROR. The strange thing is that the
correct value is printed with the message call. Did something change
recently regarding org-sbe and table? How can I find out what the
value is causing the #ERROR to be printed?

Thanks,

Alan


signature.asc
Description: PGP signature


Re: Cannot schedule something for 2039?

2021-06-07 Thread Alan Schmitt
Hello Richard,

On 2021-06-07 11:17, Richard Lawrence  
writes:

> whoa, that's a weird behavior, but it seems not to be a bug. I learned
> something today!
>
> It looks like some Emacs implementations don't support dates after
> 2038-1-1, so Org doesn't let you specify them by default. See the
> variable `org-read-date-force-compatible-dates'. I think you want to set
> this variable to nil.

Thanks a lot for pointing to this variable, its docstring is quite
interesting.

I’m trying the workaround suggested (using a diary sexp, i.e.,
"<%%(diary-date 2039 4 2)>" in my case), but I cannot test it (the
agenda for that date won’t build, at the date is outside the range). I
guess this will be fixed by then ;)

Best,

Alan


signature.asc
Description: PGP signature


Cannot schedule something for 2039?

2021-06-07 Thread alan . schmitt
Hello,

I need to schedule something for 2039, but when I do it the date is set
for 2037. I tried with a plain emacs config and I see the same issue. Is
this a bug?

Best,

Alan


signature.asc
Description: PGP signature


Re: (void-variable timestamp-up) when building an agenda buffer

2021-05-11 Thread Alan Schmitt
On 2021-05-11 19:06, Tim Cross  writes:

> The type of error you appear to be seeing is common with a broken
> install. In your config, are you installing org from orgmode.org or
> melpa rather than just using the version bundled with Emacs 27.2? If so,
> it is likely that you have a 'mixed' install. This can happen if org is
> loaded when you try to install or update the org version. A common
> problem is not realising that something in your init file is causing org
> to be loaded during startup - then when you try to do a package update,
> you get a broken build.

Thank you for the suggestion. I reinstalled org-mode and it seems to
have fixed the problem.

Best,

Alan


signature.asc
Description: PGP signature


Re: (void-variable timestamp-up) when building an agenda buffer

2021-05-11 Thread Alan Schmitt
Hello again,

On 2021-05-11 09:53, Alan Schmitt  writes:

> It seems the problem is deeper than that: I cannot use any code that
> uses =org-dlet=… I’m on emacs 27.2.
>
> I did a quick test with no configuration, so the problem seems to be in
> my config, but I’m cursious if this rings a bell for anyone.

It seems that my vanilla emacs uses org 9.4.4, which was before the
switch to lexical binding in 9.5, so I guess this is the issue. As it’s
a pretty big one, I suspect it comes from my usage of doom (other doom
users have confirmed the problem).

Best,

Alan


signature.asc
Description: PGP signature


Re: (void-variable timestamp-up) when building an agenda buffer

2021-05-11 Thread Alan Schmitt
Hello,

It seems the problem is deeper than that: I cannot use any code that
uses =org-dlet=… I’m on emacs 27.2.

I did a quick test with no configuration, so the problem seems to be in
my config, but I’m cursious if this rings a bell for anyone.

Thanks,

Alan


signature.asc
Description: PGP signature


(void-variable timestamp-up) when building an agenda buffer

2021-05-11 Thread alan . schmitt
Hello,

After a recent update, I no longer can build an agenda buffer. I put the
backtrace that I get at the end of this message. On the top of the trace
there is a call to org-entries-lessp, which looks like this:

(defun org-entries-lessp (a b)
  "Predicate for sorting agenda entries."
  ;; The following variables will be used when the form is evaluated.
  ;; So even though the compiler complains, keep them.
  (let ((ss org-agenda-sorting-strategy-selected))
(org-dlet
((timestamp-up(and (org-em 'timestamp-up 'timestamp-down ss)
   (org-cmp-ts a b "")))

Did something change recently around this code?

Thanks,

Alan

Debugger entered--Lisp error: (void-variable timestamp-up)
  org-entries-lessp(#("  Mobile: TODO 2..." 0 14 (type "tagsmatch" priority 
1000 ts-date nil todo-state "TODO" org-hd-marker # org-marker # help-echo "mouse-2 or RET jump ..." 
org-complex-heading-regexp "^\\(\\*+\\)\\(?: +\\(CANC..." org-todo-regexp 
"\\(CANCELLED\\|DONE\\|H..." org-not-done-regexp "\\(HOLD\\|NEXT\\|TODO\\|..." 
...) 14 18 (org-heading t fontified t face org-todo org-category "Mobile" tags 
... org-priority-highest 65 org-priority-lowest 67 time-of-day nil duration nil 
breadcrumbs nil ...) 18 19 (type "tagsmatch" priority 1000 ts-date nil 
todo-state "TODO" org-hd-marker # org-marker # 
help-echo "mouse-2 or RET jump ..." org-complex-heading-regexp 
"^\\(\\*+\\)\\(?: +\\(CANC..." org-todo-regexp "\\(CANCELLED\\|DONE\\|H..." 
org-not-done-regexp "\\(HOLD\\|NEXT\\|TODO\\|..." ...) 19 30 (type "tagsmatch" 
priority 1000 ts-date nil todo-state "TODO" org-hd-marker # org-marker # help-echo "mouse-2 or RET jump ..." 
org-complex-heading-regexp "^\\(\\*+\\)\\(?: +\\(CANC..." org-todo-regexp 
"\\(CANCELLED\\|DONE\\|H..." org-not-done-regexp "\\(HOLD\\|NEXT\\|TODO\\|..." 
...) 30 55 (type "tagsmatch" priority 1000 ts-date nil todo-state "TODO" 
org-hd-marker # org-marker 
# help-echo "mouse-2 or 
RET jump ..." org-complex-heading-regexp "^\\(\\*+\\)\\(?: +\\(CANC..." 
org-todo-regexp "\\(CANCELLED\\|DONE\\|H..." org-not-done-regexp 
"\\(HOLD\\|NEXT\\|TODO\\|..." ...) 55 61 (type "tagsmatch" priority 1000 
ts-date nil todo-state "TODO" org-hd-marker # org-marker # help-echo "mouse-2 or RET jump ..." org-complex-heading-regexp 
"^\\(\\*+\\)\\(?: +\\(CANC..." org-todo-regexp "\\(CANCELLED\\|DONE\\|H..." 
org-not-done-regexp "\\(HOLD\\|NEXT\\|TODO\\|..." ...) ...) #("  Mobile: Au 
rez..." 0 14 (type "tagsmatch" priority 1000 ts-date nil todo-state nil 
org-hd-marker # org-marker 
# help-echo "mouse-2 or 
RET jump ..." org-complex-heading-regexp "^\\(\\*+\\)\\(?: +\\(CANC..." 
org-todo-regexp "\\(CANCELLED\\|DONE\\|H..." org-not-done-regexp 
"\\(HOLD\\|NEXT\\|TODO\\|..." ...) 14 165 (type "tagsmatch" priority 1000 
ts-date nil todo-state nil org-hd-marker # org-marker # help-echo "mouse-2 or RET jump ..." org-complex-heading-regexp 
"^\\(\\*+\\)\\(?: +\\(CANC..." org-todo-regexp "\\(CANCELLED\\|DONE\\|H..." 
org-not-done-regexp "\\(HOLD\\|NEXT\\|TODO\\|..." ...) 165 167 (type 
"tagsmatch" priority 1000 ts-date nil todo-state nil org-hd-marker # org-marker # help-echo "mouse-2 or RET jump ..." 
org-complex-heading-regexp "^\\(\\*+\\)\\(?: +\\(CANC..." org-todo-regexp 
"\\(CANCELLED\\|DONE\\|H..." org-not-done-regexp "\\(HOLD\\|NEXT\\|TODO\\|..." 
...) 167 173 (type "tagsmatch" priority 1000 ts-date nil todo-state nil 
org-hd-marker # org-marker 
# help-echo "mouse-2 or 
RET jump ..." org-complex-heading-regexp "^\\(\\*+\\)\\(?: +\\(CANC..." 
org-todo-regexp "\\(CANCELLED\\|DONE\\|H..." org-not-done-regexp 
"\\(HOLD\\|NEXT\\|TODO\\|..." ...) 173 175 (type "tagsmatch" priority 1000 
ts-date nil todo-state nil org-hd-marker # org-marker # help-echo "mouse-2 or RET jump ..." org-complex-heading-regexp 
"^\\(\\*+\\)\\(?: +\\(CANC..." org-todo-regexp "\\(CANCELLED\\|DONE\\|H..." 
org-not-done-regexp "\\(HOLD\\|NEXT\\|TODO\\|..." ...)))
  sort((... ... ...) org-entries-lessp)
  org-agenda-finalize-entries((... ... ... ... ... ...) tags)
  org-tags-view(nil "REFILE")
  #f(compiled-function () #)()
  funcall(#f(compiled-function () #))
  (let ((org-agenda-overriding-header '"Tasks to Refile")) (funcall 
'#f(compiled-function () #)))
  eval((let ((org-agenda-overriding-header '"Tasks to Refile")) (funcall 
'#f(compiled-function () #
  org-agenda-run-series("daily review" (((tags "REFILE" 
((org-agenda-overriding-header "Tasks to Refile"))) (tags-todo 
"-CANCELLED-@maybe/!-HOLD" ((org-agenda-overriding-header "Stuck Projects") 
(org-agenda-skip-function 'bh/skip-non-stuck-projects))) (agenda "" 
((org-agenda-skip-scheduled-if-deadline-is-shown t) 
(org-agenda-skip-deadline-prewarning-if-scheduled 'pre-scheduled) 
(org-agenda-span 'day) (org-agenda-overriding-header "Today"))) (agenda "" 
((org-agenda-skip-scheduled-if-deadline-is-shown t) 
(org-agenda-skip-deadline-prewarning-if-scheduled 'pre-scheduled) 
(org-agenda-span 6) (org-agenda-start-day "+1d") (org-agenda-overriding-header 

Re: contact management in emacs

2021-03-07 Thread Alan Schmitt
Hello,

On 2021-03-08 01:13, Jean Louis  writes:

> I am recommending that you start using PostgreSQL database. I can
> guide you. My software is not so finished for public, but I can guide
> you personally and you will get stable system that lasts for years.

Thank you for the suggestion, but for the moment I think I will
experiment with text-based solutions.

Best,

Alan


signature.asc
Description: PGP signature


Re: [PATCH] org-mac-link: Disable Evernote capture by default

2021-02-28 Thread Alan Schmitt
On 2021-02-27 17:58, Kyle Meyer  writes:

>> Any chance of getting this merged in? It's a pretty nasty one for mac users.
>
> Thanks for the patch.  Ideally someone that uses macOS would provide a
> review.  Based on the history of the file, I've cc'd two people that may
> be willing/able to do so.

Sorry, but I’ve switched to Linux a couple years ago.

Best,

Alan


signature.asc
Description: PGP signature


Re: contact management in emacs

2021-02-28 Thread Alan Schmitt
Hello,

Thanks a lot for all the replies. I migrated from bbdb to ebdb a long
time ago, and I may go back following your suggestions.

Thanks again,

Alan


signature.asc
Description: PGP signature


contact management in emacs

2021-02-27 Thread Alan Schmitt
Hello,

This may be slightly off-topic for the list, but as I’m considering
org-contacts for my question, I hope it will be of interest here.

I would like to migrate my contact management to emacs, as I’m already
using it for email. My requirements are the following ones:
- address completion in emacs email clients (I currently use notmuch)
- support for multiple email addresses and custom fields
- creation of org links to contacts
- export to vcard format for synchronization to my mobile phone (using
vdirsyncer)
- keep the data under version control

I have looked at two tools, which almost seem fit for the job.
- ebdb does most of this, with the exception of vcard export (it seems
to be worked on, https://github.com/girzel/ebdb/issues/60), and I’m not
sure using version control on an sqlite file is a good idea.
- org-contacts also seem to have all the required features, including
vcard export (and if not sufficient there is
https://github.com/novoid/org-contacts2vcard). I was worried it was
unmaintained when looking at the copyright line, but I see in
https://code.orgmode.org/bzg/org-mode/commits/master/contrib/lisp/org-contacts.el
that there are recent commits to the file.

Do you manage your contacts in emacs? And if so, what tools or workflow
do you recommend?

Best,

Alan


signature.asc
Description: PGP signature


Re: org-agenda for a day different than today

2021-02-21 Thread Alan Schmitt
On 2021-02-21 01:23, Kyle Meyer  writes:

> Okay, thanks for checking.  Added a basic test and applied (3a522ad53).

Great, thanks a lot!

Best,

Alan


signature.asc
Description: PGP signature


Re: org-agenda for a day different than today

2021-02-18 Thread Alan Schmitt
Hello,

On 2021-02-18 00:32, Kyle Meyer  writes:

>> Looking at the code, I don’t see how it could cause trouble elsewhere
>> (but understanding agenda code is always tricky…)
>
> Yeah, I too think it's safe.  If you have the time, I'd appreciate if
> you could skim through the above threads and see if there are any
> minimal examples or test cases.  If so, it be good to verify that they
> still work with the patch.

I tested the first thread (where two agendas are displayed) and it still
works.

The second thread was about the beginning of the week wrongly set in a
custom file.

Best,

Alan


signature.asc
Description: PGP signature


Re: refreshing files for agenda building

2021-02-17 Thread Alan Schmitt
On 2021-02-17 22:20, Peter Hardy  writes:

> I occasionally run in to this as well, using webdav to sync my org
> files. Currently using org-revert-all-org-buffers to revert all Org
> buffers, followed by org-agenda-redo (bound to r in the agenda view) to
> rebuild the agenda.

Thanks a lot, this is most useful!

Best,

Alan


signature.asc
Description: PGP signature


refreshing files for agenda building

2021-02-17 Thread Alan Schmitt
Hello,

I have some files that are changed on disk by an external process, and
it seems that calling org-agenda does not see the changes until I visit
the file in emacs. The buffers are loaded and they are auto-reverted,
but for some reason (some cache somewhere?) their contents are not
up-to-date with what is produced by org-agenda.

Is there a command to refresh such files? Should I programatically visit
them? (And if so, do you have a suggestion as to which command I should
use, I could not find one?)

Thanks,

Alan


signature.asc
Description: PGP signature


Re: org-agenda for a day different than today

2021-02-17 Thread Alan Schmitt
Hello Kyle,

On 2021-02-16 23:01, Kyle Meyer  writes:

>> By the way, I’m surprised by the code of this function, as it is defined
>> as:
>>
>> (defun org-agenda-goto-date (span)
>>   "Jump to DATE in agenda."
>>   …
>> )
>>
>> and "span" is never mentioned in the function. Am I missing something?
>
> That does look wrong.  Among other changes, 93fcfe4d3 (org-agenda.el:
> Fix org-agenda-goto-date' again, 2012-08-30) switched the DATE argument
> to SPAN, moving the org-read-date call out of the interactive form.
> From that commit alone, I don't have a good guess at why and am
> wondering if the above change was an unfinished thought that came along
> with the other changes.
>
> Here are two threads from around that time that may be related, though I
> haven't reviewed either of them:
>
>  https://orgmode.org/list/blu0-smtp912fc379760ee431d3d68ebb...@phx.gbl/T/#u
>  https://orgmode.org/list/blu0-smtp950e9387b34fa390c4fd9cbb...@phx.gbl/T/#u
>
> Moving org-read-date back to the interactive form would allow lisp
> callers to pass in the date, though perhaps it'd bring back some
> misbehavior discussed in the above threads.

I’ve tried this change here and it works great, thanks a lot.

Looking at the code, I don’t see how it could cause trouble elsewhere
(but understanding agenda code is always tricky…)

Should I file a bug regarding this?

Best,

Alan


signature.asc
Description: PGP signature


org-agenda for a day different than today

2021-02-16 Thread Alan Schmitt
Hello,

I’ve been reading the documentation around org-agenda, and I cannot find
a way to call it to get an agenda for a day different than today. I’ve
found org-agenda-goto-date, but I don’t know how to call it from
emacs-lisp with the target date.

By the way, I’m surprised by the code of this function, as it is defined
as:

(defun org-agenda-goto-date (span)
  "Jump to DATE in agenda."
  …
)

and "span" is never mentioned in the function. Am I missing something?

Thanks,

Alan


signature.asc
Description: PGP signature


Re: programatically generate an agenda

2021-02-15 Thread Alan Schmitt
On 2021-02-14 12:12, John Kitchin  writes:

> If it is possible to set up what you want in an entry in
> org-agenda-custom-commands, then you can call it in a program like
>
> #+BEGIN_SRC emacs-lisp
> (org-agenda nil "w" nil)
> #+END_SRC

This is what I ended up doing.

- set up an agenda view with only the current day and the events:

#+begin_src emacs-lisp
  ("d" "Daily schedule"
   ((agenda ""
((org-agenda-span 'day)
 (org-agenda-use-time-grid nil)
 (org-agenda-skip-function '(org-agenda-skip-entry-if 'scheduled))
 
#+end_src

- use it with org-agenda write, massaging the results a little

#+begin_src emacs-lisp
(defun as/get-daily-agenda ()
  "Return the agenda for the day as a string."
  (interactive)
  (let ((file (make-temp-file "daily-agenda" nil ".txt")))
(org-agenda nil "d" nil)
(org-agenda-write file nil nil "*Org Agenda(d)*")
(kill-buffer)
(with-temp-buffer
  (insert-file-contents file)
  (goto-char (point-min))
  (kill-line 2)
  (while (re-search-forward "^  " nil t)
(replace-match "- " nil nil))
  (buffer-string
#+end_src

Thanks again for your suggestion.

Best,

Alan


signature.asc
Description: PGP signature


Re: programatically generate an agenda

2021-02-15 Thread Alan Schmitt
On 2021-02-14 12:12, John Kitchin  writes:

> If it is possible to set up what you want in an entry in
> org-agenda-custom-commands, then you can call it in a program like
>
> #+BEGIN_SRC emacs-lisp
> (org-agenda nil "w" nil)
> #+END_SRC
>
> In that snippet, I have the key in an org-agenda-custom-commands set to
> "w".
>
> that generates an agenda buffer for me, which I assume you can then use
> the org-agenda-write command on.

Thank you for the suggestion, this is most useful.

Best,

Alan


signature.asc
Description: PGP signature


programatically generate an agenda

2021-02-13 Thread Alan Schmitt
Hello,

In my quest/endeavor/struggle to generate an org file for what I want to
do during the day, I’m trying to leverage the power of org-agenda (that
does a lot of what I want to do) to create an org file. I learned of
org-agenda-write, which I could use to write to file what I want then
include it in my org file, but for that I need to create the correct
org-agenda buffer. What is the elisp way of doing it?

I tried using org-agenda-list, but it only seems to restore the current
agenda view. For instance, (org-agenda-list nil nil 1) generates an
agenda for the week (which is my default), even though I pass a SPAN
argument of 1. I also don’t know how to set the org-agenda-skip steps
before calling that function…

Thanks a lot for any suggestion on how to do this.

Best,

Alan


signature.asc
Description: PGP signature


Re: generate an org file for today's appointments

2020-12-04 Thread Alan Schmitt
Hello,

On 2020-12-03 20:15, TRS-80  writes:

> I am also not someone who uses one of these "daily journal" workflows,
> so I can't help but wonder how you link these daily notes back to the
> underlying project that generated the event on the agenda in the first
> place.  Becasue in my mind, I would jump from the agenda to the
> underlying project or task and be making my notes in there directly.
> Those linking considerations, in my mind anyway, would really dictate
> the rest of the workflow.

This is a very good point. My appointments do not currently have links
to the related projects (the "database of trust" is the calendar one,
which is caldav outside of emacs… maybe I should change that, but I need
to synchronize my calendar with my phone). So I currently add the links
manually. I'll have to think about this.

Best,

Alan


signature.asc
Description: PGP signature


Re: generate an org file for today's appointments

2020-12-04 Thread Alan Schmitt
Hello,

On 2020-12-03 12:01, Mikhail Skorzhisnkii  writes:

> I'd suggest to use function "org-agenda-write". You can export 
> your agenda views to org files too! However, the formatting will 
> be different. Probably something like:
>
> * Event A
>   SCHEDULED: <2020-12-03 Thu 10:00-12:00>
> * Event B
>   SCHEDULED: <2020-12-03 Thu 10:00-11:00>
> * Event C
>   SCHEDULED: <2020-12-03 Thu 14:00-15:30>
> * Event D
>   SCHEDULED: <2020-12-03 Thu 20:00-21:30>
>
> I personally do this to generate separate org-file and then 
> generate ics file based on that and upload this ics file through 
> WebDAV to my calendar server.

This is most useful, thanks a lot! This should be more than sufficient
for my needs.

Best,

Alan


signature.asc
Description: PGP signature


generate an org file for today's appointments

2020-12-02 Thread Alan Schmitt
Hello,

I have my calendars converted to org files (using ical2orgpy), and as I
include them as agenda files, I have this nice view in org-agenda:

   9:10.. now - - - - - - - - - - - - - - - - - - - - - - - - -
  AlanWork:   10:00-12:00 Event A -
  Chris:  10:00-11:00 Event B -
  10:00.. 
  12:00.. 
  AlanWork:   14:00-15:30 Event C -
  14:00.. 
  16:00.. 
  18:00.. 
  Alan:   20:00-21:30 Event D -

Is there a way to piggy-back on all the work that org-agenda already did
to generate something like:

** 10:00 Event A
** 10:00 Event B
** 14:00 Event C
** 20:00 Event D

This would then be inserted in my daily journal file.

I guess the alternative is using org-element to extract the information
from the calendars in org format, but it seems to me org-agenda already
did all the hard work.

Do you have suggestions to do this?

Thanks,

Alan


signature.asc
Description: PGP signature


Re: Bring up a screen giving option to open a series of orgmode files

2020-11-27 Thread Alan Schmitt
Hello,

On 2020-11-27 05:40, Jean Louis  writes:

> Now we have `evince' PDF viewer that can open PDF I think by page
> number and by query but it cannot do the equivalent
> `evince-store-link' so user has to think about the file name and page
> number and so on.

For that I recommend pdf-tools (great pdf viewer for emacs, supporting
annotations and synctex, https://github.com/politza/pdf-tools) and
org-pdftools (provides org links for it,
https://github.com/fuxialexander/org-pdftools). There is also the
org-noter option (https://github.com/weirdNox/org-noter) to link
external annotations to pdfs.

> We have browsers that each of them think for themselves. Each can
> store bookmarks but hardly provide such to external programs.

For that org-protocol was mentioned. There is eww as well to browse
within emacs (and thus have links).

> File managers do not provide `file-manager-store-link' but they should
> as it would be very useful to have programs integrate with each other
> that hyperdocument systems can be built.

dired is a nice file manager. I agree having something at the level of
the OS would be great, but emacs is a pretty good OS ;)

Best,

Alan


signature.asc
Description: PGP signature


Re: storing a link to a task from an agenda view

2020-11-22 Thread Alan Schmitt
On 2020-11-22 13:36, Ihor Radchenko  writes:

>> Do you have suggestions on how to store such a link from an agenda view?
>> It can either end up in ~org-stored-links~ or captured in a variable.
>
> (org-store-link nil) -> (org-store-link nil 'interactive)
>
> Or you can just save the return value of (org-store-link nil)

Thanks a lot, that worked great!

I've written a small post about it (which is a bit org-roam specific)
here:
https://org-roam.discourse.group/t/daily-task-management-with-org-agenda-and-org-roam-dailies/989

Best,

Alan


signature.asc
Description: PGP signature


storing a link to a task from an agenda view

2020-11-21 Thread Alan Schmitt
Hello,

I'm trying to store a link to a task while the cursor is on it in the
agenda view. I tried ~org-store-link~ on it, but it tells me there is no
method to do so. So I looked at some of the org-agenda code to find a
way to get to the underlying task, and I tried this:

#+begin_src emacs-lisp
(defun as/mk-agenda-link ()
  (interactive)
  (let* ((marker (or (org-get-at-bol 'org-marker)
 (org-agenda-error)))
 (buffer (marker-buffer marker))
 (pos (marker-position marker)))
(with-current-buffer buffer
  (save-excursion
(goto-char pos)
(org-store-link nil)

#+end_src

but it does not store anything. (I have to put the ~nil~ at the
~org-store-link~ code otherwise I have an error, and looking at some of
the ~org-capture~ code, I saw it there.)

Do you have suggestions on how to store such a link from an agenda view?
It can either end up in ~org-stored-links~ or captured in a variable.

Thanks,

Alan


signature.asc
Description: PGP signature


Re: add linked files to agenda files

2020-11-16 Thread Alan Schmitt
Hello Nick,

On 2020-11-16 16:33, Nick Dokos  writes:

> Just guessing at this point, I would imagine you'd want something like
> this:
>
> --8<---cut here---start->8---
> (defun path-from-link (link)
>(org-element-property :path link))
>
> (setq org-agenda-files (with-current-buffer
>  (find-file-noselect "master.org")
>  (org-element-map (org-element-parse-buffer)
>   '(link)
>   #'path-from-link)))
> --8<---cut here---end--->8---

Thanks a lot, this is most useful! I did not think it could be this
simple.

Best,

Alan


signature.asc
Description: PGP signature


add linked files to agenda files

2020-11-14 Thread Alan Schmitt
Hello,

I'm experimenting with a setup where each project is its own org file,
and where I have a master file linking to active projects. How can I
configure org to add every linked file of that master file to the
org-agenda-files?

Thanks,

Alan


signature.asc
Description: PGP signature


Re: recursive checkbox counting

2020-10-02 Thread Alan Schmitt
On 2020-10-02 09:40, Nick Dokos  writes:

> Not sure whether this will work (or whether it will help in your case):
>
> https://emacs.stackexchange.com/questions/60710/is-there-any-way-of-getting-overview-statistics-for-all-checkboxes-in-a-given-or/60747#60747
>
> There are some links to other questions on Emacs SE that might (or
> might not) be helpful.

Thank you for the suggestion. I think I might stay with nested lists at
the moment, as it works for me.

Best,

Alan


signature.asc
Description: PGP signature


Re: recursive checkbox counting

2020-10-02 Thread Alan Schmitt
On 2020-10-01 14:24, torys.ander...@gmail.com (Tory S. Anderson) writes:

> The way I've made this work is with the following property:
>
>:COOKIE_DATA: ALL
>
> But I suppose I haven't tried if that's fully recursive.

Thank you for the suggestion. I gave it a try, and unfortunately it does
not work.

Best,

Alan


signature.asc
Description: PGP signature


Re: recursive checkbox counting

2020-10-01 Thread Alan Schmitt
Hello Eric,

On 2020-10-01 12:26, Eric S Fraga  writes:

> On Thursday,  1 Oct 2020 at 08:44, Alan Schmitt wrote:
>> I'm trying to recursively count checkboxes, with intermediate counting:
>
> I think you can only do this for lists of lists.  In your case, you
> would have the 2020 headline but all subheadings would be list elements
> with the cookie.  You would keep the recursive property in the top
> headline.

Thank you for the suggestion, it works indeed.

> But, for the record, I would like to be able to do what you want as
> well.  It just doesn't seem possible currently.

I agree.

Best,

Alan


signature.asc
Description: PGP signature


Re: Reciprocal links between items

2020-10-01 Thread Alan Schmitt
On 2020-10-01 10:53, "Victor A. Stoichita"  writes:

> I wonder whether org-mode has a way to indicate reciprocal A↔B 
> relations between two items. If item A points to item B, then 
> automatically B also points to A.  Accordingly, when the relation 
> is removed on A, it is also removed from B. 
>
> I’m in the process of bringing my notes from Zotero to Org. 
> What I’m after is something like Zotero’s "related" feature. 
> Is there a way to represent that kind of relation in org?

You might want to have a look at org-roam, that implements such
backlinks.

https://github.com/org-roam/org-roam

Best,

Alan


signature.asc
Description: PGP signature


recursive checkbox counting

2020-10-01 Thread Alan Schmitt
Hello,

I'm trying to recursively count checkboxes, with intermediate counting:

* [0/0] 2020
:PROPERTIES:
:COOKIE_DATA: checkbox recursive
:END:
** [1/1] Week 39
- [X] [[file:2020-09-29.org][§:2020-09-29 (Tuesday)]]
** [2/2] Week 36
- [X] [[file:2020-09-08.org][§:2020-09-08 (Tuesday)]]
- [X] [[file:2020-09-07.org][§:2020-09-07 (Monday)]]

Unfortunately I don't know what property I need to set on the top-level
node to recursively count everything. I would like to see [3/3] there.
Is there a way to do it?

Thanks,

Alan


signature.asc
Description: PGP signature


Re: org-tables with monetary amounts

2020-09-25 Thread Alan Schmitt
Hello,

On 2020-09-25 13:20, Daniele Nicolodi  writes:

> I use beancoount (another text-based accounting software, very similar
> to ledger) for accounting purposes and I am very happy with it. I use
> org-mode for planning and management tasks or simply to compare quotes,
> things better handled in a a spreadsheet table.

I use ledger, and I wrote a small page about how I use org with it:
http://alan.petitepomme.net/tips/ledger_and_org.html

> I think it is time to have a look at how org-tables can be extended to
> handle monetary quantities.

Yes! I'm currently writing a tutorial about envelope budgeting (using
org-mode, of course), and it would help to have my table examples with
monetary quantities.

Best,

Alan


signature.asc
Description: PGP signature


Re: multiple EXPORT_LATEX_HEADER lines

2020-06-16 Thread Alan Schmitt
Hello Eric,

On 2020-06-15 10:20, Eric S Fraga  writes:

> On Saturday, 13 Jun 2020 at 17:02, Alan Schmitt wrote:
>> This is the crux of the issue: there does not seem to be any way to
>> generate a multi-line header. And this causes problems with LaTeX.
>
> Is the problem solvable in LaTeX?  Does \makeatletter expect to be on a
> single line?  As I said before, I've seldom played with @ variables or
> functions in LaTeX.  However, I had the impression that LaTeX was quite
> robust with respect to whitespace & newlines.

You're right, it should work in a single line. I don't what I did that
made it fail, and I no longer can reproduce it. Sorry for the noise.

Best,

Alan


signature.asc
Description: PGP signature


Re: multiple EXPORT_LATEX_HEADER lines

2020-06-13 Thread Alan Schmitt
Hello,

On 2020-06-12 16:01, Eric S Fraga  writes:

> The snippet from the OP will collate all three LaTeX header lines into a
> single line on export, which is expected in terms of org's
> behaviour.  This appears to cause problems with LaTeX, which is maybe
> expected or not; I don't know what LaTeX expects when working in @
> letter mode as I've seldom (if ever?) had to redefine @ variables.

This is the crux of the issue: there does not seem to be any way to
generate a multi-line header. And this causes problems with LaTeX.

There are two workarounds for this that I know of: put the latex in some
other file and \input it, or use a dedicated file and use multiple
#+LATEX_HEADER. I ended up doing it that way.

Thanks,

Alan


signature.asc
Description: PGP signature


Re: multiple EXPORT_LATEX_HEADER lines

2020-06-12 Thread Alan Schmitt
Hello Dominik,

On 2020-06-12 10:31, Dominik Schrempf  writes:

> are you looking for, e.g.,
>
> #+latex_header: \addbibresource{bibliography.bib}
> #+latex_header_extra: do some stuff
> #+latex_header_extra: and even more
>
> I don't use the EXPORT keyword at the beginning, I am not sure if it is 
> needed.

To be more precise, I want to emulate
#+LATEX_HEADER: \makeatletter
#+LATEX_HEADER+: \@setplength{refvpos}{\useplength{toaddrvpos}}
#+LATEX_HEADER+: \makeatother

(as a full file export, which yields 3 separate lines), for a subtree
export, were the property :EXPORT_LATEX_HEADER: is used.

Best,

Alan


signature.asc
Description: PGP signature


multiple EXPORT_LATEX_HEADER lines

2020-06-12 Thread Alan Schmitt
Hello,

I would like to have a multi-line export header when exporting a
subtree. I tried this:

:EXPORT_LATEX_HEADER: \makeatletter
:EXPORT_LATEX_HEADER+: \@setplength{refvpos}{\useplength{toaddrvpos}}
:EXPORT_LATEX_HEADER+: \makeatother

The problem is that it's exported on a single line, and as such it does
not work. Is there a way to have the multiple properties exported as
multiple lines, or to specify in the property there is a line break?

Thanks,

Alan


signature.asc
Description: PGP signature


Re: links are not parsed in keyword context

2020-04-13 Thread Alan Schmitt
Hello Nicolas,

On 2020-04-13 11:19, Nicolas Goaziou  writes:

> This is a feature. With a few exception, keyword value is not parsed,
> i.e., Org does not need to understand what happens in there.

Thank you for the explanation.

>> Alternatively, should I suggest org-ref uses an approach similar to
>> the one in ~org-return~?
>
> I think Org Ref can parse the value of the keyword (a string), instead.
> There is, for example, `org-element-parse-secondary-string'.

I mentioned your suggestion in the issue on the org-ref repo
(https://github.com/jkitchin/org-ref/issues/718). Thanks again.

Best,

Alan




links are not parsed in keyword context

2020-04-13 Thread Alan Schmitt
Hello,

If you consider the following line in an org file

#+begin_src org
#+FOO: http://alan.petitepomme.net/
#+end_src

then calling ~org-element-context~ returns

#+begin_src emacs-lisp
(keyword
 (:key "FOO"
  :value "http://alan.petitepomme.net/;
  :begin 1
  :end 38
  :post-blank 1
  :post-affiliated 1
  :parent nil))
#+end_src

If the same link is in the body of the org file, one gets

#+begin_src emacs-lisp
(link
 (:type "http"
  :path "//alan.petitepomme.net/"
  :format plain
  :raw-link "http://alan.petitepomme.net/;
  :application nil
  :search-option nil
  :begin 38
  :end 66
  :contents-begin nil
  :contents-end nil
  :post-blank 0
  :parent (paragraph
   (:begin 38
:end 68
:contents-begin 38
:contents-end 67
:post-blank 1
:post-affiliated 38
:parent nil
#+end_src

The link can still be opened in both cases using ~org-open-at-point~,
but it is a problem for org-ref that relies on the second format to
extract the link information (see
https://github.com/jkitchin/org-ref/blob/master/org-ref-core.el#L2045,
where the link is set to ~nil~ because there is no ~:path~ property).

I see that orgmode uses a workaround in ~org-return~ when
~org-return-follows-link~ is set to true, to detect if there is a link
using a regexp
(https://code.orgmode.org/bzg/org-mode/src/maint/lisp/org.el#L18106):
#+begin_src emacs-link
((and org-return-follows-link
  (or (org-in-regexp org-ts-regexp-both nil t)
  (org-in-regexp org-tsr-regexp-both nil  t)
  (org-in-regexp org-any-link-re nil t)))
(call-interactively #'org-open-at-point))
#+end_src

Could is be possible to parse a link in keyword context? Alternatively,
should I suggest org-ref uses an approach similar to the one in ~org-return~?

Thanks,

Alan




Re: org-ref: xxx-add-bibtex-entry with an org-capture like interface

2020-04-10 Thread Alan Schmitt
Hello,

On 2020-04-09 15:43, John Kitchin  writes:

> This is basically what doi-add-bibtex-entry does. There isn't one
> function that does arxiv too, but there is arxiv-add-bibtex-entry. Those
> are both commands in org-ref. These don't pop up a buffer for approval,
> that is something you would have to build yourself.
>
> There are many workflows people want, the one above works for me when I
> am writing, and just want to add entries with minimal disruption. I
> usually polish the entries later if needed. I can see a slower, approach
> like you describe too.

There is also the biblio-lookup command (from biblio.el,
https://github.com/cpitclaudel/biblio.el) that might be useful for this.

Best,

Alan




Re: problem when linking to headlines?

2020-02-26 Thread Alan Schmitt
On 2020-02-26 16:38, Nicolas Goaziou  writes:

> Oops. Fixed. Thank you!

Thanks a lot for the quick fix!

Best,

Alan



problem when linking to headlines?

2020-02-26 Thread Alan Schmitt
Hello,

I have these two files:

link1.org:

* Test

link2.org:

[[file:link1.org::*Test][Test]]

When I click on the first link, I get this in a dired buffer (there is
no error).

  /home/schmitta/tmp:
  wildcard link1.org::*Test
  zsh:1: no matches found: link1.org::*Test

I'm using Org Mode 9.4, and this issue started occurring recently after
I upgraded org.

Is this a consequence of the recent change on file links? How can I
debug which link handler is used?

Thanks,

Alan



Re: org link to OCaml comment

2020-02-20 Thread Alan Schmitt
On 2020-02-19 18:49, Nicolas Goaziou  writes:

> Alan Schmitt  writes:
>
>> I understand, and I can be careful (and easily fix the link if needed).
>> If `org-store-link' could do it for me, that would be perfect.
>
> I pushed some changes to `org-store-link' in order to fix this.  Please
> report if there is anything wrong.

Thanks a lot!

Best,

Alan



Re: org link to OCaml comment

2020-02-07 Thread Alan Schmitt
On 2020-02-07 15:33, Nicolas Goaziou  writes:

> *shivers* Please never suggest again url-encoding links in Org! ;) We
> only got out of this hell recently. I don't want to dive in again.

Sorry, I should have put a smiley there.

> There is some specific syntax in links. More specifically, the
> following are meaningful:
>
> - a star at the beginning of the link (or search option)
> - a hash at the beginning of the link
> - forward slashes around the link
> - parenthesis around the link
>
> I think that `org-store-link' should be careful about it and prevent
> these pathological cases if necessary.
>
> In any other situation, however, I think the user is responsible for
> not using these specific constructs.
>
> WDYT?

I understand, and I can be careful (and easily fix the link if needed).
If `org-store-link' could do it for me, that would be perfect.

Thanks again for the explanation.

Best,

Alan



Re: org link to OCaml comment

2020-02-06 Thread Alan Schmitt
Hello Nicolas,

On 2020-02-06 18:10, Nicolas Goaziou  writes:

> Link enclosed within parens meant coderef links, i.e., the syntax is
> reserved. You can probably remove the closing parenthesis to avoid this.

Thank you for the explanation. Is there a way to either escape the
parentheses (maybe url-encode them), or to automatically not include the
closing one as you suggest when creating the link?

(I'm asking someone who does not know org-mode to document his code, use
links to point to the relevant code. I'm afraid it will be tricky to ask
him to tweak the links that org create so that they work.)

Thanks again,

Alan



Re: org link to OCaml comment

2020-02-06 Thread Alan Schmitt
Hello John,

On 2020-02-06 09:58, John Kitchin  writes:

> I think you need to do it like this:
>
> #+BEGIN_SRC test.ml -r
>
> (* Object projection functions  *) (ref:opf)
>
>
> #+END_SRC
>
> [[file:2020-02-05.org::(opf)]]
>
> The -r in the header removes the coderef when you run it.

Thank you for the suggestion. Unfortunately I need to link to an
external ml file. I can change it, but I need to get a syntactically
valid file.

I tried putting the ref part inside the comment and unfortunately it
does not work.

The strange part is that linking to arbitrary code works. It seems that
the OCaml comment syntax is problematic here.

Best,

Alan



org link to OCaml comment

2020-02-06 Thread Alan Schmitt
Hello,

I'm trying to create an org link to a specific place in an OCaml file. I
thought I would use some specific target in an OCaml comment, but it
does not work.

Here is an OCaml comment:

(* Object projection functions *)

Here is the link create by `org-store-link` (I put it here with no
description)

[[file:~/work/jsexplain/jsexplain/jsref/JsSyntax.ml::(* Object projection 
functions *)]]

When I try to follow this link, I get the following error (note the
missing parentheses):

org-open-file: No match for coderef: * Object projection functions *

and I am moved to the top of the file (instead of where I stored the
link).

Is there an escape problem here? And if so, is it a bug of
`org-store-link` of not doing the escaping?

Thanks,

Alan



Re: debugging why a latex preview fails

2020-01-29 Thread Alan Schmitt
Hello Fabrice and Eric,

Thanks a lot for your suggestions. I ended up edebugging
'org-create-formula-image' to have a look at the created tex file (that
is indeed cleaned up after the generation). The file was fine, but
dvipng failed on it (with errors like "raw PostScriptdvipng warning:
PostScript environment contains DVI commands dvipng warning: No image
output from inclusion of raw PostScript"). I switched to imagemagick to
do the conversion and everything now works.

The warnings were in the *Org Preview Latex Output* buffer, which
I realized afterwards. However it's still tricky to debug because
intermediate files are erased, so I could not initially run the command
by hand to try to tweak it.

Thanks again,

Alan



debugging why a latex preview fails

2020-01-28 Thread Alan Schmitt
Hello,

I'm trying to add some diagrams in a note, and I want to use latex
preview for that. Unfortunately the result is not what I expect: I do
see an image, but there seem to be errors in the latex processing. How
can I see what latex is produced to find where the issue is?

To be precise, my note has this:

\begin{tikzcd}
A \arrow[r, "u"] \arrow[d, "i"] & B \arrow[d, "f"] \\
C \arrow[r, "v"] & D
\end{tikzcd}

and I have put this in my configuration files:

  (add-to-list 'org-latex-packages-alist '("" "tikz-cd" t nil))

The following latex file compiles correctly:

\documentclass{article}

\usepackage{tikz-cd}

\begin{document}
\begin{tikzcd}
A \arrow[r, "u"] \arrow[d, "i"] & B \arrow[d, "f"] \\
C \arrow[r, "v"] & D
\end{tikzcd}
\end{document}

So I expect I misconfigured something. Is my org-latex-packages-alist
setting wrong?

Thanks,

Alan



Re: automatic completion of file tags

2020-01-26 Thread Alan Schmitt
Hi Bastien,

On 2020-01-26 18:04, Bastien  writes:

> I'm not entirely sure: you want to tag all headline in a file with
> multiple pre-defined tags?

There are no headlines in the file (it's a small note). I want to tag
the file itself (or its content). It's mostly to help with full-text
search (I prefix my tags with '#' so they don't occur otherwise). I
think the notion of file tag does not really exist in org mode, but as
there is a '+#FILETAGS:' cookie (?), I was wondering if there was
infrastructure to help me enter the tags there.

> With `org-loop-over-headlines-in-active-region' set to `t', you can
> tag multiple headlines by selecting a region with the headlines you
> want to tag, then C-c C-q to tag them one after another.
>
> You cannot add multiple tags for each headline this way, though.
>
> I would go for defining a temporary local tag like "replaceme" to
> tag multiple (all) headline in the file, then simpy search/replace
> occurrences of "replaceme" with your:list:of:tags

Thank you. This is not what I want to do, but it's nice to know how to
do this.

Alan



automatic completion of file tags

2020-01-23 Thread Alan Schmitt
Hello,

I'm playing with an implementation of Zettelkasten using deft and org
files, and I want to tag each note with some tags taken from a list (I'm
using the ~#FILETAGS:~ line for that at the moment). Is there a builtin
org way of doing it (have a list of tags defined somewhere and tag a
whole file with them using some completion mechanism, as for headlines),
or do I need to roll up my own?

Thanks,

Alan



Re: [O] moving an entry from one date tree to another

2019-09-28 Thread Alan Schmitt

On 2019-09-28 04:55, Adam Porter  writes:


See unpackaged/org-refile-to-datetree from:

https://github.com/alphapapa/unpackaged.el#refile-to-datetree-file-using-earliestlatest-timestamp-in-entry


This is great, thanks!

Alan


signature.asc
Description: PGP signature


[O] moving an entry from one date tree to another

2019-09-27 Thread Alan Schmitt

Hello,

Is there an easy way to move an entry from one date tree to 
another? I

guess I need two things:
- figure out where in the date tree the entry is,
- create the parents if needed, and move it there.

This might be a more general question: given an entry in some 
file, can
I move it recreating the path form the root of the file to another 
file?


Thanks,

Alan


signature.asc
Description: PGP signature


Re: [O] org-ref question: create a note from a bibliography entry

2019-07-18 Thread Alan Schmitt
On 2019-07-18 15:54, John Kitchin  
writes:


M-x org-ref-open-bibtex-notes  should do that when your cursor 
is in a

bibtex entry.


Thank you very much, I don't know how I missed it.

Best,

Alan


signature.asc
Description: PGP signature


[O] org-ref question: create a note from a bibliography entry

2019-07-18 Thread Alan Schmitt

Hello,

I have a question about org-ref. Is there a way to directly create 
a
note when being inside a bibliography entry? I currently insert a 
cite
link and using it I can create the note, but I would like to skip 
the

"insert a cite link" part.

Thanks,

Alan


signature.asc
Description: PGP signature


Re: [O] converting many ics files to a single org file

2019-06-20 Thread Alan Schmitt

On 2019-06-19 14:01, Robert Horn  writes:

The golang ical2org (https://github.com/rjhorniii/ical2org) 
definitely

does this.


It seems to have many features that I would use. Thanks!

Alan


signature.asc
Description: PGP signature


Re: [O] converting many ics files to a single org file

2019-06-11 Thread Alan Schmitt

On 2019-06-10 22:20, Thomas Plass  writes:

As per its docstring it's one file per invocation.  But the 
docstring

also lists:

$ cat in.ical | ical2orgpy - - > out.org

I haven't tried, but something like this might work (on 
Unixoids):


$ echo -n > out.org
$ for i in *.ical; do cat $i | ical2orgpy - - >> out.org; echo 
>> out.org; done


Thank you for the suggestion, I'll give it a try.

Best,

Alan


signature.asc
Description: PGP signature


[O] converting many ics files to a single org file

2019-06-10 Thread Alan Schmitt

Hello,

I'm using vdirsyncer to keep a local copy of my calendars. I would 
now

like to have them in org-mode, so I'm looking for a tool to do the
conversion. One important constraint is that, by default, 
vdirsyncer

generates one ics file for each event. I've found this tool
https://github.com/asoroa/ical2org.py but it's not clear if it can
handle many files.

Do you have suggestions for such a workflow? I could try to 
concatenate

the files, but I probably need a tool for that.

Best,

Alan


signature.asc
Description: PGP signature


Re: [O] Advance notice of birthdays in org-mode via org-contacts

2019-05-28 Thread Alan Schmitt

Hi Eric,

On 2019-05-28 04:34, Eric Abrahamsen  
writes:



And (shameless plug) if you're using EBDB, you can set both
`ebdb-use-diary' and `org-agenda-include-diary' to t, and 
anniversaries

will show in the agenda.


Thank you for the plug, I've been wanting to look at EBDB for a 
while. I
have a few questions: is it easy to migrate data from BBDB? Can 
you have

org links to EBDB records? Does it work with mu4e for address
completion?

Thanks,

Alan


signature.asc
Description: PGP signature


[O] refreshing pictures that are results of code blocks

2019-05-15 Thread Alan Schmitt

Hello,

I'm playing with picture generating code like this:

#+begin_src python :results file :session :var 
matplot_lib_filename="figure2.png" :exports both

import matplotlib.pyplot as plt

data = [14.0, 7.6, 11.2, 12.8, 12.5, 9.9, 14.9, 9.4, 16.9, 10.2, 
14.9, 18.1, 7.3, 9.8, 10.9, 12.2, 9.9, 2.9, 2.8, 15.4, 15.7, 9.7, 
13.1, 13.2, 12.3, 11.7, 16.0, 12.4, 17.9, 12.2, 16.2, 18.7, 8.9, 
11.9, 12.1, 14.6, 12.1, 4.7, 3.9, 16.9, 16.8, 11.3, 14.4, 15.7, 
14.0, 13.6, 18.0, 13.6, 19.9, 13.7, 17.0, 20.5, 9.9, 12.5, 13.2, 
16.1, 13.5, 6.3, 6.4, 17.6, 19.1, 12.8, 15.5, 16.3, 15.2, 14.6, 
19.1, 14.4, 21.4, 15.1, 19.6, 21.7, 11.3, 15.0, 14.3, 16.8, 14.0, 
6.8, 8.2, 19.9, 20.4, 14.6, 16.4, 18.7, 16.8, 15.8, 20.4, 15.8, 
22.4, 16.2, 20.3, 23.4, 12.1, 15.5, 15.4, 18.4, 15.7, 10.2, 8.9, 
21.0]


plt.clf()
plt.hist(data, bins=10, edgecolor='black')
plt.grid(True)
plt.axis([0, 25, 0, 25])

plt.savefig(matplot_lib_filename)
matplot_lib_filename
#+end_src

and it works great when I evaluate it: it creates a link to the 
picture,

and when I hit Enter on the link, the picture is displayed in the
buffer.

The problem is when I modify the code block and run it again, if I 
hit
Enter on the resulting link, I see the old picture. The new one is 
there
(if I open it, it is modified), but somehow the old picture is 
cached.


Is there a way to disable this cache?

Thanks,

Alan


signature.asc
Description: PGP signature


Re: [O] Bug: Can't access org agenda custom command [9.2.1 (9.2.1-33-g029cf6-elpaplus @ /home/gustavo/.emacs.d/elpa/org-plus-contrib-20190225/)]

2019-02-26 Thread Alan Schmitt
On 2019-02-26 09:14, Nicolas Goaziou  
writes:



I think the problem is on line 3036 of org-agenda.el. The code

(propertize match nil 'face 'org-warning))

should be
(propertize match 'face 'org-warning))

(I changed it locally and it now works)


This was fixed yesterday.


Thank you. I did not know that as I updated org-plus-contrib this
morning and had the bug.

Best,

Alan



signature.asc
Description: PGP signature


Re: [O] Bug: Can't access org agenda custom command [9.2.1 (9.2.1-33-g029cf6-elpaplus @ /home/gustavo/.emacs.d/elpa/org-plus-contrib-20190225/)]

2019-02-25 Thread Alan Schmitt
On 2019-02-26 02:19, Gustavo Barros  
writes:


I've been having trouble with my custom agenda commands since 
the latest

update.

The agenda dispatcher used to work fine until the last update, 
but now,

given one of my custom agenda commands, it issues the error
"org-agenda-get-restriction-and-command: Wrong number of 
arguments".


I think the problem is on line 3036 of org-agenda.el. The code

(propertize match nil 'face 'org-warning))

should be
(propertize match 'face 'org-warning))

(I changed it locally and it now works)

Best,

Alan


signature.asc
Description: PGP signature


Re: [O] Inlining TikZ blocks as SVG in HTML export

2019-01-21 Thread Alan Schmitt
On 2019-01-09 22:46, Christophe Garion  
writes:



Hello,

I would like to be able to export Org files containing TikZ 
pictures to
HTML files with SVG pictures corresponding to TikZ pictures 
inlined
directly in the HTML files. My use case is to produce quizz 
questions
with graph drawings for the Moodle LMS (https://moodle.org/) 
used at our
university. It is really painful to upload picture files to 
Moodle and link
them to text and Moodle accepts plain HTML5 for text 
description, so it

seems to be a rather food solution.


Here is an example of how I do it. The by-backend is defined as 
follows:


;; to export to both latex and html
(defmacro by-backend ( body)
 `(cl-case org-export-current-backend ,@body))

  #+header: :file (by-backend (latex "sigma3.tikz") (t 
  "sigma3.png"))
  #+header: :imagemagick yes :iminoptions -density 600 
  :imoutoptions -geometry 800

  #+header: :results raw graphics
  #+header: :fit yes
  #+header: :packages '(("" "tikz"))
  #+begin_src latex
  \usetikzlibrary{matrix,arrows}
  \begin{tikzpicture}
 \matrix (m) [matrix of nodes, row sep=1em, column sep=4em]
 { iterate & map & reduce \\
   & & $acci$  \\
   $a_{0} = a$   & $f(a_{0})$ & \\ & &  $acc_{0} = fc\; 
   (f\; a_{0})\; acci$ \\
   $a_1 = a_0+i$  & $f(a_{1})$  &\\ & & $acc_{1} = fc\; 
   (f\; a_{1})\; acc_{0}$ \\

   $\ldots$ & $\ldots$   &\\ & & ~ \\
   $a_{n-1} = a_{n-2} + i$ & $f(a_{n-1})$ &\\ & & $acc_{n-1} = 
   fc\; (f \; a_{n-1})\; acc_{n-2}$  \\

   $a_n = a_{n-1} + i$ & $f(a_{n})$ &\\
   $a_{n+1} = a_n + i > b$& & $res = fc\; (f\; a_{n})\; 
   acc_{n-1}$  \\

 };
  \draw (m-3-1) edge[->,thick] node[auto]{\scriptsize $f$} 
  (m-3-2);
  \draw (m-5-1) edge[->,thick] node[auto]{\scriptsize $f$} 
  (m-5-2);
  \draw (m-9-1) edge[->,thick] node[auto]{\scriptsize $f$} 
  (m-9-2);
  \draw (m-11-1) edge[->,thick] node[auto]{\scriptsize $f$} 
  (m-11-2);


  \draw (m-6-3) edge[dotted] (m-8-3);

  \draw[in=90,out=0] (m-3-2) edge[thick] (m-4-3.north);
  \draw (m-2-3) edge[->,thick] node[right]{\scriptsize $fc$} 
  (m-4-3);


  \draw[in=90,out=0] (m-5-2) edge[thick] (m-6-3.north);
  \draw (m-4-3) edge[->,thick] node[right]{\scriptsize $fc$} 
  (m-6-3);


  \draw[in=90,out=0] (m-9-2) edge[thick] (m-10-3.north);
  \draw (m-8-3) edge[->,thick] node[right]{\scriptsize $fc$} 
  (m-10-3);


  \draw[in=90,out=0] (m-11-2) edge[thick] (m-12-3.north);
  \draw (m-10-3) edge[->,thick] node[right]{\scriptsize $fc$} 
  (m-12-3);

  \end{tikzpicture}
  #+end_src

Best,

Alan


signature.asc
Description: PGP signature


Re: [O] a couple tangle questions (tangle a single block, comment syntax)

2018-10-11 Thread Alan Schmitt
On 2018-10-11 16:12, Alan Schmitt  writes:

> Now I just need to find a way to specify the syntax for comments in the
> headers, and I'm all set.

I'm feeling silly. What I need to use is the "conf" language, not
"config". Sorry for the noise.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-09: 405.51, 2017-09: 403.37


signature.asc
Description: PGP signature


Re: [O] a couple tangle questions (tangle a single block, comment syntax)

2018-10-11 Thread Alan Schmitt
On 2018-10-11 08:06, John Kitchin  writes:

> Do you mean interactively?  With org-babel-tangle you can:
>
> With one universal prefix argument, only tangle the block at point.
>
> When two universal prefix arguments, only tangle blocks for the
> tangle file of the block at point.

Thank you! I looked at the manual but forgot to look at the function's
documentation.

Now I just need to find a way to specify the syntax for comments in the
headers, and I'm all set.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-09: 405.51, 2017-09: 403.37


signature.asc
Description: PGP signature


[O] a couple tangle questions (tangle a single block, comment syntax)

2018-10-11 Thread Alan Schmitt
Hello,

I'm moving my configuration files to an org file to be tangled, and I
have a couple questions.

First, is there a command to tangle a single block, or blocks in a
subtree?

Second, I like to have the :comments link option in my tangled files (to
reference where they were tangled from), but some files do not have an
emacs mode, so I use a "config" source block. For these files, org does
not know the syntax of comments, so it asks me for it. Can I specify the
syntax for comments in the header of the source block?

Thanks a lot,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-09: 405.51, 2017-09: 403.37


signature.asc
Description: PGP signature


Re: [O] Emacs mobile org

2018-09-10 Thread Alan Schmitt
On 2018-09-10 11:41, Marcin Borkowski  writes:

> On 2018-09-10, at 09:46, Alan Schmitt  wrote:
>
>> I use orgzly, and it works great with syncthing https://syncthing.net/
>
> BTW, in my experience syncthing seems quite flaky.  I turn it on on both
> the coputer and my phone, but I'm not sure what to do to start syncing.
> Sometimes it just works, sometimes it doesn't (or takes a lot of time,
> I'm not sure).  Any hints?  Is it possible to make the phone start
> syncing manually?  (I'm almost sure that my problems stem from my
> incompetence, hence the question.)

One thing to make sure is that they run on the same network. But besides
this I have not much advice to give, as it just works here.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-08: 406.99, 2017-08: 405.07


signature.asc
Description: PGP signature


Re: [O] Emacs mobile org

2018-09-10 Thread Alan Schmitt
On 2018-09-09 21:43, Kaushal Modi  writes:

> On Sun, Sep 9, 2018 at 7:53 PM M. P.  wrote:
>
>> Hello I am running emacs on a mac I have a galaxy s8 android phone. I am
>> wanting to sync my phone with emacs on my computer.
>> I would prefer not to use a cloud service but instead use
>> something like a usb or ther to sync with.
>>
>
> So, what is the question? :)
>
> Looking at just "Org" and "Android phone", I can suggest the Orgzly app.
>
> It can sync notes to a directory on your phone, and you can sync that dir
> to your computer via USB if you like (I like the Dropbox sync option).

I use orgzly, and it works great with syncthing https://syncthing.net/

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-08: 406.99, 2017-08: 405.07


signature.asc
Description: PGP signature


[O] gnus link no longer work

2018-09-06 Thread Alan Schmitt
Hello,

I've recently noticed that following gnus links (created by
org-store-link) no longer work. When I try to open one, I get an error,
and I see the gnus summary populated with the message I need, but I
cannot read it.

Here is the backtrace when I follow the link

Debugger entered--Lisp error: (wrong-type-argument consp nil)
  nnir-request-update-info("nnir:work" nil)
  nnir-request-group("work" "nnimap:inria" t nil)
  gnus-request-group("nnimap+inria:work" t)
  gnus-check-group-server()
  gnus-request-article-this-buffer(-1 "nnimap+inria:work")
  gnus-article-prepare(-1 nil)
  gnus-summary-display-article(-1 nil)
  gnus-summary-select-article(nil nil nil -1)
  gnus-summary-refer-article("ef188abb-9586-4b61-b82f-48fdc37da...@inria.fr")
  gnus-summary-goto-article("ef188abb-9586-4b61-b82f-48fdc37da...@inria.fr" nil 
t)
  org-gnus-follow-link("nnimap+inria:work" 
"ef188abb-9586-4b61-b82f-48fdc37da...@inria.fr")
  
org-gnus-open("nnimap+inria:work#ef188abb-9586-4b61-b82f-48fdc37da...@inria.fr")
  org-open-at-point()
  (if (and path (image-type-from-file-name path)) (+org/refresh-inline-images) 
(org-open-at-point))
  (let ((path (org-element-property :path (org-element-lineage context '(link) 
t (if (and path (image-type-from-file-name path)) 
(+org/refresh-inline-images) (org-open-at-point)))
  (cond ((org-element-property :checkbox (org-element-lineage context '(item) 
t)) (let ((match (and (org-at-item-checkbox-p) (match-string 1 
(org-toggle-checkbox (if (equal match "[ ]") '(16) ((eq type 'headline) 
(cond ((org-element-property :todo-type context) (org-todo (if (eq 
(org-element-property :todo-type context) 'done) 'todo 'done))) ((string= 
"ARCHIVE" (car-safe (org-get-tags))) (org-force-cycle-archived)) (t 
(+org/refresh-inline-images) (org-remove-latex-fragment-image-overlays) 
(org-toggle-latex-fragment '(4) ((eq type 'clock) 
(org-clock-update-time-maybe)) ((eq type 'footnote-reference) 
(org-footnote-goto-definition (org-element-property :label context))) ((eq type 
'footnote-definition) (org-footnote-goto-previous-reference 
(org-element-property :label context))) ((memq type '(timestamp planning)) 
(org-follow-timestamp-link)) ((memq type '(table-row table)) (if 
(org-at-TBLFM-p) (org-table-calc-current-TBLFM) (condition-case nil (progn 
(save-excursion (goto-char (org-element-property :contents-begin context)) 
(org-call-with-arg 'org-table-recalculate (or arg t (error nil ((eq 
type 'table-cell) (org-table-blank-field) (org-table-recalculate) (if (and 
(string-empty-p (string-trim (org-table-get-field))) (and (boundp 'evil-mode) 
evil-mode)) (progn (evil-change-state 'insert ((eq type 'babel-call) 
(org-babel-lob-execute-maybe)) ((eq type 'statistics-cookie) (save-excursion 
(org-update-statistics-cookies nil))) ((memq type '(inline-src-block 
src-block)) (org-babel-execute-src-block)) ((memq type '(latex-environment 
latex-fragment)) (org-toggle-latex-fragment)) ((eq type 'link) (let ((path 
(org-element-property :path (org-element-lineage context '(link) t (if (and 
path (image-type-from-file-name path)) (+org/refresh-inline-images) 
(org-open-at-point (t (+org/refresh-inline-images)))
  (let* ((context (org-element-context)) (type (org-element-type context))) 
(while (and context (memq type '(verbatim code bold italic underline 
strike-through subscript superscript))) (setq context (org-element-property 
:parent context) type (org-element-type context))) (cond ((org-element-property 
:checkbox (org-element-lineage context '(item) t)) (let ((match (and 
(org-at-item-checkbox-p) (match-string 1 (org-toggle-checkbox (if (equal 
match "[ ]") '(16) ((eq type 'headline) (cond ((org-element-property 
:todo-type context) (org-todo (if (eq (org-element-property :todo-type context) 
'done) 'todo 'done))) ((string= "ARCHIVE" (car-safe (org-get-tags))) 
(org-force-cycle-archived)) (t (+org/refresh-inline-images) 
(org-remove-latex-fragment-image-overlays) (org-toggle-latex-fragment '(4) 
((eq type 'clock) (org-clock-update-time-maybe)) ((eq type 'footnote-reference) 
(org-footnote-goto-definition (org-element-property :label context))) ((eq type 
'footnote-definition) (org-footnote-goto-previous-reference 
(org-element-property :label context))) ((memq type '(timestamp planning)) 
(org-follow-timestamp-link)) ((memq type '(table-row table)) (if 
(org-at-TBLFM-p) (org-table-calc-current-TBLFM) (condition-case nil (progn 
(save-excursion (goto-char (org-element-property :contents-begin context)) 
(org-call-with-arg 'org-table-recalculate (or arg t (error nil ((eq 
type 'table-cell) (org-table-blank-field) (org-table-recalculate) (if (and 
(string-empty-p (string-trim (org-table-get-field))) (and (boundp 'evil-mode) 
evil-mode)) (progn (evil-change-state 'insert ((eq type 'babel-call) 
(org-babel-lob-execute-maybe)) ((eq type 'statistics-cookie) (save-excursion 
(org-update-statistics-cookies nil))) ((memq type '(inline-src-block 

Re: [O] including the | character in a table

2018-07-25 Thread Alan Schmitt
On 2018-07-25 07:43, Kevin Foley  writes:

> You can use \vert to insert pipes in exported tables.

Thank you Michel and Kevin for these proposals. \vert works great (as
long as it's outside ~~, but I can deal with it).

Thanks!

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-06: 410.79, 2017-06: 408.84


signature.asc
Description: PGP signature


[O] including the | character in a table

2018-07-25 Thread Alan Schmitt
Hello,

I'm writing a cheat sheet for a programming language, and I'm having
trouble with operators that use |. For instance:

| match expr with   | pattern matching |
| | pattern -> expr | action   |

How can I escape the |? I tried putting a \ before but it does not work.

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-06: 410.79, 2017-06: 408.84


signature.asc
Description: PGP signature


Re: [O] Orgalist notes

2018-05-04 Thread Alan Schmitt
 Hello,

  I'm having the same indentation, as can be seen here. For some
  strange reason, as soon as I get to the next line (using
  return) I get extra space. I just refilled this paragraph
  and it looks like this.

  - this is a list
  - another list, and let's make is super long, even
  - longer, and I have the same problem.

Here is the list of minor modes that I have:

Abbrev Anzu Async-Bytecomp-Package Auto-Composition Auto-Compression
Auto-Encryption Auto-Fill Beacon Clean-Aindent Column-Number
Company-Childframe Counsel Diff-Auto-Refine Diredp-Highlight-Autofiles
Editorconfig Electric-Indent Eval-Sexp-Fu-Flash Evil Evil-Escape
Evil-Lion Evil-Local Evil-Search-Highlight-Persist Evil-Surround
Eyebrowse File-Name-Shadow Flx-Ido Flyspell Font-Lock Global-Anzu
Global-Auto-Revert Global-Eldoc Global-Evil-Search-Highlight-Persist
Global-Evil-Surround Global-Font-Lock Global-Git-Commit
Global-Git-Gutter+ Global-Page-Break-Lines
Global-Spacemacs-Leader-Override Global-Undo-Tree Global-Vi-Tilde-Fringe
Global-Xah-Math-Input Gnus-Message-Citation Hl-Todo Ido-Vertical
Info-Breadcrumbs-In-Mode-Line Ivy Line-Number Mac-Mouse-Wheel Menu-Bar
Mixed-Pitch Mml Orgalist Override-Global Persp Projectile Pupo Purpose
Recentf Save-Place Savehist Shell-Dirtrack Show-Smartparens
Show-Smartparens-Global Spaceline-Helm Spaceline-Info
Spacemacs-Leader-Override Transient-Mark Undo-Tree Vi-Tilde-Fringe
Volatile-Highlights Which-Key Winner Winum Xah-Math-Input Xterm-Mouse
Yas Yas-Global

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-03: 409.46, 2017-03: 407.18


signature.asc
Description: PGP signature


Re: [O] preview embedded latex fragments error with my settings

2018-03-27 Thread Alan Schmitt
According to the log, you need to configure the export to use xelatex.

The error using xelatex is at this point, where it seems you should not
use math-mode:

l.86 $\LaTeX
$

Do you have this in your code? Did you try removing the enclosing $?

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-02: 408.35, 2017-02: 406.42


signature.asc
Description: PGP signature


Re: [O] preview embedded latex fragments error with my settings

2018-03-27 Thread Alan Schmitt
On 2018-03-27 08:57, stardiviner  writes:

> I have divsvgm program on my arch linuxsystem. And "/tmp/orgtexhClnu9.dvi" 
> does
> not exist, it is not produced. Only "/tmp/orgtexhClnu9.tex" and
> "/tmp/orgtexhClnu9.log" two file.

What does the log file say? There will probably be a hint about what is
wrong. (The fact that it is there suggests latex started running, but
did not produce the dvi file.)

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-02: 408.35, 2017-02: 406.42


signature.asc
Description: PGP signature


Re: [O] [PATCH v2 0/3] org-sbe fixes

2018-03-26 Thread Alan Schmitt
On 2018-03-25 23:06, Nicolas Goaziou  writes:

> I have reverted your changes from maint.

Should there be a new release? This change is present in 9.1.8.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-02: 408.35, 2017-02: 406.42


signature.asc
Description: PGP signature


Re: [O] [PATCH v2 0/3] org-sbe fixes

2018-03-25 Thread Alan Schmitt
Hello,

On 2018-03-20 00:07, Nicolas Goaziou  writes:

> Hello,
>
> Vladimir Panteleev  writes:
>
>> OK, here is v2 with table-based tests.
>>
>> Vladimir Panteleev (3):
>>   ob-table: Fix org-sbe's handling of quotes in cell values
>>   ob-table: Fix org-sbe's handling of list arguments
>>   ob-table: Mention passing ranges as lists in org-sbe's documentation
>
> Applied. Thank you!

I think this has been applied to the maint branch, but I cannot find a
mention of it in the ORG-NEWS file. Maybe it should be mentioned there
as it is a breaking change. For instance,(I had to modify table formulas like

#+TBLFM: @2$3..@>>$3='(org-sbe call_ledger (bucket (concat "\"" $1 "\"")) 
(prefix "\"Bucket:Expenses:\""))

into

#+TBLFM: @2$3..@>>$3='(org-sbe call_ledger (bucket $$1) (prefix 
"\"Bucket:Expenses:\""))

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-02: 408.35, 2017-02: 406.42


signature.asc
Description: PGP signature


Re: [O] exporting a big project in multiple files to both pdf and html

2018-02-02 Thread Alan Schmitt
On 2018-02-02 18:41, Yasushi SHOJI  writes:

> https://github.com/yashi/multi-html-single-pdf
>
> I have to use macro expansion and `org-export-global-macros` to swap the link.
> I don't think we have conditionals to switch an internal and an external link.
>
> HTML outputs are still not good at all (wrong chapter number, excess toc, 
> etc.),
> but at least you can see the body of the text.

This is impressive, thanks a lot. Changing the macro just before calling
the exporter is a great idea.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-12: 406.82, 2016-12: 404.42


signature.asc
Description: PGP signature


Re: [O] exporting a big project in multiple files to both pdf and html

2018-02-02 Thread Alan Schmitt
> What you want is to have multiple pdf files, say a.pdf and b.pdf, and link 
> from
> a.pdf to some specific page on the b.pdf, right?

No, I want multiple html files and a single pdf file generated from
multiple org files. It seems the simplest solution is to call a function
that fixes the links for the pdf export. I'll report here once I have
that function.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-12: 406.82, 2016-12: 404.42


signature.asc
Description: PGP signature


Re: [O] exporting a big project in multiple files to both pdf and html

2018-02-01 Thread Alan Schmitt
On 2018-02-01 13:56, Nicolas Goaziou  writes:

>> Not here. If I try to export the second file (the one with the link to
>> the first file), I get an error:
>>
>> user-error: Unable to resolve link: "*A headline"
>>
>> This is why I think I need to have the target file name in the link when
>> exporting it as a standalone file.
>
> If you don't mind broken links, there's also
> `org-export-with-broken-links'.

Unfortunately I need working links, so I'll try something else.

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-12: 406.82, 2016-12: 404.42


signature.asc
Description: PGP signature


Re: [O] is there a macro to have backend-specific behavior?

2018-02-01 Thread Alan Schmitt
On 2018-02-01 13:02, Nicolas Goaziou  writes:

>> My use case is this one: I have a link to a custom id, and I want to
>> export it as [[#id]] in latex and [[file:file.org::#id]] for html
>> *before* link resolution happens (so that the custom id in the latex
>> export is substituted with the correct label).
>>
>> Is this possible?
>
> Could you simply preprocess the document to export with a function doing
> the change above? Functions in `org-export-before-parsing-hook' are
> called with the back-end as the sole argument.

Thank you for the suggestion, I think this is the simplest solution.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-12: 406.82, 2016-12: 404.42


signature.asc
Description: PGP signature


Re: [O] exporting a big project in multiple files to both pdf and html

2018-02-01 Thread Alan Schmitt
On 2018-02-01 20:09, Yasushi SHOJI  writes:

>> How do I change the link in the second headline so that I can split the
>> second headline into its own file and export it by itself?
>
> Using [[*A headline]] ?
>
> I might be still missing something but I got following:
>
> $ cat a.org
> * A headline
>
> This is the first file.
>
> #+INCLUDE: b.org :minlevel 1
>
> $ cat b.org
> * Second headline
>
> The first headline is number [[*A headline]]

…

> hmm... latex export will generate \ref{sec:\#head}
> if you have CUSTOM_ID set.  html exporter works, though.

Not here. If I try to export the second file (the one with the link to
the first file), I get an error:

user-error: Unable to resolve link: "*A headline"

This is why I think I need to have the target file name in the link when
exporting it as a standalone file.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-12: 406.82, 2016-12: 404.42


signature.asc
Description: PGP signature


[O] is there a macro to have backend-specific behavior?

2018-02-01 Thread Alan Schmitt
Hello,

Is there a way to define a macro that has different behaviors depending
on export backend? I have macros that use the @@latex:foo@@ syntax, but
in that case I "foo" is supposed to be literal latex.

My use case is this one: I have a link to a custom id, and I want to
export it as [[#id]] in latex and [[file:file.org::#id]] for html
*before* link resolution happens (so that the custom id in the latex
export is substituted with the correct label).

Is this possible?

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-12: 406.82, 2016-12: 404.42


signature.asc
Description: PGP signature


Re: [O] exporting a big project in multiple files to both pdf and html

2018-02-01 Thread Alan Schmitt
On 2018-02-01 11:17, Yasushi SHOJI <yasushi.sh...@gmail.com> writes:

> On Fri, Jan 26, 2018 at 2:37 AM, Alan Schmitt
> <alan.schm...@polytechnique.org> wrote:
>> I'm working on a project that is becoming too big to manage as a single
>> file, so I'm looking at splitting it in several files. This would also
>> have the benefit of generating several smaller html pages instead of a
>> single huge one.
>
> Does Org support this? or do you just export each file?

I was planning on exporting each file individually. (It's the main goal,
actually, as exporting the whole thing is taking too long.)

>> My question is about pdf export. Is it possible to take a document made
>> of multiple org files and generate a single book from it? I'm worried
>> that if I use a master org file that includes the other ones, the links
>> between chapters would break.
>
> You can just use '#+INCLUDE' construct and Org will take care.

My problem is links. To give a concrete example, here is the file I want
to split in two:

* A headline
  :PROPERTIES:
  :CUSTOM_ID: head1
  :END:

This is the first file.

* Second headline

The first headline is number [[#head1]]


How do I change the link in the second headline so that I can split the
second headline into its own file and export it by itself? Right now it
cannot resolve the link. Maybe a solution would be to create a custom
link with different ways to export it…


> In the html-master.org, you use links to connect.  And
> in the pdf-master.org, you can just #+INCLUDE your files.

This is the plan, if I find out how to deal with links.

> BTW, I don't think we have direct pdf exporter.  So, you must be talking about
> the latex exporter, right?

Yes, sorry for the confusion.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-12: 406.82, 2016-12: 404.42


signature.asc
Description: PGP signature


Re: [O] computing the size of a tikz to png image during export

2018-01-29 Thread Alan Schmitt
On 2018-01-28 16:37, Fabrice Popineau  writes:

> I jump on this example to ask: does this by-backend trick still work with
> Org 9.1.6?

It works here. I did not provide the definition, here it is:

(defmacro by-backend ( body)
  `(cl-case org-export-current-backend ,@body))

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-12: 406.82, 2016-12: 404.42


signature.asc
Description: PGP signature


[O] exporting a big project in multiple files to both pdf and html

2018-01-25 Thread Alan Schmitt
Hello,

I'm working on a project that is becoming too big to manage as a single
file, so I'm looking at splitting it in several files. This would also
have the benefit of generating several smaller html pages instead of a
single huge one.

My question is about pdf export. Is it possible to take a document made
of multiple org files and generate a single book from it? I'm worried
that if I use a master org file that includes the other ones, the links
between chapters would break.

Is this something you have tackled with? How did you do it?

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-12: 406.82, 2016-12: 404.42


signature.asc
Description: PGP signature


Re: [O] computing the size of a tikz to png image during export

2018-01-25 Thread Alan Schmitt
On 2018-01-25 06:46, Eric S Fraga <esfli...@gmail.com> writes:

> On Wednesday, 24 Jan 2018 at 08:54, Alan Schmitt wrote:
>> If I understand how it works in the png case, a standalone latex file is
>> first generated, then it is compiled to pdf and converted to png using
>> imagemagick. Instead of specifying the geometry of the image (width of
>> 800 pixels above), I would like to compute it using its original size.
>> Is it possible?
>
> Have you tried removing the -geometry setting?  Imagemagick should be
> fine with just the density option.

Thank you for the suggestion. Unfortunately the image is very large with
a density of 600, and if I use a lower density then it is too low
resolution.

I found a solution using an -resize argument. It seems to work fairly
well.

Thanks again,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-12: 406.82, 2016-12: 404.42


signature.asc
Description: PGP signature


[O] computing the size of a tikz to png image during export

2018-01-24 Thread Alan Schmitt
Hello,

I use this great trick to have both a pdf and html export of tikz
images:

#+header: :file (by-backend (latex "tp6-tree.tikz") (t "tp6-tree.png"))
#+header: :imagemagick yes :iminoptions -density 600 :imoutoptions -geometry 800
#+header: :results file raw
#+header: :fit yes
#+header: :headers '("\\usepackage{tikz}")
#+begin_src latex
\begin{tikzpicture}
…
\end{tikzpicture}
#+end_src

If I understand how it works in the png case, a standalone latex file is
first generated, then it is compiled to pdf and converted to png using
imagemagick. Instead of specifying the geometry of the image (width of
800 pixels above), I would like to compute it using its original size.
Is it possible?

Thanks a lot,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-12: 406.82, 2016-12: 404.42


signature.asc
Description: PGP signature


  1   2   3   4   5   6   7   8   9   >