all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: [elpa] master f00887c: Explicitly require pcase
       [not found] ` <20170423050138.63CA221037@vcs0.savannah.gnu.org>
@ 2017-04-23 13:41   ` Stefan Monnier
  2017-04-23 21:35     ` Michael Heerdegen
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2017-04-23 13:41 UTC (permalink / raw)
  To: emacs-devel; +Cc: Michael Heerdegen

>     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)?


        Stefan



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [elpa] master f00887c: Explicitly require pcase
  2017-04-23 13:41   ` [elpa] master f00887c: Explicitly require pcase Stefan Monnier
@ 2017-04-23 21:35     ` Michael Heerdegen
  2017-04-23 22:43       ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Heerdegen @ 2017-04-23 21:35 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> 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")))
     `(el-search--with-additional-pcase-macros
       (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)))))))))
#+end_src

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
`_'.


Regards,

Michael.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [elpa] master f00887c: Explicitly require pcase
  2017-04-23 21:35     ` Michael Heerdegen
@ 2017-04-23 22:43       ` Stefan Monnier
  2017-04-24  3:22         ` Michael Heerdegen
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2017-04-23 22:43 UTC (permalink / raw)
  To: emacs-devel

>> >     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")))
>      `(el-search--with-additional-pcase-macros
>        (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)))))))))
> #+end_src

I see.  That probably deserves a comment.


        Stefan




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [elpa] master f00887c: Explicitly require pcase
  2017-04-23 22:43       ` Stefan Monnier
@ 2017-04-24  3:22         ` Michael Heerdegen
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Heerdegen @ 2017-04-24  3:22 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> I see.  That probably deserves a comment.

Agreed.  I'll add a comment like this:

#+begin_src emacs-lisp
(require 'pcase) ;we bind `pcase--dontwarn-upats' before pcase is autoloaded
#+end_src

to one of the next commits.


Thanks,

Michael.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-04-24  3:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20170423050137.9474.12867@vcs0.savannah.gnu.org>
     [not found] ` <20170423050138.63CA221037@vcs0.savannah.gnu.org>
2017-04-23 13:41   ` [elpa] master f00887c: Explicitly require pcase Stefan Monnier
2017-04-23 21:35     ` Michael Heerdegen
2017-04-23 22:43       ` Stefan Monnier
2017-04-24  3:22         ` Michael Heerdegen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.