unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master 496bed5: Change command-completion-using-modes-p to defun
       [not found] ` <20210220144351.6424B20B7C@vcs0.savannah.gnu.org>
@ 2021-02-20 15:00   ` Stefan Monnier
  2021-02-21 12:41     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2021-02-20 15:00 UTC (permalink / raw)
  To: emacs-devel; +Cc: Lars Ingebrigtsen

> -(define-inline command-completion-using-modes-p (symbol buffer)
> +(defun command-completion-using-modes-p (symbol buffer)

`define-inline` can be used to define inlinable functions, but it's not
like `defsubst`: the body needs to be changed to look a bit more like
what a macro would look like.


        Stefan




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: master 496bed5: Change command-completion-using-modes-p to defun
  2021-02-20 15:00   ` master 496bed5: Change command-completion-using-modes-p to defun Stefan Monnier
@ 2021-02-21 12:41     ` Lars Ingebrigtsen
  2021-02-21 20:17       ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-02-21 12:41 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> -(define-inline command-completion-using-modes-p (symbol buffer)
>> +(defun command-completion-using-modes-p (symbol buffer)
>
> `define-inline` can be used to define inlinable functions, but it's not
> like `defsubst`: the body needs to be changed to look a bit more like
> what a macro would look like.

Right, that's what I thought, but Emacs didn't seem to beep at me when I
used it, so I assumed that it had somehow been changed lately or
something.  I didn't notice that calling

(command-completion-using-modes-p 'eww-form-select (current-buffer))

led to this appearing in my *Messages* buffer:

Compiler-macro error for command-completion-using-modes-p: (wrong-type-argument bufferp (current-buffer))

By the way, changing it back to a defun doesn't seem to clear out the
define-inline-ness?  Hm...  Ah:

(symbol-plist 'command-completion-using-modes-p)
=> (edebug #<marker at 81894 in simple.el> compiler-macro command-completion-using-modes-p--inliner)

Perhaps defun should

(put 'command-completion-using-modes-p 'compiler-macro nil)

?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: master 496bed5: Change command-completion-using-modes-p to defun
  2021-02-21 12:41     ` Lars Ingebrigtsen
@ 2021-02-21 20:17       ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2021-02-21 20:17 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: emacs-devel

> By the way, changing it back to a defun doesn't seem to clear out the
> define-inline-ness?

In the current session, indeed.

That's a general problem with the use of `put`: the info is
associated with the symbol rather than with the actual definition.
Same holds for `gv-expand`, or obsoletion, and many others.

But not for `advertized-calling-convention` because this one uses
a hash-table indexed with the actual function object ;-)


        Stefan




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-21 20:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210220144350.4736.64583@vcs0.savannah.gnu.org>
     [not found] ` <20210220144351.6424B20B7C@vcs0.savannah.gnu.org>
2021-02-20 15:00   ` master 496bed5: Change command-completion-using-modes-p to defun Stefan Monnier
2021-02-21 12:41     ` Lars Ingebrigtsen
2021-02-21 20:17       ` Stefan Monnier

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).