Re: Possible bug with speed commands, macros and flyspell-mode (was: One big file or multiple small ones)

2025-03-26 Thread Ihor Radchenko
Rens Oliemans  writes:

> Ihor Radchenko  writes:
>
>> I am unable to reproduce neither with the latest main nor with Emacs 30.
>
> That is strange, I am able to reproduce as well, at least after activating
> (flyspell-mode). Both on current main:
>
>   Org mode version 9.8-pre (release_9.7.26-6-gac9bd5 @ 
> /home/rens/Projects/org/org-mode/lisp/)
>
> and
>
>   Org mode version 9.7.11 (release_9.7.11 @ /usr/share/emacs/30.1/lisp/org/)

Ok. I found out what I did differently from you.

You said:

7. Execute macro 4 times by typing C-x e e e e

while I simply used  binding.

Your variant indeed does not work because C-x e == , while
subsequent e e e are just "e" "e" "e" triggering effort in speed
keys. It does not trigger any macro.

I see no bug on Org side.

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



Re: [BUG] (Feature request) Allow org-cite-insert to completing-read-just-once [9.7.11]

2025-03-26 Thread Daan Ro
> We need to indicate which separator is used somehow.
>
> For example, here is what `org-agenda-filter' does in similar situation:
>
> (completing-read
> (concat
> (if negate "Negative filter" "Filter")
> " [+cat-tag<0:10-/regexp/]: ")
> #'org-agenda-filter-completion-function
> nil nil ff)
>

Right. Is 'Keys [citation1 ;; citation2 ;; ...]: ' fine? Or an
instruction like 'Keys (use \";;\" to separate citation keys)'? I'm not
sure how to project org-agenda-filter's convention here.

Daanturo

On Mar 26 2025, at 12:40 am, Ihor Radchenko  wrote:
> Daan Ro  writes:
>
> >> `string-match-p' matching the strings directly.
> > A candidate may have multiple appearances, like
> > "Author A ;; Author B ;;; ..."
> > `string-match-p' would only find the first ";;" and miss
> > ";;;". I thought s.el's `s-match-strings-all' should be more robust but
> > we can't use that so iteratively inserting and searching I went.
>
> Agree.
> > + (seq-keep
> > + choice-to-citation
> > + (completing-read-multiple "Keys: " table nil t
>
> This is not ideal according to my tests.
> The prompt does not display which separator string is used, so
> unsuspecting user will have no idea how to enter multiple citations at
> once. Especially for 'dynamic separator.
>
> We need to indicate which separator is used somehow.
> For example, here is what `org-agenda-filter' does in similar situation:
> (completing-read
> (concat
> (if negate "Negative filter" "Filter")
> " [+cat-tag<0:10-/regexp/]: ")
> #'org-agenda-filter-completion-function
> nil nil ff)
>
> --
> Ihor Radchenko // yantar92,
> Org mode maintainer,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at > We need to indicate 
> which separator is used somehow.
> >
> > For example, here is what `org-agenda-filter' does in similar situation:
> >
> > (completing-read
> > (concat
> > (if negate "Negative filter" "Filter")
> > " [+cat-tag<0:10-/regexp/]: ")
> > #'org-agenda-filter-completion-function
> > nil nil ff)
> >
>
> Right. Is 'Keys [citation1 ;; citation2 ;; ...]: ' fine? Or an
> instruction like 'Keys (use \";;\" to separate citation keys)'? I'm not
> sure how to project org-agenda-filter's convention here.
>


0001-oc-basic.el-new-option-org-cite-basic-complete-key-crm-separator.patch
Description: Binary data


Re: how can I filter my agenda on tags?

2025-03-26 Thread Michael Soulier

On 2025-03-12 9:16 a.m., Michael P. Soulier wrote:

I just can't seem to get this working.

During the work hours I want to include in my agenda only TODO items that have
the @work, @calls or @errands tags. I tried one tag initially and I can't get
that working. Looking at the docs, regexp seems to be the only option.

CONDITIONS is a list of symbols, boolean OR is used to combine the results
from different tests.  Valid conditions are:

scheduled Check if there is a scheduled cookie
notscheduled  Check if there is no scheduled cookie
deadline  Check if there is a deadline
notdeadline   Check if there is no deadline
timestamp Check if there is a timestamp (also deadline or scheduled)
nottimestamp  Check if there is no timestamp (also deadline or scheduled)
regexpCheck if regexp matches
notregexp Check if regexp does not match.
todo  Check if TODO keyword matches
nottodo   Check if TODO keyword does not match

For some reason there is no tag/notag options here. So I tried regexp.

("w" "Work day report"
((agenda ""
 ((org-agenda-overriding-header "Today's schedule")
 (org-agenda-skip-function
 '(org-agenda-skip-entry-if 'tags '(("@work"
 (org-agenda-span 'day)))

But it's not working. They're still there in the agenda view.

What am I doing wrong?


I did eventually get this working.

like so

  ("w" "Work day report"
   ((agenda ""
((org-agenda-overriding-header "Today's Work 
schedule")

 (org-agenda-skip-function
  (lambda ()
(let* ((tags (org-get-tags))
   (skip-tags '("@fun" "@personal" 
"@home")))
  (when (cl-intersection tags skip-tags 
:test #'equal)

(org-end-of-subtree t)

I think this could be greatly simplified by supporting filtering the 
agenda view on tags.


Cheers,
Mike



Re: [PATCH] Preview LaTeX recursively

2025-03-26 Thread Rudolf Adamkovič
Ihor Radchenko  writes:

> Previews are currently acting on section, not subtree. Both for latex
> and image previews.

TIL what a "section" is and that images do the same.

Canceled. :)

Rudy
-- 
"I would prefer an intelligent hell to a stupid paradise."
--- Blaise Pascal

Rudolf Adamkovič  [he/him]
http://adamkovic.org



Re: [FR] org-colview.el, add annotation for functions summary-types

2025-03-26 Thread Sławomir Grochowski
Ihor Radchenko  writes:

> It has been a while since the last activity in this thread.
> May I know if you still plan to work on this patch?

Thank you Ihor for reminding me of this.

The functionality almost works... there is only one thing that blocked
me. In the `completing-read' function, the value of the passed argument
REQUIRE-MATCH is t. To prevent adding values from outside of the list of
summary-types functions. Unfortunately, when the annotation was added,
it is not possible to choose any function from the list. It throws an
error [Match required].

Maybe you have an idea how to fix it?

Patch below:
>From 75badc5be2ef361f9a228a97f27a8778ca655625 Mon Sep 17 00:00:00 2001
From: Slawomir Grochowski 
Date: Sun, 20 Oct 2024 21:48:23 +0200
Subject: [PATCH] lisp/org-colview.el: display annotation for summary type
 functions

---
 lisp/org-colview.el | 28 ++--
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index ffed5501a..d3d32e0fd 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -930,6 +930,27 @@ When COLUMNS-FMT-STRING is non-nil, use it as the column format."
 	  (goto-char (car entry))
 	  (org-columns--display-here (cdr entry)
 
+(defun org-columns--summary-types-completion-function (string pred flag)
+  (pcase flag
+('t (all-completions string
+ (delete-dups
+  (cons '("") ;Allow empty operator.
+(mapcar #'car (append
+   org-columns-summary-types
+   org-columns-summary-types-default
+ pred))
+('metadata (list 'metadata
+ (cons 'annotation-function
+   (lambda (string)
+ (let* ((doc (condition-case nil (documentation (cdr (assoc string (append
+org-columns-summary-types
+org-columns-summary-types-default
+   (error nil)))
+(doc (and doc (substring doc 0 (string-search "\n" doc)
+   (if doc
+   (format " -- %s" doc)
+ ""
+
 (defun org-columns-new (&optional spec &rest attributes)
   "Insert a new column, to the left of the current column.
 Interactively fill attributes for new column.  When column format
@@ -961,12 +982,7 @@ details."
 			 (org-string-nw-p
 			  (completing-read
 			   "Summary: "
-			   (delete-dups
-			(cons '("")	;Allow empty operator.
-  (mapcar (lambda (x) (list (car x)))
-	  (append
-	   org-columns-summary-types
-	   org-columns-summary-types-default
+			   'org-columns--summary-types-completion-function
 			   nil t (nth 3 spec)))
 			 (org-string-nw-p
 			  (read-string "Format: " (nth 4 spec
-- 
2.39.5


-- 
Slawomir Grochowski


Use of #+include: inside list with breaking change?

2025-03-26 Thread Jens Lechtenboerger
Dear all,

I want to use the keyword #+include: inside lists to embed source
code for HTML export (`C-c C-e h h'), like so:

* foo
- A list
  #+include: bar.txt src text

Previously, that worked.  On Org main, the list now gets closed
before the source code container is generated.

I want to achieve the same result as when using src blocks directly,
which still works:
* foo
- Another list
  #+attr_html: :style font-size:0.35em
  #+begin_src text
bar
  #+end_src

Here, the list is closed after the source code.  (The style
attribute is used in my own export backend, not with plain HTML
export...)

Is there a way to achieve the old behavior?

Best wishes,
Jens



Re: [patch] ox-man: footer-middle and header-middle options

2025-03-26 Thread Grégoire Scano
Hello,

Sorry for the delay.
My company need some time to process the document as it is the first
time they have to deal with such request.

I will keep you informed as soon as I have more information.

Cheers,
Grégoire

On 3/25/25 01:50, Ihor Radchenko wrote:
> Grégoire Scano  writes:
> 
>>> Would you be interested to do the assignment?
>>> See https://orgmode.org/worg/org-contribute.html#copyright
>>
>> Absolutely! The request is submitted, I'll keep you posted.
> 
> It has been a month.
> May I know if you had any difficulties with the process?
> 




Re: print bibliography without a title

2025-03-26 Thread Scott Randby

On 3/25/25 18:53, Sébastien Gendre wrote:

Hello,


I want to print a bibliography in my Org document and I use
`#+print_bibliography:`.

But when I do, it automatically create a section with a title. And
I want it to not create a section. Only insert in the section where I
call the print.

How can I do ?


This works for me:

#+print_bibliography: :heading none

Scott Randby




Re: [PATCH] ox-texinfo: Preserve source block language fields during export

2025-03-26 Thread Rudolf Adamkovič
Ihor Radchenko  writes:

> CCing the maintainer.

You were 3 minutes faster than me. :)

> Note, however, that
> https://www.gnu.org/software/texinfo/manual/texinfo/texinfo.html#Syntax-Highlighting
> may or may not understand the src block language names as they are used
> in Org. We may want some kind of dictionary to translate Org's language
> to language supported by highlight/pygments/source-highlight. Something
> akin `org-latex-listings-langs'.

Good point.

Rudy
-- 
"We shall not cease from exploration
 And the end of all our exploring
 Will be to arrive where we started
 And know the place for the first time"
--- T. S. Eliot, Little Gidding, Four Quarters, 1943

Rudolf Adamkovič  [he/him]
http://adamkovic.org



Re: [PATCH] Capitalize JavaScript correctly

2025-03-26 Thread Rudolf Adamkovič
Ihor Radchenko  writes:

> With this change, the example will no longer work, because [...]

Oops.  Fixed.  Third time is the charm?

Rudy
>From d15652fb6ecfa9e496e6aebf4fbb57e9dcc4e129 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= 
Date: Fri, 21 Mar 2025 14:25:05 +0100
Subject: [PATCH] Capitalize JavaScript correctly

* doc/org-manual.org (Exporting to minimal HTML):
* etc/ORG-NEWS (Add ~:session~ support of ob-js for js-comint):
* lisp/ob-js.el (org-babel-js-function-wrapper):
(org-babel-execute:js):
(org-babel-variable-assignments:js):
(org-babel-js-initiate-session):
* lisp/ox-html.el (org-html-style-default):
(org-html-klipse-selection-script): Re-capitalize "Javascript" to
JavaScript or add a SIC comment if not possible.
---
 doc/org-manual.org | 2 +-
 etc/ORG-NEWS   | 3 +++
 lisp/ob-js.el  | 9 +
 lisp/ox-html.el| 4 ++--
 4 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 1f4fe5a6f..7561c0d62 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -13554,7 +13554,7 @@ name, and date.
 
 *** Exporting to minimal HTML
 :PROPERTIES:
-:DESCRIPTION: Exporting HTML without CSS, Javascript, etc.
+:DESCRIPTION: Exporting HTML without CSS, JavaScript, etc.
 :ALT_TITLE: Bare HTML
 :END:
 
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 332586f4f..057f66fd1 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -4763,10 +4763,13 @@ wget -c "https://ben.akrin.com/crackzor/crackzor_1.0.c.gz";
 #+end_example
 
 *** Add ~:session~ support of ob-js for js-comint
+
 #+begin_src js :session "*Javascript REPL*"
 console.log("stardiviner")
 #+end_src
 
+# SIC, JavaScript miscapitalized in `js-comint.el'.
+
 *** Add ~:session~ support of ob-js for Indium
 #+begin_src js :session "*JS REPL*"
 console.log("stardiviner")
diff --git a/lisp/ob-js.el b/lisp/ob-js.el
index 309f04929..816aa972e 100644
--- a/lisp/ob-js.el
+++ b/lisp/ob-js.el
@@ -1,4 +1,4 @@
-;;; ob-js.el --- Babel Functions for Javascript  -*- lexical-binding: t; -*-
+;;; ob-js.el --- Babel Functions for JavaScript  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2010-2025 Free Software Foundation, Inc.
 
@@ -73,10 +73,10 @@
   ;; parenthesis are not shadowed if the last line of the body is a
   ;; line comment.
   "require('process').stdout.write(require('util').inspect(function(){%s\n}()));"
-  "Javascript code to print value of body.")
+  "JavaScript code to print value of body.")
 
 (defun org-babel-execute:js (body params)
-  "Execute Javascript BODY according to PARAMS.
+  "Execute JavaScript BODY according to PARAMS.
 This function is called by `org-babel-execute-src-block'."
   (let* ((org-babel-js-cmd (or (cdr (assq :cmd params)) org-babel-js-cmd))
 	 (session (cdr (assq :session params)))
@@ -158,7 +158,7 @@ specifying a variable of the same value."
 session))
 
 (defun org-babel-variable-assignments:js (params)
-  "Return list of Javascript statements assigning the block's variables.
+  "Return list of JavaScript statements assigning the block's variables.
 The variables are defined in PARAMS."
   (mapcar
(lambda (pair) (format "var %s=%s;"
@@ -183,6 +183,7 @@ Return the initialized session."
 	(run-skewer)
 	(skewer-repl)
 	session-buffer)))
+   ;; SIC, JavaScript miscapitalized in `js-comint.el'.
((string= "*Javascript REPL*" session)
 (org-require-package 'js-comint)
 (let ((session-buffer "*Javascript REPL*"))
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 321f263cd..2f4ec12e2 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -332,7 +332,7 @@ This affects IDs that are determined from the ID property.")
   pre.src-haskell:before { content: 'Haskell'; }
   pre.src-hledger:before { content: 'hledger'; }
   pre.src-java:before { content: 'Java'; }
-  pre.src-js:before { content: 'Javascript'; }
+  pre.src-js:before { content: 'JavaScript'; }
   pre.src-latex:before { content: 'LaTeX'; }
   pre.src-ledger:before { content: 'Ledger'; }
   pre.src-lisp:before { content: 'Lisp'; }
@@ -1651,7 +1651,7 @@ https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag";
  selector_eval_scheme: '.src-scheme',
  selector: '.src-clojure',
  selector_eval_ruby: '.src-ruby'};"
-  "Javascript snippet to activate klipse."
+  "JavaScript snippet to activate klipse."
   :group 'org-export-html
   :package-version '(Org . "9.1")
   :type 'string)
-- 
2.39.5 (Apple Git-154)

-- 
"Be especially critical of any statement following the word
'obviously.'"
--- Anna Pell Wheeler, 1883-1966

Rudolf Adamkovič  [he/him]
http://adamkovic.org


whether org-mode should ignore links in properties drawer?

2025-03-26 Thread stardiviner
I use org-mode to manage bookmarks, contacts, and ebook library etc. So
offten insert URL or other
link types as property value in the properties drawer.

For example:

#+begin_src org
,*** INPROGRESS xgCloud  :LOG:bookmark:repeat:subscribe:
SCHEDULED: <2024-10-21 Mon .+1y>
:PROPERTIES:
:DATE: [2023-10-21 Sat 17:42]
:URL:  https://aff1.xgsite2.com/, https://aff4.xgsite1.com/
:PROFILE:  https://my.xgcloud.pro/#/stage/dashboard
:SOURCE:   https://dengcloud.org/xgcloud.html
:CUSTOM_ID: xgCloud
:END:
#+end_src

The commands like ~org-next-link~ etc will ignore links in properties
drawer. I think links in
properties drawer should not be ignored.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/