iankelling.org
/
git
/
spray
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dce5a35
)
Enable and enhance left and top margins
author
Ian Kelling
<ian@iankelling.org>
Mon, 30 Jun 2014 03:35:14 +0000
(20:35 -0700)
committer
Ian Kelling
<ian@iankelling.org>
Mon, 30 Jun 2014 03:39:28 +0000
(20:39 -0700)
spray.el
patch
|
blob
|
history
diff --git
a/spray.el
b/spray.el
index 7e38b4eee3dbd13a0cad1a37dc6760cf1e7ddf5b..7a6b8fd23c47b4253c94140919bf709f650089e2 100644
(file)
--- a/
spray.el
+++ b/
spray.el
@@
-47,6
+47,8
@@
(defvar spray-wpm 400 "words/min")
(defvar spray-height 400 "height of characters")
(defvar spray-wpm 400 "words/min")
(defvar spray-height 400 "height of characters")
+(defvar spray-margin-top 1 "character margin at top of buffer. Characters are as big as spray text characters.")
+(defvar spray-margin-left 0 "character margin at left of buffer. Characters are as big as spray text characters.")
(defvar spray-mode-map
(let ((km (make-sparse-keymap)))
(defvar spray-mode-map
(let ((km (make-sparse-keymap)))
@@
-90,12
+92,11
@@
;; * utility functions
;; * utility functions
-(defun spray-set-margins (left above)
- "Currently broken & not used:
-add margins before/above the spray text. each arguments can be
-an integer or a float value."
+(defun spray-set-margins ()
+ "Setup spray--margin-string"
(setq spray--margin-string
(setq spray--margin-string
- (propertize " " 'display `((space-width ,left) (height ,(+ 1 above))))))
+ (concat (make-string spray-margin-top 10) ;; 10 = ascii newline
+ (make-string spray-margin-left 32)))) ;; 32 = ascii space
;; * the mode
;; * the mode
@@
-165,6
+166,7
@@
an integer or a float value."
(t 0))))
(move-overlay spray--orp-overlay (1- orp) orp)
(move-overlay spray--base-overlay beg end)
(t 0))))
(move-overlay spray--orp-overlay (1- orp) orp)
(move-overlay spray--base-overlay beg end)
+ (spray-set-margins)
(overlay-put spray--base-overlay 'before-string
(concat spray--margin-string
(make-string (- 5 (- orp beg)) ?\s)))
(overlay-put spray--base-overlay 'before-string
(concat spray--margin-string
(make-string (- 5 (- orp beg)) ?\s)))