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

Smartly reactivate beginend when narrowing is in effect #33

Merged
merged 1 commit into from Jun 18, 2017

Conversation

DamienCassou
Copy link
Owner

Instead of just deactivating beginend when a buffer is narrowed, this
patch widens the buffer, applies the beginend procedure, and checks if
point has moved outside the original narrowed region.

@DamienCassou
Copy link
Owner Author

Up

(defun beginend--out-of-bounds-p (point)
"Return non-nil if POINT is outside [`point-min', `point-max'].
This is possible if buffer was narrowed after POINT was stored."
(not (<= (point-min) point (point-max))))
Copy link
Collaborator

Choose a reason for hiding this comment

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

This only works in 25+. Is that our lowest-supported version?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Apparently this got added in Emacs 24.4:

Numeric comparison functions =, <, >, <=, >= can now take many arguments.

That's good enough for me.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I also added tests and Travis builds this package on Emacs 24.5.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh, okey. Somehow I was under the impression it's a 25+ feature. Let's go ahead with this then. But we should probably add a version constraint to the requirements.

Copy link
Owner Author

Choose a reason for hiding this comment

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

But we should probably add a version constraint to the requirements.

beginend.el already contains:

;; Package-Requires: ((emacs "24.4"))

Do you have something else in mind?

@DamienCassou DamienCassou force-pushed the widen-before-moving branch 2 times, most recently from 6131afb to 30ac9ee Compare June 18, 2017 11:14
Instead of just deactivating beginend when a buffer is narrowed, this
patch widens the buffer, applies the beginend procedure, and checks if
point has moved outside the original narrowed region.
@DamienCassou DamienCassou merged commit 0aa6033 into master Jun 18, 2017
@DamienCassou DamienCassou deleted the widen-before-moving branch June 18, 2017 12:03
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