Re: org-insert-heading-before-current

2022-07-07 Thread Ihor Radchenko
Tyler Grinn  writes:

> In general, I like to order my headings from newest to oldest top to
> bottom. I'm looking for a function which will prepend a heading at the
> current level in the current subtree. Some examples:
>
>
>   * Subtree  * Subtree
>   ** Item 2  >>> ** |
>   ** Item 1| ** Item 2
>  ** Item 1

One can implement this using prefix arguments for org-insert-heading.
Similar to the existing C-u and C-u C-u arguments (see the docstring of
org-insert-heading).

Patches are welcome. (If you find this feature sufficiently important,
feel free to implement this new functionality and submit the patch)

Best,
Ihor



Re: Links to javascript-based websites from orgmode.org: Paypal and Github

2022-07-07 Thread Dr. Arne Babenhauserheide

Richard Stallman  writes:

> [[[ To any NSA and FBI agents reading my email: please consider]]]
> [[[ whether defending the US Constitution against all enemies, ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
>   > "Note: To be PCI compliant, you must load Stripe.js directly from
>   > https://js.stripe.com. You cannot include it in a bundle or host
>   > it yourself. This package wraps the global Stripe function
>   > provided by the Stripe.js script as an ES module."
>
> That is hard for me to understand, since I don't know what "PCI
> compliant" means (or who is expected to comply with "PCI" or why).

PCI compliance is a requirement by the credit card industry: 
https://www.investopedia.com/terms/p/pci-compliance.asp

Companies that follow and achieve the Payment Card Industry Data Security 
Standards (PCI DSS) are considered to be PCI compliant.
The PCI Security Standards Council is responsible for developing the PCI 
DSS.
PCI DSS has 12 key requirements, 78 base requirements, and 400 test 
procedures to ensure that organizations are PCI compliant.
Being PCI compliant reduces data breaches, protects the data of 
cardholders, avoids fines, and improves brand reputation.
PCI compliance is not required by law but is considered mandatory through 
court precedent.

> Also, what is a "ES module" and what are the implications of that?

ES module (EcmaScript modules) is just the term for the module system in
Javascript.
https://hacks.mozilla.org/2018/03/es-modules-a-cartoon-deep-dive/

> I wonder if users could run the free version of that JS code
> while talking with Stripe.

You could try replacing it in your browser.

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


signature.asc
Description: PGP signature


Re: Ignore, skip, omit headline when exporting to LaTeX

2022-07-07 Thread Ihor Radchenko
ed...@openmail.cc writes:

> Firstly, do tell me if I am breaking the nettiquete.

This is on topic and can be useful for others without knowing the
context of the mentioned discussion. So, there should be no issue with
posting this here, especially if you provide sufficient context.

> I found someone asking online how to ignore a headline when exporting  
> to LaTeX. This e-mail is to avoid creating an account on that forum  
> and to provide a solution.
>
> (require 'ox-extra)
>
>(defun org-export-ignore-headlines-latex (data backend info)
>  "Hack of `org-export-ignore-headlines' for LaTeX: add a  
> conditional for the latex backend and replace 'ignore' with 'ignoreltx'"
>  (when (org-export-derived-backend-p backend 'latex)
>(org-element-map data 'headline
>  (lambda (object)
>(when (member "ignoreltx" (org-element-property :tags object))
> ...
>  (org-element-extract-element object)))
>  info nil)
>data))

Note that this modified version of the function is derived from
org-export-ignore-headlines from ox-extra.el [1]
However, a part of the original function code is omitted.
AFAIU, this version also discards the headline contents, in addition to
the headline itself (unlike what org-export-ignore-headlines does).

Note that discarding headline + contents is also supported using
:NOEXPORT: tag.

[1] https://git.sr.ht/~bzg/org-contrib

Best,
Ihor



Re: Problem with defining stuck projects

2022-07-07 Thread Ihor Radchenko
Bob Heffernan  writes:

> I want the following:
>   1. A project is a level 1 header marked as TODO
>   2. A project is not stuck if it has any sub-header that is scheduled but 
> not closed.
>
> So, in the example above Project 1 counts as stuck, but Project 2 does not.
>
> What I've got so far is this:
> (setq org-stuck-projects
>   '("+LEVEL=1/TODO-DONE" nil nil "SCHEDULED:")
>
> But this will clearly mark both projects 1 and 2 as stuck.
> I need some way of specifying the "but not closed" part, but am at a loss as 
> to how I can do this.

If you have org-log-done set to 'time, your completed (closed) tasks
will contain CLOSED: ... in their planning line:

* DONE headline
CLOSED: [timestamp] SCHEDULED: [timestamp]

So, you can try the following regexp instead of "SCHEDULED:":

"^[ \t]*\\(SCHEDULED:\\|DEADLINE:\\)"

Best,
Ihor



Re: Links to javascript-based websites from orgmode.org: Paypal and Github

2022-07-07 Thread tomas
On Thu, Jul 07, 2022 at 11:33:39PM -0400, Richard Stallman wrote:
> [[[ To any NSA and FBI agents reading my email: please consider]]]
> [[[ whether defending the US Constitution against all enemies, ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> 
>   > "Note: To be PCI compliant, you must load Stripe.js directly from
>   > https://js.stripe.com. You cannot include it in a bundle or host
>   > it yourself. This package wraps the global Stripe function
>   > provided by the Stripe.js script as an ES module."
> 
> That is hard for me to understand, since I don't know what "PCI
> compliant" means (or who is expected to comply with "PCI" or why).

PCI probably refers to "Payment Card Industry" [1]: they set some
standards people processing payments better follow or else.

It's one of those cases where private industry gets to write things
which amount to law. Much worse than traditional law because there
is no democratic oversight to it.

Typically they tend (by accident or by design) to be hostile to
free software (the above is a good example of how that happens:
they attach some magic property to having "loaded Stripe.js from
[some specific URL]" thus hampering the copy, enhancement or
distribution; you're only allowed to study (unless they serve
obfuscated Javascript: I don't feel like looking).

> Also, what is a "ES module" and what are the implications of that?

That might be an "EcmaScript module" [2], given the context.

> I wonder if users could run the free version of that JS code
> while talking with Stripe.

It's kind of free. If you modify it you stop being compliant,
thus being allowed to use it.

Cheers

[1] https://en.wikipedia.org/wiki/Payment_Card_Industry_Data_Security_Standard
[2] https://flaviocopes.com/es-modules/

-- 
t


signature.asc
Description: PGP signature


Re: org-meta-return / org-insert-heading does not insert new heading in middle of heading even id org-M-RET-may-split-line is set

2022-07-07 Thread Ihor Radchenko
Guillaume MULLER  writes:

>> I tried to set org-M-RET-may-split-line to nil first followed by setting
>> it to either t or '((default . t)). For both values, I am seeing
>> 
>> * heading number
>> * <>one
>> 
>> which is expected behavior.
>
> Are you using DoomEmacs or Vanilla Emacs?

I am using Vanilla Emacs.
Note that Doom is known for carelessly advising some Org functions and
can sometimes break things. Such issues should be reported to Doom
developers.

> More precisely, are you using org-mode "9.6-??-e9da29b6f" as I do? (This is 
> the only version that gives me the strange behavior)

There is no such Org version. Our latest version tag is 9.5.4.
If you are seeing 9.6-..., it indicates some problem with your package
manager. I suggest to purge your local downloaded Org copy and
re-install Org.

>> Please, try to reproduce starting from emacs -Q (without Doom).
>> See https://orgmode.org/manual/Feedback.html

> What I tried:
>
> - Getting an as-vanilla-as-possible DoomInstall, by removing my config.org 
> and sync'ing Doom. I get the same "9.6-??-e9da29b6f" org version and 
> erroneous behavior.

9.6 means that your Doom is not clean enough. There is some problem with
your Org source code used by Doom.

> - Changing the version of org-mode used in Doom, by removing the directory 
> and installing the one from MELPA (9.5.4). This gives me the correct behavior 
> for org-meta-return, but it breaks too many other things in org to be usable.

What do you mean by "breaks too many other things in org"?

> - Using "vanilla" "emacs -Q" and running only org "9.6".
>
>   1. I've tried to manually load the org-version that comes with Doom, by 
> writing & executing "(add-to-list 'load-path 
> "/home/user/.emacs.d/modules/lang/org/lisp/autoload") (load "org")" from 
> scratch buffer, then running org-reload
>+ but I get org-version 9.3
>+ and I can't find a way to edit the "load-path" "variable" to remove the 
> native path ("/usr/share/emacs/27.1/lisp/org") from the list (sorry newbie 
> here...)

I do not think that "/home/user/.emacs.d/modules/lang/org/lisp/autoload"
contains Org source. AFAIK, Doom using using straight.el, which puts the
packages sources into .emacs.d/straight/repos/ and
.emacs/straight/build/. Though Doom might use different paths.

You can try to watch the video I recorded on testing Org issues:
https://open.tube/videos/watch/4d819114-43bf-42df-af94-f94fc53dd0d9
There, I showcased how to get a clean Org setup + vanilla Emacs.

>   2. I've tried to git clone the org-mode repo in /tmp, but don't see any 
> tag/branch that would correspond to a "9.6" version of org.
>   + I do see a commit matching e9da29b6f 
> (e9da29b6fafe63abbc2774e9d485ac13d2811b65)
> * I've tried to recover the code from this version "git checkout 
> e9da29b6f ."
> * Compiled it (make)
> * Opened emacs -Q
> * Wrote and executed "(add-to-list 'load-path "/tmp/org-mode/lisp/") 
> (load "org")" in the scratch buffer
> * Ran M-x org-reload
> + But "M-x org-version" still returns "Org mode version 9.5.4", and it 
> works as expected
>
> If you have any more hints on how I could setup an environment where I could 
> test just org-mode "9.6-??-e9da29b6f" on a raw/vanilla emacs, I vwould be 
> glad to test that.

Again, there is no such tag. There is official release version, which is
9.5.4; and there are two development branches: bugfix and main. The
bugfix is WIP minor release branch for 9.5.5 and main is the development
branch for next major release. Note that Doom is using the development
(main) branch, AFAIK.

Best,
Ihor



Re: Links to javascript-based websites from orgmode.org: Paypal and Github

2022-07-07 Thread Tim Cross


Richard Stallman  writes:

> [[[ To any NSA and FBI agents reading my email: please consider]]]
> [[[ whether defending the US Constitution against all enemies, ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
>   > "Note: To be PCI compliant, you must load Stripe.js directly from
>   > https://js.stripe.com. You cannot include it in a bundle or host
>   > it yourself. This package wraps the global Stripe function
>   > provided by the Stripe.js script as an ES module."
>
> That is hard for me to understand, since I don't know what "PCI
> compliant" means (or who is expected to comply with "PCI" or why).
> Also, what is a "ES module" and what are the implications of that?
>
PCI = "Payment Card Industry Data Security Standard", which is a set of
mandatory and requested measures merchants need to comply with in order
to be permitted to process credit card transactions. There are different
levels of compliance, which affect what the 'merchant' is allowed to do
and/or the fees they must pay.

ES = ECMAScript, the 'real' name for Javascript. 


> I wonder if users could run the free version of that JS code
> while talking with Stripe.

I think that is the point being made - it would seem you cannot.

Richard, in all these discussions, the one question you have not
addressed is why is it OK for the FSF to have a link to paypal on their
donation page (https://my.fsf.org/donate), but you say individual
projects cannot do the same? This seems inconsistent and potentially
hypocritical.  




Re: Org mode export accessibility

2022-07-07 Thread Ihor Radchenko
"T.V Raman"  writes:

> On org side:

Thanks for the feedback!

> 1. During authoring, ensure that authors have the ability to label
>images, drawings and math content.
>2. When exporting, make sure that that information gets through to
>   the exported format.

Could you please elaborate what you mean by "label"?

Org generally supports figures and equations in export, including adding
captions - all specific to the corresponding export backends (when the
backends support figures/equations).

>   3. For math especially, make sure the TeX/LaTeX is preserved one
>  way  or the other in the export

Do you refer to the TeX source? To any specific export format?

Best,
Ihor




Re: Org mode export accessibility

2022-07-07 Thread Ihor Radchenko
briangpowell  writes:

> Suggest OrgMode outputs focus on creating "Lowest Common Denominator"
> documents as output:
> TeXinfo docs should be used as the LCD doctype--suggest you focus on
> creating 1 document in Texinfo that you use to create all other sorts of
> documents, when possible:
>
> Pipeline should be more like
> OrgMode->Texinfo->TROFF||DTD/XML/HTML/XHTML->LaTeX/TeX->DVI||SVG->PS->PDF
>
> * TeXinfo: https://savannah.gnu.org/projects/texinfo
> https://www.gnu.org/software/texinfo

I do not think that using Texinfo as intermediate format is useful.
Texinfo does not support many of the available Org syntax structures
like, for example, backend-specific export blocks. We will inevitably
lose some document structure information when exporting to Texinfo.
Please remember that Texinfo is by no means a generic export engine - it
is tailored to produce software documentation specifically and may not
be suitable for more generic authored documents.

Note that we already have a much more feature-full export functionality.
RMS even suggested that Org might be used as a replacement for Texinfo:
https://yhetil.org/emacs-devel/e1nzqh5-0001ob...@fencepost.gnu.org

Best,
Ihor



Re: Warning (org-element-cache): org-element--cache: Warning( *helm-org-rifle-fontify*): Unregistered buffer modifications detected. Resetting.

2022-07-07 Thread Ihor Radchenko
Gregor Zattler  writes:

> Dear org-mode developers, Ihor, I got these warnings
> immediately after I purged ~/.cache/org-persist, started
> emacs/org-mode and tried to find some node via org-rifle.
> Backtrace:
>   org-element-cache diagnostics( *helm-org-rifle-fontify*): nil is about to 
> modify text: warning t
>   org-element-cache diagnostics( *helm-org-rifle-fontify*): nil is about to 
> modify text: warning t
> ...

Thanks for reporting! The backtrace is very helpful.

Can you please try the attached patch and let me know if it helps?

Best,
Ihor

>From 6bd34950429b37b4db8471015edc84d949bc40db Mon Sep 17 00:00:00 2001
Message-Id: <6bd34950429b37b4db8471015edc84d949bc40db.1657254235.git.yanta...@gmail.com>
From: Ihor Radchenko 
Date: Fri, 8 Jul 2022 12:22:16 +0800
Subject: [PATCH] org-element: Do not try to sync element cache in the middle
 of a change

* lisp/org-element.el (org-element--cache-sync): Do not sync between
`before-change-functions' and `after-change-functions'.

Fixes https://orgmode.org/list/87tu7tdljo.fsf@no.workgroup
---
 lisp/org-element.el | 122 +++-
 1 file changed, 63 insertions(+), 59 deletions(-)

diff --git a/lisp/org-element.el b/lisp/org-element.el
index 8964770f0..d0345410d 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -5946,67 +5946,71 @@ (defun org-element--cache-sync (buffer &optional threshold future-change offset)
 actually submitted."
   (when (buffer-live-p buffer)
 (with-current-buffer (or (buffer-base-buffer buffer) buffer)
-  ;; Check if the buffer have been changed outside visibility of
-  ;; `org-element--cache-before-change' and `org-element--cache-after-change'.
-  (if (/= org-element--cache-last-buffer-size (buffer-size))
-  (progn
-(org-element--cache-warn
- "Unregistered buffer modifications detected. Resetting.
+  ;; Do not sync when, for example, in the middle of
+  ;; `combine-change-calls'.  See the commentary inside
+  ;; `org-element--cache-active-p'.
+  (when (org-element--cache-active-p)
+;; Check if the buffer have been changed outside visibility of
+;; `org-element--cache-before-change' and `org-element--cache-after-change'.
+(if (/= org-element--cache-last-buffer-size (buffer-size))
+(progn
+  (org-element--cache-warn
+   "Unregistered buffer modifications detected. Resetting.
 If this warning appears regularly, please report the warning text to Org mode mailing list (M-x org-submit-bug-report).
 The buffer is: %s\n Current command: %S\n Backtrace:\n%S"
- (buffer-name (current-buffer))
- this-command
- (when (and (fboundp 'backtrace-get-frames)
-(fboundp 'backtrace-to-string))
-   (backtrace-to-string (backtrace-get-frames 'backtrace
-(org-element-cache-reset))
-(let ((inhibit-quit t) request next)
-  (setq org-element--cache-interrupt-C-g-count 0)
-	  (when org-element--cache-sync-timer
-	(cancel-timer org-element--cache-sync-timer))
-  (let ((time-limit (time-add nil org-element-cache-sync-duration)))
-	(catch 'org-element--cache-interrupt
-  (when org-element--cache-sync-requests
-(org-element--cache-log-message "Syncing down to %S-%S" (or future-change threshold) threshold))
-	  (while org-element--cache-sync-requests
-	(setq request (car org-element--cache-sync-requests)
-		  next (nth 1 org-element--cache-sync-requests))
-	(org-element--cache-process-request
-	 request
-	 (when next (org-element--request-key next))
-	 threshold
-	 (unless threshold time-limit)
-	 future-change
- offset)
-;; Re-assign current and next requests.  It could have
-;; been altered during phase 1.
-(setq request (car org-element--cache-sync-requests)
-		  next (nth 1 org-element--cache-sync-requests))
-	;; Request processed.  Merge current and next offsets and
-	;; transfer ending position.
-	(when next
-  ;; The following requests can only be either phase 1
-  ;; or phase 2 requests.  We need to let them know
-  ;; that additional shifting happened ahead of them.
-	  (cl-incf (org-element--request-offset next) (org-element--request-offset request))
-  (org-element--cache-log-message
-   "Updating next request offset to %S: %s"
-   (org-element--request-offset next)
-   (let ((print-length 10) (print-level 3)) (prin1-to-string next)))
-  ;; FIXME: END part of the request only matters for
-  ;; phase 0 requests.  However, the only possible
-  ;; phase 0 request must be the first request in the
-  ;; list all 

Re: [BUG] org-agenda-prepare-buffers does not save restrictions

2022-07-07 Thread Ihor Radchenko
Al Haji-Ali  writes:

> I am not sure if this has been reported before, of if the behaviour is 
> intended. But to reproduce this "bug":
> - Open an org file from the agenda.
> - Restrict to some headline
> - Execute the following command:
>
> (with-temp-buffer
>   (org-agenda-prepare-buffers (org-agenda-files t)))
>
> - The restriction is removed.
>
> Note that executing `(org-agenda-prepare-buffers (org-agenda-files t))` in 
> the buffer (without `with-temp-buffer`) restores the restriction upon 
> completion.
>
> The reason is that `save-restriction` (and `save-excursion`) are called in 
> `org-agenda-prepare-buffers`
> before switching to the buffer of the org file so the restriction is not 
> saved (the point is manually restored but not the restriction).
>
> This has implications on running `org-map-entries` where all org buffers in 
> the agenda (beside the current one) lose their restrictions.

I agree that the current behavior might be unexpected.
I also do not see any potential side effects of applying the proposed
patch.

> Attached is a possible patch to fix this.

Thanks for the patch! The patch looks good.

Could you please create a proper patch following
https://orgmode.org/worg/org-contribute.html#first-patch instructions?

You will need to add the proper commit message and add TINYCHANGE line
to the message. All the details are described in the link.

Best,
Ihor



Re: Links to javascript-based websites from orgmode.org: Paypal and Github

2022-07-07 Thread Richard Stallman
[[[ To any NSA and FBI agents reading my email: please consider]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > "Note: To be PCI compliant, you must load Stripe.js directly from
  > https://js.stripe.com. You cannot include it in a bundle or host
  > it yourself. This package wraps the global Stripe function
  > provided by the Stripe.js script as an ES module."

That is hard for me to understand, since I don't know what "PCI
compliant" means (or who is expected to comply with "PCI" or why).
Also, what is a "ES module" and what are the implications of that?

I wonder if users could run the free version of that JS code
while talking with Stripe.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





Re: [BUG] bug report [9.6 (9.6-??-e7ea951 @ /Users/anthonyle/.emacs.d/.local/straight/build-28.0.91/org/)]

2022-07-07 Thread Ihor Radchenko
legac...@icloud.com writes:

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

Could you please provide some more details on what happened?

> Package: Org mode version 9.6 (9.6-??-e7ea951 @ 
> /Users/anthonyle/.emacs.d/.local/straight/build-28.0.91/org/)

Now, from your Org version, I can only suggest to update Org. We have
fixed one annoying issue since the commit you are currently on.

Best,
Ihor



Ignore, skip, omit headline when exporting to LaTeX

2022-07-07 Thread edgar

Firstly, do tell me if I am breaking the nettiquete.

I found someone asking online how to ignore a headline when exporting  
to LaTeX. This e-mail is to avoid creating an account on that forum  
and to provide a solution.


(require 'ox-extra)

  (defun org-export-ignore-headlines-latex (data backend info)
"Hack of `org-export-ignore-headlines' for LaTeX: add a  
conditional for the latex backend and replace 'ignore' with 'ignoreltx'"

(when (org-export-derived-backend-p backend 'latex)
  (org-element-map data 'headline
(lambda (object)
  (when (member "ignoreltx" (org-element-property :tags object))
(let ((level-top (org-element-property :level object))
  level-diff)
  (mapc (lambda (el)
  ;; recursively promote all nested headlines
  (org-element-map el 'headline
(lambda (el)
  (when (equal 'headline (org-element-type el))
(unless level-diff
  (setq level-diff (-  
(org-element-property :level el)

  level-top)))
(org-element-put-property
 el
 :level (- (org-element-property :level el)
 
level-diff)

  ;; insert back into parse tree
  (org-element-insert-before el object))
(org-element-contents object)))
(org-element-extract-element object)))
info nil)
  data))

  (push '(ignore-latex-headlines
  org-export-ignore-headlines-latex
  org-export-filter-parse-tree-functions)
ox-extras)
  (ox-extras-activate '(latex-header-blocks ignore-headlines  
ignore-latex-headlines))



-
This free account was provided by VFEmail.net - report spam to ab...@vfemail.net

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the 
NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  



[PATCH v4] ol.el: add description format parameter to org-link-parameters

2022-07-07 Thread Hugo Heagren
Since the last version of this patch, I have:
- moved the code which sets `type' in `org-insert-link' to a position
  where it covers more cases
- rewritten the macros used in the tests, so that always (and
  correctly) restore the original state after running, even after
  errors. Thanks to Max Nikulin for suggesting using `condition-case'

There is only one thing left which I am not happy with. Currently, the
test fails in the case where :default-description is 'ignore. This was
intended to test for situations where the parameter is set to a
function, but the function doesn't return a string (I used ignore
because it returns 'nil). Accordingly, the test is a `should-error'
(because the function *should* return a string, so we should error if
it doesn't, right?).

But the error condition is inside the error clause of a condition
case---which is only triggered if the code errors. Calling 'ignore
with any arguments and getting 'nil back doesn't cause any errors, so
the error clause is never triggered, and 'nil is just used as the
default description (which is then ignored, because it is 'nil --
other non-string values like numbers would not be ignored).

I'd like some input on what to do about this: I could rewrite the
tests so that a nil-value doesn't matter. In the case of this test, a
non-interactive call would just insert a link without a description.
Alternatively I could rewrite the function so that if the
:default-description parameter returns something, we error unless it
is a string.

tl;dr The question is: what is the Good Behaviour when
:default-description is set to something, which is meant to return a
string and returns 'nil instead? Should it be treated like an empty
string, or as an error?

Thanks,

Hugo
>From ae17e87436def764f99b24add4debb5d7a481e1a Mon Sep 17 00:00:00 2001
From: Hugo Heagren 
Date: Tue, 21 Jun 2022 12:45:50 +0100
Subject: [PATCH 2/2] test-ol: tests for default-description param when
 inserting links

Add tests for various values of `:default-description' in
`org-link-parameters'.
---
 testing/lisp/test-ol.el | 92 +
 1 file changed, 92 insertions(+)

diff --git a/testing/lisp/test-ol.el b/testing/lisp/test-ol.el
index 429bb52ee..9114c6497 100644
--- a/testing/lisp/test-ol.el
+++ b/testing/lisp/test-ol.el
@@ -625,5 +625,97 @@ See https://github.com/yantar92/org/issues/4.";
 (test-ol-parse-link-in-text
 "The http://foo.com/(something)?after=parens link"
 
+;;; Insert Links
+
+(defmacro test-ol-with-link-parameters-as (type parameters &rest body)
+  "Pass TYPE/PARAMETERS to `org-link-parameters' and execute BODY.
+
+Save the original value of `org-link-parameters', execute
+`org-link-set-parameters' with the relevant args, execute BODY
+and restore `org-link-parameters'.
+
+TYPE is as in `org-link-set-parameters'.  PARAMETERS is a plist to
+be passed to `org-link-set-parameters'."
+  ;; Copy all keys in `parameters' and their original values to
+  ;; `orig-parameters'. For `parity': nil = odd, non-nill = even
+  `(let (parity orig-parameters)
+ (dolist (p ',parameters)
+   (unless parity
+ (setq orig-parameters
+   (plist-put orig-parameters p (org-link-get-parameter ,type p
+   (setq parity (not parity)))
+ ;; Set `parameters' values
+ (condition-case err
+ (let ((_ (org-link-set-parameters ,type ,@parameters))
+   ;; Do body
+   (rtn (progn ,@body)))
+   ;; Restore original values
+   (apply 'org-link-set-parameters ,type orig-parameters)
+   ;; Return whatever the body returned
+   rtn)
+   ;; In case of error, restore state anyway AND really error
+   (error
+(apply 'org-link-set-parameters ,type orig-parameters)
+(signal (car err) (cdr err))
+
+(defun test-ol-insert-link-get-desc (&optional link-location description)
+  "Insert link in temp buffer, return description.
+
+LINK-LOCATION and DESCRIPTION are passed to
+`org-insert-link' (COMPLETE-FILE is always nil)."
+  (org-test-with-temp-text ""
+(org-insert-link nil link-location description)
+(save-match-data
+  (when (and
+ (org-in-regexp org-link-bracket-re 1)
+ (match-end 2))
+(match-string-no-properties 2)
+
+(defun test-ol/return-foobar (_link-test _desc)
+  "Return string \"foobar\".
+
+Take (and ignore) arguments conforming to `:default-description'
+API in `org-link-parameters'.  Used in test
+`test-ol/insert-link-default-description', for the case where
+`:default-description' is a function symbol."
+  "foobar")
+
+(ert-deftest test-ol/insert-link-default-description ()
+  "Test `:default-description' parameter handling."
+  ;; String case
+  (should
+   (string=
+"foobar"
+(test-ol-with-link-parameters-as
+ "id" (:default-description "foobar")
+ (test-ol-insert-link-get-desc "id:foo-bar"
+  ;; Lambda case
+  (should
+   (string=
+"foobar"
+(test-ol

Re: wrong type argument with latest org and [not] latest emacs

2022-07-07 Thread Colin Baxter


Excellent!

Best wishes,



Problem with defining stuck projects

2022-07-07 Thread Bob Heffernan
Dear all,

I am having trouble setting org-stuck-projects in a way that works for me.

My org-files are organised something like this...
* Non-project header
  - blah, blah
  ** Foo
* TODO Project 1
  ** TODO Do this
 CLOSED: [2022-07-06 Wed 17:10] SCHEDULED: <2022-07-06 Wed>
  ** TODO Do these
  *** TODO First thing
  CLOSED: [2022-07-06 Wed 17:20] SCHEDULED: <2022-07-06 Wed>
  *** TODO Second thing
* TODO Project 2
  ** TODO Something
 SCHEDULED: <2022-07-07 Thu>

I want the following:
  1. A project is a level 1 header marked as TODO
  2. A project is not stuck if it has any sub-header that is scheduled but not 
closed.

So, in the example above Project 1 counts as stuck, but Project 2 does not.

What I've got so far is this:
(setq org-stuck-projects
  '("+LEVEL=1/TODO-DONE" nil nil "SCHEDULED:")

But this will clearly mark both projects 1 and 2 as stuck.
I need some way of specifying the "but not closed" part, but am at a loss as to 
how I can do this.

Any help is appreciated.
Regards,
Bob Heffernan



Warning (org-element-cache): org-element--cache: Warning( *helm-org-rifle-fontify*): Unregistered buffer modifications detected. Resetting.

2022-07-07 Thread Gregor Zattler
Dear org-mode developers, Ihor, I got these warnings
immediately after I purged ~/.cache/org-persist, started
emacs/org-mode and tried to find some node via org-rifle.

Actually I did the purge and restart, because I got very
similar warnings before.

I don't know if this is useful, please tell me if there is
anything I can do to help investigate.


-- Ciao; Gregor
--
-... --- .-. . -.. ..--.. ...-.-

Warning (org-element-cache): org-element--cache: Warning( 
*helm-org-rifle-fontify*): Unregistered buffer modifications detected. 
Resetting.
If this warning appears regularly, please report the warning text to Org mode 
mailing list (M-x org-submit-bug-report).
The buffer is:  *helm-org-rifle-fontify*
 Current command: nil
 Backtrace:
"  backtrace-to-string(nil)
  org-element--cache-sync(#)
  apply(org-element--cache-sync #)
  timer-event-handler([t 0 0 522546 nil org-element--cache-sync (#) idle 725999 nil])
  helm-read-from-minibuffer(nil nil nil nil nil nil nil)
  helm-internalname . \"diary.org\") (buffer . #) 
(candidates . #) 
(keymap keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... 
... ... ... ... ... ... ... ... ...) (action . helm-org-rifle-actions) 
(multiline . t) (requires-pattern . 0) (filtered-candidate-transformer 
helm-fuzzy-highlight-matches) (volatile . t) (match helm-mm-exact-match 
helm-mm-match identity) (redisplay . identity) (header-line . ...) (multimatch 
. t) (after-init-hook helm-org-rifle-set-input-idle-delay) (group . helm)) 
((name . \"izt.org\") (buffer . #) (candidates . #) (keymap keymap ... ... 
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... 
... ... ...) (action . helm-org-rifle-actions) (multiline . t) 
(requires-pattern . 0) (filtered-candidate-transformer 
helm-fuzzy-highlight-matches) (volatile . t) (match helm-mm-exact-match 
helm-mm-match identity) (redisplay . identity) (header-line . ...) (multimatch 
. t) (after-init-hook helm-org-rifle-set-input-idle-delay) (group . helm)) 
((name . \"notmuch-startpage.org\") (buffer . #) 
(candidates . #) 
(keymap keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... 
... ... ... ... ... ... ... ... ...) (action . helm-org-rifle-actions) 
(multiline . t) (requires-pattern . 0) (filtered-candidate-transformer 
helm-fuzzy-highlight-matches) (volatile . t) (match helm-mm-exact-match 
helm-mm-match identity) (redisplay . identity) (header-line . ...) (multimatch 
. t) (after-init-hook helm-org-rifle-set-input-idle-delay) (group . helm)) 
((name . \"grfz.org\") (buffer . #) (candidates . #) (keymap keymap ... ... 
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... 
... ... ...) (action . helm-org-rifle-actions) (multiline . t) 
(requires-pattern . 0) (filtered-candidate-transformer 
helm-fuzzy-highlight-matches) (volatile . t) (match helm-mm-exact-match 
helm-mm-match identity) (redisplay . identity) (header-line . ...) (multimatch 
. t) (after-init-hook helm-org-rifle-set-input-idle-delay) (group . helm)) 
((name . \"configuration.org\") (buffer . #) 
(candidates . #) 
(keymap keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... 
... ... ... ... ... ... ... ... ...) (action . helm-org-rifle-actions) 
(multiline . t) (requires-pattern . 0) (filtered-candidate-transformer 
helm-fuzzy-highlight-matches) (volatile . t) (match helm-mm-exact-match 
helm-mm-match identity) (redisplay . identity) (header-line . ...) (multimatch 
. t) (after-init-hook helm-org-rifle-set-input-idle-delay) (group . helm))) nil 
nil nil nil nil nil nil nil)
  helmname . \"diary.org\") (buffer . #) (candidates . 
#) (keymap keymap 
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... 
... ... ... ... ...) (action . helm-org-rifle-actions) (multiline . t) 
(requires-pattern . 0) (filtered-candidate-transformer 
helm-fuzzy-highlight-matches) (volatile . t) (match helm-mm-exact-match 
helm-mm-match identity) (redisplay . identity) (header-line . ...) (multimatch 
. t) (after-init-hook helm-org-rifle-set-input-idle-delay) (group . helm)) 
((name . \"izt.org\") (buffer . #) (candidates . #) (keymap keymap ... ... 
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... 
... ... ...) (action . helm-org-rifle-actions) (multiline . t) 
(requires-pattern . 0) (filtered-candidate-transformer 
helm-fuzzy-highlight-matches) (volatile . t) (match helm-mm-exact-match 
helm-mm-match identity) (redisplay . identity) (header-line . ...) (multimatch 
. t) (after-init-hook helm-org-rifle-set-input-idle-delay) (group . helm)) 
((name . \"notmuch-startpage.org\") (buffer . #) 
(candidates . #) 
(keymap keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... 
... ... ... ... ... ... ... ... ...) (action . helm-org-rifle-actions) 
(multiline . t) (requires-pattern . 0) (filtered-candidate-transformer 
helm-fuzzy-highlight-matches) (volatile . t) (match helm-mm-exact-match 
helm-mm-match identity

Re: Proposal: 'executable' org-capture-templates

2022-07-07 Thread Max Nikulin

On 03/07/2022 22:12, Arthur Miller wrote:

Max Nikulin writes:


My impression is that Emacs process per task scenario is not supported.


I am not sure if we think of same thing, but "process per task" means simply how
people use Emacs. Some people open each file in a new Emacs process, some people
like to keep different tasks in different instances of Emacs, for example Gnus
in one Emacs, and editing work in another etc. It is not that Emacs has some
feature that would make one prohibit to start Gnus in other session, or to load
same set of files in different Emacs processes, but I don't think it is
necessary either.


I am aware of a workaround with a separate process for gnus since it is 
implemented as a synchronous single thread application, so network 
latency becomes a disaster. Emacs process per file is inconvenient when 
emacs server is desired (e.g. for org-protocol). True init directory is 
required for easy customization. There are may be subtle differences 
whether a file loaded as a part of initialization of as -l argument and, 
of course, bugs.


After all, it would be much more convenient to tune init.el file if it 
were possible to specify just config directory. It is disappointing that 
emacs offers rather strange options instead: --user and XDG_CONFIG_HOME. 
Even mount namespace might be more convenient than the latter one to 
override just .emacs.d without touching of over desktop settings.


So menu with multitasking support sounds promising to avoid multiple 
processes, but requires some care at the call sites.





Re: Links to javascript-based websites from orgmode.org: Paypal and Github

2022-07-07 Thread Thomas S. Dye

Ihor Radchenko  writes:


"Thomas S. Dye"  writes:

Nevertheless, it is good to know that I'm free to give up 
freedoms 
to contribute to Org mode development.  @Ihor, will Paypal work 
for you?


Yep. Currently, Paypal is the only option (apart from direct 
bank

transfers) that works for me.

See https://liberapay.com/org-mode or 
https://liberapay.com/yantar92/ or

just use my email as Paypal id.


Done.  Thanks for your good work!

All the best,
Tom

--
Thomas S. Dye
https://tsdye.online/tsdye



Re: org-meta-return / org-insert-heading does not insert new heading in middle of heading even id org-M-RET-may-split-line is set

2022-07-07 Thread Guillaume MULLER
Hi again,

Thanks for your answer and sorry for the duplicate.

I would be glad to help find if/where is the bug.

> Note that '(default . t) is _not_ the correct value. It should be
 '((default . t)). Just in case.

Yes indeed. I had it right in my config. I made the mistake when I copied into 
the email.

> I tried to set org-M-RET-may-split-line to nil first followed by setting
> it to either t or '((default . t)). For both values, I am seeing
> 
> * heading number
> * <>one
> 
> which is expected behavior.

Are you using DoomEmacs or Vanilla Emacs?

More precisely, are you using org-mode "9.6-??-e9da29b6f" as I do? (This is the 
only version that gives me the strange behavior)

> Please, try to reproduce starting from emacs -Q (without Doom).
> See https://orgmode.org/manual/Feedback.html

I've tried several things, but it's not very clear to me how to get/test the 
specific version of org-mode that is comes with doom ("9.6-??-e9da29b6f").

What I tried:

- Getting an as-vanilla-as-possible DoomInstall, by removing my config.org and 
sync'ing Doom. I get the same "9.6-??-e9da29b6f" org version and erroneous 
behavior.

- Changing the version of org-mode used in Doom, by removing the directory and 
installing the one from MELPA (9.5.4). This gives me the correct behavior for 
org-meta-return, but it breaks too many other things in org to be usable.

- Using "vanilla" "emacs -Q" and running only org "9.6".

  1. I've tried to manually load the org-version that comes with Doom, by 
writing & executing "(add-to-list 'load-path 
"/home/user/.emacs.d/modules/lang/org/lisp/autoload") (load "org")" from 
scratch buffer, then running org-reload
   + but I get org-version 9.3
   + and I can't find a way to edit the "load-path" "variable" to remove the 
native path ("/usr/share/emacs/27.1/lisp/org") from the list (sorry newbie 
here...)

  2. I've tried to git clone the org-mode repo in /tmp, but don't see any 
tag/branch that would correspond to a "9.6" version of org.
  + I do see a commit matching e9da29b6f 
(e9da29b6fafe63abbc2774e9d485ac13d2811b65)
* I've tried to recover the code from this version "git checkout e9da29b6f 
."
* Compiled it (make)
* Opened emacs -Q
* Wrote and executed "(add-to-list 'load-path "/tmp/org-mode/lisp/") (load 
"org")" in the scratch buffer
* Ran M-x org-reload
+ But "M-x org-version" still returns "Org mode version 9.5.4", and it 
works as expected

If you have any more hints on how I could setup an environment where I could 
test just org-mode "9.6-??-e9da29b6f" on a raw/vanilla emacs, I vwould be glad 
to test that.


Thanks in advance

-- 
Guillaume MULLER



OpenPGP_signature
Description: OpenPGP digital signature


Re: Org mode export accessibility

2022-07-07 Thread T.V Raman
briangpowell  writes:


P.S. Please dont quote me out of context. I did not say pdftex and
pdflatex were not useful, I still rely on them heavily.
> "[I suspect that the exported documents can similarly be improved to
> reduce the amount of effort required from visually impaired users to
> read
> such documents. The question is what improvements can be made on
> Org side.]
>
> Best,
> Ihor"
>
> Very glad to hear from TV Raman, the creator of EmacSpeak,
>
> I'm not blind like TV but I was motivated to turn my a main OrgMode
> buffer into an audio desktop like TV's
>
> But now back to the topic; much agree with Ihor, we should focus on
> "what improvements can be made on OrgMode side"
>
> & TV's points are well made too: "pdftex and pdflatex were built in
> the late 90's"--very true & they were rarely useful
>
> Suggest OrgMode make changes aimed at the "Lowest Common Denominator"
> of accessibility--accessibility in the visual sense AND in the machine
> or program processable sense or more exactly the "document convertible
> sense"--I mean documents should be made firstly in a form that all
> computers can easily navigate & present on computer screens and/or
> audio desktops in addition to being readily able to print out
>
> TV's right, the usual pipeline of LaTeX->PDF can produce tagged &
> useful documents but can an end user easily copy and paste the
> document? How useful are pretty documents that run on proprietary
> systems? Many PDF's can make simple processes like this very hard or
> impossible--the documents can be very pretty but they can contain
> control characters & special characters & even malicious code
>
> Suggest OrgMode outputs focus on creating "Lowest Common Denominator"
> documents as output:
> TeXinfo docs should be used as the LCD doctype--suggest you focus on
> creating 1 document in Texinfo that you use to create all other sorts
> of documents, when possible:
>
> Pipeline should be more like
> OrgMode->Texinfo->TROFF||DTD/XML/HTML/XHTML->LaTeX/TeX->DVI||SVG->PS->PDF
>
>
> * TeXinfo: https://savannah.gnu.org/projects/texinfo
> https://www.gnu.org/software/texinfo
>
> ** "Texinfo uses a single source file to produce output in a number of
> formats, both online and printed (dvi, html, info, pdf, xml, etc.).
> This means that instead of writing different documents for online
> information and another for a printed manual, you need write only one
> document.  And when the work is revised, you need revise only that one
> document.  The Texinfo system is integrated well with GNU Emacs. 
>
> *** Texinfo docs can also be viewed & used by ALL end-users without
> any issues--regardless of the power of their computer or monitor or
> even if they're blind like TV Raman--he uses an audio desktop or
> EmacSpeak--and the same docs can be printed on any printer & remain
> navigable with "rn" & other simple news-reading software--or the
> "info" program
>
> * Output formats currently supported by Texinfo:
> https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Output-Formats.html
> <=> Info,Text,HTML,DVI,PostScript{PS},PDF,DocBook,XML
>
> ** Related/useful may be: "latex2nemeth"--a LATEX to Braille/Nemeth,
> approach "Simple pictures in PSTricks are also supported in order to
> produce tactile graphics": https://ctan.org/pkg/latex2nemeth
>
> On Thu, Jun 30, 2022 at 3:53 AM Ihor Radchenko 
> wrote:
>
> "T.V Raman"  writes:
>
> > 1. Accessibility as word used in isolation has now become mostly
> >meaningless, to be concrete one has to ask "Accessibility to
> whom"? 
> >
> > 2. So in the following, everything I say is with respect to
> users with
> >visual impairments.
>
> This is exactly the perspective I was hoping to hear from you.
> Though
> this thread is not dedicated to visual impairments. (I guess you
> also
> did not touch the question of color blindness).
>
> > 3. It's incorrect to define "Accessibility" in terms of a
> specific
> >user access tool or technology -- that usage is marketing
> jargon
> >for a specific Access Solution like a screenreader --- so I
> refrain in general from
> >defining this in terms of Screenreaders.
>
> Yet, in order to simplify the efforts needed to read a document
> exported
> from Org mode one needs to use some kind of tool/technology.
> Unless a
> common standard exist in this area, we have to support at least
> the most
> common Access Solutions (prioritizing Free software, if possible).
>
> From you message, it does not look like there is any common
> standard.
>
> > With those meta-thoughts out of the way:
> >
> > A: Org-generated documents are mostly well-structured documents,
> and ...
> > B: The LaTeX->PDF pipeline *can* produce tagged PDF with respect
> to ...
> > C: pdftex and pdflatex were built in the late 90's by a student
> in ...
> > D: All that said, it is likely still 

[BUG] bug report [9.6 (9.6-??-e7ea951 @ /Users/anthonyle/.emacs.d/.local/straight/build-28.0.91/org/)]

2022-07-07 Thread legacyle



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.




Emacs  : GNU Emacs 28.0.91 (build 1, aarch64-apple-darwin21.3.0, NS 
appkit-2113.30 Version 12.2.1 (Build 21D62))
of 2022-02-26
Package: Org mode version 9.6 (9.6-??-e7ea951 @ 
/Users/anthonyle/.emacs.d/.local/straight/build-28.0.91/org/)

current state:
==
(setq
org-link-elisp-confirm-function nil
org-directory "~/SynologyDrive/mylife/"
org-after-refile-insert-hook '(save-buffer)
org-indirect-buffer-display 'current-window
org-roam-db-gc-threshold 2305843009213693951
org-crypt-key nil
org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
org-load-hook '(+org-init-org-directory-h +org-init-appearance-h 
+org-init-agenda-h
 +org-init-attachments-h +org-init-babel-h 
+org-init-babel-lazy-loader-h
 +org-init-capture-defaults-h +org-init-capture-frame-h 
+org-init-custom-links-h
 +org-init-export-h +org-init-habit-h +org-init-hacks-h 
+org-init-keybinds-h
 +org-init-popup-rules-h +org-init-protocol-h 
+org-init-protocol-lazy-loader-h
 +org-init-smartparens-h)
org-startup-folded nil
org-babel-after-execute-hook '(+org-redisplay-inline-images-in-babel-result-h)
org-link-abbrev-alist '(("doom-repo" . 
"https://github.com/hlissner/doom-emacs/%s";)
 ("wolfram" . "https://wolframalpha.com/input/?i=%s";)
 ("wikipedia" . "https://en.wikipedia.org/wiki/%s";)
 ("duckduckgo" . "https://duckduckgo.com/?q=%s";)
 ("gmap" . "https://maps.google.com/maps?q=%s";)
 ("gimages" . "https://google.com/images?q=%s";)
 ("google" . "https://google.com/search?q=";)
 ("youtube" . "https://youtube.com/watch?v=%s";)
 ("github" . "https://github.com/%s";))
org-agenda-files '("~/SynologyDrive/mylife/1.habits.org"
"/Users/anthonyle/SynologyDrive/mylife/1.gtd.org"
"/Users/anthonyle/SynologyDrive/mylife/1.tickler.org"
"/Users/anthonyle/SynologyDrive/mylife/0.Android.org"
"/Users/anthonyle/SynologyDrive/mylife/1.inbox.org"
"/Users/anthonyle/SynologyDrive/mylife/1.notes.org"
"/Users/anthonyle/SynologyDrive/mylife/1.shopping.org"
"/Users/anthonyle/SynologyDrive/mylife/1.someday.org"
"/Users/anthonyle/SynologyDrive/mylife/notes.org"
"/Users/anthonyle/SynologyDrive/mylife/notes.temp.org")
org-capture-templates '(("t" "Personal todo" entry (file+headline 
+org-capture-todo-file "Inbox")
  "* [ ] %?\n%i\n%a" :prepend t)
 ("n" "Personal notes" entry (file+headline 
+org-capture-notes-file "Inbox")
  "* %u %?\n%i\n%a" :prepend t)
 ("j" "Journal" entry (file+olp+datetree 
+org-capture-journal-file)
  "* %U %?\n%i\n%a" :prepend t)
 ("p" "Templates for projects")
 ("pt" "Project-local todo" entry
  (file+headline +org-capture-project-todo-file 
"Inbox") "* TODO %?\n%i\n%a"
  :prepend t)
 ("pn" "Project-local notes" entry
  (file+headline +org-capture-project-notes-file 
"Inbox") "* %U %?\n%i\n%a"
  :prepend t)
 ("pc" "Project-local changelog" entry
  (file+headline +org-capture-project-changelog-file 
"Unreleased")
  "* %U %?\n%i\n%a" :prepend t)
 ("o" "Centralized templates for projects")
 ("ot" "Project todo" entry 
#'+org-capture-central-project-todo-file
  "* TODO %?\n %i\n %a" :heading "Tasks" :prepend nil)
 ("on" "Project notes" entry 
#'+org-capture-central-project-notes-file
  "* %U %?\n %i\n %a" :heading "Notes" :prepend t)
 ("oc" "Project changelog" entry 
#'+org-capture-central-project-changelog-file
  "* %U %?\n %i\n %a" :heading "Changelog" :prepend t)
 )
org-persist-after-read-hook '(org-element--cache-persist-after-read)
org-refile-targets '((nil :maxlevel . 3) (org-agenda-files :maxlevel . 3))
org-export-before-parsing-hook '(org-attach-expand-links)
org-default-notes-file "/Users/anthonyle/SynologyDrive/mylife/notes.org"
org-roam-find-file-hook '(org-roam-buffer--setup-redisplay-

Re: Org mode export accessibility

2022-07-07 Thread T.V Raman
P.S. Emacspeak is not camel-cased -- please say Emacspeak -- and not
with the 's' capitalized.
-- 

Thanks,

--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1  🦮

--

Thanks,

--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1  🦮



Re: Org mode export accessibility

2022-07-07 Thread T.V Raman


On org side:

1. During authoring, ensure that authors have the ability to label
   images, drawings and math content.
   2. When exporting, make sure that that information gets through to
  the exported format.
  3. For math especially, make sure the TeX/LaTeX is preserved one
 way  or the other in the export

That's just a few initial thoughts, am sure there could be morebriangpowell 
writes:
 > "[I suspect that the exported documents can similarly be improved to
 > reduce the amount of effort required from visually impaired users to read
 > such documents. The question is what improvements can be made on
 > Org side.]
 > 
 > Best,
 > Ihor"
 > 
 > Very glad to hear from TV Raman, the creator of EmacSpeak,
 > 
 > I'm not blind like TV but I was motivated to turn my a main OrgMode buffer
 > into an audio desktop like TV's
 > 
 > But now back to the topic; much agree with Ihor, we should focus on "what
 > improvements can be made on OrgMode side"
 > 
 > & TV's points are well made too: "pdftex and pdflatex were built in the
 > late 90's"--very true & they were rarely useful
 > 
 > Suggest OrgMode make changes aimed at the "Lowest Common Denominator" of
 > accessibility--accessibility in the visual sense AND in the machine or
 > program processable sense or more exactly the "document convertible
 > sense"--I mean documents should be made firstly in a form that all
 > computers can easily navigate & present on computer screens and/or audio
 > desktops in addition to being readily able to print out
 > 
 > TV's right, the usual pipeline of LaTeX->PDF can produce tagged & useful
 > documents but can an end user easily copy and paste the document? How
 > useful are pretty documents that run on proprietary systems? Many PDF's can
 > make simple processes like this very hard or impossible--the documents can
 > be very pretty but they can contain control characters & special characters
 > & even malicious code
 > 
 > Suggest OrgMode outputs focus on creating "Lowest Common Denominator"
 > documents as output:
 > TeXinfo docs should be used as the LCD doctype--suggest you focus on
 > creating 1 document in Texinfo that you use to create all other sorts of
 > documents, when possible:
 > 
 > Pipeline should be more like
 > OrgMode->Texinfo->TROFF||DTD/XML/HTML/XHTML->LaTeX/TeX->DVI||SVG->PS->PDF
 > 
 > * TeXinfo: https://savannah.gnu.org/projects/texinfo
 > https://www.gnu.org/software/texinfo
 > 
 > ** "Texinfo uses a single source file to produce output in a number of
 > formats, both online and printed (dvi, html, info, pdf, xml, etc.). This
 > means that instead of writing different documents for online information
 > and another for a printed manual, you need write only one document.  And
 > when the work is revised, you need revise only that one document.  The
 > Texinfo system is integrated well with GNU Emacs.
 > 
 > *** Texinfo docs can also be viewed & used by ALL end-users without any
 > issues--regardless of the power of their computer or monitor or even if
 > they're blind like TV Raman--he uses an audio desktop or EmacSpeak--and the
 > same docs can be printed on any printer & remain navigable with "rn" &
 > other simple news-reading software--or the "info" program
 > 
 > * Output formats currently supported by Texinfo:
 > https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Output-Formats.html
 > <=> Info,Text,HTML,DVI,PostScript{PS},PDF,DocBook,XML
 > 
 > ** Related/useful may be: "latex2nemeth"--a LATEX to Braille/Nemeth,
 > approach "Simple pictures in PSTricks are also supported in order to
 > produce tactile graphics": https://ctan.org/pkg/latex2nemeth
 > 
 > On Thu, Jun 30, 2022 at 3:53 AM Ihor Radchenko  wrote:
 > 
 > > "T.V Raman"  writes:
 > >
 > > > 1. Accessibility as word used in isolation has now become mostly
 > > >meaningless, to be concrete one has to ask "Accessibility to whom"?
 > > >
 > > > 2. So in the following, everything I say is with respect to users with
 > > >visual impairments.
 > >
 > > This is exactly the perspective I was hoping to hear from you. Though
 > > this thread is not dedicated to visual impairments. (I guess you also
 > > did not touch the question of color blindness).
 > >
 > > > 3. It's incorrect to define "Accessibility" in terms of a specific
 > > >user access tool or technology -- that usage is marketing jargon
 > > >for a specific Access Solution like a screenreader --- so I refrain
 > > in general from
 > > >defining this in terms of Screenreaders.
 > >
 > > Yet, in order to simplify the efforts needed to read a document exported
 > > from Org mode one needs to use some kind of tool/technology. Unless a
 > > common standard exist in this area, we have to support at least the most
 > > common Access Solutions (prioritizing Free software, if possible).
 > >
 > > From you message, it does not look like there is any common standard.
 > >
 > > > With those meta-thoughts out of the way:
 > > >
 > > > A: Org-generated

Re: Org mode export accessibility

2022-07-07 Thread briangpowell
"[I suspect that the exported documents can similarly be improved to
reduce the amount of effort required from visually impaired users to read
such documents. The question is what improvements can be made on
Org side.]

Best,
Ihor"

Very glad to hear from TV Raman, the creator of EmacSpeak,

I'm not blind like TV but I was motivated to turn my a main OrgMode buffer
into an audio desktop like TV's

But now back to the topic; much agree with Ihor, we should focus on "what
improvements can be made on OrgMode side"

& TV's points are well made too: "pdftex and pdflatex were built in the
late 90's"--very true & they were rarely useful

Suggest OrgMode make changes aimed at the "Lowest Common Denominator" of
accessibility--accessibility in the visual sense AND in the machine or
program processable sense or more exactly the "document convertible
sense"--I mean documents should be made firstly in a form that all
computers can easily navigate & present on computer screens and/or audio
desktops in addition to being readily able to print out

TV's right, the usual pipeline of LaTeX->PDF can produce tagged & useful
documents but can an end user easily copy and paste the document? How
useful are pretty documents that run on proprietary systems? Many PDF's can
make simple processes like this very hard or impossible--the documents can
be very pretty but they can contain control characters & special characters
& even malicious code

Suggest OrgMode outputs focus on creating "Lowest Common Denominator"
documents as output:
TeXinfo docs should be used as the LCD doctype--suggest you focus on
creating 1 document in Texinfo that you use to create all other sorts of
documents, when possible:

Pipeline should be more like
OrgMode->Texinfo->TROFF||DTD/XML/HTML/XHTML->LaTeX/TeX->DVI||SVG->PS->PDF

* TeXinfo: https://savannah.gnu.org/projects/texinfo
https://www.gnu.org/software/texinfo

** "Texinfo uses a single source file to produce output in a number of
formats, both online and printed (dvi, html, info, pdf, xml, etc.). This
means that instead of writing different documents for online information
and another for a printed manual, you need write only one document.  And
when the work is revised, you need revise only that one document.  The
Texinfo system is integrated well with GNU Emacs.

*** Texinfo docs can also be viewed & used by ALL end-users without any
issues--regardless of the power of their computer or monitor or even if
they're blind like TV Raman--he uses an audio desktop or EmacSpeak--and the
same docs can be printed on any printer & remain navigable with "rn" &
other simple news-reading software--or the "info" program

* Output formats currently supported by Texinfo:
https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Output-Formats.html
<=> Info,Text,HTML,DVI,PostScript{PS},PDF,DocBook,XML

** Related/useful may be: "latex2nemeth"--a LATEX to Braille/Nemeth,
approach "Simple pictures in PSTricks are also supported in order to
produce tactile graphics": https://ctan.org/pkg/latex2nemeth

On Thu, Jun 30, 2022 at 3:53 AM Ihor Radchenko  wrote:

> "T.V Raman"  writes:
>
> > 1. Accessibility as word used in isolation has now become mostly
> >meaningless, to be concrete one has to ask "Accessibility to whom"?
> >
> > 2. So in the following, everything I say is with respect to users with
> >visual impairments.
>
> This is exactly the perspective I was hoping to hear from you. Though
> this thread is not dedicated to visual impairments. (I guess you also
> did not touch the question of color blindness).
>
> > 3. It's incorrect to define "Accessibility" in terms of a specific
> >user access tool or technology -- that usage is marketing jargon
> >for a specific Access Solution like a screenreader --- so I refrain
> in general from
> >defining this in terms of Screenreaders.
>
> Yet, in order to simplify the efforts needed to read a document exported
> from Org mode one needs to use some kind of tool/technology. Unless a
> common standard exist in this area, we have to support at least the most
> common Access Solutions (prioritizing Free software, if possible).
>
> From you message, it does not look like there is any common standard.
>
> > With those meta-thoughts out of the way:
> >
> > A: Org-generated documents are mostly well-structured documents, and ...
> > B: The LaTeX->PDF pipeline *can* produce tagged PDF with respect to ...
> > C: pdftex and pdflatex were built in the late 90's by a student in ...
> > D: All that said, it is likely still easier to go from org->HTML ...
>
> Do I understand correctly that you have no issues with reading documents
> exported using current version of Org?
>
> > E: Finally, note that in (D) I said "machine processable" not
> > "Accessible"; machine-processable is a pre-requisite to "repurpose "
> > what you publish, and making  that result usable by different user
> > communities is a direct consequence of suche machine-processability.
>
> I understand. Bu

Re: wrong type argument with latest org and [not] latest emacs

2022-07-07 Thread Alain . Cochard
Colin Baxter writes on Thu  7 Jul 2022 13:22:

 > > So it is not the latest emacs
 > 
 > >   GNU Emacs 27.2 (build 1, x86_64-redhat-linux-gnu, GTK+ Version
 > > 3.24.30, cairo version 1.17.4) of 2021-08-07
 > 
 > > but it seems related. I have no problem with
 > 
 > >   Org mode version 9.5.4 (9.5.4-ge0b05b @
 > > /home/cochard/.emacs.d/elpa/org-9.5.4/)
 > 
 > > but if I use what I believe to be the latest org from git (pulled
 > > a few minutes ago):
 > 
 > >   Org mode version 9.5.4 (release_9.5.4-609-g713598 @
 > > /home/cochard/Org/Coch-git/org-mode/lisp/)
 > 
 > > upon 'C-x C-c', I get
 > 
 > >   org-babel-remove-temporary-stable-directory: Wrong type
 > > argument: stringp, nil
 > 
 > > and emacs does not even close.  I cannot kill it either with 'C-c'
 > > on the terminal from which I started emacs.  I have to 'kill -9
 > > '
 > 
 > 
 > It should work with org-mode release_9.5.4-610-gbdf7af.

Yes it does (just tested with 613-gb3b17c ).  Thank you.

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




Re: Org and Hyperbole

2022-07-07 Thread Ihor Radchenko
Max Brieiev  writes:

> Embark defines the following targets: file, symbol, URL, s-expression,
> defun, etc. It seems it is conceptually the same as implicit buttons in
> Hyperbole. Is this correct?

AFAIK, the strength of Hyperbole is that you can easily define custom
targets.

Best,
Ihor



Re: wrong type argument with latest org and [not] latest emacs

2022-07-07 Thread Colin Baxter
> Alain Cochard  writes:

> Colin Baxter writes on Tue 5 Jul 2022 20:24:
>> > Colin Baxter  writes:
>> 
>> > Ihor Radchenko  writes: >> Colin Baxter
>>  writes: >>> I'm sending this to emacs.orgmode
>> and emacs.devel lists.
>> >>> 
>> >>> With the latest emacs:
>> >>> 
>> >>> 
>> >>> Debugger entered--Lisp error: (wrong-type-argument stringp
>> >>> (wrong-type-argument stringp nil)) >>>
>> format-message((wrong-type-argument stringp nil)) >>>
>> apply(format-message (wrong-type-argument stringp nil)) >>>
>> error((wrong-type-argument stringp nil)) #f(compiled-function >>>
>> (fun) # )(org-babel-remove-temporary-stable-directory)
>> >>> run-hook-wrapped(#f(compiled-function (fun) # ) org-babel-remove-temporary-stable-directory)
>> 
>> >> Thanks for reporting!  This likely caused by recent commit of
>> >> mine on systems with no write access to remote directory (at
>> >> least, I am unable to reproduce the steps on my system).
>> 
>> >> Can you please try the attached patch?
>> 
>> >> Best, Ihor
>> 
>> >> From ddf6278e8fcbaa4939539277b111061b7c00f550 Mon Sep 17
>> 00:00:00 >> 2001 Message-Id: >>
>> 

>> >> From: Ihor Radchenko  Date: Tue, 5 Jul
>> 2022 >> 21:00:24 +0800 Subject: [PATCH] ob-core: Fix nil value of
>> >> `org-babel-temporary-stable-directory'
>> 
>> >> * lisp/ob-core.el: Fallback the value of >>
>> `org-babel-temporary-stable-directory' to >>
>> `org-babel-temporary-directory' if there are issues with >>
>> directory creation.
>> 
>> >> Fixes https://yhetil.org/emacs-devel/87sfnfhm6v@yandex.com
>> >> --- lisp/ob-core.el | 3 ++- 1 file changed, 2 insertions(+), 1
>> >> deletion(-)
>> 
>> >> diff --git a/lisp/ob-core.el b/lisp/ob-core.el index >>
>> 6c379c121..aaf895d74 100644 --- a/lisp/ob-core.el +++ >>
>> b/lisp/ob-core.el @@ -3167,7 +3167,8 @@ (defvar >>
>> org-babel-temporary-stable-directory (expand-file-name >>
>> "babel-stable" (temporary-file-directory))) - (t nil))) + ;; >>
>> Fallback if things do not work.  + (t >>
>> org-babel-temporary-directory))) "Directory to hold temporary >>
>> files created to execute code blocks.  Used by >>
>> `org-babel-temp-file'.  This directory will be removed on Emacs
>> >> shutdown."))  -- 2.35.1
>> 
>> > Ok, that patch seems to solve the issue. I have applied the
>> patch > and I now get now error message when I close down
>> emacs-29.0.50.
>> 
>> Typo! That's no error, not now error.

> So it is not the latest emacs

>   GNU Emacs 27.2 (build 1, x86_64-redhat-linux-gnu, GTK+ Version
> 3.24.30, cairo version 1.17.4) of 2021-08-07

> but it seems related. I have no problem with

>   Org mode version 9.5.4 (9.5.4-ge0b05b @
> /home/cochard/.emacs.d/elpa/org-9.5.4/)

> but if I use what I believe to be the latest org from git (pulled
> a few minutes ago):

>   Org mode version 9.5.4 (release_9.5.4-609-g713598 @
> /home/cochard/Org/Coch-git/org-mode/lisp/)

> upon 'C-x C-c', I get

>   org-babel-remove-temporary-stable-directory: Wrong type
> argument: stringp, nil

> and emacs does not even close.  I cannot kill it either with 'C-c'
> on the terminal from which I started emacs.  I have to 'kill -9
> '


It should work with org-mode release_9.5.4-610-gbdf7af.

Best wishes,

Colin Baxter.



Re: Org and Hyperbole

2022-07-07 Thread Max Brieiev
Hi Robert,

Robert Weiner  writes:

> Oantolin no doubt can speak to Embark much better but my present
> understanding is that it is a toolkit package for generating contextual
> popup or completion menus with a few standard context menus included.
>
> Hyperbole is a much broader personal information management
> environment, one part of which is to turn every common type of
> cross-reference found in buffers from programming identifiers to
> page links into immediately useable hyperlinks with no effort
> or markup on your part (implicit buttons).

I struggle to understand the core difference between Embark and
Hyperbole.

In terms of Embark, the context around point is called /target/. So if
the target is a filename, then the default action is to visit the
file. If the default action is not what you want, then Embark can
present you with a context menu - you can choose amongst the actions
that can be executed on the file, like deleting it or locating it in a
dired buffer.

In terms of Hyperbole, the contextual information is called /implicit
button/. Pressing M-RET on it sounds very much the same as executing
the default action in terms of Embark.

Embark defines the following targets: file, symbol, URL, s-expression,
defun, etc. It seems it is conceptually the same as implicit buttons in
Hyperbole. Is this correct?



Re: Efficiently reuse code in org babel with R

2022-07-07 Thread Naresh Gurbuxani
Thanks for providing a detailed solution.  

I also learned from other responses.

Sent from my iPhone

> On Jul 7, 2022, at 4:42 AM, Jeremie Juste  wrote:
> 
> Hello Naresh,
> 
> Many thanks for sharing.
> If I'm looking for efficiency, I tend not to use noweb and use an R
> session instead.
> 
> One reason is that caching does not work with noweb
> 
> #+name: test
> #+begin_src R  :cache yes :session *R*
> Sys.sleep(10)
>  a <- 1
> #+end_src
> 
> #+RESULTS[36c41617bf9aa447ecc28fca8207eab38340d418]: test
> : 1
> 
> 
> #+name: add1
> #+begin_src R :noweb yes :cache no :session *R*
> <>
> a + 1
> #+end_src
> 
> #+RESULTS: add1
> : 2
> 
> 
> I would proceed in the following way
> 
>#+name: connection
>#+begin_src R :exports results :results output :session *R* 
> ## my code here
>#+end_src
> 
>#+begin_src R :exports results :results output graphics file
>:session *R* :file figures/fig1.png
>## my code here
>#+end_src
> 
>#+begin_src R :exports results output graphics file :file figures/fig2.png 
> :session *R*
>## my code here
>#+end_src
> 
> this will require running the first code chunk once only to run the rest
> 
>> On Thursday,  7 Jul 2022 at 09:22, Greg Minshall wrote:
>> you'd have to be careful to not get bitten by the code
>> *not* being evaluated, and by it being evaluated too often.  (probably
>> too clever by half.)
> 
> The comment of Greg is very relevant here as you'll have to manage
> updates yourself, and it can get complex very quickly. A potential
> pitfall is when the tables in database you are referring to, change.
> So in this case I would avoid using :cache yes in the first code chunk
> 
> 
> I'm also tempted to adopt the following organization
> 
>* setup table
>#+name: connection
>#+begin_src R :exports results :results output :session *R* 
> ## my code here
>#+end_src
> 
>* output graphs
> :PROPERTIES:
> :header-args:R: :exports results output graphics file  :session *R*
> :END:
> 
>#+begin_src R  :file figures/fig2.png
>## my code here
>#+end_src
> 
>#+begin_src R  :file figures/fig1.png 
>## my code here
>#+end_src
> 
> then I would use (org-babel-execute-subtree) which is bound to C-c C-v
> s on the subheading output graphs to regenerate the graphs.
> 
> 
> HTH,
> Jeremie


[BUG] org-agenda-prepare-buffers does not save restrictions

2022-07-07 Thread Al Haji-Ali

I am not sure if this has been reported before, of if the behaviour is 
intended. But to reproduce this "bug":
- Open an org file from the agenda.
- Restrict to some headline
- Execute the following command:

(with-temp-buffer
  (org-agenda-prepare-buffers (org-agenda-files t)))

- The restriction is removed.

Note that executing `(org-agenda-prepare-buffers (org-agenda-files t))` in the 
buffer (without `with-temp-buffer`) restores the restriction upon completion.

The reason is that `save-restriction` (and `save-excursion`) are called in 
`org-agenda-prepare-buffers`
before switching to the buffer of the org file so the restriction is not saved 
(the point is manually restored but not the restriction).

This has implications on running `org-map-entries` where all org buffers in the 
agenda (beside the current one) lose their restrictions.

Attached is a possible patch to fix this.

Emacs  : GNU Emacs 28.1 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, 
cairo version 1.16.0)
 of 2022-04-08
Package: Org mode version 9.5.3 (9.5.3-g428076 @ 
/home/abdo/Work/Projects/dotfiles/emacs-radian/.emacs.d/.elocal/straight/build-28.1/org/)
diff --git a/lisp/org.el b/lisp/org.el
index 661efeb9c..e75b7c93c 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15031,49 +15031,48 @@ When a buffer is unmodified, it is just killed.  When modified, it is saved
   "Create buffers for all agenda files, protect archived trees and comments."
   (interactive)
   (let ((inhibit-read-only t)
-	(org-inhibit-startup org-agenda-inhibit-startup)
-	pos)
+	(org-inhibit-startup org-agenda-inhibit-startup))
 (setq org-tag-alist-for-agenda nil
 	  org-tag-groups-alist-for-agenda nil)
 (save-excursion
-  (save-restriction
-	(dolist (file files)
-	  (catch 'nextfile
-	(if (bufferp file)
-		(set-buffer file)
-	  (org-check-agenda-file file)
-	  (set-buffer (org-get-agenda-file-buffer file)))
-	(widen)
-	(org-set-regexps-and-options 'tags-only)
-	(setq pos (point))
-	(or (memq 'category org-agenda-ignore-properties)
-		(org-refresh-category-properties))
-	(or (memq 'stats org-agenda-ignore-properties)
-		(org-refresh-stats-properties))
-	(or (memq 'effort org-agenda-ignore-properties)
-(unless org-element-use-cache
-		  (org-refresh-effort-properties)))
-	(or (memq 'appt org-agenda-ignore-properties)
-		(org-refresh-properties "APPT_WARNTIME" 'org-appt-warntime))
-	(setq org-todo-keywords-for-agenda
-		  (append org-todo-keywords-for-agenda org-todo-keywords-1))
-	(setq org-done-keywords-for-agenda
-		  (append org-done-keywords-for-agenda org-done-keywords))
-	(setq org-todo-keyword-alist-for-agenda
-		  (append org-todo-keyword-alist-for-agenda org-todo-key-alist))
-	(setq org-tag-alist-for-agenda
-		  (org--tag-add-to-alist
-		   org-tag-alist-for-agenda
-		   org-current-tag-alist))
-	;; Merge current file's tag groups into global
-	;; `org-tag-groups-alist-for-agenda'.
-	(when org-group-tags
-	  (dolist (alist org-tag-groups-alist)
-		(let ((old (assoc (car alist) org-tag-groups-alist-for-agenda)))
-		  (if old
-		  (setcdr old (org-uniquify (append (cdr old) (cdr alist
-		(push alist org-tag-groups-alist-for-agenda)
-	(goto-char pos)
+  (dolist (file files)
+	(catch 'nextfile
+	  (if (bufferp file)
+	  (set-buffer file)
+	(org-check-agenda-file file)
+	(set-buffer (org-get-agenda-file-buffer file)))
+	  (save-excursion
+(save-restriction
+  (widen)
+	  (org-set-regexps-and-options 'tags-only)
+	  (setq pos (point))
+	  (or (memq 'category org-agenda-ignore-properties)
+		  (org-refresh-category-properties))
+	  (or (memq 'stats org-agenda-ignore-properties)
+		  (org-refresh-stats-properties))
+	  (or (memq 'effort org-agenda-ignore-properties)
+  (unless org-element-use-cache
+		(org-refresh-effort-properties)))
+	  (or (memq 'appt org-agenda-ignore-properties)
+		  (org-refresh-properties "APPT_WARNTIME" 'org-appt-warntime))
+	  (setq org-todo-keywords-for-agenda
+		(append org-todo-keywords-for-agenda org-todo-keywords-1))
+	  (setq org-done-keywords-for-agenda
+		(append org-done-keywords-for-agenda org-done-keywords))
+	  (setq org-todo-keyword-alist-for-agenda
+		(append org-todo-keyword-alist-for-agenda org-todo-key-alist))
+	  (setq org-tag-alist-for-agenda
+		(org--tag-add-to-alist
+		 org-tag-alist-for-agenda
+		 org-current-tag-alist))
+	  ;; Merge current file's tag groups into global
+	  ;; `org-tag-groups-alist-for-agenda'.
+	  (when org-group-tags
+	(dolist (alist org-tag-groups-alist)
+		  (let ((old (assoc (car alist) org-tag-groups-alist-for-agenda)))
+		(if old
+		(setcdr old (org-uniquify (append (cdr old) (cdr alist
+		  (push alist org-tag-groups-alist-for-agenda))
 (setq org-todo-keywords-for-agenda
   (org-uniqui

Re: We have asynchronous sessions, why have anything else?

2022-07-07 Thread Ihor Radchenko
Ivar Fredholm  writes:

> Hi Ihor, I have a prototype of what I mentioned earlier, at least for python. 
> This supports asynchronous, synchronous, session, and session-less blocks. 
> It's pretty messy but it helps to illustrate what I had in mind. Let me know 
> what you think.

I am not sure how I feel about it.
>From cursory look, the idea looks reasonable implementation-wise.

However, there is one big important requirement which does not appear to
be obeyed by your code: We _must_ be backwards-compatible. All the
existing babel backends must not be broken, especially third-party ones.
We must not make breaking changes to non-private function definitions.

Also, I do not see error handling as it is implemented in our current
babel code: Errors should be displayed in a popup buffer.

Best,
Ihor



Re: org-meta-return / org-insert-heading does not insert new heading in middle of heading even id org-M-RET-may-split-line is set

2022-07-07 Thread Ihor Radchenko
Guillaume MULLER  writes:

> I thought I already reported this bug, but I cannot find it anymore in the 
> mailing list archives 
> (https://lists.gnu.org/archive/cgi-bin/namazu.cgi?query=org-meta-return&submit=Search%21&idxname=emacs-orgmode&max=20&result=normal&sort=date%3Alate)
>  nor in the accepted bugs 
> (https://updates.orgmode.org/?sort-bugs-by=date#bugs) so I'm reporting it 
> (again?). Please forgive me if I'm duplicating it, but FYI it is still 
> present today.

It is
https://list.orgmode.org/41f10572-03d0-8c7a-341a-26c031575...@alolise.org/
and it is not listed in updates.orgmode.org because your bug report has
never been confirmed.

I recommend using https://list.orgmode.org/ to search our mailing list.
Our website frontend has a bit more reliable search engine.

> By default, on my config org-M-RET-may-split-line is set to 'nil', but 
> changing to whatever ("Always" or (default . t)) results in the same behavior.

Note that '(default . t) is _not_ the correct value. It should be
'((default . t)). Just in case.

I tried to set org-M-RET-may-split-line to nil first followed by setting
it to either t or '((default . t)). For both values, I am seeing

* heading number
* <>one

which is expected behavior.

Please, try to reproduce starting from emacs -Q (without Doom).
See https://orgmode.org/manual/Feedback.html

Best,
Ihor



Re: Re: [PATCH] ob-latex: Added support for including files with a relative path

2022-07-07 Thread Ihor Radchenko
em...@vergauwen.me writes:

> Different export types, or different user included packages, generate 
> different
>  metafiles. This makes an automated cleanup process afterwards a bit more
> complicated I think, if not impossible. 
>
> The temporary file makes it hard to add files to the working directory. 

Not too hard I'd say.
All we need is (1) record the directory files before running LaTeX; (2)
Run LaTeX; (3) Remove all the added files but the generated output file.

Best,
Ihor



Re: org-cature-ref

2022-07-07 Thread Ihor Radchenko
Henrik Frisk  writes:

> Ihor Radchenko recently mentioned org-capture-ref and I decided to try to
> use it, but I'm having trouble getting it to work. I have org-protocl
> working for me so I'm suspecting that it is the syntax of the bookmarklet
> I'm using that is at fault. I merely changed the capture template key from
> the example here:
>
> https://github.com/alphapapa/org-protocol-capture-html#org-protocol-instructions
>
> but that doesn't work (I get an empty buffer with what looks as the the
> link contents as name). Apart from that I have just copied the template
> from here:

Do I understand correctly that you used the following bookmarklet:

javascript:location.href = 'org-protocol://capture-html?template=w&url=...

?

Is so, you probably need

org-protocol://capture?template...
instead of
org-protocol://capture-html?template...

Best,
Ihor



Re: Org and Hyperbole

2022-07-07 Thread Fraga, Eric
Robert,

one immediate issue that has arisen is the binding of C-c C-m (i.e. C-c
RET) to hui-select-thing.  This clobbers the whole gnus-dired-mode-map
in dired mode (for those of us that use gnus...).

Just noting this but should probably take this off-list as it has
nothing to do with org.

-- 
: Eric S Fraga, with org release_9.5.4-609-g713598 in Emacs 29.0.50


Re: [PATCH] oc-csl: Add support for nocite citations

2022-07-07 Thread Ihor Radchenko
"Bruce D'Arcus"  writes:

> On Mon, Jul 4, 2022 at 7:54 AM Ihor Radchenko  wrote:
>
>> Since the fontification part appears to be unrelated to this particular
>> patch, I'd like to ask people who use CSL to test the patch.
>
> I just tested it, and it works as expected.

Thanks!
Applied onto main via b3b17cdb6.

Best,
Ihor



Re: [feature] Consistent fixed indentation of headline data

2022-07-07 Thread Ihor Radchenko
Valentin Lab  writes:

> I'm using org-mode for a long time, and I never understood quite well 
> how headline data were supposed to be indented, however I was happy with 
> what emerged to me as the default of 2 spaces (with my emacs and 
> org-mode version at the time). I recently updated my old emacs to 
> =9.5.3=, and what I thought was a default indentation was removed.
>
> Suddenly, I had no indentation at all for these headline-data and this 
> bugged me.

First of all, thanks for the patch! New contributions are always
welcome.

Note that we rarely change the defaults. This particular change came
after extensive discussion:
https://orgmode.org/list/878s4x3bwh@gnu.org
Also, it has been documented in https://orgmode.org/Changes.html
I recommend reviewing the changes every time you update Org to new
version.

> I went through documentation, and code, and (re-)discovered 
> `org-adapt-indentation' that was nil in my case and is intended to stay 
> this way as far as I am concerned : I'm looking for a fixed indentation 
> whatever the depth of my outlines.
>
> I'm far from sure it was a default one day, but sure it was at least 
> suggested/enforced in my workflow with my emacs at some time. And even 
> if it didn't feel like it was clad in iron, it seems I'm not the only 
> one who was using that as I can find some examples remaining in the 
> current 'testing/examples' org files.
>
> This indentation concerns only what is called "headline data" in the 
> documentation of `org-adapt-indentation'. To be precise: schedules 
> ("SCHEDULE:", "DEADLINE:"...), clock drawer (":LOGBOOK:..."), property 
> drawer (":PROPERTY:..."). These are "data" appearing after the headline 
> as I understand them.

This sounds like a reasonable addition.

> If I'm a user of org-mode, I'm fairly new in the emacs lisp and hacking 
> community and I need to know:
> - if my proposal is useful and has any chance to be accepted,

It looks useful for me.

> - if there are any pitfalls I delved into in matter of coding, 
> conventions, ...

I will provide some comments on the patch below.
In general, the patch looks nice. Providing tests is especially welcome.

> Subject: [PATCH] org-el: Add fixed indentation of headline data
>
> * lisp/org.el (org-headline-data-fixed-indent-level): Definition of
> new customizable variable and doc.
> (org-add-planning-info): When creating planning line, force a
> `org-indent-line' to indent it correctly.
> (org--get-expected-indentation): If variable
> `org-headline-data-fixed-indent-level' is set and line is header,
> inform `org-indent-line' to indent from specified amount.
> (org-adapt-indentation): Update documentation to mention new
> `org-headline-data-fixed-indent-level'.

Note that introducing a new customization should be documented in
etc/ORG-NEWS file and probably also in the manual (17.4.2 Hard
indentation).

Also, I am not sure if we really need a new custom variable. We already
have many. What about simply allowing an integer value of
org-adapt-indentation?

> TINYCHANGE
>
> Signed-off-by: Valentin Lab 

Note that your patch is _not_ a tiny change (not <15 LOC).
See https://orgmode.org/worg/org-contribute.html#first-patch and
https://orgmode.org/worg/org-contribute.html#copyright
Would you consider signing the copyright assignment papers with FSF?

> @@ -18371,6 +18386,9 @@ ELEMENT."
>   ;; a footnote definition.
>   (org--get-expected-indentation
>(org-element-property :parent previous) t))
> +  ((and (not (eq org-headline-data-fixed-indent-level nil))
> + (memq type '(drawer property-drawer planning node-property clock)))
> + org-headline-data-fixed-indent-level)
>;; Otherwise, move to the first non-blank line above.

Why clock? It does not belong to property drawers.

> @@ -1216,6 +1259,13 @@
>  (org-test-with-temp-text "* H\n:PROPERTIES:\n:key:\n:END:"
>(org-indent-region (point-min) (point-max))
>(buffer-string)
> +  ;; ;; Indent property drawers according to `org-adapt-indentation'.
> +  ;; (let ((org-adapt-indentation 'headline-data))
> +  ;;   (should
> +  ;;(equal "* H\n  :PROPERTIES:\n  :key:\n  :END:\n\ncontent2"
> +  ;;   (org-test-with-temp-text "* 
> H\n:PROPERTIES:\n:key:\n:END:\n\ncontent"
> +  ;; (org-indent-region (point-min) (point-max))
> +  ;; (buffer-string)

This test is commented. Is it intentional?

Best,
Ihor



Re: [BUG] running org-agenda-todo-yesterday on a habit erroneously sets :LAST_REPEAT: as today, instead of yesterday [9.6 (9.6-??-e9da29b6f @ /home/jon/.emacs.d/.local/straight/build-28.1/org/)]

2022-07-07 Thread Ihor Radchenko
Jonathan Reeve  writes:

> I will often use org-agenda-todo-yesterday to log habits that I did 
> yesterday. It works fine for changing the todo state and logging it as 
> yesterday’s, but the :LAST_REPEAT: property it has, since it’s a habit, is 
> set to today, rather than yesterday.
>
> This means that, for example, I can have a habit that’s set to repeat every 
> day, and run org-agenda-todo-yesterday in Agenda view, which will change the 
> state of a habit to “DONE” for yesterday, but when I reload the buffer, the 
> item disappears, because it thinks it’s already been done for that day. But I 
> want to log it as done for yesterday, and then log it again as done for today.

Thanks!
Fixed on main via 0495961f3.

Best,
Ihor



Re: [BUG] org-agenda passes current-prefix-arg to commands instead of arg [9.5.3 (9.5.3-g69c588 @ /Users/stas/.emacs.d/straight/build/org/)]

2022-07-07 Thread Ihor Radchenko
stasvla...@disroot.org writes:

> `org-agenda' function passes `current-prefix-arg' to its commands (e.g., 
> `org-agenda-tags') instead of `arg'
>
> This might create unexpected behaviour if one uses `org-agenda' function 
> inside another interactive function that accepts on universal prefix. For 
> example if I define `my/agenda-done-todos' it wont show any DONE todos if I 
> call it with prefix to restrict it to current buffer because 
> `org-agenda-tags' will be limited only to active todos by 
> `current-prefix-arg' and this will always produce empty set:

Thanks for reporting!
Your examples makes sense and I do not see any reason why
`current-prefix-arg' should be used instead of ARG. The present usage
appears to be introduced in the initial agenda implementation back 14
years ago.

Fixed on main via db12a497d.

Best,
Ihor




Re: Links to javascript-based websites from orgmode.org: Paypal and Github

2022-07-07 Thread Ihor Radchenko
"Thomas S. Dye"  writes:

> Nevertheless, it is good to know that I'm free to give up freedoms 
> to contribute to Org mode development.  @Ihor, will Paypal work 
> for you?

Yep. Currently, Paypal is the only option (apart from direct bank
transfers) that works for me.

See https://liberapay.com/org-mode or https://liberapay.com/yantar92/ or
just use my email as Paypal id.

Best,
Ihor



Re: [BUG] formatting at edges of link

2022-07-07 Thread Ihor Radchenko
Tor Kringeland  writes:

>> Descriptions will be correctly formatted.
>>
>> [[https://orgmode.org][/italic/]] should work just fine.
>
> This does not work for me.  "italic" isn't italicized.  But for example

Hmm. You are right.
This problem indeed exists on main.
However, it will be fixed after the ongoing refactoring of our
fontification code.
See https://orgmode.org/list/87ee7c9quk.fsf@localhost.
You can try the new fontification code on
https://github.com/yantar92/org (feature/org-font-lock-element branch)

Best,
Ihor



Re: [PATCH] Bugfix to org-babel-remove-temporary-stable-directory

2022-07-07 Thread Ihor Radchenko
Mark Dawson  writes:

> * ob-core.el (org-babel-remove-temporary-stable-directory): This
> function was failing when `org-babel-temporary-stable-directory' was
> nil.  This variable is nil when initialised.  The function
> now checks that the variable is non-nil before attempting to call
> `file-exists-p`.
> TINYCHANGE

Thanks for the patch!
I applied a different fix.
See https://list.orgmode.org/87let71hy0@yandex.com/T/#t

Best,
Ihor



Re: [BUG] [PATCH] Ensure org-babel-temporary-stable-directory bound-and-true [9.6 (9.6-g713598 @ /home/n/.emacs.d/elpaca/builds/org/)]

2022-07-07 Thread Ihor Radchenko
No Wayman  writes:

> Sorry, that symbol should not be quoted in the patch. 
> Amended attached.

I applied a different fix. See
https://list.orgmode.org/87let71hy0@yandex.com/T/#t

Best,
Ihor



Re: wrong type argument with latest org and latest emacs

2022-07-07 Thread Ihor Radchenko
Colin Baxter  writes:

> Ok, that patch seems to solve the issue. I have applied the patch and I
> now get now error message when I close down emacs-29.0.50.

Thanks for testing!
Fixed on main via e4438fe3c.
I applied a different patch that solves the problem properly.
I have managed to reproduce the error using Emacs 29. The problem was
partially related to `make-directory' return value and partially related
to failed `make-directory' calls.

Best,
Ihor



Re: wrong type argument with latest org and [not] latest emacs

2022-07-07 Thread Alain . Cochard
Colin Baxter writes on Tue  5 Jul 2022 20:24:
 > > Colin Baxter  writes:
 > 
 > > Ihor Radchenko  writes:
 > >> Colin Baxter  writes:
 > >>> I'm sending this to emacs.orgmode and emacs.devel lists.
 > >>> 
 > >>> With the latest emacs:
 > >>> 
 > >>> 
 > >>> Debugger entered--Lisp error: (wrong-type-argument stringp
 > >>> (wrong-type-argument stringp nil))
 > >>> format-message((wrong-type-argument stringp nil))
 > >>> apply(format-message (wrong-type-argument stringp nil))
 > >>> error((wrong-type-argument stringp nil)) #f(compiled-function
 > >>> (fun) # -0x1724f6e> )(org-babel-remove-temporary-stable-directory)
 > >>> run-hook-wrapped(#f(compiled-function (fun) # -0x1724f6e> ) org-babel-remove-temporary-stable-directory)
 > 
 > >> Thanks for reporting!  This likely caused by recent commit of
 > >> mine on systems with no write access to remote directory (at
 > >> least, I am unable to reproduce the steps on my system).
 > 
 > >> Can you please try the attached patch?
 > 
 > >> Best, Ihor
 > 
 > >> From ddf6278e8fcbaa4939539277b111061b7c00f550 Mon Sep 17 00:00:00
 > >> 2001 Message-Id:
 > >> 
 > 
 > >> From: Ihor Radchenko  Date: Tue, 5 Jul 2022
 > >> 21:00:24 +0800 Subject: [PATCH] ob-core: Fix nil value of
 > >> `org-babel-temporary-stable-directory'
 > 
 > >> * lisp/ob-core.el: Fallback the value of
 > >> `org-babel-temporary-stable-directory' to
 > >> `org-babel-temporary-directory' if there are issues with
 > >> directory creation.
 > 
 > >> Fixes https://yhetil.org/emacs-devel/87sfnfhm6v@yandex.com
 > >> --- lisp/ob-core.el | 3 ++- 1 file changed, 2 insertions(+), 1
 > >> deletion(-)
 > 
 > >> diff --git a/lisp/ob-core.el b/lisp/ob-core.el index
 > >> 6c379c121..aaf895d74 100644 --- a/lisp/ob-core.el +++
 > >> b/lisp/ob-core.el @@ -3167,7 +3167,8 @@ (defvar
 > >> org-babel-temporary-stable-directory (expand-file-name
 > >> "babel-stable" (temporary-file-directory))) - (t nil))) + ;;
 > >> Fallback if things do not work.  + (t
 > >> org-babel-temporary-directory))) "Directory to hold temporary
 > >> files created to execute code blocks.  Used by
 > >> `org-babel-temp-file'.  This directory will be removed on Emacs
 > >> shutdown."))  -- 2.35.1
 > 
 > > Ok, that patch seems to solve the issue. I have applied the patch
 > > and I now get now error message when I close down emacs-29.0.50.
 > 
 > Typo! That's no error, not now error.

So it is not the latest emacs

  GNU Emacs 27.2 (build 1, x86_64-redhat-linux-gnu, GTK+ Version
  3.24.30, cairo version 1.17.4) of 2021-08-07

but it seems related. I have no problem with 

  Org mode version 9.5.4 (9.5.4-ge0b05b @
  /home/cochard/.emacs.d/elpa/org-9.5.4/)

but if I use what I believe to be the latest org from git (pulled a
few minutes ago):

  Org mode version 9.5.4 (release_9.5.4-609-g713598 @
  /home/cochard/Org/Coch-git/org-mode/lisp/)

upon 'C-x C-c', I get

  org-babel-remove-temporary-stable-directory: Wrong type argument:
  stringp, nil

and emacs does not even close.  I cannot kill it either with 'C-c' on
the terminal from which I started emacs.  I have to 'kill -9
'


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




Re: Bug: org-edit-special indents inline latex [9.5 (nil @ /home/david/.emacs.d/.local/straight/build-27.2/org-mode/)]

2022-07-07 Thread Ihor Radchenko
Sébastien Miquel  writes:

> Marking this as resolved on updates.orgmode.org, 2nd try.
>
> |Fixed.|

AFAIK, the  proper syntax is putting "Fixed" at the beginning of a line
somewhere in the email text:

Fixed.

Note that the instructions in Woof!'s github and sr.ht repos are too
new. https://updates.orgmode.org/ uses an older version of Woof! with
slightly different syntax.
The new version is to be released and to be used soon (hopefully).

Best,
Ihor



Re: Efficiently reuse code in org babel with R

2022-07-07 Thread Jeremie Juste
Hello Naresh,

Many thanks for sharing.
If I'm looking for efficiency, I tend not to use noweb and use an R
session instead.

One reason is that caching does not work with noweb

#+name: test
#+begin_src R  :cache yes :session *R*
Sys.sleep(10)
  a <- 1
#+end_src

#+RESULTS[36c41617bf9aa447ecc28fca8207eab38340d418]: test
: 1


#+name: add1
#+begin_src R :noweb yes :cache no :session *R*
<>
 a + 1
#+end_src

#+RESULTS: add1
: 2


I would proceed in the following way

#+name: connection
#+begin_src R :exports results :results output :session *R* 
 ## my code here
#+end_src

#+begin_src R :exports results :results output graphics file
:session *R* :file figures/fig1.png
## my code here
#+end_src

#+begin_src R :exports results output graphics file :file figures/fig2.png 
:session *R*
## my code here
#+end_src

this will require running the first code chunk once only to run the rest

On Thursday,  7 Jul 2022 at 09:22, Greg Minshall wrote:
>  you'd have to be careful to not get bitten by the code
> *not* being evaluated, and by it being evaluated too often.  (probably
> too clever by half.)

The comment of Greg is very relevant here as you'll have to manage
updates yourself, and it can get complex very quickly. A potential
pitfall is when the tables in database you are referring to, change.
So in this case I would avoid using :cache yes in the first code chunk


I'm also tempted to adopt the following organization

* setup table
#+name: connection
#+begin_src R :exports results :results output :session *R* 
 ## my code here
#+end_src

* output graphs
 :PROPERTIES:
 :header-args:R: :exports results output graphics file  :session *R*
 :END:
 
#+begin_src R  :file figures/fig2.png
## my code here
#+end_src

#+begin_src R  :file figures/fig1.png 
## my code here
#+end_src

then I would use (org-babel-execute-subtree) which is bound to C-c C-v
s on the subheading output graphs to regenerate the graphs.


HTH,
Jeremie



Re: Links to javascript-based websites from orgmode.org: Paypal and Github

2022-07-07 Thread Richard Stallman
[[[ To any NSA and FBI agents reading my email: please consider]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > That’s when banks take up Taler. Before they do, any intermediary can
  > take that role and use Taler to pool money so it can be sent in larger
  > regular transactions.

If people make it work, I'll cheer.

Regarding GitHub, the thigs we already condemned it for
are much worse for the community than Copialot.  Promoting
bad license practices has been a disaster.


-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)