Re: [O] bug in org-capture for table lines

2018-06-22 Thread Holst Thomas (PS-EC/ESE4)
Hi Nicolas,

Nicolas Goaziou  writes:

>"Holst Thomas (PS-EC/ESE4)"  writes:
>
>> there is a bug in org-capture. When capturing table lines table formula is 
>> not updated.
>>
>> Here is an ECM:
>>
>> [...snip ...]
>
> Fixed. Thank you.

I can confirm that it works perfectly.
Thank you!

--
Thomas



[O] bug in org-capture for table lines

2018-06-21 Thread Holst Thomas (PS-EC/ESE4)
Hi,

there is a bug in org-capture. When capturing table lines table formula is not 
updated.

Here is an ECM:

#+begin_src org
* Table for testing

|   | Item | Price |
|---+--+---|
|   |  |  3.50 |
|---+--+---|
| # | sum: |  3.50 |
#+TBLFM: @3$3=vsum(@-II..@-I);%.2f

* Lisp code (capture template)

#+begin_src elisp :results none
  (setq org-capture-templates
'(("t" "Table formula" table-line
   (file+headline "~/tmp/org-capture-table-formula.org" "Table for 
testing")
   "| | %^{item} | %^{price} |" :table-line-pos "II-1" 
:immediate-finish t)))
#+end_src
#+end_src

(emacs-version)
"GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 
2018-06-18"

(org-version)
Org mode version 9.1.13 (release_9.1.13-821-g460d83 @ 
/home/hts2fe/git-emacs/org-mode/lisp/)

Thank you for looking into this.

Mit freundlichen Grüßen / Best regards

Thomas Holst
PS-EC/ESE4

Tel. +49 711 811-40681



Re: [O] ANN/RFC: org-sidebar

2018-06-04 Thread Holst Thomas (PS-EC/ESE4)
Hello Adam,

No problem. I am not that good in elisp, but I like to help testing. So I am 
glad I could help here.

After a git pull the error is gone - but I don't get any entries in the sidebar 
:-(.

In my testfile I have two headlines marked with TODO. The two buffers in the 
sidebar are empty.

Again I used emacs -Q and the lisp code I posted earlier.

Mit freundlichen Grüßen / Best regards

Thomas Holst
PS-EC/ESE4  

Tel. +49 711 811-40681 



> -Ursprüngliche Nachricht-
> Von: alphadeltap...@gmail.com [mailto:alphadeltap...@gmail.com] Im Auftrag
> von Adam Porter
> Gesendet: Montag, 4. Juni 2018 14:16
> An: Holst Thomas (PS-EC/ESE4) 
> Cc: emacs-orgmode@gnu.org
> Betreff: Re: [O] ANN/RFC: org-sidebar
> 
> Hi Thomas,
> 
> I just pushed a commit which should fix this problem.  My apologies
> for putting you to so much trouble.  It was a simple mistake that I
> should have figured out on my own.  I don't know why it didn't happen
> on my system; even with "emacs -q" I didn't get it, but when I
> followed your steps with "emacs -Q", it did happen--and then it
> happened in my main config, too!  Maybe I've been staring at this code
> for too long...  ;)
> 
> Please let me know if you have any other feedback on the package.
> Maybe in a few weeks I will consider publishing it on MELPA, but I
> think it needs some more work first.
> 
> Thanks,
> Adam


Re: [O] ANN/RFC: org-sidebar

2018-06-04 Thread Holst Thomas (PS-EC/ESE4)
Hi Adam,

> Hi all,
> 
> Inspired by a post on Reddit, which was inspired by the Organized plugin
> for the Atom editor, I came up with this:
> 
> https://github.com/alphapapa/org-sidebar
> 
> This package presents a helpful sidebar view for Org buffers.  At the top
> is a chronological list of scheduled and deadlined tasks in the current
> buffer, and below that is a list of all other non-done to-do items.  If
> the buffer is narrowed, the sidebar only shows items in the narrowed
> portion; this allows seeing an overview of tasks in a subtree.
> 
> It's in an early stage of development, but I think it may be useful.
> Any feedback would be appreciated.

I really like the idea of org-sidebar. I tried it and followed the
instructions in README.org but I get an error. Here is the
backtrace:

Debugger entered--Lisp error: (void-variable main-window)
  (let ((org-buffer (current-buffer)) (org-buffer-window main-window)) (let 
((save-selected-window--state (internal--before-with-selected-window window))) 
(save-current-buffer (unwind-protect (progn (select-window (car 
save-selected-window--state) (quote norecord)) (switch-to-buffer 
(get-buffer-create (format " *%s*" name))) (setq header-line-format (propertize 
name (quote face) (quote ...)) mode-line-format nil) (set-window-parameter nil 
(quote org-buffer) org-buffer) (set-window-parameter nil (quote 
org-buffer-window) org-buffer-window) (use-local-map org-sidebar-map) 
(erase-buffer) (insert contents) (goto-char (point-min)) (toggle-truncate-lines 
1)) (internal--after-with-selected-window save-selected-window--state)
  org-sidebar--prepare-window(# " ElProjects.org: 
Agenda" "")
  (progn (select-frame frame (quote norecord)) (delete-other-windows) (setq 
main-window (selected-window)) (setq agenda-window (split-window nil -50 (quote 
right))) (setq todo-window (let ((save-selected-window--state 
(internal--before-with-selected-window agenda-window))) (save-current-buffer 
(unwind-protect (progn (select-window (car save-selected-window--state) (quote 
norecord)) (split-window-vertically)) (internal--after-with-selected-window 
save-selected-window--state) (org-sidebar--prepare-window agenda-window 
(format " %s: Agenda" buffer-name-string) agenda-string) 
(org-sidebar--prepare-window todo-window (format " %s: Other TODOs" 
buffer-name-string) todo-string) (select-window main-window))
  (unwind-protect (progn (select-frame frame (quote norecord)) 
(delete-other-windows) (setq main-window (selected-window)) (setq agenda-window 
(split-window nil -50 (quote right))) (setq todo-window (let 
((save-selected-window--state (internal--before-with-selected-window 
agenda-window))) (save-current-buffer (unwind-protect (progn (select-window ... 
...) (split-window-vertically)) (internal--after-with-selected-window 
save-selected-window--state) (org-sidebar--prepare-window agenda-window 
(format " %s: Agenda" buffer-name-string) agenda-string) 
(org-sidebar--prepare-window todo-window (format " %s: Other TODOs" 
buffer-name-string) todo-string) (select-window main-window)) (if (frame-live-p 
old-frame) (progn (select-frame old-frame (quote norecord (if 
(buffer-live-p old-buffer) (progn (set-buffer old-buffer
  (let ((old-frame (selected-frame)) (old-buffer (current-buffer))) 
(unwind-protect (progn (select-frame frame (quote norecord)) 
(delete-other-windows) (setq main-window (selected-window)) (setq agenda-window 
(split-window nil -50 (quote right))) (setq todo-window (let 
((save-selected-window--state (internal--before-with-selected-window 
agenda-window))) (save-current-buffer (unwind-protect (progn ... ...) 
(internal--after-with-selected-window save-selected-window--state) 
(org-sidebar--prepare-window agenda-window (format " %s: Agenda" 
buffer-name-string) agenda-string) (org-sidebar--prepare-window todo-window 
(format " %s: Other TODOs" buffer-name-string) todo-string) (select-window 
main-window)) (if (frame-live-p old-frame) (progn (select-frame old-frame 
(quote norecord (if (buffer-live-p old-buffer) (progn (set-buffer 
old-buffer)
  (let* ((buffer (current-buffer)) (agenda-items (let ((it (let (...) (cond ... 
... ... ... (let ((it (-map org-sidebar-format-fn it))) (-group-by 
--cl-date-header-- it (todo-items (let ((it (let (...) (cond ... ... ... 
... (-map org-sidebar-format-fn it))) (agenda-string (let ((temp-buffer 
(generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) 
(unwind-protect (progn (let ... ...) (buffer-string)) (and (buffer-name 
temp-buffer) (kill-buffer temp-buffer)) (todo-string (s-join "\n" 
todo-items)) (frame (selected-frame)) (buffer-name-string (concat (if 
(buffer-narrowed-p) (progn "[narrowed] ")) (buffer-name))) main-window 
agenda-window todo-window) (let ((old-frame (selected-frame)) (old-buffer 
(current-buffer))) (unwind-protect (progn (select-frame frame (quote norecord)) 
(delete-other-windows) (setq main-window (selected-window)) (setq