Re: multipage html output

2024-08-06 Thread Orm Finnendahl
Hi Ihor,

 as always much appreciated. I'll look into that and get back. It
might take a bit depending on how complicated it is as I have some
other things on my org list right now, but we'll get there ;-)

Best,
Orm

Am Montag, den 05. August 2024 um 18:22:22 Uhr (+) schrieb Ihor Radchenko:
> Orm Finnendahl  writes:
> 
> >  attached are the patches for the multipage html export proposal. The
> > tgz file contains all commits after branching from the main branch to
> > the org-html-multipage branch (see:
> > https://github.com/ormf/org-mode/tree/org-html-multipage)
> 
> Thanks! Although creating patches is not necessary in your case - remote
> git repo is good enough for me to check things.
> 
> I am also a bit surprised that you went as far as adding documentation
> to the manual. We are a bit early into the review, so things are still
> going to change. Let's focus on the code first.
> 
> > +(setq tmp-info info)
> > ...
> > +(setq global-prop org-export-filters-alist)
> 
> I noticed temporary debug statements and some (message ...) statements
> sprinkled around. They are ok for the time being, but will need to be
> removed before merging upstream.
> 
> > +(defvar org-export-multipage-split-functions nil
> > +  "List of functions applied when multipage output has to be split.")
> 
> Please be a bit more specific about what these functions are. Here is an
> example of a complete docstring:
> 
> (defvar org-export-filter-parse-tree-functions nil
>   "List of functions applied to the parsed tree.
> Each filter is called with three arguments: the parse tree, as
> returned by `org-element-parse-buffer', the backend, as
> a symbol, and the communication channel, as a plist.  It must
> return the modified parse tree to transcode.")
> 
> Also, please mention that `org-export-multipage-split-functions' are
> called _only_ when multipage output is requested. This means that
> `org-html-multipage-split' does not need to check :multipage property.
> 
> > +(defun org-html-transcode-org-data (data content info)
> > +  "Transcode the top org-data node of the org file to export.
> > ...
> 
> > +(defun org-html-transcode-multipage (info &optional body-only)
> > +  "Central routine transcoding to multipage output called by
> > +`org-html-transcode-org-data' called from `org-export-as'.
> > ...
> 
> I see nothing specific to HTML in these two functions.  Please, factor
> them out into ox.el. I think that they can be all merged into the
> default `org-export-transcode-org-data'.
> 
> > +(defun org-html-multipage-split (data _backend info)
> > ...
> > +(if (not (file-writable-p dir)) (error "Output dir not writable")
> > +  (let* ((encoding (or org-export-coding-system 
> > buffer-file-coding-system))
> 
> Checking output dir does not belong here.
> You should probably do it in `org-html-export-to-multipage' instead.
> Ideally, split function should do splitting, but not other things.
> 
> > +  ;; collect all org-pages to be exported.
> > +  (plist-put info :multipage-org-pages
> > + (cl-loop
> > +  for file in section-filenames
> > +  for tl-headline in section-trees
> > +  collect
> > +  (list 'org-page
> > +(list :output-file (format "%s/%s" dir 
> > file)
> > +  :tl-headline tl-headline
> > +  :tl-headline-number
> > +  (alist-get
> > +   tl-headline
> > +   
> > stripped-section-headline-numbering))
> > +nil
> 
> This is awkward.  Why not modifying DATA directly? Say, you can
> transform it into (org-data (...) (org-page ...) (org-page ...) ...).
> 
> -- 
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 



Re: [BUG] org-cancel-repeater fails depending on position of repeater [9.6.15 (release_9.6.15 @ /opt/homebrew/Cellar/emacs-plus@29/29.4/share/emacs/29.4/lisp/org/)]

2024-08-06 Thread Ihor Radchenko
Peter Solodov  writes:

> Changing `org-cancel-repeater' to work on all active timestamps makes
> the most sense to me. The reason this came up at all is because org
> changes order of timestamps, first timestamp is always the timestamp
> that was changed last. If entry is a state where current code can handle
> it correctly and then timestamp with repeater is shifted through a
> normal user action (updating deadline or scheduled), then canceling with
> repeater override is unexpectedly broken.

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

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



Re: [POLL] ob-R, ob-julia: Should we force-disable ess-ask-for-ess-directory? (was: [BUG] Relative filenames for graphics output in ob-R.el [9.8-pre (release_9.7.4-80-g7fa169)])

2024-08-06 Thread Ihor Radchenko
Ihor Radchenko  writes:

> I'd like to hear from ob-R/ob-julia users whether the current behavior
> is something they rely on. If not, I'd prefer to follow the conventions
> we introduce in the manual and suppress the ESS's directory prompt.

The responses expressed no objections to the change.
So, ob-R and ob-julia now obey the working directory conventions common
for the rest of babel backends - use default-directory or :dir; no
queries.

Closed.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=62b88d613e

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



RE: Issue opening files with accented words, using org-attach-open

2024-08-06 Thread Ihor Radchenko
Kepa  writes:

> I get no error using " M-x debug-on-entry  org-open-file ".
>
> If I use org-attach-open from the attach menu, I get this backtrace:
>
> Debugger entered--entering a function:
> * org-open-file("p:/170 Buzón/oq.pdf" nil)
>   org-attach-open(nil)
>   funcall-interactively(org-attach-open nil)
>   command-execute(org-attach-open)
>   org-attach()
>   funcall-interactively(org-attach)
>   command-execute(org-attach)
>
>
> Although I've now noticed that the error only occurs when the file is on the 
> local network. If it's on my hard drive, access works correctly. P: is a 
> local network drive.

Ok.
What about the same steps, but using
M-x debug-on-entry... w32-shell-execute ?

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



Re: multipage html output

2024-08-06 Thread Orm Finnendahl
Hi Ihor,

 it was easier than I thought, although still nasty:

https://github.com/ormf/org-mode/tree/org-html-multipage

Maybe you can check whether this is along the lines of what you had in
mind.

Am Montag, den 05. August 2024 um 18:22:22 Uhr (+) schrieb Ihor Radchenko:
> I am also a bit surprised that you went as far as adding documentation
> to the manual. We are a bit early into the review, so things are still
> going to change. Let's focus on the code first.

Don't be, it was just an exercise, not much work and I expect there
are probably changes. I just thought to present it for commentary.

> > +(setq tmp-info info)
> > ...
> > +(setq global-prop org-export-filters-alist)
> 
> I noticed temporary debug statements and some (message ...) statements
> sprinkled around. They are ok for the time being, but will need to be
> removed before merging upstream.

of course. I removed most of them now.

> > +(defvar org-export-multipage-split-functions nil
> > +  "List of functions applied when multipage output has to be split.")
> 
> Please be a bit more specific about what these functions are. Here is an
> example of a complete docstring:
> 
> (defvar org-export-filter-parse-tree-functions nil
>   "List of functions applied to the parsed tree.
> Each filter is called with three arguments: the parse tree, as
> returned by `org-element-parse-buffer', the backend, as
> a symbol, and the communication channel, as a plist.  It must
> return the modified parse tree to transcode.")

done.

> Also, please mention that `org-export-multipage-split-functions' are
> called _only_ when multipage output is requested. This means that
> `org-html-multipage-split' does not need to check :multipage property.

done.

> > +(defun org-html-transcode-org-data (data content info)
> > +  "Transcode the top org-data node of the org file to export.
> > ...
> 
> > +(defun org-html-transcode-multipage (info &optional body-only)
> > +  "Central routine transcoding to multipage output called by
> > +`org-html-transcode-org-data' called from `org-export-as'.
> > ...
> 
> I see nothing specific to HTML in these two functions.  Please, factor
> them out into ox.el. I think that they can be all merged into the
> default `org-export-transcode-org-data'.

I factored out org-html-transcode-multipage to
org-export-transcode-multipage and got rid of
org-html-transcode-multipage.

> > +(defun org-html-multipage-split (data _backend info)
> > ...
> > +(if (not (file-writable-p dir)) (error "Output dir not writable")
> > +  (let* ((encoding (or org-export-coding-system 
> > buffer-file-coding-system))
> 
> Checking output dir does not belong here.

That was a leftover, I had already fixed but forgot to delete the
condition statement, thanks.

> 
> This is awkward.  Why not modifying DATA directly? Say, you can
> transform it into (org-data (...) (org-page ...) (org-page ...) ...).

I implemented it now by making org-page elements full citizens,
adopting their contents so that you can org-export-data on them. It
was quite nasty concerning link resolution but I found a reasonable
way to solve this.

This is just a proposal to check whether this architecture is the way
to go. I got the idea that it might be feasible to integrate all page
related properties directly into the properties of each org-page
element rather than annotating info with this information. I will look
into that in the following days as it might simplify the code
somewhat, but it won't be a drastic change (just again probably a
chasing of many nasty details ;-).

--
Orm



RE: Issue opening files with accented words, using org-attach-open

2024-08-06 Thread Kepa
Hi, Ihor



I get not output with w32-shell-execute, but... if I make a link to the file, 
and I try to open it, I get a backtrace (so it would be not a problem from 
org-attach, but from org-mode):





Debugger entered--entering a function:

* org-open-file("p:/170 Buzón/oq.pdf" nil)

  apply(org-open-file "p:/170 Buzón/oq.pdf" nil nil)

  org-link-open-as-file("p:/170 Buzón/oq.pdf" nil)





  org-link-open((link (:standard-properties [214050 nil nil nil 214078 0 nil 
nil nil nil nil nil nil nil # nil nil (paragraph 
(:standard-properties [214050 214050 214050 214079 214079 0 nil nil element t 
(20 . 214083) nil nil nil # nil nil (section ...)]))] 
:type "file" :type-explicit-p t :path "p:/170 Buzón/oq.pdf" :format bracket 
:raw-link "file:p:/170 Buzón/oq.pdf" :application nil :search-option nil)) nil)





  #f(compiled-function (&optional arg) "Open thing at point.\nThe thing can be 
a link, citation, timestamp, footnote, src-block or\ntags.\n\nWhen point is on 
a link, follow it.  Normally, files will be opened by\nan appropriate 
application (see `org-file-apps').  If the optional prefix\nargument ARG is 
non-nil, Emacs will visit the file.  With a double\nprefix argument, try to 
open outside of Emacs, in the application the\nsystem uses for this file 
type.\n\nWhen point is on a timestamp, open the agenda at the 
day\nspecified.\n\nWhen point is a footnote definition, move to the first 
reference\nfound.  If it is on a reference, move to the 
associated\ndefinition.\n\nWhen point is on a src-block of inline src-block, 
open its result.\n\nWhen point is on a citation, follow it.\n\nWhen point is on 
a headline, display a list of every link in the\nentry, so it is possible to 
pick one, or all, of them.  If point\nis on a tag, call `org-tags-view' 
instead.\n\nOn top of syntactically correct links, this function also tries\nto 
open links and timestamps in comments, node properties, and\nkeywords if point 
is on something looking like a timestamp or\na link." (interactive "P") 
#)(nil)





  apply(#f(compiled-function (&optional arg) "Open thing at point.\nThe thing 
can be a link, citation, timestamp, footnote, src-block or\ntags.\n\nWhen point 
is on a link, follow it.  Normally, files will be opened by\nan appropriate 
application (see `org-file-apps').  If the optional prefix\nargument ARG is 
non-nil, Emacs will visit the file.  With a double\nprefix argument, try to 
open outside of Emacs, in the application the\nsystem uses for this file 
type.\n\nWhen point is on a timestamp, open the agenda at the 
day\nspecified.\n\nWhen point is a footnote definition, move to the first 
reference\nfound.  If it is on a reference, move to the 
associated\ndefinition.\n\nWhen point is on a src-block of inline src-block, 
open its result.\n\nWhen point is on a citation, follow it.\n\nWhen point is on 
a headline, display a list of every link in the\nentry, so it is possible to 
pick one, or all, of them.  If point\nis on a tag, call `org-tags-view' 
instead.\n\nOn top of syntactically correct links, this function also tries\nto 
open links and timestamps in comments, node properties, and\nkeywords if point 
is on something looking like a timestamp or\na link." (interactive "P") 
#) nil)





  org--mouse-open-at-point(#f(compiled-function (&optional arg) "Open thing at 
point.\nThe thing can be a link, citation, timestamp, footnote, src-block 
or\ntags.\n\nWhen point is on a link, follow it.  Normally, files will be 
opened by\nan appropriate application (see `org-file-apps').  If the optional 
prefix\nargument ARG is non-nil, Emacs will visit the file.  With a 
double\nprefix argument, try to open outside of Emacs, in the application 
the\nsystem uses for this file type.\n\nWhen point is on a timestamp, open the 
agenda at the day\nspecified.\n\nWhen point is a footnote definition, move to 
the first reference\nfound.  If it is on a reference, move to the 
associated\ndefinition.\n\nWhen point is on a src-block of inline src-block, 
open its result.\n\nWhen point is on a citation, follow it.\n\nWhen point is on 
a headline, display a list of every link in the\nentry, so it is possible to 
pick one, or all, of them.  If point\nis on a tag, call `org-tags-view' 
instead.\n\nOn top of syntactically correct links, this function also tries\nto 
open links and timestamps in comments, node properties, and\nkeywords if point 
is on something looking like a timestamp or\na link." (interactive "P") 
#) nil)





  apply(org--mouse-open-at-point #f(compiled-function (&optional arg) "Open 
thing at point.\nThe thing can be a link, citation, timestamp, footnote, 
src-block or\ntags.\n\nWhen point is on a link, follow it.  Normally, files 
will be opened by\nan appropriate application (see `org-file-apps').  If the 
optional prefix\nargument ARG is non-nil, Emacs will visit the file.  With a 
double\nprefix argument, try to open outside of Emacs, in the application 
the\nsystem uses for this file type.\n\nWhen point is 

Re: multipage html output

2024-08-06 Thread Orm Finnendahl
Am Dienstag, den 06. August 2024 um 20:47:22 Uhr (+0200) schrieb Orm Finnendahl:
> 
> I factored out org-html-transcode-multipage to
> org-export-transcode-multipage and got rid of
> org-html-transcode-multipage.

Sorry, I meant "I factored out org-html-transcode-org-data to
org-export-transcode-org-data and got rid of
org-html-transcode-multipage".





[BUG] org-fill-paragraph adds wrong prefix to lines with two bold lines [9.7.8 (N/A @ /gnu/store/bj2bsz76f14n3vfnkv556s8f1x66m9in-emacs-org-9.7.8/share/emacs/site-lisp/org-9.7.8/)]

2024-08-06 Thread Dr. Arne Babenhauserheide


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.


To reproduce:

Create a paragraph in which the first two words in the first two lines
are fat. For example:

*Ver’jigor* geht zur Handelsvertretung, um den Botschafter zu treffen.
*Sambucus* und *Targ* suchen eine Herberge, finden einen 6-Personen
Schlafsaal für zwei Silber in /Gronaks Palast/. Zum Essen schöpft
der Troll am Tresen direkt mit den Gläsern aus dem Eimer — und mit
den Schalen aus dem Eintopf. Sie essen am Ende das gerollte Brot.

Copy this into an org-mode buffer. Move point into the paragraph. Then
hit M-q.

Expected: the paragraph does not change.

Actual: lines 3-5 become prefixed with *.

I tried this with emacs -Q. It happens there, too.

Best wishes,
Arne

Emacs  : GNU Emacs 30.0.60 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, 
cairo version 1.18.0)
Package: Org mode version 9.7.8 (N/A @ 
/gnu/store/bj2bsz76f14n3vfnkv556s8f1x66m9in-emacs-org-9.7.8/share/emacs/site-lisp/org-9.7.8/)
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de


signature.asc
Description: PGP signature


Re: Should we move constants.el by Carsten Dominik to Org orphanage?

2024-08-06 Thread Carsten Dominik
Is there a volunteer who would like to help creating a package for
constants.el?
I don't have experience creating packages

- Carsten

On Sun, Aug 4, 2024 at 8:49 PM Ihor Radchenko  wrote:

> Carsten Dominik  writes:
>
> >> > Yes, this is stable, and I am still maintaining it.
> >>
> >> Thanks for chiming in :)
> >> Have you considered publishing constants.el as GNU/non-GNU ELPA package?
> >>
> >
> > I have not yet considered that.  I think this package ha only few users.
> > Am I wrong about that?
>
> Maybe, maybe not. But I think that it may be the chicken-and-egg problem
> - constants.el may be not used because it is not available in the
> package repositories.
>
> I am asking mostly because Org mode declares support of constants.el in
> the manual:
>
> ‘constants.el’ by Carsten Dominik
>
>  Org can use names for constants in formulas in tables.  Org can
>  also use calculation suffixes for units, such as ‘M’ for ‘Mega’.
>  For a standard collection of such constants, install the
>  ‘constants’ package.  Install version 2.0 of this package,
>  available at .
>  Org checks if the function ‘constants-get’ has been autoloaded.
>  Installation instructions are in the file ‘constants.el’.
>
> ... and it would be nice to have it available via the usual M-x
> package-install.
>
> I also see no reason why this package would not be accepted - it is a
> useful package, especially when it can be installed without efforts.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>