[O] Re: programmatic jump to headline

2011-03-26 Thread Eric Abrahamsen
Bernt Hansen  writes:

> Eric Abrahamsen  writes:
>
>> I'm writing a little helper function for use when I'm starting work on a
>> particular long-term writing project. Basically I found myself doing the
>> same little ritual of commands two or three times a day, and I got tired
>> of it. Here's what I've got so far, it's pretty self-explanatory. The "my-"
>> variables are set elsewhere.

[...]

> Hi Eric,
>
> If your chapters are always level 1 headings you can do something like
> this:
>
> (defun bh/jump-to-last-level-1-heading ()
>   (interactive)
>   (goto-char (point-max))
>   (while (org-up-heading-safe)))


Thanks for the pointers! A =while= form with no body wasn't
something that had occured to me, that's pretty useful. The final
command, which does just what I want, is below.

Eric

#+begin_src emacs-lisp
(defun my-project-start ()
  (interactive)
  (delete-other-windows)
  (find-file my-project-file)
  (goto-char (point-max))
  (while (org-up-heading-safe))
  (while (not (looking-at "\\* Chapter"))
(org-backward-same-level 1))
  (org-narrow-to-subtree)
  (split-window-horizontally)
  (other-window 1)
  (show-subtree)
  (goto-char (point-max))
  (abbrev-mode 1)
  (read-abbrev-file my-project-abbrev-file)
)
#+end_src





[O] Re: Outlook replacement

2011-03-26 Thread Eric Abrahamsen
Sébastien Vauban 
writes:

> Chris Malone,
>
> Chris Malone wrote:
>> Hi Henri-Paul,
>>
>> While you've brought the topic up I /have/ been recently curious about
>> others' email setup and how they incorporate that into Emacs/org-mode?  I
>> notice several users send emails from within Emacs using org-mode syntax -
>> any tips on setting such a thing up?

[...]

> For "Org-mode syntax" (putting codes as the above):
>
> - simply copy/paste,
> - select region with C-x C-x,
> - demarcate block with C-c C-v C-d and insert the correct language (here:
>   emacs-lisp).

Where does that last keybinding come from? I run (turn-on-orgstruct++),
but org-babel-demarcate-block isn't bound to anything, and C-c C-v runs
message-delete-not-region…

Eric




[O] [PATCH] EPS support for ob-plantuml

2011-03-26 Thread Michael Gauland
EPS export from Plantuml is now in beta testing; this patch makes it available 
through org-babel.

To generate an EPS from Plantuml, give your source block a ':file' with the 
extension '.eps'.

If you want to include the EPS files in PDF generated from org-export, include 
the line

#+LaTex_header: \usepackage{epstopdf}

in your org file.

--Mike Gauland

diff --git a/lisp/ob-plantuml.el b/lisp/ob-plantuml.el
index fbebd35..b57aad6 100644
--- a/lisp/ob-plantuml.el
+++ b/lisp/ob-plantuml.el
@@ -62,6 +62,8 @@ This function is called by `org-babel-execute-src-block'."
 (expand-file-name org-plantuml-jar-path))
(if (string= (file-name-extension out-file) "svg")
" -tsvg" "")
+   (if (string= (file-name-extension out-file) "eps")
+   " -teps" "")
" -p " cmdline " < "
(org-babel-process-file-name in-file)
" > "


signature.asc
Description: Digital signature


[O] Re: Outlook replacement

2011-03-26 Thread Sébastien Vauban
Hi Eric,

Eric Abrahamsen wrote:
> Sébastien Vauban  writes:
>> Chris Malone wrote:
>>> Hi Henri-Paul,
>>>
>>> While you've brought the topic up I /have/ been recently curious about
>>> others' email setup and how they incorporate that into Emacs/org-mode? I
>>> notice several users send emails from within Emacs using org-mode syntax -
>>> any tips on setting such a thing up?
>>
>> For "Org-mode syntax" (putting codes as the above):
>>
>> - simply copy/paste,
>> - select region with C-x C-x,
>> - demarcate block with C-c C-v C-d and insert the correct language (here:
>>   emacs-lisp).
>
> Where does that last keybinding come from? I run (turn-on-orgstruct++), but
> org-babel-demarcate-block isn't bound to anything,

True. I've made a global binding of it:

#+begin_src emacs-lisp*
  (global-set-key (kbd "C-c C-v C-d") 'org-babel-demarcate-block)
#+end_src

> and C-c C-v runs message-delete-not-region…

True. I've removed that binding from Message -- never used it anyway.

#+begin_src emacs-lisp*
  ;; remove the binding of `C-c C-v', used by Org-Babel commands
  (add-hook 'message-mode-hook
(lambda ()
  (define-key message-mode-map (kbd "C-c C-v") nil)))
