Re: oeg-add-note and double backslash ?

2023-12-04 Thread David Masterson
Samuel Wales  writes:

> On 12/4/23, David Masterson  wrote:
>> Ihor Radchenko  writes:
>>
>>> David Masterson  writes:
>>>
 org-add-note puts a '\\' at the end of the first line.  Is it expected
 the user will put '\\' at the end of each line of a multiline note
 (except the last line)?
>>>
>>> No.
>>>
 .. Why is this done?
>>>
>>> To prevent fill-region from concatenating the auto-generated text in the
>>> first line and the user input in the following lines.
>>
>> Ah.  Is that mentioned somewhere in the Org manual?  I don't mean the
>> details of filll-region, but a little something to answer "why is that
>> there?" by new users.
>
> (info "(org) Paragraphs")

Hmm. Not quite as it doesn't say anything about Org notes.
-- 
David Masterson



Re: OrgMode Agenda empty if one of files is missing from the org-agenda-files

2023-12-04 Thread Ali M.
You are right

I tried again, and this time, i checked the echo/mini buffer area, and it
had the options you mentioned above
my bad

My agenda windows open on the side, not the bottom (not sure why), so i
guess this why i didnt notice the warning in the echo area before
also a bit unfortunate that a is for abort because i might have kept
pressing a when i first got a blank windows (also a being the first option
for agenda, and the thing you will most likely try as a new user)

Anyway, thanks



On Mon, Dec 4, 2023 at 10:06 AM Ihor Radchenko  wrote:

> "Ali M."  writes:
>
> > If a file added on my agenda list is deleted, Org Mode Agenda list comes
> > back empty
> >
> > For example, my org agenda has two files
> >  '(org-agenda-files
> >'("c:/dev/projects/one/one.org"  "c:/dev/projects/two/two.org"  ))
> >
> > Now I deleted folder two , so the folder  c:/dev/projects/two/ and its
> > content is also deleted
> >
> > Now when I try C-ca and select any of the option to list my scheduled
> todos
> > I get an empty *Org Agenda* buffer
>
> This is not what I am seeing on my side.
> For me, agenda displays a message:
>
> Non-existent agenda file /tmp/two/two.org.  [R]emove from list or [A]bort?
>
> If I press "r", the agenda is displayed with the existing file.
> If I press "a", agenda generation is aborted.
>
> > I think the Agenda buffer should still show me the todo items from the
> > available files, and maybe just warn me about the delete file, or at
> least
> > show nothing, but warn me about the issue
>
> I suspect that you accidentally pressed "a" extra time, which happened
> to trigger "[A]bort".
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


What is the status of ob-maxima.el? Is this a bug?

2023-12-04 Thread Eduardo Ochs
Hi list,

what is the status of ob-maxima.el? Is it considered to be functional?
If yes, what am I doing wrong? If no, should I file a bug report about
the problem below?

If I eval these two sexps and then execute the code block below them
with `C-c C-c' - obs: I added some indentation for clarity,

  (setq org-confirm-babel-evaluate nil)
  (require 'ob-maxima)

  #+begin_src maxima
  2+3;
  #+end_src

then I get this "#+RESULTS:" block when the first "maxima" found in
the $PATH is /usr/local/bin/maxima, that is a script that runs a
Maxima compiled from the git sources a few days ago,

  #+RESULTS:
  | Adding  | 118 | subdirectories | of |
/usr/local/share/maxima/branch_5_47_base_312_gd5a35a21b/share | to | search
| path. |
  | Adding  |   0 | subdirectories | of |
/home/edrx/.maxima| to | search
| path. |
  | Loading | /home/edrx/.maxima/maxima-init.lisp |||
|||
  |
  | Loading |  /home/edrx/.maxima/maxima-init.mac |||
|||
  |

and I get this empty "#+RESULTS:" block

  #+RESULTS:

when the first "maxima" found in the $PATH is /usr/bin/maxima, that is
a script that runs the Maxima that comes with Debian 11
("oldstable")...

If I simply run the tests above in a shell the log is:

  /home/edrx(edrx:sc)# /usr/local/bin/maxima
  Adding 118 subdirectories of
"/usr/local/share/maxima/branch_5_47_base_312_gd5a35a21b/share" to search
path.
  Adding 0 subdirectories of "/home/edrx/.maxima" to search path.
  Loading /home/edrx/.maxima/maxima-init.lisp
  Loading /home/edrx/.maxima/maxima-init.mac
  Maxima branch_5_47_base_312_gd5a35a21b https://maxima.sourceforge.io
  using Lisp SBCL 2.1.1.debian
  Distributed under the GNU Public License. See the file COPYING.
  Dedicated to the memory of William Schelter.
  The function bug_report() provides bug reporting information.
  (%i1) 2+3;
  (%o1)  5
  (%i2) quit()$
  /home/edrx(edrx:sc)#
  /home/edrx(edrx:sc)# /usr/bin/maxima

  Maxima 5.44.0 http://maxima.sourceforge.net
  using Lisp GNU Common Lisp (GCL) GCL 2.6.12
  Distributed under the GNU Public License. See the file COPYING.
  Dedicated to the memory of William Schelter.
  The function bug_report() provides bug reporting information.
  (%i1) 2+3;
  (%o1)  5
  (%i2) quit()$
  /home/edrx(edrx:sc)#


Thanks in advance,
  Eduardo Ochs
  http://anggtwu.net/eepitch.html


Re: oeg-add-note and double backslash ?

2023-12-04 Thread Samuel Wales
(info "(org) Paragraphs")

On 12/4/23, David Masterson  wrote:
> Ihor Radchenko  writes:
>
>> David Masterson  writes:
>>
>>> org-add-note puts a '\\' at the end of the first line.  Is it expected
>>> the user will put '\\' at the end of each line of a multiline note
>>> (except the last line)?
>>
>> No.
>>
>>> .. Why is this done?
>>
>> To prevent fill-region from concatenating the auto-generated text in the
>> first line and the user input in the following lines.
>
> Ah.  Is that mentioned somewhere in the Org manual?  I don't mean the
> details of filll-region, but a little something to answer "why is that
> there?" by new users.
>
> --
> David Masterson
>
>


-- 
The Kafka Pandemic

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



Org contributors: Typo in a heading

2023-12-04 Thread Rudolf Adamkovič
A quick heads-up about a typo at

  https://orgmode.org/worg/contributors.html

Actual heading:

  Current contributors with FSF assignement

Expected heading:

  Current contributors with FSF assignment

Rudy
-- 
"'Obvious' is all too often a synonym for 'wrong'."
-- Jeff Erickson, Algorithms, 2019

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



Re: oeg-add-note and double backslash ?

2023-12-04 Thread David Masterson
Ihor Radchenko  writes:

> David Masterson  writes:
>
>> org-add-note puts a '\\' at the end of the first line.  Is it expected
>> the user will put '\\' at the end of each line of a multiline note
>> (except the last line)?
>
> No.
>
>> .. Why is this done?
>
> To prevent fill-region from concatenating the auto-generated text in the
> first line and the user input in the following lines.

Ah.  Is that mentioned somewhere in the Org manual?  I don't mean the
details of filll-region, but a little something to answer "why is that
there?" by new users.

-- 
David Masterson



Re: [BUG] ob-shell: :shebang changes interpretation of :cmdline

2023-12-04 Thread Matt


  On Mon, 04 Dec 2023 14:55:58 +0100  Ihor Radchenko  wrote --- 
 > Matt m...@excalamus.com> writes:
 > 
 > >  > #+begin_src bash :cmdline 1 2 3
 > >  >printf "%s\n" "$1"
 > >  > #+end_src
 > >  > 
 > >  > #+RESULTS:
 > >  > : 1
 > >  > 
 > >  > #+begin_src bash :cmdline 1 2 3 :shebang #!/bin/bash
 > >  >printf "%s\n" "$1"
 > >  > #+end_src
 > >  > 
 > >  > #+RESULTS:
 > >  > : 1 2 3
 > >
 > > Thank you!  This makes a good test case.
 > 
 > I am confused. Isn't it a bug?

Yes, it's a bug.  And the test was wrong.

Here is a corrected version.  When the bug is fixed, the following should pass. 
 It currently fails because the first block returns 1 and the second block 
returns 1 2 3 (as seen in the quote).  Both blocks should return 1.

(ert-deftest test-cmdline-alone-and-with-shebang-have-same-result ()
  "Pass arguments to a block.  Don't use shebang.  Then use
shebang set to the same language as the block.  The result should
be the same."
  (should (equal
   (org-test-with-temp-text 
   "#+begin_src bash :cmdline 1 2 3   
echo \"$1\" 
 
#+end_src"  
 (org-babel-execute-src-block)) 
   (org-test-with-temp-text 
   "#+begin_src bash :cmdline 1 2 3 :shebang #!/bin/bash  
echo \"$1\" 
 
#+end_src"  
 (org-babel-execute-src-block)  



Suggestion for org-agenda-list: pre-open org-agenda-files

2023-12-04 Thread John Wiegley
Recently I switched all of my Org files from “properties at the bottom” to
“properties at the top”, in order to avoid maintaining my own fork with this
capability. Although that fork had been working well, Ihor had a good argument
that I’m potentially opting myself out of 3rd party tools by veering from what
has become the standard format.

Right away I discovered one of the reasons I had preferred properties at the
bottom: When I startup my Emacs and run org-agenda-list, and then hit RET on
an entry, no folding has been applied to the Org file and thus I see the full
property block at the beginning of entries (and in my case, they can often be
quite large). I have to scan down to find the actual text.

Reading through the code, I found that org-agenda-list calls
org-agenda-get-day-entries on each file in org-agenda-files, which
intentionally disables code folding before opening the file if it isn’t open
already:

  (defun org-agenda-get-day-entries (file date  args)
(let* ((org-startup-folded nil)
  …)))

My workaround for this is to visit every entry in org-agenda-files before
calling org-agenda-list:

  (require 'org-agenda)
  (mapc #’find-file-noselect org-agenda-files)
  (call-interactively 'org-agenda-list)

I’m wondering whether we might want to provide a customization option to do
this automatically at the top of org-agenda-list, for any org-agenda-files
that aren’t already in buffers, since proper folding can make a big difference
when visiting Org entries from the Agenda.

--
John Wiegley  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com  60E1 46C4 BD1A 7AC1 4BA2



[BUG] subheadings disappear from buffer [9.6.6 (release_9.6.6 @ /opt/local/share/emacs/29.1/lisp/org/)]

2023-12-04 Thread Peter Mao
This is an incomplete initial bug report.  I don't have time right now to
chase down all the details.

A couple of times in the past month, the subheadings in the org file I'm
working on (with lots of org-babel code blocks) disappear.   does not
fold or unfold those headings, although the indicator (...) still shows.
In desperation, I switch to fundamental-mode, but the text is still not in
the buffer.  I save the buffer under a different filename to find that all
the missing text is in the file.

Has anyone else seen this?

summary:
1. subheading text disappears from org file, even in fundamental
2. saving the buffer shows that the disappearance is cosmetic only
3. I have not established reproducible conditions for this yet.


Emacs  : GNU Emacs 29.1 (build 2, x86_64-apple-darwin22.5.0, GTK+ Version
3.24.38, cairo version 1.17.6)
 of 2023-08-07
Package: Org mode version 9.6.6 (release_9.6.6 @
/opt/local/share/emacs/29.1/lisp/org/)

current state:
==
(setq
 org-noter--doc-goto-location-hook '(org-noter-pdf--goto-location)
 org-link-elisp-confirm-function 'yes-or-no-p
 org-ditaa-jar-path "/opt/local/share/java/ditaa-0.11.0-standalone.jar"
 org-noter-supported-modes '(doc-view-mode pdf-view-mode nov-mode)
 org-bibtex-headline-format-function #[257 "\300 \236A\207" [:title] 3
"\n\n(fn ENTRY)"]
 org-download-file-format-function 'org-download-file-format-default
 org-agenda-files '("~/Syncbox/files/gtd.org")
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-noter-arrow-horizontal-offset -30
 org-cycle-tab-first-hook '(org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-noter-doc-split-fraction '(0.67 . 0.9)
 org-default-notes-file "~/Syncbox/files/.notes"
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-file-apps '((auto-mode . emacs) ("\\.x?html?\\'" . default)
("\\.pdf\\'" . default) ("\\.jpe?g\\'" . "gqview -t %s &"))
 org-noter--pretty-print-location-for-title-hook
'(org-noter-pdf--pretty-print-location-for-title)
 org-odt-format-inlinetask-function
'org-odt-format-inlinetask-default-function
 org-ascii-format-drawer-function #[771 " \207" [] 4 "\n\n(fn NAME CONTENTS
WIDTH)"]
 org-cycle-hook '(org-cycle-hide-archived-subtrees
org-cycle-show-empty-lines org-cycle-optimize-window-after-visibility-change
  org-cycle-display-inline-images)
 org-noter-auto-save-last-location t
 org-persist-before-read-hook '(org-element--cache-persist-before-read)
 org-noter--pretty-print-highlight-location-hook
'(org-noter-pdf--pretty-print-highlight)
 org-mode-hook '(#[0 "\301\211 \207" [imenu-create-index-function
org-imenu-get-tree] 2] er/add-org-mode-expansions org-appear-mode
 #[0 "\300\301\302\303\304$\207" [add-hook
change-major-mode-hook org-fold-show-all append local] 5]
 #[0 "\300\301\302\303\304$\207" [add-hook
change-major-mode-hook org-babel-show-result-all append local] 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-babel-load-languages '((emacs-lisp . t) (ditaa . t) (perl . t) (python
. t) (octave . t) (shell . t) (matlab . t))
 org-appear-autoentities t
 org-noter--pretty-print-location-hook
'(org-noter-pdf--pretty-print-location)
 org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
 org-ellipsis " ↧"
 org-download-abbreviate-filename-function 'file-relative-name
 org-latex-format-headline-function
'org-latex-format-headline-default-function
 org-confirm-shell-link-function 'yes-or-no-p
 org-download-annotate-function 'org-download-annotate-default
 org-appear-autosubmarkers t
 org-adapt-indentation t
 org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-download-screenshot-method "screencapture -i %s"
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-appear-inside-latex t
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-tangle-lang-exts '(("python" . "py") ("perl" . "pl")
("emacs-lisp" . "el") ("elisp" . "el"))
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-ditaa-eps-jar-path
"/opt/local/share/emacs/29.1/lisp/contrib/scripts/DitaaEps.jar"
 org-id-link-to-org-use-id t
 org-noter-headline-title-decoration "/"
 org-appear-autoemphasis nil
 org-noter--show-arrow-hook '(org-noter-pdf--show-arrow)
 org-speed-command-hook '(org-speed-command-activate
org-babel-speed-command-activate)
 org-html-format-inlinetask-function
'org-html-format-inlinetask-default-function
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-noter-arrow-background-color "cyan"
 org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-noter--add-highlight-hook '(org-noter-pdf--highlight-location)
 

Re: Bug in org-insert-link?

2023-12-04 Thread Guillaume MULLER

EDIT:

The problem is still here, and I managed to find the actual problem.

The problem happens when I do the "C-C C-l file:" then select a file. The root cause is 
that the mini-buffer then lists all the files in the current directory, and when there are many, 
the mini-buffer becomes quite big. Thus, the current buffer gets its size reduced, and when the 
cursor was very low in the buffer frame/window(?), the cursor "magically" jumps to a new 
position, in the part of the buffer that remained visible.

It is now perfectly reproducible on my side.

On 12/4/23 16:24, Guillaume MULLER wrote:

Hi,

Sorry for coming back that late on this problem. The problem came back again 
today: Links get inserted into random places again.

I think I have (the beginning of) an idea where problem lies.

Context:
- I'm using (Doom)Emacs in emacs-client mode, and I'm putting my computer only 
on sleep at night, so Emacs (daemon) often runs for weeks
- I regularly do some updates/upgrades: `sh> doom upgrade` or `sh> doom sync 
-u` (from shell, outside DoomEmacs)
   - Sometimes it works, so I just continue using Emacs
   - But sometimes doing the updates/upgrades while DoomEmacs is running make 
it go berserk
   - In such cases, I start by running `M-x doom/reload` (from inside Emacs), 
and if org buffers are going berserk too, I also run `M-x org-reload`
   - If it still does not work (most of the time), I `pkill emacs` and start 
Emacs again from scratch

The last time the link insertion issue appeared, I had called `M-x org-reload` 
after a `M-x doom/reload` after a `sh> doom upgrade`.

Restarting Emacs solved it.

I tried calling `M-x org-reload` and inserting some link on the fresh new Emacs 
process, and it seems to work.

So the problem apparently comes when calling `M-x org-reload` (from inside Emacs) 
after calling `sh> doom upgrade` (from outside Emacs). (NOTE: I haven't been 
able to try if the problem appears when calling `M-x doom/upgrade` (from inside 
Emacs) yet, as my Emacs is the freshest possible for now).

My conclusion is that "the bug" probably comes from the fact that the "org-mode" being 
reloaded is a fresher version than the "org-mode" that was loaded when Emacs-client was started, 
several weeks ago.

Not sure if this issue should be pursued or if my franken-usage of Emacs is to 
be blamed :)

Cheers

On 10/9/23 16:40, Guillaume MULLER wrote:

Hi,

Thanks for the answer... I'll have a look at your links.

However, since I wrote the email, I've seen the behavior occur without changing 
(at least voluntarily) the cursor position in the Org buffer...

On 10/5/23 12:18, Ihor Radchenko wrote:

Guillaume MULLER  writes:


...
- Switch back to (Doom)Emacs ("window"/desktop)
- Click inside the Emacs "window" to give it focus
[Here is the problem: sometimes I forgot that I already started the 
org-insert-link]
- Call org-insert-link
- Paste the URL
- Validate the link creation

Then the link is inserted where I clicked last (to give focus to the Emacs 
"window").


By default, Emacs moves point to where you click. You can do the same
thing if you deliberately C-x o from the minibuffer. See 9.3 Editing in
the Minibuffer section of Emacs manual.
I see nothing wrong on the Org side.


Of course, the problem lies in my mistake of calling twice the org-insert-link 
method, but the behavior is very strange, and it took me some time to identify 
why my links were inserted at random places in my text.

However, wouldn't it be possible to prevent it from the beginning by forbidding 
me to call org-insert-link twice, i.e. making it a singleton/atomic function (I 
don't see a UseCase where this could be useful to be able to call it inside 
itself, but maybe I'm wrong)?


Check out 22.1 Mouse Commands for Editing section of Emacs manual.
`x-mouse-click-focus-ignore-position' might be something you want to
customize.







