all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tino Calancha <tino.calancha@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 27762@debbugs.gnu.org
Subject: bug#27762: 26.0.50; ls-lisp: misalignment when dired-directory is a cons
Date: Thu, 20 Jul 2017 12:45:22 +0900	[thread overview]
Message-ID: <87lgnjzs8d.fsf@calancha-pc> (raw)
In-Reply-To: <83vamobboe.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 19 Jul 2017 20:04:33 +0300")

Eli Zaretskii <eliz@gnu.org> 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.





  reply	other threads:[~2017-07-20  3:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-19  3:21 bug#27762: 26.0.50; ls-lisp: misalignment when dired-directory is a cons Tino Calancha
2017-07-19 17:04 ` Eli Zaretskii
2017-07-20  3:45   ` Tino Calancha [this message]
2017-07-21  4:55     ` Tino Calancha
2017-07-29  8:09       ` Eli Zaretskii
2017-08-01  7:01         ` Tino Calancha
2017-08-01 13:46           ` Eli Zaretskii
2017-08-01 15:08             ` Tino Calancha
2017-08-01 15:43               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lgnjzs8d.fsf@calancha-pc \
    --to=tino.calancha@gmail.com \
    --cc=27762@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.