Re: [BUG] Org-9.6 declares compatibility with Emacs-25.1

2023-01-01 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Max Nikulin  writes:
>
>> lisp/org.el:10:;; Package-Requires: ((emacs "25.1"))
>
> We should indeed bump the minimal required Emacs version.
> Should we use Emacs 26.3 as the minimal version?

We should fix this before Org 9.6.1.
I will leave the decision about exact Emacs version to Bastien.

One notable fact is that Debian oldstable we use on CI [1] appears to
use Emacs 26.1. So, we are probably safe to declare Emacs 26.1
compatibility.

[1] https://builds.sr.ht/api/jobs/915058/manifest

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



Re: [BUG] org-element--cache: (org-agenda) Cached element is incorrect [9.6 (release_9.6-90-gf49ee9 @ /home/stefan/.emacs.d/contrib/org-mode/lisp/)]

2023-01-01 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Thanks! It looks like you found the culprit.
>
> `org-startup-align-all-tables' triggers a function that changes buffer
> contents (tables) during Org loading. For same reason, this function is
> executed with modification hooks being suppressed and cache missing the
> edits as a result.
>
> The problematic commit is
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=9c4d403ada376dca771d9c2dadd7e9eebf4d5f7f

I now moved table alignment code out of `org-unmodified'.
Fixed.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=1cd39c9e3

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



Re: Export Org with Org concept -- Re: Problems with C-c C-e file.org,

2023-01-01 Thread Eduardo Ochs
On Sun, 1 Jan 2023 at 11:02, Ihor Radchenko  wrote:
>
> Eduardo Ochs  writes:
>
> > My conclusion was that Org is much harder to learn than I thought.
> > It's easy to learn if:
> >
> >   1) you're a "user", or
> >   2) you know a lot about debugging Emacs, or
> >   3) the developers like your questions.
>
> I hope that (3) is not your experience with Org ML. If it is, I'd rather
> say "developers understand questions". At least from my perspective.
> Your approach is rather unusual for me, making it difficult to follow
> even after detailed explanations.

Hi Ihor,

(3) _is_ my experience with the Org mailing list.

What I meant by "the developers like your questions" was roughly:
"recognizing that that person deserves help, and giving him tools that
would let him solve his problems in hours instead of in months or
years".

For example, in this thread

https://lists.gnu.org/archive/html/emacs-orgmode/2021-12/msg00674.html

no one considered that if I was asking that then maybe it would be a
good idea to make `org-export-dispatch' more hackeable by beginners...

For example, someone could have said "can you try this? Copy that
function to other file, replace its lines foo and bar by the lines
plic and bletch, and use the ideas in these two blog posts to debug
and inspect its data structures"... but no, that didn't happen - I've
asked lots of technical questions here over the years and never got
detailed answers like that, only answers whose technical details _were
kept as short as possible_, and whose explanations were much closer to
"in English" than to "in Lisp".

A few days ago I added subtitles to my video about "Org for
Non-Users". The links are here,

  http://angg.twu.net/2021-org-for-non-users.html

and some people will prefer to just read this:

  http://angg.twu.net/eev-videos/2021-org-for-non-users.vtt
  http://angg.twu.net/SUBTITLES/2021-org-for-non-users.lua.html

It explains with examples how a "non-user" thinks, and it shows what I
mean by "explanations in Lisp".

  Cheers =/,
Eduardo



Refactor org-babel-shell-initialize? (was Re: ob-shell intentions and paperwork (was Bash results broken?))

2023-01-01 Thread Matt


  On Sat, 31 Dec 2022 07:56:10 -0500  Ihor Radchenko  wrote --- 
 > As for being a macro, there will be not much gain - the convention is
 > mostly designed for things like `cl-defun' aimed to be used in the code.
 > `org-babel-shell-initialize' is only used by `org-babel-shell-names'.

I'm not sure what you mean by "to be used in code".  Do you mean called within 
the global scope?

 > I do not have objections if it were a macro though. (But I do not see
 > how it would help debugging).
 >
 > > Because `org-babel-shell-initialize' is a function factory, you can't 
 > > easily examine or modify their definitions.  `C-h f org-babel-execute:sh' 
 > > jumps to the top of lisp/ob-shell.el.  Changing the definition requires 
 > > reevaluating the definition for all the execute functions (or first 
 > > changing `org-babel-shell-names').
 > 
 > This is indeed a downside. Any better ideas?
 > ob-core dictates that we must have org-babel-execute:lang functions to
 > make things work.

My apologies, I feel there are too many separate issues I've brought up.  Since 
I've already brought them up, let me try to be more clear about them.  

I observe four issues with the current form of `org-babel-shell-initialize':

1. The source is not explicit for a given `org-babel-execute:some-shell', 
making it difficult to debug
2. Source navigation gets confused when looking up help for a generated 
function.  For example, `C-h f org-babel-execute:sh' goes to the top of 
ob-shell.el
3. It does not adhere to the coding convention
4. Except for using the customize interface, changing `org-babel-shell-names' 
requires reevaluating the function generator, currently 
`org-babel-shell-initialize'

Here's my perspective on each point.

1. The source is not explicit for a given `org-babel-execute:some-shell', 
making it difficult to debug

The benefit of using a macro is clarity of the defined functions.  Here's the 
core `org-babel-shell-initialize' functionality as a macro.  Note that it 
doesn't loop through `org-babel-shell-names'.

(defmacro define-babel-shell-1 (shell-name)
  (declare (indent nil) (debug t))
  (let ((function-name (intern (concat "my-org-babel-execute:" shell-name
`(progn
   (defun ,function-name (body params)
 ,(format "Execute a block of %s commands with Babel." shell-name)
 (let ((shell-file-name ,shell-name)
   (org-babel-prompt-command
(or (alist-get ,shell-name org-babel-shell-set-prompt-commands)
(alist-get t org-babel-shell-set-prompt-commands
   (org-babel-execute:shell body params)))
   (defalias
 ',(intern (concat "org-babel-variable-assignments:" shell-name))
 'org-babel-variable-assignments:shell
 ,(format "Return list of %s statements assigning to the block's 
variables." shell-name))
   (defvar ,(intern (concat "org-babel-default-header-args:" shell-name)) 
nil

You can expand to see the definitions:

(pp-macroexpand-expression '(define-babel-shell-1 "csh"))

Is there a way to see the definition of`org-babel-execute:csh' using the 
current `org-babel-shell-initialize', that is, when generated by a function?

Looking at the expansion, I see what appears to be an error:

(alist-get "csh" org-babel-shell-set-prompt-commands)

`org-babel-shell-set-prompt-commands' is an alist keyed by string shell names 
and whose values are shell commands to set the prompt.  `alist-get' uses `eq' 
by default which always returns nil for string comparisons.  That is, 
(alist-get "csh" org-babel-shell-set-prompt-commands) returns nil, not because 
the corresponding alist value is nil.  Rather, because the (eq "csh" "csh") 
comparison evaluates as nil.  The TESTFN probably should be `equal' or 
`string=':

(alist-get "csh" org-babel-shell-set-prompt-commands nil nil 'equal)

Then, it will return the prompt associated with "csh".

All this is visible from the function version of `org-babel-shell-initialize', 
of course.  However, it requires mentally tracking that ,name resolves to a 
string.  Using a macro along with `pp-macroexpand-expression' makes the defined 
function explicit.  The forms generated by the macro expansion are readily 
available to eval whereas the function version makes the definitions 
inaccessible (AFAICT).  

2. Source navigation gets confused when looking up help for a generated 
function.  For example, `C-h f org-babel-execute:sh' goes to the top of 
ob-shell.el

Generating the execute functions with a macro also has this problem.  I'm not 
sure there's a way around it other than defining each function with `defun'.  
Doing that would be a bad idea because of the massive code 
duplication/maintenance it would create.

3. It does not adhere to the coding convention.

I'll requote the convention here for convenience.

> (elisp) Coding Conventions says,
>
> "• Constructs that define a function or variable should be macros, not
> functions, and their names should start 

Re: ob-shell intentions and paperwork (was Bash results broken?)

2023-01-01 Thread Matt

  On Sat, 31 Dec 2022 09:31:16 -0500  Ihor Radchenko  wrote --- 
 > Matt m...@excalamus.com> writes:
 > 
 > > I've backed out the `require' change and adjusted everything else based on 
 > > your feedback.  There is a separate patch for each refactor that created a 
 > > new test.   The remaining refactors are in a single patch.  I was also 
 > > able to resolve the issue I had with inserting the test name for the 
 > > session (the "yes" string in `test-ob-shell/session').
 > 
 > Thanks!
 > 
 > I can see that you still prefer to use `string-join' for Org body.
 > Why not a bare string?

Because I often program in Python where double quoted strings typically don't 
span lines.  One of the original tests had the string "#+BEGIN_SRC sh :results 
list\necho 1\necho 2\necho 3\n#+END_SRC" in it (that is, used newline 
characters instead of inserting new lines), so my brain assumed strings Emacs 
Lisp behaved similarly to Python.  Silly brain :)  Thanks for continuing to 
follow up on that.

I've updated the patches to use bare strings.

If this set of patches look good, I can push them to main.

0001-test-ob-shell.el-Split-test-ob-shell-dont-error-on-e.patch
Description: Binary data


0002-test-ob-shell.el-Refactor-test-ob-shell-session.patch
Description: Binary data


0003-test-ob-shell.el-Refactor-ob-shell-generic-uses-no-a.patch
Description: Binary data


0004-Refactor-ob-shell-bash-uses-assoc-arrays.patch
Description: Binary data


0005-test-ob-shell.el-Refactor-test-names-and-kill-test-b.patch
Description: Binary data


0006-ob-shell-test.org-Remove-ob-shell-test.org.patch
Description: Binary data


0007-test-ob-shell.el-Organize-tests.patch
Description: Binary data


org-up-element does not the same for all structural blocks

2023-01-01 Thread Alain . Cochard


With an org file like

   * h
   #+begin_export ascii
   foo
   #+end_export

putting the cursor on 'foo' and doing

   M-x org-up-element

brings the cursor on '* h'.  Same with the following blocks:

‘#+begin_comment’ ... ‘#+end_comment’
‘#+begin_example’ ... ‘#+end_example’
‘#+begin_export’ ... ‘#+end_export’
‘#+begin_export html’ ... ‘#+end_export’
‘#+begin_export latex’ ... ‘#+end_export’
‘#+begin_src’ ... ‘#+end_src’ (I tried org and lisp)
‘#+begin_verse’ ... ‘#+end_verse’

But for those two blocks:

‘#+begin_center’ ... ‘#+end_center’
‘#+begin_quote’ ... ‘#+end_quote’

the cursor is moved to the beginning of the block instead, which I
find strange.

Incidentally, is there a definition understandable for the basic user
of what an "org element" is?  I could not find one after a (quick)
Internet search, not even in

https://orgmode.org/worg/dev/org-element-api.html
https://orgmode.org/worg/org-syntax.html

(even if I sure it's between the lines...)


-- 
EOST (École et Observatoire des Sciences de la Terre) 
ITE (Institut Terre & Environnement) | alain.coch...@unistra.fr
5 rue René Descartes   [bureau 110]  | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France | [ slot available for rent ]




Shouldn't #+EXP> complete to '#+EXPORT_FILE_NAME:'

2023-01-01 Thread Alain . Cochard


The manual (in 17.1) says that 

   After ‘#+’, [‘M-’] complete[s] the special keywords [...]

but if I do it after '#+EXP', it does not complete to 

   #+EXPORT_FILE_NAME:

Do I understand the manual incorrectly?

Thanks.


-- 
EOST (École et Observatoire des Sciences de la Terre) 
ITE (Institut Terre & Environnement) | alain.coch...@unistra.fr
5 rue René Descartes   [bureau 110]  | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France | [ slot available for rent ]




Re: search in org-sparse-tree for multiple files

2023-01-01 Thread Eric Chun
 I think I found a solution but here are the steps in case others have the same 
problem:
* First, I open an org file in Emacs.* I then create a sparse tree using a 
regular expression.* I then type M-g M-n to move to the next occurrence of my 
search string but it doesn't work.  I get a message saying "user-error: Moved 
past last grep hit".
* I kill the pre-existing "*grep*" buffer in Emacs.
* I then try M-g M-n again and it works.

Writing out these steps got me thinking that there might be an option in 
compilation mode to switch buffers when finding next error.  I looked in the 
compilation mode section of the Emacs manual and found next-error-select-buffer 
that switches buffers when searching for errors.  I also just realized that you 
mentioned next-error-find-buffer-function configuration variable in an earlier 
post.  I'll try that as well.
You can consider my question answered.  Thanks for the help.
On Sunday, January 1, 2023 at 06:24:39 AM MST, Ihor Radchenko 
 wrote:  
 
 Eric Chun  writes:

> I'm assuming "current buffer" is the buffer which I can currently type input 
> into.  The current buffer is not finding next occurrence of search string by 
> pressing M-g M-n.  Is this expected?

Could you please elaborate?
What exactly you did and what do you expect to happen?
(see https://orgmode.org/manual/Feedback.html#Feedback)

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

Re: Is function 'org-insert-property-drawer' usable?

2023-01-01 Thread Alain . Cochard
Ihor Radchenko writes on Sun  1 Jan 2023 13:23:

 > I guess we can just make it into a command.

For me, that would be ideal.  Otherwise, I think it would help a bit
to change the manual from

   ... this command calls ‘org-insert-property-drawer’ ...

to

   ... this command calls the non interactive
   ‘org-insert-property-drawer’ command ...

With this, I would not have asked the question in the first place, and
might have been able to rebind the command without RY's input
(thanks).




-- 
EOST (École et Observatoire des Sciences de la Terre) 
ITE (Institut Terre & Environnement) | alain.coch...@unistra.fr
5 rue René Descartes   [bureau 110]  | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France | [ slot available for rent ]




Re: [org-promote-subtree + undo] adds one star

2023-01-01 Thread Ihor Radchenko
alain.coch...@unistra.fr writes:

> I fear that, even if the emacs people fix the problem, it still won't
> work with, say, emacs 27 or 28.
>
> Oh, well...

If they fix this, we will at least have a clue what is causing it.

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



Re: Babel (scheme): Evaluation errors are not shown

2023-01-01 Thread Marc Nieper-Wißkirchen
Fixed.

Am So., 1. Jan. 2023 um 14:53 Uhr schrieb Ihor Radchenko :
>
> Marc Nieper-Wißkirchen  writes:
>
> >  (defun org-babel-eval-error-notify (exit-code stderr)
> > -  "Open a buffer to display STDERR and a message with the value of 
> > EXIT-CODE."
> > +  "Open a buffer to display STDERR and a message with the value of 
> > EXIT-CODE.
> > +If EXIT-CODE is nil, suppress the message."
>
> The docstring is not accurate now.
> If EXIT-CODE is nil, the message is not suppressed.
>
> > ...
> > -  (message "Babel evaluation exited with code %S" exit-code))
> > +  (if exit-code
> > +  (message "Babel evaluation exited with code %S" exit-code)
> > +(message "Babel evaluation exited abnormally")))
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 


0001-lisp-ob-scheme.el-Do-not-hide-Scheme-evaluation-erro.patch
Description: Binary data


Re: [org-promote-subtree + undo] adds one star

2023-01-01 Thread Alain . Cochard
Ihor Radchenko writes on Sun  1 Jan 2023 14:13:

 > It is indeed Org 9.6 issue. Likely related to some obscure
 > interaction between what Org does and `combine-after-change-calls'.
 > 
 > Note that I am reporting for Emacs master, which ships with Org
 > 9.6.

I'm afraid it is a bit complicated for me :-)

I fear that, even if the emacs people fix the problem, it still won't
work with, say, emacs 27 or 28.

Oh, well...

-- 
EOST (École et Observatoire des Sciences de la Terre) 
ITE (Institut Terre & Environnement) | alain.coch...@unistra.fr
5 rue René Descartes   [bureau 110]  | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France | [ slot available for rent ]




Re: Broken numerical ordered list when exported to latex

2023-01-01 Thread Ihor Radchenko
Sharon Kimble  writes:

> My org file is attached, and the original source was a web-page, a straight 
> copy and paste, so its inheriting the same list structure as the original. 

This is expected. Lists are numbered from 1. all the time unless you
explicitly state otherwise. See
https://orgmode.org/manual/Plain-Lists.html

You need something like

10. [@10] Life and/or death. There's little else of such significance. Have you 
had a near-death experience? What is your experience of witnessing birth or 
death?

in your Org source.

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



Re: [org-promote-subtree + undo] adds one star

2023-01-01 Thread Ihor Radchenko
alain.coch...@unistra.fr writes:

>  > Confirmed.
>  > 
>  > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60467
>
> Funny: since the problem was not present in previous versions of org,
> I would have thought it was an org 9.6 issue...

It is indeed Org 9.6 issue. Likely related to some obscure interaction
between what Org does and `combine-after-change-calls'.

Note that I am reporting for Emacs master, which ships with Org 9.6.

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



Re: Broken numerical ordered list when exported to latex

2023-01-01 Thread Sharon Kimble

Ihor Radchenko  writes:

> Sharon Kimble  writes:
>
>> I have a long-standing problem with a numerical ordered list which is broken 
>> by sub-headings, and exported to latex.
>>
>> On looking at the org manual, the most recent one that I have, on page 12, 
>> it shows something like '[@20]' which when exported shows exactly the same, 
>> and hasn't continued the numerical numbering.
>>
>> So how can I have a continuing numerical ordered list please when exported 
>> to latex?  
>
> Could you please provide an example Org file, explain what you do to
> export it, describe what you expect and what you get instead?
> See https://orgmode.org/manual/Feedback.html#Feedback

My org file is attached, and the original source was a web-page, a straight 
copy and paste, so its inheriting the same list structure as the original. 

And this is the command that I'm using to export to latex - '(global-set-key 
(kbd "s-#") 'org-latex-export-to-latex)'.

The second file, a pdf file is showing what it appears when built into a pdf 
file. And I'm using 'pdfbuild' from my 'taste of linux' website, to perform the 
'build'.  

Thanks
  Sharon.
  

  

mwe.org
Description: application/vnd


mwe.pdf
Description: Adobe PDF document

   
-- 
A taste of linux = http://www.sharons.org.uk
Debian 11.5, fluxbox 1.3.7, emacs 29.0.60, org 9.5.5 


Re: [org-promote-subtree + undo] adds one star

2023-01-01 Thread Alain . Cochard


 > Confirmed.
 > 
 > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60467

Funny: since the problem was not present in previous versions of org,
I would have thought it was an org 9.6 issue...

-- 
EOST (École et Observatoire des Sciences de la Terre) 
ITE (Institut Terre & Environnement) | alain.coch...@unistra.fr
5 rue René Descartes   [bureau 110]  | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France | [ slot available for rent ]




Re: Export Org with Org concept -- Re: Problems with C-c C-e file.org,

2023-01-01 Thread Ihor Radchenko
Eduardo Ochs  writes:

> My conclusion was that Org is much harder to learn than I thought.
> It's easy to learn if:
>
>   1) you're a "user", or
>   2) you know a lot about debugging Emacs, or
>   3) the developers like your questions.

I hope that (3) is not your experience with Org ML. If it is, I'd rather
say "developers understand questions". At least from my perspective.
Your approach is rather unusual for me, making it difficult to follow
even after detailed explanations.

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



Re: Babel (scheme): Evaluation errors are not shown

2023-01-01 Thread Ihor Radchenko
Marc Nieper-Wißkirchen  writes:

>  (defun org-babel-eval-error-notify (exit-code stderr)
> -  "Open a buffer to display STDERR and a message with the value of 
> EXIT-CODE."
> +  "Open a buffer to display STDERR and a message with the value of EXIT-CODE.
> +If EXIT-CODE is nil, suppress the message."

The docstring is not accurate now.
If EXIT-CODE is nil, the message is not suppressed.

> ...
> -  (message "Babel evaluation exited with code %S" exit-code))
> +  (if exit-code
> +  (message "Babel evaluation exited with code %S" exit-code)
> +(message "Babel evaluation exited abnormally")))

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



Re: [org-promote-subtree + undo] adds one star

2023-01-01 Thread Ihor Radchenko
alain.coch...@unistra.fr writes:

> Under release_9.6-173-g24740a
>
> I have file
>
> #+begin_src org
> ,* h1
> ,** h2
> #+end_src
>
> I do
>
>M-x org-promote-subtree
>
> on h2, which works as expected; then
>
>M-x undo
> ...
> and I have the message
>
>primitive-undo: Changes to be undone by function different from
>announced

Confirmed.

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60467

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



Re: How to disable completely org-persist

2023-01-01 Thread Jean Louis
* to...@tuxteam.de  [2022-12-31 10:12]:
> Perhaps it would make sense to state the goals in more
> detail. I can see many "aspects":
> 
>  - "I don't want my ~/.emacs.d/ littered beyond my explicit
>control"

Isn't that happening anyway by various packages and functions? I see
there "auto-install", "auto-save-list" directories, I did not create
them myself. I see "desktop", though I used "desktop" package nobody
warned me it will be there. There is "erc-log" which I did not know it
will be there, there is "eshell", "games", "icons", "image-dired",
"multisession", "newsticker", "todo" and so on, too many.

I never had explicit control over creation of those files.

Using a package alone is not what I consider under "explicit", as I
was not asked directly about any of those directories.

>  - "I don't have (nor want to have) XDG directories"

Me too, I do not want to have, and I do not have, but some XDG
environment variables are there.

>  - "I don't want things in /tmp" [1]

Me too, but I keep it in my private $TMPDIR, as it is unsafe to keep
it in /tmp

I do keep /tmp encrypted for that reason as it is not safe. And my
/home is also encrypted on different partition. 

In general it is unsafe to choose /tmp for private information as then
maybe /tmp is not encrypted.

>  - "I don't want my Emacs's session state to spill to
>persistent media"

Me too, unless I use "desktop" and that is saved on encrypted
partition.

But I would not like using Org files on remote servers and that
information is anywhere else stored unencrypted about which file I
opened and what I wrote.


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



Re: LaTeX tutorial (focused on what Org exports) ??

2023-01-01 Thread Ihor Radchenko
"Fraga, Eric"  writes:

> On Saturday, 31 Dec 2022 at 23:12, David Masterson wrote:
>> I'm not sure what language this one is in.
>
> The second link was to a PDF document that you should be able to view in
> the browser or download.

I think that it is not very clear how to use it.
Abstract says that it is self-explaining, but it appears that not every
pdf viewer supports showing the explanations.

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



Re: search in org-sparse-tree for multiple files

2023-01-01 Thread Ihor Radchenko
Eric Chun  writes:

> I'm assuming "current buffer" is the buffer which I can currently type input 
> into.  The current buffer is not finding next occurrence of search string by 
> pressing M-g M-n.  Is this expected?

Could you please elaborate?
What exactly you did and what do you expect to happen?
(see https://orgmode.org/manual/Feedback.html#Feedback)

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



Re: Is function 'org-insert-property-drawer' usable?

2023-01-01 Thread Ihor Radchenko
Ruijie Yu via "General discussions about Org-mode."
 writes:

> According to the source code of `org-insert-drawer', I think the manual
> is saying that when ARG is non-nil, the function simply calls
> `org-insert-property-drawer'.  However, `org-insert-property-drawer' is
> not declared interactive, so you wouldn't be able to M-x it.

I guess we can just make it into a command. I see no downsides.

See the attached.

>From a32e4791ee3b0f12d8b9ce006c2ec4cede3829eb Mon Sep 17 00:00:00 2001
Message-Id: 
From: Ihor Radchenko 
Date: Sun, 1 Jan 2023 16:21:32 +0300
Subject: [PATCH] org-insert-property-drawer: Make into a command

* lisp/org.el (org-insert-property-drawer): Make interactive.  This
function is mentioned in the manual and may be used by users.

Reported-by: alain.coch...@unistra.fr
Link: https://orgmode.org/list/25520.25134.831330.318...@gargle.gargle.howl
---
 lisp/org.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/org.el b/lisp/org.el
index db32ec562..6cb326ca0 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -13062,6 +13062,7 @@ (defun org-insert-property-drawer ()
   "Insert a property drawer into the current entry.
 Do nothing if the drawer already exists.  The newly created
 drawer is immediately hidden."
+  (interactive)
   (org-with-wide-buffer
;; Set point to the position where the drawer should be inserted.
(if (or (not (featurep 'org-inlinetask)) (org-inlinetask-in-task-p))
-- 
2.38.1


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


Re: LaTeX tutorial (focused on what Org exports) ??

2023-01-01 Thread Fraga, Eric
On Saturday, 31 Dec 2022 at 23:12, David Masterson wrote:
> I'm not sure what language this one is in.

The second link was to a PDF document that you should be able to view in
the browser or download.

-- 
: Eric S Fraga, with org release_9.6-124-g036cc0 in Emacs 30.0.50


Re: Persisting the current working directory in an org-babel session

2023-01-01 Thread Ihor Radchenko
Adam Sneller  writes:

> For some reason, I am unable to make changes to my working directory persist, 
> from one emacs-lisp SRC block to the next.
>
> For example, consider the following:
>
>   * Literate programming in a single session
>   :PROPERTIES:
>   :header-args: :var DIR="/Users/adam/Desktop/test"
>   :END:
>
>   #+BEGIN_SRC emacs-lisp :session *elisp*
>   (cd DIR)
>   #+END_SRC
>
>   #+RESULTS:
>   : /Users/adam/Desktop/test/
>
>
>   #+BEGIN_SRC emacs-lisp :session *elisp*
>   (cd ".")
>   #+END_SRC
>
>   #+RESULTS:
>   : /Users/adam/org/

Confirmed.

This is because `org-babel-execute-src-block' let-binds
`default-directory'. So, your changes to it are only affecting lexical
scope.

Fixes welcome!

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



Persisting the current working directory in an org-babel session

2023-01-01 Thread Adam Sneller
For some reason, I am unable to make changes to my working directory persist, 
from one emacs-lisp SRC block to the next.

For example, consider the following:

* Literate programming in a single session
:PROPERTIES:
:header-args: :var DIR="/Users/adam/Desktop/test"
:END:

#+BEGIN_SRC emacs-lisp :session *elisp*
(cd DIR)
#+END_SRC

#+RESULTS:
: /Users/adam/Desktop/test/


#+BEGIN_SRC emacs-lisp :session *elisp*
(cd ".")
#+END_SRC

#+RESULTS:
: /Users/adam/org/

The :header-args: define a starting directory (DIR="/Users/adam/Desktop/test"). 
The first block establishes the *elisp* session and navigates into DIR, using 
(cd DIR). Confirmation is then seen in the #+RESULTS. 

A second block is then created in the same *elisp* session. This simply echos 
the current working directory with (cd "."). BUT... the #+RESULTS show that the 
working directory has not persisted from our first block and has instead, 
defaulted to the default org-mode directory.

Now, I realise that I could have used :dir in my initial :header-args: to set 
the same working directory for all blocks. But what I am interested in is why 
my changes are not persisting, when (if I am not mistaken) this is the entire 
point of establishing a session?

Thanks!

Adam Sneller