Re: Suggestion with footnotes when toggling headlines into plain lists

2022-11-10 Thread Ihor Radchenko
Ihor Radchenko  writes:

>> ~C-c -~ turns that into a list where footnotes definitions can't be 
>> found. It gives, for example, problems when exporting or when more 
>> footnotes are added:
>>
>> * Main headline
>> - Headline 1
>>     [fn:1]
>>
>>    [fn:1] 
>> - Headline 2
>
> Confirmed.
>
> Transforming footnote-definition into footnote-reference is not intended
> and should be considered a bug.

Fixed on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=f83e45526b5ec4627d601673be3680e2dece1b33

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



[MAINTENANCE] Do we have any backwards-compatibility policy for third-party packages?

2022-11-10 Thread Ihor Radchenko
Hi,

Org promises to support the last three Emacs releases.
However, it is less clear what is our policy wrt third-party packages.

We do need third-party packages, for example, in babel backends.
Sometimes, we have to make changes to the ob-*.el files in order to
accommodate changes in the required third-party packages. Like in recent
changes to ob-scheme where `run-geiser' function is now obsolete
upstream.

Should we try to support obsolete functions/variables in third-party
packages? Should we try to work around breaking changes and support both
before/after package versions?

The answer is not obvious as older Emacs versions might not be supported
by some third-party packages. Then, logically, we have to support older
package versions compatible with the oldest Emacs version we support.
But it might be hard to keep track of such scenarios.

WDYT?

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



Re: [PATCH] Bind calendar-debug-sexp to non-nil when running tests (was: problem with diary sexps)

2022-11-10 Thread Ihor Radchenko
Ihor Radchenko  writes:

> I guess we can permanently bind calendar-debug-sexp to non-nil in tests.
> It should help if we encounter diary-related issues in future.

Applied onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=c41a2198f2d7a3fbae5953f4b25c84cbe6692e2e

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



Re: [PATCH] Re: [BUG] Make org-html-htmlize-output-type safe [9.5.2 (release_9.5.2-9-g7ba24c @ /Users/salutis/src/emacs/nextstep/Emacs.app/Contents/Resources/lisp/org/)]

2022-11-10 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Can be done. Like in the attached patch.

Applied onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=4517fba441444fa6a2fb167787a6e813d7004c80

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



Re: [BUG] phantom newlines while moving headings [9.6-pre ( @ /home/chomwitt/.config/emacs/elpa/org-9.6pre0.20221110.85807/)]

2022-11-10 Thread Ihor Radchenko
chomw...@posteo.eu writes:

> It follows a possible org chunk that reproduce the phantom newlines that
> are created while trying to move a headline from a state where there
> are no newlines between the headers.

Could you please provide more information?
Which headline should I move to reproduce the problem?

I tried to move headlines randomly in the attached file (your example)
but I do not see any newlines created.



bug2.org
Description: Lotus Organizer

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


Re: [BUG] org-babel-comint-with-output: incorrect prompt detection [9.6-pre]

2022-11-10 Thread Ihor Radchenko
Bruno Barbier  writes:

> For example, using a haskell prompt, let say the prompt is "Prelude> ",
> the first incoming text is "Pre", the second incoming text is
> "lude> ", o-b-c-w-o will wrongly infer that "lude> " is the prompt,
> and that "Pre" was part of the previous value/output.

The problem is that Bash can send incoming text like

"prompt> " "prompt> " "prompt> output\n".

"prompt> prompt> prompt> output\n".

So, we cannot reliably distinguish your case from other possibly comint
quirks based on newline.

One possible fix could be replacing `comint-prompt-regexp' one more time
at the very end in addition to `org-babel-comint-prompt-separator'. We
must also make `comint-prompt-regexp' more precise to avoid "lude> "
being detected as a prompt.

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



Re: [BUG] LaTeX export in non-English language [9.6-pre (release_9.5.5-1087-g620a96.dirty @ /home/yantar92/.emacs.d/straight/build/org/)]

2022-11-10 Thread Ihor Radchenko
Juan Manuel Macías  writes:

>> And exported to pdf (C-c C-e l o).
>> Surprisingly, the output is in English.
>>
>> Am I missing something?
>
> You need to explicitly load babel or polyglossia:
>
> For polyglossia (`org-latex-guess-polyglossia-language'):
>
> #+LaTeX_Header: \usepackage[AUTO]{polyglossia}

Aha! I missed that part in the newer manual.

Note that the manual only talks about setting
`org-latex-packages-alist'. Not the keyword.

Maybe we can add the #+LATEX_HEADER example to the manual.

> BTW I've noticed that the value of #+language is not case-agnostic. You
> should put "he". Should it be case-agnostic? In the previous
> implementation, when there were two language lists for babel and
> polyglossia, neither was it.

I think that it is a good idea. I do not recall common language
abbreviations to be case-sensitive in other software.

-

Now, let me continue to act like an ordinary user and follow your
suggestion :)

I tried to add the header:

#+title: Temp
#+LATEX_COMPILER: lualatex
#+LANGUAGE: he
#+LaTeX_Header: \usepackage[AUTO]{polyglossia}

\begin{equation}
f(x) = \frac{8}{7}
\end{equation}

#+begin_src python :exports code
for i in range(3):
print("hello")
#+end_src

Then, C-c C-e l o

And I get an error...

Rc files read:
  NONE
Latexmk: This is Latexmk, John Collins, 29 September 2020, version: 4.70b.
Rule 'lualatex': File changes, etc:
   Changed files, or newly in use since previous run(s):
  'bug.tex'

Run number 1 of rule 'lualatex'


Running 'lualatex  -interaction=nonstopmode -recorder -output-directory="."  
"bug.tex"'

Set environment variable BIBINPUTS='.:'
Set environment variable TEXINPUTS='.:'
Latexmk: applying rule 'lualatex'...
This is LuaHBTeX, Version 1.13.0 (TeX Live 2021 Gentoo Linux) 
 restricted system commands enabled.
