Re: Emacs and org mode in aws

2023-04-16 Thread Christopher M. Miles

Naresh Gurbuxani  writes:

> In my Amazon Web Service account, I can launch emacs from the terminal. 
> Nearly all emacs features
> work well. But I miss the ability to view graphs created by code blocks in 
> org mode. Have other
> members found a solution?
>

I don't know whether AWS supports SSH X11 Forwarding. But you can check
out this feature to get Linux desktop forwarding view as for Emacs
graphics.

-- 

[ stardiviner ]
I try to make every word tell the meaning that I want to express without 
misunderstanding.

Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3


signature.asc
Description: PGP signature


Re: [RFC] ox-icalendar: Unscheduled tasks & repeating tasks

2023-04-16 Thread Jack Kamm
Ihor Radchenko  writes:

>> So technically, a standalone DEADLINE + repeater isn't allowed -- a
>> repeating task must always have a start date.
>
> May we then use org-deadline-warning-days/timestamp warntime spec as DTSTART?
> VALARM component is not fitting for warning days anyway.
>
>> But still, maybe we should stick to the requirement, and only export
>> repeater on SCHEDULED. That would simplify the implementation. The
>> downside is that repeating deadlines won't show up in iCalendar, which
>> seems undesirable.
>
> Agree. We should better stick to the spec.

I took a closer look into how other programs handle RRULE, DTSTART, DUE.

I tried the following CalDav servers:

Nextcloud, radicale

And the following clients:

Tasks.org, Thunderbird, Evolution. (I did not use Nextcloud client
because it doesn't support repeating tasks, even though the Nextcloud
server does).

Thunderbird and Evolution clients do not allow creating repeating tasks
without start date -- if you try to do so, they will force you to
specify one.

Tasks.org client does allow repeating tasks with only a deadline (no
start date).  Nextcloud and radicale servers happily accept the
repeating deadline from Tasks.org without start date. When I download
the ICS file from the server, the VTODO contains RRULE and DUE, but not
DTSTART. When I validate the ICS file with icalendar.org [1], it accepts
the ICS as valid, even though it seemingly violates the spec by missing
DTSTART.

So, it seems there is some inconsistency about this in the iCalendar
ecosystem.

I have not yet reached a firm conclusion on the best solution, but am
leaning towards your suggestion to use org-deadline-warning-days for
DTSTART in this case. I'll try to have a more concrete, updated patch on
this ready in a couple weeks or so.


[1] https://icalendar.org/validator.html



[PATCH] lisp/org-id.el: Add new relative timestamp feature for `ts' `org-id-method'

2023-04-16 Thread fernseed
From: Kierin Bell 

* lisp/org-id.el (org-id-ts-relative, org-id-ts-relative-method):
(org-id-ts-effective-format):
(org-id-ts-elapsed-format): New custom variables controlling the
relative timestamp feature for the `ts' `org-id-method'.
(org-id-ts-format-strip-redundant): New function for 
`org-id-ts-effective-format'.
(org-id-ts-effective-from-keyword):
(org-id-ts-format-relative): New helper functions for generating
relative timestamps.
(org-id-new): Use the new variables to optionally generate IDs in the
new relative timestamp format.

* etc/ORG-NEWS (New relative timestamp feature now available for the
~ts~ ~org-id-method~): Document the new feature.
---
This patch introduces a new feature for the `ts` method specified by
`org-id-method' that allows for the creation IDs with relative
timestamps. This is my first patch for Emacs/Org mode. I have just
started the FSF copyright assignment process.

 etc/ORG-NEWS   |  40 +++
 lisp/org-id.el | 178 +++--
 2 files changed, 213 insertions(+), 5 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index b6acafc3d..58d61fa43 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -201,6 +201,46 @@ Running shell blocks with the ~:session~ header freezes 
Emacs until
 execution completes.  The new ~:async~ header allows users to continue
 editing with Emacs while a ~:session~ block executes.
 
+*** New relative timestamp feature now available for the ~ts~ ~org-id-method~
+
+The new ~org-id-ts-relative~, ~org-id-ts-relative-method~,
+~org-id-ts-effective-format~, and ~org-id-ts-elapsed-format~ options
+allow the user to modify the behavior of the ~ts~ ID method specified
+by ~org-id-method~.
+
+When ~org-id-ts-relative~ is non-nil, the new relative timestamp
+feature is enabled.  Before a ~ts~ timestamp ID is created, an attempt
+is made to determine an effective time for the current file according
+to ~org-id-ts-relative-method~, which can either be a regular
+expression matching a keyword name that contains an Org timestamp
+value or a function that is called in the current buffer and should
+return the effective date.
+
+If an effective time can be determined, then this is used to generate
+relative timestamps for IDs within the file.  Otherwise, timestamps
+for IDs are generated as normal using the current system time.
+
+Relative timestamps have the format:
+EFFECTIVE[+ELAPSED]
+
+...Where EFFECTIVE is generated by formatting the effective time
+according to ~org-id-ts-effective-format~, and ELAPSED is generated by
+calculating the elapsed time, in seconds, since the effective time and
+formatting that according to ~org-id-ts-elapsed-format~.  The latter
+can optionally be set to nil to omit the ELAPSED component.
+
+Assuming that a suitable keyword in the current file contains the
+timestamp [2023-04-16 Sun], an ID in the new relative timestamp
+format, created at exactly 12:00 on that same day using the default
+settings, would look like this:
+20230416T00+720.00
+
+Users of Protesilaos Stavrou's Denote package
+(https://protesilaos.com/emacs/denote), which provides a convenient
+mechanism for adding headings with a ~date~ keyword to Org files, may
+find this new feature particularly helpful, especially when organizing
+Org attachments.
+
 ** Miscellaneous
 *** Blank lines after removed objects are not retained during export
 
diff --git a/lisp/org-id.el b/lisp/org-id.el
index aa9610f16..e22635199 100644
--- a/lisp/org-id.el
+++ b/lisp/org-id.el
@@ -142,6 +142,109 @@ timezone, local time and precision down to 1e-6 seconds."
   :type 'string
   :package-version '(Org . "9.5"))
 
+(defcustom org-id-ts-relative nil
+  "Non-nil means to use relative timestamps where applicable.
+
+When this variable is non-nil and an ID is created using the `ts'
+method specified by `org-id-method', the relative timestamp
+format will be used if an effective time can be determined for
+the current Org file.
+
+The variable `org-id-ts-relative-method' specifies how the
+effective time is determined.  By default, if the first
+occurrence of a keyword with the name \\=\"date\\=\" contains a
+valid timestamp value, then this is used as the effective time,
+and otherwise, the ID is created as a normal timestamp using the
+current system time, as if this variable were nil.
+
+A relative timestamp has the format:
+EFFECTIVE[+ELAPSED]
+
+EFFECTIVE is generated by formatting the effective time according
+to the variable `org-id-ts-effective-format'.
+
+ELAPSED is generated by calculating the number of seconds that has
+elapsed since the effective time and formatting it according to
+`org-id-ts-elapsed-format', which can be set to nil to omit both the
+ELAPSED component and the \\='+\\=' separator."
+  :group 'org-id
+  :type 'boolean
+  :package-version '(Org . "9.6"))
+
+(defcustom org-id-ts-relative-method "date"
+  "Method to use for determining effective times for relative timestamps.
+
+If this variable is a string, then it is 

Re: Command not found when using Org + Guix + envrc.el

2023-04-16 Thread Adolfo De Unanue
I am facing the same problem, hopefully some one can help us
- A

On Sun, Apr 16, 2023, at 08:56, Fabio Natali wrote:
> Hi!
>
> I tend to set up my literate programming projects with:
>
> - Emacs and Org
> - Guix, to install the dependencies and create a development environment
> - direnv, to automatically load the Guix environment
> - envrc.el, to use direnv from Emacs
>
> It's a great setup and I'm very grateful to the above projects, but
> there are a few corner cases where things don't work as expected.
>
> For instance:
>
> - Define a Guix environment that includes Python (Python not being
>   installed on the system otherwise)
> - Create an envrc file that activates the Guix environment, e.g. via
>   ~eval "$(guix shell --search-paths --manifest="$1")~
> - In the same folder, create an Org file with a Python block
>
> The block is evaluated correctly when a new Emacs instance is launched
> from within the folder, and therefore from within the activated
> environment.
>
> However, things don't work as expected when using emacsclient with an
> existing Emacs server. Thanks to envrc.el the Guix environment gets
> apparently activated in the buffer, as confirmed by the envrc flag in
> the modeline and by the output of =(getenv "PATH")=. However, evaluating
> the block results in the following error:
>
> #+begin_quote
> /bin/bash: line 1: python: command not found
> [ Babel evaluation exited with code 127 ]
> #+end_quote
>
> Tangentially, if the block's header includes =:session=, as in
> =#+begin_src python :session=, then the error is slightly different and
> is displayed in the minibuffer as opposed to a separate buffer:
>
> #+begin_quote
> make-process--with-editor-process-filter: Searching for program: No 
> such file or directory, python
> #+end_quote
>
> Things work fine when manually setting =org-babel-python-command=, but
> hardcoding the Guix store path is clearly inconvenient, to start with
> it'd require constant update.
>
> #+begin_quote
> (setq-local org-babel-python-command "/gnu/store/...")
> #+end_quote
>
> Does anyone have any idea on how to investigate this further? I'm still
> unsure whether this may have to do with envrc.el, Org Babel, or possibly
> with some quirks in my configuration.
>
> Thanks, cheers, Fabio.



Re: Emacs and org mode in aws

2023-04-16 Thread Ihor Radchenko
Naresh Gurbuxani  writes:

> I understand that, in terminal, images are not displayed in emacs.  Are 
> people using other ways to connect to aws where they can see images in emacs?

I don't, but you may look into 40.1 TCP Emacs server (Emacs manual)

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



Re: Emacs and org mode in aws

2023-04-16 Thread Naresh Gurbuxani
I understand that, in terminal, images are not displayed in emacs.  Are people 
using other ways to connect to aws where they can see images in emacs?

Sent from my iPhone

> On Apr 16, 2023, at 7:01 AM, Ihor Radchenko  wrote:
> 
> Naresh Gurbuxani  writes:
> 
>> In my Amazon Web Service account, I can launch emacs from the terminal.  
>> Nearly all emacs features work well.  But I miss the ability to view graphs 
>> created by code blocks in org mode.  Have other members found a solution?
> 
> If your terminal Emacs does not support graphics, images will not be 
> displayed.
> 
> -- 
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 


Re: [BUG] ox-md image captions

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

> Indeed.
> I tried to make this point more clear in the attached patch for Org manual.

Applied, onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=62996300e

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



Re: [orgweb/zh-CN] [DRAFT PATCH] Tentative zh-CN translation

2023-04-16 Thread Ihor Radchenko
Ruijie Yu  writes:

>> -org-mode-parser
>> +/org-mode-parser/
>>
>> This probably belongs to the English version as well.
>
> Should the English version change belong to a new commit, unrelated to
> the translation patchset?  Or would I just modify it in the same commit
> where I translate zh-CN/tools.org?

A separate commit would be cleaner. However, if it requires you to do too
much unnecessary rebasing, we can postpone it until the main translation
is merged.

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



Re: [orgweb/zh-CN] [DRAFT PATCH] Tentative zh-CN translation

2023-04-16 Thread General discussions about Org-mode.


Ihor Radchenko  writes:

> Ruijie Yu  writes:
>
>>> Series of commits is ok.
>>
>> I have decided to push the changes to an unlisted cloned project on
>> sourcehut (https://sr.ht/~ruijieyu/orgweb), since otherwise I would have
>> to generate the patchset in every iteration, and attach the files to
>> emails _one by one_ on mu4e.  Let me know if you need me to attach the
>> patchset to keep a trace on the ML -- it takes me a while but I can do
>> it.
>
> mu4e does not support multiple selection when attaching files? AFAIK,
> Emacs supports drag-and-drop for attachments.

Hanno provided additional hints on that, and I will try to use dired to
place attachments in my next iteration. 

   * I think the "#+description:" portion of each *.org file can be just
 moved into setup.org?  That way we don't duplicate it twenty times.
>>>
>>> Agree.
>>
>> Noted.  I did not touch the descriptions outside of zh-CN; please let me
>> know if I should.
>
> It will be a good idea.

I'll update all "#+description" fields outside zh-CN in a single,
separate commit, unless you have other ideas.

>>> It will be useful to add alternative websites in Mandarin/Cantonese as a
>>> secondary link.
>>
>> Sounds good, will do on my next iteration.  One more question: should I
>> add the secondary link next to the primary link, or should I add them as
>> footnotes?
>
> IMHO, it will make sense to have an immediately visible alternative
> link. So, secondary link will do. Or you may even make the Chinese link
> primary, as the one that is more likely to be useful.

Noted.

>> On second look, this may just be because I ran `C-c C-e h h'.  I tried
>> to run this command on the English site, and the generated site also
>> behaves like what I described above.
>>
>> I am curious about the differences between `C-c C-e h h' and publish.sh.
>> I didn't run publish.sh because I don't think the publish script should
>> be run locally as-is, since it contains hardcoded paths.
>
> Publishing is quite a bit different. For example, it tries hard to make
> the HTML anchors stable. There are other differences as well.

Got it.  As evident from some of my other messages, I have therefore
switched over to using publish.sh because I want to be able to see how
exactly each page looks.

-- 
Best,


RY



Re: [orgweb/zh-CN] [DRAFT PATCH] Tentative zh-CN translation

2023-04-16 Thread General discussions about Org-mode.


Ihor Radchenko  writes:

> Ruijie Yu via "General discussions about Org-mode."
>  writes:
>
>> I underwent a (painfully long) process of git magickery so that each
>> "translation" commit only _translates_ a file, instead of adds a brand
>> new file with brand new contents.  This means reviewers can have an
>> easier time to just review the diff without needing to look back and
>> forth between two files.
>
> Thanks!
>
>> +  
>> +概述显示 
>
> I'd look into, for example, how Chinese version of WPS office names outlines.

Thanks, installing it now and will take a look.

> Also, I noticed that in tools.org you changed
>
> -org-mode-parser
> +/org-mode-parser/
>
> This probably belongs to the English version as well.

Should the English version change belong to a new commit, unrelated to
the translation patchset?  Or would I just modify it in the same commit
where I translate zh-CN/tools.org?

-- 
Best,


RY



Re: [orgweb/zh-CN] [DRAFT PATCH] Tentative zh-CN translation

2023-04-16 Thread General discussions about Org-mode.


Hanno Perrey  writes:

>>> I have decided to push the changes to an unlisted cloned project on
>>> sourcehut (https://sr.ht/~ruijieyu/orgweb), since otherwise I would have
>>> to generate the patchset in every iteration, and attach the files to
>>> emails _one by one_ on mu4e.  Let me know if you need me to attach the
>>> patchset to keep a trace on the ML -- it takes me a while but I can do
>>> it.
>>
>>mu4e does not support multiple selection when attaching files? AFAIK,
>>Emacs supports drag-and-drop for attachments.
>
> Just FYI: It is possible to attach several files in one go in mu4e, by using 
> the integration into dired and marking any file to be attached: 
> https://www.djcbsoftware.nl/code/mu/mu4e/Dired.html

Thanks for mentioning it and for the link, I'll remember to use that
next time.

> Best wishes,
> Hanno
>
> PS: hope the formatting of this mail is ok, I am currently struggling with 
> the k9mail configuration on my mobile

All your paragraphs show up as long lines on my end, so evidently your
mobile email client soft-wraps your paragraphs for you (instead of
hard-wrapping, i.e., adding real newline chars).  Typical behavior on
mobile email clients, so I'm not surprised.

-- 
Best,


RY



Command not found when using Org + Guix + envrc.el

2023-04-16 Thread Fabio Natali
Hi!

I tend to set up my literate programming projects with:

- Emacs and Org
- Guix, to install the dependencies and create a development environment
- direnv, to automatically load the Guix environment
- envrc.el, to use direnv from Emacs

It's a great setup and I'm very grateful to the above projects, but
there are a few corner cases where things don't work as expected.

For instance:

- Define a Guix environment that includes Python (Python not being
  installed on the system otherwise)
- Create an envrc file that activates the Guix environment, e.g. via
  ~eval "$(guix shell --search-paths --manifest="$1")~
- In the same folder, create an Org file with a Python block

The block is evaluated correctly when a new Emacs instance is launched
from within the folder, and therefore from within the activated
environment.

However, things don't work as expected when using emacsclient with an
existing Emacs server. Thanks to envrc.el the Guix environment gets
apparently activated in the buffer, as confirmed by the envrc flag in
the modeline and by the output of =(getenv "PATH")=. However, evaluating
the block results in the following error:

#+begin_quote
/bin/bash: line 1: python: command not found
[ Babel evaluation exited with code 127 ]
#+end_quote

Tangentially, if the block's header includes =:session=, as in
=#+begin_src python :session=, then the error is slightly different and
is displayed in the minibuffer as opposed to a separate buffer:

#+begin_quote
make-process--with-editor-process-filter: Searching for program: No such file 
or directory, python
#+end_quote

Things work fine when manually setting =org-babel-python-command=, but
hardcoding the Guix store path is clearly inconvenient, to start with
it'd require constant update.

#+begin_quote
(setq-local org-babel-python-command "/gnu/store/...")
#+end_quote

Does anyone have any idea on how to investigate this further? I'm still
unsure whether this may have to do with envrc.el, Org Babel, or possibly
with some quirks in my configuration.

Thanks, cheers, Fabio.



Re: [orgweb/zh-CN] [DRAFT PATCH] Tentative zh-CN translation

2023-04-16 Thread Hanno Perrey


>> I have decided to push the changes to an unlisted cloned project on
>> sourcehut (https://sr.ht/~ruijieyu/orgweb), since otherwise I would have
>> to generate the patchset in every iteration, and attach the files to
>> emails _one by one_ on mu4e.  Let me know if you need me to attach the
>> patchset to keep a trace on the ML -- it takes me a while but I can do
>> it.
>
>mu4e does not support multiple selection when attaching files? AFAIK,
>Emacs supports drag-and-drop for attachments.

Just FYI: It is possible to attach several files in one go in mu4e, by using 
the integration into dired and marking any file to be attached: 
https://www.djcbsoftware.nl/code/mu/mu4e/Dired.html

Best wishes,
Hanno

PS: hope the formatting of this mail is ok, I am currently struggling with the 
k9mail configuration on my mobile



Re: [orgweb/zh-CN] [DRAFT PATCH] Tentative zh-CN translation

2023-04-16 Thread Ihor Radchenko
Ruijie Yu  writes:

>> Series of commits is ok.
>
> I have decided to push the changes to an unlisted cloned project on
> sourcehut (https://sr.ht/~ruijieyu/orgweb), since otherwise I would have
> to generate the patchset in every iteration, and attach the files to
> emails _one by one_ on mu4e.  Let me know if you need me to attach the
> patchset to keep a trace on the ML -- it takes me a while but I can do
> it.

mu4e does not support multiple selection when attaching files? AFAIK,
Emacs supports drag-and-drop for attachments.

>>>   * Please let me know if there are any guidelines for commit messages
>>> which I should follow.
>>
>> See https://orgmode.org/worg/org-contribute.html#commit-messages
>
> Tried to abide, please confirm.

Looks OK.

>>>   * I think the "#+description:" portion of each *.org file can be just
>>> moved into setup.org?  That way we don't duplicate it twenty times.
>>
>> Agree.
>
> Noted.  I did not touch the descriptions outside of zh-CN; please let me
> know if I should.

It will be a good idea.

>> It will be useful to add alternative websites in Mandarin/Cantonese as a
>> secondary link.
>
> Sounds good, will do on my next iteration.  One more question: should I
> add the secondary link next to the primary link, or should I add them as
> footnotes?

IMHO, it will make sense to have an immediately visible alternative
link. So, secondary link will do. Or you may even make the Chinese link
primary, as the one that is more likely to be useful.

> [And small nit, Hong Kong is not a province but a S.A.R. :) ]

Of course. I did not mean otherwise.

> On second look, this may just be because I ran `C-c C-e h h'.  I tried
> to run this command on the English site, and the generated site also
> behaves like what I described above.
>
> I am curious about the differences between `C-c C-e h h' and publish.sh.
> I didn't run publish.sh because I don't think the publish script should
> be run locally as-is, since it contains hardcoded paths.

Publishing is quite a bit different. For example, it tries hard to make
the HTML anchors stable. There are other differences as well.

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



Re: [PATCH] ox.el: Customize org-export-dispatch options

2023-04-16 Thread Ihor Radchenko
Jim Wisniewski  writes:

> On Sat, Apr 15, 2023 at 5:47 AM Ihor Radchenko  wrote:
>
>> Thanks! Looks like reasonable addition. See some minor comments below.
>
> Ah, thanks for your feedback; this is my first time contributing to Emacs so I
> appreciate the pointers.  Okay, I've attached an updated patch per your review
> comments.

No further comments from me.

Now, need to wait until your copyright is in order.

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



Re: [orgweb/zh-CN] [DRAFT PATCH] Tentative zh-CN translation

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

> I underwent a (painfully long) process of git magickery so that each
> "translation" commit only _translates_ a file, instead of adds a brand
> new file with brand new contents.  This means reviewers can have an
> easier time to just review the diff without needing to look back and
> forth between two files.

Thanks!

> +  
> + 概述显示 

I'd look into, for example, how Chinese version of WPS office names outlines.

Also, I noticed that in tools.org you changed

-org-mode-parser
+/org-mode-parser/

This probably belongs to the English version as well.

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



Re: Checkbox dependencies and invisible tasks

2023-04-16 Thread Gautier Ponsinet
Ihor Radchenko  (2023-04-16 11:56 +):
> It was an actual bug showed up after switching to lexical scope.
> Fixed, on bugfix.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=0f6ae7296

Thank you!



Re: [BUG] cannot latex-export images linked to websites (error) [9.6.3 (N/A @ /gnu/store/5bhjhzyn6cnal35xad5x55f7b4hf2jcp-emacs-org-9.6.3/share/emacs/site-lisp/org-9.6.3/)]

2023-04-16 Thread Ihor Radchenko
"Dr. Arne Babenhauserheide"  writes:

> When I try to export this org-mode snippet as PDF, I get errors:
>
>
> #+caption: Schematic
> [[https://www.draketo.de/wissen/essd-14-4811-2022-f02-web--cc-by.png][file:essd-14-4811-2022-f02-web--cc-by.png]]
> ...
> The cause seems to be that this is exported as a figure wrapped in a
> \href — see the latex export part:
>
>
> \href{https://www.draketo.de/wissen/essd-14-4811-2022-f02-web--cc-by.png}{\begin{figure}[htbp]
>
> \includegraphics[width=.9\linewidth]{essd-14-4811-2022-f02-web--cc-by.png}
> \caption{Schematic}
> \end{figure}}

Confirmed.
Thanks for reporting!

This specific scenario is not handled by ox-latex logic. You should
either remove caption or not use nested links here for now, until this
is fixed.

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



Re: [BUG] Org-9.6.x org templates hang on 'clipboard pasted as level 2 subtree'...

2023-04-16 Thread Ihor Radchenko
Carlo Tambuatco  writes:

> I restarted emacs with org 9.6.3 and reloaded it uncompiled and
> did M-x toggle-debug-on-error to turn on backtrace on error.
>
> I have also attached a copy of what my org-capture-templates
> variable looks like.
>
> Comparing these backtraces to my org-capture-templates,
> you can see that only some of them fail (the ones corresponding to
> 'd', 'e', 'r', 'Rr', 'Rg', and 'Cc')
>
> They all worked up until Org 9.6. They still work under Org 9.5.5, so
> I don't know what changed.

I tried your templates locally and I am not seeing any problem.

May you try to reproduce starting from emacs -Q?
Or, alternatively, try to use the following version of Org capture, use
C-g to exit, and report the (hopefully) more detailed backtrace.

(defun org-capture ( goto keys)
  "Capture something.
\\
This will let you select a template from `org-capture-templates', and
then file the newly captured information.  The text is immediately
inserted at the target location, and an indirect buffer is shown where
you can edit it.  Pressing `\\[org-capture-finalize]' brings you back to the \
previous
state of Emacs, so that you can continue your work.

When called interactively with a `\\[universal-argument]' prefix argument \
GOTO, don't
capture anything, just go to the file/headline where the selected
template stores its notes.

With a `\\[universal-argument] \\[universal-argument]' prefix argument, go to \
the last note stored.

When called with a `C-0' (zero) prefix, insert a template at point.

When called with a `C-1' (one) prefix, force prompting for a date when
a datetree entry is made.

ELisp programs can set KEYS to a string associated with a template
in `org-capture-templates'.  In this case, interactive selection
will be bypassed.

If `org-capture-use-agenda-date' is non-nil, capturing from the
agenda will use the date at point as the default date.  Then, a
`C-1' prefix will tell the capture process to use the HH:MM time
of the day at point (if any) or the current HH:MM time."
  (interactive "P")
  (when (and org-capture-use-agenda-date
 (eq major-mode 'org-agenda-mode))
(setq org-overriding-default-time
  (org-get-cursor-date (equal goto 1
  (cond
   ((equal goto '(4))  (org-capture-goto-target keys))
   ((equal goto '(16)) (org-capture-goto-last-stored))
   (t
(let* ((orig-buf (current-buffer))
   (annotation (if (and (boundp 'org-capture-link-is-already-stored)
org-capture-link-is-already-stored)
   (plist-get org-store-link-plist :annotation)
 (ignore-errors (org-store-link nil
   (entry (or org-capture-entry (org-capture-select-template keys)))
   initial)
  (setq initial (or org-capture-initial
(and (org-region-active-p)
 (buffer-substring (point) (mark)
  (when (stringp initial)
(remove-text-properties 0 (length initial) '(read-only t) initial))
  (when (stringp annotation)
(remove-text-properties 0 (length annotation)
'(read-only t) annotation))
  (cond
   ((equal entry "C")
(customize-variable 'org-capture-templates))
   ((equal entry "q")
(user-error "Abort"))
   (t
(org-capture-set-plist entry)
(org-capture-get-template)
(org-capture-put :original-buffer orig-buf
 :original-file (or (buffer-file-name orig-buf)
(and (featurep 'dired)
 (car (rassq orig-buf
 dired-buffers
 :original-file-nondirectory
 (and (buffer-file-name orig-buf)
  (file-name-nondirectory
   (buffer-file-name orig-buf)))
 :annotation annotation
 :initial initial
 :return-to-wconf (current-window-configuration)
 :default-time (or org-overriding-default-time
   (org-current-time)))
(org-capture-set-target-location (and (equal goto 0) 'here))
(condition-case error
(org-capture-put :template (org-capture-fill-template))
  ((error quit)
   (if (get-buffer "*Capture*") (kill-buffer "*Capture*"))
   (error "Capture abort: %s" (error-message-string error

(setq org-capture-clock-keep (org-capture-get :clock-keep))
(org-capture-place-template
 (eq (car (org-capture-get :target)) 'function))
(when (and (derived-mode-p 'org-mode) (org-capture-get :clock-in))
  (condition-case nil
  (progn
(when (org-clock-is-active)
  (org-capture-put :interrupted-clock

Re: Checkbox dependencies and invisible tasks

2023-04-16 Thread Ihor Radchenko
Gautier Ponsinet  writes:

> I understand. However, the docstring of the variable says:
>... 
> they become unblocked.  An exemption to this behavior is when a task is
> blocked because of unchecked checkboxes below it.

Fair point.
It was an actual bug showed up after switching to lexical scope.
Fixed, on bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=0f6ae7296

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



Re: Checkbox dependencies and invisible tasks

2023-04-16 Thread Gautier Ponsinet
Hello Ihor,

Ihor Radchenko  (2023-04-16 11:09 +):
> As you instructed Org, checkboxes should be considered as task blockers,
> if unchecked. Then, you instructed Org to hide blocked tasks in agenda.
> Your "Test entry" is blocked by the checkbox. Thus, it is hidden in the
> agenda.

I understand. However, the docstring of the variable says:

"Instead of t, this variable can also have the value ‘invisible’.
Then blocked tasks will be invisible and only become visible when
they become unblocked.  An exemption to this behavior is when a task is
blocked because of unchecked checkboxes below it.  Since checkboxes do
not show up in the agenda views, making this task invisible you remove any
trace from agenda views that there is something to do.  Therefore, a task
that is blocked because of checkboxes will never be made invisible, it
will only be dimmed."

I don't understand how this fits with the behavior you describe.

All the best,
Gautier.



Re: Checkbox dependencies and invisible tasks

2023-04-16 Thread Ihor Radchenko
Gautier Ponsinet  writes:

> (setq org-agenda-files '("~/agenda.org"))
> (setq org-enforce-todo-checkbox-dependencies t)
> (setq org-agenda-dim-blocked-tasks 'invisible)
>
> with the following agenda.org file:
>
> * TODO Test entry
> <2023-04-16 dim.>
> - [ ] a checkbox
>
> then the entry "Test entry" does not appear in the agenda or in the
> Global list of TODO items !
>
> Am I missing or misunderstanding something?

As you instructed Org, checkboxes should be considered as task blockers,
if unchecked. Then, you instructed Org to hide blocked tasks in agenda.
Your "Test entry" is blocked by the checkbox. Thus, it is hidden in the
agenda.

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



Re: [BUG] org-delete-indentation on region doesn't work when END is before BEGIN [9.6.1 (release_9.6.1-40-g3d817c @ /home/sbaugh/.local/src/emacs29/lisp/org/)]

2023-04-16 Thread Ihor Radchenko
Spencer Baugh  writes:

> 1. emacs -Q
> 2. Insert the following in an org-mode buffer
> * head
> a
> b
> 3. C-x h M-^ and note that it's now formatted as:
> a
> b
>  * head

`org-delete-indentation' did not support regions properly.
I tried to make things more consistent with `delete-indentation in the
attached patch.

May you please test the patch and let me know if there are any other
inconsistencies you observe?

>From 6e9a09dd74e0fcb38563b1042163e95e3e43c4da Mon Sep 17 00:00:00 2001
Message-Id: <6e9a09dd74e0fcb38563b1042163e95e3e43c4da.1681642978.git.yanta...@posteo.net>
From: Ihor Radchenko 
Date: Sun, 16 Apr 2023 13:00:40 +0200
Subject: [PATCH] org-delete-indentation: Support region selection

* lisp/org.el (org-delete-indentation): Support active region when the
first line in region is a heading.  Clarify in the docstring that
region is ignored with prefix argument.

Reported-by: Spencer Baugh 
Link: https://orgmode.org/list/ier3552edfr@janestreet.com
---
 lisp/org.el | 41 +
 1 file changed, 25 insertions(+), 16 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 26d2a8610..9422fd587 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -17675,41 +17675,50 @@ (defun org-kill-note-or-show-branches ()
 	   (org-fold-show-branches)
 	   (org-fold-hide-archived-subtrees beg end)
 
-(defun org-delete-indentation ( arg)
+(defun org-delete-indentation ( arg beg end)
   "Join current line to previous and fix whitespace at join.
 
 If previous line is a headline add to headline title.  Otherwise
 the function calls `delete-indentation'.
 
-I.e. with a non-nil optional argument, join the line with the
-following one.  If there is a region then join the lines in that
-region."
-  (interactive "*P")
+If there is a region (BEG END), then join the lines in that region.
+
+With a non-nil prefix ARG, join the line with the following one,
+ignoring region."
+  (interactive
+   (cons current-prefix-arg
+ (when (and (not current-prefix-arg) (use-region-p))
+   (list (region-beginning) (region-end)
+  (unless (and beg end)
+;; No region selected or BEG/END arguments not passed.
+(setq beg (line-beginning-position (if arg 1 0))
+  end (line-end-position (if arg 2 1
   (if (save-excursion
-	(beginning-of-line (if arg 1 0))
-	(let ((case-fold-search nil))
-	  (looking-at org-complex-heading-regexp)))
+(goto-char beg)
+(beginning-of-line)
+(and (< (line-end-position) end)
+ (let ((case-fold-search nil))
+	   (looking-at org-complex-heading-regexp
   ;; At headline.
   (let ((tags-column (when (match-beginning 5)
 			   (save-excursion (goto-char (match-beginning 5))
 	   (current-column
-	(string (concat " " (progn (when arg (forward-line 1))
-   (org-trim (delete-and-extract-region
-		  (line-beginning-position)
-		  (line-end-position)))
-	(unless (bobp) (delete-region (point) (1- (point
+	string)
+(goto-char beg)
+;; Join all but headline.
+(save-excursion (save-match-data (delete-indentation nil (line-beginning-position 2) end)))
+(setq string (org-trim (delete-and-extract-region (line-end-position) (line-end-position 2
 	(goto-char (or (match-end 4)
 		   (match-beginning 5)
 		   (match-end 0)))
 	(skip-chars-backward " \t")
-	(save-excursion (insert string))
+	(save-excursion (insert " " string))
 	;; Adjust alignment of tags.
 	(cond
 	 ((not tags-column))		;no tags
 	 (org-auto-align-tags (org-align-tags))
 	 (t (org--align-tags-here tags-column ;preserve tags column
-(let ((current-prefix-arg arg))
-  (call-interactively #'delete-indentation
+(funcall-interactively #'delete-indentation arg beg end)))
 
 (defun org-open-line (n)
   "Insert a new row in tables, call `open-line' elsewhere.
-- 
2.40.0


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


Re: Emacs and org mode in aws

2023-04-16 Thread Ihor Radchenko
Naresh Gurbuxani  writes:

> In my Amazon Web Service account, I can launch emacs from the terminal.  
> Nearly all emacs features work well.  But I miss the ability to view graphs 
> created by code blocks in org mode.  Have other members found a solution?

If your terminal Emacs does not support graphics, images will not be displayed.

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



Checkbox dependencies and invisible tasks

2023-04-16 Thread Gautier Ponsinet
Hello everyone,

In an empty "emacs -Q" session, if I evaluate only the following lines:

(setq org-agenda-files '("~/agenda.org"))
(setq org-enforce-todo-checkbox-dependencies t)
(setq org-agenda-dim-blocked-tasks 'invisible)

with the following agenda.org file:

* TODO Test entry
<2023-04-16 dim.>
- [ ] a checkbox

then the entry "Test entry" does not appear in the agenda or in the
Global list of TODO items !

Am I missing or misunderstanding something?

(emacs-version: GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+
Version 3.24.36, cairo version 1.17.6) of 2023-01-03
org-version: 9.6.3)

All the best,
Gautier.



[BUG] cannot latex-export images linked to websites (error) [9.6.3 (N/A @ /gnu/store/5bhjhzyn6cnal35xad5x55f7b4hf2jcp-emacs-org-9.6.3/share/emacs/site-lisp/org-9.6.3/)]

2023-04-16 Thread Dr. Arne Babenhauserheide


Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.


When I try to export this org-mode snippet as PDF, I get errors:


#+caption: Schematic
[[https://www.draketo.de/wissen/essd-14-4811-2022-f02-web--cc-by.png][file:essd-14-4811-2022-f02-web--cc-by.png]]


Runaway argument?
{\begin {figure}[htbp] 
! Paragraph ended before \href@split was complete.
 
   \par 
l.38 
 

LaTeX Warning: File `essd-14-4811-2022-f02-web--cc-by.png' not found on input l
ine 39.


! Package pdftex.def Error: File `essd-14-4811-2022-f02-web--cc-by.png' not fou
nd: using draft setting.

See the pdftex.def package documentation for explanation.
Type  H   for immediate help.
 ...  
  
l.39 ...dth]{essd-14-4811-2022-f02-web--cc-by.png}
  

(/gnu/store/3rqj0gzglw46lw3prrd1pdzqzkw0d2nz-texlive-texmf-20210325/share/texmf
-dist/tex/latex/base/t1cmtt.fd)

! LaTeX Error: \caption outside float.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H   for immediate help.
 ...  
  
l.40 \caption
 {Schematic}

Overfull \hbox (8.6822pt too wide) in paragraph at lines 39--41
[][] \T1/cmr/m/n/10.95 Schematic 
! Extra }, or forgotten \endgroup.
\@endfloatbox ...pagefalse \outer@nobreak \egroup 
  \color@endbox 
l.41 \end{figure}
 }
! Too many }'s.
\color@endbox ->\color@endgroup \egroup 

l.41 \end{figure}
 }

! LaTeX Error: \begin{document} ended by \end{figure}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H   for immediate help.
 ...  
  
l.41 \end{figure}
 }
! Extra \endgroup.
 \endgroup 
  
l.41 \end{figure}
 }
! Too many }'s.
l.41 \end{figure}}
  

The cause seems to be that this is exported as a figure wrapped in a
\href — see the latex export part:


\href{https://www.draketo.de/wissen/essd-14-4811-2022-f02-web--cc-by.png}{\begin{figure}[htbp]

\includegraphics[width=.9\linewidth]{essd-14-4811-2022-f02-web--cc-by.png}
\caption{Schematic}
\end{figure}}



Best wishes,
Arne

Emacs  : GNU Emacs 29.0.60 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, 
cairo version 1.16.0)
Package: Org mode version 9.6.3 (N/A @ 
/gnu/store/5bhjhzyn6cnal35xad5x55f7b4hf2jcp-emacs-org-9.6.3/share/emacs/site-lisp/org-9.6.3/)

-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de


signature.asc
Description: PGP signature