From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jarek Czekalski Newsgroups: gmane.emacs.devel Subject: Re: using command-error-function in emacspeak Date: Tue, 05 Nov 2013 15:45:30 +0100 Message-ID: <5279048A.8030102@poczta.onet.pl> References: <5276AA83.9050905@poczta.onet.pl> <5278946B.3000901@poczta.onet.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1383662763 31577 80.91.229.3 (5 Nov 2013 14:46:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Nov 2013 14:46:03 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 05 15:46:09 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VdhtQ-0005iI-QP for ged-emacs-devel@m.gmane.org; Tue, 05 Nov 2013 15:46:08 +0100 Original-Received: from localhost ([::1]:56496 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdhtQ-0000WX-8K for ged-emacs-devel@m.gmane.org; Tue, 05 Nov 2013 09:46:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vdht9-0000Vr-E0 for emacs-devel@gnu.org; Tue, 05 Nov 2013 09:46:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vdhss-0000CV-7n for emacs-devel@gnu.org; Tue, 05 Nov 2013 09:45:51 -0500 Original-Received: from smtpo11.poczta.onet.pl ([213.180.142.142]:37041) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vdhsr-000098-Sp for emacs-devel@gnu.org; Tue, 05 Nov 2013 09:45:34 -0500 Original-Received: from [192.168.17.9] (cj.e-siemianowice.pl [95.215.234.30]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jarekczek@poczta.onet.pl) by smtp.poczta.onet.pl (Onet) with ESMTPSA id 3dDYZg2VVGz9v7PV for ; Tue, 5 Nov 2013 15:45:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poczta.onet.pl; s=2011; t=1383662731; bh=IMl61tfi5cEDYueMjkTnlu7nqWNSl0iBEKSTEIzh/HI=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=r4EfW3Pzbl9RpAjVHct3RdgG6db0CNkLWbU1CI0z/BpHhFGIx1l9V1emgvn5CZ6d0 R50Ju+OJVhywmX5Ffy6BtfhupExs0ntC1ITjCqL/Dusx8RiuG1CHIARkoa86JWyhPP pHeX/TWP9CR/cnDGgyWzYe0gZvYBd3wBSLKthLZU= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 213.180.142.142 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:164960 Archived-At: W dniu 2013-11-05 15:07, Stefan Monnier pisze: >>> add-function is the to modify the behavior of a function. >>> It can't know what `nil' represents. >> This is what nil represents: >> (defun nil-fun () nil) > No, it's not. > Try to (setq command-error-function #'nil-fun) > to see if it's really the same as nil. Do you mean some subtle elisp difference (which I do not see) or the way command-error-function works? Or you just caught me that I didn't include "&rest args" in nil-fun definition? I know that (setq command-error-function 'nil-fun) changes Emacs behaviour, but this is not the case. I think the case is that (add-function command-error-function something) ;; forgive me wrong syntax here should do the same as (setq command-error-function something) in case when command-error-function is nil beforehand. And the latter would be equivalent to: (setq command-error-function 'nil-fun) (add-function command-error-function something) which is what I propose as a simplification of what add-function should do. Please explain, what you had in mind. I still don't understand why add-function couldn't work on nils. Could you give one counter-example? Thanks, Jarek