--
Guillaume MULLER
Associate Professor, PhD
Fayol Institute - ISI Department
 #426
☎ 04 77 42 02 71
 https://www.mines-stetienne.fr
留= Physical Address =
  Espace Fauriel
  29 Rue Pierre et Dominique Ponchardier
  42100 Saint-Étienne
 = Postal Address =
  École des Mines de Saint-Étienne
  158 cours Fauriel
  42100 Saint-Étienne


OpenPGP_0xF3BCAD9F46F5FADC.asc
Description: OpenPGP public key


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: [BUG] org-get-entry-text-content return the title of the next org-entry if current entry has no body.

2023-12-04 Thread SyedZuhair
臘 I have writen the fnction myself... when I didn't know the
importance naming functions approperiately in emacs. Sorry. 

Ihor Radchenko  writes:
> SyedZuhair  writes:
>
>> 1. define this function:
>>
>> (defun test-get-entry-text-content ()
>>  (interactive)
>>  (let ((body (org-get-entry-text-content)))
>>  (prin1 body)
>>  )
>>  )
>
> The function `org-get-entry-text-content' is not a part of Org mode.
> Not an Org mode bug.
> Canceled.
>
> I suggest you to check where it is defined:
> C-h f org-get-entry-text-content 
> The place where the function is defined should be displayed in the
> *Help* buffer then.
>
> Once you know where the function is coming from, you may reach out to
> the author of that package (if it is a package) or investigate further
> looking into the function code.



Re: Bug in org-insert-link?

2023-12-04 Thread Guillaume MULLER

Hi,

Sorry for coming back that late on this problem. The problem came back again 
today: Links get inserted into random places again.

I think I have (the beginning of) an idea where problem lies.

Context:
- I'm using (Doom)Emacs in emacs-client mode, and I'm putting my computer only 
on sleep at night, so Emacs (daemon) often runs for weeks
- I regularly do some updates/upgrades: `sh> doom upgrade` or `sh> doom sync 
-u` (from shell, outside DoomEmacs)
  - Sometimes it works, so I just continue using Emacs
  - But sometimes doing the updates/upgrades while DoomEmacs is running make it 
go berserk
  - In such cases, I start by running `M-x doom/reload` (from inside Emacs), 
and if org buffers are going berserk too, I also run `M-x org-reload`
  - If it still does not work (most of the time), I `pkill emacs` and start 
Emacs again from scratch

The last time the link insertion issue appeared, I had called `M-x org-reload` 
after a `M-x doom/reload` after a `sh> doom upgrade`.

Restarting Emacs solved it.

I tried calling `M-x org-reload` and inserting some link on the fresh new Emacs 
process, and it seems to work.

So the problem apparently comes when calling `M-x org-reload` (from inside Emacs) 
after calling `sh> doom upgrade` (from outside Emacs). (NOTE: I haven't been 
able to try if the problem appears when calling `M-x doom/upgrade` (from inside 
Emacs) yet, as my Emacs is the freshest possible for now).

My conclusion is that "the bug" probably comes from the fact that the "org-mode" being 
reloaded is a fresher version than the "org-mode" that was loaded when Emacs-client was started, 
several weeks ago.

Not sure if this issue should be pursued or if my franken-usage of Emacs is to 
be blamed :)

Cheers

On 10/9/23 16:40, Guillaume MULLER wrote:

Hi,

Thanks for the answer... I'll have a look at your links.

However, since I wrote the email, I've seen the behavior occur without changing 
(at least voluntarily) the cursor position in the Org buffer...

On 10/5/23 12:18, Ihor Radchenko wrote:

Guillaume MULLER  writes:


...
- Switch back to (Doom)Emacs ("window"/desktop)
- Click inside the Emacs "window" to give it focus
[Here is the problem: sometimes I forgot that I already started the 
org-insert-link]
- Call org-insert-link
- Paste the URL
- Validate the link creation

Then the link is inserted where I clicked last (to give focus to the Emacs 
"window").


By default, Emacs moves point to where you click. You can do the same
thing if you deliberately C-x o from the minibuffer. See 9.3 Editing in
the Minibuffer section of Emacs manual.
I see nothing wrong on the Org side.


Of course, the problem lies in my mistake of calling twice the org-insert-link 
method, but the behavior is very strange, and it took me some time to identify 
why my links were inserted at random places in my text.

However, wouldn't it be possible to prevent it from the beginning by forbidding 
me to call org-insert-link twice, i.e. making it a singleton/atomic function (I 
don't see a UseCase where this could be useful to be able to call it inside 
itself, but maybe I'm wrong)?


Check out 22.1 Mouse Commands for Editing section of Emacs manual.
`x-mouse-click-focus-ignore-position' might be something you want to
customize.





