all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Upcoming seq.el version problem with the Emacs release
@ 2016-02-16 13:32 Nicolas Petton
  2016-02-20  6:24 ` John Wiegley
  0 siblings, 1 reply; 11+ messages in thread
From: Nicolas Petton @ 2016-02-16 13:32 UTC (permalink / raw
  To: emacs-devel, Artur Malabarba

[-- Attachment #1: Type: text/plain, Size: 2392 bytes --]

Hi,

We have been discussing with Artur an issue that will appear with seq.el
once we'll have Emacs 25.1 out.

Quoting Artur:

  Hi Nico, I just realised a problem that we're about to face. Once Emacs
  25 is released,there'll be a version of seq.el (2.x) in the wild, with a
  fixed set of features.  Later on, if you add new features to the seq.el
  that's on Elpa (whose version is 1.y) these features will be impossible
  to use without issue.
  
  For instance, let's say you add seq-map-indexed on version 1.15, and I
  want to use it on a package. For that, I would require seq.el version
  1.15 on my package.
  
  However, I have no guarantee that I'll get that. If the user is running
  Emacs 25.1, they'll have a seq.el installed with version 2.something
  (which satisfies the dependency) but does not contain map indexed.
  
  The same will happen for all newly added features. And seriously reduces
  the usefulness of seq as dependency package.


One solution would be to have a single seq package on Elpa (carrying a
2.x version number), that offered both implementations. It would have 3
files:

- seq.el
- seq-25.el
- seq-24.el

The file seq-24.el would have the exact same contents as the current
seq-1.x we have on Elpa except:

- The file-header and the provide statement would say seq-24

- It wouldn't have the package pseudo-headers (no version number, no
  keywords, etc).

The file seq-25.el would have the exact same contents as the current
seq-2.x we have in Emacs except:

- The file-header and the provide statement would say seq-25

- It wouldn't have the package pseudo-headers (no version number, no
  keywords, etc).

This way there is only one version of the seq package. Packages that
want some recent functionality added in minor-version 12 can simply
depend on 2.12, regardless of the Emacs version.  Also, packages that
want the generics functionality can simply depend on (seq "2.12") and on
(emacs "25").

The problem with this solution is that we'd get tons of byte-compilation
warnings, becaus even if seq-25.el is never used with Emacs 24.x, it
will get byte-compiled.

We were wondering if there would be a way to prevent byte-compilation
only on some emacs versions, or if someone have a better solution to the
problem.

Cheers,
Nico
-- 
Nicolas Petton
http://nicolas-petton.fr

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

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

* Re: Upcoming seq.el version problem with the Emacs release
  2016-02-16 13:32 Upcoming seq.el version problem with the Emacs release Nicolas Petton
@ 2016-02-20  6:24 ` John Wiegley
  2016-02-20 18:30   ` Nicolas Petton
  0 siblings, 1 reply; 11+ messages in thread
From: John Wiegley @ 2016-02-20  6:24 UTC (permalink / raw
  To: Nicolas Petton; +Cc: Artur Malabarba, emacs-devel

>>>>> Nicolas Petton <nicolas@petton.fr> writes:

> We have been discussing with Artur an issue that will appear with seq.el
> once we'll have Emacs 25.1 out.

Hi Nicolas, what is the current status on this issue?

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2



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

* Re: Upcoming seq.el version problem with the Emacs release
  2016-02-20  6:24 ` John Wiegley
@ 2016-02-20 18:30   ` Nicolas Petton
  2016-03-15 21:46     ` Nicolas Petton
  0 siblings, 1 reply; 11+ messages in thread
From: Nicolas Petton @ 2016-02-20 18:30 UTC (permalink / raw
  To: John Wiegley; +Cc: Artur Malabarba, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 208 bytes --]

John Wiegley <jwiegley@gmail.com> writes:

> Hi Nicolas, what is the current status on this issue?

It hasn't progressed at all.  However, this issue will affect seq.el in
ELPA only, not in Emacs 25.1.

Nico

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

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

* Re: Upcoming seq.el version problem with the Emacs release
  2016-02-20 18:30   ` Nicolas Petton
@ 2016-03-15 21:46     ` Nicolas Petton
  2016-03-19 17:44       ` Bozhidar Batsov
  0 siblings, 1 reply; 11+ messages in thread
From: Nicolas Petton @ 2016-03-15 21:46 UTC (permalink / raw
  To: John Wiegley; +Cc: Artur Malabarba, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 246 bytes --]

John Wiegley <jwiegley@gmail.com> writes:

> Hi Nicolas, what is the current status on this issue?

I'm still wondering if there's a way to prevent byte-compilation based
on the version of Emacs.

Does anyone know if that's doable?

Cheers,
Nico

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

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

* Re: Upcoming seq.el version problem with the Emacs release
  2016-03-15 21:46     ` Nicolas Petton
