all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Strange dynamic variable buf in ielm-send-input
@ 2004-04-25  2:21 Luc Teirlinck
  2004-04-26  7:27 ` Richard Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: Luc Teirlinck @ 2004-04-25  2:21 UTC (permalink / raw)


Take:

(defun ielm-send-input nil
  "Evaluate the Emacs Lisp expression after the prompt."
  (interactive)
  (let ((buf (current-buffer))
        ielm-input)			; set by ielm-input-sender
    (comint-send-input)		      ; update history, markers etc.
    (ielm-eval-input ielm-input)))


That dynamically bound variable "buf" does not only _not_ get used in
the function ielm-send-input, but also nowhere else in ielm.el, nor in
comint.el.  I do not know whether it is a remnant of a prior version
in which it was used (in which case it should obviously be removed),
or whether it is meant to provide the user with a way to refer to the
current ielm buffer in IELM expressions.  (Because (current-buffer)
yields the working buffer, not necessarily the ielm buffer, the ielm
buffer may have been renamed and although (window-buffer) will most of
the time refer to the actual IELM buffer, it may not be 100% reliable
either.)

If the latter is the purpose, then I believe that that purpose should
be documented in the docstring and also that the variable should be
renamed to ielm-buffer or something similar, because buf can just too
easily be overridden.

Sincerely,

Luc.

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

end of thread, other threads:[~2004-04-26  7:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-25  2:21 Strange dynamic variable buf in ielm-send-input Luc Teirlinck
2004-04-26  7:27 ` Richard Stallman

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.