Possible error in manual

2023-01-07 Thread J G
>
> 2.2.3 Catching invisible edits
>
> Sometimes you may inadvertently edit an invisible part of the buffer and
> be confused on what has been edited and how to undo the mistake. Setting
> org-fold-catch-invisible-edits to non-nil helps preventing this. See the
> docstring of this option on how Org should catch invisible edits and
> process them
>

 org-fold-catch-invisible-edits does not exist in Org mode version 9.5.2,
it should be org-catch-invisible-edits.


thanks
Jim Graf


org-clock-sum-today performance

2023-01-07 Thread Tijs Mallaerts
After building emacs from the master branch (with Org mode version 9.6
release_9.6-81-g563a43) I noticed the org-clock-sum-today function takes
much more time compared to my previous emacs build (with Org mode version
9.5.4 release_9.5.4-19-g4dff42) in a large org buffer.

Are there any settings that could speed up the calculation?

Thank you!
Tijs


Index not translated to pt-BR

2023-01-07 Thread Rafael Bento

Hello, good morning!

The table of Contents doesn't translate when exporting to utf-8 or ODT 
with pt_BR as the value for the LANGUAGE keyword. I believe the line 
below (6180, ox.el file):


("pt_BR" :html "ndice" :utf8 "Índice" :ascii "Indice")

should be something like:

("pt_BR" :html "ndice" :utf-8 "Índice" :ascii "Indice")

or:

("pt_BR" :default "Índice" :html "ndice" :ascii "Indice")

I'm using GNU Emacs 28.2, Org mode version 9.5.5.

Thank you.




Bug report for ox-icalendar: newlines should be CRLF

2023-01-07 Thread Stephen J. Eglen
Hello,

If I have a test file

--

* test 1

<2023-01-05 Thu 19:00-19:20>

--


and then convert to an .ics file using C-c C-e c f

I get the attached test.ics file, but copied here too:

BEGIN:VCALENDAR
VERSION:2.0
X-WR-CALNAME:test
PRODID//Stephen J. Eglen//Emacs with Org mode//EN
X-WR-TIMEZONE:GMT
X-WR-CALDESC:
CALSCALE:GREGORIAN
BEGIN:VEVENT ***
DTSTAMP:20230105T221431Z ***
UID:TS1-81DE7E9C-0385-49CE-8528-C2FD51372CB4 ***
DTSTART:20230105T19Z ***
DTEND:20230105T192000Z ***
SUMMARY:test 1 ***
DESCRIPTION:<2023-01-05 Thu 19:00>–<2023-01-05 Thu 19:20> ***
CATEGORIES:test ***
END:VEVENT
END:VCALENDAR

The lines from BEGIN:VEVENT to CATEGORIES:test inclusive have CR (^M) as well
as LF (^J) as newline [in the text above, I've converted the ^M to ***
to see them eaer.  Is that intended?  Uploading the file to
https://icalendar.org/validator.html gives me the error

> Lines not delimited by CRLF sequence near line # 1
> Reference: RFC 5545 3.1. Content Lines

Nicolas (cc'ed) has confirmed that it seems to be a problem.  Before I
work slowly on a suggested patch, does anyone have an idea on the best
way forward?  Is it possible to encode the file as "DOS" ,using
something like set-buffer-file-coding-system?  SOme lines do however
have \r and \n see e.g. org-icalendar-fold-string which inserts both \r
and \n




Best wishes, Stephen




test.ics
Description: Binary data


28.2; `texmathp` returns `t` everywhere in an Org buffer

2023-01-07 Thread Hiếu Phẩy




Hi, I'm testing on a feature on this development branch of Org-mode
pulled from https://git.tecosaur.net/tec/org-mode

It seems like `texmathp` returns `t` everywhere in an Org buffer, as
written in the email subject. Tecosaur suggest that this should be
reported here.

Here's the results from M-x report-emacs-bug:

In GNU Emacs 28.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo 
version 1.16.0)
of 2022-12-03 built on pop-os
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: Pop!_OS 22.04 LTS

Configured using:
'configure --with-modules --with-json --with-mailutils --with-rsvg
--with-native-compilation --with-xwidgets --with-gif'

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
X11 XDBE XIM XPM XWIDGETS GTK3 ZLIB

Important settings:
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix

Major mode: Org

Minor modes in effect:
eros-mode: t
evil-traces-mode: t
global-evil-surround-mode: t
evil-surround-mode: t
TeX-PDF-mode: t
TeX-source-correlate-mode: t
whitespace-mode: t
recentf-mode: t
global-so-long-mode: t
global-git-commit-mode: t
evil-org-mode: t
mixed-pitch-mode: t
org-modern-mode: t
svg-tag-mode: t
org-appear-mode: t
org-fragtog-mode: t
cursor-sensor-mode: t
laas-mode: t
aas-mode: t
vi-tilde-fringe-mode: t
visual-fill-column-mode: t
+word-wrap-mode: t
org-indent-mode: t
which-key-mode: t
better-jumper-mode: t
better-jumper-local-mode: t
vertico-mode: t
marginalia-mode: t
evil-snipe-override-mode: t
evil-snipe-mode: t
evil-snipe-override-local-mode: t
evil-snipe-local-mode: t
gcmh-mode: t
global-hl-line-mode: t
hl-line-mode: t
winner-mode: t
ws-butler-global-mode: t
ws-butler-mode: t
savehist-mode: t
corfu-echo-mode: t
corfu-popupinfo-mode: t
corfu-history-mode: t
global-corfu-mode: t
corfu-mode: t
global-undo-fu-session-mode: t
undo-fu-session-mode: t
undo-fu-mode: t
persp-mode: t
solaire-global-mode: t
projectile-mode: t
org-super-agenda-mode: t
citar-org-roam-mode: t
org-roam-db-autosync-mode: t
org-latex-preview-auto-mode: t
org-cdlatex-mode: t
pdf-occur-global-minor-mode: t
save-place-mode: t
yas-global-mode: t
yas-minor-mode: t
smartparens-global-mode: t
smartparens-mode: t
evil-goggles-mode: t
global-evil-vimish-fold-mode: t
vimish-fold-global-mode: t
vimish-fold-mode: t
evil-escape-mode: t
doom-modeline-mode: t
shell-dirtrack-mode: t
evil-mode: t
evil-local-mode: t
windmove-mode: t
+popup-mode: t
override-global-mode: t
general-override-mode: t
global-eldoc-mode: t
eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
prettify-symbols-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
window-divider-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
size-indication-mode: t
column-number-mode: t
line-number-mode: t
visual-line-mode: t
transient-mark-mode: t

Load-path shadows:
/home/hieuphay/.emacs.d/.local/straight/build-28.2/org/ob-julia hides 
/home/hieuphay/.emacs.d/.local/straight/build-28.2/ob-julia/ob-julia
/home/hieuphay/.emacs.d/.local/straight/build-28.2/transient/transient hides 
/usr/local/share/emacs/28.2/lisp/transient
/home/hieuphay/.emacs.d/.local/straight/build-28.2/project/project hides 
/usr/local/share/emacs/28.2/lisp/progmodes/project
/home/hieuphay/.emacs.d/.local/straight/build-28.2/xref/xref hides 
/usr/local/share/emacs/28.2/lisp/progmodes/xref
/home/hieuphay/.emacs.d/.local/straight/build-28.2/org/ob-forth hides 
/usr/local/share/emacs/28.2/lisp/org/ob-forth
/home/hieuphay/.emacs.d/.local/straight/build-28.2/org/oc hides 
/usr/local/share/emacs/28.2/lisp/org/oc
/home/hieuphay/.emacs.d/.local/straight/build-28.2/org/ob-gnuplot hides 
/usr/local/share/emacs/28.2/lisp/org/ob-gnuplot
/home/hieuphay/.emacs.d/.local/straight/build-28.2/org/org-tempo hides 
/usr/local/share/emacs/28.2/lisp/org/org-tempo
/home/hieuphay/.emacs.d/.local/straight/build-28.2/org/ob-java hides 
/usr/local/share/emacs/28.2/lisp/org/ob-java
/home/hieuphay/.emacs.d/.local/straight/build-28.2/org/ob-R hides 
/usr/local/share/emacs/28.2/lisp/org/ob-R
/home/hieuphay/.emacs.d/.local/straight/build-28.2/org/oc-natbib hides 
/usr/local/share/emacs/28.2/lisp/org/oc-natbib
/home/hieuphay/.emacs.d/.local/straight/build-28.2/org/ob-octave hides 
/usr/local/share/emacs/28.2/lisp/org/ob-octave
/home/hieuphay/.emacs.d/.local/straight/build-28.2/org/org-macs hides 
/usr/local/share/emacs/28.2/lisp/org/org-macs
/home/hieuphay/.emacs.d/.local/straight/build-28.2/org/ox-texinfo hides 
/usr/local/share/emacs/28.2/lisp/org/ox-texinfo
/home/hieuphay/.emacs.d/.local/straight/build-28.2/org/org-macro hides 
/usr/local/share/emacs/28.2/lisp/org/org-macro
/home/hieuphay/.emacs.d/.local/straight/build-28.2/org/org-agenda hides 
/usr/local/share/emacs/28.2/lisp/org/org-agenda

org-clock-sum-today performance

2023-01-07 Thread Tijs Mallaerts
After building emacs from the master branch (with Org mode version 9.6
release_9.6-81-g563a43) I noticed the org-clock-sum-today function takes
much more time compared to my previous emacs build (with Org mode version
9.5.4 release_9.5.4-19-g4dff42) in a large org buffer.

Are there any settings that could speed up the calculation?

Thank you!
Tijs


Re: Re: OS advice

2023-01-07 Thread Thomas Paulsen
Alternatively, boost memory up to (at least) 8gb of RAM. ­ This isn't too expensive today.Von: Ypo Datum: 07.01.2023 23:26:24An:Betreff: Re: OS adviceThanks you all.I think it is a good idea to try a live-cd. Maybe gentoo¿? I have been looking to some light OS and Triskel mini looks like quite attractive, I tried it many years ago. That will be my second option.Thanks :-)El 07/01/2023 a las 13:32, Ihor Radchenko escribió:Ypo  writes:

Orgmode is sometimes desperately slow on my PC:

Intel(R) Core(TM) i3-2100 CPU @ 3.10GHz, 3100 Mhz

(RAM)    4,00 GB


I am running Windows 10, everything I use works OK, but Orgmode.

Do you think that if I install a Linux OS, Orgmode would run fast? Any 
OS suggestion?

AFAIK, 4Gb is barely enough for Windows 10. If I remember correctly, 4Gb
is the minimal hardware requirement for Windows 10, and it will use
almost the whole RAM in such scenario.

So, using things like Chromium or Emacs will likely exceed your RAM
capacity and put system into using SWAP.

You can downgrade to Windows 7, which just requires 2Gb, or you can use
Linux indeed. For example, my current Gentoo setup with Awesome WM +
Browser + Emacs + Syncthing + RSSHub + davmail running only takes 2.7Gb
RAM with bare system (no extra docker services, Emacs, and browser) only
taking 150Mb.

Gesendet mit Firemail.de - Freemail





Help with a workflow to export plantuml diagrams

2023-01-07 Thread Ypo

Hi

I want to export a diagram, which has a syntax compatible with Orgmode.


I have these headlines:


* Business Process Modelling WBS
** Launch the project
*** Complete Stakeholder Research
*** Initial Implementation Plan
** Design phase
*** Model of AsIs Processes Completed
 Model of AsIs Processes Completed1
 Model of AsIs Processes Completed2
*** Measure AsIs performance metrics
*** Identify Quick Wins
** Complete innovate phase


And I want to export them into a WBS diagram, so I make this block:


#+begin_src plantuml :file my-diagram.png

@startwbs

 * Business Process Modelling WBS
 ** Launch the project
 *** Complete Stakeholder Research
 *** Initial Implementation Plan
 ** Design phase
 *** Model of AsIs Processes Completed
  Model of AsIs Processes Completed1
  Model of AsIs Processes Completed2
 *** Measure AsIs performance metrics
 *** Identify Quick Wins
 ** Complete innovate phase

@endwbs

#+end_src


A workflow could be:

- to use "org-cut-special" and to yank the headlines inside the plantuml 
block.


- After that, I would have to run a macro to insert a blank space before 
each headline, so orgmode doesn't recognize them as headlines.


- Each time I modified the original headlines, I would have to repeat 
that process.


Probably it would be faster to use "org-toggle-item" and work with 
lists, instead of headlines, but there must be a reason for the syntax 
compatibility with orgmode. There must be an intended workflow...


Could be the headlines exported in a faster way?

Could be possible to avoid the duplication of information? (To create 
the diagram directly from the headlines, without yanking a copy of them).



WBS language specification:

https://plantuml.com/wbs-diagram


Thanks


Re: OS advice

2023-01-07 Thread Ypo

Wow! Thanks Juan Manuel!

El 07/01/2023 a las 23:22, Juan Manuel Macías escribió:

Ypo writes:


Hi

Orgmode is sometimes desperately slow on my PC:

Intel(R) Core(TM) i3-2100 CPU @ 3.10GHz, 3100 Mhz

(RAM)4,00 GB

I am running Windows 10, everything I use works OK, but Orgmode.

Do you think that if I install a Linux OS, Orgmode would run fast? Any
OS suggestion?

I've read somewhere that Emacs performance on windows tends to be slow,
but I can't assure you because the last windows I suffered was W98, and
at that time I didn't even use Emacs. According to the official GNU
Emacs website:

#+begin_quote

The reason for GNU Emacs's existence is to provide a powerful editor for
the GNU operating system. Versions of GNU, such as GNU/Linux, are the
primary platforms for Emacs development.

However, GNU Emacs includes support for some other systems that
volunteers choose to support.

[...]

#+end_quote

I don't know what specific performance problems you have with Emacs
under Windows, but you can post them on the Emacs-devel mailing list to
help improve Emacs performance on windows.

However, if you are not tied to windows for work reasons or for a
specific application, my recommendation is that you migrate to
GNU/Linux. But I also recommend that you try to avoid falling into the
clutches of distro hopping, at least to begin with :-). In general, any
of the popular distributions (Ubuntu, Fedora, etc.) is a good choice.
Even if you want the latest of the latest software, EndeavourOS is an
excellent derivative of Arch Linux (much better than Manjaro) with a
very simple graphical installer. Arch itself also has a graphical
installer, if you want to install it, but I would start with Endeavour.
In Linux you also have the possibility of installing light desktop
environments or window managers, which run well with the specifications
of your PC. Lxde and Lxqt are good options, they have openbox as a
window manager, which is robust and highly configurable. But if you
don't want to complicate your life, xfce is a good option. Or Plasma,
which despite being very attractive, I remember that it did not consume
too many resources. And later, if you want to come in the world of
tiling-style window managers, you have a vast territory to explore. I
was very comfortable with BSPWM for a long time, until I migrated to
EXWM (Emacs X Window Manager), which is what I've been using now for a
few years.

Best regards,

Juan Manuel

Re: OS advice

2023-01-07 Thread Jude DaShiell
To run windows 10 well, I wouldn't do it with anything less than 6gb and
even then a screen reader eats 50% of the throughput.  It doesn't matter
how much memory a machine has once a screen reader runs on it 50% of the
throughput is sacrificed immediately.  That was found out working
accessibility for the navy.



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 Sat, 7 Jan 2023, Juan Manuel Mac?as wrote:

> Ypo writes:
>
> > Hi
> >
> > Orgmode is sometimes desperately slow on my PC:
> >
> > Intel(R) Core(TM) i3-2100 CPU @ 3.10GHz, 3100 Mhz
> >
> > (RAM)4,00 GB
> >
> > I am running Windows 10, everything I use works OK, but Orgmode.
> >
> > Do you think that if I install a Linux OS, Orgmode would run fast? Any
> > OS suggestion?
>
> I've read somewhere that Emacs performance on windows tends to be slow,
> but I can't assure you because the last windows I suffered was W98, and
> at that time I didn't even use Emacs. According to the official GNU
> Emacs website:
>
> #+begin_quote
>
> The reason for GNU Emacs's existence is to provide a powerful editor for
> the GNU operating system. Versions of GNU, such as GNU/Linux, are the
> primary platforms for Emacs development.
>
> However, GNU Emacs includes support for some other systems that
> volunteers choose to support.
>
> [...]
>
> #+end_quote
>
> I don't know what specific performance problems you have with Emacs
> under Windows, but you can post them on the Emacs-devel mailing list to
> help improve Emacs performance on windows.
>
> However, if you are not tied to windows for work reasons or for a
> specific application, my recommendation is that you migrate to
> GNU/Linux. But I also recommend that you try to avoid falling into the
> clutches of distro hopping, at least to begin with :-). In general, any
> of the popular distributions (Ubuntu, Fedora, etc.) is a good choice.
> Even if you want the latest of the latest software, EndeavourOS is an
> excellent derivative of Arch Linux (much better than Manjaro) with a
> very simple graphical installer. Arch itself also has a graphical
> installer, if you want to install it, but I would start with Endeavour.
> In Linux you also have the possibility of installing light desktop
> environments or window managers, which run well with the specifications
> of your PC. Lxde and Lxqt are good options, they have openbox as a
> window manager, which is robust and highly configurable. But if you
> don't want to complicate your life, xfce is a good option. Or Plasma,
> which despite being very attractive, I remember that it did not consume
> too many resources. And later, if you want to come in the world of
> tiling-style window managers, you have a vast territory to explore. I
> was very comfortable with BSPWM for a long time, until I migrated to
> EXWM (Emacs X Window Manager), which is what I've been using now for a
> few years.
>
> Best regards,
>
> Juan Manuel
>
>



Re: OS advice

2023-01-07 Thread Ypo

Thanks you all.

I think it is a good idea to try a live-cd. Maybe gentoo¿?

I have been looking to some light OS and Triskel mini looks like quite 
attractive, I tried it many years ago. That will be my second option.


Thanks :-)

El 07/01/2023 a las 13:32, Ihor Radchenko escribió:

Ypo  writes:


Orgmode is sometimes desperately slow on my PC:

Intel(R) Core(TM) i3-2100 CPU @ 3.10GHz, 3100 Mhz

(RAM)    4,00 GB


I am running Windows 10, everything I use works OK, but Orgmode.

Do you think that if I install a Linux OS, Orgmode would run fast? Any
OS suggestion?

AFAIK, 4Gb is barely enough for Windows 10. If I remember correctly, 4Gb
is the minimal hardware requirement for Windows 10, and it will use
almost the whole RAM in such scenario.

So, using things like Chromium or Emacs will likely exceed your RAM
capacity and put system into using SWAP.

You can downgrade to Windows 7, which just requires 2Gb, or you can use
Linux indeed. For example, my current Gentoo setup with Awesome WM +
Browser + Emacs + Syncthing + RSSHub + davmail running only takes 2.7Gb
RAM with bare system (no extra docker services, Emacs, and browser) only
taking 150Mb.


Re: OS advice

2023-01-07 Thread Juan Manuel Macías
Ypo writes:

> Hi
>
> Orgmode is sometimes desperately slow on my PC: 
>
> Intel(R) Core(TM) i3-2100 CPU @ 3.10GHz, 3100 Mhz
>
> (RAM)4,00 GB
>
> I am running Windows 10, everything I use works OK, but Orgmode. 
>
> Do you think that if I install a Linux OS, Orgmode would run fast? Any
> OS suggestion?

I've read somewhere that Emacs performance on windows tends to be slow,
but I can't assure you because the last windows I suffered was W98, and
at that time I didn't even use Emacs. According to the official GNU
Emacs website:

#+begin_quote

The reason for GNU Emacs's existence is to provide a powerful editor for
the GNU operating system. Versions of GNU, such as GNU/Linux, are the
primary platforms for Emacs development.

However, GNU Emacs includes support for some other systems that
volunteers choose to support.

[...]

#+end_quote

I don't know what specific performance problems you have with Emacs
under Windows, but you can post them on the Emacs-devel mailing list to
help improve Emacs performance on windows.

However, if you are not tied to windows for work reasons or for a
specific application, my recommendation is that you migrate to
GNU/Linux. But I also recommend that you try to avoid falling into the
clutches of distro hopping, at least to begin with :-). In general, any
of the popular distributions (Ubuntu, Fedora, etc.) is a good choice.
Even if you want the latest of the latest software, EndeavourOS is an
excellent derivative of Arch Linux (much better than Manjaro) with a
very simple graphical installer. Arch itself also has a graphical
installer, if you want to install it, but I would start with Endeavour.
In Linux you also have the possibility of installing light desktop
environments or window managers, which run well with the specifications
of your PC. Lxde and Lxqt are good options, they have openbox as a
window manager, which is robust and highly configurable. But if you
don't want to complicate your life, xfce is a good option. Or Plasma,
which despite being very attractive, I remember that it did not consume
too many resources. And later, if you want to come in the world of
tiling-style window managers, you have a vast territory to explore. I
was very comfortable with BSPWM for a long time, until I migrated to
EXWM (Emacs X Window Manager), which is what I've been using now for a
few years.

Best regards,

Juan Manuel 



Re: [O] [PATCH] ob-eval: display error fix

2023-01-07 Thread General discussions about Org-mode.


Hi Andreas,

-(display-buffer buf))
+(if org-babel-eval-error-display-notify
+(display-buffer buf)
+  (if (or (not (numberp exit-code))
+  (> exit-code 0))
+  (display-buffer buf

Quick question, does it help or hurt readability if we change this
nested `if' into a `cond' expression?

Or, alternatively, since both the outer then branch and the inner then
branch are the same expression, maybe we can just combine all three
conditions into a single `or' call?

Something like

(when (or org-babel-eval-error-display-notify
  (not (numberp exit-code))
  (> exit-code 0))
  (display-buffer buf))

Best,


RY



Re: When is a function an interactive function? [was Re: Is function 'org-insert-property-drawer' usable?]

2023-01-07 Thread Jean Louis
* alain.coch...@unistra.fr  [2023-01-06 02:16]: 
:ATTACH:
:PROPERTIES:
:ID:   51b2af8b-b2b1-45a7-ab74-1d8e7d8fce7e
:END:
> so I was trying to understand if there is a way to deduce whether or
> not a particular function is a command.  Based on several examples
> such as
> 
>‘M-’ (‘org-do-demote’)

Function is considered command when it has declaration (interactive)

See: (info "(elisp) Defining Commands")

22.2 Defining Commands
==

The special form ‘interactive’ turns a Lisp function into a command.
The ‘interactive’ form must be located at top-level in the function
body, usually as the first form in the body; this applies to both lambda
expressions (*note Lambda Expressions::) and ‘defun’ forms (*note
Defining Functions::).  This form does nothing during the actual
execution of the function; its presence serves as a flag, telling the
Emacs command loop that the function can be called interactively.  The
argument of the ‘interactive’ form specifies how the arguments for an
interactive call should be read.

Please note
---

The word "interactive" is used in context of Emacs Lisp, and not in
the context of English language.

In the context of the English language any Emacs Lisp function may be
interactive, even if it is not a command.

And to note is that only commands, which are functions with
(interactive) declaration, may be bound to keys.

> I conjectured that, when an interactive function does correspond to a
> command,

Function with (interactive) declaraion IS a command.

But in English language ordinary context in computing, a function may
be interactive but not a command, because it does not have
(interactive) declaration.

> it is just mentioned between parentheses, right after its
> corresponding key combination.  I tried to check this in an as much
> systematic way as I could and investigated 330 such instances (based
> on the manual of version 9.5).

> - that even if a function is _not_ mentioned in that conventional
>   form, it be explicitly stated in the manual that it is
>   non-interactive (just as was recently proposed for
>   'org-insert-property-drawer' by Ihor+Bastien).

When programmer wish to find out if function is interactive, one can
use C-h f function-name-here to see if it is interactive, or one may
jump to it's definition:

(find-function 'org-insert-property-drawer) and see if there is
declaration to be command, 

or to use the test like this:

(commandp 'org-insert-property-drawer) ➜ nil

IMHO, mentioning for each function if it is interactive or
non-interactive in Emacs manual is waste.

And programmers shall observe that commands should appear only in
corresponding modes:

If MODES is present, it should be a list of mode names (symbols) that
this command is applicable for.  The main effect of this is that
‘M-x TAB’ (by default) won’t list this command if the current buffer’s
mode doesn’t match the list.  That is, if either the major mode isn’t
derived from them, or (when it’s a minor mode) the mode isn’t in effect.

> (interactive  ARG-DESCRIPTOR  MODES)

> If MODES is present, it should be a list of mode names (symbols) that
> this command is applicable for.  The main effect of this is that
> ‘M-x TAB’ (by default) won’t list this command if the current buffer’s
> mode doesn’t match the list.  That is, if either the major mode isn’t
> derived from them, or (when it’s a minor mode) the mode isn’t in
> effect.

And sharp programmers should make sure that their functions that may
be invoked interactively in other modes, recognize what is going on
and don't disturb user's work or data.

> For example, with the cursor on 'org-capture-finalize' in the manual,
> 'C-h f ' gives nothing right away; 'C-h f org-capture' does
> not offer 'org-capture-finalize' as a completion; 'C-h f
> org-capture-fin' does complete and says that
> 'org-capture-finalize' is interactive; and then it becomes possible to
> use it with 'M-x'.
> 
> Similarly, as far I as can see, 'M-x org-attach-attach' fails right
> away, but works after having been used once with the standard (menu)
> way.

Good inspection!

I find it not right that I can even invoke `M-x og-attach-attach' in
this mail mode.

And I find it out of control that directory was created in ~/data
without asking me or telling me, by using `org-attach'.

We have too many expectations.

> I can understand why it is like that, but still find it disconcerting.
> If it is to stay this way, perhaps things could be made more explicit
> in the manual.

Thanks for observation.

> List (of non interactive functions that might be thought interactive
> to the ignorant):
> 
> - ‘C-u C-u ’ (‘org-set-startup-visibility’)

Any function without (interactive) declaration may be made a "command"
by adding declaration by using `lambda' like this:

(lambda () (interactive) (org-set-startup-visibility))

and that `lambda' may be bound to key.

> - ‘C-c C-e’ (‘org-export’) 
> 
>   Shouldn't this one be 'org-export-dispatch'?


Re: [BUG] Org agenda misbehaves in a side window [9.5 (9.5-g0a86ad @ /home/zellerin/.emacs.d/elpa/org-9.5/)]

2023-01-07 Thread Jean Louis
* Ihor Radchenko  [2023-01-06 17:56]:
> Tomas Zellerin  writes:
> 
> > When Agenda buffer is in a side window, several actions fail with
> > "Cannot make side window the only window".
> >
> > Example:
> >
> > emacs -Q
> > in *scratch*, (setq display-buffer-alist '(("\\*Org Agenda\\*"
> > display-buffer-in-side-window)))
> > M-x org-agenda t to display Todo agenda
> > in org-agenda buffer, another M-x org-agenda is observed fails with error 
> > above,
> > expected is display the menu to select agenda command
> 
> Confirmed.
> 
> > Other failing commands are for example changes of todo state in agenda
> > buffer.
> >
> > The reason seems that org-agenda-get-restriction-and-command calls
> > delete-other-window; however, this is not something user observes and
> > expects as effect of those commands.
> 
> Sure, but what can we do in order to both fix this and also not break
> the existing behaviour?

You can do this:

GNU Emacs package: rcd-org-agenda-dashboard.el -- RCD Org Agenda Dashboard:
https://gnu.support/gnu-emacs/packages/GNU-Emacs-package-rcd-org-agenda-dashboard-el-RCD-Org-Agenda-Dashboard-76669.html

Follow same principles for Org Agenda, liberate it into derived mode
where people use it just as any other Emacs buffer.


-- 
Jean

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

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



Re: Export Org with Org concept -- Re: Problems with C-c C-e file.org,

2023-01-07 Thread Jean Louis
* Max Nikulin  [2023-01-06 06:30]:
> Could you, please, concentrate on your vision of proper
> `org-export-registered-backends' design? 

I leave that to Org developers. That variable is not described well,
neither mentioned in Org manual.

I can only reiterate my point which you did not understand. In Emacs
there are thousands of extensions. There is mainstream Emacs and there
are ELPA, and other repositories and all kinds of Emacs packages.

Functions found in those packages may be commands (interactive), and
it is up to user how to bind those keys. 

Read (info "(elisp) Key Binding Conventions")

Based on that I don't find it consistent that in variable
`org-export-registered-backends' Org has something like this:

(85 "As UTF-8 buffer"
   (lambda
 (a s v b)
 (org-ascii-export-as-ascii a s v b
'(:ascii-charset utf-8

as that asks for key probably 85 to be defined for that specific
function.

And the design of that variable leads to Gordian knot of the tangled
code because it demands from all other exporters and extensions to
follow that principle.

And principle is not consistent to (info "(elisp) Key Binding Conventions")

So why do that?

I recommend not binding authors of Org export packages to provide
keys and let users be free to decide which keys to use for which
export. 

I can think that by clicking first time on a menu item in RCD Org
Export, that I can ask user if to assign which key for that export,
and remember that option. Provide something like that, a helpful
assistance function that when some option is invoked multiple times,
that computer may offer to user to assign it permanently to some key.

Or when some prefix is invoked that user may decide which key to use,
and that key is remembered for next sessions.

In general, leave to users how to bind keys.

> Do not repeat that blocking menu is not convenient enough sometimes. 

I am repeating it thousands of times on website pages. If it disturbs
you, is personal problem, which I can't help with. Some things don't
get done unless points are repeated..

> Say what should be used instead of `org-export-registered-backends'.

Before to tell that, you should describe that variable better.

"List of backends currently available in the exporter.
This variable is set with `org-export-define-backend' and
`org-export-define-derived-backend' functions."

What I see from RCD Org Export view point is that:

- there is variable `org-export-backends' which says which exports are
  customized by user to be "there". In my case:

  org-export-backends ➜ (org odt md latex html ascii)

- I would like menu in RCD Org Export to appear for those backends
  which are customized by user. So I have 3 solutions, one is totally
  independent of Org mainstream, which would simply recognize those to
  me known exporting functions and show the menu of whatever packages
  are available for export, and other would be convenient, to
  recognize what user wants and offer only that. Or combination of
  those.

Sorry, I do not understand why `org-export-backends' do not recognize
all the pandoc based exports. I do understand why those exports appear
in the org-export-dispatch menu. 

Is then Org consistent to user that user can turn on, turn off, any
export that user wish or want?

Or is not consistent? It appears not consistent for ox-pandoc package.

If Org is not consistent, then I better build on the external
foundation without asking Org variables, but just recognizing which
functions already exist.

I can as well simply parse variable `org-pandoc-menu-entry' for
construction of the menu.

-- 
Jean

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

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



Re: Export Org with Org concept -- Re: Problems with C-c C-e file.org,

2023-01-07 Thread Jean Louis
* Ihor Radchenko  [2023-01-07 12:04]:
> As I said, the requirement to get it into the core is re-creating
> previous layout and bindings. The layout and bindings may be
> customizable, but they must be available.

You have got the concept, you may implement it.

> > The Concept and More Ideas:
> > ---
> >
> > 1. You can create derived mode, for example Org derived mode.
> 
> This has pros and cons. Org derived mode means that personal
> customization, including key bindings and themes, may affect menus. This
> may or may not be desired.

It was example of the mode. You may use any mode you wish. I said it
is example. 

Though I do not know how personal customization may affect the
generated temporary Org buffer which sole purpose is to invoke
functions.

If for example, export of body only is somewhere customized than
package similar to RCD Org Export may set those variables
correspondingly, or recognize user's options.

> > 3. You can create read-only, temporary buffers for export in that
> >derived mode.
> 
> I am not sure what you are referring to.

You have to review the concept I have sent. A temporary generated
buffer is used as menu, in read-only mode. Of course you don't want to
users to write into temporary generated buffer (RCD Org Export), but
if they really want, they can turn off read-only-mode. Because you
wish to setup key bindings, you should use derived mode. I am
referring to concept how you would do the non-blocking menu.


> > 4. Because it is read only, similar to modal modes, you do not need
> >complicated key bindings, you don't need to use C-combinations for
> >few simple things, use simply letter. 
> 
> Same as what we do now in the menus. I do not think that we need to
> change the existing bindings (by default).

All is your choice. I am giving you concept on which you can build.

> > 5. Though it implies you can use same key bindings for
> >"compatibility", but I would say it rather honestly for bad habits,
> >as in the derived.
> 
> As I said earlier, "bad habits" is a judgment. We will not break user
> experience if we don't have to. It includes existing bindings.
> 
> Introducing alternatives is possible though.

Of course it is judgment, and nothing wrong with it, I keep judging
it, that is why I don't use it, it is disturbing. All opinions are
judgments. Though my judgments are based on experience with Org and
many other software, it is informed opinion, not just a biased opinion
without inspection. It is opinion with a solution. People make
opinions all the time, that something is judgment is obvious.


-- 
Jean

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

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



Re: Export Org with Org concept -- Re: Problems with C-c C-e file.org,

2023-01-07 Thread Jean Louis
* Ihor Radchenko  [2023-01-07 12:04]:
> > The Concept and More Ideas:
> > ---
> >
> > 1. You can create derived mode, for example Org derived mode.
> 
> This has pros and cons. Org derived mode means that personal
> customization, including key bindings and themes, may affect menus. This
> may or may not be desired.

OK so to be constructive, you have to start somewhere.

Question is:

1. Do you want Org Export menus to appear in non-blocking buffer? So
   far I understood, answer is YES.

2. Then do you want derived buffer? If yes, which one? It is necessary
   as to be able to assign key bindings that work only in such
   buffer. My recommendation is that it is derived from org-mode.

   I can't see how personal customization affects the buffer look. The
   theme or Org themes if such exist may affect it, so what? That was
   choice of the user. Emacs themes anyway affect the current org
   export buffer.

   Those are very minor issue, decide if you wish derived mode, and
   make definition for it.

> > 2. You can create key bindings freely for that derived mode.
> 
> +1

Then make list of what is always to be there and with which key
bindings.

I would say make a package that is separate from Org so that it can be
add-on for some time, until people can test it.

Once there is list of options which always must be there, with key
bindings, then you make functions to display those options.

-- 
Jean

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

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



Re: Beamer export: Executing LaTeX between two frames

2023-01-07 Thread M . ‘quintus’ Gülker
Dear Ihor,

please apologise the slow reply.

Am Sonntag, dem 26. Juni 2022 schrieb Ihor Radchenko:
> This is too hacky as for my taste.
>
> I'd rather use :ignore: tag from ox-extra:

This works decently. I did not know about “ox-extra” before. For
reference, it is here: 


What I then did was:

(require 'ox-extra)
(ox-extras-activate '(ignore-headlines))

And then export to latex-beamer as usual. Just like Ihor described, the
two headings tagged “:ignore:” are suppressed from the output and the
“\usebackgroundtemplate” macro is properly wrapped around the
non-ignored heading.

Thank you Ihor.

  -quintus

-- 
Dipl.-Jur. M. Gülker | https://mg.guelker.eu | PGP: Siehe Webseite
Passau, Deutschland  | kont...@guelker.eu| O<



list.orgmode.org: planned maintenance on 2023-01-15

2023-01-07 Thread Kyle Meyer
https://list.orgmode.org will be intermittently offline on Sunday
January 15 during a 19:00-20:00 UTC maintenance window.



Re: Filter for HTML (cite) footnotes?

2023-01-07 Thread M . ‘quintus’ Gülker
Dear all,

I ought to drive this thread to its completion. What I intend to do is
better covered by the new callback functions provided by citeproc-el:


  -quintus

Am Dienstag, dem 08. März 2022 schrieb Juan Manuel Macías:
> M. ‘quintus’ Gülker writes:
>
>> That is, what I am after effectively, is post-processing the results
>> generated by org-cite resp. citeproc.el. I have names in my
>> bibliographic database like “Axel von Hellfeld”, which contain the
>> German name particle “von”. Some (not all) citation customs require
>> “von” to be abbreviated to “v.” so that the cited name becomes
>> “v. Hellfeld”. This is not possible with CSL, so I look for another
>> way to automate this during the export process.
>
> I see. Have you tried using `org-export-filter-final-output-functions'?
> You can try a find/replace function for the footnotes of final
> output. The drawback is that the scope here is broader and
> care should be taken with false positives...
>
> Best regards,
>
> Juan Manuel 


-- 
Dipl.-Jur. M. Gülker | https://mg.guelker.eu | PGP: Siehe Webseite
Passau, Deutschland  | kont...@guelker.eu| O<



Re: [BUG] issue with texmathp [9.6 (release_9.6-22-g78d283 @ /home/jds6696/.emacs.d/straight/build/org-mode/)]

2023-01-07 Thread Ihor Radchenko
Daniel Fleischer  writes:

> BTW, I haven't follow any discussions about org syntax and math
> environments inside org (the use of \...[\] instead $...$ etc.) These
> usecases I mentioned are what I'm used to and perhaps they are not
> consistent with changes made to the org syntax, demanding every math
> should be inside a math environment for easier parsing and you still
> managed to solve that without all the previous regexps.

We did not make changes to syntax. Just decided to aim towards less
visibility of $..$ in the documentation.

At the end, we don't want to break existing documents, just to
discourage people from using $...$ syntax.

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



Re: Babel (scheme): Evaluation errors are not shown

2023-01-07 Thread Marc Nieper-Wißkirchen
Am Sa., 7. Jan. 2023 um 08:44 Uhr schrieb Ihor Radchenko :
>
> Marc Nieper-Wißkirchen  writes:
>
> >> Thanks!
> >> Note that your patch does not apply onto main.
> >
> > Rebased against the latest main.  Please see the appended patch.
>
> Hmm.
> Not sure what is going on here, but I am getting
>
> 128 git … am --3way -- 
> /tmp/0001-lisp-ob-scheme.el-Do-not-hide-Scheme-evaluation-erro.patch
> Applying: lisp/ob-scheme.el: Do not hide Scheme evaluation errors.
> Using index info to reconstruct a base tree...
> error: patch failed: lisp/ob-scheme.el:194
> error: lisp/ob-scheme.el: patch does not apply
> error: Did you hand edit your patch?
> It does not apply to blobs recorded in its index.
> Patch failed at 0001 lisp/ob-scheme.el: Do not hide Scheme evaluation errors.
> hint: Use 'git am --show-current-patch=diff' to see the failed patch
> When you have resolved this problem, run "git am --continue".
> If you prefer to skip this patch, run "git am --skip" instead.
> To restore the original branch and stop patching, run "git am --abort".

Okay, apparently, `git format-patch -w' to ignore whitespace changes
does not work (at least not as simple as I thought).

A new patch file is attached; `git am' against the upstream head works here.

Thanks,

Marc

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


0001-lisp-ob-scheme.el-Do-not-hide-Scheme-evaluation-erro.patch
Description: Binary data


Re: [BUG] issue with texmathp [9.6 (release_9.6-22-g78d283 @ /home/jds6696/.emacs.d/straight/build/org-mode/)]

2023-01-07 Thread Daniel Fleischer
Ihor Radchenko  writes:

> Can you try to test the attached patch?

Looks good. Now these work again: `cdlatex-dollar`, inserting symbols
using ` outside math environments and inserting cdlatex environments
with completion also outside math environments. Need to make sure the
issue of the OP didn't regress.

BTW, I haven't follow any discussions about org syntax and math
environments inside org (the use of \...[\] instead $...$ etc.) These
usecases I mentioned are what I'm used to and perhaps they are not
consistent with changes made to the org syntax, demanding every math
should be inside a math environment for easier parsing and you still
managed to solve that without all the previous regexps.

Thank you,

-- 
Daniel Fleischer



Re: Babel (scheme): Evaluation errors are not shown

2023-01-07 Thread Bastien Guerry
Ihor Radchenko  writes:

> As for GCC-related assignment, I am not sure if it is sufficient.

I confirm that the copyright assignment should explicitely mention
EMACS as a GNU project.

-- 
 Bastien



[O] [PATCH] ob-eval: display error fix

2023-01-07 Thread Andreas Gerler


0001-lisp-ob-eval.el-Display-error-fix.patch
Description: Binary data


Dear all,

since commit

f7b16402e6a694d592210f766544f6114056b4b0

every sql code block is displaying the *Org-Babel Error Output* for me due to 
warning messages from the database.
I added a check to display the buffer only if non zero exit.
The buffer still gets written.
Additionally I added defcustom org-babel-eval-error-display-notify
If anybody is in need to display everything he can toggle it.

I signed my FSF papers in 2017 for an ob-sql patch.

so long…

Andreas Gerler

—

http://www.bundesbrandschatzamt.de/~baron




signature.asc
Description: Message signed with OpenPGP


Re: [SECURITY] Arbitrary code evaluation security in Org (was: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable)

2023-01-07 Thread Ihor Radchenko
Ihor Radchenko  writes:

>> I do wonder if the idea of a document classification model and some form
>> of heuristic algorithms to handle default document classification might
>> be useful.
>
> I do not think that we need to go in this direction.
> I doubt that we are qualified to get the heuristics right.
> Such things should either be maintained in Emacs core or not provided at
> all to not create false sense of security.

And I was wrong.

There is `unsafep' and `safe-functions' customization, which we can
utilize.

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



Re: [PATCH][oc-csl] Improve reference parsing

2023-01-07 Thread M . ‘quintus’ Gülker
Dear all,

I probably have not much to contribute to this rather technical thread,
but Ihor has redirected me here two times for my citation formatting
questions[1][2]. So I would like to ask if there is something I can do to
accelerate its inclusion into org so that I can start using macros in
citations?

  -quintus

[1]: https://list.orgmode.org/orgmode/87o7tb8pc1.fsf@localhost/

[2]: https://list.orgmode.org/orgmode/87zgcw8gtd.fsf@localhost/

-- 
Dipl.-Jur. M. Gülker | https://mg.guelker.eu | PGP: Siehe Webseite
Passau, Deutschland  | kont...@guelker.eu| O<



Re: [PATCH] org-datetree.el: Allow datetrees with TODO, priority, tags

2023-01-07 Thread Ihor Radchenko
Ilya Chernyshov  writes:

>  (defun org-datetree--find-create
> @@ -169,18 +167,19 @@ component.  If INSERT is non-nil and there is no match 
> then it is
>  inserted into the buffer."
>(when (or month day)
>  (org-narrow-to-subtree))
> -  (let ((re (format regex-template year month day))
> +  (let ((re (format org-complex-heading-regexp-format
> +(format regex-template year month day)))

These changes make the docstring for `org-datetree--find-create'
incorrect:

(defun org-datetree--find-create
(regex-template year  month day insert)
  "Find the datetree matched by REGEX-TEMPLATE for YEAR, MONTH, or DAY.
REGEX-TEMPLATE is passed to `format' with YEAR, MONTH, and DAY as
arguments.  Match group 1 is compared against the specified date
component.  If INSERT is non-nil and there is no match then it is
inserted into the buffer."

Please update the docstring to reflect the new behaviour.

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



Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2023-01-07 Thread Ihor Radchenko
Ihor Radchenko  writes:

>> See the attached patch.
>
> Thanks!
> Installed onto bugfix.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=41ebc2e40

And still not enough...
Though this time it does not look like our fault:

https://builds.sr.ht/~bzg/job/918602
3 unexpected results:
   FAILED  ob-octave/graphics-file  ((should-not (buffer-live-p (get-buffer 
"*Org-Babel Error Output*"))) :form (buffer-live-p #) :value t)
   FAILED  ob-octave/graphics-file-space  ((should-not (buffer-live-p
   (get-buffer "*Org-Babel Error Output*"))) :form (buffer-live-p
   #) :value t)

I filed a bug report to Emacs:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60626

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



Re: OS advice

2023-01-07 Thread Ihor Radchenko
Ypo  writes:

> Orgmode is sometimes desperately slow on my PC:
>
> Intel(R) Core(TM) i3-2100 CPU @ 3.10GHz, 3100 Mhz
>
> (RAM)    4,00 GB
>
>
> I am running Windows 10, everything I use works OK, but Orgmode.
>
> Do you think that if I install a Linux OS, Orgmode would run fast? Any 
> OS suggestion?

AFAIK, 4Gb is barely enough for Windows 10. If I remember correctly, 4Gb
is the minimal hardware requirement for Windows 10, and it will use
almost the whole RAM in such scenario.

So, using things like Chromium or Emacs will likely exceed your RAM
capacity and put system into using SWAP.

You can downgrade to Windows 7, which just requires 2Gb, or you can use
Linux indeed. For example, my current Gentoo setup with Awesome WM +
Browser + Emacs + Syncthing + RSSHub + davmail running only takes 2.7Gb
RAM with bare system (no extra docker services, Emacs, and browser) only
taking 150Mb.

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



Re: [BUG] Conflict between Org hyperlink and auto-complete (I think) [9.6 ( @ /home/dsmasterson/.emacs.d/elpa/org-9.6/)]

2023-01-07 Thread Ihor Radchenko
David Masterson  writes:

>> You may consider using https://github.com/Malabarba/elisp-bug-hunter
>
> I think I'll add this package to my setup, but I don't think it can help
> in this case as it's an infinite loop bug.  Once it's locked in the
> loop, I have to kill emacs, so elisp-bug-hunter would never have a
> chance to report anything.

You can use interactive bisection.
See https://list.orgmode.org/orgmode/87ee2nlslt.fsf@localhost/ and 
https://cubeatic.com/index.php/s/iQakFWXgxsJzyXP

> Question: does Org scan (some part of the) text *AS* you are typing?
>
> I'm beginning to think that the answer is 'no' and, so, it was
> auto-complete that tripped on a sequence of characters.  I'll have to
> look at which part of auto-complete did it.

Yes, Org does scan things as you type. However, you should always be
able to exit upon typing C-g (maybe
`org-element--cache-interrupt-C-g-max-count' times).

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



Re: Documentation missing for several org-habit variables?

2023-01-07 Thread Ihor Radchenko
Christian Heinrich  writes:

> I noticed that https://orgmode.org/manual/Tracking-your-habits.html explains 
> only a few variables
> that exist in org-agenda.el and that are declared via defvar.
>
> However, in org-habit.el, more variables exist but are declared via 
> defcustom. I cannot find any
> documentation (online) on, e.g., org-habit-today-glyph.
>
> Is this correct / are you aware of this or should the documentation for these 
> variables be added as
> well?

Manual does not need to describe all the possible customizations. Just
the most important ones.

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



Re: Tilde not expanded during latex export

2023-01-07 Thread Ihor Radchenko
alain.coch...@unistra.fr writes:

> release_9.6-193-g30314c 
>
> I have file '~/Org/test.org', which contains
>
>#+begin_src org
>  * foo
>  bar
>#+end_src
>
> I do 'C-c '' from within the src block, then 'C-c C-e l o' from the
> *Org Src test.org[ org ]* buffer.
>
> The minibuffer asks for an output file:
>  
>Output file: ~/Org/
>
> I add 'foobar.tex' then  and get:
>
>Wrote /home/cochard/Org/foobar.tex
>Processing LaTeX file ~/Org/foobar.tex...
>Latexmk: Filename '~/Org/foobar.tex' contains character not allowed

Thanks for reporting!
Fixed, on bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5a8a1d4ff

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



Re: LaTeX export for Org Mode Documents written in Indic Languages

2023-01-07 Thread Ihor Radchenko
Krishna Jani  writes:

> I have never had to write in languages other than English but an
> assignment just came up to transcribe the Indian Penal Code in
> simple and understandable Hindi. I have an Org file with some of my
> transcriptions (because of Emacs's awesome language support) but I am
> unable to org-export these files to pdf. I suppose I must install some
> latex packages, but I have not been able to find any documentation for
> the same. I dont really know latex, I mainly just use it for Org pdf
> export. 
>
> Has anyone had a similar experience, or has a clue to this problem. Is
> there some documentation relating to languages that I can read

LaTeX makes it tricky to export non-English out of the box.
We support it partially via LANGUAGE setting (see 13.10.2 LaTeX specific
export settings), but you still need to accompany this with installing
certain LaTeX packages and adding LaTeX headers manually.

See the discussion in https://list.orgmode.org/orgmode/87h6z7jq4o.fsf@localhost/
The discussion also mentions some useful LaTeX headers and packages.

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



Re: [BUG] issue with texmathp [9.6 (release_9.6-22-g78d283 @ /home/jds6696/.emacs.d/straight/build/org-mode/)]

2023-01-07 Thread Ihor Radchenko
Daniel Fleischer  writes:

> I just found this thread after math-related things stopped working. I
> have two use cases that don't work now:
>
> 1. Inserting a dollar pair $$ using `cdlatex-dollar` (it thinks we're
> inside a math environment).
>
> 2. Inserting of cdlatex environments using their built-in completions, e.g.
> ali
> eqn
>stopped working.

Thanks for reporting!
So, the docstring was erroneous at the end.

Can you try to test the attached patch?

>From bce44c75b73fa0b935a9f991624a292e061f5c73 Mon Sep 17 00:00:00 2001
Message-Id: 
From: Ihor Radchenko 
Date: Sat, 7 Jan 2023 14:17:26 +0300
Subject: [PATCH] org-cdlatex-mode: Fix regression from f01390cf05

* lisp/org.el (org--math-always-on): Rename to `org--math-p' and only
override `texmathp' when current command is `cdlatex-math-symbol' or
when we are inside Org LaTeX math fragment.  Only these two scenarios
are the places where `texmathp' may not work properly in Org files.
We must not return t outside latex fragments as initially suggested by
the docstring because it would break, for example, `cdlatex-dollar'
command.
(org-cdlatex-mode): Use the new function name for advice.
* lisp/org-compat.el (org--math-always-on): Declare obsolete.

Reported-by: Daniel Fleischer 
Link: https://orgmode.org/list/m2cz7sj5zt@gmail.com
---
 lisp/org-compat.el |  3 +++
 lisp/org.el| 27 ---
 2 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index 6c5085255..0f6dc831a 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -568,6 +568,9 @@ (defun org-let2 (list1 list2  body) ;FIXME: Where did our karma go?
 (make-obsolete 'org-let "to be removed" "9.6")
 (make-obsolete 'org-let2 "to be removed" "9.6")
 
+(define-obsolete-function-alias 'org--math-always-on
+  'org--math-p "9.7")
+
 (defun org-compatible-face (inherits specs)
   "Make a compatible face specification.
 If INHERITS is an existing face and if the Emacs version supports
diff --git a/lisp/org.el b/lisp/org.el
index ae6250e52..44c41a729 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15434,13 +15434,15 @@ (define-minor-mode org-cdlatex-mode
 (cdlatex-compute-tables))
   (unless org-cdlatex-texmathp-advice-is-done
 (setq org-cdlatex-texmathp-advice-is-done t)
-(advice-add 'texmathp :around #'org--math-always-on)))
+(advice-add 'texmathp :around #'org--math-p)))
 
-(defun org--math-always-on (orig-fun  args)
-  "Always return t in Org buffers.
-This is because we want to insert math symbols without dollars even outside
-the LaTeX math segments.  If Org mode thinks that point is actually inside
-an embedded LaTeX fragment, let `texmathp' do its job.
+(defun org--math-p (orig-fun  args)
+  "Return t inside math fragments or running `cdlatex-math-symbol'.
+This function is intended to be an :around advice for `texmathp'.
+
+If Org mode thinks that point is actually inside
+an embedded LaTeX environment, return t when the environment is math
+or let `texmathp' do its job otherwise.
 `\\[org-cdlatex-mode-map]'"
   (interactive)
   (cond
@@ -15450,11 +15452,14 @@ (defun org--math-always-on (orig-fun  args)
 t)
(t
 (let ((element (org-element-context)))
-  (or (not (org-inside-LaTeX-fragment-p element))
-  (if (not (eq (org-element-type element) 'latex-fragment))
-  (apply orig-fun args)
-(setq texmathp-why '("Org mode embedded math" . 0))
-	t))
+  (when (org-inside-LaTeX-fragment-p element)
+(pcase (substring-no-properties
+(org-element-property :value element)
+0 2)
+  ((or "\\(" "\\[" (pred (string-match-p (rx string-start "$"
+   (setq texmathp-why '("Org mode embedded math" . 0))
+   t)
+  (_ (apply orig-fun args
 
 (defun turn-on-org-cdlatex ()
   "Unconditionally turn on `org-cdlatex-mode'."
-- 
2.38.1


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


Re: [MAINTENANCE] Org orphanage?

2023-01-07 Thread Bastien Guerry
Bastien  writes:

> Shall I create https://git.sr.ht/~bzg/org-orphan-packages ?

Or better https://git.sr.ht/~org-orphanage/ as a new user, to where
Org orphan repos could be added.

This would mimick emacsorphanage, which is a GitHub organization.

-- 
 Bastien



Re: LaTeX export for Org Mode Documents written in Indic Languages

2023-01-07 Thread Vikas Rawal
>
>
> I have an Org file with some of my
> transcriptions (because of Emacs's awesome language support) but I am
> unable to org-export these files to pdf. I suppose I must install some
> latex packages, but I have not been able to find any documentation for
> the same. I dont really know latex, I mainly just use it for Org pdf
> export.
>
>
I had once written a blog post (from 2012) describing steps for writing and
exporting devanagari which is still available at:
https://web.archive.org/web/20131201063324/http://agrarianresearch.org/blog/?p=563
Since this is old, you may have to see how much of it still works.

Key excerpt from a recent org file which combined english and devanagari:

#+LATEX_HEADER: \usepackage{fontspec,xltxtra}
#+LATEX_HEADER: \usepackage{polyglossia}
#+LATEX_HEADER: \usepackage[Latin,Devanagari]{ucharclasses}
#+LATEX_HEADER: \setmainfont[Ligatures=TeX,Scale=1.0454]{Minion Pro}
#+LATEX_HEADER:
\newfontfamily{\defaultfont}[Ligatures=TeX,Scale=1.0454]{Minion Pro}
#+LATEX_HEADER: \newfontfamily{\devanagarifont}[Scale=0.9]{Lohit Devanagari}
#+LATEX_HEADER: \setdefaultlanguage{english}
#+LATEX_HEADER: \setotherlanguage{devanagari}
#+LATEX_HEADER: \setDefaultTransitions{\defaultfont}{}
#+LATEX_HEADER: \setTransitionTo{devanagari}{\devanagarifont}
#+LATEX_HEADER: \setTransitionFrom{devanagari}{\defaultfont}
#+LATEX_HEADER: \setTransitionsForLatin{\defaultfont}{}
#+LATEX_HEADER: \setTransitionTo{Devanagari}{\devanagarifont}
#+LATEX_HEADER: \setTransitionsForDevanagari{\devanagarifont}{}

Note that I used Minion Pro for English and Lohit Devanagari for Hindi. You
may have to check what fonts are installed on your system, and modify these
accordingly.

And I have this in my emacs config, which allows me to use arabic numbers
with devanagari script (since I don't want to use devanagari numbers even
when I am writing devanagari):

;; Function to mix Devanagari with Arabic numbers

(require 'ind-util)

;; based on:
;;
https://github.com/emacs-mirror/emacs/blob/30c09955f64815201ae9b86215fed8ea2af0ba66/lisp/language/ind-util.el#L464
(defun indian-make-hash-without-digits (table trans-table)
  "Indian Transliteration Hash for decode/encode"
  (let* ((encode-hash (make-hash-table :test 'equal))
 (decode-hash (make-hash-table :test 'equal))
 (hashtbls (cons encode-hash decode-hash))
 (vowels (elt table 0))
 (consonants (elt table 1))
 (misc   (elt table 2))
 (digits (elt table 3))
 (halant (char-to-string (elt misc  4)))
 (trans-vowels (elt trans-table 0))
 (trans-consonants (elt trans-table 1))
 (trans-misc   (elt trans-table 2))
 (trans-digits  '("0" "1" "2" "3" "4" "5" "6" "7" "8" "9")))
(indian--puthash-v vowels trans-vowels hashtbls)
(indian--puthash-c consonants trans-consonants halant hashtbls)
(indian--puthash-cv consonants trans-consonants
  vowels trans-vowels hashtbls)
(indian--puthash-m misc trans-misc hashtbls)
;;(indian--puthash-m digits trans-digits hashtbls)
hashtbls))


;; based on:
;;
https://github.com/emacs-mirror/emacs/blob/30c09955f64815201ae9b86215fed8ea2af0ba66/lisp/language/ind-util.el#L486
(setq indian-dev-itrans-v5-hash-without-digits
  (indian-make-hash-without-digits indian-dev-base-table
indian-itrans-v5-table))

;; needed for the quail-define-indian-trans-package function:
;;(add-to-list 'load-path "~/emacs/lisp/leim/")
(load "leim/quail/indian.elc")
;; (load "quail/indian.el.gz")


;; based on:
;;
https://github.com/emacs-mirror/emacs/blob/30c09955f64815201ae9b86215fed8ea2af0ba66/lisp/leim/quail/indian.el#L56
(quail-define-indian-trans-package
 indian-dev-itrans-v5-hash-without-digits
"devanagari-itrans-without-digits" "Devanagari" "DevIT"
 "Devanagari transliteration by ITRANS method, with Arabic numerals.")


Re: [MAINTENANCE] Org orphanage?

2023-01-07 Thread Bastien
Ihor Radchenko  writes:

>> Indeed, perhaps https://github.com/emacsorphanage is a good shelter
>> for Org orphan packages already.
>
> It is a good shelter, but I was hoping to promote Sourcehut and
> discourage people using Github to report issues in favour of Org mailing
> list.

I see, and I agree, especially if issues against Org orphan packages
are to be reported on the Org mailing list at some point.

Shall I create https://git.sr.ht/~bzg/org-orphan-packages ?

> Otherwise, I have no objections to Jonas Bernoulli doing the background
> maintenance. Less work for us at the end.

It's probably wiser to expect org-orphan-packages maintainers to come
from the Org community, rather than drawning Jonas Bernoulli into more
maintenance workload...

> One thing we may do though is letting him know about
> https://orgmode.org/worg/org-orphanage.html - he may contact us or use
> GitHub mentions, and he may let us know when a new Org-related package
> lands on his repo.

I updated https://orgmode.org/worg/org-orphanage.html with Org
packages from https://github.com/emacsorphanage - once you agree that
we create https://git.sr.ht/~bzg/org-orphan-packages, we can suggest
Jonas to move the Org abandoned repos from emacsorphanage to our repo,
and to add a note on emacsorphanage's README?

-- 
 Bastien



Re: LaTeX export for Org Mode Documents written in Indic Languages

2023-01-07 Thread tomas
On Sat, Jan 07, 2023 at 12:41:39PM +0530, Krishna Jani wrote:
> 
> Hello,
> 
> I have never had to write in languages other than English but an
> assignment just came up to transcribe the Indian Penal Code in
> simple and understandable Hindi. I have an Org file with some of my
> transcriptions (because of Emacs's awesome language support) but I am
> unable to org-export these files to pdf. I suppose I must install some
> latex packages, but I have not been able to find any documentation for
> the same. I dont really know latex, I mainly just use it for Org pdf
> export. 
> 
> Has anyone had a similar experience, or has a clue to this problem. Is
> there some documentation relating to languages that I can read

There are some approaches described here:

  
https://tex.stackexchange.com/questions/199773/how-to-type-hindi-words-in-latex

Since your input will be most probably already UTF-8 encoding, I
guess the most promising avenue these days is to go with LuaLaTeX.
It should work as a drop-in replacement for LaTeX "classic" and
should be included in your favourite TeX distribution.

I don't know off-the-bat what to do to make it work with Org
(I'm sure there are folks around here who do :), I'd first
export to LaTeX and fiddle with the preamble until I know what
to do.

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: How to make change the appearance of org-date inside a drawer?

2023-01-07 Thread Ihor Radchenko
William Denton  writes:

> describe-char there tells me the timestamp has the face org-date.  Is there a 
> way to make org-date smaller when it's in a drawer?  I don't want to make a 
> global setting for it, because I often use dates in headings.

Not yet.
For now, you can use `org-font-lock-set-keywords-hook' to add a custom
font-lock keyword that will check if point is in drawer and apply
alternative timestamp face.

See `font-lock-keywords' docstring. It is long and not very easy to
understand, but the options are flexible enough to achieve anything you
want.

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



Re: Export Org with Org concept -- Re: Problems with C-c C-e file.org,

2023-01-07 Thread Ihor Radchenko
Jean Louis  writes:

> * Ihor Radchenko  [2023-01-05 14:17]:
>> Could you please elaborate what is bad about the design and maybe
>> provide some ideas how it can be improved?
>
> ...
> The ideas have been sent as concept to you, then as full package,
> which I now use daily, so it is to derive the mode, define key
> bindings, decide how to display toggling of variables for body, scope,
> async, etc. and generate hyperlinks for export.

I though that you objected the design of `org-export-define-backend' and
the backend objects. Menus have little to do with it, merely following
the key bindings suggested by export backend authors.

If you just object the export menu system, let's go back to the main
discussion about non-blocking menus in other branches of this thread.

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



Re: Export Org with Org concept -- Re: Problems with C-c C-e file.org,

2023-01-07 Thread Ihor Radchenko
Jean Louis  writes:

>> I was hoping that you might be interested to provide a patch for Org
>> upstream.
>
> Question is: did you try it out?
>
> Once you try it out, then let me know to continue.

I did try it. I am in favour of the non-blocking menu. Other people
participating in this discussion too.

As I said, the requirement to get it into the core is re-creating
previous layout and bindings. The layout and bindings may be
customizable, but they must be available.

> The Concept and More Ideas:
> ---
>
> 1. You can create derived mode, for example Org derived mode.

This has pros and cons. Org derived mode means that personal
customization, including key bindings and themes, may affect menus. This
may or may not be desired.

> 2. You can create key bindings freely for that derived mode.

+1

> 3. You can create read-only, temporary buffers for export in that
>derived mode.

I am not sure what you are referring to.

> 4. Because it is read only, similar to modal modes, you do not need
>complicated key bindings, you don't need to use C-combinations for
>few simple things, use simply letter. 

Same as what we do now in the menus. I do not think that we need to
change the existing bindings (by default).

> 5. Though it implies you can use same key bindings for
>"compatibility", but I would say it rather honestly for bad habits,
>as in the derived.

As I said earlier, "bad habits" is a judgment. We will not break user
experience if we don't have to. It includes existing bindings.

Introducing alternatives is possible though.

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