From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#27762: 26.0.50; ls-lisp: misalignment when dired-directory is a cons Date: Tue, 01 Aug 2017 16:01:17 +0900 Message-ID: <87a83jkc02.fsf@calancha-pc> References: <87wp75yuuh.fsf@calancha-pc> <83vamobboe.fsf@gnu.org> <87lgnjzs8d.fsf@calancha-pc> <87d18uz8w1.fsf@calancha-pc> <83shhf3brw.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1501570955 7750 195.159.176.226 (1 Aug 2017 07:02:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 1 Aug 2017 07:02:35 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 27762@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 01 09:02:21 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dcRC4-00013g-Hh for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Aug 2017 09:02:16 +0200 Original-Received: from localhost ([::1]:34798 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcRCA-0000Bg-Cs for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Aug 2017 03:02:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcRC0-0000BP-9W for bug-gnu-emacs@gnu.org; Tue, 01 Aug 2017 03:02:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcRBq-00080p-Vn for bug-gnu-emacs@gnu.org; Tue, 01 Aug 2017 03:02:12 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33342) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dcRBq-00080h-S7 for bug-gnu-emacs@gnu.org; Tue, 01 Aug 2017 03:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dcRBq-00034y-9R for bug-gnu-emacs@gnu.org; Tue, 01 Aug 2017 03:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Aug 2017 07:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27762 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27762-submit@debbugs.gnu.org id=B27762.150157088911796 (code B ref 27762); Tue, 01 Aug 2017 07:02:02 +0000 Original-Received: (at 27762) by debbugs.gnu.org; 1 Aug 2017 07:01:29 +0000 Original-Received: from localhost ([127.0.0.1]:36019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dcRBJ-00034B-9F for submit@debbugs.gnu.org; Tue, 01 Aug 2017 03:01:29 -0400 Original-Received: from mail-pf0-f177.google.com ([209.85.192.177]:34048) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dcRBI-000340-At for 27762@debbugs.gnu.org; Tue, 01 Aug 2017 03:01:28 -0400 Original-Received: by mail-pf0-f177.google.com with SMTP id o86so846944pfj.1 for <27762@debbugs.gnu.org>; Tue, 01 Aug 2017 00:01:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=T5vn3Onqdb0SAoQgz8Fk1QMZrL9CuuIsK1lgwNj6jfk=; b=AkORiwjA35P8tI3YqmWQ7pmCuyovLjSR5hpu1cRQcvKRB0sSRVkOGK84zAQpPBbdyr evTrJF5KChshWIi+kAXF1GRZdfe34yFT2isNmbhQr4OY6zr5VsXHKzaskPfREedSwGxW rzmRVZMQdVTsxRNUTvLmwd8WSaheoBbRLGhClfgJVx8YUzv8sMjK9+llWVGgS8NUniez g/3S+4tg602kSJ5M/eScQjN5o/u6GQgbcDBQPh4hVtsrUm62W0Hq4/8NQihRhLDp3JqN 8YdaxneRkUpt4mIf/LiRcPqIK0GU/Pq+suWi5Pckfw4EGrfoWGcYhlHNOZc/+gYdeGfa uVbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=T5vn3Onqdb0SAoQgz8Fk1QMZrL9CuuIsK1lgwNj6jfk=; b=dzdJiS/+8BTACMWaBtd7sw4jGHc3bDd7KcaReL0Gto+XUZN9UHT2IiQCpirtFoCGwa AQtuuv7UPt3W7vPEYLz7+9l46EQEA2pGy9lnN8o5sZIUWJ7yncw0cf33zPrh4KOmnS2B V87qyRgElC8h+MBz1IHzbANiiDQoRefHafZ2d/GEBME16WL0Cl1Kc83EhDoQq3Gbaktp TmS66WEQ9pmaLw0TcMNMY4xKdyjIuLeS01zPQI6dvlBJ0yNNTiBUolcPH45ZMZIEutQJ spDbI95H4Xgtp/oUiSJ1rLP+n4T6ej4HzUtY5V3+CO0G6JdUC7118MDLKJ5yqsWMs3q/ wxbQ== X-Gm-Message-State: AIVw113aNF7970FIOqmuxgtQnBdKZ/7ebcSJUQpggEIwgZZ/MrsXhfHE bAOK/Ty9qUTkeIBK X-Received: by 10.98.138.204 with SMTP id o73mr18354488pfk.5.1501570882133; Tue, 01 Aug 2017 00:01:22 -0700 (PDT) Original-Received: from calancha-pc (170.224.128.101.dy.bbexcite.jp. [101.128.224.170]) by smtp.gmail.com with ESMTPSA id 4sm45340298pfe.88.2017.08.01.00.01.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 01 Aug 2017 00:01:21 -0700 (PDT) In-Reply-To: <83shhf3brw.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 29 Jul 2017 11:09:07 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:135206 Archived-At: Eli Zaretskii writes: > Looks OK, but why this complicated code: > >> + (when-let* ((col-diff (- (point) (point-at-bol))) >> + (higher (> col-diff target))) >> + (setq target col-diff))) >> + (and (/= first target) target)))) > > Doesn't current-column do its job in this case? That is to work regardless on the `dired-hide-details-mode' value. If we use `current-column' we are in trouble. Consider the following: ;; Definition uses `current-column'. (defun dired--need-align-p () "Return non-nil if some file names are misaligned. The return value is the target column for the file names." (save-excursion (goto-char (point-min)) (dired-goto-next-file) ;; Use point difference instead of `current-column', because ;; the former works when `dired-hide-details-mode' is enabled. (let* ((first (current-column)) (target first)) (while (and (not (eobp)) (progn (forward-line) (dired-move-to-filename))) (when (> (current-column) target) (setq target (current-column)))) (and (/= first target) target)))) ;; Eval following form: (let* ((dir (expand-file-name "src" source-directory)) (default-directory dir)) (dired (list dir "alloc.c" "w32xfns.c" "xdisp.c")) ; Wrong aligment. ;; Following just fix the first file, but xdisp.c keeps misaligned. (dired-goto-file (expand-file-name "cygw32.c")) (forward-line 0) (let ((inhibit-read-only t)) (dired-align-file (point) (point-max)))) M-: (dired--need-align-p) RET => t ( ; toggle dired-hide-details-mode M-: (dired--need-align-p) RET => nil ( ; Toggle again: the files still are misaligned.