[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Strange dynamic variable buf in ielm-send-input
From: |
Luc Teirlinck |
Subject: |
Strange dynamic variable buf in ielm-send-input |
Date: |
Sat, 24 Apr 2004 21:21:30 -0500 (CDT) |
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.
- Strange dynamic variable buf in ielm-send-input,
Luc Teirlinck <=