From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#23648: [PATCH] `defun-declarations-alist' can be unintentionally modified Date: Mon, 18 Jul 2016 14:58:20 -0400 Message-ID: References: <87twfnd50u.fsf@users.sourceforge.net> <83wpkj10eg.fsf@gnu.org> <83k2gi24nz.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1468868368 28065 80.91.229.3 (18 Jul 2016 18:59:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Jul 2016 18:59:28 +0000 (UTC) Cc: 23648@debbugs.gnu.org, Paul Pogonyshev To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 18 20:59:17 2016 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 1bPDl6-0006Mz-Ir for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 Jul 2016 20:59:16 +0200 Original-Received: from localhost ([::1]:49781 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPDl2-0003MD-Gj for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 Jul 2016 14:59:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPDkw-0003J5-DC for bug-gnu-emacs@gnu.org; Mon, 18 Jul 2016 14:59:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPDks-00020z-65 for bug-gnu-emacs@gnu.org; Mon, 18 Jul 2016 14:59:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43663) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPDks-00020u-2O for bug-gnu-emacs@gnu.org; Mon, 18 Jul 2016 14:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bPDkr-0005zU-NX for bug-gnu-emacs@gnu.org; Mon, 18 Jul 2016 14:59:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Jul 2016 18:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23648 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 23648-submit@debbugs.gnu.org id=B23648.146886830822981 (code B ref 23648); Mon, 18 Jul 2016 18:59:01 +0000 Original-Received: (at 23648) by debbugs.gnu.org; 18 Jul 2016 18:58:28 +0000 Original-Received: from localhost ([127.0.0.1]:56000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPDkK-0005yb-3S for submit@debbugs.gnu.org; Mon, 18 Jul 2016 14:58:28 -0400 Original-Received: from mail-oi0-f45.google.com ([209.85.218.45]:34538) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPDkI-0005yO-KH for 23648@debbugs.gnu.org; Mon, 18 Jul 2016 14:58:26 -0400 Original-Received: by mail-oi0-f45.google.com with SMTP id l65so179733124oib.1 for <23648@debbugs.gnu.org>; Mon, 18 Jul 2016 11:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=PQEydhLgQcAS0NLl0KAk2zzVbW+TB4lMd2aR4BNg3ws=; b=WAWjLyp52EDKt3s/FKz65XNELP/O2Jky6yHxPoM8lZB75c9FVFe/dqWWrmJ9SLqTfN H80HNO9nRaVMT9zcz9mxWdfEij01Vpj+ABp1Th3/6aoB2XryjTn/csd4QWc19r/QYVnh bzCYTNnAqw6p+O881mM+c4RP/RBTR226mB6y3H8LAZE7UO0AUHJymHw7X6HtbZcTvuWF qB0e6KjIBRiXnLizm75jKVS5nLvn19FZ52TRYbo+Gn6agClDD7PDgg6NbzO+OQS0OeLR PaXEWWkhLGzfTbqxe8KGI3XYLonGJW3ln8IQR6Q1MPhgYfitKSlZWLPNTd05kutyLcZ4 jq5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=PQEydhLgQcAS0NLl0KAk2zzVbW+TB4lMd2aR4BNg3ws=; b=esVvummmtu2FBC2K9dugtiF1Lqwm1ph5KlfZgBec0URxBNbQ5oq/crIOeC0YXnuSur Zh08DRuyLGrxwQivtlljMHbi1yvd+Tt5XwIG83zCSQhfxNt/48CU0RW8fESf2k+mrT/D m8UOAxnD8j2cGGWOL5xH3EPHn6fEqVBVordOx4AitzZL5XtDAWaU9i0x8DaQVfcVJl2R R6o+qu60xEdz5mCg2QRH23m39m3mIPBZ+5JByCm0jIBGODzgFZD+HK0BiYTqQ03yTo4Q 4AsPJff/j2Gt0oTvjxFMnlSNkckobi+vNtKo0GNP+4Z3yceq1DIqs0DqUMSja9AVU8Vh Bz7A== X-Gm-Message-State: ALyK8tLJu0cV5wCbakYxey/VatR91FZf3P04EPdrWUOiSh6GfCe157gLlUK3MRjcMojaU2keV9blrwnhEBLJ5A== X-Received: by 10.202.92.194 with SMTP id q185mr16102917oib.88.1468868300952; Mon, 18 Jul 2016 11:58:20 -0700 (PDT) Original-Received: by 10.157.7.161 with HTTP; Mon, 18 Jul 2016 11:58:20 -0700 (PDT) In-Reply-To: <83k2gi24nz.fsf@gnu.org> X-Google-Sender-Auth: qXeDZlkfxwp-OnMcu37VdQ4nrjU X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:121232 Archived-At: On Mon, Jul 18, 2016 at 2:16 PM, Eli Zaretskii wrote: >> From: Noam Postavsky >> Date: Mon, 18 Jul 2016 11:53:42 -0400 >> Cc: Paul Pogonyshev , 23648@debbugs.gnu.org >> >> > I'm not sure, actually. How probable is the situation where this >> > problem pops up? >> >> It happens with 100% probability when performing completion inside a >> (declare ...) form. Starting from emacs -Q, put into *scratch* >> >> (defun foo () >> (declare (indent 1)) >> nil) >> >> Macroexpanding this gives: >> >> (prog1 >> (defalias 'foo >> #'(lambda nil nil)) >> (put 'foo 'lisp-indent-function '1)) >> >> Now move point to just after "indent" and type C-M-i (this gives >> message "Sole completion"), macroexpanding now gives >> >> (prog1 >> (defalias 'foo >> #'(lambda nil nil)) >> "Warning: Unknown defun property `indent' in foo") > > Sorry, I'm not following: what do you mean by "macroexpanding" in this > context? Calling macroexpand on the defun form. The most convenient method for testing is to put point at the closing bracket of the defun, and then `M-x pp-macroexpand-last-sexp'. > When you wrote "when performing completion", I expected to > see some simple completion gesture that leads to an error, but it > sounds like I'm missing something. The simple completion gesture would be the C-M-i I mentioned, which (silently) destroys the value of defun-declarations-alist. The symptoms of the wrong value can be seen when defun is macroexpanded.