alphapapa / org-graph-view

View Org buffers as a clickable, graphical mind-map
216 stars 7 forks source link

Getting error #1

Closed michaelsjackson closed 4 years ago

michaelsjackson commented 4 years ago

Dear Adam, thanks for sharing this, looks great, wanted to try it quickly, but did get an error message.

I am seeing these requirements:

;;;; Requirements

(require 'cl-lib)
(require 'org)
(require 'subr-x)

(require 'dash)
(require 'graph)

I have org and dash, how can I install the rest? What are the package names in melpa listing? Thanks in advance.

If this would work, the only wish I would want is being able to export as latex-pdf into a subdirectory on harddisk, according to the tree structure. We could collect information in one bigger .org file, having its graph view, as you developed here, then, when wanting smaller pieces of sub-information in pdf form, this missing command could do the trick.

alphapapa commented 4 years ago

Hi Michael,

There is nothing else to install. The top 3 are part of Emacs, and graph is included in this repo.

I don't know about your LaTeX idea. This is just an early prototype. :)

michaelsjackson commented 4 years ago

This is what I am getting with a simple test of

Debugger entered--Lisp error: (void-function when-let*) (when-let* ((color (org-entry-get begin "color"))) (list :foreground color)) (or (when-let* ((color (org-entry-get begin "color"))) (list :foreground color)) (if level (progn (nth level org-level-faces)))) (let* ((begin (plist-get input0 :begin)) (level (plist-get input0 :level))) (or (when-let* ((color (org-entry-get begin "color"))) (list :foreground color)) (if level (progn (nth level org-level-faces))))) (let ((input0 properties)) (let* ((begin (plist-get input0 :begin)) (level (plist-get input0 :level))) (or (when-let* ((color (org-entry-get begin "color"))) (list :foreground color)) (if level (progn (nth level org-level-faces)))))) (closure ((--cl-face-- closure #1 (properties) (let ((input0 properties)) (let* ((begin (plist-get input0 :begin)) (level (plist-get input0 :level))) (or (when-let* (...) (list :foreground color)) (if level (progn ...)))))) (--cl-heading-string-- closure #1 (properties) (let* ((heading (plist-get properties :raw-value)) (face (funcall --cl-face-- properties))) (if heading (progn (propertize heading (quote face) face (quote properties) (plist-put properties :buffer ...)))))) (--cl-rec-- closure #1 (tree) (let ((input0 tree)) (let* ((--dash-source-1-- (cdr input0)) (properties (car-safe ...)) (children --dash-source-1--)) (if properties (cons (funcall --cl-heading-string-- properties) (mapcar --cl-rec-- children)) (mapcar --cl-rec-- children))))) t) (properties) (let ((input0 properties)) (let* ((begin (plist-get input0 :begin)) (level (plist-get input0 :level))) (or (when-let* ((color (org-entry-get begin "color"))) (list :foreground color)) (if level (progn (nth level org-level-faces)))))))((:raw-value "three" :begin 31 :end 39 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 31 :title "three" :parent (org-data nil (headline #0)))) funcall((closure ((--cl-face-- closure #1 (properties) (let ((input0 properties)) (let* ((begin (plist-get input0 :begin)) (level (plist-get input0 :level))) (or (when-let* (...) (list :foreground color)) (if level (progn ...)))))) (--cl-heading-string-- closure #1 (properties) (let* ((heading (plist-get properties :raw-value)) (face (funcall --cl-face-- properties))) (if heading (progn (propertize heading (quote face) face (quote properties) (plist-put properties :buffer ...)))))) (--cl-rec-- closure #1 (tree) (let ((input0 tree)) (let* ((--dash-source-1-- (cdr input0)) (properties (car-safe ...)) (children --dash-source-1--)) (if properties (cons (funcall --cl-heading-string-- properties) (mapcar --cl-rec-- children)) (mapcar --cl-rec-- children))))) t) (properties) (let ((input0 properties)) (let* ((begin (plist-get input0 :begin)) (level (plist-get input0 :level))) (or (when-let* ((color (org-entry-get begin "color"))) (list :foreground color)) (if level (progn (nth level org-level-faces))))))) (:raw-value "three" :begin 31 :end 39 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 31 :title "three" :parent (org-data nil (headline #0)))) (let* ((heading (plist-get properties :raw-value)) (face (funcall --cl-face-- properties))) (if heading (progn (propertize heading (quote face) face (quote properties) (plist-put properties :buffer (current-buffer)))))) (closure ((--cl-face-- closure #1 (properties) (let ((input0 properties)) (let* ((begin (plist-get input0 :begin)) (level (plist-get input0 :level))) (or (when-let* (...) (list :foreground color)) (if level (progn ...)))))) (--cl-heading-string-- closure #1 (properties) (let* ((heading (plist-get properties :raw-value)) (face (funcall --cl-face-- properties))) (if heading (progn (propertize heading (quote face) face (quote properties) (plist-put properties :buffer ...)))))) (--cl-rec-- closure #1 (tree) (let ((input0 tree)) (let* ((--dash-source-1-- (cdr input0)) (properties (car-safe ...)) (children --dash-source-1--)) (if properties (cons (funcall --cl-heading-string-- properties) (mapcar --cl-rec-- children)) (mapcar --cl-rec-- children))))) t) (properties) (let* ((heading (plist-get properties :raw-value)) (face (funcall --cl-face-- properties))) (if heading (progn (propertize heading (quote face) face (quote properties) (plist-put properties :buffer (current-buffer)))))))((:raw-value "three" :begin 31 :end 39 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 31 :title "three" :parent (org-data nil (headline #0)))) funcall((closure ((--cl-face-- closure #1 (properties) (let ((input0 properties)) (let* ((begin (plist-get input0 :begin)) (level (plist-get input0 :level))) (or (when-let* (...) (list :foreground color)) (if level (progn ...)))))) (--cl-heading-string-- closure #1 (properties) (let* ((heading (plist-get properties :raw-value)) (face (funcall --cl-face-- properties))) (if heading (progn (propertize heading (quote face) face (quote properties) (plist-put properties :buffer ...)))))) (--cl-rec-- closure #1 (tree) (let ((input0 tree)) (let* ((--dash-source-1-- (cdr input0)) (properties (car-safe ...)) (children --dash-source-1--)) (if properties (cons (funcall --cl-heading-string-- properties) (mapcar --cl-rec-- children)) (mapcar --cl-rec-- children))))) t) (properties) (let* ((heading (plist-get properties :raw-value)) (face (funcall --cl-face-- properties))) (if heading (progn (propertize heading (quote face) face (quote properties) (plist-put properties :buffer (current-buffer))))))) (:raw-value "three" :begin 31 :end 39 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 31 :title "three" :parent (org-data nil (headline #0)))) (cons (funcall --cl-heading-string-- properties) (mapcar --cl-rec-- children)) (if properties (cons (funcall --cl-heading-string-- properties) (mapcar --cl-rec-- children)) (mapcar --cl-rec-- children)) (let* ((--dash-source-1-- (cdr input0)) (properties (car-safe (prog1 --dash-source-1-- (setq --dash-source-1-- (cdr --dash-source-1--))))) (children --dash-source-1--)) (if properties (cons (funcall --cl-heading-string-- properties) (mapcar --cl-rec-- children)) (mapcar --cl-rec-- children))) (let ((input0 tree)) (let* ((--dash-source-1-- (cdr input0)) (properties (car-safe (prog1 --dash-source-1-- (setq --dash-source-1-- (cdr --dash-source-1--))))) (children --dash-source-1--)) (if properties (cons (funcall --cl-heading-string-- properties) (mapcar --cl-rec-- children)) (mapcar --cl-rec-- children)))) (closure ((--cl-face-- closure #1 (properties) (let ((input0 properties)) (let* ((begin (plist-get input0 :begin)) (level (plist-get input0 :level))) (or (when-let* (...) (list :foreground color)) (if level (progn ...)))))) (--cl-heading-string-- closure #1 (properties) (let* ((heading (plist-get properties :raw-value)) (face (funcall --cl-face-- properties))) (if heading (progn (propertize heading (quote face) face (quote properties) (plist-put properties :buffer ...)))))) (--cl-rec-- closure #1 (tree) (let ((input0 tree)) (let* ((--dash-source-1-- (cdr input0)) (properties (car-safe ...)) (children --dash-source-1--)) (if properties (cons (funcall --cl-heading-string-- properties) (mapcar --cl-rec-- children)) (mapcar --cl-rec-- children))))) t) (tree) (let ((input0 tree)) (let* ((--dash-source-1-- (cdr input0)) (properties (car-safe (prog1 --dash-source-1-- (setq --dash-source-1-- ...)))) (children --dash-source-1--)) (if properties (cons (funcall --cl-heading-string-- properties) (mapcar --cl-rec-- children)) (mapcar --cl-rec-- children)))))((headline (:raw-value "three" :begin 31 :end 39 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 31 :title "three" :parent (org-data nil #0)))) mapcar((closure ((--cl-face-- closure #1 (properties) (let ((input0 properties)) (let* ((begin (plist-get input0 :begin)) (level (plist-get input0 :level))) (or (when-let* (...) (list :foreground color)) (if level (progn ...)))))) (--cl-heading-string-- closure #1 (properties) (let* ((heading (plist-get properties :raw-value)) (face (funcall --cl-face-- properties))) (if heading (progn (propertize heading (quote face) face (quote properties) (plist-put properties :buffer ...)))))) (--cl-rec-- closure #1 (tree) (let ((input0 tree)) (let* ((--dash-source-1-- (cdr input0)) (properties (car-safe ...)) (children --dash-source-1--)) (if properties (cons (funcall --cl-heading-string-- properties) (mapcar --cl-rec-- children)) (mapcar --cl-rec-- children))))) t) (tree) (let ((input0 tree)) (let* ((--dash-source-1-- (cdr input0)) (properties (car-safe (prog1 --dash-source-1-- (setq --dash-source-1-- ...)))) (children --dash-source-1--)) (if properties (cons (funcall --cl-heading-string-- properties) (mapcar --cl-rec-- children)) (mapcar --cl-rec-- children))))) ((headline (:raw-value "three" :begin 31 :end 39 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 31 :title "three" :parent (org-data nil #1))))) (if properties (cons (funcall --cl-heading-string-- properties) (mapcar --cl-rec-- children)) (mapcar --cl-rec-- children)) (let* ((--dash-source-1-- (cdr input0)) (properties (car-safe (prog1 --dash-source-1-- (setq --dash-source-1-- (cdr --dash-source-1--))))) (children --dash-source-1--)) (if properties (cons (funcall --cl-heading-string-- properties) (mapcar --cl-rec-- children)) (mapcar --cl-rec-- children))) (let ((input0 tree)) (let* ((--dash-source-1-- (cdr input0)) (properties (car-safe (prog1 --dash-source-1-- (setq --dash-source-1-- (cdr --dash-source-1--))))) (children --dash-source-1--)) (if properties (cons (funcall --cl-heading-string-- properties) (mapcar --cl-rec-- children)) (mapcar --cl-rec-- children)))) (closure ((--cl-face-- closure #1 (properties) (let ((input0 properties)) (let* ((begin (plist-get input0 :begin)) (level (plist-get input0 :level))) (or (when-let* (...) (list :foreground color)) (if level (progn ...)))))) (--cl-heading-string-- closure #1 (properties) (let* ((heading (plist-get properties :raw-value)) (face (funcall --cl-face-- properties))) (if heading (progn (propertize heading (quote face) face (quote properties) (plist-put properties :buffer ...)))))) (--cl-rec-- closure #1 (tree) (let ((input0 tree)) (let* ((--dash-source-1-- (cdr input0)) (properties (car-safe ...)) (children --dash-source-1--)) (if properties (cons (funcall --cl-heading-string-- properties) (mapcar --cl-rec-- children)) (mapcar --cl-rec-- children))))) t) (tree) (let ((input0 tree)) (let* ((--dash-source-1-- (cdr input0)) (properties (car-safe (prog1 --dash-source-1-- (setq --dash-source-1-- ...)))) (children --dash-source-1--)) (if properties (cons (funcall --cl-heading-string-- properties) (mapcar --cl-rec-- children)) (mapcar --cl-rec-- children)))))((org-data nil (headline (:raw-value "three" :begin 31 :end 39 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 31 :title "three" :parent #0)))) funcall((closure ((--cl-face-- closure #1 (properties) (let ((input0 properties)) (let* ((begin (plist-get input0 :begin)) (level (plist-get input0 :level))) (or (when-let* (...) (list :foreground color)) (if level (progn ...)))))) (--cl-heading-string-- closure #1 (properties) (let* ((heading (plist-get properties :raw-value)) (face (funcall --cl-face-- properties))) (if heading (progn (propertize heading (quote face) face (quote properties) (plist-put properties :buffer ...)))))) (--cl-rec-- closure #1 (tree) (let ((input0 tree)) (let* ((--dash-source-1-- (cdr input0)) (properties (car-safe ...)) (children --dash-source-1--)) (if properties (cons (funcall --cl-heading-string-- properties) (mapcar --cl-rec-- children)) (mapcar --cl-rec-- children))))) t) (tree) (let ((input0 tree)) (let* ((--dash-source-1-- (cdr input0)) (properties (car-safe (prog1 --dash-source-1-- (setq --dash-source-1-- ...)))) (children --dash-source-1--)) (if properties (cons (funcall --cl-heading-string-- properties) (mapcar --cl-rec-- children)) (mapcar --cl-rec-- children))))) (org-data nil (headline (:raw-value "three" :begin 31 :end 39 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 31 :title "three" :parent #0)))) (let* ((graph-line-wid 1) (graph (funcall --cl-rec-- (org-element-parse-buffer (quote headline)))) (drawn (graph-draw-tree graph)) (inhibit-read-only t)) (save-current-buffer (set-buffer (org-graph-view-buffer)) (erase-buffer) (save-excursion (insert drawn)) (pop-to-buffer (current-buffer)))) (save-restriction (widen) (if (org-at-heading-p) (progn (org-narrow-to-subtree))) (let* ((graph-line-wid 1) (graph (funcall --cl-rec-- (org-element-parse-buffer (quote headline)))) (drawn (graph-draw-tree graph)) (inhibit-read-only t)) (save-current-buffer (set-buffer (org-graph-view-buffer)) (erase-buffer) (save-excursion (insert drawn)) (pop-to-buffer (current-buffer))))) (save-excursion (save-restriction (widen) (if (org-at-heading-p) (progn (org-narrow-to-subtree))) (let* ((graph-line-wid 1) (graph (funcall --cl-rec-- (org-element-parse-buffer (quote headline)))) (drawn (graph-draw-tree graph)) (inhibit-read-only t)) (save-current-buffer (set-buffer (org-graph-view-buffer)) (erase-buffer) (save-excursion (insert drawn)) (pop-to-buffer (current-buffer)))))) (let (--cl-rec-- --cl-heading-string-- --cl-face--) (setq --cl-rec-- (function (lambda (tree) (let ((input0 tree)) (let* ((--dash-source-1-- ...) (properties ...) (children --dash-source-1--)) (if properties (cons ... ...) (mapcar --cl-rec-- children))))))) (setq --cl-heading-string-- (function (lambda (properties) (let* ((heading (plist-get properties :raw-value)) (face (funcall --cl-face-- properties))) (if heading (progn (propertize heading ... face ... ...))))))) (setq --cl-face-- (function (lambda (properties) (let ((input0 properties)) (let* ((begin ...) (level ...)) (or (when-let* ... ...) (if level ...))))))) (save-excursion (save-restriction (widen) (if (org-at-heading-p) (progn (org-narrow-to-subtree))) (let* ((graph-line-wid 1) (graph (funcall --cl-rec-- (org-element-parse-buffer ...))) (drawn (graph-draw-tree graph)) (inhibit-read-only t)) (save-current-buffer (set-buffer (org-graph-view-buffer)) (erase-buffer) (save-excursion (insert drawn)) (pop-to-buffer (current-buffer))))))) org-graph-view() funcall-interactively(org-graph-view) call-interactively(org-graph-view record nil) command-execute(org-graph-view record) execute-extended-command(nil "org-graph-view" "org-gr") funcall-interactively(execute-extended-command nil "org-graph-view" "org-gr") call-interactively(execute-extended-command nil nil) command-execute(execute-extended-command)

michaelsjackson commented 4 years ago

I am using emacs-25.3

alphapapa commented 4 years ago

I don't know if when-let* is in Emacs 25.3. I recommend upgrading to 26.3.

michaelsjackson commented 4 years ago

Oh, I see, I tried some time ago upgrading to latest emacs, but then got other problems with my other settings, which are more important to me, so I decided keeping 25.3 for now. The worst thing is for me after an emacs upgrade, if older stuff which were working are stopping working. A bit similar like if the server gets a perl update and you have to debug 20000 lines of perl code, because older working scripts stop working.

;; Package-Requires: ((emacs "25.2") (org "9.0") (dash "2.13.0"))

Is there no easy alternative to when-let* ? For example how is org-brain doing its graph, org-brain is working here, just as an idea.

alphapapa commented 4 years ago

If you can't upgrade, you could replace it with -when-let* from dash. But I can't offer more support than that, because this is just a prototype. And if I work on this package further, it may become less compatible with earlier versions. If you have problems upgrading, I recommend asking for help on /r/emacs. It shouldn't be difficult to make the necessary changes.

michaelsjackson commented 4 years ago

Hey, thanks my friend, what a great tip, a tiny - (minus) in one place did the trick. Not even worth all the writing reading here. :)

Yeah, I will upgrade emacs at some point, in the big holidays maybe, but now I need to use it every day, permanently, it just has to work perfectly, with all the features I am using so far. Thanks for help again alphapapa/Adam.

Usually I am looking at the requirements first, always, (emacs "25.2") if unmet here, I just do not touch the package, in your case it seemed it was compatible, but then it was not.

alphapapa commented 4 years ago

When it comes to not upgrading software until necessary, you are not alone. ;)

Little issues like this are to be expected because this isn't really a published package, just a prototype. Maybe in the future...