invalid version syntax 8.3.2c #141

Closed
jaydixit opened this Issue Nov 20, 2013 · 10 comments

Comments

Projects
None yet
4 participants

Upgraded to the newest org.

When I try to call org2blog I'm getting this:

Debugger entered--Lisp error: (error "Invalid version syntax: '8.2.3c'")
signal(error ("Invalid version syntax: '8.2.3c'"))
ad-Orig-error("Invalid version syntax: '%s'" "8.2.3c")
apply(ad-Orig-error ("Invalid version syntax: '%s'" "8.2.3c"))
error("Invalid version syntax: '%s'" "8.2.3c")
version-to-list("8.2.3c")
(version-list-< (version-to-list (org-version)) (quote (8 0 0)))
(if (version-list-< (version-to-list ...) (quote ...)) nil (require (quote ox)))
(unless (version-list-< (version-to-list ...) (quote ...)) (require (quote ox)))
eval-buffer(#<buffer load> nil "/Users/jay/Library/Application Support/Aquamacs Emacs/elpa/org2blog-20130704.908/org2blog.el" nil t) ; Reading at buffer position 2468
load-with-code-conversion("/Users/jay/Library/Application Support/Aquamacs Emacs/elpa/org2blog-20130704.908/org2blog.el" "/Users/jay/Library/Application Support/Aquamacs Emacs/elpa/org2blog-20130704.908/org2blog.el" nil t)
(org2blog/wp-mode)
gf()
call-interactively(gf record nil)
command-execute(gf record)
smex-read-and-run(("org-version" "gf" "cyberpunk" "org-mode" "widen" "load-theme" "unfill-region" "replace-regexp" "customize-group" "customize-face" "incarnadine-cursor" "color-theme-select" "load-file" "rgrep" "abbrev-mode" "org2blog/wp-login" "clone-indirect-buffer" "jabber-connect" "markdown-mode" "package-install" "package-list-packages" "auto-capitalize-mode" "org-bullets-mode" "rename-file-and-buffer" "scroll-bar-mode" "customize-mode" "multi-occur" "search-forward-regexp" "calc" "mail-region" "query-replace" "org-indent-mode" "delete-file" "text-mode" "message-mode" "emacs-version" "org-store-link" "regexp-builder" "twit" "shell" "eshell" "tramp-cleanup-all-buffers" "whitespace-mode" "html-helper-mode" "jabber-customize" "save-some-buffers" "org2blog/wp-new-entry" "tramp-cleanup-all-connections" "org-mac-chrome-get-frontmost-url" "clone-indirect-buffer-other-window" ...))
smex()
(lambda nil (interactive) (or (boundp ...) (smex-initialize)) (global-set-key [...](quote smex)) (smex))()
call-interactively((lambda nil (interactive) (or (boundp ...) (smex-initialize)) (global-set-key [...](quote smex)) (smex)) nil nil)

Collaborator

titaniumbones commented Nov 22, 2013

This looks like a bug in version-to-list. On my machine it parses the
latest org-version without an error. what version of emas are you
using?

I'm using version 23.4.1. (Aquamacs distribution 2.5.)


Jay Dixit
jaydixit.com
newyorkwritersintensive.com
(646) 355-8001
fol­low @jaydixit https://twitter.com/jaydixit/
Jay Dixit

On Fri, Nov 22, 2013 at 1:17 PM, Matt Price notifications@github.comwrote:

This looks like a bug in version-to-list. On my machine it parses the
latest org-version without an error. what version of emas are you
using?


Reply to this email directly or view it on GitHubhttps://github.com/punchagan/org2blog/issues/141#issuecomment-29110053
.

Collaborator

titaniumbones commented Nov 23, 2013

Do you get the same error evaluating

(version-to-list (org-version))

and what about

(version-to-list "8.2.3c")

If so, I do think the problem is in version-to-list. I don't know what
to do about that. Maybe we can compare source code for that function
in our two emacsen. Here's mine:

(defun version-to-list (ver)
  "Convert version string VER into a list of integers.

The version syntax is given by the following EBNF:

   VERSION ::= NUMBER ( SEPARATOR NUMBER )*.

   NUMBER ::= (0|1|2|3|4|5|6|7|8|9)+.

   SEPARATOR ::= `version-separator' (which see)
           | `version-regexp-alist' (which see).

The NUMBER part is optional if SEPARATOR is a match for an element
in `version-regexp-alist'.

Examples of valid version syntax:

   1.0pre2   1.0.7.5   22.8beta3   0.9alpha1   6.9.30Beta

Examples of invalid version syntax:

   1.0prepre2   1.0..7.5   22.8X3   alpha3.2   .5

Examples of version conversion:

   Version String    Version as a List of Integers
   \"1.0.7.5\"         (1  0  7 5)
   \"1.0pre2\"         (1  0 -1 2)
   \"1.0PRE2\"         (1  0 -1 2)
   \"22.8beta3\"       (22 8 -2 3)
   \"22.8Beta3\"       (22 8 -2 3)
   \"0.9alpha1\"       (0  9 -3 1)
   \"0.9AlphA1\"       (0  9 -3 1)
   \"0.9alpha\"        (0  9 -3)

See documentation for `version-separator' and `version-regexp-alist'."
  (or (and (stringp ver) (> (length ver) 0))
      (error "Invalid version string: '%s'" ver))
  ;; Change .x.y to 0.x.y
  (if (and (>= (length ver) (length version-separator))
       (string-equal (substring ver 0 (length version-separator))
             version-separator))
      (setq ver (concat "0" ver)))
  (save-match-data
    (let ((i 0)
      (case-fold-search t)      ; ignore case in matching
      lst s al)
      (while (and (setq s (string-match "[0-9]+" ver i))
          (= s i))
    ;; handle numeric part
    (setq lst (cons (string-to-number (substring ver i (match-end 0)))
            lst)
          i   (match-end 0))
    ;; handle non-numeric part
    (when (and (setq s (string-match "[^0-9]+" ver i))
           (= s i))
      (setq s (substring ver i (match-end 0))
        i (match-end 0))
      ;; handle alpha, beta, pre, etc. separator
      (unless (string= s version-separator)
        (setq al version-regexp-alist)
        (while (and al (not (string-match (caar al) s)))
          (setq al (cdr al)))
        (cond (al
           (push (cdar al) lst))
          ;; Convert 22.3a to 22.3.1, 22.3b to 22.3.2, etc.
          ((string-match "^[-_+ ]?\\([a-zA-Z]\\)$" s)
           (push (- (aref (downcase (match-string 1 s)) 0) ?a -1)
             lst))
          (t (error "Invalid version syntax: '%s'" ver))))))
      (if (null lst)
      (error "Invalid version syntax: '%s'" ver)
    (nreverse lst)))))

that's in subr.el, in emacs 24.3.50.1 notice the final (cond (al
(push)) ((string-match...
I think that's where the difference would be.

On Fri 22 Nov 2013 07:43:14 PM EST, Jay Dixit wrote:

I'm using version 23.4.1. (Aquamacs distribution 2.5.)


Jay Dixit
jaydixit.com
newyorkwritersintensive.com
(646) 355-8001
fol­low @jaydixit https://twitter.com/jaydixit/
Jay Dixit

On Fri, Nov 22, 2013 at 1:17 PM, Matt Price notifications@github.comwrote:

This looks like a bug in version-to-list. On my machine it parses the
latest org-version without an error. what version of emas are you
using?


Reply to this email directly or view it on GitHubhttps://github.com/punchagan/org2blog/issues/141#issuecomment-29110053
.


Reply to this email directly or view it on GitHub:
#141 (comment)

Thank you for your help. Yes, I do get the same error with those two
expressions you listed. I don't know how to look at or edit the source code
since I'm using the Aquamacs .dmg package.


Jay Dixit
jaydixit.com
newyorkwritersintensive.com
(646) 355-8001
fol­low @jaydixit https://twitter.com/jaydixit/
Jay Dixit

On Fri, Nov 22, 2013 at 6:00 PM, Matt Price notifications@github.comwrote:

Do you get the same error evaluating

(version-to-list (org-version))

and what about

(version-to-list "8.2.3c")

If so, I do think the problem is in version-to-list. I don't know what
to do about that. Maybe we can compare source code for that function
in our two emacsen. Here's mine:

(defun version-to-list (ver)
"Convert version string VER into a list of integers.

The version syntax is given by the following EBNF:

VERSION ::= NUMBER ( SEPARATOR NUMBER )*.

NUMBER ::= (0|1|2|3|4|5|6|7|8|9)+.

SEPARATOR ::= `version-separator' (which see)
| `version-regexp-alist' (which see).

The NUMBER part is optional if SEPARATOR is a match for an element
in `version-regexp-alist'.

Examples of valid version syntax:

1.0pre2 1.0.7.5 22.8beta3 0.9alpha1 6.9.30Beta

Examples of invalid version syntax:

1.0prepre2 1.0..7.5 22.8X3 alpha3.2 .5

Examples of version conversion:

Version String Version as a List of Integers
\"1.0.7.5\" (1 0 7 5)
\"1.0pre2\" (1 0 -1 2)
\"1.0PRE2\" (1 0 -1 2)
\"22.8beta3\" (22 8 -2 3)
\"22.8Beta3\" (22 8 -2 3)
\"0.9alpha1\" (0 9 -3 1)
\"0.9AlphA1\" (0 9 -3 1)
\"0.9alpha\" (0 9 -3)

See documentation for `version-separator' and `version-regexp-alist'."
(or (and (stringp ver) (> (length ver) 0))
(error "Invalid version string: '%s'" ver))
;; Change .x.y to 0.x.y
(if (and (>= (length ver) (length version-separator))
(string-equal (substring ver 0 (length version-separator))
version-separator))
(setq ver (concat "0" ver)))
(save-match-data
(let ((i 0)
(case-fold-search t) ; ignore case in matching
lst s al)
(while (and (setq s (string-match "[0-9]+" ver i))
(= s i))
;; handle numeric part
(setq lst (cons (string-to-number (substring ver i (match-end 0)))
lst)
i (match-end 0))
;; handle non-numeric part
(when (and (setq s (string-match "[^0-9]+" ver i))
(= s i))
(setq s (substring ver i (match-end 0))
i (match-end 0))
;; handle alpha, beta, pre, etc. separator
(unless (string= s version-separator)
(setq al version-regexp-alist)
(while (and al (not (string-match (caar al) s)))
(setq al (cdr al)))
(cond (al
(push (cdar al) lst))
;; Convert 22.3a to 22.3.1, 22.3b to 22.3.2, etc.
((string-match "^[-_+ ]?\\([a-zA-Z]\\)$" s)
(push (- (aref (downcase (match-string 1 s)) 0) ?a -1)
lst))
(t (error "Invalid version syntax: '%s'" ver))))))
(if (null lst)
(error "Invalid version syntax: '%s'" ver)
(nreverse lst)))))

that's in subr.el, in emacs 24.3.50.1 notice the final (cond (al
(push)) ((string-match...
I think that's where the difference would be.

On Fri 22 Nov 2013 07:43:14 PM EST, Jay Dixit wrote:

I'm using version 23.4.1. (Aquamacs distribution 2.5.)


Jay Dixit
jaydixit.com
newyorkwritersintensive.com
(646) 355-8001
fol­low @jaydixit https://twitter.com/jaydixit/

Jay Dixit

On Fri, Nov 22, 2013 at 1:17 PM, Matt Price <notifications@github.com
wrote:

This looks like a bug in version-to-list. On my machine it parses the
latest org-version without an error. what version of emas are you
using?


Reply to this email directly or view it on GitHub<
https://github.com/punchagan/org2blog/issues/141#issuecomment-29110053>
.


Reply to this email directly or view it on GitHub:
#141 (comment)


Reply to this email directly or view it on GitHubhttps://github.com/punchagan/org2blog/issues/141#issuecomment-29123211
.

Collaborator

titaniumbones commented Nov 23, 2013

I think pasting the code for my version of the function into your .emacs
might fix the problem. To explore the sourcecode try

C-h f version-to-list

then click on the underlined link "subr.el" in the help buffer that pops
up. It should take you to the funtion definition in the source code.

On 13-11-23 03:54 AM, Jay Dixit wrote:

Thank you for your help. Yes, I do get the same error with those two
expressions you listed. I don't know how to look at or edit the source code
since I'm using the Aquamacs .dmg package.


Jay Dixit
jaydixit.com
newyorkwritersintensive.com
(646) 355-8001
fol­low @jaydixit https://twitter.com/jaydixit/
Jay Dixit

On Fri, Nov 22, 2013 at 6:00 PM, Matt Price notifications@github.comwrote:

Do you get the same error evaluating

(version-to-list (org-version))

and what about

(version-to-list "8.2.3c")

If so, I do think the problem is in version-to-list. I don't know what
to do about that. Maybe we can compare source code for that function
in our two emacsen. Here's mine:

(defun version-to-list (ver)
"Convert version string VER into a list of integers.

The version syntax is given by the following EBNF:

VERSION ::= NUMBER ( SEPARATOR NUMBER )*.

NUMBER ::= (0|1|2|3|4|5|6|7|8|9)+.

SEPARATOR ::= `version-separator' (which see)
| `version-regexp-alist' (which see).

The NUMBER part is optional if SEPARATOR is a match for an element
in `version-regexp-alist'.

Examples of valid version syntax:

1.0pre2 1.0.7.5 22.8beta3 0.9alpha1 6.9.30Beta

Examples of invalid version syntax:

1.0prepre2 1.0..7.5 22.8X3 alpha3.2 .5

Examples of version conversion:

Version String Version as a List of Integers
\"1.0.7.5\" (1 0 7 5)
\"1.0pre2\" (1 0 -1 2)
\"1.0PRE2\" (1 0 -1 2)
\"22.8beta3\" (22 8 -2 3)
\"22.8Beta3\" (22 8 -2 3)
\"0.9alpha1\" (0 9 -3 1)
\"0.9AlphA1\" (0 9 -3 1)
\"0.9alpha\" (0 9 -3)

See documentation for `version-separator' and `version-regexp-alist'."
(or (and (stringp ver) (> (length ver) 0))
(error "Invalid version string: '%s'" ver))
;; Change .x.y to 0.x.y
(if (and (>= (length ver) (length version-separator))
(string-equal (substring ver 0 (length version-separator))
version-separator))
(setq ver (concat "0" ver)))
(save-match-data
(let ((i 0)
(case-fold-search t) ; ignore case in matching
lst s al)
(while (and (setq s (string-match "[0-9]+" ver i))
(= s i))
;; handle numeric part
(setq lst (cons (string-to-number (substring ver i (match-end 0)))
lst)
i (match-end 0))
;; handle non-numeric part
(when (and (setq s (string-match "[^0-9]+" ver i))
(= s i))
(setq s (substring ver i (match-end 0))
i (match-end 0))
;; handle alpha, beta, pre, etc. separator
(unless (string= s version-separator)
(setq al version-regexp-alist)
(while (and al (not (string-match (caar al) s)))
(setq al (cdr al)))
(cond (al
(push (cdar al) lst))
;; Convert 22.3a to 22.3.1, 22.3b to 22.3.2, etc.
((string-match "^[-_+ ]?\\([a-zA-Z]\\)$" s)
(push (- (aref (downcase (match-string 1 s)) 0) ?a -1)
lst))
(t (error "Invalid version syntax: '%s'" ver))))))
(if (null lst)
(error "Invalid version syntax: '%s'" ver)
(nreverse lst)))))

that's in subr.el, in emacs 24.3.50.1 notice the final (cond (al
(push)) ((string-match...
I think that's where the difference would be.

On Fri 22 Nov 2013 07:43:14 PM EST, Jay Dixit wrote:

I'm using version 23.4.1. (Aquamacs distribution 2.5.)


Jay Dixit
jaydixit.com
newyorkwritersintensive.com
(646) 355-8001
fol­low @jaydixit https://twitter.com/jaydixit/
Jay Dixit

On Fri, Nov 22, 2013 at 1:17 PM, Matt Price <notifications@github.com
wrote:

This looks like a bug in version-to-list. On my machine it parses the
latest org-version without an error. what version of emas are you
using?


Reply to this email directly or view it on GitHub<
https://github.com/punchagan/org2blog/issues/141#issuecomment-29110053>
.


Reply to this email directly or view it on GitHub:
#141 (comment)

Reply to this email directly or view it on GitHubhttps://github.com/punchagan/org2blog/issues/141#issuecomment-29123211
.


Reply to this email directly or view it on GitHub:
#141 (comment)

Owner

punchagan commented Nov 23, 2013

I think pasting the code for my version of the function into your .emacs
might fix the problem.

Yes, that would be worth a try.

Wow, pasting that code into my .emacs totally worked. Thank you!


Jay Dixit
jaydixit.com
newyorkwritersintensive.com
(646) 355-8001
fol­low @jaydixit https://twitter.com/jaydixit/
Jay Dixit

On Sat, Nov 23, 2013 at 1:11 PM, Matt Price notifications@github.comwrote:

I think pasting the code for my version of the function into your .emacs
might fix the problem. To explore the sourcecode try

C-h f version-to-list

then click on the underlined link "subr.el" in the help buffer that pops
up. It should take you to the funtion definition in the source code.

On 13-11-23 03:54 AM, Jay Dixit wrote:

Thank you for your help. Yes, I do get the same error with those two
expressions you listed. I don't know how to look at or edit the source
code
since I'm using the Aquamacs .dmg package.


Jay Dixit
jaydixit.com
newyorkwritersintensive.com
(646) 355-8001
fol­low @jaydixit https://twitter.com/jaydixit/
Jay Dixit

On Fri, Nov 22, 2013 at 6:00 PM, Matt Price <notifications@github.com
wrote:

Do you get the same error evaluating

(version-to-list (org-version))

and what about

(version-to-list "8.2.3c")

If so, I do think the problem is in version-to-list. I don't know what
to do about that. Maybe we can compare source code for that function
in our two emacsen. Here's mine:

(defun version-to-list (ver)
"Convert version string VER into a list of integers.

The version syntax is given by the following EBNF:

VERSION ::= NUMBER ( SEPARATOR NUMBER )*.

NUMBER ::= (0|1|2|3|4|5|6|7|8|9)+.

SEPARATOR ::= `version-separator' (which see)
| `version-regexp-alist' (which see).

The NUMBER part is optional if SEPARATOR is a match for an element
in `version-regexp-alist'.

Examples of valid version syntax:

1.0pre2 1.0.7.5 22.8beta3 0.9alpha1 6.9.30Beta

Examples of invalid version syntax:

1.0prepre2 1.0..7.5 22.8X3 alpha3.2 .5

Examples of version conversion:

Version String Version as a List of Integers
\"1.0.7.5\" (1 0 7 5)
\"1.0pre2\" (1 0 -1 2)
\"1.0PRE2\" (1 0 -1 2)
\"22.8beta3\" (22 8 -2 3)
\"22.8Beta3\" (22 8 -2 3)
\"0.9alpha1\" (0 9 -3 1)
\"0.9AlphA1\" (0 9 -3 1)
\"0.9alpha\" (0 9 -3)

See documentation for `version-separator' and `version-regexp-alist'."
(or (and (stringp ver) (> (length ver) 0))
(error "Invalid version string: '%s'" ver))
;; Change .x.y to 0.x.y
(if (and (>= (length ver) (length version-separator))
(string-equal (substring ver 0 (length version-separator))
version-separator))
(setq ver (concat "0" ver)))
(save-match-data
(let ((i 0)
(case-fold-search t) ; ignore case in matching
lst s al)
(while (and (setq s (string-match "[0-9]+" ver i))
(= s i))
;; handle numeric part
(setq lst (cons (string-to-number (substring ver i (match-end 0)))
lst)
i (match-end 0))
;; handle non-numeric part
(when (and (setq s (string-match "[^0-9]+" ver i))
(= s i))
(setq s (substring ver i (match-end 0))
i (match-end 0))
;; handle alpha, beta, pre, etc. separator
(unless (string= s version-separator)
(setq al version-regexp-alist)
(while (and al (not (string-match (caar al) s)))
(setq al (cdr al)))
(cond (al
(push (cdar al) lst))
;; Convert 22.3a to 22.3.1, 22.3b to 22.3.2, etc.
((string-match "^[-_+ ]?\\([a-zA-Z]\\)$" s)
(push (- (aref (downcase (match-string 1 s)) 0) ?a -1)
lst))
(t (error "Invalid version syntax: '%s'" ver))))))
(if (null lst)
(error "Invalid version syntax: '%s'" ver)
(nreverse lst)))))

that's in subr.el, in emacs 24.3.50.1 notice the final (cond (al
(push)) ((string-match...
I think that's where the difference would be.

On Fri 22 Nov 2013 07:43:14 PM EST, Jay Dixit wrote:

I'm using version 23.4.1. (Aquamacs distribution 2.5.)


Jay Dixit
jaydixit.com
newyorkwritersintensive.com
(646) 355-8001
fol­low @jaydixit https://twitter.com/jaydixit/
Jay Dixit

On Fri, Nov 22, 2013 at 1:17 PM, Matt Price <notifications@github.com
wrote:

This looks like a bug in version-to-list. On my machine it parses the
latest org-version without an error. what version of emas are you
using?


Reply to this email directly or view it on GitHub<
https://github.com/punchagan/org2blog/issues/141#issuecomment-29110053>
.


Reply to this email directly or view it on GitHub:
#141 (comment)

Reply to this email directly or view it on GitHub<
https://github.com/punchagan/org2blog/issues/141#issuecomment-29123211>

.


Reply to this email directly or view it on GitHub:
#141 (comment)


Reply to this email directly or view it on GitHubhttps://github.com/punchagan/org2blog/issues/141#issuecomment-29132123
.

Collaborator

aspiers commented Nov 24, 2013

So what's the conclusion? That there's a bug in 23.4.1 (or at least the Aquamacs 2.5 version of it) which has since been fixed? Is it possible to see a diff of the two versions so we can pin it down to a particular commit?

Collaborator

titaniumbones commented Nov 24, 2013

Jay, can you follow the directions in my last comment and paste the
source for the original version of your emacs' function into a comment?

in fact, browsing the code for aquamacs 2.5 on github it apears to me
that the new versioning scheme was introduced in a more recent version,
so this code from emacs 24 is missing there:
< (cond (al
< (push (cdar al) lst))
< ;; Convert 22.3a to 22.3.1, 22.3b to 22.3.2, etc.
< ((string-match "^[-_+ ]?([a-zA-Z])$" s)
< (push (- (aref (downcase (match-string 1 s)) 0) ?a
-1)
< lst))

< (t (error "Invalid version syntax: '%s'" ver))))))

      (or al (error "Invalid version syntax: '%s'" ver))
      (setq lst (cons (cdar al) lst)))))

https://github.com/davidswelt/aquamacs-emacs/blob/c41502b0f733465ddf9102f4f922387bb6b17828/lisp/subr.el

It may be that the final "c" in org-mode is only a legal version number
in emacs 24.

On Sun 24 Nov 2013 08:08:46 AM EST, Adam Spiers wrote:

So what's the conclusion? That there's a bug in 23.4.1 (or at least
the Aquamacs 2.5 version of it) which has since been fixed? Is it
possible to see a diff of the two versions so we can pin it down to a
particular commit?


Reply to this email directly or view it on GitHub
#141 (comment).

Owner

punchagan commented May 26, 2014

This should be fixed with a newer version of org released. Closing. Feel free to re-open, in case of issues.

punchagan closed this May 26, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment