Re: [O] ox-cv.el
Hi Diego, thank you very much for your reply! That looks like really nice project. Thanks, Eike Diego Zamboni writes: > Hi Eike, > > I don’t think it’s the same, but at least from the name, this one might serve > a similar purpose: > https://blog.oscarnajera.com/2018/05/org-cv-an-org-export-backend-for-cv/ > <https://blog.oscarnajera.com/2018/05/org-cv-an-org-export-backend-for-cv/> > > I found it just yesterday, haven’t tried it yet. > > Best, > —Diego > > >> On 6 Jul 2018, at 11:56, Eike wrote: >> >> >> Hello, >> >> I'm occassionally using a nice package by Myles English that has been on >> github for a while https://github.com/mylese/ox-cv. This is gone now and >> I can't find it using some search-engines. >> >> Has it maybe been moved to another git provider? Or could someone hand a >> copy of this file to me :) >> >> Many thanks in advance >> Eike >> >> -- GPG/PGP: AD7AC35E https://eikek.github.io/sharry
[O] ox-cv.el
Hello, I'm occassionally using a nice package by Myles English that has been on github for a while https://github.com/mylese/ox-cv. This is gone now and I can't find it using some search-engines. Has it maybe been moved to another git provider? Or could someone hand a copy of this file to me :) Many thanks in advance Eike
Re: [O] [PATCH] ob-core: check argument to goto-char
Nicolas Goaziou <m...@nicolasgoaziou.fr> writes: > I suggest to use built-in `orgtbl-to-orgtbl' instead: > > (insert (orgtbl-to-orgtbl '(("id" "num") hline ("a" "1") ("b" "2")) nil)) > Ah, that's what I'm looking for. Thanks! Eike -- gpg: AD7AC35E finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E
Re: [O] [PATCH] ob-core: check argument to goto-char
Charles C. Berry <ccbe...@ucsd.edu> writes: > The easiest way to borrow babel tools is to use babel to execute src > blocks directly. Here is a start. Run this src block to define a function > `insert-quoted-list-as-result': > > #+BEGIN_SRC emacs-lisp >(defun insert-quoted-list-as-result (my-list) >(save-excursion > (insert > (format >"#+BEGIN_SRC emacs-lisp\n '%S\n#+END_SRC\n\n" my-list)) > (let ((org-confirm-babel-evaluate nil)) >(org-babel-execute-src-block))) > (delete-region (point) > (org-babel-where-is-src-block-result))) > #+END_SRC > Oh I see. It is more complicated than I hoped. Thanks, Eike -- gpg: AD7AC35E finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E
Re: [O] [PATCH] ob-core: check argument to goto-char
Charles C. Berry <ccbe...@ucsd.edu> writes: > On Sat, 30 Apr 2016, Eike wrote: > >> >> Hi, >> >> I have some code that uses `org-babel-insert-result' and I've found that >> evaluating for example >> >> (org-babel-insert-result "a") >> >> results in an error. > > Although not explicitly marked as such, `org-babel-insert-result' seems > intended as an internal function for processing babel RESULTs. ok, I didn't know. >> The reason is that `goto-char' is called with a nil >> argument. > > When your snippet is in a src block or inline src block, there is no > error. Also, no error when point is in a src block and you run the snippet > with > > : M-x eval-expression RET (org-babel-insert-result "a") RET > > So, it looks like you are trying to evaluate the snippet above when > point is not in a src block. AFAICS, there is no guarantee that such usage > will succeed. > > Failure in such uses seems more like a feature than a bug. Ok, so it wasn't clear to me that point must be in a src block. Since the results are passed as argument, I made the false assumption that it inserts them where point currently is /or/ after a src block. The lisp code at that point (ob-core.el l.2212) invokes goto-char with nil which is caused by `inline' being nil. But the next line checks for `inline' being nil as does the line before: (if existing-result (goto-char existing-result) …) so I thought it might be good to check for that in the else-branch, too. >> I simply put the snippet in a `when' clause, but since the >> function is quite large I'm not so sure if it's now doing always the >> correct thing. At least my org files seem still to work…. >> >> I've added the patch in case it is ok to be applied. Maybe someone can >> have a look at it. >> > > See http://orgmode.org/worg/org-contribute.html for details on how to > contribute. Also, running `make test' on new code is a good idea. > > If you can explain what you are trying to achieve, someone may suggest a > fix that does not require retooling babel internals. I didn't really mean you to apply my patch, but rather have a look at it: thanks for that. I thought it's simpler to send a patch file than to explain in words… `make test' doesn't show unexpected failures to me, did I miss something? I'm sorry for breaking any contributing rules, I'll try to do better next time. What I want to do: I want to insert an org table somewhere in an org buffer. The data is not from an src block but retrieved from somewhere else. So I have a list like `(("id" "num") hline ("a" "1") ("b" "2"))' and I'd like to put it in a buffer as an org table (the buffer is in org-mode). It is certainly not my intention to retool babel internals to achieve this. My impression was that this may be a bug. But it may not, that's why I asking here. Thanks Eike -- gpg: AD7AC35E finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E
[O] [PATCH] ob-core: check argument to goto-char
Hi, I have some code that uses `org-babel-insert-result' and I've found that evaluating for example (org-babel-insert-result "a") results in an error. The reason is that `goto-char' is called with a nil argument. I simply put the snippet in a `when' clause, but since the function is quite large I'm not so sure if it's now doing always the correct thing. At least my org files seem still to work…. I've added the patch in case it is ok to be applied. Maybe someone can have a look at it. Thanks and regards Eike signature.asc Description: PGP signature >From fd2182dd3edfb4887cb272a5c93c72660eac0efe Mon Sep 17 00:00:00 2001 From: Eike Kettner <eike.kett...@posteo.de> Date: Sat, 30 Apr 2016 12:59:41 +0200 Subject: [PATCH] ob-core: check argument to `goto-char' The argument to `goto-char' must not be nil, which occurs if `org-element-property' is called with nil element argument. --- lisp/ob-core.el | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 71c7aea..088f744 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -2210,8 +2210,10 @@ INFO may provide the values of these header arguments (in the (progn (when outside-scope (widen)) (if existing-result (goto-char existing-result) - (goto-char (org-element-property :end inline)) - (skip-chars-backward " \t")) + (let ((end (org-element-property :end inline))) + (when end + (goto-char end) + (skip-chars-backward " \t" (unless inline (setq indent (org-get-indentation)) (forward-line 1)) -- 2.7.4 -- gpg: AD7AC35E finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E
[O] simple expense tracking with org
Hello there, I thought to share a little elisp thingy that I wrote to track my expenses with org. I use the org's capture mechanism to add expense items to some files and the following code only searches through all these files and creates summaries of all found expenses. It is possible to search by date, tags etc. You can have a look here: https://github.com/eikek/org-expenses Regards, Eike -- gpg: AD7AC35E finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E
Re: [O] simple expense tracking with org
Sure. An expense item is a headline with a property drawer that has a property where the key is some currency code (other headlines are ignored). Then tags can be applied to this headline. A category is either specified via CATEGORY property or the parent headline is used (if present). The org files may look like this * some headline that is a category by default ** expense item 1 :atag: :PROPERTIES: :CHF: 25.00 :date: [2014-09-20] :END: ** expense item 2 :anothertag: :PROPERTIES: :CHF: 21.00 :date: [2014-09-20] :CATEGORY: :END: The expense view gives a summary of these items and the items itself as a org table (there also is a screenshot https://github.com/eikek/org-expenses/blob/master/screenshot.png): #+TITLE: Expenses [2014-08-01 Fr] - [2014-08-31 So] #+STARTUP: showeverything Search: ~(:date 2014-08)~ Showing *7* items * Overview ** Summary | Curr. |sum |max | min | count | avg | |---+++---+---+---| | CHF | 532.98 | 349.99 | 10.00 | 6 | 88.83 | | EUR | 15.99 | 15.99 | 15.99 | 1 | 15.99 | ** Categories | |sum |max | min | count |avg | |---+++---+---+| | Bücher CHF| 49.99 | 39.99 | 10.00 | 2 | 25.00 | | Bücher EUR| 15.99 | 15.99 | 15.99 | 1 | 15.99 | | Sonstiges CHF | 426.49 | 349.99 | 20.00 | 3 | 142.16 | | Work CHF | 56.50 | 56.50 | 56.50 | 1 | 56.50 | ** Monthly | |sum |max | min | count | avg | |-+++---+---+---| | 2014/08 CHF | 532.98 | 349.99 | 10.00 | 6 | 88.83 | | 2014/08 EUR | 15.99 | 15.99 | 15.99 | 1 | 15.99 | * Items | :item | :category | :date | :CHF | :EUR | |---+---+-++---| | Buch1 | Bücher| [2014-08-31 So] || 15.99 | | Cellphone | Sonstiges | [2014-08-30 Sa] | 349.99 | | | Pizza | Sonstiges | [2014-08-29 Fr] | 20.00 | | | Buch2 | Bücher| [2014-08-26 Di] | 10.00 | | | Cablecom | Sonstiges | [2014-08-25 Mo] | 56.50 | | | Cablecom | Work | [2014-08-25 Mo] | 56.50 | | | Buch2 | Bücher| [2014-08-01 Fr] | 39.99 | | It's just counting and summing the items, nothing more. It's not doing accounting or anythingmore complicated, if you had this in mind. Regard, Eike Tory S. Anderson writes: Could you give a few snippets of examples -- what the org files with tags look like, what the result looks like? I'm interested because I also use Org to do my budgeting and finances. Eike e...@eknet.org writes: Hello there, I thought to share a little elisp thingy that I wrote to track my expenses with org. I use the org's capture mechanism to add expense items to some files and the following code only searches through all these files and creates summaries of all found expenses. It is possible to search by date, tags etc. You can have a look here: https://github.com/eikek/org-expenses Regards, Eike -- gpg: AD7AC35E finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E -- gpg: AD7AC35E finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E
Re: [O] accessing properties in org-element-parse-buffer tree
Eric Abrahamsen writes: Eike e...@eknet.org writes: Hello list, I want to ask for help regarding elisp and org-elements. I like to access the properties of all my headlines and I created the following function (tree is the parsed tree) that collects them into an a-list: You could also take a look at org-collector, in contrib. It might give you some ideas, or even solve your problem directly. Yes, that looks really interesting! Thanks for the tip! Kind regards Eike
Re: [O] org-elements-parse-buffer and weird property drawers
Hello, Nicolas Goaziou writes: Eike n...@eknet.org writes: I'm playing with the functions in org-elements.el and the following effect seems strange to me: I have a few propery drawers with empty propertys, like #+BEGIN_EXAMPLE :PROPERTIES: :date: [2014-08-29 Fr] :chf: 21.76 :eur: :END: #+END_EXAMPLE If I do org-elements-parse-buffer, the empty one is not there, but the first one is duplicated. At least, there are two node-property elements in the tree like that: #+BEGIN_EXAMPLE (node-property (:key chf :value 21.76 :begin 38 :end 58 :post-blank 0 :post-affiliated 38 :parent #4)) (node-property (:key chf :value 21.76 :begin 58 :end 67 :post-blank 0 :post-affiliated 58 :parent #4)) #+END_EXAMPLE The function call was this: #+begin_src emacs-lisp (with-current-buffer test-exp.org (org-element-parse-buffer)) #+end_src And here is the test-exp.org org file: #+BEGIN_EXAMPLE * Sonstiges ** Pizza :PROPERTIES: :chf: 21.76 :eur: :END: #+END_EXAMPLE This should be fixed. Thank you for reporting it. Many thanks! It works here now. Regards, Eike
[O] accessing properties in org-element-parse-buffer tree
Hello list, I want to ask for help regarding elisp and org-elements. I like to access the properties of all my headlines and I created the following function (tree is the parsed tree) that collects them into an a-list: #+begin_src emacs-lisp (defun collect-props (tree) (car (org-element-map tree 'headline (lambda (hl) (when (eq 2 (org-element-property :level hl)) ; want only level-2 properties (org-element-map hl 'node-property (lambda (np) (cons (org-element-property :key np) (org-element-property :value np) #+end_src I'm not very confident about this, is this ok? Is there a better way? For example, the first car looks strange, and I don't know how to get rid of it. Thanks you very much in advance!!! Kind regards Eike -- gpg: AD7AC35E finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E
[O] org-elements-parse-buffer and weird property drawers
Hello all, I'm playing with the functions in org-elements.el and the following effect seems strange to me: I have a few propery drawers with empty propertys, like #+BEGIN_EXAMPLE :PROPERTIES: :date: [2014-08-29 Fr] :chf: 21.76 :eur: :END: #+END_EXAMPLE If I do org-elements-parse-buffer, the empty one is not there, but the first one is duplicated. At least, there are two node-property elements in the tree like that: #+BEGIN_EXAMPLE (node-property (:key chf :value 21.76 :begin 38 :end 58 :post-blank 0 :post-affiliated 38 :parent #4)) (node-property (:key chf :value 21.76 :begin 58 :end 67 :post-blank 0 :post-affiliated 58 :parent #4)) #+END_EXAMPLE The function call was this: #+begin_src emacs-lisp (with-current-buffer test-exp.org (org-element-parse-buffer)) #+end_src And here is the test-exp.org org file: #+BEGIN_EXAMPLE * Sonstiges ** Pizza :PROPERTIES: :chf: 21.76 :eur: :END: #+END_EXAMPLE Am I missing something, or are empty properties not supported? Kind regards, Eike
Re: [O] org-elements-parse-buffer and weird property drawers
forgot to mention org version: Org-mode version 8.3beta (release_8.3beta-296-g851b77 @ /home/eike/.emacs.d/src/org-mode/lisp/) Kind regards, Eike Eike writes: Hello all, I'm playing with the functions in org-elements.el and the following effect seems strange to me: I have a few propery drawers with empty propertys, like #+BEGIN_EXAMPLE :PROPERTIES: :date: [2014-08-29 Fr] :chf: 21.76 :eur: :END: #+END_EXAMPLE If I do org-elements-parse-buffer, the empty one is not there, but the first one is duplicated. At least, there are two node-property elements in the tree like that: #+BEGIN_EXAMPLE (node-property (:key chf :value 21.76 :begin 38 :end 58 :post-blank 0 :post-affiliated 38 :parent #4)) (node-property (:key chf :value 21.76 :begin 58 :end 67 :post-blank 0 :post-affiliated 58 :parent #4)) #+END_EXAMPLE The function call was this: #+begin_src emacs-lisp (with-current-buffer test-exp.org (org-element-parse-buffer)) #+end_src And here is the test-exp.org org file: #+BEGIN_EXAMPLE * Sonstiges ** Pizza :PROPERTIES: :chf: 21.76 :eur: :END: #+END_EXAMPLE Am I missing something, or are empty properties not supported? Kind regards, Eike -- gpg: AD7AC35E finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E
Re: [O] accessing properties in org-element-parse-buffer tree
Hello again it seems that I messed up my testing variables… I always had just one headline and thus the list of lists had always one element that I then extracted with `car'. So `car' must be removed: #+begin_src emacs-lisp (defun collect-props (tree) (org-element-map tree 'headline (lambda (hl) (when (eq 2 (org-element-property :level hl)) ; want only level-2 properties (org-element-map hl 'node-property (lambda (np) (cons (org-element-property :key np) (org-element-property :value np #+end_src I'd still be curious if there are other/better ways to do that; or is this idiomatic usage of provided org functions? Thanks again and kind regards Eike Eike writes: Hello list, I want to ask for help regarding elisp and org-elements. I like to access the properties of all my headlines and I created the following function (tree is the parsed tree) that collects them into an a-list: #+begin_src emacs-lisp (defun collect-props (tree) (car (org-element-map tree 'headline (lambda (hl) (when (eq 2 (org-element-property :level hl)) ; want only level-2 properties (org-element-map hl 'node-property (lambda (np) (cons (org-element-property :key np) (org-element-property :value np) #+end_src I'm not very confident about this, is this ok? Is there a better way? For example, the first car looks strange, and I don't know how to get rid of it. Thanks you very much in advance!!! Kind regards Eike -- gpg: AD7AC35E finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E
Re: [O] accessing properties in org-element-parse-buffer tree
Thanks a lot for the examples, they are very helpful! I first thought to parse the org buffer and then work with the resulting tree. But your examples now makes me think to work directly on the buffer. Well, I will play with a few different ways now… Regards Eike Thorsten Jolitz writes: Eike e...@eknet.org writes: Hello, I want to ask for help regarding elisp and org-elements. I like to access the properties of all my headlines and I created the following function (tree is the parsed tree) that collects them into an a-list: #+begin_src emacs-lisp (defun collect-props (tree) (car (org-element-map tree 'headline (lambda (hl) (when (eq 2 (org-element-property :level hl)) ; want only level-2 properties (org-element-map hl 'node-property (lambda (np) (cons (org-element-property :key np) (org-element-property :value np) #+end_src I'm not very confident about this, is this ok? Is there a better way? For example, the first car looks strange, and I don't know how to get rid of it. * Answer :PROPERTIES: :CUSTOM_ID: abc123 :foo: bar :END: There are several options, here a few examples, some using my new function 'org-dp-filter-node-props' from org-dp-lib.el which is very good at filtering out only those node-properties you are really interested in. 'org-entry-properties' does some filtering too, but its less generic. #+NAME: ex1 #+BEGIN_SRC emacs-lisp :results raw (org-map-entries (lambda () (org-entry-properties nil nil foo))) #+END_SRC #+results: (((CATEGORY . 989)) ((CUSTOM_ID . abc123) (foo . bar) (CATEGORY . 989))) #+NAME: ex2 #+BEGIN_SRC emacs-lisp :results raw (require 'org-dp-lib) (org-map-entries (lambda () (org-dp-filter-node-props 'org t t))) #+END_SRC #+results: (nil ((foo . bar))) #+NAME: ex3 #+BEGIN_SRC emacs-lisp :results raw (org-element-map (org-element-parse-buffer 'headline) 'headline (lambda (hl) (when (eq 1 (org-element-property :level hl)) ; want only level-2 properties (org-element-property :FOO hl #+END_SRC #+results: ex3 (bar) #+NAME: ex4 #+BEGIN_SRC emacs-lisp :results raw (let (props) (save-excursion (goto-char (point-min)) (while (re-search-forward ^\\*+ nil t) (save-excursion (beginning-of-line) (setq props (cons (org-dp-filter-node-props '(FOO CUSTOM_ID) nil t) props (delq nil props))) #+END_SRC #+results: ex4 (((foo . bar) (CUSTOM_ID . abc123))) PS 1 Strange behaviour in src-block ex1. Neither the example given nor (org-entry-properties nil foo) (org-entry-properties nil foo foo) return what I would expect. PS 2 Without the :results header-arg I get the following error when running src-block ex2: Debugger entered--Lisp error: (args-out-of-range 0 1) orgtbl-to-orgtbl((nil ((foo . bar))) (:fmt (lambda (cell) (format %s cell org-babel-insert-result((nil ((foo . bar))) (replace) (emacs-lisp (require 'org-dp-lib)\n(org-map-entries (lambda () (org-dp-filter-node-props 'org t t))) ((:comments . ) (:shebang . ) (:cache . no) (:padline . ) (:noweb . no) (:tangle . no) (:exports . code) (:results . replace) (:session . none) (:hlines . no) (:result-type . value) (:result-params replace) (:rowname-names) (:colname-names)) nil 0 #marker at 1263 in *outorg-edit-buffer*) nil 0 emacs-lisp) org-babel-execute-src-block(nil) org-babel-execute-src-block-maybe() org-babel-execute-maybe() org-babel-execute-safely-maybe() run-hook-with-args-until-success(org-babel-execute-safely-maybe) org-ctrl-c-ctrl-c(nil) call-interactively(org-ctrl-c-ctrl-c nil nil)
[O] input date/time properties
Dear List, I've discovered orgmode only several weeks ago and this was a great day. So this is my first post and I want to thank you all making this free software! Now I have several org files and I sometimes want to attach date or datetime properties to a headline. So I type C-c C-x p and answer the minibuffer. For a date/time value I'd like to use the nice input method (I think provided by `org-read-date') but I cannot figure out how to enable it when adding properties this way. Is this possible or should I add the PROPERTIES drawer first and then use C-c ! to add date value? Also, how can I instruct org to update the date value of a property? (If I hit C-c C-c inside the property drawer the property action menu appears.) kind regards Eike
Re: [O] input date/time properties
Aahhh.. I knew I'm missing something obvious. I just wasn't brave enough to simply try those key strokes from within the minibuffer... silly me. It also works here, of course. Thank you Eike Thorsten Jolitz writes: Eike Kettner n...@eknet.org writes: Now I have several org files and I sometimes want to attach date or datetime properties to a headline. So I type C-c C-x p and answer the minibuffer. For a date/time value I'd like to use the nice input method (I think provided by `org-read-date') but I cannot figure out how to enable it when adding properties this way. Is this possible or should I add the PROPERTIES drawer first and then use C-c ! to add date value? It works for me over here: , | C-c C-x p mydate RET C-c ! ` and calendar window opens ... PS Org-mode version beta_8.3 (beta_8.3-21-g815c21 @ /usr/share/emacs/24.3/lisp/org/lisp/)