Re: [O] Babel problem: Output incomplete if it contains # character (only in session)

2018-06-04 Thread Berry, Charles


> On Jun 4, 2018, at 9:42 AM, Marian Schubert  wrote:
> 
> I'm having trouble with babel block like this:
> 
> 
> #+BEGIN_SRC shell :results output :session abc
> echo foo#bar
> #+END_SRC
> 
> When I execute it for the first time I get this result:
> 
> #+RESULTS:
> : 
> : foo#bar
> 
> When I execute it again I get this:
> 
> #+RESULTS:
> : 
> : bar
> 
> (foo# is missing)
> 
> Any idea what might be wrong? I'm using version 9.1.13.
> 

After running that I get this in the abc buffer for 

M-x describe-variable RET comint-prompt-regexp RET

,
| comint-prompt-regexp is a variable defined in ‘comint.el’.
| Its value is "^[^#$%>
| ]*[#$%>] *"
| Local in buffer abc; global value is "^"
| 
| Documentation:
| Regexp to recognize prompts in the inferior process.
| Defaults to "^", the null string at BOL.
| 
| This variable is only used if the variable
| ‘comint-use-prompt-regexp’ is non-nil.
| 
| Good choices:
|   Canonical Lisp: "^[^> \n]*>+:? *" (Lucid, franz, kcl, T, cscheme, oaklisp)
|   Lucid Common Lisp: "^\\(>\\|\\(->\\)+\\) *"
|   franz: "^\\(->\\|<[0-9]*>:\\) *"
|   kcl: "^>+ *"
|   shell: "^[^#$%>\n]*[#$%>] *"
|   T: "^>+ *"
| 
| This is a good thing to set in mode hooks.
| 
| [back]
`

The first hash is not recognized as a prompt, but the rest are.

If you really need to use the hash, then running

: (set-local comint-prompt-regexp "^[^$%>\n]*[$%>] *")

in the `abc' buffer might help.

This has obvious problems if you run as root and do not reset the prompt to 
something other than #.

HTH,

Chuck

Re: [O] Symbol’s value as variable is void: haskell-prompt-regexp

2018-06-04 Thread Roger Mason
Hello,

Nick Dokos  writes:

> Please provide a backtrace. 

This source block:

#+begin_src haskell :exports results 
nanmol=[1,1,3,2,1,2,3]
ncatmol=[2,1,2,1,2,1,2]
#+end_src
produces the error in the attached backtrace

Steps to reproduce:

1. emacs -Q -l init

with init being:

 Org-mode
(add-to-list 'load-path "/home/rmason/.emacs.d/org-git/lisp")
(add-to-list 'load-path "/home/rmason/.emacs.d/org-git/contrib/lisp")
(add-to-list 'load-path "/home/rmason/.emacs.d/elpa/haskell-mode-20180601.143")
(org-babel-do-load-languages
 'org-babel-load-languages
 '((shell . t)
   (emacs-lisp . t)
   (haskell . t)
   ))

2. evaluste the source block

GNU Emacs 25.3.1 (i386-portbld-freebsd11.1, GTK+ Version 3.22.29) of 2018-04-26
Org mode version 9.1.13 (release_9.1.13-784-ged7d1d @
/home/rmason/.emacs.d/org-git/lisp/)

Cheers,
Roger



haskell_error.debug
Description: Binary data


Re: [O] Symbol’s value as variable is void: haskell-prompt-regexp

2018-06-04 Thread Nick Dokos
Please provide a backtrace. Instruction on how to produce a *useful*
backtrace can be found by evaluating

   (info "(org) Feedback")

in the section "How to create a useful backtrace").

Alternatively, check the same section on the online doc:

   https://orgmode.org/org.html#Feedback

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: [O] Symbol’s value as variable is void: haskell-prompt-regexp

2018-06-04 Thread Roger Mason
Hello,

Nick Dokos  writes:

> Try evaluating
>
> (require 'inf-haskell)
>
> and then try evaluating the source code block again.
>
> Untested.

That seems to have helped, but now I'm getting:

‘org-babel-script-escape’ expects a string

Many thanks,
Roger




Re: [O] Symbol’s value as variable is void: haskell-prompt-regexp

2018-06-04 Thread Nick Dokos
Roger Mason  writes:

> Hello,
>
> GNU Emacs 25.3.1 (i386-portbld-freebsd11.1, GTK+ Version
> 3.22.29) of 2018-04-26
>
> Org mode version 9.1.13 (release_9.1.13-784-ged7d1d @ 
> /home/rmason/.emacs.d/org-git/lisp/)
>
> Attempting to run a haskell code block:
>
> #+begin_src haskell :exports results 
> cations=["Na","Mg","Al","Si","K","Ti","Fe"]
> atwt=[22.9897,24.305,26.9815,28.0855,39.0983,47.867,55.845]
> nanmol=[1,1,3,2,1,2,3]
> ncatmol=[2,1,2,1,2,1,2]
> anwt= replicate (length atwt) 15.9994
> #+end_src
>
> gives this message:
> executing Haskell code block...
> run-hooks: Symbol’s value as variable is void: haskell-prompt-regexp
>
> Any help in solving this will be most appreciated.
>

Try evaluating

(require 'inf-haskell)

and then try evaluating the source code block again.

Untested.
-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




[O] Bug: org-clock-display conflicts link display in headline [9.1.9 (release_9.1.9-65-g5e4542 @ /usr/share/emacs/26.1/lisp/org/)]

2018-06-04 Thread 杨圣
--text follows this line--

I was trying the beloved clock feature of org-mode, and tried
`org-clock-display` on an org file. A total time is added to each
headline as expected, but it is not the case for headlines with a link
in it. The whole link is displayed as if `org-toggle-link-display` is
called.

Minimum file to reproduce the problem:

* [[https://www.google.com][google]]
    :LOGBOOK:
    CLOCK: [2018-06-03 Sun 22:15]--[2018-06-03 Sun 22:25] =>  0:10
    :END:

Steps to reproduce:
  1. Open an org file whose headline contains link
  2. Add some clock for this headline
  3. Call `org-clock-display`

Expected behavior:

  Looks like:

* google ..10
    :LOGBOOK:...

What I get:

* [[https://www.google.com][google]] ..10
    :LOGBOOK:...

Note: If I call `org-clock-remove-overlay` to remove clock display, the
clock displayed is removed, and link display is restored.

What I tried: looking into the function `org-toggle-link-display` and
`org-clock-display` to see what is actually happening underneath, and
how are they implemented. org-link seems to be using `font-lock-mode`,
while `org-clock-display` is using overlay, both of which I am not
familiar with. I also tried vanilla Emacs with ~emacs -Q~, but problem
persists. I also tried calling `org-restart-font-lock` manually after
 `org-clock-display` is called, which is what is called in
`org-toggle-link-display`, but links are still in its full form.





Emacs  : GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2018-05-29
Package: Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @
/usr/share/emacs/26.1/lisp/org/)

current state:
==
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-mode-hook '(#[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-show-block-all append
    local]
   5]
 #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-babel-show-result-all
    append local]
   5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3
"\n\n(fn ENTRY)"]
 org-babel-pre-tangle-hook '(save-buffer)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
 org-occur-hook '(org-first-headline-recenter)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-speed-command-hook '(org-speed-command-activate
  org-babel-speed-command-activate)
 org-confirm-shell-link-function 'yes-or-no-p
 org-link-parameters '(("id" :follow org-id-open)
   ("rmail" :follow org-rmail-open :store
    org-rmail-store-link)
   ("mhe" :follow org-mhe-open :store org-mhe-store-link)
   ("irc" :follow org-irc-visit :store org-irc-store-link)
   ("info" :follow org-info-open :export org-info-export
    :store org-info-store-link)
   ("gnus" :follow org-gnus-open :store
    org-gnus-store-link)
   ("docview" :follow org-docview-open :export
    org-docview-export :store org-docview-store-link)
   ("bibtex" :follow org-bibtex-open :store
    org-bibtex-store-link)
   ("bbdb" :follow org-bbdb-open :export org-bbdb-export
    :complete org-bbdb-complete-link :store
    org-bbdb-store-link)
   ("w3m" :store org-w3m-store-link) ("file+sys")
   ("file+emacs") ("doi" :follow org--open-doi-link)
   ("elisp" :follow org--open-elisp-link)
   ("file" :complete org-file-complete-link)
   ("ftp" :follow
    (lambda (path) (browse-url (concat "ftp:" path
   ("help" :follow org--open-help-link)
   ("http" :follow
    (lambda (path) (browse-url (concat "http:" path
   ("https" :follow
    (lambda (path) (browse-url (concat "https:" path
   ("mailto" :follow
    (lambda (path) (browse-url (concat "mailto:"; path
   ("news" :follow
    (lambda (path) (browse-url (concat "news:"; path
   ("shell" :follow org--open-shell-link))
 )


-- 
Sheng Yang(杨圣)
PhD student
Computer Science Department
University of Maryl

[O] Symbol’s value as variable is void: haskell-prompt-regexp

2018-06-04 Thread Roger Mason
Hello,

GNU Emacs 25.3.1 (i386-portbld-freebsd11.1, GTK+ Version
3.22.29) of 2018-04-26

Org mode version 9.1.13 (release_9.1.13-784-ged7d1d @ 
/home/rmason/.emacs.d/org-git/lisp/)

Attempting to run a haskell code block:

#+begin_src haskell :exports results 
cations=["Na","Mg","Al","Si","K","Ti","Fe"]
atwt=[22.9897,24.305,26.9815,28.0855,39.0983,47.867,55.845]
nanmol=[1,1,3,2,1,2,3]
ncatmol=[2,1,2,1,2,1,2]
anwt= replicate (length atwt) 15.9994
#+end_src

gives this message:
executing Haskell code block...
run-hooks: Symbol’s value as variable is void: haskell-prompt-regexp

Any help in solving this will be most appreciated.

Thanks,
Roger



[O] Babel problem: Output incomplete if it contains # character (only in session)

2018-06-04 Thread Marian Schubert
Hello,

I'm having trouble with babel block like this:


#+BEGIN_SRC shell :results output :session abc
echo foo#bar
#+END_SRC

When I execute it for the first time I get this result:

#+RESULTS:
:
: foo#bar

When I execute it again I get this:

#+RESULTS:
:
: bar

(foo# is missing)

Any idea what might be wrong? I'm using version 9.1.13.

Best regards,
Marian


Full example.org:

* Example
#+BEGIN_SRC shell :results output :session abc
echo foo#bar
#+END_SRC

#+RESULTS:
:
: foo#bar

#+BEGIN_SRC shell :results output :session abc
echo foo#bar
#+END_SRC

#+RESULTS:
:
: bar


[O] org-toggle-comment does not interact well with inlinetask

2018-06-04 Thread Alain . Cochard


Hello.  I am aware inlinetasks integration is currently under
discussion.  I am reporting this issue in case it would be useful for
this integration.

I do

   emacs -Q -l ~/tmp/scr.emacs

with scr.emacs being

   (add-to-list 'load-path "/home/cochard/Org/Coch-git/org-mode/lisp")
   (require 'org-inlinetask)

Then I visit an org file which is

   * foo
   *** inlinestuff
 blah
   *** END
 bar

(the inlinestuff being obtained with 'C-c C-x t').  If I do

   C-c ;

on "bar" (or the line before or the line after), the file becomes:

   * foo
   *** inlinestuff
 blah
   *** COMMENT END
 bar

Regards


Emacs : GNU Emacs 24.5.1 (x86_64-redhat-linux-gnu, GTK+ Version
3.18.9) of 2016-04-11 on buildvm-25.phx2.fedoraproject.org Package:
Org mode version 9.1.13 (release_9.1.13-784-ged7d1d @
/home/cochard/Org/Coch-git/org-mode/lisp/)


-- 
EOST (École et Observatoire des Sciences de la Terre) 
IPG (Institut de Physique du Globe) | alain.coch...@unistra.fr
5 rue René Descartes   [bureau 106] | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France| Fax:   +33 (0)3 68 85 01 25 



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] org-detangle seems broken

2018-06-04 Thread Frederick Giasson
Hi Nicolas,

Here it is. If you =detangle= the =broken-detangle--working.el= file, it
will work as expected.

However, if you try to detangle the =broken-detangle--NOT-working.el= file,
you should get a "Not in a source block" error in *message*.

Another thing I noted while creating the ECM is if there is only *one* code
block in the =.org= file, then it throws a =End of Buffer= error.



On Sat, Jun 2, 2018 at 6:17 AM, Nicolas Goaziou 
wrote:

> Hello,
>
> Frederick Giasson  writes:
>
> > It appears that org-detangle is broken. I am using spacemacs, but even
> with
> > a vanilla Emacs (emacs -Q) it appears to be broken.
> >
> > When I tangle a file with =:comments link= every things works as expected
> > and the comments are added in the tangled file.
> >
> > When I just detangle that tangled file, everything get detangled as
> > expected.
> >
> > If I change one or two lines, it normally works as expected.
> >
> > If I change more than 4 lines, I always get the error message "Not in a
> > block file".
> >
> > Some debugging shows that the function =org-element-at-point= sometimes
> tag
> > the element as =paragraph= instead of =src-block=, like if it doesn't
> know
> > where it is... somehow.
> >
> > Does anybody use that function without experiencing this (apparent major)
> > issue?
>
> Could you provide an ECM demonstrating the issue?
>
> Thank you.
>
> Regards,
>
> --
> Nicolas Goaziou
>


broken-detangle.org
Description: Binary data
;; [[file:~/Documents/git/broken-detangle.org::*Experience%20broken%20detangle][Experience broken detangle:1]]
(defun test
  (message "broken detangle")
  (message "test")
  (message "test"))
;; Experience broken detangle:1 ends here

;; [[file:~/Documents/git/broken-detangle.org::*Experience%20broken%20detangle][Experience broken detangle:2]]
(defun test
(message "broken detangle")
  (message "test"))
;; Experience broken detangle:2 ends here

;; [[file:~/Documents/git/broken-detangle.org::*Experience%20broken%20detangle][Experience broken detangle:3]]
(defun test
(message "broken detangle")
(message "test")
(message "test"))
;; Experience broken detangle:3 ends here
;; [[file:~/Documents/git/broken-detangle.org::*Experience%20broken%20detangle][Experience broken detangle:1]]
(defun test
(message "broken detangle"))
;; Experience broken detangle:1 ends here

;; [[file:~/Documents/git/broken-detangle.org::*Experience%20broken%20detangle][Experience broken detangle:2]]
(defun test
(message "broken detangle")
  (message "test"))
;; Experience broken detangle:2 ends here

;; [[file:~/Documents/git/broken-detangle.org::*Experience%20broken%20detangle][Experience broken detangle:3]]
(defun test
(message "broken detangle")
(message "test")
(message "test"))
;; Experience broken detangle:3 ends here


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

2018-06-04 Thread Adam Porter
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 Thomas Holst
Hi Adam,

thank you for looking into this.

· Adam Porter  wrote:
>> Debugger entered--Lisp error: (void-variable main-window)
>
> Thanks for your email.  I wasn't able to reproduce the error on my
> system, even with "emacs -q".  I also looked at the code again, and I
> don't know why that error would occur.  Can you reproduce the problem
> with "emacs -q"?  If so, please let me know what version of Emacs and
> of Org you're using.

Here is what I did to reproduced it.

I tried it with two different emacs / org-versions. Also tested several
org-files. The error happens even with a minimal org-file with just one
heading and one TODO item.

Best regards
  Thomas

> emacs -Q

(package-initialize)
(add-to-list 'load-path "~/git-emacs/org-agenda-ng")
(add-to-list 'load-path "~/git-emacs/org-sidebar")
(require 'org-sidebar)

(emacs-version)
"GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.9) of 2017-05-02"
"GNU Emacs 25.1.1 (x86_64-w64-mingw32) of 2016-09-22"

(org-version)
"8.2.10"
"9.1.13"

system-type
gnu/linux
windows-nt

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(# " org-sidebar.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

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

2018-06-04 Thread Adam Porter
Hi Thomas,

On Mon, Jun 4, 2018 at 4:03 AM, Thomas Holst  wrote:
> Hi Adam,
>
> 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
> bactrace:
>
> Debugger entered--Lisp error: (void-variable main-window)

Thanks for your email.  I wasn't able to reproduce the error on my
system, even with "emacs -q".  I also looked at the code again, and I
don't know why that error would occur.  Can you reproduce the problem
with "emacs -q"?  If so, please let me know what version of Emacs and
of Org you're using.



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

2018-06-04 Thread Thomas Holst
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
bactrace:

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 agenda-

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 agenda