emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Elisp assertion for debugging
@ 2022-06-19 18:44 Ypo
  2022-06-19 19:11 ` Bruno Barbier
  0 siblings, 1 reply; 2+ messages in thread
From: Ypo @ 2022-06-19 18:44 UTC (permalink / raw)
  To: Org-mode

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

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

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Elisp assertion for debugging
  2022-06-19 18:44 Elisp assertion for debugging Ypo
@ 2022-06-19 19:11 ` Bruno Barbier
  0 siblings, 0 replies; 2+ messages in thread
From: Bruno Barbier @ 2022-06-19 19:11 UTC (permalink / raw)
  To: Ypo, Org-mode

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,


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-19 19:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-19 18:44 Elisp assertion for debugging Ypo
2022-06-19 19:11 ` Bruno Barbier

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).