Re: woman doesn't work if current buffer's directory doesn't exist

2007-01-26 Thread Richard Stallman
I guess all I mean is that we need to fix Tramp (and other file
handlers) as well as jka-compr, because this also causes an error:

We need to fix all the file handlers that use call-process, I agree.
Fortunately there are not too many.

I agree it would be easier if we could fix this in call-process.  That
was the first direction I looked in.  However, someone pointed out why
changing the home directory magically in call-process just isn't
acceptable: because it would change the meaning of relative file name
arguments.  Fixing the callers is our only option.

Therefore, I ask people to start actually doing this.


Michael, could you fix Tramp and ange-ftp?


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: woman doesn't work if current buffer's directory doesn't exist

2007-01-26 Thread Juanma Barranquero

On 1/26/07, Richard Stallman [EMAIL PROTECTED] wrote:


Let's not go around in circles.  We've already seen why this can't be
fixed in a natural way.


Yes, sorry. I missed the start of the thread.

BTW, I think the comments in jka-compr.el and some doctrings
(notoriously those of `jka-compr-shell' and
`ja-compr-compression-info-list') do lie about the use of a shell and
the following patch should be applied.

   /L/e/k/t/u


Index: lisp/jka-cmpr-hook.el
===
RCS file: /cvsroot/emacs/emacs/lisp/jka-cmpr-hook.el,v
retrieving revision 1.14
diff -c -r1.14 jka-cmpr-hook.el
*** lisp/jka-cmpr-hook.el   21 Jan 2007 03:53:11 -  1.14
--- lisp/jka-cmpr-hook.el   26 Jan 2007 12:13:47 -
***
*** 248,257 
file-magic-chars  is a string of characters that you would find
 at the beginning of a file compressed in this way.

- Because of the way `call-process' is defined, discarding the stderr output of
- a program adds the overhead of starting a shell each time the program is
- invoked.
-
 If you set this outside Custom while Auto Compression mode is
 already enabled \(as it is by default), you have to call
 `jka-compr-update' after setting it to properly update other
--- 248,253 
Index: lisp/jka-compr.el
===
RCS file: /cvsroot/emacs/emacs/lisp/jka-compr.el,v
retrieving revision 1.92
diff -c -r1.92 jka-compr.el
*** lisp/jka-compr.el   21 Jan 2007 03:53:11 -  1.92
--- lisp/jka-compr.el   26 Jan 2007 12:15:06 -
***
*** 47,64 
 ;; The default value of this variable allows jka-compr to work with
 ;; Unix compress and gzip.
 ;;
- ;; If you are concerned about the stderr output of gzip and other
- ;; compression/decompression programs showing up in your buffers, you
- ;; should set the discard-error flag in the compression-info-list.
- ;; This will cause the stderr of all programs to be discarded.
- ;; However, it also causes emacs to call compression/uncompression
- ;; programs through a shell (which is specified by jka-compr-shell).
- ;; This may be a drag if, on your system, starting up a shell is
- ;; slow.
- ;;
 ;; If you don't want messages about compressing and decompressing
! ;; to show up in the echo area, you can set the compress-name and
! ;; decompress-name fields of the jka-compr-compression-info-list to
 ;; nil.


--- 47,55 
 ;; The default value of this variable allows jka-compr to work with
 ;; Unix compress and gzip.
 ;;
 ;; If you don't want messages about compressing and decompressing
! ;; to show up in the echo area, you can set the compress-msg and
! ;; decompress-msg fields of the jka-compr-compression-info-list to
 ;; nil.


***
*** 105,113 

 (defcustom jka-compr-shell sh
   *Shell to be used for calling compression programs.
! The value of this variable only matters if you want to discard the
! stderr of a compression/decompression program (see the documentation
! for `jka-compr-compression-info-list').
   :type 'string
   :group 'jka-compr)

--- 96,102 

 (defcustom jka-compr-shell sh
   *Shell to be used for calling compression programs.
! NOTE: Not used in MS-DOS and Windows systems.
   :type 'string
   :group 'jka-compr)


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: woman doesn't work if current buffer's directory doesn't exist

2007-01-26 Thread Chris Moore
Richard Stallman [EMAIL PROTECTED] writes:

 To see jka-compr failing, evaluate this:

   (let ((default-directory /a/b/c))
   (insert-file-contents /usr/share/man/man1/ls.1.gz))

 Can someone please fix jka-compr?

My post which started this thread contained a fix for jka-compr.  The
modified functions will need reindenting.  I've left the indentation
alone to make the patch more readable.

$ cvs diff -c lisp/jka-compr.el
Index: lisp/jka-compr.el
===
RCS file: /sources/emacs/emacs/lisp/jka-compr.el,v
retrieving revision 1.92
diff -c -r1.92 jka-compr.el
*** lisp/jka-compr.el   21 Jan 2007 03:53:11 -  1.92
--- lisp/jka-compr.el   26 Jan 2007 14:46:48 -
***
*** 166,171 
--- 166,172 
;; to discard the part we don't want.
(let ((skip (/ beg jka-compr-dd-blocksize))
  (err-file (jka-compr-make-temp-name))
+   (default-directory (file-name-directory infile))
  count)
;; Update PREFIX based on the text that we
won't read in.
  (setq prefix (- beg (* skip
  jka-compr-dd-blocksize))
***
*** 204,209 
--- 205,211 
  
  
  (defun jka-compr-call-process (prog message infile output temp args)
+   (let ((default-directory (file-name-directory infile)))
(if jka-compr-use-shell
  
(let ((err-file (jka-compr-make-temp-name))
***
*** 243,248 
--- 245,251 
 (with-current-buffer temp
(write-region (point-min) (point-max) output)
   (erase-buffer)
+   )
  
  
  ;; Support for temp files.  Much of this was inspired if not lifted


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: woman doesn't work if current buffer's directory doesn't exist

2007-01-26 Thread Eli Zaretskii
 Cc: [EMAIL PROTECTED],  emacs-pretest-bug@gnu.org
 From: Chris Moore [EMAIL PROTECTED]
 Date: Fri, 26 Jan 2007 15:52:36 +0100
 
 *** lisp/jka-compr.el   21 Jan 2007 03:53:11 -  1.92
 --- lisp/jka-compr.el   26 Jan 2007 14:46:48 -
 ***
 *** 166,171 
 --- 166,172 
 ;; to discard the part we don't want.
 (let ((skip (/ beg jka-compr-dd-blocksize))
   (err-file (jka-compr-make-temp-name))
 +   (default-directory (file-name-directory infile))
   count)
 ;; Update PREFIX based on the text that we
 won't read in.
   (setq prefix (- beg (* skip
   jka-compr-dd-blocksize))
 ***
 *** 204,209 
 --- 205,211 
   
   
   (defun jka-compr-call-process (prog message infile output temp args)
 +   (let ((default-directory (file-name-directory infile)))
 (if jka-compr-use-shell

At this late stage in the pretest, won't it be safer to bind
default-directory only if the original value doesn't exist?


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: woman doesn't work if current buffer's directory doesn't exist

2007-01-26 Thread Richard Stallman
BTW, I think the comments in jka-compr.el and some doctrings
(notoriously those of `jka-compr-shell' and
`ja-compr-compression-info-list') do lie about the use of a shell and
the following patch should be applied.

Please install your patch.


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: woman doesn't work if current buffer's directory doesn't exist

2007-01-26 Thread Richard Stallman
At this late stage in the pretest, won't it be safer to bind
default-directory only if the original value doesn't exist?

I am not sure whether it is safer, but it can't really hurt, and it
avoids the issue of installing more code by Chris Moore before his
papers come.

Would you please install that change?


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug