[ISSUE] org-fold does not support auto-reveal for some external package commands

2022-05-02 Thread Christopher M. Miles

I'm using package "consult" which has command "consult-org-heading" to search 
org headlines. It will
auto jump to the selected headline and expand the jumped headline. After using 
org-fold, it does not
auto jump to the headline now.

The previous discussion here as reference 
https://github.com/minad/consult/issues/563.

As @minad mentioned we need to wait for org-fold provide an official API to 
reveal content. Hope
this can be added to org-fold plan.

Ihor Radchenko  writes:

> This is the final version of the patch. I am going to merge it this
> weekend. If there are any comments, please send them ASAP.
>
> This version is basically the same as previous, but (1) Rebased onto
> current main; (2) org-agenda.el can be native compiled; (3) Fixed some
> edge cases with fontification.
>
> Best,
> Ihor

-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3


signature.asc
Description: PGP signature


Re: [BUG] org-compile-prefix-format doco is incomplete [9.5.2 (9.5.2-gfbff08 @ /home/phil/.emacs.d/elpa/org-9.5.2/)]

2022-05-02 Thread Ihor Radchenko
Phil Hudson  writes:

> Function org-compile-prefix-format in file org-agenda.el (line 6917 in
> Org 9.5.2) does not properly document parameter `key'.

Thanks! Fixed on main via 5d3173cb0.

Best,
Ihor



[PATCH] Re: [BUG] org-element-map doco should refer to org-element-parse-buffer [9.5.2 (9.5.2-gfbff08 @ /home/phil/.emacs.d/elpa/org-9.5.2/)]

2022-05-02 Thread Ihor Radchenko
Phil Hudson  writes:

> The documentation for function `org-element-parse-buffer' helpfully
> directs the user to that of function `org-element-map', but the
> documentation for the latter makes no mention of
> `org-element-parse-buffer'. It contains lengthy and helpful explanations
> of what to do with its `data' parameter, but no hint as to how to obtain
> that data.

Sounds reasonable.
Will something like the attached do?

Best,
Ihor

>From 6041817f426aa0976f557f4c108203b8eed37ac1 Mon Sep 17 00:00:00 2001
Message-Id: <6041817f426aa0976f557f4c108203b8eed37ac1.1651549348.git.yanta...@gmail.com>
From: Ihor Radchenko 
Date: Tue, 3 May 2022 11:40:26 +0800
Subject: [PATCH] org-element-map: Refer to `org-element-parse-buffer' in the
 docstring

