From 83d208a5dd293caae48beb9d36dd45529375631a Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Thu, 26 Jun 2014 07:53:37 +0800 Subject: 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. --- lisp/ruler-mode.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lisp/ruler-mode.el') 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 -- cgit v1.2.3