summaryrefslogtreecommitdiff
path: root/lisp/ruler-mode.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/ruler-mode.el
parent30a42a5bedfbfaab72da862826f43291fe771ce8 (diff)
downloademacs-83d208a5dd293caae48beb9d36dd45529375631a.tar.gz
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/ruler-mode.el')
-rw-r--r--lisp/ruler-mode.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/ruler-mode.el b/lisp/ruler-mode.el
index 9e32a2f5c64..bcd9c5463a1 100644
--- a/lisp/ruler-mode.el
+++ b/lisp/ruler-mode.el
@@ -477,8 +477,9 @@ START-EVENT is the mouse click event."
(not (member ts tab-stop-list))
(progn
(message "Tab stop set to %d" ts)
- (setq tab-stop-list (sort (cons ts tab-stop-list)
- #'<)))))))))
+ (when (null tab-stop-list)
+ (setq tab-stop-list (indent-accumulate-tab-stops (1- ts))))
+ (setq tab-stop-list (sort (cons ts tab-stop-list) #'<)))))))))
(defun ruler-mode-mouse-del-tab-stop (start-event)
"Delete tab stop at the graduation where the mouse pointer is on.
@@ -754,7 +755,7 @@ Optional argument PROPS specifies other text properties to apply."
i (1+ i) 'help-echo ruler-mode-fill-column-help-echo
ruler))
;; Show the `tab-stop-list' markers.
- ((and ruler-mode-show-tab-stops (member j tab-stop-list))
+ ((and ruler-mode-show-tab-stops (= j (indent-next-tab-stop (1- j))))
(aset ruler i ruler-mode-tab-stop-char)
(put-text-property
i (1+ i) 'face 'ruler-mode-tab-stop