use-package icon indicating copy to clipboard operation
use-package copied to clipboard

discuss: when/if keyword

Open seagle0128 opened this issue 1 year ago • 1 comments

Think about this snippet

(use-package vertico-posframe
  :when (display-graphic-p))

According to the current design, the snippet will expand to

(progn
  (use-package-ensure-elpa 'vertico-posframe
                           '(t)
                           'nil)
  (when
      (display-graphic-p)))

But, I think it's better expand to below,, so that the package will not be installed in TUI. Does it make sense?

(progn
   (when
      (display-graphic-p)
          (use-package-ensure-elpa 'vertico-posframe
                           '(t)
                           'nil)
    ))

seagle0128 avatar Jan 10 '24 09:01 seagle0128

Yeah this seems like a bug. I think this used to work, but it definitely doesn't now. I use :if (display-graphic-p) a lot but packages are still being loaded in my terminal emacs.

sjrmanning avatar Mar 13 '24 18:03 sjrmanning