renard / o-blog

Standalone orgmode blog exporter. DEPECATED, NOT MAINTAINED
http://renard.github.com/o-blog-v2
260 stars 58 forks source link

Getting (wrong-type-argument characterp nil) #1

Closed paulprovost closed 12 years ago

paulprovost commented 12 years ago

Hi! Trying out o-blog for the first time. I followed the manual installation, and got an error ((wrong-type-argument characterp nil)) when publishing the sample. I trimmed down my init file to

(add-to-list 'load-path "~/local/site-lisp/")
(add-to-list 'load-path "~/local/site-lisp/org/lisp/")
(add-to-list 'load-path "~/local/site-lisp/org/contrib/lisp/")
(add-to-list 'load-path "~/local/site-lisp/remember/")
(add-to-list 'load-path "~/.emacs.d/o-blog")

(require 'o-blog)

(require 'org-install)
(require 'org-protocol)

Started emacs with -q -l . Opened sample.org and ran M-x org-publish-blog. Here's the trace.

Debugger entered--Lisp error: (wrong-type-argument characterp nil)
  char-to-string(nil)
  (downcase (char-to-string (car ...)))
  (list (downcase (char-to-string ...)))
  (nconc ret (list (downcase ...)))
  (setq ret (nconc ret (list ...)))
  (progn (setq ret (nconc ret ...)))
  (if (or (member gc ...) (= 45 c)) (progn (setq ret ...)) (if (member gc ...) (progn ...)))
  (while (< (setq --cl-idx-- ...) (length --cl-vec--)) (setq c (aref --cl-vec-- --cl-idx--)) (setf gc (get-char-code-property c ...)) (if (or ... ...) (progn ...) (if ... ...)))
  (let* ((--cl-vec-- s) (--cl-idx-- -1) (c nil) (gc nil) (ret nil) (ret nil)) (while (< ... ...) (setq c ...) (setf gc ...) (if ... ... ...)) (replace-regexp-in-string "--+" "-" (replace-regexp-in-string "^-+\\|-+$" "" ...)))
  (catch (quote --cl-block-nil--) (let* (... ... ... ... ... ...) (while ... ... ... ...) (replace-regexp-in-string "--+" "-" ...)))
  (cl-block-wrapper (catch (quote --cl-block-nil--) (let* ... ... ...)))
  (block nil (let* (... ... ... ... ... ...) (while ... ... ... ...) (replace-regexp-in-string "--+" "-" ...)))
  (loop for c across s with gc with ret do (setf gc (get-char-code-property c ...)) if (or (member gc ...) (= 45 c)) collect (downcase (char-to-string ...)) into ret else if (member gc (quote ...)) collect "-" into ret finally return (replace-regexp-in-string "--+" "-" (replace-regexp-in-string "^-+\\|-+$" "" ...)))
  ob:sanitize-string("usage")
  (make-ob:tags :name td :safe (ob:sanitize-string td))
  (cons (make-ob:tags :name td :safe (ob:sanitize-string td)) --cl-var--)
  (setq --cl-var-- (cons (make-ob:tags :name td :safe ...) --cl-var--))
  (push (make-ob:tags :name td :safe (ob:sanitize-string td)) --cl-var--)
  (while (consp --cl-var--) (setq tn (car --cl-var--)) (setf td (replace-regexp-in-string "_" " " ...)) (push (make-ob:tags :name td :safe ...) --cl-var--) (setq --cl-var-- (cdr --cl-var--)))
  (let* ((--cl-var-- ...) (tn nil) (td nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq tn ...) (setf td ...) (push ... --cl-var--) (setq --cl-var-- ...)) (nreverse --cl-var--))
  (catch (quote --cl-block-nil--) (let* (... ... ... ...) (while ... ... ... ... ...) (nreverse --cl-var--)))
  (cl-block-wrapper (catch (quote --cl-block-nil--) (let* ... ... ...)))
  (block nil (let* (... ... ... ...) (while ... ... ... ... ...) (nreverse --cl-var--)))
  (loop for tn in (org-get-local-tags) with td do (setf td (replace-regexp-in-string "_" " " ...)) and collect (make-ob:tags :name td :safe (ob:sanitize-string td)))
  (let* ((title ...) (tags ...) (timestamp ...) (year ...) (month ...) (day ...) (category ...) (page ...) (filename ...) (filepath ...) (htmlfile ...) (content ...) (linked-files ...)) (when page (setq htmlfile page filename ... filepath ...)) (loop for f in linked-files do (let ... ... ...)) (make-ob:post :title title :tags tags :timestamp timestamp :year year :month month :day day :filename filename :filepath filepath :path-to-root (file-relative-name "." filepath) :htmlfile htmlfile :template (or ... ...) :content content :content-html (ob-export-string-to-html content) :category category))
  (progn (let* (... ... ... ... ... ... ... ... ... ... ... ... ...) (when page ...) (loop for f in linked-files do ...) (make-ob:post :title title :tags tags :timestamp timestamp :year year :month month :day day :filename filename :filepath filepath :path-to-root ... :htmlfile htmlfile :template ... :content content :content-html ... :category category)))
  (if (search-forward-regexp org-complex-heading-regexp (point-at-eol) t) (progn (let* ... ... ... ...)))
  (when (search-forward-regexp org-complex-heading-regexp (point-at-eol) t) (let* (... ... ... ... ... ... ... ... ... ... ... ... ...) (when page ...) (loop for f in linked-files do ...) (make-ob:post :title title :tags tags :timestamp timestamp :year year :month month :day day :filename filename :filepath filepath :path-to-root ... :htmlfile htmlfile :template ... :content content :content-html ... :category category)))
  ob-parse-entry()
  (save-current-buffer (set-buffer (marker-buffer marker)) (goto-char (marker-position marker)) (ob-parse-entry))
  (with-current-buffer (marker-buffer marker) (goto-char (marker-position marker)) (ob-parse-entry))
  (list (with-current-buffer (marker-buffer marker) (goto-char ...) (ob-parse-entry)))
  (nconc posts (list (with-current-buffer ... ... ...)))
  (setq posts (nconc posts (list ...)))
  (while (consp --cl-var--) (setq marker (car --cl-var--)) (setq posts (nconc posts ...)) (setq --cl-var-- (cdr --cl-var--)))
  (let* ((--cl-var-- markers) (marker nil) (posts nil) (posts nil)) (while (consp --cl-var--) (setq marker ...) (setq posts ...) (setq --cl-var-- ...)) (loop for post in (sort posts ...) with id = 0 do (setf ... id) and do (incf id 1) and collect post))
  (catch (quote --cl-block-nil--) (let* (... ... ... ...) (while ... ... ... ...) (loop for post in ... with id = 0 do ... and do ... and collect post)))
  (cl-block-wrapper (catch (quote --cl-block-nil--) (let* ... ... ...)))
  (block nil (let* (... ... ... ...) (while ... ... ... ...) (loop for post in ... with id = 0 do ... and do ... and collect post)))
  (loop for marker in markers with posts = nil collect (with-current-buffer (marker-buffer marker) (goto-char ...) (ob-parse-entry)) into posts finally return (loop for post in (sort posts ...) with id = 0 do (setf ... id) and do (incf id 1) and collect post))
  (save-excursion (loop for marker in markers with posts = nil collect (with-current-buffer ... ... ...) into posts finally return (loop for post in ... with id = 0 do ... and do ... and collect post)))
  ob-parse-entries((#<marker at 16762 in sample.org> #<marker at 17933 in sample.org> #<marker at 18432 in sample.org> #<marker at 24735 in sample.org> #<marker at 25495 in sample.org>))
  (let* ((start-time ...) (default-directory ...) (BLOG ...) (POSTS ...) (ALL-POSTS POSTS) (STATIC ...) (SNIPPETS ...) (TAGS ...)) (ob-write-static) (ob-write-posts) (ob-write-tags) (ob-write-index) (copy-directory (format "%s/%s" ... ...) (ob:blog-publish-dir BLOG)) (run-hooks (quote o-blog-after-publish-hook)) (message (format "Blog %s published in %ss" file ...)))
  (save-current-buffer (set-buffer (or ... ...)) (run-hooks (quote o-blog-before-publish-hook)) (let* (... ... ... ... ... ... ... ...) (ob-write-static) (ob-write-posts) (ob-write-tags) (ob-write-index) (copy-directory ... ...) (run-hooks ...) (message ...)))
  (with-current-buffer (or (get-file-buffer file) (find-file file)) (run-hooks (quote o-blog-before-publish-hook)) (let* (... ... ... ... ... ... ... ...) (ob-write-static) (ob-write-posts) (ob-write-tags) (ob-write-index) (copy-directory ... ...) (run-hooks ...) (message ...)))
  org-publish-blog-sync("/home/paul/.emacs.d/o-blog/example/sample.org")
  (if async (org-publish-blog-async file) (org-publish-blog-sync file))
  org-publish-blog("/home/paul/.emacs.d/o-blog/example/sample.org" nil)
  eval((org-publish-blog "/home/paul/.emacs.d/o-blog/example/sample.org" nil))
  repeat-complex-command(1)
  call-interactively(repeat-complex-command nil nil)

Please help!

renard commented 12 years ago

Hi,

Unfortunately I wasn't able to reproduce the bug.

Which versions are you using?

I run:

emacs -q -batch  -L "~/.emacs.d/el-get/org-mode" \
   -L "~/.emacs.d/el-get/o-blog" \
--eval "(progn (require 'o-blog) (require 'o-blog-admonition) (org-publish-blog \"~/.emacs.d/el-get/o-blog/example/sample.org\") (message (emacs-version)) (org-version))"

I got:

Loading 00debian-vars...og-admonition) (org-publish-blog \"~/.emacs.d/el-get/o-blog/example/sample.org\") (message (emaLoading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Skipping dictionaries-common setup for emacs-snapshot
Loading /etc/emacs/site-start.d/50emacs-goodies-el.el (source)...
Loading /etc/emacs/site-start.d/50git-core.el (source)...
[...]
Blog ~/.emacs.d/el-get/o-blog/example/sample.org published in 3.728s
GNU Emacs 24.0.92.1 (x86_64-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2012-01-11 on cw-bkp0, modified by Debian
Org-mode version 7.8.03

I do use:

Cheers

Seb

paulprovost commented 12 years ago

So, the versions are:

I run

emacs -q -batch  -L "~/local/site-lisp/org/lisp"    -L "~/.emacs.d/o-blog" --eval "(progn (require 'o-blog) (require 'o-blog-admonition) (org-publish-blog \"~/.emacs.d/o-blog/example/sample.org\") (message (emacs-version)) (org-version))"

and get

Loading 00debian-vars...
Loading /etc/emacs/site-start.d/20apel.el (source)...
Loading /etc/emacs/site-start.d/50a2ps.el (source)...
Loading /etc/emacs/site-start.d/50autoconf.el (source)...
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
Loading /etc/emacs/site-start.d/50edb.el (source)...
Loading /etc/emacs/site-start.d/50emacs-goodies-el.el (source)...
Loading /etc/emacs/site-start.d/50flim.el (source)...
Loading /etc/emacs/site-start.d/50git-core.el (source)...
Loading /etc/emacs/site-start.d/50w3m-el-snapshot.el (source)...
Loading /etc/emacs/site-start.d/51semi.el (source)...
Loading /etc/emacs/site-start.d/65wl-beta.el (source)...
OVERVIEW
Loading vc-git...
Wrong type argument: characterp, nil

Hm. Emacs version issue? Maybe some stuff loaded on debian by default.

Paul

paulprovost commented 12 years ago

Sorry about the formatting...

paulprovost commented 12 years ago
emacs -q -batch  -L "~/local/site-lisp/org-mode/lisp"    -L "~/.emacs.d/o-blog" --eval "(progn (require 'o-blog) (require 'o-blog-admonition) (org-publish-blog \"~/.emacs.d/o-blog/example/sample.org\") (message (emacs-version)) (org-version))"

gives:

Loading 00debian-vars...
Loading /etc/emacs/site-start.d/20apel.el (source)...
Loading /etc/emacs/site-start.d/50autoconf.el (source)...
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Skipping dictionaries-common setup for emacs-snapshot
Loading /etc/emacs/site-start.d/50emacs-goodies-el.el (source)...
Loading /etc/emacs/site-start.d/50flim.el (source)...
Loading /etc/emacs/site-start.d/50global.el (source)...
Loading /etc/emacs/site-start.d/50ledger.el (source)...
Loading /etc/emacs/site-start.d/50w3m-el-snapshot.el (source)...
Loading /etc/emacs/site-start.d/51semi.el (source)...
Loading /etc/emacs/site-start.d/65wl-beta.el (source)...
OVERVIEW
Loading vc-git...
Wrong type argument: characterp, nil
renard commented 12 years ago

Can you please test with a an emacs snapshot version (http://emacs.naquadah.org/)

Thanks

paulprovost commented 12 years ago

Hi,

So i tried with an Emacs 24 compiled from sources on both a clean virtual machine (no emacs packages installed from a distro repo) and my current machine (with some emacs packages installed from the distro's repo) and both succeeded. This seems to point to a 23 vs. 24 issue. If you are interested in supporting Emacs 23, then I am willing to help (fair warning, I am not an expert elisp coder). If not, that's ok too. we can close the issue.

Paul

paulprovost commented 12 years ago

Arg. Formatting again...

So i tried with an Emacs 24 compiled from sources on both a clean virtual machine (no emacs packages installed from a distro repo) and my current machine (with some emacs packages installed from the distro's repo) and both succeeded. This seems to point to a 23 vs. 24 issue. If you are interested in supporting Emacs 23, then I am willing to help (fair warning, I am not an expert elisp coder). If not, that's ok too. we can close the issue.

Paul

renard commented 12 years ago

Hi,

You can send me a full trace of what happened by doing this in :

emacs -q -batch  -L "~/.emacs.d/el-get/org-mode" \
   -L "~/.emacs.d/el-get/o-blog" \
--eval "(let (print-lenght print-level (debug-on-error t)) (require 'o-blog) (require 'o-blog-admonition) (org-publish-blog \"~/.emacs.d/el-get/o-blog/example/sample.org\") (message (emacs-version)) (org-version))"

Please adapt the paths according your configuration.

Cheers

Sébastien Gross

paulprovost commented 12 years ago

Hm. Different result...

emacs -q -batch  -L "~/local/site-lisp/org/lisp"    -L "~/.emacs.d/o-blog" --eval "(let (print-lenght print-level (debug-on-error t)) (require 'o-blog) (require 'o-blog-admonition) (org-publish-blog \"~/.emacs.d/o-blog/example/sample.org\") (message (emacs-version)) (org-version))"

The result is

Loading 00debian-vars...
Loading /etc/emacs/site-start.d/20apel.el (source)...
Loading /etc/emacs/site-start.d/50a2ps.el (source)...
Loading /etc/emacs/site-start.d/50autoconf.el (source)...
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
Loading /etc/emacs/site-start.d/50edb.el (source)...
Loading /etc/emacs/site-start.d/50emacs-goodies-el.el (source)...
Loading /etc/emacs/site-start.d/50flim.el (source)...
Loading /etc/emacs/site-start.d/50git-core.el (source)...
Loading /etc/emacs/site-start.d/50w3m-el-snapshot.el (source)...
Loading /etc/emacs/site-start.d/51semi.el (source)...
Loading /etc/emacs/site-start.d/65wl-beta.el (source)...
OVERVIEW
Loading vc-git...
...
  ob:sanitize-string("usage")
  (make-ob:tags :name td :safe (ob:sanitize-string td))
  (cons (make-ob:tags :name td :safe (ob:sanitize-string td)) --cl-var--)
  (setq --cl-var-- (cons (make-ob:tags :name td :safe ...) --cl-var--))
  (push (make-ob:tags :name td :safe (ob:sanitize-string td)) --cl-var--)
  (while (consp --cl-var--) (setq tn (car --cl-var--)) (setf td (replace-regexp-in-string "_" " " ...)) (push (make-ob:tags :name td :safe ...) --cl-var--) (setq --cl-var-- (cdr --cl-var--)))
  (let* ((--cl-var-- ...) (tn nil) (td nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq tn ...) (setf td ...) (push ... --cl-var--) (setq --cl-var-- ...)) (nreverse --cl-var--))
  (catch (quote --cl-block-nil--) (let* (... ... ... ...) (while ... ... ... ... ...) (nreverse --cl-var--)))
  (cl-block-wrapper (catch (quote --cl-block-nil--) (let* ... ... ...)))
  (block nil (let* (... ... ... ...) (while ... ... ... ... ...) (nreverse --cl-var--)))
  (loop for tn in (org-get-local-tags) with td do (setf td (replace-regexp-in-string "_" " " ...)) and collect (make-ob:tags :name td :safe (ob:sanitize-string td)))
  (let* ((title ...) (tags ...) (timestamp ...) (year ...) (month ...) (day ...) (category ...) (page ...) (filename ...) (filepath ...) (htmlfile ...) (content ...) (linked-files ...)) (when page (setq htmlfile page filename ... filepath ...)) (loop for f in linked-files do (let ... ... ...)) (make-ob:post :title title :tags tags :timestamp timestamp :year year :month month :day day :filename filename :filepath filepath :path-to-root (file-relative-name "." filepath) :htmlfile htmlfile :template (or ... ...) :content content :content-html (ob-export-string-to-html content) :category category))
  (progn (let* (... ... ... ... ... ... ... ... ... ... ... ... ...) (when page ...) (loop for f in linked-files do ...) (make-ob:post :title title :tags tags :timestamp timestamp :year year :month month :day day :filename filename :filepath filepath :path-to-root ... :htmlfile htmlfile :template ... :content content :content-html ... :category category)))
  (if (search-forward-regexp org-complex-heading-regexp (point-at-eol) t) (progn (let* ... ... ... ...)))
  (when (search-forward-regexp org-complex-heading-regexp (point-at-eol) t) (let* (... ... ... ... ... ... ... ... ... ... ... ... ...) (when page ...) (loop for f in linked-files do ...) (make-ob:post :title title :tags tags :timestamp timestamp :year year :month month :day day :filename filename :filepath filepath :path-to-root ... :htmlfile htmlfile :template ... :content content :content-html ... :category category)))
  ob-parse-entry()
  (save-current-buffer (set-buffer (marker-buffer marker)) (goto-char (marker-position marker)) (ob-parse-entry))
  (with-current-buffer (marker-buffer marker) (goto-char (marker-position marker)) (ob-parse-entry))
  (list (with-current-buffer (marker-buffer marker) (goto-char ...) (ob-parse-entry)))
  (nconc posts (list (with-current-buffer ... ... ...)))
  (setq posts (nconc posts (list ...)))
  (while (consp --cl-var--) (setq marker (car --cl-var--)) (setq posts (nconc posts ...)) (setq --cl-var-- (cdr --cl-var--)))
  (let* ((--cl-var-- markers) (marker nil) (posts nil) (posts nil)) (while (consp --cl-var--) (setq marker ...) (setq posts ...) (setq --cl-var-- ...)) (loop for post in (sort posts ...) with id = 0 do (setf ... id) and do (incf id 1) and collect post))
  (catch (quote --cl-block-nil--) (let* (... ... ... ...) (while ... ... ... ...) (loop for post in ... with id = 0 do ... and do ... and collect post)))
  (cl-block-wrapper (catch (quote --cl-block-nil--) (let* ... ... ...)))
  (block nil (let* (... ... ... ...) (while ... ... ... ...) (loop for post in ... with id = 0 do ... and do ... and collect post)))
  (loop for marker in markers with posts = nil collect (with-current-buffer (marker-buffer marker) (goto-char ...) (ob-parse-entry)) into posts finally return (loop for post in (sort posts ...) with id = 0 do (setf ... id) and do (incf id 1) and collect post))
  (save-excursion (loop for marker in markers with posts = nil collect (with-current-buffer ... ... ...) into posts finally return (loop for post in ... with id = 0 do ... and do ... and collect post)))
  ob-parse-entries((#<marker at 16762 in sample.org> #<marker at 17933 in sample.org> #<marker at 18432 in sample.org> #<marker at 24735 in sample.org> #<marker at 25495 in sample.org>))
  (let* ((start-time ...) (default-directory ...) (BLOG ...) (POSTS ...) (ALL-POSTS POSTS) (STATIC ...) (SNIPPETS ...) (TAGS ...)) (ob-write-static) (ob-write-posts) (ob-write-tags) (ob-write-index) (copy-directory (format "%s/%s" ... ...) (ob:blog-publish-dir BLOG)) (run-hooks (quote o-blog-after-publish-hook)) (message (format "Blog %s published in %ss" file ...)))
  (save-current-buffer (set-buffer (or ... ...)) (run-hooks (quote o-blog-before-publish-hook)) (let* (... ... ... ... ... ... ... ...) (ob-write-static) (ob-write-posts) (ob-write-tags) (ob-write-index) (copy-directory ... ...) (run-hooks ...) (message ...)))
  (with-current-buffer (or (get-file-buffer file) (find-file file)) (run-hooks (quote o-blog-before-publish-hook)) (let* (... ... ... ... ... ... ... ...) (ob-write-static) (ob-write-posts) (ob-write-tags) (ob-write-index) (copy-directory ... ...) (run-hooks ...) (message ...)))
  org-publish-blog-sync("~/.emacs.d/o-blog/example/sample.org")
  (if async (org-publish-blog-async file) (org-publish-blog-sync file))
  org-publish-blog("~/.emacs.d/o-blog/example/sample.org")
  (let (print-lenght print-level (debug-on-error t)) (require (quote o-blog)) (require (quote o-blog-admonition)) (org-publish-blog "~/.emacs.d/o-blog/example/sample.org") (message (emacs-version)) (org-version))
  eval((let (print-lenght print-level (debug-on-error t)) (require (quote o-blog)) (require (quote o-blog-admonition)) (org-publish-blog "~/.emacs.d/o-blog/example/sample.org") (message (emacs-version)) (org-version)))
  command-line-1(("-L" "~/local/site-lisp/org/lisp" "-L" "~/.emacs.d/o-blog" "--eval" "(let (print-lenght print-level (debug-on-error t)) (require 'o-blog) (require 'o-blog-admonition) (org-publish-blog \"~/.emacs.d/o-blog/example/sample.org\") (message (emacs-version)) (org-version))"))
  command-line()
  normal-top-level()
paulprovost commented 12 years ago

from inside a running emacs, I have


Debugger entered--Lisp error: (wrong-type-argument characterp nil)
  char-to-string(nil)
  (downcase (char-to-string (car ...)))
  (list (downcase (char-to-string ...)))
  (nconc ret (list (downcase ...)))
  (setq ret (nconc ret (list ...)))
  (progn (setq ret (nconc ret ...)))
  (if (or (member gc ...) (= 45 c)) (progn (setq ret ...)) (if (member gc ...) (progn ...)))
  (while (< (setq --cl-idx-- ...) (length --cl-vec--)) (setq c (aref --cl-vec-- --cl-idx--)) (setf gc (get-char-code-property c ...)) (if (or ... ...) (progn ...) (if ... ...)))
  (let* ((--cl-vec-- s) (--cl-idx-- -1) (c nil) (gc nil) (ret nil) (ret nil)) (while (< ... ...) (setq c ...) (setf gc ...) (if ... ... ...)) (replace-regexp-in-string "--+" "-" (replace-regexp-in-string "^-+\\|-+$" "" ...)))
  (catch (quote --cl-block-nil--) (let* (... ... ... ... ... ...) (while ... ... ... ...) (replace-regexp-in-string "--+" "-" ...)))
  (cl-block-wrapper (catch (quote --cl-block-nil--) (let* ... ... ...)))
  (block nil (let* (... ... ... ... ... ...) (while ... ... ... ...) (replace-regexp-in-string "--+" "-" ...)))
  (loop for c across s with gc with ret do (setf gc (get-char-code-property c ...)) if (or (member gc ...) (= 45 c)) collect (downcase (char-to-string ...)) into ret else if (member gc (quote ...)) collect "-" into ret finally return (replace-regexp-in-string "--+" "-" (replace-regexp-in-string "^-+\\|-+$" "" ...)))
  ob:sanitize-string("usage")
  (make-ob:tags :name td :safe (ob:sanitize-string td))
  (cons (make-ob:tags :name td :safe (ob:sanitize-string td)) --cl-var--)
  (setq --cl-var-- (cons (make-ob:tags :name td :safe ...) --cl-var--))
  (push (make-ob:tags :name td :safe (ob:sanitize-string td)) --cl-var--)
  (while (consp --cl-var--) (setq tn (car --cl-var--)) (setf td (replace-regexp-in-string "_" " " ...)) (push (make-ob:tags :name td :safe ...) --cl-var--) (setq --cl-var-- (cdr --cl-var--)))
  (let* ((--cl-var-- ...) (tn nil) (td nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq tn ...) (setf td ...) (push ... --cl-var--) (setq --cl-var-- ...)) (nreverse --cl-var--))
  (catch (quote --cl-block-nil--) (let* (... ... ... ...) (while ... ... ... ... ...) (nreverse --cl-var--)))
  (cl-block-wrapper (catch (quote --cl-block-nil--) (let* ... ... ...)))
  (block nil (let* (... ... ... ...) (while ... ... ... ... ...) (nreverse --cl-var--)))
  (loop for tn in (org-get-local-tags) with td do (setf td (replace-regexp-in-string "_" " " ...)) and collect (make-ob:tags :name td :safe (ob:sanitize-string td)))
  (let* ((title ...) (tags ...) (timestamp ...) (year ...) (month ...) (day ...) (category ...) (page ...) (filename ...) (filepath ...) (htmlfile ...) (content ...) (linked-files ...)) (when page (setq htmlfile page filename ... filepath ...)) (loop for f in linked-files do (let ... ... ...)) (make-ob:post :title title :tags tags :timestamp timestamp :year year :month month :day day :filename filename :filepath filepath :path-to-root (file-relative-name "." filepath) :htmlfile htmlfile :template (or ... ...) :content content :content-html (ob-export-string-to-html content) :category category))
  (progn (let* (... ... ... ... ... ... ... ... ... ... ... ... ...) (when page ...) (loop for f in linked-files do ...) (make-ob:post :title title :tags tags :timestamp timestamp :year year :month month :day day :filename filename :filepath filepath :path-to-root ... :htmlfile htmlfile :template ... :content content :content-html ... :category category)))
  (if (search-forward-regexp org-complex-heading-regexp (point-at-eol) t) (progn (let* ... ... ... ...)))
  (when (search-forward-regexp org-complex-heading-regexp (point-at-eol) t) (let* (... ... ... ... ... ... ... ... ... ... ... ... ...) (when page ...) (loop for f in linked-files do ...) (make-ob:post :title title :tags tags :timestamp timestamp :year year :month month :day day :filename filename :filepath filepath :path-to-root ... :htmlfile htmlfile :template ... :content content :content-html ... :category category)))
  ob-parse-entry()
  (save-current-buffer (set-buffer (marker-buffer marker)) (goto-char (marker-position marker)) (ob-parse-entry))
  (with-current-buffer (marker-buffer marker) (goto-char (marker-position marker)) (ob-parse-entry))
  (list (with-current-buffer (marker-buffer marker) (goto-char ...) (ob-parse-entry)))
  (nconc posts (list (with-current-buffer ... ... ...)))
  (setq posts (nconc posts (list ...)))
  (while (consp --cl-var--) (setq marker (car --cl-var--)) (setq posts (nconc posts ...)) (setq --cl-var-- (cdr --cl-var--)))
  (let* ((--cl-var-- markers) (marker nil) (posts nil) (posts nil)) (while (consp --cl-var--) (setq marker ...) (setq posts ...) (setq --cl-var-- ...)) (loop for post in (sort posts ...) with id = 0 do (setf ... id) and do (incf id 1) and collect post))
  (catch (quote --cl-block-nil--) (let* (... ... ... ...) (while ... ... ... ...) (loop for post in ... with id = 0 do ... and do ... and collect post)))
  (cl-block-wrapper (catch (quote --cl-block-nil--) (let* ... ... ...)))
  (block nil (let* (... ... ... ...) (while ... ... ... ...) (loop for post in ... with id = 0 do ... and do ... and collect post)))
  (loop for marker in markers with posts = nil collect (with-current-buffer (marker-buffer marker) (goto-char ...) (ob-parse-entry)) into posts finally return (loop for post in (sort posts ...) with id = 0 do (setf ... id) and do (incf id 1) and collect post))
  (save-excursion (loop for marker in markers with posts = nil collect (with-current-buffer ... ... ...) into posts finally return (loop for post in ... with id = 0 do ... and do ... and collect post)))
  ob-parse-entries((#<marker at 16762 in sample.org> #<marker at 17933 in sample.org> #<marker at 18432 in sample.org> #<marker at 24735 in sample.org> #<marker at 25495 in sample.org>))
  (let* ((start-time ...) (default-directory ...) (BLOG ...) (POSTS ...) (ALL-POSTS POSTS) (STATIC ...) (SNIPPETS ...) (TAGS ...)) (ob-write-static) (ob-write-posts) (ob-write-tags) (ob-write-index) (copy-directory (format "%s/%s" ... ...) (ob:blog-publish-dir BLOG)) (run-hooks (quote o-blog-after-publish-hook)) (message (format "Blog %s published in %ss" file ...)))
  (save-current-buffer (set-buffer (or ... ...)) (run-hooks (quote o-blog-before-publish-hook)) (let* (... ... ... ... ... ... ... ...) (ob-write-static) (ob-write-posts) (ob-write-tags) (ob-write-index) (copy-directory ... ...) (run-hooks ...) (message ...)))
  (with-current-buffer (or (get-file-buffer file) (find-file file)) (run-hooks (quote o-blog-before-publish-hook)) (let* (... ... ... ... ... ... ... ...) (ob-write-static) (ob-write-posts) (ob-write-tags) (ob-write-index) (copy-directory ... ...) (run-hooks ...) (message ...)))
  org-publish-blog-sync("~/.emacs.d/o-blog/example/sample.org")
  (if async (org-publish-blog-async file) (org-publish-blog-sync file))
  org-publish-blog("~/.emacs.d/o-blog/example/sample.org")
  eval((org-publish-blog "~/.emacs.d/o-blog/example/sample.org"))
  eval-expression((org-publish-blog "~/.emacs.d/o-blog/example/sample.org") nil)
  call-interactively(eval-expression nil nil)
renard commented 12 years ago

Hi,

I guess I got it! The problem was that (get-char-code-property c 'decomposition) returns nil on emacs23 if the char is pure ascii.

Can you please test with that patch against o-blog.el?

If it works for you I would be able to close the bug.

@@ -648,12 +648,15 @@ If provided CATEGORY YEAR and MONTH are used to select articles."
 - downcasing all letters
 - trimming leading and tailing \"-\""
   (loop for c across s
+   with cd
    with gc
    with ret
-   do (setf gc (get-char-code-property c 'general-category))
+   do (progn
+        (setf gc (get-char-code-property c 'general-category))
+        (setf cd (get-char-code-property c 'decomposition)))
    if (or (member gc '(Lu Ll Nd)) (= ?- c))
-   collect (downcase (char-to-string
-              (car (get-char-code-property c 'decomposition))))
+   collect (downcase
+        (char-to-string (if cd (car cd)  c)))
    into ret
    else if (member gc '(Zs))
    collect "-" into ret
paulprovost commented 12 years ago

Hi Seb,

Well, we go a little further:

emacs -q -batch  -L "~/local/site-lisp/org/lisp"    -L "~/.emacs.d/o-blog" --eval "(let ((debug-on-error t)) (require 'o-blog) (require 'o-blog-admonition) (org-publish-blog \"~/.emacs.d/o-blog/example/sample.org\") (message (emacs-version)) (org-version))"

now gives

Loading 00debian-vars...
Loading /etc/emacs/site-start.d/20apel.el (source)...
Loading /etc/emacs/site-start.d/50a2ps.el (source)...
Loading /etc/emacs/site-start.d/50autoconf.el (source)...
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
Loading /etc/emacs/site-start.d/50edb.el (source)...
Loading /etc/emacs/site-start.d/50emacs-goodies-el.el (source)...
Loading /etc/emacs/site-start.d/50flim.el (source)...
Loading /etc/emacs/site-start.d/50git-core.el (source)...
Loading /etc/emacs/site-start.d/50w3m-el-snapshot.el (source)...
Loading /etc/emacs/site-start.d/51semi.el (source)...
Loading /etc/emacs/site-start.d/65wl-beta.el (source)...
OVERVIEW
Loading vc-git...
OVERVIEW
Mark set
Exporting...
Fontifying  *temp*<3>...
Fontifying  *temp*<3>... (regexps...)
Fontifying  *temp*<3>... (regexps....)
Fontifying  *temp*<3>... (regexps.....)
Fontifying  *temp*<3>... (regexps......)
Fontifying  *temp*<3>... (regexps.......)
Fontifying  *temp*<3>... (regexps........)
Fontifying  *temp*<3>... (regexps.........)
Fontifying  *temp*<3>... (regexps..........)
Fontifying  *temp*<3>... (regexps...........)
Fontifying  *temp*<3>... (regexps............)
Fontifying  *temp*<3>... (regexps.............)
Fontifying  *temp*<3>... (regexps..............)
Fontifying  *temp*<3>... (regexps...............)
Fontifying  *temp*<3>... (regexps................)
Fontifying  *temp*<3>... (regexps.................)
Fontifying  *temp*<3>... (regexps..................)
Fontifying  *temp*<3>... (regexps...................)
Fontifying  *temp*<3>... (regexps....................)
Fontifying  *temp*<3>... (regexps.....................)
Fontifying  *temp*<3>... (regexps......................)
Fontifying  *temp*<3>... (regexps.......................)
Fontifying  *temp*<3>... (regexps........................)
Fontifying  *temp*<3>... (regexps.........................)
Fontifying  *temp*<3>... (regexps..........................)
Fontifying  *temp*<3>... (regexps...........................)
Fontifying  *temp*<3>... (regexps............................)
Fontifying  *temp*<3>... (regexps.............................)
Fontifying  *temp*<3>... (regexps..............................)
Fontifying  *temp*<3>... (regexps...............................)
Fontifying  *temp*<3>... (regexps................................)
Fontifying  *temp*<3>... (regexps.................................)
Fontifying  *temp*<3>... (regexps..................................)
Fontifying  *temp*<3>... (regexps...................................)
Fontifying  *temp*<3>... (regexps....................................)
Fontifying  *temp*<3>... (regexps.....................................)
Fontifying  *temp*<3>... (regexps......................................)
Fontifying  *temp*<3>... (regexps.......................................)
Fontifying  *temp*<3>... (regexps........................................)
Exporting...
HTML export done, pushed to kill ring and clipboard
OVERVIEW
Mark set
Exporting...
Exporting...
HTML export done, pushed to kill ring and clipboard
OVERVIEW
Mark set
Debugger entered--Lisp error: (wrong-number-of-arguments copy-file 6)
  (copy-file f target t t t t)
  (let ((target ...)) (mkdir (file-name-directory target) t) (copy-file f target t t t t))
  (while (consp --cl-var--) (setq f (car --cl-var--)) (let (...) (mkdir ... t) (copy-file f target t t t t)) (setq --cl-var-- (cdr --cl-var--)))
  (let* ((--cl-var-- linked-files) (f nil)) (while (consp --cl-var--) (setq f ...) (let ... ... ...) (setq --cl-var-- ...)) nil)
  (catch (quote --cl-block-nil--) (let* (... ...) (while ... ... ... ...) nil))
  (cl-block-wrapper (catch (quote --cl-block-nil--) (let* ... ... nil)))
  (block nil (let* (... ...) (while ... ... ... ...) nil))
  (loop for f in linked-files do (let (...) (mkdir ... t) (copy-file f target t t t t)))
  (let* ((title ...) (tags ...) (timestamp ...) (year ...) (month ...) (day ...) (category ...) (page ...) (filename ...) (filepath ...) (htmlfile ...) (content ...) (linked-files ...)) (when page (setq htmlfile page filename ... filepath ...)) (loop for f in linked-files do (let ... ... ...)) (make-ob:post :title title :tags tags :timestamp timestamp :year year :month month :day day :filename filename :filepath filepath :path-to-root (file-relative-name "." filepath) :htmlfile htmlfile :template (or ... ...) :content content :content-html (ob-export-string-to-html content) :category category))
  (progn (let* (... ... ... ... ... ... ... ... ... ... ... ... ...) (when page ...) (loop for f in linked-files do ...) (make-ob:post :title title :tags tags :timestamp timestamp :year year :month month :day day :filename filename :filepath filepath :path-to-root ... :htmlfile htmlfile :template ... :content content :content-html ... :category category)))
  (if (search-forward-regexp org-complex-heading-regexp (point-at-eol) t) (progn (let* ... ... ... ...)))
  (when (search-forward-regexp org-complex-heading-regexp (point-at-eol) t) (let* (... ... ... ... ... ... ... ... ... ... ... ... ...) (when page ...) (loop for f in linked-files do ...) (make-ob:post :title title :tags tags :timestamp timestamp :year year :month month :day day :filename filename :filepath filepath :path-to-root ... :htmlfile htmlfile :template ... :content content :content-html ... :category category)))
  ob-parse-entry()
  (save-current-buffer (set-buffer (marker-buffer marker)) (goto-char (marker-position marker)) (ob-parse-entry))
  (with-current-buffer (marker-buffer marker) (goto-char (marker-position marker)) (ob-parse-entry))
  (list (with-current-buffer (marker-buffer marker) (goto-char ...) (ob-parse-entry)))
  (nconc posts (list (with-current-buffer ... ... ...)))
  (setq posts (nconc posts (list ...)))
  (while (consp --cl-var--) (setq marker (car --cl-var--)) (setq posts (nconc posts ...)) (setq --cl-var-- (cdr --cl-var--)))
  (let* ((--cl-var-- markers) (marker nil) (posts nil) (posts nil)) (while (consp --cl-var--) (setq marker ...) (setq posts ...) (setq --cl-var-- ...)) (loop for post in (sort posts ...) with id = 0 do (setf ... id) and do (incf id 1) and collect post))
  (catch (quote --cl-block-nil--) (let* (... ... ... ...) (while ... ... ... ...) (loop for post in ... with id = 0 do ... and do ... and collect post)))
  (cl-block-wrapper (catch (quote --cl-block-nil--) (let* ... ... ...)))
  (block nil (let* (... ... ... ...) (while ... ... ... ...) (loop for post in ... with id = 0 do ... and do ... and collect post)))
  (loop for marker in markers with posts = nil collect (with-current-buffer (marker-buffer marker) (goto-char ...) (ob-parse-entry)) into posts finally return (loop for post in (sort posts ...) with id = 0 do (setf ... id) and do (incf id 1) and collect post))
  (save-excursion (loop for marker in markers with posts = nil collect (with-current-buffer ... ... ...) into posts finally return (loop for post in ... with id = 0 do ... and do ... and collect post)))
  ob-parse-entries((#<marker at 16762 in sample.org> #<marker at 17933 in sample.org> #<marker at 18432 in sample.org> #<marker at 24735 in sample.org> #<marker at 25495 in sample.org>))
  (let* ((start-time ...) (default-directory ...) (BLOG ...) (POSTS ...) (ALL-POSTS POSTS) (STATIC ...) (SNIPPETS ...) (TAGS ...)) (ob-write-static) (ob-write-posts) (ob-write-tags) (ob-write-index) (copy-directory (format "%s/%s" ... ...) (ob:blog-publish-dir BLOG)) (run-hooks (quote o-blog-after-publish-hook)) (message (format "Blog %s published in %ss" file ...)))
  (save-current-buffer (set-buffer (or ... ...)) (run-hooks (quote o-blog-before-publish-hook)) (let* (... ... ... ... ... ... ... ...) (ob-write-static) (ob-write-posts) (ob-write-tags) (ob-write-index) (copy-directory ... ...) (run-hooks ...) (message ...)))
  (with-current-buffer (or (get-file-buffer file) (find-file file)) (run-hooks (quote o-blog-before-publish-hook)) (let* (... ... ... ... ... ... ... ...) (ob-write-static) (ob-write-posts) (ob-write-tags) (ob-write-index) (copy-directory ... ...) (run-hooks ...) (message ...)))
  org-publish-blog-sync("~/.emacs.d/o-blog/example/sample.org")
  (if async (org-publish-blog-async file) (org-publish-blog-sync file))
  org-publish-blog("~/.emacs.d/o-blog/example/sample.org")
  (let ((debug-on-error t)) (require (quote o-blog)) (require (quote o-blog-admonition)) (org-publish-blog "~/.emacs.d/o-blog/example/sample.org") (message (emacs-version)) (org-version))
  eval((let ((debug-on-error t)) (require (quote o-blog)) (require (quote o-blog-admonition)) (org-publish-blog "~/.emacs.d/o-blog/example/sample.org") (message (emacs-version)) (org-version)))
  command-line-1(("-L" "~/local/site-lisp/org/lisp" "-L" "~/.emacs.d/o-blog" "--eval" "(let ((debug-on-error t)) (require 'o-blog) (require 'o-blog-admonition) (org-publish-blog \"~/.emacs.d/o-blog/example/sample.org\") (message (emacs-version)) (org-version))"))
  command-line()
  normal-top-level()
renard commented 12 years ago

Hi

Yep the copy-file function is not the same in emacs23 Can you please remove the last "t" from the copy-file function?

(copy-file f target t t t)

instead of

(copy-file f target t t t t)
paulprovost commented 12 years ago

Closer still! I now generate without errors. But the resulting html has a couple of issues:

  <head>
    <meta charset="utf-8"/>
    <title>Quick start Guide</title>
    <link rel="stylesheet" type="text/less" href="./style/css/o-blog.less">
    <script src="./style/js/less-1.2.1.min.js" type="text/javascript"></script>
    <script src="./style/js/jquery-1.7.1.min.js" type="text/javascript"></script>
    <!-- <script src="./style/js/jquery.tableofcontents.min.js" type="text/javascript"></script> -->
    <script src="./style/js/bootstrap-dropdown.js" type="text/javascript"></script>
    Lisp error in nil: (void-variable org-export-xhtml-scripts)
  </head>

which does not point to the right js and css directories. Removing the /styles prefix by hand makes them render correctly.

Lisp error in nil: (void-variable org-export-xhtml-scripts)

Related?

We're making progress!

Thanks for your patience!

paulprovost commented 12 years ago

Further info.

Generating from within emacs makes the second problem go away. But the 'styles' prefix is still in the generated html.

Thanks!

renard commented 12 years ago

yep it is because =org-export-xhtml-scripts= is known from =org-xhtml=.

Meanwhile the require is in the source.

May I close the bug?

paulprovost commented 12 years ago

There is still the issue with the extra "style" in the stylesheet and script directives in the generated html.

Will you want to roll the changes into the master?

Paul