emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bruno Barbier <brubar.cs@gmail.com>
To: Ypo <ypuntot@gmail.com>, Org-mode <emacs-orgmode@gnu.org>
Subject: Re: Elisp assertion for debugging
Date: Sun, 19 Jun 2022 21:11:55 +0200	[thread overview]
Message-ID: <E1o30Jm-0003uw-DZ@lists.gnu.org> (raw)
In-Reply-To: <a0f85e9e-e8d7-9c43-2916-95813810bcc3@gmail.com>

Ypo <ypuntot@gmail.com> writes:

> I am trying to debug my init file: C-u prefix is not working.
> I am using the elisp-bug-hunter package that has saved me many times in 
> the past. But it doesn't work fine this time though, so it seems I need 
> an “assertion elisp” to debug my init file.
> What elisp expression would return nil when C-u prefix works and non-nil 
> when C-u prefix doesn't work?
> I have tried
> (eq (key-binding "C-u C-SPC") 'nil)
> but it is probably a nonsense.
> Best regards

This might work:

     (unless (eq 'universal-argument (keymap-lookup global-map "C-u"))
       (error "C-u has been redefined"))

Note that you don't need to quote nil:

     'nil = nil

Also, this question is not really about org-mode; posting to the emacs
mailing list might increase your chance to get a good answer.

Best regards,

      reply	other threads:[~2022-06-19 19:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-19 18:44 Elisp assertion for debugging Ypo
2022-06-19 19:11 ` Bruno Barbier [this message]

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:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1o30Jm-0003uw-DZ@lists.gnu.org \
    --to=brubar.cs@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=ypuntot@gmail.com \


* 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


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