aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjason2015-11-07 15:22:57 -0700
committerjason2015-11-07 15:22:57 -0700
commitb8e51d1e9c228125e0f7e68cdb400a00edf49a10 (patch)
tree20be84aa5b830f9cd2c7b9946eae74ad4c405623
parent98e9bbbb0a36900e1c174d92b7c8e23fc0aa0752 (diff)
downloaddotfiles-b8e51d1e9c228125e0f7e68cdb400a00edf49a10.tar.gz
dotfiles-b8e51d1e9c228125e0f7e68cdb400a00edf49a10.zip
use markers for unscroll
-rw-r--r--.spacemacs17
1 files changed, 9 insertions, 8 deletions
diff --git a/.spacemacs b/.spacemacs
index d9dbdef..47b5fc9 100644
--- a/.spacemacs
+++ b/.spacemacs
@@ -277,19 +277,20 @@ M-x ao/what-face."
277;; Undo accidental scrolling 277;; Undo accidental scrolling
278(put 'scroll-up-command 'unscrollable t) 278(put 'scroll-up-command 'unscrollable t)
279(put 'scroll-down-command 'unscrollable t) 279(put 'scroll-down-command 'unscrollable t)
280(put 'scroll-left-command 'unscrollable t) 280(defvar unscroll-point (make-marker)
281(put 'scroll-right-command 'unscrollable t)
282(defvar unscroll-point nil
283 "Text position for next call to 'unscroll'.") 281 "Text position for next call to 'unscroll'.")
284(defvar unscroll-window-start nil 282(defvar unscroll-window-start (make-marker)
285 "Window start for next call to 'unscroll'.") 283 "Window start for next call to 'unscroll'.")
286(defvar unscroll-window-hscroll nil 284(defvar unscroll-window-hscroll nil
287 "Hscroll for next call to 'unscroll'.") 285 "Hscroll for next call to 'unscroll'.")
288(defun unscroll-maybe-remember () 286(defun unscroll-maybe-remember ()
289 (if (not (get last-command 'unscrollable)) 287 (if (not (get last-command 'unscrollable))
290 (setq unscroll-point (point) 288 (progn
291 unscroll-window-start (window-start) 289 (set-marker unscroll-point (point))
292 unscroll-window-hscroll (window-hscroll)))) 290 (set-marker unscroll-window-start (window-start))
291 (setq unscroll-window-hscroll (window-hscroll))
292 )))
293
293(defun unscroll () 294(defun unscroll ()
294 "Jump to location specified by 'unscroll-point'." 295 "Jump to location specified by 'unscroll-point'."
295 (interactive) 296 (interactive)