all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* emacs-lisp-byte-compile and buffer change
@ 2004-06-03 18:48 Lars Hansen
  2004-06-05 13:49 ` Richard Stallman
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Hansen @ 2004-06-03 18:48 UTC (permalink / raw)


Create a file foo.el containing the line

  (setq foo t)

and then do

  emacs --no-init-file --no-site-file --file=foo.el 
--eval="(emacs-lisp-byte-compile)"

The Emacs correctly displays a *Compile-Log* with the message

  foo.el:1:7:Warning: assignment to free variable foo

Now, make a file bar.el with

(setq display-buffer-function
  (lambda (buffer not-this-window)
    (set-buffer buffer)
    (let ((display-buffer-function nil))
      (display-buffer buffer not-this-window))))

and do

  emacs --no-init-file --no-site-file --load=bar.el --file=foo.el 
--eval="(emacs-lisp-byte-compile)"

The Emacs _incorrectly_ displays a *Compile-Log* with the messages

  foo.el:1:7:Warning: assignment to free variable bar
  foo.el:1:3:Error: End of file during parsing

This seems to be because the display-buffer-function above changes the 
buffer.
Emacs 21.3 does not have this problem.

You may say that the display-buffer-function above should not change the 
buffer.
However, Emacs (however parts it is) should IMHO be more robust here 
(like 21.3 is).

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: emacs-lisp-byte-compile and buffer change
  2004-06-03 18:48 emacs-lisp-byte-compile and buffer change Lars Hansen
@ 2004-06-05 13:49 ` Richard Stallman
  2004-06-05 14:07   ` Lars Hansen
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Stallman @ 2004-06-05 13:49 UTC (permalink / raw)
  Cc: emacs-devel

    Now, make a file bar.el with

    (setq display-buffer-function
      (lambda (buffer not-this-window)
	(set-buffer buffer)
	(let ((display-buffer-function nil))
	  (display-buffer buffer not-this-window))))

I can't really blame the compiler for being messed up
by such a perverse hook definition.  However, if you would
like to send a patch that would make it stand up to this
sort of messing around, I would approve it, as long
as it is clean.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: emacs-lisp-byte-compile and buffer change
  2004-06-05 13:49 ` Richard Stallman
@ 2004-06-05 14:07   ` Lars Hansen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Hansen @ 2004-06-05 14:07 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman wrote:

>I can't really blame the compiler for being messed up
>by such a perverse hook definition.
>
I anticipated that sort of answer. However, I hoped that someone had an 
idea of where to look since the behaviour I describe has been indroduced 
since 21.3.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-06-05 14:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-03 18:48 emacs-lisp-byte-compile and buffer change Lars Hansen
2004-06-05 13:49 ` Richard Stallman
2004-06-05 14:07   ` Lars Hansen

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.