unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Psionic K <psionik@positron.solutions>
To: Eli Zaretskii <eliz@gnu.org>, help-gnu-emacs@gnu.org
Subject: Re: Introspecting yas tab binding
Date: Sat, 3 Feb 2024 22:47:06 +0900	[thread overview]
Message-ID: <CADQMGAQtR-THKu4YQA6L2==XBP-SgSSoJFMw+PU-JvEZ79RVNw@mail.gmail.com> (raw)

It's solved.  The general method is described at the end.

> For the first question, we have trace.el, stepping through Lisp code
> in Edebug, and stepping through code in keyboard.c in GDB.  For the
> second, I would modify the offending menu entry in some way that would
> signal that it is responsible

I re-bound the command to "X" like so:

    (setcar  (car(last yas-minor-mode-map)) (string-to-char "X"))

This confirmed the responsibility of the menu binding, the contents of
which are:

    (9 menu-item "" yas-expand :filter yas-maybe-expand-abbrev-key-filter)

> The fact that :filter function cannot be debugged using debug-on-entry
> perhaps warrants a bug report.

I confirmed that `trace-function' was able to see the filter be
called.  However, debug-on-entry did not trigger a debugger session.

`key-binding' succeeds in uncovering that a binding exists, but not where it is.

Identifying keymaps from `current-active-maps' and corroborating the
symbol names with the obarray values, then calling `keymap-lookup'
appears to be viable.

The `keymap-lookup' returns nil or `yas-expand' depending on the
:filter result.  The user must configure the filter to be true to
observer the binding.  This is the only such conditional binding I
have observed in Emacs that didn't rely on variables in
`emulation-mode-alists` or modifying keymaps themselves.



             reply	other threads:[~2024-02-03 13:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-03 13:47 Psionic K [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-02-03  2:14 Introspecting yas tab binding Psionic K
2024-02-03  6:11 ` tomas
2024-02-03  6:43   ` Joost Kremers
2024-02-03  7:09     ` Emanuel Berg
2024-02-03  7:42     ` Eli Zaretskii
2024-02-03  7:57       ` Emanuel Berg
2024-02-03  6:54   ` Emanuel Berg
2024-02-03  8:06 ` Eli Zaretskii
2024-02-03  8:29   ` Emanuel Berg
2024-02-02 12:34 Psionic K
2024-02-02 12:39 ` 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='CADQMGAQtR-THKu4YQA6L2==XBP-SgSSoJFMw+PU-JvEZ79RVNw@mail.gmail.com' \
    --to=psionik@positron.solutions \
    --cc=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /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.
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).