help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: auth-source multiple accounts


From: Ted Zlatanov
Subject: Re: auth-source multiple accounts
Date: Wed, 08 Dec 2010 15:21:27 -0000
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

On Tue, 27 Jul 2010 22:35:41 +0100 Uday S Reddy <uDOTsDOTreddy@cs.bham.ac.uk> 
wrote: 

USR> However, there is another problem.  (Sorry to be bringing up so many 
problems:-(

USR> I suppose auth-source is part of the Gnus distribution.  Am I
USR> right?

It's also part of Emacs, synchronized often.  It only exists in Gnus and
Emacs AFAIK.

USR> So, people are going to be using different versions of auth-source,
USR> obtained via the Gnus distribution, FSF distribution and XEmacs
USR> distribution (not to mention other independent distros).  It will take
USR> years for all of these distributions to converge.

USR> So, I won't be able to use the new version of
USR> auth-source-user-or-password in VM until I can be sure that all our
USR> users have retired the old version.  Sounds terrible, doesn't it?
USR> When we deal with independent distributions, it appears that
USR> backward-compatibility is not enough; forward-compatibility is also
USR> needed.

USR> One solution is to add a new function instead of adding an optional
USR> parameter to the existing function.  Then I can test to see if the new
USR> function exists and use the querying functionality if it does.

auth-source.el (specifically, auth-source-user-or-password) will work
either way.  The new query parameter is optional so at worst the user
will get the wrong password.  There will be no error.  So you don't have
to give up on old versions.  Just warn the user that the account won't
be part of the lookup.

I can add auth-source-version and you can assume that if it's missing
the version is 0.0.0.  I should have done this from the start, sorry.
Patterned after gnus-version* and using http://semver.org/ semantic
versioning:

(defconst auth-source-version "1.0.0"
  "Version number for this version of auth-source.el.  See http://semver.org/.";)

(defconst auth-source-version (format "auth-source.el v%s" auth-source-version)
  "Version string for this version of auth-source.el.  See http://semver.org/.";)

(defun auth-source-version (&optional arg)
  "Version number of this version of auth-source.el.
If ARG, insert string at point.  See http://semver.org/.";
  (interactive "P")
  (if arg
      (insert (message auth-source-version))
    (message auth-source-version)))

Does that work for you?

Ted
 


reply via email to

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