[BUG] `org-element-at-point-no-context' error in flyspell `org-mode-flyspell-verify'

2023-11-06 Thread Christopher M. Miles

I got following error:

#+begin_example
Please report this to Org mode mailing list (M-x org-submit-bug-report).
⛔ Warning (org-element-cache): org-element--cache: Org parser error in 
Code.org::434180. Resetting.
 The error was: (wrong-number-of-arguments ((t) nil "Return outline-regexp with 
limited number of levels.
The number of levels is controlled by `org-inlinetask-min-level'." (cond ((not 
(derived-mode-p 'org-mode)) outline-regexp) ((not (featurep 'org-inlinetask)) 
org-outline-regexp) (t (let* ((limit-level (1- org-inlinetask-min-level)) 
(nstars (if org-odd-levels-only (1- (* limit-level 2)) limit-level))) (format 
"\\*\\{1,%d\\} " nstars) 1)
 Backtrace:
"  backtrace-to-string(nil)
  (progn (backtrace-to-string (backtrace-get-frames 'backtrace)))
  (if (and (fboundp 'backtrace-get-frames) (fboundp 'backtrace-to-string)) 
(progn (backtrace-to-string (backtrace-get-frames 'backtrace
  (format \"Org parser error in %s::%S. Resetting.\\n The error was: %S\\n 
Backtrace:\\n%S\\n Please report this to Org mode mailing list (M-x 
org-submit-bug-report).\" (buffer-name (current-buffer)) epom err (if (and 
(fboundp 'backtrace-get-frames) (fboundp 'backtrace-to-string)) (progn 
(backtrace-to-string (backtrace-get-frames 'backtrace)
  (let* ((format-string (format \"Org parser error in %s::%S. Resetting.\\n The 
error was: %S\\n Backtrace:\\n%S\\n Please report this to Org mode mailing list 
(M-x org-submit-bug-report).\" (buffer-name (current-buffer)) epom err (if (and 
(fboundp 'backtrace-get-frames) (fboundp 'backtrace-to-string)) (progn 
(backtrace-to-string (backtrace-get-frames ...)) (format-string (if (or 
(not org-element--cache-diagnostics-ring) (not (eq 'backtrace 
org-element--cache-self-verify))) format-string (prog1 (concat (format 
\"Warning(%s): \" (buffer-name ...)) format-string \"\\nBacktrace:\\n  \" 
(mapconcat #'identity (ring-elements org-element--cache-diagnostics-ring) \"\\n 
 \")) (setq org-element--cache-diagnostics-ring nil) (if (and (boundp 
'org-batch-test) org-batch-test) (error \"%s\" (concat \"org-element--cache: \" 
format-string)) (display-warning 'org-element-cache (concat 
\"org-element--cache: \" format-string
  (condition-case err (org-element--parse-to epom) ((debug error) (let* 
((format-string (format \"Org parser error in %s::%S. Resetting.\\n The error 
was: %S\\n Backtrace:\\n%S\\n Please report this to Org mode mailing list (M-x 
org-submit-bug-report).\" (buffer-name (current-buffer)) epom err (if (and ... 
...) (progn ... (format-string (if (or (not 
org-element--cache-diagnostics-ring) (not ...)) format-string (prog1 (concat 
... format-string \"\\nBacktrace:\\n  \" ...) (setq 
org-element--cache-diagnostics-ring nil) (if (and (boundp 'org-batch-test) 
org-batch-test) (error \"%s\" (concat \"org-element--cache: \" format-string)) 
(display-warning 'org-element-cache (concat \"org-element--cache: \" 
format-string (org-element-cache-reset) (org-element--parse-to epom)))
  (if cached-only (if (and (org-element--cache-active-p) (or (not 
org-element--cache-sync-requests) (< epom (aref (car 
org-element--cache-sync-requests) 1 (progn (org-element--cache-find epom))) 
(condition-case err (org-element--parse-to epom) ((debug error) (let* 
((format-string (format \"Org parser error in %s::%S. Resetting.\\n The error 
was: %S\\n Backtrace:\\n%S\\n Please report this to Org mode mailing list (M-x 
org-submit-bug-report).\" (buffer-name ...) epom err (if ... ...))) 
(format-string (if (or ... ...) format-string (prog1 ... ... (if (and 
(boundp 'org-batch-test) org-batch-test) (error \"%s\" (concat 
\"org-element--cache: \" format-string)) (display-warning 'org-element-cache 
(concat \"org-element--cache: \" format-string (org-element-cache-reset) 
(org-element--parse-to epom
  (setq element (if cached-only (if (and (org-element--cache-active-p) (or (not 
org-element--cache-sync-requests) (< epom (aref (car 
org-element--cache-sync-requests) 1 (progn (org-element--cache-find epom))) 
(condition-case err (org-element--parse-to epom) ((debug error) (let* 
((format-string (format \"Org parser error in %s::%S. Resetting.\\n The error 
was: %S\\n Backtrace:\\n%S\\n Please report this to Org mode mailing list (M-x 
org-submit-bug-report).\" ... epom err ...)) (format-string (if ... 
format-string ...))) (if (and (boundp ...) org-batch-test) (error \"%s\" 
(concat \"org-element--cache: \" format-string)) (display-warning 
'org-element-cache (concat \"org-element--cache: \" format-string 
(org-element-cache-reset) (org-element--parse-to epom)
  (let (element) (if (org-element--cache-active-p) (progn (if (not 
(save-current-buffer (set-buffer (or ... ...)) org-element--cache)) 
(org-element-cache-reset) (if cached-only nil (org-element--cache-sync 
(current-buffer) epom) (setq element (if cached-only (if (and 
(org-element--cache-active-p) (or (not org-element--cache-sync-requests) (< 
epom (aref ... 1 

[BUG] `org-todo` [C-c C-t] got error (args-out-of-range # 0 48016)

2023-11-06 Thread Christopher M. Miles

Here is the backtrace after I toggled debug-on-error:


#+begin_example
Debugger entered--Lisp error: (args-out-of-range # 0 
48016)
  replace-match("")
  (progn (goto-char (match-beginning 0)) (replace-match "") 
(insert-before-markers-and-inherit next) (if (org-invisible-p 
(line-beginning-position)) nil (org-fold-region (line-beginning-position) 
(line-end-position) nil)))
  (unwind-protect (progn (goto-char (match-beginning 0)) (replace-match "") 
(insert-before-markers-and-inherit next) (if (org-invisible-p 
(line-beginning-position)) nil (org-fold-region (line-beginning-position) 
(line-end-position) nil))) (setq org-fold-core--last-buffer-chars-modified-tick 
(buffer-chars-modified-tick)))
  (let ((org-fold-core--ignore-modifications t)) (unwind-protect (progn 
(goto-char (match-beginning 0)) (replace-match "") 
(insert-before-markers-and-inherit next) (if (org-invisible-p 
(line-beginning-position)) nil (org-fold-region (line-beginning-position) 
(line-end-position) nil))) (setq org-fold-core--last-buffer-chars-modified-tick 
(buffer-chars-modified-tick
  (let* ((match-data (match-data)) (startpos (copy-marker 
(line-beginning-position))) (force-log (and (equal arg '...) (prog1 t (setq arg 
nil (logging (let ((saved-match-data ...)) (unwind-protect (progn ...) 
(set-match-data saved-match-data t (org-log-done org-log-done) 
(org-log-repeat org-log-repeat) (org-todo-log-states org-todo-log-states) 
(org-inhibit-logging (if (equal arg 0) (progn (setq arg nil) 'note) 
org-inhibit-logging)) (this (match-string 1)) (hl-pos (match-beginning 0)) 
(head (org-get-todo-sequence-head this)) (ass (assoc head org-todo-kwd-alist)) 
(interpret (nth 1 ass)) (done-word (nth 3 ass)) (final-done-word (nth 4 ass)) 
(org-last-state (or this "")) (completion-ignore-case t) (member (member this 
org-todo-keywords-1)) (tail (cdr member)) (org-state (cond ((eq arg ...) (if 
this ... ...)) ((eq arg ...) (if ... nil ...)) (arg (cond ... ... ... ... ... 
... ... ...)) ((and org-todo-key-trigger org-use-fast-todo-selection) 
(org-fast-todo-selection this)) ((null member) (or head ...)) ((equal this 
final-done-word) nil) ((null tail) nil) ((memq interpret ...) (if ... ... ...)) 
(t (car tail (org-state (or (run-hook-with-args-until-success 
'org-todo-get-default-hook org-state org-last-state) org-state)) (next (if 
(org-string-nw-p org-state) (concat " " org-state " ") " ")) (change-plist 
(list :type 'todo-state-change :from this :to org-state :position startpos)) 
dolog now-done-p) (if org-blocker-hook (progn (let (org-blocked-by-checkboxes 
block-reason) (setq org-last-todo-state-is-todo (not ...)) (if (save-excursion 
...) nil (setq block-reason ...) (if ... ... ... ...) (store-match-data 
match-data) (let ((org-fold-core--ignore-modifications t)) (unwind-protect 
(progn (goto-char (match-beginning 0)) (replace-match "") 
(insert-before-markers-and-inherit next) (if (org-invisible-p ...) nil 
(org-fold-region ... ... nil))) (setq 
org-fold-core--last-buffer-chars-modified-tick (buffer-chars-modified-tick 
(cond ((and org-state (equal this org-state)) (message "TODO state was already 
%s" (org-trim next))) ((not (pos-visible-in-window-p hl-pos)) (message "TODO 
state changed to %s" (org-trim next (if head nil (progn (setq head 
(org-get-todo-sequence-head org-state)) (setq ass (assoc head 
org-todo-kwd-alist)) (setq interpret (nth 1 ass)) (setq done-word (nth 3 ass)) 
(setq final-done-word (nth 4 ass (if (memq arg '(nextset previousset)) 
(progn (message "Keyword-Set %d/%d: %s" (- (length org-todo-sets) -1 (length 
...)) (length org-todo-sets) (mapconcat 'identity (assoc org-state 
org-todo-sets) " " (setq org-last-todo-state-is-todo (not (member org-state 
org-done-keywords))) (setq now-done-p (and (member org-state org-done-keywords) 
(not (member this org-done-keywords (and logging (org-local-logging 
logging)) (if (or (and (or org-todo-log-states org-log-done) (not (eq 
org-inhibit-logging t)) (not (memq arg ...))) force-log) (progn (setq dolog (or 
(if force-log ...) (nth 1 ...) (nth 2 ...))) (if (and (eq dolog ...) (eq 
org-inhibit-logging ...)) (progn (setq dolog ...))) (if (or (and ... ...) (and 
org-state ... ...)) (progn (org-add-planning-info nil nil ...))) (if (and 
now-done-p org-log-done) (progn (org-add-planning-info ... ...) (if ... ...))) 
(if (and org-state dolog) (progn (org-add-log-setup ... org-state this 
dolog) (org-todo-trigger-tag-changes org-state) (if org-auto-align-tags 
(progn (org-align-tags))) (if org-provide-todo-statistics (progn 
(org-update-parent-todo-statistics))) (if (and (boundp 
'org-clock-out-when-done) org-clock-out-when-done) (progn 
(org-clock-out-if-current))) (run-hooks 'org-after-todo-state-change-hook) (if 
(and arg (not (member org-state org-done-keywords))) (progn (setq head 
(org-get-todo-sequence-head org-state (put-text-property 
(line-beginning-position) (line-end-position) 'org-todo-head head) (if 
now-done-p (progn (if 

Re: How to mark a in HTML export with a class?

2023-11-06 Thread Marcin Borkowski


On 2023-11-07, at 06:06, Marcin Borkowski  wrote:

> Hi all,
>
> I'd like to put some HTML class on my  element, exported from an Org
> mode list.  Is that possible?

Ok, found it - say

#+ATTR_HTML: :class whatever

right before it.

Best,

-- 
Marcin Borkowski
http://mbork.pl



How to mark a in HTML export with a class?

2023-11-06 Thread Marcin Borkowski
Hi all,

I'd like to put some HTML class on my  element, exported from an Org
mode list.  Is that possible?

TIA,

-- 
Marcin Borkowski
http://mbork.pl



Re: bash source code block: problem after ssh commands

2023-11-06 Thread Alain . Cochard
Matt writes on Mon  6 Nov 2023 19:01:

 > I want to confirm, are you able to accomplish your task by using
 > '-n'?

Yes.  Evaluating this block (with C-c C-c):

   #+begin_src bash :results output
   ssh -n coch...@fruc.u-strasbg.fr "echo foo>foo_file"
   echo "bar"
   #+end_src

gives

   #+RESULTS:
   : bar

(without the '-n', #+RESULTS: is empty).  Same conclusion if I
copy/yank the 2 bash instructions in an emacs terminal (M-x shell). 

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




Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2023-11-06 Thread Jim Porter

On 11/6/2023 12:11 PM, Ihor Radchenko wrote:

[ Branching to emacs-devel for further input from Emacs devs ]

Jim Porter  writes:


This is similar to Emacs bug#66752[1]. It would be nice if
"(thing-at-point 'url)" would return the URL when point is over an Org
link. With this, it's easier to write a function that copies (or browses
to) the URL at point without coding so many special cases.
...
+(defun org--url-at-point ()
+  "`thing-at-point' provider function."
+  (org-element-property :raw-link (org-element-context)))


Supporting thingatpt.el is certainly welcome. However, I have some
doubts about how mature thingatpt.el is.

In particular, I am concerned whether `thing-at-point-provider-alist' is
reliable enough in non-trivial scenarios like when given URL string is
not matching some generic URL regexp.


The nice thing about 'thing-at-point-provider-alist' is that your 
provider has absolute control over what to return, so Org's URL provider 
could do whatever it wants. As far as I can tell, this code path 
completely avoids calling 'bounds-of-thing-at-point' ('botap'). However, 
it *would* call 'botap' if point wasn't on an Org link, since it would 
fall back to the last condition in 'thing-at-point'. Still, this is what 
happens today with no provider, so it's not really any worse than before...


Maybe it would make sense for 'thing-at-point' to have a "(catch 
'not-found ...)" form around the loop over 
'thing-at-point-provider-alist'. Then Org could definitively say, 
"There's no URL at point, no matter what anyone else says".



Looking into the source code of `bounds-of-thing-at-point', I see that
for standard "things" (like url),
`thing-at-point-bounds-of-url-at-point' is used unconditionally. In the
case of Org links, we may have something like [[https://orgmode.org]]
that will not match default URL regexp as is. AFAIU, there is no
documented way to customize the behaviour of `bounds-of-thing-at-point'
and `forward-thing'.


I think it would make sense to add some sort of 
'bounds-of-thing-at-point-provider-alist' (that's a mouthful!) that 
would let modes override the behavior of 'botap', but I don't think 
that's necessary for the narrower purpose of asking, "I want the value 
of THING at point, if any."



I also have concerns about Org-specific part of the patch, but the above
is far more important, and we need to discuss it before starting to
consider anything for Org mode.


For better or worse, I mostly modeled this patch on how EWW integrates 
with thing-at-point, since that's the only place I saw in the Emacs tree 
that did this already.




Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2023-11-06 Thread Ihor Radchenko
[ Branching to emacs-devel for further input from Emacs devs ]

Jim Porter  writes:

> This is similar to Emacs bug#66752[1]. It would be nice if 
> "(thing-at-point 'url)" would return the URL when point is over an Org 
> link. With this, it's easier to write a function that copies (or browses 
> to) the URL at point without coding so many special cases.
> ...
> +(defun org--url-at-point ()
> +  "`thing-at-point' provider function."
> +  (org-element-property :raw-link (org-element-context)))

Supporting thingatpt.el is certainly welcome. However, I have some
doubts about how mature thingatpt.el is.

In particular, I am concerned whether `thing-at-point-provider-alist' is
reliable enough in non-trivial scenarios like when given URL string is
not matching some generic URL regexp.

Looking into the source code of `bounds-of-thing-at-point', I see that
for standard "things" (like url),
`thing-at-point-bounds-of-url-at-point' is used unconditionally. In the
case of Org links, we may have something like [[https://orgmode.org]]
that will not match default URL regexp as is. AFAIU, there is no
documented way to customize the behaviour of `bounds-of-thing-at-point'
and `forward-thing'.

I also have concerns about Org-specific part of the patch, but the above
is far more important, and we need to discuss it before starting to
consider anything for Org mode.

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



Re: [PATCH] Add support for 'thing-at-point' to get URL at point

2023-11-06 Thread Jim Porter

On 11/6/2023 11:45 AM, Jim Porter wrote:
This is similar to Emacs bug#66752[1]. It would be nice if 
"(thing-at-point 'url)" would return the URL when point is over an Org 
link. With this, it's easier to write a function that copies (or browses 
to) the URL at point without coding so many special cases.


Actually, this code should probably be a bit more selective: is there a 
good way to tell when an Org link is an absolute URL, as opposed to some 
relative path or internal target?


Maybe we should check 'thing-at-point-uri-schemes'?



Re: how to exclude certain row values from calculation in a table

2023-11-06 Thread Uwe Brauer
Hi Bruno


> Hi Uwe,

> Uwe Brauer  writes:

> ...

> You could use 'vmask' to mask the values you don't want.
> Here is an example using vmask:

>||  Price |
>|+|
>| 1  |  10.98 |
>||  11.90 |
>||  19.98 |
>||  13.79 |
>| 1  |  29.97 |
>||  18.98 |
>||  13.79 |
>||  11.90 |
>||  24.28 |
>|+|
>|| 155.57 |
>| Total unmarked | 114.62 |
>| Total marked   |  40.95 |
>| Check all  | OK |

>#+TBLFM: @11$2=vsum(@I$2..@II$2);f2
>#+TBLFM: @12$2=vsum(vmask(map(<0 = #1>, @I$1..@II$1), @I$2..@II$2));f2NE

>#+TBLFM: @13$2=vsum(vmask(map(<1 = #1>, @I$1..@II$1), @I$2..@II$2));f2NE
>#+TBLFM: @14$2=string(if(@12$2+@13$2 = @11$2, "OK", "Oops!"))

Very cool, thank you very much indeed, this is very helpful

Uwe 




-- 
I strongly condemn Hamas heinous atrocities on Israel, especially the 
despicable pogroms.
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the NATO membership of Ukraine.
I support the EU membership of Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/


smime.p7s
Description: S/MIME cryptographic signature


[PATCH] Add support for 'thing-at-point' to get URL at point

2023-11-06 Thread Jim Porter
This is similar to Emacs bug#66752[1]. It would be nice if 
"(thing-at-point 'url)" would return the URL when point is over an Org 
link. With this, it's easier to write a function that copies (or browses 
to) the URL at point without coding so many special cases.


Attached is a patch with a regression test for it. Should this also get 
a NEWS entry?


[1] https://lists.gnu.org/archive/html/bug-gnu-emacs/2023-10/msg01628.htmlFrom 6bce84bd28253236eff8ef972ede7daf82f95a71 Mon Sep 17 00:00:00 2001
From: Jim Porter 
Date: Mon, 6 Nov 2023 11:39:09 -0800
Subject: [PATCH] Add support for 'thing-at-point' to get URL at point

* lisp/org.el (thingatpt): Require.
(org--url-at-point): New function...
(org-mode): ... and add it to 'thing-at-point-provider-alist'.

* testing/lisp/test-org.el (test-org/thing-at-point/url): New test.
---
 lisp/org.el  | 10 ++
 testing/lisp/test-org.el | 10 ++
 2 files changed, 20 insertions(+)

diff --git a/lisp/org.el b/lisp/org.el
index 4eb6ad0ee..c7ecfc13a 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -81,6 +81,7 @@
 (require 'calendar)
 (require 'find-func)
 (require 'format-spec)
+(require 'thingatpt)
 
 (condition-case nil
 (load (concat (file-name-directory load-file-name)
@@ -4948,6 +4949,11 @@ The following commands are available:
 #'pcomplete-completions-at-point nil t)
   (setq-local buffer-face-mode-face 'org-default)
 
+  ;; `thing-at-point' support
+  (setq-local thing-at-point-provider-alist
+  (append thing-at-point-provider-alist
+  '((url . org--url-at-point
+
   ;; If empty file that did not turn on Org mode automatically, make
   ;; it to.
   (when (and org-insert-mode-line-in-empty-file
@@ -8611,6 +8617,10 @@ there is one, return it."
   (setq link (nth (1- nth) links)
(cons link end)
 
+(defun org--url-at-point ()
+  "`thing-at-point' provider function."
+  (org-element-property :raw-link (org-element-context)))
+
 ;;; File search
 
 (defun org-do-occur (regexp  cleanup)
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 21b850c03..2fe4477a3 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -3583,6 +3583,16 @@ Foo Bar
 (org-open-at-point))
 nil)
 
+
+;;; Thing at point
+
+(ert-deftest test-org/thing-at-point/url ()
+  "Test that `thing-at-point' returns the URL at point."
+  (should
+   (org-test-with-temp-text
+   "[[https://www.gnu.org/software/emacs/][GNU Emacs]]"
+ (string= (thing-at-point 'url) "https://www.gnu.org/software/emacs/;
+
 
 ;;; Node Properties
 
-- 
2.25.1



Re: how to exclude certain row values from calculation in a table

2023-11-06 Thread Bruno Barbier


Hi Uwe,

Uwe Brauer  writes:

> Hi all
>
> Please look at 
>
> |   |  Price |
> |---+|
> | / |  10.98 |
> |   |  11.90 |
> |   |  19.98 |
> |   |  13.79 |
> |   |  29.97 |
> |   |  18.98 |
> |   |  13.79 |
> |   |  11.90 |
> |   |  24.28 |
> |---+|
> |   | 155.57 |
> #+TBLFM: @11$2=vsum(@I$2..@II$2);f2
>
> I would like to exclude the first value from the sum by adding some mark
> in that row.
...
>
> Any idea how to exclude row values in a column?

You could use 'vmask' to mask the values you don't want.
Here is an example using vmask:

   ||  Price |
   |+|
   | 1  |  10.98 |
   ||  11.90 |
   ||  19.98 |
   ||  13.79 |
   | 1  |  29.97 |
   ||  18.98 |
   ||  13.79 |
   ||  11.90 |
   ||  24.28 |
   |+|
   || 155.57 |
   | Total unmarked | 114.62 |
   | Total marked   |  40.95 |
   | Check all  | OK |
   #+TBLFM: @11$2=vsum(@I$2..@II$2);f2
   #+TBLFM: @12$2=vsum(vmask(map(<0 = #1>, @I$1..@II$1), @I$2..@II$2));f2NE
   #+TBLFM: @13$2=vsum(vmask(map(<1 = #1>, @I$1..@II$1), @I$2..@II$2));f2NE
   #+TBLFM: @14$2=string(if(@12$2+@13$2 = @11$2, "OK", "Oops!"))

Bruno




Re: bash source code block: problem after ssh commands

2023-11-06 Thread Matt


  On Mon, 06 Nov 2023 14:32:16 +0100  Ihor Radchenko  wrote --- 
 > I am wondering about the possible downsides of using script approach
 > instead of stdin redirection.
 
I'm curious to hear more about what you're thinking.



Re: bash source code block: problem after ssh commands

2023-11-06 Thread Matt


  On Fri, 27 Oct 2023 13:47:24 +0200  alain.coch...@unistra.fr wrote --- 
 > Russell Adams writes on Thu 26 Oct 2023 16:44:
 >  > [...] are you using an SSH key to connect, or entering a password?
 >  > If you use an SSH key for passwordless access, try adding -n (ie:
 > 
 >  > "ssh -n derp@host mycommand"). 
 > 
 > Yes, I use an SSH key, and yes, '-n' saves the day.  Thanks.
 
Hi Alain,

I'm the supposed maintainer of ob-shell who's been missing in action for this 
whole discussion.

I want to confirm, are you able to accomplish your task by using '-n'?

Matt



Re: [PATCH] doc/org-manual.org: Checkboxes, add checkbox states examples

2023-11-06 Thread Bastien
Ihor Radchenko  writes:

> Bastien  writes:
>
>> I added you as a contributor on
>> https://orgmode.org/worg/contributors.html
>
> I think that you added him second time :)

Ahah, good catch!

> @@ 260,6 260,7 @@ within GNU Emacs:
> ...
> +- Slawomir Grochowski
>  - Sławomir Grochowski

I fixed this by keeping the second occurrence with "ł"...

-- 
 Bastien



Re: [PATCH] doc/org-manual.org: Checkboxes, add checkbox states examples

2023-11-06 Thread Ihor Radchenko
Bastien  writes:

> I added you as a contributor on
> https://orgmode.org/worg/contributors.html

I think that you added him second time :)

@@ 260,6 260,7 @@ within GNU Emacs:
...
+- Slawomir Grochowski
 - Sławomir Grochowski
...

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



Re: [PATCH] doc/org-manual.org: Checkboxes, add checkbox states examples

2023-11-06 Thread Bastien
Hi Sławomir,

Sławomir Grochowski  writes:

> I have added some examples to the org-manual. 
> Patch in attachment and also a screenshot of generated html.

Applied, with a minor modification, using 1. instead of 1) for the
list items.

I added you as a contributor on
https://orgmode.org/worg/contributors.html

Thanks!

-- 
 Bastien



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

2023-11-06 Thread Ihor Radchenko
Cletip Cletip  writes:

> The Issue:
> I have an Org file, test.org, from which I tangle code blocks into test.py.
> The complication arises because test.py is a symbolic link. Each time I
> perform the tangling operation, the symbolic link is unfortunately
> overwritten.
> ...
> Proposed Solution:
> I've identified a potential fix that involves a minor adjustment in the
> ob-tangle.el file:
>
> Original line (259):
>
> (let ((file-name (car by-fn)))
>
> Modified line:
>
> (let ((file-name (file-truename (car by-fn
>
> While this solution appears effective at first glance, I haven't
> extensively tested all edge cases. I would greatly appreciate your insights
> on whether this is a robust solution ^^.

Looks reasonable.
Max, do you see any pitfalls using `file-truename'?

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



[BUG] Tangle with symbolic links don't work

2023-11-06 Thread Cletip Cletip
Hello everyone,

I'm reaching out to discuss a challenge I've encountered while working with
Org-mode, specifically during the tangling process of code blocks.

The Issue:
I have an Org file, test.org, from which I tangle code blocks into test.py.
The complication arises because test.py is a symbolic link. Each time I
perform the tangling operation, the symbolic link is unfortunately
overwritten.

Interestingly, when exporting documents to formats such as .tex, .html, or
others, Org-mode respects the symbolic link, which is the desired behavior.
However, this is not the case with tangling, which is quite perplexing.

My Org mode version : 9.6.10 (9.6.10-n/a-g902975...)

Proposed Solution:
I've identified a potential fix that involves a minor adjustment in the
ob-tangle.el file:

Original line (259):

(let ((file-name (car by-fn)))

Modified line:

(let ((file-name (file-truename (car by-fn

While this solution appears effective at first glance, I haven't
extensively tested all edge cases. I would greatly appreciate your insights
on whether this is a robust solution ^^.

Thanks in advance for your answer.


how to exclude certain row values from calculation in a table

2023-11-06 Thread Uwe Brauer
Hi all

Please look at 

|   |  Price |
|---+|
| / |  10.98 |
|   |  11.90 |
|   |  19.98 |
|   |  13.79 |
|   |  29.97 |
|   |  18.98 |
|   |  13.79 |
|   |  11.90 |
|   |  24.28 |
|---+|
|   | 155.57 |
#+TBLFM: @11$2=vsum(@I$2..@II$2);f2

I would like to exclude the first value from the sum by adding some mark
in that row.

Of course, I also could use 
|   |  Price |
|---+|
| / |  10.98 |
|---+|
|   |  11.90 |
|   |  19.98 |
|   |  13.79 |
|   |  29.97 |
|   |  18.98 |
|   |  13.79 |
|   |  11.90 |
|   |  24.28 |
|---+|
|   | 144.59 |
#+TBLFM: @11$2=vsum(@II$2..@III$2);f2

But suppose the value I'd like to exclude would be 29.97, then I would
need some reordering, I prefer to avoid.

Any idea how to exclude row values in a column?


Regards

Uwe Brauer 


-- 
I strongly condemn Hamas heinous atrocities on Israel, especially the 
despicable pogroms.
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the NATO membership of Ukraine.
I support the EU membership of Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/




Re: bash source code block: problem after ssh commands

2023-11-06 Thread Ihor Radchenko
Bruno Barbier  writes:

> IIUC, the elisp expression:
>
> (process-file "bash" "/tmp/test.sh")
>
> is more equivalent to:
>
> cat /tmp/test.sh | bash
>
> i.e. the shell is getting the commands from stdin.  Thus, any command
> that uses stdin might change what gets executed or not.

Looking at `org-babel-sh-evaluate', it should be enough to specify
:shebang, :cmdline, or :stdin header argument to force using script
rather than channel source block as input to bash:

#+begin_src shell :results output :cmdline bash
exec 0>&-
echo OK
#+end_src

#+RESULTS:
: OK


#+begin_src shell :results output :cmdline bash
echo 1
read -p "Next command? " NEXT_COMMAND
echo 2
echo 3
#+end_src

#+RESULTS:
: 1
: 2
: 3

I am wondering about the possible downsides of using script approach
instead of stdin redirection.

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



Re: Org site is down

2023-11-06 Thread Bastien Guerry
Ihor Radchenko  writes:

> I just fixed a bug in 
> https://list.orgmode.org/orgmode/87bkc744ub.fsf@localhost/
> So far, it is still listed in https://tracker.orgmode.org/bugs?sorting-by=date

It's probably the Woof bug mentioned before.

Let's see if Woof can track new patches and tasks, for example.
I'll monitor this, you don't need to worry about it right now.

-- 
 Bastien Guerry



Re: Org site is down

2023-11-06 Thread Ihor Radchenko
Bastien Guerry  writes:

> Did you manage to get other bugs close? or to add tasks and patches?
> This will prove that the inbox monitoring works correctly.

After the maintenance?
I just fixed a bug in https://list.orgmode.org/orgmode/87bkc744ub.fsf@localhost/
So far, it is still listed in https://tracker.orgmode.org/bugs?sorting-by=date

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



Re: Exporting Hyperlinks ?

2023-11-06 Thread Ihor Radchenko
David Masterson  writes:

>>> [[file:test.pdf::#anchor][Another document]]
>>>-> \href{test.pdf\#anchor}{Another document}
>>
>> AFAIK, this kind of URL cannot be opened except when opening pdf in
>> browser.
>
> What else is there?  PDFviewer?  What is the standard for Latex?

Yes, PDFviewer.
AFAIU, it is only possible to refer to a specific page:
\href[page=X]{test.pdf}
https://tex.stackexchange.com/questions/675130/open-an-external-pdf-file-on-a-specific-page

>>> [[file:test.org::#anchor][Another document]]
>>> Either for xr-hyper
>>>   -> Another document \ref{f1-orgabc123}
>>> with \label{orgabc123} in test.tex
>>> or with redefined \label to generate additional \hypertarget
>>>   -> \href{test.pdf\#anchor}{Another document}
>>
>> And this does not fit into single-document exports. We must export
>> multiple files via ox-publish. ...and ox-publish does not support pdf
>> export.
>
> org-latex-publish-to-pdf ??  Oh, you mean that it has to go through
> Latex to get to PDF. 

I mean that ox-publish is mostly polished for html publishing.
While it is technically possible to publish with other export backends,
I expect many rough edges there.

In particular, `org-latex-publish-to-pdf' in ox-latex has no special
arrangement to support pdf cross-references. There is even no conversion
from .org references to .pdf references as .org -> .html in ox-html.

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



Re: Org site is down

2023-11-06 Thread Bastien Guerry
Ihor Radchenko  writes:

>> It should be back now, please report any problem you may notice.
>
> There are still issues with some bugs not being closed despite my emails
> containing the trigger keywords. However, it looks similar to
> https://lists.sr.ht/~bzg/woof/%3C87ilhjiw7g.fsf%40localhost%3E, so I
> assume that I just need to wait until the problem is solved.

Yes, this is probably the error.

Did you manage to get other bugs close? or to add tasks and patches?
This will prove that the inbox monitoring works correctly.

-- 
 Bastien Guerry



Re: Org site is down

2023-11-06 Thread Ihor Radchenko
Bastien Guerry  writes:

> Bastien  writes:
>
>> https://tracker.orgmode.org is back too but tracking new emails will
>> not work for the next two hours or so.  I'll confirm when it's back.
>
> It should be back now, please report any problem you may notice.

There are still issues with some bugs not being closed despite my emails
containing the trigger keywords. However, it looks similar to
https://lists.sr.ht/~bzg/woof/%3C87ilhjiw7g.fsf%40localhost%3E, so I
assume that I just need to wait until the problem is solved.

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



Re: [BUG] org-comment-dwim does not work with temporary Transient Mark mode [9.7-pre (release_9.6.10-902-g41ff56 @ /home/jschmidt/work/org-mode/lisp/)]

2023-11-06 Thread Ihor Radchenko
Jens Schmidt  writes:

> * Reproducer
> ...
> where I would have expected:
>
> - /tmp/test.org -
> #+begin_src bash
>   # foo
>   # bar
>   # baz(point)
> #+end_src
> - /tmp/test.org -

Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=101429634
Thanks for reporting!

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