emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cl-lib warnings


From: João Távora
Subject: Re: cl-lib warnings
Date: Mon, 26 Dec 2022 15:10:34 +0000

On Mon, Dec 26, 2022 at 3:13 AM Milan Glacier <news@milanglacier.com> wrote:
use-package is a macro, so if someone uses use-package to configure the
package, when he needs to debug (for example minimal configuration), he
can always present the expanded form. (which basically just expands to
stuffs like setq, autoload, add-hook stuffs).

Yes, this was my initial hope too, that something like 
`pp-macroexpand-last-sexp` could help me.  But it's got 
enough fluff to make it tiring to read.  Here's what a simple 
'(use-package foo)' with no options expands to:

(progn
  (defvar use-package--warning1
    #'(lambda
        (keyword err)
        (let
            ((msg
              (format "%s/%s: %s" 'foo keyword
                      (error-message-string err))))
          (display-warning 'use-package msg :error))))
  (condition-case-unless-debug err
      (if
          (not
           (require 'foo nil t))
          (display-warning 'use-package
                           (format "Cannot load %s" 'foo)
                           :error))
    (error
     (funcall use-package--warning1 :catch err)))) 

I'm afraid mode options will make this even more 
complicated.  And what's with that defvar?

--
João

reply via email to

[Prev in Thread] Current Thread [Next in Thread]