(goto-char beg) throw error, when called from function (comment-regio…#83
Open
sharad wants to merge 1 commit intoalphapapa:masterfrom
Open
(goto-char beg) throw error, when called from function (comment-regio…#83sharad wants to merge 1 commit intoalphapapa:masterfrom
sharad wants to merge 1 commit intoalphapapa:masterfrom
Conversation
…n-default)
Description:
(goto-char beg) throw error "Marker points into wrong buffer", when current-buffer and marker-buffer are not same
(goto-char beg) called by comment-region
which in turn called by outshine-comment-region
whcih in turn called from adviced org-store-log-note
Reason:
Issue happens when current-buffer and marker-buffer are not same
It usually happens when (org-store-log-note) used in uninteractively
For example:
Using org-store-log-note in a idle timer to log predefined note in a org file.
Here org-store-log-note is called through org-clock-out which is called
from a idle timer function.
Backtrace:
Debugger entered--Lisp error: (error "Marker points into wrong buffer" #<marker at 28600 in report.org>)
comment-region-default(#<marker at 28600 in report.org> #<marker (moves after insertion) at 28600 in report.org> nil)
comment-region(#<marker at 28600 in report.org> #<marker (moves after insertion) at 28600 in report.org> nil)
outshine-comment-region(#<marker at 28600 in report.org> #<marker (moves after insertion) at 28600 in report.org>)
ad-Advice-org-store-log-note
apply(ad-Advice-org-store-log-note
org-store-log-note()
org-ctrl-c-ctrl-c(nil)
funcall-interactively(org-ctrl-c-ctrl-c nil)
call-interactively(org-ctrl-c-ctrl-c nil nil)
command-execute(org-ctrl-c-ctrl-c)
Error:
(goto-char beg) through (error "Marker points into wrong buffer" #<marker at POS in FILE>)
from comment-region-default calledby comment-region called by
outshine-comment-region
Solution:
This error can be fix by wrapping (outshine-comment-region ...) function call
in (with-current-buffer (marker-buffer org-log-note-marker) ...)
Owner
|
Thanks. @thblt Does this look good to you? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…n-default)
Description:
(goto-char beg) throw error "Marker points into wrong buffer", when current-buffer and marker-buffer are not same
(goto-char beg) called by comment-region
which in turn called by outshine-comment-region
whcih in turn called from adviced org-store-log-note
Reason:
Issue happens when current-buffer and marker-buffer are not same
It usually happens when (org-store-log-note) used in uninteractively
For example:
Using org-store-log-note in a idle timer to log predefined note in a org file.
Backtrace:
Debugger entered--Lisp error: (error "Marker points into wrong buffer" #<marker at 28600 in report.org>)
comment-region-default(#<marker at 28600 in report.org> #<marker (moves after insertion) at 28600 in report.org> nil)
comment-region(#<marker at 28600 in report.org> #<marker (moves after insertion) at 28600 in report.org> nil)
outshine-comment-region(#<marker at 28600 in report.org> #<marker (moves after insertion) at 28600 in report.org>)
ad-Advice-org-store-log-note
apply(ad-Advice-org-store-log-note
org-store-log-note()
org-ctrl-c-ctrl-c(nil)
funcall-interactively(org-ctrl-c-ctrl-c nil)
call-interactively(org-ctrl-c-ctrl-c nil nil)
command-execute(org-ctrl-c-ctrl-c)
Error:
(goto-char beg) through (error "Marker points into wrong buffer" #)
from comment-region-default calledby comment-region called by
outshine-comment-region
Solution:
This error can be fix by wrapping (outshine-comment-region ...) function call
in (with-current-buffer (marker-buffer org-log-note-marker) ...)