[BUG] Citations: Locator treated as prefix [9.5 (release_9.5-225-g494c20 @ /home/quintus/.emacs.d/org-mode/lisp/)]

2021-11-10 Thread M . ‘quintus’ Gülker
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.


Dear all,

I originally reported this at
https://github.com/andras-simonyi/citeproc-el/issues/68, but was
directed here.

take this org file `mwe.org':

#+TITLE: Test
#+AUTHOR: Testauthor
#+LANGUAGE: de
#+bibliography: /tmp/mwe/mwe.bib
#+cite_export: csl /tmp/mwe/juristische-schulung.csl

Das ist ein Test [cite:@redeker2020itr Kap. A Rn. 72, Suffixtext hier]

with this `mwe.bib' Biblatex file:

@Book{redeker2020itr,
author   = {Helmut Redeker},
title= {IT-Recht},
year  = {2020},
edition   = {7},
publisher = {C.H. Beck},
location  = {München},
langid= {ngerman}}

`juristische-schulung.el' is 
https://github.com/citation-style-language/styles/blob/e22b8a566bad9b4c7f52720f60dd875057a5d210/juristische-schulung.csl

When this is exported to HTML, the locator `Kap. A Rn. 72' is split and
partly taken as the prefix. It exports to this:

1 Kap. A Rn.  Redeker, IT-Recht, 7. Aufl. (2020), 72 Suffixtext hier

This is incorrect; it should export to:

1 Redeker, IT-Recht, 7. Aufl. (2020), Kap. A Rn. 72 Suffixtext hier

Org mode version 9.5 (release_9.5-225-g494c20 @ 
/home/quintus/.emacs.d/org-mode/lisp/)
citeproc.el at e6b3f160dbe87d035cbee6c61bcfdd063f56b1cb

  -quintus

Emacs  : GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, 
cairo version 1.16.0)
 of 2021-03-28, modified by Debian
Package: Org mode version 9.5 (release_9.5-225-g494c20 @ 
/home/quintus/.emacs.d/org-mode/lisp/)

