Re: BUG: org-cycle does not unfold some subtrees

2023-05-09 Thread William Denton

On 8 May 2023, Thomas S. Dye wrote:

Would it be useful for me to search for calls to the folding functions from 
outline.el in the source code of the Org packages that Spacemacs and I load?


This problems happens to me regularly, and I don't use Spacemacs.  Wherever it 
is, I don't think it's in there.


Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada
CO₂: 424.26 ppm (Mauna Loa Observatory, 2023-05-08)

Re: [PATCH] Highlight ANSI sequences in the whole buffer (was [PATCH] ANSI color on example blocks and fixed width elements)

2023-05-09 Thread Nathaniel Nicandro

Ihor Radchenko  writes:

> Nathaniel Nicandro  writes:
>
>>> Ideally, fontifying ANSI sequences should be fully controlled by users:
>>> 1. We may not want to touch src blocks by default, when
>>>`org-src-fontify-natively' is set to t. Only, maybe, provide an
>>>option. Or you may better publish a minor mode that does this for
>>>shell scripts.
>>> 2. We may allow all the ANSI sequences to be fontified in the whole
>>>buffer.
>>
>> I've updated my patch to be a combination of (1) and (2), see the
>> attached patch.  Essentially every sequence is fontified except those in
>> source blocks and a minor mode has been created to allow users to
>> disable or enable fontification whenever they want.
>>
>> I've also attached an example Org file with some ANSI sequences in it
>> for testing purposes that you can try out.
>
> Thanks!
>
>> One issue that remains is how to handle sequences within inline source
>> blocks.  Those don't have a src-block property so any sequences within
>> an inline source block are currently fontified.
>
> You should not use 'src-block property at all. There are scenarios when
> jit-lock defers source block fontification (in particular, when source
> block spans beyond the screen) and 'src-block property is not yet
> applied.
>
> Instead, you should query `org-element-at-point' or
> `org-element-context'.

The attached patch now uses `org-element-at-point' and
`org-element-context' to query for the bounds of elements.

Note, I've also attached an updated example file which shows that the
escape sequences in inline source blocks are now handled similarly to
regular source blocks, i.e. they are not fontified.

>
>> +*** ANSI escape sequences are now highlighted in the whole buffer
>> +
>> +A new customization ~org-fontify-ansi-sequences~ is available which
>> +tells Org to highlight all ANSI sequences in the buffer if non-nil and
>> +the new minor mode ~org-ansi-mode~ is enabled.
>> +
>> +To disable highlighting of the sequences you can either
>> +disable ~org-ansi-mode~ or set ~org-fontify-ansi-sequences~ to ~nil~
>> +and =M-x revert-buffer RET=.  Doing the latter will disable
>> +highlighting of sequences in all newly opened Org buffers whereas
>> +doing the former disables highlighting locally to the current buffer.
>
> Rather than asking to use revert-buffer, we usually suggest M-x
> org-mode-restart.

Done.

>
>> +(defun org-fontify-ansi-sequences (limit)
>> +  "Fontify ANSI sequences."
>> +  (when (and org-fontify-ansi-sequences org-ansi-mode)
>> +(let (end)
>> +  (while (/= (point) limit)
>
> Instead of this strict condition and later juggle with
> `narrow-to-region', just use the usual (while (< (point) limit) ...).
>

Done.

