Re: Passing table to Ruby session

2023-08-09 Thread Mike Gauland

On 10/08/23 09:24, Mike Gauland wrote:
Just to follow up on my problem sending a table to ruby. It doesn't' 
seem to be an org problem, but with inf-ruby.


I copied the ruby code that org generates to set the variable, and 
pasted it in to an inf-ruby session, and that works fine.


However, when I select it as a region, and do "ruby-send-region", 
inf-ruby complains about an "unexpected end-of-input".


As long as the code to set the variable is under 4k, it works. When 
it's longer than that,  process-send-region sends it in pieces, and 
inf-ruby is apparently prematurely interpreting the incomplete code.


I'll take this up elsewhere, though if anyone here has suggestions for 
me, or wants further updates, let me know.


Kind regards,

Mike

Just a final note in case any one else has runs into the same problem. I 
got the same results with jruby, but "pry" handles my file without 
complaint.






Re: ox-html: no tests, besides mathjax?

2023-08-09 Thread Rudolf Adamkovič
Ihor Radchenko  writes:

> We had no tests at all and then added some alongside with the MathJax
> 3 support.

Hello there. :)

/waves hands/

Rudy
-- 
"It is no paradox to say that in our most theoretical moods we may be
nearest to our most practical applications."
-- Alfred North Whitehead, 1861-1947

Rudolf Adamkovič  [he/him]
Studenohorská 25
84103 Bratislava
Slovakia



Re: Or probably just fix the org-ctags hook functions? (was: Should we accept breaking changes ...)

2023-08-09 Thread Jens Schmidt

On 2023-08-08  10:48, Ihor Radchenko wrote:


The situation is a bit more complex.


To make it even more complex, here a different point of view.  Sorry,
I don't have any earlier mails ready I could reply to ...

* TL;DR

Probably the problem is not the side-effects done by loading
=org-ctags=, but rather that these hook function from =org-ctags= try
to do their job when the environment is not really ready for them,
i.e. when there is no known tag file around.

* Full Story

I tried to get this thing running.  Some issues and observations I
came across:

1. When I execute function `org-ctags-create-tags' in file
   =org-manual.org= of Org =main=, an empty =TAGS= file gets created.
   Presumably because the asterisk in the generated command line is
   quoted and the warning generated by that (=cannot open source file
   "/home/jschmidt/work/org-mode/doc/*"=) is not shown in Emacs:

   #+begin_example
 ctags-exuberant --langdef=orgmode --langmap=orgmode:.org \
   --regex-orgmode="/<<([^>]+)>>/\1/d,definition/" \
   -f "/home/jschmidt/work/org-mode/doc/TAGS" -e -R \
   "/home/jschmidt/work/org-mode/doc/*"
  ^^^^^^
   #+end_example

   If I execute the statement on the command line w/o the quotes on
   the final parameter, I get a non-empty =TAGS= file.

   Besides that, I somehow doubt that =-R .../*= (=-R= meaning
   recursive operation) makes actually sense, this probably should be
   just =-R ...= instead.

   Besides *that* the following sexps from the function look fishy:

   #+begin_src emacs-lisp
 (expand-file-name (concat dir-name "/TAGS"))
 (expand-file-name (concat dir-name "/*"))
   #+end_src

   Why not =(expand-file-name "TAGS" dir-name)=?

2. When one looks at the =TAGS= file generated thus, one immediately
   notices that the regular expression from parameter
   =--regex-orgmode= used to match these <> matches also
   non-targets, like in the following example section:

 #+begin_example
   1. one item
   2. <>another item
   Here we refer to item [[target]].
 #+end_example

   But that is probably intentional or not avoidable.  Probably these
   are even valid Org targets?

Ok, that was more or less cheap criticism.  Or a bug report?  Anyway,
what is more interesting is:

3. When one later visits =org-manual.org=,\\
   and there is a =TAGS= file in that directory,\\
   and =org-ctags= previously has been loaded, then,\\
   by virtue of the following snippet from =org-ctags.el=:

   #+begin_src emacs-lisp
 (add-hook 'org-mode-hook
  (lambda ()
(when (and org-ctags-enabled-p
   (buffer-file-name))
  ;; Make sure this file's directory is added to default
  ;; directories in which to search for tags.
  (let ((tags-filename
 (expand-file-name
  (concat (file-name-directory (buffer-file-name))
  "/TAGS"
(when (file-exists-p tags-filename)
  (visit-tags-table tags-filename))
   #+end_src

   that =TAGS= file gets automatically visited, meaning that future
   tag look-ups with =C-c C-o= do not ask about any tag files to load.

   (Yes, there is again that funny =(expand-file-name (concat ...))=
   pattern used above.)

4. From that and also from the header documentation:

   #+begin_example
 ;; When you click on a link "[[foo]]" and org cannot find a
 ;; matching "<>" in the current buffer, the tags
 ;; facility will take over.  The file TAGS in the active
  ^^^
 ;; directory is examined to see if the
^
 ;; tags facility knows about "<>" in any other files.
 ;; If it does, the matching file will be opened and the
 ;; cursor will jump to the position of "<>" in that
 ;; file.
   #+end_example

   I conclude that the whole =org-ctags= functionality is based on the
   assumption that a =TAGS= file lives in the working directory of the
   currently visited Org mode file.  Why not test for that condition
   in the hook functions:

   #+begin_src emacs-lisp
 org-ctags-find-tag
 org-ctags-ask-rebuild-tags-file-then-find-tag
 org-ctags-rebuild-tags-file-then-find-tag
 org-ctags-ask-append-topic
 org-ctags-append-topic
 org-ctags-ask-visit-buffer-or-file
 org-ctags-visit-buffer-or-file
 org-ctags-fail-silently
   #+end_src

   in some way or other, probably also testing variable
   =tags-file-name=, and just skip their execution returning =nil=, if
   the environment does not seem to be ready for a tag search.  Then
   regular link operation would kick in.

Of course, that is all based on educated guesses and ad-hoc poking in
the code, not on long-term usage.  Is there a known user of
=org-ctags= who one could ask?

I think the number of people using =org-ctags= is much smaller than
the number of people not using

Re: [PATCH 2/2] test-ox-html: postamble format

2023-08-09 Thread Hraban Luyat
XD forgot the attachment

On 8/9/23 4:50 PM, Hraban Luyat wrote:
> Another test for ox-html, this time for postamble options handling. 
> It's quite tricky, apparently.
>
>
> Hraban
>From c054e5d3e9a0813da7c8e269fdfc9ae98c322aa9 Mon Sep 17 00:00:00 2001
From: Hraban Luyat 
Date: Wed, 9 Aug 2023 16:43:38 -0400
Subject: [PATCH 2/2] test-ox-html: postamble format

---
 testing/lisp/test-ox-html.el | 110 +++
 1 file changed, 110 insertions(+)

diff --git a/testing/lisp/test-ox-html.el b/testing/lisp/test-ox-html.el
index 76329951b..03c80e5bf 100644
--- a/testing/lisp/test-ox-html.el
+++ b/testing/lisp/test-ox-html.el
@@ -883,5 +883,115 @@ $x$"
 (with-current-buffer export-buffer
   (libxml-parse-xml-region)))
 
+
+
+;;; Postamble Format
+
+(ert-deftest ox-html/postamble-default ()
+  "Test default postamble"
+  (org-test-with-temp-text "Test, hi"
+(let ((export-buffer "*Test HTML Export*")
+  (org-export-show-temporary-export-buffer nil))
+  (org-export-to-buffer 'html export-buffer
+nil nil nil nil nil)
+  (with-current-buffer export-buffer
+(should (= 1 (how-many "Validate")))
+(should (= 1 (how-many "Created: ")))
+
+
+(ert-deftest ox-html/postamble-custom ()
+  "Test custom postamble"
+  (org-test-with-temp-text "Test, hi"
+(let ((export-buffer "*Test HTML Export*")
+  (org-export-show-temporary-export-buffer nil))
+  (org-export-to-buffer 'html export-buffer
+nil nil nil nil '(:html-postamble "Foobar"))
+  (with-current-buffer export-buffer
+(should (= 0 (how-many "Validate")))
+(should (= 0 (how-many "Created: ")))
+(should (= 1 (how-many "Foobar")))
+
+(ert-deftest ox-html/postamble-custom-format ()
+  "Test a html-postamble option (not -format) containing a format string"
+  (org-test-with-temp-text "Test, hi"
+(let ((export-buffer "*Test HTML Export*")
+  (org-export-show-temporary-export-buffer nil))
+  (org-export-to-buffer 'html export-buffer
+nil nil nil nil '(:html-postamble "Author=%a"
+  :author "Madame Orange"))
+  (with-current-buffer export-buffer
+(should (= 0 (how-many "Validate")))
+(should (= 0 (how-many "Created: ")))
+(should (= 1 (how-many "Author=Madame Orange")))
+
+(ert-deftest ox-html/postamble-none ()
+  "Test no postamble"
+  (org-test-with-temp-text "Test, hi"
+(let ((export-buffer "*Test HTML Export*")
+  (org-export-show-temporary-export-buffer nil))
+  (org-export-to-buffer 'html export-buffer
+nil nil nil nil '(:html-postamble nil))
+  (with-current-buffer export-buffer
+(should (= 0 (how-many "Validate")))
+(should (= 0 (how-many "Created: ")))
+
+(ert-deftest ox-html/postamble-format-wrong-config ()
+  "Test a html-postamble-format option, with incomplete config.
+
+This option is only picked up when html-postamble is set to
+T. This test leaves it unset, which means it is set to 'auto,
+which will make ox-html skip the html-postamble-format option
+entirely."
+  (org-test-with-temp-text "Test, hi"
+(let ((export-buffer "*Test HTML Export*")
+  (org-export-show-temporary-export-buffer nil))
+  (org-export-to-buffer 'html export-buffer
+nil nil nil nil '(:html-postamble-format (("en" "Foobar"
+  (with-current-buffer export-buffer
+(should (= 1 (how-many "Validate")))
+(should (= 1 (how-many "Created: ")))
+(should (= 0 (how-many "Foobar")))
+
+(ert-deftest ox-html/postamble-format-proper-config ()
+  "Test a html-postamble-format option which is just a string"
+  (org-test-with-temp-text "Test, hi"
+(let ((export-buffer "*Test HTML Export*")
+  (org-export-show-temporary-export-buffer nil))
+  (org-export-to-buffer 'html export-buffer
+nil nil nil nil '(:html-postamble-format (("en" "Foobar"))
+  :html-postamble t))
+  (with-current-buffer export-buffer
+(should (= 0 (how-many "Validate")))
+(should (= 0 (how-many "Created: ")))
+(should (= 1 (how-many "Foobar")))
+
+(ert-deftest ox-html/postamble-format-conflict ()
+  "Test conflicting postamble and postamble-format configs"
+  (org-test-with-temp-text "Test, hi"
+(let ((export-buffer "*Test HTML Export*")
+  (org-export-show-temporary-export-buffer nil))
+  (org-export-to-buffer 'html export-buffer
+nil nil nil nil '(:html-postamble-format "The format string"
+  :html-postamble "Regular postamble"))
+  (with-current-buffer export-buffer
+(should (= 0 (how-many "Validate")))
+(should (= 0 (how-many "Created: ")))
+(should (= 0 (how-many "The format string")))
+(should (= 1 (how-many "Regular postamble")))
+
+(ert-deftest ox-html/postamble-format-author ()
+  "Test a html-postamble-format option containing the author"
+

Re: Passing table to Ruby session

2023-08-09 Thread Mike Gauland
Just to follow up on my problem sending a table to ruby. It doesn't' 
seem to be an org problem, but with inf-ruby.


I copied the ruby code that org generates to set the variable, and 
pasted it in to an inf-ruby session, and that works fine.


However, when I select it as a region, and do "ruby-send-region", 
inf-ruby complains about an "unexpected end-of-input".


As long as the code to set the variable is under 4k, it works. When it's 
longer than that,  process-send-region sends it in pieces, and inf-ruby 
is apparently prematurely interpreting the incomplete code.


I'll take this up elsewhere, though if anyone here has suggestions for 
me, or wants further updates, let me know.


Kind regards,

Mike




[PATCH 2/2] test-ox-html: postamble format

2023-08-09 Thread Hraban Luyat
Another test for ox-html, this time for postamble options handling. It's 
quite tricky, apparently.


Hraban





[PATCH 1/2] test-ox-html: checkboxes: ascii, html & unicode

2023-08-09 Thread Hraban Luyat
Hi all,


I've added some minor unit tests for checkboxes in ox-html. I was 
playing around with something I thought was a bug, which turned out to 
be my project config. Thought I'd share the unit tests anyway, maybe 
this can help someone down the line create more patches.
From f9a343cc23bd5e99346797dd5e1cf4d1c661a605 Mon Sep 17 00:00:00 2001
From: Hraban Luyat 
Date: Wed, 9 Aug 2023 14:09:18 -0400
Subject: [PATCH 1/2] test-ox-html: checkboxes: ascii, html & unicode

---
 testing/lisp/test-ox-html.el | 69 
 1 file changed, 69 insertions(+)

diff --git a/testing/lisp/test-ox-html.el b/testing/lisp/test-ox-html.el
index e1b492733..76329951b 100644
--- a/testing/lisp/test-ox-html.el
+++ b/testing/lisp/test-ox-html.el
@@ -814,5 +814,74 @@ $x$"
nil nil nil nil nil
#'html-mode
 
+
+;;; Rendering checkboxes
+
+(ert-deftest ox-html/checkbox-ascii ()
+  "Test ascii checkbox rendering"
+  (should
+   (equal
+`(ul ((class . "org-ul"))
+ (li ((class . "off"))
+ (code nil ,(format "[%c]" (char-from-name "NO-BREAK SPACE"))) " 
not yet")
+ (li ((class . "on"))
+ (code nil "[X]") " I am done")
+ (li ((class . "trans"))
+ (code nil "[-]") " unclear"))
+(org-test-with-temp-text "
+- [ ] not yet
+- [X] I am done
+- [-] unclear
+"
+  (let ((export-buffer "*Test HTML Export*")
+(org-export-show-temporary-export-buffer nil))
+(org-export-to-buffer 'html export-buffer
+  nil nil nil t nil)
+(with-current-buffer export-buffer
+  (libxml-parse-xml-region)))
+
+(ert-deftest ox-html/checkbox-html ()
+  "Test HTML checkbox rendering"
+  (should
+   (equal
+'(ul ((class . "org-ul"))
+ (li ((class . "off"))
+ (input ((type . "checkbox"))) " not yet")
+ (li ((class . "on"))
+ (input ((type . "checkbox") (checked . "checked"))) " I am done")
+ (li ((class . "trans"))
+ (input ((type . "checkbox"))) " unclear"))
+(org-test-with-temp-text "
+- [ ] not yet
+- [X] I am done
+- [-] unclear
+"
+  (let ((export-buffer "*Test HTML Export*")
+(org-export-show-temporary-export-buffer nil))
+(org-export-to-buffer 'html export-buffer
+  nil nil nil t '(:html-checkbox-type html))
+(with-current-buffer export-buffer
+  (libxml-parse-xml-region)))
+
+(ert-deftest ox-html/checkbox-unicode ()
+  "Test HTML checkbox rendering"
+  (should
+   (equal
+'(ul ((class . "org-ul"))
+ (li ((class . "off")) "☐ not yet")
+ (li ((class . "on")) "☑ I am done")
+ (li ((class . "trans")) "☐ unclear"))
+(org-test-with-temp-text "
+- [ ] not yet
+- [X] I am done
+- [-] unclear
+"
+  (let ((export-buffer "*Test HTML Export*")
+(org-export-show-temporary-export-buffer nil))
+(org-export-to-buffer 'html export-buffer
+  nil nil nil t '(:html-checkbox-type unicode))
+(with-current-buffer export-buffer
+  (libxml-parse-xml-region)))
+
 (provide 'test-ox-html)
 ;;; test-ox-html.el ends here
-- 
2.41.0



Re: Passing table to Ruby session

2023-08-09 Thread Mike Gauland

On 9/08/23 22:14, Ihor Radchenko wrote:

Mike Gauland  writes:


I'll work on putting together a minimal example, if anyone is interested
in testing it on their system.

A minimal example would certainly help.
See https://orgmode.org/manual/Feedback.html#Feedback



Here is an example that demonstrates the problem on my system. I've run 
with my init files disabled, and that makes no difference. Also, I've 
taken the data as it is sent to the session, and pasted into irb in  a 
terminal window, and it ran just fine (which I think rules out any 
problems with line length, or with the session code generating a bad 
script for the longer variable).  I'm keen to find out if anyone else 
can reproduce this, or if there's something quirky about my system.


# Without a session, this works even when the table isn't shortened:
#
#+begin_src ruby :var raw_data=raw-data :colnames no :exports code 
:results output

  puts(raw_data.count)
#+end_src

#+RESULTS:
: 75

# The next two blocks *only* work when the table is cut off at 73. If the
# last two lines are added back in to the table, the ruby session does not
# return.
# Also, even with a truncated table, I don't get any output without the
# extra call to puts() to print a blank line.
#
#+begin_src ruby :var raw_data=raw-data :session :colnames no :exports 
code :results output

  puts(raw_data.count)
  puts()
#+end_src

#+RESULTS:
: 75


#+begin_src ruby :var raw_data=raw-data :session :colnames no :exports 
code :results value

  raw_data.count
#+end_src

#+RESULTS:
: 75


#+NAME: raw-data
| Column 1 | Column 2 | Notes |
|--+--+---|
|    0 |    0 | This is note #0. It just takes up space. |
|    1 |    1 | This is note #1. It just takes up space. |
|    2 |    2 | This is note #2. It just takes up space. |
|    3 |    3 | This is note #3. It just takes up space. |
|    4 |    4 | This is note #4. It just takes up space. |
|    5 |    5 | This is note #5. It just takes up space. |
|    6 |    6 | This is note #6. It just takes up space. |
|    7 |    7 | This is note #7. It just takes up space. |
|    8 |    8 | This is note #8. It just takes up space. |
|    9 |    9 | This is note #9. It just takes up space. |
|   10 |   10 | This is note #10. It just takes up space. |
|   11 |   11 | This is note #11. It just takes up space. |
|   12 |   12 | This is note #12. It just takes up space. |
|   13 |   13 | This is note #13. It just takes up space. |
|   14 |   14 | This is note #14. It just takes up space. |
|   15 |   15 | This is note #15. It just takes up space. |
|   16 |   16 | This is note #16. It just takes up space. |
|   17 |   17 | This is note #17. It just takes up space. |
|   18 |   18 | This is note #18. It just takes up space. |
|   19 |   19 | This is note #19. It just takes up space. |
|   20 |   20 | This is note #20. It just takes up space. |
|   21 |   21 | This is note #21. It just takes up space. |
|   22 |   22 | This is note #22. It just takes up space. |
|   23 |   23 | This is note #23. It just takes up space. |
|   24 |   24 | This is note #24. It just takes up space. |
|   25 |   25 | This is note #25. It just takes up space. |
|   26 |   26 | This is note #26. It just takes up space. |
|   27 |   27 | This is note #27. It just takes up space. |
|   28 |   28 | This is note #28. It just takes up space. |
|   29 |   29 | This is note #29. It just takes up space. |
|   30 |   30 | This is note #30. It just takes up space. |
|   31 |   31 | This is note #31. It just takes up space. |
|   32 |   32 | This is note #32. It just takes up space. |
|   33 |   33 | This is note #33. It just takes up space. |
|   34 |   34 | This is note #34. It just takes up space. |
|   35 |   35 | This is note #35. It just takes up space. |
|   36 |   36 | This is note #36. It just takes up space. |
|   37 |   37 | This is note #37. It just takes up space. |
|   38 |   38 | This is note #38. It just takes up space. |
|   39 |   39 | This is note #39. It just takes up space. |
|   40 |   40 | This is note #40. It just takes up space. |
|   41 |   41 | This is note #41. It just takes up space. |
|   42 |   42 | This is note #42. It just takes up space. |
|   43 |   43 | This is note #43. It just takes up space. |
|   44 |   44 | This is note #44. It just takes up space. |
|   45 |   45 | This is note #45. It just takes up space. |
|   46 |   46 | This is note #46. It just takes up space. |
|   47 |   47 | This is note #47. It just takes up space. |
|   48 |   48 | This is note #48. It just takes up space. |
|   49 | 

Re: kaobook tex template integration to a org file to make self-contained, portable?

2023-08-09 Thread Thomas S. Dye

Aloha Zenny,

Zenny  writes:


Aloha Tom,

Thank you for taking time to respond with an useful pointer. I 
feel like I reached the right person who is  an expert in both 
LaTeX and Orgmode who has contributed to org-tufte book

earlier as seen in your github repo. I am a novice, fyi.

I appreciate if you take some time to point out the non-standard 
features in order to make Orgmode can recognize.


On Tue, Aug 8, 2023 at 10:06 PM Thomas S. Dye  
wrote:


 Aloha Zenny,

 Zenny  writes:
 >
 > However, the pdf did not inherit all the kaobook template 
 > features like: 
 >
 > 1 Mini table of contents in the margin at the start of each 
 > chapter.

 > 2 Chapter headings.
 > 3 Huge chapter number with a vertical line

 The kaobook.cls defines non-standard LaTeX commands for some of 
 its features.  Org mode doesn't know about these, so you'll 
 have 
 to figure out how Org mode can recognize and export them.




I haven't used kaobook, so I can't offer specific pointers.  I 
have used Tufte LaTeX with Org mode, so I can give general 
pointers.


A LaTeX class, such as kaobook, typically redefines standard LaTeX 
commands and environments, and also defines non-standard commands 
and environments.  So, you should first check if your system 
correctly compiles a pdf from the LaTeX examples supplied with 
kaobook.  When the LaTeX side is working correctly, then you'll 
want to identify non-standard commands and environments defined by 
the kaobook class.  In the style and class files you might search 
for \newcommand and \newenvironment, or the documentation might 
identify the user facing non-standard commands and environments. 
These are the ones you'll need to configure specially.


I typically use Org mode macros to insert non-standard LaTeX 
commands.  Here are some I use with non-standard commands from 
Tufte LaTex:


#+MACRO: newthought \newthought{$1}
#+MACRO: sidenote \sidenote[$2][$3]{$1}
#+MACRO: marginnote \marginnote[$2]{$1}
#+MACRO: urlnote \sidenote[$2][$3]{​\url{$1}​}

Non-standard environments are a bit trickier.

First, you might be able to wrap the non-standard environment like 
this in your Org mode file:


#+begin_<>
Something that should be wrapped in <>.
#+end_<>

For figures and tables, you can pass an arbitrary argument to 
:float.  I do this for the Tufte LaTeX marginfigure environment:


#+attr_latex: :float marginfigure :height 1.2in

#+attr_latex: :float marginfigure :options angle=90

#+attr_latex: :placement [ht!] \setfloatalignment{b}

The last example abuses attr_latex to pass a non-standard LaTeX 
command that Tufte LaTeX uses to tweak the vertical alignment of 
the figure.  


Good luck!

hth,
Tom

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



Re: [ANM] org-timeblock: Schedule your day visually, using timeblocking technique inside Emacs

2023-08-09 Thread Ihor Radchenko
Colin Baxter  writes:

> >> As I mentioned in Matrix chat, it would be nice if you could
> >> integrate the svg image display into Org agenda as minor mode,
> >> displaying the interactive svg in place of the time grid. That
> >> would be a welcome addition to Org core.
>
> > It's a great idea.
>
> Not for emacs -nw.

Sure. It got to be graphics-only optional feature.
For text-only, we will still have the usual agenda timegrid.

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



Re: [ANM] org-timeblock: Schedule your day visually, using timeblocking technique inside Emacs

2023-08-09 Thread Colin Baxter
> Ilya Chernyshov  writes:

> Ihor Radchenko  writes:
>> Thanks for sharing!
>> 
>> As I mentioned in Matrix chat, it would be nice if you could
>> integrate the svg image display into Org agenda as minor mode,
>> displaying the interactive svg in place of the time grid. That
>> would be a welcome addition to Org core.

> It's a great idea.

Not for emacs -nw.



Re: [ANM] org-timeblock: Schedule your day visually, using timeblocking technique inside Emacs

2023-08-09 Thread Ilya Chernyshov
Ihor Radchenko  writes:

> Thanks for sharing!
>
> As I mentioned in Matrix chat, it would be nice if you could integrate
> the svg image display into Org agenda as minor mode, displaying the
> interactive svg in place of the time grid. That would be a welcome
> addition to Org core.

It's a great idea. I see that the package could provide minor
and major modes. The minor mode could provide an interactive sliced SVG
image inside org-agenda buffer and the major mode might be implemented in
the same way it's implemented in the package.

I would be interested to hear other devs' opinion on that.



Re: Worg: issue with org-tools page

2023-08-09 Thread Max Nikulin

On 09/08/2023 14:44, Ihor Radchenko wrote:


Unfortunately, I was not able to find a way to do it and yet display the
error backtraces.

The best we can do is using  `backtrace-get-frames' in the error
handler:


My version of the script prints allowed number of error messages and 
stack of the error that exceeds the count. I decided that it provides 
better balance of details. However printing at least one error stack may 
be better.





Re: Passing table to Ruby session

2023-08-09 Thread Ihor Radchenko
Mike Gauland  writes:

> I'll work on putting together a minimal example, if anyone is interested 
> in testing it on their system.

A minimal example would certainly help.
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 



Re: BUG: org-cycle does not unfold some subtrees

2023-08-09 Thread Ihor Radchenko
Michael Dauer  writes:

> Maybe it helps to share you other fix there?

Feel free to share it. Basically, it should be enough to ask testing
using Org dev branch.

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



Re: BUG: org-cycle does not unfold some subtrees

2023-08-09 Thread Michael Dauer
Maybe it helps to share you other fix there?

Am Mi., 9. Aug. 2023 um 11:14 Uhr schrieb Michael Dauer <
mick.da...@gmail.com>:

> I don't know how to get swiper activated in a "clean" manner from there.
> In my operational set-up everything is based on straight.
>
> But anyhow it seems to be a known issue in the swiper community:
> https://github.com/abo-abo/swiper/issues/3015
>
> Am Di., 8. Aug. 2023 um 19:09 Uhr schrieb Ihor Radchenko <
> yanta...@posteo.net>:
>
>> Michael Dauer  writes:
>>
>> > The issue is still easy to reproduce:
>> 
>> > * h1
>> > a
>> > * h2
>> > b
>> > * h3
>> > b
>> > * h4
>> > c
>> > <<<
>> > Fold all. On * h1 call swiper-isearch, enter bbb and select the first
>> > match. -> h2 cannot be unfold anymore.
>> > If you repeat it and select the second match then h3 cannot be unfold
>> > anymore, but h2 works again.
>> > (org-fold-core--clear-isearch-overlays) still fixes the buffer.
>>
>> Sorry, but I cannot reproduce.
>> May you please provide more detailed steps starting from emacs -Q?
>>
>> --
>> Ihor Radchenko // yantar92,
>> Org mode contributor,
>> Learn more about Org mode at .
>> Support Org development at ,
>> or support my work at 
>>
>


Re: BUG: org-cycle does not unfold some subtrees

2023-08-09 Thread Michael Dauer
I don't know how to get swiper activated in a "clean" manner from there. In
my operational set-up everything is based on straight.

But anyhow it seems to be a known issue in the swiper community:
https://github.com/abo-abo/swiper/issues/3015

Am Di., 8. Aug. 2023 um 19:09 Uhr schrieb Ihor Radchenko <
yanta...@posteo.net>:

> Michael Dauer  writes:
>
> > The issue is still easy to reproduce:
> 
> > * h1
> > a
> > * h2
> > b
> > * h3
> > b
> > * h4
> > c
> > <<<
> > Fold all. On * h1 call swiper-isearch, enter bbb and select the first
> > match. -> h2 cannot be unfold anymore.
> > If you repeat it and select the second match then h3 cannot be unfold
> > anymore, but h2 works again.
> > (org-fold-core--clear-isearch-overlays) still fixes the buffer.
>
> Sorry, but I cannot reproduce.
> May you please provide more detailed steps starting from emacs -Q?
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


Re: [patch] ox-latex.el: fix blank lines behavior in verse block

2023-08-09 Thread Juan Manuel Macías
Ihor Radchenko writes:

>>> I see nothing that would prevent merging this patch.
>>> However, I believe that removing blank lines before/after content is
>>> something we may want to do in other built-in backends as well. WDYT?
>>
>> I think you're right. My impression is that the blank lines before/after
>> content is not a desired feature, but rather a consequence of
>> substituting line breaks to create the space between stanzas.
>
> Do you mean that people use extra leading/trailing spaces just to get
> extra vertical space before/after the verse block in _latex_ export?

No, I don't think people use it for that purpose. I meant that if
someone puts a space before or after the content (which can be usual,
for clarity):

#+begin_verse

blah...

#+end_verse

that vertical space appears in the export, which shouldn't.

-- 
Juan Manuel Macías

https://juanmanuelmacias.com

https://lunotipia.juanmanuelmacias.com

https://gnutas.juanmanuelmacias.com



Passing table to Ruby session

2023-08-09 Thread Mike Gauland
I'm trying to pass a table to a ruby code block. The table is 211 lines, 
of four columns.


I want to pass it to a session, so I can use the data in subsequent 
blocks.  I've done this successfully on my work laptop, running Windows 
emacs (28.2), with ruby 3.2.


On my linux box (NixOS), however, the code block never completes.  If I 
cut the table down to 65 lines or so, it works just fine.


If I sent the full table to a stand-alone block (no :session), the block 
executes successfully.


Both machines are using ob-ruby.el version 2.4.4 and inf-ruby.el 2.7.0.

If anyone has any thoughts on what might be going on, I'd love to hear 
them. I'm not familiar enough with the code (not yet, anyway) to know 
where to start.


I'll work on putting together a minimal example, if anyone is interested 
in testing it on their system.


Kind regards,

Mike




Re: [ANN] lisp/ob-tangle-sync.el

2023-08-09 Thread Ihor Radchenko
Mehmet Tekman  writes:

> Ihor Radchenko  writes:
>
>> No. :result-params is not an actual header argument. It is
>> implementation detail - parsing :results header arg internally produces
>> (:results . "all the values concatenated") and _also_ (:result-params
>> "val 1" "val 2" ...).
>
> Hmm... what is the benefit if they encode the same
> information? (e.g. :tangle "one two \"three and four\"" vs
> :tangle-params "one" "two "three and four").
>
> Edit: Oh, I see -- Org parses the action from the `:tangle-params'
> and Users can extend tangle as much as they want via `:tangle'

No, not really. The main purpose is to avoid calling `split-string'
every time we need to check :results settings.

>> > Why can't we just go back to that?
>>
>> We can. I did not expect that we would need to go this far into the
>> rabbit hole. Although, I still think that unifying header argument
>> parsing is something worth doing, even if I need to implement it myself.
>
> Hah, me either. At the same time, it doesn't make sense to have
> `:tangle-sync' present in one release of Org-mode and then deprecated in
> the next (after your header rewrite). It would just confuse users.
>
> I'm happy to have another go at a unified header approach, I will
> just need to explore the code base a bit more.

Thanks! Feel free to ask anything. Babel code is not always easy to read.

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



Re: ox-html: no tests, besides mathjax?

2023-08-09 Thread Ihor Radchenko
Hraban Luyat  writes:

> I was looking for ox-html unit tests and found 
> testing/lisp/test-ox-html.el, which contains only mathjax tests. I 
> didn't find any other (unit) tests for HTML. Is that correct?

Yup. We had no tests at all and then added some alongside with the
MathJax 3 support. That's why the tests are just for MathJax.

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



Re: [patch] ox-latex.el: fix blank lines behavior in verse block

2023-08-09 Thread Ihor Radchenko
Juan Manuel Macías  writes:

>> I see nothing that would prevent merging this patch.
>> However, I believe that removing blank lines before/after content is
>> something we may want to do in other built-in backends as well. WDYT?
>
> I think you're right. My impression is that the blank lines before/after
> content is not a desired feature, but rather a consequence of
> substituting line breaks to create the space between stanzas.

Do you mean that people use extra leading/trailing spaces just to get
extra vertical space before/after the verse block in _latex_ export?

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



Re: [POLL] Should we accept breaking changes to get rid of Org libraries that perform side effects when loading?

2023-08-09 Thread Max Nikulin

On 08/08/2023 20:29, Bastien Guerry wrote:

The definition of a new function is not a side-effect
that affects Emacs editing behavior, so Babel and export libs are
OK.


Function definition is not side effect when load library is requested. 
However it is a side effect of hitting TAB in Emacs help prompt. 
Completion of a variable or a function should not modify Org behavior. 
Loading of a file is not explicitly requested by the user in this case.


I would disregard however function definitions, however changes in key 
bindings and recognized plain text links may be surprising to users who 
just tries to read help.




Re: One-stop shop for ALL org faces size?

2023-08-09 Thread Ihor Radchenko
James Harkins  writes:

> I recall in prior versions of org that it was much easier to change the 
> default font size.
>
> So anyway... what I would like to do is to set something, preferably in one 
> place, and have ALL org faces follow suit. How to do this? Or, is it 
> impossible?
>
> Org 9.5.2.

org-verbatim face no longer inherits fixed-pitch in the latest Org release.

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



Re: Worg: issue with org-tools page

2023-08-09 Thread Ihor Radchenko
Ihor Radchenko  writes:

>>> Note that I just pushed an alternative (but very similar) change in
>>> https://git.sr.ht/~bzg/worg/commit/b38a1f08
>>
>> It fails on first error. I find a report containing several errors much 
>> more helpful for figuring out what has actually happened. On the other 
>> hand there should be a strong reason to read all errors when there are 
>> hundreds one.
>
> You are right. I will see what I can do to throw exit only at the end,
> showing all the errors.

Unfortunately, I was not able to find a way to do it and yet display the
error backtraces.

The best we can do is using  `backtrace-get-frames' in the error
handler:

(backtrace-to-string (backtrace-get-frames 'backtrace))

But it will only display backtrace down to `condition-case' entry - not
very useful in practice.

So, I think that the best option we have is stopping on the first error
and displaying backtrace - it will provide as much information as
possible to diagnose the cause.

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



Re: One-stop shop for ALL org faces size?

2023-08-09 Thread James Harkins
 On Wed, 09 Aug 2023 15:38:55 +0800  James Harkins  wrote --- 
> So anyway... what I would like to do is to set something, preferably in one 
> place, and have ALL org faces follow suit. How to do this? Or, is it 
> impossible?

Erm... as often happens, moments after sending, I found the issue: 
custom-set-faces had set "default" to the font family I wanted, but fixed-pitch 
was overriding this with a different family. Changing that fixed it.

Sorry for noise.

hjh



One-stop shop for ALL org faces size?

2023-08-09 Thread James Harkins
A while back, I configured Emacs' default face to use the Inconsolata font 
slightly smaller than how it appeared at first. (It shows up in .emacs as 
":height 98" -- what is 98, I'm not sure.)

Now the trouble is, =verbatim segments= appear slightly larger than the text 
around it. As it's a programming related article that I'm writing, there are a 
LOT of verbatim bits and it's extremely distracting to see variable line 
heights.

I dug into org-faces and found Org Verbatim face. This inherits from 
fixed-pitch, so I tried to change it to have the same height property, but, no 
luck.

I recall in prior versions of org that it was much easier to change the default 
font size.

So anyway... what I would like to do is to set something, preferably in one 
place, and have ALL org faces follow suit. How to do this? Or, is it impossible?

Org 9.5.2.

Thanks.

hjh



Re: [BUG] `org-open-at-point' surprisingly asks for tags table [9.7-pre (release_9.6.7-640-ga18ebc @ /home/jschmidt/work/org-mode/lisp/)]

2023-08-09 Thread Ihor Radchenko
Jens Schmidt  writes:

> Sorry, just followed that recent side-effect-thread to the root
>
> https://list.orgmode.org/orgmode/87o7omg4ie@alphaville.usersys.redhat.com/
>
> and found that everything already got documented.  It was that thread
> that triggered my bug report as an example of a particular nasty side
> effect.

Yup. This is a known problem.
Handled. Closing in favor of the linked thread.

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



Re: blank line in ido as default when refiling

2023-08-09 Thread Ihor Radchenko
Samuel Wales  writes:

> Subject: is blank option in ido a bugfix refile change?
> idk if this is etireoly user eror but i ave made no changes to my
> config that i am aware of so want to confirm with others who mght be
> able to guess or know there was a change i bugfix..

I do not recall any relevant changes on bugfix recently.
There is just a handful of new commits since the last minor release. You
can review all of them in
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/log/?h=bugfix
I see nothing relevant.

May it be that you updated something else?

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