Re: [O] Bug: Exception when trying to export inlined-code [8.3.4 (8.3.4-9-gfda14f-elpa @ ~/.emacs.d/elpa/org-20160307/)]

2016-03-13 Thread Nicolas Goaziou
Hello,

Shlomi Vaknin  writes:

> Does the cache persist to disk? Can I clear it?

It doesn't. You can clear it with `org-element-cache-reset'.


Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: Exception when trying to export inlined-code [8.3.4 (8.3.4-9-gfda14f-elpa @ ~/.emacs.d/elpa/org-20160307/)]

2016-03-13 Thread Shlomi Vaknin
Hey,


> You can call `org-reload' with an universal argument.

Oh thanks, noted!


> This is indeed a cache corruption.

Does the cache persist to disk? Can I clear it?

I can recall exactly what I did, but after playing around with some things,
exporting started working again on without setting the cache to nil. I
guess I did clear that cache, and would love to know how ;)

Thanks a lot for all your help,
Shlomi


Re: [O] Bug: Exception when trying to export inlined-code [8.3.4 (8.3.4-9-gfda14f-elpa @ ~/.emacs.d/elpa/org-20160307/)]

2016-03-13 Thread Nicolas Goaziou
Hello,

Shlomi Vaknin  writes:

> Without setting it to nil, here is the complete backtrace of an uncompiled
> org (I simply erased all elc files, that sufficient, right?)

You can call `org-reload' with an universal argument.

> Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
>   goto-char(nil)

This is indeed a cache corruption. Unfortunately, the backtrace doesn't
help to tell what action is responsible for that.

Thank you anyway.


Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: Exception when trying to export inlined-code [8.3.4 (8.3.4-9-gfda14f-elpa @ ~/.emacs.d/elpa/org-20160307/)]

2016-03-11 Thread Shlomi Vaknin
Hey Nicholas,

Thanks for trying to help! Setting org-element-use-cache to nil did the
trick, it now export just fine in both elpa version of org and on master,
thanks!

Without setting it to nil, here is the complete backtrace of an uncompiled
org (I simply erased all elc files, that sufficient, right?)

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  goto-char(nil)
  (progn (goto-char contents-end) (skip-chars-forward "
\n" limit) (if (= (point) limit) limit (line-beginning-position)))
  (let* ((struct (or structure (org-element--list-struct limit))) (type
(cond ((org-looking-at-p "[ ]*[A-Za-z0-9]") (quote ordered)) ((nth 5 (assq
(point) struct)) (quote descriptive)) (t (quote unordered
(contents-begin (point)) (begin (car affiliated)) (contents-end (let*
((item (assq contents-begin struct)) (ind (nth 1 item)) (pos (nth 6 item)))
(while (and (setq item (assq pos struct)) (= (nth 1 item) ind)) (setq pos
(nth 6 item))) pos)) (end (progn (goto-char contents-end)
(skip-chars-forward "
\n" limit) (if (= (point) limit) limit (line-beginning-position) (list
(quote plain-list) (nconc (list :type type :begin begin :end end
:contents-begin contents-begin :contents-end contents-end :structure struct
:post-blank (count-lines contents-end end) :post-affiliated contents-begin)
(cdr affiliated
  (save-excursion (let* ((struct (or structure (org-element--list-struct
limit))) (type (cond ((org-looking-at-p "[ ]*[A-Za-z0-9]") (quote ordered))
((nth 5 (assq ... struct)) (quote descriptive)) (t (quote unordered
(contents-begin (point)) (begin (car affiliated)) (contents-end (let*
((item (assq contents-begin struct)) (ind (nth 1 item)) (pos (nth 6 item)))
(while (and (setq item ...) (= ... ind)) (setq pos (nth 6 item))) pos))
(end (progn (goto-char contents-end) (skip-chars-forward "
\n" limit) (if (= (point) limit) limit (line-beginning-position) (list
(quote plain-list) (nconc (list :type type :begin begin :end end
:contents-begin contents-begin :contents-end contents-end :structure struct
:post-blank (count-lines contents-end end) :post-affiliated contents-begin)
(cdr affiliated)
  org-element-plain-list-parser(122 (86) ((28 2 "- " nil nil nil 51) (51 2
"-" nil nil nil 55) (55 2 "-" nil nil nil 59) (59 2 "-" nil nil nil 63) (63
2 "- " nil nil nil 99) (99 2 "- " nil nil nil 135) (135 2 "- " nil nil nil
158)))
  (cond ((and (cdr affiliated) (>= (point) limit)) (goto-char (car
affiliated)) (org-element-keyword-parser limit nil)) ((looking-at
org-element--latex-begin-environment) (org-element-latex-environment-parser
limit affiliated)) ((looking-at org-drawer-regexp)
(org-element-drawer-parser limit affiliated)) ((looking-at "[ ]*:\\(
\\|$\\)") (org-element-fixed-width-parser limit affiliated)) ((looking-at
"[ ]*#") (goto-char (match-end 0)) (cond ((looking-at "\\(?: \\|$\\)")
(beginning-of-line) (org-element-comment-parser limit affiliated))
((looking-at "\\+BEGIN_\\(\\S-+\\)") (beginning-of-line) (funcall (let*
((val ...)) (cond (... ...) (... ...) (... ...) (... ...) (... ...) (...
...) (... ...) (t ...))) limit affiliated)) ((looking-at "\\+CALL:")
(beginning-of-line) (org-element-babel-call-parser limit affiliated))
((looking-at "\\+BEGIN:? ") (beginning-of-line)
(org-element-dynamic-block-parser limit affiliated)) ((looking-at
"\\+\\S-+:") (beginning-of-line) (org-element-keyword-parser limit
affiliated)) (t (beginning-of-line) (org-element-paragraph-parser limit
affiliated ((looking-at org-footnote-definition-re)
(org-element-footnote-definition-parser limit affiliated))
((looking-at "[ ]*-\\{5,\\}[
]*$") (org-element-horizontal-rule-parser limit affiliated)) ((looking-at
"%%(") (org-element-diary-sexp-parser limit affiliated)) ((looking-at
"[ ]*\\(|\\|\\+\\(-+\\+\\)+[
]*$\\)") (org-element-table-parser limit affiliated)) ((looking-at
(org-item-re)) (org-element-plain-list-parser limit affiliated (or
structure (org-element--list-struct limit (t
(org-element-paragraph-parser limit affiliated)))
  (let ((affiliated (org-element--collect-affiliated-keywords limit)))
(cond ((and (cdr affiliated) (>= (point) limit)) (goto-char (car
affiliated)) (org-element-keyword-parser limit nil)) ((looking-at
org-element--latex-begin-environment) (org-element-latex-environment-parser
limit affiliated)) ((looking-at org-drawer-regexp)
(org-element-drawer-parser limit affiliated)) ((looking-at "[ ]*:\\(
\\|$\\)") (org-element-fixed-width-parser limit affiliated)) ((looking-at
"[ ]*#") (goto-char (match-end 0)) (cond ((looking-at "\\(?: \\|$\\)")
(beginning-of-line) (org-element-comment-parser limit affiliated))
((looking-at "\\+BEGIN_\\(\\S-+\\)") (beginning-of-line) (funcall (let*
(...) (cond ... ... ... ... ... ... ... ...)) limit affiliated))
((looking-at "\\+CALL:") (beginning-of-line) (org-element-babel-call-parser
limit affiliated)) ((looking-at "\\+BEGIN:? ") (beginning-of-line)
(org-element-dynamic-block-parser limit affiliated)) ((looking-at
"\\+\\S-+:") 

Re: [O] Bug: Exception when trying to export inlined-code [8.3.4 (8.3.4-9-gfda14f-elpa @ ~/.emacs.d/elpa/org-20160307/)]

2016-03-10 Thread Nicolas Goaziou
Hello,

Shlomi Vaknin  writes:

> I managed to make another non-working example (should I make
> a gif showing what I see?):
>
> ---
>  - src_elisp{3} {{{results(=3=)}}}
>
> * B
>   - src_elisp{3} {{{results(=3=)}}}
>   -
>   -
>   -
>   - src_elisp{3} {{{results(=3=)}}}
>   - src_elisp{2} {{{results(=2=)}}}
>   - {{{results(=2=)}}}
> ---
>
> again, removing any line from this makes export work again. Otherwise I get
> =org-element--current-element: Wrong type argument: integer-or-marker-p,
> nil=

I cannot reproduce the problem. Could you send a complete backtrace with
un-compiled Org?

Also, could you try setting `org-element-use-cache' to nil?

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: Exception when trying to export inlined-code [8.3.4 (8.3.4-9-gfda14f-elpa @ ~/.emacs.d/elpa/org-20160307/)]

2016-03-09 Thread Bill Burdick
(Hi Shlomi!)

When I export this to html, I get what looks to be the same error.  Here's
some info that may help track this down.

My org-version line:
Org-mode version 8.3.4 (8.3.4-9-gfda14f-elpaplus @
c:/Users/bill/.emacs.d/elpa/org-plus-contrib-20160307/)

The error I get:
org-element--current-element: Wrong type argument: integer-or-marker-p, nil
[2 times]

The stack trace:

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  org-element-plain-list-parser(122 (86) ((28 2 "- " nil nil nil 51) (51 2
"-" nil nil nil 55) (55 2 "-" nil nil nil 59) (59 2 "-" nil nil nil 63) (63
2 "- " nil nil nil 99) (99 2 "- " nil nil nil 135) (135 2 "- " nil nil nil
158)))
  org-element--current-element(122 element nil ((28 2 "- " nil nil nil 51)
(51 2 "-" nil nil nil 55) (55 2 "-" nil nil nil 59) (59 2 "-" nil nil nil
63) (63 2 "- " nil nil nil 99) (99 2 "- " nil nil nil 135) (135 2 "- " nil
nil nil 158)))
  org-element--parse-to(101)
  org-element-at-point()
  org-element-context()
  org-babel-exp-process-buffer(#<2>>)
  (unwind-protect (org-babel-exp-process-buffer reference) (kill-buffer
reference))
  (let ((reference (org-export-copy-buffer))) (unwind-protect
(org-babel-exp-process-buffer reference) (kill-buffer reference)))
  org-export-execute-babel-code()
  (progn (run-hook-with-args (quote org-export-before-processing-hook)
(progn nil (or (and (memq (aref backend 0)
cl-struct-org-export-backend-tags)) (signal (quote wrong-type-argument)
(list (quote org-export-backend) backend))) (aref backend 1)))
(org-export-expand-include-keyword) (org-export--delete-comments)
(org-macro-initialize-templates) (org-macro-replace-all org-macro-templates
nil parsed-keywords) (org-set-regexps-and-options)
(org-update-radio-target-regexp) (org-export-execute-babel-code)
(org-set-regexps-and-options) (org-update-radio-target-regexp) (goto-char
(point-min)) (save-excursion (run-hook-with-args (quote
org-export-before-parsing-hook) (progn nil (or (and (memq (aref backend 0)
cl-struct-org-export-backend-tags)) (signal (quote wrong-type-argument)
(list (quote org-export-backend) backend))) (aref backend 1
(org-set-regexps-and-options) (org-update-radio-target-regexp) (setq info
(org-export-install-filters (org-combine-plists info
(org-export-get-environment backend subtreep ext-plist (let
((backend-name (progn nil (or (and (memq ...
cl-struct-org-export-backend-tags)) (signal (quote wrong-type-argument)
(list ... backend))) (aref backend 1 (let ((--dolist-tail-- (plist-get
info :filter-options)) filter) (while --dolist-tail-- (setq filter (car
--dolist-tail--)) (let ((result (funcall filter info backend-name))) (if
result (progn (setq info result (setq --dolist-tail-- (cdr
--dolist-tail--) (org-macro-replace-all (list (cons "author"
(org-element-interpret-data (plist-get info :author))) (cons "date" (let*
((date (plist-get info :date)) (value (or ... ""))) (if (and (consp date)
(not ...) (eq ... ...)) (format "(eval (if (org-string-nw-p \"$1\") %s
%S))" (format "(org-timestamp-format '%S \"$1\")" ...) value) value)))
(cons "email" (org-element-interpret-data (plist-get info :email))) (cons
"title" (org-element-interpret-data (plist-get info :title))) (cons
"results" "$1")) (quote finalize) parsed-keywords) (setq tree
(org-element-parse-buffer nil visible-only))
(org-export--merge-external-footnote-definitions tree)
(org-export--prune-tree tree info) (org-export--remove-uninterpreted-data
tree info) (setq tree (org-export-filter-apply-functions (plist-get info
:filter-parse-tree) tree info)) (setq info (org-combine-plists info
(org-export-collect-tree-properties tree info))) (let* ((body
(org-element-normalize-string (or (org-export-data tree info) "")))
(inner-template (cdr (assq (quote inner-template) (plist-get info
:translate-alist (full-body (org-export-filter-apply-functions
(plist-get info :filter-body) (if (not (functionp inner-template)) body
(funcall inner-template body info)) info)) (template (cdr (assq (quote
template) (plist-get info :translate-alist) (org-no-properties
(org-export-filter-apply-functions (plist-get info :filter-final-output)
(if (or (not (functionp template)) body-only) full-body (funcall template
full-body info)) info
  (save-current-buffer (set-buffer --buf-copy) (goto-char (point-min))
(progn (run-hook-with-args (quote org-export-before-processing-hook) (progn
nil (or (and (memq (aref backend 0) cl-struct-org-export-backend-tags))
(signal (quote wrong-type-argument) (list (quote org-export-backend)
backend))) (aref backend 1))) (org-export-expand-include-keyword)
(org-export--delete-comments) (org-macro-initialize-templates)
(org-macro-replace-all org-macro-templates nil parsed-keywords)
(org-set-regexps-and-options) (org-update-radio-target-regexp)
(org-export-execute-babel-code) (org-set-regexps-and-options)
(org-update-radio-target-regexp) (goto-char (point-min)) (save-excursion
(run-hook-with-args (quote org-export-before-parsing-hook) (progn 

Re: [O] Bug: Exception when trying to export inlined-code [8.3.4 (8.3.4-9-gfda14f-elpa @ ~/.emacs.d/elpa/org-20160307/)]

2016-03-09 Thread Shlomi Vaknin
>
> Its been in master since Jan 2015.

Yeah, I guess I didnt update my packages in quite a while :P


>
> It works for me as does the same with `emacs-lisp' as the language
> under latex or html export to buffer or file using: Org-mode version
> 8.3.4 (release_8.3.4-635-g268486 ...) producing the expected document.
>
> Not sure what gives. Perhaps a mixed installation of org-mode?
>

So I checked this (to the best of my knowledge), I searched and removed
everything that had to do with org-mode, got master, compiled and installed
it. (org-version) now gives "Org-mode version 8.3.4
(release_8.3.4-635-g268486 @ ~/org-mode/org-mode/lisp/)"

and although the minimal example I posted above *does* work now, my real
file does not. I managed to make another non-working example (should I make
a gif showing what I see?):

---
 - src_elisp{3} {{{results(=3=)}}}

* B
  - src_elisp{3} {{{results(=3=)}}}
  -
  -
  -
  - src_elisp{3} {{{results(=3=)}}}
  - src_elisp{2} {{{results(=2=)}}}
  - {{{results(=2=)}}}
---

again, removing any line from this makes export work again. Otherwise I get
=org-element--current-element: Wrong type argument: integer-or-marker-p,
nil=

This might be something silly, but I really dont know what else to do and I
am quite stuck, I need to present my org file to emacs-hostile people :|

I have a new installation of emacs (used =find= to remove all other emacs
paths), new org-mode compiled from source (looked through =find= as well as
checked all 'load-path locations and removed anything I found) and no
custom init files What else could I check on my system?

I am using a mac, if that makes any differences..

Thanks for your help!


[O] Bug: Exception when trying to export inlined-code [8.3.4 (8.3.4-9-gfda14f-elpa @ ~/.emacs.d/elpa/org-20160307/)]

2016-03-09 Thread Shlomi Vaknin
Hey, I am a dedicated org-mode user, and I absolutely love it! This is my
first post to this group.

Recently, one of my org files stopped being exportable (does not matter
what I try to export to). I traced the problem to be related to the new
inlined code result block {{{result()}}}. I tried a fresh installation of
emacs, with nothing extra installed and no custom configuration files with
the latest org mode, but the problem persists.

I am getting an exception =Wrong type argument: integer-or-marker-p,nil=
when trying to export my org file. I managed to systematically remove lines
from the file until I was left with the following skeleton that still
produces the problem in my setup:

--
* Test a
  - src_elisp{3}

* Test Q
  - src_elisp{3}
  - test
  - something
- src_elisp{3}
- src_elisp{3} {{{results(=3=)}}}
  src_elisp{3} {{{results(=3=)}}}
--

Interesting enough, if I remove any of these lines, the exporter works
again..
I am not sure why I am getting this problem, and would appreciate if anyone
else tries this out to know if its just a problem in my setup or is it a
legitimate bug.

Here is the backtrace:
Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  org-element-plain-list-parser(98 (60) ((25 2 "- " nil nil nil 30) (30 2
"- " nil nil nil 39) (39 2 "- " nil nil nil 110) (53 4 "- " nil nil nil 72)
(72 4 "- " nil nil nil 110)))
  org-element--current-element(98 element nil ((25 2 "- " nil nil nil 30)
(30 2 "- " nil nil nil 39) (39 2 "- " nil nil nil 110) (53 4 "- " nil nil
nil 72) (72 4 "- " nil nil nil 110)))
  org-element--parse-to(77)
  org-element-at-point()
  org-element-context()
  org-babel-exp-process-buffer(#<2>>)
  org-export-execute-babel-code()
  org-export-as(html nil nil nil (:output-file "./org-bug.html"))
  org-export-to-file(html "./org-bug.html" nil nil nil nil nil)
  org-html-export-to-html(nil nil nil nil)
  org-export-dispatch(nil)
  funcall-interactively(org-export-dispatch nil)
  call-interactively(org-export-dispatch nil nil)
  command-execute(org-export-dispatch)


Emacs  : GNU Emacs 25.1.50.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21
Version 10.9.5 (Build 13F1603)) of 2016-03-09
Package: Org-mode version 8.3.4 (8.3.4-9-gfda14f-elpa @
~/.emacs.d/elpa/org-20160307/)

current state:
==
(setq
 org-tab-first-hook '(org-hide-block-toggle-maybe
org-babel-hide-result-toggle-maybe org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-default-hook
org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-html-format-drawer-function '(lambda (name contents) contents)
 org-latex-format-inlinetask-function
'org-latex-format-inlinetask-default-function
 org-confirm-shell-link-function 'yes-or-no-p
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-latex-format-headline-function
'org-latex-format-headline-default-function
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-latex-format-drawer-function '(lambda (name contents) contents)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '(#[nil "\300\301\302\303\304$\207" [org-add-hook
change-major-mode-hook org-show-block-all append local] 5]
#[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook
org-babel-show-result-all append local] 5]
(lambda nil (org-add-hook (quote change-major-mode-hook) (quote
org-show-block-all) (quote append) (quote local)))
(lambda nil
 (org-add-hook (quote change-major-mode-hook) (quote
org-babel-show-result-all) (quote append) (quote local)))
org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-ascii-format-drawer-function '(lambda (name contents width) contents)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
org-babel-execute-safely-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
org-cycle-show-empty-lines
 org-optimize-window-after-visibility-change)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-html-format-headline-function
'org-html-format-headline-default-function
 org-html-format-inlinetask-function
'org-html-format-inlinetask-default-function
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 )