[BUG] Export does not read .dir-locals.el [9.7.3 (release_9.7.3 @ /usr/local/share/emacs/30.0.50/lisp/org/)]

2024-06-13 Thread Protesilaos Stavrou
Dear maintainer,

I have noticed that the export mechanism does not read the local
variables of a file when those come from a .dir-locals.el.

Steps to reproduce this:

1. Create a test directory.

2. Inside of that directory, write a .dir-locals.el file with something
   like the following:

 ;;; Directory Local Variables-*- no-byte-compile: t -*-
 ;;; For more information see (info "(emacs) Directory Variables")

 ((nil . ((testing . "hello"

3. Now create a new Org file with a code block that includes the
   variable we introduced in the previous step. For example:

  Does this export?

  #+begin_src emacs-lisp :exports results
  testing
  #+end_src

4. If you do C-c C-c on the code block, it returns the local value as
   the variable is not void. But if you try to export, you an error that
   the variable is void.

Perhaps there is some user option to let the export mechanism read those
local variables?

All the best,
Protesilaos (or simply "Prot")

* * *

Emacs  : GNU Emacs 30.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, 
cairo version 1.16.0)
 of 2024-06-11
Package: Org mode version 9.7.3 (release_9.7.3 @ 
/usr/local/share/emacs/30.0.50/lisp/org/)

-- 
Protesilaos Stavrou
https://protesilaos.com



Re: [BUG] org-export: incorrect assignment of bind keywords [9.7.3 (9.7.3-2f1844 @ /home/user/.emacs.d/elpa/org-9.7.3/)]

2024-06-13 Thread Ihor Radchenko
"Suhail Singh"  writes:

> In Org 9.7.3, the variables bound using the =#+BIND= keyword have values that
> are nested.  E.g., when a string value is provided, the value actually gets 
> set
> to a singleton list containing said string.  This can be observed using the
> snippet:
> ...
> #+RESULTS: bugs/org/9.7/bind-vars
> : #+bind: my/bug/ox/foo "foo"
> : #+bind: my/bug/ox/bar
> : 
> : #+results: 
> : : my/bug/ox/foo = '(foo)' :: cons
> : : my/bug/ox/bar = 'nil' :: symbol

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

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



org-babel-execute-src-block filters characters from :session *shell* output

2024-06-13 Thread Cook, Malcolm
Hi,

While using:

Org mode version 9.7.3 (9.7.3-2f1844 @ 
/home/mec/.dotfiles/emacs/.emacs.d/elpa/org-9.7.3/)
GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo

Let me walk you through the issue:

#+begin_src sh
printf 'a\nb\nc\n>d\nd
: d\n" before the "d"?

Let's try it again.

First kill the *shell* buffer:

#+begin_src elisp
(let ((kill-buffer-query-functions nil)) (kill-buffer "*shell*"))
#+end_src

#+RESULTS:
: t


and try it again:

#+begin_src sh
printf 'a\nb\nc\n>d\nd
: " is back!

What is going on.

I'm pretty sure that `org-babel-comint--prompt-filter` is implicated which has 
had some recent changes (https://list.orgmode.org/87ttmn9fg0.fsf@localhost/T/) 
related to prompt filtering.

Any workarounds / patches most welcome!

Thanks!

~ Malcolm




Re: [BUG] org 9.7 drag image down't make directory on Windows system [9.7.3 (release_9.7.3 @ f:/App/emacs/share/emacs/30.0.50/lisp/org/)]

2024-06-13 Thread Ihor Radchenko
ISouthRain  writes:

> Thanks you work!!
>
> Example:
> (setq org-yank-image-save-method "./myattach/")
> (setq org-yank-dnd-method 'attach)
> Filename: c:/users/abc/test.org
> No have dir: c:/users/abc/myattach/ 
> drag image down't work, no auto make directory c:/users/abc/myattach/
> Message out: Copying file: Operation not permitted, .. and more
>
> I Have dir: c:/users/abc/myattach/
> drag image is work
>
> Because I saw the function: org--image-yank-media-handler
> (when (and (not (eq org-yank-image-save-method 'attach))
>(not (file-directory-p org-yank-image-save-method)))
>   (make-directory org-yank-image-save-method t))
>
> I don't understand why the path is not created automatically??

A simple omission.
Fixed, on bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=d7b5c19da

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



Re: Missing the first and last number of the date and time in the :CREATED: field.

2024-06-13 Thread Ihor Radchenko
Sharon Kimble  writes:

> When creating a new task in my organiser file I find that this is showing up -
>
> 
> ** TODO replace the battery on the wall clock above my monitor
> SCHEDULED: <2024-06-12 Wed>
> :PROPERTIES:
> :CREATED:  [024-06-12 Wed 08:0]
> :END:
> 
>
> As you can see, its missing the first and last number of the date and time in 
> the :CREATED: field.
>   
> As far as I know its not affecting anything else.

Thanks for reporting, but may you provide mode details?
What one needs to do to replicate the problem you are seeing?
Is some kind of capture template necessary? Custom commands?

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

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



Feature request: support sessions in ob-emacs-lisp via IELM

2024-06-13 Thread Suhail Singh
IELM (M-x ielm) derives from comint-mode and provides a convenient
interactive environment for evaluating lisp expressions.  Some of the
conveniences such as automatically evaluating expressions can make
iterative development easier.

Currently, ob-emacs-lisp does not support sessions.  It would be nice if
support of sessions was added to ob-emacs-lisp such that the session
buffer is an ielm-mode buffer.

-- 
Suhail



[BUG] Trailing dash is not included in link [9.7.3 (9.7.3-2f1844 @ /home/mwillcock/.emacs.d/elpa/org-9.7.3/)]

2024-06-13 Thread Morgan Willcock



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

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

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


When web links are inserted into an org buffer, if the link ends in a
trailing dash this seems to be omitted from the link target.

i.e. Inserting "https://domain/test-; into the buffer will create a
clickable link for "https://domain/test;.

These types of links will likely be encountered for sites where anchor
targets are automatically generated from documentation headings which
are questions.

e.g. 
https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-connect-sso-faq#how-can-i-roll-over-the-kerberos-decryption-key-of-the--azureadsso--computer-account-

It seems straight-forward to verify that the trailing dash of the link
is not considered part of the link:

  (with-temp-buffer
(org-mode)
(insert "https://domain/test-;)
(goto-char (point-min))
(let ((context (org-element-context)))
  (cl-assert (eq (org-element-type context) 'link))
  (buffer-substring-no-properties
   (org-element-property :begin context)
   (org-element-property :end context

Emacs  : GNU Emacs 29.3 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo version 
1.16.0, Xaw3d scroll bars)
 of 2024-03-25
Package: Org mode version 9.7.3 (9.7.3-2f1844 @ 
/home/mwillcock/.emacs.d/elpa/org-9.7.3/)



Re: [BUG] org-plot: Unable to use text xtics with type:2d (+ more) [9.7-pre (N/A @ /home/viz/lib/emacs/straight/build/org/)]

2024-06-13 Thread Visuwesh
[வியாழன் ஜூன் 13, 2024] Visuwesh wrote:

> [புதன் ஜூன் 12, 2024] Ihor Radchenko wrote:
>
>> Visuwesh  writes:
>>
 I do not think that it is right.
 AFAIU, the idea is that `org-plot/preset-plot-types' provides some
 default options, but the user can overwrite these defaults in the #+PLOT
 line. What you propose will disregard the values of

  :set :line :map :title :file :ind :timeind :timefmt :textind
  :deps :labels :xlabels :ylabels :xmin :xmax :ymin :ymax :ticks

 if they are customized by user in `org-plot/preset-plot-types'.
>>>
>>> I don't follow your conclusion since this change will only affect the
>>> value of :check-ind-type leaving the rest of the settings unaffected.
>>
>> My point is that we will eventually need to merge TYPE and PARAMS to
>> fix another bug - `org-plot/preset-plot-types' options like :set, :line,
>> etc being ignored. So, instead of patching the way you proposed, we can
>> merge TYPE and PARAMS into PARAMS, making the existing (plist-get params
>> :check-ind-type) working.
>>
>> In other words, org-plot's handling of parameters is very broken
>> now. There is more than one bug lurking there, and it may be more
>> productive to fix things together.
>>
>> You solution will, of course, work, but only for this specific bug you
>> described; not for other.
>
> OK, thanks for the explanation.  I was unaware of the issue as I didn't
> read the code closely enough.  What about the attached patch?

Sorry for the noise, I copied the wrong link in the commit message.
Please see attached instead.

>From 2a153a5bc015b0e970ecde39fd2edbb515261349 Mon Sep 17 00:00:00 2001
From: Visuwesh 
Date: Thu, 13 Jun 2024 12:33:49 +0530
Subject: [PATCH] org-plot: Respect parameters given in
 `org-plot/preset-plot-types'

* lisp/org-plot.el (org-plot/preset-plot-types): Fix docstring and
correct the lambda argument order for the 'grid' plot type.
(org-plot/gnuplot): Merge the parameters given in
`org-plot/preset-plot-types' and the #+PLOT line to ensure the former
is respected everywhere.

Reported-by: Visuwesh 
Link: https://orgmode.org/list/87cypbjw50@gmail.com
---
 lisp/org-plot.el | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lisp/org-plot.el b/lisp/org-plot.el
index 283d993..6d53830 100644
--- a/lisp/org-plot.el
+++ b/lisp/org-plot.el
@@ -349,7 +349,7 @@ (defcustom org-plot/preset-plot-types
 (grid :plot-cmd "splot"
 	  :plot-pre (lambda (_table _data-file _num-cols params _plot-str)
 		  (if (plist-get params :map) "set pm3d map" "set map"))
-	  :data-dump (lambda (table data-file params _num-cols)
+	  :data-dump (lambda (table data-file _num-cols params)
 		   (let ((y-labels (org-plot/gnuplot-to-grid-data
 	table data-file params)))
 			 (when y-labels (plist-put params :ylabels y-labels
@@ -391,8 +391,8 @@ (defcustom org-plot/preset-plot-types
 - :data-dump - Function to dump the table to a datafile for ease of
   use.

-  Accepts lambda function.  Default lambda body:
-  (org-plot/gnuplot-to-data table data-file params)
+  Accepts lambda function with arguments:
+  (table data-file num-cols params)

 - :plot-pre - Gnuplot code to be inserted early into the script, just
   after term and output have been set.
@@ -679,8 +679,8 @@ (defun org-plot/gnuplot ( params)
 		tbl))
 	   (num-cols (length (if (eq (nth 0 table) 'hline) (nth 1 table)
 			   (nth 0 table
-	   (type (assoc (plist-get params :plot-type)
-			org-plot/preset-plot-types))
+	   (type (cdr (assoc (plist-get params :plot-type)
+			 org-plot/preset-plot-types)))
gnuplot-script)

   (unless type
@@ -695,6 +695,7 @@ (defun org-plot/gnuplot ( params)
   (save-excursion (while (and (equal 0 (forward-line -1))
   (looking-at "[[:space:]]*#\\+"))
 			(setf params (org-plot/collect-options params
+  (setq params (org-combine-plists type params))
   ;; Dump table to datafile
   (let ((dump-func (plist-get type :data-dump)))
 (if dump-func
--
2.43.0


Re: [BUG] org-plot: Unable to use text xtics with type:2d (+ more) [9.7-pre (N/A @ /home/viz/lib/emacs/straight/build/org/)]

2024-06-13 Thread Visuwesh
[புதன் ஜூன் 12, 2024] Ihor Radchenko wrote:

> Visuwesh  writes:
>
>>> I do not think that it is right.
>>> AFAIU, the idea is that `org-plot/preset-plot-types' provides some
>>> default options, but the user can overwrite these defaults in the #+PLOT
>>> line. What you propose will disregard the values of
>>>
>>>  :set :line :map :title :file :ind :timeind :timefmt :textind
>>>  :deps :labels :xlabels :ylabels :xmin :xmax :ymin :ymax :ticks
>>>
>>> if they are customized by user in `org-plot/preset-plot-types'.
>>
>> I don't follow your conclusion since this change will only affect the
>> value of :check-ind-type leaving the rest of the settings unaffected.
>
> My point is that we will eventually need to merge TYPE and PARAMS to
> fix another bug - `org-plot/preset-plot-types' options like :set, :line,
> etc being ignored. So, instead of patching the way you proposed, we can
> merge TYPE and PARAMS into PARAMS, making the existing (plist-get params
> :check-ind-type) working.
>
> In other words, org-plot's handling of parameters is very broken
> now. There is more than one bug lurking there, and it may be more
> productive to fix things together.
>
> You solution will, of course, work, but only for this specific bug you
> described; not for other.

OK, thanks for the explanation.  I was unaware of the issue as I didn't
read the code closely enough.  What about the attached patch?

>From 2a153a5bc015b0e970ecde39fd2edbb515261349 Mon Sep 17 00:00:00 2001
From: Visuwesh 
Date: Thu, 13 Jun 2024 12:33:49 +0530
Subject: [PATCH] org-plot: Respect parameters given in
 `org-plot/preset-plot-types'

* lisp/org-plot.el (org-plot/preset-plot-types): Fix docstring and
correct the lambda argument order for the 'grid' plot type.
(org-plot/gnuplot): Merge the parameters given in
`org-plot/preset-plot-types' and the #+PLOT line to ensure the former
is respected everywhere.

Reported-by: Visuwesh 
Link: https://orgmode.org/list/87edbu4kdh@gmail.com
---
 lisp/org-plot.el | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lisp/org-plot.el b/lisp/org-plot.el
index 283d993..6d53830 100644
--- a/lisp/org-plot.el
+++ b/lisp/org-plot.el
@@ -349,7 +349,7 @@ (defcustom org-plot/preset-plot-types
 (grid :plot-cmd "splot"
 	  :plot-pre (lambda (_table _data-file _num-cols params _plot-str)
 		  (if (plist-get params :map) "set pm3d map" "set map"))
-	  :data-dump (lambda (table data-file params _num-cols)
+	  :data-dump (lambda (table data-file _num-cols params)
 		   (let ((y-labels (org-plot/gnuplot-to-grid-data
 	table data-file params)))
 			 (when y-labels (plist-put params :ylabels y-labels
@@ -391,8 +391,8 @@ (defcustom org-plot/preset-plot-types
 - :data-dump - Function to dump the table to a datafile for ease of
   use.
 
-  Accepts lambda function.  Default lambda body:
-  (org-plot/gnuplot-to-data table data-file params)
+  Accepts lambda function with arguments:
+  (table data-file num-cols params)
 
 - :plot-pre - Gnuplot code to be inserted early into the script, just
   after term and output have been set.
@@ -679,8 +679,8 @@ (defun org-plot/gnuplot ( params)
 		tbl))
 	   (num-cols (length (if (eq (nth 0 table) 'hline) (nth 1 table)
 			   (nth 0 table
-	   (type (assoc (plist-get params :plot-type)
-			org-plot/preset-plot-types))
+	   (type (cdr (assoc (plist-get params :plot-type)
+			 org-plot/preset-plot-types)))
gnuplot-script)
 
   (unless type
@@ -695,6 +695,7 @@ (defun org-plot/gnuplot ( params)
   (save-excursion (while (and (equal 0 (forward-line -1))
   (looking-at "[[:space:]]*#\\+"))
 			(setf params (org-plot/collect-options params
+  (setq params (org-combine-plists type params))
   ;; Dump table to datafile
   (let ((dump-func (plist-get type :data-dump)))
 (if dump-func
-- 
2.43.0



Re: [BUG/FR] org-plot: replot on resize [9.7-pre (N/A @ /home/viz/lib/emacs/straight/build/org/)]

2024-06-13 Thread Visuwesh
[செவ்வாய் ஜூன் 04, 2024] Ihor Radchenko wrote:

> Visuwesh  writes:
>
>> This is more of a FR than a bug but it would be nice to have working
>> replot-on-resize when the gnuplot terminal is qt, x11, etc.  To have
>> this functional, the data-file needs to be not deleted.
>
> It should be doable.
> We can simply use `org-babel-temp-stable-file' and leave cleaning up to
> `org-babel-remove-temporary-stable-directory'.

The data writing functions themselves require a filename so the file
content cannot be used as DATA to org-babel-temp-stable-file.  What
should be DATA instead? (list table params)?