current state:
==
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-link-shell-confirm-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-html-format-inlinetask-function 
'org-html-format-inlinetask-default-function
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-persist-before-write-hook '(org-element--cache-persist-before-write)
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-mode-hook '((closure
  (org-agenda-skip-regexp org-table1-hline-regexp 
org-table-tab-recognizes-table\.el
   org-table-dataline-regexp org-table-any-border-regexp
   org-agenda-restriction-lock-overlay 
org-agenda-overriding-restriction
   org-agenda-diary-file org-complex-heading-regexp t)
  nil (setq imenu-create-index-function 'org-imenu-get-tree))
 (closure
  (org--rds reftex-docstruct-symbol org-element-greater-elements
   visual-fill-column-width org-clock-history 
org-agenda-current-date org-with-time
   org-defdecode org-def org-read-date-inactive org-ans2 
org-ans1
   org-columns-current-fmt-compiled org-clock-current-task 
org-clock-effort
   org-agenda-skip-function org-agenda-skip-comment-trees 
org-agenda-archives-mode
   org-end-time-was-given org-time-was-given org-log-note-extra 
org-log-note-purpose
   org-log-post-message org-last-inserted-timestamp 
org-last-changed-timestamp
   org-entry-property-inherited-from org-blocked-by-checkboxes 
org-state
   org-agenda-headline-snapshot-before-repeat 
org-agenda-buffer-name
   org-agenda-start-on-weekday org-agenda-buffer-tmp-name 
org-priority-regexp
   org-mode-abbrev-table org-mode-syntax-table 
org-element-use-cache
   org-element-cache-persistent buffer-face-mode-face 
org-tbl-menu org-org-menu
   org-struct-menu org-entities org-last-state 
org-id-track-globally
   org-clock-start-time texmathp-why remember-data-file
   org-agenda-tags-todo-honor-ignore-options 
iswitchb-temp-buflist
   calc-embedded-open-mode calc-embedded-open-formula 
calc-embedded-close-formula
   align-mode-rules-list org-emphasis-alist 
org-emphasis-regexp-components
   org-export-registered-backends org-modules crm-separator 
org-babel-load-languages
   org-id-overriding-file-name org-indent-indentation-per-level
   org-element-paragraph-separate org-agenda-buffer-name 
org-inlinetask-min-level t)
  nil (add-hook 'change-major-mode-hook 'org-show-all 'append 
'local))
 (closure
  (org-src-window-setup *this* 
org-babel-confirm-evaluate-answer-no
   org-babel-tangle-uncomment-comments 
org-src-preserve-indentation
   org-src-lang-modes 

Re: [BUG] Warning (emacs): org-element--cache: Unregistered buffer modifications detected. Resetting. [9.5 (release_9.5-223-g876e81 @ /usr/share/emacs/site-lisp/org/)]

2021-11-10 Thread Vladimir Lomov
Hello,
** Ihor Radchenko  [2021-11-11 13:54:05 +0800]:

> Vladimir Lomov  writes:

>> A few weeks ago I started seeing these warnings from Emacs:
>>
>> Warning (emacs): org-element--cache: Unregistered buffer modifications 
>> detected. Resetting.
>> ...
>> This happens when I edit a table. Even if I disable the warning
>> ("showing" and "logging"), editing is still very slow compared to what it
>> was.

> Thanks for reporting!

> Are you able to reproduce with emacs -Q?

No, editing table 'charges.org' in Emacs running as 'emacs -Q' works fine, but
it uses org mode shipped with Emacs. If I launch emacs as 'emacs -Q -l
org-min.el' then I see the same messages.

An interesting observation (I didn't check that before): if I use English
language (latin keyboard) all goes fine, but when I switch input method (C-\,
Russian language) I see these warnings and editing slows down.

> Are you using any third-party packages that have anything to do with tables?

I use several emacs packages, but they don't interact with Org buffers (except
CDLaTeX but I don't use it in particular file).

This is 'org-min.el' file:

- 8< -
(add-to-list 'load-path "/usr/share/emacs/site-lisp/org")
; (add-to-list 'load-path "/usr/share/emacs/site-lisp/org_contrib")
- 8< -

> Best,
> Ihor

---
WBR, Vladimir Lomov

-- 
Q:  What's the difference between USL and the Graf Zeppelin?
A:  The Graf Zeppelin represented cutting edge technology for its time.


signature.asc
Description: PGP signature


Re: [BUG] Warning (emacs): org-element--cache: Unregistered buffer modifications detected. Resetting. [9.5 (release_9.5-223-g876e81 @ /usr/share/emacs/site-lisp/org/)]

2021-11-10 Thread Ihor Radchenko
Vladimir Lomov  writes:

> A few weeks ago I started seeing these warnings from Emacs:
>
> Warning (emacs): org-element--cache: Unregistered buffer modifications 
> detected. Resetting.
> ...
> This happens when I edit a table. Even if I disable the warning
> ("showing" and "logging"), editing is still very slow compared to what it
> was.

Thanks for reporting!

Are you able to reproduce with emacs -Q? Are you using any third-party
packages that have anything to do with tables?

Best,
Ihor



[BUG] Warning (emacs): org-element--cache: Unregistered buffer modifications detected. Resetting. [9.5 (release_9.5-223-g876e81 @ /usr/share/emacs/site-lisp/org/)]

2021-11-10 Thread Vladimir Lomov



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.


Hello.

A few weeks ago I started seeing these warnings from Emacs:

Warning (emacs): org-element--cache: Unregistered buffer modifications 
detected. Resetting.
If this warning appears regularly, please report it to Org mode mailing list 
(M-x org-submit-bug-report).
The buffer is: charges.org
 Current command: org-self-insert-command
 Backtrace:
nil Disable showing Disable logging
Warning (emacs): org-element--cache: Unregistered buffer modifications 
detected. Resetting.
If this warning appears regularly, please report it to Org mode mailing list 
(M-x org-submit-bug-report).
The buffer is: charges.org
 Current command: org-self-insert-command
 Backtrace:
nil Disable showing Disable logging

This happens when I edit a table. Even if I disable the warning
("showing" and "logging"), editing is still very slow compared to what it
was.

Emacs  : GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.2430, 
cairo version 1.17.4)
 of 2021-11-10
Package: Org mode version 9.5 (release_9.5-223-g876e81 @ 
/usr/share/emacs/site-lisp/org/)

current state:
==
(setq
 org-archive-location "~/works/org/archive/%s::* Завершённые задания\n\n"
 org-link-elisp-confirm-function 'yes-or-no-p
 org-format-latex-header 
"\\documentclass{article}\n\\usepackage[conf=org-preview]{isu-th3}\n[NO-PACKAGES]\n[NO-DEFAULT-PACKAGES]\n[EXTRA]"
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
 org-log-done 'note
 org-log-into-drawer t
 org-agenda-files "/home/vladimir/works/org/agenda.txt"
 org-capture-templates '(("t" "Список заданий" entry (file+headline (format 
"%s/refile.org" x-org-directory) "Задания")
  (format "%%[%s/emacs/org/capture-todo.txt]" 
x-data-dir))
 ("j" "Журнал событий" entry (file+olp+datetree (format 
"%s/journal.org" x-org-directory))
  (format "%%[%s/emacs/org/capture-journal.txt]" 
x-data-dir))
 ("n" "Идеи, короткие заметки" entry (file+olp+datetree 
(format "%s/refile.org" x-org-directory))
  (format "%%[%s/emacs/org/capture-note-idea.txt]" 
x-data-dir))
 )
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-tag-alist '(("срочно" . 117) ("позвонить" . 99) ("задания" . 101) ("daily" 
. 100) ("schedule" . 115) ("работа" . 119)
 ("встреча" . 109) ("личное" . 112) (:startgroup) ("@универ" . 
110) ("@политех" . 111) ("@институт" . 105)
 ("@дом" . 104) (:endgroup))
 org-default-notes-file "/home/vladimir/works/org/refile.org"
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-file-apps '(("\\.pdf\\'" . "zathura %s") ("\\.pdf::\\([[:digit:]]+\\)\\'" 
. "zathura --page=%1 %s") (auto-mode . emacs)
 (system . system))
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-persist-before-read-hook '(org-element--cache-persist-before-read)
 org-modules '(ol-bbdb ol-bibtex ol-docview org-habit org-id ol-info 
