Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Commit

Permalink
Move insert newline condition up again.
Browse files Browse the repository at this point in the history
Especially the goto-char needs special protection. This shouldn't be
made when no newline is requested.
  • Loading branch information
rudolfochrist committed Nov 20, 2016
1 parent b09e87d commit e5fd369
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions interleave.el
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,15 @@ If POSITION is non-nil move point to it."
(switch-to-buffer interleave-org-buffer))
(when (integerp position)
(goto-char position))
(save-restriction
(interleave--narrow-to-subtree t)
(goto-char (point-max))
(unless interleave-disable-narrowing
(redisplay))
;; Insert a new line if not already on a new line
(when (and insert-newline-maybe
(not (looking-back "^ *" (line-beginning-position))))
(org-return))))
(when insert-newline-maybe
(save-restriction
(interleave--narrow-to-subtree t)
(goto-char (point-max))
(unless interleave-disable-narrowing
(redisplay))
;; Insert a new line if not already on a new line
(when (not (looking-back "^ *" (line-beginning-position)))
(org-return)))))

(defun interleave--switch-to-pdf-buffer ()
"Switch to the pdf buffer."
Expand Down

0 comments on commit e5fd369

Please sign in to comment.