#+end_src

Best regards,
  Seb

-- 
Sébastien Vauban




[O] Re: Outlook replacement

2011-03-26 Thread Achim Gratz
Suvayu Ali  writes:
> Also I often access email from multiple locations, home workstation,
> university workstation and my laptop. Not sure how to deal with that.

The two solutions to deal with that problem at the extreme ends: you
either leave all mail on the server(s) all the time, which means you
need network access (you can cache IMAP but not POP) or you always pull
all mail down to the same machine which means you'll always need access
to that machine.  There's a spectrum of solutions between these two
extremes, but if you need full access to all mail on all machines you
will have to store it on the net somehow (well, you could put it onto a
USB stick I guess *shudder*).


Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Samples for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldSamplesExtra




[O] Re: Comma-protection of Org blocks

2011-03-26 Thread Achim Gratz
Sébastien Vauban 
writes:
> Hence, questions:
[...]

The question really is if org hasn't evolved to the point where it needs
a more general quoting/escaping mechanism.  This might be one of the
things to ponder during the upcoming exporter cleanup, but goes a bit
beyond just exporting.


Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf microQ V2.22R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




Re: [O] Re: Outlook replacement

2011-03-26 Thread Suvayu Ali
Hi Achim,

On Sat, 26 Mar 2011 09:41:06 +0100
Achim Gratz  wrote:

> Suvayu Ali  writes:
> > Also I often access email from multiple locations, home workstation,
> > university workstation and my laptop. Not sure how to deal with
> > that.
> 
> The two solutions to deal with that problem at the extreme ends: you
> either leave all mail on the server(s) all the time, which means you
> need network access (you can cache IMAP but not POP) or you always
> pull all mail down to the same machine which means you'll always need
> access to that machine.  There's a spectrum of solutions between
> these two extremes, but if you need full access to all mail on all
> machines you will have to store it on the net somehow (well, you
> could put it onto a USB stick I guess *shudder*).
> 

After the comments form Nick, I think my last attempt to try
OfflineImap was the optimum solution for this problem. I'll have to
delve back into that when I find the time (hoping that will be in a
couple of months :) ).

> 
> Achim.

-- 
Suvayu

Open source is the future. It sets us free.



[O] Re: [Link] Missing referenced page in Org-beamer

2011-03-26 Thread Sébastien Vauban
Hi Eric,

Eric S Fraga wrote:
> Sébastien Vauban  writes:
>> Check this out in section 4.3 of
>> http://orgmode.org/worg/org-tutorials/org-beamer/tutorial.html
>> (last line).
>
> Thanks Seb.
>
> Yes, that document ceased to exist a while back. I forgot I was linking to
> it.

This shows that we should have some type of "link checker"[1]. I began working 
on
one which even produces a DOT graph (let's dream of a clickable sitemap?), but
I'm still stuck with it.

I could finish it right away, using only LP, but I'd like to be able to
execute parts of the document inside it ("in situ execution") for testing
purpose, and assemble all of its parts at the end (à la LP).

For this, Dan had proposed a =:stdin= option to the Babel blocks (which I
think would resolve my problem), but I'm not sure I've communicated the
problem correctly, hence a current status quo and/or a lack of time.

See http://www.mail-archive.com/emacs-orgmode@gnu.org/msg36924.html for the
skeleton.

Best regards,
  Seb

Footnotes:

[1] In fact, it's more than checking links, it is as well checking that no
files are just sitting there on an island, unreferenced.
-- 
Sébastien Vauban




[O] zotero (or mendeley) integration with org

2011-03-26 Thread Stephen Eglen
There was a mail-thread lastyear about zotero and integration with org.
Now that there is an alpha release of 'org-standalone' 
  http://www.zotero.org/blog/2011/02/

has anyone looked at whether this helps integrate org and zotero?

I've not yet switched to a pdf manager (they're all stuffed into a
folder, with a few subfolders, and the only meta-data is in the
filename!), so I'd appreciate hearing what others to do to look after
their pdfs.  Mendeley is a possibility too (although syncing between
machines is a must, and Mendeley doesn't offer that yet.)

Stephen



[O] lisp/org-clock.el: Add param :properties to list properties in clocktable

2011-03-26 Thread Niels Giesen

Here are a few patches to add property columns in clocktables. These
allow me e.g. to freely set different cost centers which is wanted @
my work, and also possibly small descriptions. It is generically set
up so I reckon other people may find use in this too.

The patches together add two parameters to the dynamic block line:

: :properties ("prop-this" "prop-other") :inherit-props t

The property columns will be added at the left side of the existing
columns; I did experiment with adding them to the right, but because
of the variable number of levels (being defined both by :maxlevel and
the actual number of found levels), that did not work out well.

I used the parameter =:inherit-props= to set inheritance for
properties, as I have learned in the past that
=org-use-property-inheritance= should be used very sparingly.

#+begin_src diff
>From 20346cf661e2b9ba0b4a66b705809e6100d9e8e0 Mon Sep 17 00:00:00 2001
From: Niels Giesen 
Date: Sat, 26 Mar 2011 10:19:08 +0100
Subject: [PATCH 1/3] org-clock: Add properties param handling to 
`org-clock-get-table-data'

This param should be a list of strings referring to properties. Those
properties will be returned in an alist when found in an entry.
---
 lisp/org-clock.el |   14 +++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index c567a26..df096d1 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1,6 +1,6 @@
 ;;; org-clock.el --- The time clocking code for Org-mode
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik 
@@ -2335,6 +2335,7 @@ TIME:  The sum of all time spend in this tree, in 
minutes.  This time
 (block (plist-get params :block))
 (link (plist-get params :link))
 (tags (plist-get params :tags))
+(properties (plist-get params :properties))
 (matcher (if tags (cdr (org-make-tags-matcher tags
 cc range-text st p time level hdl props tsp tbl)
 
@@ -2388,8 +2389,15 @@ TIME:  The sum of all time spend in this tree, in 
minutes.  This time
  (or (cdr (assoc "SCHEDULED" props))
  (cdr (assoc "DEADLINE" props))
  (cdr (assoc "TIMESTAMP" props))
- (cdr (assoc "TIMESTAMP_IA" props)
- (when (> time 0) (push (list level hdl tsp time) tbl))
+ (cdr (assoc "TIMESTAMP_IA" props
+   props (when properties
+   (remove nil
+   (mapcar
+(lambda (p)
+  (when (org-entry-get (point) p)
+(cons p (org-entry-get (point) p
+properties
+ (when (> time 0) (push (list level hdl tsp time props) tbl))
   (setq tbl (nreverse tbl))
   (list file org-clock-file-total-minutes tbl
 
-- 
1.7.1
#+end_src

#+begin_src diff
>From a5da80e0b42256e1a1ea07e213bcae3685786589 Mon Sep 17 00:00:00 2001
From: Niels Giesen 
Date: Sat, 26 Mar 2011 11:05:33 +0100
Subject: [PATCH 2/3] org-clock: Add properties param handling to 
`org-clocktable-write-default'

Each property specified in properties will get a column in the clocktable.
---
 lisp/org-clock.el |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index df096d1..a330db0 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2052,6 +2052,7 @@ from the dynamic block defintion."
 (emph (plist-get params :emphasize))
 (level-p (plist-get params :level))
 (timestamp (plist-get params :timestamp))
+(properties (plist-get params :properties))
 (ntcol (max 1 (or (plist-get params :tcolumns) 100)))
 (rm-file-column (plist-get params :one-file-with-archives))
 (indent (plist-get params :indent))
@@ -2115,6 +2116,7 @@ from the dynamic block defintion."
 (if multifile "|" "")  ; file column, maybe
 (if level-p   "|" "")  ; level column, maybe
 (if timestamp "|" "")  ; timestamp column, maybe
+(if properties (make-string (length properties) ?|) "")  ;properties 
columns, maybe
 (format "<%d>| |\n" narrow)))  ; headline and time columns
 
   ;; Insert the table header line
@@ -2123,6 +2125,7 @@ from the dynamic block defintion."
(if multifile (concat (nth 1 lwords) "|") "")  ; file column, maybe
(if level-p   (concat (nth 2 lwords) "|") "")  ; level column, maybe
(if timestamp (concat (nth 3 lwords) "|") "")  ; timestamp column, maybe
+   (if properties (concat (mapconcat 'identity properties "|") "|") "") 
;properties columns, maybe
(concat (nth 4 lwords) "|" 
   (nth 5 lwords) "|\n"))   

[O] Re: lisp/org-clock.el: Add param :properties to list properties in clocktable

2011-03-26 Thread Bernt Hansen
Niels Giesen  writes:

> Here are a few patches to add property columns in clocktables. These
> allow me e.g. to freely set different cost centers which is wanted @
> my work, and also possibly small descriptions. It is generically set
> up so I reckon other people may find use in this too.
>
> The patches together add two parameters to the dynamic block line:
>
> : :properties ("prop-this" "prop-other") :inherit-props t
>
> The property columns will be added at the left side of the existing
> columns; I did experiment with adding them to the right, but because
> of the variable number of levels (being defined both by :maxlevel and
> the actual number of found levels), that did not work out well.
>
> I used the parameter =:inherit-props= to set inheritance for
> properties, as I have learned in the past that
> =org-use-property-inheritance= should be used very sparingly.
>

Hi Niels,

Could you provide a sample clock report using this patch to get a
better idea of why you find this useful?

Thanks,
-- 
Bernt



Re: [O] zotero (or mendeley) integration with org

2011-03-26 Thread Cian
I use Mendeley and just set it up to export bibtex files. Then you can
just reference those in org-mode using reftex. I think you can do
something similar using zotero.

It works okay. I don't annotate PDFs using Mendeley (I just write my
notes in org-mode), so I'm not sure if you can access those somehow?
But as a system for managing PDFs it's adequate.

On Sat, Mar 26, 2011 at 3:47 PM, Stephen Eglen
 wrote:
> There was a mail-thread lastyear about zotero and integration with org.
> Now that there is an alpha release of 'org-standalone'
>  http://www.zotero.org/blog/2011/02/
>
> has anyone looked at whether this helps integrate org and zotero?
>
> I've not yet switched to a pdf manager (they're all stuffed into a
> folder, with a few subfolders, and the only meta-data is in the
> filename!), so I'd appreciate hearing what others to do to look after
> their pdfs.  Mendeley is a possibility too (although syncing between
> machines is a must, and Mendeley doesn't offer that yet.)
>
> Stephen
>
>



Re: [O] zotero (or mendeley) integration with org

2011-03-26 Thread Ramon Diaz-Uriarte
Dear Stephen,

[My ---long--- comments refer only to Mendeley, not org, so maybe this
should be off-list].

On Sat, Mar 26, 2011 at 4:47 PM, Stephen Eglen
 wrote:
> There was a mail-thread lastyear about zotero and integration with org.
> Now that there is an alpha release of 'org-standalone'
>  http://www.zotero.org/blog/2011/02/
>
> has anyone looked at whether this helps integrate org and zotero?
>
> I've not yet switched to a pdf manager (they're all stuffed into a
> folder, with a few subfolders, and the only meta-data is in the
> filename!), so I'd appreciate hearing what others to do to look after
> their pdfs.  Mendeley is a possibility too (although syncing between
> machines is a must, and Mendeley doesn't offer that yet.)
>

I've been using Mendeley for about 9 months now, after spending a few
weeks examining how Mendeley, Zotero, and some other options, fitted
into my habits. Here are some comments about your questions:

1. Syncing: the "orthodox" Mendeley way allows for two options: a) you
sync the database of the refs (not pdfs) via their servers; b) you
also sync the pdfs, which will most likely require you to pay for
storage in their servers if you have a decent number of pdfs.

However, I do the syncing myself. I've used rsync, then Dropbox, and
for the last four months Wuala. I sync the directory where the dbs are
(~/.local/share/data/Mendeley Ltd./Mendeley Desktop) and the directory
where I store my pdfs. I have had this set up for the 9 months, shared
between four machines, and it works fine (I try not to have Mendeley
open in more than one machine at the same time, to prevent problems,
but have never run into any).


2. All pdfs into a folder with a few subfolders. In Mendeley you can
have each reference under its own subdirectory with some limited
flexibility for the naming of the subdirectories (author, date, title,
etc). Its not ideal (e.g., I dislike spaces in directory names), but I
like it better than Zotero's (names of subdirectories are a random
string). Keeping each ref in its own directory allows me to store
other stuff (e.g., code, suppl. mat, etc) in the same place as the
pdf.


Now, that said, I am not all that happy with Mendeley.

To begin with, Mendeley is not free software. Zotero is, but the
naming of directories and the lack of a built-in pdf editor were a
no-go for me.

Mendeley's pdf editor allows me to underline and add notes to pdfs. At
least in Linux, adding comments and underlining pdfs is not yet well
solved: evince currently allows comments in the devel. version, but no
underlining. Okular allows comments and underlining, but stores them
in ~/.kde/share/apps/okular, which I dislike (it seems very fragile),
and in okular you cannot underline a single column in papers with
multi-column setup (another no-go for me).

However, with Mendeley's pdf editor/viewer you can only display one
pdf at a time, which is a pain if you want to compare two or more
papers side by side. In fact, Mendely's pdf viewer is rather
under-powered compared to, say, okular (e.g., lack of keyboard
shortcuts for viewing to page or width size, difference between
scrolling and moving to next page, fast searching, etc). If I only
need read-only access to the pdf, even from within Mendeley, I use
another pdf viewer.

