unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / 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

unofficial mirror of emacs-devel@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/emacs-devel/0 emacs-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 emacs-devel emacs-devel/ https://yhetil.org/emacs-devel \
		emacs-devel@gnu.org
	public-inbox-index emacs-devel

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.devel
	nntp://news.gmane.io/gmane.emacs.devel


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git