From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: files.el Date: Thu, 18 Mar 2004 07:30:48 -0600 (CST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200403181330.i2IDUm704853@raven.dms.auburn.edu> References: <200403180432.i2I4W7204170@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1079620128 20555 80.91.224.253 (18 Mar 2004 14:28:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 18 Mar 2004 14:28:48 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Mar 18 15:28:39 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1B3yVj-0007HU-00 for ; Thu, 18 Mar 2004 15:28:39 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1B3yVj-0008CE-00 for ; Thu, 18 Mar 2004 15:28:39 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B3yUw-0006dx-E4 for emacs-devel@quimby.gnus.org; Thu, 18 Mar 2004 09:27:50 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B3yUJ-0006Zs-32 for emacs-devel@gnu.org; Thu, 18 Mar 2004 09:27:11 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B3xwc-0000y7-Al for emacs-devel@gnu.org; Thu, 18 Mar 2004 08:52:53 -0500 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B3xdZ-0005KJ-Ad for emacs-devel@gnu.org; Thu, 18 Mar 2004 08:32:41 -0500 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id i2IDWOKt011451; Thu, 18 Mar 2004 07:32:24 -0600 (CST) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.6+Sun/8.11.6) id i2IDUm704853; Thu, 18 Mar 2004 07:30:48 -0600 (CST) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: teirllm@dms.auburn.edu In-reply-to: <200403180432.i2I4W7204170@raven.dms.auburn.edu> (message from Luc Teirlinck on Wed, 17 Mar 2004 22:32:07 -0600 (CST)) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:20579 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:20579 The dolist loop in my previous patch was silly. I originally had another condition than string=, for which the dolist was necessary. When I replaced it with string=, I failed to notice that after that, the dolist became essentially equivalent to member. Revised patch: ===File ~/files.el-diff===================================== *** files.el.~1.680.~ Thu Mar 4 15:36:49 2004 --- files.el Thu Mar 18 07:18:56 2004 *************** *** 4205,4218 **** (defun insert-directory (file switches &optional wildcard full-directory-p) "Insert directory listing for FILE, formatted according to SWITCHES. Leaves point after the inserted text. ! SWITCHES may be a string of options, or a list of strings. Optional third arg WILDCARD means treat FILE as shell wildcard. Optional fourth arg FULL-DIRECTORY-P means file is a directory and switches do not contain `d', so that a full listing is expected. This works by running a directory listing program whose name is in the variable `insert-directory-program'. ! If WILDCARD, it also runs the shell specified by `shell-file-name'." ;; We need the directory in order to find the right handler. (let ((handler (find-file-name-handler (expand-file-name file) 'insert-directory))) --- 4205,4224 ---- (defun insert-directory (file switches &optional wildcard full-directory-p) "Insert directory listing for FILE, formatted according to SWITCHES. Leaves point after the inserted text. ! SWITCHES may be a string of options, or a list of strings ! representing individual options. Optional third arg WILDCARD means treat FILE as shell wildcard. Optional fourth arg FULL-DIRECTORY-P means file is a directory and switches do not contain `d', so that a full listing is expected. This works by running a directory listing program whose name is in the variable `insert-directory-program'. ! If WILDCARD, it also runs the shell specified by `shell-file-name'. ! ! When SWITCHES contains the long `--dired' option,this function ! treats it specially, for the sake of dired. However, the ! normally equivalent short `-D' option is just passed on to ! `insert-directory-program', as any other option." ;; We need the directory in order to find the right handler. (let ((handler (find-file-name-handler (expand-file-name file) 'insert-directory))) *************** *** 4225,4231 **** ;; Read the actual directory using `insert-directory-program'. ;; RESULT gets the status code. ! (let* (;; We at first read by no-conversion, then after ;; putting text property `dired-filename, decode one ;; bunch by one to preserve that property. (coding-system-for-read 'no-conversion) --- 4231,4237 ---- ;; Read the actual directory using `insert-directory-program'. ;; RESULT gets the status code. ! (let* ( ;; We at first read by no-conversion, then after ;; putting text property `dired-filename, decode one ;; bunch by one to preserve that property. (coding-system-for-read 'no-conversion) *************** *** 4301,4307 **** (access-file file "Reading directory") (error "Listing directory failed but `access-file' worked"))) ! (when (string-match "--dired\\>" switches) (forward-line -2) (when (looking-at "//SUBDIRED//") (delete-region (point) (progn (forward-line 1) (point))) --- 4307,4315 ---- (access-file file "Reading directory") (error "Listing directory failed but `access-file' worked"))) ! (when (if (stringp switches) ! (string-match "--dired\\>" switches) ! (member "--dired" switches)) (forward-line -2) (when (looking-at "//SUBDIRED//") (delete-region (point) (progn (forward-line 1) (point))) ============================================================