[SOLVED] Re: Something has happened such that I can't export to latex

2022-07-30 Thread Sharon Kimble
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Ihor Radchenko  writes:

> Sharon Kimble  writes:
>
>> foo$ git pull
>> - From https://git.savannah.gnu.org/git/emacs/org-mode
>>5be0c709b3..d37c0ee5fa  main   -> origin/main
>> Updating 5be0c709b3..d37c0ee5fa
>> Fast-forward
>>  lisp/org.el  | 2 +-
>>  lisp/ox-latex.el | 7 +--
>>  mk/org-fixup.el  | 2 +-
>>  3 files changed, 7 insertions(+), 4 deletions(-)
>> 
>> foo$ make autoloads
>
> Considering that you have a questionable local.mk, I suggested trying
> cloning the Org repo from scratch. Just in case.
>
> If that does not work, I suspect that you have some peculiar Emacs
> installation. The error you are getting appears like Emacs compilation
> wrongly set the environment somehow. It is the first time I am seeing
> such a strange error.
>

Thank you to all who've been trying to sort out my problem, but I think that 
I've found the solution.

I have now rebuilt emacs with this bog-standard setup -

===
/autogen.sh
/configure
make
sudo make install
===

and it then builds org-loaddefs with zero problems.

My previous build was using this setup -

===
/autogen.sh
/configure
make bootstrap
make
===

And I suspect that the lone 'make' caused the problems, but I haven't done a 
test build to try it out.

I don't know where I got the bootstrap build mantra from, I must've found it 
online somewhere some time ago.

But thank you to all who tried to find a solution.

Thanks
Sharon.  
- -- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
DrugFacts = https://www.drugfacts.org.uk
Debian 11, fluxbox 1.3.7, emacs 29.0.50, org 9.5.4
-BEGIN PGP SIGNATURE-

iQJRBAEBCgA7FiEELSc/6QwVBIYugJDbNoGAGQr4g1sFAmLk3PodHGJvdWRpY2Nh
c0Bza2ltYmxlMDkucGx1cy5jb20ACgkQNoGAGQr4g1s0fRAAwe3SJQjVZ0p+yxke
2FMin2cC6d2qoRlO3rIAimQ5irlvDY7JRD6rZU4pSLWb0MBvJv8bzvcKDGlfDpxy
W40abdsi1A0Pha1RyBAcGppaIlaHXLJMZ5qi+yIfiWX4/G1D219KRftaSKuO2WE9
T+UDaMRBhzIyMpGH5QB/L8sdgkw59YRPa5INj/c4B+oxpvjPxwp6+gCJpepyopzW
Skj/BXbywn1viM9Zce1e9SrAd83Sw6DbAVWERStl+4A5FI9nsD7j+U+g+pS1CAbU
I2+Ywgll8HAAqZAQLRsVq52EpLX4Mjc26lg2oz3/4iIAYPnTRl21VeLKvJ31frrs
ZfW7VatNGixXs6PV0OvlTIpvufT2cbiHx7OjZOj3hJY9fmVMci17eL8ZRBuyqpzb
GN2aZNYeaeDG8mBxy+qXdcOv9yqHLFfiqrByjhcfU15hQnvZfx7Dr6o6EuOfNjXU
lSp/Wn9R6G9Hh7XHoZBq5o1WmkKhvw2PWJondadJGgcId589vjw/89R83j7GzY3U
HnjW0MaFuOJRYFb9wD004gi7loPxGw0PPuLlPxs6scVSubX//RBNkBjf+JxIc31l
0Tnv1d+PX44J6XEB9HYIMVw4uhWnjRZHgGHOoEPXR6Ui7GvwZInoBLnE15KCrw5m
H98RE6esSb98lzqSFC6rBfEv+W0=
=DbuR
-END PGP SIGNATURE-



Re: [PATCH v9] ol.el: add description format parameter to org-link-parameters

2022-07-30 Thread Ihor Radchenko
Adding Org ML back to CC.

Hugo Heagren  writes:

>> The rx-to-string call may still suffer from the described edge case.
>
> Yes, I think this is a good idea.
>
>> (and all-prefixes ...)
>
> I'm not sure what you mean, but I don't think it will work.

I mean

(and ,all-prefixes (rx-to-string `(: string-start (submatch (or (and 
,@all-prefixes))) ":")))

Best,
Ihor



Re: [BUG] org-mode 9.5.4 with evil-leader leads to endless loop in table [9.5.4 (9.5.4-g6013cb1 @ /Users/cgrabenstein/.emacs.d/straight/build/org/)]

2022-07-30 Thread Christoph Grabenstein
Hello Ihor,

thanks for your reply, and thanks for further debugging the issue. I
created an issue for evil here:
https://github.com/emacs-evil/evil/issues/1642. Feel free to add some more
details to my report.

One thing that's still bugging me though is why the table would not hang
with the older version of org-mode. As far as I can tell nothing has
changed around tables between 9.5.2 and 9.5.4. Do you have any idea what
could cause the difference in behaviour?

Thanks again, and best regards

Christoph


On Thu, 28 Jul 2022, 16:55 Ihor Radchenko,  wrote:

> Christoph Grabenstein  writes:
>
> > org-table-insert-row hangs if evil-leader is installed.
> >
> > Steps to reproduce:
> >
> > 1. Install org-mode 9.5.4, evil and evil-leader, and enable evil-mode
> > and global-evil-leader-mode.
> > 2. Open or create an org file that has a table like that:
> > ```
> > | header | another header |
> > ```
> > 3. Place your cursor in the header and hit enter (in evil insert mode).
> > 4. Emacs hangs in an endless loop, you will have to interrupt with C-g.
>
> Thanks for reporting!
>
> > - I'm not sure if this is an error on org's side or on evil's side.
> Please
> > let me know if I should open a ticket for evil.
> > - For more details see my question at the emacs stackexchange:
> >
> https://emacs.stackexchange.com/questions/72769/org-mode-tables-slowed-down-by-evil-mode
>
> Thanks for the link. Extra information from the link allowed me to
> narrow down the cause. The cause is in evil-mode.
>
> evil-local-mode is run in temporary buffer, which is OK. What is not OK
> is that evil-local-mode is altering the match data. It must not happen.
> Please report this issue to evil devs.
>
> Best,
> Ihor
>


Re: [BUG] org-mode 9.5.4 with evil-leader leads to endless loop in table [9.5.4 (9.5.4-g6013cb1 @ /Users/cgrabenstein/.emacs.d/straight/build/org/)]

2022-07-30 Thread Ihor Radchenko
>
> One thing that's still bugging me though is why the table would not hang
> with the older version of org-mode. As far as I can tell nothing has
> changed around tables between 9.5.2 and 9.5.4. Do you have any idea what
> could cause the difference in behaviour?


`org-string-width` is now using temporary buffer to calculate width
precisely to pixels.

Best,
Ihor

>
>>
>>


Re: [BUG] org-mode 9.5.4 with evil-leader leads to endless loop in table [9.5.4 (9.5.4-g6013cb1 @ /Users/cgrabenstein/.emacs.d/straight/build/org/)]

2022-07-30 Thread Christoph Grabenstein
That makes perfectly sense. Thank you!

On Sat, 30 Jul 2022, 10:55 Ihor Radchenko,  wrote:

> One thing that's still bugging me though is why the table would not hang
>> with the older version of org-mode. As far as I can tell nothing has
>> changed around tables between 9.5.2 and 9.5.4. Do you have any idea what
>> could cause the difference in behaviour?
>
>
> `org-string-width` is now using temporary buffer to calculate width
> precisely to pixels.
>
> Best,
> Ihor
>
>>
>>>
>>>


Re: The fate of ob-asymptote.el

2022-07-30 Thread Jarmo Hurri


Hello Ihor.

Ihor Radchenko  writes:

> Well. You convinced me. If Asymptote has very stable syntax and major
> features, it probably makes more sense to maintain it within Org or
> within Org community.

If Bastien shows the green light, I am looking forward to giving back
something to the community: maintanance and a good set of illustrative
examples on worg. For the past 2 years I have just been utilizing what
you guys have been doing, in a state of haze, for obvious reasons.

>> - I embrace a (any) maintained feature which extends the
>> applicability of Org without compromising "the core." I have had
>> great moments noticing that Org already supports something new I
>> need.
>
> I agree that it is nice, but we cannot, unfortunately support all the
> programming languages out there. As long a some specific language has
> a maintainer, things are fine, but in long term it is only reliable to
> support popular ones + possibly GNU projects (as Org is a part of GNU,
> and it is kind of obligation).

Makes sense. As long as there is a maintainer, a more exotic language
can be supported. Perhaps my contribution will increase the popularity
of Asymptote within the Org community and therefore the probability of
long term survival of ob-asymptote.el.

> As long as there is a person maintaining ob-asymptote, things should
> be fine. Especially if there is a good test coverage and WORG
> documentation.

I will be in standby mode until Bastien tells me what happens next.

All the best,

Jarmo




Re: [Patch] Align baseline of latex fragments and surrounding text

2022-07-30 Thread Ihor Radchenko
Matt Huszagh  writes:

> These are nice ideas, and ones I hadn't considered. Thanks for the
> suggestions! I'll think about it a bit and may modify the patch
> accordingly.

May I ask if you further considered changing the patch?

Best,
Ihor



link broken on babel header-args

2022-07-30 Thread pinmacs

on:

https://orgmode.org/worg/org-contrib/babel/header-args.html

points to:

https://orgmode.org/manual/Specific-header-arguments.html

which is 404

I think the correct link is:

https://orgmode.org/manual/Using-Header-Arguments.html#Using-Header-Arguments


OpenPGP_0x9D64597C3A982DCA.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: link broken on babel header-args

2022-07-30 Thread Ihor Radchenko
pinm...@cas.cat writes:

> on:
>
> https://orgmode.org/worg/org-contrib/babel/header-args.html
>
> points to:
>
> https://orgmode.org/manual/Specific-header-arguments.html
>
> which is 404

Confirmed.

> I think the correct link is:
>
> https://orgmode.org/manual/Using-Header-Arguments.html#Using-Header-Arguments

Well. Rather https://orgmode.org/manual/Working-with-Source-Code.html
We do not anymore have a dedicated section listing all the possible
header arguments. So, the text in
https://orgmode.org/worg/org-contrib/babel/header-args.html may also
need to be changed.

Best,
Ihor



Re: [PATCH] Re: the comment environment does not work for checkboxes

2022-07-30 Thread Ihor Radchenko
Uwe Brauer  writes:

>> Headline markup has the top priority all the times.
> I am confused

Never mind then. I was explaining something you did not look for.




[PATCH] ol-info: Enable :insert-description feature

2022-07-30 Thread Max Nikulin

On 30/07/2022 15:02, Ihor Radchenko wrote:


Hugo Heagren writes:


The rx-to-string call may still suffer from the described edge case.


Yes, I think this is a good idea.


(and all-prefixes ...)


I'm not sure what you mean, but I don't think it will work.


I mean

(and ,all-prefixes (rx-to-string `(: string-start (submatch (or (and ,@all-prefixes))) 
":")))


I agree that it is better than the trick with test, but, I think, it is 
not critical taking into account version of the patch set. I do not see 
any issues that really prevent committing of changes. This time tests 
pass on my side.


When committing the current version or if you decided to prepare a new 
one, please, fix the name of the test. Ihor committed my patch to run ol 
tests, the variant that renames test instead of adjustment of selector.


diff --git a/testing/lisp/test-ol.el b/testing/lisp/test-ol.el
index 5f2cca538..6802f0333 100644
--- a/testing/lisp/test-ol.el
+++ b/testing/lisp/test-ol.el
@@ -673,7 +673,7 @@ API in `org-link-parameters'.  Used in test
 `:insert-description' is a function symbol."
   "foobar-from-function")

-(ert-deftest test-ol/insert-link-insert-description ()
+(ert-deftest test-org-link/insert-link-insert-description ()
   "Test `:insert-description' parameter handling."
   ;; String case.
   (should

To get impression of the new feature in action, I modified ol-info.el. 
First patch does not depend on :insert-description and might be useful 
per se. Second one just enables the feature.From 7d46a872ea653c3a64522463fe3f35412ac6753e Mon Sep 17 00:00:00 2001
From: Max Nikulin 
Date: Sat, 30 Jul 2022 19:13:01 +0700
Subject: [PATCH 1/2] ol-info: New function to generate description

* lisp/ol-info.el (org-info-link-file-node): New helper to parse info
link info file (manual) name and node.
(org-info-description-as-command): New function to create description
for info links that may executed to view a manual.
(org-info-follow-link, org-info-export): Use `org-info-link-file-node'.
* testing/lisp/test-ol-info.el (test-org-link-info/link-file-node)
(test-org-link-info/description-as-command): New file for tests of new
functions `org-info-link-file-node', `org-info-description-as-command'.

Prepare to :insert-description new feature of `org-link'.
---
 lisp/ol-info.el  | 80 ++---
 testing/lisp/test-ol-info.el | 87 
 2 files changed, 150 insertions(+), 17 deletions(-)
 create mode 100644 testing/lisp/test-ol-info.el

diff --git a/lisp/ol-info.el b/lisp/ol-info.el
index dc5f6d5ba..008b4d34f 100644
--- a/lisp/ol-info.el
+++ b/lisp/ol-info.el
@@ -63,24 +63,70 @@
   "Follow an Info file and node link specified by PATH."
   (org-info-follow-link path))
 
+(defun org-info-link-file-node (link)
+  "Extract file name and node from info LINK.
+
+Return list containing file name and node name or \"Top\".
+Components may be separated by \"::\" or by \"#\"."
+  (and
+   link
+   (or
+(string-match "\\`\\([^:]*:\\)?\\(.*\\)\\(?:#\\|::\\)\\(.*\\)?\\'" link)
+(string-match "\\`\\([^:]*:\\)?\\(.*\\)\\'" link))
+   (let ((scheme (match-string 1 link))
+ (file (match-string 2 link))
+ (node (match-string 3 link)))
+ (and
+  (or (not scheme) (string-equal "info:" scheme))
+  (org-string-nw-p file)
+  (list file (or (org-string-nw-p node) "Top"))
+
+(defun org-info-description-as-command (link desc)
+  "Info link description that can be pasted as command.
+
+For the folloing LINK
+
+\"info:elisp::Non-ASCII in Strings\"
+
+the result is
+
+info \"(elisp) Non-ASCII in Strings\"
+
+that may be executed as a shell command or evaluated by
+\\[eval-expression] (wrapped with parenthesis) to read the manual
+in Emacs.
+
+Calling convention is similar to `org-link-make-description-function'.
+DESC has higher priority and returned when it is not nil.
+If LINK is not an info link then DESC is returned."
+  (or (org-string-nw-p desc)
+  (let* ((file-node (org-info-link-file-node link))
+ (file (car file-node))
+ (node (cadr file-node)))
+(cond
+ ((and node (not (string-equal "Top" node)))
+  (format "info \"(%s) %s\"" file node))
+ (file (format "info %s" file))
+ (t desc)
+
 
 (defun org-info-follow-link (name)
   "Follow an Info file and node link specified by NAME."
-  (if (or (string-match "\\(.*\\)\\(?:#\\|::\\)\\(.*\\)" name)
-  (string-match "\\(.*\\)" name))
-  (let ((filename (match-string 1 name))
-	(nodename-or-index (or (match-string 2 name) "Top")))
-	(require 'info)
-	;; If nodename-or-index is invalid node name, then look it up
-	;; in the index.
-	(condition-case nil
-	(Info-find-node filename nodename-or-index)
-	  (user-error (Info-find-node filename "Top")
-		  (condition-case nil
-			  (Info-index nodename-or-index)
-			(user-error "Could not find '%s' node or index entry"
-nodename-or-index)
-(u

Re: [PATCH v2] Add new entity \-- serving as markup separator/escape symbol

2022-07-30 Thread Max Nikulin

On 30/07/2022 13:49, Ihor Radchenko wrote:

Samuel Wales writes:


   $[emphasis :position beg :type bold :display "*"]bold text$[emphasis
:position end :type bold :display "*"]


This is similar to another recent idea about inline special blocks.
Among other things, we discussed supplying parameters to such inline
special blocks. This suggestion is essentially equivalent, except you
give a slightly different syntax.


Samuel asked for syntax extension that allows to define some feature as 
a lisp function almost 2 decades ago:


https://list.orgmode.org/orgmode/20524da70901041233g105f372fv175a47dc9884f...@mail.gmail.com/T/
Samuel Wales. extensible syntax. Sun, 4 Jan 2009 13:33:23 -0700




Re: [PATCH]: ox-latex: omit empty date

2022-07-30 Thread Max Nikulin

On 29/07/2022 19:49, emacs--- via General discussions about Org-mode. wrote:


In the attachment you can find a patch which omits an empty \date{} line in
a latex document when the option to include the date is set to nil or when
no date is provided. This empty date line can cause problems is certain
use cases.



  (let ((date (and (plist-get info :with-date) (org-export-get-date info
-   (format "\\date{%s}\n" (org-export-data date info)))
+   (cond date


I would consider (plist-get info :with-date) instead of date here to 
allow to suppress date in the title by


#+options: title:t date:t
#+date:

With such approach to avoid \date{} in the latex file date:nil can be 
used in the options line.



+ (format "\\date{%s}\n" (org-export-data date info






Re: [PATCH] ob-tangle.el: fix ‘:comments noweb’ double linking

2022-07-30 Thread Hraban Luyat
On 7/30/22 12:56 AM, Ihor Radchenko wrote:
> Hraban Luyat  writes:
>
>> This is my first org-mode patch, all comments welcome :). I signed a
>> copyright assignment to the FSF 2021-07-12.
>
> Thanks for the contribution!
>
> Bastien, could you please check the FSF records?
>
> The patch looks good in general. Few minor comments below.
>

Done, new patch attached. Thanks for the feedback.From 778558a5b0d38ee79d47b0068f68c761326e5e61 Mon Sep 17 00:00:00 2001
From: Hraban Luyat 
Date: Thu, 28 Jul 2022 22:32:08 -0400
Subject: [PATCH] =?UTF-8?q?ob-tangle.el:=20fix=20=E2=80=98:comments=20nowe?=
 =?UTF-8?q?b=E2=80=99=20double=20linking?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lisp/ob-tangle.el: Refactor the double implementation to a single
helper function.  This avoids the double link wrapping.

* testing/lisp/test-ob-tangle.el: Add unit tests.

Babel tangle allows inserting comments at the tangled site which link
back to the source in the org file.  This linking was implemented
twice, to handle separate cases, but when using ‘:comments noweb’ it
ended up going through both codepaths.  This resulted in doubly
wrapped links.

By refactoring all link generation into a single function, this double
wrapping is avoided.

Example file, /tmp/test.org:

* Inner
#+name: inner
#+begin_src emacs-lisp
2
#+end_src

* Main
#+header: :tangle test.el :comments noweb :noweb yes
#+begin_src emacs-lisp
1
<>
#+end_src

Before:

;; [[file:test.org::*Main][Main:1]]
1
;; file:/tmp/test.org::inner][inner]]][inner]]
2
;; inner ends here
;; Main:1 ends here

After:

;; [[file:test.org::*Main][Main:1]]
1
;; [[file:test.org::inner][inner]]
2
;; inner ends here
;; Main:1 ends here
---
 lisp/ob-tangle.el  | 54 
 testing/lisp/test-ob-tangle.el | 56 ++
 2 files changed, 83 insertions(+), 27 deletions(-)

diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index fdba72278..f85f07e70 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -469,6 +469,29 @@ code blocks by target file."
 (mapcar (lambda (b) (cons (car b) (nreverse (cdr b
(nreverse blocks
 
+(defun org-babel-tangle--unbracketed-link (params)
+  "Get a raw link to the src block at point, without brackets.
+
+The PARAMS are the 3rd element of the info for the same src block."
+  (save-match-data
+(let* (;; The created link is transient.  Using ID is not necessary,
+   ;; but could have side-effects if used.  An ID property may
+   ;; be added to existing entries thus creating unexpected file
+   ;; modifications.
+   (org-id-link-to-org-use-id nil)
+   (l (org-no-properties (org-store-link nil)))
+   (bare (and (string-match org-link-bracket-re l)
+  (match-string 1 l
+  (when bare
+(if (and org-babel-tangle-use-relative-file-links
+ (string-match org-link-types-re bare)
+ (string= (match-string 1 bare) "file"))
+(concat "file:"
+(file-relative-name (substring bare (match-end 0))
+(file-name-directory
+ (cdr (assq :tangle params)
+  bare)
+
 (defun org-babel-tangle-single-block (block-counter &optional only-this-block)
   "Collect the tangled source for current block.
 Return the list of block attributes needed by
@@ -485,16 +508,7 @@ non-nil, return the full association list to be used by
 (extra (nth 3 info))
  (coderef (nth 6 info))
 (cref-regexp (org-src-coderef-regexp coderef))
-(link (let* (
-  ;; The created link is transient.  Using ID is
-  ;; not necessary, but could have side-effects if
-  ;; used.  An ID property may be added to
-  ;; existing entries thus creatin unexpected file
-  ;; modifications.
-  (org-id-link-to-org-use-id nil)
-  (l (org-no-properties (org-store-link nil
- (and (string-match org-link-bracket-re l)
-  (match-string 1 l
+(link (org-babel-tangle--unbracketed-link params))
 (source-name
  (or (nth 4 info)
  (format "%s:%d"
@@ -548,15 +562,7 @@ non-nil, return the full association list to be used by
(if org-babel-tangle-use-relative-file-links
(file-relative-name file)
  file)
-   (if (and org-babel-tangle-use-relative-file-links
-(string-match org-link-types-re link)
-(string= (match-string 1 link) "file")
- (stringp src-tfile))
-   (concat "file:"
-

Re: [PATCH]: ox-latex: omit empty date

2022-07-30 Thread Ihor Radchenko
Max Nikulin  writes:

>>   (let ((date (and (plist-get info :with-date) (org-export-get-date 
>> info
>> -   (format "\\date{%s}\n" (org-export-data date info)))
>> +   (cond date
>
> I would consider (plist-get info :with-date) instead of date here to 
> allow to suppress date in the title by
>
> #+options: title:t date:t
> #+date:
>
> With such approach to avoid \date{} in the latex file date:nil can be 
> used in the options line.
>
>> + (format "\\date{%s}\n" (org-export-data date info

I am sorry, but I do not understand.

I tried

#+options: title:t date:nil

No \date is exported.

#+options: title:t date:t

\date is exported

#+options: title:t date:t
#+date:

No date is export.

All the above makes sense. Do I miss something?

Best,
Ihor



[PATCH] ox-latex.el: `org-latex-language-alist' improved

2022-07-30 Thread Juan Manuel Macías
Hi,

I've managed to get some free time to remake this list, following Maxim
Nikulin's suggestion
(https://list.orgmode.org/orgmode/taeb0a$r62$1...@ciao.gmane.io/). It's no
longer an anonymous list and I agree it now has a more robust structure
with name fields. I have also added the `:lang-name' property, whose
value is the actual language name. For example:

("el-polyton" . (:babel "polutonikogreek" :polyglossia "greek"
:polyglossia-variant "polytonic" :lang-name "Polytonic Greek"))

Thanks to this I think the code for org-latex-guess-babel-language,
org-latex-guess-polyglossia-language and org-latex--format-spec is also
simpler.

Best regards,

Juan Manuel

>From b06cdd45198f470a135efad2cd1d8b22ab7e2f22 Mon Sep 17 00:00:00 2001
From: Juan Manuel Macias 
Date: Sun, 31 Jul 2022 02:31:08 +0200
Subject: [PATCH] lisp/ox-latex.el: `org-latex-language-alist' improved.

* (org-latex-language-alist): Alist between language code and
corresponding properties, such as Babel/Polyglossia options and
language names.  Each element of the list consists of a cons cell,
where car is the language code and cdr is a property list.
* (org-latex-guess-babel-language): Modified to adapt the function to
the new structure of `org-latex-language-alist'.
* (org-latex-guess-polyglossia-language): Modified to adapt the function to
the new structure of `org-latex-language-alist'.
* (org-latex--format-spec): Modified to adapt the function to
the new structure of `org-latex-language-alist'.
---
 lisp/ox-latex.el | 287 +++
 1 file changed, 138 insertions(+), 149 deletions(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index c56f9d347..669458913 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -173,110 +173,106 @@
 ;;; Internal Variables
 
 (defconst org-latex-language-alist
-  ;; TODO: replace this list with a property list (the actual
-  ;; implementation is not very robust).
-  '(("am" "amharic" "*")
-("ar" "arabic")
-("ast" "asturian" "*")
-("bg" "bulgarian")
-("bn" "bengali" "*")
-("bo" "tibetan" "*")
-("br" "breton")
-("ca" "catalan")
-("cop" "coptic" "*")
-("cs" "czech")
-("cy" "welsh")
-("da" "danish")
-("de" "ngerman" "german" "german")
-("de-at" "naustrian" "german" "austrian")
-("dsb" "lsorbian" "*")
-("dv" "divehi" "*")
-("el" "greek")
-("el-polyton" "polutonikogreek" "greek" "polytonic")
-("en" "american" "english" "usmax")
-("en-au" "australian" "english" "australian")
-("en-gb" "british" "english" "uk")
-("en-nz" "newzealand" "english" "newzealand")
-("en-us" "american" "english" "usmax")
-("eo" "esperanto")
-("es" "spanish")
-("es-mx" "spanishmx" "spanish" "mexican")
-("et" "estonian")
-("eu" "basque")
-("fa" "farsi")
-("fi" "finnish")
-("fr" "french")
-("fr-ca" "canadien" "french" "canadian")
-("fur" "friulan")
-("ga" "irish")
-("gd" "scottish")
-("gl" "galician")
-("he" "hebrew")
-("hi" "hindi")
-("hr" "croatian")
-("hsb" "uppersorbian" "sorbian" "upper")
-("hu" "magyar")
-("hy" "armenian" "*")
-("ia" "interlingua")
-("id" "bahasai" "*")
-("is" "icelandic")
-("it" "italian")
-("kn" "kannada" "*")
-("la" "latin")
-("la-classic" "classiclatin" "latin" "classic")
-("la-medieval" "medievallatin" "latin" "medieval")
-("la-ecclesiastic" "ecclesiasticlatin" "latin" "ecclesiastic")
-("lo" "lao" "*")
-("lt" "lithuanian")
-("lv" "latvian")
-("ml" "malayalam" "*")
-("mr" "maranthi" "*")
-("nb" "norsk" "norwegian" "bokmal")
-("nl" "dutch")
-("nn" "nynorsk" "norwegian" "nynorsk")
-("no" "norsk")
-("oc" "occitan")
-("pl" "polish")
-("pms" "piedmontese")
-("pt" "portuges")
-("pt-br" "brazilian")
-("rm" "romansh" "*")
-("ro" "romanian")
-("ru" "russian")
-("sa" "sanskrit" "*")
-("sk" "slovak")
-("sl" "slovene")
-("sq" "albanian")
-("sr" "serbian")
-("sv" "swedish")
-("syr" "syriac" "*")
-("ta" "tamil" "*")
-("te" "telugu" "*")
-("th" "thai")
-("tk" "turkmen")
-("tr" "turkish")
-("uk" "ukrainian")
-("ur" "urdu" "*")
-("vi" "vietnamese"))
-  "Alist between language code and corresponding Babel/Polyglossia option.
-
-For the names of the languages, the Babel nomenclature is
-preferred to that of Polyglossia, in those cases where both
-coincide.
-
-The alist supports three types of members:
-
-- Members with two elements: CODE BABEL/POLYGLOSSIA OPTION.
-
-- Members with three elements: CODE BABEL/POLYGLOSSIA OPTION
-ASTERISK (the presence of the asterisk indicates that this
-language is not loaded in Babel using the old method of ldf
-files but using ini files.  If Babel is loaded in an Org
-document with these languages, the \"AUTO \" argument is just
-removed, to avoid compilation errors).
-
-- Members with four elements (for variants of languages): CODE
-BABEL

Re: [PATCH] Re: How to stop results being hidden when using ":results drawer"?

2022-07-30 Thread Ihor Radchenko
Ihor Radchenko  writes:

> In fact, forcefully folding the drawers is relatively recent addition by
> Nicolas in 1027e0256903bc2.
>
> I am attaching the patch making drawer folding controllable via optional
> argument. WDYT?

No objections have been given.
Applied onto main via 785f003de with slight modifications to address 
https://orgmode.org/list/m2a68zthgq@ntnu.no.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=785f003de527487d1557cb724dd4b8867b5ea657

Best,
Ihor



Re: [BUG] Avoid folding drawers using `org-clock-goto'

2022-07-30 Thread Ihor Radchenko
Tor Kringeland  writes:

> Ihor Radchenko  writes:
>
>> Could you please elaborate why you prefer not folding drawers in
>> `org-clock-goto'?
>
> If I already unfolded a drawer (for example with notes), then I want to
> keep it open, at least as long as the heading itself is unfolded.

Should be fixed on main now.

Best,
Ihor



Re: [PATCH] oc-csl: Add support for sub-bibliographies

2022-07-30 Thread Ihor Radchenko
András Simonyi  writes:

> the attached patch adds support for filter-based sub-bibliographies in the 
> "csl"
> org-cite export processor. It supports the same syntax for specifying
> filters as the biblatex processor and supports some of the biblatex
> filter types, concretely, entry-type and keyword based filtering. It
> also supports filtering based on CSL type (as opposed to bib(la)tex
> type) and using any Lisp predicate as a filter.

Applied onto main via 7e0761184.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=7e076118443ed6ccfa95390cdd17b3464859abd3

Best,
Ihor



Re: [PATCH]: ox-latex: omit empty date

2022-07-30 Thread Max Nikulin

On 31/07/2022 07:53, Ihor Radchenko wrote:

Max Nikulin writes:


   (let ((date (and (plist-get info :with-date) (org-export-get-date 
info
-   (format "\\date{%s}\n" (org-export-data date info)))
+   (cond date


I would consider (plist-get info :with-date) instead of date here to
allow to suppress date in the title by

#+options: title:t date:t
#+date:

With such approach to avoid \date{} in the latex file date:nil can be
used in the options line.


+ (format "\\date{%s}\n" (org-export-data date info


I am sorry, but I do not understand.

I tried

#+options: title:t date:nil

No \date is exported.

#+options: title:t date:t

\date is exported

#+options: title:t date:t
#+date:

No date is export.

All the above makes sense. Do I miss something?


To be precise, \date is not exported to LaTeX file, but current date 
appears in PDF. That is why I consider the change as a breaking one.


Try to export to PDF the following document.

 >8 
#+options: title:t
# #+options: date:nil
# #+date:
#+title: Title
test
 8< 

PDF file is produced with current date. Before the patch it was possible 
to suppress date in PDF file by removing comment for either "#+options: 
date:nil" or for "#+date:". With current main branch HEAD some other 
workaround is required. I think, it is not what is expected from the 
description of the #+options: keyword:



‘date:’
 Toggle inclusion of a date into exported file
 (‘org-export-with-date’).


info "(org) Export Settings" https://orgmode.org/manual/Export-Settings.html



Re: [PATCH] oc-csl: Add support for sub-bibliographies

2022-07-30 Thread Ihor Radchenko
András Simonyi  writes:

>> This is an important point. I think that we should describe this gotcha
>> in the "Bibliography printing". oc-basic and oc-csl just print the list
>> of bibliography entries, while oc-bibtex/oc-natbib/oc-biblatex insert a
>> separate section. It is a very important information and users should be
>> aware of it.
>
> I agree, so I've attached a new version in which a sentence is added
> about this difference in behaviour.

Thanks!
Applied onto main via 24d2826f0.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=24d2826f049068e0d2afac19a2669a3ff8fdad6a

> Also, this is kind of annoying - this way mixing oc-bibtex
>> and oc-basic for LaTeX and non-LaTeX export gets awkward.
>
> Yes, in the long run we might want to unify the behaviour of the
> processors in this respect. OTOH changing "basic" and "csl" to
> automatically print a heading would be a breaking change, e.g., AFAIK,
> ox-hugo currently adds a heading on its own when org-cite is used for
> bibliography printing with the "csl" processor.

Can we then change the oc-biblatex et al defaults to output
\printbibliography[heading=none]
?

Best,
Ihor



Re: [PATCH]: ox-latex: omit empty date

2022-07-30 Thread Ihor Radchenko
Max Nikulin  writes:

>> All the above makes sense. Do I miss something?
>
> To be precise, \date is not exported to LaTeX file, but current date 
> appears in PDF. That is why I consider the change as a breaking one.
>
> Try to export to PDF the following document.
>
>  >8 
> #+options: title:t
> # #+options: date:nil
> # #+date:
> #+title: Title
> test
>  8< 
>
> PDF file is produced with current date. Before the patch it was possible 
> to suppress date in PDF file by removing comment for either "#+options: 
> date:nil" or for "#+date:". With current main branch HEAD some other 
> workaround is required. I think, it is not what is expected from the 
> description of the #+options: keyword:

Agree. I did not know about this LaTeX default.

Bob, do you have any ideas? I am inclined to revert the patch.

Best,
Ihor



Re: [PATCH] Fix caption format for custom latex src block

2022-07-30 Thread Ihor Radchenko
Matt Huszagh  writes:

> This patch fixes an issue in which captions for custom listing
> environments are not converted correctly. To illustrate the issue,
> take the following MWE.

Since the original issue cannot be reproduced (see the other email in
the thread) I am closing this.

Canceled.

Best,
Ihor



Re: oc-basic: CSL-JSON year as number vs. string (nativecomp?)

2022-07-30 Thread Ihor Radchenko
David Lukeš  writes:

> Ihor: Thank you for the feedback! I'll send a proper patch then.

Did you get a chance to work on this?

Best,
Ihor



Re: [BUG] org-capture-kill: doesn't remove the right text region

2022-07-30 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Caleb Chase  writes:
>
>> I discovered a bug with org-capture and org-capture kill when
>> canceling an item or plain type template on a heading that has only an
>> empty line for content. Minimal reproduction is as follows:
>
> The fix is attached.
> The reason why this bug is happening is `org-capture-empty-lines-before`
> adding/removing the lines before the capture region. This situation was
> not considered by org-capture.
>
> Note that `org-capture-empty-lines-before` changes are not going to be
> restored upon capture abortion. Fixing this will not be trivial (AFAIU,
> suggestions are welcome) and the gains are marginal - I doubt that
> anyone is going to care much about this side effect. Of course, feel
> free to disagree by replying.

Applied onto main via 2ea0830f0.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=2ea0830f07fa81b6e22ccdd43ad351ad76fcc097

Best,
Ihor



Re: [PATCH] * lisp/org.el (org-store-log-note): Do not indent empty lines

2022-07-30 Thread Ihor Radchenko
Ihor Radchenko  writes:

> See the attached patch.

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

Best,
Ihor




Re: [RFC PATCH 0/2] Make org-babel-tangle usable in after-save-hook on large org buffers

2022-07-30 Thread Ihor Radchenko
Ihor Radchenko  writes:

> I would like to send an experimental patch improving performance of
> org-babel-tangle.  The patch contains two major changes:
> 1. org-babel-tangle-single-block will not try to parse LINK to src
>block when :comments is set to "no" and simple return nil in
>relevant slot of the parsed src block structure.
> 2. org-babel-expand-noweb-references cache will be saved between the
>function calls (reset on buffer edits)

Applied onto main via 0435fea9a and 0d3bf2ed4.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=0d3bf2ed491ab2828ca1a2c42ea0d4e457c32bd4
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=0435fea9a8f4d65524ee8a8dd4e6829a70ff6e20

Best,
Ihor



Re: Bug: CLOCKSUM works first time, fails second time when used in column view

2022-07-30 Thread Ihor Radchenko
Joshua Hartshorne  writes:

> column view will work a few times and then suddenly it won't work anymore,
> saying: "The CLOCKSUM property can not be set with `org-entry-put"

Sorry for the late reply.

I am unable to reproduce the issue with current main.

Best,
Ihor