Re: [BUG] repeated warnings about org-element-at-point "cannot be used in non-Org buffer" [9.7 (9.7-??-57b94f3 @ /Users/cstevens/.emacs.d/.local/straight/build-29.2/org/)]

2024-02-07 Thread Daniel Clemente
Thanks, I replaced org-cycle/org-global-cycle with
outline-cycle/outline-cycle-buffer, and then the outlining works.

On Tue, 6 Feb 2024 at 18:56, Ihor Radchenko  wrote:

> Daniel Clemente  writes:
>
> > I also see the warnings. In my case it's because I'm using outline-minor
> > mode in an elisp file. I'm not sure it's supported, but it worked years
> > ago: ...
>
> It is not supported by Org mode.
> The modern outline mode has `outline-cycle'.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


Re: [BUG] repeated warnings about org-element-at-point "cannot be used in non-Org buffer" [9.7 (9.7-??-57b94f3 @ /Users/cstevens/.emacs.d/.local/straight/build-29.2/org/)]

2024-02-06 Thread Ihor Radchenko
Daniel Clemente  writes:

> I also see the warnings. In my case it's because I'm using outline-minor
> mode in an elisp file. I'm not sure it's supported, but it worked years
> ago: ...

It is not supported by Org mode.
The modern outline mode has `outline-cycle'.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] repeated warnings about org-element-at-point "cannot be used in non-Org buffer" [9.7 (9.7-??-57b94f3 @ /Users/cstevens/.emacs.d/.local/straight/build-29.2/org/)]

2024-02-06 Thread Daniel Clemente
I also see the warnings. In my case it's because I'm using outline-minor
mode in an elisp file. I'm not sure it's supported, but it worked years
ago: I could fold and unfold sections with usual org-mode keys like C-tab.
I miss that feature. I never managed to learn the real outline-mode
keys/concepts (outline-show-branches, outline-hide-subtree etc.).

To reproduce it, I used test.el with:


;; -*- mode: emacs-lisp; mode:outline-minor; hs-minor-mode: nil;
outline-regexp:"* [^ \n]" -*-

;; a
;;; a1
;; b


Then I went to ;; a and pressed C-tab, expecting to open/close that
section (showing/hiding the a1). And I saw the warning, and an error:
rx--translate-bounded-repetition: rx ‘**’ range error [3 times]

Please excuse if my expectations or my test file are broken. I didn't use
this feature in years.





On Tue, 30 Jan 2024 at 16:17, Ihor Radchenko  wrote:

> Christopher Stevenson  writes:
>
> > I get these warnings about org-element when I am in non-org files; the
> > main ones that come to mind are JavaScript files and in magit when I am
> > doing a commit. They don't seem to break anything but it does get
> > annoying to have to constantly dismiss them.
>
> These warnings indicate that some of your packages or customization
> causes `org-element-at-point' to be executed in non-Org buffer.
> `org-element-at-point' does not have a defined behaviour in non-Org
> buffers and may cause random errors.
>
> If you can narrow down the caller of `org-element-at-point', I suggest
> you to report the observed behaviour as a bug (if that is a third-party
> package).
>
> Otherwise, you may suppress the Org warning.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>
>


Re: [BUG] repeated warnings about org-element-at-point "cannot be used in non-Org buffer" [9.7 (9.7-??-57b94f3 @ /Users/cstevens/.emacs.d/.local/straight/build-29.2/org/)]

2024-01-30 Thread Ihor Radchenko
Christopher Stevenson  writes:

> I get these warnings about org-element when I am in non-org files; the
> main ones that come to mind are JavaScript files and in magit when I am
> doing a commit. They don't seem to break anything but it does get
> annoying to have to constantly dismiss them.

These warnings indicate that some of your packages or customization
causes `org-element-at-point' to be executed in non-Org buffer.
`org-element-at-point' does not have a defined behaviour in non-Org
buffers and may cause random errors.

If you can narrow down the caller of `org-element-at-point', I suggest
you to report the observed behaviour as a bug (if that is a third-party
package).

Otherwise, you may suppress the Org warning.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



[BUG] repeated warnings about org-element-at-point "cannot be used in non-Org buffer" [9.7 (9.7-??-57b94f3 @ /Users/cstevens/.emacs.d/.local/straight/build-29.2/org/)]

2024-01-30 Thread Christopher Stevenson



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 get these warnings about org-element when I am in non-org files; the
main ones that come to mind are JavaScript files and in magit when I am
doing a commit. They don't seem to break anything but it does get
annoying to have to constantly dismiss them.

Emacs  : GNU Emacs 29.2 (build 2, aarch64-apple-darwin23.2.0, NS appkit-2487.30 
Version 14.2.1 (Build 23C71))
of 2024-01-23
Package: Org mode version 9.7 (9.7-??-57b94f3 @ 
/Users/cstevens/.emacs.d/.local/straight/build-29.2/org/)

current state:
==
(setq
org-link-elisp-confirm-function nil
org-directory "~/SynologyDrive/OrgRoam"
org-agenda-skip-deadline-prewarning-if-scheduled t
org-cite-insert-processor 'citar
org-after-refile-insert-hook '(save-buffer)
org-indirect-buffer-display 'current-window
org-roam-db-gc-threshold 2305843009213693951
org-crypt-key nil
org-bibtex-headline-format-function 'org-bibtex-headline-format-default
org-download-file-format-function 'org-download-file-format-default
org-log-done t
org-roam-mode-hook '(+org-roam-detach-magit-section-mode-map-h 
turn-on-visual-line-mode)
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-init-roam-h)
org-startup-folded 'show2levels
org-babel-after-execute-hook '(+org-redisplay-inline-images-in-babel-result-h)
org-link-abbrev-alist '(("doomdir" . "/Users/cstevens/.doom.d/%s") ("emacsdir" 
. "/Users/cstevens/.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-skip-scheduled-if-done t
org-agenda-files '("~/SynologyDrive/OrgRoam")
org-capture-templates '(("t" "Quick Todo" entry (file +org-capture-todo-file) 
"* TODO %^{Task}\nSCHEDULED: %t\n"
  :immediate-finish t)
 ("T" "Todo" entry (file +org-capture-todo-file) "* 
TODO %?\n %i\n")
 ("n" "Quick Note" entry (file +org-capture-notes-file) 
"* %^{Note}\n" :immediate-finish t)
 ("N" "Note" entry (file +org-capture-notes-file) "* 
%?\n %i\n"))
org-roam-node-display-template "${title:*} ${tags:10}"
org-persist-after-read-hook '(org-element--cache-persist-after-read)
org-refile-targets '((nil :maxlevel . 5) (org-agenda-files :maxlevel . 5))
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
org-babel-header-arg-expand 
+org-clear-babel-results-h +org-cycle-only-current-subtree-h)
org-tag-alist '(("grading" . 103) ("important" . 105) ("dept" . 100) ("cmte" . 
99))
org-default-notes-file "~/SynologyDrive/OrgRoam/inbox.org"
org-roam-find-file-hook 
'(doom--setq-org-id-link-to-org-use-id-for-org-roam-find-file-h 
org-roam-buffer--setup-redisplay-h
   org-roam--register-completion-functions-h 
org-roam--replace-roam-links-on-save-h
   org-roam-db-autosync--setup-update-on-save-h 
+org-roam-enable-auto-backlinks-buffer-h)
org-refile-use-outline-path 'file
org-archive-hook '(org-attach-archive-delete-maybe)
org-cite-follow-processor 'citar
org-file-apps '((remote . emacs) ("\\.pdf\\'" . default) (directory . emacs) 
(auto-mode . emacs) ("\\.mm\\'" . default)
 ("\\.x?html?\\'" . default) ("\\.xls\\'" . default) 
("\\.xlsm\\'" . default) ("\\.xlsx\\'" . default)
 ("\\.docx\\'" . default) ("\\.doc\\'" . default))
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-font-lock-set-keywords-hook '(doom-themes-enable-org-fontification)
org-modules '(ol-bibtex)
org-image-actual-width nil