Re: Problems getting org-macs.el macros to be loaded
Hi, I updated to a newer 29 release branch commit, and now things work, must have been a glitch. Kind regards, Bram Adams On 30-11-22 2:07 p.m., Bram Adams wrote: Hi, I just built the latest Emacs 29 version from the upstream release branch, which comes with org 9.6-3-ga4d38e (no other org version installed). Overall, it seems like org-macs.el is not loaded properly, since I get issues with invalid function errors for "org-assert-version" and "org-current-text-indentation", even though those are actually macros. The "org-assert-version" issue caused org to misbehave entirely, until I added an empty function definition for "org-assert-version" (native compilation still chokes on this). I could not find a workaround for the "org-current-text-indentation" case, which is used when narrowing code blocks. Adding "(require 'org-macs)" early in my init file did not resolve anything. FWIW, here's how I've been loading org mode since Emacs 26: == (use-package org :commands (org-heading-components org-read-date) :diminish org-indent-mode :mode (("\\.org$" . org-mode)) :init (add-hook 'org-load-hook #'+org-init-babel-lazy-loader-h) :config [...] ) == Any ideas what could go wrong? Kind regards, Bram Adams
Problems getting org-macs.el macros to be loaded
Hi, I just built the latest Emacs 29 version from the upstream release branch, which comes with org 9.6-3-ga4d38e (no other org version installed). Overall, it seems like org-macs.el is not loaded properly, since I get issues with invalid function errors for "org-assert-version" and "org-current-text-indentation", even though those are actually macros. The "org-assert-version" issue caused org to misbehave entirely, until I added an empty function definition for "org-assert-version" (native compilation still chokes on this). I could not find a workaround for the "org-current-text-indentation" case, which is used when narrowing code blocks. Adding "(require 'org-macs)" early in my init file did not resolve anything. FWIW, here's how I've been loading org mode since Emacs 26: == (use-package org :commands (org-heading-components org-read-date) :diminish org-indent-mode :mode (("\\.org$" . org-mode)) :init (add-hook 'org-load-hook #'+org-init-babel-lazy-loader-h) :config [...] ) == Any ideas what could go wrong? Kind regards, Bram Adams
Re: Bug (with fix): org-tempo-add-block incorrectly inserts comma before next `#+begin_src' during expansion [9.3.2 (9.3.2-8-g47b104-elpaplus @ ~/.emacs.d/elpa/org-plus-contrib-20200127/)]
Hi Bastien, > Yes, you're right, my fix was wrong - I've followed your indication > and removed the second occurrence of '>. > > What happens is this: the template expansion calls org-edit-src-code > which gets the wrong source block boundaries, thus escaping "#+begin" > with a comma. > > Looking at the second '>, I think there is no need for it here (it > means: "indent the line"), so we're safe removing it without touching > `org-edit-src-code' for now. OK, makes sense, thanks! Kind regards, Bram Adams > I still think org-edit-src-code should only be called interactively, > not through internal calls. I'll see if this needs to be fixed too. > > Best, > > -- > Bastien >
Re: Bug (with fix): org-tempo-add-block incorrectly inserts comma before next `#+begin_src' during expansion [9.3.2 (9.3.2-8-g47b104-elpaplus @ ~/.emacs.d/elpa/org-plus-contrib-20200127/)]
Hi Bastien, >> Are you referring to commit cad2a6a588? > > Yes, this commit. I applied the commit, but still encounter the same issue, unless I disable `org-src-tab-acts-natively’ or remove ‘> in the org-tempo macro. Kind regards, Bram Adams
Re: Bug (with fix): org-tempo-add-block incorrectly inserts comma before next `#+begin_src' during expansion [9.3.2 (9.3.2-8-g47b104-elpaplus @ ~/.emacs.d/elpa/org-plus-contrib-20200127/)]
Hi Bastien, > this should be fixed now in maint and master. Thanks for looking into this. > I implemented a different fix, please test it and report > any problem. Are you referring to commit cad2a6a588? Kind regards, Bram Adams
Re: Bug (with fix): org-tempo-add-block incorrectly inserts comma before next `#+begin_src' during expansion [9.3.2 (9.3.2-8-g47b104-elpaplus @ ~/.emacs.d/elpa/org-plus-contrib-20200127/)]
Hi Ihor, > It's a duplicate of my earlier bug report > https://lists.gnu.org/archive/html/emacs-orgmode/2019-12/msg00326.html > <https://lists.gnu.org/archive/html/emacs-orgmode/2019-12/msg00326.html> True, I seem to notice the same symptoms and also had `org-src-tab-acts-natively’ set. > Hope, there will be some progress. Yes, hopefully removing the `’>’ in org-tempo.el is only a temporary hack (cannot use `org-insert-structure-template’ due to other templates). Thanks for the quick reply, Bram Adams > Bram Adams writes: > >> Hi, >> >> I encountered a bug in org-tempo-add-block, where the following snippet in >> an org file (with “> `org-structure-template-alist’): >> === >> > >> [random text, potentially empty] >> >> #+begin_src any_code_block >> […] >> #+end_src >> === >> >> … expands into (notice the comma before `#+begin'): >> === >> [expansion of > >> [random text, potentially empty] >> >> ,#+begin_src any_code_block >> […] >> #+end_src >> === >> >> (The issue does not occur when using `org-insert-structure-template’.) >> >> The spurious comma seems to be generated by the second `’>’ on line 125 of >> org-tempo.el: >> === >> (defun org-tempo-add-block (entry) >> "Add block entry from `org-structure-template-alist'." >> (let* ((key (format "<%s" (car entry))) >> (name (cdr entry)) >> (special (member name '("src" "export" >>(tempo-define-template (format "org-%s" (replace-regexp-in-string " " "-" >> name)) >> `(,(format "#+begin_%s%s" name (if special " " "")) >> ,(when special 'p) '> n '> ,(unless special 'p) n >> ;; <—— line 125 >> ,(format "#+end_%s" (car (split-string name " "))) >> >) >> key >> (format "Insert a %s block" name) >> 'org-tempo-tags))) >> === >> >> Removing the second `’>’ on line 125 fixes the issue. >> >> Kind regards, >> >> Bram Adams >> >> >> === >> === >> === >> >> Emacs : GNU Emacs 26.3 (build 1, x86_64-apple-darwin17.7.0, Carbon Version >> 158 AppKit 1561.6) >> of 2019-08-29 >> Package: Org mode version 9.3.2 (9.3.2-8-g47b104-elpaplus @ >> ~/.emacs.d/elpa/org-plus-contrib-20200127/) >> >> current state: >> == >> (setq >> org-src-mode-hook '(org-src-babel-configure-edit-buffer >> org-src-mode-configure-edit-buffer) >> org-fontify-whole-heading-line t >> org-refile-target-verify-function 'verify-refile-target >> org-agenda-scheduled-leaders '("Sch.: " "Sch.%2dx: ") >> org-link-shell-confirm-function 'yes-or-no-p >> org-babel-after-execute-hook '(org-redisplay-inline-images) >> org-tempo-keywords-alist nil >> org-metadown-hook '(org-babel-pop-to-session-maybe) >> org-clock-out-hook '(org-clock-remove-empty-clock-drawer) >> org-refile-targets '((nil :maxlevel . 4) (filter_out_cal :maxlevel . 4)) >> org-enforce-todo-dependencies t >> org-edit-src-content-indentation 0 >> org-src-tab-acts-natively t >> org-special-ctrl-a/e t >> org-agenda-files '(“/path/to/org/" >>“/path/to/org/archive/") >> org-shiftup-final-hook '(windmove-up) >> org-blocker-hook '(org-block-todo-from-checkboxes >>org-block-todo-from-children-or-siblings-or-parent) >> org-archive-location "archive/%s_archive.gpg::" >> org-super-agenda-mode t >> org-mode-hook '(add-pcomplete-to-capf org-bullets-mode org-tempo-setup >> #[0 "\300\301\302\303\304$\207" >> [add-hook change-major-mode-hook org-show-all append >> local] 5] >> ob-ipython-auto-configure-kernels >> #[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-eldoc-load) >> org-outline-path-complete-in-steps nil
Bug (with fix): org-tempo-add-block incorrectly inserts comma before next `#+begin_src' during expansion [9.3.2 (9.3.2-8-g47b104-elpaplus @ ~/.emacs.d/elpa/org-plus-contrib-20200127/)]
Hi, I encountered a bug in org-tempo-add-block, where the following snippet in an org file (with “’ on line 125 of org-tempo.el: === (defun org-tempo-add-block (entry) "Add block entry from `org-structure-template-alist'." (let* ((key (format "<%s" (car entry))) (name (cdr entry)) (special (member name '("src" "export" (tempo-define-template (format "org-%s" (replace-regexp-in-string " " "-" name)) `(,(format "#+begin_%s%s" name (if special " " "")) ,(when special 'p) '> n '> ,(unless special 'p) n ;; <—— line 125 ,(format "#+end_%s" (car (split-string name " "))) >) key (format "Insert a %s block" name) 'org-tempo-tags))) === Removing the second `’>’ on line 125 fixes the issue. Kind regards, Bram Adams === === === Emacs : GNU Emacs 26.3 (build 1, x86_64-apple-darwin17.7.0, Carbon Version 158 AppKit 1561.6) of 2019-08-29 Package: Org mode version 9.3.2 (9.3.2-8-g47b104-elpaplus @ ~/.emacs.d/elpa/org-plus-contrib-20200127/) current state: == (setq org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-fontify-whole-heading-line t org-refile-target-verify-function 'verify-refile-target org-agenda-scheduled-leaders '("Sch.: " "Sch.%2dx: ") org-link-shell-confirm-function 'yes-or-no-p org-babel-after-execute-hook '(org-redisplay-inline-images) org-tempo-keywords-alist nil org-metadown-hook '(org-babel-pop-to-session-maybe) org-clock-out-hook '(org-clock-remove-empty-clock-drawer) org-refile-targets '((nil :maxlevel . 4) (filter_out_cal :maxlevel . 4)) org-enforce-todo-dependencies t org-edit-src-content-indentation 0 org-src-tab-acts-natively t org-special-ctrl-a/e t org-agenda-files '(“/path/to/org/" “/path/to/org/archive/") org-shiftup-final-hook '(windmove-up) org-blocker-hook '(org-block-todo-from-checkboxes org-block-todo-from-children-or-siblings-or-parent) org-archive-location "archive/%s_archive.gpg::" org-super-agenda-mode t org-mode-hook '(add-pcomplete-to-capf org-bullets-mode org-tempo-setup #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-show-all append local] 5] ob-ipython-auto-configure-kernels #[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-eldoc-load) org-outline-path-complete-in-steps nil org-archive-hook '(org-attach-archive-delete-maybe) org-confirm-elisp-link-function 'yes-or-no-p org-agenda-finalize-hook '(ap/org-super-agenda-origami-fold-default gs/org-agenda-project-highlight-warning #[0 "\300ed\301#\207" [remove-text-properties (mouse-face t)] 4] ) org-agenda-before-write-hook '(org-agenda-add-entry-text) org-metaup-hook '(org-babel-load-in-session-maybe) org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn ENTRY)"] org-shiftdown-final-hook '(windmove-down) org-agenda-deadline-faces '((1.001 . error) (1.0 . org-warning) (0.5 . org-upcoming-deadline) (0.0 . org-upcoming-distant-deadline)) org-track-ordered-property-with-tag t org-babel-pre-tangle-hook '(save-buffer) org-file-apps '((auto-mode . emacs) ("\\.mm\\'" . default) ("\\.x?html?\\'" . default) ("\\.pdf\\'" . default) ("\\.jpg\\'" . system) ("\\.JPG\\'" . system) ("\\.png\\'" . system) ("\\.PNG\\'" . system)) org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-hide-leading-stars t org-babel-load-languages '((R . t) (sql . t) (shell . t) (dot . t) (sqlite . t) (perl . t) (ditaa . t) (ipython . t) (python . t) (applescript . t) (emacs-lisp . t)) org-shiftright-final-hook '(windmove-right) org-agenda-time-grid '((daily today remove-match) (800 1200 1600 2000) ".." "") org-log-done 'time org-highlight-latex-and-related '(latex) org-ellipsis