all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: no-spam@cua.dk (Kim F. Storm)
Subject: Can we add a check to see if user is using old or obsolete code?
Date: 20 Feb 2003 22:03:13 +0100	[thread overview]
Message-ID: <5xfzqibr72.fsf@kfs2.cua.dk> (raw)


I have a specific problem with CUA-mode in CVS head, but the solution
might be useful for other packages as well.

Many users of emacs 20.7 or 21.1 or 21.2 have fetched the cua.el
package from my web site, and installed it according to the
instructions found in that file, i.e. they have included the
following lines in their .emacs file:

   (require 'cua)  
        ;; or (require 'cua-mode)
        ;; or (load "cua-mode")
   (CUA-mode t)


Now, emacs 21.4 includes a newer version of CUA-mode, and the old
version actually doesn't work very well with 21.4 (due to changes in
the way the key-translation-map works).  So if a user upgrade from,
say, 21.2 with the old version of cua.el in the load-path to release
21.4, CUA-mode will appear to be broken, but there is no indication
that anything is wrong.

So, the problem is: 

When a user upgrades to 21.4 (once it is released), can we prevent the
loading and activation of the old cua-mode package (which is most
likely still in the user's load-path).

Actually, I don't see how it would be possible to prevent loading and
activation of the obsolete (and non-functioning) CUA-mode.  But it
would be a good service to the user if emacs would at least warn the
user that he is using an obsolete package, and recommend that he
should use the included version instead.

I suggest that we create a new hook, `check-compat-hook', which is run
at the end of `normal-top-level' (i.e. after all normal user-setup
actions have been performed).

Packages which need to check that the user doesn't use an obsolete
version of the package may then use a suitable block of autoloads
like this:

;;;###autoload (defun XXX-compat-check ()
;;;###autoload   (if (boundp 'XXX-some-obsolete-var)
;;;###autoload     (error "You are using an obsolete version of XXX.")))
;;;###autoload (add-hook 'check-compat-hook 'XXX-compat-check)

WDYT?

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

             reply	other threads:[~2003-02-20 21:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-20 21:03 Kim F. Storm [this message]
2003-02-20 20:26 ` Can we add a check to see if user is using old or obsolete code? Stefan Monnier
2003-02-20 22:04   ` Kim F. Storm
2003-02-21 21:44   ` Richard Stallman
2003-02-21 23:20     ` Kim F. Storm
2003-02-22  0:28       ` Miles Bader
2003-02-22 22:37         ` Kim F. Storm
2003-02-22 17:54       ` Richard Stallman
2003-02-20 21:29 ` Kai Großjohann
2003-02-21  0:35   ` Kim F. Storm
2003-02-21 16:41     ` Kai Großjohann
2003-02-22  8:15   ` Richard Stallman
2003-02-23 11:06     ` Kai Großjohann
2003-02-24 16:38       ` Richard Stallman

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

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

  git send-email \
    --in-reply-to=5xfzqibr72.fsf@kfs2.cua.dk \
    --to=no-spam@cua.dk \
    /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 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.