unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Bozhidar Batsov <bozhidar.batsov@gmail.com>
To: Sebastian Wiesner <swiesner@lunaryorn.com>, emacs-devel@gnu.org
Subject: Re: subr-x on older Emacsen
Date: Fri, 18 Jul 2014 15:21:59 +0300	[thread overview]
Message-ID: <etPan.53c91167.628c895d.daeb@Bozhidars-MacBook-Pro.local> (raw)
In-Reply-To: <47A003F9-F2D7-454C-B148-31A6C2D46C1F@lunaryorn.com>

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

On July 15, 2014 at 4:09:27 PM, Sebastian Wiesner (swiesner@lunaryorn.com) wrote:
Hello, 

I’d like to use the new subr-x library in my Emacs Lisp projects, and I’m searching for advice on how to handle backwards compatibility. 

As you know, subr-x was only recently introduced in Emacs trunk, and is not available in any Emacs release. Currently, I simply copy those functions that I need into my code, guarding their definition with `(unless (features 'subr-x) …)'. 

This scales poorly across many projects, obviously, so I’d like to know if there is a better approach to handle this problem. Is their a compatibility package for subr-x on GNU ELPA, similar to cl-lib? 

While this could be done, there a few caveats:

* subr-x should be considered a built-in package
* newer version might have less functions than older one as ideally parts of subr-x will be promoted to subr
* the compatibility package should check for the presence of each function prior to defining it (follows from the previous bullet point)

Of course, this is part of a much bigger issue as things get constantly added to various Emacs libraries and using them and staying backwards compatible is always problematic. I don’t think we need a subr-x backwards compatibility package, we need an Emacs backwards compatibility package. Perhaps it would include stuff from a few past releases and define the things conditionally if not present?



Greetings, 
Sebastian Wiesner 

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

  reply	other threads:[~2014-07-18 12:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-15 13:08 subr-x on older Emacsen Sebastian Wiesner
2014-07-18 12:21 ` Bozhidar Batsov [this message]
2014-07-18 15:54   ` Stefan Monnier
2014-07-18 16:16     ` Sebastian Wiesner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=etPan.53c91167.628c895d.daeb@Bozhidars-MacBook-Pro.local \
    --to=bozhidar.batsov@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=swiesner@lunaryorn.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).