[BUG] intermittent invalid search bound error [9.6.15 (release_9.6.15 @ /tmp/.mount_Emacs-NcE3UV/share/emacs/29.4/lisp/org/)]

2025-01-24 Thread John


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.


I periodically get the following error for no apparent rhyme or reason:

Warning (org-element-cache): org-element--cache: Org parser error in 
Notes.org::25724. Resetting.
 The error was: (error "Invalid search bound (wrong side of point)")
 Backtrace:
"  backtrace-to-string(nil)
  org-element-at-point()
  org-return(nil nil 1)
  funcall-interactively(org-return nil nil 1)
  command-execute(org-return)

It occurs with other commands, not just enter. It occurs randomly with
"dabbrev-expand" or just jumping to a different location. It occurs with
commands that work most of the time without issue.

Thanks for your help.

Emacs  : GNU Emacs 29.4 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30, 
cairo version 1.15.10)
 of 2024-06-30
Package: Org mode version 9.6.15 (release_9.6.15 @ 
/tmp/.mount_Emacs-NcE3UV/share/emacs/29.4/lisp/org/)

current state:
==
(setq
 org-noter--doc-goto-location-hook '(org-noter-pdftools--doc-goto-location 
org-noter-djvu--goto-location
 org-noter-nov--goto-location 
org-noter-pdf--goto-location)
 org-noter--check-location-property-hook '(org-noter-pdftools--check-link)
 org-link-elisp-confirm-function 'yes-or-no-p
 org-directory "/home/john/Documents/Notes"
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
 org-pdftools-get-desc-function 'org-pdftools-get-desc-default
 org-agenda-files '("~/Documents/Notes")
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-refile-targets '(("~/Document/Notes/todo.org" :maxlevel . 3))
 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-noter-pdftools-markup-pointer-function 
'pdf-annot-add-highlight-markup-annotation
 org-noter--pretty-print-location-for-title-hook 
'(org-noter-djvu--pretty-print-location
   
org-noter-nov--pretty-print-location
   
org-noter-pdf--pretty-print-location-for-title)
 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-noter--note-after-tipping-point-hook 
'(org-noter-pdftools--note-after-tipping-point)
 org-persist-before-read-hook '(org-element--cache-persist-before-read)
 org-link-from-user-regexp "|\\"
 org-noter--pretty-print-highlight-location-hook 
'(org-noter-pdf--pretty-print-highlight)
 org-mode-hook '(org-pdftools-setup-link mixed-pitch-mode (lambda nil 
(org-superstar-mode 1))
 #[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
 #[0 "\301\211\207" [imenu-create-index-function 
org-imenu-get-tree] 2])
 org-noter--pretty-print-location-hook 
'(org-noter-pdftools--pretty-print-location 
org-noter-djvu--pretty-print-location
 org-noter-nov--pretty-print-location 
org-noter-pdf--pretty-print-location)
 org-confirm-shell-link-function 'yes-or-no-p
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-startup-indented t
 org-use-speed-commands t
 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)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-agenda-window-setup 'other-window
 org-noter--show-arrow-hook '(org-noter-pdf--show-arrow)
 org-noter-insert-heading-hook '(org-noter-pdftools--insert-heading)
 org-speed-command-hook '(org-speed-command-activate 
org-babel-speed-command-activate)
 org-noter--add-highlight-hook '(org-noter-pdf--highlight-location)
 org-noter--get-current-view-hook '(org-noter-djvu--get-current-view 
org-noter-nov--get-current-view
org-noter-pdf--get-current-view)
 org-noter-set-up-document-hook '(org-noter-djvu--setup-handler 
org-noter-nov--setup-handler
  org-noter-pdf--doc-view-setup-handler 
org-noter-pdf--pdf-view-setup-handler)
 org-noter--get-containing-element-hook '(org-noter--get-containing-heading 
org-noter--get-containing-property-drawer)
 org-fold-core-isearch-open-function 'org-fold-core--isearch-reveal
 org-pdftools-markup-pointer-function 'pdf-annot

Re: [BUG] "Invalid search bound (wrong side of point)" [9.8-pre (release_9.7.16-169-ge87ecf @ ~/.emacs.d/org-mode-git/lisp/)]

2025-01-24 Thread Paul Stansell
Hi Ihor,

On Sun, 12 Jan 2025 at 17:22, Paul Stansell  wrote:

> Please try and let me know if you still see anything suspicious.
>>
>
It's quite rare, but I'm still receiving these warnings:

Warning (emacs): Emacs reader failed to read data in
"~/.cache/org-persist//gc-lock.eld". The error was: "End of file during
parsing"

Is there anything else you'd like me to try?

Paul


Re: Cannot yank media when image come from Gnome screenshot

2025-01-24 Thread Robert Pluim
> On Fri, 24 Jan 2025 18:27:23 +0530, Visuwesh  said:

Visuwesh> [வெள்ளி ஜனவரி 24, 2025] Robert Pluim wrote:
>>> On Fri, 24 Jan 2025 10:37:37 +0530, Visuwesh  
said:
>> 
Visuwesh> * lisp/org-compat.el: Add workaround proposed by Robert Pluim
Visuwesh>  to make yank-media work under GNOME reliably 
for
Visuwesh> Emacs 29.
>> 
>> Did I propose it? I donʼt remember 😀

Visuwesh> You did, indeed.  See https://yhetil.org/87wmlb8djy@gmail.com.

I know, I was (feebly) attempting a joke.

>> I thought Ihor wanted this to check for a pgtk build? Personally I
>> think the check for the window system in the cl-defmethod is enough,
>> but Iʼm not Ihor.

Visuwesh> I think so too but let's hear from Ihor first.

>> One way to check for pgtk is checking the result of
>> (window-system). Or checking whether `pgtk-backend-display-class' is
>> `fboundp'.

And checking (window-system) duplicates the `cl-defmethod' check.

Visuwesh> I don't think we should use (window-system) since the return 
value is
Visuwesh> FRAME dependent: if Someone™ opens a terminal frame first and 
loads Org
Visuwesh> while it is focused, they won't get this fix even if their build 
is a
Visuwesh> pgtk build.  C:
Visuwesh> [ I think this will definitely break for daemon processes.  ]

People who use the daemon are making a rod for their own back, but we
should still cater to them, I suppose.

Visuwesh> We could rely on (fboundp 'pgtk-backend-display-class) but I 
somehow
Visuwesh> don't like it as compared to just leaving this extra check out.

Right.

Robert
-- 



Re: Adding a resume.cls to Org ?

2025-01-24 Thread David Masterson
Robert Klein  writes:

> On Thu, 23 Jan 2025 18:47:23 -0800
> David Masterson  wrote:
>
>> Anyone have a writeup on adding a simple resume.cls to Org?
>
> You mean something like
>
>   (setq roklein/org-latex-class/scrartcl

This is the name of a variable?  With slashes in the name?!?  Didn't
know that...

> ;; note: ~ resolves to ~\\ which is a forced space
> ;; plus a line break.  Otherwise the following text (even
> ;; if there is an empty line) would be on the same line
> ;; as the paragraph title.

Not sure I get this...

> '("scrartcl"

Is this actually the cls file?  Where is the cls file located?

>   "\\documentclass[11pt]{scrartcl}"

This is defining the documentclass or loading the existing
documentclass?

>   ("\\section{%s}" . "\\section*{%s}")
>   ("\\subsection{%s}" . "\\subsection*{%s}")
>   ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
>   ("\\paragraph{%s}~\\par" . "\\paragraph*{%s}~\\par")
>   ("\\subparagraph{%s}~\\par" . "\\subparagraph*{%s}~\\par")))

1. The cls file defines the "\\section*" (etc) references, right?
2. Must all cls files have definitions for this hierarchy?
3. What do I look for in the cls file to identify the start of one of
these definitions?  (I think I can read it after I know where to start
reading.)
4. What is "~\\par" ?

>   (use-package ox-latex
> :after org
> :config
> (setq org-latex-default-class "scrartcl"
>   ;; more stuff...
> (add-to-list 'org-latex-classes roklein/org-latex-class/scrartcl)
> ;; more stuff
>   )

This I get.

Thanks for the help.
-- 
David Masterson



Re: Cannot yank media when image come from Gnome screenshot

2025-01-24 Thread Robert Pluim
> On Fri, 24 Jan 2025 10:37:37 +0530, Visuwesh  said:

Visuwesh> * lisp/org-compat.el: Add workaround proposed by Robert Pluim
Visuwesh>  to make yank-media work under GNOME reliably 
for
Visuwesh> Emacs 29.

Did I propose it? I donʼt remember 😀

Visuwesh> Link: https://list.orgmode.org/orgmode/87ed7kttoa@k-7.ch
Visuwesh> Reported-by: Sébastien Gendre 
Visuwesh> ---
Visuwesh>  lisp/org-compat.el | 15 +++
Visuwesh>  1 file changed, 15 insertions(+)

Visuwesh> diff --git a/lisp/org-compat.el b/lisp/org-compat.el
Visuwesh> index 91192629a..3ad330628 100644
Visuwesh> --- a/lisp/org-compat.el
Visuwesh> +++ b/lisp/org-compat.el
Visuwesh> @@ -1992,6 +1992,21 @@ (make-obsolete-variable 
'org-speed-commands-user
Visuwesh>  "configure `org-speed-commands' 
instead." "9.5")
Visuwesh>  (provide 'org-compat)
 
Visuwesh> + yank-media
Visuwesh> +;; Emacs 29's pgtk port has a bug where it might fail to return 
the
Visuwesh> +;; right TARGET.  Install a workaround for Emacs <=29 since the 
fix
Visuwesh> +;; went to Emacs 30.  See bug#72254.
Visuwesh> +;; Org bug report link: 
https://list.orgmode.org/orgmode/87ed7kttoa@k-7.ch
Visuwesh> +;; This should be removed once we drop Emacs 29 support.
Visuwesh> +(when (<= emacs-major-version 29)

I thought Ihor wanted this to check for a pgtk build? Personally I
think the check for the window system in the cl-defmethod is enough,
but Iʼm not Ihor.

One way to check for pgtk is checking the result of
(window-system). Or checking whether `pgtk-backend-display-class' is `fboundp'.

Visuwesh> +  (cl-defmethod gui-backend-get-selection ((selection-symbol 
(eql 'CLIPBOARD))
Visuwesh> +   (target-type (eql 
'TARGETS))
Visuwesh> +   &context 
(window-system pgtk))
Visuwesh> +(let ((sel (pgtk-get-selection-internal selection-symbol 
target-type)))
Visuwesh> +  (if (vectorp sel)
Visuwesh> +  sel
Visuwesh> +(vector sel)
Visuwesh> +
Visuwesh>  ;; Local variables:
Visuwesh>  ;; generated-autoload-file: "org-loaddefs.el"
Visuwesh>  ;; End:
Visuwesh> -- 
Visuwesh> 2.45.2



Robert
-- 



Re: Cannot yank media when image come from Gnome screenshot

2025-01-24 Thread Visuwesh
[வெள்ளி ஜனவரி 24, 2025] Robert Pluim wrote:

>> On Fri, 24 Jan 2025 10:37:37 +0530, Visuwesh  said:
>
> Visuwesh> * lisp/org-compat.el: Add workaround proposed by Robert Pluim
> Visuwesh>  to make yank-media work under GNOME reliably 
> for
> Visuwesh> Emacs 29.
>
> Did I propose it? I donʼt remember 😀

You did, indeed.  See https://yhetil.org/87wmlb8djy@gmail.com.

> Visuwesh> Link: https://list.orgmode.org/orgmode/87ed7kttoa@k-7.ch
> Visuwesh> Reported-by: Sébastien Gendre 
> Visuwesh> ---
> Visuwesh>  lisp/org-compat.el | 15 +++
> Visuwesh>  1 file changed, 15 insertions(+)
>
> Visuwesh> diff --git a/lisp/org-compat.el b/lisp/org-compat.el
> Visuwesh> index 91192629a..3ad330628 100644
> Visuwesh> --- a/lisp/org-compat.el
> Visuwesh> +++ b/lisp/org-compat.el
> Visuwesh> @@ -1992,6 +1992,21 @@ (make-obsolete-variable 
> 'org-speed-commands-user
> Visuwesh>  "configure `org-speed-commands' 
> instead." "9.5")
> Visuwesh>  (provide 'org-compat)
>
> Visuwesh> + yank-media
> Visuwesh> +;; Emacs 29's pgtk port has a bug where it might fail to 
> return the
> Visuwesh> +;; right TARGET.  Install a workaround for Emacs <=29 since 
> the fix
> Visuwesh> +;; went to Emacs 30.  See bug#72254.
> Visuwesh> +;; Org bug report link: 
> https://list.orgmode.org/orgmode/87ed7kttoa@k-7.ch
> Visuwesh> +;; This should be removed once we drop Emacs 29 support.
> Visuwesh> +(when (<= emacs-major-version 29)
>
> I thought Ihor wanted this to check for a pgtk build? Personally I
> think the check for the window system in the cl-defmethod is enough,
> but Iʼm not Ihor.

I think so too but let's hear from Ihor first.

> One way to check for pgtk is checking the result of
> (window-system). Or checking whether `pgtk-backend-display-class' is
> `fboundp'.

I don't think we should use (window-system) since the return value is
FRAME dependent: if Someone™ opens a terminal frame first and loads Org
while it is focused, they won't get this fix even if their build is a
pgtk build.  C:
[ I think this will definitely break for daemon processes.  ]

We could rely on (fboundp 'pgtk-backend-display-class) but I somehow
don't like it as compared to just leaving this extra check out.



Re: Adding a resume.cls to Org ?

2025-01-24 Thread Robert Klein
On Thu, 23 Jan 2025 18:47:23 -0800
David Masterson  wrote:

> Anyone have a writeup on adding a simple resume.cls to Org?

You mean something like

  (setq roklein/org-latex-class/scrartcl
;; note: ~ resolves to ~\\ which is a forced space
;; plus a line break.  Otherwise the following text (even
;; if there is an empty line) would be on the same line
;; as the paragraph title.
'("scrartcl"
  "\\documentclass[11pt]{scrartcl}"
  ("\\section{%s}" . "\\section*{%s}")
  ("\\subsection{%s}" . "\\subsection*{%s}")
  ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
  ("\\paragraph{%s}~\\par" . "\\paragraph*{%s}~\\par")
  ("\\subparagraph{%s}~\\par" . "\\subparagraph*{%s}~\\par")))

  (use-package ox-latex
:after org
:config
(setq org-latex-default-class "scrartcl"
  ;; more stuff...
(add-to-list 'org-latex-classes roklein/org-latex-class/scrartcl)
;; more stuff
  )



Best regards
Robert