--
Guillaume MULLER
Associate Professor, PhD
Fayol Institute - ISI Department
 #426
☎ 04 77 42 02 71
 https://www.mines-stetienne.fr
留= Physical Address =
  Espace Fauriel
  29 Rue Pierre et Dominique Ponchardier
  42100 Saint-Étienne
 = Postal Address =
  École des Mines de Saint-Étienne
  158 cours Fauriel
  42100 Saint-Étienne


OpenPGP_0xF3BCAD9F46F5FADC.asc
Description: OpenPGP public key


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: oeg-add-note and double backslash ?

2023-12-04 Thread Ihor Radchenko
David Masterson  writes:

> org-add-note puts a '\\' at the end of the first line.  Is it expected
> the user will put '\\' at the end of each line of a multiline note
> (except the last line)?

No.

> .. Why is this done?

To prevent fill-region from concatenating the auto-generated text in the
first line and the user input in the following lines.

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



Re: OrgMode Agenda empty if one of files is missing from the org-agenda-files

2023-12-04 Thread Ihor Radchenko
"Ali M."  writes:

> If a file added on my agenda list is deleted, Org Mode Agenda list comes
> back empty
>
> For example, my org agenda has two files
>  '(org-agenda-files
>'("c:/dev/projects/one/one.org"  "c:/dev/projects/two/two.org"  ))
>
> Now I deleted folder two , so the folder  c:/dev/projects/two/ and its
> content is also deleted
>
> Now when I try C-ca and select any of the option to list my scheduled todos
> I get an empty *Org Agenda* buffer

This is not what I am seeing on my side.
For me, agenda displays a message:

Non-existent agenda file /tmp/two/two.org.  [R]emove from list or [A]bort?

If I press "r", the agenda is displayed with the existing file.
If I press "a", agenda generation is aborted.

> I think the Agenda buffer should still show me the todo items from the
> available files, and maybe just warn me about the delete file, or at least
> show nothing, but warn me about the issue

I suspect that you accidentally pressed "a" extra time, which happened
to trigger "[A]bort".

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



Re: [BUG] org-get-entry-text-content return the title of the next org-entry if current entry has no body.

2023-12-04 Thread Ihor Radchenko
SyedZuhair  writes:

> 1. define this function:
>
> (defun test-get-entry-text-content ()
>  (interactive)
>  (let ((body (org-get-entry-text-content)))
>  (prin1 body)
>  )
>  )

The function `org-get-entry-text-content' is not a part of Org mode.
Not an Org mode bug.
Canceled.

I suggest you to check where it is defined:
C-h f org-get-entry-text-content 
The place where the function is defined should be displayed in the
*Help* buffer then.

Once you know where the function is coming from, you may reach out to
the author of that package (if it is a package) or investigate further
looking into the function code.

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



Re: [BUG] Get "Args out of range" when trying to link heading with completion from inside a footnote

2023-12-04 Thread Ihor Radchenko
luke...@posteo.de writes:

> My problem is the following. When I create a footnote with C-c C-x f or 
> org-footnote-new, and then try to link to an internal heading of my 
> document typing [[*xyz]] and hitting M-tab for completion, I get nothing 
> but the message in the minibuffer which says "args-out-of-range "" 1 
> nil". If I manually type the name of the heading and export to PDF 
> through LaTeX, the result is fine. But since some Headings are really 
> long, auto-completion would be very helpful here. From everywhere else 
> inside my document auto-completion for internal links works fine.
> ...
> Thus, it seems like a bug to me, since it is not working even with this 
> very simple setup.

Yes, it is a real bug.
It has been reported previously in 
https://list.orgmode.org/orgmode/db9pr06mb7753e0e548b2fb6614285847c6...@db9pr06mb7753.eurprd06.prod.outlook.com/

I wish someone more familiar with Emacs completion innards were to take
a look on this problem. I am not sure what is going wrong there.

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



Re: [BUG] error: Invalid search bound [9.6.11 ( @ /home/nikratio/.emacs.d/elpa/28.2/develop/org-9.6.11/)]

2023-12-04 Thread Ihor Radchenko
"Nikolaus Rath"  writes:

> When running org-agenda and pressing "x" (see below for configuration), I am 
> occasionally getting the following error:
>
> Warning (org-element-cache): org-element--cache: Added org-data parent to 
> non-headline element:
> ...
>
> Emacs  : GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, 
> cairo version 1.16.0)
> of 2023-05-14, modified by Debian
> Package: Org mode version 9.6.11 ( @ 
> /home/nikratio/.emacs.d/elpa/28.2/develop/org-9.6.11/)

May you please try the latest bugfix branch and let us know if you are
still seeing the warning?

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



Re: org-publish and folding ?

2023-12-04 Thread Ihor Radchenko
David Masterson  writes:

> I keep a number of Org files in buffers when I'm working on Org stuff. I
> try to keep them folded so that I get the overview when I switch to the
> buffer. I have found that, when I org-publish the project with these Org
> files, any Org file that is newly published will unfold the buffer as
> publish does it's thing,  My problem is that it doesn't refold the
> buffer when publish is done.

May you please provide more detailed steps to reproduce the problem?
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: [PATCH] Fix indentation in test-org.el

2023-12-04 Thread Ihor Radchenko
Allen Li  writes:

> The indentation in test-org.el is all over the place.  I've attached a
> patch fixing it.

We generally do not accept whitespace-only changes.
Instead, we prefer to fix whitespace together with other _functional_
change.

This is because such changes make it harder to use git blame.
See the discussion in 
https://yhetil.org/emacs-devel/e1k8aul-0001mr...@fencepost.gnu.org/

Canceled.

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



Re: [BUG] ob-shell: :shebang changes interpretation of :cmdline

2023-12-04 Thread Ihor Radchenko
Matt  writes:

>  > #+begin_src bash :cmdline 1 2 3
>  >printf "%s\n" "$1"
>  > #+end_src
>  > 
>  > #+RESULTS:
>  > : 1
>  > 
>  > #+begin_src bash :cmdline 1 2 3 :shebang #!/bin/bash
>  >printf "%s\n" "$1"
>  > #+end_src
>  > 
>  > #+RESULTS:
>  > : 1 2 3
>
> Thank you!  This makes a good test case.

I am confused. Isn't it a bug?

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



Re: [BUG] org-clock-auto-clockout does not actually use x11idle on X11 [9.6.8 (release_9.6.8-3-g21171d @ /usr/share/emacs/30.0.50/lisp/org/)]

2023-12-04 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Vladimir Nikishkin  writes:
>
>> For some time I have been wondering why auto-clockout does not use
>> x11idle on my machine.
>> ...

Attaching a tentative fix.
It would help if someone can test it on other machine.

>From d655c095fda6d1789a20aa93d4ac3a5f269dadc9 Mon Sep 17 00:00:00 2001
Message-ID: 
From: Ihor Radchenko 
Date: Mon, 4 Dec 2023 14:47:53 +0100
Subject: [PATCH] org-clock-auto-clockout: Honor system idle time.  Do not
 spawn multiple timers

* lisp/org-clock.el (org-clock--auto-clockout-timer-obj): New internal
variable holding the auto-clockout timer.
(org-clock--auto-clockout-maybe): New function to be used in timer.
Use `org-user-idle-seconds' to check for idleness.  Make sure that we
correctly handle system idle time, which may be lesser than Emacs idle
time.
(org-clock-auto-clockout): Do not create duplicate timers.  Use the
new internal helper function.

Reported-by: Vladimir Nikishkin 
Link: https://orgmode.org/list/87ttqv6l2g@laptop.lockywolf.net
---
 lisp/org-clock.el | 35 ---
 1 file changed, 32 insertions(+), 3 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index eda312d74..a042af4f3 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1493,6 +1493,33 @@ (defun org-clock-in ( select start-time)
 	 (message "Clock starts at %s - %s" ts org--msg-extra)
 	 (run-hooks 'org-clock-in-hook))
 
+(defvar org-clock--auto-clockout-timer-obj nil
+  "Timer object holding the existing clockout timer.")
+(defun org-clock--auto-clockout-maybe ()
+  "Clock out the currently clocked in task when idle.
+See `org-clock-auto-clockout-timer' to set the idle time span.
+
+This function is to be called by a timer."
+  (when (and (numberp org-clock-auto-clockout-timer)
+	 org-clock-current-task)
+(let ((user-idle-seconds (org-user-idle-seconds)))
+  (cond
+   ;; Already idle.  Clock out.
+   ((>= user-idle-seconds org-clock-auto-clockout-timer)
+(setq org-clock--auto-clockout-timer-obj nil)
+(org-clock-out))
+   ;; Emacs is idle but system is not.  Retry assuming that system will remain idle.
+   ((>= (org-emacs-idle-seconds) org-clock-auto-clockout-timer)
+(setq org-clock--auto-clockout-timer-obj
+  (run-with-timer
+   (- org-clock-auto-clockout-timer user-idle-seconds)
+   nil #'org-clock--auto-clockout-maybe)))
+   ;; Emacs is not idle.  Check again next time we are idle.
+   (t
+(setq org-clock--auto-clockout-timer-obj
+  (run-with-idle-timer
+   org-clock-auto-clockout-timer nil #'org-clock--auto-clockout-maybe)))
+
 (defun org-clock-auto-clockout ()
   "Clock out the currently clocked in task if Emacs is idle.
 See `org-clock-auto-clockout-timer' to set the idle time span.
@@ -1500,9 +1527,11 @@ (defun org-clock-auto-clockout ()
 This is only effective when `org-clock-auto-clockout-insinuate'
 is present in the user configuration."
   (when (and (numberp org-clock-auto-clockout-timer)
-	 org-clock-current-task)
-(run-with-idle-timer
- org-clock-auto-clockout-timer nil #'org-clock-out)))
+	 org-clock-current-task
+ (not (timerp org-clock--auto-clockout-timer-obj)))
+(setq org-clock--auto-clockout-timer-obj
+  (run-with-idle-timer
+   org-clock-auto-clockout-timer nil #'org-clock--auto-clockout-maybe
 
 ;;;###autoload
 (defun org-clock-toggle-auto-clockout ()
-- 
2.42.0


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


Re: [PATCH] org-id: allow using parent's existing id in links to headlines

2023-12-04 Thread Rick Lupton
Hi,

I can’t see this patch listed at https://tracker.orgmode.org/ so just wanted to 
check it hasn’t got lost?

Thanks
Rick

On Sun, 19 Nov 2023, at 3:21 PM, Rick Lupton wrote:
> Here's an updated patch, which adds (optional) search strings to ID 
> links, and the option to inherit ID targets from parent headline / the 
> top level file properties.  I've also updated ORG-NEWS and the manual, 
> and added tests.
>
> I think I've fixed all the issues with my first patch about which 
> headline gets used for the description when inheriting IDs, what 
> happens if there is no ID, etc.
>
>> Ideally, we should have all the necessary logic to store the link within 
>> `org-id-store-link' and then use `org-link-set-parameters' to configure id 
>> links.
>> ...
>> I think that we need to make a change in the rules for :store functions. 
>> `interactive?' may be passed as the argument to these functions.
>
> I've also moved the org-id specific logic from `org-store-link` to 
> `org-id-store-link`, and added the `interactive?` argument to link 
> store functions as discussed.
>
>>> So my question is: should search strings be added to all org-id links?
>> Sounds as a reasonable default, but users should have an option to revert to 
>> previous behaviour with heading id being stored.
>
> The default value for the new option `org-id-link-use-context` is `t`, 
> but it can be set to `nil` (or disabled with a prefix argument to 
> `org-store-link` temporarily).  This is a change in default behaviour 
> when storing ID links with point at a subheading, named block, or 
> target, or with an active region.
>
> The option `org-id-link-consider-parent-id` I've left with a default 
> value of `nil`, since I'm not sure if everyone will want this behaviour.
>
> Thanks
> Rick
>
> Attachments:
> * 0001-org-id.el-Extend-links-with-search-strings-inherit-p.patch



Re: Using backticks for the inline code delimiter? (now with `org-publish-all`)

2023-12-04 Thread Ihor Radchenko
chris  writes:

> The code below is working fine as long as I stay in `org-mode`. But it shows 
> its limitations when I do `M-x org-publish-all`, at which time, instead of 
> having the text with style verbatim, I get the text within backticks.
>
> Is there any improvement you could think of that would fix that?

You will need to patch the parser in org-element.el.

We do not officially support extending markup syntax. So, even changing
org-element may still leave other bugs. Caveat emptor.

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



Re: Inactive timestamp with TODO are exported in .ics file

2023-12-04 Thread Ihor Radchenko
Cletip Cletip  writes:

> Despite setting (org-icalendar-with-timestamps 'active), I am facing an
> issue where the export includes items with the TODO state and inactive
> timestamp. 
> ...
> (org-icalendar-with-timestamps 'active)
> (org-icalendar-include-todo nil) ;; nil to not clone scheduled TODO task
> (org-icalendar-use-scheduled'(event-if-todo-not-done event-if-not-todo))
> (org-icalendar-use-deadline '(event-if-not-todo event-if-todo-not-done))
> )
> ...
>  TODO A tickler (TODO + scheduled + inactive timestamp) (not exported)
> SCHEDULED:[2023-08-05 Sat 18:33]
> :PROPERTIES:
> :ID:   71fc9702-f479-4d36-ad6f-457892df6ab9
> :END:
> ...
> Why are the "tickler" exported, despite it is an inactive timestamp ?
> Is the a solution to export appointment and the tasks, exclude the tickler ?

Because `org-icalendar-use-scheduled' takes precedence. In fact, Org has
no notion of inactive timestamp in SCHEDULED. You will even see a
warning if you run M-x org-lint on the provided example file.

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



Re: [BUG] Tangle with symbolic links don't work

2023-12-04 Thread Ihor Radchenko
Cletip Cletip  writes:

> Sorry to bring up the subject again, but I didn't quite understand what the
> solution was: should I modify the function ? Is it modified in a new
> version of org-mode ?

The tentative solution is attached. May you test it?

The previous discussion was mostly about how to best approach the solution.

>From cf9db7b5a602c2c0d4970c69a95d98640cefc9a0 Mon Sep 17 00:00:00 2001
Message-ID: 
From: Ihor Radchenko 
Date: Mon, 4 Dec 2023 13:55:05 +0100
Subject: [PATCH] org-babel-tangle: Do note erase the existing tangle target
 before overwriting

* lisp/ob-tangle.el (org-babel-tangle): Do not remove the existing
tangle target file, if any.  `write-region' later will overwrite it
anyway, while removing may be unexpected if the existing target is a
symlink.

Reported-by: Cletip Cletip 
Link: https://list.orgmode.org/orgmode/caphku6o9nfvmafme3_ahmpjea_2qm0mjmfx6qppt8uiq94k...@mail.gmail.com/
---
 lisp/ob-tangle.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index b30fd9274..b48269897 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -310,9 +310,8 @@ (defun org-babel-tangle ( arg target-file lang-re)
   (compare-buffer-substrings
nil nil nil
tangle-buf nil nil)))
- ;; erase previous file
- (when (file-exists-p file-name)
-   (delete-file file-name))
+ ;; We do not erase, but overwrite previous file
+ ;; to preserve any existing symlinks.
 		 (write-region nil nil file-name)
 		 (mapc (lambda (mode) (set-file-modes file-name mode)) modes))
(push file-name path-collector))
-- 
2.42.0


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