Re: Please help by becoming a maintainer for an Org Babel file

2021-03-01 Thread Bastien
Hi Andy and Kyle,

Kyle Meyer  writes:

> Andy Klock writes:
>
>> Hi all, am I too late?
>>
>> ‐‐‐ Original Message ‐‐‐
>> On Monday, October 26, 2020 4:07 AM, Bastien  wrote:
>>
>>> If you feel like proposing yourself for maintaining an Org Babel
>>> language, that would be super helpful.
>>
>> Can I throw my hat in to help maintain ob-sql.el ?
>
> While I of course can't speak for Bastien (and am not sure what this
> thread involved behind the scenes here), it doesn't appear that anyone
> volunteered for ob-sql.  And regardless any help would be greatly
> appreciated.

FWIW I do confirm that any help is welcome!  Nobody is ever "too late"
in volunteering for maintaining an ob-* file.

Thanks in advance for your time and dedication,

-- 
 Bastien



Re: Simple org-publish configuration example in manual does not work

2021-03-01 Thread Kyle Meyer
dalanicolai writes:

> Hello, sorry for sending this email directly, but currently sending mail
> from Emacs does not work correctly.

No worries.  There's no requirement to send it from Emacs.

[...]
> It would be great if these two small point in the manual, which is
> otherwise great, could
> get updated.
>
> 1. add the required :publishing-function keyword to the documentation (with
> the correct function value)
> 2. change the name of the default function from org-publish-org-to-html ->
> *org-html-publish-to-html*

Thanks for reporting.  Done in 8244e7ba8 and b712b9618.



Re: [tip for EXWM users] An alternative method for isolate trees

2021-03-01 Thread Kyle Meyer
Julian M. Burgos writes:

> I have not noticed that org-tree-to-indirect-buffer
> reuses the indirect buffer when you call it for a second time.
> According to the manual, "with a C-u prefix, do not remove the
> previously used indirect buffer", but that does not seem to work.
> When you do Cu-Cc-Cx-b from a buffer that already has an indirect
> buffer you get a "cannot modify an area being edited in a dedicated
> buffer".  If you try it from a different buffer, the prefix is ignored
> and the indirect buffer is assigned to the tree from the last buffer.

Hmm, could you provide a reproducer for the problem?  Here's what I
tried with the current master (afd75d05a), Emacs 27.1, and no custom
configuration.

--8<---cut here---start->8---
* a
a content
* b
b content
--8<---cut here---end--->8---

 - on "a", C-c C-x b  ;; org-tree-to-indirect-buffer
   Displays -a-1 buffer.

 - move to "b", C-u C-c C-x b
   Displays -b-1 buffer, a-1 buffer still exists.



Re: [PATCH] org-mac-link: Disable Evernote capture by default

2021-03-01 Thread Kyle Meyer
Kyle Meyer writes:

> Thanks for the patch.  Ideally someone that uses macOS would provide a
> review.  Based on the history of the file, I've cc'd two people that may
> be willing/able to do so.

Applied (afd75d05a).  Thanks again.



Re: [PATCH] ~org-font-lock-add-priority-faces~: ensure priority cookies are in a headline

2021-03-01 Thread Kyle Meyer
Sébastien Miquel writes:

> Priority cookies are always in a headline.
>
> The attached patch speeds up fontification of a 1k lines buffer by 0.1
> second.

Thank.  Pushed (a03b4656c), adding this...

> Note that the variable org-priority-regexp can't be modified since
> it is used in the agenda and in org-get-priority.

... bit to the commit message, and also adding a trailer to credit Ihor
for the initial suggestion.



Re: Babel: Programmatically evaluate a heading and subtrees?

2021-03-01 Thread Ken Mankoff
Hi Nathan,

