Re: [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-03 Thread Phil Hudson
Thanks Ihor, that's great!

One tiny nit-pick: I think "e.g." is deprecated in favor of the
explicit literal "for example". My source for this is (info "(elisp)
Documentation Tips").

Also, just spotted what I think is a pre-existing typo, "objects
types", which I think should probably be just "object types". Might as
well fix that while we're at it.

Best,
Phil

On Tue, 3 May 2022 at 04:43, Ihor Radchenko  wrote:
>
> 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
>



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-03 Thread Phil Hudson
Thanks again Ihor!

On Tue, 3 May 2022 at 04:44, Ihor Radchenko  wrote:
>
> 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



Re: [BUG] In recent GNU emacs master org-capture hangs [9.5.3 (release_9.5.3-465-gd7dc62 @ /home/oub/emacs/site-lisp/packages/org/)]

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

> Here is one of the templates
> ("mt" "Tutorias Headings"
>  entry (file+headline 
> "~/ALLES/HGs/tex/vorlesungen/Tutorias/tutorias.org" "Tutorials")
>  "* TODO %^{Task} %T : %:from %:subject %^G\n- From :: %:from\n- 
> Subject :: %:subject\n- Date :: %:date\n- Email :: %a\n\n%?\n%i")
>
> So I in my gnus message 
>
> 1. I fire up org-capture
>
> 2. I am asked to the Task, I type but then Emacs hangs, and I have
>to abort the operation. That did not happen with git master
>1f78ca45f8d534e51c1e30e9225d1da8b2e50650

Could you please provide detailed steps how to reproduce starting from
emacs -Q?

I am unable to trigger the hang using your template doing the following

1. cd path/to/org/repo/main/branch
2. make cleanall; make autoloads; emacs -Q -L ./lisp/ -l org -l /tmp/bug.el 
with bug.el:
(setq org-capture-templates '(("m" "Tutorias Headings"
 entry (file+headline "/tmp/tutorias.org" "Tutorials")
 "* TODO %^{Task} %T : %:from %:subject %^G\n- From :: %:from\n- 
Subject :: %:subject\n- Date ::
%:date\n- Email :: %a\n\n%?\n%i")))

3. M-x gnus
4. m
5. Fill To and Subject fields of the message
6. M-x org-capture  m
7. test 
8. 1:test: 
9. C-c C-c

Best,
Ihor



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

2022-05-03 Thread Karl Voit
Hi,

* Marcin Borkowski  wrote:
>
> On 2022-05-01, at 22:01, Berry, Charles  wrote:
>
>>> On May 1, 2022, at 2:20 AM, Marcin Borkowski  wrote:
>>> 
>>> 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))
>>
>>
>> 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.
>
> http://mbork.pl/2021-05-02_Org-mode_to_Markdown_via_the_clipboard

I tried this neat code snippet today with Emacs 26.3 and Org-mode
9.1.9 and I got an error:

| org-export-barf-if-invalid-backend: Unknown "nil" back-end: Aborting export

When I execute the following code, I get the same error:
| (setq region "/foo/ *bar* https://example.com baz")
| (org-export-string-as region 'md t '(:with-toc nil))

Could it be that I don't have "md" as backend somehow? Is there a
hidden requirement?

Do I need something like "(require 'ox-md)"? I somehow noted that
those export requirements are not necessary any more. Maybe this is
wrong?

Thanks!

-- 
get mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML into Org-mode:
   > get Memacs from https://github.com/novoid/Memacs <
Personal Information Management > http://Karl-Voit.at/tags/pim/
Emacs-related > http://Karl-Voit.at/tags/emacs/




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

2022-05-03 Thread Christopher M. Miles

Ihor Radchenko  writes:

> "Christopher M. Miles"  writes:
>
>> 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.
>
> I reviewed the available API and realized that Org actually does provide
> sufficient functionality to reveal search matches temporarily. (there
> was a bug in that area, but I already fixed it)
>
> The basic idea is demonstrated in a simple function below:
>
> (defun test (pos)
>   (interactive "nEnter point to be revealed: ")
>   (read-char "Revealing point temporarily. Press any key...")
>   (save-excursion
> (org-fold-save-outline-visibility nil
>   (goto-char pos)
>   (org-fold-show-set-visibility 'local)
>   (read-char "About to restore the previous fold state. Press any 
> key...")))
>   (read-char "Now, reveal the point permanently. Press any key...")
>   (goto-char pos)
>   (org-fold-show-set-visibility 'local))
>
> Hope it helps.
>
> Best,
> Ihor

Interesting, I tested and confirmed this works good. Thanks for demonstrating. 
I will figure out
consult-org-heading command part.

-- 
[ 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: [PATCH] New function org-speed-command-add for adding/modifying speed commands

2022-05-03 Thread Ihor Radchenko
Shankar Rao  writes:

> Over the weekend I thought about this issue of configuring
> `org-speed-commands' more easily, and I believe I have come up with a
> simpler solution that I have provided in the attached patch.
>
> This patch creates a new function `org-speed-command-add' that can be
> used to add new speed command shortcuts to `org-speed-commands', as
> well as modify existing shortcuts. This function takes as argument an
> alist in the same format as `org-speed-commands'. For each command for
> which the shortcut key is already present in `org-speed-commands', the
> old command is replaced with the new command at the same position.
> Commands with brand new shortcut keys are added to the user section of
> `org-speed-commands'.
>
> I believe this patch strikes a balance between power users, who can
> still directly customize `org-speed-commands', and non-experts, who
> may want to add/modify some speed commands without having to
> understand the structure and organization of `org-speed-commands'.

I am not sure about usefulness of the proposed command. For non-power
users, we have cusomize interface. It should work just fine without a
need to introduce another function.

Also, org-speed-command-add may behave strangely if the argument
contains descriptive headline like ("My command group title") as its
first element.

Best,
Ihor



[PATCH v3] org-encode-time compatibility and convenience helper

2022-05-03 Thread Max Nikulin

On 26/04/2022 16:07, Ihor Radchenko wrote:


LGTM. I think you can go ahead and continue with the followup patch
making use of the new macro.


The attached patch set is assumed to be complete.

I have no chance to thoroughly test it. Existing unit tests pass for 
Emacs-26 and Emacs-27. Nothing has changed for Emacs-25, as for the 
"main" branch one test fails. I have not tried Emacs-28 or the current 
git version.


In comparison to the previous patch version I have expanded the 
docstring and added a bit more tests. I have tried to support recently 
committed to Emacs 6-elements list for `encode-time', but I do not like 
the following compile-time warning:



In toplevel form:
org-macs.el:1397:23:Warning: encode-time called with 1 argument, but requires
6+


I had to carve the patch originally posted by Paul Eggert for the Emacs 
repository to adapt it for the Org repository and to drop 
org-encode-time-1 chunks.

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54764#10

The largest patch replaces all calls of `encode-time' to `org-encode-time'

Goals of `org-encode-time':
- it should work at the compile or load time to minimize runtime 
performance impact,
- since both ways to call `encode-time' are necessary (in a half of 
cases a list returned by `decode-time' is available, in other cases 
timestamps are assembled from scratch, none is preferred), it should be 
convenient in both cases,
- it should allow Org to work even if support of multiple `encode-time' 
arguments will be removed from Emacs,
- it should allow to avoid a pitfall with Emacs-27+ `encode-time': DST 
argument is taken into account when the function called with single list 
argument but it is ignored when multiple arguments is passed. 
`org-encode-time' respects DST value unless it is running in Emacs-26 or 
earlier. I have not added special code for old versions considering it 
as graceful degradation.


Finally, let me remind that these changes are result of the following 
discussions:


Ignacio Casso to emacs-orgmode. [BUG] org-agenda thinks timestamps after 
23:00 correspond to the next day.  Tue, 29 Mar 2022 15:09:10 +0200. 
https://list.orgmode.org/paxpr06mb7760238f410cbe3203f78ee0c6...@paxpr06mb7760.eurprd06.prod.outlook.com


https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54731
https://list.orgmode.org/8b85c879-4f9b-eac3-e700-f176cc588...@gmail.com
#54731 - Please, revert part of dd0727e1ec1 related to Org mode 
(`encode-time') - GNU bug report logs


https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54764
https://list.orgmode.org/5ed963b2-3fa8-48d8-627e-bc0571d15...@gmail.com
#54764 - encode-time: make DST and TIMEZONE fields of the list argument 
optional ones - GNU bug report logsFrom fbddfa8cfeecc8465117eacf101a0880cfc13775 Mon Sep 17 00:00:00 2001
From: Paul Eggert 
Date: Sat, 9 Apr 2022 00:17:09 -0700
Subject: [PATCH 1/6] Use unknown DST instead of standard time in timestamps

* lisp/ol.el (org-store-link): Prefer plain (encode-time ...)
to (apply 'encode-time ...), for speed.
* lisp/org-macs.el (org-parse-time-string): Return unknown DST,
not standard time.
* lisp/org.el (org-read-date-analyze): Return a timestamp with a DST
flag of -1 (unknown) rather than nil (standard time).

Max Nikulin:
A larger patch "Improve Org usage of timestamps" was suggested in
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54764#10

Changes selected for this patch normalizes timestamp format:
if it is a list than it should contain 9 elements to be compatible
with Emacs-27 and Emacs-28 `encode-time' single argument, nil should not
be used for DST field since it means standard time while actual value
is unknown and should be guessed.

Ignacio Casso reported a problem with agenda
https://list.orgmode.org/paxpr06mb7760238f410cbe3203f78ee0c6...@paxpr06mb7760.eurprd06.prod.outlook.com
due to Emacs commit dd0727e1ec1 changing Org code.  It was mostly reverted
by 8ef37913d3 (bug#54731).  Code in the Org repository did not have
the bug, but it safer to add protection against similar refactoring.
---
 lisp/ol.el   | 4 +---
 lisp/org-macs.el | 2 +-
 lisp/org.el  | 2 +-
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/lisp/ol.el b/lisp/ol.el
index d4bd0e40c..0de9c921b 100644
--- a/lisp/ol.el
+++ b/lisp/ol.el
@@ -1618,9 +1618,7 @@ non-nil."
 	  (setq link
 		(format-time-string
 		 (car org-time-stamp-formats)
-		 (apply 'encode-time
-			(list 0 0 0 (nth 1 cd) (nth 0 cd) (nth 2 cd)
-			  nil nil nil
+		 (encode-time 0 0 0 (nth 1 cd) (nth 0 cd) (nth 2 cd
 	  (org-link-store-props :type "calendar" :date cd)))
 
((eq major-mode 'w3-mode)
diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index 8535bf2cd..241155064 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -1412,7 +1412,7 @@ This should be a lot faster than the `parse-time-string'."
 	(string-to-number (match-string 4 s))
 	(string-to-number (match-string 3 s))
 	(string-to-number (match-string 2 s))
-	nil nil nil))
+	nil -1 nil))
 
 (defun org-matcher-time 

Re: [BUG] In recent GNU emacs master org-capture hangs [9.5.3 (release_9.5.3-465-gd7dc62 @ /home/oub/emacs/site-lisp/packages/org/)]

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

> Uwe Brauer  writes:
>> Here is one of the templates
>> ("mt" "Tutorias Headings"
>> entry (file+headline "~/ALLES/HGs/tex/vorlesungen/Tutorias/tutorias.org" 
>> "Tutorials")
>> "* TODO %^{Task} %T : %:from %:subject %^G\n- From :: %:from\n- Subject :: 
>> %:subject\n- Date :: %:date\n- Email :: %a\n\n%?\n%i")
>> 
>> So I in my gnus message 
>> 
>> 1. I fire up org-capture
>> 
>> 2. I am asked to the Task, I type but then Emacs hangs, and I have
>> to abort the operation. That did not happen with git master
>> 1f78ca45f8d534e51c1e30e9225d1da8b2e50650

> Could you please provide detailed steps how to reproduce starting from
> emacs -Q?

My apologies, I downgraded both Emacs and org and the problem still
persists, so either it is a package I installed in the meantime or some
change in my settings.

I try to debug this and report back

Uwe 


smime.p7s
Description: S/MIME cryptographic signature


[BUG] - Statistics cookie is part of the org heading title

2022-05-03 Thread Fabian
Hi everybody,

I would like to report his behaviour as a bug: 

Example:

* Some Heading Title [0/1]  ;; cursor in this line when executing
** TODO Some Todo Item

-> result is "Some Heading Title [0/1]"

-> desired result would be "Some Heading Title"


I don't see any reason why the statistics cookie should be part of the title: 
it should be a separate component.

The Topic has beend posted on Stack here: 
https://emacs.stackexchange.com/questions/71592/extract-org-heading-title-without-task-count-e-g-0-0?noredirect=1#comment115659_71592

Best Regards, 

Fabian



org-startup-folded does not work with directory local variables

2022-05-03 Thread Max Fujimoto
Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 
1.17.6)

The variable org-startup-folded does not work expected in .dir-locals.el.The 
option "#+startup: fold" works as expected.


To replicate 
- start emacs -q- create a test dir    - create or copy an .org file 
with a few headers, sub headers and some content in(to) the test dir.
    - add "((org-mode . ((org-startup-folded . t" to "./.dir-locals.el"    
- open the org file    - check M-x describe-variable to confirm variable 
org-startup-folded is set to t and not default value


thanks


Bug ? : No indentation for the text in inline tasks

2022-05-03 Thread Nicolas Odermatt-Lemay
Greetings,

Step to reproduce:
1- Enable (org-indent-mode) in an org buffer.
2- Use the command (org-inlinetask-insert-task)
3- Insert some text between the task's title and the keyword END
4- Notice that the text between the title and the keyword END isn't
properly indented.

I'm not sure if this is helpful, but I noticed that we have the right
indentation when using the code from org-inlinetask.el of this old
repository:
https://github.com/ngz/org-mode-lists/blob/master/lisp/org-inlinetask.el

Thanks for your work, org-mode is an amazing piece of software.


Re: [BUG] In recent GNU emacs master org-capture hangs [9.5.3 (release_9.5.3-465-gd7dc62 @ /home/oub/emacs/site-lisp/packages/org/)]

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

> Uwe Brauer  writes:
>> Here is one of the templates
>> ("mt" "Tutorias Headings"
>> entry (file+headline "~/ALLES/HGs/tex/vorlesungen/Tutorias/tutorias.org" 
>> "Tutorials")
>> "* TODO %^{Task} %T : %:from %:subject %^G\n- From :: %:from\n- Subject :: 
>> %:subject\n- Date :: %:date\n- Email :: %a\n\n%?\n%i")
>> 
>> So I in my gnus message 
>> 
>> 1. I fire up org-capture
>> 
>> 2. I am asked to the Task, I type but then Emacs hangs, and I have
>> to abort the operation. That did not happen with git master
>> 1f78ca45f8d534e51c1e30e9225d1da8b2e50650

> Could you please provide detailed steps how to reproduce starting from
> emacs -Q?

I recovered a working version. For this I downgraded emacs and org mod
and all my lisp packages installed via the emacs package system.

Then I upgraded org to the actual git master/main version. It still worked.

When I upgrade GNU emacs to the actual master, I encountered problems
with some of the packages (I recall having this problem a couple of days
ago) so I needed to upgrade some packages and that triggered the
problem.

So I downgraded to the GNU emacs version from November and the working
emacs package version. Everything is fine.

I need this org functionality now and have to time to fiddle around but I
try to find out the culprit by the end of June.


Regards

Uwe Brauer 


smime.p7s
Description: S/MIME cryptographic signature


Re: org-startup-folded does not work with directory local variables

2022-05-03 Thread Jeremie Juste
Hello Max,


On Tuesday,  3 May 2022 at 00:37, Max Fujimoto wrote:
> Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo
> version 1.17.6)


I must apologise for, I haven't made the jump to emacs 28 yet:  GNU Emacs 27.2 
(build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.24) of 2022-01-16.

I'm on the following version of Org mode version 9.5.3 
(release_9.5.3-467-g2bd34e @ /home/djj/src/org-mode/lisp/)

and I don't know where is .dir-locals.el.

but, with the following unfoled file /tmp/test.org

* Some Heading Title [0/2] 
** TODO Some Todo Item
** TODO heading 3


the following command

$ emacs -Q -L ./lisp -l org   --eval "(setq org-startup-folded t)"
/tmp/test.org

Produces your desired results

* Some Heading Title [0/2] ...


HTH,
Jeremie



Re: DOC "Org Mode tools": orgparse is missing

2022-05-03 Thread TRS-80
Patches welcome?  :)

Cheers,
TRS-80




Re: Agenda without todos only if there is no other timestamp

2022-05-03 Thread TRS-80
TRS-80  writes:

> On 2022-04-05 04:48, Karl Voit wrote:
>> Hi,
>> I've got following custom agenda for exporting:
>> | ("n" "no TODO events +180d"
>> |  ((agenda "no TODO events +180d"
>> |   ((org-agenda-span 180)
>> |(org-agenda-time-grid nil)
>> |(org-agenda-entry-types '(:timestamp :sexp))
>> |(org-agenda-skip-function
>> | '(or
>> |   (org-agenda-skip-entry-if 'todo 'any);; skip if any
>> TODO state is found
>> |   (org-agenda-skip-entry-if 'category "errors");; skip
>> if any TODO state is found
>> |   (my-skip-tag "lp")
>> |   )
>> |  nil (,(concat my-org-files-path "agenda_180d_filtered_raw.html")))
>> (don't mind the stupid name - I may fix this as it is misleading
>> here)
>> This results in an HTML file that contains my appointments without
>> the tasks.
>> Unfortunately, I sometimes seem to schedule appointments within open
>> todos such as:
>> | * NEXT talk with Steve about the project X
>> | SCHEDULED: <2022-04-05 Tue>
>> |
>> | - [X] ask him for a time-slot
>> | - we settled for: <2022-04-05 Tue 14:00-15:00>
>> Of course, those appointments are lost in my agenda export as
>> specified above. This is a bummer and I want to fix this somehow.
>> Tasks should be omitted only if there is no other time-stamp than
>> deadline or scheduled.
>> org-agenda-skip-if lists:
>> | scheduled Check if there is a scheduled cookie
>> | notscheduled  Check if there is no scheduled cookie
>> | deadline  Check if there is a deadline
>> | notdeadline   Check if there is no deadline
>> | timestamp Check if there is a timestamp (also deadline or
>> scheduled)
>> | nottimestamp  Check if there is no timestamp (also deadline or
>> scheduled)
>> | regexpCheck if regexp matches
>> | notregexp Check if regexp does not match.
>> | todo  Check if TODO keyword matches
>> | nottodo   Check if TODO keyword does not match
>> How is it possible to accomplish this? I think this would require
>> something like "Check if there is a timestamp (except deadline or
>> scheduled)" which isn't available yet.
>> Any ideas on that one?
>
> I think you will need to write a custom ~org-agenda-skip-function~.
>

I realized there is probably an even easier way (no custom ELisp
required), simply by creating a separate child heading for the meeting,
which should then show up.  Assuming I am following you correctly, how
about:

#+begin_src org

* PROJECT Project X
  :PROPERTIES:
  :CATEGORY: P:X
  :END:

** PROJECT Discuss 'topic' with Steve

*** DONE Ask Steve for a time-slot

*** Meeting with steve
<2022-04-05 Tue 14:00>--<2022-04-05 Tue 15:00>

#+end_src

N.B. the indentation levels.

Couple notes here:

1. If you set CATEGORY on the parent, and have enabled inheritance, the
'P:X' should appear on left side in your agenda, at the time of this
meeting, giving context.  The 'P:' convention is just what I use to
denote a Project (as opposed to an Area).

2. I follow GTD here, where anything with more subtasks is itself also
considered another 'project'.  You don't have to.  In fact one of my
todo keywords is actually PROJECT.

3. I guess you could use SCHEDULED just as well, but if you carefully
read the manual, this is not the intent of SCHEDULED.  An appointment
(like this) should simply be a time slot (as I showed above).  You can
of course do whatever you like.  :)

I have included some things here that I might do which are not strictly
necessary to solving your problem, but hopefully you can adapt this to
your needs.

Cheers,
TRS-80




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

2022-05-03 Thread Jeremie Juste
Hello Karl,

On Tuesday,  3 May 2022 at 11:15, Karl Voit wrote:
>
> I tried this neat code snippet today with Emacs 26.3 and Org-mode
> 9.1.9 and I got an error:
>
> | org-export-barf-if-invalid-backend: Unknown "nil" back-end: Aborting export
>
> When I execute the following code, I get the same error:
> | (setq region "/foo/ *bar* https://example.com baz")
> | (org-export-string-as region 'md t '(:with-toc nil))
>
> Could it be that I don't have "md" as backend somehow? Is there a
> hidden requirement?

with
$ emacs -Q -L ./lisp -l org /tmp/test.org

then C-c C-e, I don't have markdown in the default export options.

tested with, Org mode version 9.5.3 (release_9.5.3-467-g2bd34e @
/home/djj/src/org-mode/lisp/).

And I still work with (require 'ox-md).

Best regards,
Jeremie



Re: [PATCH] speed commands: error message when a key is not associated with a command

2022-05-03 Thread Juan Manuel Macías
Ihor Radchenko writes:

> It is more complex and I do not see a clear benefit of introducing a
> whole new hook. It would only be useful for people who define a large
> number of extra speed command handlers.

Yes, I agree. Also I'm afraid that this idea of mine added a drawback as
a bonus track: it would be necessary to modify all the functions that
activate the speed commands because, otherwise, it would return an error
anywhere outside the activation contexts. Precisely because of this:

(pcase (run-hook-with-args-until-success 'org-speed-command-strict-hook _)
  ('nil (error "Command not defined: \"?\" for help"))
  (symbol (run-hook-with-args-until-success
  'org-speed-command-strict-hook _)))

And I suppose that the functions should consist of a conditional of the
type: "if the context is given -> activate the speed commands, otherwise
-> self-insert-command". Or something like that. Too hacky.

On the other hand, I now seriously doubt whether a patch would be worth
it, even if a defcustom was added. I think you're also right about what
you said at the beginning: considering how speed commands are designed,
it's hard to implement a clean, general solution. I think I'm going to
leave this patch in the fridge for now, though I also encourage other
potential users of speed commands to join the discussion.

(Perhaps, instead of a patch, some tips could be added to the manual (or
to any other relevant site) so that users who want to extend this
functionality apply this type of hacks, as I have done in my particular
case...).

Best regards,

Juan Manuel 



Re: Org as a workspace (an impromptu reflection)

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

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

I've read here and there interesting things about org-roam, but I admit
I've never had the courage to try it. Partly due to lack of time and
partly because with my current Org setup I am reasonably satisfied. In
any case, everything I described I get with (if the expression is
allowed) 'org-vanilla' :-) (+ a number of must-have packages, such as
org-ql/helm-org-ql, org-super-links, org-transclusion, and more).

Best regards,

Juan Manuel 



Re: Report error in scheme evaluation

2022-05-03 Thread Felipe Lema



On 2022-04-30 06:35, Neil Jerram wrote:

On Sat, 30 Apr 2022 at 09:14, Ihor Radchenko  wrote:

Felipe Lema  writes:


I just realized I was un-CCed out of the thread

Here's the updated patch with the requested changes (actually single one)

Lemme know if I'm missing anything else.

Can you update the patch making it a proper patch under your name?
See https://orgmode.org/worg/org-contribute.html#patches for
instructions.

Hi Felipe,

Sorry for not commenting on this back in December.

Is the error that your patch shows equivalent to (or less than) taking
a look at the '*Geiser dbg*' buffer?  If it is, I wonder if it would
be better just to pop up the existing '*Geiser dbg*' buffer?  (Example
appended below.)

Best wishes,
 Neil

--- example of *Geiser dbg* buffer -
geiser-debugger
ice-9/boot-9.scm:1669:16: In procedure raise-exception:
Unbound variable: categorize-transactions-by-weeks

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]>
ice-9/boot-9.scm:1669:16: In procedure raise-exception:
Unbound variable: categorize-transactions-by-weeks

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]>
Expression evaluated was:

;; -*- geiser-scheme-implementation: guile -*-
(load "nationwide.scm")
(let ((classification '()))
(categorize-transactions-by-weeks (pre-2022 2020)
(two-column-table->alist classification) #t)
)
--- example of *Geiser dbg* buffer -


Hey, Neil


I believe there's an customizable option for that (opening the geiser 
repl with the debugger on). The patch I posted mimics current behavior 
with python, although the latter does have an option to pop the repl.


Lemme check if I can work something out and I'll post a new patch. I'll 
also address  Ihor's request for a proper patch.


Gards

Felipe




Re: [BUG] - Statistics cookie is part of the org heading title

2022-05-03 Thread Daniel Fleischer
Fabian  writes:

> I don't see any reason why the statistics cookie should be part of the title: 
> it should be a separate component.

According to the spec, the statistics cookie can appear anywhere, it's a
text element. It can appear in a headline where it has more meaning and
also appear anywhere in the headline, not necessarily at the end. The
function you failed to mention but is mentioned in the link is
`org-heading-components` which does a simple split around syntax parts:
stars, TODO word, text, tags. If you don't want to see the cookie you
can remove it easily from text using regex.

-- 

Daniel Fleischer



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

2022-05-03 Thread Daniel Fleischer
Karl Voit  writes:

> Could it be that I don't have "md" as backend somehow? Is there a
> hidden requirement?

The variable `org-export-backends` default value is  

'(ascii html icalendar latex odt) 

so you need to add 'md. 

-- 

Daniel Fleischer



Re: [BUG] - Statistics cookie is part of the org heading title

2022-05-03 Thread Samuel Wales
some code removes it.  for example creating a link to a headline using capture.

On 5/3/22, Daniel Fleischer  wrote:
> Fabian  writes:
>
>> I don't see any reason why the statistics cookie should be part of the
>> title: it should be a separate component.
>
> According to the spec, the statistics cookie can appear anywhere, it's a
> text element. It can appear in a headline where it has more meaning and
> also appear anywhere in the headline, not necessarily at the end. The
> function you failed to mention but is mentioned in the link is
> `org-heading-components` which does a simple split around syntax parts:
> stars, TODO word, text, tags. If you don't want to see the cookie you
> can remove it easily from text using regex.
>
> --
>
> Daniel Fleischer
>
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



Re: [BUG] - Statistics cookie is part of the org heading title

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

> some code removes it.  for example creating a link to a headline using 
> capture.

Yeah. org-link--normalize-string. But it is internal function, so I would
not rely on it.

Also, rather than relying on regexps, I would use
org-element-headline-parser, extract parsed :title property, and filter
out statistics-cookie objects.

Best,
Ihor



[BUG] 67275f4 broke evil-search Re: [PATCH 10/35] Implement link folding

2022-05-03 Thread Tom Gillespie
Hi Ihor,
It seems that this patch (as commit
67275f4664ce00b5263c75398d78816e7dc2ffa6, found using git bisect to
hunt down the issue) breaks search in evil mode when
(evil-select-search-module 'evil-search-module 'evil-search) is set.
The broken behavior is that evil-search no longer searches inside
folded headings. I had a quick look at the changes but couldn't figure
out why these changes might cause the issue. Best,
Tom



Re: [BUG] 67275f4 broke evil-search Re: [PATCH 10/35] Implement link folding

2022-05-03 Thread Ihor Radchenko
Tom Gillespie  writes:

> It seems that this patch (as commit
> 67275f4664ce00b5263c75398d78816e7dc2ffa6, found using git bisect to
> hunt down the issue) breaks search in evil mode when
> (evil-select-search-module 'evil-search-module 'evil-search) is set.
> The broken behavior is that evil-search no longer searches inside
> folded headings. I had a quick look at the changes but couldn't figure
> out why these changes might cause the issue. Best,

Evil re-implements isearch functionality and it does it only partially.
It appears to respect isearch-filter-predicate, but not
isearch-mode-end-hook.
I expect this to be a bug on evil side.

Meanwhile, you can try to set search-invisible to t. It should help (in
theory).

Best,
Ihor