[Orgmode] Re: DAV config for mobileorg

2010-06-25 Thread news
Matthew Jones bsdmatb...@gmail.com writes:

 I've actually just been using python's pywebdav: http://code.google.com/p/
 pywebdav/

 running on my VPS.   I plan to just use this until I get Dropbox (or something
 like it) support integrated.

Dropbox support would be VERY welcome.
In the meantime, is there any way I can just copy my org files across
from my computer and read them with your app? I tried copying them into
/sdcard/mobileorg/ but they didn't show up in MobileOrg.

-- 
aleblanc


___
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: Mobile org

2010-02-03 Thread news
Marcelo de Moraes Serpa celose...@gmail.com writes:

 Hello list,

 org-mode really changed my life, and allowed me to fully implement GTD the way
 I wanted. However, I miss having access to it everytime, so, I'm looking for a
 mobile device that could run emacs and org, and that I could keep in sync with
 my laptop.

 What do you think?

 Any suggestions appreciated,

 Marcelo.

Hi Marcelo,
   check the CategoryPorts page on the emacswiki:
   http://www.emacswiki.org/emacs/CategoryPorts

   Personally I use emacs on my android phone, which includes a
   Debian installation, see here:

   http://www.emacswiki.org/emacs/EmacsOnAndroid 

   I use the android scripting environment to access android
   programs from emacs. This allows me to make phone calls/send
   text messages with BBDB in emacs, while I can still use the
   useful gui stuff in android such as maps, web-browsing,
   bar-code scanner etc. 

   I believe android is the way to go since it is open source
   and hackable, while also having a large repertoire of cool
   and useful apps.

   The only drawback is that the initial setup is quite
   complicated and time-consuming. You need to be fairly
   technically minded.

-- 
aleblanc



___
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] org-export-generic.el patch to make it load with require

2010-02-03 Thread news
In the org-export-generic.el file the library is provided as org-generic
instead of org-export-generic. 
Not sure what the reason for this is, but I cannot load it with 
(require 'org-generic). 

This patch changes (provide 'org-generic) to 
(provide 'org-export-generic) so I can load it normally.

*** ~/.emacs.d/org-export-generic.el2010-02-03 15:47:30.0 +
--- ~/.emacs.d/org-mode/contrib/lisp/org-export-generic.el  2010-02-03 
15:46:45.0 +
***
*** 1237,1242 
  (and vl (setcar vl nil))
  vl))
  
! (provide 'org-export-generic)
  
  ;;; org-export-generic.el ends here
--- 1237,1242 
  (and vl (setcar vl nil))
  vl))
  
! (provide 'org-generic)
  
  ;;; org-export-generic.el ends here




-- 
aleblanc



___
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: iPhone app for Org view and capture

2009-09-15 Thread news
Sven Bretfeld sven.bretf...@gmx.ch writes:

 Richard Moreland r...@ncogni.to writes:

 Here is a teaser video of the app running in the simulator:  
 http://ncogni.to/
 mobileorg-demo1.mov

 Very nice, congratulations. The unavoidable question: Will there be an
 Android port as well?


You might be interested to know that with the android scripting
environment you can access the android API from emacs.
I've written a little recipe to make phone calls directly from your bbdb
buffer in emacs on android. See here: 
http://www.emacswiki.org/emacs/EmacsOnAndroid


-- 
aleblanc



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: iPhone app for Org view and capture

2009-09-10 Thread news
Sven Bretfeld sven.bretf...@gmx.ch writes:

 Richard Moreland r...@ncogni.to writes:

 Here is a teaser video of the app running in the simulator:  
 http://ncogni.to/
 mobileorg-demo1.mov

 Very nice, congratulations. The unavoidable question: Will there be an
 Android port as well?

My thoughts exactly. Especially since I recently bought an Android phone
specifically so that I could use org on it.
My current solution is to run emacs under Debian on the phone (see here:
http://www.androidfanatic.com/cms/community-forums.html?func=viewcatid=9id=2248)
however this uses alot of memory and causes the phone to reboot when the
memory runs out, very annoying.

Anyone like to give a rough guess of the number of man hours required to
make an Android org app?

-- 
aleblanc



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: small emacs for using org on Android

2009-09-02 Thread news
Torsten Wagner torsten.wag...@gmail.com writes:


 please remember a org-file is still (and thankfully and amazingly) a plain 
 text
 file. As long as you are not going to make big changes, any other (smaller)
 text editor will do, e.g., nano, pico, *cough* vim *cough*.
 I found myself comfortable to export the org-file to html and display it in my
 E-ink Ebook reader. Not able to edit it but reading my notes and thought like
 on printed paper is nice :)


Good point. 
However some of my org entries are encrypted, and navigation is much easier 
with org. 
I wonder if anyone is working on an Android version of Emacs?

-- 
aleblanc



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: small emacs for using org on Android

2009-09-01 Thread news
Sven Bretfeld sven.bretf...@gmx.ch writes:

 n...@aleblanc.cotse.net writes:

can anyone recommend a small emacs implementation that will run org?
I have Debian running on my G1 phone (see here:
http://www.emacswiki.org/emacs/EmacsOnAndroid), 
and have been running Emacs 22 on it successfully. 
However it doesn't leave me much memory for other apps.

 If you have a flatrate and if you don't mind to have a computer
 constantly running at home, you can use the Android app ConnectBot (or
 normal ssh on Debian) to do your Emacs work including org stuff. This is
 much easier and faster than running Emacs on the phone itself.

Actually I find it significantly slower using ssh - there is a
noticeable lag. I only really want to use it for org-mode so I don't
need any heavy computation.
However I must admit I get a more reliable cursor position using SSH
(with a local connection it is sometimes off by a line).


-- 
aleblanc



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: small emacs for using org on Android

2009-08-29 Thread news
Scot Becker scot.bec...@gmail.com writes:

How do I remove unwanted modes? Is it just a case of removing the .el files?

 I'm not the most qualified person to answer this, since I'm only an
 observer to emacs development, but I have some experience trying to
 compile a reduced-size version of Emacs 23, so I'll add my two pence
 until someone can inform you better.

 I tried to cut down emacs for my own use (basically, an older laptop
 in which I was running TinyCore linux from RAM, and wanted to put
 emacs+org into RAM as well).  I found that GNU Emacs seems not to be
 designed with modularity in mind.  In fact, my read of the devel list
 is that the opposite virtue is espoused:  reuse existing code where
 possible.  Add to this that the program (as I'm sure you know) is
 quite complex.  Even if there were a smaller Lisp interpreter, it
 probably would fail at a number of points to do the things that
 org-mode (and the Emacs parts org depends on) needs.  In this case, I
 don't think you'll get a smaller engine to drive the same car.  Sorry.

 What you might have some luck with is slicing away gingerly at your
 existing Emacs distribution.  For example, you might try: (1) making
 sure that there are no Lisp source files for libraries which exist as
 byte compiled files (delete blah.el where there is a blah.elc).  (2)
 slicing the info documentation down to the bone, and gzipping the
 remainder.  (3) removing modes you don't need.  This will take some
 experimentation.  org-mode won't compile without 'calc' 'calendar' and
 even Gnus, but might run without gnus if you don't need whatever
 feature it borrows.  Also, other modes derive from more basic modes or
 other wise re-use other modes' code.  So you may run into errors,
 which you'll have to fix by adding the missing pieces back in.  (4)
 You can cut out input methods and terminal types you don't need.  (5)
 I expect Emacs 22 is smaller than emacs 23, and you may even find that
 Emacs 21 meets your needs, though org-mode apparently has some
 limitations on it.

 I suspect that judicious experimental cutting is the only way (aside
 from compression) that you'll get a smaller GNU Emacs and org mode.
 Good luck.

 HTH,
 Scot


 On Fri, Aug 28, 2009 at 7:00 PM, n...@aleblanc.cotse.net wrote:
 Hi,
   can anyone recommend a small emacs implementation that will run org?
   I have Debian running on my G1 phone (see here:
   http://www.emacswiki.org/emacs/EmacsOnAndroid),
   and have been running Emacs 22 on it successfully.
   However it doesn't leave me much memory for other apps.

   I have had a look through some of the implementations listed here:

   http://www.emacswiki.org/emacs-en/EmacsImplementations

   but it seems that most of them are not full elisp interpreters and so
   I'm not sure that org-mode will work.

 --
 aleblanc



 ___
 Emacs-orgmode mailing list
 Remember: use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode



 ___
 Emacs-orgmode mailing list
 Remember: use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Hi Scot,


-- 
aleblanc



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] small emacs for using org on Android

2009-08-28 Thread news
Hi,
   can anyone recommend a small emacs implementation that will run org?
   I have Debian running on my G1 phone (see here:
   http://www.emacswiki.org/emacs/EmacsOnAndroid), 
   and have been running Emacs 22 on it successfully. 
   However it doesn't leave me much memory for other apps.

   I have had a look through some of the implementations listed here:

   http://www.emacswiki.org/emacs-en/EmacsImplementations

   but it seems that most of them are not full elisp interpreters and so
   I'm not sure that org-mode will work.

-- 
aleblanc



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: changing headline format

2009-03-24 Thread news
Peter Jones mli...@pmade.com writes:

 Why not use sed/awk to alter the output of the tree command so that it's
 in a format that org will understand?

Yes I could do that, but if there was an easy org/outline mode way to do
it that would be better. I may want to do other related stuff in the future.


-- 
aleblanc



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: org-crypt and PROPERTIES location

2009-03-24 Thread news
Peter Jones mli...@pmade.com writes:

 Actually, org-crypt was written by John Wiegley, and I'm going to be
 making some changes to slightly alter how it works.  You can get John's
 version here:

   
 http://github.com/jwiegley/dot-emacs/raw/cf72e6e004034849bd683b467b51d960d80a3e66/org-crypt.el

 I'll post a message after I've made my changes to it.

Thanks. 
Here's my $0.02: symmetric encryption (i.e. passphrase based encryption).

-- 
aleblanc



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: org-crypt and PROPERTIES location

2009-03-23 Thread news
Peter Jones mli...@pmade.com writes:


 Are there any org-crypt users out there that want to throw in their
 $0.02?
Hi Peter,
 I wrote a function for encrypting subtrees a couple of weeks
 ago. I didn't realize someone else was already on the case.
 I guess your solution is better than mine, but where can I get
 hold of it? I don't see it in worg.
-- 
aleblanc



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] changing headline format

2009-03-23 Thread news
Hi,
   does anyone know if there is an easy way to change the headline
   format for outline/org mode? I know about hiding stars and using odd
   levels only in org, but I want to be able to convert a file so that
   the actual text of the headlines is changed.
   More specifically I want to be able to quickly convert directory
   trees that I grabbed with the unix tree command into org trees.

-- 
aleblanc



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Feature request: org-goto hierarchical path completion with ido

2009-03-17 Thread news
Hi, when I set org-outline-path-complete-in-steps to t, I am no longer
able to use ido completion. Instead it shows the completion candidates
in another buffer. Is there any way to use ido with hierarchical
completion?
Also, I can specify a list of candidate files to refile to with
org-refile-targets. Is it possible to get the same behaviour for
org-goto? (i.e. so I can quickly jump to another org file).


-- 
aleblanc



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: SOLVED: elisp formulas in column view (without converting to tables)

2009-03-16 Thread news
n...@aleblanc.cotse.net writes:

 Hi,
I have rewritten the org-columns-compute function to allow elisp
formulas in column view.
It allows you to specify how to accumulate values from child headers,
and how to specify the value for the current header, based on other
columns.

Have since discovered that my new version doesn't work with checkbox
formulas. The solution is to use the old version of org-columns-compute
if the formula is not an elisp formula. Rename the old function to
org-columns-compute-orig, and then use this code for
org-columns-compute:

(defun org-columns-compute (property)
  Sum the values of property PROPERTY hierarchically, for the entire buffer.
  (interactive)
  (let* ((re (concat ^ outline-regexp))
 (lmax 30) ; Does anyone use deeper levels???
 (level 0)
 (ass (assoc property org-columns-current-fmt-compiled))
 ;; parse elisp form if there is one
 (form (nth 3 ass))
 (uselisp (and ( (length form) 1)
   (or (equal ( (substring form 0 1)) 
   (equal ( (substring form 1 2)
 (form (if uselisp
   (replace-regexp-in-string 
\$\\([^()\]+\\) 
(string-to-number (or (org-entry-get nil \\\1\) \0\)) 
(nth 3 ass) t)))
 ;; vector to hold running totals for each level
 (lsum (make-vector lmax (if uselisp nil 0)))
 (format (nth 4 ass))
 (printf (nth 5 ass))
 (beg org-columns-top-level-marker)
 last-level val valflag end sumpos sum-alist str str1 useval prevtotal 
curtotal newvals)
(if uselisp
(save-excursion
  ;; Find the region to compute
  (goto-char beg)
  (setq end (condition-case nil (org-end-of-subtree t) (error 
(point-max
  (goto-char end)
  ;; Walk the tree from the back and do the computations
  (while (re-search-backward re beg t)
(setq sumpos (match-beginning 0)
  last-level level
  level (org-outline-level)
  ;; total from children, or nil if there were none
  prevtotal (if ( level last-level) (aref lsum last-level) nil)
  ;; total at this level
  curtotal (aref lsum level)
  ;; current property value as string
  val (org-entry-get nil property)
  ;; is it non-empty?
  valflag (and val (string-match \\S- val))
  ;; current property value as number (or nil if empty)
  curval (if valflag (org-column-string-to-number val format) 
nil)
  ;; get values to replace current value and running total
  newvals (if uselisp (eval-expression (read form))
(list (or prevtotal curval 0)
  (+ curtotal (or prevtotal curval 0)
(cond
 (( level last-level) ; we have moved up to a parent
  (setq 
   ;; new value, as string
   str (if (nth 0 newvals) (org-columns-number-to-string (nth 0 
newvals) format printf) nil)
   ;; add text properties to it
   useval (org-add-props (copy-sequence str) nil 'org-computed t 
'face 'bold)
   ;; get current text properties
   sum-alist (get-text-property sumpos 'org-summaries))
  ;; put new value here as a text property
  (if (assoc property sum-alist)
  (setcdr (assoc property sum-alist) useval)
(push (cons property useval) sum-alist)
(org-unmodified
 (add-text-properties sumpos (1+ sumpos)
  (list 'org-summaries sum-alist
  ;; put new org property value 
  (if (nth 0 newvals) (org-entry-put nil property str))
  ;; set value for current level total
  (when (or prevtotal valflag)
(aset lsum level (nth 1 newvals)))
  ;; clear totals for deeper levels
  (loop for l from (1+ level) to (1- lmax) do
(aset lsum l (if uselisp nil 0
 ((= level last-level) ; we have not moved up to a parent
  ;; set new org property value and add to total for this level
  (org-entry-put nil property (org-columns-number-to-string (nth 0 
newvals) format printf))
  (aset lsum level (nth 1 newvals)))
 (t (error This should not happen)
  (org-columns-compute-orig property



-- 
aleblanc



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] SOLVED: elisp formulas in column view (without converting to tables)

2009-03-13 Thread news
Hi,
   I have rewritten the org-columns-compute function to allow elisp
   formulas in column view.
   It allows you to specify how to accumulate values from child headers,
   and how to specify the value for the current header, based on other
   columns.
   In the column specification you place elisp code between the braces
   {} after the column name. This elisp should return a list of 2
   values. The first value should be the value for that header, and the second
   value should be the running total of values so far at that level, which will
   eventually be used to set the value for the parent header.

   The following values may be referenced by your elisp code:

   | $name | the value of the 'name' column for this header 
(swap 'name' for whatever columns you have) |
   | curval| the current value for this header  
|
   | curtotal  | the running total from headers at the same level 
as this one   |
   | prevtotal | the total from headers below this level
|

   Here is the column specification for the example that Eric gave:

 :COLUMNS:  %25ITEM %2d{`(,(or curval 0) 0)} %f{`(,(or curval 0) 0)} 
%2fd{`(,(+ $f $d) 0)}

   This will ensure that the 'fd' column contains the sum of the 'f' and
   'd' columns. If there are any missing values in the 'f' and 'd'
   columns they will be replaced with 0's. No running total is needed
   for that example so the second element of the return list just
   contains 0.
   I use the ` and , chars to evaluate the elements between the brackets
   before returning the list, but you could also use the (list val1
   val2) form.

   Here is a more complicated example that calculates the geometric mean of 
child
   headers:

 :COLUMNS:  %25ITEM %5count{`(,(or prevtotal 1) ,(if curtotal (1+ curtotal) 
1))} %21val{`(,(if prevtotal (exp (/ prevtotal $count)) (or curval 1)) ,(if 
curtotal (+ curtotal (log curval)) (or (log curval) 1)))} 

   The 'val' column will contain either raw data, or a geometric mean
   depending on whether the header has children or not. The extra column
   'count' is used to count the number of children (is there an org
   function for this?).

   You could use the calc-eval function in your elisp code to do some
   calculations for you, but this would get a bit messy as it takes a 
   string argument and returns a string, so you would need to make lots
   of use of the number-to-string and string-to-number functions.

   I guess it is not a very simple solution but it does the job for now.

   It anyone can improve on it that would be great... or maybe Dominik
   already has something?

   Here it is:

(defun org-columns-compute (property)
  Compute the values of property PROPERTY hierarchically, for the entire 
buffer.
  (interactive)
  (let* ((re (concat ^ outline-regexp))
 (lmax 30) ; Does anyone use deeper levels???
 (level 0)
 (ass (assoc property org-columns-current-fmt-compiled))
 ;; parse elisp form if there is one
 (form (nth 3 ass))
 (uselisp (and ( (length form) 1)
   (or (equal ( (substring form 0 1)) 
   (equal ( (substring form 1 2)
 (form (if uselisp
   (replace-regexp-in-string 
\$\\([^()\]+\\) 
(string-to-number (org-entry-get nil \\\1\)) 
(nth 3 ass) t)))
 ;; vector to hold running totals for each level
 (lsum (make-vector lmax (if uselisp nil 0)))
 (format (nth 4 ass))
 (printf (nth 5 ass))
 (beg org-columns-top-level-marker)
 last-level val valflag end sumpos sum-alist str str1 useval prevtotal 
curtotal newvals)
(save-excursion
  ;; Find the region to compute
  (goto-char beg)
  (setq end (condition-case nil (org-end-of-subtree t) (error (point-max
  (goto-char end)
  ;; Walk the tree from the back and do the computations
  (while (re-search-backward re beg t)
(setq sumpos (match-beginning 0)
  last-level level
  level (org-outline-level)
  ;; total from children, or nil if there were none
  prevtotal (if ( level last-level) (aref lsum last-level) nil)
  ;; total at this level
  curtotal (aref lsum level)
  ;; current property value as string
  val (org-entry-get nil property)
  ;; is it non-empty?
  valflag (and val (string-match \\S- val))
  ;; current property value as number (or nil if empty)
  curval (if valflag (org-column-string-to-number val format) nil)
  ;; get values to replace current value and running total
  newvals (if uselisp (eval-expression (read form))

[Orgmode] Re: SOLVED: elisp formulas in column view (without converting to tables)

2009-03-13 Thread news
n...@aleblanc.cotse.net writes:

 Hi,
I have rewritten the org-columns-compute function to allow elisp
formulas in column view.
It allows you to specify how to accumulate values from child headers,
and how to specify the value for the current header, based on other
columns.
In the column specification you place elisp code between the braces
{} after the column name. This elisp should return a list of 2
values. The first value should be the value for that header, and the second
value should be the running total of values so far at that level, which 
 will
eventually be used to set the value for the parent header.

The following values may be referenced by your elisp code:

| $name | the value of the 'name' column for this header 
 (swap 'name' for whatever columns you have) |
| curval| the current value for this header
   |
| curtotal  | the running total from headers at the same level 
 as this one   |
| prevtotal | the total from headers below this level  
   |


I forgot to mention that curtotal will be nil if the current header is
the first header at the current level, and prevtotal will be nil if the
current header has no children. You can test for these in your elisp functions.

-- 
aleblanc



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] column view: hiding :PROPERTIES:, and overriding edit restrictions

2009-03-13 Thread news
Hi, 
when I enter column view I can cycle through tree visibility
settings by hitting the tab key, but can only hide the :PROPERTIES:
line under the top heading if I fold the tree completely.
I want to be able to see all headings, but no :PROPERTIES: 
How can I do this?
Also.. how can I override the restriction that prevents me from
editing a value when there is a corresponding formula and the header
has children: The value is computed from the entry's children 
When using my previously posted org-columns-content function, I
may be only interested in accumulating values to the top level, and
not intermediate levels. So I may want to be able to edit these
intermediate level headings.

-- 
aleblanc



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: alter all subtrees containing specific tag

2009-03-09 Thread news
n...@aleblanc.cotse.net writes:


 Just discovered a bug in my previously posted function. It doesn't work
 too well if you have lower level subtrees tagged for encryption.

I also forgot to mention that you need to have pgg pre-loaded.
This will ensure that:

(defun my-func-org-toggle-encryption (rcpts passphrase)
  (interactive (list (split-string (read-string Recipients (default is none): 
) [ \t,]+)
 (pgg-read-passphrase GnuPG passphrase: )))
  (require 'pgg)
  (show-all)
  (org-map-entries '(let (start end teststring)
  (org-outline-level)
  (next-line)
  (org-beginning-of-line)
  (setq start (point))
  (setq teststring (buffer-substring start (+ start 27)))
  (outline-get-next-sibling)
  (if (not (equal (point) (point-max)))
  (previous-line))
  (org-end-of-line)
  (setq end (point))
  (if (equal teststring -BEGIN PGP MESSAGE-)
  (if (pgg-decrypt-region start end passphrase)
  (pgg-display-output-buffer start end t)
(message Can't decrypt region!))
(if (equal rcpts '())
(pgg-encrypt-symmetric-region start end passphrase)
  (pgg-encrypt-region start end rcpts nil passphrase))
(pgg-display-output-buffer start end t)))
   +ENCRYPT))



-- 
aleblanc



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] alter all subtrees containing specific tag

2009-03-08 Thread news
Hi,
   I use pgg to encrypt some org subtrees (e.g. the ones containing
   passwords). At the moment I have to encrypt/decrypt them one at a
   time by selecting the appropriate region and running
   pgg-encrypt-region/pgg-decrypt-region. 
   I want to make a function that will automatically encrypt/decrypt all
   subtrees (in the current buffer) whose headings contain an :ENCRYPT: tag.
   I tried using org-map-entries, but it seems to restore the buffer to
   its original state after returning.
   Is there a quick way to get the start and end points of a subtree, or
   place region around it? and a quick way to jump to the next heading
   with a given tag?

-- 
aleblanc



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: alter all subtrees containing specific tag

2009-03-08 Thread news
Carsten Dominik domi...@science.uva.nl writes:

 Hi,
   I use pgg to encrypt some org subtrees (e.g. the ones containing
   passwords). At the moment I have to encrypt/decrypt them one at a
   time by selecting the appropriate region and running
   pgg-encrypt-region/pgg-decrypt-region.
   I want to make a function that will automatically encrypt/decrypt
 all
   subtrees (in the current buffer) whose headings contain an
 :ENCRYPT: tag.
   I tried using org-map-entries, but it seems to restore the buffer to
   its original state after returning.

I discovered that the problem is with pgg-encrypt not org.
For some reason it only works properly if I call it interactively.


 No, org-map-entries should be perfect for this, and it does not
 restore the buffer.
 This should really well.  The only thing that might happen, by
 replacing the
 subtree, that it does not know correctly where to continue and
 therefore it might do
 every tree twice?


   Is there a quick way to get the start and end points of a subtree,
 or
   place region around it? and a quick way to jump to the next heading
   with a given tag?


 (org-mark-subtree)  ;; this will include the headline

I don't have this function (Org-mode version 6.24).

-- 
aleblanc



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: alter all subtrees containing specific tag

2009-03-08 Thread news
Ian Barton li...@manor-farm.org writes:

I use pgg to encrypt some org subtrees (e.g. the ones containing
passwords). At the moment I have to encrypt/decrypt them one at a
time by selecting the appropriate region and running
pgg-encrypt-region/pgg-decrypt-region.I want to make a
 function that will automatically encrypt/decrypt all
subtrees (in the current buffer) whose headings contain an :ENCRYPT: tag.
I tried using org-map-entries, but it seems to restore the buffer to
its original state after returning.
Is there a quick way to get the start and end points of a subtree, or
place region around it? and a quick way to jump to the next heading
with a given tag?

 Not really an answer, but I use epa and encrypt the whole file, which
 I find much fiddly. You can get epa to play nicely with org mode by
 putting something like:

 -*- mode:org; epa-file-encrypt-to: (m...@mmyemail.com) -*-

 at the top of your encrypted file.

I can encrypt the whole buffer with pgg-encrypt, but I want to be able
to just encrypt a selection of subtrees.

-- 
aleblanc



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: alter all subtrees containing specific tag

2009-03-08 Thread news
Carsten Dominik domi...@science.uva.nl writes:

   Is there a quick way to get the start and end points of a subtree,
 or
   place region around it? and a quick way to jump to the next heading
   with a given tag?

 (org-mark-subtree)  ;; this will include the headline

 (re-search-forward ^\\*+ .*?:ENCRYPT: nil t)

 - Carsten

Just discovered a bug in my previously posted function. It doesn't work
too well if you have lower level subtrees tagged for encryption.
Here is the fixed version:

(defun aleblanc-org-toggle-encryption (rcpts passphrase)
  (interactive (list (split-string (read-string Recipients (default is none): 
) [ \t,]+)
 (pgg-read-passphrase GnuPG passphrase: )))
  (show-all)
  (org-map-entries '(let (start end teststring)
  (org-outline-level)
  (next-line)
  (org-beginning-of-line)
  (setq start (point))
  (setq teststring (buffer-substring start (+ start 27)))
  (outline-get-next-sibling)
  (if (not (equal (point) (point-max)))
  (previous-line))
  (org-end-of-line)
  (setq end (point))
  (if (equal teststring -BEGIN PGP MESSAGE-)
  (if (pgg-decrypt-region start end passphrase)
  (pgg-display-output-buffer start end t)
(message Can't decrypt region!))
(if (equal rcpts '())
(pgg-encrypt-symmetric-region start end passphrase)
  (pgg-encrypt-region start end rcpts nil passphrase))
(pgg-display-output-buffer start end t)))
   +ENCRYPT))


-- 
aleblanc



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: alter all subtrees containing specific tag

2009-03-08 Thread news
Carsten Dominik domi...@science.uva.nl writes:

   Is there a quick way to get the start and end points of a subtree,
 or
   place region around it? and a quick way to jump to the next heading
   with a given tag?

 (org-mark-subtree)  ;; this will include the headline

 (re-search-forward ^\\*+ .*?:ENCRYPT: nil t)

 - Carsten

Couldn't find the org-mark-subtree function, but the following code
works for me. 
It will toggle the encryption of all subtrees in the current buffer that
are tagged with :ENCRYPT:, i.e. if the subtree is encrypted (starting
from the first line after the header, and finishing on the last
non-empty line of the subtree), it will be decrypted, otherwise it will
be encrypted.
You can use either gpg keys or a passphrase to encrypt subtrees. To use
gpg keys, enter the names of the owners of the keys at the prompt,
otherwise just press enter to use a passphrase only.
If the passphrase does not match for any encrypted subtrees they will be
left as is.

Perhaps someone could post this on Worg? (I am lazy).

(defun org-toggle-encryption (rcpts passphrase)
  (interactive (list (split-string (read-string Recipients (default is none): 
) [ \t,]+)
 (pgg-read-passphrase GnuPG passphrase: )))
  (org-map-entries '(let (start end teststring)
  (org-show-subtree)
  (next-line)
  (org-beginning-of-line)
  (setq start (point))
  (setq teststring (buffer-substring start (+ start 27)))
  (condition-case nil
  (progn 
(outline-forward-same-level 1)
(previous-line))
(error (goto-char (point-max
  (org-end-of-line)
  (setq end (point))
  (if (equal teststring -BEGIN PGP MESSAGE-)
  (if (pgg-decrypt-region start end passphrase)
  (pgg-display-output-buffer start end t)
(message Can't decrypt region!))
(if (equal rcpts '())
(pgg-encrypt-symmetric-region start end passphrase)
  (pgg-encrypt-region start end rcpts nil passphrase))
(pgg-display-output-buffer start end t)))
   +ENCRYPT))
   

-- 
aleblanc



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode