Re: [BUG] warrning in org-element---cashe [9.6 (9.6-??-27edae8ce @ /Users/mohammedalbatati/.emacs.d/.local/straight/build-27.2/org/)]

2021-11-24 Thread Ihor Radchenko
Mohammed Albatati  writes:

> Saw this warrning puped to the screen asking to submit a bug report, the
> org-mode is working fine so far without any issues

Thanks for reporting! Can you also provide the warning text when you see
it next time? The text contains important clues for us to understand
what went wrong.

Note that such warnings are a part of self-verification mechanism. If
you see them, there is something going wrong and Org is resetting it's
internal caches to make sure that nothing gets broken. So, Org should
not be broken on your side, but may become slower.

Best,
Ihor



Re: [DISCUSSION] Refactoring fontification system

2021-11-24 Thread Nicolas Goaziou
Hello,

Ihor Radchenko  writes:

> Recently, there have been multiple issues related to incorrect
> fontification:
> - https://list.orgmode.org/orgmode/23707.20428.546749.44...@frac.u-strasbg.fr/
> - https://list.orgmode.org/orgmode/87fsujp7mc@web.de/
> - https://list.orgmode.org/orgmode/87czvqxdn9@gmail.com/
> - 
> https://list.orgmode.org/8735nsv9qo@nicolasgoaziou.fr/T/#me1c44b6e493dd280cca4f042b833c24749ae4fe0
>
> These issues keep appearing because our current fontification code is
> based on regexps and only approximates the actual Org grammar elements.
> It is largely a legacy from the times when org-element parser was not a
> thing.
>
> Maybe it is a time to upgrade the fontification according to our
> state-of-art parser?
>
> Instead of fontifying elements individually via regexps, we can leverage
> org-element-map, org-element-parse-buffer, org-element-cache, and
> jit-lock-mode. Each type of Org element/object can be assigned with a
> fontification function accepting a single argument - the element datum.
>
> Also, the fontification code can be move to a separate library.
>
> WDYT?

I wholeheartedly agree with all these points.

Regards,
-- 
Nicolas Goaziou



Re: [oc-basic] fontification weirdness

2021-11-24 Thread Nicolas Goaziou
Hello,

"Bruce D'Arcus"  writes:

> I can't fully pin this down, but I and a couple of others I've
> discussed this with are seeing the following behavior.
>
> With this example:
>
> a citation [cite:@couper2014] and another [cite:@kohn2006]
>
> ... the first citation is highlighted, and the second (and any
> subsequent) is not.
>
> In some way I can't reproduce, I can then get the fontification to
> work correctly, but if I restart, the problem reappears.
>
> Discussed more here:
>
> https://github.com/bdarcus/citar/discussions/430#discussioncomment-1693707
>
> Can anyone else confirm this?

I couldn't reproduce it, but I saw something fishy in the fontification
code. I fixed it. Hopefully, your problem is gone, too. Crossing
fingers.

Regards,
-- 
Nicolas Goaziou



[oc-basic] fontification weirdness

2021-11-24 Thread Bruce D'Arcus
I can't fully pin this down, but I and a couple of others I've
discussed this with are seeing the following behavior.

With this example:

a citation [cite:@couper2014] and another [cite:@kohn2006]

... the first citation is highlighted, and the second (and any
subsequent) is not.

In some way I can't reproduce, I can then get the fontification to
work correctly, but if I restart, the problem reappears.

Discussed more here:

https://github.com/bdarcus/citar/discussions/430#discussioncomment-1693707

Can anyone else confirm this?

Bruce



Re: Bibliographies on export with ox-context and ox-epub

2021-11-24 Thread András Simonyi
Dear All,
On Wed, 24 Nov 2021 at 16:49, juh  wrote:
> The error disappears but the bibliography still is not rendered.
>
> I get the plain code:
>
> [@doe 45]
>
> [cite/t:@doe 45]
>
> juh
is the rendering OK when you export using the built-in, standard
backends, e.g., html or txt? As a data point, on my system org-cite
export with the CSL processor using ox-context works as expected.

best wishes,
András



Re: [PATCH] ob-shell-test, test-ob-shell and introduction

2021-11-24 Thread Matt


 > [FSF copyright assignment]. Have you done that yet?
 
I just verified with my employer that my contract grants an exception for this 
project.  Just emailed the request to ass...@gnu.org.  Also, got access from 
Bastien for worg. I figure it's probably best to reserve any more changes 'til 
the paper work is done?
 




Re: Bibliographies on export with ox-context and ox-epub

2021-11-24 Thread John Kitchin
If you are happy with org-ref, here is a minimal example that shows how to
get a bibliography via csl, and a pre-processing hook.


* test

A sentence with ref [[cite:]].


* Bibliography
bibliography:~/Dropbox/emacs/bibliography/references.bib

* build
 :noexport:

#+csl-style: apa-5th-edition.csl
#+csl-locale: en-US

#+BEGIN_SRC emacs-lisp
(require 'ox-epub)
(let ((org-export-before-parsing-hook '(org-ref-csl-preprocess-buffer)))
  (org-open-file (org-epub-export-to-epub)))
#+END_SRC


John

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



On Wed, Nov 24, 2021 at 3:00 AM juh  wrote:

> Hi all,
>
> I am kind of lost with references and ox-context and ox-epub.
>
> Is there a tutorial how to integrate a bibliography in ConTeXt and
> epub-Export?
>
>
> What I want to achieve is to use a bibtex bibliographies with org-roam and
> export them to epub and ConTeXt to generate bibliographies in the output.
>
> The first wish kind of works as I can insert entries from the bibtex file
> with C-].
>
> They look like this:
>
> Nam a sapien.[[cite:@horkheimer_dialektik_1984]]
>
> This is the org-ref entry in settings.org.
>
>   (straight-use-package 'org-ref)
>   (with-eval-after-load "org-ref"
>   (setq reftex-default-bibliography '("~/org/bibliography.bib")))
>
>   (setq bibtex-completion-bibliography '("~/org/bibliography.bib")
> bibtex-completion-library-path '("~/org/bibtex-pdfs/")
> bibtex-completion-notes-path "~/org/notes/"
> bibtex-completion-pdf-open-function
> (lambda (fpath)
>   (call-process "open" nil 0 nil fpath)))
>
>   (define-key org-mode-map (kbd "C-c ]") 'org-ref-insert-link)
>
>
> What puzzles me is that I could not find a hint to create a bibliography
> for epub export and context export. Maybe there isn't. But as some
> things with references does not work in my setup I fear that my
> configuration is not working. I take snippets from the documentations of
> the packages.
>
> I miss an overall example or tutorial for note taking via org-roam and
> exporting to epub and ConTeXt.
>
> So for now my current publishing workflow is split into two.
>
> 1. Zettelkasten via org-roam
>
> 2. PDF and epub creation via pandoc and cite-proc.
>
> As you can see there is a break of tools, so I would like to avoid this.
>
> TIA
> juh
>
> --
> Autoren-Homepage: . http://literatur.hasecke.com
> Satiren & Essays: . http://www.sudelbuch.de
> Privater Blog:  http://www.hasecke.eu
> Netzliteratur-Projekt:  http://www.generationenprojekt.de
>
>
>
>


Re: org-roam broken for me

2021-11-24 Thread Noboru


> Symbol's function definition is void: org-collect-keywords, skipping

You might need to update your Org. I guess you are on 9.3? This function is 
introduced with 9.4 if I remember correctly; it is prerequisite for Org-roam 
now. 

If Org version is not the cause, I have no other ideas.

Noboru



[PATCH] Fix ob-plantuml over TRAMP

2021-11-24 Thread guillaume
Hi All,

My Emacs Workflow involves connecting to a dev server over SSH so I can use my 
machines as thin clients and avoid synchronizing files,
for that I do pretty much everything over TRAMP as I don’t want to lose the 
benefits of GUI Emacs.
While everything mostly works impressively fine, I noticed writing my 
specifications that ob-plantuml fails to generate diagrams.

It seems to me that there is a redundant check which uses `file-exists-p` even 
if using TRAMP, the plantuml jar is located on the remote server, so 
it fails with an error even though the command to actually render the diagrams 
works fine.

The patch I propose involves keeping this check but moving it so it only 
generates a message instead of failing the whole generation process,
doing so allows to restore the functionality and I can finally generate my 
sequence diagrams over TRAMP.

For more details, see the attached patch.

--
Guillaume



0001-Allow-ob-plantuml-to-work-over-Tramp.patch
Description: Binary data


Re: [PATCH] Fix regex for determining image width from attribute

2021-11-24 Thread Max Nikulin

On 24/11/2021 22:59, Matt Huszagh wrote:


Better?


Certainly. I have not tested the patch though.

I am sorry that I confused you by my note concerning space before 
:width. I am afraid, current variant means repeated ":"



+  (concat "^[ \t]*#\\+attr_"
+  backend
+  ":+.*? :width +\\(\\S-+\\)")))

   ^
---'

Is space after "#+attr_XXX:" is required at all? Is something besides 
spaces allowed here?


Untested:
":\\s-*:width\\s-+\\(\\S-+\\)"
I am unsure concerning newlines as space characters, so the following, 
perhaps, is more correct:

":[^\n\\S-]*:width[^\n\\S-]+\\(\\S-+\\)"

Actually value is everything till line end besides trailing spaces, so 
precise regexp should be a bit longer. Are there backends that allows 
spaces between number and units?







Re: [HELP] Request for patches to improve Org test coverage

2021-11-24 Thread Daniele Pizzolli


Ihor Radchenko writes:

> Dear Fellow Orgers,
>
> Despite being not directly visible to users, Org mode testing suite is
> critical to maintain overall codebase stability. It helps to avoid
> unintentional breakages as we keep adding new features to Org.

[]

> - Generally, more and better tests would be welcome.

Hello,

Thanks for calling for tests improvement with such rationale.

I submitted my small test patch for a bug in babel/shell early this year
(unfortunately I was not able to fix the bug). I still think that the
test is valuable for inclusion.  If not, please give feedback.

See the original mail at: <87h7jhus7k.fsf@spx.local.examples>

Best,
Daniele



Re: [PATCH] Fix regex for determining image width from attribute

2021-11-24 Thread Matt Huszagh
Max Nikulin  writes:

> This is related solely to docscring.
>
>> +that is not found, use the first #+ATTR_.*:width specification.
>
> I am unsure how to make this phrase more clear, maybe something like
> "use :width value from the first #+ATTR_,*" or even "#+ATTR_xxx" to 
> avoid ".*".
>
>> + (re-search-forward (funcall attr-re 
>> "[a-z]*?")
>> +par-end t
>
> https://orgmode.org/worg/dev/org-syntax.html#Keywords
> has no requirement that it may be letter only. I expect it to be more 
> coherent with
> http://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/org-element.el#n2387
> that uses "\\S-" non-space character.

Better?

Matt

>From 73f6d6d0c16d9b3312737463361cefe08b01d35c Mon Sep 17 00:00:00 2001
From: Matt Huszagh 
Date: Mon, 22 Nov 2021 23:28:48 -0800
Subject: [PATCH 1/2] org.el: Prioritize attr_org when computing image width

	* lisp/org.el (org-display-inline-image--width): First look
	for attr_org: :width and then look for another attr_.* :width
	when that isn't specified.
---
 lisp/org.el | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 308bb7d51..3718d3118 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -16853,13 +16853,20 @@ buffer boundaries with possible narrowing."
((listp org-image-actual-width)
 (let* ((case-fold-search t)
(par (org-element-lineage link '(paragraph)))
-   (attr-re "^[ \t]*#\\+attr_.*?: +.*?:width +\\(\\S-+\\)")
+   (attr-re (lambda (backend)
+  (concat "^[ \t]*#\\+attr_"
+  backend
+  ":+.*? :width +\\(\\S-+\\)")))
(par-end (org-element-property :post-affiliated par))
-   ;; Try to find an attribute providing a :width.
+   ;; If an attr_org provides a :width, use that. Otherwise,
+   ;; use the first attribute that provides it, if any.
(attr-width
 (when (and par (org-with-point-at
(org-element-property :begin par)
- (re-search-forward attr-re par-end t)))
+ (or (re-search-forward (funcall attr-re "org")
+par-end t)
+ (re-search-forward (funcall attr-re "\\S-+?")
+par-end t
   (match-string 1)))
(width
 (cond
-- 
2.31.1


>From 76e92428716f2dcde0fbd281f71739c44a9be9d3 Mon Sep 17 00:00:00 2001
From: Matt Huszagh 
Date: Mon, 22 Nov 2021 23:30:11 -0800
Subject: [PATCH 2/2] org.el: Clarify documentation for computing image width

	* lisp/org.el (org-display-inline-image--width)
	(org-image-actual-width): Specify documentation for computing
	an inline image width in org-image-actual-width and remove the
	redundant documentation from org-display-inline-image--width.
---
 lisp/org.el | 38 --
 1 file changed, 24 insertions(+), 14 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 3718d3118..b050cb0dd 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15529,10 +15529,29 @@ When set to a number in a list, try to get the width from any
 
 and fall back on that number if none is found.
 
-When set to nil, try to get the width from an #+ATTR.* keyword
-and fall back on the original width if none is found.
-
-When set to any other non-nil value, always use the image width.
+When set to nil, first try to get the width from #+ATTR_ORG.  If
+that is not found, use the first #+ATTR_xxx :width specification.
+If that is also not found, fall back on the original image width.
+
+Finally, org is quite flexible in the width specifications it
+supports and intelligently interprets width specifications for
+other backends when rendering an image in an org buffer.  This
+behavior is described presently.
+
+1. A floating point value is interpreted as the percentage of the text
+   area that should be taken up by the image.
+2. A number followed by a percent sign is divided by 100 and then
+   interpreted as a floating point value.
+3. If a number is followed by other text, extract the number and
+   discard the remaining text.  That number is then interpreted as a
+   floating-point value.  For example,
+
+   #+ATTR_LATEX: :width 0.7\\linewidth
+
+   would be interpreted as 70% of the text width.
+4. If t is provided the original image width is used.  This is useful
+   when you want to specify a width for a backend, but still want to
+   use the original image width in the org buffer.
 
 This requires Emacs >= 24.1, built with imagemagick support."
   :group 'org-appearance
@@ -16838,16 +16857,7 @@ buffer boundaries with possible narrowing."
 (defvar visual-fill-column-width) ; Silence compiler warning
 (defun org-display-inline-image--width (link)
   "Determine the 

org-roam broken for me

2021-11-24 Thread juh
Dear all,

after straight-pull and rebuild today org-roam stops sync'ing the da with

Symbol's function definition is void: org-collect-keywords, skipping

I don't update org-roam every day. So I don't know which version works
for me.

Any hints?
juh
-- 
Autoren-Homepage: . http://literatur.hasecke.com
Satiren & Essays: . http://www.sudelbuch.de
Privater Blog:  http://www.hasecke.eu
Netzliteratur-Projekt:  http://www.generationenprojekt.de




signature.asc
Description: PGP signature


[BUG] warrning in org-element---cashe [9.6 (9.6-??-27edae8ce @ /Users/mohammedalbatati/.emacs.d/.local/straight/build-27.2/org/)]

2021-11-24 Thread Mohammed Albatati
y

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.


Saw this warrning puped to the screen asking to submit a bug report, the
org-mode is working fine so far without any issues

Emacs  : GNU Emacs 27.2 (build 1, x86_64-apple-darwin21.1.0, Carbon Version 165 
AppKit 2113)
of 2021-11-18
Package: Org mode version 9.6 (9.6-??-27edae8ce @ 
/Users/mohammedalbatati/.emacs.d/.local/straight/build-27.2/org/)

current state:
==
(setq
org-src-mode-hook '(doom-modeline-set-org-src-modeline 
org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer)
org-fontify-whole-heading-line t
org-link-shell-confirm-function 'yes-or-no-p
org-mode-local-vars-hook '(+org-init-gifs-h eldoc-mode)
org-babel-after-execute-hook '(org-redisplay-inline-images)
org-insert-heading-respect-content t
org-after-refile-insert-hook '(save-buffer)
org-metadown-hook '(org-babel-pop-to-session-maybe)
org-follow-link-hook '(+nav-flash-delayed-blink-cursor-h)
org-refile-targets '((nil :maxlevel . 3) (org-agenda-files :maxlevel . 3))
org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function
org-enforce-todo-dependencies t
org-odt-format-headline-function 'org-odt-format-headline-default-function
org-special-ctrl-a/e t
org-imenu-depth 6
org-persist-before-write-hook '(org-element--cache-persist-before-write)
org-agenda-files '("/Users/mohammedalbatati/org/my_wiki.org" 
"/Users/mohammedalbatati/org/diary.org"
"/Users/mohammedalbatati/org/journal.org" 
"/Users/mohammedalbatati/org/operation.org"
"/Users/mohammedalbatati/org/programming.org")
org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
org-reveal-start-hook '(org-decrypt-entry)
org-modules '(ol-bibtex)
org-startup-folded nil
org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent)
org-journal-date-prefix "#+TITLE:"
org-mode-hook '(er/add-org-mode-expansions org-tempo-setup 
+lookup--init-org-mode-handlers-h
 (closure ((hook . org-mode-hook) (--dolist-tail--) t) ( _)
  (add-hook 'before-save-hook 'org-encrypt-entries nil t))
 #[0 "\301\211\207" [imenu-create-index-function 
org-imenu-get-tree] 2]
 #[0 "\300\301\302\303\304$\207" [add-hook 
change-major-mode-hook org-show-all append local] 5]
 #[0 "\300\301\302\303\304$\207" [add-hook 
change-major-mode-hook org-babel-show-result-all append local] 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes 
doom-disable-show-paren-mode-h
 doom-disable-show-trailing-whitespace-h 
+org-enable-auto-reformat-tables-h +org-enable-auto-update-cookies-h
 +org-make-last-point-visible-h org-fancy-priorities-mode 
org-superstar-mode evil-org-mode toc-org-enable
 writegood-mode flyspell-mode embrace-org-mode-hook 
org-eldoc-load)
org-clock-persist 'history
org-fancy-priorities-list '("⚑" "⬆" "■")
org-export-with-smart-quotes t
org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
org-outline-path-complete-in-steps nil
org-archive-hook '(org-attach-archive-delete-maybe)
org-persist-before-read-hook '(org-element--cache-persist-before-read)
org-superstar-headline-bullets-list '("⁖" "◉" "○" "✸" "✿")
org-journal-carryover-items 
"TODO=\"TODO\"|TODO=\"PROJ\"|TODO=\"STRT\"|TODO=\"WAIT\"|TODO=\"HOLD\""
org-agenda-finalize-hook '(org-fancy-priorities-create-overlays 
+org-exclude-agenda-buffers-from-workspace-h
+org-defer-mode-in-agenda-buffers-h)
org-startup-indented t
org-clock-history-length 20
org-journal-mode-hook '(#[0 "\301\302\303\304$\207" [org-journal-encrypt-on 
add-hook org-journal-encryption-hook nil t] 5])
org-agenda-before-write-hook '(org-agenda-add-entry-text)
org-metaup-hook '(org-babel-load-in-session-maybe)
org-persist-after-read-hook '(org-element--cache-persist-after-read)
org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
org-agenda-deadline-faces '((1.001 . error) (1.0 . org-warning) (0.5 . 
org-upcoming-deadline)
 (0.0 . org-upcoming-distant-deadline))
org-crypt-key nil
org-babel-pre-tangle-hook '(save-buffer)
org-file-apps '((remote . emacs) (auto-mode . emacs) (directory . emacs) 
("\\.mm\\'" . default) ("\\.x?html?\\'" . default)
 ("\\.pdf\\'" . default))