On 2021-02-20 at 11:10 -08, Nathan Neff  wrote...
> I have some code like this:
>
> * Heading 1
>
> # code block name:FOO
>
> ** Subheading 1
>
> # code block
>
> ** Subheading 2
>
> # code block
>
> I find that I often want to evaluate the code in Heading 1 and its
> subheadings.
>
> Currently, I navigate to Heading 1 and then use org-babel-execute-subtree
>
> I see that there's a function called org-babel-goto-named-src-block,
> so I think I could write a small function to jump to FOO in Heading 1
> and then run execute subtree and then jump back to my previous
> location in Emacs.
>
> Is there a more programmatic or built-in way? For example:
> org-babel-execute-block-and-subheadings FOO

What about,

(defun my/eval-parent-subtree()
  (save-excursion
(outline-up-heading 1)
(org-babel-execute-subtree)))

And then binding that to some key or something? Or (outline-up-heading 99) if 
you always want to go to "*". Or make that line a bit more dynamically 
controllable by use of 'prefix-arg' ?

  -k.



Re: [tip for EXWM users] An alternative method for isolate trees

2021-03-01 Thread Juan Manuel Macías
Hi Julian,

"Julian M. Burgos"  writes:

> This does not seem to be a limitation from emacs, as it is possible to
> open multiple indirect buffers from a base buffer, using for example
> clone-indirect-buffer. So it should be possible to make a function
> combining "clone-indirect-buffer" and "org-narrow-to-subtree" perhaps?
> I am thinking so this option is available not only to EXWM users.

I think that combining clone-indirect-buffer and org-narrow-to-subtree
would work well. Another way to isolate several trees at once is by
using the excellent package org-sidebar
(https://github.com/alphapapa/org-sidebar). In fact, I borrowed from
this package the idea of renaming the new buffers with the string :: (if
I open helm and start typing ::, it shows me the list of isolated trees,
so it's very useful to have a dedicated string). Although my method for
isolating each tree is more pedestrian :-). And it only makes sense in
EXWM...

Best regards,

Juan Manuel 



Re: [tip for EXWM users] An alternative method for isolate trees

2021-03-01 Thread Julian M. Burgos
Hi Juan,

You are right. :) I have not noticed that org-tree-to-indirect-buffer reuses 
the indirect buffer when you call it for a second time.  According to the 
manual, "with a C-u prefix, do not remove the previously used indirect buffer", 
but that does not seem to work.  When you do Cu-Cc-Cx-b from a buffer that 
already has an indirect buffer you get a "cannot modify an area being edited in 
a dedicated buffer".  If you try it from a different buffer, the prefix is 
ignored and the indirect buffer is assigned to the tree from the last buffer.

This does not seem to be a limitation from emacs, as it is possible to open 
multiple indirect buffers from a base buffer, using for example 
clone-indirect-buffer.  So it should be possible to make a function combining 
"clone-indirect-buffer" and "org-narrow-to-subtree" perhaps?  I am thinking so 
this option is available not only to EXWM users.

Ideally, there should be an option to allow org-tree-to-indirect-buffer to 
create more than one indirect buffer if desired.

My best,

Julian

Juan Manuel Macías writes:

> Hi Julian, thanks for your comment.
>
> "Julian M. Burgos"  writes:
>
>> Thank you, although I tested your functions and compared with the
>> original org-tree-to-indirect-buffer, the only difference I see is
>> that your function creates a new exwm workspace. The original function
>> already creates indirect buffers with their own names (using a slash
>> instead of the double colons). Or I am missing something?
>
> org-tree-to-indirect-buffer creates a new buffer, but (as far as I know)
> does not allow accumulating buffers. In other words, you cannot have
> several isolated trees at the time. In this method it just occurred to
> me to configure org-indirect-buffer-display as new-frame and take
> advantage of EXWM frame management.
>
> Best regards,
>
> Juan Manuel


--
Julian Mariano Burgos, PhD
Hafrannsóknastofnun, rannsókna- og ráðgjafarstofnun hafs og vatna/
Marine and Freshwater Research Institute
Botnsjávarsviðs / Demersal Division
  Fornubúðir 5, IS-220 Hafnarfjörður, Iceland
