Re: [BUG] "args out of range" on link heading completion [9.5 (9.5-gd361c7 @ /Users/carlos/.emacs.d/straight/build/org/)]

2021-10-20 Thread Ihor Radchenko
Carlos Pita  writes:

> If you can't still reproduce it let me know and I will debug the issue.

I can reproduce on latest main.

Confirmed.

Best,
Ihor



Re: [PATCH] {the CORRECT patch}

2021-10-20 Thread Christopher M. Miles


Max Nikulin  writes:

> On 20/10/2021 16:58, Christopher M. Miles wrote:
>> Just update the email subject contains [PATCH]
>> "Christopher M. Miles"  writes:
>> Mostly Emacs versions under macOS does not have compiled with DBus.
>> Or still don't work even compiled with DBus even macOS installed
>> dbus with homebrew. I'm under this situation and problem. Spend lot
>> of time have not solution to solve this problem. So I give up on
>> Emacs DBus support under macOS to make "notifications.el" work.
>> I added patch on org-notify.el to make it invoke AppleScript command
>> to display notifications. Hope it help some macOS users.
>> [5. text/x-patch;
>> 0001-org-attach.el-add-a-new-command-to-archive-web-page.patch]… 
>
> Christopher, the patch you attached is related to org-attach and e.g. 
> handling of monolith links.
> Does it really solve some notification problem?
>
> Bastien committed your earlier patch for notification through applescript 
> (that does not protect
> backslashes in notification text):
>
> b80b0a517de7be94c70d3d6537899a94ac046fab
> org-clock.el: Make org-notify support macOS notification
>
> I would expect that dbus-related options has lower priority than applescript.

Sorry, I misplaced the patch attachment file. I will attach the correct one. 
Sorry about this.
Because org-contrib has separated from org-mode. So I go into wrong directory.

This is a patch for org-contrib/lisp/org-notify.el. Thanks for reviewing.


<#secure method=pgpmime mode=sign>

>From 132a802d38c71569d6112ba933310af5318448b9 Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Wed, 20 Oct 2021 17:19:14 +0800
Subject: [PATCH] org-notify.el: Make org-notify-action-notify support macOS
 without DBus

* lisp/org-notify.el (org-notify-action-notify): Use Emacs to invoke
AppleScript code to send notification when DBus not available under macOS.
---
 lisp/org-notify.el | 34 ++
 1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/lisp/org-notify.el b/lisp/org-notify.el
index 7f9a814..e8f8cf6 100644
--- a/lisp/org-notify.el
+++ b/lisp/org-notify.el
@@ -379,16 +379,27 @@ org-notify window.  Mostly copied from `appt-select-lowest-window'."
 (defun org-notify-action-notify (plist)
   "Pop up a notification window."
   (require 'notifications)
-  (let* ((duration (plist-get plist :duration))
- (id (notifications-notify
-  :title (plist-get plist :heading)
-  :body  (org-notify-body-text plist)
-  :timeout   (if duration (* duration 1000))
-  :urgency   (plist-get plist :urgency)
-  :actions   org-notify-actions
-  :on-action 'org-notify-on-action-notify)))
-(setq org-notify-on-action-map
-  (plist-put org-notify-on-action-map id plist
+  (cond ((and (featurep 'dbus) (boundp 'dbusbind))
+ (let* ((duration (plist-get plist :duration))
+(id (notifications-notify
+ :title (plist-get plist :heading)
+ :body  (org-notify-body-text plist)
+ :timeout   (if duration (* duration 1000))
+ :urgency   (plist-get plist :urgency)
+ :actions   org-notify-actions
+ :on-action 'org-notify-on-action-notify)))
+   (setq org-notify-on-action-map
+ (plist-put org-notify-on-action-map id plist
+((fboundp 'ns-do-applescript)
+ (ns-do-applescript
+  (format "display notification \"%s\" with title \"%s\" sound name \"Frog\""
+  (replace-regexp-in-string "\"" "#" (org-notify-body-text plist))
+  (replace-regexp-in-string "\"" "#" (plist-get plist :heading
+ (when org-notify-audible
+   ;; TODO make audio speaking async. By default `ns-do-applescript' will block Emacs.
+   (ns-do-applescript
+(format "say \"%s\""
+(replace-regexp-in-string "\"" "#" (plist-get plist :heading
 
 (defun org-notify-action-notify/window (plist)
   "For a graphics display, pop up a notification window, for a text
@@ -398,8 +409,7 @@ terminal an emacs window."
 (org-notify-action-window plist)))
 
 ;;; Provide a minimal default setup.
-(org-notify-add 'default '(:time "1h" :actions -notify/window
- :period "2m" :duration 60))
+(org-notify-add 'default '(:time "1h" :actions -notify/window :period "2m" :duration 60))
 
 (provide 'org-notify)
 
-- 
2.30.1 (Apple Git-130)

-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: [BUG] "args out of range" on link heading completion [9.5 (9.5-gd361c7 @ /Users/carlos/.emacs.d/straight/build/org/)]

2021-10-20 Thread Carlos Pita
Hi Greg,

> fwiw, using
>
> : emacs -Q -L ~/.emacs.d/straight/build/org foo.org

It's exactly the same. To be more precise, this is what I did:

1. open -na emacs --args -Q -L ~/.emacs.d/straight/build/org foo.org

2. C-x C-f /tmp/test.org (a new file)

3. Type "* heading" in the first line

4. Type "[[]]" in the second line

5. Go into the brackets an type "*head"

6. Press  or C-M-i.

This is the message I get:

completion--some: Args out of range: #("*hea" 0 1 (fontified t
help-echo "LINK: *head" htmlize-link (:uri "*head") rear-nonsticky
(mouse-face highlight keymap invisible intangible help-echo
org-linked-text htmlize-link) face org-link ...) 1 2 (fontified t
help-echo "LINK: *head" htmlize-link (:uri "*head") rear-nonsticky
(mouse-face highlight keymap invisible intangible help-echo
org-linked-text htmlize-link) face org-link ...) 2 3 (fontified t
help-echo "LINK: *head" htmlize-link (:uri "*head") rear-nonsticky
(mouse-face highlight keymap invisible intangible help-echo
org-linked-text htmlize-link) face org-link ...) 3 4 (fontified t
help-echo "LINK: *head" htmlize-link (:uri "*head") rear-nonsticky
(mouse-face highlight keymap invisible intangible help-echo
org-linked-text htmlize-link) face org-link ...)),

Interestingly enough the message includes the string "*hea" as well as
the string "*head".

If you can't still reproduce it let me know and I will debug the issue.

> ps -- the org-version was
> : Org mode version 9.5 (9.5-gdc154f @
> /home/minshall/.emacs.d/straight/build/org/)

What are these? Seemingly not git revisions. Can I checkout that version
somehow? If not, pass me your git revision and I will rerun my recipe
there.

Best regards,
Carlos



Re: [BUG] "args out of range" on link heading completion [9.5 (9.5-gd361c7 @ /Users/carlos/.emacs.d/straight/build/org/)]

2021-10-20 Thread Greg Minshall
Carlos,

fwiw, using

: emacs -Q -L ~/.emacs.d/straight/build/org foo.org

on my system, i don't seem to be able to recreate this problem.

cheers, Greg

ps -- the org-version was
: Org mode version 9.5 (9.5-gdc154f @ 
/home/minshall/.emacs.d/straight/build/org/)



Re: org-persist

2021-10-20 Thread Ihor Radchenko
Samuel Wales  writes:

> On 10/19/21, Ihor Radchenko  wrote:
>> enabled all the time in future.  If you have specific reasons to avoid
>> org-element-cache, may you share them?
>
> fwiw, long ago, i disabled org element cache due to buffer corruption.
> perhaps that has been fixed and tested.

I hope I fixed it. At least on my side. Need other users to test.
Currently, cache even self-verifies itself to double check corruption.

> also i presume this is all on main not bugfix [i haven't upgraded
> maint yet; first thing i will do is try the archiving improvement].

It is indeed not on bugfix. Just on main.

Best,
Ihor



pretty basic upgrade questions

2021-10-20 Thread Samuel Wales
haven't upgraded from maint.  have changes that automatically rebase
on top of upstream org.  currently run make oldorg.

is git clone best, to clean up tags etc.?  then i use git branch
bugfix, then kinda try to figure out rebasing, and use make, not
oldorg?

also, i'm not sure if the manual's make autoloads is necessary if you
do make.  maybe that could be clarified in the manual?

also, the manual says you can "create a local configuration with ‘make
config", but doesn't specify.  what is a configuration?



Clarify bug report requirements wrt mailing list subscription

2021-10-20 Thread Carlos Pita
Hi all,

I find the instructions about bug reporting in [1] lacking a heads-up
that subscription to the mailing list is a (soft?) prerequisite. It's
true that it links to [2] which states:

You can subscribe to the list from this web page. If you are not a
member of the mailing list, your mail will be passed to the list
after a moderator has approved

but also it's true [3] states:

The Org mailing list is a members only mailing list to prevent
spam. Membership is freely available and only requires that you
subscribe to the list and confirm your email address.

Moreover, that it seemingly is a soft requirement implies that I'm not
getting any feedback for some time about the status of my report.

All this ended up in that, after some years, I reported a bug again but
from an alternative address following the instructions in [1], but
without reading [2], and since hours later I wasn't seeing my report in
the list I checked [3], subscribe to the list and resent the report,
which probably will arrive twice now, except that a moderator catches
the dup.

I reckon that I could have been more careful regarding [2] but still the
instructions in [1] are somewhat misleading and I would say that [3]
just contradicts [2], whatever is true.

What do you think of:

- Adding some brief mention to subscription in [1].

- Resolve the apparent contradiction about subscription being a
  prerequisite or not between [2] and [3].

Best regards,
Carlos

---

[1] https://orgmode.org/worg/org-issues.html

[2] https://orgmode.org/org.html#Feedback

[3] https://orgmode.org/worg/org-mailing-list.html



[BUG] "args out of range" on link heading completion [9.5 (9.5-gd361c7 @ /Users/carlos/.emacs.d/straight/build/org/)]

2021-10-20 Thread Carlos Pita
Hi,

when I try to autocomplete a heading inside a link I get:

completion--some: Args out of range: #("*hea" 0 1 (fontified t
help-echo "LINK: *head" htmlize-link (:uri "*head") rear-nonsticky
(mouse-face highlight keymap invisible intangible help-echo
org-linked-text htmlize-link) face org-link ...) 1 2 (fontified t
help-echo "LINK: *head" htmlize-link (:uri "*head") rear-nonsticky
(mouse-face highlight keymap invisible intangible help-echo
org-linked-text htmlize-link) face org-link ...) 2 3 (fontified t
help-echo "LINK: *head" htmlize-link (:uri "*head") rear-nonsticky
(mouse-face highlight keymap invisible intangible help-echo
org-linked-text htmlize-link) face org-link ...) 3 4 (fontified t
help-echo "LINK: *head" htmlize-link (:uri "*head") rear-nonsticky
(mouse-face highlight keymap invisible intangible help-echo
org-linked-text htmlize-link) face org-link ...)), 0, 5


