Re: Bug: org-latex-export-to-pdf does not remove .tex file [9.4 (9.4-elpa @ /home/bruno/.emacs.d/elpa/org-9.4/)]

2023-02-15 Thread Hanno Perrey
Bruno BEAUFILS  skrev: (15 februari 2023 21:38:55 CET)
>On Wed, Feb 15, 2023 at 09:34:21AM -1000, Thomas S. Dye wrote:
>> I often use the .tex file to track down compilation issues.  I don't want
>> Org to delete it.
>
>I get your point. In that case the file must not be removed when the
>compilation failed.
>
>In all other (more numerous) cases (when everything went well) what is
>the point to have this file in addition to the source and the output?
>
>-- 
>Bruno BEAUFILS

I see the export to PDF as a shortcut only and appreciate having the .tex file 
besides it. As the TeX file is the most reliable way to regenerate the exact 
PDF again later again (even on other peoples' machines without Emacs installed) 
I like to keep it in many cases "for the record".

I would personally opt for keeping the current default, that is keeping the TeX 
file.



Re: [PATCH] Async evaluation in ob-shell

2023-02-15 Thread Matt


  On Wed, 15 Feb 2023 10:08:47 -0500  Ihor Radchenko  wrote --- 
 > Matt m...@excalamus.com> writes:
 > 
 > > Checking the final result from the callback is trickier.   The following 
 > > works, but requires advice (which could potentially persist beyond the 
 > > test) and a delay (which slows testing overall and whose duration likely 
 > > depends on the hardware the test runs on).  Without the delay, I could not 
 > > get the callback to execute within the test.  It would execute when 
 > > running manually in an Org buffer, however.  I'm not sure why. 
 > 
 > Doesn't (while ... (sleep-for ...)) work?

I'm afraid I don't follow what you mean.

My biggest concern is the sleep-for itself.  Aside from the concerns above, the 
test doesn't work without it. 

For example, the check made by the advice looks for "1\n2\n".  I've changed the 
source block from "echo 1" to "echo 2"  to induce a failure (it will now 
receive "2\n2\n").  I re-evaluate the test and call M-: (ert 
"test-ob-shell/session-async-evaluation").  The test passes!  I can put a 
message or debug in the advice and see that it's never called.  However, if I 
uncomment the sleep-for, the advice runs, and the test fails as expected.

(ert-deftest test-ob-shell/session-async-evaluation ()
  (let ((session-name "test-ob-shell/session-async-evaluation")
(kill-buffer-query-functions nil)
result)
;; check callback return for correct results
(advice-add
 'ob-shell-async-chunk-callback
 :filter-return
 (lambda ( r)
   (let ((result (car r)))
 (should (string= result "1\n2\n"))  ; this was previously an if 
statement
 result))
 `((name . ,session-name)))
;; always remove advice, regardless of test outcome
(unwind-protect
(org-test-with-temp-text
(concat "#+begin_src sh :session " session-name " :async t
echo 2
echo 2
#+end_src")
  ;; execute block; callback only executes when delay
  (setq result (org-trim (org-babel-execute-src-block)))
  (if (should
   (and 
(string-match test-ob-shell/uuid-regex result)  ; block runs
(not (sleep-for 0.1))   ; callback 
doesn't fail
)) 
  (kill-buffer session-name)))
  (advice-remove 'ob-shell-async-chunk-callback session-name






Re: [BUG] Incorrect display of folded headings after cycling with subheading with VISIBILITY content/children

2023-02-15 Thread Daniel Hubmann
Ah, my bad. Got confused. The output above set according to the properties
is correct.

Thanks a lot for the fast fix.

On Wed, Feb 15, 2023 at 11:26 PM Daniel Hubmann  wrote:

> Thanks for the partial fix.
>
> Unfortunately there is still something strange going on as the last
> heading gets hidden. Added some more headings to demonstrate this better:
>
> This is the unfolded file content:
>
> * Heading Lvl 1
> ** Heading Lvl 2 with VISIBILITY content
> :PROPERTIES:
> :VISIBILITY: content
> :END:
> *** Heading Lvl 3
> ** Another Heading Lvl 2
> * Formulas
> ** New Ones
> *** LET
> *** LAMBDA
> :PROPERTIES:
> :VISIBILITY: content
> :END:
> *** XMATCH
> *** XLOOKUP
> * Dynamic Array Formulas
>
> After using org-cycle-content followed by
> org-cycle-set-visibility-according-to-property I get this:
>
> * Heading Lvl 1
> ** Heading Lvl 2 with VISIBILITY content...
> *** Heading Lvl 3...
> * Formulas
> *** LAMBDA
> * Dynamic Array Formulas
>
> Whereas the expected output should look as follows:
>
> * Heading Lvl 1
> ** Heading Lvl 2 with VISIBILITY content
> *** Heading Lvl 3
> *** Another Heading Lvl 2 (missing)*
> * Formulas
>
> *** New Ones (missing)*** LET **(missing)*
> *** LAMBDA
>
>  XMATCH (missing)*** XLOOKUP* *(missing)*
> * Dynamic Array Formulas
>
> Setting org-fold-core-style to overlays doesn't change the outcome.
>
> On Wed, Feb 15, 2023 at 4:30 PM Ihor Radchenko 
> wrote:
>
>> Daniel Hubmann  writes:
>>
>> > * Heading Lvl 1...** Heading Lvl 2 with VISIBILITY content...
>> > *** Heading Lvl 3...
>>
>> Thanks for reporting!
>> Fixed, on bugfix.
>> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=be9280f68
>>
>> --
>> Ihor Radchenko // yantar92,
>> Org mode contributor,
>> Learn more about Org mode at .
>> Support Org development at ,
>> or support my work at 
>>
>


Re: [BUG] Incorrect display of folded headings after cycling with subheading with VISIBILITY content/children

2023-02-15 Thread Daniel Hubmann
Thanks for the partial fix.

Unfortunately there is still something strange going on as the last heading
gets hidden. Added some more headings to demonstrate this better:

This is the unfolded file content:

* Heading Lvl 1
** Heading Lvl 2 with VISIBILITY content
:PROPERTIES:
:VISIBILITY: content
:END:
*** Heading Lvl 3
** Another Heading Lvl 2
* Formulas
** New Ones
*** LET
*** LAMBDA
:PROPERTIES:
:VISIBILITY: content
:END:
*** XMATCH
*** XLOOKUP
* Dynamic Array Formulas

After using org-cycle-content followed by
org-cycle-set-visibility-according-to-property I get this:

* Heading Lvl 1
** Heading Lvl 2 with VISIBILITY content...
*** Heading Lvl 3...
* Formulas
*** LAMBDA
* Dynamic Array Formulas

Whereas the expected output should look as follows:

* Heading Lvl 1
** Heading Lvl 2 with VISIBILITY content
*** Heading Lvl 3
*** Another Heading Lvl 2 (missing)*
* Formulas

*** New Ones (missing)*** LET **(missing)*
*** LAMBDA

 XMATCH (missing)*** XLOOKUP* *(missing)*
* Dynamic Array Formulas

Setting org-fold-core-style to overlays doesn't change the outcome.

On Wed, Feb 15, 2023 at 4:30 PM Ihor Radchenko  wrote:

> Daniel Hubmann  writes:
>
> > * Heading Lvl 1...** Heading Lvl 2 with VISIBILITY content...
> > *** Heading Lvl 3...
>
> Thanks for reporting!
> Fixed, on bugfix.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=be9280f68
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


Re: Cannot expand macros through included org file

2023-02-15 Thread Nick Dokos
reza  writes:

> Hi Ihor
>
> Thanks for your quick reply
>
>> What you can do instead is creating a named Org paragraph with macro,
>> like
>>
>> #+name: year
>> {{{year}}}
>
> I tried this approach but it does not seem to work either:
>
> "template.org":
>
>#+TITLE: Report
>#+NAME: year
>
>{{{year}}}
>

There should be no empty line between `#+NAME: year' and `{{{year}}}'.

There is a `+' missing at the end of the python code block.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Cannot expand macros through included org file

2023-02-15 Thread reza

> It works, but Org does not include variable assignments to exported code
> by default. See org-babel-exp-code-template. The assignment would be
> done if you execute the blocks though.

So I have to set this variable to true?

> Note that year will have a value of "2019\n" with trailing newline.

hm this is unfortunate...

> Yet another approach is including common :var year=2009 header arg.

what do you mean by common? I want to have a report for the years 
2019-2022 for example.



OpenPGP_0xC375C6AF05125C52.asc
Description: application/pgp-keys


OpenPGP_signature
Description: PGP signature


Re: Cannot expand macros through included org file

2023-02-15 Thread Ihor Radchenko
reza  writes:

>> What you can do instead is creating a named Org paragraph with macro,
>> like
>> 
>> #+name: year
>> {{{year}}}
>
> I tried this approach but it does not seem to work either:

It works, but Org does not include variable assignments to exported code
by default. See org-babel-exp-code-template. The assignment would be
done if you execute the blocks though.

Note that year will have a value of "2019\n" with trailing newline.
Yet another approach is including common :var year=2009 header arg.

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



Re: Cannot expand macros through included org file

2023-02-15 Thread reza
Hi Ihor

Thanks for your quick reply

> What you can do instead is creating a named Org paragraph with macro,
> like
> 
> #+name: year
> {{{year}}}

I tried this approach but it does not seem to work either:

"template.org":

   #+TITLE: Report
   #+NAME: year
   {{{year}}}

   * My headline

   #+BEGIN_SRC bash :var year=year
 ./get_log_file --start=$year-01-01 --end=$year-12-31
   #+END_SRC

   #+BEGIN_SRC python :var year=year
 log = pd.read_csv(f"log_{year}.csv")
   #END_SRC

"report_2019.org":

#+TITLE: Report 2019
#+MACRO: year 2019

#+INCLUDE: "template.org" :lines "2-"

Cheers,
Reza


OpenPGP_0xC375C6AF05125C52.asc
Description: application/pgp-keys


OpenPGP_signature
Description: PGP signature


Re: Bug: org-latex-export-to-pdf does not remove .tex file [9.4 (9.4-elpa @ /home/bruno/.emacs.d/elpa/org-9.4/)]

2023-02-15 Thread Alain . Cochard
Bruno BEAUFILS writes on Wed 15 Feb 2023 21:38:

 > In all other (more numerous) cases (when everything went well) what
 > is the point to have this file in addition to the source and the
 > output?

Sometimes I select a part of the .tex and send it to someone who does
not use Org mode, for inclusion into his own tex file.  One can also
think about doing things that are not (yet) possible with Org mode (or
that one does not know how to do).

-- 
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 ]




Re: Cannot expand macros through included org file

2023-02-15 Thread Ihor Radchenko
reza  writes:

>#+BEGIN_SRC bash :file log_{{{year}}}.csv
>  ./get_log_file --start={{{year}}}-01-01 --end={{{year}}}-12-31
>#+END_SRC
>
>#+BEGIN_SRC python
>  log = pd.read_csv("log_{{{year}}}.csv")
>#END_SRC
> ...
> But that does not seem to work. It looks like the macro expansion does 
> not happen for included content. Is this a bug or correct behavior, what 
> would be the approach to not repeat the content for several reports?

Macro expansion only works inside Org proper markup.
Macros are only recognized withing non-verbatim contexts.
Src blocks are considered verbatim and macros are not expanded there.
Otherwise, Org would risk interfering with proper programming language
syntax.

What you can do instead is creating a named Org paragraph with macro,
like

#+name: year
{{{year}}}

and then refer to it via variable assignments.

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



Re: Bug: org-latex-export-to-pdf does not remove .tex file [9.4 (9.4-elpa @ /home/bruno/.emacs.d/elpa/org-9.4/)]

2023-02-15 Thread Bruno BEAUFILS
On Wed, Feb 15, 2023 at 09:34:21AM -1000, Thomas S. Dye wrote:
> I often use the .tex file to track down compilation issues.  I don't want
> Org to delete it.

I get your point. In that case the file must not be removed when the
compilation failed.

In all other (more numerous) cases (when everything went well) what is
the point to have this file in addition to the source and the output?

-- 
Bruno BEAUFILS


signature.asc
Description: PGP signature


Re: Bug: org-latex-export-to-pdf does not remove .tex file [9.4 (9.4-elpa @ /home/bruno/.emacs.d/elpa/org-9.4/)]

2023-02-15 Thread Ihor Radchenko
Bruno BEAUFILS  writes:

> When using the org-latex-export-to-pdf on any foo.org file I get the
> foo.pdf file produced the right way but I also get the foo.tex file.
>
> I think that the whole point of exporting to pdf is only to get the pdf
> file, avoiding the need to keep the latex one.
>
> I guess that one of org-latex-compile or org-latex-export-to-pdf
> function should remove the source LaTeX file if the compile went well.

The problem with LaTeX export is that it is not always possible to know
if the process truly finished without errors or not.

I guess we might make this a user options, if more people are
interested.

Meanwhile, you can tweak org-latex-logfiles-extensions adding "tex".

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



Cannot expand macros through included org file

2023-02-15 Thread reza
Hi List

I have the following setup:
In "template.org" is the structure of a report defined which I need to 
generate for several years, e.g:

   #+TITLE: Report

   * My headline

   #+BEGIN_SRC bash :file log_{{{year}}}.csv
 ./get_log_file --start={{{year}}}-01-01 --end={{{year}}}-12-31
   #+END_SRC

   #+BEGIN_SRC python
 log = pd.read_csv("log_{{{year}}}.csv")
   #END_SRC

Now I want to generate a report for different years, my approach was now 
to have a file "report_2019.org" like:

   #+TITLE: Report 2019
   #+MACRO: year 2019

   #+INCLUDE: "template.org" :lines "2-"


But that does not seem to work. It looks like the macro expansion does 
not happen for included content. Is this a bug or correct behavior, what 
would be the approach to not repeat the content for several reports?

Thanks for your inputs.

Cheers,
Reza


OpenPGP_0xC375C6AF05125C52.asc
Description: application/pgp-keys


OpenPGP_signature
Description: PGP signature


Re: [PATCH 0/4] Structure editing when region is active

2023-02-15 Thread Ihor Radchenko
Rudolf Adamkovič  writes:

> P.S. It took me a while to get all this because I do not use (nor have, for 
> that
> matter) arrow keys, and those nonsensical function names mean absolutely 
> nothing
> to me.

If you have ideas about good alternative names for these functions,
please share them.

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



Re: Bug: org-latex-export-to-pdf does not remove .tex file [9.4 (9.4-elpa @ /home/bruno/.emacs.d/elpa/org-9.4/)]

2023-02-15 Thread Thomas S. Dye



Bruno BEAUFILS  writes:


[[PGP Signed Part:Undecided]]
When using the org-latex-export-to-pdf on any foo.org file I get 
the
foo.pdf file produced the right way but I also get the foo.tex 
file.


I think that the whole point of exporting to pdf is only to get 
the pdf

file, avoiding the need to keep the latex one.

I guess that one of org-latex-compile or org-latex-export-to-pdf
function should remove the source LaTeX file if the compile went 
well.




Emacs  : GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ 
Version 3.24.24, cairo version 1.16.0)

 of 2021-03-28, modified by Debian
Package: Org mode version 9.4 (9.4-elpa @ 
/home/bruno/.emacs.d/elpa/org-9.4/)


I often use the .tex file to track down compilation issues.  I 
don't want Org to delete it.


All the best,
Tom

--
Thomas S. Dye
https://tsdye.online/tsdye



Bug: org-latex-export-to-pdf does not remove .tex file [9.4 (9.4-elpa @ /home/bruno/.emacs.d/elpa/org-9.4/)]

2023-02-15 Thread Bruno BEAUFILS
When using the org-latex-export-to-pdf on any foo.org file I get the
foo.pdf file produced the right way but I also get the foo.tex file.

I think that the whole point of exporting to pdf is only to get the pdf
file, avoiding the need to keep the latex one.

I guess that one of org-latex-compile or org-latex-export-to-pdf
function should remove the source LaTeX file if the compile went well.



Emacs  : GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, 
cairo version 1.16.0)
 of 2021-03-28, modified by Debian
Package: Org mode version 9.4 (9.4-elpa @ /home/bruno/.emacs.d/elpa/org-9.4/)

-- 
Bruno BEAUFILS


signature.asc
Description: PGP signature


Re: [PATCH 0/4] Structure editing when region is active

2023-02-15 Thread Rudolf Adamkovič
Ihor Radchenko  writes:

> They indeed do not. Only on selected list items. Patches welcome!

Oh, wait I see.  Non-recursive manipulation (l/r) works with marked regions but
recursive manipulation (L/R) does not work yet.  Then, it all behaves correctly
and "patches welcome" makes sense (to make it work in both cases).  Gotcha!

P.S. It took me a while to get all this because I do not use (nor have, for that
matter) arrow keys, and those nonsensical function names mean absolutely nothing
to me.

Rudy
-- 
"Chop your own wood and it will warm you twice."
-- Henry Ford; Francis Kinloch, 1819; Henry David Thoreau, 1854

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



Re: [PATCH] ox-texinfo: Fix invalid syntax in Texinfo version detection code

2023-02-15 Thread Rudolf Adamkovič
Max Nikulin  writes:

> Since content of subr-x.el consists of `defsubst' definitions, likely it 
> is preferable to use
>
>  (eval-when-compile (require 'subr-x))

All right, I added the 'require' to both files.  Better?

Rudy

>From 384515548a4eb790e9b947e484dd9da41bdece94 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= 
Date: Mon, 6 Feb 2023 22:33:40 +0100
Subject: [PATCH] ox-texinfo: Fix invalid syntax in Texinfo version detection
 code

* lisp/ox-texinfo.el (org-texinfo-supports-math-p): Fix the incorrect
syntax @displaymath{1 + 1 = 2} used to detect whether Texinfo supports
TeX "math mode".  Instead, use the correct syntax @math{1 + 1 = 2}.
---
 lisp/ox-texinfo.el  | 16 ++--
 testing/lisp/test-ox-texinfo.el | 32 
 2 files changed, 42 insertions(+), 6 deletions(-)

diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el
index 8e3a04562..4ff482cc3 100644
--- a/lisp/ox-texinfo.el
+++ b/lisp/ox-texinfo.el
@@ -32,6 +32,8 @@
 (require 'cl-lib)
 (require 'ox)
 
+(eval-when-compile (require 'subr-x))
+
 (defvar orgtbl-exp-regexp)
 (defvar org-texinfo-supports-math--cache)
 
@@ -2025,12 +2027,14 @@ Once computed, the results remain cached."
   (unless (boundp 'org-texinfo-supports-math--cache)
 (setq org-texinfo-supports-math--cache
   (let ((math-example "1 + 1 = 2"))
-(let* ((input-file
-(make-temp-file "test" nil ".info"))
-   (input-content
-(concat (format "@setfilename %s" input-file) "\n"
-"@node Top" "\n"
-(format "@displaymath{%s}" math-example) "\n")))
+(let* ((input-file (make-temp-file "test" nil ".info"))
+   (input-content (string-join
+   (list (format "@setfilename %s" input-file)
+ "@node Top"
+ "@displaymath"
+ math-example
+ "@end displaymath")
+   "\n")))
   (with-temp-file input-file
 (insert input-content))
   (let* ((output-file (org-texinfo-compile input-file))
diff --git a/testing/lisp/test-ox-texinfo.el b/testing/lisp/test-ox-texinfo.el
index 51fdb3606..38395500d 100644
--- a/testing/lisp/test-ox-texinfo.el
+++ b/testing/lisp/test-ox-texinfo.el
@@ -24,6 +24,8 @@
 (require 'cl-lib)
 (require 'ox-texinfo)
 
+(eval-when-compile (require 'subr-x))
+
 (unless (featurep 'ox-texinfo)
   (signal 'missing-test-dependency "org-export-texinfo"))
 
@@ -292,5 +294,35 @@
  nil
  '(:with-latex t))
 
+
+;;; End-to-end
+
+(ert-deftest test-ox-texinfo/end-to-end-inline ()
+  "Test end-to-end with inline TeX fragment."
+  (should
+   (org-test-with-temp-text
+"$a^2 = b$"
+(let ((export-buffer "*Test Texinfo Export*")
+  (org-export-show-temporary-export-buffer nil))
+  (org-export-to-buffer 'texinfo export-buffer
+nil nil nil nil nil
+#'texinfo-mode)
+
+(ert-deftest test-ox-texinfo/end-to-end-sanity-check-displayed ()
+  "Test end-to-end with LaTeX environment."
+  (should
+   (org-test-with-temp-text
+(string-join
+ (list "\\begin{equation}"
+   "a ^ 2 = b"
+   "b ^ 2 = c"
+   "\\end{equation}")
+ "\n")
+(let ((export-buffer "*Test Texinfo Export*")
+  (org-export-show-temporary-export-buffer nil))
+  (org-export-to-buffer 'texinfo export-buffer
+nil nil nil nil nil
+#'texinfo-mode)
+
 (provide 'test-ox-texinfo)
 ;;; test-ox-texinfo.el end here
-- 
2.39.0

-- 
"Chop your own wood and it will warm you twice."
-- Henry Ford; Francis Kinloch, 1819; Henry David Thoreau, 1854

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


Re: Compact schedule in agenda day view

2023-02-15 Thread Marcin Borkowski


On 2023-02-15, at 11:31, Angel de Vicente  
wrote:

> Hello,
>
> Angel de Vicente  writes:
>
>> Anybody knows off the top of your head how to toggle this?
>
> Sorry for the noise. "G" is the magic letter I was looking for.

And you could have found it out yourself with `C-h l' (`view-lossage').
`C-h m' (`describe-mode') and `C-h k' (`describe-key') are also useful
in such a context.  Also, if you have a spare 20-30 minutes, try `C-h
C-h' (`help-for-help') to see other helpful commands.  And speaking of
/helpful/, you might be interested in the `helpful' package by Wilfred
Hughes (see https://github.com/Wilfred/helpful).

Hth,

-- 
Marcin Borkowski
http://mbork.pl



RE: Problem with let/cl-letf binding stuff with org-capture

2023-02-15 Thread arthur miller
Hemma thanks, for some reason, my Emacs does not display the link but it 
does for other functions. Strange.

Thanks for the help!


 Originalmeddelande 
Från: Bruno Barbier 
Datum: 2023-02-15 14:18 (GMT+01:00)
Till: Arthur Miller 
Kopia: Ihor Radchenko , emacs-orgmode@gnu.org
Ämne: Re: Problem with let/cl-letf binding stuff with org-capture

Arthur Miller  writes:

>
> Anyway, a follow question: Where is the source code?!

lisp/textmodes/string-edit.el

> Normally the help window says "... is a Lisp function in ."
>

My Emacs tells me it's an autoloaded function with the usual link.

Bruno



Re: [BUG] Incorrect display of folded headings after cycling with subheading with VISIBILITY content/children

2023-02-15 Thread Ihor Radchenko
Daniel Hubmann  writes:

> * Heading Lvl 1...** Heading Lvl 2 with VISIBILITY content...
> *** Heading Lvl 3...

Thanks for reporting!
Fixed, on bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=be9280f68

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



Re: [POLL] Proposed syntax for timestamps with time zone info (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda)

2023-02-15 Thread Ihor Radchenko
Jean Louis  writes:

> That is not same case as Ihor, when he designated it as 
>
> 2030-02-09 12:00 -0800 @UTC
> because there are no offsets @UTC time zone.

I do not recall providing such example. May you point me to the message
where you saw me writing -0800 @UTC?

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



Re: Timestamp and timestamp range definitions

2023-02-15 Thread Ihor Radchenko
Ilya Chernyshov  writes:

> So, we either should change the behavior of
> (org-element-timestamp-parser) or update the definitions of 
> timestamp
> and timestamp range in org-manual. What do you think?

Updating the manual will make more sense. Would you mind writing a patch?

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



Re: [PATCH] Async evaluation in ob-shell

2023-02-15 Thread Ihor Radchenko
Matt  writes:

> Checking the final result from the callback is trickier.   The following 
> works, but requires advice (which could potentially persist beyond the test) 
> and a delay (which slows testing overall and whose duration likely depends on 
> the hardware the test runs on).  Without the delay, I could not get the 
> callback to execute within the test.  It would execute when running manually 
> in an Org buffer, however.  I'm not sure why. 

Doesn't (while ... (sleep-for ...)) work?

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



Re: Not all reftex commands within latex block generate appropriate message

2023-02-15 Thread Alain . Cochard
Fraga, Eric writes on Wed 15 Feb 2023 12:30:

 > I think this is indeed likely to be the reason.

Thanks for the confirmation.  I was hoping that someone can arrange so
that the self explanatory message is shown each time, not the cryptic
one :-)

-- 
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 ]




Re: Problem with let/cl-letf binding stuff with org-capture

2023-02-15 Thread Bruno Barbier
Arthur Miller  writes:

>
> Anyway, a follow question: Where is the source code?!

lisp/textmodes/string-edit.el

> Normally the help window says "... is a Lisp function in ."
>

My Emacs tells me it's an autoloaded function with the usual link.

Bruno




Re: Problem with let/cl-letf binding stuff with org-capture

2023-02-15 Thread Arthur Miller
Ihor Radchenko  writes:

> Arthur Miller  writes:
>
>> Based on a Reddit thread:
>>
>> https://www.reddit.com/r/emacs/comments/10xhvd8/a_little_readstring_utility_using_an_org_mode/j7xziao/?context=3
>>
>> I did a small experiment to see if I can re-use org-capture, to just capture 
>> a
>> string from a buffer, without actually writing to any file.
>
> You can use a template target set to function pointing to temporary
> buffer. + org-capture-before-finalize-hook

I did try something this:

#+begin_src emacs-lisp
(defun my-func ()
  (with-current-buffer (get-buffer-create "my-capture-buffer")))

(defun my-hook ()
  (with-current-buffer 
  (try-completion "CAPTURE" (mapcar #'buffer-name (buffer-list)))
(let ((content (buffer-string)))
  (kill-buffer)
  content)))

(defun my-read-string ()
  (let ((org-capture-templates
 `(("s" "string" plain (function my-func
(org-capture-before-finalize-hook #'my-hook))
(org-capture nil "s")))
#+end_src

But that does not work well, because capture will put buffer it is called from
as original buffer and write to that one. To prevent that I can call capture
from a temporary buffer:

#+begin_src emacs-lisp
(defun my-read-string ()
  (with-current-buffer (get-buffer-create "my-capture-buffer")
(let ((org-capture-templates
   `(("s" "string" plain (function ignore
  (org-capture-before-finalize-hook #'my-hook))
  (org-capture nil "s"
#+end_src

but than capture complains about the buffer not being a file buffer, despite the
before finalize hook. I could point it to some temp file like /tmp/my-capture, 
by
manipulating capture plist myself, but it seems to be too expensive to create a
temp file just for a hack to read a string form a buffer. There is probably some
other way, but I give up here, especially since you point our
read-string-from-buffer :)

Anyway, thanks for the input and help.

/a



Emphasis issues with special blocks and latex

2023-02-15 Thread User Name
I am having several issues with the fontification of emphasis markers in
org-special-blocks and inside latex equations in my org-files.

I have changed `org-emphasis-regexp-components` to be the following...

```
  (with-eval-after-load 'org
(setcar org-emphasis-regexp-components "\t('\"{[:alpha:]:-“”\[\\") ;;
chars for prematch
(setcar (nthcdr 1 org-emphasis-regexp-components)
"\][:alpha:]-_^[:space:]:\t.,!?;''“”\")}/\\“”") ;; chars for postmatch
(setcar (nthcdr 2 org-emphasis-regexp-components) "\t\r\n,\"") ;;
forbidden chars
(setcar (nthcdr 3 org-emphasis-regexp-components) ".") ;; body
(setcar (nthcdr 4 org-emphasis-regexp-components) 5) ;; max newlines
(org-set-emph-re 'org-emphasis-regexp-components
org-emphasis-regexp-components))
```

I would like to be able to intersperse emphasis markers inside of strings,
which is why I included alphabetical characters for pre and post-match. I'd
like to be able to have *w*or*d* only bold the w & the d if possible, and
to be able to use backslashes between emphasized words (eg. ideally
=this=/d *be* /so//*cool*! should codify "this", italicize /so/, and bold
"cool*).

The main issue I get is that special-block metalines seem to get
font-locked (eg. `#+begin_theorem` becomes `#+begintheorem` and the
metalines themselves seem to cause the underlining of the contents within
the block. Inside latex equations, I end up with fontlocking if I don't
include spaces between underscores, pluses, minuses, or equal signs. I am
wondering if there is a way to fix this by adding more forbidden characters
(ie. forbid `#+begin_`, and `#+attr_latex` from being or causing emphasis,
and forbid emphasis between $$ $$, \begin{} \end{}, \( \), \[ \], $ $) or
possibly to include look-around using visual-regexp-sterioids.el.

Thanks in advance.


Re: Not all reftex commands within latex block generate appropriate message

2023-02-15 Thread Fraga, Eric
On Wednesday, 15 Feb 2023 at 13:15, alain.coch...@unistra.fr wrote:
> did I understand what I presume is the reason:
>
>reftex-access-scan-info: RefTeX works only in buffers visiting a file

I think this is indeed likely to be the reason.

Similar issues arise with, for instance, ledger in that some of the
capabilities of ledger-mode assume that there is a file behind the
buffer.  Not sure there is any solution to this other than tangling your
code to a file and visiting that file.

-- 
: Eric S Fraga, with org release_9.6.1-250-ge6353d in Emacs 30.0.50


Not all reftex commands within latex block generate appropriate message

2023-02-15 Thread Alain . Cochard


Issued after 'org-edit-special' within a latex block (like the one
below) the command 'reftex-toc' generates the dreadful

   reftex-TeX-master-file: Wrong type argument: stringp, nil

Only after some debugging time and trying

   reftex-label

did I understand what I presume is the reason:

   reftex-access-scan-info: RefTeX works only in buffers visiting a file


#+begin_export latex
\documentclass{article}
\begin{document}
\section{1}
\section{2}
\end{document}
#+end_export

-- 
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 ]




Re: Compact schedule in agenda day view

2023-02-15 Thread Gautier Ponsinet
Hello Angel,

Angel de Vicente  :
> I was too quick on the keyboard and I pressed some magic key combination
> and now my schedule for today shows in a compact way (only showing the
> appointments). I actually prefer the "expanded" way, in which I get a
> grid for the whole day (so it easier for me to quickly see if an
> appointment is in the morning or the afternoon, etc.).
>
> The problem: I don't know how to go back, and I'm not sure how this
> feature is called, so I was not successful searching for it in the
> manual.
>
> Anybody knows off the top of your head how to toggle this?

Are you looking for the key 'G' associated with the function
'org-agenda-toggle-time-grid' maybe?

All the best,
Gautier.



Re: Compact schedule in agenda day view

2023-02-15 Thread Angel de Vicente
Hello,

Angel de Vicente  writes:

> Anybody knows off the top of your head how to toggle this?

Sorry for the noise. "G" is the magic letter I was looking for.

Cheers,
-- 
Ángel de Vicente -- (GPG: 0x64D9FDAE7CD5E939)
 Research Software Engineer (Supercomputing and BigData)
 Instituto de Astrofísica de Canarias (https://www.iac.es/en)




Compact schedule in agenda day view

2023-02-15 Thread Angel de Vicente
Hello,

I was too quick on the keyboard and I pressed some magic key combination
and now my schedule for today shows in a compact way (only showing the
appointments). I actually prefer the "expanded" way, in which I get a
grid for the whole day (so it easier for me to quickly see if an
appointment is in the morning or the afternoon, etc.).

The problem: I don't know how to go back, and I'm not sure how this
feature is called, so I was not successful searching for it in the
manual.

Anybody knows off the top of your head how to toggle this?

Many thanks,
-- 
Ángel de Vicente -- (GPG: 0x64D9FDAE7CD5E939)
 Research Software Engineer (Supercomputing and BigData)
 Instituto de Astrofísica de Canarias (https://www.iac.es/en)




Re: [BUG] Incorrect display of folded headings after cycling with subheading with VISIBILITY content/children

2023-02-15 Thread Daniel Hubmann
Tried (setq org-fold-core-style 'overlays) which is mentioned in the link.
Unfortunately the behaviour is still the same.

On Tue, Feb 14, 2023 at 10:15 PM William Denton  wrote:

> On 14 February 2023, Bruno Barbier wrote:
>
> > Daniel Hubmann  writes:
> >
> >> After using org-cycle-overview (or org-cycle-content) and then using
> >> org-cycle-set-visibility-according-to-property I get this:
> >>
> >> * Heading Lvl 1...** Heading Lvl 2 with VISIBILITY content...
> >> *** Heading Lvl 3...
> >
> > I'm observing the same behavior.
>
> Similar things have been happening to me since the middle of last year.
>
> See:
>
> https://lists.gnu.org/archive/html/emacs-orgmode/2022-07/msg00368.html
>
> https://lists.gnu.org/archive/html/emacs-orgmode/2022-05/msg00811.html
> (my screenshots are gone by they looked like what's been described)
>
> Ihor did some work but the problem is still going on now and then, in the
> sort
> of way that seems unreproducible to me.
>
>
> Bill
>
> --
> William Denton
> https://www.miskatonic.org/
> Librarian, artist and licensed private investigator.
> Toronto, Canada
> CO₂: 421.18 ppm (Mauna Loa Observatory, 2023-02-13)