[O] eliminating blocked tasks from printed agenda
I am having a configuration problem I was hoping to get some help with. I have a simple agenda configuration file that looks like this. (setq org-agenda-custom-commands '((o Office tasks tags-todo OFFICE nil (~/agenda.pdf And I have the custom variable org-agenda-dim-blocked-tasks set to the symbol invisible. It does what I expect when I build the agenda in buffer. Blocked tasks are hidden. However, when I export the agenda to PDF, blocked tasks are included in the agenda. Is there anything I can configure so that the exported agenda does not include blocked tasks? Thank you for the help.
[O] Org-mode and fill-nobreak-predicate
Hello list, I've just installed Emacs 25 (I only had 24.3 before), and was eager to try out some cool new features. I put this in my init.el: (add-hook 'fill-nobreak-predicate #'fill-single-char-nobreak-p) But it won't work in Org-mode: it turns out that Org sets fill-nobreak-predicate, too. What should I do? Should I put my add-hook /in the org-mode-hook/? TIA, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University
Re: [O] Redirecting stderr to stdout with babel/shell
Check out this solution: http://kitchingroup.cheme.cmu.edu/blog/2015/01/04/Redirecting-stderr-in-org-mode-shell-blocks/ I think it does what you want, and uses the idea below. Samuel Wales samolog...@gmail.com writes: hi karl, i always wrap as follows and it works for me. { your code } 21 : the : eliminates fancy error handling. i find that much less confusing. samuel -- --- John Kitchin Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu
Re: [O] eliminating blocked tasks from printed agenda
On Sun, Jan 04, 2015 at 06:24:32AM -0500, Mike Ashley wrote: I am having a configuration problem I was hoping to get some help with. I have a simple agenda configuration file that looks like this. (setq org-agenda-custom-commands '((o Office tasks tags-todo OFFICE nil (~/agenda.pdf And I have the custom variable org-agenda-dim-blocked-tasks set to the symbol invisible. I apologize. I realized I neither anticipated some obvious questions nor did I include enough information to reproduce. I am running Emacs 23.4.1 and org 8.2.9. Here is a complete .emacs file and org file to demonstrate the problem. First the .emacs file. ;;; - (add-to-list 'load-path ~mike/projects/org-mode/lisp) (setq org-agenda-files '(~mike/Documents/notes/gtd.org)) (global-set-key \C-ca 'org-agenda) (require 'org) (setq org-agenda-custom-commands '((o Agenda and office-related tasks tags-todo OFFICE nil (~/agenda.pdf (custom-set-variables '(org-agenda-dim-blocked-tasks (quote invisible)) '(org-enforce-todo-dependencies t)) ;;; - Now the gtd.org file. #+STARTUP: overview indent #+TAGS: OFFICE(o) HOME(h) #+SEQ_TODO: TODO DONE * Miscellaneous ** TODO One :OFFICE: ** TODO Two :HOME: * Project one :PROPERTIES: :ORDERED: t :END: ** TODO First project task :OFFICE: ** TODO This task should be blocked :OFFICE: If I C-c a, I get the correct agenda. If I C-x w to agenda.txt or C-c a e to create agenda.pdf, the created files include the blocked task. What can I do to make the exported agenda match the agenda in buffer? Mike
Re: [O] Org-mode and fill-nobreak-predicate
Hello, Marcin Borkowski mb...@wmi.amu.edu.pl writes: I've just installed Emacs 25 (I only had 24.3 before), and was eager to try out some cool new features. I put this in my init.el: (add-hook 'fill-nobreak-predicate #'fill-single-char-nobreak-p) But it won't work in Org-mode: it turns out that Org sets fill-nobreak-predicate, too. What should I do? Should I put my add-hook /in the org-mode-hook/? You need to set `fill-nobreak-predicate' before Org is loaded, or add the hook locally within `org-mode-hook'. Regards, -- Nicolas Goaziou
Re: [O] Org-mode and fill-nobreak-predicate
On 2015-01-04, at 18:50, Nicolas Goaziou m...@nicolasgoaziou.fr wrote: Hello, Marcin Borkowski mb...@wmi.amu.edu.pl writes: I've just installed Emacs 25 (I only had 24.3 before), and was eager to try out some cool new features. I put this in my init.el: (add-hook 'fill-nobreak-predicate #'fill-single-char-nobreak-p) But it won't work in Org-mode: it turns out that Org sets fill-nobreak-predicate, too. What should I do? Should I put my add-hook /in the org-mode-hook/? You need to set `fill-nobreak-predicate' before Org is loaded, or add the hook locally within `org-mode-hook'. Thanks! I'll try to set it up at the beginning of my init.el and see what happens. Regards, Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University
Re: [O] org tables into R?
Hi Vikas, Thanks for following up on this issue! Vikas Rawal vikasli...@agrarianresearch.org writes: Michael Gauland mikely...@gmail.com writes: I want to use an R block to manipulate data from an org table, but I'm not getting what I expect. What am I doing wrong? I believe, that this is a bug that has been reported already [1] and is still open. The code sent by Michael works fine for me (that it, the org table is read as a data.frame). It may help to upgrade your org-mode. What version are you on? Vikas It turns out I cannot reproduce it either with emacs -Q. I investigated and found that the culprit is an export filter I have defined that replaces tabs with spaces: --8---cut here---start-8--- (defun my-e-beamer-final-filter (contents backend info) (replace-regexp-in-string \t contents)) (add-to-list 'org-export-filter-final-output-functions 'my-e-beamer-final-filter) --8---cut here---end---8--- Now, I consider that a bug as well. I am not exporting anything, here. But I am merely evaluating a code block. Export filters should not interfere. Plus, it used to work (unfortunately, I do not have the time to bisect right now). So, why are export filters involved? And can that be disabled? Regards, Andreas PS: Here is my environment: #+begin_src emacs-lisp (concat (replace-regexp-in-string on .* (emacs-version)) \n (replace-regexp-in-string @.* (org-version nil t))) #+end_src #+results: : GNU Emacs 24.4.50.1 (x86_64-apple-darwin13.3.0, NS appkit-1265.21 Version 10.9.4 (Build 13E28)) : of 2014-09-02 : Org-mode version 8.3beta (release_8.3beta-709-g3e64f6
Re: [O] [PATCH] Fix R table import
Hi Aaron, Aaron Ecay aarone...@gmail.com writes: Hi Michael, Thanks for this patch. Before it is applied, though, I would like to understand why it is necessary. Vikas said that he could not reproduce the problem you originally reported. (Here is a web archived version of Vikas’s message, in case you did not see it at first: http://mid.gmane.org/b874ada0-1879-4021-b873-035ac85c4...@agrarianresearch.org) I cannot reproduce the problem either, using a very recent git version of org. I think we need some more information in order to understand why you are experiencing this misbehavior. Can you tell us what version of org you have installed, i.e. the output of M-x org-version? As I was involved in the thread you linked to as well, let me add that I cannot (in some sense) reproduce it either. But see my reply on the other thread (http://permalink.gmane.org/gmane.emacs.orgmode/93778). Regards, Andreas
Re: [O] [PATCH] Fix R table import
I'm using the latest from git, with some unrelated local modifications (though to be sure I did a clean build from origin/master and had the same problem). Versions: Org-mode version 8.3beta (release_8.3beta-758-g034d00.dirty @ /usr/local/share/emacs/site-lisp/org/) GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7) of 2014-03-08 on lamiak, modified by Debian R version 3.0.2 (2013-09-25) -- Frisbee Sailing This is an Ubuntu system; my Debian system is pretty much the same, and also shows the problem. Does this help? On Sun, Jan 4, 2015 at 7:24 PM, Aaron Ecay aarone...@gmail.com wrote: Hi Michael, Thanks for this patch. Before it is applied, though, I would like to understand why it is necessary. Vikas said that he could not reproduce the problem you originally reported. (Here is a web archived version of Vikas’s message, in case you did not see it at first: http://mid.gmane.org/b874ada0-1879-4021-b873-035ac85c4...@agrarianresearch.org) I cannot reproduce the problem either, using a very recent git version of org. I think we need some more information in order to understand why you are experiencing this misbehavior. Can you tell us what version of org you have installed, i.e. the output of M-x org-version? Thanks, -- Aaron Ecay
[O] Calling a source block with raw results
Dear Orgers, The following shell function lists the files within a directory and for each file, write a org piece of code to include it. #+NAME: org-figure-to-slide #+HEADERS: :var title=Empty title #+HEADERS: :var dir=./figures :var ext=*.pdf #+HEADERS: :var options= #+BEGIN_SRC sh if [ ! -d ${dir} ]; then echo ${dir} is not a directory ! exit 1 fi for i in ${dir}/${ext}; do echo * ${title} if [ ${options} != ]; then echo :PROPERTIES: echo ${options} echo :END: fi echo #+BEGIN_CENTER echo #+ATTR_LATEX: :width \linewidth echo [[file:${i}]] echo #+END_CENTER done #+END_SRC The basic use of such function is for a beamer presentation, each headline corresponds to a figure. Since I am explicitly writing all the org code, I would like to call the function and gets a *raw* results by doing #+CALL: org-figure-to-slide[:exports none :results raw]() The problem is when executing the call line, the result is always embeds between #+begin_example/#+end_example code block given something like #+RESULTS: #+begin_example * Empty title #+BEGIN_CENTER #+ATTR_LATEX: :width \linewidth [[file:./figures/timeline0.pdf]] #+END_CENTER * Empty title #+BEGIN_CENTER #+ATTR_LATEX: :width \linewidth [[file:./figures/timeline1.pdf]] #+END_CENTER #+end_example I want to remove the #+begin_example/#+end_example but I do not find any header arguments that achieve that (I have tested almost all of them). Moreover when I read =ob-core= code I do not understand why the function =org-babel-examplify-region= (responsible for the add of example block) is called since I set a raw results. The only (bad) way I have found is to set the variable =org-babel-min-lines-for-block-output= to nil but then I get big troubles when exporting the result. Can someone give some advice on how to get a pure raw results from a source block ? Thanks a lot for your help, Xavier
Re: [O] Calling a source block with raw results
Aloha Xavier, Xavier Garrido xavier.garr...@gmail.com writes: Since I am explicitly writing all the org code, I would like to call the function and gets a *raw* results by doing #+CALL: org-figure-to-slide[:exports none :results raw]() I think the problem is that you are specifying :results raw as an 'inside header argument' rather than an 'end header argument'. Inside header arguments affect ow the code block is evaluated. End header arguments affect how the results are incorporated into the Org mode buffer. See section 14.5 of the manual. Does the following call line do what you want? #+CALL: org-figure-to-slide() :results raw hth, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] How to get your list of categories?
rene jl...@yahoo.com writes: (org-buffer-property-keys) will give you all the categories in a buffer. I'd like to dynamically get the list of all of my categories (:CATEGORY: property). Is there an easy way to do that? How can I write a command that would operate much the same way I get - the list of all my TODO keywords (using C-c a T), or - the list of all my TAGS (using C-c a M)? -- Rene -- --- John Kitchin Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu
Re: [O] Efficiency of Org v. LaTeX v. Word
Ken Mankoff mank...@gmail.com writes: Did anyone see the parody of this here: http://mjambon.github.io/vim-vs-emacs/ It is pretty funny! People here might be interested in a publication from [2014-12-19 Fri] available at http://dx.doi.org/10.1371/journal.pone.0115069 Title: An Efficiency Comparison of Document Preparation Systems Used in Academic Research and Development Summary: Word users are more efficient and have less errors than even experienced LaTeX users. Someone here should repeat experiment and add Org into the mix, perhaps Org - ODT and/or Org - LaTeX and see if it helps or hurts. I assume Org would trump LaTeX, but would Org - ODT or Org - X - DOCX (via pandoc) beat straight Word? -k. -- --- John Kitchin Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu
Re: [O] Calling a source block with raw results
Hi Tom, Le 04/01/2015 21:29, Thomas S. Dye a écrit : Aloha Xavier, Xavier Garrido xavier.garr...@gmail.com writes: Since I am explicitly writing all the org code, I would like to call the function and gets a *raw* results by doing #+CALL: org-figure-to-slide[:exports none :results raw]() I think the problem is that you are specifying :results raw as an 'inside header argument' rather than an 'end header argument'. Inside header arguments affect ow the code block is evaluated. End header arguments affect how the results are incorporated into the Org mode buffer. See section 14.5 of the manual. Does the following call line do what you want? #+CALL: org-figure-to-slide() :results raw Thanks for your quick answer. Nevertheless, adding :results raw at the end changes the formatting output but embeds everything within paren. Given your advice, I am pretty closed to what I want to do by adding another :results raw command either as an inside header arguments or directly when declaring the =org-figure-to-slide= code like #+NAME: org-figure-to-slide #+HEADERS: :var title=Empty title #+HEADERS: :var dir=./figures :var ext=*.pdf #+HEADERS: :var options= #+BEGIN_SRC sh :results raw .. #+END_SRC Thanks again for your help, Xavier hth, Tom
Re: [O] Efficiency of Org v. LaTeX v. Word
Hi John, John Kitchin johnrkitc...@gmail.com writes: Ken Mankoff mank...@gmail.com writes: Did anyone see the parody of this here: http://mjambon.github.io/vim-vs-emacs/ It is pretty funny! Indeed. Thanks for sharing. Regards, Andreas People here might be interested in a publication from [2014-12-19 Fri] available at http://dx.doi.org/10.1371/journal.pone.0115069 Title: An Efficiency Comparison of Document Preparation Systems Used in Academic Research and Development Summary: Word users are more efficient and have less errors than even experienced LaTeX users. Someone here should repeat experiment and add Org into the mix, perhaps Org - ODT and/or Org - LaTeX and see if it helps or hurts. I assume Org would trump LaTeX, but would Org - ODT or Org - X - DOCX (via pandoc) beat straight Word? -k.
Re: [O] Org-mode to feed a database
Vikas Rawal vikasli...@agrarianresearch.org writes: It is possible, but not worth the effort. Even with moderately experienced users, you will be amazed at how org-files can get mangled by users. In a recent course I taught, I used links for some data entry; the links stored data as properties in a headline. Even then a handful of users found some ways to delete headlines, modify what got stored, etc... As someone else mentioned, if Emacs is the input interface, widgets is the way to go. Otherwise, a webform is a much better idea. Alternatives include a PDF form, an MS Word or Excel form, or one of the online survey tools. This is, in all likelihood, a crazy idea. Please excuse me for that. I often need to get a number of people enter complex survey data into a database using some kind of forms. The forms I need are fairly complex (with several nested grids, for example). I need radio-buttons and drop-down menus-equivalents. I was thinking if it would be worth it to use Org-mode for data entry. The idea would be something like this. We have a template org file that is copied for each survey respondent. The template contains “blank” org tables and some source blocks. Responses are filled into the org tables, and then the source blocks are evaluated to feed the data into the database. You can version-control the whole thing so that different people can create these records and push it to a centralised git repository. Has anyone done anything like this? What has been the experience? There are two aspects that immediately come to my mind. 1. Is org adequately feature rich for such a scenario? There are two concerns I can think of right now. 1.1 Would feeding information from one Org table to another become too complicated? 1.2 Is there a way to build in tab-completion for columns in Org-table using pre-specified categories? 2. In my case, people who would enter the data into org files would not have used emacs before. So, there is a learning curve. Is it worth it? Or should one just build a web-based graphic application for such people to use? Vikas -- --- John Kitchin Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu
Re: [O] org tables into R?
Hi Andreas, Thanks for following up on this problem. 2015ko urtarrilak 4an, Andreas Leha-ek idatzi zuen: I investigated and found that the culprit is an export filter I have defined that replaces tabs with spaces: --8---cut here---start-8--- (defun my-e-beamer-final-filter (contents backend info) (replace-regexp-in-string \t contents)) (add-to-list 'org-export-filter-final-output-functions 'my-e-beamer-final-filter) --8---cut here---end---8--- Now, I consider that a bug as well. I am not exporting anything, here. But I am merely evaluating a code block. Export filters should not interfere. Plus, it used to work (unfortunately, I do not have the time to bisect right now). So, why are export filters involved? And can that be disabled? Recently(-ish), Nicolas updated the org-table functions to use the export framework. One of the drawbacks of this approach (as you have brought to our attention) is that export filters are invoked. This should probably be disabled. Another drawback is the detection of unexpanded macros (which will be triggered e.g. if a tabular babel result has macro-like {{{text}}} in it). A proof-of-concept patch for this is attached. From 50ce44be96f446272d1e465c01265632f0ed488f Mon Sep 17 00:00:00 2001 From: Aaron Ecay aarone...@gmail.com Date: Sun, 4 Jan 2015 18:14:26 -0500 Subject: [PATCH] [export] allow sloppy usage of macros for internal APIs * lisp/ox.el (org-export-as): Support :sloppy-macros plist entry. * lisp/org-table.el (orgtbl-to-generic): Use it. --- lisp/org-table.el | 2 +- lisp/ox.el| 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/org-table.el b/lisp/org-table.el index 6b33eda..7a53d7a 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -4834,7 +4834,7 @@ This may be either a string or a function of two arguments: (table-cell . ,(org-table--to-generic-cell params)) ;; Section. Return contents to avoid garbage around table. (section . (lambda (s c i) c - 'body-only (org-combine-plists params '(:with-tables t)) + 'body-only (org-combine-plists params '(:with-tables t :sloppy-macros t)) (defun org-table--generic-apply (value name optional with-cons rest args) (cond ((null value) nil) diff --git a/lisp/ox.el b/lisp/ox.el index f47baef..0fcfc04 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -2885,7 +2885,8 @@ Return code as a string. (cons email (or (plist-get info :email) )) (cons title (org-element-interpret-data (plist-get info :title - 'finalize) + (unless (plist-get info :sloppy-macros) + 'finalize)) ;; Parse buffer. (setq tree (org-element-parse-buffer nil visible-only)) ;; Handle left-over uninterpreted elements or objects in -- 2.2.1 I wonder, though, whether the various exceptions like this that will stack up will tip the balance towards its being simpler for org-table to have its own set of functions that operate on the org-element parse tree, but don’t invoke org-export code. For csv this would be something like (pseudocode): (org-element-mapconcat (lambda (table-row) (org-element-mapconcat (lambda (table-cell) (quote-for-csv (org-element-interpret table-cell)) table-row ,)) table \n) Nicolas, WDYT? If you prefer to continue using the export framework, I can add some commentary to the attached patch and install it. Thanks, -- Aaron Ecay
Re: [O] [PATCH] Fix R table import
Hi Michael, Hmm. I have Org-mode version 8.3beta (release_8.3beta-695-g390015 @ /home/aecay/development/org-mode/lisp/) The git sha 034d00 from your org-version isn’t in my checkout. Yours also thinks it’s 60ish commits ahead of where mine is (758 vs. 695). This is very strange; I don’t know what to make of it. I have: GNU Emacs 25.0.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.6) What is your version of ESS? (C-h v ess-version) It’s 14.11 for me (actually a melpa install of the latest git version). I executed the attached elisp file, then loaded the attached org file, and could not reproduce the issue. When doing so, the code that org executes is echoed to the *R* buffer. Can you send what is echoed for you? (You will have to edit in the appropriate paths to your org and ess installations, unless they are in emacs’s default load-path) I get: data.table - local({ con - textConnection( \A\ \B\ \C\ \115\ \76\ \60\ ) res - utils::read.table( con, header= TRUE, row.names = NULL, sep = \t, as.is = TRUE ) close(con) res }) data.table 'org_babel_R_eoe' r-table.el Description: application/emacs-lisp r-table.org Description: Lotus Organizer Thanks, -- Aaron Ecay
Re: [O] [PATCH] Fix R table import
My git has so many more commits because I'm sloppy about my local changes. I had been using ESS 5.14 (from ELPA). When I switched to the latest git version, the problem (at least seems to have) went away. For my needs, I don't think this needs any further investigation, though I'm happy to help if anyone else thinks it is important. On Mon, Jan 5, 2015 at 1:35 PM, Aaron Ecay aarone...@gmail.com wrote: Hi Michael, Hmm. I have Org-mode version 8.3beta (release_8.3beta-695-g390015 @ /home/aecay/development/org-mode/lisp/) The git sha 034d00 from your org-version isn’t in my checkout. Yours also thinks it’s 60ish commits ahead of where mine is (758 vs. 695). This is very strange; I don’t know what to make of it. I have: GNU Emacs 25.0.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.6) What is your version of ESS? (C-h v ess-version) It’s 14.11 for me (actually a melpa install of the latest git version). I executed the attached elisp file, then loaded the attached org file, and could not reproduce the issue. When doing so, the code that org executes is echoed to the *R* buffer. Can you send what is echoed for you? (You will have to edit in the appropriate paths to your org and ess installations, unless they are in emacs’s default load-path) I get: data.table - local({ con - textConnection( \A\ \B\ \C\ \115\ \76\ \60\ ) res - utils::read.table( con, header= TRUE, row.names = NULL, sep = \t, as.is = TRUE ) close(con) res }) data.table 'org_babel_R_eoe' Thanks, -- Aaron Ecay
[O] [bug?] Different whitespace behavior between capture, and capture w. refile
Let's say I start with a .notes file that looks like this: #+BEGIN_EXAMPLE * Tasks * Refile Here * Other Stuff #+END_EXAMPLE with all the default capture templates. The only org-mode configuration I have is (org-blank-before-new-entry (quote ((heading) (plain-list-item as well as C-c c for capture. Everything else is default. This is on Emacs 24.4, and org-mode 8.2.10 Let's say I have another file called ~/Spike.org open, and I am capturing from it. This is not relevant to the example, but makes it clearer where the links are coming from. Then, I capture two items: C-c c t Capture Item 1 C-c C-c and C-c c t Capture Item 2 C-c C-c. Now, my .notes file looks like this: #+BEGIN_EXAMPLE * Tasks ** TODO Capture Item 1 [2015-01-04 Sun] [[file:~/Spike.org]] ** TODO Capture Item 2 [2015-01-04 Sun] [[file:~/Spike.org]] * Refile Here * Other Stuff #+END_EXAMPLE Note how there are no blank lines between the different capture items. Now, I capture two items, but instead of finishing the capture with C-c C-c, I refile right from the Capture window: C-c c t Refile Item 1 C-c C-w Refile here and C-c c t Refile Item 2 C-c C-w Refile here. Now, my .notes file looks like this: #+BEGIN_EXAMPLE * Tasks ** TODO Capture Item 1 [2015-01-04 Sun] [[file:~/Spike.org]] ** TODO Capture Item 2 [2015-01-04 Sun] [[file:~/Spike.org]] * Refile Here ** TODO Refile Item 1 [2015-01-04 Sun] [[file:~/Spike.org]] ** TODO Refile Item 2 [2015-01-04 Sun] [[file:~/Spike.org]] * Other Stuff #+END_EXAMPLE Note how refiling from the capture window introduced whitespace between items under Refile here, but finishing the capture doesn't. Needless to say, this inconsistency drives me mildly up the wall. I am currently looking into writing some sort of hook for org-after-refile-insert-hook, but exactly what to do there is unclear. Is there some configuration option I am missing? Thanks!
Re: [O] [PATCH] Patches for agenda exiting commands
Nicolas Goaziou m...@nicolasgoaziou.fr wrote: [...] Nitpick: in commit messages, prefer the present tense. I've reworded the commit message for the remaining patches. +(defvar org-agenda-last-indirect-buffer nil) Please provide a docstring for this new variable. [...] Also, the commit message lacks the creation of `org-agenda--quit'. I've added both of these. Thanks for your comments. -- Kyle From fc3a2b526a77e574c6b076d626cd35583ad5ecdf Mon Sep 17 00:00:00 2001 From: Kyle Meyer k...@kyleam.com Date: Sun, 4 Jan 2015 22:18:40 -0500 Subject: [PATCH 1/2] org-agenda: Track last indirect buffer * lisp/org-agenda.el (org-agenda-tree-to-indirect-buffer): Record last indirect buffer for agenda. * lisp/org-agenda.el (org-agenda-quit): Delete window for org-agenda-last-indirect-buffer, not org-last-indirect-buffer. Introduce a new variable, org-agenda-last-indirect-buffer, that is specific for the agenda (and perhaps a particular agenda buffer, if org-agenda-sticky is set). This prevents org-agenda-quit from deleting a window if it is displaying a buffer that was created through a org-tree-to-indirect-buffer call outside of org-agenda-tree-to-indirect-buffer. Make org-agenda-Quit check for indirect buffer windows, like org-agenda-quit does. --- lisp/org-agenda.el | 24 +--- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 2fbfacc..6e2e953 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -2078,6 +2078,8 @@ (defvar org-agenda-last-prefix-arg nil) (defvar org-agenda-this-buffer-name nil) (defvar org-agenda-doing-sticky-redo nil) (defvar org-agenda-this-buffer-is-sticky nil) +(defvar org-agenda-last-indirect-buffer nil + Last buffer loaded by `org-agenda-tree-to-indirect-buffer'.) (defconst org-agenda-local-vars '(org-agenda-this-buffer-name @@ -2102,6 +2104,7 @@ (defconst org-agenda-local-vars org-agenda-effort-filter org-agenda-markers org-agenda-last-search-view-search-was-boolean +org-agenda-last-indirect-buffer org-agenda-filtered-by-category org-agenda-filter-form org-agenda-cycle-counter @@ -7177,6 +7180,12 @@ (defun org-agenda-Quit () Like `org-agenda-quit', but kill the buffer even when `org-agenda-sticky' is non-nil. (interactive) + (let ((org-agenda-last-indirect-window + (and (eq org-indirect-buffer-display 'other-window) + org-agenda-last-indirect-buffer + (get-buffer-window org-agenda-last-indirect-buffer +(when org-agenda-last-indirect-window + (delete-window org-agenda-last-indirect-window))) (if org-agenda-columns-active (org-columns-quit) (let ((buf (current-buffer))) @@ -7210,12 +7219,12 @@ (defun org-agenda-quit () When column view is active, exit column view instead of the agenda. (interactive) - (if (and (eq org-indirect-buffer-display 'other-window) - org-last-indirect-buffer) - (let ((org-last-indirect-window - (get-buffer-window org-last-indirect-buffer))) - (if org-last-indirect-window - (delete-window org-last-indirect-window + (let ((org-agenda-last-indirect-window + (and (eq org-indirect-buffer-display 'other-window) + org-agenda-last-indirect-buffer + (get-buffer-window org-agenda-last-indirect-buffer +(when org-agenda-last-indirect-window + (delete-window org-agenda-last-indirect-window))) (if org-agenda-columns-active (org-columns-quit) (if org-agenda-sticky @@ -8758,7 +8767,8 @@ (defun org-agenda-tree-to-indirect-buffer (arg) (and indirect-window (select-window indirect-window)) (switch-to-buffer org-last-indirect-buffer :norecord) (fit-window-to-buffer indirect-window))) - (select-window (get-buffer-window agenda-buffer) + (select-window (get-buffer-window agenda-buffer)) + (setq org-agenda-last-indirect-buffer org-last-indirect-buffer (defun org-agenda-do-tree-to-indirect-buffer (arg) Same as `org-agenda-tree-to-indirect-buffer' without saving window. -- 2.2.1 From f842617f9bacccdf2458a0c6b53f86814787cdc3 Mon Sep 17 00:00:00 2001 From: Kyle Meyer k...@kyleam.com Date: Sun, 4 Jan 2015 22:18:46 -0500 Subject: [PATCH 2/2] org-agenda: Fix issues with restoring windows * lisp/org-agenda.el (org-agenda-prepare-window): Update window configuration even when agenda buffer exists in background. * lisp/org-agenda.el (org-agenda-Quit): Use buffer value for org-agenda-pre-window-conf to allow for local values used with sticky agenda buffers. * lisp/org-agenda.el (org-agenda-quit): Reset local, not global, value for org-agenda-pre-window-conf. * lisp/org-agenda.el (org-agenda--quit): New function. Update the pre-agenda window configuration on the next agenda call even if org-agenda-pre-window-conf is non-nil (which occurs when the agenda buffer is exited without q, Q, or X). This prevents restoring a window configuration that is not the one prior to the most recent agenda call.
Re: [O] Org-mode to feed a database
It is possible, but not worth the effort. Even with moderately experienced users, you will be amazed at how org-files can get mangled by users. In a recent course I taught, I used links for some data entry; the links stored data as properties in a headline. Even then a handful of users found some ways to delete headlines, modify what got stored, etc... Thanks, John. Vikas