all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: npostavs@users.sourceforge.net
To: Wilfred Hughes <me@wilfred.me.uk>
Cc: 24863@debbugs.gnu.org
Subject: bug#24863: Functions declared as side-effect-free do not generate warnings in the same file
Date: Thu, 03 Nov 2016 19:14:45 -0400	[thread overview]
Message-ID: <87fun8p34q.fsf@users.sourceforge.net> (raw)
In-Reply-To: <CAFXAjY4YAT_uhdSRc-LCv4ih=LEeHkRA7YEVAV-foh+d-HDmJA@mail.gmail.com> (Wilfred Hughes's message of "Wed, 2 Nov 2016 20:59:39 -0400")

severity 24863 minor
quit

Wilfred Hughes <me@wilfred.me.uk> writes:

>
> However, ideally this wouldn't be required. I think it's just a matter
> of changing defun-declarations-alist to:
>
>    (list 'side-effect-free
>          #'(lambda (f _args val)
>              `(eval-and-compile (function-put ',f 'side-effect-free ',val)))
>          "If non-nil, calls can be ignored if their value is unused.
> If `error-free', drop calls even if `byte-compile-delete-errors' is nil.")

Note the comment above:

   ;; We can only use backquotes inside the lambdas and not for those
   ;; properties that are used by functions loaded before backquote.el.

Since the side-effect-free lambda wasn't using backquotes, I presume it
has to stay that way.

On StackExchange you commented

    changing defun-declarations-alist in my current Emacs instance
    doesn't fix the issue

But doing

    (setf (nth 1 (assq 'side-effect-free defun-declarations-alist))
          (lambda (f _args val)
            `(eval-and-compile (function-put ',f 'side-effect-free ',val))))

in a running Emacs works for me.  By "changing" did you mean just
changing the source?  In that case, you would have to redump Emacs
before the change would take effect.





  reply	other threads:[~2016-11-03 23:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-03  0:59 bug#24863: Functions declared as side-effect-free do not generate warnings in the same file Wilfred Hughes
2016-11-03 23:14 ` npostavs [this message]
2021-02-06 11:54 ` Lars Ingebrigtsen

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

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

  git send-email \
    --in-reply-to=87fun8p34q.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=24863@debbugs.gnu.org \
    --cc=me@wilfred.me.uk \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.