From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#11241: 24.1.50; emacs-lock is ill uncompiled (lexical binding problem?) Date: Sat, 14 Apr 2012 08:47:09 -0400 Message-ID: References: <86d37b3xzi.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1334407667 24798 80.91.229.3 (14 Apr 2012 12:47:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 14 Apr 2012 12:47:47 +0000 (UTC) Cc: michael_heerdegen@web.de, 11241@debbugs.gnu.org To: Juanma Barranquero Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 14 14:47:46 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1SJ2OG-0004cv-VN for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Apr 2012 14:47:45 +0200 Original-Received: from localhost ([::1]:39592 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJ2OG-0006zq-CP for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Apr 2012 08:47:44 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJ2OD-0006zl-B7 for bug-gnu-emacs@gnu.org; Sat, 14 Apr 2012 08:47:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SJ2OB-0007lK-Je for bug-gnu-emacs@gnu.org; Sat, 14 Apr 2012 08:47:40 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJ2OB-0007lE-GY for bug-gnu-emacs@gnu.org; Sat, 14 Apr 2012 08:47:39 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SJ2PW-0004Tg-FT for bug-gnu-emacs@gnu.org; Sat, 14 Apr 2012 08:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Apr 2012 12:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11241-submit@debbugs.gnu.org id=B11241.133440771917185 (code B ref 11241); Sat, 14 Apr 2012 12:49:02 +0000 Original-Received: (at 11241) by debbugs.gnu.org; 14 Apr 2012 12:48:39 +0000 Original-Received: from localhost ([127.0.0.1]:58161 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SJ2P8-0004T7-Gc for submit@debbugs.gnu.org; Sat, 14 Apr 2012 08:48:39 -0400 Original-Received: from ironport-out.teksavvy.com ([206.248.143.162]:46545) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SJ2P4-0004Sv-LI for 11241@debbugs.gnu.org; Sat, 14 Apr 2012 08:48:35 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjEKACxOgk9FxL78/2dsb2JhbABDtheCDAOBDIEIggkBAQQBViMQCw4mEhQYDSSIHAW2MothhHkEpEWBXYMD X-IronPort-AV: E=Sophos;i="4.75,391,1330923600"; d="scan'208";a="174214638" Original-Received: from 69-196-190-252.dsl.teksavvy.com (HELO pastel.home) ([69.196.190.252]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 14 Apr 2012 08:47:09 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 56C635809C; Sat, 14 Apr 2012 08:47:09 -0400 (EDT) In-Reply-To: (Juanma Barranquero's message of "Sat, 14 Apr 2012 04:06:19 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:59058 Archived-At: >> You don't get that error when you use the compiled code, however. > Stefan, I can "fix" this for 24.1 just by making emacs-lock.el not use > lexical-binding. But is this difference between compiled and > non-compiled code a bug in the lexical-binding support or something > expected? IIRC the problem is that it's not clear whether ( ) should treat as an expression or a value. The compiler handles such as call like (funcall #' ) whereas the interpreter handles it like (funcall ' ). In dynamically scoped Elisp, there is no difference between the two, but not with lexical scoping. The patch below should work around the difference. Note that using define-minor-mode's `arg' is not recommended [ But no, I don't have a good replacement to suggest, other than to split the code into two functions, one behaving as a normal boolean minor mode and the other accepting the extra possible values. ] Stefan === modified file 'lisp/emacs-lisp/easy-mmode.el' --- lisp/emacs-lisp/easy-mmode.el 2012-02-25 05:53:29 +0000 +++ lisp/emacs-lisp/easy-mmode.el 2012-04-14 12:41:01 +0000 @@ -260,7 +260,7 @@ ;; repeat-command still does the toggling correctly. (interactive (list (or current-prefix-arg 'toggle))) (let ((,last-message (current-message))) - (,@(if setter (list setter) + (,@(if setter `(funcall #',setter) (list (if (symbolp mode) 'setq 'setf) mode)) (if (eq arg 'toggle) (not ,mode)