From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alexander Klimov Newsgroups: gmane.emacs.devel Subject: patch for long options in dired-listing-switches Date: Tue, 31 May 2011 11:07:20 +0300 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: dough.gmane.org 1306829268 3229 80.91.229.12 (31 May 2011 08:07:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 31 May 2011 08:07:48 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 31 10:07:44 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QRJzL-00038v-G9 for ged-emacs-devel@m.gmane.org; Tue, 31 May 2011 10:07:43 +0200 Original-Received: from localhost ([::1]:41627 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRJzK-0001wQ-VZ for ged-emacs-devel@m.gmane.org; Tue, 31 May 2011 04:07:42 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:46966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRJzI-0001wG-AJ for emacs-devel@gnu.org; Tue, 31 May 2011 04:07:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QRJzH-00034y-4w for emacs-devel@gnu.org; Tue, 31 May 2011 04:07:40 -0400 Original-Received: from www.eitan.edu ([199.203.54.24]:47551 helo=eitan.edu) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1QRJzG-00034P-Mq for emacs-devel@gnu.org; Tue, 31 May 2011 04:07:39 -0400 Original-Received: (qmail 4832 invoked from network); 31 May 2011 08:07:20 -0000 Original-Received: from unknown (HELO localhost) (127.0.0.1) by localhost with SMTP; 31 May 2011 08:07:20 -0000 X-detected-operating-system: by eggs.gnu.org: Solaris 9 X-Received-From: 199.203.54.24 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:139941 Archived-At: Originally dired-listing-switches was supposed to be (etc/NEWS.1-17) a string containing `-' followed by letters, but now (doc/emacs/dired.texi) No matter how they are specified, the @code{ls} switches can include short options (that is, single characters) requiring no arguments, and long options (starting with @samp{--}) whose arguments are specified with @samp{=}. As a result, the code that assume the former definition is broken once the user implements the latter. One example, is recover-session: if the value of dired-listing-switches ends with "--time-style=long-iso", then recover-session tries to add "t" to it and fails since ls does not like "--time-style=long-isot". The simplest solution is to concat with " -t" instead. The following patch solves the most obvious cases in lisp/files.el and lisp/mail/sendmail.el, but in lisp/net/ange-ftp.el (string-match "[aA]" dired-listing-switches) is also a bug for long options that contain `a'. === modified file 'lisp/files.el' --- lisp/files.el 2011-05-28 19:26:25 +0000 +++ lisp/files.el 2011-05-31 08:02:07 +0000 @@ -5256,7 +5256,7 @@ (save-excursion (let ((switches dired-listing-switches)) (if (file-symlink-p file) - (setq switches (concat switches "L"))) + (setq switches (concat switches " -L"))) (set-buffer standard-output) ;; Use insert-directory-safely, not insert-directory, ;; because these files might not exist. In particular, @@ -5299,7 +5299,7 @@ (error "No previous sessions to recover"))) (let ((ls-lisp-support-shell-wildcards t)) (dired (concat auto-save-list-file-prefix "*") - (concat dired-listing-switches "t"))) + (concat dired-listing-switches " -t"))) (save-excursion (goto-char (point-min)) (or (looking-at " Move to the session you want to recover,") === modified file 'lisp/mail/sendmail.el' --- lisp/mail/sendmail.el 2011-05-27 07:18:15 +0000 +++ lisp/mail/sendmail.el 2011-05-31 08:02:06 +0000 @@ -1800,7 +1800,7 @@ ;; unbound on exit from the let. (require 'dired) (let ((dired-trivial-filenames t)) - (dired-other-window wildcard (concat dired-listing-switches "t"))) + (dired-other-window wildcard (concat dired-listing-switches " -t"))) (rename-buffer "*Auto-saved Drafts*" t) (save-excursion (goto-char (point-min)) @@ -1880,7 +1880,7 @@ ;; `ls' is not a standard program (it will use ;; ls-lisp instead). (dired-noselect file-name - (concat dired-listing-switches "t")))) + (concat dired-listing-switches " -t")))) (save-selected-window (select-window (display-buffer dispbuf t)) (goto-char (point-min)) -- Regards, ASK