(./bug.tex
LaTeX2e <2020-10-01> patch level 4
 L3 programming layer <2021-02-18>
(/usr/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class

[clipped]

(/usr/share/texmf-dist/tex/luatex/luatexbase/luatexbase.sty
(/usr/share/texmf-dist/tex/luatex/ctablestack/ctablestack.sty))
(/usr/share/texmf-dist/tex/latex/polyglossia/gloss-latex.ldf))
(/usr/share/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf

! LaTeX Error: File `luabidi.sty' not found.

Type X to quit or  to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
 
   
l.3 \RequireBidi
  
 440 words of node memory still in use:
   3 hlist, 1 rule, 1 dir, 3 kern, 1 glyph, 4 attribute, 58 glue_spec, 4 attrib
ute_list, 1 if_stack, 1 write nodes
   avail lists: 2:13,3:2,4:1,5:2,7:2,9:2
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on bug.log.
Latexmk: Missing input file: 'luabidi.sty' from line
  '! LaTeX Error: File `luabidi.sty' not found.'
Failure to make 'bug.pdf'
Collected error summary (may duplicate other messages):
  lualatex: Command for 'lualatex' gave return code 1
  Refer to 'bug.log' for details
Latexmk: Examining 'bug.log'
=== TeX engine is 'LuaHBTeX'
Latexmk: Errors, in force_mode: so I tried finishing targets


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



[BUG] phantom newlines while moving headings [9.6-pre ( @ /home/chomwitt/.config/emacs/elpa/org-9.6pre0.20221110.85807/)]

2022-11-10 Thread chomwitt
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.



It follows a possible org chunk that reproduce the phantom newlines that
are created while trying to move a headline from a state where there
are no newlines between the headers.
 



* Linux system programming
  
** What is a product  Standard  ?
  :posix:sus: <> 


*** Unix characteristics

 Portability

One 





*** Standard Makefile Targets

** Headers

How to find the include paths used by the gcc compiler ?

...

** Keyboard 

 A scancode is the lowest identification number for a key, 
   
evtest - Input device event monitor and query tool

*** Extra keyboard keys

Many
** Time
*** Check current time-date-timezone

n
** References/Example_code


*** TLPI book's code (The Linux Programming Interface)


 DONE TOsDO Socket stream example
 CLOSED: [2017-01-11 Τετ 06:29]

Sockets

$ gcc -g -o us_xfr_cl us_xfr_cl.c  -L../lib -I../lib/
../lib/error_functions.o $ gcc -g -o us_xfr_sv  us_xfr_sv.c  -L../lib
-I../lib/ ../lib/error_functions.o


http://man7.org/tlpi/

** Utilities

*** strace 

strace traces and logs  all system calls issued by a program along with
their return codes. In this way, you can watch how a program interacts
with the system, which is useful for tracking down behavioural issues.
ss

strace -c foo_obj   // generate stats of syscalls

*** pmap 

$ foo &
[pid]
$ pmap pid



*** objdump

objdump is a program for displaying various information about object
files. For instance, it can be used as a disassembler to view an
executable in assembly form. It is part of the GNU Binutils for
fine-grained control over executables and other binary data.

$ objdump -f foo_obj   // see information related to the overall file
header , like file format

$ objdump -h foo_ob// Dumping the section headers from the ELF
executable // If the ELF executable contains debug symbols will contain 
   // section  with names beginning with .debug_ -
these are // ldthe DWARF debugging sections

26 .debug_aranges 0020      1037
 CONTENTS, READONLY, DEBUGGING
27 .debug_pubnames 0028      1057
 CONTENTS, READONLY, DEBUGGING
28 .debug_info   00cc      107f
 CONTENTS, READONLY, DEBUGGING
29 .debug_abbrev 008a      114b
 CONTENTS, READONLY, DEBUGGING
30 .debug_line   006b      11d5
 CONTENTS, READONLY, DEBUGGING
31 .debug_frame  0044      1240
 CONTENTS, READONLY, DEBUGGING
32 .debug_str00ae      1284
 CONTENTS, READONLY, DEBUGGING
33 .debug_loc0058      1332
 CONTENTS, READONLY, DEBUGGING

The first number seen for each section here is its size, and the last
is the offset where it begins in the ELF file. The debugger uses this
information to read the section from the executable


$ objdump --dwarf=info foo_obj   // display the DWARF debug_info section
//This is why DWARF encodes a full mapping between lines in the C
source code //and machine code addresses in the executable. This
information is contained in //the .debug_line section and can be
extracted in a readable form as follows:


$ objdump --dwarf=decodedline  foo_obj   // display 

http://eli.thegreenplace.net/2011/02/07/how-debuggers-work-part-3-debugging-information/


Emacs  : GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.24, cairo version 1.16.0) of 2021-03-28, modified by Debian
Package: Org mode version 9.6-pre ( @
/home/chomwitt/.config/emacs/elpa/org-9.6pre0.20221110.85807/)

current state:
==
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer) org-link-shell-confirm-function
'yes-or-no-p org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-persist-before-write-hook
'(org-element--cache-persist-before-write) org-mode-hook '(#[0
"\300\301\302\303\304$\207" [add-hook change-major-mode-hook
org-fold-show-all append local] 5] #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook
org-babel-show-result-all append local] 5] org-babel-result-hide-spec
org-babel-hide-all-hashes) 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-startup-with-inline-images t 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)

[BUG] org-babel-comint-with-output: incorrect prompt detection [9.6-pre]

2022-11-10 Thread Bruno Barbier


Hi,