www.hafogvatn.is
Sími/Telephone : +354-5752037
Netfang/Email: julian.bur...@hafogvatn.is



Re: [tip for EXWM users] An alternative method for isolate trees

2021-03-01 Thread Juan Manuel Macías
Hi Julian, thanks for your comment.

"Julian M. Burgos"  writes:

> Thank you, although I tested your functions and compared with the
> original org-tree-to-indirect-buffer, the only difference I see is
> that your function creates a new exwm workspace. The original function
> already creates indirect buffers with their own names (using a slash
> instead of the double colons). Or I am missing something?

org-tree-to-indirect-buffer creates a new buffer, but (as far as I know)
does not allow accumulating buffers. In other words, you cannot have
several isolated trees at the time. In this method it just occurred to
me to configure org-indirect-buffer-display as new-frame and take
advantage of EXWM frame management.

Best regards,

Juan Manuel



Re: [tip for EXWM users] An alternative method for isolate trees

2021-03-01 Thread Julian M. Burgos
Hi Juan Manuel,

Thank you, although I tested your functions and compared with the original 
org-tree-to-indirect-buffer, the only difference I see is that your function 
creates a new exwm workspace.  The original function already creates indirect 
buffers with their own names (using a slash instead of the double colons).  Or 
I am missing something?

My best,

Julian

Juan Manuel Macías writes:

> Hi,
>
> Since EXWM uses Emacs frames as virtual desktops, I have written this
> alternative method of `org-tree-to-indirect-buffer', which I share here.
> With this method I can have several isolated trees, with their own name,
> and access them quickly (with helm-buffer-list, for example):
>
> #+begin_src emacs-lisp
>   (defun my-goto-buffer-regexp (regexp)
> (dolist (buffer (buffer-list))
>   (let ((name (buffer-name buffer)))
>   (when (and name (not (string-equal name ""))
>  (string-match regexp name))
> (switch-to-buffer buffer)
>
>   (defun my-org-tree-to-indirect-buffer ()
> (interactive)
> (let ((buf (buffer-name))
> (ind-buf (replace-regexp-in-string "\\[.+\\]" "" (nth 4 
> (org-heading-components
> (org-indirect-buffer-display 'new-frame))
>   (org-tree-to-indirect-buffer)
>   (my-goto-buffer-regexp ind-buf)
>   (rename-buffer (concat buf "::" ind-buf
> #+end_src
>
> Best regards,
>
> Juan Manuel


--
Julian Mariano Burgos, PhD
Hafrannsóknastofnun, rannsókna- og ráðgjafarstofnun hafs og vatna/
Marine and Freshwater Research Institute
Botnsjávarsviðs / Demersal Division
  Fornubúðir 5, IS-220 Hafnarfjörður, Iceland
www.hafogvatn.is
Sími/Telephone : +354-5752037
Netfang/Email: julian.bur...@hafogvatn.is



[tip for EXWM users] An alternative method for isolate trees

2021-03-01 Thread Juan Manuel Macías
Hi,

Since EXWM uses Emacs frames as virtual desktops, I have written this
alternative method of `org-tree-to-indirect-buffer', which I share here.
With this method I can have several isolated trees, with their own name,
and access them quickly (with helm-buffer-list, for example):

#+begin_src emacs-lisp
  (defun my-goto-buffer-regexp (regexp)
(dolist (buffer (buffer-list))
  (let ((name (buffer-name buffer)))
(when (and name (not (string-equal name ""))
   (string-match regexp name))
  (switch-to-buffer buffer)

  (defun my-org-tree-to-indirect-buffer ()
(interactive)
(let ((buf (buffer-name))
  (ind-buf (replace-regexp-in-string "\\[.+\\]" "" (nth 4 
(org-heading-components
  (org-indirect-buffer-display 'new-frame))
  (org-tree-to-indirect-buffer)
  (my-goto-buffer-regexp ind-buf)
  (rename-buffer (concat buf "::" ind-buf
#+end_src

Best regards,

Juan Manuel