Re: Haskell code blocks

2022-11-06 Thread Ihor Radchenko
Bruno Barbier  writes:

> I've attached the patch that I've used to fix ob-haskell.

Applied onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=0de063a52181bd96ac9bf023454781f07c3353b3

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



Re: [BUG] Undocumented convention for org-time-stamp-custom-formats to be "<...>" (was: time-stamp in DONE tag is not really displayed)

2022-11-06 Thread Ihor Radchenko
Ihor Radchenko  writes:

> I propose to do the following:
> 1. org-time-stamp-formats and org-time-stamp-custom-formats will be
>treated as is, unless they contain "<" and ">" and the first and the
>last char.
> 2. If the formats do contain <...>, strip the "<" and ">".
> 3. Document (2) in the docstrings.

Done on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=e3a7c01874c9bb80e04ffa58c578619faf09e7f0

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



Re: [PATCH] * lisp/org.el: (org-get-indirect-buffer) Allow indirect base buffers

2022-11-06 Thread Ihor Radchenko
Adam Porter  writes:

> Thanks for your review.  I've attached a new patch.

Thanks!
Applied onto main with amendment to the commit message.
I added a link to this discussion for future reference.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=155dc778e8cd12bdfb4c7cac7e03f166ece1059c

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



Re: Interest in an Org video meetup?

2022-11-06 Thread Ihor Radchenko
Russell Adams  writes:

>> Do you plan to start the meetups any time soon?
>> If you do, we may also ask Timothy to announce it during his "This year
>> in Org" talk at Emacsconf.
>
> I've been really busy with work. I got a new Emacs BlueButton account
> I need to test, and then I'll make an initial presentation on a topic.
>
> Perhaps I can schedule one later this month.

To clarify, Timothy's presentation is going to be in December.
It would be great if you finalize how committed you can be to this by
then. Both from technical point of view and from your free time
availability.

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



Re: [PATCH] Re: Update Org to MathJax 3

2022-11-06 Thread Ihor Radchenko
Rudolf Adamkovič  writes:

> Bummer!  Do you have any suggestions in mind?  Perhaps we could define
> an advice for '(current-message)', if that ever runs?  I would welcome
> any ideas.

Using `current-message' would not be reliable even if it worked. It is
not future-compatible if we decide to emit new messages during export.

The proper test is not presence of the message, but the correct
conversion of the legacy options in the actual html output.

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



Re: [PATCH] lisp/ob-tangle.el, lisp/ob-core.el: Add strip-tangle

2022-11-06 Thread Ihor Radchenko
Daniel Ziltener  writes:

> This patch adds the "strip-tangle" option for the :noweb header
> argument.  This strips the noweb tags before tangling the block.  This can
> be useful for e.g. testing purposes where one wants to use a block as
> test case that can be both run inline as well as tangled into a file for
> automated testing.

Thanks!
Applied onto main with minor amendments.
I changed the commit title to "org-babel: Add new "strip-tangle" :noweb
argument value". I changed log entries to start from capital letters,
added missing "" around "strip-tangle", and added a TINYCHANGE cookie.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5e0c5c186dc151a2a2447a52c57f0db5b501a17b

You are now also listed as an Org contributor.
https://git.sr.ht/~bzg/worg/commit/cb74ea75fdb44d3844888a21e843559815e189a6

If you want to contribute to Org further, please consider signing FSF
copyright assignment. See
https://orgmode.org/worg/org-contribute.html#copyright

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



Re: [PATCH] oc-csl: Improve LaTeX bibliography formatting

2022-11-06 Thread Ihor Radchenko
András Simonyi  writes:

> the attached patch substantially improves the formatting of CSL-based
> bibliographies in LaTeX export by supporting in-style formatting
> settings that were previously ignored, most importantly,
> 'second-field-align', which is typically used for numeric styles such
> as ieee.csl.
>
> I'm sending this while another oc-csl patch (about affix and locator
> formatting) is still under discussion because I consider it a priority
> for the 9.6 release. (Not supporting those formatting settings
> rendered a large number of styles, some of them pretty popular, close
> to being unusable.)

Thanks for the patch!

Please, document the new customization in ORG-NEWS.
Also, it would be nice to describe CSL usage and tweaks in the manual.

> +;; The following was inspired by and mostly follows how Pandoc's
> +;; () default LaTeX template handles
> +;; CSL output.  Many thanks to the author, John MacFarlane!
> +(defcustom org-cite-csl-latex-preamble
> +  "\\usepackage{calc}
> +\\newlength{\\cslhangindent}
> +\\setlength{\\cslhangindent}{[CSL-HANGINDENT]}
> +\\newlength{\\csllabelsep}
> +\\setlength{\\csllabelsep}{[CSL-LABELSEP]}
> +\\newlength{\\csllabelwidth}
> +\\setlength{\\csllabelwidth}{[CSL-LABELWIDTH-PER-CHAR] * 
> [CSL-MAXLABEL-CHARS]}
> +\\newenvironment{citeprocbib}[2] % 1st arg. is hanging-indent, 2nd entry 
> spacing.
> + {% By default, paragraphs are not indented.
> +  \\setlength{\\parindent}{0pt}
> +  % Hanging indent is turned on when first argument is 1.
> +  \\ifodd #1
> +  \\let\\oldpar\\par
> +  \\def\\par{\\hangindent=\\cslhangindent\\oldpar}
> +  \\fi
> +  % Set entry spacing based on the second argument.
> +  \\setlength{\\parskip}{\\parskip +  #2\\baselineskip}
> + }%
> + {}
> +\\newcommand{\\cslblock}[1]{#1\\hfill\\break}
> +\\newcommand{\\cslleftmargin}[1]{\\parbox[t]{\\csllabelsep + 
> \\csllabelwidth}{#1}}
> +\\newcommand{\\cslrightinline}[1]
> +  {\\parbox[t]{\\linewidth - \\csllabelsep - \\csllabelwidth}{#1}\\break}
> +\\newcommand{\\cslindent}[1]{\\hspace{\\cslhangindent}#1}
> +\\makeatletter
> +\\newcommand{\\citeprocitem}[2]
> + {\\protect\\hyper@linkstart{cite}{citeproc_bib_item_#1}#2\\hyper@linkend}
> +\\makeatother"
> +  "LaTeX preamble content inserted by the `csl' citation processor.
> +
> +The placeholders [CSL-HANGINDENT], [CSL-LABELSEP],
> +[CSL-LABELWIDTH-PER-CHAR] and [CSL-MAXLABEL-CHARS] are replaced,
> +respectively, by the contents of the customizable variables
> +`org-cite-csl-latex-hanging-indent', `org-cite-csl-latex-label-separator',
> +`org-cite-csl-latex-label-width-per-char', and the maximal label length
> +in the bibliography measured in characters."
> +  :group 'org-cite
> +  :type 'string
> +  :package-version '(Org . "9.6"))
> +

I have two comments here:
1. Where are all these new commands coming from? They are not used
   directly in the code. Are you tweaking citeproc.el output this way? May
   it be better to use customizations provided by citeproc.el itself?
2. You are declaring this variable as defcustom, but it is not clear
   what is going to happen if the user changes it. It is not how to
   change this template in meaningful ways either.

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



Re: [BUG] Org errors when exporting document with R an source block that results in a table [9.5.5 (release_9.5.5 @ /usr/share/emacs/29.0.50/lisp/org/)]

2022-11-06 Thread Ihor Radchenko
Mattias  writes:

> When exporting an org file with an R sourceblock that results in a table I 
> get the following error: ~(wrong-type-argument number-or-marker-p nil)~.
>
> This happens when using ~emacs -Q~ and putting the below code blocks in a 
> test.org file; then using C-e h o to export to html.
>
> #+begin_src emacs-lisp :results none
> (require 'ob-R) ;; C-x C-e here as it's needed to run R blocks
> #+end_src
>
> #+begin_src R :exports both :colnames yes
> mtcars
> #+end_src
>
> This does not seem to happen in Emacs 28.1, or in 29.0.50 with Org 9.4.6.
>
> Debug on error shows the following:
>
> Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)

I am unable to reproduce on the latest main, but I can reproduce using
built-in Org version on Emacs 29.

This will be fixed in the next release.

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



Re: 2 'echo' bash instructions produce a table

2022-11-06 Thread Ihor Radchenko
alain.coch...@unistra.fr writes:

>#+begin_src bash
>echo "foo"
>echo "bar"
>#+end_src
>
> Typing 'C-c C-c' produces
>
>#+RESULTS:
>| foo |
>| bar |
>
> By contrast, with only 'echo "foo"', it produces what I expect:
>
>#+RESULTS:
>: foo

If you want to force string output, use :results output.

By default, ob-shell tries to guess the output type.
In the case of two commands returning output, the guess is yielding the
table. In the case of a single command, the guess is yielding a single
string output.

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



Re: processing a literal example line by line in a shell source block?

2022-11-06 Thread Greg Minshall
Ihor,

again, thanks for helping me with that problem.

and, just for my (or anyone's) future reference, how i probably *should*
have debugged this was to tangle the relevant source block, and then
examine the resulting shell-script file, and gone from there.

cheers, Greg



Re: [PATCH] Re: Update Org to MathJax 3

2022-11-06 Thread Rudolf Adamkovič
Ihor Radchenko  writes:

> Nothing is attached.

I apologize.  Please see the attached patch.

> If you are using Emacs to send email, I suggest you to enable checks
> for attachments, as I do in notmuch [...]

TIL and thank you!  Added to my configuration.

> AFAIK, `current-message' always returns nil in noninteractive batch
> mode. Messages are written directly into stderr. You need to use a
> different approach for testing.
>
>> P.S. As a workaround I also tried to set `set-message-function',
>> dependency-injection style, but it did not work either.
>
> I do not think that this function is ever executed in noninteractive
> mode either.

Bummer!  Do you have any suggestions in mind?  Perhaps we could define
an advice for '(current-message)', if that ever runs?  I would welcome
any ideas.

Rudy

>From 7bdc7cbd7e6f5c06773138657325502adc2fe999 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= 
Date: Fri, 7 Oct 2022 15:03:48 +0200
Subject: [PATCH] ox-html: Update from MathJax 2 to MathJax 3+

* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility.  All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3.  Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.

Link: https://list.orgmode.org/orgmode/m2a667n4ax@me.com/
---
 doc/org-manual.org   |  11 +-
 etc/ORG-NEWS |  32 ++
 lisp/ox-html.el  | 240 ---
 testing/lisp/test-ox-html.el | 762 +++
 4 files changed, 971 insertions(+), 74 deletions(-)
 create mode 100644 testing/lisp/test-ox-html.el

diff --git a/doc/org-manual.org b/doc/org-manual.org
index dc2fc57cd..7500202c5 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -13229,23 +13229,18 @@ LaTeX math snippets (see [[*LaTeX fragments]]) can be displayed in two
 different ways on HTML pages.  The default is to use the
 [[https://www.mathjax.org][MathJax]], which should work out of the box
 with Org[fn:: By default Org loads MathJax from
-[[https://cdnjs.com][cdnjs.com]] as recommended by
+[[https://www.jsdelivr.com/][jsDelivr]] as recommended by
 [[https://www.mathjax.org][MathJax]].][fn:46].  Some MathJax display
 options can be configured via ~org-html-mathjax-options~, or in the
 buffer.  For example, with the following settings,
 
 #+begin_example
-,#+HTML_MATHJAX: align: left indent: 5em tagside: left font: Neo-Euler
-,#+HTML_MATHJAX: cancel.js noErrors.js
+,#+HTML_MATHJAX: align: left indent: 5em tagside: left
 #+end_example
 
 #+texinfo: @noindent
 equation labels are displayed on the left margin and equations are
-five em 

Re: [PATCH] * lisp/org.el: (org-get-indirect-buffer) Allow indirect base buffers

2022-11-06 Thread Adam Porter

Hi Ihor,

On 11/5/22 03:09, Ihor Radchenko wrote:

Adam Porter  writes:


The attached patch improves the function org-get-indirect-buffer, fixing
a bug, clarifying the code, and adding a docstring.


Thanks! I have some comments.


Thanks for your review.  I've attached a new patch.


+(cl-defun org-get-indirect-buffer ( (buffer (current-buffer)) heading)
+  "Return an indirect buffer based on BUFFER.
+If HEADING, prepend it to the name of the new buffer."


Maybe append to the name?


Yes, thanks.  In the new patch I took the liberty of improving the 
format to make it more distinctive (i.e. it won't resemble a normal 
filename).



+  (let* ((base-buffer (or (buffer-base-buffer buffer) buffer))
+ (suffix-prefix (if heading
+(concat heading "-")
+  ""))


Why not pre-define the whole prefix instead?
(prefix (format "%s-%s" (buffer-name base-buffer)
 (if heading (concat heading "-") "")))

then, can just say (format "%s%s" prefix n) in the loop.


+ (buffer-name (cl-loop for n from 1 to 100


why to 100? It may fail (even though unlikely) and also unnecessary.
Can just say for n from 1.


I chose to limit the index because IME it's better to signal an error 
than to potentially go into an infinite loop.  Although it shouldn't 
happen, it could in the case of unforeseen circumstances, one of which I 
experienced while writing the patch.


But, even better, the new patch uses the built-in function 
generate-new-buffer-name, which handles it for us, and more efficiently.



+  ;; FIXME: Explain why this `condition-case' is necessary.  Why
+  ;; could an error be signaled with the CLONE argument non-nil,
+  ;; and why would trying again without CLONE solve the problem?
+  (error (make-indirect-buffer base-buffer buffer-name)


I did not find why in the git logs. It looks like some ancient code. You
can remove it in a followup patch.


Very well, the new patch omits it.

Thanks,
AdamFrom 22e7091b5d6dd8a84446b303a2706ab3d422b52f Mon Sep 17 00:00:00 2001
From: Adam Porter 
Date: Fri, 4 Nov 2022 14:52:58 -0500
Subject: [PATCH] * lisp/org.el: (org-get-indirect-buffer) Allow indirect base
 buffers

Previously, calling this function on an indirect buffer would fail,
preventing the user from making a new indirect buffer based on an
indirect buffer (e.g. imagine the user makes an indirect buffer for a
large subtree, then wants to make another one for a subtree of that).
Now, the base buffer of the buffer is used, when applicable.

Also, the function is partially rewritten to be clearer, and a
docstring is added.
---
 lisp/org.el | 35 ---
 1 file changed, 16 insertions(+), 19 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index d8708f8f2..6c39f351f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6160,25 +6160,22 @@ frame is not changed."
 (run-hook-with-args 'org-cycle-hook 'all)
 (and (window-live-p cwin) (select-window cwin
 
-(defun org-get-indirect-buffer ( buffer heading)
-  (setq buffer (or buffer (current-buffer)))
-  (let ((n 1) (base (buffer-name buffer)) bname)
-(while (buffer-live-p
-	(get-buffer
-	 (setq bname
-		   (concat base "-"
-			   (if heading (concat heading "-" (number-to-string n))
-			 (number-to-string n))
-  (setq n (1+ n)))
-(condition-case nil
-(let ((indirect-buffer (make-indirect-buffer buffer bname 'clone)))
-  ;; Decouple folding state.  We need to do it manually since
-  ;; `make-indirect-buffer' does not run
-  ;; `clone-indirect-buffer-hook'.
-  (org-fold-core-decouple-indirect-buffer-folds)
-  ;; Return the buffer.
-  indirect-buffer)
-  (error (make-indirect-buffer buffer bname)
+(cl-defun org-get-indirect-buffer ( (buffer (current-buffer)) heading)
+  "Return an indirect buffer based on BUFFER.
+If HEADING, append it to the name of the new buffer."
+  (let* ((base-buffer (or (buffer-base-buffer buffer) buffer))
+ (buffer-name (generate-new-buffer-name
+   (format "%s%s"
+   (buffer-name base-buffer)
+   (if heading
+   (concat "::" heading)
+ ""
+ (indirect-buffer (make-indirect-buffer base-buffer buffer-name 'clone)))
+;; Decouple folding state.  We need to do it manually since
+;; `make-indirect-buffer' does not run
+;; `clone-indirect-buffer-hook'.
+(org-fold-core-decouple-indirect-buffer-folds)
+indirect-buffer))
 
 (defun org-set-frame-title (title)
   "Set the title of the current frame to the string TITLE."
-- 
2.34.0



[PATCH] lisp/ob-tangle.el, lisp/ob-core.el: Add strip-tangle

2022-11-06 Thread Daniel Ziltener
* lisp/ob-tangle.el (org-babel-tangle-single-block): strip noweb tags
from block if :noweb has been set to strip-tangle.
* lisp/ob-core.el (org-babel-common-header-args-w-values): add
"strip-tangle" as new allowed value.
* lisp/ob-core.el (org-babel-noweb-p): add "strip-tangle" at the
appropriate positions.
* testing/lisp/test-ob-tangle.el (ob-tangle/strip-tangle): add new test
case for "strip-tangle".
* doc/org-manual.org (Noweb Reference Syntax): adjust documentation for
the noweb header argument.
* etc/ORG-NEWS: add entry for new header argument value.

This patch adds the "strip-tangle" option for the :noweb header
argument.  This strips the noweb tags before tangling the block.  This can
be useful for e.g. testing purposes where one wants to use a block as
test case that can be both run inline as well as tangled into a file for
automated testing.
---
 doc/org-manual.org |  6 ++
 etc/ORG-NEWS   |  5 +
 lisp/ob-core.el|  8 
 lisp/ob-tangle.el  |  4 +++-
 testing/lisp/test-ob-tangle.el | 26 ++
 5 files changed, 44 insertions(+), 5 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index b3071ec6d..90fd950dc 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -18998,6 +18998,12 @@ tangled, or exported.
   Expansion of noweb syntax references in the body of the code block
   when tangling.  No expansion when evaluating or exporting.
 
+- =strip-tangle= ::
+
+  Expansion of noweb syntax references in the body of the code block
+  when evaluating or exporting.  Removes noweb syntax references
+  when exporting.
+
 - =no-export= ::
 
   Expansion of noweb syntax references in the body of the code block
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index b542da34b..ca1944614 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -228,6 +228,11 @@ commands.
 =:noweb-prefix= can be set to =no= to prevent the prefix characters
 from being repeated when expanding a multiline noweb reference.
 
+*** New =:noweb= babel header argument value =strip-tangle=
+
+=:noweb= can be set to =strip-tangle= to strip the noweb syntax references
+before tangling.
+
 *** New LaTeX source block backend using =engraved-faces-latex=
 
 When ~org-latex-src-block-backend~ is set to ~engraved~,
diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index a1c11e6ca..22d60cfe6 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -415,7 +415,7 @@ then run `org-babel-switch-to-session'."
 (mkdirp. ((yes no)))
 (no-expand)
 (noeval)
-(noweb . ((yes no tangle no-export strip-export)))
+(noweb . ((yes no tangle strip-tangle no-export strip-export)))
 (noweb-ref . :any)
 (noweb-sep  . :any)
 (noweb-prefix . ((no yes)))
@@ -2885,9 +2885,9 @@ parameters when merging lists."
   "Check if PARAMS require expansion in CONTEXT.
 CONTEXT may be one of :tangle, :export or :eval."
   (let ((allowed-values (cl-case context
- (:tangle '("yes" "tangle" "no-export" "strip-export"))
- (:eval   '("yes" "no-export" "strip-export" "eval"))
- (:export '("yes")
+ (:tangle '("yes" "tangle" "no-export" "strip-export" 
"strip-tangle"))
+ (:eval   '("yes" "no-export" "strip-export" "eval" 
"strip-tangle"))
+ (:export '("yes" "strip-tangle")
 (cl-some (lambda (v) (member v allowed-values))
 (split-string (or (cdr (assq :noweb params)) "")
 
diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index 2da92efaf..ad027ccd0 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -536,7 +536,9 @@ non-nil, return the full association list to be used by
 (body
  ;; Run the tangle-body-hook.
   (let ((body (if (org-babel-noweb-p params :tangle)
- (org-babel-expand-noweb-references info)
+  (if (string= "strip-tangle" (cdr (assq :noweb (nth 2 
info
+(replace-regexp-in-string (org-babel-noweb-wrap) 
"" (nth 1 info))
+   (org-babel-expand-noweb-references info))
(nth 1 info
(with-temp-buffer
  (insert
diff --git a/testing/lisp/test-ob-tangle.el b/testing/lisp/test-ob-tangle.el
index a0003ee40..2a6e4b1dd 100644
--- a/testing/lisp/test-ob-tangle.el
+++ b/testing/lisp/test-ob-tangle.el
@@ -510,6 +510,32 @@ another block
(org-split-string (buffer-string
  (delete-file file))
 
+(ert-deftest ob-tangle/strip-tangle ()
+  "Test if strip-tangle works correctly when tangling noweb code blocks."
+  (should
+   (equal '("1")
+  (let ((file (make-temp-file "org-tangle-")))
+(unwind-protect
+(progn
+  (org-test-with-temp-text-in-file
+   (format "
+#+name: block1
+#+begin_src elisp
+2
+#+end_src
+

Re: How to set latex preview font to regular instead of italics?

2022-11-06 Thread Mati
I ended up with DejaVu Math TeX Gyre. You probably need this font 
installed on your system, but I'm not sure, because I had it installed 
before. Here's code to replace in my config:

  \\usepackage{mathastext}
  \\usepackage{unicode-math}
  \\setmainfont{Liberation Serif}
  \\setsansfont[Scale=MatchLowercase]{Liberation Sans}
  \\setmonofont[Scale=MatchLowercase]{Liberation Mono}
  \\setmathfont{DejaVu Math TeX Gyre}





Re: How to set latex preview font to regular instead of italics?

2022-11-06 Thread Mati
Ok, I found it's (La?)TeX default, specifically: By default math fonts 
are italic, and what I want is upright font. So, currently I found it 
can be done by \usepackage{mathastext} that makes italic math font a 
upright font or by using "Neo Euler" font . At the moment I succesfully 
applied it to PDF export, both mathastext and neo euler. I think I'll 
stick to Neo Euler, it's more straightforward, although Libertinus looks 
better, unfortunately it has weird SEM symbol. Maybe if other symbols 
are more straightforward I'll switch back. However, I still don't know 
how to apply those font settings to latex previews in org-mode.


I found great article on beautifying org latex export: 
https://so.nwalsh.com/2020/01/05-latex Here is my improved version of 
those export options, they might be useful for someone: (I also attach 
init.el for rest of my latex config)


One note before: You need to install Liberation font on your systems if 
you want to use it, it is used in my config. Next thing - if you want 
upright Libertine instead of Neo Euler, change some lines to this 
(you'll notice which):

  \\usepackage{mathastext}
  \\usepackage{libertinus}
  \\setmainfont{Liberation Serif}
  \\setsansfont[Scale=MatchLowercase]{Liberation Sans}
  \\setmonofont[Scale=MatchLowercase]{Liberation Mono}
  \\setmathfont{Libertinus Math}


Config:

(setq
  org-format-latex-options (plist-put org-format-latex-options ':scale' 5)
  org-latex-compiler "lualatex"
  org-latex-listings t
  org-latex-default-packages-alist
    '(("" "graphicx" t)
      ("" "grffile" t)
      ("" "longtable" nil)
      ("" "wrapfig" nil)
      ("" "rotating" nil)
      ("normalem" "ulem" t)
      ("" "textcomp" t)
      ("" "capt-of" nil)
      ("" "hyperref" nil))

  org-latex-classes
  '(;; ("equation"
;; "\\usepackage{fontspec}
;;   \\setmainfont{Liberation Serif}
;;   \\setmathfont[Scale=MatchLowercase]{DejaVu Math TeX Gyre}
;;   \\setsansfont[Scale=MatchLowercase]{Raleway}
;;   \\setmonofont[Scale=MatchLowercase]{Operator Mono SSm}")
  ("article"
"\\RequirePackage{fix-cm}
  \\PassOptionsToPackage{svgnames}{xcolor}
  \\documentclass[14pt]{article}
  \\usepackage{neo-euler}
  \\setmainfont{Liberation Serif}
  \\setsansfont[Scale=MatchLowercase]{Liberation Sans}
  \\setmonofont[Scale=MatchLowercase]{Liberation Mono}
  \\setmathfont{Neo Euler}
  \\usepackage{sectsty}
  \\allsectionsfont{\\sffamily}
  \\usepackage{enumitem}
\\setlist[description]{style=unboxed,font=\\sffamily\\bfseries}
  \\usepackage{listings}
  \\lstset{frame=single,aboveskip=1em,
      framesep=.5em,backgroundcolor=\\color{AliceBlue},
      rulecolor=\\color{LightSteelBlue},framerule=1pt}
  \\usepackage{xcolor}
\\newcommand\\basicdefault[1]{\\scriptsize\\color{Black}\\ttfamily#1}
  \\lstset{basicstyle=\\basicdefault{\\spaceskip1em}}
  \\lstset{literate=
      keywordstyle=\\color{DarkGreen}\\bfseries,
      identifierstyle=\\color{DarkRed},
      commentstyle=\\color{Gray}\\upshape,
      stringstyle=\\color{DarkBlue}\\upshape,
      emphstyle=\\color{Chocolate}\\upshape,
      showstringspaces=false,
      columns=fullflexible,
      keepspaces=true}
  \\usepackage[a4paper,margin=0.5in]{geometry}
  \\usepackage{parskip}
  \\makeatletter
  \\renewcommand{\\maketitle}{%
    \\begingroup\\parindent0pt
    \\sffamily
    \\Huge{\\bfseries\\@title}\\par\\bigskip
    \\LARGE{\\bfseries\\@author}\\par\\medskip
    \\normalsize\\@date\\par\\bigskip
    \\endgroup\\@afterindentfalse\\@afterheading}
  \\makeatother
  [DEFAULT-PACKAGES]
  \\hypersetup{linkcolor=Blue,urlcolor=DarkBlue,
    citecolor=DarkRed,colorlinks=true}
  \\AtBeginDocument{\\renewcommand{\\UrlFont}{\\ttfamily}}
  [PACKAGES]
  [EXTRA]"
  ("\\section{%s}" . "\\section*{%s}")
  ("\\subsection{%s}" . "\\subsection*{%s}")
  ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
  ("\\paragraph{%s}" . "\\paragraph*{%s}")
  ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))

  ("report" "\\documentclass[11pt]{report}"
  ("\\part{%s}" . "\\part*{%s}")
  ("\\chapter{%s}" . "\\chapter*{%s}")
  ("\\section{%s}" . "\\section*{%s}")
  ("\\subsection{%s}" . "\\subsection*{%s}")
  ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))

  ("book" "\\documentclass[11pt]{book}"
  ("\\part{%s}" . "\\part*{%s}")
  ("\\chapter{%s}" . "\\chapter*{%s}")
  ("\\section{%s}" . "\\section*{%s}")
  ("\\subsection{%s}" . "\\subsection*{%s}")
  ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))

org-latex-pdf-process
  (list (concat "latexmk -"
    org-latex-compiler
    " -recorder -synctex=1 %b"))
  )


Credits of course go also to creators of this very nice template, I just 
improved it. In attachments there is example pdf produced with it.


btw: inline $...$ has broken fraction distances, use $$...$$ instead(add-to-list 'default-frame-alist '(font . "Liberation Serif-16" ))
(set-face-attribute 'default t :font "Liberation Serif-16")
(set-fontset-font t nil (font-spec :size 16 :name 

Re: Interest in an Org video meetup?

2022-11-06 Thread Russell Adams
On Sun, Nov 06, 2022 at 03:55:33AM +, Ihor Radchenko wrote:
> Russell Adams  writes:
>
> > Would there be any interest in a monthly 1-2 hour long ad-hoc screen
> > sharing and video discussion for Org-mode?
> There seems to be general interest.
>
> Do you plan to start the meetups any time soon?
> If you do, we may also ask Timothy to announce it during his "This year
> in Org" talk at Emacsconf.

I've been really busy with work. I got a new Emacs BlueButton account
I need to test, and then I'll make an initial presentation on a topic.

Perhaps I can schedule one later this month.

--
Russell Adamsrlad...@adamsinfoserv.com
https://www.adamsinfoserv.com/



[BUG] Org errors when exporting document with R an source block that results in a table [9.5.5 (release_9.5.5 @ /usr/share/emacs/29.0.50/lisp/org/)]

2022-11-06 Thread Mattias
Hey all,

When exporting an org file with an R sourceblock that results in a table I get 
the following error: ~(wrong-type-argument number-or-marker-p nil)~.

This happens when using ~emacs -Q~ and putting the below code blocks in a 
test.org file; then using C-e h o to export to html.

#+begin_src emacs-lisp :results none
(require 'ob-R) ;; C-x C-e here as it's needed to run R blocks
#+end_src

#+begin_src R :exports both :colnames yes
mtcars
#+end_src

This does not seem to happen in Emacs 28.1, or in 29.0.50 with Org 9.4.6.

Debug on error shows the following:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
jit-lock--run-functions(142 2726)
jit-lock-fontify-now(142 #>)
org-font-lock-ensure(142 #>)
org-table-align()
org-babel-insert-result((("mpg" "cyl" "disp" "hp" "drat" "wt" "qsec" "vs" "am" 
"gear" "carb") hline (21 6 160 110 3.9 2.62 16.46 0 1 4 4) (21 6 160 110 3.9 
2.875 17.02 0 1 4 4) (22.8 4 108 93 3.85 2.32 18.61 1 1 4 1) (21.4 6 258 110 
3.08 3.215 19.44 1 0 3 1) (18.7 8 360 175 3.15 3.44 17.02 0 0 3 2) (18.1 6 225 
105 2.76 3.46 20.22 1 0 3 1) (14.3 8 360 245 3.21 3.57 15.84 0 0 3 4) (24.4 4 
146.7 62 3.69 3.19 20 1 0 4 2) (22.8 4 140.8 95 3.92 3.15 22.9 1 0 4 2) (19.2 6 
167.6 123 3.92 3.44 18.3 1 0 4 4) (17.8 6 167.6 123 3.92 3.44 18.9 1 0 4 4) 
(16.4 8 275.8 180 3.07 4.07 17.4 0 0 3 3) (17.3 8 275.8 180 3.07 3.73 17.6 0 0 
3 3) (15.2 8 275.8 180 3.07 3.78 18 0 0 3 3) (10.4 8 472 205 2.93 5.25 17.98 0 
0 3 4) (10.4 8 460 215 3 5.424 17.82 0 0 3 4) (14.7 8 440 230 3.23 5.345 17.42 
0 0 3 4) (32.4 4 78.7 66 4.08 2.2 19.47 1 1 4 1) (30.4 4 75.7 52 4.93 1.615 
18.52 1 1 4 2) (33.9 4 71.1 65 4.22 1.835 19.9 1 1 4 1) (21.5 4 120.1 97 3.7 
2.465 20.01 1 0 3 1) (15.5 8 318 150 2.76 3.52 16.87 0 0 3 2) (15.2 8 304 150 
3.15 3.435 17.3 0 0 3 2) (13.3 8 350 245 3.73 3.84 15.41 0 0 3 4) (19.2 8 400 
175 3.08 3.845 17.05 0 0 3 2) (27.3 4 79 66 4.08 1.935 18.9 1 1 4 1) (26 4 
120.3 91 4.43 2.14 16.7 0 1 5 2) (30.4 4 95.1 113 3.77 1.513 16.9 1 1 5 2) 
(15.8 8 351 264 4.22 3.17 14.5 0 1 5 4) (19.7 6 145 175 3.62 2.77 15.5 0 1 5 6) 
(15 8 301 335 3.54 3.57 14.6 0 1 5 8) (21.4 4 121 109 4.11 2.78 18.6 1 1 4 2)) 
("replace") ("R" "mtcars" ((:colname-names) (:rowname-names) (:result-params 
"replace") (:result-type . value) (:results . "replace") (:exports . "both") 
(:cache . "no") (:colnames . "yes") (:hlines . "no") (:noweb . "no") (:session 
. "none") (:tangle . "no")) "" nil 71 "(ref:%s)") nil "R")
org-babel-execute-src-block(nil ("R" "mtcars" ((:colname-names) 
(:rowname-names) (:result-params "replace") (:result-type . value) (:results . 
"replace") (:exports . "both") (:tangle . "no") (:session . "none") (:noweb . 
"no") (:hlines . "no") (:colnames . "yes") (:cache . "no")) "" nil 71 
"(ref:%s)"))
org-babel-exp-results(("R" "mtcars" ((:cache . "no") (:colname-names) 
(:colnames . "yes") (:exports . "both") (:hlines . "no") (:noweb . "no") 
(:result-params "replace") (:result-type . value) (:results . "replace") 
(:rowname-names) (:session . "none") (:tangle . "no")) "" nil 71 "(ref:%s)") 
block nil "8ebec0065e2f8c60506a73f500125bdbdce014a1")
org-babel-exp-do-export(("R" "mtcars" ((:cache . "no") (:colname-names) 
(:colnames . "yes") (:exports . "both") (:hlines . "no") (:noweb . "no") 
(:result-params "replace") (:result-type . value) (:results . "replace") 
(:rowname-names) (:session . "none") (:tangle . "no")) "" nil 71 "(ref:%s)") 
block "8ebec0065e2f8c60506a73f500125bdbdce014a1")
org-babel-exp-src-block()
org-babel-exp-process-buffer()
org-export-as(html nil nil nil (:output-file "test.html"))
org-export-to-file(html "test.html" nil nil nil nil nil)
org-html-export-to-html(nil nil nil nil)
(org-open-file (org-html-export-to-html nil s v b))
(if a (org-html-export-to-html t s v b) (org-open-file (org-html-export-to-html 
nil s v b)))
(lambda (a s v b) (if a (org-html-export-to-html t s v b) (org-open-file 
(org-html-export-to-html nil s v b(nil nil nil nil)
org-export-dispatch(nil)
funcall-interactively(org-export-dispatch nil)
command-execute(org-export-dispatch)
completing-read-default("Describe variable: " help--symbol-completion-table 
#f(compiled-function (vv) #) t nil nil nil nil)
completing-read("Describe variable: " help--symbol-completion-table 
#f(compiled-function (vv) #) t nil nil nil)
byte-code("\301 
\302p\303\2\30\304\305\306\6\69\205\22\0\6\6\"\307\310\311\6\6\"\302\303\211\6\n9\205&\0\312\6\13!&\7\262\1\211\313\232\2034\0\3\202..."
 [enable-recursive-minibuffers variable-at-point t nil completing-read 
format-prompt "Describe variable" help--symbol-completion-table make-closure 
#f(compiled-function (vv) #) symbol-name "" intern] 
13)
command-execute(describe-variable)

Emacs : GNU Emacs 29.0.50 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 
3.24.34, cairo version 1.17.6)
of 2022-09-19
Package: Org mode version 9.5.5 (release_9.5.5 @ 
/usr/share/emacs/29.0.50/lisp/org/)

current state:
==
(setq
org-link-elisp-confirm-function 

Re: Still prob on Agenda

2022-11-06 Thread Adham Omran
What do you mean by a false TODO?

Adham Omran



Re: CI tests

2022-11-06 Thread Christopher M. Miles

Christian Köstlin  writes:

> Dear org-mode users,
>
>
> at the moment I am trying to enable as much of the org-mode testsuite
> on the ci server (see https://builds.sr.ht/~bzg for the latest
> testruns).
>
> From time to time some tests fail, because the time when e.g. a
> timestamp is written to the buffer is different to when the timestamp
> is calculated in the test (the minute just flips there).
>
> The buildserver already stumbled over:
> - test-org/org-log-done
> - test-org-capture/fill-template
> but I think there might be more problems like that.
>
> Did you also see that when running the tests locally?
>
> Kind regards,
> Christian

Feedback: I have not seen those two tests failed on my local running.

-- 

[ stardiviner ]
I try to make every word tell the meaning that I want to express without 
misunderstanding.

Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3


signature.asc
Description: PGP signature


[PATCH] oc-csl: Improve LaTeX bibliography formatting

2022-11-06 Thread András Simonyi
Dear All,

the attached patch substantially improves the formatting of CSL-based
bibliographies in LaTeX export by supporting in-style formatting
settings that were previously ignored, most importantly,
'second-field-align', which is typically used for numeric styles such
as ieee.csl.

I'm sending this while another oc-csl patch (about affix and locator
formatting) is still under discussion because I consider it a priority
for the 9.6 release. (Not supporting those formatting settings
rendered a large number of styles, some of them pretty popular, close
to being unusable.)

Thanks in advance for your feedback!

best wishes,
András
From bc92683a6326e7f97093b401caf453a76b76ba46 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A1s=20Simonyi?= 
Date: Sun, 2 Oct 2022 19:20:36 +0200
Subject: [PATCH] oc-csl: Improve LaTeX bibliography formatting

* lisp/oc-csl.el (org-cite-csl--output-format): Use the dedicated
'org-latex' citeproc formatter to export references in LaTeX.
(org-cite-csl-latex-preamble, org-cite-csl--generate-latex-preamble,
org-cite-csl-finalizer): Insert a preamble fragment compatible with
the 'org-latex' citeproc formatter.
(org-cite-csl-latex-label-separator,
org-cite-csl-latex-label-width-per-char): Introduce additional
variables to control bibliography formatting.
---
 lisp/oc-csl.el | 98 ++
 1 file changed, 83 insertions(+), 15 deletions(-)

diff --git a/lisp/oc-csl.el b/lisp/oc-csl.el
index 1ccb74e92..1807efaea 100644
--- a/lisp/oc-csl.el
+++ b/lisp/oc-csl.el
@@ -214,6 +214,68 @@ Used only when `second-field-align' is activated by the used CSL style."
   :type 'string
   :safe #'stringp)
 
+(defcustom org-cite-csl-latex-label-separator "0.6em"
+  "Distance between citation label and bibliography item for LaTeX
+output in valid LaTeX units.  Used only when `second-field-align'
+is activated by the used CSL style."
+  :group 'org-cite
+  :package-version '(Org . "9.6")
+  :type 'string
+  :safe #'stringp)
+
+(defcustom org-cite-csl-latex-label-width-per-char "0.45em"
+  "Character width in LaTeX units for calculating entry label widths.
+Used only when `second-field-align' is activated by the used CSL
+style."
+  :group 'org-cite
+  :package-version '(Org . "9.6")
+  :type 'string
+  :safe #'stringp)
+
+;; The following was inspired by and mostly follows how Pandoc's
+;; () default LaTeX template handles
+;; CSL output.  Many thanks to the author, John MacFarlane!
+(defcustom org-cite-csl-latex-preamble
+  "\\usepackage{calc}
+\\newlength{\\cslhangindent}
+\\setlength{\\cslhangindent}{[CSL-HANGINDENT]}
+\\newlength{\\csllabelsep}
+\\setlength{\\csllabelsep}{[CSL-LABELSEP]}
+\\newlength{\\csllabelwidth}
+\\setlength{\\csllabelwidth}{[CSL-LABELWIDTH-PER-CHAR] * [CSL-MAXLABEL-CHARS]}
+\\newenvironment{citeprocbib}[2] % 1st arg. is hanging-indent, 2nd entry spacing.
+ {% By default, paragraphs are not indented.
+  \\setlength{\\parindent}{0pt}
+  % Hanging indent is turned on when first argument is 1.
+  \\ifodd #1
+  \\let\\oldpar\\par
+  \\def\\par{\\hangindent=\\cslhangindent\\oldpar}
+  \\fi
+  % Set entry spacing based on the second argument.
+  \\setlength{\\parskip}{\\parskip +  #2\\baselineskip}
+ }%
+ {}
+\\newcommand{\\cslblock}[1]{#1\\hfill\\break}
+\\newcommand{\\cslleftmargin}[1]{\\parbox[t]{\\csllabelsep + \\csllabelwidth}{#1}}
+\\newcommand{\\cslrightinline}[1]
+  {\\parbox[t]{\\linewidth - \\csllabelsep - \\csllabelwidth}{#1}\\break}
+\\newcommand{\\cslindent}[1]{\\hspace{\\cslhangindent}#1}
+\\makeatletter
+\\newcommand{\\citeprocitem}[2]
+ {\\protect\\hyper@linkstart{cite}{citeproc_bib_item_#1}#2\\hyper@linkend}
+\\makeatother"
+  "LaTeX preamble content inserted by the `csl' citation processor.
+
+The placeholders [CSL-HANGINDENT], [CSL-LABELSEP],
+[CSL-LABELWIDTH-PER-CHAR] and [CSL-MAXLABEL-CHARS] are replaced,
+respectively, by the contents of the customizable variables
+`org-cite-csl-latex-hanging-indent', `org-cite-csl-latex-label-separator',
+`org-cite-csl-latex-label-width-per-char', and the maximal label length
+in the bibliography measured in characters."
+  :group 'org-cite
+  :type 'string
+  :package-version '(Org . "9.6"))
+
 
 ;;; Internal variables
 (defconst org-cite-csl--etc-dir
@@ -413,7 +475,7 @@ corresponding to one of the output formats supported by Citeproc: `html',
   (let ((backend (plist-get info :back-end)))
 (cond
  ((org-export-derived-backend-p backend 'html) 'html)
- ((org-export-derived-backend-p backend 'latex) 'latex)
+ ((org-export-derived-backend-p backend 'latex) 'org-latex)
  (t 'org
 
 (defun org-cite-csl--style-file (info)
@@ -670,6 +732,21 @@ value is the bibliography as rendered by Citeproc."
 (plist-put info :cite-citeproc-rendered-bibliographies result)
 result)
 
+(defun org-cite-csl--generate-latex-preamble (info)
+  "Generate the CSL-related part of the LaTeX preamble.
+INFO is the export state, as a 

Re: View next 7 days of agenda, not next week

2022-11-06 Thread renato . pontefice
No, when I open my .org file, ad fitst I view the calendario of week (with 
things to do), I would have this view for the next 7 (or 6 or 9 or n) days in 
future. Non I sede just the actual week

Thank you

Renato

Il 5 novembre 2022 23:57:37 CET, "Quiliro Ordóñez"  ha 
scritto:
>El 2022-11-05 15:51, Renato Pontefice escribió:
>> With this command
>> (org-agenda-list)
>> (delete-other-windows)
>> 
>> My org-mode open with the present week days appointment and TODO
>> 
>> I would open with next 7 days view every day, not just on Monday.
>> Is it possible?
>
>Did you read the Org manual?
>

-- 
Inviato dal mio dispositivo Android con Mail. Perdonate la brevità.

Re: [PATCH] Re: oc-basic "Wrong value for ENTRY-OR-KEY" error on emacs master (29.x) [Was: Bibliographies on export with ox-context and ox-epub]

2022-11-06 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Ihor Radchenko  writes:
>
>> Note that apart from the problem on Emacs side, there appears to be a
>> problem with org-cite-basic-export-bibliography.
>>
>> org-cite-basic-export-bibliography uses org-cite-basic--print-entry,
>> which fails to print keys, which are not in .bib files. As a result,
>> #+print_bibliography: appears to fail all the time when the document
>> contains invalid cite keys.
>>
>> I consider this as a bug. At least org-cite-basic-export-bibliography
>> could provide a more useful error message. Or maybe even skip the
>> invalid keys. Or, similar to LaTeX, print ???. I am not sure which way
>> will be more canonical according to general oc.el design.
>
> I am suggesting to merge the attached patch.
> It will simply skip keys that are not in the bibliography when printing
> it.

Applied onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=26a2811b06a5916a66d101b10238552db12ff6e7

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



Re: [PATCH v4] [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)]

2022-11-06 Thread Ihor Radchenko
Ihor Radchenko  writes:

> I will be happy to merge a proper patch upon addressing possible
> pitfalls. I do not feel strongly about my variant vs. yours.

Max, do you have any update here? If not, I will merge my variant as it
should not break anything.

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



Feedback on Org syntax document

2022-11-06 Thread Ihor Radchenko
Hi,

It has been a while since I looked into the Org syntax document at
https://orgmode.org/worg/dev/org-syntax.html. So, I am not again ready
to see and comment on things with a fresh eye.

Below, I am listing my further feedback on the document.
I encourage other Org users to look into it as well.
This is one of the big projects that need to be finished as a
prerequisite for registering Org format in RFC:

Submit an IETF RFC to register Org as a MIME type
https://list.orgmode.org/87r1qt9cf0@gnu.org/

I also answered all the notes. I think that we should remove them for
good and instead spin off email treads from here, if necessary.

-

1. Introduction
> Should markdown be mentioned at all?
I see no problem with it.

> 2.2. The minimal and standard sets of objects

> excluding citation references and table cells.

"citation references" could be a link to the relevant 4.6 section.

> 2.4. Indentation

We can mention that Org parser discards common indentation.
For example

   This paragraph will not contain
   a long sequence of spaces before "a".

Also,

   This paragraph does not have leading spaces according to the parser.

This feature is also important in src blocks for whitespace-sensitive
programming languages.

> 3.1.1. Headings
> TITLE (optional)
> A series of objects from the standard set, excluding line break
> objects. It is matched after every other part.

"after every other part" is a bit confusing. I would name what exactly
is matches (KEYWORD and PRIORITY).

Also, at least one space is mandatory after STARS.

> If the TITLE of a heading is exactly the value of org-footnote-section
> (Footnotes by default)

I think that we can clarify a bit about using lisp variables across the
document in 2. Terminology and conventions.

> All content following a heading — up to either the next heading, or
> the end of the document, forms a section contained by the heading.
> This is optional, as the next heading may occur immediately in which
> case no section is formed.

Note that leading blank lines after heading before section are not
included into the section.

In particular, this means that

* Heading without section, but with blank lines


* Another heading with section

This is a section. It includes everything from "This is" down to "Last
heading", including the trailing blank lines.

* Last heading


Top-section follows the same rule:

-

Paragraph after blank lines after bob. The parent section starts at
"Paragraph".

> Since sections are usually thought of as a larger group that includes
> nested content (e.g. “section 3”), and this isn’t what Org sections
> are, maybe this should be called something slightly different?

Org manual indeed uses "section" as a larger group. In contrast to the
parser.

However, it is difficult to rename section element in Org code for
backwards compatibility reasons. I do not see any easy way to rename
sections, unfortunately.

Thus, I am inclined to keep "section" in Org parser's sense within
syntax document. Possibly, adding a visible disclaimer to the syntax
document.

> 3.2.1. Greater Blocks
> A collection of zero or more elements, subject to two conditions:
>   No line may start with #+end_NAME.

There is just one condition.

> 3.2.4. Footnote Definitions
> [fn:LABEL] CONTENTS
> LABEL
> Either a number or an instance of the pattern fn:WORD, where WORD
> represents a string consisting of word-constituent characters, hyphens
> and underscores (-_).

This is a bit misleading. I am reading this as "LABEL .. an instance of
... fn:WORD ...", which implies [fn:fn:WORD].

> 3.2.5. Inlinetasks
> Urgh, this syntax is ugly. — Tom G, Timothy

Oh, well. This note is not very useful. Lets remote it. You'd better
open a feature request.

> 3.2.6. Items
> TAG (optional)
> ... does not contain the substring "\nbsp{}::\nbsp{}"

What is \nbsp? Something is likely wrong with Org source formatting.

> 3.2.7. Plain Lists
> At a glance it may appear as though nested lists are not possible.
> They are, as items may themselves contain lists.

I am stumbling upon this wording. Maybe

  Note that item elements can contain nested plain list elements.

> if both types are present consecutively then they parse as separate
> lists.

"are parsed"?

> (ordered-plain-list
> (item)
> (item
>  (descriptive-plain-list
>   (item

This is wrong. Need

(ordered-plain-list
 (item
   (paragraph))
 (item
  (paragraph)
  (descriptive-plain-list
   (item
 (paragraph)

> The failure mode for malformed contents needs to be determined more
> clearly here. We don’t want property draws to suddenly become plain
> drawers just because a user has a malformed line, that could be
> disastrous if certain settings in the property drawer mask settings
> from further up the tree. In short, malformed contents should not
> poison the whole property drawer. — Tom G

Yet, malformed property drawers do become ordinary drawers. If we want
to do something about this, let's discuss in a 

2 'echo' bash instructions produce a table

2022-11-06 Thread Alain . Cochard


Hello.

I do

   emacs -Q -l ~/.emacs.git

with .emacs.git being

   (add-to-list 'load-path "~/Org/Coch-git/org-mode/lisp")
   (custom-set-variables
'(org-babel-load-languages
  '(
(shell . t))
  )
'(debug-on-error t)
)

   Org mode version 9.6-pre (release_9.5.5-1075-g3e010d @
   /home/cochard/Org/Coch-git/org-mode/lisp/)

Then I visit an Org file which contains only

   #+begin_src bash
   echo "foo"
   echo "bar"
   #+end_src

Typing 'C-c C-c' produces

   #+RESULTS:
   | foo |
   | bar |

By contrast, with only 'echo "foo"', it produces what I expect:

   #+RESULTS:
   : foo



-- 
EOST (École et Observatoire des Sciences de la Terre) 
ITE (Institut Terre & Environnement) | alain.coch...@unistra.fr
5 rue René Descartes   [bureau 110]  | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France | [ slot available for rent ]