Re: [PATCH] lisp/org-capture.el: Add hook & hook options to org-capture (Valentin Herrmann)

2022-02-08 Thread Ihor Radchenko
No Wayman  writes:

> I've implemented what you're proposing here (and much more) in a 
> package you may find useful a couple years ago. I pitched adopting 
> some of the ideas into org-mode proper and was willing to do the 
> work. My proposal was met with enthusiastic silence:
>
> https://www.github.com/progfolio/doct

I think Nicolas gave some reasonable comments, didn't he? He suggested
to incorporate some of the ideas into the existing Org mode code.

https://orgmode.org/list/87wo66t8i7@gmail.com

Best,
Ihor



Re: the old "zsh:1: command not found: latexmk"

2022-02-08 Thread Tim Cross


bruce robertson  writes:

> I have the directory, /usr/local/texlive/2021/bin/universal-darwin, in .zshrc 
> & .zprofile
> AND
> in exec-path
> Do I need to file a bug to get help?
>
> Thanks,
> Bruce

Have you verified latexmk is in one of those directories?

What does the command

which latexmk

show on your system?





Re: [PATCH v5 0/4] ox-texinfo: Define definition commands using description lists

2022-02-08 Thread Nicolas Goaziou
Hello,

Jonas Bernoulli  writes:

> This fixes the small last minute defect in v4 and removes a mention
> of an unused argument like you told me too.
>
> This also adds an export option to enable the "compact itemx" syntax
> for all lists in a file.  I mentioned that I would like to be able to
> enable this feature for a complete file but haven't heard back yet.
>
> I think it makes sense to allow enabling this per file because I would
> expect that it is much more likely that someone would want to use this
> feature for all lists or for no lists at all, than it is for them to
> only want to use it for certain lists.
>
> I picked "compact-itemx" as the name of the export option but it seems
> that the names of most other options are much shorter, so maybe just
> "itemx" would be better.  I am a bit unsure about the name of the
> variable as well.

Applied. Thank you! We can always revisit the variable name later.

Could you provides an ORG-NEWS entry for this?

Regards,
-- 
Nicolas Goaziou



Re: Shell SRC blocks under Windows

2022-02-08 Thread Matt


  On Tue, 08 Feb 2022 04:47:04 -0500 H. Dieter Wilhelm 
 wrote 

 > Not yet, I'm still grappling with your message
 > <17ecbfb46e9.e16df906236239.6523271905911672...@excalamus.com> and
 > ob-shell.el.  I'll come back to you when I'm through.

Okay, feel free to let me know if something I wrote is unclear or to ask any 
questions.



the old "zsh:1: command not found: latexmk"

2022-02-08 Thread bruce robertson
I have the directory, /usr/local/texlive/2021/bin/universal-darwin, in
.zshrc & .zprofile
AND
in exec-path
Do I need to file a bug to get help?

Thanks,
Bruce

-- 
λέγει αὐτῷ Ἰησοῦς Ἐγώ εἰμι ἡ ὁδὸς καὶ ἡ ἀλήθεια καὶ ἡ ζωή· οὐδεὶς ἔρχεται
πρὸς τὸν Πατέρα εἰ μὴ δι' ἐμοῦ. ΚΑΤΑ ΙΩΑΝΝΗΝ


Re: [PATCH] lisp/org-capture.el: Add hook & hook options to org-capture (Valentin Herrmann)

2022-02-08 Thread No Wayman



I've implemented what you're proposing here (and much more) in a 
package you may find useful a couple years ago. I pitched adopting 
some of the ideas into org-mode proper and was willing to do the 
work. My proposal was met with enthusiastic silence:


https://www.github.com/progfolio/doct


- :prependNormally newly captured information will 
be appended at
- the target location (last child, last 
table line,
- last list item...).  Setting this property 
will

- change that.
+ :prepend   Normally newly captured information 
will be appended at
+the target location (last child, last 
table line,
+last list item...).  Setting this 
property will

+change that.


Are the white space changes to unrelated properties necessary?
  

+(defcustom org-capture-before-view-hook nil
+  "Hook that is run right after the capture buffer is made 
current.

+The buffer is still narrowed."
+  :group 'org-capture
+  :version "28.1"
+  :type 'hook)
+


This functionality is already provided by `org-capture-mode-hook'. 
Instead of introducing another hook, that can be utilized. An 
illustration using doct's :hook keyword which runs functions 
during org-capture-mode-hook:


Yodel[1] Report 2022-02-08 14:16:58
===

--8<---cut here---start->8---
(yodel
 :save "org-capture-mode-hook-example"
 :packages*
 doct
 :post*
 (require 'org-capture)
 (require 'doct)
 (let ((org-capture-templates
   (doct
`("test"
  :keys "t"
  :file "/tmp/test.org"
  :template "* test"
  :immediate-finish t
  :hook (lambda nil
(message "%S narrowed?: %S"
 (current-buffer)
 (buffer-narrowed-p)))
   (org-capture nil "t")))
--8<---cut here---end--->8---

STDOUT
==

Loading 
/tmp/org-capture-mode-hook-example/straight-bootstrap-snippet.el 
(source)...

Clipboard pasted as level 1 subtree
# narrowed?: t


Environment
===

- emacs version: GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, 
 GTK+ Version 3.24.31, cairo version 1.17.4)

of 2022-01-13
- system type: gnu/linux

Packages


- doct 
 https://github.com/progfolio/doct/commit/9ed9b8c7f7e2ea2d2fb739d65ae4626a1cf16b9f


[1] https://www.github.com/progfolio/yodel


+
+(run-hooks 'org-capture-before-view-hook)
+(if-let ((bvh (org-capture-get :before-view-hook)))
+(funcall bvh))


This pattern implies that functions added via template keywords 
will be run after the equivalent global hooks. That should be 
documented. This pattern could be improved by let-binding each 
hook and adding the templates functions. e.g.



(let ((org-capture-mode-hook
  (append org-capture-mode-hook (org-capture-get :hook t
 (run-hooks 'org-capture-mode-hook))


Note the use of the non-nil LOCAL argument in org-capture-get.
You want to ensure you're accessing the correct plist in the case 
of overlapping capture processes.


   ;; FIXME: This does not do the right thing, we need to remove 
   the

   ;; new stuff by hand it is easy: undo, then kill the buffer
-  (let ((org-note-abort t)
-   (org-capture-before-finalize-hook nil))
+  (let ((org-note-abort t))
 (org-capture-finalize)))
 
 (defun org-capture-goto-last-stored ()


Why was org-capture-before-finalize-hook bound to nil here and 
what is the reason for changing that?






Re: Request For Approval To Contribute To Org Mode

2022-02-08 Thread Samuel Banya
Thanks Corwin :)

On Sun, Feb 6, 2022, at 2:35 PM, Corwin Brust wrote:
> On Sun, Feb 6, 2022 at 1:28 PM Samuel Banya  wrote:
> >
> > Hey there,
> >
> > I can't find my previous email thread, but I asked if anyone could approve 
> > my Sourcehub registration to be able to make commits to Org Mode's repo 
> > going forward.
> >
> > I wasn't sure if Bastien was around to do this though, so I wanted to check 
> > in about this.
> >
> 
> AFAIK only Basiten can approve this, added to this thread.
> 


Re: Org for non-users, part 2: `C-c C-e', a.k.a. `org-export-dispatch'

2022-02-08 Thread Ihor Radchenko
Eduardo Ochs  writes:

> On Mon, 7 Feb 2022 at 10:55, Ihor Radchenko  wrote:
>
>> >   What are the recommended ways to abort org-export-dispatch without
>> >   letting it destroy the "*Org Export Dispatcher*" window and its
>> >   buffer?
>>
>> You cannot. That window acts similarly to transient, but simpler. You
>> can think of *Org Export Disipatcher* as an extended help for
>> read-char-exclusive.
> What do you mean by "you cannot"?

Sorry if I was not clear. I was answering specifically the question you
asking. Elaborating: you cannot abort org-export-dispatch without
letting it destroy the "*Org Export Dispatcher*" buffer. This is because
"*Org Export Dispatcher*" is created inside unwind-protect form like:

(unwind-protect

(and (get-buffer "*Org Export Dispatcher*")
 (kill-buffer "*Org Export Dispatcher*")))

Any time you abort org-export-dispatch, the unwind-protect is going to
kill the buffer.

> I was expecting an answer like this:
>
>   That's difficult to do, but the temporary buffer is generated by the
>   function `org-foo-bar'... you can try to make a copy of
>   `org-foo-bar' called `org-foo-bar-hacked-version', add your own
>   debugging functions to that copy - suggestion: the lines 42 and 99
>   are good places for that - and then you can change the function
>   `org-plic-ploc', that is called by `org-export-dispatch', to make it
>   call `org-foo-bar-hacked-version' instead of `org-foo-bar'...

If your question is about debugging, feel free to M-x debug-on-entry
org-export--dispatch-action. That will suspend execution of
org-export--dispatch-ui called by org-export-dispatch right after the
buffer is created but before Emacs even loop is blocked to read user
input. Reading the source code of org-export--dispatch-ui might also
help.

> One possible meaning of "you cannot" is:
>
>   Org is NOT MEANT to be explored in that way, and this "is not meant
>   to" is in a very strong sense. The last time that a person gave
>   technical information of that kind in the mailing list was 4 or 5
>   years ago, and we banished her from the community and excommunicated
>   her. Her name shall not be mentioned.

In my reply, "you cannot" referred to you cannot because of technical
reasons, as I tried to explain above. You appear to interpret the
wording in a strongly negative sense. Note that I was not trying to attack
you in any way and I am always trying my best to follow GNU Kind
Communication Guidelines [1] in my emails. Also note that my wording
might not be ideal. Either because English is not my native language or
because I may misinterpret the message I am replying to. 

[1] https://www.gnu.org/philosophy/kind-communication.html

Best,
Ihor




Export to ics file with retaining spaces

2022-02-08 Thread Dieter Faulbaum



I normally use this hook:
before-save-hook (delete-trailing-whitespace time-stamp 
copyright-update)


But this is not a good idea, if I use org-icalendar-export-to-ics,
because the spaces at line ends are significant in an ics file.

There is only a org-icalendar-after-save-hook
(and not a org-icalendar-before-save-hook).

Any elegant idea to retain the spaces
(without customizing the before-save-hook for this)?

Thanks for any help



Re: Emacs-orgmode Digest, Vol 192, Issue 8

2022-02-08 Thread Tianshu Wang


Max Nikulin writes:

> Thank you, such approach, unlike mine example, does not have code
> duplication. On the other hand it loads org-protocol on any remote
> command, not only for "files" representing org-protocol URIs. Maybe
> defadvice in org-protocol.el should be changed by newer advice-add with
> a function containing body of the old advice.

Yes, I replaced the original code with advice-add (not fully tested).

(advice-add 'server-execute :before
(defun enable-org-protocol ( r)
  (unless (featurep 'org-protocol) (require 'org-protocol

--
Tianshu Wang



Re: Shell SRC blocks under Windows

2022-02-08 Thread H. Dieter Wilhelm
Matt  writes:

>   On Sun, 06 Feb 2022 12:51:49 -0500 H. Dieter Wilhelm 
>  wrote 
>  > Matt  writes:
>  > 
>  > >   On Sat, 05 Feb 2022 17:22:29 -0500 Matt  wrote 
> 
>  > >
>  > >  >  > But I'm not sure if I'm halfway there with "sh"?  I need to run the
>  > >  >  > following MSYS2 command AND switch between two arguments (for 
> building
>  > >  >  > Emacs).
>  > >  >  > 
>  > >  >  >   \MSYS2\msys2_shell.cmd -mingw64
>  > >  >  > 
>  > >  >  > and
>  > >  >  > 
>  > >  >  >   \MSYS2\msys2_shell.cmd -msys.
>  > >  >  > 
>  > >  >  > How could I achieve this within a src block?
>  > >  > 
>  > >  > I'm not sure I follow you here.  Can you please describe what
>  > >  > you're trying to do and the system you're using (e.g. Windows,
>  > >  > GNU/Linux, Haiku) as well the shell used to run the Emacs instance
>  > >  > you're doing this in?
>  > >  > 
>  > > Excuse me.  Obviously you're using Windows.  :)
>  > 
>  > Yes I have to, but please don't mind, thank you for your interest. :-)
>  > 
>  
> I don't mind. I had asked about the system to help troubleshoot yet
> that info was clearly given in the thread title.  :)
>
>  You said you weren't sure if you're halfway there with "sh".  Is that
>  feeling resolved for you?

Not yet, I'm still grappling with your message
<17ecbfb46e9.e16df906236239.6523271905911672...@excalamus.com> and
ob-shell.el.  I'll come back to you when I'm through.

Thanks a lot for your interest.

   Dieter
-- 
Best wishes
H. Dieter Wilhelm
Zwingenberg, Germany