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: Mon, 23 Jun 2014 22:24:34 +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 1403533528 19245 80.91.229.3 (23 Jun 2014 14:25:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Jun 2014 14:25:28 +0000 (UTC) Cc: 16381@debbugs.gnu.org To: djcb@djcbsoftware.nl Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 23 16:25:21 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 1Wz5BQ-0007ZJ-8z for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Jun 2014 16:25:20 +0200 Original-Received: from localhost ([::1]:53863 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz5BP-00069J-OO for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Jun 2014 10:25:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz5BF-000669-W0 for bug-gnu-emacs@gnu.org; Mon, 23 Jun 2014 10:25:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wz5B9-0001Vf-G8 for bug-gnu-emacs@gnu.org; Mon, 23 Jun 2014 10:25:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38933) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz5B9-0001Un-CZ for bug-gnu-emacs@gnu.org; Mon, 23 Jun 2014 10:25:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Wz5B8-0007f5-IG for bug-gnu-emacs@gnu.org; Mon, 23 Jun 2014 10:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Leo Liu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Jun 2014 14:25:02 +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.140353348829421 (code B ref 16381); Mon, 23 Jun 2014 14:25:02 +0000 Original-Received: (at 16381) by debbugs.gnu.org; 23 Jun 2014 14:24:48 +0000 Original-Received: from localhost ([127.0.0.1]:58316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wz5Au-0007eT-1W for submit@debbugs.gnu.org; Mon, 23 Jun 2014 10:24:48 -0400 Original-Received: from mail-pa0-f54.google.com ([209.85.220.54]:46183) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wz5Ar-0007e9-Ev for 16381@debbugs.gnu.org; Mon, 23 Jun 2014 10:24:46 -0400 Original-Received: by mail-pa0-f54.google.com with SMTP id et14so5960679pad.27 for <16381@debbugs.gnu.org>; Mon, 23 Jun 2014 07:24:39 -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=Ogd6GVLD98TJ/fzbHce7oy5woerayPE6O2FyoevGfoc=; b=A1aXLqU8o6GFnXRa8kE04DfBduFwxSinuTbdBhTThU/kBlT88qixuUzksb3WN4mLjL tlCFLW8TtHoJVzgRNFzwQIjq8ZB2toKq3w/NrXHHxVP+1snr9TfVVAzr/4ju6/YcPygv 0j/tTrnibOJ6ydd16DWpPBtZ2HkDgUsWBvwn/IfSB6CwvOQCDSEyJPJUrfutALMcie4F EcUleqXAPEwKYbVLP6YBa0cbgn7A4myh3BHbI45Es0xwt3aydeLRxwSy7KSQXAv1r6GE xd44nRcw15Wo3E+744k9D+p2+igO3CCgWDewPvXZRoMZzSHfI/Wq8hJElAGjD/jii1+Q HMWg== X-Received: by 10.68.227.4 with SMTP id rw4mr29437354pbc.3.1403533478976; Mon, 23 Jun 2014 07:24:38 -0700 (PDT) Original-Received: from fortuna ([221.222.158.228]) by mx.google.com with ESMTPSA id ja8sm27218509pbd.3.2014.06.23.07.24.36 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 23 Jun 2014 07:24:38 -0700 (PDT) Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoAgMAAADxkFD+AAAADFBMVEUvT09qWs3/pQD///+J kUVcAAAAAWJLR0QAiAUdSAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9cBBwMLOd3veKQA AACuSURBVBjTldE9CgIxEAXgB+lEyFUC2wo5ikdZ8DSypxhMY7H9VuIVwlqkGRgnm59VsHGafIQ3 CZlAtmKIRaHETgYa12lqvEsPYKf8wXHsPGfqPaUM0g9aJPKFXkmNQmSDqwzz4Fpgpz+6WAPY2z5o uPJJpu0uypcl4nyCibMLQ8lCiVjayLoQvw5LsVKQuHPRR958HZbOcVsKeepcLxpByjycGvnKmY+c MBvrtyjfe0vmuLvdq/kAAAAASUVORK5CYII= In-Reply-To: <87ha9gvzdq.fsf@borealis.i-did-not-set--mail-host-address--so-tickle-me> (djcb@djcbsoftware.nl's message of "Tue, 07 Jan 2014 12:51:13 +0200") 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:90689 Archived-At: On 2014-01-07 12:51 +0200, djcb@djcbsoftware.nl wrote: > int foo (int bar) > { > char flub; > > } > > now mark the 'char flub' line, M-x align and we get: > > int foo (int bar) > { > charflub; > > } This is broken by defaulting tab-stop-list to nil in revno: 114577. Stefan, can I fix it as follows in emacs-24? Thanks, Leo. === modified file 'lisp/align.el' --- lisp/align.el 2014-03-24 16:54:24 +0000 +++ lisp/align.el 2014-06-23 14:22:10 +0000 @@ -1130,13 +1130,8 @@ column (if (not tab-stop) (+ column spacing) - (let ((stops tab-stop-list)) - (while stops - (if (and (> (car stops) column) - (= (setq spacing (1- spacing)) 0)) - (setq column (car stops) - stops nil) - (setq stops (cdr stops))))) + (dotimes (_ spacing) + (setq column (indent-next-tab-stop column))) column))) (defsubst align-column (pos) === modified file 'lisp/indent.el' --- lisp/indent.el 2014-02-10 01:34:22 +0000 +++ lisp/indent.el 2014-06-23 12:43:33 +0000 @@ -249,7 +249,7 @@ (indent-rigidly--pop-undo) (let* ((current (indent-rigidly--current-indentation beg end)) (rtl (eq (current-bidi-paragraph-direction) 'right-to-left)) - (next (indent--next-tab-stop current (if rtl nil 'prev)))) + (next (indent-next-tab-stop current (if rtl nil 'prev)))) (indent-rigidly beg end (- next current)))) (defun indent-rigidly-right-to-tab-stop (beg end) @@ -258,7 +258,7 @@ (indent-rigidly--pop-undo) (let* ((current (indent-rigidly--current-indentation beg end)) (rtl (eq (current-bidi-paragraph-direction) 'right-to-left)) - (next (indent--next-tab-stop current (if rtl 'prev)))) + (next (indent-next-tab-stop current (if rtl 'prev)))) (indent-rigidly beg end (- next current)))) (defun indent-line-to (column) @@ -654,7 +654,7 @@ (setq tab-stop-list tabs)) (message "Tab stops installed")) -(defun indent--next-tab-stop (column &optional prev) +(defun indent-next-tab-stop (column &optional prev) "Return the next tab stop after COLUMN. If PREV is non-nil, return the previous one instead." (let ((tabs tab-stop-list)) @@ -684,7 +684,7 @@ (interactive) (and abbrev-mode (= (char-syntax (preceding-char)) ?w) (expand-abbrev)) - (let ((nexttab (indent--next-tab-stop (current-column)))) + (let ((nexttab (indent-next-tab-stop (current-column)))) (delete-horizontal-space t) (indent-to nexttab))) @@ -693,7 +693,7 @@ The variable `tab-stop-list' is a list of columns at which there are tab stops. Use \\[edit-tab-stops] to edit them interactively." (interactive) - (let ((nexttab (indent--next-tab-stop (current-column)))) + (let ((nexttab (indent-next-tab-stop (current-column)))) (let ((before (point))) (move-to-column nexttab t) (save-excursion