unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: chad <yandros@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Robert Pluim <rpluim@gmail.com>,
	EMACS development team <emacs-devel@gnu.org>,
	Lars Ingebrigtsen <larsi@gnus.org>,
	Richard Stallman <rms@gnu.org>
Subject: Re: Always-true predicate?
Date: Mon, 22 Feb 2021 15:07:37 -0800	[thread overview]
Message-ID: <CAO2hHWYQEWU5RNq6gDpLGvoC39mR_49U752tL4yrsRQtX+C70A@mail.gmail.com> (raw)
In-Reply-To: <83im6kw2lv.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 2955 bytes --]

On Mon, Feb 22, 2021 at 7:21 AM Eli Zaretskii <eliz@gnu.org> wrote:

> > From: chad <yandros@gmail.com>
> > Date: Sun, 21 Feb 2021 21:02:43 -0800
> > Cc: Robert Pluim <rpluim@gmail.com>, Lars Ingebrigtsen <larsi@gnus.org>,
> Richard Stallman <rms@gnu.org>,
> >       EMACS development team <emacs-devel@gnu.org>
> >
> > I suspect that I ran into an instance of this recently, where the
> helpful package (an extension that offers
> > expanded help functions, basically) had trouble in it's helpful-callable
> function with facemenu-face-menu. I
> > tracked the problem down to a bad interaction in helpful with this code
> in facemenu.el:
> >
> >  (defvar facemenu-face-menu
> >    [...])
> >  (defalias 'facemenu-face-menu facemenu-face-menu)
> >
> > The problem that I get is:
> >
> >  Debugger entered--Lisp error: (wrong-type-argument sequencep t)
> >    mapconcat(identity (t) " ")
> >    s-join(" " (t))
> >    helpful--signature(facemenu-face-menu)
> >    helpful-update()
> >    helpful-callable(facemenu-face-menu)
> >    funcall-interactively(helpful-callable facemenu-face-menu)
> >    call-interactively(helpful-callable nil nil)
> >    command-execute(helpful-callable)
> >
> > I'm not familiar with the (defalias 'foo foo) idiom, so maybe it should
> be expected to work, and it's just a bug
> > in helpful. (I reported it to the package maintainers already, with a
> note that I'd mention it here.) There are a
> > few other instances of in emacs that I found with a quick search, and
> they also cause similar trouble for
> > helpful.
> >
> > Is this an example of an accidental functional value, as I originally
> expected, or am I barking up the wrong
> > tree and instead just looking at a parsing bug? (My lisp is largely self
> taught and started with Scheme, so
> > these parts of elisp are murky to me.)
>
> I think it's a bug in helpful: facemenu-face-menu is a keymap, so
> maybe helpful isn't ready for that.
>

Good point; I didn't (but should have) say: the issue, I think, is that the
use of defalias makes helpful-callable think that facemenu-face-menu is a
"viable callable", when it isn't. This doesn't mean that it's not a bug in
helpful, of course; I'm just trying to understand if the bug is that
helpful should be able to tell that facemenu-face-menu isn't "callable".
Here's the start of helpful-callable, fwiw:

(defun helpful-callable (symbol)
>   "Show help for function, macro or special form named SYMBOL.
>


See also `helpful-macro', `helpful-function' and `helpful-command'."
>   (interactive
>    (list (helpful--read-symbol
>           "Callable: "
>           (helpful--callable-at-point)
>           #'fboundp)))


helpful--read-symbol seems to be a simple porcelain around completing-read
with, in this case, #'fboundp as the predicate. That said, I'm not sure if
this is just a bug in helpful being confused by the idiom with defalias,
via the function-value usage you mentioned upthread.

Thanks,
~Chad

[-- Attachment #2: Type: text/html, Size: 4461 bytes --]

  reply	other threads:[~2021-02-22 23:07 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17 12:01 Always-true predicate? Lars Ingebrigtsen
2021-02-17 12:31 ` Andrea Corallo via Emacs development discussions.
2021-02-17 12:40   ` Lars Ingebrigtsen
2021-02-17 16:59     ` Barry Fishman
2021-02-19 15:24   ` Stefan Kangas
2021-02-17 13:16 ` Basil L. Contovounesios
2021-02-17 18:56   ` Pip Cet
2021-02-17 19:19     ` Lars Ingebrigtsen
2021-02-17 19:31       ` Pip Cet
2021-02-17 19:37         ` Lars Ingebrigtsen
2021-02-17 20:18           ` Teemu Likonen
2021-02-17 22:25             ` [External] : " Drew Adams
2021-02-17 23:04               ` Basil L. Contovounesios
2021-02-17 23:13                 ` Drew Adams
2021-02-17 23:01             ` Stefan Monnier
2021-02-19 11:27               ` Pip Cet
2021-02-19 15:07                 ` Stefan Monnier
2021-02-19 19:04                   ` Pip Cet
2021-02-19 20:11                     ` Stefan Monnier
2021-02-20  9:40                       ` Pip Cet
2021-02-20 13:58                         ` Stefan Monnier
2021-02-19  5:39 ` Richard Stallman
2021-02-19  8:52   ` Robert Pluim
2021-02-19  9:10     ` Eli Zaretskii
2021-02-19 12:12       ` Eli Zaretskii
2021-02-19 12:52       ` Stefan Kangas
2021-02-19 13:00         ` Lars Ingebrigtsen
2021-02-19 13:34         ` Eli Zaretskii
2021-02-19 13:40           ` Lars Ingebrigtsen
2021-02-19 13:53             ` Eli Zaretskii
2021-02-19 14:05               ` Lars Ingebrigtsen
2021-02-19 18:04                 ` [External] : " Drew Adams
2021-02-19 14:42             ` Stefan Monnier
2021-02-20 12:47               ` Lars Ingebrigtsen
2021-02-20 12:49                 ` Lars Ingebrigtsen
2021-02-20 14:03                   ` Stefan Monnier
2021-02-20 14:20                     ` Lars Ingebrigtsen
2021-02-20 14:55                       ` Stefan Monnier
2021-02-20 15:05                         ` Lars Ingebrigtsen
2021-02-20 15:21                           ` Stefan Monnier
2021-02-21 12:50                             ` Robert Pluim
2021-02-21 13:04                             ` Lars Ingebrigtsen
2021-02-19 15:09           ` Stefan Kangas
2021-02-19 15:22             ` Eli Zaretskii
2021-02-19 18:17               ` [External] : " Drew Adams
2021-02-19 18:41                 ` Eli Zaretskii
2021-02-22  5:02       ` chad
2021-02-22 15:20         ` Eli Zaretskii
2021-02-22 23:07           ` chad [this message]
2021-02-21  6:12     ` Richard Stallman
2021-02-21 15:12       ` Eli Zaretskii

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=CAO2hHWYQEWU5RNq6gDpLGvoC39mR_49U752tL4yrsRQtX+C70A@mail.gmail.com \
    --to=yandros@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=rms@gnu.org \
    --cc=rpluim@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).