Re: font lock (locally, per file) ignore subscripts

2022-06-17 Thread Ihor Radchenko
Uwe Brauer  writes:

> I'd like that, in certain files, subscripts are ignored.
>
> I know I could use ~ ~ as in 
>  ~dl_emacs_support.m~ 
>
> Or 
>
> =dl_emacs_support.m=
>
> But could I deactivate font locking for these constructions locally?

You can set org-use-sub-superscripts locally in the buffer.

Best,
Ihor



Re: [PATCH] org.el (org-format-latex-header): put DEFAULT-PACKAGES before PACKAGES

2022-06-17 Thread Ihor Radchenko
Sébastien Miquel  writes:

> Ihor Radchenko writes:
>> Thanks for the clarification! Now, your patch makes much more sense. Can
>> you update the commit message explaining the above shortly and linking
>> to this thread?
>
> See attached.

Thanks!
Applied onto main via 9fb9a2bdf with amendments to the commit message.
I have capitalized begging of sentences and added double space between
sentences as described in https://orgmode.org/worg/org-contribute.html

Best,
Ihor



Re: Proposal: 'executable' org-capture-templaes

2022-06-17 Thread Tim Cross


Ihor Radchenko  writes:

> Arthur Miller  writes:
>
>> this example the mode map approach seems slightly more convenient. I don't 
>> know,
>> in org-agenda-test, I haven't implemented all of org-agenda, restrictions,
>> prefixes and some other stuff, mostly because I don't really understand the
>> implementation.
>
> In the nutshell, agenda restrictions will execute some elisp that sets
> certain global variables affecting other agenda commands. selecting the
> restriction should not leave the agenda menu.
>
> Also, unlike other selections being echoed literally upon selection,
> restriction echo must depend on the global state. If you press "<" in
> the menu, the menu prompt should change between "Press key for agenda
> command (unrestricted):", Press key for agenda command (restricted to
> buffer):, ... etc
>
> Note that there is not much point echoing the selection.
> Tim, do I understand correctly that changed minibuffer prompt will be
> also spoken out by emacspeak?
>

I think so, but this would need to be verified. A lot depends on
how/where Emacs does things - for example, because Emacspeak relies on
the advice mechanism, it cannot pickup changes/actions which occur in
pure C code. Provided Emacspeak is able to get the prompt in some
before, after or around advice call, all should be fine. 





Re: Proposal: 'executable' org-capture-templaes

2022-06-17 Thread Ihor Radchenko
Arthur Miller  writes:

> Anyway, I have been playing and testing a bit, and didn't want to prolong
> discussion untill I have something to show. So here is a small prototype. It 
> is
> just a rough sketch of the idea.

Thanks!
I will not comment on Elisp part just yet. Let's first settle down the design.

> this example the mode map approach seems slightly more convenient. I don't 
> know,
> in org-agenda-test, I haven't implemented all of org-agenda, restrictions,
> prefixes and some other stuff, mostly because I don't really understand the
> implementation.

In the nutshell, agenda restrictions will execute some elisp that sets
certain global variables affecting other agenda commands. selecting the
restriction should not leave the agenda menu.

Also, unlike other selections being echoed literally upon selection,
restriction echo must depend on the global state. If you press "<" in
the menu, the menu prompt should change between "Press key for agenda
command (unrestricted):", Press key for agenda command (restricted to
buffer):, ... etc

Note that there is not much point echoing the selection.
Tim, do I understand correctly that changed minibuffer prompt will be
also spoken out by emacspeak?

> About the name: org-select; i really have no idea what to call it, so better
> name would be nice. Sorry for the bugs, I am aware of many, but it still
> displays the idea I think.

It does not matter at this point. We can discuss it at the very end. It
is not like M-x replace-regexp is difficult to run later.

> (defun osl--make-mode-map ()
>   (let ((map (make-sparse-keymap)))
> (define-key map [?q] #'org-select-quit)
> (define-key map [?\C-g] #'org-select-abort)
> (define-key map [left] #'osl--back)
> (define-key map [?\C-p] #'osl--back)

binding left and C-p is unexpected. C-n and C-p are usually dedicated to
moving around. A very conservative alternative could be creating a new
buffer for sub-menus and letting the user use the usual previous-buffer
command.

> ;;; API
> 
> (defun org-select (tables  args)
>   "Select a member of an alist with multiple keys.
>
> TABLE is an alist which should contain entries where the car is a string.
> There should be two types of entries.

This is confusing because there is no TABLE argument in the command.
I it not immediately clear that you can use multiple tables to build a
single menu.

> ARGS is a property list containing following members:

Does it apply to individual menu entries? I am a bit confused here.

> :text  a string placed over the selection in the buffer.
> :label a string used for the selections buffer name.

:label name is confusing. Why not directly :buffer-name?

> :alwayswhen `t', this menu is shown; even descended into submenus
> :transient when `t', the menu is dissmised after user perform an
> action

Does it apply to the whole table? Individual entries?

> TABLES are additional menus in the same format as TABLE. If there are more
> than one menus, they will be separated by a separator line rendered with
> character as specified in `org-select-horizontal-separator'"

> (defun org-capture-test ( goto keys)
> (defun org-capture--handle (entry)
>   (org-select-quit "")
>   (cond
>((or (equal "C" (car entry)) (equal "q" (car entry)))
> (eval (nth 2 entry)))
>(t
> (let* ((orig-buf (current-buffer))

This looks fragile. It is hard to know what is the value of
(current-buffer) after exiting the manu. It is not guaranteed to be the
buffer where the menu was called initially.

A more proper alternative could be allowing the menu to setup some
variables _before_ running the menu. For example, org-select can store
some setting as buffer-local variables in the menu buffer. This way, the
caller can fill some initial settings at the calling time. The settings
will then be available at the time user actually select the menu option.

> (defvar org-agenda--menu
>   '((("a" "Agenda for current week or day" (org-agenda--exec
> 'org-agenda-list))

It's nice that I can instead do

`((("a" ,(propertize "Agenda for current week or day"
   'face 'highlight)
  (org-agenda--exec
   'org-agenda-list))

and the face is actually preserved (:

Best,
Ihor



[PATCH] babel output seems to drop anything before % (in session)

2022-06-17 Thread Ihor Radchenko
"Felix Freeman"  writes:

> Today I stumbed upon the same bug.
>
> Sadly I have no idea how to fix it, but thought it would be nice to post
> about it here so the bug doesn't get lost in the sands of time.

I finally managed to get some working fix.
At least it kind of works on my system using bash.
The idea is changing shell prompt to something unique when we initialize
the session.

See the attached patch.

Please test this on "sh" "zsh" "fish" "csh" "ash" "dash" "ksh" "mksh"
and "posh".
Especially on fish, csh, and posh (which I believe refers to
PowerShell).

Also, doing PS1="blabla > " in bash may not always work. At least it
does not work with https://github.com/nojhan/liquidprompt

So, more reliable ways to change prompt are welcome.

Best,
Ihor

>From 141f810a658d652e1cb3a147c5f71659f62df86f Mon Sep 17 00:00:00 2001
Message-Id: <141f810a658d652e1cb3a147c5f71659f62df86f.1655522152.git.yanta...@gmail.com>
From: Daniele Pizzolli 
Date: Wed, 5 May 2021 17:00:28 +0200
Subject: [PATCH 1/2] Add disabled test for % in babel shell output

---
 testing/lisp/test-ob-shell.el | 29 +
 1 file changed, 29 insertions(+)

diff --git a/testing/lisp/test-ob-shell.el b/testing/lisp/test-ob-shell.el
index 2f346f699..e81058ac7 100644
--- a/testing/lisp/test-ob-shell.el
+++ b/testing/lisp/test-ob-shell.el
@@ -106,6 +106,35 @@ (ert-deftest ob-shell/simple-list ()
 	   "#+BEGIN_SRC sh :results output :var l='(1 2)\necho ${l}\n#+END_SRC"
 	   (org-trim (org-babel-execute-src-block))
 
+(ert-deftest ob-shell/percent-simple ()
+  "Test percent in output."
+  (should
+   (equal "one 0% two\ntree 0% four"
+	  (org-test-with-temp-text
+	   "#+BEGIN_SRC bash :results output verbatim\necho one 0% two\necho tree 0% four\n#+END_SRC"
+	   (org-trim (org-babel-execute-src-block)
+  (should
+   (equal "five 0% two\ntree 0% four"
+	  (org-test-with-temp-text
+	   "#+BEGIN_SRC bash :results output verbatim\necho five 0% two\necho tree 0% four\n#+END_SRC"
+	   (org-trim (org-babel-execute-src-block))
+
+(ert-deftest ob-shell/percent-session ()
+  "Test percent in output for session.
+
+At the second iteration the string before % is dropped."
+  :expected-result :failed
+  (should
+   (equal "one 0% two\ntree 0% four"
+	  (org-test-with-temp-text
+	   "#+BEGIN_SRC bash :results output verbatim :session sess\necho one 0% two\necho tree 0% four\n#+END_SRC"
+	   (org-trim (org-babel-execute-src-block)
+  (should
+   (equal "five 0% six\nseven 0% eight"
+	  (org-test-with-temp-text
+	   "#+BEGIN_SRC bash :results output verbatim :session sess\necho five 0% six\necho seven 0% eight\n#+END_SRC"
+	   (org-trim (org-babel-execute-src-block))
+
 (provide 'test-ob-shell)
 
 ;;; test-ob-shell.el ends here
-- 
2.35.1

>From 4f7a1369e72b22836cb74931c7c86e845155a729 Mon Sep 17 00:00:00 2001
Message-Id: <4f7a1369e72b22836cb74931c7c86e845155a729.1655522152.git.yanta...@gmail.com>
In-Reply-To: <141f810a658d652e1cb3a147c5f71659f62df86f.1655522152.git.yanta...@gmail.com>
References: <141f810a658d652e1cb3a147c5f71659f62df86f.1655522152.git.yanta...@gmail.com>
From: Ihor Radchenko 
Date: Sat, 18 Jun 2022 11:11:12 +0800
Subject: [PATCH 2/2] ob-shell: Fix output containing strings matching
 `comint-prompt-regexp'

* lisp/ob-comint.el (org-babel-comint-wait-for-output): Do not rely on
`face-at-point' returning non-nil.
* lisp/ob-shell.el (org-babel-shell-set-prompt-commands): New constant
holding shell-specific commands to change prompt.
(org-babel-prompt-command): New variable holding command to be user to
set distinguishable prompt.
(org-babel-shell-initialize): Set `org-babel-prompt-command' according
to shell name.
(org-babel-sh-prompt): New variable holding default shell prompt.
(org-babel-sh-initiate-session): Change the default prompt to
`org-babel-sh-prompt' and alter `comint-prompt-regexp' to match it
tightly.
* testing/lisp/test-ob-shell.el (ob-shell/percent-session): Do not
expect failure in the fixed test.

Fixes https://list.orgmode.org/CKK9TULBP2BG.2UITT31YJV03J@laptop/T/#mc8e3ca2f5f1b9a94040a68b4c6201234b209041c
---
 lisp/ob-comint.el |  4 +---
 lisp/ob-shell.el  | 42 ++-
 testing/lisp/test-ob-shell.el |  4 ++--
 3 files changed, 39 insertions(+), 11 deletions(-)

diff --git a/lisp/ob-comint.el b/lisp/ob-comint.el
index 427aba341..1d3e24607 100644
--- a/lisp/ob-comint.el
+++ b/lisp/ob-comint.el
@@ -124,9 +124,7 @@ (defun org-babel-comint-wait-for-output (buffer)
 (while (progn
  (goto-char comint-last-input-end)
  (not (and (re-search-forward comint-prompt-regexp nil t)
-   (goto-char (match-beginning 0))
-   (string= (face-name (face-at-point))
-"comint-highlight-prompt"
+ (goto-char (match-beginning 0)
   (accept-process-output (get-buffer-process buffer)
 
 (defun 

[PATCH worg 1/2] Move duplicate and obsolete LoB to archive

2022-06-17 Thread ~theophilusx
From: Tim Cross 

A duplicate library-of-babel.org file was in the

worg/org-contrib/babel

directory. It was out-of-date, so I moved it to archive.
The 'real' library-of-babel.org file sits in the root /worg
directory.
---
 {org-contrib/babel => archive}/library-of-babel.org | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename {org-contrib/babel => archive}/library-of-babel.org (100%)

diff --git a/org-contrib/babel/library-of-babel.org 
b/archive/library-of-babel.org
similarity index 100%
rename from org-contrib/babel/library-of-babel.org
rename to archive/library-of-babel.org
-- 
2.34.2




[PATCH worg 2/2] Update and cleanup of LoB file

2022-06-17 Thread ~theophilusx
From: Tim Cross 

- Add exmaple elispgantt test table and description
- Fix some old tblname and headers arguments
- Fix some missing quoting in exmaple blocks
- fix block indentation
- add missing name values

Still a bit of cleanup work required, but a start...
---
 library-of-babel.org | 554 +++
 1 file changed, 294 insertions(+), 260 deletions(-)

diff --git a/library-of-babel.org b/library-of-babel.org
index e61c3d35..aa1772dd 100644
--- a/library-of-babel.org
+++ b/library-of-babel.org
@@ -29,7 +29,7 @@ A collection of simple utility functions:
 
 #+name: echo
 #+begin_src emacs-lisp :var input="echo'd"
-  input
+input
 #+end_src
 
 * File I/O
@@ -42,13 +42,13 @@ file as either a table or a string.
 
 #+name: read
 #+begin_src emacs-lisp :var file="" :var format=""
-  (if (string= format "csv")
-  (with-temp-buffer
-(org-table-import (expand-file-name file) nil)
-(org-table-to-lisp))
+(if (string= format "csv")
 (with-temp-buffer
-  (insert-file-contents (expand-file-name file))
-  (buffer-string)))
+  (org-table-import (expand-file-name file) nil)
+  (org-table-to-lisp))
+  (with-temp-buffer
+(insert-file-contents (expand-file-name file))
+(buffer-string)))
 #+end_src
 
 Write =data= to a file at =file=.  If =data= is a list, then write it
@@ -56,14 +56,14 @@ as a table in traditional Org-mode table syntax.
 
 #+name: write
 #+begin_src emacs-lisp :var data="" :var file="" :var ext='()
-  (flet ((echo (r) (if (stringp r) r (format "%S" r
-(with-temp-file file
-  (case (and (listp data)
- (or ext (intern (file-name-extension file
-('tsv (insert (orgtbl-to-tsv data '(:fmt echo
-('csv (insert (orgtbl-to-csv data '(:fmt echo
-(t(org-babel-insert-result data)
-  nil
+(flet ((echo (r) (if (stringp r) r (format "%S" r
+  (with-temp-file file
+(case (and (listp data)
+   (or ext (intern (file-name-extension file
+  ('tsv (insert (orgtbl-to-tsv data '(:fmt echo
+  ('csv (insert (orgtbl-to-csv data '(:fmt echo
+  (t(org-babel-insert-result data)
+nil
 #+end_src
 
 ** Remote files
@@ -74,18 +74,18 @@ Read local or remote file in [[http://www.json.org/][json]] 
format into emacs-li
 
 #+name: json
 #+begin_src emacs-lisp :var file='() :var url='()
-  (require 'json)
-  (cond
-   (file
-(org-babel-with-temp-filebuffer file
-  (goto-char (point-min))
-  (json-read)))
-   (url
-(require 'w3m)
-(with-temp-buffer
-  (w3m-retrieve url)
-  (goto-char (point-min))
-  (json-read
+(require 'json)
+(cond
+ (file
+  (org-babel-with-temp-filebuffer file
+(goto-char (point-min))
+(json-read)))
+ (url
+  (require 'w3m)
+  (with-temp-buffer
+(w3m-retrieve url)
+(goto-char (point-min))
+(json-read
 #+end_src
 
 *** Google docs
@@ -103,17 +103,17 @@ for spreadsheets.
 
 #+name: gdoc-read
 #+begin_src emacs-lisp :var title="example" :var format="csv"
-  (let* ((file (concat title "." format))
- (cmd (format "google docs get --format %S --title %S" format title)))
-(message cmd) (message (shell-command-to-string cmd))
-(prog1 (if (string= format "csv")
-   (with-temp-buffer
- (org-table-import (shell-quote-argument file) '(4))
- (org-table-to-lisp))
+(let* ((file (concat title "." format))
+   (cmd (format "google docs get --format %S --title %S" format title)))
+  (message cmd) (message (shell-command-to-string cmd))
+  (prog1 (if (string= format "csv")
  (with-temp-buffer
-   (insert-file-contents (shell-quote-argument file))
-   (buffer-string)))
-  (delete-file file)))
+   (org-table-import (shell-quote-argument file) '(4))
+   (org-table-to-lisp))
+   (with-temp-buffer
+ (insert-file-contents (shell-quote-argument file))
+ (buffer-string)))
+(delete-file file)))
 #+end_src
 
 For example, a line like the following can be used to read the
@@ -139,27 +139,30 @@ normal document.
 
 #+name: gdoc-write
 #+begin_src emacs-lisp :var title="babel-upload" :var data=fibs(n=10) :results 
silent
-  (let* ((format (if (listp data) "csv" "txt"))
- (tmp-file (make-temp-file "org-babel-google-doc" nil (concat "." 
format)))
- (cmd (format "google docs upload --title %S %S" title tmp-file)))
-(with-temp-file tmp-file
-  (insert
-   (if (listp data)
-   (orgtbl-to-csv
-data '(:fmt (lambda (el) (if (stringp el) el (format "%S" el)
- (if (stringp data) data (format "%S" data)
-(message cmd)
-(prog1 (shell-command-to-string cmd) (delete-file tmp-file)))
+(let* ((format (if (listp data) "csv" "txt"))
+   (tmp-file (make-temp-file "org-babel-google-doc" nil (concat "." 
format)))
+   (cmd (format "google docs upload --title %S %S" title 

[PATCH worg 0/2] Cleanup of LoB file

2022-06-17 Thread ~theophilusx
These patches just perform some basic cleanup of the library-of-
babel.org file. It also moves a duplicate library-of-babel.org file into
the archive directory.  Note that I am working on a complete overhaul of
worg, which I will implement in a separate branch in my sourcehut clone
of the repo.

Given the planned changes are going to be fairly large, I felt it better
to do this work in a fork and separate branch on sourcehut, which chould
allow anyone interested to clone and review without affecting the main
worg repository. Happy to be added with write access to main worg
repository if you feel that is warranted, but probably don't really need
it at this point.

Tim Cross (2):
  Move duplicate and obsolete LoB to archive
  Update and cleanup of LoB file

 .../babel => archive}/library-of-babel.org|   0
 library-of-babel.org  | 554 ++
 2 files changed, 294 insertions(+), 260 deletions(-)
 rename {org-contrib/babel => archive}/library-of-babel.org (100%)

-- 
2.34.2



Re: Links to javascript-based websites from orgmode.org: Paypal and Github

2022-06-17 Thread Ihor Radchenko
Bastien  writes:

> If one day more Org contributors appear on a Worg page where they
> advertize their need for donations (and I encourage Org contributors
> to add such a page), I would have no problem with links to donations
> services that are not aligned with GNU standards.

I have been recently exploring Liberapay and stumbled upon
https://liberapay.com/about/teams.

It is possible to create a "team" and distribute the donations across
multiple developers. I believe that it is one of a simple (from
perspective of user) ways to direct donations to the willing Org
contributors without creating confusion among donors on where to donate.

WDYT?

Best,
Ihor





Re: Orgmode plain list bullet : change automatically with list depth

2022-06-17 Thread Tim Cross


Samuel Wales  writes:

> sure.
>
> iiuc i think op wants 2 things:
>
>   1] graphical bullets.  i.e. not the - + etc. that are in the org
> plain text as saved to disk.
>   2] each level of a list to have the same bullet style
>
>
> examples of 2]:
>
> a conforming list:
>
> - this is level 1.  for this list, we always want level 1 to
>   use the - bullet style in the org plain text.
>   + this is level 2.  for this list, we always want level 2
> to use the + bullet style in the org plain text.
>   + another level 2
> - another level 1
>   + another level 2
>   + the + is CONSISTENT with the + in the level 2 of the
> previous list item
>
>
> a non-conforming list:
>
>
> - this is level 1.  for this list, we always want level 1 to
>   use the - bullet style in the org plain text.
>   + this is level 2.  for this list, we always want level 2
> to use the + bullet style in the org plain text.
>   + another level 2
> - another level 1
>   * another level 2
>   * these * markers are INCONSISTENT with the + markers in
> the level 2 previous list item.
>
>
> the idea is for org [as opposed to fontification] to enforce this
> level correspondence.  whenever we do a bullet style change at any
> level, org could change ALL BULLETS AT THE SAME LEVEL.  this keeps the
> list conforming.
>
> currently, org does not do this.  instead, it allows you to
> say that /demotion/ makes a + when you have a -.  but
> without enforcement, the list can quickly become
> non-conforming after the user edits it.
>
> this idea is independent (orthogonal) to fontification /
> displayed graphical glyph.  i think op's 2] idea can make
> sense.  and then fontification / displayed graphical glyph
> can be done perhaps with a fontification package.
>
> in any case, fontification can merely say that + looks
> like  or so.  orthogonal to levels.
>
>

Sorry, but I think this idea is misguided. 

The 'bullets' in lists are largely irrelevant to org. Lists are
determined by the indentation level. I don't think org actually cares
about wither an item starts with '-', '+', or '*'. I also don't think it
matters (from an org perspective) if a list has a mix of different
bullets. This might be 'offensive' for users, but is largely irrelevant
for org. 

This means the questions now becomes "Do we add the additional complexity
and possible performance hit to enforce bullet consistency?" and "Are
there any use cases where people might want different bullets at the
same level in a list?". 

As having mixed bullets does not impact on org export, I'm inclined to
leave this as a user issue i.e. if you want things to be consistent,
then be consistent. The current behaviour I think is pretty good i.e. if
you start using a different bullet, new items at the same level will use
that bullet and when you shift an item to be at the parent level, it
will change the bullet to be the same as the parents. If you indent an
item, it will use the same bullet as the parent, but you can change it
and then all additional items at that level will use the same bullet. 

As the bullet type has no baring on org's processing of lists, I think
this is a purely presentation issue and therefore anything we want to do
wrt enforcement should in fact occur at the font-lock layer. e.g. allow
code which will just set the bullet to some preferred mapping based on
level. As the user won't see which 'real' character is being used, it
won't matter if it uses mixed bullet styles. This also has the advantage
that the user can just use the one bullet 'type' and see different
bullet rendering based on level, so you won't have any 'inconsistency'
anyway as all entries just use the same bullet. 






Re: LoB elsipgantt sample input table

2022-06-17 Thread Tim Cross


"Fraga, Eric"  writes:

> Dear Tim,
>
> On Friday, 17 Jun 2022 at 18:27, Tim Cross wrote:
>> "Fraga, Eric"  writes:
>>> On Friday, 17 Jun 2022 at 13:34, Tim Cross wrote:
 One of the more interesting code blocks is elispgantt, which can
 generate a Gantt chart from data supplied in a table. It is based on
 code originally submitted by Eric Fraga and modified by Tom Dye. .
>
> attached is an org file with a simple example table along with a brief
> description. Would this be enough to include within the LoB document? If so, 
> are
> you able to add it as I don't have access at present.
>

Thanks Eric. Exactly what I was hoping for. I will add it to my sr.ht
fork and send through a patch to get it added to worg (I still need to
get my own worg access sorted, just need to send the email). 






Re: Orgmode plain list bullet : change automatically with list depth

2022-06-17 Thread Samuel Wales
sure.

iiuc i think op wants 2 things:

  1] graphical bullets.  i.e. not the - + etc. that are in the org
plain text as saved to disk.
  2] each level of a list to have the same bullet style


examples of 2]:

a conforming list:

- this is level 1.  for this list, we always want level 1 to
  use the - bullet style in the org plain text.
  + this is level 2.  for this list, we always want level 2
to use the + bullet style in the org plain text.
  + another level 2
- another level 1
  + another level 2
  + the + is CONSISTENT with the + in the level 2 of the
previous list item


a non-conforming list:


- this is level 1.  for this list, we always want level 1 to
  use the - bullet style in the org plain text.
  + this is level 2.  for this list, we always want level 2
to use the + bullet style in the org plain text.
  + another level 2
- another level 1
  * another level 2
  * these * markers are INCONSISTENT with the + markers in
the level 2 previous list item.


the idea is for org [as opposed to fontification] to enforce this
level correspondence.  whenever we do a bullet style change at any
level, org could change ALL BULLETS AT THE SAME LEVEL.  this keeps the
list conforming.

currently, org does not do this.  instead, it allows you to
say that /demotion/ makes a + when you have a -.  but
without enforcement, the list can quickly become
non-conforming after the user edits it.

this idea is independent (orthogonal) to fontification /
displayed graphical glyph.  i think op's 2] idea can make
sense.  and then fontification / displayed graphical glyph
can be done perhaps with a fontification package.

in any case, fontification can merely say that + looks
like  or so.  orthogonal to levels.


On 6/17/22, Ihor Radchenko  wrote:
> Samuel Wales  writes:
>
>> i wonder if org could do the semantics in the text, while
>> fontification could do the appearance only.
>>
>> org allows you to change the bullet style [real text bullets rather
>> than fontification] upon demotion.
>>
>> thus, you can have it consistent that demoting + from top level will
>> create - on level 2 for 1 item.  until you change it.
>>
>> but org does not enforce by level.  so you can't keep the results of
>> your demotion strategy in the rest of the list.  an enforced scheme
>> would have it so that a change to new bullet style at a level, or
>> level 1 otherwise, would style that level.
>
> Could you please provide an example. I do not understand what you are
> trying to suggest.
>
> Best,
> Ihor
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



Re: Creating animated gif from latex src blocks

2022-06-17 Thread Ihor Radchenko
Edouard Debry  writes:

> As a matter of fact, you can, but I will check out the latex package you 
> mentioned
>
> "Fraga, Eric"  writes:
>
>> Check out the animate LaTeX package.  I don't believe you can create
>> such the actual animation from tikz itself.

FYI, animate package can work, but it is not guaranteed that the results
can be actually viewed by anything other than Adobe Acrobat.

Best,
Ihor



Re: Creating animated gif from latex src blocks

2022-06-17 Thread Edouard Debry


As a matter of fact, you can, but I will check out the latex package you 
mentioned

"Fraga, Eric"  writes:

> Check out the animate LaTeX package.  I don't believe you can create
> such the actual animation from tikz itself.



Re: Agenda view sorting based on custom property

2022-06-17 Thread Haakon HR
Thank you! That was exactly what I was looking for.

Sincerely,
Haakon



Re: About 'inline special blocks'

2022-06-17 Thread Juan Manuel Macías
Ihor Radchenko  writes:

> While arbitrary markup can indeed be introduced using our current link
> syntax, there is one important limitation of links:
>
>  *** link description cannot contain other links ***
>
> If one seriously tries to extend Org syntax with custom markup elements,
> nested markup will not be possible. And we do not want to change Org
> links to allow other links inside.
>
> Inline special blocks may not have such limitation if we allow special
> blocks to be nested.

  +1.

This seems to me a *very* important point.

Best regards,

Juan Manuel 



Re: LoB elsipgantt sample input table

2022-06-17 Thread Fraga, Eric
Dear Tim,

On Friday, 17 Jun 2022 at 18:27, Tim Cross wrote:
> "Fraga, Eric"  writes:
>> On Friday, 17 Jun 2022 at 13:34, Tim Cross wrote:
>>> One of the more interesting code blocks is elispgantt, which can
>>> generate a Gantt chart from data supplied in a table. It is based on
>>> code originally submitted by Eric Fraga and modified by Tom Dye. .

attached is an org file with a simple example table along with a brief 
description.  Would this be enough to include within the LoB document?  If so, 
are you able to add it as I don't have access at present.

thank you,
eric

-- 
: Eric S Fraga, with org release_9.5.4-564-g811dea in Emacs 29.0.50


GANTT.org
Description: GANTT.org


Re: Utility of description lists

2022-06-17 Thread Cletip Cletip
Ok I understand, it's really nice (the rendering on your site too).
Thanks for your answer

Le ven. 17 juin 2022 à 16:05, Kaushal Modi  a
écrit :

> On Fri, Jun 17, 2022 at 8:50 AM Cletip Cletip 
> wrote:
>
> > Final question : why do you use description lists and not another ?
>
> I use description lists *heavily*.
>
> 1. For description lists of course.. where the "description" part is a
> bit verbose and plain lists don't look at that elegant
>
> For example, this in Org
>
> =
> ** Customizing ~local.mk~ (Optional)
> Here are few variables that you might like to change in the ~local.mk~:
> - ~prefix~ :: Org installation directory
>   #+begin_src makefile
>   prefix = /dir/where/you/want/to/install/org # Default: /usr/share
>   #+end_src
>   The ~.el~ files will go to ~$(prefix)/emacs/site-lisp/org~ by
>   default. If you'd like to change that, change the ~lispdir~
>   variable too.
> - ~infodir~ :: Org Info installation directory. I like to keep the
>   Info file for development version of Org in a separate directory.
>   #+begin_src makefile
>   infodir = $(prefix)/org/info # Default: $(prefix)/info
>   #+end_src
> - ~ORG_MAKE_DOC~ :: Types of Org documentation you'd like to build by
>   default.  Setting below generates only the Org Info manual.
>   #+begin_src makefile
>   ORG_MAKE_DOC = info # Default: html pdf
>   #+end_src
> =
>
> exports to
> https://scripter.co/building-org-development-version/#customizing-local-dot-mk--optional
>
> 2. Where something would belong in a sub-heading, but not quite
> exactly? I can only describe that using one of my examples:
>
> =
> * Using ~pip install~
> If you do not want to manually download the ~.jar~, there's a Python
> wrapper available to do the same for you:
> [[https://github.com/svenkreiss/html5validator][html5validator]].
> - Install ::
>   #+begin_src shell
>   pip install --user html5validator
>   #+end_src
> - Run ::
>   #+begin_src shell
>   html5validator --root public/
>   #+end_src
>   It seems like this Python wrapper implicitly passes ~--skip-non-html
> =
>
> exports to https://scripter.co/offline-html5-validator/#using-pip-install
>
> 3. Sometimes I also use it for adding Notes to a section
>
> =
> - Note :: While the =%.1f= format is handy for those who are used to
>   =printf()= syntax, note that Calc unlimited precision
>   numbers are converted to double floats before applying
>   =%.1f=. Whereas =f1= operates on Calc numbers without
>   conversion.
> =
>
> exports to the Note in
> https://scripter.co/field-formatters-in-org-table/#using-calc-f1-formatter
>


Re: Utility of description lists

2022-06-17 Thread Cletip Cletip
Ok clear thanks!

Le ven. 17 juin 2022 à 15:43, Fraga, Eric  a écrit :

> On Friday, 17 Jun 2022 at 09:35, William Denton wrote:
> > When I have a list of things I want to briefly descibe!
>
> And where the leading bullet or number would simple add clutter.
> --
> : Eric S Fraga, with org release_9.5.4-535-ged6f8d in Emacs 29.0.50


Re: Utility of description lists

2022-06-17 Thread Cletip Cletip
Simple and efficient, thanks for your answer!


Le ven. 17 juin 2022 à 15:36, William Denton  a écrit :

> On 17 June 2022, Cletip Cletip wrote:
>
> > Final question : why do you use description lists and not another ?
>
> When I have a list of things I want to briefly descibe!  That's all.  It's
> just
> a way of formatting a list of things where there's a term (a word, a name,
> a
> title) that has some descriptive text.  Sometimes I use them when there's
> an
> obvious term/description pairing, and sometimes when I have a text-heavy
> list of
> things and I want to have a brief summary of each to make it easier to
> read.
>
>
> Bill
>
> --
> William Denton
> https://www.miskatonic.org/
> Librarian, artist and licensed private investigator.
> Toronto, Canada
>


Re: Is ob-latex maintained ?

2022-06-17 Thread Fraga, Eric
On Friday, 17 Jun 2022 at 13:48, DEBRY.Edouard wrote:
> Unfortunately not.
>
> If I remember well, this setting is for math environments, whether you
> want to preview them as png or svg, it does not work for src blocks.

Well, my src blocks work although I use imagemagick and then have the
following extra settings for the LaTeX src blocks:

#+property: header-args:latex :fit yes :results file :exports results
#+property: header-args:latex+ :imagemagick yes :iminoptions -density 600 
:imoutoptions -geometry 1200

If you have ImageMagick installed, maybe try this?

-- 
: Eric S Fraga, with org release_9.5.4-535-ged6f8d in Emacs 29.0.50


Re: Utility of description lists

2022-06-17 Thread Juan Manuel Macías
Hi,

Cletip Cletip writes:

> - they are made implicitly to make a "key :: value" couple, which can
> be convenient

Leaving aside typographical considerations, what LaTeX calls, for
example, "description" (because Org is totally typographic agnostic), I
find this property that you mention very useful. For example, for my
translation (work in progress) of Homer's Odyssey, I am writing a
descriptive list with the Homeric formulas in Greek (key) and how I
translate each specific formula (value), since they are terms that are
repeated a lot in the text. With a bit of Elisp I can later recover
some specific formula from the list.

See: https://list.orgmode.org/87bl5tzof2@posteo.net/

Then, when I publish the translation (if I ever finish it ;-)), that
list will be translated in typographic terms, into a glossary of
homeric formulas.

Best regards,

Juan Manuel 



Re: Utility of description lists

2022-06-17 Thread Kaushal Modi
On Fri, Jun 17, 2022 at 8:50 AM Cletip Cletip  wrote:

> Final question : why do you use description lists and not another ?

I use description lists *heavily*.

1. For description lists of course.. where the "description" part is a
bit verbose and plain lists don't look at that elegant

For example, this in Org

=
** Customizing ~local.mk~ (Optional)
Here are few variables that you might like to change in the ~local.mk~:
- ~prefix~ :: Org installation directory
  #+begin_src makefile
  prefix = /dir/where/you/want/to/install/org # Default: /usr/share
  #+end_src
  The ~.el~ files will go to ~$(prefix)/emacs/site-lisp/org~ by
  default. If you'd like to change that, change the ~lispdir~
  variable too.
- ~infodir~ :: Org Info installation directory. I like to keep the
  Info file for development version of Org in a separate directory.
  #+begin_src makefile
  infodir = $(prefix)/org/info # Default: $(prefix)/info
  #+end_src
- ~ORG_MAKE_DOC~ :: Types of Org documentation you'd like to build by
  default.  Setting below generates only the Org Info manual.
  #+begin_src makefile
  ORG_MAKE_DOC = info # Default: html pdf
  #+end_src
=

exports to 
https://scripter.co/building-org-development-version/#customizing-local-dot-mk--optional

2. Where something would belong in a sub-heading, but not quite
exactly? I can only describe that using one of my examples:

=
* Using ~pip install~
If you do not want to manually download the ~.jar~, there's a Python
wrapper available to do the same for you:
[[https://github.com/svenkreiss/html5validator][html5validator]].
- Install ::
  #+begin_src shell
  pip install --user html5validator
  #+end_src
- Run ::
  #+begin_src shell
  html5validator --root public/
  #+end_src
  It seems like this Python wrapper implicitly passes ~--skip-non-html
=

exports to https://scripter.co/offline-html5-validator/#using-pip-install

3. Sometimes I also use it for adding Notes to a section

=
- Note :: While the =%.1f= format is handy for those who are used to
  =printf()= syntax, note that Calc unlimited precision
  numbers are converted to double floats before applying
  =%.1f=. Whereas =f1= operates on Calc numbers without
  conversion.
=

exports to the Note in
https://scripter.co/field-formatters-in-org-table/#using-calc-f1-formatter



Re: Creating animated gif from latex src blocks

2022-06-17 Thread Fraga, Eric
Check out the animate LaTeX package.  I don't believe you can create
such the actual animation from tikz itself.

-- 
: Eric S Fraga, with org release_9.5.4-535-ged6f8d in Emacs 29.0.50


Re: Is ob-latex maintained ?

2022-06-17 Thread DEBRY . Edouard


Unfortunately not.

If I remember well, this setting is for math environments, whether you
want to preview them as png or svg, it does not work for src blocks.

"Fraga, Eric"  writes:

> ---
> Attention, ce courriel provient d'Internet. L'emetteur n'est peut-etre pas 
> celui que vous pensez. 
> Merci de considerer ce point en lisant ce courriel, avant d'y repondre, de 
> cliquer sur
> les liens ou d'ouvrir les pieces jointes.
> ---
>
> Have you tried adding the line:
>
> #+options: tex:dvipng
>
> to the file?  (you may need to type C-c C-c on that line to refresh the
> settings.)  Would this solve your problem?

___

This email and any attachments are confidential to the intended recipient and 
may also be privileged.
If you are not the intended recipient please delete it from your system and 
notify the sender. 
You should not copy it or use it for any purpose nor disclose or distribute its 
contents to any other person.
 

Ce courriel et ses pieces-jointes sont envoyes de maniere confidentielle et 
doivent etre traites avec attention.
Si vous n'etes pas le destinataire, merci de le detruire et d'en informer son 
auteur. 
Vous ne devez pas copier, utiliser, reveler ou diffuser son contenu a quiconque.




Re: Utility of description lists

2022-06-17 Thread Fraga, Eric
On Friday, 17 Jun 2022 at 09:35, William Denton wrote:
> When I have a list of things I want to briefly descibe!  

And where the leading bullet or number would simple add clutter.
-- 
: Eric S Fraga, with org release_9.5.4-535-ged6f8d in Emacs 29.0.50


Re: Utility of description lists

2022-06-17 Thread George Mauer
It is not quite true that it's just a way of formatting, there is a
semantic element to it as well where someone parsing your document
programmatically can now know that what you have is a list of terms paired
with their descriptions. In fact, when exporting to html you get a
description list
 which is one
of the most underused-yet-everyone-should-use-it-more html elements.

On Fri, Jun 17, 2022 at 8:37 AM William Denton  wrote:

> On 17 June 2022, Cletip Cletip wrote:
>
> > Final question : why do you use description lists and not another ?
>
> When I have a list of things I want to briefly descibe!  That's all.  It's
> just
> a way of formatting a list of things where there's a term (a word, a name,
> a
> title) that has some descriptive text.  Sometimes I use them when there's
> an
> obvious term/description pairing, and sometimes when I have a text-heavy
> list of
> things and I want to have a brief summary of each to make it easier to
> read.
>
>
> Bill
>
> --
> William Denton
> https://www.miskatonic.org/
> Librarian, artist and licensed private investigator.
> Toronto, Canada
>
>


Re: Utility of description lists

2022-06-17 Thread William Denton

On 17 June 2022, Cletip Cletip wrote:


Final question : why do you use description lists and not another ?


When I have a list of things I want to briefly descibe!  That's all.  It's just 
a way of formatting a list of things where there's a term (a word, a name, a 
title) that has some descriptive text.  Sometimes I use them when there's an 
obvious term/description pairing, and sometimes when I have a text-heavy list of 
things and I want to have a brief summary of each to make it easier to read.



Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada



Re: Is ob-latex maintained ?

2022-06-17 Thread Fraga, Eric
Have you tried adding the line:

#+options: tex:dvipng

to the file?  (you may need to type C-c C-c on that line to refresh the
settings.)  Would this solve your problem?

-- 
: Eric S Fraga, with org release_9.5.4-535-ged6f8d in Emacs 29.0.50


Creating animated gif from latex src blocks

2022-06-17 Thread DEBRY . Edouard


Hello,

I would like to create an animated gif for a latex src block.

Here to fix ideas such a block :

<>
#+header: :file test4.gif
#+header: :exports results
#+header: :results output silent graphics file
#+header: :imagemagick yes :iminoptions -density 600 -delay 8 -loop 0 
-background white -alpha remove
#+header: :fit yes :noweb yes :headers '("\\usepackage{tikz}")
#+begin_src latex
\foreach \angle in {0,10,...,360}
{
  \begin{tikzpicture}
% fill circle and plot
\fill[blue!50] (-1,0) arc (0:\angle:1) -- (-2,0) -- cycle;
\fill[blue!50] plot[smooth,domain=0:\angle] (pi/180*\x,{sin(\x)}) |- (0,0);
% draw connection
\draw (-2,0) +(\angle:1) circle (2pt) -- (pi/180*\angle,{sin(\angle)}) 
circle (2pt);
% draw axes an ticks
\draw (-3.5,0) -- (7,0);
\foreach \deg in {90, 180, 270, 360}
  \draw (pi/180*\deg,2pt) -- (pi/180*\deg,-2pt) node[below] {$\deg^\circ$};
\draw (0,-1.2) -- (0,1.2);
\foreach \y in {-1,-0.5,0.5,1}
  \draw (2pt,\y) -- (-2pt,\y) node[left] {$\y$};
% draw plot and circle outline
\draw plot[smooth,domain=0:360] (pi/180*\x,{sin(\x)});
\draw (-2,0) circle (1);
  \end{tikzpicture}
}
#+end_src
<>

grabbed here :
https://tex.stackexchange.com/questions/291627/draw-an-animated-gif-of-trigonometry-function

When hitting [C-c C-c], it does produce a gif, but which cannot be
animated.

I downloaded another animated gif on internet which works properly
within emacs, so the issue comes most probably from the latex to pdf
generation.

I noticed that the latex header used is

<==>
\documentclass{article}
\usepackage[usenames]{color}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{capt-of}
\pagestyle{empty} % do not remove
% The settings below are copied from fullpage.sty
\setlength{\textwidth}{\paperwidth}
\addtolength{\textwidth}{-3cm}
\setlength{\oddsidemargin}{1.5cm}
\addtolength{\oddsidemargin}{-2.54cm}
\setlength{\evensidemargin}{\oddsidemargin}
\setlength{\textheight}{\paperheight}
\addtolength{\textheight}{-\headheight}
\addtolength{\textheight}{-\headsep}
\addtolength{\textheight}{-\footskip}
\addtolength{\textheight}{-3cm}
\setlength{\topmargin}{1.5cm}
\addtolength{\topmargin}{-2.54cm}
\usepackage[active, tightpage]{preview}
<==>

which is different from the latex header used in tex.stackexchange page
:
<>
\documentclass[tikz]{standalone}
\usepackage{tikz}
<>

I replaced the default header provided by emacs with this very one and
it worked. Is it possible to modify the latex header depending on the
export image format ?

Regards

___

This email and any attachments are confidential to the intended recipient and 
may also be privileged.
If you are not the intended recipient please delete it from your system and 
notify the sender. 
You should not copy it or use it for any purpose nor disclose or distribute its 
contents to any other person.
 

Ce courriel et ses pieces-jointes sont envoyes de maniere confidentielle et 
doivent etre traites avec attention.
Si vous n'etes pas le destinataire, merci de le detruire et d'en informer son 
auteur. 
Vous ne devez pas copier, utiliser, reveler ou diffuser son contenu a quiconque.




Is ob-latex maintained ?

2022-06-17 Thread DEBRY . Edouard


Hello,

I had a couple of small issues when trying to export latex src block to
images.

Here is to fix ideas a src block :

<=>
#+HEADER: :file test1.png
#+HEADER: :exports results
#+HEADER: :results output silent graphics file
#+HEADER: :fit yes :noweb yes :headers '("\\usepackage{tikz}" 
"\\usetikzlibrary{backgrounds}")
#+begin_src latex
\begin{tikzpicture}[background rectangle/.style={fill=olive!30}, show 
background rectangle]
\draw[->] (-3,0) -- (-2,0) arc[radius=0.5cm,start angle=-180,end angle=0] 
(-1,0) -- (1,0) arc[radius=0.5cm,start angle=180,end angle=0] (2,0) -- (3,0);
\filldraw (-1.5,0) circle[radius=1mm];
\filldraw (1.5,0) circle[radius=3mm];
\end{tikzpicture}
#+end_src
<=>

When hitting [C-c C-c], it did produce an "test1.png" however, it was
not a png file but ... a svg one !

I figured out that the process goes through first condition of
"org-babel-execute:latex (body params)" function (around line 150).
This one relies on function "org-create-formula-image" which should
have the process-type in argument, either 'dvipng, 'dvisvgm or
'imagemagick. If not given, the default one is given which for me is set
to 'dvisvgm.

The "org-create-formula-image" should be given in arguments the backend
corresponding to the desired image format. I tried adding 'dvipng
explicitely but image generation fails, however doing it manually (latex
+ dvipng) works.

Does someone maintains "ob-latex" ? and could make things clearer.

Regards




___

This email and any attachments are confidential to the intended recipient and 
may also be privileged.
If you are not the intended recipient please delete it from your system and 
notify the sender. 
You should not copy it or use it for any purpose nor disclose or distribute its 
contents to any other person.
 

Ce courriel et ses pieces-jointes sont envoyes de maniere confidentielle et 
doivent etre traites avec attention.
Si vous n'etes pas le destinataire, merci de le detruire et d'en informer son 
auteur. 
Vous ne devez pas copier, utiliser, reveler ou diffuser son contenu a quiconque.




Utility of description lists

2022-06-17 Thread Cletip Cletip
Hello to all,
The question is the same as the object, but it can be more detailed with
this question: what are the differences between description lists and other
lists?
After many researches, I can't understand the fundamental difference.
I can see two advantages to using this type of list:
- they are made implicitly to make a "key :: value" couple, which can be
convenient
- they can be useful when exporting: they have a different style than other
lists and can be used for some other things.

For example, with the use of org-roam (or even org-normal), if I want to
export a note with properties containing a link, I can't (the link is badly
exported). You can try with the following document :

:PROPERTIES:
:ID: 20220617115633324937
:SOURCE: [[id:20220617105453042719][Emacs]]
:CITE: [cite:@DifferenceSemantiqueEntre2022]
:END:
#+title: Test Page
#+OPTIONS: prop:t


- cite :: [cite:@DifferenceSemantiqueEntre2022]
- source :: [[id:20220617105453042719][Emacs]]

* Title and some content after here



Morehover, this type of data can be exploited by the Vulpea library (
https://github.com/d12frosted/vulpea), which could allow to add other
information to each note.

Final question : why do you use description lists and not another ?

PS : Thank you very much in advance for your future response, I discover
this original system to ask questions and I hope not to abuse it by asking
this type of questions ^^


Re: [PATCH] org.el (org-format-latex-header): put DEFAULT-PACKAGES before PACKAGES

2022-06-17 Thread Sébastien Miquel

Ihor Radchenko writes:

Thanks for the clarification! Now, your patch makes much more sense. Can
you update the commit message explaining the above shortly and linking
to this thread?


See attached.

Thanks,

--
Sébastien Miquel
From 72742cab341f66525e0acb0b92de65fb6d24c27f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Miquel?= 
Date: Mon, 13 Jun 2022 11:04:34 +0200
Subject: [PATCH] org.el (org-format-latex-header): put DEFAULT-PACKAGES before
 PACKAGES

* lisp/org.el (org-format-latex-header): put DEFAULT-PACKAGES before
PACKAGES, as per org-latex-packages-alist's documentation.

`org-format-latex-header' is mostly used to generate in-buffer images
from LaTeX fragments. For LaTeX document export, the header is
generated by `org-splice-latex-header' ond `org-latex-classes' instead
and the default and documented behaviour is to insert DEFAULT-PACKAGES
before PACKAGES.

See also
https://list.orgmode.org/877d5gg5rt.fsf@localhost/T/#m2ad2f3b1509e1af72016e8e6fad3557ff3083046
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 95dff27ad..0acfa4846 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3248,8 +3248,8 @@ images at the same place."
 
 (defcustom org-format-latex-header "\\documentclass{article}
 \\usepackage[usenames]{color}
-\[PACKAGES]
 \[DEFAULT-PACKAGES]
+\[PACKAGES]
 \\pagestyle{empty} % do not remove
 % The settings below are copied from fullpage.sty
 \\setlength{\\textwidth}{\\paperwidth}
-- 
2.36.1



Re: Orgmode plain list bullet : change automatically with list depth

2022-06-17 Thread Ihor Radchenko
Samuel Wales  writes:

> i wonder if org could do the semantics in the text, while
> fontification could do the appearance only.
>
> org allows you to change the bullet style [real text bullets rather
> than fontification] upon demotion.
>
> thus, you can have it consistent that demoting + from top level will
> create - on level 2 for 1 item.  until you change it.
>
> but org does not enforce by level.  so you can't keep the results of
> your demotion strategy in the rest of the list.  an enforced scheme
> would have it so that a change to new bullet style at a level, or
> level 1 otherwise, would style that level.

Could you please provide an example. I do not understand what you are
trying to suggest.

Best,
Ihor



Re: Agenda view sorting based on custom property

2022-06-17 Thread Ihor Radchenko
Haakon HR  writes:

> I have tried a few approaches but I'm a bit stuck. My first approach was
> to use the variable `org-agenda-cmp-user-defined' and implement a
> comparison function based on the already existing ones like
> `org-cmp-alpha' or `org-cmp-effort'. However, I'm not able to extract
> the custom property from the kind of entry that is passed into the
> comparison function, which seem to rely on `text-properties'. Is it
> possible to somehow make custom properties available as a text property,
> similar to things like 'todo-state, 'tags and so on?

Yes. What you are looking for is 'org-hd-marker property. It holds
marker to the position of the corresponding headline.

Once you know the marker, you can simply

(org-entry-get marker "CUSTOM")

It does not matter that current buffer is not the Org buffer. Marker
contains buffer information.

Best,
Ihor



Agenda view sorting based on custom property

2022-06-17 Thread Haakon HR
Hi all,

I'm trying to hack together a custom agenda view where I want to sort
the entries by a custom property, let's call it :CUSTOM:. So the entries
in question would look like this:

* TODO Buy cheese
  :PROPERTIES
  :CUSTOM: 2
  :END:

I have tried a few approaches but I'm a bit stuck. My first approach was
to use the variable `org-agenda-cmp-user-defined' and implement a
comparison function based on the already existing ones like
`org-cmp-alpha' or `org-cmp-effort'. However, I'm not able to extract
the custom property from the kind of entry that is passed into the
comparison function, which seem to rely on `text-properties'. Is it
possible to somehow make custom properties available as a text property,
similar to things like 'todo-state, 'tags and so on?

My second approach was to try to use the org parsing capabilities. I can
get the AST by parsing the buffers of interest containing entries I want
to sort. I'm for example able to get the list of :CUSTOM: with this
snippet:

`(org-element-map (org-element-parse-buffer) '(headline) (lambda (hl)
  (org-element-property :RELEVANCE hl)))'

Then I imagine I can manipulate the AST into the order I want and then
use `org-element-interpret-data' to create a new buffer w/ the desired
sorting. However, I haven't found a way to actually create a buffer
containing all the information from the interpreted AST as some
information seem to get lost. The end goal in this case is also an
agenda view where I can build on top of all the agenda capabilities, but
using this custom sorting. Is there a way to start from an AST and
transform it into an agenda view?

Thanks for any help or tips,
Haakon



Re: LoB elsipgantt sample input table

2022-06-17 Thread Tim Cross


"Fraga, Eric"  writes:

> On Friday, 17 Jun 2022 at 13:34, Tim Cross wrote:
>> One of the more interesting code blocks is elispgantt, which can
>> generate a Gantt chart from data supplied in a table. It is based on
>> code originally submitted by Eric Fraga and modified by Tom Dye. .
>
> If you give me the link, I will try to write some description that you
> could add?

thanks Eric, that would be great. 

The link is
https://git.sr.ht/~bzg/worg/tree/master/item/library-of-babel.org and
the section starts at line 484 (near the end of the file). 

The elispgantt block is looking for a table called gantttest, which
doesn't exist. If you can provide a description of the table format I
will add one or if you have one, just send it through and I'll add it. 



Re: LoB elsipgantt sample input table

2022-06-17 Thread Fraga, Eric
On Friday, 17 Jun 2022 at 13:34, Tim Cross wrote:
> One of the more interesting code blocks is elispgantt, which can
> generate a Gantt chart from data supplied in a table. It is based on
> code originally submitted by Eric Fraga and modified by Tom Dye. .

If you give me the link, I will try to write some description that you
could add?

-- 
: Eric S Fraga, with org release_9.5.4-535-ged6f8d in Emacs 29.0.50


Org syntax compatibility with texinfo syntax (was: Org mode and Emacs (was: Convert README.org to plain text README while installing package))

2022-06-17 Thread Ihor Radchenko
I am forwarding yet another email from the emacs-devel thread to here.
This thread includes both emacs-devel and Org ML.
I will still keep emacs-devel in the loop because people from there can
provide a useful insight about texinfo capabilities.

Richard Stallman wrote:

> I don't know for certain that every possible nesting "does the right
> thing".  I do know that @var{} is used inside many other constructs.
> By contrast, @dfn{} would not be nested inside or around other
> contructs very much.  @key can be nested inside @kbd, and it behaves
> a little differently when nested.

signifying (in addition to previous message), that
1. Texinfo has some software documentation-specific markup elements
2. Those elements can be nested in non-trivial ways, similar to Org's
org-element-object-restrictions, the that nesting can affect formatted
export (again, similar to Org).

With regards to Org syntax, I do not think that we must include all the
possible texinfo elements into Org standard.
@dfn, @key, and @var constructs are extremely specific to software
documentation and have no sense to maintain as a part of general-purpose
markup syntax.

However, what we can do is to allow extending Org syntax to support such
elements. We do support custom syntax elements already (or are
discussing such support):

We have the following, potentially customizeable syntax elements:
- Org links (extensible via org-link-set-parameters)
- Special blocks (de-facto extensible in export backends; also,
  https://github.com/alhassy/org-special-block-extras/);
  
https://list.orgmode.org/87edzqv4ha.fsf@localhost/T/#m6b95119faa65645fd1c32b0e17b6440f73ecd3af
- [FR] Inline special blocks idea being discussed in
  https://orgmode.org/list/87a6b8pbhg@posteo.net

The links are somewhat limited wrt nesting: links cannot be nested
inside links thus limiting their usefulness as custom markup. Hence, we
may need to look more closely into the idea of inline special blocks
(discuss it in https://orgmode.org/list/87a6b8pbhg@posteo.net).

Special blocks already support custom :type, but lack convenient Elisp
interface like org-link-set-parameters. (let's keep this part in
https://list.orgmode.org/87edzqv4ha.fsf@localhost/T/#m6b95119faa65645fd1c32b0e17b6440f73ecd3af)

I'd like to keep discussion on the specifics of customizeable Org syntax
in the relevant threads.

In here, I'd like to hear feedback on possible additional
incompatibilities between texinfo and Org. Is there anything (not
covered by the above list) that is present in texinfo, but impossible in
Org?

For starters, Org does not have a full support for generating index
(apart from ox-texinfo and ox-publish). Though see
https://github.com/tecosaur/org-glossary

Best,
Ihor



Re: About 'inline special blocks'

2022-06-17 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Vestibulum convallis, lorem blockname_[<>]{text} a tempus semper, dui
> dui euismod elit, vitae placerat urna tortor vitae lacus.

This thread is possible relevant to the ongoing emacs-devel discussion
where RMS requested support/integration of Org and texinfo.

Richard Stallman wrote:
https://yhetil.org/emacs-devel/e1o1cee-0006cj...@fencepost.gnu.org

> I don't know for certain that every possible nesting "does the right
> thing".  I do know that @var{} is used inside many other constructs.
> By contrast, @dfn{} would not be nested inside or around other
> contructs very much.  @key can be nested inside @kbd, and it behaves
> a little differently when nested.

He mentioned an important point that could make the idea of inline
special blocks more appealing.

While arbitrary markup can indeed be introduced using our current link
syntax, there is one important limitation of links:

 *** link description cannot contain other links ***

If one seriously tries to extend Org syntax with custom markup elements,
nested markup will not be possible. And we do not want to change Org
links to allow other links inside.

Inline special blocks may not have such limitation if we allow special
blocks to be nested.

Best,
Ihor