all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Strange requirement...
@ 2006-07-24  6:54 David Kastrup
  2006-07-24 21:50 ` Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: David Kastrup @ 2006-07-24  6:54 UTC (permalink / raw)



Hi,

in
(info "(elisp) Common Keywords.")

we have

`:package-version '(PACKAGE . VERSION)'
     This option specifies that the item was first introduced in
     PACKAGE version VERSION, or that its default value was changed in
     that version.  This keyword takes priority over :version.  The
     value of PACKAGE is a symbol and VERSION is a string.  The PACKAGE
     and VERSION must appear in the alist
     `customize-package-emacs-version-alist'.  Since PACKAGE must be
     unique and the user might see it in an error message, a good choice
     is the official name of the package, such as MH-E or Gnus.


   Packages that use the `:package-version' keyword must also update
the `customize-package-emacs-version-alist' variable.

 -- Variable: customize-package-emacs-version-alist
     This alist provides a mapping for the versions of Emacs that are
     associated with versions of a package listed in the
     `:package-version' keyword.  Its elements look like this:

          (PACKAGE (PVERSION . EVERSION)...)

     For each PACKAGE, which is a symbol, there are one or more
     elements that contain a package version PVERSION with an
     associated Emacs version EVERSION.  These versions are strings.
     For example, the MH-E package updates this alist with the
     following:

          (add-to-list 'customize-package-emacs-version-alist
                       '(MH-E ("6.0" . "22.1") ("6.1" . "22.1") ("7.0" . "22.1")
                              ("7.1" . "22.1") ("7.2" . "22.1") ("7.3" . "22.1")
                              ("7.4" . "22.1") ("8.0" . "22.1")))

     The value of PACKAGE needs to be unique and it needs to match the
     PACKAGE value appearing in the `:package-version' keyword.  Since
     the user might see the value in a error message, a good choice is
     the official name of the package, such as MH-E or Gnus.

[...]

This gives, however, no clue about how to deal with declaring versions
of an external package that is _not_ distributed as part of Emacs
(notably AUCTeX).

I think the reasonable behavior would be to just use :package-version
like described, but not add anything to
customize-package-emacs-version-alist, since there is nothing useful
to add there.

Would that lead to reasonable behavior?  If yes, I think we should
document it.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: Strange requirement...
  2006-07-24  6:54 Strange requirement David Kastrup
@ 2006-07-24 21:50 ` Richard Stallman
  2006-07-25  7:29   ` David Kastrup
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Stallman @ 2006-07-24 21:50 UTC (permalink / raw)
  Cc: emacs-devel

    This gives, however, no clue about how to deal with declaring versions
    of an external package that is _not_ distributed as part of Emacs
    (notably AUCTeX).

You just follow the instructions for :package-version.
They seem clear to me.  If you don't find them clear,
could you explain why?

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

* Re: Strange requirement...
  2006-07-24 21:50 ` Richard Stallman
@ 2006-07-25  7:29   ` David Kastrup
  2006-07-25 22:15     ` Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: David Kastrup @ 2006-07-25  7:29 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     This gives, however, no clue about how to deal with declaring versions
>     of an external package that is _not_ distributed as part of Emacs
>     (notably AUCTeX).
>
> You just follow the instructions for :package-version.
> They seem clear to me.  If you don't find them clear,
> could you explain why?

The last sentence of the :package-version description states:

   Packages that use the `:package-version' keyword must also update
the `customize-package-emacs-version-alist' variable.

And the immediately following description states:

 -- Variable: customize-package-emacs-version-alist
     This alist provides a mapping for the versions of Emacs that are
     associated with versions of a package listed in the
     `:package-version' keyword.  Its elements look like this:

          (PACKAGE (PVERSION . EVERSION)...)

     For each PACKAGE, which is a symbol, there are one or more
     elements that contain a package version PVERSION with an
     associated Emacs version EVERSION.

But for an external package, there is no associated Emacs version, so
there is no point or sense in updating
`customize-package-emacs-version-alist'.

So I think that the last sentence in the :package-version description
should be something like:

   Packages that use the `:package-version' keyword with versions that
   have been distributed as part of Emacs must also update the
   `customize-package-emacs-version-alist' variable.

     For example, the MH-E package updates this alist with the
     following:

          (add-to-list 'customize-package-emacs-version-alist
                       '(MH-E ("6.0" . "22.1") ("6.1" . "22.1") ("7.0" . "22.1")
                              ("7.1" . "22.1") ("7.2" . "22.1") ("7.3" . "22.1")
                              ("7.4" . "22.1") ("8.0" . "22.1")))


And the passage before should probably be something like:

`:package-version '(PACKAGE . VERSION)'
     This option specifies that the item was first introduced in
     PACKAGE version VERSION, or that its default value was changed in
     that version.  This keyword takes priority over :version.  The
     value of PACKAGE is a symbol and VERSION is a string.  If any
     VERSION of PACKAGE has been distributed as part of Emacs, the
     combination of PACKAGE and VERSION must appear in the alist
     `customize-package-emacs-version-alist'.  Since PACKAGE must be
     unique and the user might see it in an error message, a good choice
     is the official name of the package, such as MH-E or Gnus.

Note that this is just my _guess_ as how to treat this sensibly.  I
don't know whether the actual code will complain if it can't find a
given package and version in `customize-package-emacs-version-alist'.

If it does, I think it should likely be changed to match the behavior
I described.  But as it stands, the instructions for :package-version
can't be heeded for packages not distributed as part of Emacs.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: Strange requirement...
  2006-07-25  7:29   ` David Kastrup
@ 2006-07-25 22:15     ` Richard Stallman
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Stallman @ 2006-07-25 22:15 UTC (permalink / raw)
  Cc: emacs-devel

    The last sentence of the :package-version description states:

       Packages that use the `:package-version' keyword must also update
    the `customize-package-emacs-version-alist' variable.

Ok, now I see the issue.  It looks like the code was designed to assume
that :package-version will only be used for packages released in Emacs.
But clearly we should generalize it, so I wrote this patch for the code.
I will update the manual too.


*** cus-edit.el	17 Jul 2006 18:04:31 -0400	1.297
--- cus-edit.el	25 Jul 2006 15:35:01 -0400	
***************
*** 1087,1104 ****
  ;; Packages will update this variable, so make it available.
  ;;;###autoload
  (defvar customize-package-emacs-version-alist nil
!   "Alist mapping versions of Emacs to versions of a package.
! These package versions are listed in the :package-version
! keyword used in `defcustom', `defgroup', and `defface'. Its
! elements look like this:
  
       (PACKAGE (PVERSION . EVERSION)...)
  
! For each PACKAGE, which is a symbol, there are one or more
! elements that contain a package version PVERSION with an
! associated Emacs version EVERSION.  These versions are strings.
! For example, the MH-E package updates this alist with the
! following:
  
       (add-to-list 'customize-package-emacs-version-alist
                    '(MH-E (\"6.0\" . \"22.1\") (\"6.1\" . \"22.1\")
--- 1087,1110 ----
  ;; Packages will update this variable, so make it available.
  ;;;###autoload
  (defvar customize-package-emacs-version-alist nil
!   "Alist mapping versions of a package to Emacs versions.
! We use this for packages that have their own names, but are released
! as part of Emacs itself.
! 
! Each elements looks like this:
  
       (PACKAGE (PVERSION . EVERSION)...)
  
! Here PACKAGE is the name of a package, as a symbol.  After
! PACKAGE come one or more elements, each associating a
! package version PVERSION with the first Emacs version
! EVERSION in which it (or a subsequent version of PACKAGE)
! was first released.  Both PVERSION and EVERSION are strings.
! PVERSION should be a string that this package used in
! the :package-version keyword for `defcustom', `defgroup',
! and `defface'.
! 
! For example, the MH-E package updates this alist as follows:
  
       (add-to-list 'customize-package-emacs-version-alist
                    '(MH-E (\"6.0\" . \"22.1\") (\"6.1\" . \"22.1\")
***************
*** 1173,1183 ****
  	     since-version))))
  
  (defun customize-package-emacs-version (symbol package-version)
!   "Return Emacs version of SYMBOL.
! PACKAGE-VERSION has the form (PACKAGE . VERSION).  The VERSION of
! PACKAGE is looked up in the associated list
  `customize-package-emacs-version-alist' to find the version of
! Emacs that is associated with it."
    (let (package-versions emacs-version)
      ;; Use message instead of error since we want user to be able to
      ;; see the rest of the symbols even if a package author has
--- 1179,1188 ----
  	     since-version))))
  
  (defun customize-package-emacs-version (symbol package-version)
!   "Return the Emacs version in which SYMBOL's meaning last changed.
! PACKAGE-VERSION has the form (PACKAGE . VERSION).  We use
  `customize-package-emacs-version-alist' to find the version of
! Emacs that is associated with version VERSION of PACKAGE."
    (let (package-versions emacs-version)
      ;; Use message instead of error since we want user to be able to
      ;; see the rest of the symbols even if a package author has
***************
*** 1193,1201 ****
                        (cdr package-version)
                        "customize-package-emacs-version-alist")))
            (t
!            (message "Package %s neglected to update %s"
                      (car package-version)
!                     "customize-package-emacs-version-alist")))
      emacs-version))
  
  (defun customize-version-lessp (version1 version2)
--- 1198,1206 ----
                        (cdr package-version)
                        "customize-package-emacs-version-alist")))
            (t
!            (message "Package %s version %s lists no corresponding Emacs version"
                      (car package-version)
!                     (cdr package-version))))
      emacs-version))
  
  (defun customize-version-lessp (version1 version2)

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

end of thread, other threads:[~2006-07-25 22:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-24  6:54 Strange requirement David Kastrup
2006-07-24 21:50 ` Richard Stallman
2006-07-25  7:29   ` David Kastrup
2006-07-25 22:15     ` Richard Stallman

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.