From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Condy Chen Newsgroups: gmane.emacs.devel Subject: Re: "Command Discovery In Emacs " Date: Mon, 16 Aug 2021 21:33:28 +0800 Message-ID: References: <35ED7127-E9B2-4725-A8CE-F40EA09202C0@traduction-libre.org> <87k0klfwl4.fsf@gnus.org> <87r1etblay.fsf@gnus.org> <9E7AB41B-8F1F-4FC8-AA1B-8867ACC32FA0@traduction-libre.org> <87r1eta5go.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000caebb205c9ad3fc9" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8865"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Jean-Christophe Helary , Emacs Devel To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Aug 16 15:35:51 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mFcmN-00021C-HO for ged-emacs-devel@m.gmane-mx.org; Mon, 16 Aug 2021 15:35:51 +0200 Original-Received: from localhost ([::1]:46144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mFcmL-0000mi-NK for ged-emacs-devel@m.gmane-mx.org; Mon, 16 Aug 2021 09:35:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50408) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mFckN-0004gb-6d for emacs-devel@gnu.org; Mon, 16 Aug 2021 09:33:47 -0400 Original-Received: from mail-ot1-x32d.google.com ([2607:f8b0:4864:20::32d]:39596) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mFckL-0006Ha-FB for emacs-devel@gnu.org; Mon, 16 Aug 2021 09:33:46 -0400 Original-Received: by mail-ot1-x32d.google.com with SMTP id m7-20020a9d4c87000000b0051875f56b95so3871431otf.6 for ; Mon, 16 Aug 2021 06:33:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7PSzgzVAXuQ8y04r/8URqHaDigndvLowJ/yBYY/c79Y=; b=Cf2rQGYVUkue4yRxhHFtLzKjI6Fg5ExS0oIWT5hYinIb4uhqfpnBdKJrMqP0cFhgx3 3EhIdD4Rgg+7xuS8nkiqRGgZWxbktB7GgfV+FQDir1NULB19YGwyuAjsun6CCGJB89xF NSOy40dA5v8sWp0Xt2FPgs2zryU8a4ePl5fh2xoysgWa0V6L0z9Rz6DP0AhU+fn3l+dA SHsomreHTKB9jsCpUnprxWdnESaxd9kBa1BCRcygzlsbiKKmy6iV1H+MB0OXV2nShOH6 ocnPGnN40M3vluCBWNrJDSdSw7uTooiQKlUB7hJ3Rv3/AiCi3XSDDTKP+RTdQV3JLsSK eDig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7PSzgzVAXuQ8y04r/8URqHaDigndvLowJ/yBYY/c79Y=; b=f0vTWtsw7uEVoHqkHoLy/PlGJ0X2e6r8jBzN5lKjvypOzp3pcBJV5lS7GRbqm2ryPG k07vRe7Abl+2t33IOPlhv0i4+GDcupLl8PX0o5ABzMee0/VyZ0pJdy56WsNeehWl321B OwN56n5d1fzxbbrvzJGGxpi0zz3IO3KwP4dxwo69tlPMHLWp+upnZWD1R+dC76/baDS/ X6DB0BdOp8/Ey0GCwb8ERFTNjvFBpI58zoOiOyBW+34KjebzKtb/guUPEeZAL9RtWlZj d1T/ZTbZLcq7g1dIg6FiVhYSJQDYdO56N1AxoxycoaTp1fE0vdW+hOUykOGnnwXedNbR 6lqg== X-Gm-Message-State: AOAM532+lyBvTJAsDl+RZH3oq9gXqWJzrn+HyQDJrVitXqVW6uQ+j+7x /3M9roTxJn7Dk80Ns3JlmtcyGNhXmSs2Hs0KNeo= X-Google-Smtp-Source: ABdhPJySatDIdTtAHA7wQIrVQdE26inCCxtdvKD+nDAVw5Qejpsk64OfnSlwNpsQhFAFUxL3W0Y0lBStUhnYZgwA5Bg= X-Received: by 2002:a05:6830:44a8:: with SMTP id r40mr12594267otv.222.1629120820340; Mon, 16 Aug 2021 06:33:40 -0700 (PDT) In-Reply-To: <87r1eta5go.fsf@gnus.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::32d; envelope-from=condy0919@gmail.com; helo=mail-ot1-x32d.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:272440 Archived-At: --000000000000caebb205c9ad3fc9 Content-Type: text/plain; charset="UTF-8" By defining `foo' with (defun foo (arg) (interactive "p" org-mode) (message "foo")) M-x foo is still available in elisp-mode. I'm using GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.17.4) of 2021-08-16 On Mon, Aug 16, 2021 at 9:24 PM Lars Ingebrigtsen wrote: > Jean-Christophe Helary writes: > > > Ok, that's what I eventually guessed. So, the idea is to check whether > > a function is interactive and try to guess whether it is limited to a > > given mode (most probably the mode it is defined in), and if yes tag > > it ? > > Yup. > > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no > > --000000000000caebb205c9ad3fc9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
By defining `foo' with

(defun foo (arg)
=C2=A0 (interactive "p" org-mode)
=C2= =A0 (message "foo"))

M-x foo is still av= ailable in elisp-mode.

I'm using GNU Emacs 28.= 0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.1= 7.4) of 2021-08-16

On Mon, Aug 16, 2021 at 9:24 PM Lars Ingebrigtsen &= lt;larsi@gnus.org> wrote:
Jean-Christophe Helary &= lt;lists@tr= aduction-libre.org> writes:

> Ok, that's what I eventually guessed. So, the idea is to check whe= ther
> a function is interactive and try to guess whether it is limited to a<= br> > given mode (most probably the mode it is defined in), and if yes tag > it ?

Yup.

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

--000000000000caebb205c9ad3fc9--