-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible to turn on mode buffer-local? #74
Comments
org-remark-mode is a buffer local minor mode, so yes. Any reason why you don’t use |
I would also like to analyze what exactly happens. Do you mind providing me more detail of your set up and step-by-step procedure so that I cN reproduce the error? Thank you 🙏 |
@akashpal-21 Please take your time. No need to feel any pressure. |
Function `org-remark-highlights-load' is set to `after-revert-hook'. Before this fix, it was wrongly set as a global hook. This caused the hook to call the function wrongly for buffers that do not have `org-remark-mode` enabled -- it is a local minor mode.
Thank you for the detail. #74 should fix the issue where, in your example, remark0 creates a note buffer. I could not replicate your second issue with this error:
I am guessing it may be fixed by this patch too. Please let me know. Two additional comments: 1. Use of File Local VariableYou use this syntax: #** * eval: .... ; * When I call command
2. Pop-up to Ask for Read-Only BufferThe read-only file pop-up seems to be cause by the fact the subdirectory (defun custom/org-remark-note-path ()
(let ((dir (concat (file-name-directory (buffer-file-name))
"resources/"
(file-name-sans-extension (buffer-name))
"/")))
(unless (file-exists-p dir) (make-directory dir t))
(concat dir "notes.org")))
(setq org-remark-notes-file-path #'custom/org-remark-note-path)
(setq org-remark-source-file-name 'abbreviate-file-name)) |
Thank you for raising this issue; it would have been impossible to notice this error in my code... |
I managed to solve the highlight not loading when opening from the file manager directly too, for some reason the hook was not getting executed and therefore (org-remark-highlights-load) was not loading - which meant that tracking was turned off too, it was not only a visual bug. I changed line no. 1656 from This seems to have solved the bug in my case, This is the full edit I made combined,
|
Thanks for the note. Please keep it open for now. I would like to see if I can replicate what you see. I hope to have some time in one of the weekends soon (hopefully in January). |
Is this the current issue you are reminding me of? |
And your solution is pasted in full in the diff in this comment? |
Not annoyed at all. Just forgotten, apologies. Thanks for keeping me honest. |
Hey @nobiot I have solved the problem - there is nothing wrong with these two functions, the problem all along was my also
Sorry for the false alarm. Best. |
Thank you for letting me know. I was going to come back to this issue. But... no need to come back then? |
I spoke too soon - it seems fundamentally window-state-change hook is buggy and should not be relied upon - i
I think such a delay mechanism would be more resilient. This issue was for the error - we now know where the error source was - if youd not mind - can I open a new issue for the window-state-change-function leaking? |
Refer to issues #82 #74. If buffer in question is opened directly instead of using find-file -- during new client frame creation - this leaks to ALL open buffers if org-remark-mode is activated by using local evaluation, for example: # Local Variables: # eval: (org-remark-mode) # End: The solution is to replace the use of `window-state-change-functions' hook with the local post-command-hook.
I only use this package for files explicitly - I add a prop line in the beginning of the file to evaluate the function that enables this mode.
One problem with this is that - if a file in which this has been evaluated has been opened - any subsequent file I do revert C-x x g ; the package tries to open its note file even if the mode is disabled in the file. I think this is a bug
Secondly; this error pops up when i visit a file with org-remark-mode enabled:
The relevant function which causes the error is
is it normal ?
The text was updated successfully, but these errors were encountered: