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

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

Re: `call-process-region' is stuck in the past


From: David Hunter
Subject: Re: `call-process-region' is stuck in the past
Date: Wed, 23 Mar 2005 23:27:06 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)

Hi Joe,

call-process-region creates a temporary file according to the variable temp-file-name-pattern, 
which should be "$TMPDIR/emacsXXXXXX" or "/tmp/emacsXXXXXX".  When the process 
runs, this file is connected to stdin.  (I assumed that the file name was added to the command line 
arguments; I was wrong.)  The file is destroyed after the process completes, so you should never 
experience ill effects from previous invocations.

I see a possible problem with your lynx command.  According to the users guide for lynx 2.8.6, when 
no startfile is present in the command arguments, then a default file will be displayed.  (I'd bet 
your default file is being displayed in *foo*.)  To read the startfile from stdin, you must use the 
"-stdin" option.  So you probably want to change your command to "lynx -dump 
-stdin".

I also don't understand why you use tcsh to execute lynx.  If the shell is not 
required, you should be able to execute lynx directly, like so:

(call-process-region (point-min) (point-max) "lynx -dump -stdin" nil
                    (get-buffer-create "*foo*"))

Hope this helps.
-Dave

Joe Corneli wrote:
Here's what happens:
I switch to some buffer containing some arbitrary HTML code. I evaluate the following form, which is designed to render
this HTML:

 (call-process-region (point-min) (point-max) "tcsh" nil
                      (get-buffer-create "*foo*")
                      nil "-c" "lynx -dump")

I switch to the buffer *foo* and I see (to my annoyance):

    1. [1]Google
    2. [2]Homepage of Joseph Angus Corneli
    3. [3]Map of the internet

References

   1. http://www.google.com/
   2. http://www.ma.utexas.edu/~jcorneli/
   3. http://www.ma.utexas.edu/~jcorneli/l/map.html


This is not what I expected to see, because, as stated above,
the buffer that I ran this process on had arbitrary HTML code
that has *nothing to do* with the output seen here.

I did in fact use 'lynx -dump' to generate output that looked
like this some time ago, but since the I've used it to generate
lots and lots of different kinds of output.
The weird thing about it is that I've restarted Emacs in the
mean time, and I don't even see any files hanging around any of my working/nearby directories with the HTML code to
generate the above output.  I have no idea where 'lynx -dump'
is getting the info from.  If I run it under a shell or even
as a `shell-command' on a file or URL from within Emacs, it
produces the output I'd expect!  So, I figure, there must
be something weird going on with `call-process-region' but
I'm not sure what could be going on.
Skimming the code, it says that some temporary files are used,
but I don't know where to look for these files.  Please
help!  This is too weird!



In GNU Emacs 22.0.50.1 (powerpc-apple-darwin7.5.0, X toolkit, Xaw3d scroll bars)
 of 2005-02-22 on hope-of-a-stone.local
Distributor `The XFree86 Project, Inc', version 11.0.40300000
configured using `configure '--with-x' '--without-carbon' 
'CFLAGS=-I/sw/include' 'CPPFLAGS=-I/sw/include' 'LDFLAGS=-L/sw/lib''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  auto-image-file-mode: t
  show-paren-mode: t
  display-time-mode: t
  mouse-wheel-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
o <tab> <return> C-v C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-x o C-x b <return> C-a C-SPC <C-right> M-w <up> <up> <down> M-x r e p <tab> o <tab> r <tab> <retur
n>

Recent messages:
History item: 1
Undo! [11 times]
(No changes need to be saved)
Mark set
Type C-t b w RET to restore the other window.  C-M-v to scroll the help.
mouse-2, RET: find function's definition
Loading cc-mode...done
Mark activated
Making completion list... [2 times]
Loading emacsbug...done


_______________________________________________
Emacs-pretest-bug mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug





reply via email to

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