[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-24 r117301: Fix a few packages to work with nil tab-
From: |
Leo Liu |
Subject: |
[Emacs-diffs] emacs-24 r117301: Fix a few packages to work with nil tab-stop-list |
Date: |
Thu, 26 Jun 2014 00:06:23 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 117301
revision-id: address@hidden
parent: address@hidden
committer: Leo Liu <address@hidden>
branch nick: emacs-24
timestamp: Thu 2014-06-26 07:53:37 +0800
message:
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.
modified:
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/indent.el indent.el-20091113204419-o5vbwnq5f7feedwu-230
lisp/progmodes/asm-mode.el asmmode.el-20091113204419-o5vbwnq5f7feedwu-400
lisp/ruler-mode.el
rulermode.el-20091113204419-o5vbwnq5f7feedwu-2250
lisp/textmodes/picture.el picture.el-20091113204419-o5vbwnq5f7feedwu-213
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2014-06-25 17:20:08 +0000
+++ b/lisp/ChangeLog 2014-06-25 23:53:37 +0000
@@ -1,3 +1,14 @@
+2014-06-25 Leo Liu <address@hidden>
+
+ * 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.
+
+ * indent.el (indent-accumulate-tab-stops): New function.
+
2014-06-25 Stefan Monnier <address@hidden>
* emacs-lisp/package.el (package-list-unsigned): New var (bug#17625).
=== modified file 'lisp/indent.el'
--- a/lisp/indent.el 2014-06-23 23:09:20 +0000
+++ b/lisp/indent.el 2014-06-25 23:53:37 +0000
@@ -677,6 +677,13 @@
(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.
=== modified file 'lisp/progmodes/asm-mode.el'
--- a/lisp/progmodes/asm-mode.el 2014-02-10 01:34:22 +0000
+++ b/lisp/progmodes/asm-mode.el 2014-06-25 23:53:37 +0000
@@ -172,7 +172,7 @@
;; Simple `;' comments go to the comment-column.
(and (looking-at "\\s<\\(\\S<\\|\\'\\)") comment-column)
;; The rest goes at the first tab stop.
- (or (car tab-stop-list) tab-width)))
+ (or (indent-next-tab-stop 0))))
(defun asm-colon ()
"Insert a colon; if it follows a label, delete the label's indentation."
=== modified file 'lisp/ruler-mode.el'
--- a/lisp/ruler-mode.el 2014-01-01 07:43:34 +0000
+++ b/lisp/ruler-mode.el 2014-06-25 23:53:37 +0000
@@ -477,8 +477,9 @@
(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 @@
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
=== modified file 'lisp/textmodes/picture.el'
--- a/lisp/textmodes/picture.el 2014-02-10 01:34:22 +0000
+++ b/lisp/textmodes/picture.el 2014-06-25 23:53:37 +0000
@@ -418,7 +418,8 @@
(save-excursion
(let (tabs)
(if arg
- (setq tabs (default-value 'tab-stop-list))
+ (setq tabs (or (default-value 'tab-stop-list)
+ (indent-accumulate-tab-stops (window-width))))
(let ((regexp (concat "[ \t]+[" (regexp-quote picture-tab-chars) "]")))
(beginning-of-line)
(let ((bol (point)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-24 r117301: Fix a few packages to work with nil tab-stop-list,
Leo Liu <=