summaryrefslogtreecommitdiff
path: root/lisp/indent.el
diff options
context:
space:
mode:
authorLeo Liu <sdl.web@gmail.com>2014-06-26 07:53:37 +0800
committerLeo Liu <sdl.web@gmail.com>2014-06-26 07:53:37 +0800
commit83d208a5dd293caae48beb9d36dd45529375631a (patch)
treee8075fee7dc607ebfa34779edf3e929c8fca6b63 /lisp/indent.el
parent30a42a5bedfbfaab72da862826f43291fe771ce8 (diff)
Fix a few packages to work with nil tab-stop-list
* indent.el (indent-accumulate-tab-stops): New function. * textmodes/picture.el (picture-set-tab-stops): * ruler-mode.el (ruler-mode-mouse-add-tab-stop) (ruler-mode-ruler): Fix to work with nil tab-stop-list. * progmodes/asm-mode.el (asm-calculate-indentation): Use indent-next-tab-stop.
Diffstat (limited to 'lisp/indent.el')
-rw-r--r--lisp/indent.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/indent.el b/lisp/indent.el
index 7df927ff808..20820701b3b 100644
--- a/lisp/indent.el
+++ b/lisp/indent.el
@@ -677,6 +677,13 @@ If PREV is non-nil, return the previous one instead."
(if (<= column last) -1 (/ (- column last 1) step))
(1+ (/ (- column last) step)))))))))
+(defun indent-accumulate-tab-stops (limit)
+ "Get a list of tab stops before LIMIT (inclusive)."
+ (let ((tab 0) (tab-stops))
+ (while (<= (setq tab (indent-next-tab-stop tab)) limit)
+ (push tab tab-stops))
+ (nreverse tab-stops)))
+
(defun tab-to-tab-stop ()
"Insert spaces or tabs to next defined tab-stop column.
The variable `tab-stop-list' is a list of columns at which there are tab stops.