org-protocol)
 org-mode-hook '((lambda nil (electric-indent-local-mode -1))
 #[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
 #[0 "\301\211\207" [imenu-create-index-function 
org-imenu-get-tree] 2])
 org-babel-load-languages '((emacs-lisp . t) (gnuplot . t) (asymptote . t) 
(perl . t) (R . t) (shell . t))
 org-src-window-setup 'split-window-right
 org-id-locations-file "/home/vladimir/.cache/emacs/org-id-locations"
 org-link-file-path-type 'relative
 org-confirm-shell-link-function 'yes-or-no-p
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-use-sub-superscripts '{}
 org-highlight-latex-and-related '(latex scripts entities)
 org-edit-src-auto-save-idle-delay 3
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-tangle-lang-exts '(("perl" . "pl") ("asymptote" . "asy") 
("emacs-lisp" . "el") ("elisp" . "el"))
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer
 (lambda nil (define-key org-src-mode-map [f2] 
'org-edit-src-save)))
 org-confirm-elisp-link-function 'yes-or-no-p
 org-todo-keywords '((sequence "TODO(t)" "|" "DONE(d)") (types "УНИВЕР(u)" 
"ИНСТИТУТ(i)" 

ob-clojure eval error when has comment at end of code line

2021-11-10 Thread Christopher M. Miles

I have following Clojure source block:

#+begin_src clojure
(re-find #"\d+" "I've just finished reading Fahrenheit 451");; => "451"
(re-find #"Bees" "Beads aren't cheap.");; => nil
#+end_src

When I press =[C-c C-c]= to evaluate source block, got error:

When there is no comments behind code lines. No this error.

#+begin_example
Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
  replace-regexp-in-string("nil" "" nil)
  (closure ((result0 "nil" nil "nil" "\"451\"" nil "\"451\"") (result-params 
"replace") (connection . #) (params (:colname-names) 
(:rowname-names) (:result-params "replace") (:result-type . value) (:results . 
"replace") (:exports . "") (:session . "none") (:hlines . "no") (:tangle . 
"no") (:cache . "yes") (:mkdirp . "yes") (:show-process . "no") (:noweb . 
"yes") (:eval . "yes")) (expanded . "(re-find #\"\\d+\" \"I've just finished 
reading Fahren...") inf-clojure-comint-prompt-regexp inf-clojure-buffer 
ob-clojure-inf-clojure-tmp-output ob-clojure-inf-clojure-filter-out t) (r) 
(replace-regexp-in-string "nil" "" r))(nil)
  mapcar((closure ((result0 "nil" nil "nil" "\"451\"" nil "\"451\"") 
(result-params "replace") (connection . #) (params (:colname-names) 
(:rowname-names) (:result-params "replace") (:result-type . value) (:results . 
"replace") (:exports . "") (:session . "none") (:hlines . "no") (:tangle . 
"no") (:cache . "yes") (:mkdirp . "yes") (:show-process . "no") (:noweb . 
"yes") (:eval . "yes")) (expanded . "(re-find #\"\\d+\" \"I've just finished 
reading Fahren...") inf-clojure-comint-prompt-regexp inf-clojure-buffer 
ob-clojure-inf-clojure-tmp-output ob-clojure-inf-clojure-filter-out t) (r) 
(replace-regexp-in-string "nil" "" r)) ("nil" nil "nil" "\"451\"" nil 
"\"451\""))
  (delete "" (mapcar #'(lambda (r) (replace-regexp-in-string "nil" "" r)) 
result0))
  (reverse (delete "" (mapcar #'(lambda (r) (replace-regexp-in-string "nil" "" 
r)) result0)))
  (ob-clojure-string-or-list (reverse (delete "" (mapcar #'(lambda (r) 
(replace-regexp-in-string "nil" "" r)) result0
  (if (not connection) (setq result0 "Please reevaluate when nREPL is 
connected") (let ((temp-buffer (generate-new-buffer " *temp*" t))) 
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert 
expanded) (goto-char (point-min)) (while (not (looking-at "\\s-*\\'")) (let* 
(... ... ...) (sit-for 0.1) (let ... ... (and (buffer-name temp-buffer) 
(kill-buffer temp-buffer) (ob-clojure-string-or-list (reverse (delete "" 
(mapcar #'(lambda (r) (replace-regexp-in-string "nil" "" r)) result0)
  (let ((connection (cider-current-connection (cdr (assq :target params 
(result-params (cdr (assq :result-params params))) result0) (if connection nil 
(sesman-start-session 'CIDER)) (if (not connection) (setq result0 "Please 
reevaluate when nREPL is connected") (let ((temp-buffer (generate-new-buffer " 
*temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect 
(progn (insert expanded) (goto-char (point-min)) (while (not ...) (let* ... ... 
...))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer) 
(ob-clojure-string-or-list (reverse (delete "" (mapcar #'(lambda ... ...) 
result0))
  ob-clojure-eval-with-cider("(re-find #\"\\d+\" \"I've just finished reading 
Fahren..." ((:colname-names) (:rowname-names) (:result-params "replace") 
(:result-type . value) (:results . "replace") (:exports . "") (:session . 
"none") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:mkdirp . "yes") 
(:show-process . "no") (:noweb . "yes") (:eval . "yes")))
  (cond ((eq org-babel-clojure-backend 'inf-clojure) 
(ob-clojure-eval-with-inf-clojure expanded params)) ((eq 
org-babel-clojure-backend 'cider) (ob-clojure-eval-with-cider expanded params)) 
((eq org-babel-clojure-backend 'slime) (ob-clojure-eval-with-slime expanded 
params)))
  (setq result (cond ((eq org-babel-clojure-backend 'inf-clojure) 
(ob-clojure-eval-with-inf-clojure expanded params)) ((eq 
org-babel-clojure-backend 'cider) (ob-clojure-eval-with-cider expanded params)) 
((eq org-babel-clojure-backend 'slime) (ob-clojure-eval-with-slime expanded 
params
  (let* ((expanded (org-babel-expand-body:clojure body params)) (result-params 
(cdr (assq :result-params params))) result) (setq result (cond ((eq 
org-babel-clojure-backend 'inf-clojure) (ob-clojure-eval-with-inf-clojure 
expanded params)) ((eq org-babel-clojure-backend 'cider) 
(ob-clojure-eval-with-cider expanded params)) ((eq org-babel-clojure-backend 
'slime) (ob-clojure-eval-with-slime expanded params (let ((--params 
result-params)) (if (member "none" --params) nil (if (or (member "scalar" 
--params) (member "verbatim" --params) (member "html" --params) (member "code" 
--params) (member "pp" --params) (member "file" --params) (and (or (member 
"output" --params) (member "raw" --params) (member "org" --params) (member 
"drawer" --params)) (not (member "table" --params result (condition-case 
nil (org-babel-script-escape result) 

Re: Worg HTML export problem?

2021-11-10 Thread Thomas S. Dye

Aloha Max,

Max Nikulin  writes:


On 08/11/2021 05:46, Thomas S. Dye wrote:
I pushed a new file, ob-doc-org.org, to Worg earlier today, but 
the link 
in 
https://orgmode.org/worg/org-contrib/babel/languages/index.html 
gives a 404
error.  I usually see this when the Org file has a bad link 
that causes export
to fail, but AFAICT ob-doc-org.org doesn't have this 
affliction--it exports

locally.
I've likely made some other error, but I don't have clue what 
it might be.

I don't know how to debug this.  Can someone help, please?


https://builds.sr.ht/~bzg/job/623225

[exporting] org-contrib/babel/languages/ob-doc-org.org
No org-babel-execute function for org!

However I do not see explicit load/require for particular 
language in sibling

files. I expected something like

#+begin_src emacs-lisp :exports none
  (require 'ob-org)
#+end_src


Thanks for looking into this.

Is the problem something I can fix in ob-doc-org.org?  Or, does it 
have to do with the configuration at sr.ht?


All the best,
Tom

--
Thomas S. Dye
https://tsdye.online/tsdye



Re: Introducing Org-transclusion

2021-11-10 Thread Noboru Ota
Ihor Radchenko  writes:

> Try to open the attached file and run M-x org-transclusion-add-all

Thank you. I see. Not even org-transclusion-add-all but a single add
function takes a bit of time.

If I may ask some questions and for some advice:

1. I see it as an issue rather of recursive transclusions (transclusions
inside a transclusion) than of overlay. Do you agree?

2. If it is a recursion, I would like to somehow avoid it altogether by
"skipping it" before going into a loop.  I thought I had done part of
it; apparently, it's not enough.  Do you have some suggestions how other
programs might deal with this type of issues?  I feel that many pieces
of software have done so...

3. If it is an overlay issue, do you have suggestions what sort of
methods are available within Emacs?  

4. This file does not seem realistic for me as a user who use Emacs for
writing -- but I see this sort of testing can be useful for avoiding
potential issues.  How important do you think it is to tackle this type
of "hypothetical" issues as a package developer?  It's a question of
priority for me.  I do not feel that I have sufficient knowledge and
skill set to tackle it right now; if the priority is not so high, I think
I would leave it (for now, but this "for now" would be for a long time).
If priority is high, I would need to ask for some help with even framing
the problem so that we can somehow tackle it.

Thank you.
Noboru



Re: upgrade to 9.5 failed:

2021-11-10 Thread Pete Siemsen
Ihor,

I downloaded the latest, and it works.

Thanks!

-- Pete



On Tue, Nov 9, 2021 at 7:16 PM Ihor Radchenko  wrote:

> Pete Siemsen  writes:
>
> > Thank you. That changed things, so I guess it's getting better. Now when
> I
> > do a TAB, I get
> >
> > Cannot open load file. No such file or directory, xdg
>
> Note that Org does not officially support Aquamacs. For now, I fixed
> this particular issue because it also affects Emacs 25. However, this
> part of Org is currently a subject of change. Feel free to join the
> discussion at https://list.orgmode.org/87ee7yaksm.fsf@localhost/ to make
> your voice (as Aquamacs user) heard.
>
> Best,
> Ihor
>


Re: Worg HTML export problem?

2021-11-10 Thread Max Nikulin

On 08/11/2021 05:46, Thomas S. Dye wrote:


I pushed a new file, ob-doc-org.org, to Worg earlier today, but the link 
in https://orgmode.org/worg/org-contrib/babel/languages/index.html gives 
a 404 error.  I usually see this when the Org file has a bad link that 
causes export to fail, but AFAICT ob-doc-org.org doesn't have this 
affliction--it exports locally.


I've likely made some other error, but I don't have clue what it might be.

I don't know how to debug this.  Can someone help, please?


https://builds.sr.ht/~bzg/job/623225

[exporting] org-contrib/babel/languages/ob-doc-org.org
No org-babel-execute function for org!

However I do not see explicit load/require for particular language in 
sibling files. I expected something like


#+begin_src emacs-lisp :exports none
  (require 'ob-org)
#+end_src




Re: Incorrect link is stored (org-elements?)

2021-11-10 Thread Ihor Radchenko
Max Nikulin  writes:

> With equivalent patch (attached one has additional differences in spaces 
> around) my particular case works. I have no idea which additional 
> scenarios it may affect. I did not test the patch extensively. I faced 
> the issue while I was preparing a patch to fix storing double #CUSTOM_ID 
> links.

I pushed the patch upstream.

> P.S. I am puzzled that `org-element-at-point' returns paragraph even 
> when patch is not applied. After such call `org-store-link' does what I 
> expect. However "after undo" erroneous state survives emacs restart, 
> thanks to org-persist, I believe.

The bug was in very specific case. org-element-at-point now has a
special fast mode of operation when CACHED-ONLY argument is non-nil. In
this mode, it does not try to parse anything, but only checks the
nearest cached element and returns it if point is at the element
beginning, within +begin/end line of the element, or inside a
non-greater element. The error happened when the cached element was a
section and point was within blank lines at the end of the section
exactly one symbol before the following headline. In such cases,
org-element-at-point must follow some special rules (see comments in
org-element--parse-to), but it did not in this specific scenario.
On top of that, org-element-parse-to cannot return section and the
current code assumes that we ever attempt to return section when point
is at the beginning of section. So, it returns
(org-element-at-point (1+ pos)) instead. Hence, the next headline
was wrongly returned when (1) point is 1- beginning of next headline
(2) we are within blank lines at the end of section (3) some edit in
buffer just cleared everything in cache inside current section
(4) org-element-at-point is called with non-nil CACHED-ONLY argument.

Just calling org-element-at-point did not trigger error. You would need
to call (org-element-at-point nil 'cached)

Best,
Ihor




Re: Incorrect link is stored (org-elements?)

2021-11-10 Thread Max Nikulin

On 09/11/2021 18:46, Ihor Radchenko wrote:

Max Nikulin writes:


`org-store-link' under some conditions may pick a link to wrong heading.
Emacs-26.3, Org main~1.


I can reproduce, though not exactly following your steps.
Can you try the attached patch?


With equivalent patch (attached one has additional differences in spaces 
around) my particular case works. I have no idea which additional 
scenarios it may affect. I did not test the patch extensively. I faced 
the issue while I was preparing a patch to fix storing double #CUSTOM_ID 
links.


P.S. I am puzzled that `org-element-at-point' returns paragraph even 
when patch is not applied. After such call `org-store-link' does what I 
expect. However "after undo" erroneous state survives emacs restart, 
thanks to org-persist, I believe.






Re: Bug: org-no-popups disregards display-buffer-fallback-action [9.4.6 (9.4.6-13-g4be129-elpaplus @ /home/jeeger/.emacs.d/elpa/org-plus-contrib-20210920/)]

2021-11-10 Thread Ihor Radchenko
Jan Seeger via "General discussions about Org-mode."
 writes:

> Hello!
>
> I'm trying to make multi-frame emacsing nicer, and I encountered what I
> consider a bug with the `org-no-popups` macro in `org-macs.el`.

This problem has been fixed in Org 9.5. Feel free to update. See
https://orgmode.org/org.html#Installation for installation instructions.

Best,
Ihor



Bug: org-no-popups disregards display-buffer-fallback-action [9.4.6 (9.4.6-13-g4be129-elpaplus @ /home/jeeger/.emacs.d/elpa/org-plus-contrib-20210920/)]

2021-11-10 Thread General discussions about Org-mode.


Hello!

I'm trying to make multi-frame emacsing nicer, and I encountered what I
consider a bug with the `org-no-popups` macro in `org-macs.el`.

`org-no-popups` tries to surpress the creation of new frames via setting
`pop-up-frames` and `display-buffer-alist` to nil temporarily. This does
not take `display-buffer-fallback-action` into account, which is the
preferred way of making Emacs pop up new frames (or not, as the case may
be). When the fallback variable is set, code run inside `org-no-popups`
still creates new popups, which causes functions such as
`org-insert-link` to fail, or at least act *very* confusingly.

The preferred way of overriding the behavior of `display-buffer` for
localized Emacs code seems to be the variable
`display-buffer-overriding-action`.

Changing the definition of `org-no-popups` to

```
(defmacro org-no-popups ( body)
  "Suppress popup windows and evaluate BODY."
  `(let ((display-buffer-overriding-action '(display-buffer-pop-up-window)))
 ,@body))
```

correctly makes org pop up windows instead of frames.

Please contact me if you have any questions!

Best regards,
Jan Seeger

---

Emacs  : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, 
cairo version 1.16.0)
Package: Org mode version 9.4.6 (9.4.6-13-g4be129-elpaplus @ 
/home/jeeger/.emacs.d/elpa/org-plus-contrib-20210920/)



Bug: org-no-popups disregards display-buffer-fallback-action [9.4.6 (9.4.6-13-g4be129-elpaplus @ /home/jeeger/.emacs.d/elpa/org-plus-contrib-20210920/)]

2021-11-10 Thread General discussions about Org-mode.


Hello!

I'm trying to make multi-frame emacsing nicer, and I encountered what I
consider a bug with the `org-no-popups` macro in `org-macs.el`.

`org-no-popups` tries to surpress the creation of new frames via setting
`pop-up-frames` and `display-buffer-alist` to nil temporarily. This does
not take `display-buffer-fallback-action` into account, which is the
preferred way of making Emacs pop up new frames (or not, as the case may
be). When the fallback variable is set, code run inside `org-no-popups`
still creates new popups, which causes functions such as
`org-insert-link` to fail, or at least act *very* confusingly.

The preferred way of overriding the behavior of `display-buffer` for
localized Emacs code seems to be the variable
`display-buffer-overriding-action`.

Changing the definition of `org-no-popups` to

```
(defmacro org-no-popups ( body)
  "Suppress popup windows and evaluate BODY."
  `(let ((display-buffer-overriding-action '(display-buffer-pop-up-window)))
 ,@body))
```

correctly makes org pop up windows instead of frames.

Please contact me if you have any questions!

Best regards,
Jan Seeger

---

Emacs  : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, 
cairo version 1.16.0)
Package: Org mode version 9.4.6 (9.4.6-13-g4be129-elpaplus @ 
/home/jeeger/.emacs.d/elpa/org-plus-contrib-20210920/)