@ 2016-03-19 17:44       ` Bozhidar Batsov
  2016-03-20 10:15         ` Nicolas Petton
  0 siblings, 1 reply; 11+ messages in thread
From: Bozhidar Batsov @ 2016-03-19 17:44 UTC (permalink / raw
  To: Nicolas Petton; +Cc: John Wiegley, Artur Malabarba, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 191 bytes --]

I might be missing something here, but what exactly is so problematic -
there are packages that are in Emacs and on ELPA (e.g. cl-lib) and I don't
think they are taking any special measures.

[-- Attachment #2: Type: text/html, Size: 279 bytes --]

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

* Re: Upcoming seq.el version problem with the Emacs release
  2016-03-19 17:44       ` Bozhidar Batsov
@ 2016-03-20 10:15         ` Nicolas Petton
  2016-03-20 14:20           ` Bozhidar Batsov
                             ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Nicolas Petton @ 2016-03-20 10:15 UTC (permalink / raw
  To: Bozhidar Batsov; +Cc: John Wiegley, Artur Malabarba, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 860 bytes --]

Bozhidar Batsov <bozhidar@batsov.com> writes:

> I might be missing something here, but what exactly is so problematic -
> there are packages that are in Emacs and on ELPA (e.g. cl-lib) and I don't
> think they are taking any special measures.

The problem is that seq.el (in Emacs) uses `pcase-defmacro', which does
not exist in Emacs 24.5.  When byte-compiling the file, we get warnings
as the byte compiler will think that `pcase-defmacro' is a function.

The solution I'm going for is to define locally the macro (when
byte-compiling the file in Emacs < 25), using something like the
following:

    (push `(pcase-defmacro . ,(lambda (&rest _) nil))
          byte-compile-macro-environment)

You can read more about the issue here:
https://github.com/NicolasPetton/seq.el/issues/7

Nico
-- 
Nicolas Petton
http://nicolas-petton.fr

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

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

* Re: Upcoming seq.el version problem with the Emacs release
  2016-03-20 10:15         ` Nicolas Petton
@ 2016-03-20 14:20           ` Bozhidar Batsov
  2016-03-20 20:35           ` Michael Heerdegen
  2016-03-21 13:33           ` Stefan Monnier
  2 siblings, 0 replies; 11+ messages in thread
From: Bozhidar Batsov @ 2016-03-20 14:20 UTC (permalink / raw
  To: Nicolas Petton; +Cc: John Wiegley, Artur Malabarba, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 991 bytes --]

Ah, now I get it. Thanks for the info!

On 20 March 2016 at 12:15, Nicolas Petton <nicolas@petton.fr> wrote:

> Bozhidar Batsov <bozhidar@batsov.com> writes:
>
> > I might be missing something here, but what exactly is so problematic -
> > there are packages that are in Emacs and on ELPA (e.g. cl-lib) and I
> don't
> > think they are taking any special measures.
>
> The problem is that seq.el (in Emacs) uses `pcase-defmacro', which does
> not exist in Emacs 24.5.  When byte-compiling the file, we get warnings
> as the byte compiler will think that `pcase-defmacro' is a function.
>
> The solution I'm going for is to define locally the macro (when
> byte-compiling the file in Emacs < 25), using something like the
> following:
>
>     (push `(pcase-defmacro . ,(lambda (&rest _) nil))
>           byte-compile-macro-environment)
>
> You can read more about the issue here:
> https://github.com/NicolasPetton/seq.el/issues/7
>
> Nico
> --
> Nicolas Petton
> http://nicolas-petton.fr
>

[-- Attachment #2: Type: text/html, Size: 1708 bytes --]

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

* Re: Upcoming seq.el version problem with the Emacs release
  2016-03-20 10:15         ` Nicolas Petton
  2016-03-20 14:20           ` Bozhidar Batsov
@ 2016-03-20 20:35           ` Michael Heerdegen
  2016-03-21  8:39             ` Nicolas Petton
  2016-03-21 13:33           ` Stefan Monnier
  2 siblings, 1 reply; 11+ messages in thread
From: Michael Heerdegen @ 2016-03-20 20:35 UTC (permalink / raw
  To: emacs-devel

Nicolas Petton <nicolas@petton.fr> writes:

>     (push `(pcase-defmacro . ,(lambda (&rest _) nil))
>           byte-compile-macro-environment)


Would this work?


(defmacro seq--when-pcase-defmacro-defined (&rest body)
  (when (fboundp 'pcase-defmacro)
    `(progn ,@body)))

(seq--when-pcase-defmacro-defined
  { your seq pcase pattern definitions here })


Note that the fboundp test is done at compile time.


Michael.




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

* Re: Upcoming seq.el version problem with the Emacs release
  2016-03-20 20:35           ` Michael Heerdegen
@ 2016-03-21  8:39             ` Nicolas Petton
  0 siblings, 0 replies; 11+ messages in thread
From: Nicolas Petton @ 2016-03-21  8:39 UTC (permalink / raw
  To: Michael Heerdegen, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 478 bytes --]

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Nicolas Petton <nicolas@petton.fr> writes:
>
>>     (push `(pcase-defmacro . ,(lambda (&rest _) nil))
>>           byte-compile-macro-environment)
>
>
> Would this work?
>
>
> (defmacro seq--when-pcase-defmacro-defined (&rest body)
>   (when (fboundp 'pcase-defmacro)
>     `(progn ,@body)))
>
> (seq--when-pcase-defmacro-defined
>   { your seq pcase pattern definitions here })

I'll give it a try, thanks Michael!

Nico

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

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

* Re: Upcoming seq.el version problem with the Emacs release
  2016-03-20 10:15         ` Nicolas Petton
  2016-03-20 14:20           ` Bozhidar Batsov
  2016-03-20 20:35           ` Michael Heerdegen
@ 2016-03-21 13:33           ` Stefan Monnier
  2016-03-21 13:45             ` Nicolas Petton
  2 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2016-03-21 13:33 UTC (permalink / raw
  To: emacs-devel

> The problem is that seq.el (in Emacs) uses `pcase-defmacro', which does
> not exist in Emacs 24.5.  When byte-compiling the file, we get warnings
> as the byte compiler will think that `pcase-defmacro' is a function.

Is that really the only problem?

I thought the main problem was that GNU ELPA's seq.el can't use
cl-defgeneric since GNU-ELPA's cl-generic can only dispatch on
EIEIO types.

As for preventing byte-compilation, yes indeed you can and I've done
that a few times recently.  See for example dts--using-macro in the
dts-mode package (in GNU ELPA).
See also TeX--if-macro-fboundp in auctex's tex.el.


        Stefan




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

* Re: Upcoming seq.el version problem with the Emacs release
  2016-03-21 13:33           ` Stefan Monnier
@ 2016-03-21 13:45             ` Nicolas Petton
  0 siblings, 0 replies; 11+ messages in thread
From: Nicolas Petton @ 2016-03-21 13:45 UTC (permalink / raw
  To: Stefan Monnier, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 966 bytes --]

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

>> The problem is that seq.el (in Emacs) uses `pcase-defmacro', which does
>> not exist in Emacs 24.5.  When byte-compiling the file, we get warnings
>> as the byte compiler will think that `pcase-defmacro' is a function.
>
> Is that really the only problem?

We'd get byte-compilation warnings.  Maybe that's something we can live
with, but since it's easy enough to fix, now that I know how to do it,
I'd rather make sure that we don't get any warning in Emacs 24.5.

> I thought the main problem was that GNU ELPA's seq.el can't use
> cl-defgeneric since GNU-ELPA's cl-generic can only dispatch on
> EIEIO types.

No, that's a limitation I'm ok with.

> As for preventing byte-compilation, yes indeed you can and I've done
> that a few times recently.  See for example dts--using-macro in the
> dts-mode package (in GNU ELPA).
> See also TeX--if-macro-fboundp in auctex's tex.el.

Thanks for the pointers!

Nico

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

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

end of thread, other threads:[~2016-03-21 13:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-16 13:32 Upcoming seq.el version problem with the Emacs release Nicolas Petton
2016-02-20  6:24 ` John Wiegley
2016-02-20 18:30   ` Nicolas Petton
2016-03-15 21:46     ` Nicolas Petton
2016-03-19 17:44       ` Bozhidar Batsov
2016-03-20 10:15         ` Nicolas Petton
2016-03-20 14:20           ` Bozhidar Batsov
2016-03-20 20:35           ` Michael Heerdegen
2016-03-21  8:39             ` Nicolas Petton
2016-03-21 13:33           ` Stefan Monnier
2016-03-21 13:45             ` Nicolas Petton

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.