From: Ian Kelling Date: Sun, 29 Jun 2014 22:49:20 +0000 (-0700) Subject: add spray-quit plus some minor docs X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=dce5a35abd9e640d6d6123ac2b2bfd42c86ee7f8;p=spray add spray-quit plus some minor docs --- diff --git a/spray.el b/spray.el index 5a4318b..7e38b4e 100644 --- a/spray.el +++ b/spray.el @@ -56,7 +56,8 @@ (define-key km (kbd "") 'spray-backward-word) (define-key km (kbd "") 'spray-forward-word) (define-key km (kbd "f") 'spray-faster) - (define-key km (kbd "s") 'spray-slower) + (define-key km (kbd "q") 'spray-quit) + (define-key km (kbd "") 'spray-quit) km) "keymap for spray-mode buffers") @@ -77,7 +78,8 @@ ;; * internal vars -(defvar spray--margin-string "") +(defvar spray--margin-string "" + "Currently not used.") (defvar spray--base-overlay nil) (defvar spray--orp-overlay nil) (defvar spray--running nil) @@ -89,10 +91,11 @@ ;; * utility functions (defun spray-set-margins (left above) - "add margins before/above the spray text. each arguments can be + "Currently broken & not used: +add margins before/above the spray text. each arguments can be an integer or a float value." (setq spray--margin-string - (propertize " " 'display `((space-width ,left) (height ,(1+ above)))))) + (propertize " " 'display `((space-width ,left) (height ,(+ 1 above)))))) ;; * the mode @@ -134,6 +137,11 @@ an integer or a float value." (remove-hook 'pre-command-hook 'spray--pre-command-handler) (spray-stop)))) +(defun spray-quit () + "Exit spray mode." + (interactive) + (spray-mode -1)) + (defun spray--pre-command-handler () (unless (string-match "^spray-" (symbol-name this-command)) (spray-mode -1)))