Re: [O] Programmatically construct agenda from list of headline ids
Alexander Baier mailbox.org> writes: > > Hi! > > As the title mentions I have a list of ids of existing org headlines and > want create an agenda view listing all of these headlines. > > Is there functionality in org-agenda, that allows me to do this? > > Best Regards, Nobody else has offered help yet, so I'll take a shot. What exactly are your "ids"? Do you mean you have headlines with assigned CUSTOM_ID properties, and you have a list of values for which you want to show the headlines in agenda? If so, I think you could just assemble the list in a command that sticks new search conditions into one of your custom agenda views. E.g., if you currently had a custom agenda search mapped to "i" for two different CUSTOM_IDs, like this: (setq org-agenda-custom-commands '(("i" tags "CUSTOM_ID=323|CUSTOM_ID=832"))) you could reissue command to get the search done for different list of custom ids: (setq org-agenda-custom-commands '(("i" tags "CUSTOM_ID=153|CUSTOM_ID=932|CUSTOM_ID=293"))) I haven't tested this, but I expect it or something similar would work. There are probably tweaks you could make, e.g, list could be combined into a regular expression so you don't need to repeat multiple 'CUSTOM_ID=' sections. For more info on custom agenda views see: http://orgmode.org/org.html#Custom-agenda-views and for more info on property searches see: http://orgmode.org/org.html#Matching-tags-and-properties
Re: [O] Displaying property values in agenda search result
Markus Heller gmail.com> writes: > > Hello, > > how can I display property values in the agenda, more specifically, in > the results of an agenda search? > I think the straigtforward way would be to use column view, and set up your column view to show, in your case, the PROJECT property. See, sect. 10.8 of the manual, "Using column view in the agenda": http://orgmode.org/manual/Agenda-column-view.html#Agenda-column-view as well as reviewing the basic column view info and directions for setup in sect 7.5, "Column view": http://orgmode.org/manual/Column-view.html#Column-view
Re: [O] export subtree
Not a perfect solution, buy I think you can use the #+SELECT_TAGS option to set which tress will be exported by default, then tag your desired export tree with that tag. Then when you export the full buffer (not just a subtree) it will choose the tree with that tag. E.g., - #+SELECT_TAGS: myexporttree * Main tree :myexporttree: fkjaldfk ** subhead ** subhead * anoher heading 1 * another heading level 1 ** subhead ** subhead In org buffer above it will export only the first subtree now when you export the entire buffer. You should be able to export the others selectively if you choose scope as 'subtree'. And you can always comment out or delete the SELECT_TAGS line if you want to export entire buffer.
Re: [O] Problem with org-collector.el in Org v. 8.3
Whoops, turns out that the org-collector.el file I was grabbing in step 1 was _NOT_ the one from this link: http://orgmode.org/worg/code/elisp/org-collector.el Instead, I was using a copy of the org-collector.el file in most recent org-contrib-plus package. The version in org-contrib-plus appears to be newer despite it having a version of 0.01 while http link above has version 0.1.
[O] Problem with org-collector.el in Org v. 8.3
I seem to be having same problem with org-collector in v.8.3as was reported by Charlie Millar back in April. I checked with him and he was never able to resolve the issue. Here's his original post: http://article.gmane.org/gmane.emacs.orgmode/96966/match=org+collector It was easy to confirm that org-collector was working properly in Org 8.2.1, which is built in to my Emacs 24.5.1. I can reproduce the problem with Org 8.3.2 (nov 23, 2015) with the following steps (I was working from base Emacs 24.5.1 install): (1) Download the org-collector.el file and org-collector-example.org file from here: http://orgmode.org/worg/sources/org-contrib/org-collector-example.org http://orgmode.org/worg/code/elisp/org-collector.el (2) Start emacs. Download elpa version of org, which will be Org 8.3.2: M-x list-packages, go to 'org' and install. (3) Exit Emacs (4) Start a new "bare" Emacs with 'emacs -Q' (5) in scratch directory enable elpa packages by evaluating: (require 'package) (package-initialize) (6) Load the org-collector-example.org file into a buffer. Check loaded Org version to confirm it's 8.3.2. (7) Load org-collector.el into a buffer and do M-x eval-buffer. (8) Move to the org-collector-example buffer. Place cursor on one of the '#+BEGIN:' lines and press C-c C-c. You should see the same faulty results as reported by Charlie Millar.
Re: [O] how to get images support in Emacs on Windows?
Ben gmail.com> writes: > Actually, I use few inline images. Most of my images are large. They should be resized to look pretty on emacs. But to resize them I need to build emacs with ImageMagick. And I haven't tried that yet. > Are you sure you need to rebuild Emacs? On my Linux machine I run a standard version of Emacs 24.3 binaries that I got from the Linux Mint repository. It supports using (a separately installed) Imagemagick to reduce size of inline images. I can't get it to work automatically in Org-mode, but I think that's because I need a more recent version of Org-mode. I'm running v.7.9.3f of Org-mode. To test Imagemagick support I'm running the test code made available in this post: http://article.gmane.org/gmane.emacs.orgmode/90278 I think the original poster in that thread said he couldn't get it to work in Org-mode until he had updated his Org-mode version. -- Herb
Re: [O] how to get images support in Emacs on Windows?
Ben gmail.com> writes: > > You can download the corresponding dlls from ezwinports [fn:1] and put them into emacs's `bin` directory. > > There are some instructions in the "Image support" part on page [fn:2]. > > [fn:2] https://ftp.gnu.org/gnu/emacs/windows/ > Strangely, the instructions and files work only for a couple formats I tried. jpeg,png -- work perfectly svg -- works, but so far not inline. I.e., I can click on link and image will show up in another Emacs buffer, but can't get it to show up inline. tiff -- can't get this to work at all. When clicking on it, it shows character-mode garbage in separate buffer, along with error message. This is despite fact that dynamic-library-alist shows the same files as I copied to the bin folder. Not a huge deal for me, since jpeg and png are what I wanted most. But still seems a little odd; I have no idea what problems are with svg and tiff.
Re: [O] how to get images support in Emacs on Windows?
Ben gmail.com> writes: > > You can download the corresponding dlls from ezwinports [fn:1] and put them into emacs's `bin` directory. > > There are some instructions in the "Image support" part on page [fn:2]. > > [fn:1] http://sourceforge.net/projects/ezwinports/files/ > > [fn:2] https://ftp.gnu.org/gnu/emacs/windows/ > Ben, Ista, Yuri -- Thanks for all your help. I finally got things going by grabbing the dll's from the ezwinports project and putting them in emacs/bin directory. The zlib1.dll was packaged in the libpng zip file so that was all I needed to get my png images to show. Like many things was simple once I knew how to do it. That StackOverflow answer was on point but was dated; I don't think Emacs 24 will work with the files it mentions there, which are the ones from the GnuWin32 project. Turns out all this info was in the Gnu Emacs for Windows readme/install instructions. Unfortunately I installed long time ago and didn't recall that info, and my web searches weren't turning it up. Thanks for all your help. -- Herbert
[O] how to get images support in Emacs on Windows?
I'm trying to use inline images on Windows and (I think?) I've gotten to the point where I understand that this is not available with the standard GNU Emacs installation on Windows. My understanding is that I need an "image.dll" that I can put in the bin directory. I think that comes as part of EmacsW32 install, but that install seems to be packaged as a single executable, not sure how to get image.dll without running a full install of EmacsW32, which I don't think I want. So, am I correct in understanding that all I need is that 'image.dll' to get inline image support on Windows (I'm running v24.4 of Emacs). If not, what more do I need to do? And how can I get (or make) a copy of that .dll? Thanks, Herbert
Re: [O] adding custom org-keymaps for EVIL Vim emulator
Herbert Sitz gmail.com> writes: > > (define-minor-mode evil-org-mode > "minor mode to add evil keymappings to Org-mode." > :keymap (make-sparse-keymap) > (evil-local-mode t)) > Whoops, I left out the earlier lines to load and enable Evil. They are below. I commented out the (evil-mode 1), which enables evil-mode in all buffers and instead call evil-local-mode in the hook function that's called when a buffer is set to 'org' type. I assume there's some better way to do this, since I do want to use Evil mode in most buffers, not just org buffers. But I was having problems in the date-editing mini buffer if I had (evil-mode 1) so I took the easy way of getting rid of that. . . Also, Evil must of course be installed before you can do these custom mappings. Here's home page for Evil: https://gitorious.org/evil/pages/Home v below to be in .emacs file v (add-to-list 'load-path "c:/Program Files (x86)/Emacs/emacs/lisp/evil") (require 'evil) ; comment out line below to activate evil only in org-buffers ;(evil-mode 1) ; lines above go in .emacs above lines from previous post, which ; start as. . . (define-minor-mode evil-org-mode "minor mode to add evil keymappings to Org-mode." :keymap (make-sparse-keymap) (evil-local-mode t)) [. . .]
[O] adding custom org-keymaps for EVIL Vim emulator
I was playing around with Evil and like it quite a bit. It feels better than the previous Viper/Vimpulse package I was using, plus documentation is good, clear, and it seems easy to customize. One problem with Org for me has been keybindings. Even with a Vim emulator that does a decent job of vim-ifying Emacs, it still leaves all of the (numerous) Org-specific keymappings to deal with. It turns out to be quite easy to add custom keymappings to Org-mode to make commands accessible in a more Vim-like way. I've added the code below to my .emacs and it's a good start. Maybe some vim-friendly Org users will have ideas on how to grow it from here: (define-minor-mode evil-org-mode "minor mode to add evil keymappings to Org-mode." :keymap (make-sparse-keymap) (evil-local-mode t)) ; the ',' keys give quick and easy way to hide/reveal outline ; structure of entire document (analogous to ); (evil-define-key 'normal evil-org-mode-map ",1" '(lambda() (interactive)(hide-sublevels 1))) (evil-define-key 'normal evil-org-mode-map ",2" '(lambda() (interactive)(hide-sublevels 2))) (evil-define-key 'normal evil-org-mode-map ",3" '(lambda() (interactive)(hide-sublevels 3))) (evil-define-key 'normal evil-org-mode-map ",4" '(lambda() (interactive)(hide-sublevels 4))) (evil-define-key 'normal evil-org-mode-map ",5" '(lambda() (interactive)(hide-sublevels 5))) (evil-define-key 'normal evil-org-mode-map ",6" '(lambda() (interactive)(hide-sublevels 6))) (evil-define-key 'normal evil-org-mode-map ",7" '(lambda() (interactive)(hide-sublevels 7))) (evil-define-key 'normal evil-org-mode-map ",8" '(lambda() (interactive)(hide-sublevels 8))) ; the ',,' maps below give quick and easy way to hide/reveal outline ; structure of single subtree. depending on what sort of org ; documents you have, and how you use them, you may prefer ; to have these mappings use single ',' and have entire-document ; mappings use ',,' prefix. (evil-define-key 'normal evil-org-mode-map ",,1" '(lambda() (interactive)(hide-sublevels 1))) (evil-define-key 'normal evil-org-mode-map ",,2" '(lambda() (interactive)(hide-sublevels 1)(show-children 1))) (evil-define-key 'normal evil-org-mode-map ",,3" '(lambda() (interactive)(hide-sublevels 1)(show-children 2))) (evil-define-key 'normal evil-org-mode-map ",,4" '(lambda() (interactive)(hide-sublevels 1)(show-children 3))) (evil-define-key 'normal evil-org-mode-map ",,5" '(lambda() (interactive)(hide-sublevels 1)(show-children 4))) (evil-define-key 'normal evil-org-mode-map ",,6" '(lambda() (interactive)(hide-sublevels 1)(show-children 5))) (evil-define-key 'normal evil-org-mode-map ",,7" '(lambda() (interactive)(hide-sublevels 1)(show-children 6))) (evil-define-key 'normal evil-org-mode-map ",,8" '(lambda() (interactive)(hide-sublevels 1)(show-children 7))) ; various commands mapped below (evil-define-key 'normal evil-org-mode-map ",dd" 'org-deadline) (evil-define-key 'normal evil-org-mode-map ",ds" 'org-schedule) (evil-define-key 'normal evil-org-mode-map ",te" 'org-set-tags-command) (evil-define-key 'normal evil-org-mode-map ",ts" 'org-todo) (evil-define-key 'normal evil-org-mode-map ",r" 'org-refile) (evil-define-key 'normal evil-org-mode-map ",c" 'org-capture) (evil-define-key 'normal evil-org-mode-map ",ag" 'org-agenda) (evil-define-key 'normal evil-org-mode-map "<<" 'org-promote-subtree) (evil-define-key 'normal evil-org-mode-map ">>" 'org-demote-subtree) (evil-define-key 'normal evil-org-mode-map ">." 'org-move-subtree-down) (evil-define-key 'normal evil-org-mode-map "<," 'org-move-subtree-up) (evil-define-key 'normal evil-org-mode-map "gj" 'org-forward-same-level) (evil-define-key 'normal evil-org-mode-map "gk" 'org-backward-same-level) (evil-define-key 'normal evil-org-mode-map "gh" 'outline-up-heading) (evil-define-key 'normal evil-org-mode-map "gl" 'outline-next-visible-heading) (evil-define-key 'normal evil-org-mode-map ",g" 'org-goto) (evil-define-key 'normal evil-org-mode-map ",ex" 'org-export) (evil-define-key 'normal evil-org-mode-map ",ns" 'org-narrow-to-subtree) (evil-define-key 'normal evil-org-mode-map ",nw" 'widen) (evil-define-key 'normal evil-org-mode-map [(return)] 'org-insert-heading-respect-content) ; add hook to load evil-org mappings in all org documents (add-hook 'org-mode-hook 'evil-org-mode)
Re: [O] Tags question
Nick Dokos hp.com> writes: > There is a function that is used for tags completion: > > , > | org-global-tags-completion-table is a Lisp function in `org.el'. > | > | (org-global-tags-completion-table &optional FILES) > | > | Return the list of all tags in all agenda buffer/files. > | Optional FILES argument is a list of files to which can be used > | instead of the agenda files. > ` > An easy alternative if the list of tags is small and relatively stable would be to create a custom block agenda view (or maybe several different block agendas). Below is example code from the Org documentation: (setq org-agenda-custom-commands '(("h" "Agenda and Home-related tasks" ((agenda "") (tags-todo "home") (tags "garden"))) ("o" "Agenda and Office-related tasks" ((agenda "") (tags-todo "work") (tags "office") "This will define C-c a h to create a multi-block view for stuff you need to attend to at home. The resulting agenda buffer will contain your agenda for the current week, all TODO items that carry the tag ‘home’, and also all lines tagged with ‘garden’. Finally the command C-c a o provides a similar view for office tasks." http://orgmode.org/manual/Block-agenda.html#Block-agenda
Re: [O] update agenda on file modification
sergio sergio.spb.ru> writes: > > Is it possible to update agenda on .org file modification? > Do you mean whenever a buffer changes? If so then I think the answer is No, and you wouldn't want it to, since you frequently are working in agenda and causing changes to the document buffers. This has been discussed before and even if performance was not a problem there are reasons for not regenerating while you're in agenda. There's a function that will regenerate the agenda after an idle time of x seconds: http://orgmode.org/worg/org-hacks.html#sec-1-8-11 I assume it could be modified to check for changed files on disk, if you wanted to use that as trigger for regeneration. -- Herb
Re: [O] file name prefix in agenda view
Herbert Sitz gmail.com> writes: > > The first field of agenda lines is actually the 'Category' of the heading, > defaults to the filename. You can get it to blank out the Category field by > including this line in config lines of your documents: > > #+CATEGORY > Sorry, that should have been: #+CATEGORY:
Re: [O] file name prefix in agenda view
sergio sergio.spb.ru> writes: > Is it possible to turn of file prefix (file:) in agenda view? > I use the only one file for agenda and don't plan to use more than one. The first field of agenda lines is actually the 'Category' of the heading, which defaults to the filename. You can get it to blank out the Category field by including this line in config lines of your documents: #+CATEGORY I don't know if there's some way to set it to a blank value globally. I expect there is; maybe someone else can point it out. -- Herb
Re: [O] The Org->ODT exporter is now in Org's core (latest git)
Thomas quantentunnel.de> writes: > > There is ODT2ORG > (https://bitbucket.org/josemaria.alkala/odt2org/wiki/Home) > which lets you import odt files in org-mode. > It works quite well and may need > just some minor polishing. > Thomas -- Thanks, I think that's what I was thinking of. For some reason I was assuming that the odt importer would have been written by Jambunathan as a companion piece to his exporter. -- Herb
Re: [O] The Org->ODT exporter is now in Org's core (latest git)
Bastien altern.org> writes: > > Dear all, > > as the subject says. Please all test this heavily and report > any problems. This will be part of Org 7.8 and soon in Emacs. > > Thanks a lot to Jambunathan for all this efforts, let's make > sure everything is smooth before the release! > > Best, > Great. I'm wondering what sort of progress has been made on the ODT importer. For example, is it able to convert an Org export to ODT back to Org format with result being same as the original Org file that was exported? If something is lost, what is lost?
Re: [O] benefit to having org files in one folder
prad towardsfreedom.com> writes: > > i read somewhere that we should keep orgfiles in an org folder. > i've used org casually that way and otherwise. > > what advantages are there to having them in a single folder? > It can be easier to specify agenda files if you have all of them in a single directory. If you include a directory in the agenda-files variable then all .org files in that directory will automatically be included in agenda-files. -- Herb
Re: [O] Viewing all entries of a file in Agenda
Sven Bretfeld gmx.ch> writes: > It is the last line that puzzles me. If I have it like above, every call > of this agenda is interrupted by the question which tag I want to query > for. Hitting RET does what I want, namely displaying all headlines of > the file. How is that possible without Emacs asking me? The file can > contain different todo-keywords and tags or none at all. I want to > display everything. > > Thanks for a hint > > Sven One of the special properties of every Org heading is 'Level', which is an integer representing the outline level of the heading. Doing the following search should return all the headings in an Org document: Level>=1 This search would return only first and second level headings:
Re: [O] [feature request] Org as an Excerpt Database (or Multivalue Properties)
Sven Bretfeld gmx.ch> writes: > > > A property search for "code-writing" should match this citation and all > others with this property. An additional search for "career" should > narrow the matches down. But orgmode understands "money, ... ethics" as > ONE value, not FOUR. That's the problem. Sven -- I think you should be able to get results you want using "regular expression" searches on your 'keyword' field. E.g., the following tags-todo search should find headings that have both 'career' and 'code-writing' in a 'keyword' property: keyword={career}keyword={code-writing} This search would find headings that had one or the other or both: keyword={career\|code-writing} Regular expressions start out simple but can get very complex. I expect there's a way to get whatever you want out of the "multi-value" property strings you want to use. -- Herb
Re: [O] Directional quotes in html
tycho garen tychoish.com> writes: > > The directional quotes are processed by LaTeX and org have very little > to do with this. Ahh, thanks, I should have known that. > > > What is best way to get directional pairs of open- and close-quotes in html > > export? > > http://daringfireball.net/projects/smartypants/ Thanks. Looks like Christian Moe's method in different post is a simplified and perhaps not quite as effective way of doing something similar. -- Herb
Re: [O] Directional quotes in html
Christian Moe christianmoe.com> writes: > > Hi, Herb, > > I keep this in my .emacs: > > (setq org-export-html-special-string-regexps >(cons > '(" \"\\([^\"]+\\)\"" . " “\\1”") > org-export-html-special-string-regexps)) > > There may be a better way to do it altogether, and I'm sure the very > simple regexp could be improved on (in fact, I'm posting this in the > hope someone will improve on it), but it mostly works. > > Yours, > Christian > Christian -- Thanks a lot. If there's nothing built in to Org to do it then that looks like a good method. Question: Does this work only if quotes both appear on the same line of Org-mode text? Or is the regex applied to paragraph as a whole after it's been assembled as part of export? It looks like it does only double-quotes; makes me realize single quotes are a bit harder because they're often used alone as apostrophes. It seems like even single-quote pairs could work well if you put beginning-of-word (\<) and end-of-word (\<) regex anchors in there. Beginning-of-word and end-of-word anchors may be appropriate even for the double-quote search, so maybe something like change below could be improvement. Take it for what's it's worth, since I don't do emacs regexes. > '("\<\"\\([^\"]+\\)\"\>" . " “\\1”") -- Herb
[O] Directional quotes in html
In my exports to pdf standard double-quote and single-quote (apostrophe) characters both get translated to corresponding pairs of opening and closing quotes. But in export to html both double- and single-quotes seem to be same in resulting html as they were in the org text, non-paired, non-directional. What is best way to get directional pairs of open- and close-quotes in html export? -- Herb
Re: [O] Generating clock table for arbitrary date range
A. Ryan Reynolds gmail.com> writes: > > Is there any way to specify a start and end date for the :block property of a clock table? Lately I have often > found myself submitting an invoice based upon my clock report on Friday evening, only to be called > frantically on Saturday and having to put in additional hours (this should sound familiar to many > programmers :)), which I then need to attribute to next week's clock table to be submitted on the following > invoice. Is there an easy way to do this? > -- > A. Ryan Reynolds > I'm not sure how this solves problem you describe, but see the tstart and tend options for clocktables: http://orgmode.org/manual/The-clock-table.html#The-clock-table For example: #+begin: clocktable :tstart "<2011-10-27 Tue>" :tend "<2011-11-22 Tue>" #+end The above is for a dynamic block in the document. If you're talking about clocktables in agenda I assume the way to modify is to change the period of the agenda view.
Re: [O] how to show deadlines in global to-do list?
James Harkins gmail.com> writes: > I like the out-of-the-box to-do list, except one thing: I would like > to see the items' deadlines. The weekly agenda view shows the > deadlines, but I need a view where I can see *only* to-do items and > their deadlines. > Here is one way: Include this line in your org-file's config lines, or just stick it in if you don't have config-line block: #+COLUMNS: %45ITEM %18DEADLINE Now either save and reload or press on the #+COLUMNS line. Now do your agenda search. Once in agenda, turn on column view by pressing: This is a more-or-less temporary solution. I'm sure there's way to make the columns setting above a default without having to put the config line in your buffers, but don't remember offhand. I believe turning on column-view is a setting you can include when defining a user-defined search. . .
Re: [O] Open Drawer using keys or even better automatically
Markus Grebenstein mgrebenstein.de> writes: > > Dear List, > > after converting my whole thesis from Scrivener to Orgmode I'm missing > just one feature: > Synopsis > > The method proposed in the list using the VISIBILITY property is not > suitable for me since I want to have the synopsis at the level of the > text it describes and I want to be able to have some introduction text > also besides the synopsis. Markus -- Was this the method you didn't like that used the VISIBILITY property, or was it the same author's previous solution?: http://article.gmane.org/gmane.emacs.orgmode/34949/match=synopsis -- Herb Sitz
Re: [O] [beamer] Can I just export one frame?
zwz gmail.com> writes: > It takes long to export the whole file when it contains many babel > stuff. And in many cases, I just want to check if the current frame is > arranged as expected. SO I just want to know if there is some convenient > way to export just one frame without tagging all the other frames as > :noexport. > Have you tried just tagging the tree you want with :export:? Once that select tag is present in the buffer Org will automatically exclude any trees that don't have it. From the docs: "Org first checks if any of the select tags is present in the buffer. If yes, all trees that do not carry one of these tags will be excluded. If a selected tree is a subtree, the heading hierarchy above it will also be selected for export, but not the text below those headings. " http://orgmode.org/manual/Selective-export.html#index-export_002c-selective-by-tags-or-TODO-keyword-1424
Re: [O] Failure exporting with emacs --batch
Nick Dokos hp.com> writes: > > That doesn't matter here: both of the above should work fine in a bash > (or similar) shell environment. I prefer the single quote style in > general, since it allows me to leave everything else unchanged[fn:1]. > > But shell quoting is a minefield: when you have to quote *parts* of an > expression and leave other parts unquoted so that the shell can get to > them (e.g. to evaluate shell variables and `...` or $(...) constructs), > life starts to get difficult - and that's just the beginning[fn:2]. > Nick -- Thanks for clarifying, I didn't read Tom's post closely enough or I would have seen that the export was indeed getting called. I've been working with getting the batch quoting working both for bash and for windows command line (in VimOrganizer clone), trying to keep them as much alike as possible. I think I have things working okay for now, but your tips may be helpful if I end up with something more complex to send. Regards, Herb
Re: [O] Failure exporting with emacs --batch
Herbert Sitz gmail.com> writes: > > Not sure, but I do something similar with a single --eval: > > --eval '(progn (find-file "filename") (org-export-as-html-and-open 3) )' > Except my version has double quotes for --eval argument and backslashes before embedded quotes: --eval "(progn (find-file \"filename\") (org-export-as-html-and-open 3) )"
Re: [O] Failure exporting with emacs --batch
Tom Prince ualberta.net> writes: > With b43c1c621f52f4a51d8d79cb76c226dfed003998 running > > emacs --no-init-file --load min.el --eval '(setq debug-on-error t)' --eval '(find-file "test.org")' > -eval '(org-export-as-html 3)' --batch > Not sure, but I do something similar with a single --eval: --eval '(progn (find-file "filename") (org-export-as-html-and-open 3) )' -- Herb
Re: [O] regenerating agendas automatically if any .org files change
Viktor Rosenfeld googlemail.com> writes: > > AFAIK, there can only be one agenda view (an expert correct me, if I'm > wrong). But you can multiple blocks in the agenda. Search for "Office > block agenda" in: > > http://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.html > > Cheers, > Viktor I assume an agenda view with multiple blocks would work for OP. But given his intended use could he not also just start up several independent Emacs instances on his B machine, each to show a different agenda view? -- Herb
Re: [O] Feature suggestion
Markus Grebenstein mgrebenstein.de> writes: > > since I used Scrivener (Windows Beta) quite a while I'd love to have > more of fletcher penny's multimarkdown (or MMD- like Syntax) integrated > in orgmode to make it more versatile. Sadly I am not a lisp programmer > at all... > Markus -- What exactly are the features you're thinking about? For example, I read this at the MMD site, but virtually all of these are already implemented in Org-mode: MultiMarkdown adds these features to the basic Markdown syntax: footnotes tables citations and bibliography (works best in LaTeX using BibTeX) math support automatic cross-referencing ability smart typography, with support for multiple languages image attributes table and image captions definition lists glossary entries (LaTeX only) document metadata (e.g. title, author, etc.) -- http://fletcherpenney.net/multimarkdown/features/ Regards, Herb
Re: [O] Video showing Jambunathan's ODT exporter
Torsten Wagner gmail.com> writes: > > > It's obviously not for everyone; I'm sure some Org users have no need for > > documents in a word processor and steer as far away as possible. Others may > > love it, though, and it could potentially bring more users to Org community. > > Well it becomes particular important if it comes to collaboration with > MS-Office people. I can write my stuff in org and make a LaTeX export > for the final submission, however, I can send co-authors ODT (and by > resaving doc) formats to allow them to make changes and comments to the > manuscript. Great point. On related note, did you see the tweak Jambunathan added a week or so ago to translate "note blocks" in Org into author-attributed comment bubbles in Word/LibreOffice: http://article.gmane.org/gmane.emacs.orgmode/48585 Another benefit I just thought about with to exporting to ODT is the power it gives users to modify document formats. LaTeX is amazing, but it's not something where the average user is going to be able to tweak the output very easily. Word/LibreOffice, on the other hand, allow the average user to tweak formatting fairly easily, either after export by changing styles directly in the document, or (I assume) before export by changing the styles that are used by Jambunathan's exporter. Though I must say the formatting he's using right now seems very good. I particularly like the way section headings have slightly more whitespace above than they do below, makes for nice connection of headings to their text, which if I recall is a touch that's not done as nicely in many LaTeX classes. > > Having the possibility to re-import the ODT-file into org and make a > kind of diff which I simply step through and either agree or disagree > would be perfect. Emacs already has diff functionallity. What would be > needed is a way to re-import the ODT-file in a as much as possible exact > way like it was originally. > The ODF format is open and I wonder whether there is some kind of > metadata tag, which could be used to save the org-mode stuff directly > beside the odt text stuff... this would allow to restore the org-mode > file rather efficiently. That could be sort of a "holy grail" type of workflow, seamless export out and import back in from MS Word. I know Org's exports to other formats are also amazing, but the export to MS Word seems somehow more "magic". I think it's because I'm a relative old-time and still think of Word as being monstrosity from the days of proprietary binary formats. Now with ODT support it's (almost) like making it part of the plain-text crowd. Regards, Herb
Re: [O] New version of VimOrganizer, an Org-mode clone in Vim
Michael Brand gmail.com> writes: > > or at a similar place that there is also the possibility to have the > vi modal editing paradigm and most of the vi key bindings within Emacs > itself by using a vi emulation like Viper mode. (I use Emacs with > Viper mode all the time to have the best of both worlds.) > > Michael > Michael -- No problem, this issue was of course brought up when I started the project a year or so ago. Actually for the many Vim users who have tried to make the transition to Emacs I think it is pretty well known that there are several different Vim emulators for Emacs. (Evil is a fairly new one I still want to try out; I'm not sure but I think it's by same team and intended to supplant Vimpulse, which itself extends Viper: http://gitorious.org/evil ) In any case, for several people who contacted me about editing Org documents, and who had no preference for Vim over Emacs, I of course recommended that they go with Emacs. That's a no brainer. I use Viper/Vimpulse myself when in Emacs, and while nice, I certainly would not say it gives me the best of both worlds. It gives me Emacs, which is great, along with a useful but somewhat kludgy-feeling emulation of a decent chunk of Vim stuff. Good enough for some people trying to make the switch to Emacs. Not good enough for many, who have tried to make the switch only to turn back to Vim. You may be aware that the Org project itself is one of the major reasons people try to switch from Vim to Emacs. I was one of those people who tried and didn't like working in Emacs, despite using Viper/Vimpulse. Even now when I use Org-mode I mostly operate it using the menu system, not with the key-chord-combinations. One neat idea, I think, would be for someone to extend Viper/Vimpulse/(or Evil) with keybindings that provide a usable Vim-type modal interface to Org-mode's features. That could be nice. Regards, Herb
[O] Video showing Jambunathan's ODT exporter
Last week I finally got around to testing the export to ODT that Jambunathan's made available. Here's a 3 minute video showing how it works (calling odt export from a document open in VimOrganizer): http://vimeo.com/31564708 This is some seriously cool functionality for Org that deserves wider exposure. Jambunathan's done a great job. It's obviously not for everyone; I'm sure some Org users have no need for documents in a word processor and steer as far away as possible. Others may love it, though, and it could potentially bring more users to Org community. I've seen comments about an ODT import that I haven't had a chance to look into yet. Cheers, Herb
[O] New version of VimOrganizer, an Org-mode clone in Vim
I just formally pushed up a new version of VimOrganizer, an Org clone in Vim. This version is much closer to being a true alternative to using Org-mode in Emacs. I say alternative to "using Org-mode in Emacs", because VimOrganizer in large part operate as a front end to Org-mode by making calls to a running Emacs server. All of the export functionality is done this way, as is access to stuff like Org-babel, spreadsheet evaluation, live blocks like clocktables, column blocks, etc. I'd be glad to hear any feedback, comments, suggestions. . . An intro to some of the stuff in the new version is here: https://github.com/hsitz/VimOrganizer/blob/master/intro.txt Git page is here: https://github.com/hsitz/VimOrganizer And the page on Vim's website is here: http://www.vim.org/scripts/script.php?script_id=3342 I will try to get some videos of the new functionality in next day or two. One main thing I'm happy about is I extended my patch of Vim to allow separate highlighting of TODO items on folded headings. Previously my patch enabled level-dependent fold highlighting, but always showed TODOs in same color as the folded heading. Much nicer to have everything collapsed and still have the TODOs pop out at you. Thanks to everybody on here who's provided help for my (sometimes silly) questions about Org-mode and how it works. I'm starting to really appreciate elisp, so who knows what the future holds. . . Regards, Herb
Re: [O] Bug in pdf export of tables with latest development version
Nick Dokos hp.com> writes: > > You probably should try using a long table: section 12.6.4 in the manual > or evaluate > > (info "(org) Tables in LaTeX export") > > Nick > Nick --- Thanks, that did the trick. Sorry to trouble you, upgrading to 7.7 development version and could have sworn same thing worked fine in the 7.4 I was using, but I'm sure I was mistaken. Thanks again. --- Herb
Re: [O] Bug in pdf export of tables with latest development version
Herbert Sitz gmail.com> writes: > I'm having problems exporting to pdf with a source block that generates a table > result. If the table has enough rows to get to bottom of page, it seems, the > rest of the table output disappears/is discarded and the pdf document skips to > text after the source block output. > A little more info. Looking at the .tex file all of the exported data is there in a \tabular section. However as I said whatever goes beyond end of page where table starts is discarded or invisible on conversion to pdf. It seems no page breaks are getting put into the table, just runs off end of first page in pdf. -- Herb
[O] Bug in pdf export of tables with latest development version
I'm having problems exporting to pdf with a source block that generates a table result. If the table has enough rows to get to bottom of page, it seems, the rest of the table output disappears/is discarded and the pdf document skips to text after the source block output. Everything works fine with html output. Here's sample code. With repeat number of above 50 or so it will truncate table output in resulting pdf: -- * Head one #+begin_src python :exports results :results value mylist = [] for i in range(100): mylist.append([i,i+1,i+2,i+3,i+4]) return str(mylist) #+end_src #+results: * Head two more text for head two ---
Re: [O] [odt] Support for annotations/comments
Jambunathan K gmail.com> writes: > > I needed an excuse for adding support for annotations. Exporting the > below org will produce the attached odt/pdf files. Note that the pdf > file is produced by LibreOffice pdf export. > > Annotations is a ODT only feature right now and will not work with other > backends. > Wow! That's great. I wasn't thinking of odt, have never used it, but maybe I will check into it. I loaded into Word 2007 and it gave some error message but displayed the comments fine. And of course they work great in the LibreOffice pdf. Thanks, Herb
[O] Evaluation on export has stopped working, org-export-blocks hook was culprit?
I had a system that was working fine, but it seems to have stopped processing babel source blocks on export. I've switched between Org 7.4 and 7.7 on Win32 Emacs 23.1 and both have the problem. As I was writing this up I discovered that the problem was caused by a line I had added to my .emacs. This line was preventing any evaluation of source blocks at all: '(org-export-blocks (quote ((comment org-export-blocks-format-comment nil) (ditaa org-export-blocks-format-ditaa nil) (dot org-export-blocks-format-dot nil I had innocently been testing out export of comments with org-export-blocks hook and I had forgotten I put that in .emacs some days ago. It seems to have prevented any processing of my source blocks on export. That is the export of the block simply exports the code between begin_src and end_src, regardless of the value of :exports option (both, none, results, code). And, of course, the code in the source block was not getting evaluated. Don't know if this is a known problem or not. Thanks, Herb
[O] "Clocktable summary at ..." line not showing up right in export
I'm exporting a file with a clocktable and the first line of the Clocktable shows up with no date or time info, just: "Clock summary at" [followed by nothing] The rest of the clocktable shows up fine, and has lines that look like: #+begin: clocktable :maxlevel 1 Clock summary at [2011-10-27 Thu 14:29] | Headline| Time | |-+| | *Total time*| *5:11* | |-+| | DONE Tasks and States | 1:01 | | FIXME Custom agenda views | 0:01 | [ . . . ] :#+end: I'm using Org 7.4 and Emacs 23.1. Don't know if this bug has been reported or addressed but didn't see it in quick search of the archives. Is something wrong on my end? -- Herb
Re: [O] How to include comments on export? org-exp-blocks.el?
Herbert Sitz gmail.com> writes: > > Can someone give an example of how org-exp-blocks (or anything else) could be > used to export comment blocks as graphic notes in the text? > Just to add a bit. I do have the following line in my .emacs: (require 'org-exp-blocks) and I have a comment like this in my document: --- sample text below -- * Heading one text here #+begin_comment some comment text here #+end_comment * Heading two --- sample text above -- When I export it the headings and text print out but the comment doesn't. I assume I need to do something more than have the 'require' for org-exp-blocks in my .emacs but I can't figure out what it is. -- Herb
[O] How to include comments on export? org-exp-blocks.el?
I'm trying to see if there is a way to include comments on export, to show up as something like the comments boxes you see in MS Word. I see Eric Schulte did some work on this and that somehow it ended up (I think) as part of what you could do using the org-exp-blocks addon. But I'm not sure how you actually use it. Can someone give an example of how org-exp-blocks (or anything else) could be used to export comment blocks as graphic notes in the text? Thanks, Herb
Re: [O] Output to shell when calling emacsclient?
Herbert Sitz gmail.com> writes: > Can't get it to work in Windows, though. In Windows it runs in the gui server > with correct output in Emacs server in the Messages buf and on the minibuf > command line. But not output in the terminal. > In case anyone cares -- I know the number of people using emacsclientw is probably tiny -- the workaround I'm using in Windows is just to pipe it to 'cat'. So this does work to output on the terminal: > emacsclientw --eval ^"(message \^"Hi there\^")^" | cat -- Herb
Re: [O] Output to shell when calling emacsclient?
Nick Dokos hp.com> writes: > The message function will cause output to the echo area of emacs as well > as to the > standard output of the emacsclient command: > , > | $ emacsclient --eval '(message "Hi there")' > | "Hi there" > ` Nick -- Thanks, it does indeed work for me in Linux. Can't get it to work in Windows, though. In Windows it runs in the gui server with correct output in Emacs server in the Messages buf and on the minibuf command line. But not output in the terminal. Strange because I can get the shell to redirect the output to a file: > emacsclientw --eval ^"(message \^"Hi there\^")^" > output.txt But if I don't enter the redirect to a file the output never shows up in the terminal. Maybe someone knows the explanation for this? -- Herb
[O] Output to shell when calling emacsclient?
I'm running --eval commands from the shell using emacsclient (and on windows emacsclientw). The --batch option does not seem to be an option with emacsclient, although it works fine with plain emacs. However, I would still like to print output to the shell that I'm issuing the emacsclient command in. Is there some way to do this? Thanks, Herb
Re: [O] Org, Diffs, and Version Control
Eric Schulte gmail.com> writes: > Additionally you could try the --word-diff option to git, i.e., > > git diff --word-diff > > or > > git diff --word-diff=color > > which returns diffs which ignore whitespace changes and which show > changes on the word rather than line level. I believe it is possible to > make this behavior default for a git repository but I've never done so > and don't know how such a default would be specified. > > Hope this helps -- Eric > Thanks for the tip. Here's some info that I think shows how to make --word-diff option the default for a particular type (e.g., .org) fie: http://stackoverflow.com/questions/7542543/use-gits-word-diff-for-latex-files -- Herb
Re: [O] How do I automatically run a function whenever an org file is loaded?
Herbert Sitz nwlink.com> writes: > > I'd like to put a function in my .emacs file to run each time an org file is > loaded. > > I don't see any hook for this among org-mode hooks; I assume this is something > that's accomplished using generic Emacs. > > Can someone tell me how to set this up? > Sorry for the trouble, I think it is indeed one of the org-mode hooks, specifically 'org-mode-hook'. -- Herb
[O] How do I automatically run a function whenever an org file is loaded?
I'd like to put a function in my .emacs file to run each time an org file is loaded. I don't see any hook for this among org-mode hooks; I assume this is something that's accomplished using generic Emacs. Can someone tell me how to set this up? Thanks, Herb
Re: [O] problem with find-file in --eval from command line
Viktor Rosenfeld googlemail.com> writes: > > This works on Bash (tested on 4.2.10) and should be easy to remember: > > emacs --eval "(find-file \"/home/somefile.org\" )" > > Cheers, > Viktor I thought I had tried already that but I hadn't. Thanks Viktor. -- Herb
Re: [O] problem with find-file in --eval from command line
Achim Gratz nexgo.de> writes: > > Bash needs this instead > > emacs --eval "( find-file "'"'"/home/somefile.org"'"'" ) " > > THere may be other solutions for bash, but I never really got the hang > of their quoting rules. > > Regards, > Achim. Achim -- Thanks a lot, that Bash version works great. I'll have to check into quoting rules for the Linux shells. Regards, Herb
[O] problem with find-file in --eval from command line
I'm trying to start emacs from the command line and using an --eval section to open a file and do some operations. I'm having a problem with the Linux version. Here's how I do it without error using the strange quoting in Windows: ---> emacs --eval ^"( find-file c:/users/myname/somefile.org\^" )^" In Linux I'm not sure how to do the quoting. I tried this: ---> emacs --eval "( find-file "/home/somefile.org" )" And I get the error: Symbols' value as variable is void: /home/somefile\.org It seems there's some problem with the period in the filename, but maybe it's more than that. Can anyone explain how to properly quote the Linux commandline version? (File comes up fine if I just do find-file in a running emacs.) Thanks, Herb
Re: [O] How to add entry in the Agenda view
Xin Shi gmail.com> writes: > I usually have a dedicated window (frame) for Org Agenda view. I found it would be very convient to be able to add item directly from the Agenda buffer, however, I don't see that command in the manual. (A closer one is the refill, which moves the entry to another category) > It may work fine to you to just use Capture from the Agenda to add a new outline item to a capture file. You invoke capture from the Agenda, then just refresh the agenda after creating the new item. Russell Adam's video demonstrates this use at roughly 14:00 to 19:00: http://vimeo.com/16533939 Regards, Herb
Re: [O] problem with command-line call to emacsclient
> (defun test-kill-buffer (fname exp-function) > (let ((buf (find-file fname))) > (funcall exp-function) > (kill-buffer buf))) > > (test-kill-buffer "/tmp/abc.txt" 'some-function-to-call) > > will do the trick. > > Regards, Olaf Olaf -- Beauteous, thank you, that did indeed do the trick. -- Herb
[O] problem with command-line call to emacsclient
I'm making a call to an emacsclient and trying to figure out how to get the buffer to unload at the end of the function I'm calling. I know kill-buffer isn't supposed to unload the buffer but I can't figure out what will. I've tried server-edit and server-kill-buffer in place of kill-buffer below and they also haven't worked. The buffer gets "pushed to the kill buffer", but remains loaded. The problem with having buffer remain loaded is when I redo the command-line call after editing the org file outside of emacs it prompts user for whether to reload changed file. One option would be to simply disable that prompt, I guess, but I'd rather be able to clear the buffer. Here's the function I'm calling: -- (defun vimorg-export-publish (fname exp-function) (find-file fname) (funcall exp-function nil) (kill-buffer) ) - And here's sample command line that calls it. Strange characters are because it's on Windows system, but it works fine other than that the buffer is not unloaded at end of vimorg-export-publish function: - c:\users\herbert\emacsclientw.exe --eval ^"(vimorg-export-publish \^"~/myorgfile.org\^" 'org-export-as-html-and-open )^" -- Thanks for any tips. -- Herb
Re: [O] tangle paths
skip gmail.com> writes: > > Is there a way I can produce output of tangle blocks to specific file paths? > I haven't tested, but one way might be to use the org-babel-post-tangle-hook to write a function to move files wherever you want: http://orgmode.org/manual/Extracting-source-code.html#index-tangling-1720 -- Herb
Re: [O] tangle paths
Eric Schulte gmail.com> writes: > skip gmail.com> writes: > > > Is there a way I can produce output of tangle blocks to specific file paths? > > > > The manual is useful: http://orgmode.org/manual/tangle.html > Eric -- I was wondering similar thing, but manual wasn't clearing things up for me. As far as I know, 'basename' conventionally refers to a filename (root plus extension) that does _not_ include a directory path to the file itself. See, e.g., http://en.wikipedia.org/wiki/Basename Is the manual using 'basename' to refer to a full path designation, minus the extension? E.g., /path/to/file/filename -- Herb
Re: [O] org-babel -- Improper syntax error in session mode?
Eric Schulte gmail.com> writes: > You are suggesting that code to be run "interactively" should be written > to an external file then loaded into the interactive session. Generally, yes, because babel's definition of "interactive" (execute an arbitrary collection of code lines all at once) is different from an interactive shell session's (execute a single statement of statement block at a time, giving output after each). > This > would certainly work around the syntax limitation of the current setup. > My two concerns here are that > > 1. users who use interactive babel blocks side-by-side with the session >may be used jumping into the session to play with code interactively >and debug, in such cases rather than seeing their code in the session >history they would only see execfile('/tmp/blahblah'). Note I do >recall discussion on list related to user's reading their session >code in the inferior session buffer. I see your point, that's a valuable tool. Ideally, it seems to me, the session blocks could be evaluated _either_ "interactively" (with a history in shell session) or as a block-as-a-whole. Having a named session (e.g., ':session debug') designated to use the interactive mode and other :sessions use "non-interactive" mode would be one way to do this. > 2. similarly error messages would now point into this temporary file, >rather than back into the session history I think the ':session debug' behavior in paragraph above could get around this. (I think there are also ways to feed the source lines through but that doesn't get around your issue 2., anyway.) > > Basically you would prefer more decoupling from the interpreter and I'm > not sure for the average user if this would be a worthwhile exchange > simply to be able to avoid syntax errors like your originally mentioned > example (which was the first such post I've seen on this list). > > I'm disinclined to make such a change without a wider base of support > for the request from the Babel/Python user community -- or at least > without more complaints about the existing behavior. > Yeah, I completely get you here. If there are no other complaints about existing behavior, and with limited resources, there's no good reason to change things. Regards, Herb
Re: [O] org-babel -- Improper syntax error in session mode?
Eric Schulte gmail.com> writes: > There are times when I explicitly do not want a session to start fresh. > Generally this is related to caching, for example if I have some value > which is expensive (say a couple of minutes of computation) to compute, > and it is currently alive in the session, then I'd probably rather keep > my session active across multiple exports as I'm working on other (say > visual/prose tweaks) to the exported document. > > Does that make sense? > > If the user did want to refresh the session on _every_ export I believe > they could add such a function to the `org-export-preprocess-hook'. > > Cheers -- Eric > Eric -- That makes perfect sense. However to the extent reproducibility is a concern it would make me uneasy to have a default that does nothing to enforce reproducibility; and instead to have it controlled in a hook behind-the-scenes. An acceptable alternative it seems to me, would be to put an elisp source block at begin of document to reset the session, and then to use that block to control whether session is reset. That way it's clear to user exactly what's happening. -- Herb
Re: [O] org-babel -- Improper syntax error in session mode?
Thomas S. Dye tsdye.com> writes: > > Aloha Herb, > > [ . . . ] > > Is it the case that the Ruby and Perl interpreters won't run code that > does run in non-session mode? > > All the best, > Tom > Tom -- I don't know about Ruby and Perl, have only done some basic testing in Ruby and it works fine. My guess would be that generic Ruby and Perl code in :session mode is more likely to run without error than Python, because of Python's special reliance on and indentation as syntax items, and the way that affected design of the Python interactive shell. -- Herb
Re: [O] org-babel -- Improper syntax error in session mode?
Thomas S. Dye tsdye.com> writes: > > Aloha Herbert, > > I think you're right about the potential to improve the documentation. > That's an on-going process. Could you suggest some specific changes? > > All the best, > Tom Tom -- I would suggest just adding specific warnings that session-based evaluation may throw syntax errors with valid code. Here's what Org manual says regarding :session evaluation with :results output': "The code is passed to the interpreter running as an interactive Emacs inferior process. The result returned is the concaOrg tenation of the sequence of (text) output from the interactive interpreter. Notice that this is not necessarily the same as what would be sent to STDOUT if the same code were passed to a non-interactive interpreter running as an external process. . . ." [http://orgmode.org/manual/Results-of-evaluation.html#Results-of-evaluation] All that needs to be added is a warning: "IMPORTANT: Note that Org provides only a thin wrapper around a language's interactive shell, so valid code that executes properly in non-session mode may fail in :session mode. This is because Org feeds the lines in a :session block to the interactive interpreter exactly as written. In come cases the lines may require special formatting in the source block to be executed properly in the interactive shell. For example: . . . " I think the above issue should be moot for some of the main interpreted languages (viz., Python, Perl, Ruby) where there are various ways to execute a block of code non-interactively despite being in the interactive shell. (One of those methods is the example I gave in previous message.) In that case identical code will run the same whether it's in an interactive-interpreter session or not. It seems to me that switching to that approach for languages that support it should both (1) simplify the Org Babel code, and (2) provide Org users with more flexibility and power. Also, it seems the real power of :session evaluation is to share state between Org/Babel source code blocks, not merely to act as a kind of Org-internal scratchpad. As a user trying to take advantage of that state-sharing power I would generally want my Org document exports to start from fresh sessions. That is, I would write my :session blocks so that they depended on results of code run in previous :session blocks, BUT I would want the first :session block to start with a fresh session,with a known state. So on export I would generally want any existing named session to be closed and restarted anew for an Org export. I hope that all makes sense. I should say I'm not a big Babel user, and I could easily be misunderstanding something. But it seems this is the way the :session-based stuff should work, when possible. -- Herb
Re: [O] org-babel -- Improper syntax error in session mode?
On Mon, Jun 20, 2011 at 5:08 PM, Nick Dokos wrote: > Herbert Sitz wrote: > >> ... (and, it turns out, _avoid_ blank lines in other cases) > > What are those cases? > > Nick > _Every_ spot where a blank line occurs that is followed by "unindented" line of (uncommented) code. By design, the blank line in interactive shell terminates a "highest-level" block and triggers its output. So you _can't_ have blank lines within a level-1 block, all lines in the block must have text. I just noticed, though, that you can include comments and that the indent of comments is irrelevant, so these blank lines could merely have a '# sign prepended to them to transform them into comments. (Existence of "unindented" comments needs to be taken into account for the regex that adds blank lines, though, since they're to be ignored for that purpose.) So this works fine in interactive shell with Eric's patch: -- #+begin_src python :results output :session mypy x = 1 y = 1 z = 1 for i in range(1,2): x = x + i print x # comment here for y in range(10,11): print y # comment here for z in range(5,6): print z while y > 0: print y y=y-1 print "Did it work?" #+end_src - but this doesn't - #+begin_src python :results output :session mypy x = 1 y = 1 z = 1 for i in range(1,2): x = x + i print x for y in range(10,11): print y for z in range(5,6): print z while y > 0: print y y=y-1 print "Did it work?" #+end_src --
Re: [O] org-babel -- Improper syntax error in session mode?
Eric Schulte gmail.com> writes: > > Babel sessions explicitly are thin wrappers around the interactive mode > of the language in question (whatever that may be). That is why Babel > happily doesn't implement sessions for all languages, the contract > simply is that if a language supports interactive evaluation, Babel will > try to allow access to that functionality. > That the Babel session is only a "thin" wrapper is not clear at all from the docs. The docs do mention 'interactive session'--and even that the output may be slightly different from the non-session mode. The docs don't mention anything about the user needing to do extra preparation to avoid syntax errors in evaluation of already valid code. If I take an existing Org block of non-session code and stick a :session on I don't expect to get syntax errors. If that's the expected behavior then it needs to be emphasized more in the docs, otherwise most users will think something is broken in Org. > If the contract was rather simply "Babel provides session based > evaluation", then we'd be on the hook for implementing session > evaluation where it doesn't already exist and may not make sense (e.g., > C, ditaa), and normalizing everywhere else as you're suggesting here. > Which would in turn requires us to spell out Babel-specific semantics of > session based evaluation -- something we have thus-far avoided. Again, the docs reference 'Session based evaluation' in big bold letters and don't indicate the thinness of the wrapper. > > Some positive points *for* the "thin wrapper" approach include; > > 1. It is the simplest to implement >- easier to implement support for new language >- easier to maintain -- especially if interactive tools change >- easier to reason about -- thinking about bug fixing here >- works with alternate back-ends e.g., ipython > I think I have a solution for Python that gives full "session-based evaluation" and which is better than the current "thin wrapper" for all four concerns above (See bottom of my message for an example.) This same approach, I think, would work for Ruby, but I would need to do a little digging to find exact method. Let me know if you want me to do that digging. > 2. It is the least surprising. I'd maintain that for users familiar >with using Python sessions this behavior is the easiest to quickly >understand and use. As opposed to if we did something fancy (even if >it was an improvement) it would be another environment for language >users to have to familiarize themselves with -- they'd have both >normal session rules and babel session rules As a sometimes Python user it had me totally confused. I don't think of "session-based" as having any essential tie to "interactive shell" at all. Why would I worry about state being maintained between statements in an org block? State is already maintained between statements in non-session Org blocks. The only difference with session-based blocks is the starting state may not be "fresh". When I look at Org and think of "session-based" blocks, I see a potential big benefit in having multiple source-blocks throughout my document share the same session. That way I don't need to use Org's (clever and useful but) somewhat clunky and inflexible method of passing data explicitly. In statistics-based docs, for example, I can imagine that the sheer amount of data would make using Org's explicit variable-passing method unfeasible. Using session-based-evaluation is at the same time both simpler and more heavy-duty. I never thought the use of session-based code blocks as something like a scratchpad was much more than toy. If you're typing in code that's not intended to be an integral part of an Org doc then you could just as well jump to the shell and enter it there. Here's an example of how to run a block of Python code of any length in the interactive session and save its output in a file. Note that this is _not_ interactive, even though the command runs in the interactive shell's session: Start with this block of code: - #+begin_src python :results output :session mypy x = 1 y = 1 z = 1 for i in range(1,2): x = x + i print x for y in range(10,11): print y # comment here for z in range(5,6): print z while y > 0: print y y=y-1 print "Did it work?" #+end_src Strip out the block of empty space at the left side and save in a file in current directory (say, 'pyfile.py') with a couple commands prepended and appended: - # beginning of file # prepend code to redirect stdout to file import sys saveout = sys.stdout fsock = open('pyfile-output.log','w') sys.stdout = fsock # code block here, with beginning space block removed x = 1 y = 1 z = 1 for i in range(1,2): x = x + i print x
Re: [O] org-babel -- Improper syntax error in session mode?
On Mon, Jun 20, 2011 at 2:15 PM, Eric Schulte wrote: > > As far as I can tell the problem with the block below (missing the > space) is due to problems with the Python interpreter. It's not due to any problem with the interpreter itself, it's due to a purposeful design decision about the way the interactive shell should work. It makes good sense to require that extra line in interactive mode, given Python's reliance on carriage-returns and indents as part of its syntax, along with decision that the interactive output should be provided at the end of every "level 1" block. The blank line is the only way to end a "level 1 block without starting a second level 1 block. >> >> I hope I'm not confusing things. > > No worries, however, I maintain that it is beyond the scope of Babel's > Python interaction to address examples such as the one given above which > do not work when typed into the Python verbatim session by the user. > >> The patch does help, but doesn't address the extra-line insertion >> issue. > > Fair enough. > Maybe adding the extra lines is beyond Babel's scope, strictly speaking. I can think of some good reasons for doing it though: (1a) Babel is not an interactive shell. (1b) It's not obvious to the Babel user that sessions are being processed using Python's interactive shell. Even if that is known (I know it's somewhere in the docs), it's not clear to a user why Babel would require a user to insert the extra lines (and, it turns out, _avoid_ blank lines in other cases), which make sense in interactive environment but not within Babel's non-interactive environment. Even if this particular idiosyncrasy is documented somewhere it's going to cause confusion for users who skim the docs and just expect regular Python code to work without problems. (If I'm first to report the issue maybe there aren't many Org users trying to use :session mode with Python, though.) (2) Isn't the blank-line issue an easy fix? I think it requires just these two simple changes to source block before submitting to python shell: (a) Regex search replace to add a blank line before any "unindented" line that is preceded by an indented line (actually it may work fine to just put blank line before _any_ "unindented" textline in the source-block); and (b) deletion of all blank lines in the source-block that are followed by "indented" text on next line. > Does it work for other "normal" Python interactive code blocks? Have > you noticed any places where the previous version worked but the new > version doesn't? If it seems safe then I would like to apply it. I think the start with a stray blank line before what should be the actual output. Otherwise It does seem to be working well with the few more complicated things I've created to throw at it. I'm not really a big Python user, was just doing some testing in my vim-Org-clone with Python when I noticed the problem. If you end up not addressing the line-insertion issue I may put it on my todo-list for my first real adventure in learning elisp. Regards, Herb
Re: [O] org-babel -- Improper syntax error in session mode?
Eric Schulte gmail.com> writes: > I've changed the python session evaluation so that it explicitly sends a > RET to the inferior Python process after every line of input. The > attached patch makes this change. > I can confirm that this fixes the > problem in your example (when an empty line is placed between the block > and the subsequent print statement) Eric -- I did confirm that the patch works with this block: #+begin_src python :results output :session mypy x = 1 for i in range(1,5): x = x + i print x print "Did it work?" #+end_src But it doesn't work with the block below, which _is_ valid Python code. I'm not sure whether you're aware that it isn't working with the code below (and were thinking that the code below is _not_ valid python), or whether you were going to require the user to input blank lines at appropriate spots: -- #+begin_src python :results output :session mypy x = 1 for i in range(1,5): x = x + i print x print "Did it work?" #+end_src --- The above block is valid Python, it's just because of the quirk of the interactive python shell that it has to have a blank line inserted before the [print "Did it work?"] line. The locations where the blank lines would need to be inserted in code are wherever the line indent goes from >0 back to 0. A user could be required to insert these, of course, but since it's valid python to leave them out it seems like something org-babel should do behind the scenes. The '0 indent' for purposes of python execution is the smallest indent in the org-babel source. So even though all source code lines are indented in above org block, the line 'x=1' has zero indent for python eval purposes. The relevance of this is just to show that extra lines for shell/babel evaluation are necessary only when code indent goes back to zero, not when indent merely becomes smaller. So the code below works fine, even though indent shrinks after 'print y' and 'print z' statements:: -- #+begin_src python :results output :session mypy x = 1 y = 1 z = 1 for i in range(1,5): x = x + i print x for y in range(10,15): print y for z in range(20,25): print z print "Did it work?" #+end_src Like the simpler example, though, it doesn't work with with the blank line omitted, which it should. I hope I'm not confusing things. The patch does help, but doesn't address the extra-line insertion issue. -- Herb
Re: [O] org-babel -- Improper syntax error in session mode?
Nick Dokos hp.com> writes: > Having said that, however, I think there *is* a problem: > > If you just start the python interpreter and start typing into it: > > --8<---cut here---start->8--- > x = 1 > for i in range(1,5): > x = x + i > print x > print "Did it work?" > --8<---cut here---end--->8--- > > the problem becomes obvious: the interpreter is still in "indented mode" > and complains about the last print, because it is not "properly" > indented. OTOH, if you exit "indented mode" by pressing another RET > before the final print, the interpreter is happy. This is a kludge used > by the interactive interpreter to accommodate python's reliance on > indentation to delimit block structure. > > That however does not work with babel: even if I leave empty lines > between the print x and the last print, the error persists. Apparently, > babel does not send the empty lines to the interpreter. If there is a > bug in babel, it seems to me this is it. > > Nick > Yep, that's what I was thinking. Experiment a little I found that wrapping it in a function gets around part of the problem. This works fine in the terminal, although it doesn't work from the equivalent Babel source block: --8<---cut here---start->8--- >>> def myfunc(): ...x=1 ...for i in range(1,5): ... x=x+i ... print x ...print "Did it work?" ... >>> myfunc() 2 4 7 11 Did it work? >>> --8<---cut here---start->8--- I don't know whether having Babel feed things in pieces and assemble output is complicated for the general case. It seems to me it wouldn't be that bad, it's only the lines where an indent reverts to zero indent where pieces would need to be broken up. As a partial solution, having Babel insert the requisite blank line after the last line of a function def would be helpful, and I think the output would then all end up in a single block, no need to reassemble (or maybe output reassembly is just simplified a little). -- Herb
Re: [O] org-babel -- Improper syntax error in session mode?
Eric Schulte gmail.com> writes: > I can confirm that I see the same behavior. Also, if I manually type > the body of the code block into the session I get the same error output > from Python, so I don't believe this is due to a problem with Babel. > It appears the problem is that the python session is interactive and is built to emit output after each Python "block" (e.g., the 'for' block), before another "block" of Python is entered. If this is the way it's designed then it seems to me that it's Babel's obligation to feed the Python blocks to the Python session as required and then assemble the output pieces as appropriate. Or am I missing something? -- Herb
Re: [O] org-babel -- Improper syntax error in session mode?
Eric Schulte gmail.com> writes: > > Hi Herbert, > > I can confirm that I see the same behavior. Also, if I manually type > the body of the code block into the session I get the same error output > from Python, so I don't believe this is due to a problem with Babel. > Eric -- Thanks. Surely this is a bug that should get reported _somewhere_. If not Org or Babel, where? -- Herb
[O] org-babel -- Improper syntax error in session mode?
I have a code block that evaluates fine in non-session mode but which gives syntax error in session mode. Since it works fine in non-session mode I assume this is a bug?: #+begin_src python :results output :session mypy x = 1 for i in range(1,5): x = x + i print x print "Did it work?" #+end_src #+results: : File "", line 4 : print "Did it work?" : ^ : SyntaxError: invalid syntax
Re: [O] Batch mode evaluation of source code?
Eric Schulte gmail.com> writes: > > By connecting to a persistent Emacs instance much of the .el script I > attached could be removed assuming Babel has already been configured in > the running Emacs server. > > Hope this helps -- Eric > Eric, Nick: Thanks, yes it does. Using also Nick's tip about using --eval (batch doesn't seem to work when calling a client process) I've got things working at least part of the way. I can do the following command in the terminal: > "c:\program files (x86)\emacs\emacs\bin\emacsclientw.exe" --eval ^"(progn > (let ((org-confirm-babel-evaluate nil)) (find-file \^"short-code.org\^") (org-babel-next-src-block) (print (org-babel-execute-src-block This gets processed properly by the running client, but print command output goes into the *message* buffer rather than to the terminal used to enter the command. Any tips on how to redirect the output to my terminal? If not, saving to a file is a decent alternative (though I don't know how to do that either, lol). -- Herb
Re: [O] Batch mode evaluation of source code?
Nick Dokos hp.com> writes: > > > You do M-x server-start on the running emacs to start the server > part. Then you invoke emacsclient from the command line to connect to > it - check the manpage of emacsclient for details: you might be able to > arrange something with the --eval argument. > > Nick > > Nick -- Thanks, also found a previous newsgroup post on same subject here: http://www.mail-archive.com/emacs-orgmode@gnu.org/msg19489.html I'll toy around and see what I can get working. Seems like if I can get the quoting in Windows shell for the eval segment then I should be able to get result I want. . . -- Herb
Re: [O] Batch mode evaluation of source code?
Herbert Sitz nwlink.com> writes: > I'm working on Windows7 and have an Emacs client running when I issue the > batch command, which I assumed also means there is a running emacs server. > Is the > call getting made to the running emacs server? If so, is there some way to > avoid the startup overhead (which seems to come from 'Adding c:/program files > (x86)/emacs/EmacsW32/lisp/ to load path.'). Or, if my batch call is _not_ > making use of the running Emacs server is there some way to get it to use that > server? > > Herb > I can confirm that a new emacs process is getting created to run each batch mode command. I don't really understand the emacs-client/emacs-server setup is supposed to work. So I guess my question is whether my batch-mode command can be made as a client of the existing emacs-server. I'm guessing the answer is 'No', but if so maybe there's some other way to speed up creation of the new emacs process when it's used solely to process an Org source-code-block? -- Herb
Re: [O] Batch mode evaluation of source code?
Eric Schulte gmail.com> writes: > > The following org-mode file and minimal elisp file can be used > to print > the results of evaluating a code block from a batch Emacs > session > (note > this is using Emacs24, so Org-mode/Babel do not need to be > explicitly > loaded). > > I used the following command line > : emacs --batch -l run-code.el 2> /dev/null > Eric -- Thanks, very cool. I'm toying around with this approach to do dynamic code-block evaluation in the Org-mode clone I'm making in Vim. No problem with on-export-evaluation, since the vim-org-clone just saves the file and issues a batch mode org-export or org-publish command to emacs, which takes over from there. I think this dynamic evaluation could be useful, but it also seems like a new server is getting called for each emacs --batch mode call. That's cumbersome for this dynamic-evaluation stuff because of start-up overhead for emacs on each call. Is that the way its supposed to work? I'm working on Windows7 and have an Emacs client running when I issue the batch command, which I assumed also means there is a running emacs server. Is the call getting made to the running emacs server? If so, is there some way to avoid the startup overhead (which seems to come from 'Adding c:/program files (x86)/emacs/EmacsW32/lisp/ to load path.'). Or, if my batch call is _not_ making use of the running Emacs server is there some way to get it to use that server? Thanks again, Herb
[O] Batch mode evaluation of source code?
The Org manual gives an example of a batch mode --eval that runs code to tangle code from Org files. I assume there's also a way to simply run a source code block and get its output in the terminal but I can't see how to do it. To give a concrete example, the Org manual uses this Python source block as example illustrating the difference between :session and non-session results output. How would I evaluate it from the command line and get the results output back in the terminal?: - #+begin_src python :results output print "hello" 2 print "bye" #+end_src -- Herb
Re: [O] Problem with ditaa when doing export from command line
Nick Dokos hp.com> writes: >That's a quoting problem (you are on Windoze, right?) The command line >on Windoze sucks raw eggs (well, not just the command line, but I'm biased . You are correct, sir! Thanks, it is indeed a quoting problem. > > On Linux, I used two kinds of quotes in order to protect the > vulnerable characters > inside each lisp sexp (you could also use backslashes strategically): > >emacs -batch --visit foo.org --eval '(setq org-confirm-babel-evaluate > nil)'\ > --eval "(require 'ob-ditaa)"\ > --eval '(setq org-babel-temporary-directory "tmp")'\ > --eval '(setq org-ditaa-jar-path "/home/nick/elisp/org-mode/contrib/scripts/ditaa.jar")'\ > --funcall org-export-as-html > > Inconvenient, but it works. Okay, here's what seems to work on Windoze. Don't laugh: emacs -batch --visit foo.org ^ --eval ^"(setq org-confirm-babel-evaluate nil)^" ^ --eval ^"(require 'ob-ditaa)^" ^ --eval ^"(setq org-babel-temporary-directory \^"tmp\^")^" ^ --eval ^"(setq org-ditaa-jar-path \^"/home/nick/elisp/org-mode /contrib/scripts/ditaa.jar\^")^" ^ --funcall org-export-as-html There is actually some reason to the rhyme, which is explained here: http://blogs.msdn.com/b/twistylittlepassagesallalike/archive/2011/04/23/everyone-quotes-arguments-the-wrong-way.aspx Thanks again. -- Herb
Re: [O] Problem with ditaa when doing export from command line
Nick Dokos hp.com> writes: > Works fine for me here, so there is probably a syntax error in the lisp > file(s) you load or the lisp code you eval - try using a minimal setup > file as shown below: > > > I do > >emacs -batch --visit=foo.org -l export.el --funcall org-export-as-html > > with export.el containing the following: > > --8<---cut here---start->8--- > setq org-confirm-babel-evaluate nil) > require 'ob-ditaa) > setq org-babel-temporary-directory "tmp") >setq org-ditaa-jar-path "/home/nick/elisp/org-mode/contrib/scripts/ditaa.jar") > --8<---cut here---end--->8--- > Nick -- Thanks very much, I did get it working with your help. However I could not get it to work if I used an --eval in the command line, had to move the assignment into setting.el to get it to work. Did you get it to work with an --eval statement in the command line? -- Herb
Re: [O] Problem with ditaa when doing export from command line
Herbert Sitz nwlink.com> writes: > > Thanks for those tips, had forgotten about loading of settings, though .emacs > was still getting loaded. . . > That was a typo, meant to say, "I thought .emacs was still getting loaded."
Re: [O] Problem with ditaa when doing export from command line
Carsten Dominik gmail.com> writes: > On Jun 10, 2011, at 9:33 AM, Herbert Sitz wrote: > > > I'm trying to do an export by calling emacs from the command line like so: > > > > emacs -batch --visit=myfilename --funcall org-export-as-html > > maybe you need to do > > emacs -batch --visit=myfilename --eval '(setq org-confirm-babel-evaluate nil)' --funcall org-export-as-html > After adding the eval switch the export terminates shortly after starting. I get messages: - Adding c:/Program Files (x86)/Emacs/EmacsW32/lisp/ to load-path OVERVIEW End of file during parsing - Same message has happened in several files, doesn't matter whether there's ditaa code block in .org file or not. I also get basically same result if I load my .emacs file explicitly, although in that case I see some 'Loading . . .' messages before OVERVIEW and End of file message. > Also, note that when you run emacs with -batch, you init file is *not* evaluated, . . . Thanks for those tips, had forgotten about loading of settings, though .emacs was still getting loaded. . . > > P.S. How is the VIM port coming along? > It's coming along slowly but fairly steadily. I'm trying to wrap up the current loose ends and get a major update out. For first time I will have menu system and some (very) basic documentation. Lack of discoverability and docs have (understandably) hindered adoption for many people so far, I think. Regards, Herb
[O] Problem with ditaa when doing export from command line
I'm trying to do an export by calling emacs from the command line like so: emacs -batch --visit=myfilename --funcall org-export-as-html The export works fine except the ditaa png from ditaa source block doesn't get created. I've run the export from within emacs and the ditaa png does get created. The export also stops to present me with dialog asking whether I want to process the ditaa code, to which I respond Yes. I don't get any dialog when I do the export from the command line. Is there some way to get the ditaa code working when I do the export from the command line. I'm running this on Windows7 if that makes any difference. Thanks, Herb
[Orgmode] Re: Does Effort support hours only?
Lawrence Mitchell gmx.li> writes: > >>> Is it possible to specify estimated effort in something other than hours > >>> (0.5, or 0:30)? > > > Being able to specify suffixes like `d' for days or `w' for weeks would be > > awesome. But I guess it's very, very complex, though. > > Turns out probably not, unless I've missed something. I think > this set of patches does what's necessary to allow duration > strings in effort properties. And as a bonus its backwards > compatible to the old style. Try it and see if it works, if it > does I'll roll it into a proper patch. > Lawrence -- I didn't test the patch, but it looks like it's hard coded to treat 24 hours as 1 day, 168 hours as 1 week, etc. This seems like it would create more confusion than there was before. In the context of measuring effort I think it's far more common to treat, e.g, 8 hours as the equivalent of a day's work. Most people have 5 day works weeks, but some don't. Etc. In any case, giving user ability to set their own conversion factors seems like a much-needed part of this. -- Herb ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Are Org manual and/or the compact guide themselves org files?
I'm wondering if the online manual or compact guide are generated from org files. Seems like they could be, but I haven't been able to find mention of it anywhere, and I haven't seen anywhere where they could be downloaded in .org format. Am I missing something? Thanks, Herb Sitz ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: calling to Emacs server to export to PDF
Nick Dokos hp.com> writes: > Yes, --batch implies -q, so you have to load your .emacs explicitly (or > perhaps > strip it down to its essentials and create a minimal .emacs for such a use). > > Probably not: try > > emacs --batch --load $HOME/minimal.emacs --visit --funcall org-export-as-pdf Nick -- Beautiful, thanks. -- Herb ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] calling to Emacs server to export to PDF
I'm trying to call a function in an Emacs server to export a file to PDF using the following command: "c:\program files (x86)\emacs\emacs\bin\emacs.exe" -batch --visit=[myfile] --funcall org-export-as-pdf It works okay but it doesn't seem to use the default latex class that I've defined in my .emacs. I can alter the LaTeX output by embedding #+LATEX_HEAD lines in my file, but those come after the \documentclass command and all the other default preamble lines Emacs is inserting. Printing from the same Emacs instance directly does seem to use the .emacs configuration for LaTeX-related variables. So I have a couple of questions. (1) Is behavior I'm seeing expected? That is, when I call org-export-as-pdf remotely it ignores settings in the .emacs file? (2) Is best workaround to just alter the default LaTeX class definitions in org-latex.el? Thanks for any help. -- Herb ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Update on Org-mode clone in Vim
Matt Lundin imapmail.org> writes: > > I'm curious to see how hyperlinks and capture might work in a vim > environment. Being able to call org-capture from anywhere in my Emacs > ecosystem (or should I say operating system) has spoiled me. :) > > Best, > Matt > Matt -- Regarding the hyperlinks there's a Vim plugin that already seems to have pretty complete hyperlinking functionality. Just put it in your plugin folder and you're good to go with it. You can find it here: http://www.vim.org/scripts/script.php?script_id=293 I haven't done any checking to see what needs to be done to make it compatible with Org-mode hyperlinking markup. I don't think it should be too bad. At least before 'conceal text' was available in Vim73 I don't think there's any good way to hide link details and have just the link text appear in the document. I haven't used Vim73 or looked at conceal text much, but it seems that feature might make it possible to closely replicate the way Emacs does things. I'd be happy to hear suggestions from people who know more about this. . . I think there are some other existing Vim plugins that can be made use of. There's a footnoting plugin that I want to look into adopting at some point. Also, I have done nothing at all to implement any of Org's table editing functionality. This is pretty much independent of Org itself, and I was hoping there was an existing Vim plugin that would be somewhere along lines of what's in Org, but I haven't found anything close yet. -- Herb ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Update on Org-mode clone in Vim
Carsten Dominik gmail.com> writes: > > > All this stuff is very similar to how Emacs Org-mode works, so the > > videos won't > > be too interesting to most of you. But I think they'll be quite > > helpful to > > people coming from Vim, some of whom have never even heard of Org- > > mode (if you > > can imagine that). > > :) > > You know what gut feeling I have when I see you write about your > project? > > I am jealous. It must be a lot of fun to write Org mode from scratch, > with a clear final feature set and detailed functionality already > cleanly in your mind, and no legacy code to keep running and no > detailed backward compatibility to worry about. :D > > I am very curious to find out if Org's philosophy and ideas will get > as much traction in the vi world. It seems to me that they should. > Even though there is little overlap between these worlds because an > Editor choice is such a basic thing, I guess we are all the same geeks. > > Cheers > > - Carsten > Carsten -- Yes, it is nice to code having a design spec that is already fleshed out and time-tested in the real world. I know there's a huge amount of time, effort, and careful decision making that's gone into the design of Org-mode. It feels good to be able to piggy- back off of it. I just wish I knew Emacs and elisp a little better so I could see how certain functions were implemented in it. Some things seem obvious; I expect I'm doing them very similarly in Vim to the way they were done in Org-mode. Other things, not so much. Regards, Herb ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Update on Org-mode clone in Vim
Matt Lundin imapmail.org> writes: > > I'm curious to see how hyperlinks and capture might work in a vim > environment. Being able to call org-capture from anywhere in my Emacs > ecosystem (or should I say operating system) has spoiled me. :) > > Best, > Matt > > Matt -- There's some basic capture functionality in there right now that you may want to try out. I was going to flesh it out a bit and do a little video on it but it's probably usable right now. It's implemented using two simple functions: CaptureBuffer(), which opens a new window and is hard-coded with a simple template that starts a level 2 heading with a date-time stamp in next line, and then pressing :W when done calls: ProcessCapture(), which saves the entry you make in the capture buffer to the end of a first level '* Agenda' heading in whatever file you have defined as g:capture_file. If you also have the g:capture_file included as one of your g:agenda_files you can add entries from agenda and do immediate refresh pretty much just like Russell Adams demonstrates in his recent Org-mode screencast at > http://vimeo.com/16533939 . You can map a keycombo to :call CaptureBuffer and it should work for you. If you try to get it working I'd be happy to hear of your success or help you resolve any problems. Regards, Herb ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Update on Org-mode clone in Vim
Just wanted to update anybody interested that I'm still making progress on my Vim org-mode clone. Agenda view and flexible agenda searches on dates, todos, and tags all work pretty well now. I've got basic clocking and clock table generation done, and some other things. All is available at github: https://github.com/hsitz/VimOrganizer Another video on very basic date spec and agenda viewing stuff is here: http://vimeo.com/17182850 I have a list of videos I want to get done in short order on: (1) specifying tags and tag editing and searching (2) specifying todos and editing todos and searching (3) agenda searches on dates, tags, todos, their combinations, other properties, etc. (4) clocking in and out and clock tables All this stuff is very similar to how Emacs Org-mode works, so the videos won't be too interesting to most of you. But I think they'll be quite helpful to people coming from Vim, some of whom have never even heard of Org-mode (if you can imagine that). Cheers, Herb Sitz ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Couple more videos of Org-mode clone in Vim
For anybody interested I've posted a couple more videos of features in the would-be Org-mode clone. First is showing basics of sparse-tree-search: http://vimeo.com/16646716 And second is on tags: http://vimeo.com/16650450 I'll try to put something together showing the agenda date views and custom searches, which is what I've spent vast majority of time on. . . . Regards, Herb Sitz ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: An Org-mode clone for Vim
John Hendy gmail.com> writes: > > > Wow! This is pretty neat. You've done some really cool things. > John -- Thanks for the kind words. I've responded to some of your comments below to clarify just what my project is and what it isn't. > > I started learning emacs only for org-mode and have never really used vim >except for editing a few config files when nano is not available. Since I >started with emacs and it has what I want (org-mode), I can't think of a >reason to learn yet another program with it's own set of shortcut > oddities :) I can relate to the shortcuts... Sometimes two in a row > involving ctrl makes me scratch my head. Though with emacs I'm > pretty sure you can literally change anything you want. > > Also, since you're using the export features of org-mode, > and as you said you can use vimperator or whatever to > emulate vim keystrokes in emacs... is there > anything really that you can do with the vim version that emacs > can't do? I completely understand #5 below -- do it just to > do it and it's fun. Other than that, though, aside from some > navigation differences and the (#_of_lines) at the > end of folded headers I was unsure what was to be different. > Now you work in vim and just call org-mode to export? > You've got it right. For someone who is comfortable with Emacs and Org-mode there's no reason at all for them to be interested in what I'm doing. The appeal of my project is pretty much limited to those people who have a strong preference for using Vim rather than Emacs. Even the people who strongly prefer Vim, if they are heavy Org-mode users and depend on a wide range of it features and multitude of options, might have little use for my project in its current state. > 2. Some people are of the opinion that, while Emacs is admittedly > a great > operating system/development environment, it lacks a decent text > editor. ;) > > I've heard this but never understood what was being said. > That comment is mostly an often repeated joke. I think it gets to a major difference between Emacs and Vim, which is that Emacs is used by many to become the central application they use, with all their sub-applications implemented in Emacs-lisp. Vim isn't really used that way, partly because it's not as suitable for it, and partly because its main author has taken a stance against that sort of use, in favor of a more Unixey-approach of merely interacting with outside applications. > > - Navigation. I definitely feel the emacs shortcut pain for certain > things. I don't mind exporting. I'm so used to it that > do C-x C-s C-c C-e p without blinking to publish to PDF. > But, I highly dislike things like C-c C-[n/p] or C-c C-[f/b] for > navigating headlines. Your arrow navigation was appealing, > perhaps only because I'm not as used to these shortcuts as > others. I find myself using two finger scroll, pg[up/dn] and > crtl+[right/left arrow] to move around much > more than the emacs built-in shortcuts. As I said earlier, > though, surely they can be changed... I just haven't. Yes, I agree that having navigation keys as multi-keypress chord combination is sub-optimal. I'm sure remappings could be done in Org, hard thing might be deciding on what key combinations. The section-moving commands in Org-mode are already mapped to keys similar to the ones I use, don't require multi-keypress chords even now. > > Great work and very cool project. Thanks for sharing and I > really enjoyed the video! > Thanks again, Herb ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] An Org-mode clone for Vim
I've been working on a Vim plugin that is file-compatible with Org-mode and that clones a good subset of features. It's gotten to the point where I'd like to put it up on Github and see if anyone wants to use it and/or help develop it with me. So far I've implemented a good subset of Org's functionality and, though it has a few rough edges, right now it could be perfectly usable for certain people out there who prefer Vim as a text editor, but who have been drawn to Emacs' Org-mode because of its features. My project isn't at the point where it has all the features or the polish of Org-mode, but many Org-mode users use only a small subset of Org. For people who prefer Vim and have subsets coinciding with my project it could be an option. I've made a video showing what it looks like and demonstrating some of the basic outlining stuff. I just uploaded it to Vimeo, and it tells me it will be available for viewing in a couple hours (i.e., around 3:15pm PST today, Friday Nov. 5,2010). When available it will be viewable at this link: http://vimeo.com/16543959 For someone who asks, 'Why would you bother to do this for Vim when it's already done in Emacs?", I would have these responses: 1. A lot of people don't like Emacs. It is of course an insanely powerful piece of software, but a lot of people can never get accustomed to the chord-key command system, or if they do get semi-accustomed they don't like it or it causes them physical pain. 2. Some people are of the opinion that, while Emacs is admittedly a great operating system/development environment, it lacks a decent text editor. ;) 3. Emacs and Vim (or Vim and Emacs) are king and queen atop the pile of text editors. What one has the other should have to, to the extent possible. 4. I consider myself a Vim person, but I moved to Org-mode and Emacs myself (made almost palatable to me by Viper and Vimpulse) because I wanted to be able to publish outlines to PDF and HTML. Vim has a couple decent outliners but nobody has bothered to create good export systems for quality output. I had written some (non-publishing-related) extensions for one of the Vim outliners and I knew it wouldn't be that hard to write something in Vim that was file-compatible with Org-mode, which would then be able to publish to PDF and HTML simply by calling out to an Emacs server. This was my original goal and it's done and works great. 5. As I did some work I became more curious about all the task management and organization features in Org-mode, and how they might be implemented in Vim. So I started coding up stuff for the various Org searches, agenda views, sparse trees, column views, date management, etc. This is actually fun to do and Vim is well-suited for doing it. So I've kept going. I'm hoping someone else might have an interest in doing this with me. 6. As I said in 5., developing this stuff is fun. That's about it. If there's any interest I'll do more videos showing how other Org-mode features have been implemented in the Vim plugin, and where they stand right now in the Vim plugin compared to Org-mode. Regards, Herb Sitz Seattle, WA ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: suggestion: simplify depth stepping of document structure (outline) visibility
On Thu, Sep 2, 2010 at 6:26 PM, Bastien wrote: > > Now I did a rewrite for some improvements, mainly to support dive in > > and out of headings also in a variant that leaves the visibility of > > siblings. The code is at the end. > > Michael Brand writes: > It tested the code, works nicely - thanks! > > I just noticed two oddities: (1) it has no notion of content, it's just > about headlines, right? Okay, I can always combine `C->' with the usual > TAB command but it's a bit surprising first; Yes, it shows only the structure not the body text. This is exactly what I want. The built-in visibility cycling always expands body text and that makes it nearly useless in most of my documents, which have large amounts of body text under each heading. As soon as you try to do a cycle all you can see is the body text under the heading, none of the subheadings. So the regular visibility cycling is useless at revealing document structure. (For some documents the built-in tab visibility cycling is useful, but for me it's a very limited set.) The focus of Michael's function on headings invites a complementary function that focuses on body text. The function I"m thinking of would toggle body text visibility on a subtree, operating only on the visible headings in the subtree. The other thing that I would like added is to have another step built-in, which in step after last heading level in subtree is revealed it will toggle body text on for all headings in subtree. For example, for a 4 level subtree the C-> operation would go successively like this: a. Reveal headings thru Level 2, b. Reveal headings thru Level 3, c. Reveal headings thru Level 4, d. show body text for all headings in subtree. (2) the first press at C-> > and C-< sets the "content relative view" to 1, whatever the initial > state was. Feels a bit unintuitive to me... > > Yes, I agree, starting from current view depth is a bit of polish that should be added. I'll help with whatever is needed. As I told Michael, I think all of the above can be done fairly easily by creating a new function based the built-in show-children function. Regards, Herb Sitz ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: tab visibility cycling doesn't work over putty/ssh with viper-mode enabled
Herbert Sitz nwlink.com> writes: > First, regarding C-c a not working to bring up > agenda-view, this problem exists on my > emacs instance in Ubuntu even when > using it directly, not through ssh. > Pressing C-c a gives error message > 'C-c a is undefined', despite the fact that Sorry, the issue with 'C-c a' was stupid error on my part. I had forgotten that you have to put the 'C-c a' key definition in the .emacs file. So the TAB problem with viper-mode is the only real problem I have. -- Herb ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: tab visibility cycling doesn't work over putty/ssh with viper-mode enabled
Jan Böcker jboecker.de> writes: > >Visibility cycling with TAB works both in command and insert mode. > I can also access the agenda using C-c a a. > >Looks like putty is misconfigured. While quickly >scanning through >putty's configuration menu, the only setting I >noticed was "Connection >-> Data -> Terminal-type string", which is >set to "xterm" here. > >However, I did not modify the default values, >so it should work out of >the box. > >You can try logging in with putty, executing >"sleep 5", and interrupting >that with C-c. If that does not work, >the problem is definitely not >emacs related. > >HTH, Jan > Jan -- Thanks, but I still haven't solved this yet and I don't think there's any problem with PuTTY configuration. However, my problems with TAB key and C-C appear to be quite different, and only the TAB key one appears to be unique to using PuTTY/ssh. First, regarding C-c a not working to bring up agenda-view, this problem exists on my emacs instance in Ubuntu even when using it directly, not through ssh. Pressing C-c a gives error message 'C-c a is undefined', despite the fact that agenda-view works fine when accessing it through the menu system. Frustrating, but it has nothing to do with PuTTY. (And PuTTY does send C-c properly to stop the 'sleep 5' process in a bare terminal.) Second, the problem with TAB key in viper-mode does seem specific to PuTTY/ssh, since it works fine when working directly. This doesn't seem possible that it's a PuTTY problem, since so far as I can tell TAB works properly in all other modes, and it works properly to cycle visibility as soon as I turn viper-mode off. Thanks for the suggestions though! I'm wondering if you have any others?. . . Regards, Herb ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: tab visibility cycling doesn't work over putty/ssh with viper-mode enabled
Herbert Sitz nwlink.com> writes: > > With viper-mode enabled all I get is a bell when I click on tab to cycle the > visibility of a heading in viper's normal mode. > > Shift-tab works okay, as does a tab key if I am in viper's insert mode (but of > course it merely inserts tab then rather than cycling visibility). > > Tab cycling seems to work properly if viper-mode is disabled. > It seems there are some other keys that don't work in PuTTY. One of the most obvious is CTRL-C, which I think works only if preceded by some other meta key. E.g., CTRL-X, CTRL-C works normally to quite emacs. But when a sequence starts with CTRL-C the bell goes off and no keypress is recognized. This makes it impossible to use keys to enter agenda view, which is accessed via CTRL-C,a. I assume my setup is common enough (Win7 PuTTY client accessing openssh server on Ubuntu 10.04) that someone has worked out these problems? Thanks for any tips. -- Herb ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] tab visibility cycling doesn't work over putty/ssh with viper-mode enabled
I'm trying to run orgmode/emacs over an ssh connection with PuTTY. Win7 client and Ubuntu host. With viper-mode enabled all I get is a bell when I click on tab to cycle the visibility of a heading in viper's normal mode. Shift-tab works okay, as does a tab key if I am in viper's insert mode (but of course it merely inserts tab then rather than cycling visibility). Tab cycling seems to work properly if viper-mode is disabled. I'm new to emacs/orgmode (coming from vim) and to ssh sessions, stumped on this tab key issue though I suspect it's nothing complicated. Can someone tell me how to get tab cycling working in my putty client when using viper-mode? Thanks! ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode