Lesser blocks allowing unescaped lines

2023-09-29 Thread Tom Alexander
This happens in worg at: 
https://git.sr.ht/~bzg/worg/tree/ba6cda890f200d428a5d68e819eef15b5306055f/exporters/ox-docstrings.org#L2490

The documentation for lesser blocks[1] states:
> Lines beginning with an asterisk or `#+` must be quoted by a comma (`,*`, 
> `,#+`).

However, the following test document parses as a lesser block despite 
containing a line starting with an unescaped #+:
```
#+CATEGORY: foo
#+begin_src text
#+CATEGORY: bar
#+end_src
```

which parses as:
```
(org-data
(:standard-properties
  [1 1 1 60 60 0 nil org-data nil nil nil 3 60 nil # nil nil 
nil]
  :path nil :CATEGORY "foo")
(section
  (:standard-properties
   [1 1 1 60 60 0 nil first-section nil nil nil 1 60 nil # 
nil nil #0])
  (keyword
   (:standard-properties
[1 1 nil nil 17 0 nil top-comment nil nil nil nil nil nil # nil nil #1]
:key "CATEGORY" :value "foo"))
  (src-block
   (:standard-properties
[17 17 nil nil 60 0 nil nil nil nil nil nil nil nil # nil 
nil #1]
:language "text" :switches nil :parameters nil :number-lines nil 
:preserve-indent nil :retain-labels t :use-labels t :label-fmt nil :value 
"#+CATEGORY: bar\n"
```

whereas I would expect this to be
```
(section
  (keyword :key "CATEGORY" :value "foo")
  (paragraph "#+begin_src text")
  (keyword :key "CATEGORY" :value "bar")
  (paragraph "#+end_src")
)
```

This test document shows that lines with an unescaped "*" do break up the 
lesser block:
```
* foo
#+begin_src text
* bar
#+end_src
```


[1] https://orgmode.org/worg/org-syntax.html#Blocks

--
Tom Alexander
pgp: https://fizz.buzz/pgp.asc



Re: Keeping org-id entries updated with buffer position changes

2023-09-29 Thread Sebastian Wålinder
I found the issue.

Apologies to anyone confused by this, it's not an issue with `org`, but rather 
with `org-roam`.

I assumed it wouldn't run any code when simply being loaded, but it turns out 
that `org-roam` was adding itself as a link follow parameter for ID links when 
loaded by Emacs.

Removing it solves my issue:

(org-link-set-parameters "id" :follow #'org-roam-id-open)

Thanks!

Sebastian Wålinder  writes:

> I have been reading through the code, and it appears that org-id doesn't 
> store the actual positions of ids within all files.
>
> It's instead fetched every time the link is accessed. There must be something 
> strange going on with the org cache causing this issue.
>
> Sebastian Wålinder  writes:
>
>> Hello!
>>
>> I often use org-id to create persistent links to headings like this:
>>
>> * Foo
>> :PROPERTIES:
>> :ID:   BAR
>> :END:
>>
>> [[BAR][Link]]
>>
>> However, after inserting a line above foo, following the link BAR will take 
>> me to the wrong line, because the org-id database hasn't been updated with 
>> the headline's new position.
>>
>> Running `org-id-update-id-locations` fixes this issue, but takes forever to 
>> run because it goes through all my org files.
>>
>> How would I keep these links updated when I make frequent edits? Is there a 
>> function that updates the IDs in a single file only? If so, I could advice 
>> the open link function to run it first and update all the positions quickly 
>> before following the link.
>>
>> Thoughts?
>>
>> Thanks!



COUNTER-SET for alphabetical ordered lists ignored for utf-8 exporter

2023-09-29 Thread Tom Alexander
It seems that COUNTER-SET[1] is not being honored when exporting to utf-8 for 
alphabetical lists even though it is honored for numeric lists. When exporting 
to html, COUNTER-SET is honored for both.

Test document:
```
# An ordered list starting at 3
1. [@3] foo


# An ordered list starting at 1
m. bar


# An ordered list starting at 11
m. [@k] baz
```

Launching emacs with: (Setting org-list-allow-alphabetical is necessary or else 
the alphabetical lists will become paragraphs)
```
emacs -q --eval '(setq org-list-allow-alphabetical t)' /tmp/test.org
```

When exporting to html you get (edited to remove whitespace for clarity):
```
foo
bar
baz
```

But when exporting to utf-8 you get: (whitespace removed again)
```
3. foo
m. bar
m. baz
```

Whereas I would expect:  (whitespace removed again)
```
3. foo
m. bar
k. baz
```

On a slightly related note: it seems the COUNTER-SET[1] allows single-letter 
values even when org-list-allow-alphabetical is nil. I don't think that is 
going to hurt anyone but I figured I should mention it in case its a bug (test 
doc: `1. [@k] foo` is a plain list starting at 11 even when 
org-list-allow-alphabetical is nil).

[1] https://orgmode.org/worg/org-syntax.html#Items

Emacs 29.1, Org-mode version 9.7-pre (release_9.6.8-781-gc70354)

--
Tom Alexander
pgp: https://fizz.buzz/pgp.asc



[BUG] wrong-type-argument integer-or-marker-p nil [9.6.8 ( @ /Users/dirkjimtheis/.emacs.d/elpa/org-9.6.8/)]

2023-09-29 Thread Dirk Oliver Theis
When I re-loaded my org file after killing the buffer (because Org got
confused and behaved erratically), this appeared:

⛔ Warning (org-element-cache): org-element--cache: Org parser error in
rydberg-jl.org::32516. Resetting.
 The error was: (wrong-type-argument integer-or-marker-p nil)
 Backtrace:
nil
 Please report this to Org mode mailing list (M-x org-submit-bug-report).


Emacs  : GNU Emacs 29.1 (build 1, aarch64-apple-darwin21.6.0, NS
appkit-2113.60 Version 12.6.6 (Build 21G646))
 of 2023-08-17
Package: Org mode version 9.6.8 ( @
/Users/dirkjimtheis/.emacs.d/elpa/org-9.6.8/)

current state:
==
(setq
 org-link-elisp-confirm-function 'yes-or-no-p
 org-bibtex-headline-format-function #[257 "\300 \236A\207" [:title] 3
"\n\n(fn ENTRY)"]
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 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-archive-hook '(org-attach-archive-delete-maybe)
 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-cycle-display-inline-images)
 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]
 #[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 '((C . t) (julia . t) (latex . t))
 org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-confirm-shell-link-function 'yes-or-no-p
 org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-tangle-lang-exts '(("latex" . "tex") ("julia" . "jl") ("D"
. "d") ("C++" . "cpp") ("emacs-lisp" . "el")
  ("elisp" . "el"))
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-structure-template-alist '(("a" . "EXPORT ascii") ("c" .
"CENTER") ("C" . "COMMENT") ("e" . "EXAMPLE")
("E" . "EXPORT") ("h" . "EXPORT html")
("l" . "EXPORT latex") ("q" . "QUOTE")
("s" . "SRC") ("v" . "VERSE"))
 org-speed-command-hook '(org-speed-command-activate
org-babel-speed-command-activate)
 org-html-format-inlinetask-function
'org-html-format-inlinetask-default-function
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-fold-core-isearch-open-function 'org-fold--isearch-reveal
 org-latex-format-inlinetask-function
'org-latex-format-inlinetask-default-function
 org-persist-before-write-hook '(org-element--cache-persist-before-write)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-link-shell-confirm-function 'yes-or-no-p
 org-babel-pre-tangle-hook '(save-buffer)
 org-agenda-loop-over-headlines-in-active-region nil
 org-occur-hook '(org-first-headline-recenter)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-link-parameters '(("attachment" :follow org-attach-follow
:complete org-attach-complete-link)
   ("id" :follow org-id-open) ("eww" :follow
org-eww-open :store org-eww-store-link)
   ("rmail" :follow org-rmail-open :store
org-rmail-store-link)
   ("mhe" :follow org-mhe-open :store org-mhe-store-link)
   ("irc" :follow org-irc-visit :store
org-irc-store-link :export org-irc-export)
   ("info" :follow org-info-open :export
org-info-export :store org-info-store-link
:insert-description org-info-description-as-command)
   ("gnus" :follow org-gnus-open :store org-gnus-store-link)
   ("docview" :follow org-docview-open :export
org-docview-export :store org-docview-store-link)
   ("bibtex" :follow org-bibtex-open :store
org-bibtex-store-link)
   ("bbdb" :follow org-bbdb-open :export
org-bbdb-export :complete org-bbdb-complete-link
:store org-bbdb-store-link)
   ("w3m" 

[BUG] backtrace nil error bug [9.7 (9.7-??-e90a8a69a @ /Users/fixerfixingfix/.emacs.d/.local/straight/build-30.0.50/org/)]

2023-09-29 Thread carlos monteiro



Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.




Emacs  : GNU Emacs 30.0.50 (build 1, aarch64-apple-darwin23.1.0, NS 
appkit-2485.20 Version 14.1 (Build 23B5046f))
of 2023-09-29
Package: Org mode version 9.7 (9.7-??-e90a8a69a @ 
/Users/fixerfixingfix/.emacs.d/.local/straight/build-30.0.50/org/)

current state:
==
(setq
org-link-elisp-confirm-function nil
org-directory "~/Documents/Org"
org-cite-insert-processor 'citar
org-after-refile-insert-hook '(save-buffer)
org-indirect-buffer-display 'current-window
org-bibtex-headline-format-function 'org-bibtex-headline-format-default
org-log-done 'time
org-load-hook '(+org-init-org-directory-h +org-init-appearance-h
 +org-init-agenda-h +org-init-attachments-h +org-init-babel-h
 +org-init-babel-lazy-loader-h +org-init-capture-defaults-h
 +org-init-capture-frame-h +org-init-custom-links-h
 +org-init-export-h +org-init-habit-h +org-init-hacks-h
 +org-init-keybinds-h +org-init-popup-rules-h
 +org-init-smartparens-h)
org-startup-folded nil
org-babel-after-execute-hook '(+org-redisplay-inline-images-in-babel-result-h)
org-link-abbrev-alist '(("doomdir" . "/Users/fixerfixingfix/.doom.d/%s")
 ("emacsdir" . "/Users/fixerfixingfix/.emacs.d/%s")
 ("doom-repo" .
  "https://github.com/doomemacs/doomemacs/%s;)
 ("wolfram" . "https://wolframalpha.com/input/?i=%s;)
 ("wikipedia" . "https://en.wikipedia.org/wiki/%s;)
 ("duckduckgo" . "https://duckduckgo.com/?q=%s;)
 ("gmap" . "https://maps.google.com/maps?q=%s;)
 ("gimages" . "https://google.com/images?q=%s;)
 ("google" . "https://google.com/search?q=;)
 ("youtube" . "https://youtube.com/watch?v=%s;)
 ("github" . "https://github.com/%s;))
org-agenda-files '("/Users/fixerfixingfix/Documents/Org/journal.org"
"/Users/fixerfixingfix/Documents/Org/Collections.org"
"/Users/fixerfixingfix/Documents/Org/README.org"
"/Users/fixerfixingfix/Documents/Org/notes.org"
"/Users/fixerfixingfix/Documents/Org/projects.org"
"/Users/fixerfixingfix/Documents/Org/todo.org")
org-capture-templates '(("t" "Personal todo" entry
  (file+headline +org-capture-todo-file "Inbox")
  "* [ ] %?\n%i\n%a" :prepend t)
 ("n" "Personal notes" entry
  (file+headline +org-capture-notes-file "Inbox")
  "* %u %?\n%i\n%a" :prepend t)
 ("j" "Journal" entry
  (file+olp+datetree +org-capture-journal-file)
  "* %U %?\n%i\n%a" :prepend t)
 ("p" "Templates for projects")
 ("pt" "Project-local todo" entry
  (file+headline +org-capture-project-todo-file "Inbox")
  "* TODO %?\n%i\n%a" :prepend t)
 ("pn" "Project-local notes" entry
  (file+headline +org-capture-project-notes-file 
"Inbox")
  "* %U %?\n%i\n%a" :prepend t)
 ("pc" "Project-local changelog" entry
  (file+headline +org-capture-project-changelog-file
   "Unreleased")
  "* %U %?\n%i\n%a" :prepend t)
 ("o" "Centralized templates for projects")
 ("ot" "Project todo" entry
  #'+org-capture-central-project-todo-file
  "* TODO %?\n %i\n %a" :heading "Tasks" :prepend nil)
 ("on" "Project notes" entry
  #'+org-capture-central-project-notes-file
  "* %U %?\n %i\n %a" :heading "Notes" :prepend t)
 ("oc" "Project changelog" entry
  #'+org-capture-central-project-changelog-file
  "* %U %?\n %i\n %a" :heading "Changelog" :prepend t)
 )
org-persist-after-read-hook '(org-element--cache-persist-after-read)
org-refile-targets '((nil :maxlevel . 3) (org-agenda-files :maxlevel . 3))
org-export-before-parsing-hook '(org-attach-expand-links)
org-cycle-tab-first-hook '(+org-yas-expand-maybe-h +org-indent-maybe-h
org-babel-hide-result-toggle-maybe
 

Re: Keeping org-id entries updated with buffer position changes

2023-09-29 Thread Sebastian Wålinder
I have been reading through the code, and it appears that org-id doesn't store 
the actual positions of ids within all files.

It's instead fetched every time the link is accessed. There must be something 
strange going on with the org cache causing this issue.

Sebastian Wålinder  writes:

> Hello!
>
> I often use org-id to create persistent links to headings like this:
>
> * Foo
> :PROPERTIES:
> :ID:   BAR
> :END:
>
> [[BAR][Link]]
>
> However, after inserting a line above foo, following the link BAR will take 
> me to the wrong line, because the org-id database hasn't been updated with 
> the headline's new position.
>
> Running `org-id-update-id-locations` fixes this issue, but takes forever to 
> run because it goes through all my org files.
>
> How would I keep these links updated when I make frequent edits? Is there a 
> function that updates the IDs in a single file only? If so, I could advice 
> the open link function to run it first and update all the positions quickly 
> before following the link.
>
> Thoughts?
>
> Thanks!



Re: Subscript with parenthesis

2023-09-29 Thread Tom Alexander
> Not true. I tried
>
> b^(*asd*) and bold inside superscript does get parsed.

Ah thanks for double-checking! You're right, that is getting parsed. Not sure 
what test document I was using to make me think objects didn't work inside the 
parenthesis.

--
Tom Alexander
pgp: https://fizz.buzz/pgp.asc



Re: [PATCH] Add backslash to list of POST characters for text markup

2023-09-29 Thread Tom Alexander
Thanks!

--
Tom Alexander
pgp: https://fizz.buzz/pgp.asc

On Fri, Sep 22, 2023, at 5:29 AM, Ihor Radchenko wrote:
> "Tom Alexander"  writes:
>
>> Backslash appears to be supported. To test I used the following test 
>> document:
>> ```
>> foo ~bar~\& baz
>> ```
>
> Thanks!
> You are right.
> Applied, onto master, with minor amendments to the commit message.
> https://git.sr.ht/~bzg/worg/commit/ba6cda89
>
> -- 
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 



Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-09-29 Thread Liu Hui
Hi,

在 2023/9/27 16:29, Visuwesh 写道:

> +*** Files and images can be attached by dropping onto Emacs
> +
> +Attachment method other than ~org-attach-method~ for dropped files can
> +be specified using ~org-dnd-default-attach-method~.

> +(defcustom org-dnd-default-attach-method nil
> +  "Default attach method to use when DND action is unspecified.
> +This attach method is used when the DND action is `private'.
> +This is also used when `org-yank-image-save-type' is nil.
> +When nil, use `org-attach-method'."

I think the dnd feature should not be restricted to org-attach. I have
often used it for opening file and inserting file link. How about
supporting them and adding a new variable, such as
org-dnd-default-method?

> +   ('ask (caddr (org-mks
> + '(("c" "Copy" cp)
> +   ("m" "Move" mv)
> +   ("l" "Hard link" ln)
> +   ("s" "Symbolic link" lns))
> + "How to attach?"
> + "Attach using method")))

It is better to pop up a menu that allows users to proceed with the
mouse, e.g. that in `dired-dnd-do-ask-action'. Options like
'open'/'file link' could be added too.

Thanks for your work.



Re: Suggestions for Text-To-Speech (TTS) from Org sources?

2023-09-29 Thread Jens Lechtenboerger
On 2023-09-28, Jude DaShiell wrote:

> espeak-ng likes to have speechdispatcher on a system

Does this improve the quality of the generated speech?

> and festival likes to have language-specific voices on it to use.

Indeed.  Which one(s) do you recommend?  I tried
voice_cmu_us_slt_arctic_hts and the mbrola us voices.

> fenrir which you didn't mention runs in user land and has no kernel
> dependencies.

I briefly tried that but failed.  Also, I was under the impression
that fenrir does produce speech by itself but relies on some TTS
implementation like espeak.  Is that wrong?

Best wishes
Jens


smime.p7s
Description: S/MIME cryptographic signature