Re: [BUG] ob-gnuplot.el can't handle importing more than one table from the current file [9.6.1 ( @ /home/thomas/.emacs.d/elpa/org-9.6.1/)]

2023-03-29 Thread Ihor Radchenko
Ihor Radchenko  writes:

> One possibility is hash collision in `org-babel-temp-stable-file'.
> Something similar to https://debbugs.gnu.org/cgi/bugreport.cgi?bug=56255
>
> I will see if I can implement collision-free hashing to work around the
> limitations of sxhash.

Done, on main.
Fixed.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=88f7bea16

Emacs devs showed no interest in collision-free hashes, so I implemented
this in our org-macs library.

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



Re: [BUG] ob-gnuplot.el can't handle importing more than one table from the current file [9.6.1 ( @ /home/thomas/.emacs.d/elpa/org-9.6.1/)]

2023-02-09 Thread Ihor Radchenko
Thomas Worthington  writes:

> I can't replicate now. It was about four weeks ago I tripped over 
> this and I absolutely saw it in action repeatedly - I could see 
> gnuplot loading the same file in its process buffer, and only one 
> file being created on-disc too.

One possibility is hash collision in `org-babel-temp-stable-file'.
Something similar to https://debbugs.gnu.org/cgi/bugreport.cgi?bug=56255

I will see if I can implement collision-free hashing to work around the
limitations of sxhash.

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



Re: [BUG] ob-gnuplot.el can't handle importing more than one table from the current file [9.6.1 ( @ /home/thomas/.emacs.d/elpa/org-9.6.1/)]

2023-02-08 Thread Thomas Worthington
Well, bloody hell.

I can't replicate now. It was about four weeks ago I tripped over 
this and I absolutely saw it in action repeatedly - I could see 
gnuplot loading the same file in its process buffer, and only one 
file being created on-disc too.

Maybe I updated org since then, but I didn't think so.

Sorry to have wasted your time. If it comes back I'll let you 
know.

Computers! Who'd have 'em?

Thomas


On Wed, Feb 08 2023, Ihor Radchenko wrote:

> Thomas Worthington  writes:
>
>> org-babel-gnuplot-process-vars in ob-gnuplot.el makes a 
>> temporary file to store a table imported from the current org 
>> file using :var
>>
>> However, the name of this file does not include the name of the
>> variable or any similar field unique to the data. This means 
>> that if
>> you want to plot data from two tables, they both get the same
>> filename and consequently the second overwrites the first and 
>> the
>> data is incorrect.
>
> May you provide an example of such problem?
>
> I just tried
>
> #+name: table1
> | 1 | 1 |
>
> | 2 | 2 |
> | 3 | 3 |
> | 4 | 4 |
> | 5 | 5 |
>
> #+name: table2
> | 1 | -1 |
>
> | 2 | -2 |
> | 3 | -3 |
> | 4 | -4 |
> | 5 | -5 |
>
> #+begin_src gnuplot :var x=table1 y=table2 :cache no
> plot x, y w l
> #+end_src
>
> And both the tables are correctly plotted.



Re: [BUG] ob-gnuplot.el can't handle importing more than one table from the current file [9.6.1 ( @ /home/thomas/.emacs.d/elpa/org-9.6.1/)]

2023-02-08 Thread Ihor Radchenko
Thomas Worthington  writes:

> org-babel-gnuplot-process-vars in ob-gnuplot.el makes a temporary file to 
> store a table imported from the current org file using :var
>
> However, the name of this file does not include the name of the variable or 
> any similar field unique to the data. This means that if you want to plot 
> data from two tables, they both get the same filename and consequently the 
> second overwrites the first and the data is incorrect.

May you provide an example of such problem?

I just tried

#+name: table1
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 | 4 |
| 5 | 5 |
#+name: table2
| 1 | -1 |
| 2 | -2 |
| 3 | -3 |
| 4 | -4 |
| 5 | -5 |

#+begin_src gnuplot :var x=table1 y=table2 :cache no
plot x, y w l
#+end_src

And both the tables are correctly plotted.

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



[BUG] ob-gnuplot.el can't handle importing more than one table from the current file [9.6.1 ( @ /home/thomas/.emacs.d/elpa/org-9.6.1/)]

2023-02-08 Thread Thomas Worthington
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 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, 
cairo version 1.16.0) of 2022-01-24, modified by Debian Package: Org mode 
version 9.6.1 ( @ home/thomas.emacs.d/elpa/org-9.6.1/)

current state:  (setq org-duration-format ’h:mm org-src-mode-hook 
’(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) 
org-after-todo-state-change-hook ’(org-clock-out-if-current) 
org-ctrl-c-ctrl-c-final-hook ’(org-msg-ctrl-c-ctrl-c) 
org-link-shell-confirm-function ’yes-or-no-p org-blank-before-new-entry 
’((heading) (plain-list-item)) org-babel-after-execute-hook 
’(org-display-inline-images) org-metadown-hook 
’(org-babel-pop-to-session-maybe) org-export-with-sub-superscripts nil 
org-refile-targets ’((org-agenda-files :maxlevel . 4)) 
org-html-format-inlinetask-function 
’org-html-format-inlinetask-default-function org-enforce-todo-dependencies t 
org-odt-format-headline-function ’org-odt-format-headline-default-function 
org-persist-before-write-hook ’(org-element–cache-persist-before-write) 
org-agenda-files ’(“home/thomas/orgfiles/worktime.org“ 
”/home/thomas/orgfiles/meetings.org“ ”/home/thomas/orgfiles/todo.org“ 
”/home/thomas/orgfiles/reminders.org“) org-ascii-format-inlinetask-function 
‘org-ascii-format-inlinetask-default org-odt-fontify-srcblocks nil 
org-plantuml-jar-path ”/usr/share/plantuml/plantuml.jar“ org-blocker-hook 
’(org-block-todo-from-children-or-siblings-or-parent 
org-block-todo-from-checkboxes) org-archive-location ”%s.archive::“ 
org-odt-preferred-output-format ”pdf“ org-mode-hook ’(#[0 ”\301\211.\207“ 
[imenu-create-index-function org-imenu-get-tree] 2] my-org-mode-config 
org-tempo-setup ws-butler-mode turn-on-visual-line-mode 
er/add-org-mode-expansions #[0 ”\300\301\302\303\304$\207“ [add-hook 
change-major-mode-hook org-show-block-all append local] 5 ”\n\n(fn)“] #[0 
”\300\301\302\303\304$\207“ [add-hook change-major-mode-hook 
org-babel-show-result-all append local] 5 ”\n\n(fn)“] 
org-babel-result-hide-spec org-babel-hide-all-hashes) 
org-export-with-smart-quotes t org-odt-format-drawer-function #[514 ”\207“ [] 3 
”\n\n(fn NAME CONTENTS)“] org-archive-hook ’(org-attach-archive-delete-maybe) 
org-persist-before-read-hook ’(org-element–cache-persist-before-read) 
org-confirm-elisp-link-function ‘yes-or-no-p org-agenda-before-write-hook 
’(org-agenda-add-entry-text) org-metaup-hook ’(org-babel-load-in-session-maybe) 
org-persist-after-read-hook ’(org-element–cache-persist-after-read) 
org-bibtex-headline-format-function #[257 ”\300.\236A\207“ [:title] 3 ”\n\n(fn 
ENTRY)“] org-latex-format-drawer-function #[514 ”\207“ [] 3 ”\n\n(fn _ 
CONTENTS)“] org-babel-pre-tangle-hook ’(save-buffer) org-tab-first-hook 
’(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) 
org-babel-load-languages ’((ditaa \.t) (dot . t) (forth \.t) (java . t) (js . 
t) (gnuplot . t) (octave . t) (perl . t) (php \.t) (plantuml . t) (R . t) (ruby 
. t) (sed . t) (shell . t) (sql . t) (sqlite . t)) org-log-done ‘time 
org-link-abbrev-alist ’((”piv“ . ”%(make-piv-link)“)) 
org-ascii-format-drawer-function #[771 ”.\207“ [] 4 ”\n\n(fn NAME CONTENTS 
WIDTH)“] org-msg-mode t org-cycle-tab-first-hook 
’(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) 
org-agenda-span ‘fortnight org-agenda-loop-over-headlines-in-active-region nil 
org-src-lang-modes ’((”php“ . php) (”ocaml“ . tuareg) (”elisp“ . emacs-lisp) 
(”ditaa“ . artist) (”asymptote“ . asy) (”dot“ . graphviz-dot) (”sqlite“ . sql) 
(”calc“ . fundamental) (”C“ . c) (”cpp“ . c++) (”C++“ . c++) (”screen“ . 
shell-script) (”shell“ . sh) (”bash“ . sh)) org-msg-greeting-fmt ”\nHi %s,\n\n“ 
org-agenda-prefix-format ’((agenda . ” %i %-12:c%?-12t% s %b“) (timeline . ” % 
s“) (todo . ” %i %-12:c %b“) (tags . ” %i %-12:c“) (search . ” %i %-12:c“)) 
org-fold-core-isearch-open-function ‘org-fold-core–isearch-reveal 
org-occur-hook ’(org-first-headline-recenter) org-cycle-separator-lines 1 
org-enforce-todo-checkbox-dependencies t org-agenda-include-diary t 
org-structure-template-alist ’((”n“ . ”notes“) (”a“ . ”export ascii“) (”c“ . 
”center“) (”C“ . ”comment“) (”e“ . ”example“) (”E“ . ”export“) (”h“ . ”export 
html“) (”l“ . ”export latex“) (”q“ . ”quote“) (”s“ . ”src“) (”v“ . ”verse“)) 
org-cycle-hook ’(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines 
org-cycle-optimize-window-after-visibility-change 
org-cycle-display-inline-images) org-todo-keywords ’((sequence ”TODO(t)“ 
”STARTED“ ”|“ ”DONE(-!)“ ”|“ ”CANCELLED(x@)“)) org-speed-command-hook 
’(org-speed-command-activate org-babel-speed-command-activate) org-msg-startup 
”hidestars indent inlineimages“ org-odt-format-inlinetask-function 
‘org-odt-format-inlineta