jwiegley / use-package

A use-package declaration for simplifying your .emacs
https://jwiegley.github.io/use-package
GNU General Public License v3.0
4.42k stars 260 forks source link

Remove custom-set-variable 3rd argument? #861

Closed conao3 closed 3 years ago

conao3 commented 4 years ago

Recently, use-package doesn't expand custom-set-variable 3rd argument for specified :custom keyword.

(pp
 (macroexpand-1
  '(use-package comint
     :custom
     (comint-prompt-regexp "^")
     (comint-buffer-maximum-size 20000 "Increase comint buffer size.")
     (comint-prompt-read-only t "Make the prompt read only."))))
;;=> (progn
;;     (funcall
;;      (or
;;       (get 'comint-prompt-regexp 'custom-set)
;;       #'set-default)
;;      'comint-prompt-regexp "^")
;;     (funcall
;;      (or
;;       (get 'comint-buffer-maximum-size 'custom-set)
;;       #'set-default)
;;      'comint-buffer-maximum-size 20000)
;;     (funcall
;;      (or
;;       (get 'comint-prompt-read-only 'custom-set)
;;       #'set-default)
;;      'comint-prompt-read-only t)
;;     (require 'comint nil nil))

I can't find "Increase comint buffer size." and "Make the prompt read only." in expanded form. It used to be output as custom-set-variable argument and could be seen in M-x customize. It also seems that the default comment of customized with use-package is no longer printed. This was useful for not changing variables managed by use-package in M-x customize.

tzz commented 4 years ago

@conao3 can you try https://github.com/tzz/use-package/commit/adb3abba43bbf6c245b784184de26da579673e8c ?

I added a new test and modified the current custom test but it's failing. I am not sure why, the code looks good to me. Maybe @jwiegley or someone else will have an idea.

jwiegley commented 4 years ago

I won't have time to look this week, if anyone can chime in with some knowledge that would be great!

tzz commented 4 years ago

@conao3 I think #881 will preserve the comment by reverting to the old function call. Could you try it?