Re: [feature] Allow "," decimal point in table cells

2022-07-19 Thread Uwe Brauer
>>> "IR" == Ihor Radchenko  writes:

> Uwe Brauer  writes:
>>> Uwe Brauer  writes:
>> 
>>> Org tables use Emacs' calc under the hood by default.
>>> AFAIK, calc is unable to use "," as decimal point because it is reserved
>>> as a vector separator. Which is why you got the vector addition in your
>>> example.
>> 
>> Thanks. I was afraid that the issue was with calc not with org-mode.

> Note that you can instead use Elisp formulas. See 3.5.3 Emacs Lisp forms
> as formulas. It is more flexible.

Can you give me an example?

> Alternatively, we may implement the comma separators as a built-in
> feature. Org table formulas already support notations like

> | 3,5 | 4,2 | 7 |

> #+TBLFM: $3=$1+$2;N

Not sure I understand this 

| 3,5 | 4,2 | 7 | (7, 7) | (7, 7) |
| | |   |||
#+TBLFM: $3=$1+$2;N::$4=$1+$2;E::$5=$1+$2;L

> (see 3.5.2 Formula syntax for Calc)

> we may as well implement something like ";Nc" that will interpret cells
> as numbers with "," as decimal point separator.

> Is there such a demand?

> (see 3.5.2 Formula syntax for Calc)

> we may as well implement something like ";Nc" that will interpret cells
> as numbers with "," as decimal point separator.

> Is there such a demand?

I think others should speak up, all I can say

1. «,» is the standard in German speaking countries, while

2. «'» is the standard in Spanish speaking countries 

For the separator.

In my use case  I need to generate  ods documents that use the
German language setting, org-mode however relying on calc needs the
notation that the «.» Separate digits while in German it is the «,».

I solve this issue by exporting my org-table to csv, set scalc to German
as a default language, and then import the csv file, using American
English.



smime.p7s
Description: S/MIME cryptographic signature


Re: change the default items for enumerated lists

2022-07-19 Thread Uwe Brauer
>>> "IR" == Ihor Radchenko  writes:

> Uwe Brauer  writes:
>> When I want to add a plain list, I usually use 
>> 
>> + C-c -
>> + M- 
>> 
>> Now, I would like to have the 1) item as default not -, moreover, when I
>> use org-metaright to make a sublist I would like to start this list with 
>> a).
>> 
>> Howe can this be achieved?

> 1) "-" is hard-coded in org-toggle-item (patches are welcome)
I see so most likely it is the magic line 
 (let* ((bul (org-list-bullet-string "-"))

Hm, I could boldy change that but maybe it would be wise to define a new
variable that control this behavior...


> 2) See org-list-demote-modify-bullet

Ok I see, thanks


smime.p7s
Description: S/MIME cryptographic signature


Re: org-set-properties for various (all) headings

2022-07-19 Thread Uwe Brauer
>>> "KM" == Kaushal Modi  writes:

> On Tue, Jul 19, 2022 at 12:58 PM Uwe Brauer  wrote:
>> 
>> > On Tue, Jul 19, 2022, 10:54 AM Uwe Brauer  wrote:
>> 
>> > Try replacing the `org-set-property` form to:
>> 
>> > (org-set-property "New" "[]")
>> 
>> This does not anything (besides garbage collecting)
>> 

> Did you replace only the `org-set-property` form with my suggestion?

This is what you said.
> In any case, I got to a computer and I tested that to work alright.

> =
> * Over
> :PROPERTIES:
> :ID:   ef19f286-8769-4fe7-8f95-8167691257a0
> :COLUMNS:  %5TODO(Status) %5NR(Nr)
> :foo:  Over
> :END:
> ** TODO Test
> :PROPERTIES:
> :Sent: [X]
> :END:

> ** WAIT Test2
> :PROPERTIES:
> :Sent: [X]
> :END:

> ** TODO Test3
> :PROPERTIES:
> :Sent: [ ]
> :END:

> #+begin_src emacs-lisp
> (defun test/set-property-at-heading ()
>   "Function to be called at the beginning of an Org heading."
>   (interactive)
>   (let ((el (org-element-at-point)))
> (org-set-property "New" "[ ]")))
> (org-map-entries #'test/set-property-at-heading)
> #+end_src


Aha, *great* thanks a ton. That really really saved my day.

Two comments though

1. It works, if the source block is at the beginning of the file 

2. I confess I don't understand anymore the use of `(let ((el 
(org-element-at-point)))':

   a. In your first version you used the defined «el», but know you
  don't, hm just saying.


In any case thanks again for this very valuable advice. I suggest to
include it somehow in the documentation, since I believe that other
users have encountered similar situations.

Regards

Uwe Brauer 


smime.p7s
Description: S/MIME cryptographic signature


Re: no syntax highlighting for code blocks with org-publish

2022-07-19 Thread M. Pger
Actually, using -nw implies that no theme is loaded, so the face colors 
'extracted' by htmlize are the flashy default colors of Emacs in terminal.

To have the colors associated with the theme I use, I had to load the theme 
through build.el and to change my bash script to:

#!/bin/sh
emacs -q --load=build.el --eval="(eval-buffer)" 
--eval="(save-buffers-kill-terminal)"

The advantage is of course to have the desired face colors; the minor 
disadvantage is to see an Emacs frame appearing, loading the theme and then 
disappearing.

Best,

M


--- Original Message ---
On Wednesday, July 20th, 2022 at 1:14 AM, M. Pger  wrote:


> I solved the issue by creating the following bash script in my project folder:
>
> #!/bin/sh
> TERM=xterm export TERM
> emacs -q -nw --load=build.el --eval="(eval-buffer)" 
> --eval="(save-buffers-kill-terminal)"
>
> This avoid using --script (and thus batch) and thus allows font-lock to be 
> enabled when my publishing elisp script (build.el) is run. Thanks to 
> `TERM=xterm export TERM`, this bash script can be run from the Emacs shell 
> (otherwise problematic because of the -nw option).
>
> To have 'extended' syntax highlighting for R, note that I have to load ESS 
> from build.el.
>
> Hope this will help! Thanks again for your feedback and your insights.
>
> Best,
>
> M
>
> --- Original Message ---
> On Wednesday, July 20th, 2022 at 12:33 AM, Tim Cross theophil...@gmail.com 
> wrote:
>
>
>
> > "M. Pger" mp...@protonmail.com writes:
> >
> > > I tried to publish using `M-x org-publish RET  RET` as 
> > > you suggested, and
> > > syntax highlighting was actually implemented, thanks.
> > >
> > > Actually the problem is coming from the fact that I use `emacs -Q 
> > > --script build.el` (as a
> > > bash script) to publish the project. According to
> > > https://list.orgmode.org/ae5693f1-f63d-4383-8840-0fd2dbaac...@gmail.com/ 
> > > (rather old, but
> > > apparently this has not changed), font-lock-mode is not enabled by 
> > > default in --batch
> > > mode. Since `--script` "run Emacs in batch mode, like ‘--batch’, and then 
> > > read and execute
> > > the Lisp code in file" (cf the doc), it seems that this is exactly my 
> > > problem.
> > >
> > > A workaround is suggested in
> > > https://list.orgmode.org/ae5693f1-f63d-4383-8840-0fd2dbaac...@gmail.com/, 
> > > but
> > > unfortunately for me it does not work (yet). I am going to dig further 
> > > into that.
> >
> > I would be interested to hear how you go. I have a use case coming up
> > where I need to publish a large number of org files using a batch job,
> > so expect to run into the same issue. Right now, I'm still getting my
> > head around how to best get a consistent style when the input comes from
> > multiple org files from different sources and I want to minimise editing
> > the sources, plus provide a simple way to update/change the styling
> > later.



Re: numbering src blocks in HTML export

2022-07-19 Thread Ihor Radchenko
"Fraga, Eric"  writes:

> Followup question, if I may: how can I make -n be default behaviour for
> export?  I have tried, for instance,
>
> #+property: header-args:julia -n 1
>
> to have all Julia src blocks show line numbers but it doesn't work.

AFAIU, source block switches are never inherited.

Dear All, may we should provide a normal header arg as an equivalent of
switches? Honestly, this whole switch syntax sounds unnecessary and only
over-complicates things.

Best,
Ihor



Re: An org backend to Haddock

2022-07-19 Thread Ihor Radchenko
Yuchen Pei  writes:

> I do wonder what is the best way to handle cross-package links.
> Currently I'm using CUSTOM_ID in the format of
> package-name-x.y.z.Module.Name.IdentifierName, as well as
> Module.Name.IdentifierName.  But this is a "one big org file" approach,
> and can make navigation slow when say the org file reaches 15+MB in
> size.

> Ideally one should be able to navigate the a hackage worth of
> documentations easily, with working cross-package links and low latency
> org-goto to jump to any identifier or module, but I don't see how to
> achieve that.  To be further investigated.

If you know the file path, you can always explicitly link to a headline
in that file:

(4.8 Search Options in File Links)

 [[file:~/code/main.c::255]]
 [[file:~/xx.org::My Target]]
 [[file:~/xx.org::*My Target]]
 [[file:~/xx.org::#my-custom-id]]
 [[file:~/xx.org::/regexp/]]
 [[attachment:main.c::255]]

Also, you can make use of org-id and set org-id-extra-files as a
directory-local/file-local variable, possibly providing an Elisp sexp to
perform auto-calculation.

Finally, 15+Mb files should no longer be a problem in future releases
of Org. I am using a 20Mb notes files with no major problems daily (on
latest development version of Org).

Best,
Ihor




[feature] Allow "," decimal point in table cells (was: org-table with different conventions: decimals)

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

>> Uwe Brauer  writes:
>
>> Org tables use Emacs' calc under the hood by default.
>> AFAIK, calc is unable to use "," as decimal point because it is reserved
>> as a vector separator. Which is why you got the vector addition in your
>> example.
>
> Thanks. I was afraid that the issue was with calc not with org-mode.

Note that you can instead use Elisp formulas. See 3.5.3 Emacs Lisp forms
as formulas. It is more flexible.

Alternatively, we may implement the comma separators as a built-in
feature. Org table formulas already support notations like

| 3,5 | 4,2 | 7 |
#+TBLFM: $3=$1+$2;N

or

#+TBLFM: $3=$1+$2;E
#+TBLFM: $3=$1+$2;L

(see 3.5.2 Formula syntax for Calc)

we may as well implement something like ";Nc" that will interpret cells
as numbers with "," as decimal point separator.

Is there such a demand?

Best,
Ihor



Re: change the default items for enumerated lists

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

> When I want to add a plain list, I usually use 
>
>+ C-c -
>+ M- 
>
> Now, I would like to have the 1) item as default not -, moreover, when I
> use org-metaright to make a sublist I would like to start this list with 
> a).
>
> Howe can this be achieved?

1) "-" is hard-coded in org-toggle-item (patches are welcome)
2) See org-list-demote-modify-bullet

Best,
Ihor



Re: Bug: Appointments duration and effort sums in agenda column view [9.3.7 (release_9.3.7-700-ga1e5be @ ~/.emacs.d/straight/build/org/)]

2022-07-19 Thread Mamoru Miura
Dear Ihor,

