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: Thu, 20 Jul 2017 12:45:22 +0900 Message-ID: <87lgnjzs8d.fsf@calancha-pc> References: <87wp75yuuh.fsf@calancha-pc> <83vamobboe.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1500522389 9523 195.159.176.226 (20 Jul 2017 03:46:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 20 Jul 2017 03:46:29 +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 Thu Jul 20 05:46:18 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 1dY2Pg-0001Lq-6O for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Jul 2017 05:46:08 +0200 Original-Received: from localhost ([::1]:35956 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dY2Pl-0005uz-D6 for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Jul 2017 23:46:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dY2Pf-0005ud-K2 for bug-gnu-emacs@gnu.org; Wed, 19 Jul 2017 23:46:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dY2Pb-0000R1-Gq for bug-gnu-emacs@gnu.org; Wed, 19 Jul 2017 23:46:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45718) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dY2Pb-0000QW-Cp for bug-gnu-emacs@gnu.org; Wed, 19 Jul 2017 23:46:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dY2Pa-0000uF-BL for bug-gnu-emacs@gnu.org; Wed, 19 Jul 2017 23:46: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: Thu, 20 Jul 2017 03:46: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.15005223353447 (code B ref 27762); Thu, 20 Jul 2017 03:46:02 +0000 Original-Received: (at 27762) by debbugs.gnu.org; 20 Jul 2017 03:45:35 +0000 Original-Received: from localhost ([127.0.0.1]:48395 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dY2P9-0000tW-6H for submit@debbugs.gnu.org; Wed, 19 Jul 2017 23:45:35 -0400 Original-Received: from mail-pf0-f179.google.com ([209.85.192.179]:36640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dY2P7-0000tJ-7r for 27762@debbugs.gnu.org; Wed, 19 Jul 2017 23:45:33 -0400 Original-Received: by mail-pf0-f179.google.com with SMTP id o88so7274840pfk.3 for <27762@debbugs.gnu.org>; Wed, 19 Jul 2017 20:45:33 -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=haryvu8tTCthIh8ZI8ZS1KPM6IKU6iiGOYuxmX4whCY=; b=mU7O5TnqnODkHlEXqvBIHsYYo2uoCynX4XksQS9tAzOubFjTKurb30m73qJeHfJOu8 BDW8od9OzeKDaeR3KuddVWBvtre+OuDTfA2d7xsVx0XsAqgHV5EBN0TP18MCMg8bKlgH g0xFGqkGj1UULKX9t6YFetjtMUNXmdLg8VmcretUweFXn9O0cdZMp7nQs5yoDguLa7vb I7//LCcvPR1RzQwLP/Sr+OVxgrYDatmYeEB2p4pU9ShVC8kHEdceqMStaBupte3WloF6 FRYJ2+k4p1veyJl79VNPC7Wy3l7jiMXFdHJ5eCnkcAIis08MqhCIRaOtxXSWAtLN+XQd SClA== 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=haryvu8tTCthIh8ZI8ZS1KPM6IKU6iiGOYuxmX4whCY=; b=GHVLfMcK1ffiuXDnk/PosyexUKcGAx0BZZHfO/9jB8Xkce/dwO7R+4V4koqzJ0gUiX 9Sg3x9yrDjLz4nw7A+sioOpmjo4jxoGAdbGLumAchp+jnys+8J4nI5jP7auAdhzBmLx6 KPP9pQ94ysh4/1OkQ8WHJNdmT2ZfLSCaKkPJwlnIiL0R3BV87o6RQY83kzcm5aAt9sgL yQZ4t+0J2QkOthJDCi/F2o9rsRdRECEFoWOfK0gGy6vMtBhZMMARTz5NiRTjqSwDp4Sc jY1NSrXocz+fmEsYz9qmieYpJP2JvqRK3mP0e1vX/2i3QBxhzb2o72HLp7Bc3l/A+Br9 MhbA== X-Gm-Message-State: AIVw112HcLgI46TpIGq/PQ+oHGmaDgZ+htqbrs1xNTKflMvmbjKpy0+c QucoHXAkd1oDXS4K X-Received: by 10.84.233.207 with SMTP id m15mr2520853pln.334.1500522327115; Wed, 19 Jul 2017 20:45:27 -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 t186sm2021740pgc.28.2017.07.19.20.45.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jul 2017 20:45:26 -0700 (PDT) In-Reply-To: <83vamobboe.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 19 Jul 2017 20:04:33 +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:134776 Archived-At: Eli Zaretskii writes: >> II) Now suppose we want to list the same files _but_ we want that >> "cyge32.c" appears the first. >> emacs -Q -l ls-lisp -eval '(setq ls-lisp-use-insert-directory-program nil)' >> Eval this form: >> >> (let* ((dir source-directory) >> (default-directory dir) >> (files (mapcar (lambda (f) (concat "src/" f)) >> (cons "cygw32.c" >> (delete "cygw32.c" >> (directory-files (expand-file-name "src") nil "\\.*\\.c\\'")))))) >> (dired (nconc (list dir) files))) >> ;; Note how the first file looks misaligned. > > Thanks, but I'd prefer to keep the ls-lisp related stuff confined to > ls-lisp.el. Is it possible to rewrite the patch such that dired.el > code doesn't need to call ls-lisp functions directly (and thus the > need for (featurep 'ls-lisp) etc. would be avoided)? Thanks. Yes, that sounds better. > Also, what exactly is the source of the differences between ls-lisp > and the 'ls' command, and are you sure the differences aren't specific > to GNU 'ls'? I think II) above is not specific of ls-lisp: the same happen with GNU ls. With emacs -Q: (let* ((dir (expand-file-name "src" source-directory)) (default-directory dir)) (dired (list dir "cygw32.c" "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)))) Note that when i eval the previous form GNU 'ls' is used, and i see misalignment. I would expect `dired-align-file' fix this problem, but i doesn't. *) Since this is not specific of `ls-lisp', one alternative fix could be to run `dired-align-file' at the end of `dired-internal-noselect' when `dired-directory' is a cons. **) First, we must fix `dired-lign-file', which is not doing its job in the snippet above.