Remove edge case that doesn't matter anymore

If `pos` is not the beginning of a cell then a beginning can always be found
unless no cell beginning exists, even when `point-min` is the beginning of a
cell. These cases are already handled by the
surround code.
This commit is contained in:
Nathaniel Nicandro 2018-01-17 21:27:04 -06:00
parent c670e4e620
commit 47c50f7c73

View file

@ -552,10 +552,7 @@ buffer is found before the beginning of a cell, raise a
`beginning-of-buffer' error." `beginning-of-buffer' error."
(let ((pos (point))) (let ((pos (point)))
(while (not (jupyter-repl-cell-beginning-p pos)) (while (not (jupyter-repl-cell-beginning-p pos))
(setq pos (or (previous-single-property-change pos 'jupyter-cell) (setq pos (previous-single-property-change pos 'jupyter-cell))
;; Edge case when `point-min' is the beginning of a cell
(and (jupyter-repl-cell-beginning-p (point-min))
(point-min))))
(if pos (when (jupyter-repl-cell-end-p pos) (if pos (when (jupyter-repl-cell-end-p pos)
(error "Found end of previous cell")) (error "Found end of previous cell"))
(signal 'beginning-of-buffer nil))) (signal 'beginning-of-buffer nil)))