Skip to content
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

org-noter-insert-note complains, "valign--flag-region-advice: Args out of range: 194, 519" #148

Open
Arbitrageur opened this issue May 12, 2021 · 2 comments

Comments

@Arbitrageur
Copy link

I'm using Spacemacs on mac.

When I hit i(org-noter-insert-note), it fails to create a new entry and complains "Args out of range"

As far as I found, when I start org-noter, org-mode narrowed and outline-show-entry function in org-noter-insert-note failed

because (point-min) gives 195 in the note buffer.

How can I resolve this issue?

@Arbitrageur
Copy link
Author

I'm not sure this is the proper solution but it works.

    (defun my/outline-show-entry ()
      "Show the body directly following this heading.
Show the heading too, if it is currently invisible."
      (interactive)
      (save-excursion
        (outline-back-to-heading t)
        (outline-flag-region (max (1- (point)) (point-min))
                             (progn
                               (outline-next-preface)
                               (if (= 1 (- (point-max) (point)))
                                   (point-max)
                                 (point)))
                             nil)))
    (advice-add 'outline-show-entry :override #'my/outline-show-entry)

@stewmehr
Copy link

stewmehr commented Dec 20, 2021

I've run into the same issue and the changes to outline-show-entry suggested above worked for me. I did not investigate this any further but I think that this has only happened for documents with relatively long content before the "Notes" section where (point-min) in the narrowed buffer took high values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants