Hey Ihor, I recently upgraded my emacs to emacs@29 via homebrew, and I know
this is an
old thread, but now that my new emacs version comes with org-9.6.6, I am
getting the same
issues as I detailed in this thread with my org capture templates. I tried
to do a reproduce
with emacs -q but the error does not reproduce in those conditions, so it
might be an issue
with org mode interacting with some of my other packages installed.

I will include a list of emacs packages I have installed, and my
org-init.el file. Maybe you
could see if anything jumps out at you that is causing this weird behavior.

On Mon, Apr 17, 2023 at 6:40 AM Carlo Tambuatco <oraclmas...@gmail.com>
wrote:

> I've decided to delete the org-9.6 folder entirely and go with the
> built-in org-9.5.5 that comes with my emacs distribution, emacs-28.2 (9.0).
>
> Maybe for some reason newer versions of org are just incompatible with
> my version of emacs 28.2. Maybe the version of emacs you're using is
> newer or somehow more compatible with these bleeding edge development
> versions of org-mode, but I suppose when I upgrade my emacs the version
> of org that comes with it (9.6, I suppose) will just work out of the box.
>
> At any rate, I can't spend any more time and energy on this. I'll stick to
> what works. Thanks for the help.
>
> On Sun, Apr 16, 2023 at 8:09 AM Ihor Radchenko <yanta...@posteo.net>
> wrote:
>
>> Carlo Tambuatco <oraclmas...@gmail.com> writes:
>>
>> > I restarted emacs with org 9.6.3 and reloaded it uncompiled and
>> > did M-x toggle-debug-on-error to turn on backtrace on error.
>> >
>> > I have also attached a copy of what my org-capture-templates
>> > variable looks like.
>> >
>> > Comparing these backtraces to my org-capture-templates,
>> > you can see that only some of them fail (the ones corresponding to
>> > 'd', 'e', 'r', 'Rr', 'Rg', and 'Cc')
>> >
>> > They all worked up until Org 9.6. They still work under Org 9.5.5, so
>> > I don't know what changed.
>>
>> I tried your templates locally and I am not seeing any problem.
>>
>> May you try to reproduce starting from emacs -Q?
>> Or, alternatively, try to use the following version of Org capture, use
>> C-g to exit, and report the (hopefully) more detailed backtrace.
>>
>> (defun org-capture (&optional goto keys)
>>   "Capture something.
>> \\<org-capture-mode-map>
>> This will let you select a template from `org-capture-templates', and
>> then file the newly captured information.  The text is immediately
>> inserted at the target location, and an indirect buffer is shown where
>> you can edit it.  Pressing `\\[org-capture-finalize]' brings you back to
>> the \
>> previous
>> state of Emacs, so that you can continue your work.
>>
>> When called interactively with a `\\[universal-argument]' prefix argument
>> \
>> GOTO, don't
>> capture anything, just go to the file/headline where the selected
>> template stores its notes.
>>
>> With a `\\[universal-argument] \\[universal-argument]' prefix argument,
>> go to \
>> the last note stored.
>>
>> When called with a `C-0' (zero) prefix, insert a template at point.
>>
>> When called with a `C-1' (one) prefix, force prompting for a date when
>> a datetree entry is made.
>>
>> ELisp programs can set KEYS to a string associated with a template
>> in `org-capture-templates'.  In this case, interactive selection
>> will be bypassed.
>>
>> If `org-capture-use-agenda-date' is non-nil, capturing from the
>> agenda will use the date at point as the default date.  Then, a
>> `C-1' prefix will tell the capture process to use the HH:MM time
>> of the day at point (if any) or the current HH:MM time."
>>   (interactive "P")
>>   (when (and org-capture-use-agenda-date
>>              (eq major-mode 'org-agenda-mode))
>>     (setq org-overriding-default-time
>>           (org-get-cursor-date (equal goto 1))))
>>   (cond
>>    ((equal goto '(4))  (org-capture-goto-target keys))
>>    ((equal goto '(16)) (org-capture-goto-last-stored))
>>    (t
>>     (let* ((orig-buf (current-buffer))
>>            (annotation (if (and (boundp
>> 'org-capture-link-is-already-stored)
>>                                 org-capture-link-is-already-stored)
>>                            (plist-get org-store-link-plist :annotation)
>>                          (ignore-errors (org-store-link nil))))
>>            (entry (or org-capture-entry (org-capture-select-template
>> keys)))
>>            initial)
>>       (setq initial (or org-capture-initial
>>                         (and (org-region-active-p)
>>                              (buffer-substring (point) (mark)))))
>>       (when (stringp initial)
>>         (remove-text-properties 0 (length initial) '(read-only t)
>> initial))
>>       (when (stringp annotation)
>>         (remove-text-properties 0 (length annotation)
>>                                 '(read-only t) annotation))
>>       (cond
>>        ((equal entry "C")
>>         (customize-variable 'org-capture-templates))
>>        ((equal entry "q")
>>         (user-error "Abort"))
>>        (t
>>         (org-capture-set-plist entry)
>>         (org-capture-get-template)
>>         (org-capture-put :original-buffer orig-buf
>>                          :original-file (or (buffer-file-name orig-buf)
>>                                             (and (featurep 'dired)
>>                                                  (car (rassq orig-buf
>>
>>  dired-buffers))))
>>                          :original-file-nondirectory
>>                          (and (buffer-file-name orig-buf)
>>                               (file-name-nondirectory
>>                                (buffer-file-name orig-buf)))
>>                          :annotation annotation
>>                          :initial initial
>>                          :return-to-wconf (current-window-configuration)
>>                          :default-time (or org-overriding-default-time
>>                                            (org-current-time)))
>>         (org-capture-set-target-location (and (equal goto 0) 'here))
>>         (condition-case error
>>             (org-capture-put :template (org-capture-fill-template))
>>           ((error quit)
>>            (if (get-buffer "*Capture*") (kill-buffer "*Capture*"))
>>            (error "Capture abort: %s" (error-message-string error))))
>>
>>         (setq org-capture-clock-keep (org-capture-get :clock-keep))
>>             (org-capture-place-template
>>              (eq (car (org-capture-get :target)) 'function))
>>         (when (and (derived-mode-p 'org-mode) (org-capture-get :clock-in))
>>           (condition-case nil
>>               (progn
>>                 (when (org-clock-is-active)
>>                   (org-capture-put :interrupted-clock
>>                                    (copy-marker org-clock-marker)))
>>                 (org-clock-in)
>>                 (setq-local org-capture-clock-was-started
>>                             (copy-marker org-clock-marker)))
>>             (error "Could not start the clock in this capture buffer")))
>>         (when (org-capture-get :immediate-finish)
>>           (org-capture-finalize))))))))
>>
>> --
>> Ihor Radchenko // yantar92,
>> Org mode contributor,
>> Learn more about Org mode at <https://orgmode.org/>.
>> Support Org development at <https://liberapay.com/org-mode>,
>> or support my work at <https://liberapay.com/yantar92>
>>
>
0blayout-readme.txt
a-20210929.1510
abyss-theme-readme.txt
ac-anaconda-readme.txt
ac-html-20151005.731
ac-html-angular-readme.txt
ac-html-csswatcher-readme.txt
ac-ispell-20151101.226
ac-php-20230522.1329
ac-php-core-20230529.1404
ac-python-20110519
ac-slime-20171027.2100
ace-flyspell-readme.txt
achievements-readme.txt
adjust-parens-readme.txt
aio-20200610.1904
alert-20221213.1619
archives
async-20230528.622
atom-dark-theme-20220114.1902
auctex-13.2.0
auctex-13.2.0.signed
auto-complete-20221231.1633
bbdb-20220706.433
bind-key-20230203.2004
chess-2.0.5
chess-2.0.5.signed
cider-1.7.0
clojure-mode-5.16.0
coffee-mode-20200315.1133
commenter-20160219.1627
company-20230416.2034
company-irony-20190124.2346
compat-29.1.4.1
compat-29.1.4.1.signed
concurrent-20170601.435
creole-20140924.1500
csv-readme.txt
ctable-20210128.629
dart-mode-20220401.0
dash-20230502.1324
db-20140421.2111
db-pg-readme.txt
db-readme.txt
deferred-20170901.1330
ebf-readme.txt
eclim-readme.txt
eglot-20221020.1010
eldoc-1.14.0
eldoc-1.14.0.signed
elnode-20190702.1509
elpy-20230402.1946
env-var-import-2.1
epc-20140610.534
epl-20180205.2049
ess-20230419.1527
exec-path-from-shell-20220826.1535
extend-dnd-readme.txt
eyuml-readme.txt
f-20230116.1032
fakir-20140729.1652
flycheck-20230306.414
flycheck-irony-20180604.2152
flycheck-kotlin-20230111.1907
flycheck-nimsuggest-20171027.2208
flycheck-perl6-20180509.2201
flycheck-swift-readme.txt
flymake-1.3.4
flymake-1.3.4.signed
flyspell-correct-readme.txt
geeknote-readme.txt
gh-readme.txt
git-commit-20230521.2344
gntp-20141025.250
gnupg
gnuplot-20230323.1400
gnuplot-mode-20171013.1616
gnuplot-mode-readme.txt
go-mode-20221228.1706
gradle-mode-20150313.1905
hackernews-readme.txt
helm-20230529.1452
helm-core-20230505.802
helm-perldoc-readme.txt
helm-projectile-20221215.613
highlight-indentation-20210221.1418
horoscope-readme.txt
ht-20230214.1632
htmlize-20200816.746
htmlize-20210825.2150
humanoid-themes-20230308.2129
indium-20210309.1210
inkpot-theme-20230511.116
ipython.el
irony-20220110.849
irony-eldoc-20200622.2214
ivy-20230410.1815
japanlaw-readme.txt
jdee-20191102.1426
jedi-20191011.1750
jedi-core-20210503.1315
js2-mode-20230509.2244
js2-refactor-20210306.2003
json-process-client-20210525.733
julia-mode-20230510.745
kotlin-mode-20230123.1859
kubernetes-readme.txt
kv-20140108.1534
latex-extra-20220817.5
let-alist-1.0.6
let-alist-1.0.6.signed
log4e-20211019.948
lsp-mode-20230524.1820
lua-mode-20221218.605
lv-20200507.1518
macrostep-20230518.1911
magit-20230530.1403
magit-section-20230521.1803
markdown-mode+-20170320.2104
markdown-mode-20230522.147
meghanada-readme.txt
memoize-20200103.2036
modus-operandi-theme-20201114.729
modus-vivendi-theme-20201114.729
multiple-cursors-20230309.1204
muse-3.20.2
muse-3.20.2.signed
muse-readme.txt
nim-mode-20211102.917
noflet-20141102.1454
ob-kotlin-20180823.1321
orca-readme.txt
org-9.5.5
org-ac-readme.txt
org-agenda-property-readme.txt
org-alert-20230520.1449
org-analyzer-20191001.1717
org-autolist-20220530.1620
org-board-readme.txt
org-brain-readme.txt
org-bullets-20200317.1740
org-category-capture-readme.txt
org-chef-readme.txt
org-dropbox-readme.txt
org-ehtml-readme.txt
org-evil-readme.txt
org-gcal-20221212.1817
org-grep-20230424.2005
org-if-readme.txt
org-kanban-readme.txt
org-mind-map-readme.txt
org-notebook-readme.txt
org-outlook-readme.txt
org-random-todo-readme.txt
org-recur-readme.txt
org-super-agenda-readme.txt
org-tree-slide-readme.txt
orgit-readme.txt
orglue-readme.txt
osx-dictionary-readme.txt
osx-plist-readme.txt
paredit-20221127.1452
parseclj-20220422.936
parseedn-20220520.835
pdf-tools-20230404.327
perl6-mode-20200414.1930
persist-0.5
persist-0.5.signed
php-extras-2.2.0.20140405
php-mode-20230521.1700
pinentry-0.1
pinentry-0.1.signed
pinentry-readme.txt
pkg-info-20150517.1143
podcaster-readme.txt
popup-20221231.1634
project-0.9.8
project-0.9.8.signed
projectile-20230317.1101
python-environment-20150310.853
python-info-20151228.1852
python-mode-20230515.722
pyvenv-20211014.707
queue-0.2
queue-0.2.signed
reformatter-20220627.825
request-20230127.417
request-deferred-20220614.1604
rg-20230430.721
ruby-additional-readme.txt
rust-mode-20230112.27
rustic-20230130.912
rw-hunspell-0.2
s-20220902.1511
seq-2.22
seq-2.22.signed
seq-2.23
seq-2.23.signed
sesman-20190909.1754
sesman-20210901.1134
skype-readme.txt
slime-20230314.915
solarized-theme-20230507.1413
spacemacs-theme-20230530.1751
spinner-1.7.4
spinner-1.7.4.signed
swank-cdt-1.0.1
sweetgreen-readme.txt
swift-mode-20230507.717
swift3-mode-readme.txt
swiper-20230410.1815
swiper-helm-20180131.1744
swiper-helm-readme.txt
sx-readme.txt
tNFA-readme.txt
tablist-20230321.705
test-simple-readme.txt
transient-20230601.1854
try-20181204.236
try-readme.txt
use-package-20230426.2324
vs-dark-theme-20230415.435
web-20141231.2001
web-mode-20230329.601
wgrep-20230203.1214
winum-20190911.1607
with-editor-20230511.2142
worf-readme.txt
xcscope-20210719.828
xref-1.6.3
xref-1.6.3.signed
xterm-color-20230321.3
yasnippet-20200604.246
zig-mode-20230307.1215

Attachment: org-init.el
Description: Binary data

Reply via email to