Re: Explicit page breaks

2022-09-28 Thread Thomas S. Dye

Aloha all,

Juan Manuel Macías  writes:


Ihor Radchenko writes:

Do note that page breaks may or may not lay between paragraphs 
or Org
elements. By its nature, page break is an object (in Org 
terminology).


Indeed, page break can be placed anywhere. But inserting it 
before

paragraphs, at least in Org, is the least compromised by the
idiosyncrasies of each format: odt or LaTeX. And the most
format-agnostic. And on the other hand, in LaTeX and odt it's 
also the
safest place to put them, unless you want to add some 
fine-tuning in

either case.



This doesn't reach to paragraphs, but tags do a good job of 
inserting \clearpage and \newpage before a section heading in 
LaTeX export.  


** Rasmus filter headline tags

This function was improved by Rasmus Pank Roulund based on one I 
had

cobbled together from pieces posted on the Org mode mailing list.

#+name: rpr-filter-headline-tags
#+begin_src emacs-lisp :results silent
(defun tsd-filter-headline-tags (contents backend info)
 "Ignore headlines with tag `ignoreheading' and/or start LaTeX
 section with `newpage' or `clearpage' command."
 (cond ((and (org-export-derived-backend-p backend 'latex)
  (string-match "\\`.*newpage.*\n" (downcase contents))
  ;; if you want to get rid of labels use the string
  ;; "\\`.*ignoreheading.*\n.*\n"
	  (string-match "\\`.*ignoreheading.*\n" (downcase 
	  contents)))

 (replace-match "newpage\n" nil nil contents))
((and (org-export-derived-backend-p backend 'latex)
  (string-match "\\`.*clearpage.*\n" (downcase contents))
	  (string-match "\\`.*ignoreheading.*\n" (downcase 
	  contents)))

 (replace-match "clearpage\n" nil nil contents))
((and (org-export-derived-backend-p backend 'latex 'html 'ascii)
	  (string-match "\\`.*ignoreheading.*\n" (downcase 
	  contents)))

 (replace-match "" nil nil contents))
((and (org-export-derived-backend-p backend 'latex)
	  (string-match 
	  "\\(\\`.*?\\)\\(?:hfill{}\\)?textsc{.*?newpage.*?}\\(.*\n\\)"

(downcase contents)))
 (replace-match "newpage\n\\1\\2"  nil nil contents))
((and (org-export-derived-backend-p backend 'latex)
	  (string-match 
	  "\\(\\`.*?\\)\\(?:hfill{}\\)?textsc{.*?clearpage.*?}\\(.*\n\\)" 
	  (downcase contents)))

 (replace-match "clearpage\n\\1\\2"  nil nil contents
#+end_src

Hope this helps. If not, sorry for the noise.

All the best,
Tom

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



Re: [PATCH 2-v1] New: auto display inline images under subtree when `org-cycle'.

2022-09-28 Thread Christopher M. Miles

Ihor Radchenko  writes:

I got a new problem in patch, the (point-max) in function
~org-cycle-display-inline-images~ SOMETIMES return EOF error instead of
correct max point value when org-cycle `state' is ~'folded~. I can't
find out what caused this even using Edebug. Do you have any clue?

> "Christopher M. Miles"  writes:
>
>> Ok, I created the patch for subtree cycling display inline images.
>> Tested by edebug when org cycling, it should works fine. I don't know
>> how to write test for this.
>
> Thanks for the update!
>
> For tests, you will need to test the existence of image overlays.
> You can refer to test-org-fold/org-fold-reveal-broken-structure but
> need to test overlays-at instead of just org-invisible-p.
>

I will try to write tests later.

>> But I got a little problem:
>>
>> When ~org-fold-core-style~ is ~'overlays~, the ~delete-overlay~ will
>> cause subtree unfolded. More detailed check out the "org.el" function
>> ~org-remove-inline-images~ in my patch.
>
> I will comment in the code.
>
>>  (defcustom org-cycle-hook '(org-cycle-hide-archived-subtrees
>> -   org-cycle-show-empty-lines
>> -   org-cycle-optimize-window-after-visibility-change)
>> +org-cycle-show-empty-lines
>> +
>> org-cycle-optimize-window-after-visibility-change
>> +org-cycle-display-inline-images)
>>"Hook that is run after `org-cycle' has changed the buffer visibility.
>>  The function(s) in this hook must accept a single argument which indicates
>>  the new state that was set by the most recent `org-cycle' command.  The
>> @@ -229,6 +230,12 @@ normal outline commands like `show-all', but not with 
>> the cycling commands."
>>:group 'org-cycle
>>:type 'boolean)
>>  
>> +(defcustom org-cycle-inline-images-display nil
>> +  "Non-nil means auto display inline images under subtree when cycling."
>> +  :group 'org-startup
>> +  :group 'org-cycle
>> +  :type 'boolean)
>
> You are providing both hook and a customization. It is redundant. Users
> can already remove the hook when desired.

I mock this style from a very similar existing hook function
~org-cycle-hide-archived-subtrees~ and custom variable
~org-cycle-open-archived-trees~. I think removing a hook function from
~org-cycle-hook~ is a way, but not as convenient as defcustom option.
(P.S: I think users prefer this defcustom customization style.)

>
> In this area, we generally do not use custom variables (see M-x
> customize-group org-cycle). So, it is better to use hook.
>
>> -(defun org-remove-inline-images ()
>> +(defun org-remove-inline-images (&optional beg end)
>>"Remove inline display of images."
>>(interactive)
>> -  (mapc #'delete-overlay org-inline-image-overlays)
>> -  (setq org-inline-image-overlays nil))
>> +  (let* ((beg (or beg (point-min)))
>> + (end (or end (point-max)))
>> + (overlays (overlays-in beg end)))
>> +(dolist (ov overlays)
>> +  (delete ov org-inline-image-overlays))
>> +(mapc #'delete-overlay overlays)
>> +;; FIXME: `org-cycle-display-inline-images' can't fold because 
>> `delete-overlay' will unfold subtree.
>> +(when (eq org-fold-core-style 'overlays)
>> +  ;; FIXME: don't know how to get the correct `spec'.
>> +  (let ((spec (alist-get 'org-fold-hidden org-fold-core--specs)))
>> +(org-fold-core-region beg end t spec)
>
> You can just
>
> (dolist (ov overlays)
>   (when (memq ov org-inline-image-overlays)
> (setq org-inline-image-overlays (delq ov org-inline-image-overlays))
> (delete-overlay ov)))

Done

> Note that `delete' and `delq' are not safe to use on their own. You
> should always use (setq foo (delq 'member foo)). It is detailed in the
> docstring.

Thanks for teaching.

-- 

[ stardiviner ]
I try to make every word tell the meaning that I want to express without 
misunderstanding.

Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3


signature.asc
Description: PGP signature


Re: Explicit page breaks

2022-09-28 Thread Max Nikulin
Let me remind that the discussion originates from a complain that 
filling paragraph does not respect ^L character in the .org file. The 
topic starter have not provided more details concerning their use case, 
maybe it is irrelevant to export.


During export (LaTeX is not the only case, even HTML may be printed or 
saved as PDF and has some CSS attributes) \clearpage (or its equivalent) 
may be attributed to the end of a block level element or a beginning of 
it. In the latter case it should be preserved even if the previous 
heading is commented out. It resembles to a recent topic discussing 
wrapping exported heading or other elements into some template.


I agree that page breaking inside paragraph (at particular point or when 
current line is filled) is a different case. Degree of support may vary 
across export backends.





Re: Explicit page breaks

2022-09-28 Thread Juan Manuel Macías
Ihor Radchenko writes:

> Do note that page breaks may or may not lay between paragraphs or Org
> elements. By its nature, page break is an object (in Org terminology).

Indeed, page break can be placed anywhere. But inserting it before
paragraphs, at least in Org, is the least compromised by the
idiosyncrasies of each format: odt or LaTeX. And the most
format-agnostic. And on the other hand, in LaTeX and odt it's also the
safest place to put them, unless you want to add some fine-tuning in
either case.

Why would anyone want to add an explicit page break and interrupt the
natural flow of text on the page? It occurs to me that for two possible
reasons: a) for (let's say) "expressive" reasons, that is, because you
want certain content to start on a new page. And b) out of simple
necessity, to fix something you don't like: carry a line to the next
page, fix an overfull vbox in LaTeX, or a thousand other things.

Cuts by necessity can occur within the paragraph. But cutting a page
within a paragraph is a tricky thing. In libreoffice (and I think in any
word processor) you can place the cursor where you want to cut and press
control + enter. This creates a new page but also creates two
paragraphs, and we only want one paragraph, but with a page break in the
middle. I suppose that a forced line break should be added at the end of
the previous paragraph (and probably produce a very ugly result with
very wide spaces between words). But the section on the next page would
still be a new paragraph for libreoffice.

LaTeX is more refined, but the process and the caveats are the same.
\clearpage adds a new page (and a new paragraph) and terminates the old
one. And \pagebreak simply adds a page break (and the best place to add
it is between two paragraphs, I insist). If you have \flushbottom active
(by default in the book class), with \pagebreak LaTeX will do its best
to match the page height after \pagebreak, inserting the necessary
vertical space before the break. If you want to insert a page break
(\pagebreak) within a paragraph, LaTeX will choose the end of the line
to break. If you want to force the break exactly there, you'll probably
want to put something like \linebreak\par\pagebreak; again, you will now
find yourself with two paragraphs, and you will need to add at least one
\noindent before the second paragraph.

With all this, I mean: to what extent should Org care about all these
details, more related to fine-tuning the output format?

Best regards,

Juan Manuel 



Re: [PATCH] Fix org-comment-line-break-function

2022-09-28 Thread Ihor Radchenko
Kaushal Modi  writes:

> Hi Nicolas,
>
> I have added few tests in the updated patch pasted in this email.
> I have made the tests for (call-interactive #'default-indent-new-line)
> because that the interactive function M-j is bound to by default.
>
> Can you please review and commit it? The machine I am on right now does not
> allow external ssh access.

Unfortunately, we cannot rely on the built-in `comment-indent-new-line'
to fill Org comments. This is because Emacs uses a complex entanglement
of regexp heuristics to determine comment at point and its boundaries.

I am attaching an alternative patch to fix the issue using Org element
parser. Note that I reused your tests.

Best,
Ihor

>From ded35b55ca694e3eb831878160ac37ceec48b08e Mon Sep 17 00:00:00 2001
Message-Id: 
From: Ihor Radchenko 
Date: Thu, 29 Sep 2022 13:02:46 +0800
Subject: [PATCH] org-comment-line-break-function: Avoid built-in Emacs comment
 machinery

* lisp/org.el (org-comment-line-break-function): Rely on Org
parser (`org-adaptive-fill-function') to determine comment filling.
Handle nil values of `fill-prefix' correctly.

* testing/lisp/test-org.el (test-org/default-indent-new-line): New
test.  Written by Kaushal Modi 
https://list.orgmode.org/cafyqvy36dkbsny2mpxdnzweotjuk8maqgjm-zhxnamfreqg...@mail.gmail.com/

Reported-by: Richard Lawrence 
Link: https://list.orgmode.org/87lf18fue9.fsf@aquinas.i-did-not-set--mail-host-address--so-tickle-me/
---
 lisp/org.el  | 18 --
 testing/lisp/test-org.el | 20 
 2 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 036384a04..5ff60baf6 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -19295,12 +19295,18 @@ (defun org-comment-line-break-function (&optional soft)
   "Break line at point and indent, continuing comment if within one.
 The inserted newline is marked hard if variable
 `use-hard-newlines' is true, unless optional argument SOFT is
-non-nil."
-  (if soft (insert-and-inherit ?\n) (newline 1))
-  (save-excursion (forward-char -1) (delete-horizontal-space))
-  (delete-horizontal-space)
-  (indent-to-left-margin)
-  (insert-before-markers-and-inherit fill-prefix))
+non-nil.
+
+This function is a simplified version of `comment-indent-new-line'
+that bypasses the complex Emacs machinery dealing with comments.
+We instead rely on Org parser, utilizing `org-adaptive-fill-function'"
+  (let ((fill-prefix (org-adaptive-fill-function)))
+(if soft (insert-and-inherit ?\n) (newline 1))
+(save-excursion (forward-char -1) (delete-horizontal-space))
+(delete-horizontal-space)
+(indent-to-left-margin)
+(when fill-prefix
+  (insert-before-markers-and-inherit fill-prefix
 
 
 ;;; Fixed Width Areas
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 1b4157d0e..4a6a3a0b0 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -1405,6 +1405,26 @@ (ert-deftest test-org/indent-region ()
 	(org-indent-region (point-min) (point-max))
 	(buffer-string)
 
+(ert-deftest test-org/default-indent-new-line ()
+  "Test behavior of default binding `M-j'."
+  ;; Calling `M-j' when point is not in an Org comment:
+  (should
+   (equal "* Some heading\n"
+  (org-test-with-temp-text "* Some heading"
+   (call-interactively #'default-indent-new-line)
+   (buffer-string
+  ;; Calling `M-j' when point is in an Org comment:
+  (should
+   (equal "# Some Org comment\n# "
+  (org-test-with-temp-text "# Some Org comment"
+   (call-interactively #'default-indent-new-line)
+   (buffer-string
+  (should
+   (equal "# Some Org\n# comment"
+  (org-test-with-temp-text "# Some Org comment"
+   (call-interactively #'default-indent-new-line)
+   (buffer-string)
+
 
 
 ;;; Editing
-- 
2.35.1


-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92


html accessibility and orgmode

2022-09-28 Thread Jude DaShiell
This may be informative.
https://beta.ada.gov/resources/web-guidance/#top
Release date on this was March of 2022.



Jude 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)

.



Add \usepackage{cmap} as default LaTeX class in ox-latex (was: org exported pdf files)

2022-09-28 Thread Ihor Radchenko
Max Nikulin  writes:

> On 28/09/2022 10:07, Ihor Radchenko wrote:
>> Max Nikulin writes:
>> 
>>> - What TeX engine do you use? E.g. for PdfLaTeX it may be necessary to
>>> add \usepackage{cmap} immediately after \documentclass. Unicode engines
>>> like LuaTeX likely do not require such trick.
>> 
>> I am wondering if having cmap should be a good default in general.
>> Not just for accessibility.
>
> For me it must have, but I am a rare person on this mail list who is 
> happy with the Computer Modern font (actually cm-super Type 1 font). I 
> have never tried .ttf fonts with PdfLaTeX and I am unaware of effect of 
> \usepackage{cmap} in that case.

May others familiar with LaTeX comment on this?
If it is safe to add cmap to default LaTeX template, I see no reason why
we should not.

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Org HTML export accessibility (was: org exported pdf files)

2022-09-28 Thread Ihor Radchenko
Tim Cross  writes:

> Note that org also lacks any accessibility support for HTML generated
> documents as well. However, this is less problematic as authors do have
> some ability to add the necessary attributes that can improve
> accessibility - an option not available with Latex.

Can we do anything about it?
Are there any available standards on how accessible HTML document should
look like?

Unlike PDF where we rely on LaTeX, Org generates the final form of the
HTML documents. Hence, we have the full control (and responsibility) to
support accessibility. At least, as a customization.

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: Org, Hyperbole, and eev

2022-09-28 Thread Ihor Radchenko
Jean Louis  writes:

> Let us say that link is:
>
>  (link "Duck" (browse-url "http://www.duckduckgo.com";))
>
> such link should be displyed as:
>
>  __Duck__ (underlined)
>
> but just as in Org mode to have toggle options descriptive or
> non-descriptive links.
>
> and that I can inject the format of the link like parenthesis and
> simple into such generic way of making links. It would go beyond Org
> that way and be available in any modes.

org-open-at-point-global can work outside Org to open Org links.

For Org-like fontification, you can add an entry to font-lock-keywords
that will fontify anything matching org-link-any-re and apply
org-activate-links. However, you may need to rewrite org-activate-link
to work outside Org mode. It should not be prohibitively hard.

(I suspect that Hyperbole could be the right place to request the
fontification feature - they already take care about fontification of
implicit buttons; may as well extend it)

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: org-capture and fast selection of tags

2022-09-28 Thread Ihor Radchenko
Christian Heinrich  writes:

> unfortunately, I didn't have any time to incorporate your comments but this 
> is still on my todo
> list. I hope I will have more time soon, but it will most likely take me a 
> few weeks.

No problem. It's not like we are in rush. Just wanted to make sure that
this email thread did not slip through the cracks.

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: Org ML integration with an existing Discourse instance

2022-09-28 Thread Ihor Radchenko
Bastien  writes:

>>> Not just this: I’m concerned with setting up a user-to-user discussion
>>> space that reify a split between users (on a forum) and developers (on
>>> the mailing list).
>>
>> For what it’s worth, as a developer I’d be very interested in the ability of 
>> a
>> forum to categorise feature requests/bug reports/workflow discussions, etc.
>
> But then the ML and the forum would compete with each other from a
> maintainer's point a view: the ones using solely the ML would not get
> the same information than the ones using the forum.

I do not know the details about Discourse-email integration. If category
changes are also emailed, Woof! might be able to work with those.

In any case, we cannot really expect everything going on in Discourse to
be reflected on Org ML. Org ML will always get less metadata and, as
discussed, we do not even aim to sync all the Discourse posts with Org
ML - just relevant.

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: IM dev discussions?

2022-09-28 Thread Ihor Radchenko
Bastien  writes:

>> Which social website do you have in mind?
>>
>> I can ask @alphapapa from /r/orgmode.
>>
>> I guess we can also ask people hanging out on Doom discord and
>> discourse.
>>
>> Maybe also Org roam people. They have discourse.
>
> I'm short of additional ideas.  This is a good start already!
>
> If they are willing to become contributors stewards on these places, I
> suggest we advertize this on worg/org-maintenance.org in a new section
> dedicated to contributor stewards.

Can we also post a dedicated announcement to be displayed at
updates.orgmode.org?

>> I am unsure how visible this kind of information will be for new
>> third-party package maintainers.
>>
>> Should we add some information to Appendix A Hacking section of the
>> manual? (something along the lines that one may contact Org maintainers
>> in other media like IRC, Matrix, etc and then link to
>> worg/org-maintenance.org)
>
> I added a "Web presence of maintainers" section in
> https://orgmode.org/worg/org-maintenance.html right after the first
> one - please go ahead with adding relevant information.
>
> I think this is really "community" information, not something that
> pertains to the manual.

Thanks!
I added myself.

>> And, of course, we need to announce this to the existing maintainers.
>> Upcoming Emacsconf may be a good opportunity.
>
> We could also have an informal OrgConf as a one day gathering online
> for bug squashing and discussing community topics like this one.  :)

This is a good idea. In particular, for technical questions.
Also, we may invite third-party package developers, though I may be
asking for too much here.

However, EmacsConf might be best for communicating the ordinary users:
- Discourse idea
- New releases (think of https://emacsconf.org/2021/talks/dev-update/)
- Major announcements like new repositories; sr.ht projects; calls for
  maintenance and other help; etc

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: Explicit page breaks (was: Create in Org a bilingual book with facing pages)

2022-09-28 Thread Ihor Radchenko
Juan Manuel Macías  writes:

> Well, considering that the most sensible place (IMO) to introduce an
> explicit page break would be before almost anything that isn't a section
> (since in sections page breaks should be defined by style), how about
> something like this:
>
> #+ATTR_LATEX: :pagebreak \clearpage
> #+ATTR_ODT: :pagebreak t
> Lorem ipsum dolor sit amet, consectetuer adipiscing elit...
>
> (In the case of LaTeX the expected value of :pagebreak could be any of
> several commands that LaTeX has for page breaking (or any other
> arbitrary code). And if you put :pagebreak t, the default value would be
> \pagebreak.
>
> And to introduce an explicit break before a heading, the above could be
> added as a property.

I do not like this idea.

Do note that page breaks may or may not lay between paragraphs or Org
elements. By its nature, page break is an object (in Org terminology).

I do understand your desire to allow putting page breaks before
headings. However, I think that proliferation of such export options is
a mistake. Instead, we should provide a generic way to define pre/post
text when exporting headings. We do discuss :export_templates in the
other thread, and we may as well define something similar but for
including the normal Org markup. (It should not be a property - I'd
rather have Org markup to be placed directly into the document and not
hidden inside properties drawer).

In any case, I'd rather discuss the question of putting staff prior to
exported heading in the :export_template thread.

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: [PATCH 2-v1] New: auto display inline images under subtree when `org-cycle'.

2022-09-28 Thread Ihor Radchenko
"Christopher M. Miles"  writes:

> Ok, I created the patch for subtree cycling display inline images.
> Tested by edebug when org cycling, it should works fine. I don't know
> how to write test for this.

Thanks for the update!

For tests, you will need to test the existence of image overlays.
You can refer to test-org-fold/org-fold-reveal-broken-structure but
need to test overlays-at instead of just org-invisible-p.

> But I got a little problem:
>
> When ~org-fold-core-style~ is ~'overlays~, the ~delete-overlay~ will
> cause subtree unfolded. More detailed check out the "org.el" function
> ~org-remove-inline-images~ in my patch.

I will comment in the code.

>  (defcustom org-cycle-hook '(org-cycle-hide-archived-subtrees
> -org-cycle-show-empty-lines
> -org-cycle-optimize-window-after-visibility-change)
> +org-cycle-show-empty-lines
> +org-cycle-optimize-window-after-visibility-change
> +org-cycle-display-inline-images)
>"Hook that is run after `org-cycle' has changed the buffer visibility.
>  The function(s) in this hook must accept a single argument which indicates
>  the new state that was set by the most recent `org-cycle' command.  The
> @@ -229,6 +230,12 @@ normal outline commands like `show-all', but not with 
> the cycling commands."
>:group 'org-cycle
>:type 'boolean)
>  
> +(defcustom org-cycle-inline-images-display nil
> +  "Non-nil means auto display inline images under subtree when cycling."
> +  :group 'org-startup
> +  :group 'org-cycle
> +  :type 'boolean)

You are providing both hook and a customization. It is redundant. Users
can already remove the hook when desired.

In this area, we generally do not use custom variables (see M-x
customize-group org-cycle). So, it is better to use hook.

> -(defun org-remove-inline-images ()
> +(defun org-remove-inline-images (&optional beg end)
>"Remove inline display of images."
>(interactive)
> -  (mapc #'delete-overlay org-inline-image-overlays)
> -  (setq org-inline-image-overlays nil))
> +  (let* ((beg (or beg (point-min)))
> + (end (or end (point-max)))
> + (overlays (overlays-in beg end)))
> +(dolist (ov overlays)
> +  (delete ov org-inline-image-overlays))
> +(mapc #'delete-overlay overlays)
> +;; FIXME: `org-cycle-display-inline-images' can't fold because 
> `delete-overlay' will unfold subtree.
> +(when (eq org-fold-core-style 'overlays)
> +  ;; FIXME: don't know how to get the correct `spec'.
> +  (let ((spec (alist-get 'org-fold-hidden org-fold-core--specs)))
> +(org-fold-core-region beg end t spec)

You can just

(dolist (ov overlays)
  (when (memq ov org-inline-image-overlays)
(setq org-inline-image-overlays (delq ov org-inline-image-overlays))
(delete-overlay ov)))

Note that `delete' and `delq' are not safe to use on their own. You
should always use (setq foo (delq 'member foo)). It is detailed in the
docstring.

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: [BUG] jump-to-captured no longer works [9.6 (9.6-??-1c7acb4 @ /Users/aibragim/.emacs.d/.local/straight/build-28.2/org/)]

2022-09-28 Thread Ihor Radchenko
Ag Ibragimov  writes:

> Org capture no longer jumping to destination, even when
> :jump-to-captured set to t in the capture template.

I am unable to reproduce on my side using the latest main branch.
Can you please provide detailed steps you performed to get the erroneous
behaviour? See https://orgmode.org/manual/Feedback.html

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: [BUG] beamer export

2022-09-28 Thread Ihor Radchenko
Leo Butler  writes:

> The following Org document shows a bug in the beamer exporter.

Confirmed on main.

There are two bugs reported here:
1. ox-latex export bug for src blocks containing direct LaTeX when
   org-latex-src-block-backend is set to its default 'verbatim value
2. ox-beamer export bug as described in the attached org file

Daniel, can you please take a look at the first bug?
I suspect that \commands should be additionally escaped in verbatim
environment, similar to
https://stackoverflow.com/questions/3019774/how-write-this-in-verbatim-latex

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: The Org mode in the Org Git does not export

2022-09-28 Thread Ihor Radchenko
Rudolf Adamkovič  writes:

> UPDATE.
>
> I tried exporting again (after some document clean up; most probably
> unrelated); and I found that exporting sometimes works!
>
> Four attempts, chronologically:
>
> 1. New Org, nil cache + core overlays -- 3 minutes 21 seconds
> 2. New Org -- 3 minutes 22 seconds
> 3. Old Org -- 12 seconds
> 4. New Org (again) -- aborted (C-g) after 5 minutes and 30 seconds
>
> 3 minutes and 22 seconds make exports unbearably slow, but at least
> possible.  What gives?

Thanks for the update!
What if you run M-x org-element-cache-reset after exiting the hang?

Also, if you can get the export finish, can you also share the profiler
report? (M-x profiler-report-write-profile from inside the profiler
report buffer).

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: emacs really slow when inserting a new source code block

2022-09-28 Thread Ihor Radchenko
Luca Ferrari  writes:

>> I'm trying to understand what could be eating all the cpu.
>>
>
> So far, turning off flyspell-mode makes Emacs work fine again. Strange...

Do you have any flyspell-related configuration in your config?

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: Compiling a C++ source block

2022-09-28 Thread Ihor Radchenko
tbanelwebmin  writes:

> You may try:
> #+header: :includes '("" "")

I notice that
https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-C.html
only has examples of a single library being using in :includes
parameter.

Although the text description does mention list of strings, it would be
nice if there was an example using :includes with multiple libraries
and/or local libraries.

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



[BUG] jump-to-captured no longer works [9.6 (9.6-??-1c7acb4 @ /Users/aibragim/.emacs.d/.local/straight/build-28.2/org/)]

2022-09-28 Thread Ag Ibragimov


Org capture no longer jumping to destination, even when
:jump-to-captured set to t in the capture template.


Emacs  : GNU Emacs 28.2 (build 2, x86_64-apple-darwin21.6.0, NS appkit-2113.60 
Version 12.6 (Build 21G115))
 of 2022-09-28
Package: Org mode version 9.6 (9.6-??-1c7acb4 @ 
/Users/aibragim/.emacs.d/.local/straight/build-28.2/org/)

current state:
==




[BUG] beamer export

2022-09-28 Thread Leo Butler
The following Org document shows a bug in the beamer exporter.

#+TITLE: Writing Beamer presentations in org-mode
#+AUTHOR:Eric S Fraga
#+AUTHOR:(bug report by Leo Butler)
#+EMAIL: e.fr...@ucl.ac.uk
#+DATE:  2010-03-30 Tue
#+DESCRIPTION: 
#+KEYWORDS: 
#+LANGUAGE:  en
#+OPTIONS:   H:2 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 
path:https://orgmode.org/org-info.js
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+HTML_LINK_UP:
#+HTML_LINK_HOME:
#+LATEX_COMPILER: lualatex
#+startup: beamer
#+LaTeX_CLASS: beamer
#+LaTeX_CLASS_OPTIONS: [bigger]
#+COLUMNS: %40ITEM %10BEAMER_env(Env) %9BEAMER_envargs(Env Args) 
%4BEAMER_col(Col) %10BEAMER_extra(Extra)


* A Bug Report about the Beamer Tutorial

** 
#+begin_src elisp :exports both
(org-version)
#+end_src

#+RESULTS:
: 9.5.2

** The bug
The [[https://orgmode.org/worg/exporters/beamer/tutorial.html][Beamer tutorial 
by Eric Fraga]]
([[https://orgmode.org/worg/exporters/beamer/tutorial.html]]) has an
example that shows how to create a two column frame using org. The
first column is not identified, though.

** The Org code
Here is the org code.
\tiny
#+begin_src org :exports code
  ,** Two columns
  ,*** A block   :B_ignoreheading:BMCOL:
  :PROPERTIES:
  :BEAMER_env: ignoreheading
  :BEAMER_col: 0.4
  :END:
  - this slide consists of two columns
  - the first (left) column has no heading and consists of text
  - the second (right) column has an image and is enclosed in an
@example@ block

  ,*** A screenshot:BMCOL:B_example:
  :PROPERTIES:
  :BEAMER_col: 0.6
  :BEAMER_env: example
  :END:
  ,#+ATTR_LaTeX: :width \textwidth
  [[./a-simple-slide.png]]
#+end_src

** The \LaTeX{} code
Here is the generated \LaTeX{} code. I needed to add comment characters (%) to 
each line due to a bug in the =verbatim= environment.\pause
\tiny
#+begin_src latex :exports code
  % \begin{frame}[label={sec:orgcc0ebff}]{Two columns}
  % \begin{itemize}
  % \item this slide consists of two columns
  % \item the first (left) column has no heading and consists of text
  % \item the second (right) column has an image and is enclosed in an
  % @example@ block
  % \end{itemize}

  % \begin{column}{0.6\columnwidth}
  % \begin{example}[A screenshot]
  % \begin{center}
  % \includegraphics[width=\textwidth]{./a-simple-slide.png}
  % \end{center}
  % \end{example}
  % \end{column}
  % \end{columns}
  % \end{frame}
#+end_src
\pause\normalsize
The first =itemize= environment should have been wrapped by a =column= 
environment inside the =columns= environment.


Re: org-capture and fast selection of tags

2022-09-28 Thread Christian Heinrich
Hi Ihor,

unfortunately, I didn't have any time to incorporate your comments but this is 
still on my todo
list. I hope I will have more time soon, but it will most likely take me a few 
weeks.

Thanks for checking in with me, I really appreciate your support!

Best regards
Christian

On Tue, 2022-08-23 at 10:17 +0800, Ihor Radchenko wrote:
> 
> Christian, did you get a chance to take a look at my further comments on
> the patch?
> 


signature.asc
Description: This is a digitally signed message part


Re: The Org mode in the Org Git does not export

2022-09-28 Thread Rudolf Adamkovič
Rudolf Adamkovič  writes:

> No luck!

UPDATE.

I tried exporting again (after some document clean up; most probably
unrelated); and I found that exporting sometimes works!

Four attempts, chronologically:

1. New Org, nil cache + core overlays -- 3 minutes 21 seconds
2. New Org -- 3 minutes 22 seconds
3. Old Org -- 12 seconds
4. New Org (again) -- aborted (C-g) after 5 minutes and 30 seconds

3 minutes and 22 seconds make exports unbearably slow, but at least
possible.  What gives?

Rudy
-- 
"Programming reliably -- must be an activity of an undeniably
mathematical nature […] You see, mathematics is about thinking, and
doing mathematics is always trying to think as well as possible."
-- Edsger W. Dijkstra, 1981

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



Re: org exported pdf files

2022-09-28 Thread Juan Manuel Macías
Hi, Tim

Tim Cross writes:

> An unfortunate situation really - especially given Emacs has one of the
> most powerful and advanced accessibility options available via
> emacspeak.
>
> I also won't hold my breath for a new latgex core. THe latex3 initiative
> seems to have failed or at least appears to be slower to be realised than 
> perl6! 

You may find this article by Frank Mittelbach from 2020 interesting,
about the future of LaTeX and the challenges to be solved, including the
accessibility issues:

https://www.latex-project.org/publications/2020-FMi-TUB-tb128mitt-quovadis.pdf

On the other hand, there is also ConTeXt. I don't know much about
ConTeXt, but I remember reading somewhere that ConTeXt is more mature
than LaTeX on PDF tagging and accessibility issues. I don't know if
there are any ConTeXt experts on the list who can confirm this... In any
case, an ox-context already exists for org, written by Jason Ross.

Best regards,

Juan Manuel 

-- 
--
--
Juan Manuel Macías 

https://juanmanuelmacias.com

https://lunotipia.juanmanuelmacias.com

https://gnutas.juanmanuelmacias.com




Re: org exported pdf files

2022-09-28 Thread Timothy
Hi Tim,

> None of what yuo wrote is a surprise. Unfortunately, it does mean two
> things
>
> 1. Org mode cannot be used to create accessible PDF documents as long as
> it depends on the latex environment to generate those documents.

It means that Org mode cannot /currently/ be used…

I have hope that in 1-2y this will change.

> 2. Technically, Org mode cannot be used in any organisation (specifically 
> government

Can’t comment on this.

> I don’t know if other document processors, like perhaps pandoc, can
> create PDF files which contain the tagging and other structural
> metadatra necessary to make PDFs accessible.

Pandoc’s PDFs via LaTeX will have exactly the same problem.

> Note that org also lacks any accessibility support for HTML generated
> documents as well. However, this is less problematic as authors do have
> some ability to add the necessary attributes that can improve
> accessibility - an option not available with Latex.

HTML has more inherent structure, so this situation is already much better.

> An unfortunate situation really - especially given Emacs has one of the
> most powerful and advanced accessibility options available via
> emacspeak.

Well, Emacs is a bit divorced from this problem.

> I also won’t hold my breath for a new latgex core. THe latex3 initiative
> seems to have failed or at least appears to be slower to be realised than 
> perl6!

Hmm? LaTeX3 switched gear, and arguably is working nicely. I expect you’re
currently using quite a few bits of LaTeX3, even if you don’t know it.

The accessibility effort was started ~2y ago, seems to be making progress
(stalled a bit with covid), and is funded with a roadmap. I see good reason to
think the current situation will change.

All the best,
Timothy


Re: org exported pdf files

2022-09-28 Thread Tim Cross


Timothy  writes:

> Hi Tim,
>
>> It would probably be good to add the two above packages as part of the
>> ’default’ package preamble, but this would require considerable testing
>> as it isn’t known if there will be adverse effects when mixed with other
>> packages.
>
> Those packages are early accessibility experiments, and are /not/ intended for
> wider use. See the top of the 
> README: “Prototype. Not suitable for production”.  The author themselves said 
> in
> a [2020 tex.SE answer] that:
>
>   `accessibility' was developed and published back in 2007 as a proof of 
> concept for
>   some of the KOMA document styles. I got hold of the files from the 
> author in
>   2019 and took over maintenance with her permission. I tidied up the 
> package
>   enough to get it to CTAN, but didn’t update the functionality. I also 
> published
>   it to GitHub to get some feedback on it.
>
>   It seems to have worked well in 2007 for a few test cases. 
> Unfortunately it now
>   fails every test case, and it looks like needing some serious efforts 
> to fix.
>
>   Because of this I no longer think that accessibility is fit for purpose.
>
> They also go on to make a comment I’ve seen a few times from the people 
> working
> on the latex3 accessibility project — basically that in order to actually get
> a /good/ solution, we’ll need to wait till support is baked into the LaTeX 
> core.
>
> If we’re desperate to add this, we’ll likely want to look at `tagpdf' which is
> written by someone working on the latex3 accessibility project. It is 
> apparently
> capable of passing PCA3, however according to the author:
>
>   `tagpdf' hasn’t been written as a user package but to allow experiments 
> and tests
>   and to help to identify missing interfaces in the kernel and in 
> packages. It can
>   change at any time in incompatible ways and it requires some skills to 
> use it.
>
> So, while it may be a particularly boring answer, I think “wait and see” is 
> our
> current best bet.
>
> All the best,
> Timothy
>
>
> [2020 tex.SE answer] 

None of what yuo wrote is a surprise. Unfortunately, it does mean two
things

1. Org mode cannot be used to create accessible PDF documents as long as
it depends on the latex environment to generate those documents. 

2. Technically, Org mode cannot be used in any organisation (specifically 
government
funded) where ther are policies which require that documents be
accessible. For example, technically, this means we cannot use org mode
in Australian government organisations, which would also include
Universities. I suspect other countries have similar accessibility
requriements, especially in government and government funded
organisations). 

I say technically because despite such policies, the level of
accessibility in many work and educational environments is very poor. In
Australia, few government departments have reached the accessibility
levels specified in policies which are now nearly 20 years old. The
private sector is even worse. While I have seen improvements in the last
40 years, I have yet to work in an environment where just a majority of
the systems I need to access in order to do my job effectively meet
minimal accessibility standards. 

I don't know if other document processors, like perhaps pandoc, can
create PDF files which contain the tagging and other structural
metadatra necessary to make PDFs accessible.

Note that org also lacks any accessibility support for HTML generated
documents as well. However, this is less problematic as authors do have
some ability to add the necessary attributes that can improve
accessibility - an option not available with Latex.

An unfortunate situation really - especially given Emacs has one of the
most powerful and advanced accessibility options available via
emacspeak.

I also won't hold my breath for a new latgex core. THe latex3 initiative
seems to have failed or at least appears to be slower to be realised than 
perl6! 




Re: org exported pdf files

2022-09-28 Thread Max Nikulin

On 28/09/2022 10:07, Ihor Radchenko wrote:

Max Nikulin writes:


- What TeX engine do you use? E.g. for PdfLaTeX it may be necessary to
add \usepackage{cmap} immediately after \documentclass. Unicode engines
like LuaTeX likely do not require such trick.


I am wondering if having cmap should be a good default in general.
Not just for accessibility.


For me it must have, but I am a rare person on this mail list who is 
happy with the Computer Modern font (actually cm-super Type 1 font). I 
have never tried .ttf fonts with PdfLaTeX and I am unaware of effect of 
\usepackage{cmap} in that case.





Re: org exported pdf files

2022-09-28 Thread Max Nikulin

On 28/09/2022 13:48, Jude DaShiell wrote:

I don't make pdf files or make pdf files available for
anyone else.


Then what is the origin of "these" PDF files you mentioned in your first 
post?


If you actually use pdftotext, I am unsure concerning effect of setting 
language for you.


> Adobe has plenty of pdf accessibility guidelines available for those
> interested in accessibility to implement.

In general my experience is that plenty of guidelines actually means 
that most of them are already obsolete or describe intentions that have 
never been implemented. So someone should provide more precise technical 
details and links to documents describing currently used techniques. 
Just links provided by a search engine may be hardly relevant to real 
experience of users of assistive technologies.




Re: emacs really slow when inserting a new source code block

2022-09-28 Thread Luca Ferrari
On Wed, Sep 28, 2022 at 3:15 PM Ihor Radchenko  wrote:
> I have not idea except that you may have something really strange in
> your config.

I'm trying to understand what could be eating all the cpu.

> What if you open the file in a clean Emacs instance? See
> https://orgmode.org/manual/Feedback.html

Clearly, -Q makes emacs work like a charm.

Luca



Re: The Org mode in the Org Git does not export

2022-09-28 Thread Rudolf Adamkovič
Ihor Radchenko  writes:

Thank you for helping me, Ihor.

> Let's try to approach this problem from another direction.
>
> Can you please set org-element-use-cache to nil and org-fold-core-style
> to 'overlays in your config and try the export again?

No luck!  I used the following configuration in '.emacs', FYI:

;; Make the Org mode less dependent on the arrow keys.
;; From the documentation: "You must set it before loading Org."
(setq-default org-use-extra-keys t)

;; Minimal configuration.
(setq org-export-use-babel nil
  org-export-with-broken-links 'mark
  org-cite-csl-styles-dir "~/"
  org-cite-export-processors '((t csl)))
(with-eval-after-load 'ox
  (require 'oc-csl))

;; EXPERIMENT
(setq org-element-use-cache nil
  org-fold-core-style 'overlays)

;; Load the latest Org mode.
(add-to-list 'load-path "~/src/org-mode/lisp/")

> If you see not improvement, we may arrange a screen session for more
> interactive debugging.

Amazing!  I can pay for your time, of course.

Rudy
-- 
"'Contrariwise,' continued Tweedledee, 'if it was so, it might be; and
if it were so, it would be; but as it isn't, it ain't.  That's logic.'"
-- Lewis Carroll, Through the Looking Glass, 1871/1872

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



Re: emacs really slow when inserting a new source code block

2022-09-28 Thread Ihor Radchenko
Luca Ferrari  writes:

> No, there is no buffer named cpu nor memory nor something alike in the
> buffer list.

I have not idea except that you may have something really strange in
your config.

> Besides, I'm now more able to reproduce the original issue: I open one
> of my perl-based org files, and it takes a lot, then I switch to
> overview and it requires almost a minute to collapse all the headings.
> Never seen nothing like this before.

What if you open the file in a clean Emacs instance? See
https://orgmode.org/manual/Feedback.html

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: The Org mode in the Org Git does not export

2022-09-28 Thread Max Nikulin

On 28/09/2022 19:55, Rudolf Adamkovič wrote:

Rudolf Adamkovič writes:

Also, I forgot to mention that Org mode from Org/Git 'main' quietly
deletes all COMMENT headings from my notebook, including their content
(!), and inlines all macros.  I have no idea why, but if I did not use
Git, I would have lost important data.  Scary!


Export as org could generate such result, but it adds additional .org 
suffix to the file name, so it is strange if your file was overwritten.






Re: Create in Org a bilingual book with facing pages

2022-09-28 Thread Hendursaga
Juan Manuel Macías  writes:

>> What is the name of this book / the publisher's page? I don't really know 
>> Spanish, and only a little Greek, but I'm fascinated by bilingual editions, 
>> especially with critical apparati. I've been looking for a workflow for 
>> creating my own (possibly critical) bilingual works, but so far, months 
>> later, I haven't really found anything satisfactory.
>
> Demóstenes y Esquines, Cartas atribuidas. Publisher: Dykinson.
>
> Perhaps it is not yet in the catalog, because the book is very recent.

Yeah, it doesn't appear to be in the catalog just yet. I'll look for it again 
sometime later!

> On this page you can see other critical editions (among other books) that I 
> have produced: https://maciaschain.gitlab.io/lunotipia/muestra_trabajos.html. 
> Certainly critical editions are some of the most fascinating kinds of books 
> out there. My favorites are the Oxford Classical Texts, the Budé Collection, 
> and Teubner. In bilingual format the Loeb Classical Texts are also excellent. 
> All these have marked a canon.

I'll look through that page sometime! As for your favorites, I already have 
some of them on my lists, but I'll look at the others!

> I think that the automatic synchronization of the facing pages of a bilingual 
> editions, either in TeX or in any other software, is a utopia.

I was beginning to think even state-of-the-art isn't sufficient yet :-/

> In the case of TeX/LaTeX, the single-thread TeX limitation is also added. 
> Packages like parallel (or paracol, which is newer) work fine when dealing 
> with simple text. At more complexity they are unusable. And furthermore, in 
> this case text A is a critical edition that needs its own configuration. 
> Parallel or paracol simply don't work here.

Have you done any works that are parallel / bilingual that parallel, paracol, 
or whatnot would probably be sufficient?  

> You might also want to take a look at ekdosis, a new package for critical 
> editions. It is not as complete as reledmac (for now), but it has some 
> interesting features, such as the possibility of exporting to TEI.

Ah! I had that somewhere in my bookmarks; now that I have more knowledge on 
TEI, I might take a closer look! I would've thought importing TEI as opposed to 
exporting would be the easier / better way, though..

> [...] For critical editions (among other text types for Humanities), the 
> standard for storing textual data is TEI 
> (https://en.wikipedia.org/wiki/Text_Encoding_Initiative). The problem with 
> TEI (at least for me) is that it consists of XML, and I hate XML :-). In this 
> regard, I think that a lightweight markup language as powerful as Org could 
> be a good alternative to TEI. And Org is indeed human-readable. One could 
> even think of a possible Org backend for TEI...

I also hate XML, but that's mostly when aiming for 100% compliance. A lot of 
features I really don't care for, and I really think the namespacing could've 
been much simpler, but with a superior editor like Emacs or perhaps a 
specialized one, I'd like to think much of the chore of TEI goes away..

Question: have you looked at other (open-source) typesetting engines besides 
the TeX family? Like, say, *roff? In some ways, I prefer groff's way to TeX, 
but it being a much smaller community, with a much smaller ecosystem, gets in 
the way..

Cheers,
Hendursaga



Re: Create in Org a bilingual book with facing pages

2022-09-28 Thread Juan Manuel Macías
Hendursaga writes:

> I'll look through that page sometime! As for your favorites, I already
> have some of them on my lists, but I'll look at the others!

There are also the Renaissance editions, especially those by Aldo
Manuzio or Robert Estienne, which are true works of art. One of my free
time projects is trying to reproduce with LuaTeX an edition of Aldo
Manuzio (including the imperfections), but since I have less and less
free time in my life it is a project that is on the dead track
indefinitely :-)

> Have you done any works that are parallel / bilingual that parallel,
> paracol, or whatnot would probably be sufficient?

When I have tried to do something in real production with these packages
I have always had some problem. But I have done many tests with less
complex text and they do not work badly. Especially paracol, which is
based on multicol.

>> [...] For critical editions (among other text types for Humanities),
>> the standard for storing textual data is TEI
>> (https://en.wikipedia.org/wiki/Text_Encoding_Initiative). The
>> problem with TEI (at least for me) is that it consists of XML, and I
>> hate XML :-). In this regard, I think that a lightweight markup
>> language as powerful as Org could be a good alternative to TEI. And
>> Org is indeed human-readable. One could even think of a possible Org
>> backend for TEI...
>
> I also hate XML, but that's mostly when aiming for 100% compliance. A
> lot of features I really don't care for, and I really think the
> namespacing could've been much simpler, but with a superior editor
> like Emacs or perhaps a specialized one, I'd like to think much of the
> chore of TEI goes away..

Yeah, TEI has become, whether we like it or not, the standard for the
transmission of texts in the digital Humanities. Certainly a TEI-mode
for Emacs, or even a TEI backend for Org would be two wonderful things
if they existed. But I imagine it would also be a tremendous job to make
them exist :-)

> Question: have you looked at other (open-source) typesetting engines
> besides the TeX family? Like, say, *roff? In some ways, I prefer
> groff's way to TeX, but it being a much smaller community, with a much
> smaller ecosystem, gets in the way..

I did something with *roff, but it was a long time ago and nothing worth
remembering. I know *roff still has fans, and I remember seeing a
version out there that incorporates TeX's line break algorithms and has
support for opentype features. A kind of TeXroff, from what I
understand.

Most of my "typographical life" has revolved around TeX. But I entered
the world of TeX not through a standard TeX but through Omega, which was
an experimental version of TeX with Unicode support and a lot of very
sophisticated features, some of which not even LuaTeX has now by the
way, LuaTeX has taken a lot of ideas from Omega). Omega was fascinating,
but a horror to use. To install a TrueType font you had to go through a
few processes. Before using exclusively free software, I also used Adobe
Indesign quite a bit, and know it reasonably well. In fact InDesign has
also borrowed a lot from TeX.

Lately there have been some very interesting (and open source) projects
of new typesetting systems based on TeX but more modern. Among them, I
am very attracted to SILE (https://sile-typesetter.org/), and I have
played quite a lot with this system. It is written entirely in Lua and
supports multithreading. But this and other new projects have one major
problem (IMO): LaTeX. Or, rather, the absence of LaTeX. TeX and any
other typesetting system based on it is unusable as such. Its primitives
are a series of basic physical processes on the page. The good news is
that Knuth made TeX extensible (like Emacs) to be used through a
'format'. And LaTeX format, with its vast repertoire of macro packages,
has made TeX usable by a huge range of users. All those macro packages
are a job already done that nobody is going to be willing to do it
again. Therefore, I believe that any new typesetting system that is not
(in some way) compatible with LaTeX will unfortunately be doomed. The
alternative is that something modular and monolithic like ConTeXt might
emerge, but not with the richness and variety (sometimes excessive,
admittedly) of LaTeX.

Best regards,

Juan Manuel 




Re: The Org mode in the Org Git does not export

2022-09-28 Thread Rudolf Adamkovič
Rudolf Adamkovič  writes:

Also, I forgot to mention that Org mode from Org/Git 'main' quietly
deletes all COMMENT headings from my notebook, including their content
(!), and inlines all macros.  I have no idea why, but if I did not use
Git, I would have lost important data.  Scary!

Rudy
-- 
"I love deadlines.  I love the whooshing noise they make as they go by."
-- Douglas Adams, The Salmon of Doubt, 2002

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



Re: The Org mode in the Org Git does not export

2022-09-28 Thread Rudolf Adamkovič
Ihor Radchenko  writes:

Thank you for helping me out.

Context:

With all this talk about Emacs 29 around the corner, I became scared
that the upcoming Org will render my Org notes unusable.  Hence, I
decided to ask now, before it happens.

> Can you
> 1. M-x debug-on-entry  org-export--generate-copy-script 
> 2. Start export
> 3. Step into the function (use "d", not "c" binding)
> 4. Try to identify which part (if any) is being slow

FYI: I had to do "(require 'ox)" before this worked.

I spent about 30 minutes pressing "d".  I saw Org sorting some character
encodings in a large number of steps, and then it started doing a large
number of various tasks, spending time in the AVL tree, etc.  I have no
idea what else to do.

I could not figure out how to step through N times at once for N > 1.  I
tried 'C-9 C-9 d' to step through 99 times, but that did not work.  The
documentation for 'debugger-step-through' contains just two sentences,
and I do not even understand the second one:

"Proceed, stepping through subexpressions of this expression.  Enter
another debugger on next entry to eval, apply or funcall."

> If the above does not work, you can also try
> 1. M-x trace-function  org-export--generate-copy-script 
> 2. M-x elp-instrument-function  org-export--generate-copy-script
>
> 2. Run export, possibly terminating it with C-g in the process
> 3. M-x elp-results 
> 4. Share the contents of the trace buffer and the contents of the
>elp-results buffer.

So, I ran the export for 17 minutes and then terminated with 'C-g'.  The
trace buffer included a very long line, which made Emacs froze, and I
had to kill it, after waiting for 5 minutes, losing all data in the
process.

I then tried to run the export for 3 minutes, and I managed to copy the
trace buffer, but upon pasting it into another buffer, Emacs froze
again, and I had to kill it again, losing data once again.

I then ran the export for 3 minutes once again, this time enabling just
the 'elp-instrument-function' to avoid freezing.  The 'elp-results'
output:

> org-export--generate-copy-script 1221 2.826854 0.0023151957

(The buffer also contains a header line, with e.g. "Function Name", but
Emacs did not allow me to select and copy it for you.)

Rudy
-- 
"Mathematics takes us still further from what is human into the region
of absolute necessity, to which not only the actual world, but every
possible world, must conform."
-- Bertrand Russell, 1902

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



Re: emacs really slow when inserting a new source code block

2022-09-28 Thread Luca Ferrari
On Wed, Sep 28, 2022 at 4:15 PM Luca Ferrari  wrote:
>
> On Wed, Sep 28, 2022 at 3:15 PM Ihor Radchenko  wrote:
> > I have not idea except that you may have something really strange in
> > your config.
>
> I'm trying to understand what could be eating all the cpu.
>

So far, turning off flyspell-mode makes Emacs work fine again. Strange...



[PATCH 2-v1] New: auto display inline images under subtree when `org-cycle'.

2022-09-28 Thread Christopher M. Miles

Ok, I created the patch for subtree cycling display inline images.
Tested by edebug when org cycling, it should works fine. I don't know
how to write test for this.

But I got a little problem:

When ~org-fold-core-style~ is ~'overlays~, the ~delete-overlay~ will
cause subtree unfolded. More detailed check out the "org.el" function
~org-remove-inline-images~ in my patch.

From 173772d166c9974db1a76f59fe58988fe8da401a Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Wed, 28 Sep 2022 20:46:52 +0800
Subject: [PATCH] org.el: Support auto display inline images when cycling

* lisp/org.el (org-toggle-inline-images): Support region.
(org-display-inline-images): Fix refresh argument logic.
(org-remove-inline-images): Support region.

* lisp/org-keys.el (org-toggle-inline-images): Update arguments.

* lisp/org-cycle.el (org-cycle-inline-images-display): Add new option to
control whether auto display inline images when cycling.
(org-cycle-display-inline-images): Add new hook function to auto display
inline images when cycling.
(org-cycle-hook): Add `org-cycle-display-inline-images' into cycling
hook by default.
---
 lisp/org-cycle.el | 36 ++--
 lisp/org-keys.el  |  2 +-
 lisp/org.el   | 25 +
 3 files changed, 52 insertions(+), 11 deletions(-)

diff --git a/lisp/org-cycle.el b/lisp/org-cycle.el
index 656ca83f2..da7a7a34e 100644
--- a/lisp/org-cycle.el
+++ b/lisp/org-cycle.el
@@ -208,8 +208,9 @@ the values `folded', `children', or `subtree'."
   :type 'hook)
 
 (defcustom org-cycle-hook '(org-cycle-hide-archived-subtrees
-		   org-cycle-show-empty-lines
-		   org-cycle-optimize-window-after-visibility-change)
+org-cycle-show-empty-lines
+org-cycle-optimize-window-after-visibility-change
+org-cycle-display-inline-images)
   "Hook that is run after `org-cycle' has changed the buffer visibility.
 The function(s) in this hook must accept a single argument which indicates
 the new state that was set by the most recent `org-cycle' command.  The
@@ -229,6 +230,12 @@ normal outline commands like `show-all', but not with the cycling commands."
   :group 'org-cycle
   :type 'boolean)
 
+(defcustom org-cycle-inline-images-display nil
+  "Non-nil means auto display inline images under subtree when cycling."
+  :group 'org-startup
+  :group 'org-cycle
+  :type 'boolean)
+
 (defvar org-cycle-tab-first-hook nil
   "Hook for functions to attach themselves to TAB.
 See `org-ctrl-c-ctrl-c-hook' for more information.
@@ -776,6 +783,31 @@ STATE should be one of the symbols listed in the docstring of
 		   "Subtree is archived and stays closed.  Use \
 `\\[org-cycle-force-archived]' to cycle it anyway."))
 
+(defun org-cycle-display-inline-images (state)
+  "Auto display inline images under subtree when cycling.
+It works when `org-cycle-inline-images-display' is non-nil."
+  (when org-cycle-inline-images-display
+(pcase state
+  ('children
+   (save-excursion
+ (save-restriction
+   (org-narrow-to-subtree)
+   ;; If has nested headlines, beg,end only from parent
+   ;; headline to first child headline which reference to
+   ;; upper let-binding `org-next-visible-heading'.
+   (org-display-inline-images
+nil nil
+(point-min) (progn (org-next-visible-heading 1) (point))
+  ('subtree
+   (save-excursion
+ (save-restriction
+   (org-narrow-to-subtree)
+   ;; If has nested headlines, also inline display images under all sub-headlines.
+   (org-display-inline-images nil nil (point-min) (point-max)
+  ('folded
+   (org-narrow-to-subtree)
+   (org-remove-inline-images (point-min) (point-max))
+
 (provide 'org-cycle)
 
 ;;; org-cycle.el ends here
diff --git a/lisp/org-keys.el b/lisp/org-keys.el
index d65379a72..79e34cbd1 100644
--- a/lisp/org-keys.el
+++ b/lisp/org-keys.el
@@ -204,7 +204,7 @@
 (declare-function org-toggle-radio-button "org" (&optional arg))
 (declare-function org-toggle-comment "org" ())
 (declare-function org-toggle-fixed-width "org" ())
-(declare-function org-toggle-inline-images "org" (&optional include-linked))
+(declare-function org-toggle-inline-images "org" (&optional include-linked beg end))
 (declare-function org-latex-preview "org" (&optional arg))
 (declare-function org-toggle-narrow-to-subtree "org" ())
 (declare-function org-toggle-ordered-property "org" ())
diff --git a/lisp/org.el b/lisp/org.el
index 036384a04..e7eba25cc 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -16071,16 +16071,16 @@ SNIPPETS-P indicates if this is run to create snippet images for HTML."
 
 (defvar-local org-inline-image-overlays nil)
 
-(defun org-toggle-inline-images (&optional include-linked)
+(defun org-toggle-inline-images (&optional include-linked beg end)
   "Toggle the display of inline images.
 INCLUDE-LINKED is passed to `org-display-inl

Re: Org, Hyperbole, and eev

2022-09-28 Thread Eduardo Ochs
On Wed, 28 Sept 2022 at 03:17, Jean Louis  wrote:
> (...)

Hi Jean Louis,

I am not sure how to interpret the tone of your message. Does it mean
that you are not interested in a prototype that works in one case?
I.e., that you are only interested in something that has all the
flexibility that you need?

> I would like to have non-Org links so that my function for links
> interpolates into a button. It works now in the presentation mode. I
> would like to make links descriptive or non descriptive just as in
> Org, so that it works in editing mode.

You're hiding the technical details, and I don't know how to think in
these terms, sorry! =(

For me your "non-Org link" is a string composed of a few substrings
concatenated, and each of these substrings is either without text
properties or is built using "propertize" or "buttonize". In this
message

  https://lists.gnu.org/archive/html/emacs-orgmode/2022-09/msg00725.html

I referred to those substrings as "subsegments", but I don't know what
is the correct term.

I am trying to factor your problem into several small functions in a
way that makes each of these small functions easy to test - with
one-liners if possible, like I do in the eev source code - and if we
do that factoring then the function that builds the "string composed
of a few substrings concatenated" that I mentioned above will not call
your rcd-template-eval and will not depend on the major mode...

I have the impression that the hard part _now_ is to write that
function that produces that string with text properties. Once we have
that we will have a clearer notion of what are the "non-Org links"
that we are dealing with, and it will be easier to think on the other
functions.

By the way, I mentioned here

  https://lists.gnu.org/archive/html/emacs-orgmode/2022-09/msg00725.html

that the simple Org link that I inspected had about 8 subsegments with
different text properties... Org links need all that because they have
to handle correctly insertions and deletions at several points,
cutting and pasting, "following", conversion to fundamental mode, etc,
etc... I have the impression that we can start with a prototype in
which our prototype-ish non-Org links have only three subsegments, but
you will have to accept that in that prototype the links won't have
all the features that you want...

  Cheers,
Eduardo Ochs
http://angg.twu.net/#eev



Re: The Org mode in the Org Git does not export

2022-09-28 Thread Ihor Radchenko
Rudolf Adamkovič  writes:

> Rudolf Adamkovič  writes:
>
> Also, I forgot to mention that Org mode from Org/Git 'main' quietly
> deletes all COMMENT headings from my notebook, including their content
> (!), and inlines all macros.  I have no idea why, but if I did not use
> Git, I would have lost important data.  Scary!

I assure you that there is nothing in Org code that intentionally
deletes things in files without user issuing explicit command.

The only thing that might mess up edits is terribly misbehaving
org-element-cache, but it is safeguarded by self-verification.

Having said that, do note that Emacs 29 currently contains a risky new
feature aiming to optimize buffers with long lines. This can badly
affect Org parser (bug#57207).

May it help if you set long-line-threshold to nil in your config?

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: The Org mode in the Org Git does not export

2022-09-28 Thread Ihor Radchenko
Rudolf Adamkovič  writes:

>> Can you
>> 1. M-x debug-on-entry  org-export--generate-copy-script 
>> 2. Start export
>> 3. Step into the function (use "d", not "c" binding)
>> 4. Try to identify which part (if any) is being slow
>
> FYI: I had to do "(require 'ox)" before this worked.
>
> I spent about 30 minutes pressing "d".  I saw Org sorting some character
> encodings in a large number of steps, and then it started doing a large
> number of various tasks, spending time in the AVL tree, etc.  I have no
> idea what else to do.

That's quite an involved stepping through. Thanks for your time, and sorry
for not being clear enough about what you can do!

The basic idea of this kind of test is use "d" to step-in once and then
continue with "c" until you run into a long-running function. Then, you
restart the process but also "d" into that identified function and again
continue with "c". There is no need to dig to the bottom. At least, I
expected to know if and individual call to
org-export--generate-copy-script is slow and what inside it may be
causing the slowdown.

In any case, your elp results combined with previous message when you
used "c" imply that (1) org-export--generate-copy-script is called
recursively; (2) the top-level call is taking a lot of time somehow.

This is all very strange.

Let's try to approach this problem from another direction.

Can you please set org-element-use-cache to nil and org-fold-core-style
to 'overlays in your config and try the export again?

These are two major new features that are complex enough to cause
potential issues.

If you see not improvement, we may arrange a screen session for more
interactive debugging.

> I could not figure out how to step through N times at once for N > 1.  I
> tried 'C-9 C-9 d' to step through 99 times, but that did not work.  The
> documentation for 'debugger-step-through' contains just two sentences,
> and I do not even understand the second one:
>
> "Proceed, stepping through subexpressions of this expression.  Enter
> another debugger on next entry to eval, apply or funcall."

Usually, "d" (step-in) is combined with "c" (step through).

> (The buffer also contains a header line, with e.g. "Function Name", but
> Emacs did not allow me to select and copy it for you.)

That's because it is not a part of buffer text. Just like modeline.

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: org exported pdf files

2022-09-28 Thread Jude DaShiell
I've never done anything with latex.  The closest I got to latex was using
groff for a little bit of time a long time ago.  On this one I'm in way
over my head without scuba gear.  Apparently html and adobe left latex in
the dust in so far as accessibility is concerned.



Jude  "There are four boxes to be used in
defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)

.

On Wed, 28 Sep 2022, Tim Cross wrote:

>
> Jude DaShiell  writes:
>
> > It was one of the messages from this list that got me that reply.  For
> > now, when I get a pdf file I try extracting it with pdftotext and read the
> > extracted text.  I don't make pdf files or make pdf files available for
> > anyone else.  How adobe accessibility recommendations for pdf files will
> > translate to Linux I don't know many were geared toward windows if memory
> > serves.  I haven't used windows since 2013 and don't intend using windows
> > for the duration either.
> >
>
> The problem is not with org mode, but rather with the limitations of
> Latex. The basic problem is that latex pre-dates accessibility concerns
> and lacks full support for tagging, alt text and other document
> structure information necessary to make PDF files accessible. Adding a
> language environment setting will have only minimal benefit. It is the
> tagging and other structural information which is necessary to make
> things really accessible i.e. the ability to browse a PDF document and
> retain the structural relationships within the document and use that
> information in a meaningful way - consider for example, browsing data
> inside a table within a PDF document.
>
> There are accessibility working groups within the tex/latex community
> who have been working on trying to improve accessibility of documents
> created using latex and some progress has been made. However, it is
> nowhere near the same level of sophistication as supported by other PDF
> generators, like adobe's suite, which has very good accessibility
> support and can enable production of some of the best accessible
> documents I've used.
>
> There are a couple of additional latex packages which can be added to
> documents which will provide some tagging and other structural
> information which will significantly improve the accessibility of PDF
> documents. I've not tested these with different engines.
>
> https://ctan.org/pkg/accessibility?lang=en
>
> and you would want ot add
>
> \usepackage[tagged, highstructure]{accessibility}
>
> to your packages list.
>
> To add accessibility for math formulas etc, you need
>
> https://ctan.org/pkg/axessibility?lang=en
>
> and add
>
> \usepackage{axessibility}
>
> As with other authoring, you also need to consider accessibility
> requirements when creating your documents and do things like adding \alt
> textg for figures etc.
>
> It would probably be good to add the two above packages as part of the
> 'default' package preamble, but this would require considerable testing
> as it isn't known if there will be adverse effects when mixed with other
> packages.
>
>
>



Re: emacs really slow when inserting a new source code block

2022-09-28 Thread Luca Ferrari
On Tue, Sep 27, 2022 at 3:22 PM Ihor Radchenko  wrote:
>
> This is strange.
> Did nothing happen after M-x profiler-report?
> Can you try again and check if *CPU-Profiler-Report ...* buffer exists
> in Emacs (... will be current date and time)?

No, there is no buffer named cpu nor memory nor something alike in the
buffer list.

Besides, I'm now more able to reproduce the original issue: I open one
of my perl-based org files, and it takes a lot, then I switch to
overview and it requires almost a minute to collapse all the headings.
Never seen nothing like this before.

Luca



Re: org exported pdf files

2022-09-28 Thread Tim Cross


Jude DaShiell  writes:

> It was one of the messages from this list that got me that reply.  For
> now, when I get a pdf file I try extracting it with pdftotext and read the
> extracted text.  I don't make pdf files or make pdf files available for
> anyone else.  How adobe accessibility recommendations for pdf files will
> translate to Linux I don't know many were geared toward windows if memory
> serves.  I haven't used windows since 2013 and don't intend using windows
> for the duration either.
>

The problem is not with org mode, but rather with the limitations of
Latex. The basic problem is that latex pre-dates accessibility concerns
and lacks full support for tagging, alt text and other document
structure information necessary to make PDF files accessible. Adding a
language environment setting will have only minimal benefit. It is the
tagging and other structural information which is necessary to make
things really accessible i.e. the ability to browse a PDF document and
retain the structural relationships within the document and use that
information in a meaningful way - consider for example, browsing data
inside a table within a PDF document.

There are accessibility working groups within the tex/latex community
who have been working on trying to improve accessibility of documents
created using latex and some progress has been made. However, it is
nowhere near the same level of sophistication as supported by other PDF
generators, like adobe's suite, which has very good accessibility
support and can enable production of some of the best accessible
documents I've used.

There are a couple of additional latex packages which can be added to
documents which will provide some tagging and other structural
information which will significantly improve the accessibility of PDF
documents. I've not tested these with different engines.

https://ctan.org/pkg/accessibility?lang=en

and you would want ot add

\usepackage[tagged, highstructure]{accessibility}

to your packages list.

To add accessibility for math formulas etc, you need

https://ctan.org/pkg/axessibility?lang=en

and add

\usepackage{axessibility}

As with other authoring, you also need to consider accessibility
requirements when creating your documents and do things like adding \alt
textg for figures etc.

It would probably be good to add the two above packages as part of the
'default' package preamble, but this would require considerable testing
as it isn't known if there will be adverse effects when mixed with other
packages.




Re: org exported pdf files

2022-09-28 Thread Timothy
Hi Tim,

> It would probably be good to add the two above packages as part of the
> ’default’ package preamble, but this would require considerable testing
> as it isn’t known if there will be adverse effects when mixed with other
> packages.

Those packages are early accessibility experiments, and are /not/ intended for
wider use. See the top of the 
README: “Prototype. Not suitable for production”.  The author themselves said in
a [2020 tex.SE answer] that:

  `accessibility' was developed and published back in 2007 as a proof of 
concept for
  some of the KOMA document styles. I got hold of the files from the author 
in
  2019 and took over maintenance with her permission. I tidied up the 
package
  enough to get it to CTAN, but didn’t update the functionality. I also 
published
  it to GitHub to get some feedback on it.

  It seems to have worked well in 2007 for a few test cases. Unfortunately 
it now
  fails every test case, and it looks like needing some serious efforts to 
fix.

  Because of this I no longer think that accessibility is fit for purpose.

They also go on to make a comment I’ve seen a few times from the people working
on the latex3 accessibility project — basically that in order to actually get
a /good/ solution, we’ll need to wait till support is baked into the LaTeX core.

If we’re desperate to add this, we’ll likely want to look at `tagpdf' which is
written by someone working on the latex3 accessibility project. It is apparently
capable of passing PCA3, however according to the author:

  `tagpdf' hasn’t been written as a user package but to allow experiments 
and tests
  and to help to identify missing interfaces in the kernel and in packages. 
It can
  change at any time in incompatible ways and it requires some skills to 
use it.

So, while it may be a particularly boring answer, I think “wait and see” is our
current best bet.

All the best,
Timothy


[2020 tex.SE answer] 


Re: form-like process for entering rows in an org-mode table?

2022-09-28 Thread Jean Louis
* Greg Minshall  [2022-09-28 06:34]:
> Jean Louis,
> 
> > * Greg Minshall  [2022-07-22 19:14]:
> > > hi.  does anyone have any code, or know of any existing package, that
> > > would allow for some sort of form-like (or "transient"-like) interface
> > > for adding rows to an org-mode table?  in particular, that provides some
> > > sort of =completing-read= interface for a given set of choices for a
> > > given column, etc.
> > 
> > I have total understanding for this use case, as I do similar all the
> > time. Just that I don't use Org tables, I use database tables.
> 
> the project that needs this has been on the back-burner for a while,
> but, for the record, i have looked at "Column View" as a possible
> replacement for "org tables as a database".  in addition to a
> completing-read interface, column view gives the opportunity to add
> descriptive text to a row -- i.e., just the regular, non-property,
> content under a headline -- which is very nice.  but, i haven't played
> with it enough to see how well it will fit my "needs".

I do not know what is column view. But I understand that you need
 descriptive text.

What I know is that without unique ID, there can't be conclusive
completion.

That is why I first construct various completions like this:

;; because there can be same names in different rows
(let* ((list '("Greg [1]" "Greg [2]"))
   (choice (completing-read "Choose: " list)))
  (rcd-get-bracketed-id-end choice)) ⇒ 2

(defun rcd-get-bracketed-id-end (s)
  "Return the ID number in string S from within first brackets on its
end. For example it would return 123 from `Some string [123]'"
  (let* ((match (string-match "\\[\\([[:digit:]]*\\)\\][[:space:]]*$" s)))
(when match
  (string-to-number
   (substring-no-properties s (match-beginning 1) (match-end 1))
   
-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



Re: Org, Hyperbole, and eev

2022-09-28 Thread Jean Louis
* Ihor Radchenko  [2022-09-28 06:52]:
> Jean Louis  writes:
> 
> > I wish to create meta links. Today I have tried figuring out how Org
> > link work, but I am overwhelmed.
> 
> Have you looked at
> https://orgmode.org/manual/Adding-Hyperlink-Types.html ?
> 
> If you find it confusing, please let us know.

That relates to adding different type of Org links. What I am looking
for is generic way of displaying links and not displaying links
similar to Org links, so that I can add any type of links beyond Org
links.

Let us say that link is:

 (link "Duck" (browse-url "http://www.duckduckgo.com";))

such link should be displyed as:

 __Duck__ (underlined)

but just as in Org mode to have toggle options descriptive or
non-descriptive links.

and that I can inject the format of the link like parenthesis and
simple into such generic way of making links. It would go beyond Org
that way and be available in any modes.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



Explicit page breaks (was: Create in Org a bilingual book with facing pages)

2022-09-28 Thread Juan Manuel Macías
Ihor Radchenko writes:

>>> 1. \clearpage command, which reminds me about
>>>https://orgmode.org/list/87mtamjrft.fsf@localhost
>>>May it be useful to have page break syntax element in Org?
>>
>> I really don't have an opinion at the moment... As a user I try to put
>> as few direct LaTeX commands as possible: commands like \newpage,
>> \pagebreak, \clearpage, \bigskip, \quad, etc. Whenever I can, I
>> prefer to control spaces and page breaks using more general macros. And,
>> when I put these commands, the fact of resorting to an export snippet
>> does not usually bother me, since they are not very verbose commands.
>> But I don't know what other users will think...
>
> Fine-tuning commands should indeed be dedicated to specific export
> backends. It is generally meaningless to have \clearpage in html export.
>
> However, \pagebreak specifically is something people use in plain text
> files, and it may be useful for odt exports.

I agree. In the case of odt its xml is a pain for me to deal with, and
usually I have to open an odt document in Emacs and look at the
contents.xml file to find the (probably) correct tag Between that
hideous labyrinth of tags :-)

Well, considering that the most sensible place (IMO) to introduce an
explicit page break would be before almost anything that isn't a section
(since in sections page breaks should be defined by style), how about
something like this:

#+ATTR_LATEX: :pagebreak \clearpage
#+ATTR_ODT: :pagebreak t
Lorem ipsum dolor sit amet, consectetuer adipiscing elit...

(In the case of LaTeX the expected value of :pagebreak could be any of
several commands that LaTeX has for page breaking (or any other
arbitrary code). And if you put :pagebreak t, the default value would be
\pagebreak.

And to introduce an explicit break before a heading, the above could be
added as a property.

Best regards,

Juan Manuel 



Re: Attempting to create orgcard.org

2022-09-28 Thread Timothy
Hi Bastien,

> Timothy, I believe your efforts are worthwhile as a way to provide
> Emacs third-party package maintainers a way to produce a refcard-like
> PDF document for their libraries.  But not for Org, where the refcard
> is really good enough as it is, especially the Emacs sync constraints
> we have right now.
>
> Is that okay with you?

Sure, though the idea here is that this would provide a way we could move
`(org-release)' out of the makefile and fully into elisp.

I’ve done a little test, and defining `org-release' like so in `org-macs.el' 
seems
to work quite nicely.

┌
│ (defalias 'org-release
│   (eval-when-compile
│ (require 'lisp-mnt)
│ (eval
│  `(function
│(lambda ()
│  "The release version of Org"
│  ,(lm-version "org.el"))
└

As I understand it, `orgcard.tex' is currently the main blocker on us moving
`org-release' out of the makefile like so?

Removing the need to manually ensure that keybindings are up to date and
accurate is a nice bonus.

All the best,
Timothy


Re: Re: Create in Org a bilingual book with facing pages

2022-09-28 Thread Pedro Andres Aranda Gutierrez
Ihor writes:
> Message: 12
> Date: Tue, 27 Sep 2022 20:29:25 +0800
> From: Ihor Radchenko 
> To: Juan Manuel Macías 
> Cc: orgmode 
> Subject: Re: Create in Org a bilingual book with facing pages
> Message-ID: <87bkr1ngpm.fsf@localhost>
> Content-Type: text/plain; charset=utf-8
>
>
> I notice two things here:
>
> 1. \clearpage command, which reminds me about
>https://orgmode.org/list/87mtamjrft.fsf@localhost
>May it be useful to have page break syntax element in Org?

I'm currently using the \clearpage too. So having a "native" element in ORG
may be superconvenient

Best, /PA
-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet


Re: how to remove parentheses from the output of a source code block

2022-09-28 Thread Greg Minshall
Andrés,

sorry -- of course, you can use base e-lisp =string-join= to accomplish
the same thing.

#+BEGIN_SRC emacs-lisp :var table=source-in-table :results value raw
  (let ((sqlcode (mapcar (lambda (row) 
   (concat "INSERT or ignore INTO labels_catalog (id, 
macro, language1, language2) VALUES ("
   (number-to-string (nth 0 row)) ", '" (nth 1 
row) "', '" (nth 2 row) "', '"
   (nth 3 row) "');\n")
   ) table)))
(string-join sqlcode " "))
#+END_SRC


cheers, Greg



Re: Create in Org a bilingual book with facing pages

2022-09-28 Thread Christian Moe
Hi, Juan Manuel,

I keep saving your messages with process documentation for future
reference should I ever attempt anything similar. Much appreciated!

Yours,
Christian

Juan Manuel Macías writes:

> Hi all,
>
> TL; DR:
>
> The bilingual critical edition (ancient Greek/Spanish) of the letters of
> Demosthenes and Aeschines has recently been published in Spain, a book
> whose production and typesetting I have taken charge of, using Org and
> Org-publish. Although I already have a long experience typesetting
> bilingual editions of a certain complexity, especially for philological
> use, I had never done it until now by centralizing the entire process in
> Org-Mode. I have to say that it has been a very interesting experience,
> so I leave here below a brief description of the process and some tips,
> in case they can be useful to someone who wants to prepare from Org
> bilingual texts with facing pages and certain complexity.
>
> BTW, Here’s a sample of two pages from the book:
>
> 
>
> Long version:
>
> First of all, for this kind of work you have to take into account an
> inherent limitation of TeX: the compilation process in TeX is a
> single-threaded process. That is, in TeX you cannot compile different
> parts of a document, with different configurations (= different
> preambles), at the same time. For example, you cannot have one
> configuration for odd pages and another for even pages (original and
> translation) and compile them in parallel and asynchronously. In Adobe
> InDesign-style DTP programs you can load multiple page threads in
> parallel, but these programs don’t have the typographic refinement of
> TeX. And besides, I never use proprietary software ;-).
>
> Therefore, to create a bilingual edition with facing pages, and for this
> particular type of book where the odd pages (the text in Greek) is a
> critical edition with a strong critical apparatus
> (https://en.wikipedia.org/wiki/Critical_apparatus), it is necessary to
> compile two separate documents and then synchronize them. The good news:
> I have found that, thanks to Org, the process is much more streamlined
> and controlled.
>
> On the other hand, since in this book the content of the odd and even
> pages is variable, the synchronization has been done per page, so that
> the reader always obtains the same content on the odd and even page when
> facing the open book. For the Greek document I used the reledmac LaTeX
> package, which is the most mature LaTeX package for philological
> critical editions, but I used it through my org-critical-edition package
> ().
>
> Once both PDFs are obtained and synchronized, they are loaded into the
> master Org document using the pdfpages LaTeX package. Since it was
> necessary to introduce in certain pages some commands specific to each
> page, such as page styles, index entries or labels for references, and
> to avoid having to load the pages one by one with pdfpages commands, I
> wrote a function that obtains the number of pages of the synchronized
> PDF (via mutool) and it does all that work. The function has three
> arguments: the path to the synced PDF, the general page command, and a
> list of page numbers with particular commands (these last two arguments
> are optional). An example of use would be:
>
> ┌
> │ (inserta-pdfpages-bi "resultado.pdf" "\\thispagestyle{plain}" '((2 
> "\\label{some-label}")))
> └
>
> The function is evaluated in the master document within a source block:
>
> 
>
> To compile the two PDFs separately and get the PDF in sync, I also do it
> from Org using a shell source block. So I have all PDFs always
> synchronized up to date. The synchronized PDF is obtained with pdftk:
>
> 
>
> The rest of the book, introduction, indices, etc. it is normally done
> via Org publish. And the final compilation (the master document that
> includes all sub-documents) is done asynchronously using latexmk.
>
> And that’s it. The next challenge for this fall is going to be a
> trilingual edition of the New Testament (Greek, Latin, Spanish). My idea
> is to try to adapt to Org the use of the LaTeX package flowfram (an
> attempt to create dynamic indesign-style text boxes in LaTeX, but
> ---because of TeX's limitations--- they would not be asynchronous
> boxes). Then, each text in a language would go inside an org block.
> We'll see how it turns out :-)
>
> Best regards,
>
> Juan Manuel
>
> --



Re: Org ML integration with an existing Discourse instance

2022-09-28 Thread Bastien
Hi Timothy,

Timothy  writes:

>> Not just this: I’m concerned with setting up a user-to-user discussion
>> space that reify a split between users (on a forum) and developers (on
>> the mailing list).
>
> For what it’s worth, as a developer I’d be very interested in the ability of a
> forum to categorise feature requests/bug reports/workflow discussions, etc.

But then the ML and the forum would compete with each other from a
maintainer's point a view: the ones using solely the ML would not get
the same information than the ones using the forum.

>> If a community-driven Discourse instance for Org emerges, that will be
>> a good thing: people could go there instead (or on top) of SO/reddit
>> if they don’t want/like to interact on a mailing list.
>
> We could canvas reddit for example to see if the people currently on there 
> would
> be interested in an Org discourse.

Yes, but mentioning that this would not be "the" Org discourse (not
forum.orgmode.org), just "a" Org forum maintained by X for the benefit
of the whole Org community (which is not really a thing actually, just
a mental shortcut for "every Org user out there").

It would be a good outcome to have such a forum: I'd be more comfy
recommending users to ask questions there iff they don't want/like
sharing questions on the ML than recommending them using reddit and
the like.

All best,

-- 
 Bastien



Re: [WORG] Document in more detail about what maintainers do?

2022-09-28 Thread Bastien
Ihor Radchenko  writes:

> I think the part about CC is missing in
> https://orgmode.org/worg/org-maintenance.html#orga0c76fb

Indeed - can you add it?

Also, I'd more comfortable if org-maintenance.org would use stable
anchors (not #orga0c76fb).

> Also, I find it important to take note about worg documentation for
> built-in babel backends. I did not even know it exist for a long time.
>
> WDYT?

+1 -- and also suggest adding tests, a part that I missed.

-- 
 Bastien



Re: IM dev discussions?

2022-09-28 Thread Bastien
Ihor Radchenko  writes:

> Discourse does allow anonymous email replies.
> https://blog.discourse.org/2016/07/reply-by-email-enabled-for-all-discourse-customers/
> (search "unregistered")

I did not know that - thanks for the pointer.

I'd interested in exploring a use-case: does anyone know of a
Discourse instance that is *fully* bridged with a mailing list?

In the hypothesis of

1. someone maintains a Discourse instance for Org users

2. this instance proves to be very useful to many Org users

3. we find an example of a full ML/Discourse bridge that works

3. Org maintainers decide at some point to promote it from
   org-mode-community-forum.org to forum.orgmode.org

then I'd be in favor of a *partial* bridge with the list, forwarding
only topics that have a "ML" category, for example.

This way forum.orgmode.org would compete with reddit, stackoverflow,
etc. as a user-to-user platform without competing with the list as the
place to contribute to Org's development.

This is the same reasoning than the one I presented on how to handle
third-places like reddit/SO: it is good if they offer various ways for
users to interact with each other *provided* that we have a good way
to ensure that we the ML don't lose those interactions that belongs to
the ML (bug reports, patches, feature requests, etc.) - the "way" here
is to ask for Org contributor stewards on these places.

I hope this all makes sense - I suggest we revisit this topics in a
few months, so that we can all focus on releasing Org 9.6.

-- 
 Bastien



Re: org exported pdf files

2022-09-28 Thread Jude DaShiell
It was one of the messages from this list that got me that reply.  For
now, when I get a pdf file I try extracting it with pdftotext and read the
extracted text.  I don't make pdf files or make pdf files available for
anyone else.  How adobe accessibility recommendations for pdf files will
translate to Linux I don't know many were geared toward windows if memory
serves.  I haven't used windows since 2013 and don't intend using windows
for the duration either.



Jude  "There are four boxes to be used in
defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)

.

On Wed, 28 Sep 2022, Timothy wrote:

> Hi Jude,
>
> > I have done nothing with exporting to pdf from orgmode since several years
> > ago I was told orgmode pdf?s were not accessible.
>
> Do you know where this information came from? And what do you use now?
>
> All the best,
> Timothy
>