Re: Support for tagging (special) blocks

2022-08-31 Thread Payas Relekar
Kaushal Modi  writes:

Tags are bit more generic though, and allow searching across not just
code blocks, but TODOs as well.

Thanks,
Payas

> On Wed, Aug 31, 2022 at 4:19 PM Sébastien Miquel 
> wrote:
>
>> Hi,
>>
>> I've been using tags on special blocks, src blocks and other, for two
>> purposes:
>>
>>   1. to control which blocks get exported, using the `#+exclude_tags`
>>  property.
>>   2. to fine tune the export, according to tags, of special blocks such as
>>  #+BEGIN_exercice:hard:
>>  …
>>  #+END_exercice
>>
>> Does anyone think this is useful and might warrant adding support for ?
>>
>
> I think that using the #+header: property for something like this might be
> more canonical.
> https://orgmode.org/manual/Using-Header-Arguments.html
>
> Example:
>
> =
>
> #+header: :tags noexport
> #+begin_foo
>
> ..
> #+end_foo
> =
>
> or
>
> =
>
> #+header: :tags hard
> #+begin_foo
>
> ..
> #+end_foo
> =
>
> It's also relatively easy to parse these headers:
>
> =
> (org-babel-parse-header-arguments (car (org-element-property :header
> special-block)))
> =
>

--



Re: Manual Ordering and Dynamic Priority

2022-08-31 Thread Tim Cross


Eduardo Suarez  writes:

> I have lots of tasks (todos) and I would like to create a long backlog based 
> on
> my perceived priority.
>
> I was thinking to deal with them in the following way:
>
> - divide them in groups (categories or similar),
> - manually sort priority for every group,
> - mergesort groups, that is, start merging groups in pairs, and manually sort
>   for every step the union group until I have a large sorted backlog.
>
> For this to be practical, I would need an easy way to sort manually a group of
> tasks and get them assigned automatically a priority (or any other hack) so
> that priority ordering matches manual ordering.
>
> Any idea about how to get this done?
>
> If I had to implement it (I don't know lisp), I would assign a property (say
> BACKLOG_PRIORITY) for every new task, with value the higher value of any other
> tasks in agenda plus ten (for instance). Then I would query a subset of tasks
> and sort them manually, swapping their values every time I swap their order. I
> would also allow to assign a value directly based on free slots, not to bubble
> the whole list for a low priority task.
>
> Does it sound over-engineered? Any idea?

It does sound a bit like over-engineering to me :-)

My first question would be "How long have you been using org-mode to
manage your tasks?"

My observation from being a long-term org-mode user (and speaking from
personal experience), is that the first big mistake people tend to make
is to over engineer their setup. I suspect many people, after first
using org-mode, they get somewhat carried away with the
possibilities. They immediately get caught up in this dream of having an
organised world where all their tasks are captured, neat, organised,
prioritised and chaos is under control.

They start by defining a precise and well laid out plan for capturing
tasks and managing them. Tasks are given priorities, effort estimates,
there are capture templates for everything you can possibly think of and
no matter what they are doing, they can open their agenda and
immediately see what to do next, little thought or effort required.

This approach suffers from two fundamental flaws

- Life is by nature chaotic. You cannot eliminate the chaos. The best
  you can do is find ways to make dealing with the chaos less painful.

- Life is about getting things done, not planning to get things
  done. Overly complex management of your tasks is very likely to result
  in more time spent managing the tasks than actually doing the tasks.

My first recommendation for most people is use org with default settings
for the first few months. The defaults are not a bad starting point and
after a few months, you will know what the pain points are for your
specific situation and can then start looking at how to address them.

Be very careful about priorities. The problem is, priorities actually
change faster than you might expect. I actually rarely use priorities as
I find most of the time, they are not adding real benefit. I know what
the priorities are. Only in extremely large or complex projects,
particularly ones with complex dependencies, have I found priorities
useful.

The other point to note is that because you now have an efficient and
quick way to gather task information, you will likely end up with a
growing list of tasks in your backlog. The reality is, a far larger
number of these tasks will never see the light of day than you may
think. I find that very 6 months or so, I go through my backlog of tasks
and move any which have not seen any progress for 12 months into a
backlog archive. These tend to be ideas or tasks which in all honestly
are never going to bubble up to the point of being acted on. This could
be because priorities or requirements have changed, the ideas underlying
the tasks needs more thought or is just a bad idea, the need for the
task no longer relevant etc. Any time spent on prioritising, classifying
or ordering these tasks is largely wasted effort. 

The other problem with priorities are they tend to only represent the
urgency of a task and not the importance of that task. The danger is, if
you only focus on urgency, you become reactive and less proactive. All
your time is spent responding to urgency with little time allocated to
implementing less urgent but important tasks which ironically, will
often result in improvements and less urgent tasks. This can be avoided
if you are disciplined and ensure you also give high priority to
non-urgent, but important tasks. However, this can be hard to do,
especially in a busy environment with lots of conflicting tasks.

Tags can be a very useful mechanism for classifying tasks. However, the
mistake people often make with tags is to create far too many different
tags. You need to be disciplined with tags and keep them to a
minimum. If you have too many, you will spend too much time trying to
decide which tag to apply, will get inconsistency in your tagging and
when it comes time to use the tags, 

Re: Support for tagging (special) blocks

2022-08-31 Thread Kaushal Modi
On Wed, Aug 31, 2022 at 4:19 PM Sébastien Miquel 
wrote:

> Hi,
>
> I've been using tags on special blocks, src blocks and other, for two
> purposes:
>
>   1. to control which blocks get exported, using the `#+exclude_tags`
>  property.
>   2. to fine tune the export, according to tags, of special blocks such as
>  #+BEGIN_exercice:hard:
>  …
>  #+END_exercice
>
> Does anyone think this is useful and might warrant adding support for ?
>

I think that using the #+header: property for something like this might be
more canonical.
https://orgmode.org/manual/Using-Header-Arguments.html

Example:

=
#+header: :tags noexport
#+begin_foo
..
#+end_foo
=

or

=
#+header: :tags hard
#+begin_foo
..
#+end_foo
=

It's also relatively easy to parse these headers:

=
(org-babel-parse-header-arguments (car (org-element-property :header
special-block)))
=


Support for tagging (special) blocks

2022-08-31 Thread Sébastien Miquel

Hi,

I've been using tags on special blocks, src blocks and other, for two
purposes:

 1. to control which blocks get exported, using the `#+exclude_tags`
property.
 2. to fine tune the export, according to tags, of special blocks such as
#+BEGIN_exercice:hard:
…
#+END_exercice

Does anyone think this is useful and might warrant adding support for ?

--
Sébastien Miquel



Re: Babel C-mode corrupts double-quoted strings in output

2022-08-31 Thread Immanuel Litzroth
I would advise you not to use org babel for compiled languages. There
is just too
much stuff that doesn't work well and multifile dependencies & build
systems are
just plain hard to get right. Debugging is annoying and getting org
babel to tell
you compiler where the source actually came from is impossible, if the language
even supports #line and #file directives (Rust still doesn't).
Immanuel Litzroth

On Wed, Aug 31, 2022 at 6:38 PM Martin Jerabek  wrote:
>
> Hi!
>
> I recently started to use Org Babel for C++ programs. One of the programs 
> outputs several lines with double-quoted strings, similar to this:
>
> #+NAME: doublequotes_cpp
> #+begin_src cpp :includes  :results output verbatim raw
> std::cout << "\"line 1\"\n";
> std::cout << "\"line 2\"\n";
> std::cout << "\"line 3\"\n";
> #+end_src
>
> #+RESULTS: doublequotes_cpp
> line 1
>
> As you can see, only the first line is copied to the RESULTS block, and it is 
> stripped of the double quotes.
>
> I tracked down the problem to org-babel-read (in ob-core.el). 
> org-babel-C-execute (in ob-C.el) calls this function with the output of the 
> C++ program. The problem is the following line:
>
> ((eq (string-to-char cell) ?\") (read cell))
>
> i.e. if the output of the program starts with a double quote, it is passed to 
> read which reads only the first string and also removes the double quotes, 
> resulting in the observed output.
>
> The original version of this piece of code was added with the following 
> commit:
>
> commit 60a8ba556d682849eafb0f84e689967cd2965549
> Author: Eric Schulte 
> Date:   Wed Mar 2 07:55:39 2011 -0700
>
> ob: read string variable values wrapped in double quotes, removing the 
> quotes
>
> * lisp/ob.el (org-babel-read): Read string variable values wrapped in
>   double quotes, removing the quotes.
>
> AFAICT this modification was done in response to the email thread "[Orgmode] 
> org-babel-read should have option NOT to interpret as elisp" started on 
> 2011-02-27, more specifically the email on "Wed, 02 Mar 2011 07:56:45 -0700" 
> from Eric Schulte. This was obviously done for parsing variables in the 
> header line, not for the program output, but the Babel C mode uses 
> org-babel-read also for the output.
>
> I assumed that ":results output verbatim raw" would prevent any 
> postprocessing of the output but this is not the case for C mode.
>
> I am not sure how to fix this without breaking backward compatibility. I 
> assume it should be fixed directly in org-babel-C-execute, not in a central 
> function like org-babel-read to minimize the impact. Surprisingly (for me) 
> the equivalent shell script works as expected:
>
> #+NAME: doublequotes
> #+begin_src shell :results output verbatim raw
> echo '"line 1"'
> echo '"line 2"'
> echo '"line 3"'
> #+end_src
>
> #+RESULTS: doublequotes
> "line 1"
> "line 2"
> "line 3"
>
> because org-babel-execute:shell does not process the output with 
> org-babel-read. I do not know if languages other than the C family (C, C++, 
> D) are affected.
>
> At the very least, the documentation of org-babel-read should be expanded to 
> document the fact that if the CELL parameter starts with a double quote, it 
> is processed by the read function.
>
> Best regards
> Martin Jerabek
>


-- 
-- A man must either resolve to point out nothing new or to become a
slave to defend it. -- Sir Isaac Newton



Babel C-mode corrupts double-quoted strings in output

2022-08-31 Thread Martin Jerabek
Hi!

I recently started to use Org Babel for C++ programs. One of the programs 
outputs several lines with double-quoted strings, similar to this:

#+NAME: doublequotes_cpp
#+begin_src cpp :includes  :results output verbatim raw
std::cout << "\"line 1\"\n";
std::cout << "\"line 2\"\n";
std::cout << "\"line 3\"\n";
#+end_src

#+RESULTS: doublequotes_cpp
line 1

As you can see, only the first line is copied to the RESULTS block, and it is 
stripped of the double quotes.

I tracked down the problem to org-babel-read (in ob-core.el). 
org-babel-C-execute (in ob-C.el) calls this function with the output of the C++ 
program. The problem is the following line:

((eq (string-to-char cell) ?\") (read cell))

i.e. if the output of the program starts with a double quote, it is passed to 
read which reads only the first string and also removes the double quotes, 
resulting in the observed output.

The original version of this piece of code was added with the following commit:

commit 60a8ba556d682849eafb0f84e689967cd2965549
Author: Eric Schulte 
Date:   Wed Mar 2 07:55:39 2011 -0700

ob: read string variable values wrapped in double quotes, removing the 
quotes

* lisp/ob.el (org-babel-read): Read string variable values wrapped in
  double quotes, removing the quotes.

AFAICT this modification was done in response to the email thread "[Orgmode] 
org-babel-read should have option NOT to interpret as elisp" started on 
2011-02-27, more specifically the email on "Wed, 02 Mar 2011 07:56:45 -0700" 
from Eric Schulte. This was obviously done for parsing variables in the header 
line, not for the program output, but the Babel C mode uses org-babel-read also 
for the output.

I assumed that ":results output verbatim raw" would prevent any postprocessing 
of the output but this is not the case for C mode.

I am not sure how to fix this without breaking backward compatibility. I assume 
it should be fixed directly in org-babel-C-execute, not in a central function 
like org-babel-read to minimize the impact. Surprisingly (for me) the 
equivalent shell script works as expected:

#+NAME: doublequotes
#+begin_src shell :results output verbatim raw
echo '"line 1"'
echo '"line 2"'
echo '"line 3"'
#+end_src

#+RESULTS: doublequotes
"line 1"
"line 2"
"line 3"

because org-babel-execute:shell does not process the output with 
org-babel-read. I do not know if languages other than the C family (C, C++, D) 
are affected.

At the very least, the documentation of org-babel-read should be expanded to 
document the fact that if the CELL parameter starts with a double quote, it is 
processed by the read function.

Best regards
Martin Jerabek



Re: Manual Ordering and Dynamic Priority

2022-08-31 Thread indieterminacy

Hello Eduardo,

On 31-08-2022 18:13, Eduardo Suarez wrote:
I have lots of tasks (todos) and I would like to create a long backlog 
based on

my perceived priority.

I was thinking to deal with them in the following way:

- divide them in groups (categories or similar),
- manually sort priority for every group,
- mergesort groups, that is, start merging groups in pairs, and 
manually sort

  for every step the union group until I have a large sorted backlog.

For this to be practical, I would need an easy way to sort manually a 
group of
tasks and get them assigned automatically a priority (or any other 
hack) so

that priority ordering matches manual ordering.

Any idea about how to get this done?



While these are non orgmode solutions inside Emacs I hope they can give 
you some ideas of what you want:


https://github.com/sp1ff/elfeed-score
https://www.unwoundstack.com/blog/scoring-elfeed-entries.html

https://www.gnu.org/software/emacs/manual/html_node/gnus/Scoring.html


If I had to implement it (I don't know lisp), I would assign a property 
(say
BACKLOG_PRIORITY) for every new task, with value the higher value of 
any other
tasks in agenda plus ten (for instance). Then I would query a subset of 
tasks
and sort them manually, swapping their values every time I swap their 
order. I
would also allow to assign a value directly based on free slots, not to 
bubble

the whole list for a low priority task.

Does it sound over-engineered? Any idea?


HTH

--
Jonathan McHugh
indieterminacy@libre.brussels



Manual Ordering and Dynamic Priority

2022-08-31 Thread Eduardo Suarez
I have lots of tasks (todos) and I would like to create a long backlog based on
my perceived priority.

I was thinking to deal with them in the following way:

- divide them in groups (categories or similar),
- manually sort priority for every group,
- mergesort groups, that is, start merging groups in pairs, and manually sort
  for every step the union group until I have a large sorted backlog.

For this to be practical, I would need an easy way to sort manually a group of
tasks and get them assigned automatically a priority (or any other hack) so
that priority ordering matches manual ordering.

Any idea about how to get this done?

If I had to implement it (I don't know lisp), I would assign a property (say
BACKLOG_PRIORITY) for every new task, with value the higher value of any other
tasks in agenda plus ten (for instance). Then I would query a subset of tasks
and sort them manually, swapping their values every time I swap their order. I
would also allow to assign a value directly based on free slots, not to bubble
the whole list for a low priority task.

Does it sound over-engineered? Any idea?




org-time-stamp-custom-formats with out the name of the day of the week

2022-08-31 Thread Uwe Brauer


Hi 

I have set
  (setq org-time-stamp-custom-formats '(" %d.%m.%Y " . " %d.%m.%Y"))

Now a time-stamp gets displayed (german convention) 


<31.08.2022>  

However when I run 

 org-toggle-time-stamp-overlays


I see <2022-08-21 Mi>

Which is well expected. So I am wondering, is there a way truly to have 

<31.08.2022>   interpreted as a org time-stamp?

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. 




[BUG] visibility cycling does not work because org-element--cache-active-p defined later than it is used in org-element.el

2022-08-31 Thread Esa Palosaari
The expectation is that using TAB cycles subtree visibility. What in
fact happens is nothing but a "function definition is void:
org-element--cache-active-p" error is shown in the minibuffer.

The bug is a "function definition void" error when using tabulator
for subtree cycling on macOS using ARM [9.5.4 (9.5.4-g202744 @
/Users/esapalosaari/.emacs.d/straight/build/org/)]. The fix is to move
the function definition (defun org-element--cache-active-p) e.g. to line
4128 in org-element.el before it is used by other parts of the code.

Emacs  : GNU Emacs 28.1 (build 1, aarch64-apple-darwin21.1.0, NS
appkit-2113.00 Version 12.0.1 (Build 21A559))
 of 2022-05-11
Package: Org mode version 9.5.4 (9.5.4-g202744 @
/Users/esapalosaari/.emacs.d/straight/build/org/)

current state:
==
(setq
 org-agenda-prefix-format '((dashboard-agenda . " %i %-12:c %s ")
   (agenda . " %i %-12:c%?-12t% s")
   (todo . " %i %-12:c") (tags . " %i %-12:c")
   (search . " %i %-12:c"))
 org-ref-bibtex-pdf-download-dir nil
 org-link-elisp-confirm-function 'yes-or-no-p
 org-cite-insert-processor 'org-ref-cite
 org-ref-cite-onclick-function '(lambda (_) (org-ref-citation-hydra/body))
 org-bibtex-headline-format-function #[257 "\300 \236A\207" [:title] 3
"\n\n(fn ENTRY)"]
 org-ref-insert-cite-function 'org-ref-cite-insert-ivy
 org-capture-templates '(("t" "Tehtävä" entry
 (file+headline "~/Dropbox/org-mode/notes.org"
  "Saapuneet")
 "* TODO %?\n  %i\nOtettu paikassa  %a")
("p" "Päiväkirja" entry
 (file+datetree "~/Dropbox/org-mode/päiväkirja.org
")
 "* %?Tallennettu %U\n  %i\n  %a")
("l" "Muistiinpanoluonnos" entry
 (file "~/SDrive/inbox/luonnoksia.org")
 "* %? \nOtettu paikassa %a")
)
 org-export-latex-format-toc-function 'org-export-latex-no-toc
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-ctrl-c-ctrl-c-hook '(org-ref-cite-Cc-Cc)
 org-refile-targets '((nil :maxlevel . 5) (org-agenda-files :maxlevel . 5)
 ("~/Dropbox/org-mode/päiväkirja.org "
:maxlevel . 8))
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-cycle-tab-first-hook '(org-babel-hide-result-toggle-maybe
   org-babel-header-arg-expand)
 org-roam-find-file-hook '(org-roam-buffer--setup-redisplay-h
  org-roam--register-completion-functions-h
  org-roam--replace-roam-links-on-save-h
  org-roam-db-autosync--setup-update-on-save-h)
 org-ref-bibtex-assoc-pdf-with-entry-move-function 'rename-file
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-cite-follow-processor 'org-ref-cite
 org-odt-format-inlinetask-function
'org-odt-format-inlinetask-default-function
 org-ascii-format-drawer-function #[771 " \207" [] 4 "\n\n(fn NAME CONTENTS
WIDTH)"]
 org-cycle-hook '(org-cycle-hide-archived-subtrees
org-cycle-show-empty-lines
 org-cycle-optimize-window-after-visibility-change)
 org-noter-auto-save-last-location t
 org-persist-before-read-hook '(org-element--cache-persist-before-read)
 org-mode-hook '(#[0 "\301\211 \207"
  [imenu-create-index-function org-imenu-get-tree] 2]
org-ref-org-menu
#[0 "\300\301\302\303\304$\207"
  [add-hook change-major-mode-hook org-fold-show-all append
   local]
  5]
#[0 "\300\301\302\303\304$\207"
  [add-hook change-major-mode-hook org-babel-show-result-all
   append local]
  5]
org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-babel-load-languages '((R . t) (python . t) (shell . t))
 org-ref-insert-link-function 'org-ref-insert-link-hydra/body
 org-cite-csl-styles-dir "~/Zotero/styles"
 org-roam-ref-annotation-function 'org-roam-ref-read--annotation
 org-roam-directory "~/SDrive/arkisto/laput/"
 org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
 org-roam-db-node-include-function #[0 "\300\207" [t] 1]
 org-latex-format-headline-function
'org-latex-format-headline-default-function
 org-confirm-shell-link-function 'yes-or-no-p
 org-ref-cite-style-annotation-function 'org-ref-cite-annotate-style
 org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-latex-classes '(("apa7" "\\documentclass{apa7}"
 ("\\section{%s}" . "\\section*{%s}")
 ("\\subsection{%s}" . "\\subsection*{%s}")
 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
 ("\\paragraph{%s}" . "\\paragraph*{%s}")
 ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
("article" "\\documentclass[11pt]{article}"
 ("\\section{%s}" . "\\section*{%s}")
 ("\\subsection{%s}" . "\\subsection*{%s}")
 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
 ("\\paragraph{%s}" . "\\paragraph*{%s}")
 ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
("report" "\\documentclass[11pt]{report}"
 ("\\part{%s}" . "\\part*{%s}")
 ("\\chapter{%s}" . "\\chapter*{%s}")
 ("\\section{%s}" . "\\section*{%s}")
 ("\\subsection{%s}" . "\\subsection*{%s}")
 ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
("book" 

Re: Improve the docstring for 'org-html-mathjax-options'

2022-08-31 Thread Rudolf Adamkovič
Ihor Radchenko  writes:

> Rudolf, since you are probably more familiar with MathJax, may you
> please take a look at the report below and tell us if the suggestions
> are sensible?

Sure, see below.

> I tried setting 'autonumber' to "None", as the docstring suggests, but
> only the lower-cased "none" worked fine.

Oops!  I screwed this up (via 15068ce30).  I wanted to lowercase "None"
but instead I capitalized "All".  Please see the attached patch 0001.

> Also, MathJax documentation for 2.7 (the version I've got HTML
> rendered with by org-mode) mentions "AMS", not "AMS Math"
> (http://docs.mathjax.org/en/v2.7-latest/tex.html).

We have this fixed on main (via 15068ce30).

> Another option that needs attention is 'indent'. The docstring
> contains the phrase 'Valid values are "left" and "right"'.

We have this fixed on main (via 15068ce30).

> This phrase should be changed to something like 'An example of a valid
> value is "2em"' or simply removed, I think.

Good idea!  Please see the attached patch 0002.

Rudy

>From c9b82b85515c7a7f334976aa90bd59bac8932461 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= 
Date: Wed, 31 Aug 2022 16:03:38 +0200
Subject: [PATCH 1/2] Fix incorrectly documented auto-numbering of MathJax
 equations

* lisp/org/ox-html.el (org-html-mathjax-options): Fix incorrect
choices for the 'autonumber' MathJax option in the docstring.
---
 lisp/ox-html.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 9e8740754..65b550603 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -1186,8 +1186,8 @@ linebreaksLet MathJax perform automatic linebreaks.  Valid values
   are \"true\" and \"false\".
 indentIf align is not center, how far from the left/right side?
 multlinewidth The width of the multline environment.
-autonumberHow to number equations.  Valid values are \"None\",
-  \"All\" and \"AMS\".
+autonumberHow to number equations.  Valid values are \"none\",
+  \"all\" and \"AMS\".
 tagindent The amount tags are indented.
 tagside   Which side to show tags/labels on.  Valid values are
   \"left\" and \"right\"
-- 
2.37.2

>From 003013f8e79ccc4570df5f7df89ccc3dfcb35e06 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= 
Date: Wed, 31 Aug 2022 16:05:04 +0200
Subject: [PATCH 2/2] Fix under-documented MathJax indentation option

* lisp/org/ox-html.el (org-html-mathjax-options): Add an example of a
valid value for the 'indent' MathJax option the docstring.
---
 lisp/ox-html.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 65b550603..68b35492d 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -1184,7 +1184,8 @@ font  The font to use with HTML-CSS and SVG output.  As of MathJax 2.5
   \"Gyre-Termes\", and \"Latin-Modern\".
 linebreaksLet MathJax perform automatic linebreaks.  Valid values
   are \"true\" and \"false\".
-indentIf align is not center, how far from the left/right side?
+indentIf align is not center, how far from the left/right side?  For
+  example, \"1em\".
 multlinewidth The width of the multline environment.
 autonumberHow to number equations.  Valid values are \"none\",
   \"all\" and \"AMS\".
-- 
2.37.2

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

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


Re: Suspected bug: example block in a footnote doesn't fold if starts with 2 blank lines

2022-08-31 Thread Alain . Cochard
Ihor Radchenko writes on Wed 31 Aug 2022 09:57:

 > This is not a bug. Just unintuitive syntax:
 > [...]
 > The important part is: It ends at the next footnote definition,
 > headline, or after two consecutive empty lines.
 > 
 > So, your example is
 > 
 > foo[fn:1]
 > 
 > [fn:1] bar
 > #+begin_example ;; <- this is not considered an example block because no
 > major org elements can be inside a footnote definition.
 > 
 > 
 > 
 > x
 > #+end_example
 > 

Thanks a lot for answering.

Is there an official definition for "major org element" ? (I could not
find anything relevant in the manual.)

I guess a headline would qualify (and it would not have occurred to me
to use a headline within a footnote; the manual is clear in that
respect anyway).

But then a list item would probably qualify as well?  But, as far as I
can see, lists and footnotes work perfectly well together... (because
2 consecutive empty lines also mark the end of a list item?)

Furthermore, as long as there is not more than one empty line in a
row, blocks also appear to me to work just fine within footnotes,
including upon latex export, and I use things like the following all
the time:

   #+LATEX_HEADER: \usepackage{fancyvrb}
   #+LATEX_HEADER: \VerbatimFootnotes
   foot[fn:1]

   [fn:1] note 
   #+begin_src fortran
 print*,"foo"
   #+end_src

I simply never had to use 2 consecutive empty lines in blocks up to
now...

So I guess I'll turn my "suspected bug" into a feature request: that
#+BEGIN ... #+END blocks behave the same way whether they are within a
footnote or not.

Regards

-- 
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 ]




Re: [PATCH] ox-icalendar.el: customizable vevent summary prefix

2022-08-31 Thread Ihor Radchenko
Mikhail Skorzhisnkii  writes:

> I have signed FSF papers. Attaching a rebased patch with additional changes to
> ORG-NEWS

Bastien, could you kindly check the FSF records?

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



Re: [PATCH] ox-icalendar.el: customizable vevent summary prefix

2022-08-31 Thread Ihor Radchenko
Mikhail Skorzhisnkii  writes:

> Subject: [PATCH 1/2] org-agenda.el: customize outline path in echo area

I do not see the second patch. Did you forget to attach it?

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



Re: [PATCH] ox-icalendar.el: customizable vevent summary prefix

2022-08-31 Thread Ihor Radchenko
Mikhail Skorzhisnkii  writes:

> I have signed FSF papers. Attaching a rebased patch with additional changes to
> ORG-NEWS

Thanks!

> Subject: [PATCH 1/2] org-agenda.el: customize outline path in echo area
>
> * lisp/org-agenda.el (org-agenda-show-outline-path): add an option to
> show document title in outline path (instead of file name)

Please follow the commit message conventions as described in
https://orgmode.org/worg/org-contribute.html#commit-messages In
particular, start sentences from capital letters, end them with ".",
separate sentences with double space, and quote lisp symbols as
`symbol'.

> * lisp/org.el (org-get-title-from-buffer): a function to collect the
 New
> document title from the org-mode buffer
 .


> * lisp/org.el (org-display-outline-path): add logic that will collect a
> document title and put it into the outline path if
> org-agenda-show-outline-path set to 'title

This is not what the patch does.  From this message, it looks like
`org-agenda-show-outline-path' is affecting the output of
`org-display-outline-path', which is not true.

>  (defcustom org-agenda-show-outline-path t
> -  "Non-nil means show outline path in echo area after line motion."
> +  "Non-nil means show outline path in echo area after line motion.
> +
> +If set to 'title, show document title."

This is not very clear. I'd rather put more detailed explanation as in
the defcustom :type spec below.

>:group 'org-agenda-startup
> -  :type 'boolean)
> +  :type '(choice
> +   (const :tag "Don't show outline path in agenda view." nil)
> +   (const :tag "Show outline path with prepended file name." t)
> +   (const :tag "Show outline path with prepended document title. 
> Fallback to file name is no title is present." title)))
> -(defun org-display-outline-path ( file current separator 
> just-return-string)
> +(defun org-get-title-from-buffer ( buffer)
> +  "Collect title from the provided `org-mode' BUFFER."
> +  (let* ((buffer (or buffer (current-buffer)))
> + (buffer (or (buffer-base-buffer buffer)
> + buffer))

Why not just

(or (buffer-base-buffer buffer)
buffer
(current-buffer))

> + title)
> +(with-current-buffer buffer
> +  (pcase (org-collect-keywords '("TITLE"))
> +(`(("TITLE" . ,val))
> + (setq title (car val)
> +title))

Extra `title' variable is unnecessary here. You can simply do 

(with-current-buffer buffer
  (pcase (org-collect-keywords '("TITLE"))
(`(("TITLE" ,val . _))
 val)))

Also, what will happen in a file like

#+TITLE: Begin title
#+TITLE: .. end title

?

> +(defun org-display-outline-path ( file-or-title current separator 
> just-return-string)
>"Display the current outline path in the echo area.
>  
> -If FILE is non-nil, prepend the output with the file name.
> +If FILE-OR-TITLE is 'title, prepend outline with file title.  If
> +it is non-nil or title is not present in document, prepend
> +outline path with the file name.
>  If CURRENT is non-nil, append the current heading to the output.
>  SEPARATOR is passed through to `org-format-outline-path'.  It separates
>  the different parts of the path and defaults to \"/\".
> @@ -7407,6 +7421,8 @@ If JUST-RETURN-STRING is non-nil, return a string, 
> don't display a message."
>(interactive "P")
>(let* (case-fold-search
>(bfn (buffer-file-name (buffer-base-buffer)))
> + (title-prop (when (and file-or-title (eq file-or-title 'title))

can be simply (eq file-or-title 'title)

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



Re: Have all the tags of a heading, with a tag hierarchy

2022-08-31 Thread Cletip Cletip
Just one last clarification to be sure: there is no native function in
org-mode to have the list of tags with a hierarchy? I have to write my
function with the two functions
org-get-tags and org-tags-expand
to get the result I want : a list of tags that takes into account the
hierarchy defined by the "org-tag-alist" variable

Le mer. 31 août 2022 à 13:25, Cletip Cletip  a
écrit :

> Sorry, I found the solution : i must just give one argument non-nil to the
> function "org-tags-expand".
> Like this :
> (org-tags-expand "GTD" t)
>
> It's perfect, thanks a lot for your help !
>
> Le mer. 31 août 2022 à 11:01, Cletip Cletip  a
> écrit :
>
>> Thank you for your answer, and sorry for the late reply
>>
>> Ok I think I understood the mechanism, but I don't understand how to use
>> this regular expression (the one given by, for example,
>> (org-tags-expand "GTD")
>> which gives me the regular expression "with the other tags"
>> )
>>
>> I see perfectly the idea : a search is done with org-agenda with this
>> regular expression. But I can't use it.
>>
>> The problem is that I don't know how to use this regular expression with
>> a function that returns the tags. Do you have any clue (piece of code where
>> it is already used ? A function allowing me to translate this regular
>> expression into a simple tag? Do I just have to convert this regular
>> expression into a list of tags? Is it possible? I'm asking myself all these
>> questions because I just don't know where to go ^^)
>>
>> Thanks in advance for your future answer.
>>
>>
>> Le lun. 29 août 2022 à 13:57, Ihor Radchenko  a
>> écrit :
>>
>>> Cletip Cletip  writes:
>>>
>>> > Yes I understand both perfectly. I think some people (like me) would
>>> like
>>> > to connect them, others would not want to bring them together.
>>> > But how to get the hierarchy (or the families) used by org agenda with
>>> a
>>> > function like "org-get-tags" ?
>>>
>>> You will probably need to combine org-get-tags output with regexp
>>> generated by org-tags-expand. Tag hierarchy in Org is a just a search
>>> wrapper - no real tags are changed in the file; only the matching.
>>>
>>> --
>>> Ihor Radchenko,
>>> Org mode contributor,
>>> Learn more about Org mode at https://orgmode.org/.
>>> Support Org development at https://liberapay.com/org-mode,
>>> or support my work at https://liberapay.com/yantar92
>>>
>>


Re: Have all the tags of a heading, with a tag hierarchy

2022-08-31 Thread Cletip Cletip
Sorry, I found the solution : i must just give one argument non-nil to the
function "org-tags-expand".
Like this :
(org-tags-expand "GTD" t)

It's perfect, thanks a lot for your help !

Le mer. 31 août 2022 à 11:01, Cletip Cletip  a
écrit :

> Thank you for your answer, and sorry for the late reply
>
> Ok I think I understood the mechanism, but I don't understand how to use
> this regular expression (the one given by, for example,
> (org-tags-expand "GTD")
> which gives me the regular expression "with the other tags"
> )
>
> I see perfectly the idea : a search is done with org-agenda with this
> regular expression. But I can't use it.
>
> The problem is that I don't know how to use this regular expression with a
> function that returns the tags. Do you have any clue (piece of code where
> it is already used ? A function allowing me to translate this regular
> expression into a simple tag? Do I just have to convert this regular
> expression into a list of tags? Is it possible? I'm asking myself all these
> questions because I just don't know where to go ^^)
>
> Thanks in advance for your future answer.
>
>
> Le lun. 29 août 2022 à 13:57, Ihor Radchenko  a
> écrit :
>
>> Cletip Cletip  writes:
>>
>> > Yes I understand both perfectly. I think some people (like me) would
>> like
>> > to connect them, others would not want to bring them together.
>> > But how to get the hierarchy (or the families) used by org agenda with a
>> > function like "org-get-tags" ?
>>
>> You will probably need to combine org-get-tags output with regexp
>> generated by org-tags-expand. Tag hierarchy in Org is a just a search
>> wrapper - no real tags are changed in the file; only the matching.
>>
>> --
>> Ihor Radchenko,
>> Org mode contributor,
>> Learn more about Org mode at https://orgmode.org/.
>> Support Org development at https://liberapay.com/org-mode,
>> or support my work at https://liberapay.com/yantar92
>>
>


Re: Have all the tags of a heading, with a tag hierarchy

2022-08-31 Thread Cletip Cletip
Thank you for your answer, and sorry for the late reply

Ok I think I understood the mechanism, but I don't understand how to use
this regular expression (the one given by, for example,
(org-tags-expand "GTD")
which gives me the regular expression "with the other tags"
)

I see perfectly the idea : a search is done with org-agenda with this
regular expression. But I can't use it.

The problem is that I don't know how to use this regular expression with a
function that returns the tags. Do you have any clue (piece of code where
it is already used ? A function allowing me to translate this regular
expression into a simple tag? Do I just have to convert this regular
expression into a list of tags? Is it possible? I'm asking myself all these
questions because I just don't know where to go ^^)

Thanks in advance for your future answer.


Le lun. 29 août 2022 à 13:57, Ihor Radchenko  a écrit :

> Cletip Cletip  writes:
>
> > Yes I understand both perfectly. I think some people (like me) would like
> > to connect them, others would not want to bring them together.
> > But how to get the hierarchy (or the families) used by org agenda with a
> > function like "org-get-tags" ?
>
> You will probably need to combine org-get-tags output with regexp
> generated by org-tags-expand. Tag hierarchy in Org is a just a search
> wrapper - no real tags are changed in the file; only the matching.
>
> --
> Ihor Radchenko,
> Org mode contributor,
> Learn more about Org mode at https://orgmode.org/.
> Support Org development at https://liberapay.com/org-mode,
> or support my work at https://liberapay.com/yantar92
>