[PATCH] Fixing refile cache use for org-goto in indirect buffers.

2022-09-18 Thread Yuchen Pei
To reprod:
- make sure the org-refile-targets generates a big enough list where
  the refile cache makes a difference
- visit an org file in org-refile-targets
- M-x clone-indirect-buffer-other-window
- C-0 C-c C-w to clear cache
- M-: (org-refile-get-targets)
- org-goto in the original buffer takes no effort
- but, org-goto in the indirect buffer takes time, which is unexpected.

---
 lisp/org-refile.el | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/org-refile.el b/lisp/org-refile.el
index 16cff25bd..7189ef595 100644
--- a/lisp/org-refile.el
+++ b/lisp/org-refile.el
@@ -306,7 +306,10 @@ converted to a headline before refiling."
(dolist (f files)
  (with-current-buffer (if (bufferp f) f (org-get-agenda-file-buffer f))
(or
-(setq tgs (org-refile-cache-get (buffer-file-name) descre))
+(setq tgs (org-refile-cache-get
+(buffer-file-name (when (bufferp f)
+(buffer-base-buffer f)))
+descre))
 (progn
   (when (bufferp f)
 (setq f (buffer-file-name (buffer-base-buffer f
-- 
2.37.3



[PATCH] Fixing refile cache use for org-goto in indirect buffers.

2022-09-18 Thread Yuchen Pei
To reprod:
- make sure the org-refile-targets generates a big enough list where
  the refile cache makes a difference
- visit an org file in org-refile-targets
- M-x clone-indirect-buffer-other-window
- C-0 C-c C-w to clear cache
- M-: (org-refile-get-targets)
- org-goto in the original buffer takes no effort
- but, org-goto in the indirect buffer takes time, which is unexpected.

---
 lisp/org-refile.el | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/org-refile.el b/lisp/org-refile.el
index 16cff25bd..7189ef595 100644
--- a/lisp/org-refile.el
+++ b/lisp/org-refile.el
@@ -306,7 +306,10 @@ converted to a headline before refiling."
(dolist (f files)
  (with-current-buffer (if (bufferp f) f (org-get-agenda-file-buffer f))
(or
-(setq tgs (org-refile-cache-get (buffer-file-name) descre))
+(setq tgs (org-refile-cache-get
+(buffer-file-name (when (bufferp f)
+(buffer-base-buffer f)))
+descre))
 (progn
   (when (bufferp f)
 (setq f (buffer-file-name (buffer-base-buffer f
-- 
2.37.3

Message-ID: <877d20vscj@ypei.org>



Re: [PATCH] Fix ob-clojure handling source block variable's value is a org-mode table or list

2022-09-18 Thread Christopher M. Miles

Ping Bastien Guerry.

"Christopher M. Miles"  writes:

> [[PGP Signed Part:Undecided]]
>
> I bellowing example:
>
> #+begin_src org
> ,#+NAME: ob-clojure-table-test
> | a | b | c |
> |---+---+---|
> | 1 | 2 | 3 |
>
> ,#+NAME: ob-clojure-table-test-2
> | a | b | c |
> |---+---+---|
> | 1 | 2 | 3 |
>
> ,#+begin_src clojure :var kk=ob-clojure-table-test :var 
> kk2=ob-clojure-table-test-2 :results output
> (println kk2)
> (println kk)
> ,#+end_src
>
> #+end_src
>
> Without this patch, it will report error "class java.lang.ClassCastException" 
> from CIDER.
>
> This patch added if condition to handle this table, list type data.
>
> From 948e8c1ff2c9ba1d9c0fe26f9bdaa096bef80a9d Mon Sep 17 00:00:00 2001
> From: stardiviner 
> Date: Sat, 9 Apr 2022 21:14:22 +0800
> Subject: [PATCH] ob-clojure.el: Fix header argument :var binding passed table
>  or list data
>
> * lisp/ob-clojure.el (org-babel-expand-body:clojure): Add if condition
> to handle source block :var passed org-mode table or list data for
> clojure let-binding to avoid java.lang.ClassCastException.
> ---
>  lisp/ob-clojure.el | 25 ++---
>  1 file changed, 18 insertions(+), 7 deletions(-)
>
> diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el
> index 5a44b6487..e6614b2d9 100644
> --- a/lisp/ob-clojure.el
> +++ b/lisp/ob-clojure.el
> @@ -101,13 +101,24 @@
>(and (cdr (assq :ns params)) (format "(ns %s)\n" ns))
>;; Variables binding.
>(if (null vars) (org-trim body)
> -(format "(let [%s]\n%s)"
> -(mapconcat
> - (lambda (var)
> -   (format "%S %S" (car var) (cdr var)))
> - vars
> - "\n  ")
> -body))
> +   ;; variable's value is a list from org-mode passed table 
> or list.
> +(if (listp (cdr (car vars)))
> +   (format "(let [%s]\n%s)"
> +   (mapconcat
> +(lambda (var)
> +  (format "%S '%S" (car var) (cadr var)))
> +vars
> +"\n  ")
> +   body)
> + ;; else, the header argument variable's value is not a 
> list.
> + (format "(let [%s]\n%s)"
> + (mapconcat
> +  (lambda (var)
> +(format "%S %S" (car var) (cdr var)))
> +  vars
> +  "\n  ")
> + body)
> + ))
>  (if (or (member "code" result-params)
>   (member "pp" result-params))
>   (format "(clojure.pprint/pprint (do %s))" body)
> -- 
> 2.35.1
>
> [5. text/x-patch; 
> 0001-ob-clojure.el-Fix-header-argument-var-binding-passed.patch]...


-- 

[ 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


[ANN] EmacsConf 2022 Second Call for Participation (extended until Sep 30)

2022-09-18 Thread Amin Bandali
Dear fellow Emacsians,

This is the second and final Call for Participation for EmacsConf 2022
now extended until September 30, and the conference itself planned for
December 3 and 4 (Sat-Sun).  Please see the CFP below for details on
how to send in your proposal(s), or chat with us about them and about
other ways of participating and volunteering around EmacsConf via our
main IRC channel #emacsconf on the Libera.Chat network.

If you're considering submitting a proposal but think the remaining
time may not be enough, please reach out to me off-list as soon as
possible so we could work something out.

I'll close this portion of the email with a thank you to all of the
folks who have submitted session proposals or expressed interest in
volunteering with EmacsConf.  We look forward to reading and reviewing
all of your messages and proposals, and getting back to you about them
and about the next steps soon. :-)

Best,
amin

P.S. please direct any replies to this post either to myself or to the
emacsconf-discuss list, so as to help avoid generating extra off-topic
chatter in the other lists cc'd on this message.  Thank you.


  ___

 EmacsConf 2022
   Online Conference
  ___


 December 3 and 4, 2022


Table of Contents
_

1. Call for Participation
2. Important dates
3. Talk formats
4. Preparing and submitting your proposal
5. Getting involved
6. Commitment to freedom


1 Call for Participation


  [EmacsConf 2022] will be a virtual conference on *December 3 and 4,
  2022 (Sat-Sun)*.  If you'd like to present at the conference, please
  [submit your proposal] by *September 30, 2022*.

  EmacsConf 2022 is about the joy of [Emacs] and Emacs Lisp.
  Come share your experiments and adventures with the Emacs text
  editor / operating system / way of life!  We welcome speakers of
  *all backgrounds* and *all levels of experience*, including
  newcomers giving their first talk.  What have you found exciting
  about Emacs lately?  What do you wish someone had told you when you
  were starting out?  What part of your workflow might inspire someone
  to get into Emacs or go deeper?

  A great way to get started with writing a proposal is to start by
  exploring the programs from previous years: [2021], [2020], [2019],
  [2015], [2013].  You might also find some neat ideas on the [ideas]
  page.  Feel free to add yours there too!  If you're still not sure,
  come by our IRC channel `#emacsconf' on `irc.libera.chat' and say
  hi.  You can join the chat using [your favourite IRC client], or by
  visiting [chat.emacsconf.org] in your web browser.

  All kinds of people use Emacs for all kinds of things.  We'd love it
  if EmacsConf 2022 could highlight interesting perspectives and
  reflect the diversity of our community.  If you know someone who
  might have a good idea for a talk, please reach out to them and
  encourage them to submit a proposal.  Many people (especially from
  underrepresented groups such as women, people of colour,
  non-developers, etc.) might not consider themselves proficient
  enough to share their thoughts.  If you let them know that you value
  their knowledge and experiences, and maybe even suggest something
  that you think others would like to hear about, they may realize
  that they do have something worth sharing and that we would love to
  hear from them.


[EmacsConf 2022] 
[submit your proposal] 
[Emacs] 
[2021] 
[2020] 
[2019] 
[2015] 
[2013] 
[ideas] 
[your favourite IRC client] 
[chat.emacsconf.org] 


2 Important dates
=

  For EmacsConf 2022, we are planning for 9am to 5pm Toronto/EST
  (2pm-10pm UTC) on December 3 and 4.  Depending on people's
  availability, it might be two half-days.

   CFP opens  July 17, 2022  
   CFP closes September 30, 2022 
   Speaker notifications  October 15, 2022 
   Schedule published October 31, 2022   
   EmacsConf 2022!December 3 and 4, 2022 

  If you are not available during the conference itself but you have a
  neat idea that you'd like to share, please propose it anyway!
  You can always handle questions after the conference, and we might
  even be able to coordinate with other Emacs meetups for regional
  events (if you're an Emacs meetup organizer and would like to make
  this happen let's [get in touch]!).

  Please note that although we will try our best to stick to the above
  dates in the coming months, given the current state of th

Re: [Patch] Pre-/postpend arbitrary LaTeX code to a section

2022-09-18 Thread Max Nikulin

On 18/09/2022 19:27, Juan Manuel Macías wrote:


* Section
  :PROPERTIES:
  :presec:  \begingroup\foo
  :postsec: \endgroup
  :END:


Juan Manuel, can it be implemented using a derived backend that calls 
the original variant of headline transcoder (`org-latex-headline') and 
adds pre/post code to the returned value? I have not tried to implement 
this idea, so perhaps I just have missed something obvious. Actually I 
wonder if the purpose of your patch is solely convenience or you faced a 
limitation with no reasonable workaround.


My only real objection is that the new keywords works for LaTeX only, 
but their names are rather generic. Moreover, Org's term is "headline", 
not "section". I would consider something like

- :headline_pre_latex: \begingroup\foo
- :headline_pre: :latex \begingroup\foo

By the way, are affiliated keywords a part of the following headline?

* Section One

#+attr_latex: :headline_pre \begingroup\foo
* Section Two




[Patch] Pre-/postpend arbitrary LaTeX code to a section

2022-09-18 Thread Juan Manuel Macías
Hi all,

I don't know if the following scenario usually appears in the workflow
of other Org users as well. Otherwise, I think this patch could be
ignored.

In my workflow I often need to pre- or postpend some LaTeX code
immediately before or after a section. Consider the following example:

--
* A section

Lorem ipsum

#+latex: \foo

* Another section

Lorem ipsum
-

The \foo command affects the second section, but for Org it belongs to
the content of the first section. If I comment this section out or mark
it as non-exportable, then the LaTeX code has no effect. I think a
simple solution could be to have the PRESEC AND POSTSEC properties to
prepend or postpend arbitrary code to a section. These properties could be
extended with PRESEC+ and POSTSEC+. An example of use:

* Section
 :PROPERTIES:
 :presec:  \begingroup\foo
 :postsec: \endgroup
 :END:
...

Best regards,

Juan Manuel 

-- 
--
--
Juan Manuel Macías 

https://juanmanuelmacias.com

https://lunotipia.juanmanuelmacias.com

https://gnutas.juanmanuelmacias.com

>From 56924d69a2090dfeedf4b35ca33e10a48cbc42b5 Mon Sep 17 00:00:00 2001
From: Juan Manuel Macias 
Date: Sun, 18 Sep 2022 13:56:05 +0200
Subject: [PATCH] lisp/ox-latex.el: Add properties for arbitrary LaTeX code.

* (org-latex-headline): The `PRESEC' and `POSTSEC' properties prepend
and postpend arbitrary LaTeX code to a section, respectively.
---
 lisp/ox-latex.el | 42 ++
 1 file changed, 26 insertions(+), 16 deletions(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 1eb70ab20..a8c9aecd2 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -2322,22 +2322,32 @@ holding contextual information."
 			 (and (string-match-p "\\" v)
   (string-match-p "\\" v)
   (format "\\stopcontents[level-%d]" level)
-		info t)
-	  (if (and opt-title
-		   (not (equal opt-title full-text))
-		   (string-match "\\`\\(.+?\\){" section-fmt))
-	  (format (replace-match "\\1[%s]" nil nil section-fmt 1)
-		  ;; Replace square brackets with parenthesis
-		  ;; since square brackets are not supported in
-		  ;; optional arguments.
-		  (replace-regexp-in-string
-		   "\\[" "(" (replace-regexp-in-string "\\]" ")" opt-title))
-		  full-text
-		  (concat headline-label pre-blanks contents))
-	;; Impossible to add an alternative heading.  Fallback to
-	;; regular sectioning format string.
-	(format section-fmt full-text
-		(concat headline-label pre-blanks contents
+		info t
+  ;; `PRESEC' and `POSTSEC' properties for arbitrary LaTeX code.
+  (pre-sec (let ((beg (org-element-property :begin headline)))
+			 (goto-char beg)
+			 (org-entry-get nil "PRESEC")))
+	  (post-sec (let ((beg (org-element-property :begin headline)))
+			  (goto-char beg)
+			  (org-entry-get nil "POSTSEC"
+  (concat
+	   (when pre-sec (format "%s\n\n" pre-sec))
+	   (if (and opt-title
+		(not (equal opt-title full-text))
+		(string-match "\\`\\(.+?\\){" section-fmt))
+	   (format (replace-match "\\1[%s]" nil nil section-fmt 1)
+		   ;; Replace square brackets with parenthesis
+		   ;; since square brackets are not supported in
+		   ;; optional arguments.
+		   (replace-regexp-in-string
+		"\\[" "(" (replace-regexp-in-string "\\]" ")" opt-title))
+		   full-text
+		   (concat headline-label pre-blanks contents))
+	 ;; Impossible to add an alternative heading.  Fallback to
+	 ;; regular sectioning format string.
+	 (format section-fmt full-text
+		 (concat headline-label pre-blanks contents)))
+   (when post-sec (format "%s\n\n" post-sec
 
 (defun org-latex-format-headline-default-function
 (todo _todo-type priority text tags _info)
-- 
2.37.3



[PATCH worg] org-tutorials/org4beginners.org: fix keybinding

2022-09-18 Thread laalsaas
---
 org-tutorials/org4beginners.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org-tutorials/org4beginners.org b/org-tutorials/org4beginners.org
index 60344c80..d7376f29 100644
--- a/org-tutorials/org4beginners.org
+++ b/org-tutorials/org4beginners.org
@@ -276,7 +276,7 @@ To speed up working with TODO-list there is the following 
shortcut
 =S-left/right= which will cycle through: *TODO* - *DONE* and empty.
 
 Imagine that you have a large document, with scattered all over the
-document TODO entries, *C-c C-v* will show only your current TODOs, and
+document TODO entries, *C-c / t* will show only your current TODOs, and
 folding the rest away.
 
 ** Configuring TODOs
-- 
2.36.1




Re: [BUG] The documentation webserver gives 404s [9.5.4 (release_9.5.4-3-g6dc785 @ )]

2022-09-18 Thread Bastien
Sorry I'm late to fixing this.

I reinstalled the rewrite rules on the server and I configured nginx
to use the errors pages that Tim already created.

We should be covered for most problems, but let me know if we need to
do more.

Thanks!

Ihor Radchenko  writes:

> If someone else is willing to allocate time and look into this issue,
> feel free to reply here. We can then arrange access to the relevant
> configs.

-- 
 Bastien



Re: [BUG] Info JS does not work [9.5.3 (release_9.5.3-467-g2bd34e @ /Users/salutis/src/org-mode/lisp/)]

2022-09-18 Thread Bastien
FWIW, I just set this up: the org-mode.git Savannah repository is
now mirrored to git.sr.ht and github.com every day at 1am CET.

-- 
 Bastien