Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#80 closed defect (fixed)

Editor Evaluate Defun ignores the buffer package

Reported by: gz Owned by: gb
Priority: major Milestone:
Component: IDE Version:
Keywords: Cc:

Description

Evaluating forms in a buffer (C-x C-e et. al.) ignores the buffer's package, making it pretty much useless

Change History (4)

comment:1 Changed 12 years ago by gb

In what sense does it ignore the buffer package (i.e., what leads you to conclude that it's ignoring the buffer package) ?

Given (defpackage foo (:use "CL")) ; defined in the listener or defined in some file that's loaded

and a buffer containing

(in-package "FOO")

(defun bar (x) (1- (1+ x)))

typing c-x c-e practically anywhere around the definition of BAR will cause FOO::BAR to be defined and the symbol FOO::BAR to be printed in the listener.

When the insertion point is past the end of the IN-PACKAGE form, the buffer's modeline will show that the FOO package is current.

What case fails for you, and how does it fail ?

It would indeed be useless if this didn't work at all. It would be useful to know when and how it fails.

comment:2 Changed 12 years ago by gz

It seems to be a state a window gets into. I still haven't been able to zero in on what causes it. Sometimes just switching windows (and maybe scrolling/clicking around?) seems to fix it, e.g. I'll hit enter, switch to the listener, notice warnings that indicate the evaluation was in the wrong package, switch back to the buffer, hit enter again, and this time it comes out right.

It does happen quite a bit. I'll keep trying to figure out when it happens.

comment:3 Changed 12 years ago by gb

  • Status changed from new to assigned

This (and maybe a few other things) may be caused by incorrect use of the Hemlock VALUE macro, which seems to access the global value of a Hemlock variable. (We obviously want to use a buffer-private value of whatever variable holds the editor's notion of the current package.)

comment:4 Changed 12 years ago by gb

  • Resolution set to fixed
  • Status changed from assigned to closed

EVAL-REGION was accessing a global Hemlock variable to get the package name, not the current buffer's variable. It stopped doing so in [7122], which hopefully fixes this.

Note: See TracTickets for help on using tickets.