From unknown Tue Jun 17 01:44:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13005: 24.2.50; table.el not working with lexical-binding Resent-From: Andreas Politz Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Nov 2012 23:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13005 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 13005@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.135397374413245 (code B ref -1); Mon, 26 Nov 2012 23:50:02 +0000 Received: (at submit) by debbugs.gnu.org; 26 Nov 2012 23:49:04 +0000 Received: from localhost ([127.0.0.1]:40688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Td8QB-0003RZ-L5 for submit@debbugs.gnu.org; Mon, 26 Nov 2012 18:49:03 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37092) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Td8Q8-0003RA-Uk for submit@debbugs.gnu.org; Mon, 26 Nov 2012 18:49:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Td8OQ-0000ee-Vk for submit@debbugs.gnu.org; Mon, 26 Nov 2012 18:47:15 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:34272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Td8OQ-0000eZ-Sg for submit@debbugs.gnu.org; Mon, 26 Nov 2012 18:47:14 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Td8OQ-000643-2K for bug-gnu-emacs@gnu.org; Mon, 26 Nov 2012 18:47:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Td8OO-0000dp-KB for bug-gnu-emacs@gnu.org; Mon, 26 Nov 2012 18:47:14 -0500 Received: from gateway-b.fh-trier.de ([143.93.54.182]:41151) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Td8OO-0000dJ-AS for bug-gnu-emacs@gnu.org; Mon, 26 Nov 2012 18:47:12 -0500 X-Virus-Scanned: by Amavisd-new + McAfee uvscan + ClamAV [Rechenzentrum Hochschule Trier] Received: from luca (dslb-088-068-049-125.pools.arcor-ip.net [88.68.49.125]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: politza) by gateway-b.fh-trier.de (Postfix) with ESMTPSA id 60B7417B427 for ; Tue, 27 Nov 2012 00:46:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=simple/simple; d=fh-trier.de; s=default; t=1353973616; bh=6tYtoF46WV7nI4R/Hc3TL13Mae8=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=rWWJ6hc5I2u7X6j+6TTnlLx1xRjd+1Ph7S6gCf38XJnpOoLdImHK2rwKef6ikQ13l 1V/K0AZJK25IufOHwNKLL7ISJTV5q6P6zNkMBsUC0je7IXiHTgbPIL0wkjUl9A4Xub kOPrAQ98boGr/FstBiCgnXb6O6ENqNm0IXDiCCCo= Received: from localhost ([127.0.0.1] helo=luca) by luca with esmtp (Exim 4.72) (envelope-from ) id 1Td8O7-000439-L3 for bug-gnu-emacs@gnu.org; Tue, 27 Nov 2012 00:46:55 +0100 From: Andreas Politz Date: Tue, 27 Nov 2012 00:46:55 +0100 Message-ID: <87mwy4q64w.fsf@fh-trier.de> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.5 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---) emacs -Q M-x table-insert 5xRET Debugger entered--Lisp error: (void-variable columns) symbol-value(columns) After (setq lexical-binding nil) and reloading the function it works fine. -ap From unknown Tue Jun 17 01:44:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13005: 24.2.50; table.el not working with lexical-binding Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Nov 2012 02:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13005 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Andreas Politz Cc: 13005@debbugs.gnu.org Received: via spool by 13005-submit@debbugs.gnu.org id=B13005.135398214725559 (code B ref 13005); Tue, 27 Nov 2012 02:10:01 +0000 Received: (at 13005) by debbugs.gnu.org; 27 Nov 2012 02:09:07 +0000 Received: from localhost ([127.0.0.1]:40777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TdAbj-0006eC-0W for submit@debbugs.gnu.org; Mon, 26 Nov 2012 21:09:07 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:26306) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TdAbg-0006e3-9F for 13005@debbugs.gnu.org; Mon, 26 Nov 2012 21:09:05 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai0FAG6Zu09FxKh9/2dsb2JhbABEsEiDSYEIghUBAQQBViMFCws0EhQYDSSIHAW6CZBEA4hCmnGBWIMH X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="208555373" Received: from 69-196-168-125.dsl.teksavvy.com (HELO pastel.home) ([69.196.168.125]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 26 Nov 2012 21:07:17 -0500 Received: by pastel.home (Postfix, from userid 20848) id 173BE592DC; Mon, 26 Nov 2012 21:07:17 -0500 (EST) From: Stefan Monnier Message-ID: References: <87mwy4q64w.fsf@fh-trier.de> Date: Mon, 26 Nov 2012 21:07:16 -0500 In-Reply-To: <87mwy4q64w.fsf@fh-trier.de> (Andreas Politz's message of "Tue, 27 Nov 2012 00:46:55 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > emacs -Q > M-x table-insert 5xRET > Debugger entered--Lisp error: (void-variable columns) > symbol-value(columns) > After (setq lexical-binding nil) and reloading the function it works > fine. Indeed, thanks. I installed the patch below in the emacs-24 branch which will fix this bug (it also fixes a few long lines, tho very few compared to how many remain). Stefan === modified file 'lisp/textmodes/table.el' --- lisp/textmodes/table.el 2012-10-02 03:46:08 +0000 +++ lisp/textmodes/table.el 2012-11-27 01:51:52 +0000 @@ -1570,8 +1570,7 @@ Inside a table cell has a special keymap. -\\{table-cell-map} -" +\\{table-cell-map}" (interactive (progn (barf-if-buffer-read-only) @@ -1583,41 +1582,47 @@ ("Cell width(s)" . table-cell-width-history) ("Cell height(s)" . table-cell-height-history))))) (table--make-cell-map) - ;; reform the arguments. + ;; Reform the arguments. (if (null cell-width) (setq cell-width (car table-cell-width-history))) (if (null cell-height) (setq cell-height (car table-cell-height-history))) (if (stringp columns) (setq columns (string-to-number columns))) (if (stringp rows) (setq rows (string-to-number rows))) - (if (stringp cell-width) (setq cell-width (table--string-to-number-list cell-width))) - (if (stringp cell-height) (setq cell-height (table--string-to-number-list cell-height))) + (if (stringp cell-width) + (setq cell-width (table--string-to-number-list cell-width))) + (if (stringp cell-height) + (setq cell-height (table--string-to-number-list cell-height))) (if (numberp cell-width) (setq cell-width (cons cell-width nil))) (if (numberp cell-height) (setq cell-height (cons cell-height nil))) - ;; test validity of the arguments. - (mapc (lambda (arg) - (let* ((value (symbol-value arg)) + ;; Test validity of the arguments. + (dolist (arg `((columns . ,columns) + (rows . ,rows) + (cell-width . ,cell-width) + (cell-height . ,cell-height))) + (let* ((value (cdr arg)) (error-handler - (function (lambda () - (error "%s must be a positive integer%s" arg - (if (listp value) " or a list of positive integers" "")))))) + (lambda () + (error "%s must be a positive integer%s" (car arg) + (if (listp value) + " or a list of positive integers" ""))))) (if (null value) (funcall error-handler)) - (mapcar (function (lambda (arg1) + (dolist (arg1 (if (listp value) value + (cons value nil))) (if (or (not (integerp arg1)) (< arg1 1)) - (funcall error-handler)))) - (if (listp value) value - (cons value nil))))) - '(columns rows cell-width cell-height)) + (funcall error-handler))))) (let ((orig-coord (table--get-coordinate)) (coord (table--get-coordinate)) r i cw ch cell-str border-str) - ;; prefabricate the building blocks border-str and cell-str. + ;; Prefabricate the building blocks border-str and cell-str. (with-temp-buffer - ;; construct border-str + ;; Construct border-str. (insert table-cell-intersection-char) (setq cw cell-width) (setq i 0) (while (< i columns) - (insert (make-string (car cw) (string-to-char table-cell-horizontal-chars)) table-cell-intersection-char) + (insert (make-string (car cw) + (string-to-char table-cell-horizontal-chars)) + table-cell-intersection-char) (if (cdr cw) (setq cw (cdr cw))) (setq i (1+ i))) (setq border-str (buffer-substring (point-min) (point-max))) From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 27 11:38:04 2012 Received: (at control) by debbugs.gnu.org; 27 Nov 2012 16:38:04 +0000 Received: from localhost ([127.0.0.1]:41911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TdOAd-000681-GC for submit@debbugs.gnu.org; Tue, 27 Nov 2012 11:38:03 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:36793) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TdOAc-00067v-5C for control@debbugs.gnu.org; Tue, 27 Nov 2012 11:38:02 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1TdO8q-000375-Kp for control@debbugs.gnu.org; Tue, 27 Nov 2012 11:36:12 -0500 Date: Tue, 27 Nov 2012 11:36:12 -0500 Message-Id: Subject: control message for bug 13005 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -4.6 (----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.6 (----) close 13005 24.3