The function `org-babel-comint-with-output' (o-b-c-w-o) may not detect
prompts correctly.

The function o-b-c-w-o checks if the incoming arbitrary chunk of text
contains whole prompts, and replace them.

But the incoming text may contain an incomplete prompt at the
end. When this happens, it will miss that real prompt.

For example, using a haskell prompt, let say the prompt is "Prelude> ",
the first incoming text is "Pre", the second incoming text is
"lude> ", o-b-c-w-o will wrongly infer that "lude> " is the prompt,
and that "Pre" was part of the previous value/output.

This is with current main (after commit 
1ef420b19d2e310d9ef67e090ef84cdb6da4744d).

I'm randomly hit by this bug, when working on tests for ob-haskell.

Let me know if I need to provide more information,

Thanks,

Bruno




Re: [PATCH] ob-java: Define the list of all supported header arguments

2022-11-10 Thread Bruno Barbier
Ihor Radchenko  writes:

> Then, it sounds like local.mk does not enable java tests.
>
> I fixed such scenario on main.
> Now, java tests will be skipped when ob-java testing is not requested.


That works for me now, with or without java in local.mk.

Thanks for the patch and the explanation!

Bruno



Re: [BUG] LaTeX export in non-English language [9.6-pre (release_9.5.5-1087-g620a96.dirty @ /home/yantar92/.emacs.d/straight/build/org/)]

2022-11-10 Thread Juan Manuel Macías
Ihor Radchenko writes:

> I am trying to look into RTL language exports.
>
> I tried the following simple-minded Org file:
>
> #+title: Temp
> #+LATEX_COMPILER: lualatex
>
> #+LANGUAGE: HE
>
> \begin{equation}
> f(x) = \frac{8}{7}
> \end{equation}
>
> #+begin_src python :exports code
> for i in range(3):
>   print("hello")
> #+end_src
>
> And exported to pdf (C-c C-e l o).
> Surprisingly, the output is in English.
>
> Am I missing something?

You need to explicitly load babel or polyglossia:

For polyglossia (`org-latex-guess-polyglossia-language'):

#+LaTeX_Header: \usepackage[AUTO]{polyglossia}

