Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun my-column-ruler (width)
- "Display temp ruler at point."
- (interactive `(,(- (+ (window-hscroll)(window-width)) 1)))
- (momentary-string-display
- (if (< width 10)
- "1 5 10\n|...|....|\n"
- (let* ((iterations (/ width 10))
- (short (- width (* 10 iterations)))
- (result1 "|...|....|")
- (result2 "1 5 10")
- (inc1 "....|....|")
- (inc2 " %d0")
- (i 1))
- (while (< i iterations)
- (setq i (1+ i))
- (setq result1 (concat result1 inc1))
- (setq result2 (concat result2 (substring (format inc2 i) -10))))
- (concat result2 "\n" result1 (substring inc1 0 short) "\n")))
- (line-beginning-position)
- nil "[space] Clears ruler"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement