emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ls-lisp patch


From: Markus Rost
Subject: ls-lisp patch
Date: Tue, 14 Jan 2003 17:42:08 -0500 (EST)

The problem appears on unix-like systems, but I guess the issue should
be considered by the maintainers of Emacs for the systems macos,
ms-dos, windows-nt.

If you load ls-lisp.el for some reason, for instance with

M-x customize-group ls-lisp

then the function insert-directory gets redefined.  That can be
unfortunate.  It is for me, as the ls-lisp emulation of ls works for
me less well than ls itself.  I suggest to avoid an essential
redefinition of insert-directory as with the following patch.  Loading
the file would then turn the emulation on only if

(memq system-type '(macos ms-dos windows-nt))

is non-nil.  Certainly one should check things for systems of type
macos, ms-dos, windows-nt; in those cases ls-lisp is preloaded by
loadup.el.  I can't do this.

The patch also autoloads ls-lisp-support-shell-wildcards, since it is
let-bound in recover-session.  Because of this I think it is safer to
add an autoload cookie.  It was autoloaded sometime ago.  I don't know
why the autoload cookie was removed; it looks as if it just went lost
during some changes.


        * ls-lisp.el (ls-lisp-mode): New global minor mode.
        (insert-directory): Use it.
        (ls-lisp-use-insert-directory-program): Variable removed.
        (ls-lisp-support-shell-wildcards): Autoload it.


*** ls-lisp.el.~1.47~   Sat Dec 21 15:20:47 2002
--- ls-lisp.el  Thu Jan  9 15:10:29 2003
***************
*** 129,142 ****
              (const :tag "Show Group" gid))
    :group 'ls-lisp)
  
! (defcustom ls-lisp-use-insert-directory-program nil
!   "*Non-nil causes ls-lisp to revert back to using `insert-directory-program'.
! This is useful on platforms where ls-lisp is dumped into Emacs, such as
! Microsoft Windows, but you would still like to use a program to list
! the contents of a directory."
!   :type 'boolean
    :group 'ls-lisp)
  
  (defcustom ls-lisp-support-shell-wildcards t
    "*Non-nil means ls-lisp treats file patterns as shell wildcards.
  Otherwise they are treated as Emacs regexps (for backward compatibility)."
--- 129,142 ----
              (const :tag "Show Group" gid))
    :group 'ls-lisp)
  
! (define-minor-mode ls-lisp-mode
!   "Toggle emulation of the ls program in Emacs Lisp.
! See the documentation of `insert-directory'."
!   (memq system-type '(macos ms-dos windows-nt))
!   :global t
    :group 'ls-lisp)
  
+ ;;;###autoload
  (defcustom ls-lisp-support-shell-wildcards t
    "*Non-nil means ls-lisp treats file patterns as shell wildcards.
  Otherwise they are treated as Emacs regexps (for backward compatibility)."
***************
*** 189,208 ****
  switches do not contain `d', so that a full listing is expected.
  
  This version of the function comes from `ls-lisp.el'.
! If the value of `ls-lisp-use-insert-directory-program' is non-nil then
  it works exactly like the version from `files.el' and runs a directory
  listing program whose name is in the variable
  `insert-directory-program'; if also WILDCARD is non-nil then it runs
! the shell specified by `shell-file-name'.  If the value of
! `ls-lisp-use-insert-directory-program' is nil then it runs a Lisp
! emulation.
  
  The Lisp emulation does not run any external programs or shells.  It
  supports ordinary shell wildcards if `ls-lisp-support-shell-wildcards'
  is non-nil; otherwise, it interprets wildcards as regular expressions
  to match file names.  It does not support all `ls' switches -- those
  that work are: A a c i r S s t u U X g G B C R and F partly."
!   (if ls-lisp-use-insert-directory-program
        (funcall original-insert-directory
               file switches wildcard full-directory-p)
      ;; We need the directory in order to find the right handler.
--- 189,207 ----
  switches do not contain `d', so that a full listing is expected.
  
  This version of the function comes from `ls-lisp.el'.
! If the minor mode `ls-lisp-mode' is off then
  it works exactly like the version from `files.el' and runs a directory
  listing program whose name is in the variable
  `insert-directory-program'; if also WILDCARD is non-nil then it runs
! the shell specified by `shell-file-name'.  If the minor mode
! `ls-lisp-mode' is on, then it runs a Lisp emulation.
  
  The Lisp emulation does not run any external programs or shells.  It
  supports ordinary shell wildcards if `ls-lisp-support-shell-wildcards'
  is non-nil; otherwise, it interprets wildcards as regular expressions
  to match file names.  It does not support all `ls' switches -- those
  that work are: A a c i r S s t u U X g G B C R and F partly."
!   (if (not ls-lisp-mode)
        (funcall original-insert-directory
               file switches wildcard full-directory-p)
      ;; We need the directory in order to find the right handler.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]