Re: [BUG] Prompted to submit (unsure what happened) [9.5.2 (9.5.2-g072523 @ /Users/apc/.emacs.d/straight/build/org/)]
Alejandro Pérez Carballo writes: > One more question: wouldn't replacing `org-in-src-block-p' with a function > that calls `org-in-src-block-p' only when in org-mode and returns `nil' > elsewhere suffice to make something that's like `org-in-src-block-p' but that > will work outside org-mode? E.g.: > > (defun my/org-in-src-block-p ( arg) > (if (derived-mode-p 'org-mode) > (org-in-src-block-p) > nil)) >From the docstring of electric-quote-inhibit-functions, a function returning nil will have no effect. So, you should be safe to use your function. A slightly more concise version would be using when instead of if. Also, unused function arguments are defined as "_" by convention. Adding a docstring to all your function is a good habit to cultivate. (defun my/org-in-src-block-p ( _) "Call `org-in-src-block-p' when in `org-mode' and return nil otherwise." (when (derived-mode-p 'org-mode) (org-in-src-block-p))) Best, Ihor
Re: [BUG] Prompted to submit (unsure what happened) [9.5.2 (9.5.2-g072523 @ /Users/apc/.emacs.d/straight/build/org/)]
One more question: wouldn't replacing `org-in-src-block-p' with a function that calls `org-in-src-block-p' only when in org-mode and returns `nil' elsewhere suffice to make something that's like `org-in-src-block-p' but that will work outside org-mode? E.g.: (defun my/org-in-src-block-p ( arg) (if (derived-mode-p 'org-mode) (org-in-src-block-p) nil)) I'm using this for now as a replacement and it seems to do the trick, at least for my present purposes. Best, Alejandro > On Feb 24, 2022, at 11:27 AM, Alejandro Pérez Carballo > wrote: > > I found the source of the problem. I was trying to disable > `electric-quote-mode' when in a src block, and found this snippet somewhere: > > ``` > (add-hook 'electric-quote-inhibit-functions #'org-in-src-block-p) > ``` > > Any thoughts on alternative ways of achieving similar behavior? Presumably > I'd need to find a way to make `electric-quote-inhibit-functions` vary > depending on whether I am in org-mode. But I'm very much an Elisp illiterate, > so I'd appreciate any suggestions here. > > Best, > > Alejandro > >> On Feb 24, 2022, at 5:39 AM, Ihor Radchenko wrote: >> >> Alejandro Pérez Carballo writes: >> >>> Sorry about the unclear report. I was indeed _not_ in an org buffer. I do >>> not think I was using minibuffer completion, but I cannot remember. I now >>> just got a similar error message, this time when working on an Elisp >>> buffer. The error message says: >>> >>> Warning (org-element-cache): org-element--cache: Org parser error in >>> setup-biblio.el::5918. Resetting. >>> The error was: (error "rx ‘**’ range error") >>> Backtrace: >>> " backtrace-to-string(nil) >>> org-element-at-point() >>> org-in-src-block-p() >>> run-hook-with-args-until-success(org-in-src-block-p) >>> electric-quote-post-self-insert-function() >>> self-insert-command(1 34) >>> funcall-interactively(self-insert-command 1 34) >>> call-interactively(self-insert-command nil nil) >>> command-execute(self-insert-command) >>> " >> >> Thanks for the backtrace! It is very clear that something in >> electric-quote-mode-hook (or maybe in electric-quote-inhibit-functions) >> is calling org-in-src-block-p. >> >> org-in-src-block-p does not work outside Org mode. It used to (at least, >> it did not throw an error), but it is not the case anymore and it was >> never guaranteed that Org functions can reliably work outside Org mode. >> >> I do not see explicit customisation adding org-in-src-block-p in your >> config from the first email. I presume that some third-party package is >> adding org-in-src-block-p to electric-quote-mode. I would first try to >> check the values of electric-quote-inhibit-functions and >> electric-quote-mode-hook and check if they contain org-* staff. Then, I >> would bisect the config to find out which package is doing it. What you >> are seeing is a bug in that package and should be reported. >> >> Best, >> Ihor >
Re: [BUG] Prompted to submit (unsure what happened) [9.5.2 (9.5.2-g072523 @ /Users/apc/.emacs.d/straight/build/org/)]
I found the source of the problem. I was trying to disable `electric-quote-mode' when in a src block, and found this snippet somewhere: ``` (add-hook 'electric-quote-inhibit-functions #'org-in-src-block-p) ``` Any thoughts on alternative ways of achieving similar behavior? Presumably I'd need to find a way to make `electric-quote-inhibit-functions` vary depending on whether I am in org-mode. But I'm very much an Elisp illiterate, so I'd appreciate any suggestions here. Best, Alejandro > On Feb 24, 2022, at 5:39 AM, Ihor Radchenko wrote: > > Alejandro Pérez Carballo writes: > >> Sorry about the unclear report. I was indeed _not_ in an org buffer. I do >> not think I was using minibuffer completion, but I cannot remember. I now >> just got a similar error message, this time when working on an Elisp buffer. >> The error message says: >> >> Warning (org-element-cache): org-element--cache: Org parser error in >> setup-biblio.el::5918. Resetting. >> The error was: (error "rx ‘**’ range error") >> Backtrace: >> " backtrace-to-string(nil) >> org-element-at-point() >> org-in-src-block-p() >> run-hook-with-args-until-success(org-in-src-block-p) >> electric-quote-post-self-insert-function() >> self-insert-command(1 34) >> funcall-interactively(self-insert-command 1 34) >> call-interactively(self-insert-command nil nil) >> command-execute(self-insert-command) >> " > > Thanks for the backtrace! It is very clear that something in > electric-quote-mode-hook (or maybe in electric-quote-inhibit-functions) > is calling org-in-src-block-p. > > org-in-src-block-p does not work outside Org mode. It used to (at least, > it did not throw an error), but it is not the case anymore and it was > never guaranteed that Org functions can reliably work outside Org mode. > > I do not see explicit customisation adding org-in-src-block-p in your > config from the first email. I presume that some third-party package is > adding org-in-src-block-p to electric-quote-mode. I would first try to > check the values of electric-quote-inhibit-functions and > electric-quote-mode-hook and check if they contain org-* staff. Then, I > would bisect the config to find out which package is doing it. What you > are seeing is a bug in that package and should be reported. > > Best, > Ihor
Re: [BUG] Prompted to submit (unsure what happened) [9.5.2 (9.5.2-g072523 @ /Users/apc/.emacs.d/straight/build/org/)]
Alejandro Pérez Carballo writes: > Sorry about the unclear report. I was indeed _not_ in an org buffer. I do not > think I was using minibuffer completion, but I cannot remember. I now just > got a similar error message, this time when working on an Elisp buffer. The > error message says: > > Warning (org-element-cache): org-element--cache: Org parser error in > setup-biblio.el::5918. Resetting. > The error was: (error "rx ‘**’ range error") > Backtrace: > " backtrace-to-string(nil) > org-element-at-point() > org-in-src-block-p() > run-hook-with-args-until-success(org-in-src-block-p) > electric-quote-post-self-insert-function() > self-insert-command(1 34) > funcall-interactively(self-insert-command 1 34) > call-interactively(self-insert-command nil nil) > command-execute(self-insert-command) > " Thanks for the backtrace! It is very clear that something in electric-quote-mode-hook (or maybe in electric-quote-inhibit-functions) is calling org-in-src-block-p. org-in-src-block-p does not work outside Org mode. It used to (at least, it did not throw an error), but it is not the case anymore and it was never guaranteed that Org functions can reliably work outside Org mode. I do not see explicit customisation adding org-in-src-block-p in your config from the first email. I presume that some third-party package is adding org-in-src-block-p to electric-quote-mode. I would first try to check the values of electric-quote-inhibit-functions and electric-quote-mode-hook and check if they contain org-* staff. Then, I would bisect the config to find out which package is doing it. What you are seeing is a bug in that package and should be reported. Best, Ihor
Re: [BUG] Prompted to submit (unsure what happened) [9.5.2 (9.5.2-g072523 @ /Users/apc/.emacs.d/straight/build/org/)]
Sorry about the unclear report. I was indeed _not_ in an org buffer. I do not think I was using minibuffer completion, but I cannot remember. I now just got a similar error message, this time when working on an Elisp buffer. The error message says: Warning (org-element-cache): org-element--cache: Org parser error in setup-biblio.el::5918. Resetting. The error was: (error "rx ‘**’ range error") Backtrace: " backtrace-to-string(nil) org-element-at-point() org-in-src-block-p() run-hook-with-args-until-success(org-in-src-block-p) electric-quote-post-self-insert-function() self-insert-command(1 34) funcall-interactively(self-insert-command 1 34) call-interactively(self-insert-command nil nil) command-execute(self-insert-command) " Best, Alejandro > On Feb 22, 2022, at 9:06 PM, Ihor Radchenko wrote: > > Alejandro Pérez Carballo writes: > >> I was simply entering an entry to my main bib file. I received an error >> message and was asked to submit this report. > > Thanks for the report! > Do I understand correctly that you got: > 1. An error message > 2. A warning popup > > Did it happen when you were _not_ in Org buffer and you did not use > minibuffer completion? > > Do you recall the error/warning text? > > Best, > Ihor
Re: [BUG] Prompted to submit (unsure what happened) [9.5.2 (9.5.2-g072523 @ /Users/apc/.emacs.d/straight/build/org/)]
Alejandro Pérez Carballo writes: > I was simply entering an entry to my main bib file. I received an error > message and was asked to submit this report. Thanks for the report! Do I understand correctly that you got: 1. An error message 2. A warning popup Did it happen when you were _not_ in Org buffer and you did not use minibuffer completion? Do you recall the error/warning text? Best, Ihor
[BUG] Prompted to submit (unsure what happened) [9.5.2 (9.5.2-g072523 @ /Users/apc/.emacs.d/straight/build/org/)]
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 was simply entering an entry to my main bib file. I received an error message and was asked to submit this report. Thanks, Alejandro Emacs : GNU Emacs 28.0.90 (build 1, x86_64-apple-darwin19.6.0, NS appkit-1894.60 Version 10.15.7 (Build 19H1419)) of 2021-12-14 Package: Org mode version 9.5.2 (9.5.2-g072523 @ /Users/apc/.emacs.d/straight/build/org/) current state: == (setq org-archive-location "~/org/agenda/archives/%s_archive.org::datetree/" org-pomodoro-format ":%s" org-roam-db-location "/Users/apc/.emacs.d/var/org/org-roam.db" org-link-elisp-confirm-function 'yes-or-no-p org-agenda-skip-deadline-prewarning-if-scheduled 2 org-cite-insert-processor 'citar org-after-refile-insert-hook '(org-gcal--refile-post) org-roam-db-gc-threshold 80 org-bibtex-headline-format-function #[257 "\300%1\236A\207" [:title] 3 "\n\n(fn ENTRY)"] org-log-done 'time org-pomodoro-long-break-sound "/Users/apc/.emacs.d/straight/build/org-pomodoro/resources/bell_multiple.wav" org-roam-mode-hook '(my/read-mode-indicator) org-roam-dailies-capture-templates '(("d" "default" entry "* %?" :if-new (file+head "%<%Y-%m-%d>.org" "#+title: %<%Y-%m-%d>")) ) org-agenda-custom-commands '(("d" "Default (ignore @sched and @hold)" ((agenda "" ((org-agenda-span 'day) (org-super-agenda-groups '((:name none :time-grid t) (:name "To do" :and (:not (:tag ("@hold")) :not (:tag ("@sched"))) :discard (:anything t)) ) ) ) ) ) ) ("z" "Work: focused" ((agenda "" ((org-agenda-span 'day) (org-agenda-files `(,(concat my/agenda-dir "/work.org"))) (org-super-agenda-groups '((:name "First and foremost" :and (:tag ("@today") :priority "A")) (:name "The rest" :tag ("@today") :discard (:anything t))) ) ) ) ) ) ("p" "Planning view" ((agenda "" ((org-agenda-span 'day) (org-super-agenda-groups '((:name "Up next" :and (:todo "NEXT" :not (:scheduled past))) (:name "New today" :and (:not (:todo ("WAIT" "KILL")) :not (:tag ("@sched")) :scheduled today) :deadline today) (:name "In progress" :todo "STRT") (:name "Overdue" :and (:not (:todo ("DONE" "KILL" "WAIT")) :not (:tag ("@sched")) :deadline past) ) (:name "Backlog" :and (:not (:todo ("STRT" "DONE" "KILL" "WAIT")) :not (:tag ("@sched")) :scheduled past) :discard (:anything t)) ) ) ) ) (alltodo "" ((org-agenda-overriding-header "") (org-super-agenda-groups `((:name "Refile" :and (:not (:todo ("DONE" "KILL" "WAIT")) :tag ("refile") :not (:tag ("read" "gkry"))) ) (:name "Next available actions" :and (:todo "NEXT" :scheduled future) :and (:todo "NEXT" :deadline future)) (:name "Coming