For babel (`org-latex-guess-babel-language'):

#+LaTeX_Header: \usepackage[bidi=basic]{babel}
#+LaTeX_Header: \babelprovide[import, main]{AUTO}

There was a discussion in an old thread about the possibility of loading
babel or polyglossia automatically (I think Maxim was in favor of it,
and brought up some possibilities). The problem is that babel's syntax
is somewhat more complex than polyglossia's, and admits many variants.
Also in babel there are languages that are loaded using the new ini file
system with the command \babelprovide. Currently,
org-latex-guess-babel-language supports babelprovide, but you need to
load the command explicitly:

#+LaTeX_Header: \babelprovide[options]{AUTO}

BTW I've noticed that the value of #+language is not case-agnostic. You
should put "he". Should it be case-agnostic? In the previous
implementation, when there were two language lists for babel and
polyglossia, neither was it.

Best regards,

Juan Manuel 



Re: Volunteering to maintain ob-asymptote.el within Org

2022-11-10 Thread Jarmo Hurri


Greetings Ihor.

Ihor Radchenko  writes:

> Jarmo, did you hear anything from Luc? There was no action in
> ob-asymptote for over a year. If the current maintainer does not reply
> to email requests related to ob-asymptote, I'd rather transfer to
> maintenance to someone more active.

Nope. I sent him another email some weeks ago, no response.

Let me know how we will proceed.

All the best,

Jarmo




Re: [PATCH] ob-java: Define the list of all supported header arguments

2022-11-10 Thread Ihor Radchenko
Bruno Barbier  writes:

> I'm seeing these 3 failures too, running the tests from the command
> line. The failure looks like this:
>
> FAILED ob-java/lint-header-args-block ((should-not (org-lint
> '(wrong-header-argument))) :form (org-lint (wrong-header-argument))
> :value ((1 ["8" "nil" "Unknown header argument \":classname\""
> #s(org-lint-checker wrong-header-argument "Report wrong babel
> headers" org-lint-wrong-header-argument nil (babel))]) (2 ["8" "nil"
> "Unknown header argument \":imports\"" #s(org-lint-checker
> wrong-header-argument "Report wrong babel headers"
> org-lint-wrong-header-argument nil (babel))]) (3 ["8" "nil" "Unknown
> header argument \":cmpflag\"" #s(org-lint-checker
> wrong-header-argument "Report wrong babel headers"
> org-lint-wrong-header-argument nil (babel))]) (4 ["8" "nil" "Unknown
> header argument \":cmdarg\"" #s(org-lint-checker
> wrong-header-argument "Report wrong babel headers"
> org-lint-wrong-header-argument nil (babel))])))
>
>
> Adding (require 'ob-java) at the beginning of test-ob-java.el ensures
> that `org-babel-header-args:java' is defined, and the tests pass.

Then, it sounds like local.mk does not enable java tests.

I fixed such scenario on main.
Now, java tests will be skipped when ob-java testing is not requested.

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



Re: [PATCH] ob-java: Define the list of all supported header arguments

2022-11-10 Thread Bruno Barbier



Ihor Radchenko  writes:

> Rudolf Adamkovič  writes:
>
>> Overall, I now see the following failures on the main branch:
>>
>>FAILED  ob-java/lint-header-args-block
>>FAILED  ob-java/lint-header-args-buffer
>>FAILED  ob-java/lint-header-args-heading
>
> AFAIK, Max is using Linux. This is strange...
> And I cannot really fix it without being able to reproduce on my side.

I'm seeing these 3 failures too, running the tests from the command
line. The failure looks like this:

FAILED ob-java/lint-header-args-block ((should-not (org-lint
'(wrong-header-argument))) :form (org-lint (wrong-header-argument))
:value ((1 ["8" "nil" "Unknown header argument \":classname\""
#s(org-lint-checker wrong-header-argument "Report wrong babel
headers" org-lint-wrong-header-argument nil (babel))]) (2 ["8" "nil"
"Unknown header argument \":imports\"" #s(org-lint-checker
wrong-header-argument "Report wrong babel headers"
org-lint-wrong-header-argument nil (babel))]) (3 ["8" "nil" "Unknown
header argument \":cmpflag\"" #s(org-lint-checker
wrong-header-argument "Report wrong babel headers"
org-lint-wrong-header-argument nil (babel))]) (4 ["8" "nil" "Unknown
header argument \":cmdarg\"" #s(org-lint-checker
wrong-header-argument "Report wrong babel headers"
org-lint-wrong-header-argument nil (babel))])))


Adding (require 'ob-java) at the beginning of test-ob-java.el ensures
that `org-babel-header-args:java' is defined, and the tests pass.

Bruno



Re: [FR] Allow TITLE to be used as default export file name (was: [BUG] EXPORT_FILE_NAME keyword is used by `org-export-output-file-name' before macro expansion/INCLUDEs/removing COMMENTed trees (was:

2022-11-10 Thread Ihor Radchenko
alain.coch...@unistra.fr writes:

>  > > > I recommend you to use :EXPORT_FILE_NAME: headline property and
>  > > > export using subtree scope.
>  > >
>  > > Thanks a lot for the tip.  A suggestion: that the :TITLE:
>  > > property be used if it exists.
>  > 
>  > We currently fall back to file name if nothing else works.  Using
>  > TITLE is possible but cannot be done by default as a fallback ---
>  > existing users relying on current behaviour will be affected by
>  > such change.
>
> I am surprised by this message: like I said earlier when replying to
> myself to the same message as the one to which you are replying, I
> discovered the :EXPORT_TITLE: (headline) property, which does exactly
> what I was looking for.
>
> It is as if you missed that message of mine (or did not understand
> what I wanted to say) AND forgot or don't know about the
> :EXPORT_TITLE: property.  As I find it rather unlikely, I guess you
> are thinking of something else, which is beyond me.

Hmm. I think I misinterpreted your message. I thought that you were
talking about file name, not the title inside the exported document.

> At any rate, there is no need for anything new in this repect, even
> for me.

Noted.

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