From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Liu Newsgroups: gmane.emacs.bugs Subject: bug#16381: 24.3.50; align issue Date: Tue, 24 Jun 2014 21:05:10 +0800 Message-ID: References: <87ha9gvzdq.fsf@borealis.i-did-not-set--mail-host-address--so-tickle-me> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1403615197 14737 80.91.229.3 (24 Jun 2014 13:06:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Jun 2014 13:06:37 +0000 (UTC) Cc: 16381@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 24 15:06:30 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WzQQY-0001yh-Gg for geb-bug-gnu-emacs@m.gmane.org; Tue, 24 Jun 2014 15:06:22 +0200 Original-Received: from localhost ([::1]:59513 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzQQX-0006t2-Et for geb-bug-gnu-emacs@m.gmane.org; Tue, 24 Jun 2014 09:06:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59055) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzQQM-0006rf-Q3 for bug-gnu-emacs@gnu.org; Tue, 24 Jun 2014 09:06:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WzQQE-0001Rv-CS for bug-gnu-emacs@gnu.org; Tue, 24 Jun 2014 09:06:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39664) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzQQE-0001Rp-AJ for bug-gnu-emacs@gnu.org; Tue, 24 Jun 2014 09:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WzQQD-0007te-LL for bug-gnu-emacs@gnu.org; Tue, 24 Jun 2014 09:06:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Leo Liu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Jun 2014 13:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16381 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 16381-submit@debbugs.gnu.org id=B16381.140361513330316 (code B ref 16381); Tue, 24 Jun 2014 13:06:01 +0000 Original-Received: (at 16381) by debbugs.gnu.org; 24 Jun 2014 13:05:33 +0000 Original-Received: from localhost ([127.0.0.1]:59047 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WzQPf-0007sm-N8 for submit@debbugs.gnu.org; Tue, 24 Jun 2014 09:05:32 -0400 Original-Received: from mail-pa0-f51.google.com ([209.85.220.51]:37246) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WzQPZ-0007sO-01 for 16381@debbugs.gnu.org; Tue, 24 Jun 2014 09:05:25 -0400 Original-Received: by mail-pa0-f51.google.com with SMTP id hz1so239369pad.10 for <16381@debbugs.gnu.org>; Tue, 24 Jun 2014 06:05:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:face:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=LcSh8ZMFkX7Pp4D0HJMjeSMFkeDl467P6gc6LXv6Qnk=; b=zi+ZZFEPPu9ahB5pV12zgOewd/Aq0XVEye/IDiaonlEhRKhAP06UYr5oIV/KwjdIi2 8BnusCTOq1gSLCTHsw+YxSIbThkmuSXGwTI5fI6vcmc+zfdF8vLRrZp3P4g5Suq26EnI esQki7ABNDOU2FmKkzPyIBhNVo/bDuCl9NisAHAJEC17MyS0BbF6KqAZ+La9PUOA7oUn zYpVyvHC6NgpSPipiOPzNBTPtkQ+HmnI4zgg9x6G20gQhltvZjjVjkNYFvlJ39FnIfK+ YcsA2+gmd/QtrCaOZ6Kk8KBFikVF3uDJfiF4E8tATAxggA5d1vKTT6eWkKva0vhwNsX/ C6Cg== X-Received: by 10.68.173.65 with SMTP id bi1mr1337227pbc.130.1403615114998; Tue, 24 Jun 2014 06:05:14 -0700 (PDT) Original-Received: from fortuna ([221.222.158.228]) by mx.google.com with ESMTPSA id fl6sm1088179pab.43.2014.06.24.06.05.13 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Tue, 24 Jun 2014 06:05:14 -0700 (PDT) Face: iVBORw0KGgoAAAANSUhEUgAAACkAAAApAQAAAACAGz1bAAABKElEQVQYlWNg3NIt5FDPUPt7 4+X79Qyucz5/ugik+L2PBgKpyphaIK921q23QDnG0NBQoMr/vaWl9f8ZLL78uPv5PwN7RETfzXoG jhmFz27XM0RXmpuY/WfY+fv0Mc56BvFybfXA/wwL5t/wF61n2PU59axXPcOVzbmSW/8zrNt1benC /ww70hqUU/4zKCtrT9jwn8FhwynbufUMendE2aLqGRpdX9al1zM8eh17lKeeQcTMrdD5P8P3j/YT Q/8zXHSb7p1Qz/C4OM2JuZ7hgtI7K6AjqsMnf8j4z8C6xG1tw3+GqpqvsVn/GTzmpD9j/8/wP/oZ S/l/Bka+QO/g/wy15ueeFQL9N1O8mPU/g+umV3t1gdT0/1bTgHLqYVeXAlWKpMWt+w8Az82C9nHf X0cAAAAASUVORK5CYII= In-Reply-To: (Glenn Morris's message of "Tue, 24 Jun 2014 01:54:15 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (CentOS 6.5) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:90729 Archived-At: On 2014-06-24 01:54 -0400, Glenn Morris wrote: > Leo, any chance you could fix that one too? > > There are a handful of other files that use tab-stop-list; > it would be good to check them too. I did a grep in lisp/ and these are the files using tab-stop-list: - woman.el - progmodes/asm-mode.el - ruler-mode.el - textmodes/picture.el The following patch seems to fix all except woman.el. woman.el seems to use its own interpretation of tab-stop-list i.e. it may not be affected at all by the change to tab-stop-list. Comments? Leo === modified file 'lisp/indent.el' --- lisp/indent.el 2014-06-23 23:09:20 +0000 +++ lisp/indent.el 2014-06-24 12:22:40 +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' --- lisp/progmodes/asm-mode.el 2014-02-10 01:34:22 +0000 +++ lisp/progmodes/asm-mode.el 2014-06-24 12:53:03 +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' --- lisp/ruler-mode.el 2014-06-16 06:37:37 +0000 +++ lisp/ruler-mode.el 2014-06-24 12:58:16 +0000 @@ -476,8 +476,11 @@ (not (member ts tab-stop-list)) (progn (message "Tab stop set to %d" ts) - (setq tab-stop-list (sort (cons ts tab-stop-list) - #'<))))))))) + ;; If `tab-stop-list' is empty, populate it with tab + ;; stops before TS. + (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. @@ -753,7 +756,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' --- lisp/textmodes/picture.el 2014-02-10 01:34:22 +0000 +++ lisp/textmodes/picture.el 2014-06-24 12:45:46 +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)))