Thank you for responding.
The issue is failing to collect (and sum) appointments' duration as
effort even when `org-agenda-columns-add-appointments-to-effort-sum'
is t.

My environment:

* Emacs 28.1
* Org 9.5.4

Here's the setting (~/.emacs.d/init.el):

(setq org-directory "~/org/")
(setq org-agenda-files (list org-directory))
(setq org-columns-default-format "%Item %Effort{:}")
(setq org-agenda-columns-add-appointments-to-effort-sum t)

With putting org-file (~/org/test.org):

* My appointment
  SCHEDULED: <2022-07-20 Wed 10:00-11:00>
* My appointment with effort
  SCHEDULED: <2022-07-20 Wed 11:00-12:00>
  :PROPERTIES:
  :Effort:   0:30
  :END:

Steps to see this issue:

1. run M-x org-agenda
2. type "a" to show "agenda for current week or day"
3. run M-x org-agenda-columns (C-c C-x C-c)

Then, you see that the column "Effort" for the item "My appointment"
is empty and not added to the daily effort summation.

Bug investigation and solving approach:

* The function `org-columns--collect-values' collects appointment
duration: 
https://github.com/bzg/org-mode/blob/e0b05b07528dea684f3439c017370436b8d37b50/lisp/org-colview.el#L291
* With running M-x describe-text-properties on the item "My
appointment" in the *Org Agenda* buffer, it has a text property
"duration" and its value is correct (60.0).
Given these facts, the property "duration" seems to disappear
somewhere or the function fails to collect it. (Unfortunately, I
didn't have the room to deep dive into further details.)
* To solve this, instead of collecting value, get the corresponding
item (entry) and recompute the duration from it. I found a computing
function `org-agenda-format-item' and re-use it.

I re-attach a patch because the previous patch contains a bug.

See also (insightful reports by Stanislav):

* 
https://emacs.stackexchange.com/questions/58875/how-do-i-add-appointments-to-effort-sum
* https://lists.gnu.org/archive/html/emacs-orgmode/2020-08/msg00090.html

Kind regards,
Mamoru


0001-lisp-org-colview.el-Fix-missing-addition-of-appointm.patch
Description: Binary data


Re: no syntax highlighting for code blocks with org-publish

2022-07-19 Thread M. Pger
I solved the issue by creating the following bash script in my project folder:

#!/bin/sh
TERM=xterm export TERM
emacs -q -nw --load=build.el --eval="(eval-buffer)" 
--eval="(save-buffers-kill-terminal)"

This avoid using --script (and thus batch) and thus allows font-lock to be 
enabled when my publishing elisp script (build.el) is run. Thanks to 
`TERM=xterm export TERM`, this bash script can be run from the Emacs shell 
(otherwise problematic because of the -nw option).

To have 'extended' syntax highlighting for R, note that I have to load ESS from 
build.el.

Hope this will help! Thanks again for your feedback and your insights.

Best,

M

--- Original Message ---
On Wednesday, July 20th, 2022 at 12:33 AM, Tim Cross  
wrote:


> "M. Pger" mp...@protonmail.com writes:
>
> > I tried to publish using `M-x org-publish RET  RET` as you 
> > suggested, and
> > syntax highlighting was actually implemented, thanks.
> >
> > Actually the problem is coming from the fact that I use `emacs -Q --script 
> > build.el` (as a
> > bash script) to publish the project. According to
> > https://list.orgmode.org/ae5693f1-f63d-4383-8840-0fd2dbaac...@gmail.com/ 
> > (rather old, but
> > apparently this has not changed), font-lock-mode is not enabled by default 
> > in --batch
> > mode. Since `--script` "run Emacs in batch mode, like ‘--batch’, and then 
> > read and execute
> > the Lisp code in file" (cf the doc), it seems that this is exactly my 
> > problem.
> >
> > A workaround is suggested in
> > https://list.orgmode.org/ae5693f1-f63d-4383-8840-0fd2dbaac...@gmail.com/, 
> > but
> > unfortunately for me it does not work (yet). I am going to dig further into 
> > that.
>
>
> I would be interested to hear how you go. I have a use case coming up
> where I need to publish a large number of org files using a batch job,
> so expect to run into the same issue. Right now, I'm still getting my
> head around how to best get a consistent style when the input comes from
> multiple org files from different sources and I want to minimise editing
> the sources, plus provide a simple way to update/change the styling
> later.



Re: no syntax highlighting for code blocks with org-publish

2022-07-19 Thread Tim Cross


"M. Pger"  writes:

> I tried to publish using `M-x org-publish RET  RET` as you 
> suggested, and
> syntax highlighting was actually implemented, thanks.
>
> Actually the problem is coming from the fact that I use `emacs -Q --script 
> build.el` (as a
> bash script) to publish the project. According to
> https://list.orgmode.org/ae5693f1-f63d-4383-8840-0fd2dbaac...@gmail.com/ 
> (rather old, but
> apparently this has not changed), font-lock-mode is not enabled by default in 
> --batch
> mode. Since `--script` "run Emacs in batch mode, like ‘--batch’, and then 
> read and execute
> the Lisp code in file" (cf the doc), it seems that this is exactly my problem.
>
> A workaround is suggested in
> https://list.orgmode.org/ae5693f1-f63d-4383-8840-0fd2dbaac...@gmail.com/, but
> unfortunately for me it does not work (yet). I am going to dig further into 
> that.
>

I would be interested to hear how you go. I have a use case coming up
where I need to publish a large number of org files using a batch job,
so expect to run into the same issue. Right now, I'm still getting my
head around how to best get a consistent style when the input comes from
multiple org files from different sources and I want to minimise editing
the sources, plus provide a simple way to update/change the styling
later.



Re: @string abbreviation in bib file not honored in (basic) org-cite

2022-07-19 Thread Bruce D'Arcus
On Tue, Jul 19, 2022 at 4:37 PM Joost Kremers  wrote:
>
>
> On Sun, Jul 17 2022, Ihor Radchenko wrote:
> > alain.coch...@unistra.fr writes:
> >
> >> My .bib file is
> >>
> >>@string{jgr="J. Geophys. Res."}
> >>@ARTICLE{chouet88,
> >>journal=jgr,
> >>author={Chouet, B.}, title={Resonance of a fluid-driven crack: [...]},
> >>year={1988}, volume={93}, number={B5}, pages={4375-4400}
> >
> > Fixed on main via c550a4290.
> >
> > After discussion with Emacs devs, it turned out that there is a way to
> > make bibtex.el parse and substitute @string abbreviations.
>
> So does this mean there is no longer any reason to add parsebib to (Non-)GNU
> ELPA?

No, since parsebib is an important dependency for citeproc-el, and
Ihor was suggesting Andras try to get that in ELPA.

Bruce



Re: @string abbreviation in bib file not honored in (basic) org-cite

2022-07-19 Thread Joost Kremers


On Sun, Jul 17 2022, Ihor Radchenko wrote:
> alain.coch...@unistra.fr writes:
>
>> My .bib file is 
>>
>>@string{jgr="J. Geophys. Res."}
>>@ARTICLE{chouet88,
>>journal=jgr,
>>author={Chouet, B.}, title={Resonance of a fluid-driven crack: [...]},
>>year={1988}, volume={93}, number={B5}, pages={4375-4400}
>
> Fixed on main via c550a4290.
>
> After discussion with Emacs devs, it turned out that there is a way to
> make bibtex.el parse and substitute @string abbreviations.

So does this mean there is no longer any reason to add parsebib to (Non-)GNU
ELPA?


-- 
Joost Kremers
Life has its moments



How to add/delete statistics cookie automatically ?

2022-07-19 Thread Cletip Cletip
Hello everyone,
My question is in the title, but for more detail on its exact use :

I'd like to add [/] or [%] to a parent heading in case I either add a TODO
subheading or a checkbox. I don't want to type it in the parent heading,
but add it automatically. Also, if all subheadings/checkboxes are removed,
the statistics cookie should be removed from the parent heading
automatically.

Question largely inspired by this one (which has not been answered):
https://www.reddit.com/r/emacs/comments/g2arww/how_to_adddelete_statistics_cookie_automatically/

Maybe this question is answered quite simply by having a correct level in
Lisp, but I still have a lot of trouble with this language. If someone
could help me, it would help me a lot ^^.

Thanks in advance for your future answers.


Re: [PATCH] lisp/org.el: Fix `org-fill-paragraph' in lists when `mark-active'

2022-07-19 Thread Sébastien Miquel



Hi,

Renato Ferreira writes:
> Go to start of list, `org-mark-element`, then `org-fill-paragraph`. 
The first item does not get filled.


This should be fixed on main. If not, please say so.

I'm removing this from updates.orgmode.org:
Canceled.

--
Sébastien Miquel



Re: bug#52771: 29.0.50; org-fill-paragraph does not work for several plain lists

2022-07-19 Thread Sébastien Miquel




Kyle Meyer writes:
> Rudolf Adamkovič writes:
>
>> Reproduction steps:
>>
>> 1. start "emacs -Q"
>> 2. type "C-x C-f" and "test.org" and RET   
>> 3. type the following:
>>
>> - one
>>   two
>>
>> - three
>>   four
>>
>> 4. mark all with "C-x h"
>> 5. type "M-q" to fill
>>
>> Actual:
>>
>> - one
>>   two
>>
>> - three four
>>
>> Expected:
>>
>> - one two
>>
>> - three four

This is fixed on main.

Marking it as resolved on updates.orgmode.org:
Fixed.

--
Sébastien Miquel



Re: [PATCH] ox-latex.el: Unify in one single list Babel and Polyglossia languages alists

2022-07-19 Thread Juan Manuel Macías
Max Nikulin writes:

> On 19/07/2022 22:01, Juan Manuel Macías wrote:
>> + (replace-match
>> + (mapconcat (lambda (option) (if (equal "AUTO" option) language
>> option))
>> + (cond ((member language options) (delete "AUTO" options))
>> + ((member "AUTO" options) options)
>> + (t (append options (list language
>> + ", ")
>
> In my opinion this code should not attempt to be excessively clever.
> If user skipped AUTO then do not append language. Test for duplicated
> options is redundant as well. Such cases may still be a reason to
> issue a warning (e.g. by `org-lint').

I completely agree. I've kept that old part of the code for backwards
compatibility and because, at the end of the day, it doesn't break
anything new. I mean, if a user declares the main language using
babelprovide and this code (too intrusive) puts the main language in the
Babel argument too (something the user doesn't want in origin), that
syntax is supported by Babel. Babel simply takes into account the main
language declared with babelprovide, if the 'main' option has been
added. But even if it doesn't return any errors, it's unnecessary
redundancy.

Anyway, yes, it's too intrusive. I am in favor of removing that part,
but I don't know if it will have any effect on backwards compatibility.

(BTW, I think I didn't explain in this thread the advantages of using
babelprovide over the traditional ldf file system. With ini files the
user has more control over the loaded language and there are many
options, including the ability to associate a font with a script.
Furthermore the user can create his own custom ini files, and define his
own languages. For example, I could write an ini file with specific
values for Spanish, or even an imaginary language. On the one hand, it
is an important advance. But on the other hand it adds more fuel to the
current great latex pandemic: multiplicity).

> On the other hand I would consider adding babel by default without
> explicit header. To suppress loading users may add
> #+latex_header: % \usepackage{babel}

I don't understand this very well. What would happen, then, to users who
prefer to use Polyglossia, or those who prefer to explicitly add babel
or polyglossia code?

> I like that you decided to avoid inventing of a DSL just to have
> org-like options that are translated to to a couple of preamble
> commands. From my point of view it would not help novices and would
> make things more complicated for experienced LaTeX users.

Yes, in the end I realized that this was getting into a slippery slope,
especially for the reasons you mention...

>> #+latex_class: article
>> #+latex_class_options: [11pt,draft,AUTO]
>> #+LaTeX_Header: \usepackage{babel}
>> #+language: ru
>
> While AUTO is suitable for \usepackage{babel} and \babelprovide, for
> class option the placeholder should be clearly associated with babel,
> e.g. BABEL_LANG instead of AUTO.

What you say makes sense. However, this was ultimately not implemented
in the current version of the patch because the argument of
org-latex-guess-babel-language is a #+latex_header keyword.

> I am not familiar enough with setting used to generate preview of
> equations or images from LaTeX source blocks, so I am not completely
> sure that suggested changes do not affect these features in some
> negative way.

I think that shouldn't affect previsualization, because if I remember
correctly the preamble used for previews is the value of
org-format-latex-header. But I'm not sure...

Best regards,

Juan Manuel 



Re: org-set-properties for various (all) headings

2022-07-19 Thread Kaushal Modi
On Tue, Jul 19, 2022 at 12:58 PM Uwe Brauer  wrote:

>
> > On Tue, Jul 19, 2022, 10:54 AM Uwe Brauer  wrote:
>
> > Try replacing the `org-set-property` form to:
>
> > (org-set-property "New" "[]")
>
> This does not anything (besides garbage collecting)
>

Did you replace only the `org-set-property` form with my suggestion?

In any case, I got to a computer and I tested that to work alright.

=
* Over
:PROPERTIES:
:ID:   ef19f286-8769-4fe7-8f95-8167691257a0
:COLUMNS:  %5TODO(Status) %5NR(Nr)
:foo:  Over
:END:
** TODO Test
:PROPERTIES:
:Sent: [X]
:END:

** WAIT Test2
:PROPERTIES:
:Sent: [X]
:END:

** TODO Test3
:PROPERTIES:
:Sent: [ ]
:END:

#+begin_src emacs-lisp
(defun test/set-property-at-heading ()
  "Function to be called at the beginning of an Org heading."
  (interactive)
  (let ((el (org-element-at-point)))
(org-set-property "New" "[ ]")))
(org-map-entries #'test/set-property-at-heading)
#+end_src
=

Hit C-c C-c with the cursor in that code block, say "yes" or "y" if
prompted, and then you should see that Org buffer change to:

=
* Over
:PROPERTIES:
:ID:   ef19f286-8769-4fe7-8f95-8167691257a0
:COLUMNS:  %5TODO(Status) %5NR(Nr)
:foo:  Over
:New:  [ ]
:END:
** TODO Test
:PROPERTIES:
:Sent: [X]
:New:  [ ]
:END:

** WAIT Test2
:PROPERTIES:
:Sent: [X]
:New:  [ ]
:END:

** TODO Test3
:PROPERTIES:
:Sent: [ ]
:New:  [ ]
:END:

#+begin_src emacs-lisp
(defun test/set-property-at-heading ()
  "Function to be called at the beginning of an Org heading."
  (interactive)
  (let ((el (org-element-at-point)))
(org-set-property "New" "[ ]")))
(org-map-entries #'test/set-property-at-heading)
#+end_src

#+RESULTS:

=


Re: [PATCH] ox-latex.el: Unify in one single list Babel and Polyglossia languages alists

2022-07-19 Thread Max Nikulin

On 19/07/2022 22:01, Juan Manuel Macías wrote:

+(replace-match
+ (mapconcat (lambda (option) (if (equal "AUTO" option) 
language option))
+(cond ((member language options) (delete 
"AUTO" options))
+  ((member "AUTO" options) options)
+  (t (append options (list language
+", ")


In my opinion this code should not attempt to be excessively clever. If 
user skipped AUTO then do not append language. Test for duplicated 
options is redundant as well. Such cases may still be a reason to issue 
a warning (e.g. by `org-lint').


On the other hand I would consider adding babel by default without 
explicit header. To suppress loading users may add

#+latex_header: % \usepackage{babel}

I like that you decided to avoid inventing of a DSL just to have 
org-like options that are translated to to a couple of preamble 
commands. From my point of view it would not help novices and would make 
things more complicated for experienced LaTeX users.



#+latex_class: article
#+latex_class_options: [11pt,draft,AUTO]
#+LaTeX_Header: \usepackage{babel}
#+language: ru


While AUTO is suitable for \usepackage{babel} and \babelprovide, for 
class option the placeholder should be clearly associated with babel, 
e.g. BABEL_LANG instead of AUTO.


I am not familiar enough with setting used to generate preview of 
equations or images from LaTeX source blocks, so I am not completely 
sure that suggested changes do not affect these features in some 
negative way.





Re: org-set-properties for various (all) headings

2022-07-19 Thread Uwe Brauer

> On Tue, Jul 19, 2022, 10:54 AM Uwe Brauer  wrote:

> Try replacing the `org-set-property` form to:

> (org-set-property "New" "[]")

This does not anything (besides garbage collecting)

-- 
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 


smime.p7s
Description: S/MIME cryptographic signature


Re: org-set-properties for various (all) headings

2022-07-19 Thread Kaushal Modi
On Tue, Jul 19, 2022, 10:54 AM Uwe Brauer  wrote:

>
>
> #+begin_src elisp :noexport
> (defun my-set-property-at-heading ()
>   "Function to be called at the beginning of an Org heading."
>   (interactive)
>   (let ((el (org-element-at-point)))
> (org-set-property "New" (org-element-property "[ ]" el)
> (org-map-entries #'my-set-property-at-heading)
>
> #+end_src
>

Try replacing the `org-set-property` form to:

(org-set-property "New" "[]")

[Not tested, typing from phone.]


Re: numbering src blocks in HTML export

2022-07-19 Thread Fraga, Eric
Followup question, if I may: how can I make -n be default behaviour for
export?  I have tried, for instance,

#+property: header-args:julia -n 1

to have all Julia src blocks show line numbers but it doesn't work.

Thanks again,
eric

-- 
: Eric S Fraga, with org release_9.5.4-643-g057df6 in Emacs 29.0.50


Re: numbering src blocks in HTML export

2022-07-19 Thread Fraga, Eric
On Tuesday, 19 Jul 2022 at 15:28, Juan Manuel Macías wrote:
> I usually do it this way:
>
> #+begin_src sh -n :exports code

Thank you.  Obvious (in hindsight).  

I now found the section in the info manual on this (under Markup for
Rich Contents, which is I guess not where I expected it... but did get
there by following link for switches in header arguments which I somehow
missed earlier.)

eric

-- 
: Eric S Fraga, with org release_9.5.4-643-g057df6 in Emacs 29.0.50

Re: no syntax highlighting for code blocks with org-publish

2022-07-19 Thread M. Pger
I tried to publish using `M-x org-publish RET  RET` as you 
suggested, and syntax highlighting was actually implemented, thanks.

Actually the problem is coming from the fact that I use `emacs -Q --script 
build.el` (as a bash script) to publish the project. According to 
https://list.orgmode.org/ae5693f1-f63d-4383-8840-0fd2dbaac...@gmail.com/ 
(rather old, but apparently this has not changed), font-lock-mode is not 
enabled by default in --batch mode. Since `--script` "run Emacs in batch mode, 
like ‘--batch’, and then read and execute the Lisp code in file" (cf the doc), 
it seems that this is exactly my problem.

A workaround is suggested in 
https://list.orgmode.org/ae5693f1-f63d-4383-8840-0fd2dbaac...@gmail.com/, but 
unfortunately for me it does not work (yet). I am going to dig further into 
that.

Best,

M



Sent with Proton Mail secure email.

--- Original Message ---
On Tuesday, July 19th, 2022 at 9:51 AM, Tim Cross  wrote:


> "M. Pger" mp...@protonmail.com writes:
>
> > Thanks for your suggestion. I added the following:
> >
> > #+begin_src elisp :eval no :exports code
> > (setq my-var "org mailing list")
> > (message "Hello, %s" my-var)
> > #+end_src
> >
> > When exported with ~C-c C-e h o~, syntax highlighting is implemented (with 
> > colors). When
> > exported with org-publish interestingly I have no color, but =setq= is in 
> > bold. Would it
> > be possible that ox-publish implements some kind of really basic builtin 
> > syntax
> > highlighting and ignores htmlize?
>
>
> I tried both exporting an org file into html and publishing and didn't
> get any syntax highlighting for either case. Had a closer look and
> noticed it didn't look like htmlize was being loaded. Did a (require
> 'htmlize) and did both an export and publish, betting syntax
> highlighting for both.
>
> My suspicion is that for the publish option, htmlize wasn't loaded?
> Maybe worth doing an explicit require and then call org-publish directly
> and see if that makes any difference.
>
> Below is the basic publish alist setting I used. Doubt all the slots are
> relevant - it was just a snippet from another project I grabbed to get
> setup.
>
> I also run M-x org-publish  orgfiles  rather than the export menu.
>
>
> (setq org-publish-project-alist
> '(("orgfiles"
> :base-directory "~/playground/org/"
> :base-extension "org"
> :recursive t
> :publishing-directory "~/Public"
> :publishing-function org-html-publish-to-html
> :exclude "PrivatePage.org"
> :html-style-default ""
> :html-scripts ""
> :html-htmlize-output-type 'inline-css
> :html-doctype "html5"
> :html-html5-fancy t
> :html-validation-link nil
> )))



Re: numbering src blocks in HTML export

2022-07-19 Thread Juan Manuel Macías
Fraga, Eric writes:

> I really do not understand the last paragraph although it implies that
> org already supports adding the line numbers.  My elisp-fu is not up to
> scratch to figure this out from the code unfortunately.  Would somebody
> explain what to do?  Or should I simply add the CSS code that would do
> it for me?

I usually do it this way:

#+begin_src sh -n :exports code
aa
bb
dd
ee
ff
#+end_src

And you can also indicate the number of the first line, ie -n 20

Best regards,

Juan Manuel 



numbering src blocks in HTML export

2022-07-19 Thread Fraga, Eric
Hello,

a quick and hopefully easy question: how do I get lines in src blocks
numbered in HTML export?  I have looked at the code and the first thing
I did was set org-html-wrap-src-lines to t.  This wraps each line in
"...".

I know how to use CSS to add line numbers to lines with these tags but,
looking at the export code, I see it uses the following function:

,[ C-h f org-export-get-loc RET ]
| org-export-get-loc is a native compiled Lisp function in ‘ox.el’.
| 
| (org-export-get-loc ELEMENT INFO)
| 
| Return count of lines of code before ELEMENT.
| 
| ELEMENT is an example-block or src-block element.  INFO is the
| plist used as a communication channel.
| 
| Count includes every line of code in example-block or src-block
| with a "+n" or "-n" switch before block.  Return nil if
| ELEMENT doesn’t allow line numbering.
| 
`

I really do not understand the last paragraph although it implies that
org already supports adding the line numbers.  My elisp-fu is not up to
scratch to figure this out from the code unfortunately.  Would somebody
explain what to do?  Or should I simply add the CSS code that would do
it for me?

Thank you,
eric

-- 
: Eric S Fraga, with org release_9.5.4-643-g057df6 in Emacs 29.0.50

Re: [PATCH] ox-latex.el: Unify in one single list Babel and Polyglossia languages alists

2022-07-19 Thread Juan Manuel Macías
Here is a new version of the patch, with the fixes added.

Important: I have modified in this patch org-latex-guess-babel-language
so that it recognizes the new Babel syntax alongside the old syntax.
That is, it is now possible to put:

#+LaTeX_Header: \usepackage[arguments,AUTO]{babel}
#+LaTeX_Header: \babelprovide[arguments]{AUTO}

Languages that are served in Babel *exclusively* via ini files (ie those
with an asterisk in the new list) are not added to the Babel argument
(they must be loaded via babelprovide).

However, the following situation may also occur. A user wants to load
the secondary languages via ldf files and the main language via ini
file (babelprovide):

#+LaTeX_Header: \usepackage[french,english]{babel}
#+LaTeX_Header: \babelprovide[main, import]{AUTO}
#+language: ru

This would produce in LaTeX:

\usepackage[french, english, russian]{babel}
\babelprovide[main, import]{russian}

I have not prevented this behavior as it is correct in Babel: you can
load the main language using the 'old style' and then redefine it using
babelprovide, which is a complement. Besides, maintaining this behavior
is also necessary to preserve backwards compatibility.

Best regards,

Juan Manuel 

>From 2f78d6a75849819f1d3aececff70b7ffa4f36c7c Mon Sep 17 00:00:00 2001
From: Juan Manuel Macias 
Date: Tue, 19 Jul 2022 16:51:55 +0200
Subject: [PATCH] * lisp/ox-latex.el: New variable `org-latex-language-alist'

(org-latex-language-alist): Unify in a single list
`org-latex-polyglossia-language-alist' and
`org-latex-babel-language-alist', and make the two variables
obsolete. However, it may be convenient in the future to replace this
list with a more robust one. (see:
`https://list.orgmode.org/taeb0a$r62$1...@ciao.gmane.io')

(org-latex-guess-babel-language): This function has been modified so
that the new Babel command `babelprovide' is also recognized. This
command is necessary to load the languages served by Babel exclusively
through an ini file. Therefore, the new Babel syntax is supported
alongside the old one.  Note that languages that are served
exclusively via an ini file are not added to the Babel argument.
---
 lisp/org-compat.el |   8 ++
 lisp/ox-latex.el   | 236 ++---
 2 files changed, 125 insertions(+), 119 deletions(-)

diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index 6f663cc24..835ec2828 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -880,6 +880,12 @@ context.  See the individual commands for more information."
   'org-truly-invisible-p "9.6"
   "Compatibility alias for legacy misspelling of `org-truly-invisible-p'.")
 
+(make-obsolete-variable 'org-latex-babel-language-alist
+"set `org-latex-language-alist' instead." "9.6")
+
+(make-obsolete-variable 'org-latex-polyglossia-language-alist
+"set `org-latex-language-alist' instead." "9.6")
+
  Obsolete link types
 
 (eval-after-load 'ol
@@ -888,6 +894,8 @@ context.  See the individual commands for more information."
  (org-link-set-parameters "file+sys"))) ;since Org 9.0
 
 
+
+
 
 ;;; Miscellaneous functions
 
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 1aab8ffd5..2eed44b62 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -172,144 +172,111 @@
 
 ;;; Internal Variables
 
-(defconst org-latex-babel-language-alist
-  '(("af" . "afrikaans")
-("bg" . "bulgarian")
-("ca" . "catalan")
-("cs" . "czech")
-("cy" . "welsh")
-("da" . "danish")
-("de" . "germanb")
-("de-at" . "naustrian")
-("de-de" . "ngerman")
-("el" . "greek")
-("en" . "english")
-("en-au" . "australian")
-("en-ca" . "canadian")
-("en-gb" . "british")
-("en-ie" . "irish")
-("en-nz" . "newzealand")
-("en-us" . "american")
-("es" . "spanish")
-("et" . "estonian")
-("eu" . "basque")
-("fi" . "finnish")
-("fr" . "french")
-("fr-ca" . "canadien")
-("gl" . "galician")
-("hr" . "croatian")
-("hu" . "hungarian")
-("id" . "indonesian")
-("is" . "icelandic")
-("it" . "italian")
-("la" . "latin")
-("ms" . "malay")
-("nl" . "dutch")
-("nb" . "norsk")
-("nn" . "nynorsk")
-("no" . "norsk")
-("pl" . "polish")
-("pt" . "portuguese")
-("pt-br" . "brazilian")
-("ro" . "romanian")
-("ru" . "russian")
-("sa" . "sanskrit")
-("sb" . "uppersorbian")
-("sk" . "slovak")
-("sl" . "slovene")
-("sq" . "albanian")
-("sr" . "serbian")
-("sv" . "swedish")
-("ta" . "tamil")
-("tr" . "turkish")
-("uk" . "ukrainian"))
-  "Alist between language code and corresponding Babel option.")
-
-(defconst org-latex-polyglossia-language-alist
-  '(("am" "amharic")
+(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")
+("ast" "asturian" "*")
 ("bg" 

Re: org-set-properties for various (all) headings

2022-07-19 Thread Uwe Brauer
>>> "KM" == Kaushal Modi  writes:

> Check out org-map-entries. I have one example here:
> https://scripter.co/looping-through-org-mode-headings/#example-modifying-a-property-in-all-headings
> .

Very nice thanks however one question.

I started as test with 


#+begin_src 
** TODO Test
   :PROPERTIES:
   :Sent: [ ]
   :END:

** WAIT Test2
   :PROPERTIES:
   :Sent: [ ]
   :END:

** TODO Test3
   :PROPERTIES:
   :Sent: [ ]
   :END:

#+end_src

I then used the code:
#+begin_src elisp :noexport
(defun test/set-property-at-heading ()
  "Function to be called at the beginning of an Org heading."
(interactive)
  (let ((el (org-element-at-point)))
(org-set-property "foo" (org-element-property :title el
(org-map-entries #'test/set-property-at-heading)

#+end_src

And indeed ended up with 

#+begin_src 
#+COLUMNS: %TODO %40ITEM(Task) %40SUMMARY(Summary) %Received(Rec)
** TODO Test
   :PROPERTIES:
   :Sent: [ ]
   :foo:  Test
   :END:

** WAIT Test2
   :PROPERTIES:
   :Sent: [ ]
   :foo:  Test2
   :END:

** TODO Test3
   :PROPERTIES:
   :Sent: [ ]
   :foo:  Test3
   :END:
#+end_src


However I wanted to insert a checkbox not a title so I tried 

#+begin_src 

#+begin_src elisp :noexport
(defun my-set-property-at-heading ()
  "Function to be called at the beginning of an Org heading."
  (interactive)
  (let ((el (org-element-at-point)))
(org-set-property "New" (org-element-property "[ ]" el)
(org-map-entries #'my-set-property-at-heading)

#+end_src

But this did not work, I am either asked all the time (but I have 200
headers), or it does not work at all. I also tried

#+begin_src elisp :noexport
(defun my-set-property-at-heading ()
  "Function to be called at the beginning of an Org heading."
  (interactive)
  (let ((el (org-element-at-point)))
(org-set-property "New2" (org-element-property :checkbox el
(org-map-entries #'my-set-property-at-heading)

#+end_src


Thanks again 

Uwe Brauer 


smime.p7s
Description: S/MIME cryptographic signature


Re: org-table with different conventions: decimals

2022-07-19 Thread Uwe Brauer

> Uwe Brauer  writes:

> Org tables use Emacs' calc under the hood by default.
> AFAIK, calc is unable to use "," as decimal point because it is reserved
> as a vector separator. Which is why you got the vector addition in your
> example.

Thanks. I was afraid that the issue was with calc not with org-mode.

Uwe 



-- 
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 


smime.p7s
Description: S/MIME cryptographic signature


Re: An org backend to Haddock

2022-07-19 Thread Yuchen Pei
On Tue 2022-07-19 21:58:26 +0800, Ihor Radchenko wrote:

> Yuchen Pei  writes:
>
>> Given this is not the official version of haddock and my changes are in
>> haddock-api, I'm calling it haddorg-api, for lack of a better name /
>> approach.  I'll be happy to contribute my changes upstream if a
>> different license covering my contribution (AGPLv3+) is accepted.
>>
>> Let me know what you think.
>
> I am pretty sure that you are asking the Haskell people for upstreaming
> ;)

Yes - I sent the email to both haskell-cafe and emacs-orgmode, but
upstream here means haddock / haddock-api indeed, thanks for clarifying.

>
> From Org side, it is always welcome when other Free software projects
> are making use of Org.
>
> Also, I looked into
> https://g.ypei.me/haddock.git/tree/haddock-api/src/Haddock/Backends/Org/Types.hs
>
> Beware of possible edge cases with "*/~|" in formatting. I am not
> sure if text containing such symbols is possible as an input for your
> library, but if it is, things may get formatted wrongly.
>
> For example, text containing "|" anywhere inside a table field must have
> "|" escaped using \vert entity. The markup can be escaped using
> zero-width space.

True.  I have not addressed these edge cases in my code, except a quick
hack to prepend a space whenever any line a src block / result block has
a leading star.  Tables on the other hand are extremely rare in Haskell
package documentation strings, and having a | in them is even rarer.

I do wonder what is the best way to handle cross-package links.
Currently I'm using CUSTOM_ID in the format of
package-name-x.y.z.Module.Name.IdentifierName, as well as
Module.Name.IdentifierName.  But this is a "one big org file" approach,
and can make navigation slow when say the org file reaches 15+MB in
size.

Ideally one should be able to navigate the a hackage worth of
documentations easily, with working cross-package links and low latency
org-goto to jump to any identifier or module, but I don't see how to
achieve that.  To be further investigated.

>
> Best,
> Ihor


Best,
Yuchen

-- 
PGP Key: 47F9 D050 1E11 8879 9040  4941 2126 7E93 EF86 DFD0
  



Re: An org backend to Haddock

2022-07-19 Thread Ihor Radchenko
Yuchen Pei  writes:

> Given this is not the official version of haddock and my changes are in
> haddock-api, I'm calling it haddorg-api, for lack of a better name /
> approach.  I'll be happy to contribute my changes upstream if a
> different license covering my contribution (AGPLv3+) is accepted.
>
> Let me know what you think.

I am pretty sure that you are asking the Haskell people for upstreaming
;)

>From Org side, it is always welcome when other Free software projects
are making use of Org.

Also, I looked into
https://g.ypei.me/haddock.git/tree/haddock-api/src/Haddock/Backends/Org/Types.hs

Beware of possible edge cases with "*/~|" in formatting. I am not
sure if text containing such symbols is possible as an input for your
library, but if it is, things may get formatted wrongly.

For example, text containing "|" anywhere inside a table field must have
"|" escaped using \vert entity. The markup can be escaped using
zero-width space.

Best,
Ihor



Re: [PATCH] Fix bug in org-indent-region when org-adapt-indentation is set to headline-data

2022-07-19 Thread Ihor Radchenko
Bastien Guerry  writes:

> Feel free to push the fix if it seems right to you.  We can revert it
> back or improve it if needed.

Applied onto main via 9917d6954.

Best,
Ihor



Re: org-table with different conventions: decimals

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

> In my current setting, the following works
>
> | 3.5 | 4.2 | 7.7 |
> #+TBLFM: $3=$1+$2
>
> Now if I want to switch to the convention used in Germany (that might be
> relevant if I want to export it later to csv, but this is a different
> topic) does work in a strange way, any comments? I would expect
>
> | 3,5 | 4,2 | (7, 7) |
> #+TBLFM: $3=$1+$2
>
>
> | 3,5 | 4,2 | 7,7|
> #+TBLFM: $3=$1+$2

Org tables use Emacs' calc under the hood by default.
AFAIK, calc is unable to use "," as decimal point because it is reserved
as a vector separator. Which is why you got the vector addition in your
example.

Best,
Ihor



Re: Bug: Appointments duration and effort sums in agenda column view [9.3.7 (release_9.3.7-700-ga1e5be @ ~/.emacs.d/straight/build/org/)]

2022-07-19 Thread Ihor Radchenko
Mamoru Miura  writes:

> Dear org community,
>
> I have also faced the problem and have made a patch to fix it. This patch 
> would
> not be the best solution since I'm unfamiliar with Emacs Lisp and the detailed
> implementation of org-mode. I'd appreciate that if you would review and merge
> the patch attached to this mail.
>
> Kind regards,
> Mamoru
> From 314877d3e4ec994a025f267a12ebc4d16b5a2aa5 Mon Sep 17 00:00:00 2001
> From: Mamoru Miura 
> Date: Mon, 18 Jul 2022 18:52:40 +0900
> Subject: [PATCH] lisp/org-colview.el: Fix missing addition of appointments to
>  effort
>
> * lisp/org-colview.el (org-columns--collect-values): re-compute
> appointments' duration because this funtion can not get text property
> `'duration'.

Could you please describe what kind of issue the patch fixes?
Ideally, can you provide steps required to see the issue. 

Best,
Ihor



Re: org-cature-ref

2022-07-19 Thread Ihor Radchenko
Henrik Frisk  writes:

> A couple of questions more:
>
> 1. In the examples at the beginning of the project's  github you have
> examples that have a combination of prperties and bibtex source, with
> preperties such as ID and CREATED. These could be helpful but I can't
> figure out how to add them with my limited knowledge.

Those are from my personal capture templates.
There is nothing fancy there. Just

"%{fetch-bibtex}* TODO %?%(org-capture-ref-get-bibtex-field :title)"
":PROPERTIES:"
":ID: %(org-capture-ref-get-bibtex-field :key)"
":CREATED: %U"
":END:"
"#+begin_src bibtex"
"%(org-capture-ref-get-bibtex-field :bibtex)"
"#+end_src bibtex"

> 2. When you write that there is support for Google Scholar "BiBTeX page",
> what do you mean? In a Google scholar search, if I click "Cite" and then
> choose BiBTeX, I don't get the expected result, but maybe you are referring
> to something else?

I am referring to what you said: "Cite" → "BibTeX". The opened page
should contain the BibTeX entry text. This page can be captured.

For example, the first item (Cite → BibTeX) in
https://scholar.google.com.sg/scholar?q=test

can be captured on my side.

I do not recommend this method though. Google Scholar does not provide
high quality BibTeX entries with DOI and sometimes provides plain wrong
entries.

Best,
Ihor



Re: Recent folding issues

2022-07-19 Thread Ihor Radchenko
Jack Kamm  writes:

> If I put the cursor on Headline 1 and call evil-open-below, I don't
> immediately see a new line, and the buffer looks as above, but with the
> pointer "inside" the elipses. As soon as I start typing, it will unfold
> the last subheading of Headline 1, and the buffer looks like this after
> I finished typing:
>
>> * Headline 1
>> *** Headline 1b1
>>
>> Stuff
>>
>> * New typing here
>> * Headline 2
>
> And also I got the message:
>
>> org-fold-check-before-invisible-edit--text-properties: Edit in invisible 
>> region aborted, repeat to confirm with text visible
>
> Whereas with org-fold-core-style set to "overlays", I get the old
> behavior -- after typing "o" on Headline 1, I see this:
>
>> * Headline 1...
>>  
>> * Headline 2
>
> With the pointer on the new line, and after typing I see:
>
>> * Headline 1...
>> * New typing here 
>> * Headline 2

Thanks for another detailed report!
Fixed on main via 39005dc09.

Let me know if you notice any other inconsistencies.
For clarity, this particular change had been tested for over a year
before it was merged.

Best,
Ihor



Re: [export to CSV]

2022-07-19 Thread Juan Manuel Macías
Uwe Brauer writes:

> Regards (take care with the heat if you live in Spain (not sure though))

Yes, I live in the Sierra de Madrid, where we are always a few degrees
below Madrid, and these days this is an oven. I guess that you are also
in Spain, because of the mail from the UCM. If so, take care too :-).
Although I think that these days few places in Europe are safe...

Best regards,

Juan Manuel 




Re: org-set-properties for various (all) headings

2022-07-19 Thread Kaushal Modi
Check out org-map-entries. I have one example here:
https://scripter.co/looping-through-org-mode-headings/#example-modifying-a-property-in-all-headings
.

On Tue, Jul 19, 2022, 4:16 AM Uwe Brauer  wrote:

>
>
> Now, I would add to all subheadings a new property, say
>
>  :Received:  [ ]
>
> Whose value I will then individually change later.
>
> Any idea how to do that


org-set-properties for various (all) headings

2022-07-19 Thread Uwe Brauer
Hi

I have
* Over
  :PROPERTIES:
  :ID:   ef19f286-8769-4fe7-8f95-8167691257a0
  :COLUMNS:  %5TODO(Status) %5NR(Nr) 
  :END:

** TODO Test
   :PROPERTIES:
   :Sent: [X] 
   :END:

** WAIT Test2
   :PROPERTIES:
   :Sent: [X] 
   :END:

** TODO Test3
   :PROPERTIES:
   :Sent: [ ]
   :END:

Now, I would add to all subheadings a new property, say

 :Received:  [ ]

Whose value I will then individually change later.

Any idea how to do that 



Regards

Uwe Brauer 
-- 
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 




change the default items for enumerated lists

2022-07-19 Thread Uwe Brauer
Hi

When I want to add a plain list, I usually use 

   + C-c -
   + M- 

Now, I would like to have the 1) item as default not -, moreover, when I
use org-metaright to make a sublist I would like to start this list with 
a).

Howe can this be achieved?

Thanks

Uwe Brauer 

-- 
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 




Re: no syntax highlighting for code blocks with org-publish

2022-07-19 Thread Tim Cross


"M. Pger"  writes:

> Thanks for your suggestion. I added the following:
>
> #+begin_src elisp :eval no :exports code
>   (setq my-var "org mailing list")
>   (message "Hello, %s" my-var)
> #+end_src
>
> When exported with ~C-c C-e h o~, syntax highlighting is implemented (with 
> colors). When
> exported with org-publish interestingly I have no color, but =setq= is in 
> bold. Would it
> be possible that ox-publish implements some kind of really basic builtin 
> syntax
> highlighting and ignores htmlize?
>
>

I tried both exporting an org file into html and publishing and didn't
get any syntax highlighting for either case. Had a closer look and
noticed it didn't look like htmlize was being loaded. Did a (require
'htmlize) and did both an export and publish, betting syntax
highlighting for both.

My suspicion is that for the publish option, htmlize wasn't loaded?
Maybe worth doing an explicit require and then call org-publish directly
and see if that makes any difference.

Below is the basic publish alist setting I used. Doubt all the slots are
relevant - it was just a snippet from another project I grabbed to get
setup. 

I also run M-x org-publish  orgfiles  rather than the export menu.

(setq org-publish-project-alist
  '(("orgfiles"
 :base-directory "~/playground/org/"
 :base-extension "org"
 :recursive t
 :publishing-directory "~/Public"
 :publishing-function org-html-publish-to-html
 :exclude "PrivatePage.org"
 :html-style-default ""
 :html-scripts ""
 :html-htmlize-output-type 'inline-css
 :html-doctype "html5"
 :html-html5-fancy t
 :html-validation-link nil
 ))) 



Re: discovering export (and other) keywords?

2022-07-19 Thread Alain . Cochard
kevinbanjo writes on Mon 18 Jul 2022 05:10:
 > this page:
 > 
 > https://orgmode.org/manual/Macro-Replacement.html#index-macro-replacement_002c-during-export
 > 
 > says:
 > 
 > Org also recognizes macro references in keywords, such as ‘CAPTION’, ‘TITLE’,
 > ‘AUTHOR’, ‘DATE’, *and for some back-end specific export options.*
 > 
 > How do I discover what those back end specific options are?

I am guessing it would be difficult to maintain a list of these
options.  On the other hand it should be quick for you to check for a
specific one.

 > Also, for various elements (e.g. begin_src emacs-lisp, begin_export html,
 > etc...) how do I discover what the acceptable keywords are, preferably
 > without only having to go thru the manual pages?

I don't think you can avoid going through the manual.  My experience
is that it is painful anyway.  I would advise you to start from the
few examples provided in the manual and try to adapt to your case;
when an (as simple as possible) example does not work as you would
expect, ask the list; there is a good chance that a good Samaritan
will have pity for you and answer.


-- 
EOST (École et Observatoire des Sciences de la Terre) 
ITE (Institut Terre & Environnement) | alain.coch...@unistra.fr
5 rue René Descartes   [bureau 106]  | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France | [ slot available for rent ]




[export to CSV] (was: org-table with different conventions: decimals)

2022-07-19 Thread Uwe Brauer
>>> "JMM" == Juan Manuel Macías  writes:

Hi Juan Manuel


> Uwe Brauer writes:
>> Now if I want to switch to the convention used in Germany (that might be
>> relevant if I want to export it later to csv, but this is a different
>> topic) does work in a strange way, any comments? [...]

> Hi, Uwe,

> If you only need to export to LaTeX you can load the siunitx package,
> which not only fits the decimals perfectly in a table but you can also
> define a value for the decimal sign that will be seen in the PDF.

Thanks but I don't want to export the table to latex, instead I want to
export it to CSV and later import it into Scalc (LO).

So I think the correct way of dealing with this situation is not export
it with english convention to csv and then in Scalc set the default
language to German and import the csv as English (US).

That is a bit cumbersome, but doable.

Regards (take care with the heat if you live in Spain (not sure though))

Uwe 


smime.p7s
Description: S/MIME cryptographic signature