[Top][All Lists]

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

Re: [elpa] master f00887c: Explicitly require pcase

From: Michael Heerdegen
Subject: Re: [elpa] master f00887c: Explicitly require pcase
Date: Sun, 23 Apr 2017 23:35:59 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

> >     Explicitly require pcase
> >     emacs -Q doesn't load pcase any more.
> But pcase macros are autoloaded.  So what breaks if you don't (require
> 'pcase)?

This unorthodox thing would break:

#+begin_src emacs-lisp
(defun el-search--matcher (pattern &optional result)
  (eval ;use `eval' to allow for user defined pattern types at run time
   (let ((expression (make-symbol "expression")))
       (let ((byte-compile-debug t) ;make undefined pattern types raise an error
             (warning-suppress-log-types '((bytecomp)))
             (pcase--dontwarn-upats (cons '_ pcase--dontwarn-upats)))
         (byte-compile (lambda (,expression)
                         (pcase ,expression
                           (,pattern ,(or result t))
                           (_        nil)))))))))

Before I call `pcase' the first time, I want to add to the binding of
`pcase--dontwarn-upats' which would not be defined at that point of time
when I don't require pcase before.  AFAIR the only purpose is to
suppress a compiler warning in some corner cases, like searching for



reply via email to

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