* lisp/org-element.el (org-element-map): Update docstring.  Mention
that parse tree can be obtained using `org-element-parse-buffer'.  Add
an example.
---
 lisp/org-element.el | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lisp/org-element.el b/lisp/org-element.el
index 3856079aa..4be345001 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -4524,12 +4524,12 @@ (defun org-element-map
 (data types fun  info first-match no-recursion with-affiliated)
   "Map a function on selected elements or objects.
 
-DATA is a parse tree, an element, an object, a string, or a list
-of such constructs.  TYPES is a symbol or list of symbols of
-elements or objects types (see `org-element-all-elements' and
-`org-element-all-objects' for a complete list of types).  FUN is
-the function called on the matching element or object.  It has to
-accept one argument: the element or object itself.
+DATA is a parse tree (e.g. returned by `org-element-parse-buffer'), an element,
+an object, a string, or a list of such constructs.  TYPES is a symbol
+or list of symbols of elements or objects types (see `org-element-all-elements'
+and `org-element-all-objects' for a complete list of types).  FUN is the function
+called on the matching element or object.  It has to accept one
+argument: the element or object itself.
 
 When optional argument INFO is non-nil, it should be a plist
 holding export options.  In that case, parts of the parse tree
@@ -4557,6 +4557,7 @@ (defun org-element-map
 the following example will return a flat list of all `src-block'
 and `example-block' elements in it:
 
+  (setq tree (org-element-parse-buffer))
   (org-element-map tree \\='(example-block src-block) #\\='identity)
 
 The following snippet will find the first headline with a level
-- 
2.35.1



Re: [Bug] incorrect indent of next heading after org-paste-subtree

2022-05-02 Thread Ihor Radchenko
Samuel Wales  writes:

> that sounds like great debugging ability.  was this using edebug or something?

Just good old debug-on-entry. Nothing fancy.

Best,
Ihor



Re: [Bug] incorrect indent of next heading after org-paste-subtree

2022-05-02 Thread Samuel Wales
that sounds like great debugging ability.  was this using edebug or something?



Re: Org as a workspace (an impromptu reflection)

2022-05-02 Thread Nick Dokos
Juan Manuel Macías  writes:

> With Org something curious has happened. I've gotten used to working
> around nodes (regardless of what documents those nodes are in), rather
> than around folders or files. Little by little, a kind of virtual world
> of ideas, objects, etc., all intertwined with each other, is being
> built.

>From my vantage point (of ignorance about it :-) ), this sounds like
org-roam to me: https://www.orgroam.com/

-- 
Nick

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




Re: [BUG] org-mode #+SETUPFILE not working with properties [9.5.2 (release_9.5.2-378-g98588e @ /home/eros/src/org-mode/lisp/)]

2022-05-02 Thread Nick Dokos
Ihor Radchenko  writes:

> Eros Zaupa  writes:
>
>> I would like to move the properties drawer to a separate file and import it
>> into the main one. To do so I'm using the `#SETUPFILE` property suggested
>> [here][1], but this doesn't seem to work.
>
> Confirmed.
> Though I am not 100% sure.
>
> Org is indeed ignoring top-level property drawer when parsing
> #+SETUPFILE.
>
> Dear All,
> I think that parsing top-level property drawer is simply an omission
> from the time we introduced top-level property drawers into syntax.
>
> We may either implement this support or leave things as is and document
> the current behaviour.
>
> I would be in favour of implementing top-level drawer support in
> SETUPFILE, but there might be alternative opinions. WDYT?

FWIW, I agree that it is a bug and it should be fixed.

-- 
Nick

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




Re: How to export to markdown programmatically without the table of contents?

2022-05-02 Thread Marcin Borkowski


On 2022-05-01, at 22:01, Berry, Charles  wrote:

>> On May 1, 2022, at 2:20 AM, Marcin Borkowski  wrote:
>> 
>> Hi fellow Orgers,
>> 
>> I'd like to export a Org-mode formatted string to markdown, but without
>> the table of contents.
>> 
>> (org-export-string-as my-string 'md t '(toc nil))
>> 
>> didn't work (the ToC was still there).  What am I missing?
>
>
> It does seem odd that BODY-ONLY as `t' gives a toc. With latex it does not 
> regardless of `:with-toc'.
>
> : (org-export-string-as my-string 'md t '(:with-toc nil))
>
> seems to give what you want.

Thanks!

http://mbork.pl/2021-05-02_Org-mode_to_Markdown_via_the_clipboard

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: [BUG] Exporting italic link with bang inside to html fails to parse the link [9.5.2 (N/A @ /gnu/store/89yvbijwnvsbpa5h33mvbgh1gy9w30n2-emacs-org-9.5.2/share/emacs/site-lisp/org-9.5.2/)]

2022-05-02 Thread Max Nikulin

On 01/05/2022 10:27, Ihor Radchenko wrote:

Max Nikulin writes:


2021-09-03  5:17 Dr. Arne Babenhauserheide Bug: PDF Export of Link fails
https://list.orgmode.org/87pmtqp79s@web.de/T/#u


Then the older bug may be cancelled as a duplicate.


Not sure. Even a fix to org-insert-link would not solve the problem with
unexpected export if the link is typed in manually. So, I'd rather keep
both the reports for the time being.


I would not insist any more. My point was: the same reporter, the same 
case of punctuation after slash in link target, the same idea to make 
`org-insert-link' more smart.



Or someone may go through all the related bugs and create a single giant
discussion to avoid scattering things around. In my notes, I have at
least 6 discussions related to edge cases of Org markup.


I have some notes as well. Though I think it should be either FAQ entry 
or a separate document describing limitations of the parser (and test 
data set for the parser).



I think it is already kind of official. At least, we directly suggest
using zero width spaces in
https://orgmode.org/manual/Escape-Character.html#Escape-Character


Things are more complicated. Without a filter (that it is not mentioned) 
it may cause undesired line breaks (the primary purpose of zero width 
space). Fortunately PdfLaTeX ignores them.


Tom Gillespie. On zero width spaces and Org syntax. Fri, 3 Dec 2021 
20:04:28 -0800. 
https://list.orgmode.org/ca+g3_pm4cxha8bu+3qg541uioaulnaqfzqu-+ukczx3itoe...@mail.gmail.com


suggested word joiner U+2060, but this character is not a space for 
regular expressions. I experimented a bit, but I can not provide a 
summary yet, my notes are in early draft stage. the "Escape Character" 
section should be expanded to discuss more use cases.



In the case of links I still prefer breaking emphasis at the link
borders. `org-insert-link' may check after inserting the markup if it
is parsed as a link and add more markers if necessary.
...
  /inter/[[https://orgmode.org/?oops=1][/word/]]/link/


I do not like this idea. It is fine when inserting a link into existing
emphasis, but what if an emphasis is applied around link later? We would
also need to update org-emphasize and still have an issue because many
users simply type the emphasis markers manually.


Emphasis around other inline objects anyway can be easily broken. Try to 
make the whole string bold:


begin =middle* verbatim= end

It may be useful to add a checker to `org-lint' that issues warnings for 
confusing link targets.


I believe that zero width space does not belong to "plain text markup" 
since it is invisible (at least by default). I see that printable ASCII 
characters are already in use, but I still think that U+200B should be 
used as rare as possible.


You are aware of my opinion now and I do not need more. You are free to 
ignore it since I can not offer anything better.





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

2022-05-02 Thread Ihor Radchenko
Rudolf Adamkovič  writes:

> I followed the instructions at ...
>
> https://orgmode.org/manual/JavaScript-support.html
>
> ... adding the following line to my Org file:
>
> #+INFOJS_OPT: view:info toc:nil
>
> The HTML now contains ...
>
> https://orgmode.org/org-info.js";>
> // @license 
> magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt
>  GPL-v3-or-Later
> // @license-end
> 
>
> ... but https://orgmode.org/org-info.js gives 404.

Confirmed.

The script is now hosted at
https://orgmode.org/worg/code/org-info-js/org-info.js

Apparently nobody touched this for a very long time. The last change in
this area was 9 years ago.

Bastien,

I do not fully understand why it is hosted in worg. We mention it in the
manual and support in the core. The script is licensed under GPL.
Is there any reason to keep it out of the main Org repo?

> P.S. If someone decides to fix this, please consider adding a test.  Without
> it, sooner or later, someone will waste their time again.

It is a good idea, though I am not sure if it is appropriate to add
network staff into Org tests directly.

Best,
Ihor



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

2022-05-02 Thread Rudolf Adamkovič



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.


I followed the instructions at ...

https://orgmode.org/manual/JavaScript-support.html

... adding the following line to my Org file:

#+INFOJS_OPT: view:info toc:nil

The HTML now contains ...

https://orgmode.org/org-info.js";>
// @license 
magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt 
GPL-v3-or-Later
// @license-end


... but https://orgmode.org/org-info.js gives 404.

P.S. If someone decides to fix this, please consider adding a test.  Without
it, sooner or later, someone will waste their time again.

Rudy

Emacs  : GNU Emacs 29.0.50 (build 9, x86_64-apple-darwin21.4.0, NS 
appkit-2113.40 Version 12.3.1 (Build 21E258))
 of 2022-05-01
Package: Org mode version 9.5.3 (release_9.5.3-467-g2bd34e @ 
/Users/salutis/src/org-mode/lisp/)
-- 
"One can begin to reason only when a clear picture has been formed in
the imagination."
-- Walter Warwick Sawyer, Mathematician's Delight, 1943

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



Re: Emacs launched from Firefox

2022-05-02 Thread Max Nikulin

On 02/05/2022 09:03, Samuel Wales wrote:

thank you.  there is no emacs in my ~/.config/mimeapps.list.  where
are those desktop files found or put?  i use fluxbox.
[i realize this is not org related.  non-list email ok.]


Perhaps emacs-help is more suitable for this discussion, but I do not 
read that mail list due to rather high traffic there. On the other hand 
I do not know if there is a resource describing such configuration 
taking into account details specific to Emacs (I have not tried to find 
it though).


I am not sure from which site you downloaded that attachment, MIME type 
may vary depending on the HTTP server configuration. You yay check 
Content-Type response header in the browser development tools or using


curl -I ''

command. It may be "text/plain", "text/x-patch", "application/x-patch", etc.

In Firefox settings (about:preferences page) check that "Applications" 
section either does not contain an entry for the MIME type (is unlikely 
in your case since you already opened a file) or its handler is 
configured to "Always ask" till you select your new handler.


System-wide .desktop file may reside e.g. in 
"/usr/share/applications/emacs.desktop". You can put your customized 
file in e.g. "~/.local/share/applications/" directory 
("$XDG_DATA_HOME/applications/") or into "applications" subdirectory of 
"$XDG_DATA_DIRS" entry. For details see

https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

Customize "Exec" entry in the .desktop file to add your options, e.g. 
create "emacs-a11y.desktop"


 >8 
[Desktop Entry]
Version=1.0
Name=Accessible Emacs (GUI)
GenericName=Text Editor
Comment=GNU Emacs is an extensible, customizable text editor - and more
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
TryExec=/usr/bin/emacs
Exec=/usr/bin/emacs %F
Icon=emacs
Type=Application
Terminal=false
Categories=Utility;Development;TextEditor;
StartupWMClass=Emacs
Keywords=Text;Editor;
 8< 

It is better to set unique "Name" to distinguish it from the default 
Emacs launcher. Desktop file format reference:

https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html

Notice that browser launcher script may reset PATH environment to some 
safe value, so executables from custom directories may be unavailable 
without specifying of the full path.


MIME type should be among the values of the MimeType field inside the 
".desktop" file or in the "mimeapps.list" file. In the former case run 
(with proper directory)


update-desktop-database ~/.local/share/applications

In the latter case add to "~/config/mimeapps.list" mapping from the MIME 
type to your .desktop file


 >8 
[Added Associations]
text/plain=emacs-a11y.desktop;
 8< 

And maybe

 >8 
[Default Applications]
text/plain=emacs-a11y.desktop;
 8< 

With such recipe a new instance of Emacs will be launched for each 
downloaded file. Likely you would prefer to use you main Emacs session 
or a special session of Emacs for untrusted content fetched from web. In 
such case you can use "emacsclient" command in the ".desktop" file and 
maybe systemd user socket+service units pair to run Emacs on demand.


If you are still using emacs-25 then e.g. "--fg-daemon" option is 
unavailable and related files are not included in the package. For 
inspiration you may check

http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/emacsclient.desktop
http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/emacs.service
https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html

Finally a rather unrelated question. Do you find accessibility tools in 
Gnome or KDE inconvenient? I believed that it should be more difficult 
to arrange setup from scratch for fluxbox. However I never tried any of 
these options.



On 5/1/22, Max Nikulin wrote:

On 01/05/2022 11:53, Samuel Wales wrote:


[firefox did not offer to allow a command line to run my shell script
which sets up emacs correctly, and idk if it even ran with my .emacs.
does it do -q?  not sure because emacs is too unusable to even find
that out.  so firefox fails to be accessible in that dialog box.


Samuel, I think, firefox does exactly what it can find in MIME
associations (e.g. ~/.config/mimeapps.list) and in the .desktop file of
the selected application.

There is an emacsclient.desktop file in Emacs git master that tries to
connect to the existing Emacs session. It is a relatively new addition,
so packages for Linux distributions may miss it.

You can either use standard Emacs initialization to get all your
customization available through default emacs.desktop or create a custom
.desktop file that contain all CLI options specific to your setup.




Re: [Bug] incorrect indent of next heading after org-paste-subtree

2022-05-02 Thread Max Nikulin

On 02/05/2022 11:00, Ihor Radchenko wrote:

Max Nikulin writes:


I am unable to reproduce on the latest Org.


Thank you, Ihor. I have checked it once more for current main HEAD
2bd34edb64. I can reproduce it using the provided steps in Emacs-26, but
not in Emacs-27.


Thanks for the extra info!
I managed to reproduce using Emacs 26 and it is a real problem with some
edge case in org-indent. The problem is masked by
combine-after-change-calls that is used since Emacs 27 but replaced by a
placeholer in Emacs 26.

The fix is attached. Let me know if it also works on your side.


I have not performed extensive testing, but your patch fixes the problem 
at least with my test file, so thank you for digging into this issue.





Re: [BUG] Warning (org-element-cache): org-element--cache: Org parser error in suma-por-fila.tex::1585. Resetting. [9.5.3 (release_9.5.3-465-gd7dc62 @ /home/oub/emacs/site-lisp/packages/org/)]

2022-05-02 Thread Uwe Brauer
>>> "IR" == Ihor Radchenko  writes:

> Uwe Brauer  writes:
>>> This is most likely done by your personal customisation or by
>>> third-party package (`link-message' function).
>> 
>> I see, most likely orglink (available in melpa)
>> ;; Homepage: https://github.com/tarsius/orglink
>> 
>> Was the culprit, I upgraded the package and have not seen that message so 
>> far anymore.

> I am not sure. I searched through commit history of orglink and there is
> no instance of org-element-context.

> So, beware that the observed issue might be related to some other package.

I see, thanks for pointing that out. I run a grep -r in my .emacs.d/elpa
directory and indeed still a lot of packages use that function, but in
my understanding all of them refer to org files. Hm, strange.

I do use a bit old version of org-ref though (since I have difficulties
with the new interface and no time to get acquainted now).

I will try later to dig more into the issue.


smime.p7s
Description: S/MIME cryptographic signature


Re: [BUG] Warning (org-element-cache): org-element--cache: Org parser error in suma-por-fila.tex::1585. Resetting. [9.5.3 (release_9.5.3-465-gd7dc62 @ /home/oub/emacs/site-lisp/packages/org/)]

2022-05-02 Thread Ihor Radchenko
Uwe Brauer  writes:

>> This is most likely done by your personal customisation or by
>> third-party package (`link-message' function).
>
> I see, most likely orglink (available in melpa)
> ;; Homepage: https://github.com/tarsius/orglink
>
> Was the culprit, I upgraded the package and have not seen that message so far 
> anymore.

I am not sure. I searched through commit history of orglink and there is
no instance of org-element-context.

So, beware that the observed issue might be related to some other package.

Best,
Ihor



Re: [BUG] Warning (org-element-cache): org-element--cache: Org parser error in suma-por-fila.tex::1585. Resetting. [9.5.3 (release_9.5.3-465-gd7dc62 @ /home/oub/emacs/site-lisp/packages/org/)]

2022-05-02 Thread Uwe Brauer
>>> "IR" == Ihor Radchenko  writes:

> Uwe Brauer  writes:
>> Org-mode git version.
>> a3dac4d20a37c51393f191d01e0ec2170bb260a3
>> 
>> Opening a tex file I receive the following error message
>> ,
>> | Warning (org-element-cache): org-element--cache: Org parser error in 
>> suma-por-fila.tex::1585. Resetting.
>> |  The error was: (error "rx ‘**’ range error")
>> |  Backtrace:
>> | "  backtrace-to-string(nil)
>> |   org-element-at-point()
>> |   org-element-context()
>> |   link-message()

> Thanks for reporting!
> As warning indicates, you are trying to run Org function
> (org-element-context) in TeX buffer.
> org-element-context does not work anymore in non-Org buffers.

> This is most likely done by your personal customisation or by
> third-party package (`link-message' function).

I see, most likely orglink (available in melpa)
;; Homepage: https://github.com/tarsius/orglink

Was the culprit, I upgraded the package and have not seen that message so far 
anymore.

Regards

Uwe Brauer 


smime.p7s
Description: S/MIME cryptographic signature


Re: How to export to markdown programmatically without the table of contents?

2022-05-02 Thread Daniel Fleischer
Jeremie Juste [2022-05-01 Sun 22:29] wrote:

> I know where to look now:
>
> (info "(org) Publishing options")

That's a good resource!