Re: [BUG] Unregistered buffer modifications detected [9.5 (9.5-g49e2f6 @ /Users/myuser/.emacs.d/straight/29/straight/build/org/)]

2021-11-18 Thread Aaron Jensen
On Wed, Nov 17, 2021 at 7:03 AM Ihor Radchenko  wrote:
>
> Aaron Jensen  writes:
>
> > Here's another on c47b535bb:
> >
> > https://gist.github.com/aaronjensen/348d879f79099c0d9b660bad199f25af
> >
> > I don't recall what I was doing at the time, it was during a meeting.
>
> I do not see anything meaningful in the backtrace, except that "Current
> command: nil" is probably related to some third-party package. If there
> is nothing obvious in your config that may be responsible, you can set
> org-element--cache-diagnostics-modifications to nil to suppress the
> warning.
>
> Best,
> Ihor

Ok, I've disabled it for now.

I'm seeing another issue and I don't know if it is related. When I
save an org-capture my emacs spins for a long time. I C-g w/
toggle-debug-on-quit and got this:


Debugger entered--Lisp error: (quit)
  org-element--parse-generic-emphasis("/" italic)
  org-element-italic-parser()
  org-element--object-lex((bold citation code entity export-snippet
footnote-reference inline-babel-call inline-src-block italic
line-break latex-fragment link macro radio-target statistics-cookie
strike-through subscript superscript target timestamp underline
verbatim))
  org-element--parse-objects(532 1586811 (paragraph (:begin 532 :end
1586811 :contents-begin 532 :contents-end 1586811 :post-blank 0
:post-affiliated 532 :mode nil :granularity nil :parent nil)) (bold
citation code entity export-snippet footnote-reference
inline-babel-call inline-src-block italic line-break latex-fragment
link macro radio-target statistics-cookie strike-through subscript
superscript target timestamp underline verbatim))
  org-element--parse-elements(508 1586811 planning nil nil nil
(section (:begin 508 :end 1586812 :contents-begin 508 :contents-end
1586811 :robust-begin 508 :robust-end 1586809 :post-blank 1
:post-affiliated 508 :mode section :granularity nil :parent nil)))
  org-element--parse-elements(508 1586811 section nil nil nil
(headline (:raw-value "Report org" :begin 490 :end 1586812 :pre-blank
0 :contents-begin 508 :contents-end 1586811 :robust-begin 510
:robust-end 1586809 :level 1 :priority nil :tags nil :todo-keyword
#("TODO" 0 4 (wrap-prefix #("* " 0 2 (face org-indent)) line-prefix ""
fontified nil)) :todo-type todo :post-blank 1 :footnote-section-p nil
:archivedp nil :commentedp nil :post-affiliated 490 :title (#("Report
org" 0 10 (:parent #7))) :mode nil :granularity nil :parent nil)))
  org-element--parse-elements(1 1587283 first-section nil nil nil
(org-data (:begin 1 :contents-begin 1 :contents-end 1587283 :end
1587283 :robust-begin 67 :robust-end 1587281 :post-blank 0
:post-affiliated 1 :path "/Users/path..." :mode org-data :ID
"AB94746D-500B-49F3-9E4F-067D2B7E3976" :CATEGORY "Refile")))
  org-element-parse-buffer()
  org-roam-db-update-file()
  org-roam-db-autosync--try-update-on-save-h()
  run-hooks(after-save-hook)
  basic-save-buffer(nil)
  save-buffer()
  org-capture-finalize(nil)
  funcall-interactively(org-capture-finalize nil)
  command-execute(org-capture-finalize)



Re: [BUG] Unregistered buffer modifications detected [9.5 (9.5-g49e2f6 @ /Users/myuser/.emacs.d/straight/29/straight/build/org/)]

2021-11-16 Thread Aaron Jensen
On Sun, Nov 14, 2021 at 3:10 PM Aaron Jensen  wrote:
>
> On Sun, Nov 14, 2021 at 3:00 AM Ihor Radchenko  wrote:
> >
> > Aaron Jensen  writes:
> >
> > > Another one: 
> > > https://gist.github.com/aaronjensen/5114997373008e18a6473f513f5d5da8
> > >
> > > I don't have the details of what I was doing in the time, sorry.
> > >
> > > I'm on: ded97b767 * main origin/main org-element.el: Fix regression
> > > from d3836c1a1
> >
> > I have done some related fixes recently. An update might help. Also, do
> > you happen to use polymode? If so, the warning may be related to
> > https://github.com/polymode/poly-org/issues/33
>
> I've updated. I do not use polymode.

Here's another on c47b535bb:

https://gist.github.com/aaronjensen/348d879f79099c0d9b660bad199f25af

I don't recall what I was doing at the time, it was during a meeting.



Re: [BUG] Unregistered buffer modifications detected [9.5 (9.5-g49e2f6 @ /Users/myuser/.emacs.d/straight/29/straight/build/org/)]

2021-11-14 Thread Aaron Jensen
On Sun, Nov 14, 2021 at 3:00 AM Ihor Radchenko  wrote:
>
> Aaron Jensen  writes:
>
> > Another one: 
> > https://gist.github.com/aaronjensen/5114997373008e18a6473f513f5d5da8
> >
> > I don't have the details of what I was doing in the time, sorry.
> >
> > I'm on: ded97b767 * main origin/main org-element.el: Fix regression
> > from d3836c1a1
>
> I have done some related fixes recently. An update might help. Also, do
> you happen to use polymode? If so, the warning may be related to
> https://github.com/polymode/poly-org/issues/33

I've updated. I do not use polymode.

Thanks,

Aaron



Re: [BUG] Unregistered buffer modifications detected [9.5 (9.5-g49e2f6 @ /Users/myuser/.emacs.d/straight/29/straight/build/org/)]

2021-11-11 Thread Aaron Jensen
Another one: 
https://gist.github.com/aaronjensen/5114997373008e18a6473f513f5d5da8

I don't have the details of what I was doing in the time, sorry.

I'm on: ded97b767 * main origin/main org-element.el: Fix regression
from d3836c1a1

Aaron



Re: [BUG] Unregistered buffer modifications detected [9.5 (9.5-g49e2f6 @ /Users/myuser/.emacs.d/straight/29/straight/build/org/)]

2021-11-04 Thread Aaron Jensen
On Thu, Nov 4, 2021 at 10:11 AM Ihor Radchenko  wrote:
>
> Aaron Jensen  writes:
>
> > I got a warning when I did an org-agenda-todo to mark something as done.
> >
> > https://gist.github.com/aaronjensen/163913c0937376c9699eaa71eaa0959a
>
> If I read the backtrace correctly, you did not update to the latest
> main. Can you check if your Org is more recent than dc0c60f123?

Ah, it was not, I'm sorry. I have updated. I'll report back next time
I see something.

Thanks,

Aaron



Re: [BUG] Unregistered buffer modifications detected [9.5 (9.5-g49e2f6 @ /Users/myuser/.emacs.d/straight/29/straight/build/org/)]

2021-11-03 Thread Aaron Jensen
On Wed, Nov 3, 2021 at 10:30 AM Aaron Jensen  wrote:
>
> On Wed, Nov 3, 2021 at 7:43 AM Ihor Radchenko  wrote:
> >
> > Aaron Jensen  writes:
> >
> > > Here is a backtrace. The package it mentions is my own:
> > > https://github.com/aaronjensen/emacs-orgonomic and
> > > https://github.com/Somelauw/evil-org-mode is mentioned too.
> >
> > The mentions are ok. Backtrace should mention every command that
> > actually changes the buffer.
> >
> > > Unregistered buffer modifications detected. Resetting.
> > > ...
> > >  Backtrace:
> > > "  backtrace-to-string(nil)
> > >   org-element--cache-sync(#)
> > >   apply(org-element--cache-sync #)
> > >   timer-event-handler([t 0 0 59 nil org-element--cache-sync
> >
> > > Backtrace:
> > >   org-element-cache diagnostics(20211101-journal): Nothing to remove.
> > > No elements in cache after 361. Terminating.
> >
> > It looks like cache complete the synchronisation successfully, but some
> > command bypasses modification detection. Unfortunately, I cannot catch
> > the problematic command from backtrace. It acts "stealthily" for cache.
> > Is there a specific kind of edit sequence that you did right before the
> > warning appeared?
> >
> > Best,
> > Ihor
>
> I don't recall, but I'll view-lossage next time it happens.

I got a warning when I did an org-agenda-todo to mark something as done.

https://gist.github.com/aaronjensen/163913c0937376c9699eaa71eaa0959a

No idea if it's related, but after a refile I save all org buffers eventually

(defvar aj/org-save-all-timer nil)
(defun aj/org-save-all-org-buffers-eventually ( _)
  (when aj/org-save-all-timer
(cancel-timer aj/org-save-all-timer))
  (setq aj/org-save-all-timer
(run-with-idle-timer 2 nil 'org-save-all-org-buffers)))

(use-feature org
  :config
  (advice-add 'org-refile :after 'aj/org-save-all-org-buffers-eventually)
  (advice-add 'org-schedule :after 'aj/org-save-all-org-buffers-eventually)
  (add-hook 'org-trigger-hook 'aj/org-save-all-org-buffers-eventually))

(use-feature org-agenda
  :config
  (advice-add 'org-agenda-quit :before 'aj/org-save-all-org-buffers-eventually)
  (advice-add 'org-agenda-todo :after 'aj/org-save-all-org-buffers-eventually)
  (advice-add 'org-agenda-deadline :after
'aj/org-save-all-org-buffers-eventually)
  (advice-add 'org-agenda-schedule :after
'aj/org-save-all-org-buffers-eventually)
  (advice-add 'org-agenda-refile :after
'aj/org-save-all-org-buffers-eventually))



Re: [BUG] Unregistered buffer modifications detected [9.5 (9.5-g49e2f6 @ /Users/myuser/.emacs.d/straight/29/straight/build/org/)]

2021-11-03 Thread Aaron Jensen
On Wed, Nov 3, 2021 at 7:43 AM Ihor Radchenko  wrote:
>
> Aaron Jensen  writes:
>
> > Here is a backtrace. The package it mentions is my own:
> > https://github.com/aaronjensen/emacs-orgonomic and
> > https://github.com/Somelauw/evil-org-mode is mentioned too.
>
> The mentions are ok. Backtrace should mention every command that
> actually changes the buffer.
>
> > Unregistered buffer modifications detected. Resetting.
> > ...
> >  Backtrace:
> > "  backtrace-to-string(nil)
> >   org-element--cache-sync(#)
> >   apply(org-element--cache-sync #)
> >   timer-event-handler([t 0 0 59 nil org-element--cache-sync
>
> > Backtrace:
> >   org-element-cache diagnostics(20211101-journal): Nothing to remove.
> > No elements in cache after 361. Terminating.
>
> It looks like cache complete the synchronisation successfully, but some
> command bypasses modification detection. Unfortunately, I cannot catch
> the problematic command from backtrace. It acts "stealthily" for cache.
> Is there a specific kind of edit sequence that you did right before the
> warning appeared?
>
> Best,
> Ihor

I don't recall, but I'll view-lossage next time it happens.



Re: [BUG] Unregistered buffer modifications detected [9.5 (9.5-g49e2f6 @ /Users/myuser/.emacs.d/straight/29/straight/build/org/)]

2021-11-02 Thread Aaron Jensen
Here is another that just happened:
https://gist.github.com/aaronjensen/5294a64f243a306b58062113b9306bab

It's scrubbed of all string data, hopefully not over-scrubbed for you.

Aaron



Re: [BUG] Unregistered buffer modifications detected [9.5 (9.5-g49e2f6 @ /Users/myuser/.emacs.d/straight/29/straight/build/org/)]

2021-11-02 Thread Aaron Jensen
On Mon, Nov 1, 2021 at 8:48 AM Ihor Radchenko  wrote:
>
> Aaron Jensen  writes:
>
> > On Sat, Oct 30, 2021 at 11:16 PM Aaron Jensen  wrote:
> >>
> >> Done, I'll report back.
> >
> > Another one, no trace:
> >
> > Warning (emacs): Emacs reader failed to read data for # > config.org>:org-element--cache. The error was: "Invalid read syntax:
> > \"#\", 1, 4670" Disable showing Disable logging
>
> Thanks! I have seen this one. Now can confirm that it is not just on my
> system. This warning indicates a likely bug in Emacs read/write. I
> disabled this warning on latest main to not irritate users.
>
> Best,
> Ihor

Here is a backtrace. The package it mentions is my own:
https://github.com/aaronjensen/emacs-orgonomic and
https://github.com/Somelauw/evil-org-mode is mentioned too.

Warning (emacs): org-element--cache: Warning(20211101-journal):
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: 20211101-journal
 Current command: nil
 Backtrace:
"  backtrace-to-string(nil)
  org-element--cache-sync(#)
  apply(org-element--cache-sync #)
  timer-event-handler([t 0 0 59 nil org-element--cache-sync
(#) idle 99 nil])
"
Backtrace:
  org-element-cache diagnostics(20211101-journal): Nothing to remove.
No elements in cache after 361. Terminating.
  org-element-cache diagnostics(20211101-journal): Found non-robust
change invalidating org-data. Re-parsing: "(org-data (:begin 1
:contents-begin 1 :contents-end 360 :end 360 :robust-begin 3
:robust-end 358 :post-blank 0 :post-affiliated 1 :path \"/path\" :mode
org-data :CATEGORY \"20211101-journal\" :parent nil :cached t
:org-element--cache-sync-key (4 . -1)))"
  org-element-cache diagnostics(20211101-journal): Adding new phase 0 request
  org-element-cache diagnostics(20211101-journal): Submitting new
synchronization request for [360..361]흙-1
  org-element-cache diagnostics(20211101-journal): save-buffer is
about to modify text: warning nil
  org-element-cache diagnostics(20211101-journal): After change
  org-element-cache diagnostics(20211101-journal): save-buffer is
about to modify text: warning nil
  org-element-cache diagnostics(20211101-journal): Nothing to remove.
No elements in cache after 364. Terminating.
  org-element-cache diagnostics(20211101-journal): Found non-robust
change invalidating org-data. Re-parsing: "(org-data (:begin 1
:contents-begin 1 :contents-end 360 :end 361 :robust-begin 3
:robust-end 358 :post-blank 1 :post-affiliated 1 :path \"/path\" :mode
org-data :CATEGORY \"20211101-journal\" :parent nil :cached t
:org-element--cache-sync-key (4 . -1)))"
  org-element-cache diagnostics(20211101-journal): Adding new phase 0 request
  org-element-cache diagnostics(20211101-journal): Submitting new
synchronization request for [361..364]흙-3
  org-element-cache diagnostics(20211101-journal): evil-org-delete is
about to modify text: warning 2
  org-element-cache diagnostics(20211101-journal): After change
  org-element-cache diagnostics(20211101-journal): evil-org-delete is
about to modify text: warning 2
  org-element-cache diagnostics(20211101-journal): Nothing to remove.
No elements in cache after 365. Terminating.
  org-element-cache diagnostics(20211101-journal): Found non-robust
change invalidating org-data. Re-parsing: "(org-data (:begin 1
:contents-begin 1 :contents-end 364 :end 364 :robust-begin 3
:robust-end 362 :post-blank 0 :post-affiliated 1 :path \"/path\" :mode
org-data :CATEGORY \"20211101-journal\" :parent nil :cached t
:org-element--cache-sync-key (4 . -1)))"
  org-element-cache diagnostics(20211101-journal): Adding new phase 0 request
  org-element-cache diagnostics(20211101-journal): Submitting new
synchronization request for [364..365]흙-1
  org-element-cache diagnostics(20211101-journal):
orgonomic-delete-backward-char is about to modify text: warning 2
  org-element-cache diagnostics(20211101-journal): After change
  org-element-cache diagnostics(20211101-journal):
orgonomic-delete-backward-char is about to modify text: warning 2
  org-element-cache diagnostics(20211101-journal): Nothing to remove.
No elements in cache after 366. Terminating.
  org-element-cache diagnostics(20211101-journal): Found non-robust
change invalidating org-data. Re-parsing: "(org-data (:begin 1
:contents-begin 1 :contents-end 365 :end 365 :robust-begin 3
:robust-end 363 :post-blank 0 :post-affiliated 1 :path \"/path\" :mode
org-data :CATEGORY \"20211101-journal\" :parent nil :cached t
:org-element--cache-sync-key (4 . -1)))"
  org-element-cache diagnostics(20211101-journal): Adding new phase 0 request
  org-element-cache diagnostics(20211101-journal): Submitting new
synchronization request for [36

Re: [BUG] Unregistered buffer modifications detected [9.5 (9.5-g49e2f6 @ /Users/myuser/.emacs.d/straight/29/straight/build/org/)]

2021-10-31 Thread Aaron Jensen
On Sat, Oct 30, 2021 at 11:16 PM Aaron Jensen  wrote:
>
> Done, I'll report back.

Another one, no trace:

Warning (emacs): Emacs reader failed to read data for #:org-element--cache. The error was: "Invalid read syntax:
\"#\", 1, 4670" Disable showing Disable logging



Re: [BUG] Unregistered buffer modifications detected [9.5 (9.5-g49e2f6 @ /Users/myuser/.emacs.d/straight/29/straight/build/org/)]

2021-10-30 Thread Aaron Jensen
On Sat, Oct 30, 2021 at 10:46 PM Ihor Radchenko  wrote:
>
> Aaron Jensen  writes:
>
> >> Do you always see "Current command: nil"? If you do, do you have any
> >> minor modes that change text in Org buffers?
> >
> > I don't know, but I'll keep an eye out for the next time it happens.
>
> If possible, can you also upgrade to latest main? I just pushed a patch
> providing additional backtrace to the warning. Hopefully, it can reveal
> more details.

Will do

> > And this to change the behavior of org-indent:
> >
> > (aj-defadvice aj--org-indent--compute-prefixes-hanging-bullets ()
> >   :override #'org-indent--compute-prefixes
> >   "Compute prefix strings with hanging header bullets."
> > ...
>
> The was a problem related to org-indent recently [1]. If your Org is
> older than b135b8c7, there is a small chance that the warning might be
> fixed after update.
>
> [1] https://list.orgmode.org/878ryev6q2.fsf@localhost/T/#t

It wasn't when I just checked, but I updated packages today so it's
possible that I was behind on this. I'll let you know if I see it
again. The second error I reported was on the latest main.

> > As for minor modes, yes:
> >
> > https://github.com/awth13/org-appear
> > ...
> > And prettify-symbols-mode:
>
> I also use org-appear and prettify-symbols-mode. Hopefully not an issue.
>
> > https://github.com/integral-dw/org-superstar-mode
>
> Not sure here. It would be helpful if you try to disable
> org-superstar-mode and see if it helps,

I'll leave it on for a bit longer to see what still repros. If it
happens again, I'll try disabling it.

> > Warning (emacs): org-element--cache: Added org-data parent to
> > non-headline element
>
> This is a bad one. I was really hoping that I fixed it. Can you set
> org-element--cache-self-verify to 'backtrace before loading Emacs and
> post the full backtrace if you see this warning again?

Done, I'll report back.

Thanks,

Aaron



Re: [BUG] Unregistered buffer modifications detected [9.5 (9.5-g49e2f6 @ /Users/myuser/.emacs.d/straight/29/straight/build/org/)]

2021-10-30 Thread Aaron Jensen
On Sat, Oct 30, 2021 at 12:45 PM Aaron Jensen  wrote:
>
> On Sat, Oct 30, 2021 at 11:37 AM Ihor Radchenko  wrote:
> >
> > Aaron Jensen  writes:
> >
> > > I don't have a consistent repro, but I am seeing this error often. At
> > > different times it is in different files and lists different nodes.
> >
> > Thanks for reporting!
> >
> > > 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: 20211025-journal
> > >  Current command: nil Disable showing Disable logging
> >
> > Do you always see "Current command: nil"? If you do, do you have any
> > minor modes that change text in Org buffers?

I just got this warning:

Warning (emacs): org-element--cache: Added org-data parent to
non-headline element: (item (:bullet "- " :begin 1935 :end 1982
:contents-begin 1937 :contents-end 1982 :checkbox nil :counter nil
:structure ((1935 0 "- " nil nil nil 1982) (1982 0 "- " nil nil nil
2032)) :pre-blank 0 :post-blank 0 :post-affiliated 1935 :tag nil :mode
item :granularity element :cached t :parent (plain-list (:type
unordered :begin 1935 :end 2032 :contents-begin 1935 :contents-end
2032 :structure ((1935 0 "- " nil nil nil 1982) (1982 0 "- " nil nil
nil 2032)) :post-blank 0 :post-affiliated 1935 :mode planning
:granularity element :cached nil :parent (section (:begin 1935 :end
2032 :contents-begin 1935 :contents-end 2032 :robust-begin 1935
:robust-end 2030 :post-blank 0 :post-affiliated 1935 :mode section
:granularity element :cached nil :parent (headline (:raw-value
"[2021-10-15 Fri]" :begin 1915 :end 2032 :pre-blank 1 :contents-begin
1935 :contents-end 2032 :robust-begin 1937 :robust-end 2030 :level 1
:priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0
:footnote-section-p nil :archivedp nil :commentedp nil
:post-affiliated 1915 :title "[2021-10-15 Fri]" :mode nil :granularity
headline :cached nil :parent (org-data (:begin 1 :contents-begin 1
:contents-end 2030 :end 2030 :robust-begin 67 :robust-end 2028
:post-blank 0 :post-affiliated 1 :path "" :mode org-data :ID
"09182EC8-8E37-4ABA-8E20-768D9A4CD34B" :CATEGORY "" :granularity
headline) nil) :org-element--cache-sync-key (4 . 1913)))
:org-element--cache-sync-key (4 . 1932))) :org-element--cache-sync-key
(4 . 1933))) :org-element--cache-sync-key (4 . 1934)))

Aaron



Re: [BUG] Unregistered buffer modifications detected [9.5 (9.5-g49e2f6 @ /Users/myuser/.emacs.d/straight/29/straight/build/org/)]

2021-10-30 Thread Aaron Jensen
On Sat, Oct 30, 2021 at 11:37 AM Ihor Radchenko  wrote:
>
> Aaron Jensen  writes:
>
> > I don't have a consistent repro, but I am seeing this error often. At
> > different times it is in different files and lists different nodes.
>
> Thanks for reporting!
>
> > 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: 20211025-journal
> >  Current command: nil Disable showing Disable logging
>
> Do you always see "Current command: nil"? If you do, do you have any
> minor modes that change text in Org buffers?

I don't know, but I'll keep an eye out for the next time it happens.
As for minor modes, yes:

https://github.com/awth13/org-appear
https://github.com/integral-dw/org-superstar-mode

And prettify-symbols-mode:

  (push '("[ ]" . "☐") prettify-symbols-alist)
  (push '("[X]" . "☑") prettify-symbols-alist)
  (push '("[-]" . "❍") prettify-symbols-alist)
  (prettify-symbols-mode)

And this to change the behavior of org-indent:

(aj-defadvice aj--org-indent--compute-prefixes-hanging-bullets ()
  :override #'org-indent--compute-prefixes
  "Compute prefix strings with hanging header bullets."

  (setq org-indent--heading-line-prefixes
(make-vector org-indent--deepest-level nil))
  (setq org-indent--inlinetask-line-prefixes
(make-vector org-indent--deepest-level nil))
  (setq org-indent--text-line-prefixes
(make-vector org-indent--deepest-level nil))

  (let* ((indent 2))

(dotimes (n org-indent--deepest-level)
  (aset org-indent--heading-line-prefixes n
(make-string (- indent 2) ?\s))
  (aset org-indent--inlinetask-line-prefixes n
(make-string indent ?\s))
  (aset org-indent--text-line-prefixes n
(make-string indent ?\s)

I think that's it (and yes, that's a lot, heh).

Thanks,

Aaron



[BUG] Unregistered buffer modifications detected [9.5 (9.5-g49e2f6 @ /Users/myuser/.emacs.d/straight/29/straight/build/org/)]

2021-10-30 Thread Aaron Jensen


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 don't have a consistent repro, but I am seeing this error often. At
different times it is in different files and lists different nodes.

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: 20211025-journal
 Current command: nil Disable showing Disable logging


Emacs  : GNU Emacs 29.0.50 (build 1, x86_64-apple-darwin21.1.0, NS 
appkit-2113.00 Version 12.0.1 (Build 21A559))
 of 2021-10-29
Package: Org mode version 9.5 (9.5-g49e2f6 @ 
/Users/myuser/.emacs.d/straight/29/straight/build/org/)

current state:
==
(setq
 org-roam-db-location "/Users/myuser/.emacs.d/var/org-roam.db"
 org-mac-grab-devonthink-app-p nil
 org-link-elisp-confirm-function 'yes-or-no-p
 org-directory "xxx"
 org-hide-emphasis-markers t
 org-bibtex-headline-format-function #[257 "\300.\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
 org-download-file-format-function 'org-download-file-format-default
 org-roam-mode-hook '(evil-motion-state)
 org-agenda-custom-commands '((" " "Agenda"
   ((agenda "" ((org-agenda-span 'day)))
(tags "refile"
 ((org-agenda-overriding-header "Tasks to 
Refile")
  (org-tags-match-list-sublevels nil))
 )
(tags-todo "-refile/!"
 ((org-agenda-overriding-header "Tasks")
  (org-agenda-skip-function
   '(org-agenda-skip-entry-if 'deadline
 'scheduled)
   )
  )
 )
(tags "-refile/"
 ((org-agenda-overriding-header
   "Tasks to Archive")
  (org-agenda-skip-function
   'aj/skip-non-archivable-tasks)
  (org-tags-match-list-sublevels nil))
 )
)
   )
  )
 org-agenda-skip-scheduled-if-done t
 org-agenda-files '("")
 org-journal-dir ""
 org-journal-date-format "%a, %-d %b %Y"
 org-capture-templates '(...
 )
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-refile-targets '((nil :maxlevel . 9) (aj/refile-target-files :maxlevel . 
3))
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-default-notes-file "notes.org"
 org-roam-find-file-hook '(org-roam-buffer--setup-redisplay-h
   org-roam--register-completion-functions-h
   org-roam--replace-roam-links-on-save-h
   org-roam-open-id-with-org-roam-db-h
   org-roam-db-autosync--setup-update-on-save-h)
 org-refile-use-outline-path 'file
 org-publish-timestamp-directory "/Users/myuser/.emacs.d/var/org/timestamps/"
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function
 org-ascii-format-drawer-function #[771 ".\207" [] 4 "\n\n(fn NAME CONTENTS 
WIDTH)"]
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-mac-grab-Outlook-app-p nil
 org-catch-invisible-edits 'show
 org-mac-grab-Addressbook-app-p nil
 org-persist-before-read-hook '(org-element--cache-persist-before-read)
 org-mode-hook '(aj--org-download org-tempo-setup aj--add-recalc-table-hook
 evil-org-mode aj--org-line-spacing
 #[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
 aj/org-prettify-symbols org-superstar-mode org-indent-mode
 orgonomic-mode org-appear-mode org-eldoc-load
 electric-pair-local-mode aj--disable-line-numbers 
flyspell-mode)
 org-babel-load-languages '((shell . t))
 org-src-window-setup 'current-window
 org-id-locations-file 

Re: [PATCH] org-mac-link: Disable Evernote capture by default

2021-02-27 Thread Aaron Jensen
On Wed, Feb 17, 2021 at 9:55 AM Aaron Jensen  wrote:
>
> The two `shell-command-to-string` invocations during eval are
> extremely slow. Users of Evernote should `org-mac-grab-Evernote-app-p`
> and `org-mac-evernote-path` explicitly.

Hi all,

Any chance of getting this merged in? It's a pretty nasty one for mac users.

Thanks,

Aaron



[PATCH] org-mac-link: Disable Evernote capture by default

2021-02-17 Thread Aaron Jensen
The two `shell-command-to-string` invocations during eval are
extremely slow. Users of Evernote should `org-mac-grab-Evernote-app-p`
and `org-mac-evernote-path` explicitly.

* contrib/lisp/org-mac-link.el (org-mac-grab-Evernote-app-p): Default
to nil
(org-mac-evernote-path): Default to nil and add a function of the same
name that will either use the variable or a shell invocation to mdfind
(org-mac-evernote-note-open): Use the function version of org-mac-evernote-path
(org-as-get-selected-evernote-notes): Use the function version of
org-mac-evernote-path
---
 contrib/lisp/org-mac-link.el | 23 ++-
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/contrib/lisp/org-mac-link.el b/contrib/lisp/org-mac-link.el
index e56354c4f..ec004d8b9 100644
--- a/contrib/lisp/org-mac-link.el
+++ b/contrib/lisp/org-mac-link.el
@@ -207,18 +207,13 @@
   :group 'org-mac-flagged-mail
   :type 'string)
 
-(defcustom org-mac-grab-Evernote-app-p
-  (< 0 (length (shell-command-to-string
-"mdfind kMDItemCFBundleIdentifier == 
'com.evernote.Evernote'")))
+(defcustom org-mac-grab-Evernote-app-p nil
   "Add menu option [e]vernote to grab note links from Evernote.app."
   :tag "Grab Evernote.app note links"
   :group 'org-mac-link
   :type 'boolean)
 
-(defcustom org-mac-evernote-path (replace-regexp-in-string (rx (* (any " 
\t\n")) eos)
-   ""
-   
(shell-command-to-string
-"mdfind 
kMDItemCFBundleIdentifier == 'com.evernote.Evernote'"))
+(defcustom org-mac-evernote-path nil
   "The path to the installed copy of Evernote.app. Do not escape spaces as the 
AppleScript call will quote this string."
   :tag "Path to Evernote"
   :group 'org-mac-link
@@ -809,11 +804,21 @@ after heading."
 
 (org-link-set-parameters "mac-evernote" :follow #'org-mac-evernote-note-open)
 
+(defun org-mac-evernote-path ()
+  "Get path to evernote.
+First consider the value of ORG-MAC-EVERNOTE-PATH, then attempt to find it.
+Finding the path can be slow."
+  (or org-mac-evernote-path
+  (replace-regexp-in-string (rx (* (any " \t\n")) eos)
+""
+(shell-command-to-string
+ "mdfind kMDItemCFBundleIdentifier == 
'com.evernote.Evernote'"
+
 (defun org-mac-evernote-note-open (noteid _)
   "Open a note in Evernote"
   (do-applescript
(concat
-"tell application \"" org-mac-evernote-path "\"\n"
+"tell application \"" (org-mac-evernote-path) "\"\n"
 "set theNotes to get every note of every notebook where its local id 
is \"" (substring-no-properties noteid) "\"\n"
 "repeat with _note in theNotes\n"
 "if length of _note is not 0 then\n"
@@ -828,7 +833,7 @@ after heading."
   "AppleScript to create links to selected notes in Evernote.app."
   (do-applescript
(concat
-"tell application \"" org-mac-evernote-path "\"\n"
+"tell application \"" (org-mac-evernote-path) "\"\n"
  "set noteCount to count selection\n"
  "if (noteCount < 1) then\n"
  "return\n"
-- 
2.28.0




Re: [PATCH] lisp/org-refile.el: Add mandatory when argument

2021-01-10 Thread Aaron Jensen
On Sun, Jan 10, 2021 at 4:12 PM Kyle Meyer  wrote:
> > * lisp/org-refile.el (org-copy): When argument added
>
> Thanks, but this was handled by 248dfcd71 earlier this week.

Ah, excellent!



[PATCH] lisp/org-refile.el: Add mandatory when argument

2021-01-10 Thread Aaron Jensen
* lisp/org-refile.el (org-copy): When argument added
---
 lisp/org-refile.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-refile.el b/lisp/org-refile.el
index 0b44fdfa5..47f22ecc0 100644
--- a/lisp/org-refile.el
+++ b/lisp/org-refile.el
@@ -373,7 +373,7 @@ the *old* location.")
 (defvar org-refile-keep nil
   "Non-nil means `org-refile' will copy instead of refile.")

-(define-obsolete-function-alias 'org-copy 'org-refile-copy)
+(define-obsolete-function-alias 'org-copy 'org-refile-copy "Org 9.4")

 ;;;###autoload
 (defun org-refile-copy ()
-- 
2.28.0



Re: Src block fontification when scrolled off window

2020-01-20 Thread Aaron Jensen
On Tue, Jan 14, 2020 at 8:20 AM Fraga, Eric  wrote:
>
> On Tuesday, 14 Jan 2020 at 07:21, Aaron Jensen wrote:
> > In one of my org files, I will occasionally see src blocks lose their
> > formatting. [...]
> >
> > Is this expected behavior? Is there a way to increase the lookback amount?
>
> I don't see this behaviour.  You might want to look at
> jit-lock-chunk-size but that's me grasping at straws...

I'm trying this out. I've also started opening src edit blocks in a
different window. I haven't seen the behavior since making these
changes, so I'm happy. Thanks!



Src block fontification when scrolled off window

2020-01-14 Thread Aaron Jensen
Hi,

In one of my org files, I will occasionally see src blocks lose their
formatting. Specifically, if I switch to editing the src block, or I
first open an org file that is expanded to a section with a src block,
if the beginning #+begin_src is scrolled above the window, but part of
the block itself is still visible, the src block will be fontified as
if it were regular text in org. I have org-src-fontify-natively. If I
scroll up so that #+begin_src is in view, it fontifies as expected.

Is this expected behavior? Is there a way to increase the lookback amount?

Thanks,

Aaron



Re: [O] [PATCH] Add support for Brave to org-mac-link

2018-11-25 Thread Aaron Jensen
On November 25, 2018 at 1:08:35 AM, Nicolas Goaziou
(m...@nicolasgoaziou.fr(mailto:m...@nicolasgoaziou.fr)) wrote:

> Hello,
> Applied.
> Fixed.

Thank you for the quick response!

Aaron



[O] [PATCH] Add support for Brave to org-mac-link

2018-11-24 Thread Aaron Jensen
Hi all,

Brave is a chromium-based browser, so the existing Chrome code works
with slight modifications.

By the way, I’ve signed FSF papers though
https://orgmode.org/worg/org-contribute.html currently has me listed
in the wrong place.

Best,

Aaron


0001-org-mac-link-Add-support-for-Brave.patch
Description: Binary data


[O] Bug: C-c C-c on deadline timestamp can do nothing useful [9.1.2 (9.1.2-elpaplus @ /Users/aaronjensen/.emacs.d/elpa/26.0/org-plus-contrib-20171004/)]

2017-10-07 Thread Aaron Jensen

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

 http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.


>From emacs -Q:

M-x org-mode
Insert the following:

* Test
  DEADLINE: <2017-10-06 Sat>

Place point on timestamp and hit C-c C-c

Expected:

Timestamp updated to <2017-10-06 Fri>

Actual:

This is displayed in *Messages*:

user-error: ‘C-c C-c’ can do nothing useful here


Emacs  : GNU Emacs 26.0.60 (build 1, x86_64-apple-darwin17.0.0, NS 
appkit-1561.00 Version 10.13 (Build 17A365))
 of 2017-09-30
Package: Org mode version 9.1.2 (9.1.2-elpaplus @ 
/Users/aaronjensen/.emacs.d/elpa/26.0/org-plus-contrib-20171004/)



[O] org-plot on multiple y axes

2017-04-12 Thread Aaron Jensen
Hi,

Is it possible to use org-plot to plot on multiple y axes? gnuplot
supports y2range, and I can specify that, but I don't know how (or if
it is possible) to specify which deps should be plotted against which
axis.

If this is not possible, is it possible to have two charts plotted
against the same table? Thanks!

Aaron



Re: [O] Fontification error

2017-03-19 Thread Aaron Jensen
On Sun, Mar 19, 2017 at 3:58 PM, Nicolas Goaziou  wrote:
> Hello,
>
> Applied. Thank you.
>
> I added TINYCHANGE at the end of the commit message since I don't know
> whether you signed FSF papers or not.

Thank you! I have not yet.

Aaron



[O] [PATCH] Reduce scope of inhibit-modification-hooks

2017-03-19 Thread Aaron Jensen
This fixes the fontification error discussed here:

http://lists.gnu.org/archive/html/emacs-orgmode/2017-03/msg00423.html

and here:

http://lists.gnu.org/archive/html/emacs-orgmode/2017-02/msg00280.html
---
 lisp/org-src.el | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/lisp/org-src.el b/lisp/org-src.el
index dfc422b..b0f952f 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -525,19 +525,19 @@ as `org-src-fontify-natively' is non-nil."
  (let ((inhibit-modification-hooks nil))
(erase-buffer)
;; Add string and a final space to ensure property change.
-   (insert string " ")
-   (unless (eq major-mode lang-mode) (funcall lang-mode))
-   (org-font-lock-ensure)
-   (let ((pos (point-min)) next)
- (while (setq next (next-property-change pos))
-   ;; Handle additional properties from font-lock, so as to
-   ;; preserve, e.g., composition.
-   (dolist (prop (cons 'face font-lock-extra-managed-props))
- (let ((new-prop (get-text-property pos prop)))
-   (put-text-property
-(+ start (1- pos)) (1- (+ start next)) prop new-prop
-org-buffer)))
-   (setq pos next)
+   (insert string " "))
+ (unless (eq major-mode lang-mode) (funcall lang-mode))
+ (org-font-lock-ensure)
+ (let ((pos (point-min)) next)
+   (while (setq next (next-property-change pos))
+ ;; Handle additional properties from font-lock, so as to
+ ;; preserve, e.g., composition.
+ (dolist (prop (cons 'face font-lock-extra-managed-props))
+   (let ((new-prop (get-text-property pos prop)))
+ (put-text-property
+  (+ start (1- pos)) (1- (+ start next)) prop new-prop
+  org-buffer)))
+ (setq pos next
;; Add Org faces.
(let ((src-face (nth 1 (assoc-string lang org-src-block-faces t
   (when (or (facep src-face) (listp src-face))
--
2.10.0



Re: [O] Fontification error

2017-03-19 Thread Aaron Jensen
That appeared to fix it for me! Thanks.

>From cdf2c445e46d5691ee82adb1a6ca0bb0ae6bbd1b Mon Sep 17 00:00:00 2001
From: Aaron Jensen <aaronjen...@gmail.com>
Date: Sun, 19 Mar 2017 12:49:18 -0700
Subject: [PATCH] Reduce scope of inhibit-modification-hooks

This fixes a fontification error that some users were having.
---
 lisp/org-src.el | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/lisp/org-src.el b/lisp/org-src.el
index dfc422b..b0f952f 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -525,19 +525,19 @@ as `org-src-fontify-natively' is non-nil."
  (let ((inhibit-modification-hooks nil))
(erase-buffer)
;; Add string and a final space to ensure property change.
-   (insert string " ")
-   (unless (eq major-mode lang-mode) (funcall lang-mode))
-   (org-font-lock-ensure)
-   (let ((pos (point-min)) next)
- (while (setq next (next-property-change pos))
-   ;; Handle additional properties from font-lock, so as to
-   ;; preserve, e.g., composition.
-   (dolist (prop (cons 'face font-lock-extra-managed-props))
- (let ((new-prop (get-text-property pos prop)))
-   (put-text-property
-(+ start (1- pos)) (1- (+ start next)) prop new-prop
-org-buffer)))
-   (setq pos next)
+   (insert string " "))
+ (unless (eq major-mode lang-mode) (funcall lang-mode))
+ (org-font-lock-ensure)
+ (let ((pos (point-min)) next)
+   (while (setq next (next-property-change pos))
+ ;; Handle additional properties from font-lock, so as to
+ ;; preserve, e.g., composition.
+ (dolist (prop (cons 'face font-lock-extra-managed-props))
+   (let ((new-prop (get-text-property pos prop)))
+ (put-text-property
+  (+ start (1- pos)) (1- (+ start next)) prop new-prop
+  org-buffer)))
+ (setq pos next
;; Add Org faces.
(let ((src-face (nth 1 (assoc-string lang org-src-block-faces t
   (when (or (facep src-face) (listp src-face))
--
2.10.0

On Sun, Mar 19, 2017 at 11:04 AM, Noam Postavsky <npost...@gmail.com> wrote:
> On Sun, Mar 19, 2017 at 1:05 PM, Kyle Meyer <k...@kyleam.com> wrote:
>>>
>>> * lisp/org-src.el (org-src-font-lock-fontify-block): Let-bind
>>> `inhibit-modification-hooks' to nil, since this function can be called
>>> from jit-lock-function which binds that variable to t (Bug#25132).
>>>
>>> Call modification hooks in org-src fontify buffers
>>> ae8264c5cccf19d5b25a340a605bf2f07de1577e
>>> Noam Postavsky
>>> Sun Jan 29 11:01:32 2017 -0500
>>>
>>> At the moment, the minimum ECM I know of is to install spacemacs and
>>> open an org file containing:
>>
>> [+cc Noam because I'm not sure if he follows this list.]
>
> [Thanks, I don't follow this list indeed]
>
>>
>> I backported this commit to the Org repo, but I don't have any good
>> guesses at what's leading to the error below.
>
> I think the problem is that the let-binding's scope is too big, it's
> applying to a text property change on the original org buffer, which
> seems to cause problems with one of its modifcation hooks due to
> narrowing. Actually, I initially posted the patch with a smaller
> binding, but then enlarged it before I pushed it; I don't remember
> why...
>
> Could someone who can reproduce this problem try shrinking the scope
> of (let ((inhibit-modification-hooks nil))...) to stop after the
> (insert " ") as in [1], and see if that fixes it?
>
> [1]: 
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25132;att=3;filename=v1-0001-Call-modification-hooks-in-org-src-fontify-buffer.patch;msg=22



Re: [O] Fontification error

2017-03-19 Thread Aaron Jensen
This is in reply to the Fontification error Thomas S. Dye reported on
Feb 13 2017:

http://lists.gnu.org/archive/html/emacs-orgmode/2017-02/msg00280.html

I was able to bisect this error to the following commit:

f2a5104e45b6f44a08960ae49ba20c124a8fa9d8 is the first bad commit
commit f2a5104e45b6f44a08960ae49ba20c124a8fa9d8
Author: Noam Postavsky 
Date:   Sat Jan 7 16:05:19 2017 -0500

Backport commit ae8264c5cc from Emacs

* lisp/org-src.el (org-src-font-lock-fontify-block): Let-bind
`inhibit-modification-hooks' to nil, since this function can be called
from jit-lock-function which binds that variable to t (Bug#25132).

Call modification hooks in org-src fontify buffers
ae8264c5cccf19d5b25a340a605bf2f07de1577e
Noam Postavsky
Sun Jan 29 11:01:32 2017 -0500

At the moment, the minimum ECM I know of is to install spacemacs and
open an org file containing:

#+begin_src emacs-lisp
()
#+end_src

This is the stack trace if I remove the condition-case that leads to
the fontification error warning:

Debugger entered--Lisp error: (args-out-of-range 6 23)
  put-text-property(23 6 fontified nil)
  jit-lock-after-change(23 24 1)
  put-text-property(23 24 face nil #)
  (let ((new-prop (get-text-property pos prop))) (put-text-property (+
start (1- pos)) (1- (+ start next)) prop new-prop org-buffer))
  (let ((prop (car --dolist-tail--))) (let ((new-prop
(get-text-property pos prop))) (put-text-property (+ start (1- pos))
(1- (+ start next)) prop new-prop org-buffer)) (setq --dolist-tail--
(cdr --dolist-tail--)))
  (while --dolist-tail-- (let ((prop (car --dolist-tail--))) (let
((new-prop (get-text-property pos prop))) (put-text-property (+ start
(1- pos)) (1- (+ start next)) prop new-prop org-buffer)) (setq
--dolist-tail-- (cdr --dolist-tail--
  (let ((--dolist-tail-- (cons (quote face)
font-lock-extra-managed-props))) (while --dolist-tail-- (let ((prop
(car --dolist-tail--))) (let ((new-prop (get-text-property pos prop)))
(put-text-property (+ start (1- pos)) (1- (+ start next)) prop
new-prop org-buffer)) (setq --dolist-tail-- (cdr --dolist-tail--)
  (while (setq next (next-property-change pos)) (let ((--dolist-tail--
(cons (quote face) font-lock-extra-managed-props))) (while
--dolist-tail-- (let ((prop (car --dolist-tail--))) (let ((new-prop
(get-text-property pos prop))) (put-text-property (+ start (1- pos))
(1- (+ start next)) prop new-prop org-buffer)) (setq --dolist-tail--
(cdr --dolist-tail--) (setq pos next))
  (let ((pos (point-min)) next) (while (setq next
(next-property-change pos)) (let ((--dolist-tail-- (cons (quote face)
font-lock-extra-managed-props))) (while --dolist-tail-- (let ((prop
(car --dolist-tail--))) (let ((new-prop ...)) (put-text-property (+
start ...) (1- ...) prop new-prop org-buffer)) (setq --dolist-tail--
(cdr --dolist-tail--) (setq pos next)))
  (let ((inhibit-modification-hooks nil)) (erase-buffer) (insert
string " ") (if (eq major-mode lang-mode) nil (funcall lang-mode))
(org-font-lock-ensure) (let ((pos (point-min)) next) (while (setq next
(next-property-change pos)) (let ((--dolist-tail-- (cons (quote face)
font-lock-extra-managed-props))) (while --dolist-tail-- (let ((prop
...)) (let (...) (put-text-property ... ... prop new-prop org-buffer))
(setq --dolist-tail-- (cdr --dolist-tail--) (setq pos next
  (save-current-buffer (set-buffer (get-buffer-create (format "
*org-src-fontification:%s*" lang-mode))) (let
((inhibit-modification-hooks nil)) (erase-buffer) (insert string " ")
(if (eq major-mode lang-mode) nil (funcall lang-mode))
(org-font-lock-ensure) (let ((pos (point-min)) next) (while (setq next
(next-property-change pos)) (let ((--dolist-tail-- (cons ...
font-lock-extra-managed-props))) (while --dolist-tail-- (let (...)
(let ... ...) (setq --dolist-tail-- ... (setq pos next)
  (let ((string (buffer-substring-no-properties start end)) (modified
(buffer-modified-p)) (org-buffer (current-buffer)))
(remove-text-properties start end (quote (face nil)))
(save-current-buffer (set-buffer (get-buffer-create (format "
*org-src-fontification:%s*" lang-mode))) (let
((inhibit-modification-hooks nil)) (erase-buffer) (insert string " ")
(if (eq major-mode lang-mode) nil (funcall lang-mode))
(org-font-lock-ensure) (let ((pos (point-min)) next) (while (setq next
(next-property-change pos)) (let ((--dolist-tail-- ...)) (while
--dolist-tail-- (let ... ... ...))) (setq pos next) (let
((src-face (nth 1 (assoc-string lang org-src-block-faces t (if (or
(facep src-face) (listp src-face)) (progn
(font-lock-append-text-property start end (quote face) src-face)))
(font-lock-append-text-property start end (quote face) (quote
org-block))) (add-text-properties start end (quote
(font-lock-fontified t fontified t font-lock-multiline t)))
(set-buffer-modified-p modified))
  (progn (let ((string (buffer-substring-no-properties start end))
(modified (buffer-modified-p)) (org-buffer (current-buffer)))

Re: [O] org-mobile-push breaks currently open org-agenda

2017-03-11 Thread Aaron Jensen
FYI, I bisected and this is the first bad commit:

bed17f1bb505dd6ecf80b44bf1ef267d45efb206 is the first bad commit
commit bed17f1bb505dd6ecf80b44bf1ef267d45efb206
Author: Nicolas Goaziou <m...@nicolasgoaziou.fr>
Date:   Sat Jan 14 16:12:43 2017 +0100

org-mobile: Fix `org-mobile-push' with stick agendas

* lisp/org-mobile.el (org-mobile-push): Do not move back to non-sticky
  agendas once called.

Reported-by: Ian Dunn <du...@gnu.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/111334>

:04 04 b51c5ae0d7d85ce3db8be72b495ba083f9104abd
3e1fb05b932e22cd0897baa94a8fb3073abe6a49 M  lisp



On Sat, Mar 11, 2017 at 7:54 AM, Aaron Jensen <aaronjen...@gmail.com> wrote:
> On Sat, Mar 11, 2017 at 7:53 AM, Aaron Jensen <aaronjen...@gmail.com> wrote:
>> $ git clone 
>> g...@github.com:aaronjensen/org-mobile-push-breaks-org-agenda-ecm.git
>> ~/.emacs.d.old
>
> Sorry, this line was wrong, it should clone to ~/.emacs.d:
>
> $ git clone 
> g...@github.com:aaronjensen/org-mobile-push-breaks-org-agenda-ecm.git
> ~/.emacs.d



Re: [O] org-mobile-push breaks currently open org-agenda

2017-03-11 Thread Aaron Jensen
On Sat, Mar 11, 2017 at 7:53 AM, Aaron Jensen <aaronjen...@gmail.com> wrote:
> $ git clone 
> g...@github.com:aaronjensen/org-mobile-push-breaks-org-agenda-ecm.git
> ~/.emacs.d.old

Sorry, this line was wrong, it should clone to ~/.emacs.d:

$ git clone 
g...@github.com:aaronjensen/org-mobile-push-breaks-org-agenda-ecm.git
~/.emacs.d



Re: [O] org-mobile-push breaks currently open org-agenda

2017-03-11 Thread Aaron Jensen
On Fri, Mar 10, 2017 at 9:28 AM, Nicolas Goaziou  wrote:
> ATM, I am not sure how it happens since the headline was extracted from
> some document. Could you try evaluating
>
>   M-: (org-get-at-bol 'org-marker)
>
> on a problematic line and report back the problem?

I just get this:

#

> Better, do you have any ECM for the problem?

Here is an ECM:
https://github.com/aaronjensen/org-mobile-push-breaks-org-agenda-ecm

$ mv ~/.emacs.d ~/.emacs.d.old
$ git clone 
g...@github.com:aaronjensen/org-mobile-push-breaks-org-agenda-ecm.git
~/.emacs.d.old
$ emacs

In emacs:

1. M-x org-agenda a
2. M-x org-mobile-push
3. C-n to TODO and hit t to mark as done

This works fine with the built-in version of emacs, so this appears to
be either a regression or a contrib issue.

Thanks,

Aaron



Re: [O] org-mobile-push breaks currently open org-agenda

2017-03-10 Thread Aaron Jensen
Hi,

> On Mar 10, 2017, at 8:20 AM, Nicolas Goaziou  wrote:
> 
> Hello,
> 
> Could you use Org uncompiled (C-u M-x org-reload)? your backtrace is
> hardly usable.

Thank you for the tip. Here is the trace:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  set-buffer(nil)
  (save-current-buffer (set-buffer buffer) buffer-undo-list)
  (let ((--cline (org-current-line)) (--cmd this-command) (--buf1 
(current-buffer)) (--buf2 buffer) (--undo1 buffer-undo-list) (--undo2 
(save-current-buffer (set-buffer buffer) buffer-undo-list)) --c1 --c2) 
(save-current-buffer (set-buffer buffer) (widen) (goto-char pos) 
(org-show-context (quote agenda)) (let ((current-prefix-arg arg)) 
(call-interactively (quote org-todo))) (and (bolp) (forward-char 1)) (setq 
newhead (org-get-heading)) (if (and (and (boundp (quote 
org-agenda-headline-snapshot-before-repeat)) 
org-agenda-headline-snapshot-before-repeat) (not (equal 
org-agenda-headline-snapshot-before-repeat newhead)) todayp) (progn (setq 
newhead org-agenda-headline-snapshot-before-repeat just-one t))) 
(save-excursion (org-back-to-heading) (move-marker org-last-heading-marker 
(point (beginning-of-line 1) (let ((wconfig 
(current-window-configuration))) (unwind-protect (progn 
(org-agenda-change-all-lines newhead hdmarker (quote fixface) just-one)) 
(set-window-configuration wconfig))) (if (and (boundp (quote 
org-clock-out-when-done)) org-clock-out-when-done) (progn (string-match (concat 
"^" (regexp-opt org-done-keywords-for-agenda)) newhead) 
(org-agenda-unmark-clocking-task))) (org-move-to-column col) 
(org-agenda-mark-clocking-task) (if org-agenda-allow-remote-undo (progn (setq 
--c1 (org-verify-change-for-undo --undo1 (save-current-buffer (set-buffer 
--buf1) buffer-undo-list)) --c2 (org-verify-change-for-undo --undo2 
(save-current-buffer (set-buffer --buf2) buffer-undo-list))) (if (or --c1 --c2) 
(progn (and --c1 (save-current-buffer (set-buffer --buf1) (undo-boundary))) 
(and --c2 (save-current-buffer (set-buffer --buf2) (undo-boundary))) (setq 
org-agenda-undo-list (cons (list --cmd --cline --buf1 --c1 --buf2 --c2) 
org-agenda-undo-list)))
  (let* ((col (current-column)) (marker (or (org-get-at-bol (quote org-marker)) 
(org-agenda-error))) (buffer (marker-buffer marker)) (pos (marker-position 
marker)) (hdmarker (org-get-at-bol (quote org-hd-marker))) (todayp 
(org-agenda-today-p (org-get-at-bol (quote day (inhibit-read-only t) 
org-agenda-headline-snapshot-before-repeat newhead just-one) (let ((--cline 
(org-current-line)) (--cmd this-command) (--buf1 (current-buffer)) (--buf2 
buffer) (--undo1 buffer-undo-list) (--undo2 (save-current-buffer (set-buffer 
buffer) buffer-undo-list)) --c1 --c2) (save-current-buffer (set-buffer buffer) 
(widen) (goto-char pos) (org-show-context (quote agenda)) (let 
((current-prefix-arg arg)) (call-interactively (quote org-todo))) (and (bolp) 
(forward-char 1)) (setq newhead (org-get-heading)) (if (and (and (boundp (quote 
org-agenda-headline-snapshot-before-repeat)) 
org-agenda-headline-snapshot-before-repeat) (not (equal 
org-agenda-headline-snapshot-before-repeat newhead)) todayp) (progn (setq 
newhead org-agenda-headline-snapshot-before-repeat just-one t))) 
(save-excursion (org-back-to-heading) (move-marker org-last-heading-marker 
(point (beginning-of-line 1) (let ((wconfig 
(current-window-configuration))) (unwind-protect (progn 
(org-agenda-change-all-lines newhead hdmarker (quote fixface) just-one)) 
(set-window-configuration wconfig))) (if (and (boundp (quote 
org-clock-out-when-done)) org-clock-out-when-done) (progn (string-match (concat 
"^" (regexp-opt org-done-keywords-for-agenda)) newhead) 
(org-agenda-unmark-clocking-task))) (org-move-to-column col) 
(org-agenda-mark-clocking-task) (if org-agenda-allow-remote-undo (progn (setq 
--c1 (org-verify-change-for-undo --undo1 (save-current-buffer (set-buffer 
--buf1) buffer-undo-list)) --c2 (org-verify-change-for-undo --undo2 
(save-current-buffer (set-buffer --buf2) buffer-undo-list))) (if (or --c1 --c2) 
(progn (and --c1 (save-current-buffer ... ...)) (and --c2 (save-current-buffer 
... ...)) (setq org-agenda-undo-list (cons ... org-agenda-undo-list
  (lambda ( arg) "Cycle TODO state of line at point, also in Org 
file.\nThis changes the line at point, all other lines in the agenda referring 
to\nthe same tree node, and the headline of the tree node in the Org file." 
(interactive "P") (org-agenda-check-no-diary) (let* ((col (current-column)) 
(marker (or (org-get-at-bol (quote org-marker)) (org-agenda-error))) (buffer 
(marker-buffer marker)) (pos (marker-position marker)) (hdmarker 
(org-get-at-bol (quote org-hd-marker))) (todayp (org-agenda-today-p 
(org-get-at-bol (quote day (inhibit-read-only t) 
org-agenda-headline-snapshot-before-repeat newhead just-one) (let ((--cline 
(org-current-line)) (--cmd this-command) (--buf1 (current-buffer)) (--buf2 
buffer) (--undo1 buffer-undo-list) (--undo2 

[O] org-mobile-push breaks currently open org-agenda

2017-03-09 Thread Aaron Jensen
html