To reproduce:

1. Create org file with a heading:

* heading

2. Start typing a link to that heading and press  to autocomplete:

[[*head]]

Best regards,
Carlos

---

Emacs  : GNU Emacs 28.0.60 (build 3, x86_64-apple-darwin20.6.0, NS
appkit-2022.60 Version 11.6 (Build 20G165))
 of 2021-10-18
Package: Org mode version 9.5 (9.5-gd361c7 @
/Users/carlos/.emacs.d/straight/build/org/)

current state:
==
(setq
 org-link-elisp-confirm-function 'yes-or-no-p
 org-directory "~/Documents"
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3
"\n\n(fn ENTRY)"]
 org-babel-after-execute-hook '(org-redisplay-inline-images)
 org-agenda-files '("/tmp/test.org")
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-default-notes-file "~/Documents/inbox.org"
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees
org-cycle-hide-drawers org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-font-lock-set-keywords-hook '(doom-themes-enable-org-fontification)
 org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook
change-major-mode-hook org-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-confirm-shell-link-function 'yes-or-no-p
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer doom-modeline-set-org-src-modeline)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-todo-keywords '((sequence "TODO" "NEXT" "|" "DONE"))
 org-speed-command-hook '(org-speed-command-activate
org-babel-speed-command-activate)
 org-preview-latex-default-process 'dvisvgm
 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)
   ("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" :store org-w3m-store-link) ("doi"
:follow org-link-doi-open :export org-link-doi-export) ("file+sys")
   ("file+emacs") ("shell" :follow org-link--open-shell)
   ("news" :follow #[514 "\301\300\302Q\"\207"
["news" browse-url ":"] 6 "\n\n(fn URL ARG)"])
   ("mailto" :follow #[514 "\301\300\302Q\"\207"
["mailto" browse-url ":"] 6 "\n\n(fn URL ARG)"])
   ("https" :follow #[514 "\301\300\302Q\"\207"
["https" browse-url ":"] 6 "\n\n(fn URL ARG)"])
   ("http" :follow #[514 "\301\300\302Q\"\207"
["http" browse-url ":"] 6 "\n\n(fn URL ARG)"])
   ("ftp" :follow #[514 "\301\300\302Q\"\207"
["ftp" browse-url ":"] 6 "\n\n(fn URL ARG)"])
   ("help" :follow org-lin

Re: org-persist

2021-10-20 Thread Samuel Wales
On 10/19/21, Ihor Radchenko  wrote:
> enabled all the time in future.  If you have specific reasons to avoid
> org-element-cache, may you share them?

fwiw, long ago, i disabled org element cache due to buffer corruption.
perhaps that has been fixed and tested.

also i presume this is all on main not bugfix [i haven't upgraded
maint yet; first thing i will do is try the archiving improvement].



Re: org-persist - bug report

2021-10-20 Thread Colin Baxter 😺
> Ihor Radchenko  writes:

> Colin Baxter 😺  writes:
>> >> I just upgraded my org-mode to the latest version in >>
>> git. Whenever I visited a certain org file, my Emacs became >>
>> unusable. Any attempt to use M-x (execute-extended-command) >>
>> resulted in max-specpdl-size errors as did using C-x C-c to exit
>> >> Emacs. Some but not all of the errors mentioned "Error during
>> >> file deserialization". After an hour's debugging, I tracked
>> this >> down to org-persist. Deleting "~/.cache/org-persist" made
>> the >> problem go away.
>> 
>> I just stumbled on this error myself. The culprit was a agenda
>> file - I mean, an org-mode file called by org-agenda. I'll pursue
>> further when I've got time (not today!)

> If you see the error again, can you also try with the following?

> (setq org-element--cache-self-verify 'backtrace)
> (setq org-element--cache-self-verify-frequency 1)

I set the above in my ~/.emacs

> If a warning appears, backtrace could be helpful. If not, it
> should be something to do with org-element-cache-map.

The max-specpdl-size error has happened again when I tried to add a note
to an agenda item. Emacs hung and had to be killed. The debugger buffer
was empty and the only other information given was the message:

mapc: Lisp nesting exceeds `max-lisp-eval-depth'

I hope this helps.

Best wishes,

Colin.




Re: org-ref 2 vs org-ref 3

2021-10-20 Thread Joseph Vidal-Rosset
Many thanks John. It is very helpful.

All the best,

Jo

Envoyé depuis ProtonMail mobile

 Message d'origine 
Le 20 oct. 2021 à 14:48, John Kitchin a écrit :

> All the breaking changes are documented at 
> https://github.com/jkitchin/org-ref/#breaking-changes-in-version-3.
>
> You can find configuration details at 
> https://github.com/jkitchin/org-ref/#configuration.
>
> On Wed, Oct 20, 2021 at 2:59 AM Joseph Vidal-Rosset  
> wrote:
>
>> Dear John,
>>
>> I upgraded org-ref to get org-ref 3 and I met the following difficulties:
>>
>> - my shortcut to get the list of my bib file did not work, and I have to
>> use the emacs menu,
>
> If you mean keyboard shortcuts (like C-c ]), you should define these in your 
> init files as described in the configuration above. org-ref does not do this 
> automatically anymore.
>
>> - I did not get via org-ref a pdf file of any paper,
>
> I can't help you on this with so little information. is there some error?
>
>> - cite links with the page(s) via "description" show only the page but
>> the reference is hidden,
>
> I consider the syntax of pre/postnote in the description to be deprecated 
> (but still supported). I pushed a fix to show the full links with a 
> description for the version 2 syntax. The preferred way to do pre/post notes 
> now is like:
>
> version 3 syntax (keys are prefixed by &, and prenote is before the key, 
> postnote is after the key.
>
> [[cite:&xiao-2006-size-effec 45]]
>
> [[cite:see &xiao-2006-size-effec 45]]
>
> These export to:
>
> \cite[45]{xiao-2006-size-effec}
>
> \cite[see][45]{xiao-2006-size-effec}
>
> version 2 syntax still works, (the two key differences are there is no & 
> prefixing the citation key, and the pre/post note is in the description.
>
> These citations
>
> [[cite:xiao-2006-size-effec][45]]
>
> [[cite:xiao-2006-size-effec][see::45]]
>
> export to:
>
> version 2 syntax
>
> \cite[45]{xiao-2006-size-effec}
>
> \cite[see][45]{xiao-2006-size-effec}
>
>> at the moment, I downgraded to org-ref 2 and everything works fine.
>>
>> I imagine that all is in the documentation you wrote to solve these
>> problems, but I wanted to point out them, in order to solve them easily
>> and to contribute to the improvement of this terrific tool you gave to
>> us. I do not imagine now writing without org-ref.
>>
>> Thanks !
>>
>> Jo.

Re: the tangled web of org-cite, selectrum, completing-read, ...

2021-10-20 Thread Bruce D'Arcus
On Tue, Oct 19, 2021 at 4:09 PM Eric S Fraga  wrote:
>
> On Tuesday, 19 Oct 2021 at 22:04, Nicolas Goaziou wrote:
> >>   1. set =org-cite-basic-author-column= to a larger number
> >
> > You can ignore this step, which is useful (but is not as you report)
> > only when using `basic' insert processor. Here, you're using a different
> > insert processor.
>
> yes, I kind of thought this might be the case in the end (but wasn't
> sure)!  As I don't need to use the basic insert processor any longer, I
> have deleted this line from my configuration.

BTW, per the bibtex-actions README, there are a few other small
packages you want to install for the best experience.

https://github.com/bdarcus/bibtex-actions#installation

For example, consult, in addition to all the convenience commands it
offers, also includes consult-completing-read-multiple, which replaces
default completing-read-multiple with a UI that is much better suited
to these long candidate strings.

Bruce



Re: Fancy underlines in Org to LaTeX

2021-10-20 Thread Eric S Fraga
Dear Juan,

although I am unlikely to need these special underline capabilities,
thank you for this.  I have used the ~soul~ package in the past for
highlighting, adding @...@ as an emphasis character.

In any case, I in particular like how you define a complex LaTeX header
entry using noweb!  Definitely more elegant than prepending manually
~#+LATEX_HEADER~ to every line.

-- 
: Eric S Fraga via Emacs 28.0.60, Org release_9.5-149-g781080
: Latest paper written in org: https://arxiv.org/abs/2106.05096



Re: How to open a link to a folder/file in Finder, not Dired

2021-10-20 Thread Gerardo Moro
It works! Thanks so much!

El mié, 20 oct 2021 a las 19:08, Mark Barton ()
escribió:

>
>
> On Oct 20, 2021, at 1:36 AM, Gerardo Moro  wrote:
>
> I am having the same problem as reported here:
> https://emacs.stackexchange.com/questions/66593/how-to-open-a-link-to-a-folder-file-in-finder-not-dired
>
>
> I copy paste:
>
> I used to be able to create links with open-insert-link pointing to
> folders or files. When I clicked on them, I would be redirected to Finder.
> Lately, they are shown within Dired. How to control this behaviour? When
> I use either [[file:/users/Shared]] or [[file+emacs:/users/Shared]], and
> click on them, I get the dired buffer, not the Finder app.
>
> Thanks!
> G.M.
>
>
> According to the help for org-open-at-point it should work if you give a
> double prefix argument. I tried C-u C-u C-c C-o and it opened a link in
> finder.
>
> I normally prefer dired, but when I need finder, I use Keyboard Maestro to
> associate H-f to bring the finder to focus in a manner specific to the
> current application. So when emacs is the current application, Keyboard
> Maestro will send the following keystrokes to emacs to open finder in the
> directory associated with the current buffer:M-! open .
>
> For the case where other applications other than emacs are the current
> application, I can configure the macro to bring up finder using the various
> application specific menu options to show file in finder. If there are no
> specific configurations for the application, then it just switches to
> finder.
>
> Mark
>


Re: How to open a link to a folder/file in Finder, not Dired

2021-10-20 Thread Mark Barton


> On Oct 20, 2021, at 1:36 AM, Gerardo Moro  wrote:
> 
> I am having the same problem as reported here: 
> https://emacs.stackexchange.com/questions/66593/how-to-open-a-link-to-a-folder-file-in-finder-not-dired
>  
> 
>  
> 
> I copy paste:
> 
> I used to be able to create links with open-insert-link pointing to folders 
> or files. When I clicked on them, I would be redirected to Finder. Lately, 
> they are shown within Dired. How to control this behaviour? When I use either 
> [[file:/users/Shared]] or [[file+emacs:/users/Shared]], and click on them, I 
> get the dired buffer, not the Finder app. 
> 
> Thanks!
> G.M.

According to the help for org-open-at-point it should work if you give a double 
prefix argument. I tried C-u C-u C-c C-o and it opened a link in finder.

I normally prefer dired, but when I need finder, I use Keyboard Maestro to 
associate H-f to bring the finder to focus in a manner specific to the current 
application. So when emacs is the current application, Keyboard Maestro will 
send the following keystrokes to emacs to open finder in the directory 
associated with the current buffer:M-! open .

For the case where other applications other than emacs are the current 
application, I can configure the macro to bring up finder using the various 
application specific menu options to show file in finder. If there are no 
specific configurations for the application, then it just switches to finder.

Mark

Re: [PATCH] Re: Make org-notify support macOS without DBus

2021-10-20 Thread Max Nikulin

On 20/10/2021 16:58, Christopher M. Miles wrote:

Just update the email subject contains [PATCH]

"Christopher M. Miles"  writes:

Mostly Emacs versions under macOS does not have compiled with DBus.
Or still don't work even compiled with DBus even macOS installed
dbus with homebrew. I'm under this situation and problem. Spend lot
of time have not solution to solve this problem. So I give up on
Emacs DBus support under macOS to make "notifications.el" work.

I added patch on org-notify.el to make it invoke AppleScript command
to display notifications. Hope it help some macOS users.

[5. text/x-patch;
0001-org-attach.el-add-a-new-command-to-archive-web-page.patch]… 


Christopher, the patch you attached is related to org-attach and e.g. 
handling of monolith links. Does it really solve some notification problem?


Bastien committed your earlier patch for notification through 
applescript (that does not protect backslashes in notification text):


b80b0a517de7be94c70d3d6537899a94ac046fab
org-clock.el: Make org-notify support macOS notification

I would expect that dbus-related options has lower priority than 
applescript.





Fancy underlines in Org to LaTeX

2021-10-20 Thread Juan Manuel Macías
Hi,

A very interesting LaTeX package, soulpos (by Javier Bezos), has
recently been uploaded to CTAN, which allows you to define personalized
underlining styles in a very free way:

https://www.ctan.org/pkg/soulpos

I have tried to adapt its use to Org, so I am attaching a small test
document here. In the preamble I have defined a command \myuline (with
the xparse syntax), with five different values for \uline:

- \myuline the default value, a single underline,

- \myuline[ul1], \myuline[ul2], \myuline[ul3] and \myuline[ul4], four
different underline styles, taken from the examples in the soulpos
documentation.

See this screenshot: https://i.imgur.com/UK6W8sl.png

Best regards,

Juan Manuel

--
--
--
Juan Manuel Macías

https://juanmanuelmacias.com/



soulpos-test.org
Description: Lotus Organizer


Re: org-persist - bug report

2021-10-20 Thread Ihor Radchenko
Colin Baxter 😺  writes:

> >> I just upgraded my org-mode to the latest version in
> >> git. Whenever I visited a certain org file, my Emacs became
> >> unusable. Any attempt to use M-x (execute-extended-command)
> >> resulted in max-specpdl-size errors as did using C-x C-c to exit
> >> Emacs. Some but not all of the errors mentioned "Error during
> >> file deserialization". After an hour's debugging, I tracked this
> >> down to org-persist. Deleting "~/.cache/org-persist" made the
> >> problem go away.
>
> I just stumbled on this error myself. The culprit was a agenda file - I
> mean, an org-mode file called by org-agenda. I'll pursue further when
> I've got time (not today!)

If you see the error again, can you also try with the following?

(setq org-element--cache-self-verify 'backtrace)
(setq org-element--cache-self-verify-frequency 1)

If a warning appears, backtrace could be helpful. If not, it should be
something to do with org-element-cache-map.

Best,
Ihor



Re: org-persist - bug report

2021-10-20 Thread Colin Baxter 😺
> Ihor Radchenko  writes:

> Alastair Burt  writes:
>> Hi there,
>> 
>> I couldn't find an issue-tracking system for org-mode as they
>> have for projects on github. So I'm emailing you directly.

> Thanks! The bug reporting for Org mode is by email. You can send
> email to Org mailing list at emacs-orgmode@gnu.org (also, see "1.4
> Feedback" section of Org manual or https://orgmode.org/ The issue
> tracker is derived from the email and can be found online in
> https://updates.orgmode.org/

> I am CCing this message the mailing list.

>> I just upgraded my org-mode to the latest version in
>> git. Whenever I visited a certain org file, my Emacs became
>> unusable. Any attempt to use M-x (execute-extended-command)
>> resulted in max-specpdl-size errors as did using C-x C-c to exit
>> Emacs. Some but not all of the errors mentioned "Error during
>> file deserialization". After an hour's debugging, I tracked this
>> down to org-persist. Deleting "~/.cache/org-persist" made the
>> problem go away.

I just stumbled on this error myself. The culprit was a agenda file - I
mean, an org-mode file called by org-agenda. I'll pursue further when
I've got time (not today!)

Best wishes,

Colin.



Re: Table of contents position in HTML export

2021-10-20 Thread Ihor Radchenko
Kodi Arfer  writes:

> the table of contents appears before "text before headline", although the 
> manual says "Org normally inserts the table of contents directly before the 
> first headline of the file". So shouldn't it be after "text before headline"? 
> Or is it the manual that's wrong?

Confirmed.

Best,
Ihor



Re: org-ref 2 vs org-ref 3

2021-10-20 Thread John Kitchin
All the breaking changes are documented at
https://github.com/jkitchin/org-ref/#breaking-changes-in-version-3.

You can find configuration details at
https://github.com/jkitchin/org-ref/#configuration.

On Wed, Oct 20, 2021 at 2:59 AM Joseph Vidal-Rosset 
wrote:

>
> Dear John,
>
> I upgraded org-ref to get org-ref 3 and I met the following difficulties:
>
> - my shortcut to get the list of my bib file did not work, and I have to
> use the emacs menu,
>

If you mean keyboard shortcuts (like C-c ]), you should define these in
your init files as described in the configuration above. org-ref does not
do this automatically anymore.


>
> - I did not get  via org-ref  a pdf file of any paper,
>

I can't help you on this with so little information. is there some error?


>
> - cite links with the page(s) via "description" show only the page but
> the reference is hidden,
>

I consider the syntax of pre/postnote in the description to be deprecated
(but still supported). I pushed a fix to show the full links with a
description for the version 2 syntax. The preferred way to do pre/post
notes now is like:

version 3 syntax (keys are prefixed by &, and prenote is before the key,
postnote is after the key.

[[cite:&xiao-2006-size-effec 45]]

[[cite:see &xiao-2006-size-effec 45]]

These export to:

\cite[45]{xiao-2006-size-effec}

\cite[see][45]{xiao-2006-size-effec}

version 2 syntax still works, (the two key differences are there is no &
prefixing the citation key, and the pre/post note is in the description.

These citations

[[cite:xiao-2006-size-effec][45]]

[[cite:xiao-2006-size-effec][see::45]]

export to:

version 2 syntax

\cite[45]{xiao-2006-size-effec}

\cite[see][45]{xiao-2006-size-effec}


> at the moment, I downgraded to org-ref 2 and everything works fine.
>
> I imagine that all is in the documentation you wrote to solve these
> problems, but I wanted to point out them, in order to solve them easily
> and to contribute to the improvement of this terrific tool you gave to
> us. I do not imagine now writing without org-ref.
>
> Thanks !
>
> Jo.
>
>


Re: org-persist

2021-10-20 Thread Ihor Radchenko
Colin Baxter 😺  writes:

> Ok, thanks - that works - I used ~/.emacs.d/org-persist/. It might be
> worth mentioning that the user should not create the
> org-persist-directory himself. I did this originally (mkdir
> ~/.emacs.d/org-persist , touch ~/.emacs.d/org-persist/index )
> and got various parsing error messages. Everything worked fine after I
> deleted my own handiwork and left the directory creation to org-persist.

Thanks for reporting! I did not consider corrupted index file. Fixed now.

> I had originally set org-element-use-cache to nil because I remember
> reading somewhere that the nil setting would help prevent emacs from
> hanging in org-mode.

The cache code has been refactored. I tried my best to fix all the bugs
causing the hangs and I am not seeing hangs anymore. That's why I took a
risk to enable cache by default on main.

> I'll certainly begin using org-persist and see what happens.

Thanks! The new cache makes agenda/sparse tree searches at least several
times faster (I even got >10x on some agendas). But we need more testing.

Best,
Ihor



Re: org-persist - bug report

2021-10-20 Thread Ihor Radchenko
Alastair Burt  writes:

> Hi there,
>
> I couldn't find an issue-tracking system for org-mode as they have for
> projects on github. So I'm emailing you directly.

Thanks! The bug reporting for Org mode is by email. You can send email
to Org mailing list at emacs-orgmode@gnu.org (also, see "1.4 Feedback"
section of Org manual or https://orgmode.org/ The issue tracker is
derived from the email and can be found online in
https://updates.orgmode.org/

I am CCing this message the mailing list.

> I just upgraded my org-mode to the latest version in git. Whenever I
> visited a certain org file, my Emacs became unusable. Any attempt to use
> M-x (execute-extended-command) resulted in max-specpdl-size errors as did
> using C-x C-c to exit Emacs. Some but not all of the errors mentioned
> "Error during file deserialization". After an hour's debugging, I tracked
> this down to org-persist. Deleting "~/.cache/org-persist" made the problem
> go away.

Your error looks bad, but I never saw it on my side. Are you able to
reproduce it with clean Emacs config? Does it happen immediately after
you open the file or did you change the file before the error appeared?

> I never managed to produce a backtrace, even with debug-on-error set to t.
> This was hard to debug!

This indicates some problem with cache code. The cache code is
asynchronous and thus difficult to debug. You may produce a useful
backtrace if you have

(setq org-element--cache-self-verify 'backtrace)
(setq org-element--cache-self-verify-frequency 1)

If the above is not enough, try the following just before actions that
trigger the error:

(setq org-element--cache-diagnostics t)

Best,
Ihor





Re: org-persist

2021-10-20 Thread Colin Baxter 😺
> Ihor Radchenko  writes:

> Colin Baxter 😺  writes:
>> I may not have understood things fully, but it seems that the
>> org-persist directory is set only by the
>> org-persist-path. Unfortunately, the resulting org-persist
>> directory in ~/.cache is no good for me since I daily clear out
>> my ~/.cache using bleachbit. I can't find a way of changing
>> org-persist-path and grep finds the variable only in ORG-NEWS.

> Oops. It was my bad (fixed now). Should be
> `org-persist-directory'. You can set it to other location in your
> init.el.

Ok, thanks - that works - I used ~/.emacs.d/org-persist/. It might be
worth mentioning that the user should not create the
org-persist-directory himself. I did this originally (mkdir
~/.emacs.d/org-persist , touch ~/.emacs.d/org-persist/index )
and got various parsing error messages. Everything worked fine after I
deleted my own handiwork and left the directory creation to org-persist.

I had originally set org-element-use-cache to nil because I remember
reading somewhere that the nil setting would help prevent emacs from
hanging in org-mode.

I'll certainly begin using org-persist and see what happens.

Thanks for your help.

Best wishes,

Colin.



[PATCH] Re: Make org-notify support macOS without DBus

2021-10-20 Thread Christopher M. Miles


Just update the email subject contains [PATCH]

"Christopher M. Miles"  writes:

> Mostly Emacs versions under macOS does not have compiled with DBus. Or still 
> don't work even compiled with DBus even
> macOS installed dbus with homebrew. I'm under this situation and problem. 
> Spend lot of time have not solution to solve
> this problem. So I give up on Emacs DBus support under macOS to make 
> "notifications.el" work. 
>
> I added patch on org-notify.el to make it invoke AppleScript command to 
> display notifications. Hope it help some macOS
> users. 
>
>
> <#secure method=pgpmime mode=sign>
>
> [5. text/x-patch; 
> 0001-org-attach.el-add-a-new-command-to-archive-web-page.patch]...



<#secure method=pgpmime mode=sign>

>From 6c667461b45e93059c6f801e485f7da4bfc3606c Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Fri, 29 May 2020 09:46:15 +0800
Subject: [PATCH] * org-attach.el: add a new command to archive web page

* lisp/org-attach.el (org-attach-url-archive): A new org-attach
dispatcher command to archive web page to a single file.

* lisp/org-agenda.el (org-attach-url-archive-command): A customize
option to specify external command for archiving web page.

* lisp/org-attach.el (org-attach-url-archive-page): A command
invoke external command to offline archive save web page.
---
 lisp/org-attach.el | 30 +-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index 57d1360fc..80855d147 100644
--- a/lisp/org-attach.el
+++ b/lisp/org-attach.el
@@ -204,6 +204,8 @@ (defcustom org-attach-commands
  "Attach a file using symbolic-link method.")
 ((?u ?\C-u) org-attach-url
  "Attach a file from URL (downloading it).")
+((?U) org-attach-url-archive
+ "Attach an offline version of web page URL.")
 ((?b) org-attach-buffer
  "Select a buffer and attach its contents to the task.")
 ((?n ?\C-n) org-attach-new
@@ -467,6 +469,31 @@ (defun org-attach-url (url)
   (let ((org-attach-method 'url))
 (org-attach-attach url)))
 
+(defun org-attach-url-archive (url)
+  (interactive "MURL of the web page be archived to attach: \n")
+  (let ((org-attach-method 'archive))
+(org-attach-attach url)))
+
+(defcustom org-attach-url-archive-command
+  (file-name-nondirectory (executable-find "monolith"))
+  "The command used to offline archive web page.
+monolith can be found here: https://github.com/Y2Z/monolith.";
+  :type 'string
+  :safe #'stringp
+  :group 'org-attach)
+
+(defun org-attach-url-archive-page (url target-file)
+  "Save an offline archive of web page."
+  (pcase org-attach-url-archive-command
+("monolith"
+ (make-process
+  :name "org-attach-offline"
+  :command (list org-attach-url-archive-command url "-o" target-file)
+  :sentinel (lambda (proc event) (message "org-attach-offline finished!"))
+  :buffer "*org-attach-url-archive*"))
+(nil (warn "You must have a command availble for offline save web page!
+Set variable `org-attach-url-archive-command'."
+
 (defun org-attach-buffer (buffer-name)
   "Attach BUFFER-NAME's contents to current outline node.
 BUFFER-NAME is a string.  Signals a `file-already-exists' error
@@ -504,7 +531,8 @@ (defun org-attach-attach (file &optional visit-dir method)
((eq method 'cp) (copy-file file attach-file))
((eq method 'ln) (add-name-to-file file attach-file))
((eq method 'lns) (make-symbolic-link file attach-file))
-   ((eq method 'url) (url-copy-file file attach-file)))
+   ((eq method 'url) (url-copy-file file attach-file))
+   ((eq method 'archive) (org-attach-url-archive-page file attach-file)))
   (run-hook-with-args 'org-attach-after-change-hook attach-dir)
   (org-attach-tag)
   (cond ((eq org-attach-store-link-p 'attached)
-- 
2.26.2

-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: org-persist

2021-10-20 Thread Ihor Radchenko
Colin Baxter 😺  writes:

> I may not have understood things fully, but it seems that the
> org-persist directory is set only by the
> org-persist-path. Unfortunately, the resulting org-persist directory in
> ~/.cache is no good for me since I daily clear out my ~/.cache using
> bleachbit. I can't find a way of changing org-persist-path and grep
> finds the variable only in ORG-NEWS.

Oops. It was my bad (fixed now). Should be `org-persist-directory'. You
can set it to other location in your init.el.

Also, deleting the cache would not make any harm, except possible slower
Org startup. org-persist should handle such case routinely. If you are
using bleachbit for privacy reasons, you may want to keep the default
cache directory: i.e. headline titles are stored in cache (unless you
are using org-crypt).

Best,
Ihot



Make org-notify support macOS without DBus

2021-10-20 Thread Christopher M. Miles


Mostly Emacs versions under macOS does not have compiled with DBus. Or
still don't work even compiled with DBus even macOS installed dbus with
homebrew. I'm under this situation and problem. Spend lot of time have
not solution to solve this problem. So I give up on Emacs DBus support
under macOS to make "notifications.el" work.

I added patch on org-notify.el to make it invoke AppleScript command to
display notifications. Hope it help some macOS users.


<#secure method=pgpmime mode=sign>

>From 6c667461b45e93059c6f801e485f7da4bfc3606c Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Fri, 29 May 2020 09:46:15 +0800
Subject: [PATCH] * org-attach.el: add a new command to archive web page

* lisp/org-attach.el (org-attach-url-archive): A new org-attach
dispatcher command to archive web page to a single file.

* lisp/org-agenda.el (org-attach-url-archive-command): A customize
option to specify external command for archiving web page.

* lisp/org-attach.el (org-attach-url-archive-page): A command
invoke external command to offline archive save web page.
---
 lisp/org-attach.el | 30 +-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index 57d1360fc..80855d147 100644
--- a/lisp/org-attach.el
+++ b/lisp/org-attach.el
@@ -204,6 +204,8 @@ (defcustom org-attach-commands
  "Attach a file using symbolic-link method.")
 ((?u ?\C-u) org-attach-url
  "Attach a file from URL (downloading it).")
+((?U) org-attach-url-archive
+ "Attach an offline version of web page URL.")
 ((?b) org-attach-buffer
  "Select a buffer and attach its contents to the task.")
 ((?n ?\C-n) org-attach-new
@@ -467,6 +469,31 @@ (defun org-attach-url (url)
   (let ((org-attach-method 'url))
 (org-attach-attach url)))
 
+(defun org-attach-url-archive (url)
+  (interactive "MURL of the web page be archived to attach: \n")
+  (let ((org-attach-method 'archive))
+(org-attach-attach url)))
+
+(defcustom org-attach-url-archive-command
+  (file-name-nondirectory (executable-find "monolith"))
+  "The command used to offline archive web page.
+monolith can be found here: https://github.com/Y2Z/monolith.";
+  :type 'string
+  :safe #'stringp
+  :group 'org-attach)
+
+(defun org-attach-url-archive-page (url target-file)
+  "Save an offline archive of web page."
+  (pcase org-attach-url-archive-command
+("monolith"
+ (make-process
+  :name "org-attach-offline"
+  :command (list org-attach-url-archive-command url "-o" target-file)
+  :sentinel (lambda (proc event) (message "org-attach-offline finished!"))
+  :buffer "*org-attach-url-archive*"))
+(nil (warn "You must have a command availble for offline save web page!
+Set variable `org-attach-url-archive-command'."
+
 (defun org-attach-buffer (buffer-name)
   "Attach BUFFER-NAME's contents to current outline node.
 BUFFER-NAME is a string.  Signals a `file-already-exists' error
@@ -504,7 +531,8 @@ (defun org-attach-attach (file &optional visit-dir method)
((eq method 'cp) (copy-file file attach-file))
((eq method 'ln) (add-name-to-file file attach-file))
((eq method 'lns) (make-symbolic-link file attach-file))
-   ((eq method 'url) (url-copy-file file attach-file)))
+   ((eq method 'url) (url-copy-file file attach-file))
+   ((eq method 'archive) (org-attach-url-archive-page file attach-file)))
   (run-hook-with-args 'org-attach-after-change-hook attach-dir)
   (org-attach-tag)
   (cond ((eq org-attach-store-link-p 'attached)
-- 
2.26.2

-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3




Re: org-persist

2021-10-20 Thread Colin Baxter 😺
> Ihor Radchenko  writes:

r> Colin Baxter 😺  writes:
>> Thank you. I cloned org-mode afresh and got the same warning
>> during 'make' - I presume that too is now fixed.

r> The warning should never appear now.  I removed it completely.

>> > Note that org-persist is enabled by default together with >
>> org-element-cache.  You can indeed disable it,
>> 
>> How can I do this?

r> If you want to disable cache persistence, just set
r> `org-element-cache-persistent' to nil.  It is documented in
r> ORG-NEWS.  If you find ORG-NEWS not clear, please let me know.  I
r> will try to improve the news record.

Thank you.

r> If you want to disable cache completely, you can set
r> `org-element-use-cache' to nil.  However, I am hoping to make
r> cache enabled all the time in future.  If you have specific
r> reasons to avoid org-element-cache, may you share them?

I may not have understood things fully, but it seems that the
org-persist directory is set only by the
org-persist-path. Unfortunately, the resulting org-persist directory in
~/.cache is no good for me since I daily clear out my ~/.cache using
bleachbit. I can't find a way of changing org-persist-path and grep
finds the variable only in ORG-NEWS.

Best wishes,

Colin.



How to open a link to a folder/file in Finder, not Dired

2021-10-20 Thread Gerardo Moro
I am having the same problem as reported here:
https://emacs.stackexchange.com/questions/66593/how-to-open-a-link-to-a-folder-file-in-finder-not-dired


I copy paste:

I used to be able to create links with open-insert-link pointing to folders
or files. When I clicked on them, I would be redirected to Finder. Lately,
they are shown within Dired. How to control this behaviour? When I use
either [[file:/users/Shared]] or [[file+emacs:/users/Shared]], and click on
them, I get the dired buffer, not the Finder app.

Thanks!
G.M.


Re: nbsp as blank

2021-10-20 Thread Alexandre Garreau
Le mercredi 20 octobre 2021, 03:42:08 CEST Samuel Wales a écrit :
> there exists org-emphasis-regexp-components, fwiw.

oh thanks that’s it!

but adding “ ” to its two first elements doesn’t seem to work… and it’s not 
anymore a defcustom… does it make it lexically binded so that I have to 
redefine it somewhere else than at prompt or in init.el?



org-ref 2 vs org-ref 3

2021-10-20 Thread Joseph Vidal-Rosset


Dear John,

I upgraded org-ref to get org-ref 3 and I met the following difficulties:

- my shortcut to get the list of my bib file did not work, and I have to
use the emacs menu,

- I did not get  via org-ref  a pdf file of any paper,

- cite links with the page(s) via "description" show only the page but
the reference is hidden,

at the moment, I downgraded to org-ref 2 and everything works fine.

I imagine that all is in the documentation you wrote to solve these
problems, but I wanted to point out them, in order to solve them easily
and to contribute to the improvement of this terrific tool you gave to
us. I do not imagine now writing without org-ref.

Thanks !

Jo.