>> +(cond
>> + ((get-text-property (point) 'src-block)
>
> As I mentioned above, please use `org-element-at-point'. This function
> will also give you information about the block boundaries.
>
>> +(ansi-color-apply-on-region (point) end t)
>
> We should probably limit ANSI colour pairs to a single Org element. It
> does not make much sense to have text in-between the quotes below
> coloured:
>
> #+begin_quote
> ...  ...
> #+end_quote
>
>
> 
>
> #+begin_quote
> ...  ...
> #+end_quote
>

Makes sense. Done.

>> +;; Reset the context before every fontification cycle.  This
>> +;; avoids issues where `ansi-color-apply-on-region' attempts to
>> +;; use an old starting point that may be from a different part
>> +;; of the buffer, leading to "wrong side of point" errors.
>> +(setq ansi-color-context-region nil)
>
> This looks fragile. AFAIU, `ansi-color-context-region' is used to track
> currently active ANSI colour settings. Since your fontification function
> may be called with various LIMITs, depending on what is displayed on the
> user screen, the fontification results might be unpredictable for ANSI
> defs spanning across multiple screens.
>

It seems to be safe to reset `ansi-color-context-region' now given that
org-element is used to find the bounds of the element at
`point'. Although the fontification limits are dependent on screen size,
the org-element functions are not and so the bounds used when applying
the fontification for the ANSI sequences won't depend on screen size
either.

Also, re-setting `ansi-color-context-region' has the effect of not
propagating previously applied color settings to other Org elements.

>> +(defvar org-ansi-colors
>> +  '(black red green yellow blue purple cyan white))
>> +
>> +(defun org-ansi-highlight (beg end seq)
>> +  (save-excursion
>> +(goto-char end)
>> +(insert "\e")
>> +(insert "[0m")
>> +(goto-char beg)
>> +(insert "\e")
>> +(insert (format "[%sm" seq
>> +
>> +(defun org-ansi-highlight-foreground (beg end color)
>> +  "Highlight the foreground between BEG and END with COLOR."
>> +  (interactive
>> +   (let ((bounds (car (region-bounds
>> + (list (car bounds) (cdr 

Re: the change in org-time-stamp-custom-formats

2023-05-09 Thread Uwe Brauer
>>> "IR" == Ihor Radchenko  writes:

> Uwe Brauer  writes:
>>> You can. Or you can leave things unchanged.
>> 
>> Well if I don't change I see the time stamps like this 
>> <<09.05.2023 >
>> instead of
>> 
>> <09.05.2023>
>> 
>> When I use org-toggle-time-stamp-overlays
>> to toggle the overlays on

> I am unable to reproduce.

> I did

> 1. /tmp/bug.el
> (custom-set-variables
>  '(org-display-custom-times t)
>  '(org-time-stamp-custom-formats '("<%d.%m.%Y>" . "<%d.%m.%Y %I:%M %p>")))

Uff I need to cook up a recipe and come back to you.
I hope it is not something in my init files 
but I started to notice that problem only after I pulled and installed
a recent master version, hm.
-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/


smime.p7s
Description: S/MIME cryptographic signature


Re: the change in org-time-stamp-custom-formats

2023-05-09 Thread Ihor Radchenko
Uwe Brauer  writes:

>> You can. Or you can leave things unchanged.
>
> Well if I don't change I see the time stamps like this 
> <<09.05.2023 >
> instead of
>
> <09.05.2023>
>
> When I use org-toggle-time-stamp-overlays
> to toggle the overlays on

I am unable to reproduce.

I did

1. /tmp/bug.el
(custom-set-variables
 '(org-display-custom-times t)
 '(org-time-stamp-custom-formats '("<%d.%m.%Y>" . "<%d.%m.%Y %I:%M %p>")))

2. /tmp/bug.org
* This is test
SCHEDULED: <2023-05-09 Tue>
<2023-05-09 Tue> <2023-05-09 Tue 16:24>
[2023-05-09 Tue] [2023-05-09 Tue 16:24]


3. make repro REPRO_ARGS="-l /tmp/bug.el /tmp/bug.org"
4. M-x org-toggle-timestamp-overlays

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



Re: the change in org-time-stamp-custom-formats

2023-05-09 Thread Uwe Brauer
>>> "IR" == Ihor Radchenko  writes:

> Uwe Brauer  writes:
>> But I have files with the setting
>> 
>> #+begin_src emacs-lisp :results silent :exports none
>> (custom-set-variables
>> '(org-display-custom-times t)
>> '(org-time-stamp-custom-formats '("<%d.%m.%Y>" . "<%d.%m.%Y %I:%M %p>")))
>> #+end_src
>> 
>> 
>> Should I change that to 
>> '(org-time-stamp-custom-formats '("%d.%m.%Y" . "%d.%m.%Y %I:%M %p")))

> You can. Or you can leave things unchanged.

Well if I don't change I see the time stamps like this 
<<09.05.2023 >
instead of

<09.05.2023>

When I use org-toggle-time-stamp-overlays
to toggle the overlays on
-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/


smime.p7s
Description: S/MIME cryptographic signature


Re: [ANN] lisp/ob-tangle-sync.el

2023-05-09 Thread Mehmet Tekman

Ihor Radchenko  writes:

> Yes. See `org-babel-common-header-args-w-values'. In particular, take a
> look at (results ...).

Thanks, it took me some time to get my head around how to use this.

> I now ported a bit of documentation from my refactor branch.
> See https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=f268819d1

I'm having some problems getting:

 `:tangle > [import/export/both/skip]'

to work nicely with the existing framework. The main issue lies in the
`:any` keyword in `org-babel-common-header-args-w-values' for the tangle
entry making it difficult to determine where one exclusionary group
begins and where the other ends.

e.g.

(defconst org-babel-common-header-args-w-values
...
(tangle . ((tangle yes no :any)
   (import export skip sync)))
...
)

If I remove the :any keyword, these two groups work with the existing
framework in `org-babel-merge-params', but this would then mean that the
first tangle argument can't just be a filename string. I can get around
it by changing `:any' to `file' and then letting users describe their
tangle headers via e.g. `:tangle file import file: /some/file' but this
would be a breaking change.

In the meantime I put together a hacky solution that parses the tangle
header independently (`org-babel--handle-tangle-args') with the aim that
the first argument should ideally define a tangle filename action and
the second argument should ideally define a tangle sync action.

Please see the attached minor patch (diff) and a toy org example file.


diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 65fa47ab5..026788c00 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -431,7 +431,8 @@ then run `org-babel-switch-to-session'."
 (sep	. :any)
 (session	. :any)
 (shebang	. :any)
-(tangle	. ((tangle yes no :any)))
+(tangle	. ((tangle yes no :any)
+		   (import export skip sync)))
 (tangle-mode . ((#o755 #o555 #o444 :any)))
 (var	. :any)
 (wrap   . :any)))
@@ -2802,6 +2803,9 @@ parameters when merging lists."
 	 (exports-exclusive-groups
 	  (mapcar (lambda (group) (mapcar #'symbol-name group))
 		  (cdr (assq 'exports org-babel-common-header-args-w-values
+ (tangle-exclusive-groups
+	  (mapcar (lambda (group) (mapcar #'symbol-name group))
+		  (cdr (assq 'tangle org-babel-common-header-args-w-values
 	 (merge
 	  (lambda (exclusive-groups  result-params)
 	;; Maintain exclusivity of mutually exclusive parameters,
@@ -2821,7 +2825,7 @@ parameters when merging lists."
 	 params;Final parameters list.
 	 ;; Some keywords accept multiple values.  We need to treat
 	 ;; them specially.
-	 vars results exports)
+	 vars results exports tangle)
 (dolist (plist plists)
   (dolist (pair plist)
 	(pcase pair
@@ -2872,6 +2876,12 @@ parameters when merging lists."
(cond ((and value (functionp value)) (funcall value))
  (value value)
  (t ""))
+  (`(:tangle . ,value)
+   (setq tangle (funcall merge
+ tangle-exclusive-groups
+ tangle
+ (split-string
+  (or value "")
   ((or '(:dir . attach) '(:dir . "'attach"))
(unless (org-attach-dir nil t)
  (error "No attachment directory for element (add :ID: or :DIR: property)"))
@@ -2897,11 +2907,38 @@ parameters when merging lists."
 			  params)
 ;; Handle other special keywords, which accept multiple values.
 (setq params (nconc (list (cons :results (mapconcat #'identity results " "))
-			  (cons :exports (mapconcat #'identity exports " ")))
+			  (cons :exports (mapconcat #'identity exports " "))
+  (cons :tangle (org-babel--handle-tangle-args tangle)))
 			params))
 ;; Return merged params.
 (org-babel-eval-headers params)))
 
+(defun org-babel--handle-tangle-args (tangle)
+  "Sanitize tangle arguments.
+From the list of TANGLE parameters, assert that that there are at
+maximum only two elements in the following preferential order:
+the first element relates to a filename descriptor (such as a
+path, `tangle', `yes', or `no'); the second element relates to a
+valid sync direction."
+  (let* ((num-args (length tangle))
+ ;; Extract valid mutex groups
+ (valid-tangle-headers (cdr (assoc 'tangle
+   org-babel-common-header-args-w-values)))
+ (valid-fname-args (seq-remove (lambda (x) (equal :any x)) (car valid-tangle-headers)))
+ (valid-sync-args (cadr valid-tangle-headers))
+ ;; Attempt to split TANGLE by these mutex groups
+ (sync-arg (seq-filter (lambda (x) (member (intern x) valid-sync-args)) tangle))
+ (fname-arg (seq-remove (lambda (x) (member x sync-arg)) tangle))
+ 

Re: the change in org-time-stamp-custom-formats

2023-05-09 Thread Ihor Radchenko
Uwe Brauer  writes:

> But I have files with the setting
>
> #+begin_src emacs-lisp :results silent :exports none
> (custom-set-variables
>  '(org-display-custom-times t)
>  '(org-time-stamp-custom-formats '("<%d.%m.%Y>" . "<%d.%m.%Y %I:%M %p>")))
> #+end_src
>
>
> Should I change that to 
>  '(org-time-stamp-custom-formats '("%d.%m.%Y" . "%d.%m.%Y %I:%M %p")))

You can. Or you can leave things unchanged.

What we now do with these values is

;; Strip brackets, if any.
(when (or (and (string-prefix-p "<" format)
   (string-suffix-p ">" format))
  (and (string-prefix-p "[" format)
   (string-suffix-p "]" format)))
  (setq format (substring format 1 -1)))

So, brackets, if any, are stripped.

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



the change in org-time-stamp-custom-formats

2023-05-09 Thread Uwe Brauer


Hi

I just read in the news that 
the Leading =<= and trailing =>= in the default values of
~org-time-stamp-formats~ and ~org-time-stamp-custom-formats~ are
stripped.

No changes on the user side are needed if
~org-time-stamp-custom-formats~ was customized.

But I have files with the setting

#+begin_src emacs-lisp :results silent :exports none
(custom-set-variables
 '(org-display-custom-times t)
 '(org-time-stamp-custom-formats '("<%d.%m.%Y>" . "<%d.%m.%Y %I:%M %p>")))
#+end_src


Should I change that to 
 '(org-time-stamp-custom-formats '("%d.%m.%Y" . "%d.%m.%Y %I:%M %p")))

-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/




Re: [Pre-PATCH] Overhaul of the LaTeX preview system

2023-05-09 Thread Ihor Radchenko
Max Nikulin  writes:

> On 09/05/2023 18:34, Ihor Radchenko wrote:
>> I can easily see Lualatex-specific preamble simply failing to work on
>> Latex. Or things being rendered wrongly.
>
> iftex.sty has \ifpdftex and \iftutex (XeTeX, LuaTeX, LuaHBTeX) commands, 
> so it is possible to create universal preamble with some additional efforts.

Sure. I mostly had user-specified #+LATEX_HEADER options in mind.
They are unlikely to be universal.

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



Re: Org-mode publish: Some questions when use it for a blog

2023-05-09 Thread Ihor Radchenko
Sébastien Gendre  writes:

>> May you please elaborate?
>
> When a webpage is generated by `org-html-publish-to-html`, it put the
> title of the document at top of the HTML content as an .
>
> I wanted to modify it to put Author and date below this title but before
> the rest of the content.

For example, you can simply put Author and data into #+SUBTITLE
Or you can add a function to `org-export-filter-parse-tree-functions'.
That function will be called with INFO communication channel (plist) as
an argument. You can override :title property in that plist by side
effect to your liking.

> But, generate a RSS feed with ox-rss [1] give me some problems. The
> README is not really clear on what the Org-mode file should look. And it
> seems to be done to generate RSS when all blog posts are a headline in
> the same document. But on my blog, each blog post is on a different
> document.

Well. You can define a derived dackend for ox-rss. It will require some
Elisp though. Check out `org-export-define-derived-backend' call in
ox-rss.el.

Alternatively, I am pretty sure that a number of rss generators already
exist for static blogs. They are more likely to work using multiple
individual html pages as input.

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



Re: [Pre-PATCH] Overhaul of the LaTeX preview system

2023-05-09 Thread Max Nikulin

On 09/05/2023 18:34, Ihor Radchenko wrote:

I can easily see Lualatex-specific preamble simply failing to work on
Latex. Or things being rendered wrongly.


iftex.sty has \ifpdftex and \iftutex (XeTeX, LuaTeX, LuaHBTeX) commands, 
so it is possible to create universal preamble with some additional efforts.


https://list.orgmode.org/9aef1174-ddfc-6957-8a2b-90cf21eae...@gmail.com/
Max Nikulin. Re: [possible patch] Basic fontspec code for LuaLaTeX and 
XelaTeX. Sat, 16 Jul 2022 10:01:30 +0700





Re: [Pre-PATCH] Overhaul of the LaTeX preview system

2023-05-09 Thread General discussions about Org-mode.


Timothy  writes:

> Hi Ihor,
>
>>> As a result of this issue (plus other issues with xelatex), I’m
>>> considering adding an option to specify different LaTeX compilers for
>>> previews and exports, with the default option continuing to be
>>> the value of `org-latex-compiler’.
>>
>> I am not sure if it is a good idea.
>> I can easily see Lualatex-specific preamble simply failing to work on
>> Latex. Or things being rendered wrongly.
>>
>> One option could be trying pdflatex first and falling back to the
>> default compiler on failure. But only as non-default option.
>
> To be clear, the default will be “use the same preview compiler as document
> compiler”, but the hassles we’re currently experiencing with XeLaTeX/LuaLaTeX
> make us think it could be worth adding an override option.

Since we had been talking only about LuaLaTeX being slow, can we also
establish whether XeLaTeX is slow?  I don't think we have confirmed this
yet.  Thanks.

> All the best,
> Timothy


-- 
Best,


RY



Re: [Pre-PATCH] Overhaul of the LaTeX preview system

2023-05-09 Thread Timothy
Hi Ihor,

>> To be clear, the default will be “use the same preview compiler as document
>> compiler”, but the hassles we’re currently experiencing with XeLaTeX/LuaLaTeX
>> make us think it could be worth adding an override option.
>
> I understand. I propose to fall back to the default even if override is
> provided, but fails compilation.

Hmm. I’m on board with this as long as the implementation isn’t to complex (I
think this should be fine), and only for overriding the global default (i.e.
stick with a different value if it was set specifically for the current buffer).

All the best,
Timothy

-- 
Timothy (‘tecosaur’/‘TEC’), Org mode contributor.
Learn more about Org mode at .
Support Org development at ,
or support my work at .


Re: [Pre-PATCH] Overhaul of the LaTeX preview system

2023-05-09 Thread Ihor Radchenko
Timothy  writes:

>> One option could be trying pdflatex first and falling back to the
>> default compiler on failure. But only as non-default option.
>
> To be clear, the default will be “use the same preview compiler as document
> compiler”, but the hassles we’re currently experiencing with XeLaTeX/LuaLaTeX
> make us think it could be worth adding an override option.

I understand. I propose to fall back to the default even if override is
provided, but fails compilation.

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



Re: Help using org-entities or arternatives.

2023-05-09 Thread General discussions about Org-mode.


Ypo  writes:

> Hi
>
> Is it possible to, each time I write "" to be subsituted by "[...]" ?
>
> I can't do it using abbrev, and I don't know how to do it using org-entities.
>
> I use it to yank quotes, for example, I write:
>
>  "Like other editors, Emacs has commands to search for occurrences of a 
> string. There are also commands that do the same thing, but
>  search for patterns instead of fixed strings."
>
> And I would like to get, automatically:
>
>  "Like other editors, Emacs has commands to search for occurrences of a 
> string. [...] There are also commands that do the same thing, but
>  search for patterns instead of fixed strings."
>
> Best regards

Not necessarily Org-specific, but here's my idea, untested:

```emacs-lisp
(defun my/yank-subst-ellipses ()
  (interactive)
  (let* ((start (point-marker))
 (_ (insert (current-kill 0)))
 (end (point-marker)))
(save-match-data
  ;; Play around with this regexp
  (while (re-search-forward (rx "...") end t)
;; And this replacement text
(replace-match "[...]")
```

Then, since Org sets C-y as `org-yank', make an advice with it.  I am
not confident in this portion at all, but here goes nothing ;)

```emacs-lisp
(require 'cl-lib)
(advice-add
 #'org-yank :around
 (lambda (org-yank  arg)
   (cl-letf (((symbol-function 'yank)
  (symbol-function 'my/yank-subst/ellipses)))
 (funcall org-yank arg
```

-- 
Best,


RY



Re: [Pre-PATCH] Overhaul of the LaTeX preview system

2023-05-09 Thread Timothy
Hi Ihor,

>> As a result of this issue (plus other issues with xelatex), I’m
>> considering adding an option to specify different LaTeX compilers for
>> previews and exports, with the default option continuing to be
>> the value of `org-latex-compiler’.
>
> I am not sure if it is a good idea.
> I can easily see Lualatex-specific preamble simply failing to work on
> Latex. Or things being rendered wrongly.
>
> One option could be trying pdflatex first and falling back to the
> default compiler on failure. But only as non-default option.

To be clear, the default will be “use the same preview compiler as document
compiler”, but the hassles we’re currently experiencing with XeLaTeX/LuaLaTeX
make us think it could be worth adding an override option.

All the best,
Timothy

-- 
Timothy (‘tecosaur’/‘TEC’), Org mode contributor.
Learn more about Org mode at .
Support Org development at ,
or support my work at .


Help using org-entities or arternatives.

2023-05-09 Thread Ypo

Hi

Is it possible to, each time I write "" to be subsituted by "[...]" ?

I can't do it using abbrev, and I don't know how to do it using 
org-entities.


I use it to yank quotes, for example, I write:

   "Like other editors, Emacs has commands to search for occurrences of
   a string. There are also commands that do the same thing, but
   search for patterns instead of fixed strings."

And I would like to get, automatically:

   "Like other editors, Emacs has commands to search for occurrences of
   a string. [...] There are also commands that do the same thing, but
   search for patterns instead of fixed strings."


Best regards


Re: [Pre-PATCH] Overhaul of the LaTeX preview system

2023-05-09 Thread Ihor Radchenko
Karthik Chikmagalur  writes:

> As a result of this issue (plus other issues with xelatex), I'm
> considering adding an option to specify different LaTeX compilers for
> previews and exports, with the default option continuing to be
> the value of `org-latex-compiler'.

I am not sure if it is a good idea.
I can easily see Lualatex-specific preamble simply failing to work on
Latex. Or things being rendered wrongly.

One option could be trying pdflatex first and falling back to the
default compiler on failure. But only as non-default option.

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



Re: [ox-gfm]

2023-05-09 Thread Uwe Brauer

> On Mon, 8 May 2023 at 18:35, Uwe Brauer  wrote:

> I think this is the package we are referring to?
> https://github.com/larstvei/ox-gfm

Thanks very much
> https://list.orgmode.org/m2eh1adtye@ifi.uio.no/


> The README says loading ox-gfm adds it to the org-export-dispatch, I
> tried doing (require 'ox-gfm) and it started showing up. But I don't
> know if there is any other/better way to do that.

Indeed, the require call is need. 

Sigh: the package system sometimes confuses me because the functions
provided by ox-gfm were already available after installation, without
the require command.

Anyhow thanks very much

-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/


smime.p7s
Description: S/MIME cryptographic signature


Re: BUG: org-cycle does not unfold some subtrees

2023-05-09 Thread Ihor Radchenko
"Thomas S. Dye"  writes:

>> Which likely means that something is calling folding functions 
>> from
>> outline.el instead of Org-native folding.
>
> Excellent!
>
> Would it be useful for me to search for calls to the folding 
> functions from outline.el in the source code of the Org packages 
> that Spacemacs and I load?

I have another thought now.
Do you happen to use built-in Spacemacs' search module?
If so, what if you switch it do isearch?
See https://github.com/emacs-evil/evil/issues/1630

You can also try running
(org-fold-core-set-folding-spec-property 'org-fold-outline :isearch-open nil)
to see if the problem stops happening.

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



Re: BUG: org-cycle does not unfold some subtrees

2023-05-09 Thread Michael Dauer
Just another check on my side for any appearance of "org-fold-": Nothing in
my code, only org related packages use it.

$ grep -r -l org-fold- .
./org/.git/index
./org/doc/org-manual.org
./org/etc/ORG-NEWS
./org/lisp/ob-core.el
./org/lisp/ob-exp.el
./org/lisp/ob-lilypond.el
./org/lisp/ob-ref.el
./org/lisp/ol.el
./org/lisp/org-agenda.el
./org/lisp/org-archive.el
./org/lisp/org-capture.el
./org/lisp/org-clock.el
./org/lisp/org-colview.el
./org/lisp/org-compat.el
./org/lisp/org-crypt.el
./org/lisp/org-cycle.el
./org/lisp/org-element.el
./org/lisp/org-feed.el
./org/lisp/org-fold-core.el
./org/lisp/org-fold.el
./org/lisp/org-footnote.el
./org/lisp/org-goto.el
./org/lisp/org-id.el
./org/lisp/org-inlinetask.el
./org/lisp/org-keys.el
./org/lisp/org-lint.el
./org/lisp/org-list.el
./org/lisp/org-loaddefs.el
./org/lisp/org-loaddefs.el~
./org/lisp/org-macs.el
./org/lisp/org-mobile.el
./org/lisp/org-mouse.el
./org/lisp/org-refile.el
./org/lisp/org-src.el
./org/lisp/org-table.el
./org/lisp/org.el
./org/lisp/ox-org.el
./org/lisp/ox.el
./org/testing/lisp/test-org-fold.el
./org/testing/lisp/test-org-list.el
./org/testing/lisp/test-org.el


Am Di., 9. Mai 2023 um 09:58 Uhr schrieb Thomas S. Dye :

>
> Ihor Radchenko  writes:
>
> > "Thomas S. Dye"  writes:
> >
> >>> You can try
> >>> M-x debug-on-variable-change  org-fold-core-style 
> >>
> >> In case it's helpful, I set debug-on-variable-change as you
> >> suggested but was bitten by the bug without triggering the
> >> debugger.
> >
> > Which likely means that something is calling folding functions
> > from
> > outline.el instead of Org-native folding.
>
> Excellent!
>
> Would it be useful for me to search for calls to the folding
> functions from outline.el in the source code of the Org packages
> that Spacemacs and I load?
>
> If so, tips on how to do this efficiently are welcome.
>
> All the best,
> Tom
>
> --
> Thomas S. Dye
> https://tsdye.online/tsdye
>


Re: New note not included in org-element-parse-buffer result

2023-05-09 Thread Ihor Radchenko
bvchg...@mail.com writes:

> I'm attempting my first non-trivial elisp and seem to be falling at the
> first hurdle.
>
> Specifically, I am using (org-trigger-hook) to inspect a TODO->DONE state
> change, and am finding that the note that I insert when the state change
> is logged is not present in the result of a call to
> (org-element-parse-buffer).

The note might indeed not yet be inside the Org buffer.
`org-add-log-setup' arranges the note to be written _after_ current
command finishes (`post-command-hook').

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



New note not included in org-element-parse-buffer result

2023-05-09 Thread bvchgvbt
Hi all,

I'm attempting my first non-trivial elisp and seem to be falling at the
first hurdle.

Specifically, I am using (org-trigger-hook) to inspect a TODO->DONE state
change, and am finding that the note that I insert when the state change
is logged is not present in the result of a call to
(org-element-parse-buffer).

I wondered if this was due to the buffer having not been saved so in the
code I call (org-save-all-org-buffers) before trying to inspect the buffer
with -parse-buffer. Since the code is working on current-buffer, I don't
*think* this should be the case, but please see my first sentence.

As possibly related issue, despite the call to (org-save-all-org-buffers)
I find that the Org buffer containing my new note remains unsaved.

Can anyone give me a clue as to what's going on, please?



Re: BUG: org-cycle does not unfold some subtrees

2023-05-09 Thread Thomas S. Dye



Ihor Radchenko  writes:


"Thomas S. Dye"  writes:


You can try
M-x debug-on-variable-change  org-fold-core-style 


In case it's helpful, I set debug-on-variable-change as you 
suggested but was bitten by the bug without triggering the 
debugger.


Which likely means that something is calling folding functions 
from

outline.el instead of Org-native folding.


Excellent!

Would it be useful for me to search for calls to the folding 
functions from outline.el in the source code of the Org packages 
that Spacemacs and I load?


If so, tips on how to do this efficiently are welcome.

All the best,
Tom

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



Re: BUG: org-cycle does not unfold some subtrees

2023-05-09 Thread Ihor Radchenko
Michael Dauer  writes:

> What could be called. It's not org-fold-core-style.

I am not really sure.
In order to avoid these situations Org advices `outline-flag-region'.
But something may apply outline overlays bypassing that function, in theory.

> Can I be just a data corruption of the text properties? I've no idea what
> they are exactly, and what other parts use them. Maybe a conflicting key,
> or failed optimization, or side effect on the regions they apply to. I just
> want to give ideas from somebody who is free of knowledge.

If your `org-fold-core-style' is set to 'text-properties (default),
folding in Org should never ever use overlays that were observed in this
thread.

> My guess is that the issue is within org-mode. But tell us, what functions
> we should look for in our code and the used packages.

I am 99% sure it is not within Org.

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



Re: BUG: org-cycle does not unfold some subtrees

2023-05-09 Thread Michael Dauer
What could be called. It's not org-fold-core-style.

Can I be just a data corruption of the text properties? I've no idea what
they are exactly, and what other parts use them. Maybe a conflicting key,
or failed optimization, or side effect on the regions they apply to. I just
want to give ideas from somebody who is free of knowledge.

My guess is that the issue is within org-mode. But tell us, what functions
we should look for in our code and the used packages.

Am Di., 9. Mai 2023 um 08:23 Uhr schrieb Ihor Radchenko :

> "Thomas S. Dye"  writes:
>
> >> You can try
> >> M-x debug-on-variable-change  org-fold-core-style 
> >
> > In case it's helpful, I set debug-on-variable-change as you
> > suggested but was bitten by the bug without triggering the
> > debugger.
>
> Which likely means that something is calling folding functions from
> outline.el instead of Org-native folding.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


Re: BUG: org-cycle does not unfold some subtrees

2023-05-09 Thread Ihor Radchenko
"Thomas S. Dye"  writes:

>> You can try
>> M-x debug-on-variable-change  org-fold-core-style 
>
> In case it's helpful, I set debug-on-variable-change as you 
> suggested but was bitten by the bug without triggering the 
> debugger.

Which likely means that something is calling folding functions from
outline.el instead of Org-native folding.

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