greg
2021-2-14 14:27:53

@zenspider Ah that’s interesting. Maybe that newer auto-un-quoting is what defeated my effort to use #' in the defcustom default values. Maybe it unquoted that, but skipped the is-this-actually-a-function check — ironic given that defcustom has this whole little contract-like DSL for describing valid values.


greg
2021-2-14 14:31:54

To be clear it was my own dang mistake. I’m talking about how to help Emacs help me avoid this kind of mistake. Like, for forms where most people probably write '("C-a" name-of-function) I often go out of my way to write `("C-a" ,#'name-of-function) just to get the byte compiler check.


greg
2021-2-14 14:32:59

I was just disappointed I couldn’t figure out how to do that in a (defcustom _ (choice (const __))).


yilin.wei10
2021-2-14 22:56:40

The problem with the #' approach is sometimes (like in add-hook ) where it breaks the diagnostic information


yilin.wei10
2021-2-14 22:57:28

So say you do #’show-paren-mode, you get the function value - whereas the symbol is more useful at a glance.


yilin.wei10
2021-2-14 22:58:35

A compromise I tend to do is to have an assert function which makes sure there’s something in the function cell