unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [nongnu] elpa/cider ff1de2bd22: [#3113] Hardcode cider-version as a workaround
       [not found] ` <20211229070213.6826CC002EE@vcs2.savannah.gnu.org>
@ 2021-12-29  7:32   ` Stefan Monnier
  2021-12-29  7:50     ` Bozhidar Batsov
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2021-12-29  7:32 UTC (permalink / raw)
  To: Bozhidar Batsov; +Cc: emacs-devel

>     [#3113] Hardcode cider-version as a workaround
>     
>     I can't figure out why the auto-extraction of the version doesn't work.
[...]
> -(defconst cider-version
> -  (lm-version (or load-file-name buffer-file-name))
> +(defconst cider-version "1.2.0"
>    "The current version of CIDER.")

I suspect the problem may be that `load-file-name` will point at
`cider.elc` where `lm-version` won't find what you need.

You can try and use `package-get-version` (new in Emacs-27) which tries
to get this working.


        Stefan




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

* Re: [nongnu] elpa/cider ff1de2bd22: [#3113] Hardcode cider-version as a workaround
  2021-12-29  7:32   ` [nongnu] elpa/cider ff1de2bd22: [#3113] Hardcode cider-version as a workaround Stefan Monnier
@ 2021-12-29  7:50     ` Bozhidar Batsov
  2021-12-29 18:45       ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Bozhidar Batsov @ 2021-12-29  7:50 UTC (permalink / raw)
  To: Emacs Devel

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

I'm already using `package-get-version` as well, but in case they install from MELPA there's a divergence in the version that I wanted to account for, as MELPA replaces the "real" package version (e.g. 1.2) with a build timestamp. So I end up displaying to the users something like "Version 1.2.0-snapshot (package: 20211219...)" in those cases. Makes it easier for me to debug issues related to snapshot builds. Anyways, thanks a lot for the help!    

On Wed, Dec 29, 2021, at 9:32 AM, Stefan Monnier wrote:
> >     [#3113] Hardcode cider-version as a workaround
> >     
> >     I can't figure out why the auto-extraction of the version doesn't work.
> [...]
> > -(defconst cider-version
> > -  (lm-version (or load-file-name buffer-file-name))
> > +(defconst cider-version "1.2.0"
> >    "The current version of CIDER.")
> 
> I suspect the problem may be that `load-file-name` will point at
> `cider.elc` where `lm-version` won't find what you need.
> 
> You can try and use `package-get-version` (new in Emacs-27) which tries
> to get this working.
> 
> 
>         Stefan
> 
> 
> 

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

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

* Re: [nongnu] elpa/cider ff1de2bd22: [#3113] Hardcode cider-version as a workaround
  2021-12-29  7:50     ` Bozhidar Batsov
@ 2021-12-29 18:45       ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2021-12-29 18:45 UTC (permalink / raw)
  To: Bozhidar Batsov; +Cc: Emacs Devel

> I'm already using `package-get-version` as well, but in case they install
> from MELPA there's a divergence in the version that I wanted to account for,
> as MELPA replaces the "real" package version (e.g. 1.2) with a build
> timestamp. So I end up displaying to the users something like "Version
> 1.2.0-snapshot (package: 20211219...)" in those cases. Makes it easier for
> me to debug issues related to snapshot builds. Anyways, thanks a lot for
> the help!

Right if you want to circumvent MELPA's version numbers, then you can't
just use `package-get-version`.  But you can probably steal ideas from
the code of `package-get-version` (maybe the cutest of them is to mark the
function as `pure` so it's computed during compilation) and
`macroexp-file-name` (tho this last one benefited from accompanying
changes in various "core" parts (like bytecomp.el) to make the info
available in a more convenient and robust way).


        Stefan




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

end of thread, other threads:[~2021-12-29 18:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <164076133315.20367.12022941883015497813@vcs2.savannah.gnu.org>
     [not found] ` <20211229070213.6826CC002EE@vcs2.savannah.gnu.org>
2021-12-29  7:32   ` [nongnu] elpa/cider ff1de2bd22: [#3113] Hardcode cider-version as a workaround Stefan Monnier
2021-12-29  7:50     ` Bozhidar Batsov
2021-12-29 18:45       ` Stefan Monnier

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).