unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: npostavs@users.sourceforge.net
To: Eli Zaretskii <eliz@gnu.org>
Cc: Michael Heerdegen <michael_heerdegen@web.de>,
	23648@debbugs.gnu.org, pogonyshev@gmail.com
Subject: bug#23648: [PATCH] `defun-declarations-alist' can be unintentionally modified
Date: Wed, 20 Jul 2016 21:09:42 -0400	[thread overview]
Message-ID: <87a8hbdcfd.fsf@users.sourceforge.net> (raw)
In-Reply-To: <83d1ma1hai.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 19 Jul 2016 05:40:53 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Michael Heerdegen <michael_heerdegen@web.de>
>> Cc: Noam Postavsky <npostavs@users.sourceforge.net>,  23648@debbugs.gnu.org,  pogonyshev@gmail.com
>> Date: Mon, 18 Jul 2016 23:28:55 +0200
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > Sorry, I guess I'm too stupid to understand this advanced stuff.  Or
>> > maybe it's too late.
>> 
>> I think the example uses macroexpand only to demonstrate what (obviously
>> ill) code you will get when you compile the mentioned form after
>> performing the completion as mentioned.
>
> Thanks, but I'm still none the wiser about the questions I asked.

Hmm, maybe it will be clearer like this:

Evaluate:

(macroexpand '(defun foo ()
                (declare (indent 1))
                nil)) ;=> (prog1 (defalias (quote foo) (function (lambda nil nil))) (function-put (quote foo) (quote lisp-indent-function) (quote 1)))

This gives the correct result (the (function-put...) part comes from the
(declare (indent 1))).

Now perform a completion on a declare clause, e.g., put cursor after
"ind" and hit C-M-i: (declare (ind)) completes to (declare (indent)).

Now evaluate the same expression as before:

(macroexpand '(defun foo ()
                (declare (indent 1))
                nil)) ;=> (prog1 (defalias (quote foo) (function (lambda nil nil))) "Warning: Unknown defun property ‘indent’ in foo")

This give the wrong result, the (declare (indent 1)) is giving the
"Warning:...".  Emacs has unlearned the indent declaration.  In fact it
unlearned all the declarations for defun except for gv-setter, you can
see this by looking at defun-declarations-alist's value.





  reply	other threads:[~2016-07-21  1:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-29 14:11 bug#23648: [PATCH] `defun-declarations-alist' can be unintentionally modified Paul Pogonyshev
2016-07-18  3:00 ` npostavs
2016-07-18 14:33   ` Eli Zaretskii
2016-07-18 15:53     ` Noam Postavsky
2016-07-18 18:16       ` Eli Zaretskii
2016-07-18 18:58         ` Noam Postavsky
2016-07-18 19:08           ` Eli Zaretskii
2016-07-18 21:28             ` Michael Heerdegen
2016-07-19  2:40               ` Eli Zaretskii
2016-07-21  1:09                 ` npostavs [this message]
2016-07-21 14:22                   ` Eli Zaretskii
2016-07-21 21:27                     ` Noam Postavsky
2016-07-23  8:54                       ` Eli Zaretskii
2016-07-23 14:18                         ` npostavs
2016-07-24 17:07                           ` Paul Pogonyshev
2016-07-24 17:31                             ` Eli Zaretskii
2016-07-18 19:17   ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a8hbdcfd.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=23648@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=michael_heerdegen@web.de \
    --cc=pogonyshev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).