Re: [BUG] Org-9.6.x org templates hang on 'clipboard pasted as level 2 subtree'...

2023-06-07 Thread Ihor Radchenko
Carlo Tambuatco  writes:

> 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.

You may try https://github.com/Malabarba/elisp-bug-hunter to narrow down
the cause in your config.

If that does not work, we can try to arrange jitsi call to investigate
in more details.

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



Re: [BUG] Org-9.6.x org templates hang on 'clipboard pasted as level 2 subtree'...

2023-06-06 Thread Carlo Tambuatco
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 
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 
> wrote:
>
>> Carlo Tambuatco  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 ( goto keys)
>>   "Capture something.
>> \\
>> 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)
>> 

Re: [BUG] Org-9.6.x org templates hang on 'clipboard pasted as level 2 subtree'...

2023-04-17 Thread Carlo Tambuatco
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  wrote:

> Carlo Tambuatco  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 ( goto keys)
>   "Capture something.
> \\
> 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 

Re: [BUG] Org-9.6.x org templates hang on 'clipboard pasted as level 2 subtree'...

2023-04-16 Thread Ihor Radchenko
Carlo Tambuatco  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 ( goto keys)
  "Capture something.
\\
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

Re: [BUG] Org-9.6.x org templates hang on 'clipboard pasted as level 2 subtree'...

2023-04-15 Thread Carlo Tambuatco
Sorry it took so long to get a backtrace going...I've been really busy.

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.

These backtraces were produced when I hit C-g to abort a
capture template that got stuck on
'clipboard pasted as level 2 subtree',

Let me know what you think.

Here are some of the backtraces generated:

Debugger entered--Lisp error: (error "Capture template ‘d’: Quit")
  signal(error ("Capture template ‘d’: Quit"))
  error("Capture template `%s': %s" "d" "Quit")
  org-capture(nil)
  funcall-interactively(org-capture nil)
  call-interactively(org-capture nil nil)
  command-execute(org-capture)

Debugger entered--Lisp error: (error "Capture template ‘e’: Quit")
  signal(error ("Capture template ‘e’: Quit"))
  error("Capture template `%s': %s" "e" "Quit")
  org-capture(nil)
  funcall-interactively(org-capture nil)
  call-interactively(org-capture nil nil)
  command-execute(org-capture)

Debugger entered--Lisp error: (error "Capture template ‘r’: Quit")
  signal(error ("Capture template ‘r’: Quit"))
  error("Capture template `%s': %s" "r" "Quit")
  org-capture(nil)
  funcall-interactively(org-capture nil)
  call-interactively(org-capture nil nil)
  command-execute(org-capture)

Debugger entered--Lisp error: (error "Capture template ‘Rr’: Quit")
  signal(error ("Capture template ‘Rr’: Quit"))
  error("Capture template `%s': %s" "Rr" "Quit")
  org-capture(nil)
  funcall-interactively(org-capture nil)
  call-interactively(org-capture nil nil)
  command-execute(org-capture)

Debugger entered--Lisp error: (error "Capture template ‘Rg’: Quit")
  signal(error ("Capture template ‘Rg’: Quit"))
  error("Capture template `%s': %s" "Rg" "Quit")
  org-capture(nil)
  funcall-interactively(org-capture nil)
  call-interactively(org-capture nil nil)
  command-execute(org-capture)

Debugger entered--Lisp error: (error "Capture template ‘Cc’: Quit")
  signal(error ("Capture template ‘Cc’: Quit"))
  error("Capture template `%s': %s" "Cc" "Quit")
  org-capture(nil)
  funcall-interactively(org-capture nil)
  call-interactively(org-capture nil nil)
  command-execute(org-capture)

On Tue, Apr 4, 2023 at 7:21 AM Ihor Radchenko  wrote:

> Carlo Tambuatco  writes:
>
> > I installed emacs from emacs-plus@28 formula on homebrew for macOS
> Ventura.
> >
> > So, I don’t think it is teh GTK emacs build…
>
> I see.
> Then, may you try to create a minimal reproducer?
> See https://orgmode.org/manual/Feedback.html#Feedback
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


org-capture-templates.el
Description: Binary data


Re: [BUG] Org-9.6.x org templates hang on 'clipboard pasted as level 2 subtree'...

2023-04-04 Thread Ihor Radchenko
Carlo Tambuatco  writes:

> I installed emacs from emacs-plus@28 formula on homebrew for macOS Ventura.
>
> So, I don’t think it is teh GTK emacs build…

I see.
Then, may you try to create a minimal reproducer?
See https://orgmode.org/manual/Feedback.html#Feedback

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



Re: [BUG] Org-9.6.x org templates hang on 'clipboard pasted as level 2 subtree'...

2023-04-04 Thread Carlo Tambuatco
I installed emacs from emacs-plus@28 formula on homebrew for macOS Ventura.

So, I don’t think it is teh GTK emacs build…



> On Apr 4, 2023, at 6:19 AM, Ihor Radchenko  wrote:
> 
> Carlo Tambuatco  writes:
> 
>> I tried M-x toggle-debug-on-quit like you said, then I tried to run one of 
>> my 
>> capture templates. It froze on ‘clipboard pasted as level 2 subtree’, again, 
>> then 
>> I did C-g to quit, but then it just quits out of creating the template. I 
>> think it 
>> is some bug during the copy paste step when it is pasting information from 
>> the template to the subtree, but I don’t know the technical details.
>> 
>> I don’t see any backtrace. 
> 
> Hmm.
> Do you happen to use GTK Emacs build?
> 
> -- 
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 




Re: [BUG] Org-9.6.x org templates hang on 'clipboard pasted as level 2 subtree'...

2023-04-04 Thread Ihor Radchenko
Carlo Tambuatco  writes:

> I tried M-x toggle-debug-on-quit like you said, then I tried to run one of my 
> capture templates. It froze on ‘clipboard pasted as level 2 subtree’, again, 
> then 
> I did C-g to quit, but then it just quits out of creating the template. I 
> think it 
> is some bug during the copy paste step when it is pasting information from 
> the template to the subtree, but I don’t know the technical details.
>
> I don’t see any backtrace. 

Hmm.
Do you happen to use GTK Emacs build?

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



Re: [BUG] Org-9.6.x org templates hang on 'clipboard pasted as level 2 subtree'...

2023-04-04 Thread Carlo Tambuatco
I tried M-x toggle-debug-on-quit like you said, then I tried to run one of my 
capture templates. It froze on ‘clipboard pasted as level 2 subtree’, again, 
then 
I did C-g to quit, but then it just quits out of creating the template. I think 
it 
is some bug during the copy paste step when it is pasting information from 
the template to the subtree, but I don’t know the technical details.

I don’t see any backtrace. 

It is weird, because SOME of my templates still work. But all of my templates 
worked perfectly before 9.6.x. Now some of them are giving me this error. 



> On Apr 4, 2023, at 4:54 AM, Ihor Radchenko  wrote:
> 
> Carlo Tambuatco  writes:
> 
>> This is a bug that started with org-9.6, and has persisted up until now. I
>> have stayed
>> with org-9.5.5 waiting until this is resolved, but it has not as of yet.
>> 
>> What happens is, for certain org templates that I run, the buffer simply
>> freezes and displays a message: clipboard pasted as level 2 subtree'.
>> 
>> Emacs then becomes unresponsive. All I can do is force quit and restart
>> emacs.
> 
> Does C-g work?
> If it does, may you run M-x toggle-debug-on-quit, trigger the hand,
> press, C-g, and then share the backtrace?
> 
> -- 
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 




Re: [BUG] Org-9.6.x org templates hang on 'clipboard pasted as level 2 subtree'...

2023-04-04 Thread Ihor Radchenko
Carlo Tambuatco  writes:

> This is a bug that started with org-9.6, and has persisted up until now. I
> have stayed
> with org-9.5.5 waiting until this is resolved, but it has not as of yet.
>
> What happens is, for certain org templates that I run, the buffer simply
> freezes and displays a message: clipboard pasted as level 2 subtree'.
>
> Emacs then becomes unresponsive. All I can do is force quit and restart
> emacs.

Does C-g work?
If it does, may you run M-x toggle-debug-on-quit, trigger the hand,
press, C-g, and then share the backtrace?

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



[BUG] Org-9.6.x org templates hang on 'clipboard pasted as level 2 subtree'...

2023-04-03 Thread Carlo Tambuatco
This is a bug that started with org-9.6, and has persisted up until now. I
have stayed
with org-9.5.5 waiting until this is resolved, but it has not as of yet.

What happens is, for certain org templates that I run, the buffer simply
freezes and displays a message: clipboard pasted as level 2 subtree'.

Emacs then becomes unresponsive. All I can do is force quit and restart
emacs.

All of my templates worked perfectly up until 9.5.5, and most of them still
work.
It is only with 4 or 5 of them that cause this issue. I do not think it is
a syntax
issue, as they worked before, but has any syntax for defining org templates
changed
with the 9.6.x releases?