From 5e8726dc6c57dc924445ef3849ba816cdc3fe0bf Mon Sep 17 00:00:00 2001 From: "git@daemon.de" Date: Wed, 25 May 2016 14:51:10 +0200 Subject: [PATCH] avoid calling a kill func if theres nothing left to kill --- viking-mode.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/viking-mode.el b/viking-mode.el index 9d7efab..1f171d1 100644 --- a/viking-mode.el +++ b/viking-mode.el @@ -346,10 +346,15 @@ should be a point-moving function." 'viking--current-killf, reset it to the contents of 'viking-kill-funcs if COUNT is 1 (thus the command key has been pressed the first time in a row" - (if (eq count 1) ; start from scratch + ;; start from scratch + (if (eq count 1) (setq viking--current-killf viking-kill-funcs)) - (if viking--current-killf ; only call killer if not done killing - (funcall (pop viking--current-killf)))) + + ;; only call killer if not done killing + (if (and viking--current-killf (not (eobp))) + (funcall (pop viking--current-killf)) + (signal 'end-of-buffer nil) + )) ;;;;; Public interactive kill functions