Re: Elisp assertion for debugging

2022-06-19 Thread Bruno Barbier
Ypo  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,



Elisp assertion for debugging

2022-06-19 Thread Ypo

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