org-tab-first-hook '(+org-yas-expand-maybe-h +org-indent-maybe-h 
org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand +org-clear-babel-results-h 
+org-cycle-only-current-subtree-h)
org-hide-leading-stars t

Re: Bibliographies on export with ox-context and ox-epub

2021-11-24 Thread juh
Am Wed, Nov 24, 2021 at 11:59:19AM +0100 schrieb Denis Maier:
> 
> Am 24.11.2021 um 10:32 schrieb juh:
> > [...]
> 
> > Thanks a lot but I get:
> > 
> > Unknown processor csl
> What happens after this?
> 
> M-: (require 'oc-csl)
> 
> Will this evaluate or do you get an error message?
> 

The error disappears but the bibliography still is not rendered.

I get the plain code:

[@doe 45]

[cite/t:@doe 45] 

juh
-- 
Autoren-Homepage: . http://literatur.hasecke.com
Satiren & Essays: . http://www.sudelbuch.de
Privater Blog:  http://www.hasecke.eu
Netzliteratur-Projekt:  http://www.generationenprojekt.de




signature.asc
Description: PGP signature


Re: Bibliographies on export with ox-context and ox-epub

2021-11-24 Thread juh

Am 24.11.21 um 09:43 schrieb Denis Maier:
Are you already on org 9.5? Looks like your still using the "old" 
org-ref links.


The following mwe might get you started:

%%
#+title: Citation tests
#+cite_export: csl
#+bibliography: test.bib

[cite: @doe 45]

[cite/text: @doe 45]

#+print_bibliography:
%%



Thanks a lot but I get:

Unknown processor csl

I also followed the example given here:
https://blog.tecosaur.com/tmio/2021-07-31-citations.html

juh



Re: [PATCH] Fix regex for determining image width from attribute

2021-11-24 Thread Max Nikulin

On 24/11/2021 08:57, Matt Huszagh wrote:

Max Nikulin writes:


I may be wrong, but it seems both the old and the new regexps match

  #+attr_html : :width 50%

that is not a keyword due to a space before ":". The dot in the regexp
is too permissive.


I agree.


Despite ".*" includes ": " before ":width", I would prefer explicit
space before ":width".


Currently we have a space before .*. Would you prefer it after? Anyway,
I've also implemented this change. Let me know what you think.


This is related solely to docscring.


+that is not found, use the first #+ATTR_.*:width specification.


I am unsure how to make this phrase more clear, maybe something like
"use :width value from the first #+ATTR_,*" or even "#+ATTR_xxx" to 
avoid ".*".



+ (re-search-forward (funcall attr-re "[a-z]*?")
+par-end t


https://orgmode.org/worg/dev/org-syntax.html#Keywords
has no requirement that it may be letter only. I expect it to be more 
coherent with

http://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/org-element.el#n2387
that uses "\\S-" non-space character.




Re: A mobile clocking solution?

2021-11-24 Thread Daniel Baker
Oops.  I'm sorry, I forgot to include the link. That would be for orgzly.

https://github.com/orgzly/orgzly-android/pull/691

On Wed, 24 Nov 2021, 08:44 Marcin Borkowski,  wrote:

>
> On 2021-11-21, at 15:25, Daniel Baker  wrote:
>
> > Hi Marcin,
> >
> > There's an open pull request on github that has a working implementation
> > for clocking in and out. There's a few ui things to fix. I'm running that
> > branch at the moment and it works quite well.
>
> Thanks, but... which app are you talking about?
>
> --
> Marcin Borkowski
> http://mbork.pl
>


Re: [HELP] Request for patches to improve Org test coverage

2021-11-24 Thread Max Nikulin

On 24/11/2021 20:11, Ihor Radchenko wrote:


- Generally, more and better tests would be welcome.


There are some tests (test-org/org-sort-remove-invisible) lost in a 
lengthy thread

https://list.orgmode.org/orgmode/s5p88r$go9$1...@ciao.gmane.io/
There is even updates.orgmode.org entry for them: [Patch] tests for 
org-remove-invisible


org-protocol tests are not run by "make test" and require additional 
variables to be set. Maybe it is reasonable to use separate emacs 
process due to some specific requirements as emacs-server.





Re: bulk archive slow

2021-11-24 Thread Ihor Radchenko
Samuel Wales  writes:

> thank you!  bulk archiving will be among the first things i will try
> once i upgrade.  i have years[?] of doneified tasks now i think.
>
> i always use maint, with my own few patches rebased on top, so not
> sure if i can take advantage of it, except to run main to do it.

If you think that your patches could be also useful for others, feel
free to send them here.

> this brings up a tangential question.  what was the reasoning behind
> changing maint to bugfix and master to main?

AFAIU, master -> main is the USA thing where word "master" is considered
sensitive (and Org is released under FSF, based in USA).

maint -> bugfix is probably to avoid too similar branch names. I am not
sure here.

Best,
Ihor




[HELP] Request for patches to improve Org test coverage

2021-11-24 Thread Ihor Radchenko
Dear Fellow Orgers,

Despite being not directly visible to users, Org mode testing suite is
critical to maintain overall codebase stability. It helps to avoid
unintentional breakages as we keep adding new features to Org.

Yet, writing tests is probably not the most exciting part for
volunteer contributors. Not many new patches also include tests and the
core Org maintainers do not have a bandwidth to supply every new
significant patch with tests.

I am writing this help request in a hope that someone interested and/or
experienced with writing tests can help improving Org tests without a
need to spend a lot of time doing something unfamiliar (e.g. I
personally wrote my very first test as a patch for Org, not knowing much
about code testing beforehand).

Some of the possible improvements to Org test suite are listed below:

- Tests on bugfix branch fail to run using Emacs 26.
  Not because of main Org code, but because test-org re-defines
  decode-time in a way not supported by older Emacs versions. (This has
  been fixed on main and simply need to be ported back to bugfix).

- Tests always run in a single process and cannot benefit from make -j
  Supporting parallel execution of multiple test sets would make Org
  development much faster by reducing make test runtime.

- Testing native-compiled Org is missing. Having it would be nice.

- Tests covering state logging are missing. I wrote an example patch how
  to write such tests, but never got around for more
  https://orgmode.org/list/87tul1v11c.fsf@localhost

- Most of the tests are written assuming default values of customised
  variables. We have very basic test coverage for non-standard settings.
  A way to run all possible tests under most common user customisations
  would improve the test coverage a lot.

- Generally, more and better tests would be welcome.

Best,
Ihor



matlab+kernel+jupyter+python: works nicely save the plot command

2021-11-24 Thread Uwe Brauer


Hi

Using Ubuntu, python 3.5 matlab 2019a and the python matlab kernel
mathworks provides (and ob-ipython, but I presume that 
scimax (https://github.com/jkitchin/scimax) 
and https://github.com/nnicandro/emacs-jupyter would behave similar.

After starting the python-matlab engine I do

#+BEGIN_SRC emacs-lisp
(setq org-confirm-babel-evaluate nil)  
;;; display/update images in the buffer after I evaluate
(add-hook 'org-babel-after-execute-hook 'org-display-inline-images 'append)

(add-to-list 'org-src-lang-modes '("matlab" . matlab))
(setq python-shell-interpreter "python3")
;; set default headers for convenience
(setq org-babel-default-header-args:matlab
  '((:results . "output replace")
(:session . "matlab")
(:kernel . "matlab")
(:exports . "code")
(:cache .   "no")
(:noweb . "no")
(:hlines . "no")
(:tangle . "no")))
(defalias 'org-babel-execute:matlab 'org-babel-execute:ipython)
(defalias 'org-babel-prep-session:matlab 'org-babel-prep-session:ipython)
(defalias 'org-babel-matlab-initiate-session 
'org-babel-ipython-initiate-session)
#+END_SRC


#+begin_src matlab :results output latex :exports code  :eval never-export 
:wrap latex
clear all
close all
t=[0:0.1:1];
y=sin(t);
plot(t,y)
print -dpng  simple.png 
#+end_src

The print command succeeds the simple.png file is generated, however I
cannot see the figure with the plot, it never pops up.

What is wrong in my setting?

Regards

Uwe Brauer 




Re: Bibliographies on export with ox-context and ox-epub

2021-11-24 Thread Colin Baxter 
> Eric S Fraga  writes:

> On Wednesday, 24 Nov 2021 at 09:59, Colin Baxter  wrote:
>> Where is citeproc.el? I'm using Org mode version 9.5.1
>> (release_9.5.1-194-gd82936) and I don't see it.

> It's a separate Emacs package which you will need to install.
> It's available on MELPA.  The csl citation engine depends on it.
> It is not part of org itself.

Ah, I see. Tthanks again Eric

Best wishes,



Re: Bibliographies on export with ox-context and ox-epub

2021-11-24 Thread Eric S Fraga
On Wednesday, 24 Nov 2021 at 09:59, Colin Baxter  wrote:
> Where is citeproc.el? I'm using Org mode version 9.5.1
> (release_9.5.1-194-gd82936) and I don't see it.

It's a separate Emacs package which you will need to install.  It's
available on MELPA.  The csl citation engine depends on it.  It is not
part of org itself.

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



Re: Bibliographies on export with ox-context and ox-epub

2021-11-24 Thread Denis Maier



Am 24.11.2021 um 10:32 schrieb juh:

[...]



Thanks a lot but I get:

Unknown processor csl

What happens after this?

M-: (require 'oc-csl)

Will this evaluate or do you get an error message?

Denis






Re: Bibliographies on export with ox-context and ox-epub

2021-11-24 Thread Denis Maier

Am 24.11.2021 um 10:59 schrieb Colin Baxter :

Denis Maier  writes:

 > Are you already on org 9.5? Looks like your still using the "old"
 > org-ref links.

 > The following mwe might get you started:

 > %%

 > #+title: Citation tests #+cite_export: csl

 > #+bibliography: test.bib

 > [cite: @doe 45]

 > [cite/text: @doe 45]

 > #+print_bibliography:
 > %%

 > This will use the new citation export framework. citeproc-el needs
 > to be installed for this to be working.

Where is citeproc.el? I'm using Org mode version 9.5.1
(release_9.5.1-194-gd82936) and I don't see it.

Best wishes,


You'll need to install it. It's an independent package.

Denis





Re: Bibliographies on export with ox-context and ox-epub

2021-11-24 Thread Colin Baxter 
> Denis Maier  writes:

> Are you already on org 9.5? Looks like your still using the "old"
> org-ref links.

> The following mwe might get you started:

> %%

> #+title: Citation tests #+cite_export: csl

> #+bibliography: test.bib

> [cite: @doe 45]

> [cite/text: @doe 45]

> #+print_bibliography:
> %%

> This will use the new citation export framework. citeproc-el needs
> to be installed for this to be working.

Where is citeproc.el? I'm using Org mode version 9.5.1
(release_9.5.1-194-gd82936) and I don't see it.

Best wishes,




Unintended consequences of removing org-speed-commands-user

2021-11-24 Thread Shankar Rao
Hello all,

I discovered that upgrading to 9.5 broke my configuration because the
variable `org-speed-commands-user' was removed. I read the thread
(https://list.orgmode.org/87v9hzzhrn@gmail.com/) where this change
was proposed and I completely agree that exposing the whole set of
`org-speeds-commands' to the user for customization is an improvement
over the previous state of affairs. However, I believe there were some
unintended consequences of this change that can make it difficult to
customize `org-speed-commands' for users that are not elisp gurus.

The main problem is that `org-speed-commands' serves two purposes
simultaneously:

1.) It contains all the mappings between speed keys and commands
2.) It contains headlines for command categories.

Because of this second purpose, both the contents and order of entries
in `org-speed-commands' are important. For example, suppose I want to
replace the usual "n" command with my own. According to the usual
conventions for alists
(https://www.gnu.org/software/emacs/manual/html_node/elisp/Association-Lists.html),
new associations such as this are added to the front of the list. But
if I do so, by doing something like:

  (setq org-speed-commands (cons '("n" . #'my-org-next-heading)
org-speed-commands))

Then the speed key "n" will show up twice when
`org-speed-command-help' is invoked. I could first delete the old
association by replacing `org-speed-commands' in the above with
`(assoc-delete-all "n" org-speed-commands)', but then my modified
command will no longer appear in the "Outline Navigation" section of
the speed command help. Alternatively, I could replace the association
for "n" using `alist-get':

  (setf (alist-get "n" org-speed-commands nil nil #'equal)
#'my-org-next-heading)

However, this solution won't work for new speed commands (e.g., if I
want to bind `my-org-next-heading' to "N" instead), because in that
case `alist-get' will return `nil'.

Below is the relevant portion of my config file where I customize
`org-speed-commands':
-
  (defun alist-set (key value alist-symbol  testfn)
"Set KEY to VALUE in alist referenced by ALIST-SYMBOL.

  If KEY is not present in the alist, then add (KEY. VALUE) to the
  front of the alist. Compare keys with TESTFN. Defaults to equal."
(if-let ((keyval (assoc key (eval alist-symbol) testfn)))
(setf (cdr keyval) value)
  (set alist-symbol (cons (cons key value) (eval alist-symbol)


  (defvar sbr-org-speed-commands-user '(("User Custom Speed Commands")
("N" . ded-org-show-next-heading-tidily)
("P" .
ded-org-show-previous-heading-tidily)
("h" . sbr-org-speed-insert-subheading)
("u" . org-up-heading-or-item)
("b" . org-backward-heading-or-item)
("f" . org-forward-heading-or-item)
("p" . org-prev-heading-or-item)
("n" . org-next-heading-or-item))
"My custom Org speed commands")

  (dolist (keyval (reverse sbr-org-speed-commands-user))
(alist-set (car keyval) (cdr keyval) 'org-speed-commands))
-

As you can see, I defined my own function `alist-set', which modifies
an association in an alist if the key is already present, or adds the
new association to the front of the list otherwise. In my opinion,
functionality like `alist-set' should be built into Emacs itself. My
code then constructs my own list of custom speed commands with its own
section header and uses `alist-set' to add/modify speed commands.
While this code works, it's a bit unsatisfying because

1.) It relies on my custom `alist-set' function
2.) It relies on knowledge of the structure of `org-speed-commands'

More specifically, it requires that my new speed commands need to be
inserted in reverse order into `org-speed-commands' in order to be
displayed properly in `org-speed-commands-help'.

I don't know what is the best solution to enable Org users to add
and/or modify speed commands while also keeping the display of
`org-speed-commands-help' organized. Here is what I propose:

1.) Keep the whole set of `org-speed-commands' exposed to user
customization for power users
2.) Bring back `org-speed-commands-user', but instead of just
appending it to `org-speed-commands' as was done prior to Org 9.5, use
something like my `alist-set' above to add/modify speed command
associations as needed while preserving the display order in
`org-speed-commands-help'.

With my proposal, Org users wouldn't have to concern themselves with
the section headers in `org-speed-commands', but they would still be
able to add/modify/remove commands as they wish.

Let me know if anyone has a simpler alternative to achieve these
goals. If there is sufficient interest in my proposal, I would be
happy to provide a patch.

Thanks,

Re: Bibliographies on export with ox-context and ox-epub

2021-11-24 Thread Denis Maier
Are you already on org 9.5? Looks like your still using the "old" 
org-ref links.


The following mwe might get you started:

%%
#+title: Citation tests
#+cite_export: csl
#+bibliography: test.bib

[cite: @doe 45]

[cite/text: @doe 45]

#+print_bibliography:
%%

This will use the new citation export framework. citeproc-el needs to be 
installed for this to be working.


Anyway, I can export this to plain text, html, and latex without 
problems. I have not yet tried out the context exporter, but I don't see 
why it should not work there as well.


In case you haven't seen it already: 
https://blog.tecosaur.com/tmio/2021-07-31-citations.html


Best,
Denis

Am 24.11.2021 um 08:22 schrieb juh:

Hi all,

I am kind of lost with references and ox-context and ox-epub.

Is there a tutorial how to integrate a bibliography in ConTeXt and
epub-Export?


What I want to achieve is to use a bibtex bibliographies with org-roam and
export them to epub and ConTeXt to generate bibliographies in the output.

The first wish kind of works as I can insert entries from the bibtex file with 
C-].

They look like this:

Nam a sapien.[[cite:@horkheimer_dialektik_1984]]

This is the org-ref entry in settings.org.

   (straight-use-package 'org-ref)
   (with-eval-after-load "org-ref"
   (setq reftex-default-bibliography '("~/org/bibliography.bib")))

   (setq bibtex-completion-bibliography '("~/org/bibliography.bib")
 bibtex-completion-library-path '("~/org/bibtex-pdfs/")
 bibtex-completion-notes-path "~/org/notes/"
 bibtex-completion-pdf-open-function
 (lambda (fpath)
   (call-process "open" nil 0 nil fpath)))

   (define-key org-mode-map (kbd "C-c ]") 'org-ref-insert-link)


What puzzles me is that I could not find a hint to create a bibliography
for epub export and context export. Maybe there isn't. But as some
things with references does not work in my setup I fear that my
configuration is not working. I take snippets from the documentations of
the packages.

I miss an overall example or tutorial for note taking via org-roam and
exporting to epub and ConTeXt.

So for now my current publishing workflow is split into two.

1. Zettelkasten via org-roam

2. PDF and epub creation via pandoc and cite-proc.

As you can see there is a break of tools, so I would like to avoid this.

TIA
juh






Bibliographies on export with ox-context and ox-epub

2021-11-24 Thread juh
Hi all,

I am kind of lost with references and ox-context and ox-epub.

Is there a tutorial how to integrate a bibliography in ConTeXt and
epub-Export?


What I want to achieve is to use a bibtex bibliographies with org-roam and
export them to epub and ConTeXt to generate bibliographies in the output.

The first wish kind of works as I can insert entries from the bibtex file with 
C-].

They look like this:

Nam a sapien.[[cite:@horkheimer_dialektik_1984]]

This is the org-ref entry in settings.org.

  (straight-use-package 'org-ref)
  (with-eval-after-load "org-ref" 
  (setq reftex-default-bibliography '("~/org/bibliography.bib")))

  (setq bibtex-completion-bibliography '("~/org/bibliography.bib")
bibtex-completion-library-path '("~/org/bibtex-pdfs/")
bibtex-completion-notes-path "~/org/notes/"
bibtex-completion-pdf-open-function
(lambda (fpath)
  (call-process "open" nil 0 nil fpath)))

  (define-key org-mode-map (kbd "C-c ]") 'org-ref-insert-link)


What puzzles me is that I could not find a hint to create a bibliography
for epub export and context export. Maybe there isn't. But as some
things with references does not work in my setup I fear that my
configuration is not working. I take snippets from the documentations of
the packages.

I miss an overall example or tutorial for note taking via org-roam and
exporting to epub and ConTeXt.

So for now my current publishing workflow is split into two.

1. Zettelkasten via org-roam

2. PDF and epub creation via pandoc and cite-proc.

As you can see there is a break of tools, so I would like to avoid this.

TIA
juh

-- 
Autoren-Homepage: . http://literatur.hasecke.com
Satiren & Essays: . http://www.sudelbuch.de
Privater Blog:  http://www.hasecke.eu
Netzliteratur-Projekt:  http://www.generationenprojekt.de