From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#7840: SYMBOL_VALUE in terminal.c Date: Sat, 19 Feb 2011 10:05:36 +0200 Message-ID: <8339nkv48f.fsf@gnu.org> References: <87wrl423dm.fsf@stupidchicken.com> <83lj1dv1jy.fsf@gnu.org> <83fwrlutf4.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1298104613 20624 80.91.229.12 (19 Feb 2011 08:36:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 19 Feb 2011 08:36:53 +0000 (UTC) Cc: cyd@stupidchicken.com, 7840@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 19 09:36:47 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PqiJ4-0004Yk-Fw for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Feb 2011 09:36:46 +0100 Original-Received: from localhost ([127.0.0.1]:56054 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PqiJ4-0000zp-2l for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Feb 2011 03:36:46 -0500 Original-Received: from [140.186.70.92] (port=58836 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PqiIy-0000za-IW for bug-gnu-emacs@gnu.org; Sat, 19 Feb 2011 03:36:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PqiIx-0006sC-BK for bug-gnu-emacs@gnu.org; Sat, 19 Feb 2011 03:36:40 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33015) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PqiIx-0006s8-9a for bug-gnu-emacs@gnu.org; Sat, 19 Feb 2011 03:36:39 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PqhqI-0005wK-5y; Sat, 19 Feb 2011 03:07:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Feb 2011 08:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7840 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7840-submit@debbugs.gnu.org id=B7840.129810278122777 (code B ref 7840); Sat, 19 Feb 2011 08:07:02 +0000 Original-Received: (at 7840) by debbugs.gnu.org; 19 Feb 2011 08:06:21 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pqhpd-0005vK-2R for submit@debbugs.gnu.org; Sat, 19 Feb 2011 03:06:21 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pqhpa-0005v6-FC for 7840@debbugs.gnu.org; Sat, 19 Feb 2011 03:06:19 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LGU00600UAXKP00@a-mtaout22.012.net.il> for 7840@debbugs.gnu.org; Sat, 19 Feb 2011 10:05:30 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.124.140.24]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LGU005KLUH3T4B0@a-mtaout22.012.net.il>; Sat, 19 Feb 2011 10:05:29 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 19 Feb 2011 03:07:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:44261 Archived-At: > From: Stefan Monnier > Cc: cyd@stupidchicken.com, 7840@debbugs.gnu.org > Date: Fri, 18 Feb 2011 16:35:18 -0500 > > > I also don't understand the "internal function" argument: it sounds > > TRT to have a function that just fetches a symbol's value, without > > signaling an error if it is unbound. Fsymbol_value, as it is now, is > > clearly coded for interactive use, which this isn't. > > You mean "Lisp use" rather than "interactive", right? No, I mean "interactive", as "in the context of some interactive API call". By contrast, create_terminal runs during Emacs initialization, when there's no one to signal a useful error to. If there were a way to have Fsymbol_value return nil instead of signaling an error, or any other way to get at a symbol's value while suppressing errors, I'd use that. find_symbol_value looked just like such an interface. > > In any case, if you want people to avoid these APIs, please explain > > more why you dislike them, because so far it is utterly unclear, at > > least to me. > > Basically Emacs variables provide > get/set/letbind/unbind/boundp/make-local/makunbound and everything else > is internal. Any code which is not directly related to implementing > that functionality should go through those entry points, IMO. The entry points you mention are Lisp APIs. Low-level C code would need to jump through the hoops to use them safely, especially if it runs during periods when the Emacs session is not yet fully set up. > find_symbol_value is the least harmful of the internal functions, > indeed, but it still requires extra care from the caller since it can > return Qunbound which is a value which should never escape to Lisp code. Checking the value in advance with Funboundp needs the same level of care. And all Fsymbol_value does is call find_symbol_value and then signal an error if the result is Qunbound. I really don't see the difference, unless you are planning some significant change in the implementation of Fsymbol_value VSN. (Btw, I see several uses of `unbound' in Lisp files.)