From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Strange dynamic variable buf in ielm-send-input Date: Sat, 24 Apr 2004 21:21:30 -0500 (CDT) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200404250221.i3P2LUG17355@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1082860021 31990 80.91.224.253 (25 Apr 2004 02:27:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 25 Apr 2004 02:27:01 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun Apr 25 04:26:54 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BHZM6-0002wW-00 for ; Sun, 25 Apr 2004 04:26:54 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BHZM5-0007Hq-00 for ; Sun, 25 Apr 2004 04:26:54 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BHZKj-0003Bv-SE for emacs-devel@quimby.gnus.org; Sat, 24 Apr 2004 22:25:29 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BHZKQ-0003Bh-Qs for emacs-devel@gnu.org; Sat, 24 Apr 2004 22:25:10 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BHZJu-00031f-5H for emacs-devel@gnu.org; Sat, 24 Apr 2004 22:25:09 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BHZJt-00031W-T7 for emacs-devel@gnu.org; Sat, 24 Apr 2004 22:24:37 -0400 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id i3P2ObTS007021 for ; Sat, 24 Apr 2004 21:24:37 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.6+Sun/8.11.6) id i3P2LUG17355; Sat, 24 Apr 2004 21:21:30 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:22116 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:22116 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.