I thought about going back to JabRef, and using recoll for searching
over all of my pdf collection (I like recoll's search much more than
Mendeley's one). But that leaves unsolved the pdf commenting issue.
Also, I like the ease of adding papers with Mendeley (e.g., when
searching in the web, or its generally successful extraction of
metadata from a paper's pdf); in fact, I find adding papers is even
easier with Zotero (and friendlier also if you add things like web
pages, etc). I also looked into paperpile, but I find it to be much
more beta than Mendeley, and so far less flexible in almost
everything.

So I'd also like to know how others are dealing with pdfs. Anyway, and
in spite of my complaints, since about 9 months ago I have not printed
a single paper. It is great to have all those pdfs synced among my
machines, be able to search them quickly, and not carry around
kilograms of dead trees.


Best,

R.




> Stephen
>
>



-- 
Ramon Diaz-Uriarte
Structural Biology and Biocomputing Programme
Spanish National Cancer Centre (CNIO)
http://ligarto.org/rdiaz
Phone: +34-91-732-8000 ext. 3019
Fax: +-34-91-224-6972



Re: [O] Re: Completing with anything

2011-03-26 Thread Michael Markert
On 25 Mar 2011, Julien Danjou wrote:
> [1  ]
> On Thu, Mar 24 2011, Cian wrote:
>
>> Can you separate out the gnus specific code at some point. If I ever
>> get any time (two small children and a day job, so big if) I'd like to
>> integrate it into Wanderlust. But currently the code assumes that
>> you're using gnus.
>
> Sure, I'll add that to my todo list.

I've wrote some code at least for template support:
#+BEGIN_SRC emacs-lisp
(require 'std11); from FLIM
(require 'wl-address)   ; from Wanderlust
(defun wl-get-from-header-content (buffer)
  (save-excursion
(set-buffer buffer)
(std11-narrow-to-header)
(prog1
(std11-fetch-field "From")
  (widen

(defun org-contacts-template-wl-name ()
  (wl-address-header-extract-realname (wl-get-from-header-content
  (org-capture-get :original-buffer
(defun org-contacts-template-wl-email ()
  (wl-address-header-extract-address (wl-get-from-header-content
  (org-capture-get :original-buffer
#+END_SRC

Because Wanderlust keeps several message buffers you have to start
capture from within a message buffer, not a summary buffer. But I'll
look into it.

Michael


pgp4j9w8yAfos.pgp
Description: PGP signature


Re: [O] Re: Completing with anything

2011-03-26 Thread Michael Markert
On 26 Mar 2011, Michael Markert wrote:
> Because Wanderlust keeps several message buffers you have to start
> capture from within a message buffer, not a summary buffer. But I'll
> look into it.

Attached code handles both capturing from summary and message
buffer.

Michael

(require 'std11)
(require 'elmo)
(require 'wl-address)
(require 'wl-summary)

(defun wl-get-from-header-content ()
  (save-excursion
(set-buffer (org-capture-get :original-buffer))
(cond
 ((eq major-mode 'wl-summary-mode) (when wl-summary-buffer-elmo-folder
 (elmo-message-field
  wl-summary-buffer-elmo-folder
  (wl-summary-message-number)
  'from)))
 ((eq major-mode 'mime-view-mode) (std11-narrow-to-header)
  (prog1
  (std11-fetch-field "From")
(widen))

(defun org-contacts-template-wl-name (&optional return-value)
  (let ((from (wl-get-from-header-content)))
(or (and from (wl-address-header-extract-realname from))
   return-value
   "%^{Name}")))

(defun org-contacts-template-wl-email (&optional return-value)
  (let ((from (wl-get-from-header-content)))
(or (and from (wl-address-header-extract-address from))
   return-value
   (concat "%^{" org-contacts-email-property "}p"



pgpqsfSzRfaTm.pgp
Description: PGP signature


[O] Re: zotero (or mendeley) integration with org

2011-03-26 Thread Rustom Mody
Stephen Eglen wrote:
> I've not yet switched to a pdf manager (they're all stuffed into a folder, 
> with a few subfolders, and the only meta-data is
> in the filename!), so I'd appreciate hearing what others to do to look after 
> their pdfs.

Maybe look at tracker [assuming linux] http://projects.gnome.org/tracker/ ?
More generally 
http://www.wikinfo.org/index.php/Comparison_of_desktop_search_software



Re: [O] Re: zotero (or mendeley) integration with org

2011-03-26 Thread Suvayu Ali
On Sun, 27 Mar 2011 08:42:19 +0530
Rustom Mody  wrote:

> Stephen Eglen wrote:
> > I've not yet switched to a pdf manager (they're all stuffed into a
> > folder, with a few subfolders, and the only meta-data is in the
> > filename!), so I'd appreciate hearing what others to do to look
> > after their pdfs.
> 
> Maybe look at tracker [assuming linux]
> http://projects.gnome.org/tracker/ ? More generally
> http://www.wikinfo.org/index.php/Comparison_of_desktop_search_software
> 

or Recoll (on GNU/Linux)

-- 
Suvayu

Open source is the future. It sets us free.