unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: emacs-devel@gnu.org
Subject: Re: files.el
Date: Thu, 18 Mar 2004 07:30:48 -0600 (CST)	[thread overview]
Message-ID: <200403181330.i2IDUm704853@raven.dms.auburn.edu> (raw)
In-Reply-To: <200403180432.i2I4W7204170@raven.dms.auburn.edu> (message from Luc Teirlinck on Wed, 17 Mar 2004 22:32:07 -0600 (CST))

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)))
============================================================

  reply	other threads:[~2004-03-18 13:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-18  4:32 files.el Luc Teirlinck
2004-03-18 13:30 ` Luc Teirlinck [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-05-14  2:07 files.el Luc Teirlinck

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=200403181330.i2IDUm704853@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    --cc=emacs-devel@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).