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

counsel.el (counsel-org-goto--get-headlines): Fix point-min bug #1011

Merged

Conversation

fabacino
Copy link
Contributor

outline-next-heading was always called once before starting the processing of the headlines, which resulted in the first headline to be excluded from the list if it was located at the very top of the file i.e. at (point-min).

The fixed function now checks if point is already on a heading and only calls outline-next-heading if this is not the case before starting the processing of the headlines.

outline-next-heading was always called once before starting the
processing of the headlines, which resulted in the first headline to
be excluded from the list if it was located at the very top of the
file i.e. at point-min.

The fixed function now checks if point is already on a heading and
only calls outline-next-heading if this is not the case before
starting the processing of the headlines.
@abo-abo abo-abo merged commit 16997d8 into abo-abo:master May 17, 2017
@abo-abo
Copy link
Owner

abo-abo commented May 17, 2017

Thanks.

@@ -2386,7 +2389,8 @@ to custom."
(when (eq counsel-org-goto-display-style 'headline)
(setq name (concat (make-string level ?*) " " name)))
(setq name (counsel-org-goto--add-face name level))))
(push `(,name . ,(point-marker)) entries)))
(push `(,name . ,(point-marker)) entries))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is simply cons, isn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct, I'll simplify it.

@fabacino fabacino deleted the bugfix/counsel-org-first-headline-is-ignored branch May 18, 2017 15:55
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

Successfully merging this pull request may close these issues.

None yet

2 participants