Re: Tableofcontents

2024-01-12 Thread Pedro Andres Aranda Gutierrez
Horst Leps  writes:

> (I use Emacs 28, Mac-Mini Apple M2, Sonoma 14.2.1)
> Since a few days: Orgmode export to Latex only creates one Latex run, so
that the table of contents remains empty and no longer shows any sections. -
> What to do? Horst

Hi,

I'm running on master and my ox-latex config starts like this:

(use-package ox-latex
  :ensure nil
  :after org
  :commands (org-beamer-export-to-pdf org-latex-export-to-pdf)
  :custom
  (org-latex-listings 'listings)
  ;; Make sure you have bibtex integrated in the production loop
  (org-latex-pdf-process
   '("latexmk -bibtex -pdflatex='pdflatex --shell-escape
--interaction=nonstopmode' -pdf -f %f"))
...

And that gets me all the runs that are needed to get toc, acronyms, etc.

Best, /PA
--
Fragen sind nicht da, um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet


Re: Diary sexp and comparing dates, agenda

2024-01-12 Thread David Rogers

Ihor Radchenko  writes:

You don't need diary-float - it returns true/false whether 
current DATE

fits the arguments.

Instead, you can make use of `calendar-nth-named-absday'.
For example,

<%%(and (= 245 (mf-days-from-easter))
(< (calendar-absolute-from-gregorian date)
   (calendar-nth-named-absday -4 0 12 24)))>

Diary sexps are nothing but ordinary Elisp, with an extra twist 
that
during evaluation `date' variable is bound to current calendar 
date.

When they return nil, DATE does not match.



Thank you!

It seems that `calendar-nth-named-absday' wants the year after the 
month, and then an (optional) day of the month to count from. 
Since I hoped to keep re-using this material every year without 
re-entering the calculations, I've tried the following:


In my init file, I've added these two short definitions:

   (defun mf-beginning-of-advent (displayed-year)
 (calendar-nth-named-absday -4 0 12 displayed-year 24))

   (defun mf-days-from-advent ()
 (- (calendar-absolute-from-gregorian date) 
 (mf-beginning-of-advent (calendar-extract-year date


And my Org file has this:

* Example 1
<%%(and (= 245 (mf-days-from-easter)) (<= (mf-days-from-advent) 
-1))>



This setup seems to work so far. Does it look reasonable to you?

--
David



Re: Moving to the next heading does not always work

2024-01-12 Thread Nick Dokos
Rudolf Adamkovič  writes:

> REPRODUCTION STEPS:
>
> 1. Launch 'emacs -Q'.
> 2. Create a new Org file:
>
> * 1
> :PROPERTIES:
> :CUSTOM_ID: foo
> :END:
> * [[#foo][foo]] 2
> * 3
>
> 3. Open the newly created Org file.
> 3. Type M-x org-toggle-link-display RET.
> 4. Move the cursor to the first heading.
> 5. Type C-c C-n.
>
> EXPECTED:
>
>   The cursor moves to the second heading.

That's what happens here. Version: Org mode version 9.7-pre
(release_9.6.14-1019-g5092ec).

What version are you running?

>
> ACTUAL:
>
>   The cursor moves to the end of file.
>
> Rudy

-- 
Nick




[BUG] org-table-eval-formula mishandles semicolons in formulas [9.7-pre (release_9.6.14-1019-g5092ec @ /home/nick/src/emacs/org/org-mode/lisp/)]

2024-01-12 Thread Nick Dokos



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.


`org-table-eval-formula' interprets *any* semicolon in a formula as the
beginning of a format specifier. So if the formula contains a literal
semicolon that is not a format specifier

#+TBLFM: $3='(concat "COMMENT ON public.layout_forms." $1 " IS " (rc-sq $2) 
";")

The problem is that `org-table-eval-formula' decides that the semicolon
is the beginning of a format specifier very early in the function and
splits off the "specifier" from the rest of the formula, leading to
errors when the truncated formula is evaluated later.

ThHere is a semi-reasonable workaround in that the regexp matches the
*last* semicolon, so we can add a semicolon at the end of the formula,
specifying an empty format, but the formula is not truncated any longer.
If it is decided that the code must not be changed, then maybe the
workaround could be added to the documentation (perhaps as a footnote to
section "Emacs Lisp forms as formulas").

This was reported by user `vfclists' on Emacs SE:


https://emacs.stackexchange.com/questions/80062/is-it-because-this-org-table-formula-contains-double-quotes-it-doesnt-work


Emacs  : GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, 
cairo version 1.17.8)
 of 2023-12-28
Package: Org mode version 9.7-pre (release_9.6.14-1019-g5092ec @ 
/home/nick/src/emacs/org/org-mode/lisp/)
-- 
Nick





Re: Diary sexp and comparing dates, agenda

2024-01-12 Thread Ihor Radchenko
David Rogers  writes:

> * Example 1
> <%%(= 245 (mf-days-from-easter))>
>
> because "mf-days-from-easter" is defined in my init file, along 
> with the definition of Easter itself. This does what it looks like 
> it should do; this year, Example 1 is shown on December 1.
>
> And I can do
>
> * Example 2
> <%%(and (diary-float 1 0 5 7) (<= (mf-days-from-easter) -56))>
>
> to say "five Sundays after January 6th, but only if Easter is 
> still 8 weeks away or more".
>
> But Example 1 isn't quite finished, because that date is too close 
> to Christmas. I can easily show a diary sexp defining when "too 
> close to Christmas" is:
>
> <%%(diary-float 12 0 -4 24)>
>
> So I want to combine these ideas, to say "Show Example 1 in the 
> agenda 245 days after Easter each year, but only if it's earlier 
> than the fourth Sunday before Christmas".

You don't need diary-float - it returns true/false whether current DATE
fits the arguments.

Instead, you can make use of `calendar-nth-named-absday'.
For example,

<%%(and (= 245 (mf-days-from-easter))
(< (calendar-absolute-from-gregorian date)
   (calendar-nth-named-absday -4 0 12 24)))>

Diary sexps are nothing but ordinary Elisp, with an extra twist that
during evaluation `date' variable is bound to current calendar date.
When they return nil, DATE does not match.

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



Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]

2024-01-12 Thread Ihor Radchenko
Stefan Monnier  writes:

>> (setq-local kill-line-query-function #'org-kill-line-query)
>
> Please use `add-function` for such things.
> That's its raison d'être.

When comparing imaginary kill-line-query-functions (abnormal hook) +
add-hook vs. kill-line-query-function + add-function, which one will be
more preferred?

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



Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]

2024-01-12 Thread Stefan Monnier
> (setq-local kill-line-query-function #'org-kill-line-query)

Please use `add-function` for such things.
That's its raison d'être.


Stefan




Re: [BUG]: unexpected behavior related to org-indent-block

2024-01-12 Thread Ihor Radchenko
Ihor Radchenko  writes:

>> ---
>> #+begin_src emacs-lisp
>> 
>> #+end_src
>> ---
> ...
> I cannot reproduce.

"---" turned out to be important.
This is not a bug.

After

(insert (org-element-interpret-data copy))

The point ends up at
--- line, which is not recognized as a source block. So,

(org-indent-block)

signals an error. This error is intended.

I updated the docstring to make it clear that error is thrown when not at
block.

Handled, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=1aa4552e5

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



Re: Diary sexp and comparing dates, agenda

2024-01-12 Thread Ken Mankoff
Hi David,

I'm not sure if this will help, but I have to file time sheets on the last 
weekday less than or equal to the 15th and last-day-of-month.

I wrote two diary functions to achieve this (I don't handle holiday edge 
cases). I use these functions with:

** INFO [#A] Time Sheet
<%%(kdm/diary-last-weekday-of-month date)>
<%%(kdm/diary-last-weekday-15th date)>

Functions are:

(defun kdm/diary-last-weekday-15th (date)
  (let* (
 (dow (calendar-day-of-week date))
 (dom (calendar-extract-day date))
 (weekday (and (>= dow 1) (<= dow 5
(or 
 (and weekday (= dom 15))
 (and (= dow 5) (= dom 14))
 (and (= dow 5) (= dom 13)

(defun kdm/diary-last-weekday-of-month (date)
  (let* (
 (dow (calendar-day-of-week date))
 (dom (calendar-extract-day date))
 (month (calendar-extract-month date))
 (year (calendar-extract-year date))
 (ldom-num (calendar-last-day-of-month month year))
 (weekday (and (>= dow 1) (<= dow 5
(or 
 (and weekday (= dom ldom-num))
 (and (= dow 5) (= (+ 1 dom) ldom-num))
 (and (= dow 5) (= (+ 2 dom) ldom-num)

  -k.

On 2024-01-11 at 21:58 -08, David Rogers 
wrote...
> Hello all
>
> I'm using the Org agenda to show when certain church occasions will
> happen. Mostly I've got them working correctly, after "stealing" the
> method used in holidays.el for finding the date of Easter, along with
> someone else's function that then uses that to find the difference
> between Easter and today. (I'm pretty sure that whole idea was on
> emacswiki, and I think Paul Sexton put it together.)
>
> So now I have a much smaller problem to solve, but I don't understand
> how to get it to work; I suspect it has to do with how dates get
> formatted within different functions. Using what I already have, I can
> do this:
>
> * Example 1 <%%(= 245 (mf-days-from-easter))>
>
> because "mf-days-from-easter" is defined in my init file, along with
> the definition of Easter itself. This does what it looks like it
> should do; this year, Example 1 is shown on December 1.
>
> And I can do
>
> * Example 2 <%%(and (diary-float 1 0 5 7) (<= (mf-days-from-easter)
> -56))>
>
> to say "five Sundays after January 6th, but only if Easter is still 8
> weeks away or more".
>
> But Example 1 isn't quite finished, because that date is too close to
> Christmas. I can easily show a diary sexp defining when "too close to
> Christmas" is:
>
> <%%(diary-float 12 0 -4 24)>
>
> So I want to combine these ideas, to say "Show Example 1 in the agenda
> 245 days after Easter each year, but only if it's earlier than the
> fourth Sunday before Christmas".
>
> I could do a long string of (and (not this day, not this day, etc etc
> [insert long list of days] . . . , but that seems like a last resort.
>
> Everything in this question fits into "the current year according to
> the agenda view" - there's no need to consider dates that cross a year
> boundary.
>
> So: Is there a fairly simple way to define a (mf-days-from-advent)
> that will do a similar job to what (mf-days-from-easter) is already
> doing (i.e. it works when used in a diary sexp)?
>
>
> Here are the relevant definitions I've been using:
>
>
>(defun mf-easter (displayed-year)
>(let* ((century (1+ (/ displayed-year 100)))
>   (shifted-epact ; age of moon for April 5...
>(% (+ 14 (* 11 (% displayed-year 19)) ; ...by Nicaean
>rule
>  (- ; ...corrected for the Gregorian century rule
>   (/ (* 3 century) 4)) (/ ; ...corrected for
>  Metonic cycle inaccuracy
>   (+ 5 (* 8 century)) 25) (* 30 century)) ; keeps
>  value positive
>   30)) (adjusted-epact ; adjust for 29.5 day month
>(if (or (zerop shifted-epact)
>(and (= shifted-epact 1) (< 10 (%
>   displayed-year 19
>(1+ shifted-epact) shifted-epact))
>   (paschal-moon ; day after the full moon on or after
>   March 21
>(- (calendar-absolute-from-gregorian (list 4 19
>displayed-year))
>   adjusted-epact))) (calendar-dayname-on-or-before 0
>   (+ paschal-moon 7
>
>
>
>(defun mf-days-from-easter ()
>  "When used in a diary sexp, this function will calculate how many
> days are between the current date (DATE) and Easter Sunday."
>  (- (calendar-absolute-from-gregorian date)
> (mf-easter (calendar-extract-year date




Re: Why not enable extra keys by default?

2024-01-12 Thread Rudolf Adamkovič
Dear Ihor,

Thank you for taking the time to explain the matter to me.

All is clear now!

Rudy
-- 
"Simplicity is complexity resolved."
--- Constantin Brâncuși, 1876-1957

Rudolf Adamkovič  [he/him]
Studenohorská 25
84103 Bratislava
Slovakia



Moving to the next heading does not always work

2024-01-12 Thread Rudolf Adamkovič
REPRODUCTION STEPS:

1. Launch 'emacs -Q'.
2. Create a new Org file:

* 1
:PROPERTIES:
:CUSTOM_ID: foo
:END:
* [[#foo][foo]] 2
* 3

3. Open the newly created Org file.
3. Type M-x org-toggle-link-display RET.
4. Move the cursor to the first heading.
5. Type C-c C-n.

EXPECTED:

  The cursor moves to the second heading.

ACTUAL:

  The cursor moves to the end of file.

Rudy
-- 
“I do not fear death.  I had been dead for billions and billions of years
before I was born, and had not suffered the slightest inconvenience from it.”
--- Mark Twain, paraphrased

Rudolf Adamkovič  [he/him]
Studenohorská 25
84103 Bratislava
Slovakia



Re: Diary sexp and comparing dates, agenda

2024-01-12 Thread Tory S. Anderson
I don't have an answer -- my own use of diary-sexp is nothing more than 
standard holiday inclusion -- but I'm interested and watching for answers on 
the list. I personally didn't know that you could do such calculations the way 
you are, such as "too close to DATE", so I'm impressed!

- Tory



Re: Tableofcontents

2024-01-12 Thread Tory S. Anderson
Horst Leps  writes:

> (I use Emacs 28, Mac-Mini Apple M2, Sonoma 14.2.1)
> Since a few days: Orgmode export to Latex only creates one Latex run, so that 
> the table of contents remains empty and no longer shows any sections. -
> What to do? Horst

I don't run the cutting-edge org, but I often have to run my export twice to 
get things like page numbers correct. Maybe it's not ideal, but if you run the 
export a second time does it change the result?

- Tory



Re: ob-shell: proposal to remove "posh"

2024-01-12 Thread Matt


  On Fri, 12 Jan 2024 11:04:33 +0100  Morgan Willcock  wrote --- 

 > As I understand it, the code for the cmd.exe shell is not released
 > anywhere.

Ah, okay.  I clearly didn't search too hard for it.

 > That said, I imagine Wine does contain its own implementation of
 > cmd.exe, although I wouldn't expect it to be 100% compatible with the
 > real thing.

That's an interesting idea.  Might be a "good enough" work around.  The VM 
image I mentioned says, "The VM will require a minimum of 8GB of RAM and at 
least 70GB of disk space". XD

--
Matt Trzcinski
Emacs Org contributor (ob-shell)
Learn more about Org mode at https://orgmode.org
Support Org development at https://liberapay.com/org-mode




Re: [BUG] [WORG] Spurious file: https://orgmode.org/worg/org-tutorials/org-R/tmp.html [9.7-pre (release_9.6.16-1057-gdea778 @ /home/yantar92/.emacs.d/straight/build/org/)]

2024-01-12 Thread Ihor Radchenko
Bastien Guerry  writes:

>> Should we remove it?
>
> Sure, please go ahead.  Thanks!

Fixed, on master.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=dda435773
(the link will be available after I push local changes to sr.ht; after it
recovers from the ongoing DDOS)

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



Re: [BUG] [WORG] Spurious file: https://orgmode.org/worg/org-tutorials/org-R/tmp.html [9.7-pre (release_9.6.16-1057-gdea778 @ /home/yantar92/.emacs.d/straight/build/org/)]

2024-01-12 Thread Bastien Guerry
Hi Ihor,

Ihor Radchenko  writes:

> It looks like https://orgmode.org/worg/org-tutorials/org-R/tmp.html is a
> draft of https://orgmode.org/worg/org-tutorials/org-R/org-R.html.
> tmp.html/tmp.org is also not referenced from anywhere.
>
> Should we remove it?

Sure, please go ahead.  Thanks!

-- 
 Bastien Guerry



Re: Tableofcontents

2024-01-12 Thread Ihor Radchenko
Horst Leps  writes:

> (I use Emacs 28, Mac-Mini Apple M2, Sonoma 14.2.1)
>
> Since a few days: Orgmode export to Latex only creates one Latex run, so that 
> the table of contents remains empty and no longer shows any sections. - What 
> to do? Horst

Thanks for reporting!

What is your value of `org-latex-pdf-process'?
Did you do any changes in Emacs config recently? Or changed LaTeX installation?

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



Re: the Chinese characters were garbled after reopening a org-mode file.

2024-01-12 Thread Ihor Radchenko
lhb_immortal  writes:

> 1. the Chinese characters were garbled when reopen a org-mode file .
> 2.  I opened the file ,and press the tab key ,then encountered the warnings:
>  The error was: (error "Invalid search bound (wrong side of point)")
> Backtrace:
> "  backtrace-to-string(nil)
>  org-element-at-point()
>  org-return(nil nil 1)
>  funcall-interactively(org-return nil nil 1)
>  call-interactively(org-return nil nil)
>  command-execute(org-return)
>  recursive-edit()
>  debug(error (error \"No process\"))
>  signal(error (\"No process\"))
>  error(\"No process\")
>  set-buffer-process-coding-system(utf-8 utf-8)
>  funcall-interactively(set-buffer-process-coding-system utf-8 utf-8)
>  call-interactively(set-buffer-process-coding-system record nil)
>  command-execute(set-buffer-process-coding-system record)

Thanks for reporting!

Unfortunately, the backtrace does not provide enough information to
understand what the problem is.

It would help if you provide a minimal reproducer, as described in
https://orgmode.org/manual/Feedback.html#Feedback

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



Re: [BUG] Bug in parser [9.7 (9.7-??-57b94f344 @ /home/jose/.config/emacs/.local/straight/build-29.1/org/)]

2024-01-12 Thread Ihor Radchenko
Jose Salazar  writes:

> This bug often happens when I load things (such as loading a literate agda
> program -- "*.lagda.org", or rendering inline latex, e.g. $x = x^2$).
>
> I'm using Doom and NixOS.
> It doesn't actively disrupt my workflow (only that a window is opened)

Your Org mode version is not the newest and we had a couple of fixes for
edge cases in the parser after 57b94f344. If you are lucky, the warning
should disappear after updating Org mode to the latest main.

Let us know if you still see the warning after upgrade.

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



Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]

2024-01-12 Thread Ihor Radchenko
Eli Zaretskii  writes:

>> May you please elaborate what you mean by "old one"?
>
> kill-line-query-function

There is no such variable in Emacs. I proposed to introduce a new
variable `kill-line-query-function' earlier in this thread. There is no
backwards-compatibility problem we need to solve here.

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



[BUG] [WORG] Spurious file: https://orgmode.org/worg/org-tutorials/org-R/tmp.html [9.7-pre (release_9.6.16-1057-gdea778 @ /home/yantar92/.emacs.d/straight/build/org/)]

2024-01-12 Thread Ihor Radchenko
Hi,

It looks like https://orgmode.org/worg/org-tutorials/org-R/tmp.html is a
draft of https://orgmode.org/worg/org-tutorials/org-R/org-R.html.
tmp.html/tmp.org is also not referenced from anywhere.

Should we remove it?

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



Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]

2024-01-12 Thread Eli Zaretskii
> From: Ihor Radchenko 
> Cc: monn...@iro.umontreal.ca, emacs-orgmode@gnu.org, 65...@debbugs.gnu.org,
>  maniku...@gmail.com, i...@whxvd.name
> Date: Fri, 12 Jan 2024 12:39:18 +
> 
> Eli Zaretskii  writes:
> 
> >> I think that I see what you mean. What we can do to achieve this is
> >> changing `kill-line-query-function' into abnormal hook
> >> `kill-line-query-functions'. Then, `kill-line'/`kill-whole-line' will
> >> use (run-hook-with-args-until-success 'kill-line-query-functions) to
> >> decide whether to show a query.
> >> 
> >> Does it make sense?
> >
> > It might, yes.  But do we have to _replace_ the hook? cannot we have
> > both?  I.e. if the new one is defined, call it, otherwise call the old
> > one.  That would be more backward-compatible, I think.
> 
> May you please elaborate what you mean by "old one"?

kill-line-query-function



Re: Bug report for ox-icalendar: newlines should be CRLF

2024-01-12 Thread Ihor Radchenko
Jack Kamm  writes:

> I've pushed this change now:
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=f4446ce795c924a1e115e360d3674f6ad89be845

Fixed.

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



Re: [FR] Add buffer-local setting to request specific ESS process/session name (was: [PATCH] Set Python shell in Org edit buffer)

2024-01-12 Thread Sparapani, Rodney
I see.  But, I assume that you meant…
8. Observe that the line still goes to "session1"

I usually launch another emacs for “session2”.
There’s probably a way to do this manually,
but, I take your point.  However, if you are a
non-user, then why do you care?

--
Rodney Sparapani, Associate Professor of Biostatistics, He/Him/His
Vice President, Wisconsin Chapter of the American Statistical Association
Institute for Health and Equity, Division of Biostatistics
Medical College of Wisconsin, Milwaukee Campus

From: Ihor Radchenko 
Date: Wednesday, January 10, 2024 at 1:28 PM
To: Sparapani, Rodney 
Cc: Jack Kamm , ess-c...@r-project.org 
, Liu Hui , emacs-orgmode@gnu.org 

Subject: Re: [FR] Add buffer-local setting to request specific ESS 
process/session name (was: [PATCH] Set Python shell in Org edit buffer)
ATTENTION: This email originated from a sender outside of MCW. Use caution when 
clicking on links or opening attachments.


"Sparapani, Rodney"  writes:

> Hi Ihor:
>
> Do you have a patch?  I’m not an org-mode user so I can’t test this myself.
> Thanks

Well. I am not exactly ESS user, so I wanted to get a general feedback
first before trying anything blindly.

I think I can demonstrate the problem we are facing without forcing you
to use Org mode though:

1. create and open test.R file containing
   x = "foo"
2. M-: (setq-local ess-gen-proc-buffer-name-function (lambda (_) "session1"))
3. M-x ess-eval-line
4. Observe "session1" R comint buffer displayed
5. create and open test2.R file containing
   y = "bar"
6. M-: (setq-local ess-gen-proc-buffer-name-function (lambda (_) "session2"))
7. M-x ess-eval-line
8. Observe that the line still goes to "session2"

As a non-user, I am not sure if the above is a bug or just some kind of
missing feature. However, for comparison, python.el allows setting
`python-shell-buffer-name' and doing steps similar to the above will
yield two independent python shells to interact with.

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



the Chinese characters were garbled after reopening a org-mode file.

2024-01-12 Thread lhb_immortal





1. the Chinese characters were garbled when reopen a org-mode file .2.  I opened the file ,and press the tab key ,then encountered the warnings:  The error was: (error "Invalid search bound (wrong side of point)") Backtrace:"  backtrace-to-string(nil)  org-element-at-point()  org-return(nil nil 1)  funcall-interactively(org-return nil nil 1)  call-interactively(org-return nil nil)  command-execute(org-return)  recursive-edit()  debug(error (error \"No process\"))  signal(error (\"No process\"))  error(\"No process\")  set-buffer-process-coding-system(utf-8 utf-8)  funcall-interactively(set-buffer-process-coding-system utf-8 utf-8)  call-interactively(set-buffer-process-coding-system record nil)  command-execute(set-buffer-process-coding-system record)  counsel-M-x-action(\"set-buffer-process-coding-system\")  ivy-call()  ivy-read(\"M-x \" [org-capture-goto-last-stored 0 org-element-paragraph-separate calendar-forward-week tramp-sudoedit-file-name-handler tramp-completion-handle-file-name-all-completions Set\\ Slice ivy-explorer org-indent-drawer Reduce\\ To:\\ to\\ Cc: ivy-default-view-name help-follow-symbol pcomplete-stub yas-x-prompt gnus-article-nndoc-name org-export-before-processing-functions znc uniquify-rename-buffer gnus-mime-security-details-buffer gnus-agent-group-covered-p org-table--descriptor-line helm-show-kill-ring message-expand-name-databases info--manual-names er/looking-back-max nnoo-map-functions gnus-try-warping-via-registry search-emacs-glossary kmacro-pop-ring1 mu4e-cited-7-face python-syntax--context-compiler-macro vc-annotate text-property--find-end-backward org-table-get-range 0 ~/Desktop/work/work_records/jilin/运维文档.org 0 swiper-include-line-number-in-search gnus-summary-limit-to-marks kmacro-p nnmail-message-id-cache-file 0 article-fill-long-lines smime-buffer-as-string-region org-get-org-file diredfl-symlink org-at-keyword-p counsel--async-filter bibtex-text-in-string ! ...] :predicate #f(compiled-function (sym) #) :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)  counsel-M-x()  funcall-interactively(counsel-M-x)  call-interactively(counsel-M-x nil nil)  command-execute(counsel-M-x)" Please report this to Org mode mailing list (M-x org-submit-bug-report).Emacs  : GNU Emacs 29.1 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G9323)) of 2023-08-17Package: Org mode version 9.6.10 ( @ /Users/halberd/.emacs.d.self/elpa/org-9.6.10/)current state:==(setq org-link-elisp-confirm-function 'yes-or-no-p org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn ENTRY)"] org-persist-after-read-hook '(org-element--cache-persist-after-read) org-export-before-parsing-hook '(org-attach-expand-links) org-cycle-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-archive-hook '(org-attach-archive-delete-maybe) org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines                  org-cycle-optimize-window-after-visibility-change org-cycle-display-inline-images) org-persist-before-read-hook '(org-element--cache-persist-before-read) org-mode-hook '(er/add-org-mode-expansions                 #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-fold-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) org-confirm-shell-link-function 'yes-or-no-p outline-isearch-open-invisible-function 'outline-isearch-open-invisible org-agenda-before-write-hook '(org-agenda-add-entry-text) org-babel-tangle-lang-exts '(("python" . "py") ("lisp" . "lisp") ("emacs-lisp" . "el") ("elisp" . "el")) org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-confirm-elisp-link-function 'yes-or-no-p org-speed-command-hook '(org-speed-command-activate org-babel-speed-command-activate) org-fold-core-isearch-open-function 'org-fold-core--isearch-reveal org-persist-before-write-hook '(org-element--cache-persist-before-write) org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-link-shell-confirm-function 'yes-or-no-p org-babel-pre-tangle-hook '(save-buffer) org-agenda-loop-over-headlines-in-active-region nil org-occur-hook '(org-first-headline-recenter) org-metadown-hook '(org-babel-pop-to-session-maybe) org-link-parameters '(("attachment" :follow org-attach-follow :complete org-attach-complete-link)                       ("eww" :follow org-eww-open :store org-eww-store-link)                       ("rmail" :follow org-rmail-open :store org-rmail-store-link)                       ("mhe" :follow org-mhe-open :store org-mhe-store-link)                       ("irc" :follow 

Re: [External] [FR] Add buffer-local setting to request specific ESS process/session name (was: [PATCH] Set Python shell in Org edit buffer)

2024-01-12 Thread Richard M. Heiberger
This idiscussion s reminding me of the following ESS functions

ess-add-ess-process   M-x ... RET
   Execute this command from within a buffer running a process to add
ess-request-a-process M-x ... RET
   Ask for a process, and make it the current ESS process.
ess-switch-processM-x ... RET
   Force a switch to a new underlying process.

Are these relevant to the question?

Rich

> On Jan 10, 2024, at 15:15, Ihor Radchenko  wrote:
>
> "Sparapani, Rodney"  writes:
>
>> I see.  But, I assume that you meant…
>> 8. Observe that the line still goes to "session1"
>
> Yup.
>
>> I usually launch another emacs for “session2”.
>> There’s probably a way to do this manually,
>> but, I take your point.  However, if you are a
>> non-user, then why do you care?
>
> Org mode supports multiple ESS sessions in Org mode src blocks
> (https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html#org2a21acd)
>
> However, we currently have to use a workaround that does not always work
> well to assign separate sessions to R source blocks in Org mode.
> ESS is the only comint mode that requires such workaround and does not
> allow setting a specific process buffer name for a given R buffer.
>
> We recently discovered `ess-gen-proc-buffer-name-function', but it does
> not work as we expected, unfortunately. (which is either because we
> misunderstand something or because there is a bug).
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>
> ___
> ESS-core list: https://stat.ethz.ch/mailman/listinfo/ess-core



Re: [FR] Add buffer-local setting to request specific ESS process/session name (was: [PATCH] Set Python shell in Org edit buffer)

2024-01-12 Thread Sparapani, Rodney
Hi Jack:

Do you have a patch?  I’m not an org-mode user so I can’t test this myself.
Thanks

--
Rodney Sparapani, Associate Professor of Biostatistics, He/Him/His
Vice President, Wisconsin Chapter of the American Statistical Association
Institute for Health and Equity, Division of Biostatistics
Medical College of Wisconsin, Milwaukee Campus

From: ESS-core  on behalf of Ihor Radchenko 

Date: Wednesday, January 10, 2024 at 6:15 AM
To: Jack Kamm , ess-c...@r-project.org 

Cc: Liu Hui , emacs-orgmode@gnu.org 

Subject: [FR] Add buffer-local setting to request specific ESS process/session 
name (was: [PATCH] Set Python shell in Org edit buffer)
ATTENTION: This email originated from a sender outside of MCW. Use caution when 
clicking on links or opening attachments.


Hi,

I'd like to request a new ESS feature that will allow to choose which
session is created by ESS when no session is yet associated with a
buffer.

Currently, `ess-request-a-process' unconditionally re-uses an existing
ESS process with appropriate `ess-dialect', even when such process is
not consistent with `ess-gen-proc-buffer-name-function'.

This behavior puts Org mode's ESS support in somewhat difficult position
- Org mode allows multiple sessions in Org src blocks, and we want some
way to tell ESS which session process to use for any given buffer
without actually starting that process manually.
We had a hope that setting `ess-gen-proc-buffer-name-function' would
suffice and that ESS would start a new process according to
`ess-gen-proc-buffer-name-function' when no process is yet associated
with buffer. But it is not the case.

Some more context:
(full thread is in
)

Jack Kamm  writes:

> I tested the patch (plus the additional change to org-src.el), with an
> Org file with following 2 blocks:
>
> #+begin_src R :session foo :results output
>   print('foo')
> #+end_src
>
> #+begin_src R :session *bar* :results output
>   print('bar')
> #+end_src

These are two R blocks that should be associated with two different ESS
R processes.

> On block "foo", I did C-', and then ess-eval-line. It creates a session
> named "foo", as expected.

When we edit the first block and when no ESS process is available,
`ess-eval-line' respects `ess-gen-proc-buffer-name-function' set by Org
mode, and creates a new ESS process "foo".

> On block "*bar*", I did the same. It does not create session named
> "*bar*", instead evaluating in session "foo". It seems ESS will always
> assume you want to evaluate in existing session if one exists, rather
> than start a new associated session, and it seems there is no way to
> tell it to behave otherwise.

But when the "foo" process is already running, despite different
`ess-gen-proc-buffer-function', `ess-eval-line' connects to the existing
"foo" process rather than "*bar*", as we anticipated.

> However, calling "M-x R" while editing block "*bar*" does create session
> "*bar*" with correct name.
>
> After sessions "foo" and "*bar*" have both been created, doing C-' and
> then ess-eval-line will evaluate in the correct session.

The only workaround, which is not ideal, is to start ESS process
unconditionally. We'd like this to change.

> It's annoying there's no way to tell ESS to start new session instead of
> evaluating in existing one. Here are a few alternatives we could
> consider to deal with this:
>
> 1. Change the worg/ORG-NEWS, to suggest users make sure the session
> exists (either by evaluating a source block or call "M-x R" in edit
> block) before running ess-eval-line.
>
> 2. Add ob-R and ob-julia customization options (as previously suggested)
> to explicitly control the startup behavior (either to auto-start, or not).
>
> 3. Submit PR to ESS to add a variable we could let-bind, to force it to
> start an associated session rather than evaluate in an existing
> non-associated sessions.
>
> Currently I lean towards a combination of #1 and #3, but am not sure,
> and happy to go with whatever you think is best.

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


___
ESS-core list: 

[BUG] Bug in parser [9.7 (9.7-??-57b94f344 @ /home/jose/.config/emacs/.local/straight/build-29.1/org/)]

2024-01-12 Thread Jose Salazar
This bug often happens when I load things (such as loading a literate agda
program -- "*.lagda.org", or rendering inline latex, e.g. $x = x^2$).

I'm using Doom and NixOS.
It doesn't actively disrupt my workflow (only that a window is opened)

The message is the following:
⛔ Warning (org-element): org-element--cache: Org parser error in
 concepts.lagda.org::#. Resetting.
 The error was: (error "org-element--cache: Emergency exit")
 Backtrace:
"  backtrace-to-string(nil)
  org-element-at-point(#)
  org-element-cache-map(#f(compiled-function (el) #) :next-re \"^*+ \" :fail-re \"^*+ \" :narrow t)
  org-scan-tags(org-encrypt-entry (lambda (todo tags-list level) (progn
(setq org-cached-props nil) (or (and (member \"crypt\" tags-list) nil)
  org-encrypt-entries()
  run-hooks(before-save-hook)
  #(nil)
  polymode-with-current-base-buffer(# nil)
  apply(polymode-with-current-base-buffer # nil)
  basic-save-buffer(nil)
  #()
  funcall(#)
  (let ((apheleia-mode (and apheleia-mode (memq arg '(nil 1) (funcall
orig-fn))
  +format--inhibit-reformat-on-prefix-arg-a(# 1)
  apply(+format--inhibit-reformat-on-prefix-arg-a # 1)
  save-buffer(1)
  funcall-interactively(save-buffer 1)
  command-execute(save-buffer)
"

The buffer is the following:
```
#+title: A

#+begin_src agda2
data S : Set where
  null : S

a : S
#+end_src
```

The bug often happens after loading (and this specific instance happened
when loading with agda)

This is the doom info:
```
generated  Jan 07, 2024 15:15:52
system NixOS 23.11pre550792.3f21a22b5aaf (Tapir) Linux
  6.1.62 x86_64
emacs  29.1 ~/.config/emacs/
doom   3.0.0-pre PROFILE=_@0 HEAD -> master 03d692f1
  2023-12-08 15:11:45 -0500 ~/.config/doom/
shell  /run/current-system/sw/bin/bash
features   CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM
  GSETTINGS HARFBUZZ JPEG JSON LIBOTF LIBSELINUX
  LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP
  NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND
  SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS
  TREE_SITTER WEBP X11 XAW3D XDBE XIM XINPUT2 XPM
  LUCID ZLIB
traits batch server-running envvar-file custom-file
modules:config use-package :completion company vertico
  :ui doom doom-dashboard doom-quit (emoji +unicode)
  hl-todo ligatures minimap modeline ophints (popup
  +defaults) tabs treemacs unicode (vc-gutter
  +pretty) vi-tilde-fringe workspaces zen :editor
  (evil +everywhere) file-templates fold (format
  +onsave) lispy snippets :emacs dired electric undo
  vc :term eshell vterm :checkers syntax (spell
  +flyspell) grammar :tools biblio collab
  editorconfig ein (eval +overlay) gist lookup (lsp
  +peek) magit make pdf tmux tree-sitter :lang agda
  (cc +lsp) common-lisp coq data emacs-lisp (go
  +lsp) (haskell +lsp) idris (json +lsp) (javascript
  +lsp) (julia +lsp) latex lean markdown nix (org
  +dragndrop +pretty +roam2) (python +lsp) (racket
  +lsp +xp) (rust +lsp) scheme (sh +fish +lsp) :app
  calendar :config (default +bindings +smartparens)
packages   (polymode) (org-agda-mode :recipe (:host github
  :repo alhassy/org-agda-mode))
```





Emacs  : GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
version 1.18.0, Xaw3d scroll bars)
Package: Org mode version 9.7 (9.7-??-57b94f344 @
/home/jose/.config/emacs/.local/straight/build-29.1/org/)

current state:
==
(setq
 org-link-elisp-confirm-function nil
 org-directory "~/org/"
 org-cite-insert-processor 'citar
 org-after-refile-insert-hook '(save-buffer)
 org-indirect-buffer-display 'current-window
 org-roam-db-gc-threshold 2305843009213693951
 org-crypt-key nil
 org-bibtex-headline-format-function 'org-bibtex-headline-format-default
 org-roam-mode-hook '(+org-roam-detach-magit-section-mode-map-h
  turn-on-visual-line-mode)
 org-load-hook '(+org-init-org-directory-h +org-init-appearance-h
+org-init-agenda-h
 +org-init-attachments-h +org-init-babel-h
 +org-init-babel-lazy-loader-h +org-init-capture-defaults-h
 +org-init-capture-frame-h +org-init-custom-links-h
 +org-init-export-h +org-init-habit-h +org-init-hacks-h
 +org-init-keybinds-h +org-init-popup-rules-h
+org-init-smartparens-h
 +org-init-roam-h)
 org-startup-folded nil
 org-babel-after-execute-hook
'(+org-redisplay-inline-images-in-babel-result-h)
 org-link-abbrev-alist '(("doomdir" . "/home/jose/.config/doom/%s")
 ("emacsdir" . "/home/jose/.config/emacs/%s")
 ("doom-repo" . "
https://github.com/doomemacs/doomemacs/%s;)
 ("wolfram" . "https://wolframalpha.com/input/?i=%s
")
 ("wikipedia" . "https://en.wikipedia.org/wiki/%s;)
 ("duckduckgo" . "https://duckduckgo.com/?q=%s;)
 ("gmap" . "https://maps.google.com/maps?q=%s;)
 ("gimages" . 

Re: [FR] Add buffer-local setting to request specific ESS process/session name (was: [PATCH] Set Python shell in Org edit buffer)

2024-01-12 Thread Sparapani, Rodney
Oops!  Sorry, I misread the signature.  That should be…

Hi Ihor:

Do you have a patch?  I’m not an org-mode user so I can’t test this myself.
Thanks

--
Rodney Sparapani, Associate Professor of Biostatistics, He/Him/His
Vice President, Wisconsin Chapter of the American Statistical Association
Institute for Health and Equity, Division of Biostatistics
Medical College of Wisconsin, Milwaukee Campus

From: Sparapani, Rodney 
Date: Wednesday, January 10, 2024 at 1:14 PM
To: Ihor Radchenko , Jack Kamm , 
ess-c...@r-project.org 
Cc: Liu Hui , emacs-orgmode@gnu.org 

Subject: Re: [FR] Add buffer-local setting to request specific ESS 
process/session name (was: [PATCH] Set Python shell in Org edit buffer)
Hi Jack:

Do you have a patch?  I’m not an org-mode user so I can’t test this myself.
Thanks

--
Rodney Sparapani, Associate Professor of Biostatistics, He/Him/His
Vice President, Wisconsin Chapter of the American Statistical Association
Institute for Health and Equity, Division of Biostatistics
Medical College of Wisconsin, Milwaukee Campus

From: ESS-core  on behalf of Ihor Radchenko 

Date: Wednesday, January 10, 2024 at 6:15 AM
To: Jack Kamm , ess-c...@r-project.org 

Cc: Liu Hui , emacs-orgmode@gnu.org 

Subject: [FR] Add buffer-local setting to request specific ESS process/session 
name (was: [PATCH] Set Python shell in Org edit buffer)
ATTENTION: This email originated from a sender outside of MCW. Use caution when 
clicking on links or opening attachments.


Hi,

I'd like to request a new ESS feature that will allow to choose which
session is created by ESS when no session is yet associated with a
buffer.

Currently, `ess-request-a-process' unconditionally re-uses an existing
ESS process with appropriate `ess-dialect', even when such process is
not consistent with `ess-gen-proc-buffer-name-function'.

This behavior puts Org mode's ESS support in somewhat difficult position
- Org mode allows multiple sessions in Org src blocks, and we want some
way to tell ESS which session process to use for any given buffer
without actually starting that process manually.
We had a hope that setting `ess-gen-proc-buffer-name-function' would
suffice and that ESS would start a new process according to
`ess-gen-proc-buffer-name-function' when no process is yet associated
with buffer. But it is not the case.

Some more context:
(full thread is in
)

Jack Kamm  writes:

> I tested the patch (plus the additional change to org-src.el), with an
> Org file with following 2 blocks:
>
> #+begin_src R :session foo :results output
>   print('foo')
> #+end_src
>
> #+begin_src R :session *bar* :results output
>   print('bar')
> #+end_src

These are two R blocks that should be associated with two different ESS
R processes.

> On block "foo", I did C-', and then ess-eval-line. It creates a session
> named "foo", as expected.

When we edit the first block and when no ESS process is available,
`ess-eval-line' respects `ess-gen-proc-buffer-name-function' set by Org
mode, and creates a new ESS process "foo".

> On block "*bar*", I did the same. It does not create session named
> "*bar*", instead evaluating in session "foo". It seems ESS will always
> assume you want to evaluate in existing session if one exists, rather
> than start a new associated session, and it seems there is no way to
> tell it to behave otherwise.

But when the "foo" process is already running, despite different
`ess-gen-proc-buffer-function', `ess-eval-line' connects to the existing
"foo" process rather than "*bar*", as we anticipated.

> However, calling "M-x R" while editing block "*bar*" does create session
> "*bar*" with correct name.
>
> After sessions "foo" and "*bar*" have both been created, doing C-' and
> then ess-eval-line will evaluate in the correct session.

The only workaround, which is not ideal, is to start ESS process
unconditionally. We'd like this to change.

> It's annoying there's no way to tell ESS to start new session instead of
> evaluating in existing one. Here are a few alternatives we could
> consider to deal with this:
>
> 1. Change the worg/ORG-NEWS, to suggest users make sure the session
> exists (either by evaluating a source block or call "M-x R" in edit
> block) before running ess-eval-line.
>
> 2. Add ob-R and ob-julia customization options (as previously suggested)
> to explicitly control the startup behavior (either to auto-start, or not).
>
> 3. Submit PR to ESS to add a variable we could let-bind, to force it to
> start an associated session rather than evaluate in an existing
> non-associated sessions.
>
> Currently I lean towards a combination of #1 and #3, but am not sure,
> and happy to go with whatever you think is best.

--

Tableofcontents

2024-01-12 Thread Horst Leps
(I use Emacs 28, Mac-Mini Apple M2, Sonoma 14.2.1)

Since a few days: Orgmode export to Latex only creates one Latex run, so that 
the table of contents remains empty and no longer shows any sections. - What to 
do? Horst


Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]

2024-01-12 Thread Ihor Radchenko
Eli Zaretskii  writes:

>> I think that I see what you mean. What we can do to achieve this is
>> changing `kill-line-query-function' into abnormal hook
>> `kill-line-query-functions'. Then, `kill-line'/`kill-whole-line' will
>> use (run-hook-with-args-until-success 'kill-line-query-functions) to
>> decide whether to show a query.
>> 
>> Does it make sense?
>
> It might, yes.  But do we have to _replace_ the hook? cannot we have
> both?  I.e. if the new one is defined, call it, otherwise call the old
> one.  That would be more backward-compatible, I think.

May you please elaborate what you mean by "old one"?

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



Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]

2024-01-12 Thread Eli Zaretskii
> From: Ihor Radchenko 
> Cc: monn...@iro.umontreal.ca, emacs-orgmode@gnu.org, 65...@debbugs.gnu.org,
>  maniku...@gmail.com, i...@whxvd.name
> Date: Fri, 12 Jan 2024 12:24:01 +
> 
> Eli Zaretskii  writes:
> 
> >> Then, Org mode can instead have
> >> 
> >> (setq-local kill-line-query-function #'org-kill-line-query)
> >> (defun org-kill-line-query (beg end)
> >>   (org-with-point-at beg
> >> (when (and (org-at-heading-p)
> >>(progn
> >>  (end-of-line)
> >>  (and (< (point) end)
> >>   (org-fold-folded-p
> >>"Kill hidden subtree along with headline? ")))
> >
> > I don't know what org-with-point-at and org-fold-folded-p do, but my
> > point is that you should consider the case when kill-line kills
> > invisible text that has nothing to do with Org's headings and trees,
> > so I suggest to either make the detection code smarter (so it could
> > distinguish between the two), or make the prompt text vaguer (to not
> > claim that the text must be a subtree).
> >
> > And if that is still not clear or you disagree, let's leave it at
> > that.
> 
> I think that I see what you mean. What we can do to achieve this is
> changing `kill-line-query-function' into abnormal hook
> `kill-line-query-functions'. Then, `kill-line'/`kill-whole-line' will
> use (run-hook-with-args-until-success 'kill-line-query-functions) to
> decide whether to show a query.
> 
> Does it make sense?

It might, yes.  But do we have to _replace_ the hook? cannot we have
both?  I.e. if the new one is defined, call it, otherwise call the old
one.  That would be more backward-compatible, I think.



Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]

2024-01-12 Thread Ihor Radchenko
Eli Zaretskii  writes:

>> Then, Org mode can instead have
>> 
>> (setq-local kill-line-query-function #'org-kill-line-query)
>> (defun org-kill-line-query (beg end)
>>   (org-with-point-at beg
>> (when (and (org-at-heading-p)
>>(progn
>>  (end-of-line)
>>  (and (< (point) end)
>>   (org-fold-folded-p
>>"Kill hidden subtree along with headline? ")))
>
> I don't know what org-with-point-at and org-fold-folded-p do, but my
> point is that you should consider the case when kill-line kills
> invisible text that has nothing to do with Org's headings and trees,
> so I suggest to either make the detection code smarter (so it could
> distinguish between the two), or make the prompt text vaguer (to not
> claim that the text must be a subtree).
>
> And if that is still not clear or you disagree, let's leave it at
> that.

I think that I see what you mean. What we can do to achieve this is
changing `kill-line-query-function' into abnormal hook
`kill-line-query-functions'. Then, `kill-line'/`kill-whole-line' will
use (run-hook-with-args-until-success 'kill-line-query-functions) to
decide whether to show a query.

Does it make sense?

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



Re: bug#66291: [Leo Vivier] [PATCH] orgalist: Update bug:31361 workaround for new upstream signature

2024-01-12 Thread Ihor Radchenko
Nicolas Goaziou  writes:

> To answer Ihor's question : I'm out of touch concerning Org development,
> so maintaining a package such as Orgalist may be problematic at some
> point, indeed.

Then, may we need to ask someone to help maintaining orgalist?
Similar question about a number of Org mode libraries where you are
listed as a maintainer.

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



Re: org-agenda + [a] generated many duplicated task entries

2024-01-12 Thread Ihor Radchenko
"Christopher M. Miles"  writes:

> When I execute command "org-agenda" with key "[a]" to generate
> org-agenda day view. Many task entries are duplicated.

Maybe you have something in
`org-agenda-skip-scheduled-if-deadline-is-shown' or similar customization.

> I tried many methods trying to figure out the problem reason.
>
> - [X] Emacs init bisect
> - [X] Emacs minimal init testing -> no problem

These two mean that you missed something during bisection.

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



Re: [fr] org-copy-subtree or so with no header

2024-01-12 Thread Ihor Radchenko
Samuel Wales  writes:

> idk if 2 is a bug vs. overly strict behavior.  org-export-with-tasks
> is technically doing what it is documented to do.  but only
> technically.
>
> it is not useful to me for it to fail to export when you explicitly
> try to export a subtree that is forbidden by the combinatin of o-e-w-t
> and the kw at top.

I still do not understand what problem you are talking about.

I tried

#+EXCLUDE_TAGS: foo
#+options: tasks:nil
* TODO  This is test :foo:
** Bar
** Baz
text

Then, I C-c C-e C-s t U and I got the subtree exported even though the
exported heading has both todo keyword and the excluded tag.

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



Re: [PATCH v6] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`

2024-01-12 Thread Ihor Radchenko
"Christopher M. Miles"  writes:

> Thanks for updating, this patch looks great to me.

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

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



[ob-clojure] Clojure sessions in Org Src buffers (was: [PATCH] Set Python shell in Org edit buffer)

2024-01-12 Thread Ihor Radchenko
"Christopher M. Miles"  writes:

>> (or (org-babel-comint-buffer-livep session)
>> (eq org-src-auto-initiate-session t)
>> (alist-get (nth 0 info) org-src-auto-initiate-session)
>> (alist-get 'default org-src-auto-initiate-session))
>>
>> With `org-src-auto-initiate-session' being a customization that controls
>> whether to associate session for a given babel backend.
>>
>> We may set the default value to something like
>>
>> ((default . t) ("R" . nil))
>
> I think this customization is reasonable.

Note that we are trying an alternative route with asking upstream ESS
devs to provide a way to associate session without starting it.

>  ... Agree to make it as a
> customization option, The ob-clojure CIDER session which managed by
> "sesman" seems also requires buffer associate with session.

AFAIK, ob-clojure does not support sessions inside Org Src buffers -
there is no `org-babel-associate-clojure-session' or
`org-babel-edit-prep:clojure'.

I am not sure if it is possible to interact with all the supported
Clojure REPLs from inside Org Src blocks.

CCing Daniel - the ob-clojure maintainer.

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



Re: ob-shell: proposal to remove "posh"

2024-01-12 Thread Morgan Willcock
Matt  writes:

> AFAIKT, both PowerShell and cmd are MIT licensed:
> - https://github.com/microsoft/terminal
> - https://github.com/PowerShell/PowerShell
>
> The thought of compiling either for a GNU system is...ugh.  But maybe someone 
> else has gotten them working?  Otherwise, it looks like Microsoft distributes 
> a developer VM image of Windows.
>
> All together, this means there's no *technical* barrier preventing us from 
> running (and hence developing for) PowerShell or cmd.

As I understand it, the code for the cmd.exe shell is not released
anywhere.

What is in the "terminal" repository mentioned above is the code for the
console host process conhost.exe, which is the server process used to
host the shell process and present it (i.e. this is the terminal and not
the shell).

That said, I imagine Wine does contain its own implementation of
cmd.exe, although I wouldn't expect it to be 100% compatible with the
real thing.

-- 
Morgan Willcock