Re: [O] Possible bug - shifting headline - hashmark and what follows is considered part of headline that is shifted

2014-05-24 Thread Sebastien Vauban
Hello,

> Perhaps -- I don't know what LocalWords is supposed to do.

"# LocalWords:" allows to add words in your dictionary for that file only.

The syntax is "LocalWords:" prefixed by the current "comment prefix".
Hence, I don't really understand why we would want to transform it in
"#+ LocalWords:".

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Org mode links for helm

2014-05-24 Thread Sebastien Vauban
Bastien wrote:
> t...@tsdye.com (Thomas S. Dye) writes:
>
>> Has anyone implemented a helm interface for Org-mode #+name lines?  I
>> think it might be useful for inserting cross reference links.
>
> did you try
> https://github.com/emacs-helm/helm/blob/master/helm-org.el ?
>
> Maybe the authors can help I guess.

The author, Thierry Volpiatto, does not support Helm-Org anymore, as
told in http://article.gmane.org/gmane.emacs.helm.user/617.

BTW, it is only for the Org headlines, not for Org code block names.

Though, this particular question has already gotten tentatives of
answers, see 
http://lists.gnu.org/archive/html/emacs-orgmode/2010-07/msg00712.html.

I remember (thanks to Org!) having written the following in my .emacs file:

#+begin_src emacs-lisp
  ;; extension of Imenu
  (when (and
 ;; `org-babel' has been loaded
 (fboundp 'org-babel-execute-src-block)

 ;; `imenu' has been loaded
 (fboundp 'try-to-add-imenu))

(setq org-src-blocks-imenu-generic-expression
  `(("Snippets" ,org-babel-src-name-w-name-regexp 2)))

(add-hook 'org-mode-hook
  (lambda ()
(setq imenu-generic-expression
  org-src-blocks-imenu-generic-expression
#+end_src

... but I never saw any name of code chunk in the "IMenu" menu.
I only saw the headings of my current Org file.

Don't know what's wrong.

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Possible bug - shifting headline - hashmark and what follows is considered part of headline that is shifted

2014-05-24 Thread Bastien


Sebastien Vauban 
writes:

> The syntax is "LocalWords:" prefixed by the current "comment prefix".
> Hence, I don't really understand why we would want to transform it in
> "#+ LocalWords:".

Yes.  Putting this in a separate configuration section at the end of
the file is probably the way to go.

-- 
 Bastien




Re: [O] Extending org-contacts with properties: naming properties

2014-05-24 Thread Esben Stien
Karl Voit  writes:

> It's set: my first properties will be:
>
> :ITOLDTHEM_EMAIL:
> :ITOLDTHEM_ADDRESS:
> :ITOLDTHEM_PHONE:

We can't use a hierarchy?

* Hukarz
:PROPERTIES:
 :TRANSFER:
  :[LINKTOKARLJUNIOR]:
   :EMAIL: bar
   :ADDRESS:
   :PHONE:
  :[LINKTOYOURSELF]:
   :EMAIL: baz
:END:

If this were the contact heading of Hukarz, it would tell you that Karl
Junior transmitted "bar" as the email address of Hukarz and that yourself
transmitted the email "baz"

Using a drawer inside a drawer would also be nice for org-contacts when
you have multiple addresses and a whole slew of other cool stuff. 

-- 
Esben Stien is b0ef@e s  a 
 http://www. s tn m
  irc://irc.  b  -  i  .   e/%23contact
   sip:b0ef@   e e 
   jid:b0ef@n n



Re: [O] Extending org-contacts with properties: naming properties

2014-05-24 Thread Bastien
Esben Stien  writes:

> We can't use a hierarchy?

Well, no, sorry!

-- 
 Bastien



Re: [O] Extending org-contacts with properties: naming properties

2014-05-24 Thread Esben Stien
Esben Stien  writes:

> * Hukarz
> :PROPERTIES:
>  :TRANSFER:
>   :[LINKTOKARLJUNIOR]:
>:EMAIL: bar
>:ADDRESS:
>:PHONE:
>   :[LINKTOYOURSELF]:
>:EMAIL: baz
> :END:

Or how about just make the heading a type contact? That would be
infinitely more useful. 

* Hukarz
 :PROPERTIES:
 :ORGTYPE: contact
 :END
** EMAIL
*** f...@bar.bz
 :PROPERTIES:
 :EMAILTYPE: business
 :END:
This dude uses this for business, but actually send him mail via
 private email, cause he sees that after business hours as well;)
** transfer
*** [LINKTOCARLJUNIOR]
 EMAIL
 ADDRESS
* STREET
* ZIP
 PHONE
*** [LINKTOYOURSELF]
 EMAIL

-- 
Esben Stien is b0ef@e s  a 
 http://www. s tn m
  irc://irc.  b  -  i  .   e/%23contact
   sip:b0ef@   e e 
   jid:b0ef@n n



[O] Org-contacts standardization (was: org-contacts development)

2014-05-24 Thread Karl Voit
Hi Alexis!

* Alexis  wrote:
>
> Hi all,
>
> i use org-contacts as my primary system for contact
> management. Consequently, i'd love to be able to make use of my
> org-contacts data on my Android phone.

Agreed!

> What would be useful would be an 'official', fleshed-out spec for
> org-contacts data, which handles a greater range of contact-related
> info. At the moment, for example, my org-contacts file makes use of the
> properties:
>
> #+PROPERTY: LANDLINE
> #+PROPERTY: MOBILE
> #+PROPERTY: POST
> #+PROPERTY: RESIDENCE
>
> A search of this list's archives for references to 'org-contacts':
>
> https://lists.gnu.org/archive/cgi-bin/namazu.cgi?query=org-contacts&submit=Search!&idxname=emacs-orgmode&max=20&result=normal&sort=date%3Alate
>
> suggests that org-contacts is something people are using heavily enough
> that they're writing code, ad-hoc, to provide functionality they
> require, e.g.
>
> http://lists.gnu.org/archive/html/emacs-orgmode/2013-11/msg00869.html

And I also posted a suggestion how to name properties:
https://lists.gnu.org/archive/html/emacs-orgmode/2011-10/msg00144.html
... which was meanwhile extended by me to:

,[ my current yasnippet template for contacts ]
| # name : Org-contacts template for a person
| # --
| ** $1 $2  :$1$2:
| :PROPERTIES:
| :TYPE: ${3:$$(yas/choose-value '("person" "company"))}
| :TITLE:
| :EMAIL: $4
| :URL:
| :MOBILE: 0043/
| :HOMEPHONE:
| :WORKPHONE:
| :PHONE:
| :COMPANY:
| :STREET:
| :POSTALCODE:
| :CITY:
| :COUNTRY: Österreich
| :PHOTOGRAPH: [[photo:$1$2.jpg]]
| :BORN:
| :ITOLDTHEM_EMAIL:
| :ITOLDTHEM_ADDRESS:
| :ITOLDTHEM_PHONE:
| :ADDRESS_CHANGE_METHOD:
| :END:
|
| - first contact: $0
`

I invested quite some time to come up with this approach. For
example, I am generating my procmail filter by scanning all :EMAIL:
entries and :ITOLDTHEM_EMAIL: (whitelisting). 

With [1] I convert my contacts.org to the VCard format for Android
4.4. I did this using Python because I wanted full control to filter
out (most) data and also to provide a sanity check on all entries
(mistyped email address format, mistyped property names, ...).

However, I currently do have an issue here where only few items do not
get imported on Android. I did not have time to nail down the issue
any further yet since there was no obvious common pattern to
identify missing contacts and Android does not throw any error at
all.

> i'm wondering if it might now be appropriate for org-contacts to become
> part of org-mode proper, rather than simply a contrib, to reduce
> unnecessary duplication of efforts. i suspect that, at the moment, a
> number of people interested in making use of org-contacts might be
> reluctant to do so (or do so more heavily) because it's not an
> 'official' part of org-mode. Yet contacts management seems to me to be
> functionality well within org-mode's remit.

In my opinion, the most important first step would be to standardize
all important property names or enhance any kind of mapping scheme.

  1. https://github.com/novoid/org-contacts2vcard
-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
   > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github




Re: [O] Extending org-contacts with properties: naming properties

2014-05-24 Thread Esben Stien
Esben Stien  writes:

Then you could do: 

* Hukarz
 :PROPERTIES:
 :ORGTYPE: contact
 :END
** EMAIL
*** f...@bar.bz
 :PROPERTIES:
 :EMAILTYPE: business0
 :ID: 000
 :END:
This dude uses this for business, but actually send him mail via
 private email, cause he sees that after business hours as well;)
*** f...@baz.quux
 :PROPERTIES:
 :ID: 111
 :EMAILTYPE: private0
 :END:
This is his private email. Only a cool million know this address. It's a
secret. Never teach the wu-tang. 
** transfer
*** [LINKTOCARLJUNIOR]
 EMAIL
* [LINKTOID000]
 ADDRESS
* STREET
* ZIP
 PHONE
*** [LINKTOYOURSELF]
 EMAIL
* [LINKTOID111]

When thinking about it, the transfer under each contact, should really
tell what information this person has provided to some other contact

So, 

* Karl Junior
 email
* f...@bar.baz
* q...@bar.baz
 :PROPERTIES:
 :ID: 000
 :END: 
 informant
* [Link to Karl Yes Man]

* Karl Yes Man
 transfer
* [Link to Karl Junior]
** [Link to Karl Gustav]
*** email
 [Link to ID 000]
* [Link to other witnesses]

..tells us that Karl Yes Man (informant) has transferred information
about Karl Gustav with the email of Karl Junior (q...@foo.bar)

-- 
Esben Stien is b0ef@e s  a 
 http://www. s tn m
  irc://irc.  b  -  i  .   e/%23contact
   sip:b0ef@   e e 
   jid:b0ef@n n



[O] Bug: creating the agenda gives "Arithmetic error" [8.2.6 (release_8.2.6-1034-g995808 @ /home/grfz/src/org-mode/lisp/)]

2014-05-24 Thread Gregor Zattler

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.


Dear org-mode developers,

I cannnot create an agenda due to a erroneous stats cookie in a
headline of an org file:


If I do C-c a a emacs opens a *Org Agenda* window but it is
empty and the message "Arithmetic Error" appears in the echo
line.  In the  *Message* buffer I'm told:

Press key for agenda command:
if: Arithmetic error


I bisected the repo:

45c4f276f266fc41530128e1069979eb8df50fa2 is the first bad commit
commit 45c4f276f266fc41530128e1069979eb8df50fa2
Author: Bastien Guerry 
Date:   Fri May 23 15:54:50 2014 +0200

org.el: Implement agenda sorting against stats cookies.  Code
cleanup


I bisected my org-agenda-files and found a minimal example which
triggers the bug:


*** Some Appointment [0/0]
<2013-09-12 Do 19:00>
- People [6/11]
  - [X] Alice
  - [X] Bob
  - [X] Mallorey
  - [X] A
  - [ ] B
  - [ ] C
  - [X] D
  - [ ] E
  - [X] F
  - [ ] G
  - [ ] H


Note the wrong stats cookie '[0/0]' in the headline.

I'll remove the '[0/0]' but it woukld be nice if org-mode would
report the erroneous stats cookie instead of throwing an
arithmetic error.


Thanks, Gregor



Emacs  : GNU Emacs 24.4.50.1 (i686-pc-linux-gnu, GTK+ Version 3.12.2)
 of 2014-05-23 on boo
Package: Org-mode version 8.2.6 (release_8.2.6-1034-g995808 @ 
/home/grfz/src/org-mode/lisp/)



Re: [O] Bug: creating the agenda gives "Arithmetic error" [8.2.6 (release_8.2.6-1034-g995808 @ /home/grfz/src/org-mode/lisp/)]

2014-05-24 Thread Bastien
Hi Gregor,

Gregor Zattler  writes:

> I cannnot create an agenda due to a erroneous stats cookie in a
> headline of an org file:

Fixed, thanks!

-- 
 Bastien



Re: [O] New worg page: Publishing beamer slideshows and articles from one source

2014-05-24 Thread Suvayu Ali
Hi Bastien,

On Wed, May 21, 2014 at 03:28:28PM +0200, Bastien wrote:
> Suvayu Ali  writes:
> 
> > BTW, the ignoreheading thing has been asked so many times, maybe I
> > should put it in an FAQ.  But then, the content is more appropriate for
> > org-hacks ... I'm undecided.  Any thoughts?
> 
> It's both a FAQ and a hack, perhaps put the answer in the FAQ and the
> details in org-hacks?

Done!




Cheers,

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] org-contacts development

2014-05-24 Thread Alexis

Rasmus  writes:

> You could also put yourself a slightly different challenge: map
> between the org-contacts-format and an carddav server that you
> establish as a backend on your phone.  E.g. google contacts is a
> carddav server, I think.
>
> I use DAVdroid for syncing my calendar and my contacts with my
> OwnCloud and it very, very well!  I sync my agenda with my OwnCloud
> using org-caldav, which works great except when you have multiple time
> stamps per heading.  For contacts I tried Asynk to sync my bbdb
> contacts with OwnCloud, but I was using too many fields unknown to it,
> and my contacts got messed up.
>
> Mayhaps you already thought of this approach.  I think it is more
> future-proof.

i wasn't aware of CardDAV - thanks for pointing it out! My thoughts of
how to deal with org-contacts data have indeed been revolving around
vCard though, so this approach looks interesting indeed. :-)


Alexis.



Re: [O] mis-alignment in org-tables with Tibetan characters

2014-05-24 Thread Bastien
Hi Eric,

Eric Abrahamsen  writes:

> Sorry this took a while to get to...
>
> I think it was a little simpler than I thought -- at least I hope that's
> true, and I'm not missing something really obvious. There are two
> patches attached, a simple one that handles re-justification of table
> fields during field movement, and another that allows for narrowing of
> columns with double-width strings. The second patch is uglier, and
> doesn't work 100% well (you get misalignment if you try to narrow a
> double-wide to an odd number of single-width characters), but it's
> better than nothing.

I want to apply the patches on master -- can you give them a commit
message with an Emacs changelog?  Also, the first one (0001-...) does
not apply on master anymore.

Thanks in advance!

-- 
 Bastien



Re: [O] org-contacts development

2014-05-24 Thread Alexis

Bastien  writes:

> Improving org-contacts.el and making it part of Org core are two
> separate issues -- not everything that is part of Org core gets a
> lot of attention, and some contributed packages do.

Oh okay, fair enough!

> I'd say: go ahead with whatever conventions you want to enforce
> and the community will step up -- or just applaud :)

Heh, okay. :-)

> PS: Actually, being part of Org core sometimes slow down things,
> because substantial contributions then need to come from people
> who assign their copyright to the Free Software Foundation.

*nod* Good point  i'd be happy to assign copyright to the FSF,
myself, but i know that doing so is an issue for many people.


Alexis.



Re: [O] org-contacts development

2014-05-24 Thread Alexis

Alexander Baier  writes:

> About the spec, might it make sense to use a standard already in
> existence as a starting point or even a major inspiration?  Something
> like vCard for example?

Yeah, i like the idea of building on top of vCard, given how widely it's
used and supported, and that it doesn't seem to be a horrible format
 Those who feel otherwise are going to need to speak up soon or
forever hold their peace. :-)


Alexis.



Re: [O] Link to using calc in embedded mode with org-mode broken

2014-05-24 Thread Bastien
Hi Christopher,

Bastien  writes:

> This is a problem about cross references not pointing at the right
> URL when they are generated by texi2html.  @pxref{} seems to target
> Info references only.
>
> I don't have simple fix, though, I'd be interested if someone has
> one.

I fixed this in the master branch, the HTML manual will use the
correct link when we release Org 8.3.

-- 
 Bastien



Re: [O] org-contacts development

2014-05-24 Thread Alexis

Xebar Saram  writes:

> This sounds awesome, i would love syncing org contacts with my android
> phone

:-) It's good to know i'm not the only one wanting this functionality -
gives me more incentive to actually implement it!


Alexis.



Re: [O] Bug: creating the agenda gives "Arithmetic error" [8.2.6 (release_8.2.6-1034-g995808 @ /home/grfz/src/org-mode/lisp/)]

2014-05-24 Thread Gregor Zattler
Hi Bastien,
* Bastien  [24. May. 2014]:
> Gregor Zattler  writes:
> 
>> I cannnot create an agenda due to a erroneous stats cookie in a
>> headline of an org file:
> 
> Fixed, thanks!

Thanks for this ultra quick fix!

Ciao, Gregor
-- 
 -... --- .-. . -.. ..--.. ...-.-



Re: [O] ob-lua.el

2014-05-24 Thread Dieter Schoen
At Wed, 21 May 2014 09:30:44 +0200,
Bastien wrote:
> 
> Hi Dieter,
> 
> Dieter Schoen  writes:
> 
> > i have just sent the email to ass...@gnu.org to start the process.
> 
> Great -- let us know how it goes (can take one month.)

As I wrote off-list, I received the signed pdf yesterday.

> In the meantime, you can fix small things like the authors of the
> package, the owner of the copyright and such.

I have my name to the copyright, but left in the name of the authors
of ob-python.el, as I used that as a template.
Is that ok?

Another change to the first version is that it's now also possible
to do :results value and :results value pp.
(The first version still had python wrapper code in there.)

The Lua pretty-printer function is a home-brew, as Lua does not provide
much in that direction out of the box, at least to my knowledge.

So here it comes:

;;; ob-lua.el --- org-babel functions for lua evaluation

;; Copyright (C) 2009-2014 Free Software Foundation, Inc.

;; Authors: Eric Schulte
;;   Dan Davison
;; Keywords: literate programming, reproducible research
;; Homepage: http://orgmode.org

;; This file is part of GNU Emacs.

;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs.  If not, see .

;;; Commentary:

;; Org-Babel support for evaluating lua source code.

;;; Code:
(require 'ob)
(eval-when-compile (require 'cl))

(declare-function org-remove-indentation "org" )
(declare-function lua-shell "ext:lua-mode" (&optional argprompt))
(declare-function lua-toggle-shells "ext:lua-mode" (arg))
(declare-function run-lua "ext:lua" (cmd &optional dedicated show))

(defvar org-babel-tangle-lang-exts)
(add-to-list 'org-babel-tangle-lang-exts '("lua" . "lua"))

(defvar org-babel-default-header-args:lua '())

(defcustom org-babel-lua-command "lua"
  "Name of the command for executing Lua code."
  :version "24.4"
  :package-version '(Org . "8.0")
  :group 'org-babel
  :type 'string)

(defcustom org-babel-lua-mode
  (if (or (featurep 'xemacs) (featurep 'lua-mode)) 'lua-mode 'lua)
  "Preferred lua mode for use in running lua interactively.
This will typically be either 'lua or 'lua-mode."
  :group 'org-babel
  :version "24.4"
  :package-version '(Org . "8.0")
  :type 'symbol)

(defvar org-src-preserve-indentation)

(defcustom org-babel-lua-hline-to "None"
  "Replace hlines in incoming tables with this when translating to lua."
  :group 'org-babel
  :version "24.4"
  :package-version '(Org . "8.0")
  :type 'string)

(defcustom org-babel-lua-None-to 'hline
  "Replace 'None' in lua tables with this before returning."
  :group 'org-babel
  :version "24.4"
  :package-version '(Org . "8.0")
  :type 'symbol)

(defun org-babel-execute:lua (body params)
  "Execute a block of Lua code with Babel.
This function is called by `org-babel-execute-src-block'."
  (let* ((session (org-babel-lua-initiate-session
   (cdr (assoc :session params
 (result-params (cdr (assoc :result-params params)))
 (result-type (cdr (assoc :result-type params)))
 (return-val (when (and (eq result-type 'value) (not session))
   (cdr (assoc :return params
 (preamble (cdr (assoc :preamble params)))
 (full-body
  (org-babel-expand-body:generic
   (concat body (if return-val (format "\nreturn %s" return-val) ""))
   params (org-babel-variable-assignments:lua params)))
 (result (org-babel-lua-evaluate
  session full-body result-type result-params preamble)))
(org-babel-reassemble-table
 result
 (org-babel-pick-name (cdr (assoc :colname-names params))
  (cdr (assoc :colnames params)))
 (org-babel-pick-name (cdr (assoc :rowname-names params))
  (cdr (assoc :rownames params))

(defun org-babel-prep-session:lua (session params)
  "Prepare SESSION according to the header arguments in PARAMS.
VARS contains resolved variable references"
  (let* ((session (org-babel-lua-initiate-session session))
 (var-lines
  (org-babel-variable-assignments:lua params)))
(org-babel-comint-in-buffer session
  (mapc (lambda (var)
  (end-of-line 1) (insert var) (comint-send-input)
  (org-babel-comint-wait-for-output session)) var-lines))
session))

(defun org-babel-load-session:lua (session body params)
  "Load BODY into SESSION."
  (save-window-excursion
(let ((buffer (org-b

Re: [O] org-contact Documentation

2014-05-24 Thread Alexis

On Fri, 23 May 2014 15:17:04 +0200, Esben Stien wrote:

> Sync'ing with ldap would also be great, but I guess that's a bit
> premature.

Well, if org-contacts becomes based in vCard, as i'd like, i guess it
might be possible to use LDAP vCard services 


Alexis.



Re: [O] org-contacts development

2014-05-24 Thread Bastien
Alexis  writes:

> *nod* Good point  i'd be happy to assign copyright to the FSF,
> myself, but i know that doing so is an issue for many people.

Here you go!

http://orgmode.org/cgit.cgi/org-mode.git/plain/request-assign-future.txt

:)

-- 
 Bastien



Re: [O] ob-lua.el

2014-05-24 Thread Bastien
Hi Dieter,

Dieter Schoen  writes:

> I have my name to the copyright, but left in the name of the authors
> of ob-python.el, as I used that as a template.
> Is that ok?

Yes -- but I don't see your name anywhere in the file.

> Another change to the first version is that it's now also possible
> to do :results value and :results value pp.
> (The first version still had python wrapper code in there.)

Great!

> The Lua pretty-printer function is a home-brew, as Lua does not provide
> much in that direction out of the box, at least to my knowledge.

What ob-lua.el depends on?

You declare functions that suggests there is both lua-mode.el and
lua.el* -- I think this is a leftover from ob-pyhton.el.  Can you
double-check this?  Also, there should be a note explaining how to
install lua-mode.el, since it is not part of Emacs.

* See (defcustom org-babel-lua-mode ...

Also, there is (defvar org-src-preserve-indentation) which is not
used.

Let's do some more cleaning and then apply this to master.

Thanks!

-- 
 Bastien



Re: [O] org-contact Documentation

2014-05-24 Thread Alexander Baier
On 2014-05-23 15:17 Esben Stien wrote:
> I find it very interesting to distribute contacts all over my files,
> instead of having a single file for them. They end up somehow where they
> are supposed to be;).

This should not be a problem.  You define what makes a headline a
contact for you by specifying `org-contacts-matcher'.  And
`org-contacts-files' is a list of file names you want org-contacts to
consider whilst looking for contacts.

[...]

> A way of using groups?

I never used BBDB, so I am not sure what you mean by "groups".
Org-contacs has a notion of groups in a sense that you can tag your
contact headlines and every headline with the same tag is considered to
be in the same group.  This can be used when you are composing a mail to
many people, as you can do this by simply stating the relevant tag name.

HTH,
-- 
Alexander Baier



Re: [O] Possible bug - shifting headline - hashmark and what follows is considered part of headline that is shifted

2014-05-24 Thread Charles Millar

Hi Sebastien, Bastien and all,

Bastien wrote:



Sebastien Vauban 
writes:


The syntax is "LocalWords:" prefixed by the current "comment prefix".
Hence, I don't really understand why we would want to transform it in
"#+ LocalWords:".

Yes. Last evening I realized that changing "# LocalWords:" to
"#+ LocalWords:" was a terrible idea since it would be of no use for ispell.



[snip] Putting this in a separate configuration section at the end of
the file is probably the way to go.



However, I thought I would try to place # LocalWords: at the top of a 
file between any #+ KEYWORDS: and the first * headline. That way it does 
not become part of a tree/subtree.


Is this OK?

Charlie

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com




Re: [O] Extending org-contacts with properties: naming properties

2014-05-24 Thread Alexis

Hi Esben,

The way that org-contacts currently works is that contact details are
grouped together in the same PROPERTIES drawer, e.g.

* Alexis
:PROPERTIES:
:EMAIL:  ale...@example.com
:PHONE:  -
:END:

and that's what i've assumed in my MobileOrg code for parsing
org-contacts data. i imagine that moving away from such a data layout
would require substantial changes to the org-contacts.el code, which i
have no intention of doing - particularly given the work that would be
needed to ensure backwards-compatibility with people's existing data.

For reference, at the moment, in my own org-contacts file, i've set up
grouping via a headings hierarchy like:

* Lists
** Org-mode
:PROPERTIES:
:EMAIL:  emacs-orgmode@gnu.org
:END:
* People
** Mum and Dad
:PROPERTIES:
:PHONE:  -
:END:
* Organisations
** Free Software Foundation
:PROPERTIES:
:EMAIL:  i...@fsf.org
:END:
*** A. Person
:PROPERTIES:
:EMAIL:  a.per...@fsf.org
:END:


Alexis.



Re: [O] org-contacts development

2014-05-24 Thread Alexis

Bastien  writes:

> Alexis  writes:
>
>> *nod* Good point  i'd be happy to assign copyright to the FSF,
>> myself, but i know that doing so is an issue for many people.
>
> Here you go!
>
> http://orgmode.org/cgit.cgi/org-mode.git/plain/request-assign-future.txt
>
> :)

Heh, thank you! i'll definitely make sure to complete that form and send
it in. :-)


Alexis.



Re: [O] org-contacts development

2014-05-24 Thread Alexander Baier
On 2014-05-24 12:15 Alexis wrote:
> Alexander Baier  writes:
>
>> About the spec, might it make sense to use a standard already in
>> existence as a starting point or even a major inspiration?  Something
>> like vCard for example?
>
> Yeah, i like the idea of building on top of vCard, given how widely it's
> used and supported, and that it doesn't seem to be a horrible format
>  Those who feel otherwise are going to need to speak up soon or
> forever hold their peace. :-)
>
>
> Alexis.

For what it's worth, I would love to help out in any way I can.  I use
org-contacts myself and know elisp well enough to also do some
implementing.  But I wouldn't mind writing some documentation, either.
I, however, don't know much about Android programming or the syncing
aspect of this task.

Regards,
-- 
Alexander Baier



Re: [O] Possible bug - shifting headline - hashmark and what follows is considered part of headline that is shifted

2014-05-24 Thread Bastien
Charles Millar  writes:

> Is this OK?

Please go ahead and tell us :)

-- 
 Bastien



Re: [O] org-contacts development

2014-05-24 Thread Bastien
Hi Alexander,

Alexander Baier  writes:

> For what it's worth, I would love to help out in any way I can.  I use
> org-contacts myself and know elisp well enough to also do some
> implementing.  But I wouldn't mind writing some documentation, either.
> I, however, don't know much about Android programming or the syncing
> aspect of this task.

I'm adding Greg (Daimrod) to this thread, as I remember he was kinda
unofficial org-contacts.el maintainer for a while -- you may both
collaborate on org-contacts.el to speed up development.

Thanks in any case!

-- 
 Bastien



Re: [O] org-contacts development

2014-05-24 Thread Alexis

Alexander Baier  writes:

> For what it's worth, I would love to help out in any way I can.  I use
> org-contacts myself and know elisp well enough to also do some
> implementing.  But I wouldn't mind writing some documentation, either.

Thank you! At this point i'm studying RFC 6350 (vCard 4) and the
org-contacts.el source, trying to work out how to bring more of the
former to the latter with a minimal amount of work and fuss. :-)

> I, however, don't know much about Android programming or the syncing
> aspect of this task.

*nod* i'm not sure how much work is involved in the syncing aspect, and
so my first priority is to at least be able to export individual
contacts from MobileOrg to an individual vCard file that can be imported
into the Android Contacts system, and vice versa. There might already be
a FOSS CardDAV library for Android out there that could be used for
syncing, but i've not researched that yet.


Alexis.



Re: [O] org-contacts development

2014-05-24 Thread Rasmus
Alexis  writes:

> There might already be
> a FOSS CardDAV library for Android out there that could be used for
> syncing, but i've not researched that yet.

Check here:

https://f-droid.org/repository/browse/?fdfilter=carddav&fdpage=1&page_id=0

DAVdroid works very well.

-- 
Sådan en god dansk lagereddike kan man slet ikke bruge mere




Re: [O] org-contacts development

2014-05-24 Thread Alexis

Rasmus  writes:

> Check here:
>
> https://f-droid.org/repository/browse/?fdfilter=carddav&fdpage=1&page_id=0
>
> DAVdroid works very well.

Oh okay, i didn't realise DAVdroid was FOSS.

DAVdroid makes use of the ez-vcard library, which is BSD-licensed, and
certainly seems like it might be useful. However, i'm not sure to what
extent the sync-specific functionality of DAVdroid can be separated from
the rest of the app; superficially, it seems like it's fairly tightly
integrated. But if nothing else, it does show how it can be done! Thank
you. :-)


Alexis.



Re: [O] org-contacts development

2014-05-24 Thread Daimrod
Alexis  writes:

> Hi all,
Hi,

> [snip...]
>
> Fleshing out an extended spec for org-contacts data could be part of the
> process of making org-contacts a first-class citizen of org-mode, and
> provide a more solid foundation on which people can build (and share)
> the org-contacts functionality they're after. And in my own particular
> case, it would greatly facilitate my work in org-contacts / Android
> Contacts integration. :-)
>
> What do people think?

IMHO, the "problem" with org-contacts isn't that it isn't part of
org-mode, but that its format isn't well defined enough.

Some fields accept only one value, some multiple values, with different
separators, etc... And on top of that, there is no easy way to access
the database (`car', `cadr', `caddr', ...) which makes it difficult to
read and write code.


So, as you said, we would need to define and document a specification
for org-contacts. And we need to be clear from the beginning about
what it can do and what it can not do. For example, it is unlikely
that org-contacts will be a 1:1 mapping with the vCard format in its
current form because vCard properties can have values.

e.g.
PROP1;PROP2=VAL:FOO BAR
  ^

And AFAIK we can't do that with org-mode properties.

An approach would be to keep using properties whenever it's possible
to keep the format simple when possible and use subtree instead of
properties when necessary.

e.g.
#+BEGIN_SRC org
  ,* Contact Name
  ,** PHONE
 :PROPERTIES:
 :TYPE: WORK
 :END:
  - num1
  - num2
#+END_SRC

But then we would need a special property to indicate that a subtree
is a contact and ignore subtree without this property (just like it
does with the EMAIL property ATM).

#+BEGIN_SRC org
  ,* Contact Name
:PROPERTIES:
:TYPE: org-contacts
:END:

  ,** PHONE
 :PROPERTIES:
 :TYPE: WORK
 :END:
  - num1
  - num2
#+END_SRC

And of course it would be nice if we could keep as much compatibility
with the current format :)

-- 
Daimrod/Greg



Re: [O] Advice needed: Cant find a decent way to autosync my work TODO org file between laptop and work pc

2014-05-24 Thread Richard Lawrence
Hi Xebar,

Xebar Saram  writes:

> i mainly used git over the last 6 months but that forces me to
> pull/commit/push manually each time i add something to either machine and
> that is really annoying. plus i get merge conflicts all the time
>
> I have tried dropbox at the past but again this causes conflicts,
> isntreliable to me (on my
> linux laptop it doesn't always resume sync after sleep)

If neither git nor Dropbox works for you, I'm not sure this will be
helpful, but...

I personally use git for this.  To keep the effort of syncing and
merging low, I have a cron job set up to automatically commit in certain
repositories containing my Org files every hour.  It's just a
quick-and-dirty hack, but here it is:

#+BEGIN_SRC bash
#!/bin/bash
# Add org file changes to the repository
ROOT=$HOME
REPOS="org Documents/philosophy/dissertation Documents/philosophy/teaching 
Documents/philosophy/reading src/emacs"

commit_and_push()
{
  for REPO in $REPOS
  do
  echo "Repository: $ROOT/$REPO"
  cd $ROOT/$REPO

  if [ ! -d .git ]; then
  echo "Not a git repository; skipping"
  continue
  fi
  if [ ! -r autocommits ]; then
  echo "No autocommits file found; skipping"
  continue
  fi

  # Remove deleted files
  git ls-files --deleted -z | xargs -0 git rm >/dev/null 2>&1

  # Add files on whitelist to commit for current branch
  while read FILE
  do
  git add $FILE
  done < autocommits

  git commit -m "$(date) from $(hostname) by autocommit.sh"
  STATUS=$?
  if [ $STATUS != 0 ]; then
  echo "git commit failed with exit status $STATUS"
  fi

  # Push the current branch
  # requires branch..remote to be specified in git config
  # and ideally push.default = tracking 
  git push --porcelain
  STATUS=$?
  if [ $STATUS != 0 ]; then
  echo "git push failed with exit status $STATUS"
  fi

  done
}

pull()
{
  for REPO in $REPOS
  do
  echo "Repository: $REPO"
  cd $ROOT/$REPO

  git status | grep 'modified:'
  if [ $? == 0 ]; then
  echo "modified files present; fetching, but not pulling."
  CMD="fetch"
  else
  CMD="pull"
  fi

  git $CMD
  STATUS=$?
  if [ $STATUS != 0 ]; then
  echo "git $CMD failed with exit status $STATUS"
  fi
  done
}

case "$1" in
  commit)
  commit_and_push
  ;;
  pull)
  pull
  ;;
  *)
  echo "Usage: $0 {commit|pull}"
  exit 1
  ;;
esac

exit 0
#+END_SRC

This script requires a file called "autocommits" in each repository in
$REPOS which is a whitelist of files to autocommit changes in.  Most of
my Org files are on such a list.

I run this from Cron like:
#+BEGIN_SRC cron
0 * * * * ~/bin/autocommits.sh commit >/dev/null 2>&1 
#+END_SRC

To make sure my changes are saved before this script runs, I have in my .emacs:
#+BEGIN_SRC elisp
(run-at-time "00:59" 3600 'org-save-all-org-buffers) ; cron commits on the hour
(add-hook 'before-save-hook 'org-update-all-dblocks)
#+END_SRC

And finally, to pull the autocommitted changes on a new machine:
$ autocommits.sh pull

So you still have to manually pull and fix any merge conflicts, but I
find that committing often generally keeps the work involved here
minimal (because I can't usually work on two machines at once!).

Hope that helps!

Best,
Richard




Re: [O] org-contacts development

2014-05-24 Thread Alexis

Daimrod  writes:

> So, as you said, we would need to define and document a specification
> for org-contacts. And we need to be clear from the beginning about
> what it can do and what it can not do. For example, it is unlikely
> that org-contacts will be a 1:1 mapping with the vCard format in its
> current form because vCard properties can have values.
>
> e.g.
> PROP1;PROP2=VAL:FOO BAR
>   ^

Agreed. But it seem to me we could at least map e.g. "TEL;CELL:" (which
is how my Android phone vCard-exports a mobile number) to
e.g. ":MOBILE:" or ":PHONE_CELL:". And we could map things like
e.g. "EMAIL;TYPE=work:" to e.g. ":EMAIL_WORK:". This is just
brainstorming, however. :-)

> An approach would be to keep using properties whenever it's possible
> to keep the format simple when possible and use subtree instead of
> properties when necessary.
>
> e.g.
> #+BEGIN_SRC org
>   ,* Contact Name
>   ,** PHONE
>  :PROPERTIES:
>  :TYPE: WORK
>  :END:
>   - num1
>   - num2
> #+END_SRC
>
> But then we would need a special property to indicate that a subtree
> is a contact and ignore subtree without this property (just like it
> does with the EMAIL property ATM).
>
> #+BEGIN_SRC org
>   ,* Contact Name
> :PROPERTIES:
> :TYPE: org-contacts
> :END:
>
>   ,** PHONE
>  :PROPERTIES:
>  :TYPE: WORK
>  :END:
>   - num1
>   - num2
> #+END_SRC
>
> And of course it would be nice if we could keep as much compatibility
> with the current format :)

Well, to me this looks broadly similar to what Esben has proposed:

https://lists.gnu.org/archive/html/emacs-orgmode/2014-05/msg01055.html

Although i like the idea of such a format in principle, my concern (as i
noted in my reply to Esben) is that this might require a substantial
modification of org-contacts.el, both to accommodate this format and to
ensure backwards-compatibility. If this is indeed the case, and someone
else is willing to commit to being the lead on undertaking that work,
then i'll certainly support that work and write relevant MobileOrg code
to work with both the new and old formats. Otherwise, from my
perspective of wanting to simply add some more fields and be able to
transfer contact details between MobileOrg and my phone's Contacts
system, it's more than i'm willing to take on at this point.


Alexis.



Re: [O] Filtering org-clock-display

2014-05-24 Thread Noah Slater
On 20 April 2014 15:18, Bastien  wrote:

> Noah Slater  writes:
>
> > Note: sorting the clock table doesn't work very well. I want each
> > level to be sorted recursively.
>
> Yeah, me too -- if you can work on enhancing how the :sort parameters
> is handled for clocktables, that'd be great.
>

Okay, I'll consider that, thanks.


> As for the rest, please try C-u C-u C-c C-x C-d from master.
>
> We can enhance it by having an option setting the default custom range
> for such display, but going further would be too much.
>

What does this do? (What changed?) Does it let me filter the display by
time period?

Sorry it took me so long to respond.


Re: [O] How can you sort an Org clock table?

2014-05-24 Thread Noah Slater
Here's a broken example:

#+BEGIN: clocktable :maxlevel 2 :link :scope file :sort (2 . ?T)
#+END:

* A
CLOCK: [2014-05-24 Sat 10:00]--[2014-05-24 Sat 11:00] =>  1:00
* B
CLOCK: [2014-05-24 Sat 11:00]--[2014-05-24 Sat 12:30] =>  1:30
* C
CLOCK: [2014-05-24 Sat 12:30]--[2014-05-24 Sat 15:00] =>  2:30

If you run C-c C-c on the clocktable, it will update, but the sorting is
wrong. It should be in reverse order because it's "T" and not "t".

Now: remove ":link" and try again. The sorting works!


On 20 April 2014 12:22, Bastien  wrote:

> Noah Slater  writes:
>
> > If you add ":link" to the BEGIN blog, the sorting doesn't appear to
> > kick in. Bug, I expect.
>
> Please provide a reproducible example.
>
> --
>  Bastien
>


Re: [O] Org mode links for helm

2014-05-24 Thread Thomas S. Dye


Aloha Seb,

Sebastien Vauban 
writes:

> Bastien wrote:
>> tsd-p0awh739ni4avxtiumw...@public.gmane.org (Thomas S. Dye) writes:
>>
>>> Has anyone implemented a helm interface for Org-mode #+name lines?  I
>>> think it might be useful for inserting cross reference links.
>>
>> did you try
>> https://github.com/emacs-helm/helm/blob/master/helm-org.el ?
>>
>> Maybe the authors can help I guess.
>
> The author, Thierry Volpiatto, does not support Helm-Org anymore, as
> told in http://article.gmane.org/gmane.emacs.helm.user/617.
>
> BTW, it is only for the Org headlines, not for Org code block names.
>
> Though, this particular question has already gotten tentatives of
> answers, see 
> http://lists.gnu.org/archive/html/emacs-orgmode/2010-07/msg00712.html.
>
> I remember (thanks to Org!) having written the following in my .emacs file:
>
> #+begin_src emacs-lisp
>   ;; extension of Imenu
>   (when (and
>  ;; `org-babel' has been loaded
>  (fboundp 'org-babel-execute-src-block)
>
>  ;; `imenu' has been loaded
>  (fboundp 'try-to-add-imenu))
>
> (setq org-src-blocks-imenu-generic-expression
>   `(("Snippets" ,org-babel-src-name-w-name-regexp 2)))
>
> (add-hook 'org-mode-hook
>   (lambda ()
> (setq imenu-generic-expression
>   org-src-blocks-imenu-generic-expression
> #+end_src
>
> ... but I never saw any name of code chunk in the "IMenu" menu.
> I only saw the headings of my current Org file.

Thanks for this helpful information.  I didn't know about imenu, but it
appears to provide much of the functionality I'm after.

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com




Re: [O] current task being worked in agenda time grid

2014-05-24 Thread jdavidboyd

On 20.05.2014 23:04, Bastien wrote:

Eric S Fraga  writes:

Of course, you *could* change the mode line so that clocking 
information

comes earlier in the line... but playing with the mode line can be a
real time sink, and I speak from experience!  My mode line bears 
little

resemblance to the default and the changes were motivated by my using
Emacs on very small systems such as the OpenPandora.


A mode-line?  What mode-line?

http://bzg.fr/emacs-hide-mode-line.html


but definitely getting off-topic here :-)


Feels good sometimes :)


I like that no-mode-line mode.  Pretty cool!

Dave



Re: [O] ob-lua.el

2014-05-24 Thread Dieter Schoen
At Sat, 24 May 2014 14:25:05 +0200,
Bastien wrote:
> 
> Hi Dieter,
> 
> Dieter Schoen  writes:
> 
> > I have my name to the copyright, but left in the name of the authors
> > of ob-python.el, as I used that as a template.
> > Is that ok?
> 
> Yes -- but I don't see your name anywhere in the file.

madre-de-dios. i should not try to work when my boys are around.

> What ob-lua.el depends on?
> 
> You declare functions that suggests there is both lua-mode.el and
> lua.el* -- I think this is a leftover from ob-pyhton.el.  Can you
> double-check this?  Also, there should be a note explaining how to
> install lua-mode.el, since it is not part of Emacs.

Yes, that was a copy/paste relict from ob-python, I removed the latter
mode reference.

> * See (defcustom org-babel-lua-mode ...

As far as I understand the code, lua-mode would only be used for the session
support, to have an inferior process as receiver for code blocks.
I could not yet get the session support to work, there is a bit more work
involved than simple s/py/lua/.
I'll continue to work in that area.
 
> Also, there is (defvar org-src-preserve-indentation) which is not
> used.

removed.

> Let's do some more cleaning and then apply this to master.



regards,
dieter




;;; ob-lua.el --- org-babel functions for lua evaluation

;; Copyright (C) 2009-2014 Free Software Foundation, Inc.

;; Authors: Dieter Schoen
;;   Eric Schulte, Dan Davison
;; Keywords: literate programming, reproducible research
;; Homepage: http://orgmode.org

;; This file is part of GNU Emacs.

;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs.  If not, see .

;; Requirements:
;; for session support, lua-mode is needed.
;; lua-mode is not part of GNU Emacs/orgmode, but can be obtained
;; from marmalade or melpa.

;; However, sessions are not yet working.

;; Org-Babel support for evaluating lua source code.

;;; Code:
(require 'ob)
(eval-when-compile (require 'cl))

(declare-function org-remove-indentation "org" )
(declare-function lua-shell "ext:lua-mode" (&optional argprompt))
(declare-function lua-toggle-shells "ext:lua-mode" (arg))
(declare-function run-lua "ext:lua" (cmd &optional dedicated show))

(defvar org-babel-tangle-lang-exts)
(add-to-list 'org-babel-tangle-lang-exts '("lua" . "lua"))

(defvar org-babel-default-header-args:lua '())

(defcustom org-babel-lua-command "lua"
  "Name of the command for executing Lua code."
  :version "24.4"
  :package-version '(Org . "8.0")
  :group 'org-babel
  :type 'string)

(defcustom org-babel-lua-mode
  (if (or (featurep 'xemacs) (featurep 'lua-mode)) 'lua-mode)
  "Preferred lua mode for use in running lua interactively.
This will typically be 'lua-mode."
  :group 'org-babel
  :version "24.4"
  :package-version '(Org . "8.0")
  :type 'symbol)

(defcustom org-babel-lua-hline-to "None"
  "Replace hlines in incoming tables with this when translating to lua."
  :group 'org-babel
  :version "24.4"
  :package-version '(Org . "8.0")
  :type 'string)

(defcustom org-babel-lua-None-to 'hline
  "Replace 'None' in lua tables with this before returning."
  :group 'org-babel
  :version "24.4"
  :package-version '(Org . "8.0")
  :type 'symbol)

(defun org-babel-execute:lua (body params)
  "Execute a block of Lua code with Babel.
This function is called by `org-babel-execute-src-block'."
  (let* ((session (org-babel-lua-initiate-session
   (cdr (assoc :session params
 (result-params (cdr (assoc :result-params params)))
 (result-type (cdr (assoc :result-type params)))
 (return-val (when (and (eq result-type 'value) (not session))
   (cdr (assoc :return params
 (preamble (cdr (assoc :preamble params)))
 (full-body
  (org-babel-expand-body:generic
   (concat body (if return-val (format "\nreturn %s" return-val) ""))
   params (org-babel-variable-assignments:lua params)))
 (result (org-babel-lua-evaluate
  session full-body result-type result-params preamble)))
(org-babel-reassemble-table
 result
 (org-babel-pick-name (cdr (assoc :colname-names params))
  (cdr (assoc :colnames params)))
 (org-babel-pick-name (cdr (assoc :rowname-names params))
  (cdr (assoc :rownames params))

(defun org-babel-prep-session:lua (session params)
  "Prepare SESSION according to the header arguments in PAR

Re: [O] Advice needed: Cant find a decent way to autosync my work TODO org file between laptop and work pc

2014-05-24 Thread Richard Lawrence
Martin Schöön  writes:

> What if, as is the case for me, work computer runs Win7 and home computer
> runs Linux?
> Now I use a manual 'system' which shouldn't be necessary, I think.

Well, I don't run Windows on any of my systems, so someone else probably
has better advice here.

I'm pretty sure git runs on Windows, and in theory you should be able to
do something similar to the Bash script/cron job setup I described using
batch files.  But I'm no expert on that.

Another alternative would be to write a short ELisp program to do the
same thing, using `run-at-time' and `shell-command'...though I don't
know how shell-command works on Windows.

Also, Unison (http://www.cis.upenn.edu/~bcpierce/unison/) promises to do
two-way file sync between *nix and Windows.  I've never tried it; has
anyone else?

-- 
Best,
Richard


(If possible, please encrypt your reply to me using my PGP key:
Key ID: CF6FA646
Fingerprint: 9969 43E1 CF6F A646.
See http://www.ocf.berkeley.edu/~rwl/encryption.html for more information.)



Re: [O] Advice needed: Cant find a decent way to autosync my work TODO org file between laptop and work pc

2014-05-24 Thread Melleus
Richard Lawrence  writes:

> Also, Unison (http://www.cis.upenn.edu/~bcpierce/unison/) promises to do
> two-way file sync between *nix and Windows.  I've never tried it; has
> anyone else?

I can recommend rsync (you can get it from Cygwin for Windows) for such
things. No fancy GUIs though. It just works.




Re: [O] How can you sort an Org clock table?

2014-05-24 Thread Bastien
Hi Noah,

Noah Slater  writes:

> Here's a broken example:
>
> #+BEGIN: clocktable :maxlevel 2 :link :scope file :sort (2 . ?T)
> #+END:

You need :link t or :link nil for this block to be correctly formatted.

HTH,

-- 
 Bastien



Re: [O] Advice needed: Cant find a decent way to autosync my work TODO org file between laptop and work pc

2014-05-24 Thread Ken Mankoff

Do you have auto-revert enabled for that file? At the top of a
dropbox-shared Org file I have this:

# -*- coding: utf-8; eval: (auto-revert-mode 1); -*-

I still find it a bit buggy, and also have this code snippet which I
execute whenever I begin editing in that Org file. I also try to
remember to save it when done.

#+BEGIN_SRC emacs-lisp :results none
(revert-buffer nil t)
#+END_SRC

  -k.

On 2014-05-24 at 01:11, Xebar Saram  wrote:
> Hi all
>
> i need to sync my main work TODO org file between my work PC and laptop i
> carry around on work related trips and when im at home. i have tried
> several methods buy really none of them work.
>
> i mainly used git over the last 6 months but that forces me to
> pull/commit/push manually each time i add something to either machine and
> that is really annoying. plus i get merge conflicts all the time
>
> I have tried dropbox at the past but again this causes conflicts,
> isntreliable to me (on my
> linux laptop it doesn't always resume sync after sleep)
>
> I am using linux (arch linux on laptop  and debian on work PC to be precise)
>
> Also i use mobileorg on phones/tablets which works with various levels of
> success :)
>
> any advice would be hugely appreciated!
>
> thanks alot
>
> Z



Re: [O] Org mode links for helm

2014-05-24 Thread Thomas S. Dye
Aloha Bastien,

Bastien  writes:

> Hi Thomas,
>
> t...@tsdye.com (Thomas S. Dye) writes:
>
>> Has anyone implemented a helm interface for Org-mode #+name lines?  I
>> think it might be useful for inserting cross reference links.
>
> did you try
>
> https://github.com/emacs-helm/helm/blob/master/helm-org.el
>
> ?

This code, adapted from some code I found on John Kitchin's blog, does
what I want.

** Cross references
#+name: tsd-xref
#+begin_src emacs-lisp
(defun tsd-get-names-and-labels ()
  (interactive)
  (save-excursion
(goto-char (point-min))
(let ((matches '()))
  (while (re-search-forward "\\#\\+\\(name\\|label\\):\\s-\\(.*\\)" 
(point-max) t)
(add-to-list 'matches (match-string-no-properties 2) t))
  matches)))

(defun tsd-org-insert-crossref-link (&optional arg)
  (interactive (list (completing-read "insert: " (tsd-get-names-and-labels
  (insert (format "[[%s]]" arg)))
#+end_src

Now, when I'm referring to something I've labeled or named, I call
tsd-org-insert-crossref-link and helm works on a list of labels and
names defined in the buffer.

It's almost as convenient as using Carsten's reftex mode when writing in
LaTeX.

All the best,
Tom
-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] mis-alignment in org-tables with Tibetan characters

2014-05-24 Thread Eric Abrahamsen
Bastien  writes:

> Hi Eric,
>
> Eric Abrahamsen  writes:
>
>> Sorry this took a while to get to...
>>
>> I think it was a little simpler than I thought -- at least I hope that's
>> true, and I'm not missing something really obvious. There are two
>> patches attached, a simple one that handles re-justification of table
>> fields during field movement, and another that allows for narrowing of
>> columns with double-width strings. The second patch is uglier, and
>> doesn't work 100% well (you get misalignment if you try to narrow a
>> double-wide to an odd number of single-width characters), but it's
>> better than nothing.
>
> I want to apply the patches on master -- can you give them a commit
> message with an Emacs changelog?  Also, the first one (0001-...) does
> not apply on master anymore.
>
> Thanks in advance!

The patch series that would not die!

I'm not a git wizard, but I think I was able to apply both these patches
to master with no problem: they're now sitting on top of 56b47fb and
nothing is going wrong (I think). Can you try again?

Here they are with better commit messages.

E

>From 3e6fd0e2790156a9bd68401bdabbf1b170408ba6 Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen 
Date: Wed, 13 Feb 2013 11:56:18 +0800
Subject: [PATCH 1/2] Use string width in table field justification

lisp/org-table.el (org-table-justify-field-maybe): Use
org-string-width instead of length to calculate the visual width of
table cells -- helps with double-width charsets, etc.
---
 lisp/org-table.el | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/org-table.el b/lisp/org-table.el
index 6a7935e..5e0177f 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -981,13 +981,16 @@ Optional argument NEW may specify text to replace the current field content."
 	(progn
 	  (setq s (match-string 1)
 		o (match-string 0)
-		l (max 1 (- (match-end 0) (match-beginning 0) 3))
+		l (max 1
+			   (- (org-string-width
+			   (buffer-substring-no-properties
+(match-end 0) (match-beginning 0))) 3))
 		e (not (= (match-beginning 2) (match-end 2
 	  (setq f (format (if num " %%%ds %s" " %%-%ds %s")
 			  l (if e "|" (setq org-table-may-need-update t) ""))
 		n (format f s))
 	  (if new
-		  (if (<= (length new) l)  ;; FIXME: length -> str-width?
+		  (if (<= (org-string-width new) l)
 		  (setq n (format f new))
 		(setq n (concat new "|") org-table-may-need-update t)))
 	  (if (equal (string-to-char n) ?-) (setq n (concat " " n)))
-- 
1.9.3

>From 7850f739a6ef21bcc92763150861a67798282f12 Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen 
Date: Wed, 13 Feb 2013 16:46:33 +0800
Subject: [PATCH 2/2] Improve table column narrowing with variable-width
 strings

lisp/org-table.el (org-table-align): Use org-string-width to make a
better guess as to how wide a narrowed table column should actually
be. This won't work perfectly with variable-width scripts, as it still
only narrows in full-column increments, but it's better than before.
---
 lisp/org-table.el | 19 ++-
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/lisp/org-table.el b/lisp/org-table.el
index 5e0177f..d1f9686 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -765,7 +765,7 @@ When nil, simply write \"#ERROR\" in corrupted fields.")
 	 (hfmt1 (concat
 		 (make-string sp2 ?-) "%s" (make-string sp1 ?-) "+"))
 	 emptystrings links dates emph raise narrow
-	 falign falign1 fmax f1 len c e space)
+	 falign falign1 fmax f1 f2 len c e space)
 (untabify beg end)
 (remove-text-properties beg end '(org-cwidth t org-dwidth t display t))
 ;; Check if we have links or dates
@@ -851,10 +851,19 @@ When nil, simply write \"#ERROR\" in corrupted fields.")
 		  (unless (> f1 1)
 		(user-error "Cannot narrow field starting with wide link \"%s\""
 			   (match-string 0 xx)))
-		  (add-text-properties f1 (length xx) (list 'org-cwidth t) xx)
-		  (add-text-properties (- f1 2) f1
-   (list 'display org-narrow-column-arrow)
-   xx)
+		  (setq f2 (length xx))
+		  (if (= (org-string-width xx)
+			 f2)
+		  (setq f2 f1)
+		(setq f2 1)
+		(while (< (org-string-width (substring xx 0 f2))
+			  f1)
+		  (setq f2 (1+ f2
+		  (add-text-properties f2 (length xx) (list 'org-cwidth t) xx)
+		  (add-text-properties (if (>= (string-width (substring xx (1- f2) f2)) 2)
+	   (1- f2) (- f2 2)) f2
+	   (list 'display org-narrow-column-arrow)
+	   xx)
   ;; Get the maximum width for each column
   (push (apply 'max (or fmax 1) 1 (mapcar 'org-string-width column))
 	lengths)
-- 
1.9.3



Re: [O] mis-alignment in org-tables with Tibetan characters

2014-05-24 Thread Bastien
Eric Abrahamsen  writes:

> The patch series that would not die!

:)

Applied, thanks!

-- 
 Bastien



Re: [O] ob-lua.el

2014-05-24 Thread Bastien
Hi Dieter,

Dieter Schoen  writes:

> Yes, that was a copy/paste relict from ob-python, I removed the latter
> mode reference.

OK -- I see there are still references to both lua-mode.el and lua.el
(which does not exist) and you need to add a link to the lua-mode.el
github repository.

>> * See (defcustom org-babel-lua-mode ...
>
> As far as I understand the code, lua-mode would only be used for the session
> support, to have an inferior process as receiver for code blocks.
> I could not yet get the session support to work, there is a bit more work
> involved than simple s/py/lua/.
> I'll continue to work in that area.

Okay.  Another thing:

  :version "24.4"
  :package-version '(Org . "8.0")

needs to be

  :version "24.5"
  :package-version '(Org . "8.3")

to be accurate.

Thanks for the ongoing work, keep us posted and we can put this in
master when you get the confirmation from the FSF for the copyright
assignment.

Thanks!

-- 
 Bastien



Re: [O] Filtering org-clock-display

2014-05-24 Thread Bastien
Hi Noah,

Noah Slater  writes:

> As for the rest, please try C-u C-u C-c C-x C-d from master.
>
> We can enhance it by having an option setting the default custom
> range for such display, but going further would be too much.
>
>
> What does this do? (What changed?) Does it let me filter the display
> by time period?

Yes -- try it, you'll see.

> Sorry it took me so long to respond.

No problem!

-- 
 Bastien



[O] [PATCH] sort TODO entries more usefully

2014-05-24 Thread Eric Abrahamsen
For some reason I've been sorting lots of TODOs recently, and found the
default behavior of org-sort-entries a little odd. It sorts according to
the order found in org-todo-keywords-1, which apparently just comes from
the order the keywords were scanned during setup. I don't think that's
all that useful, so the attached patch sorts first by
org-not-done-keywords vs org-done-keywords, then alphabetically.
Headings with no keywords sort "big".

I'm not very experienced at logical tricks like sorting strategies, and
I'd be very curious to see if anyone had a more concise way of
expressing the comp function.

Eric
>From d19c86e720feb65e0aef7a1fff9bf19bd75dbcf4 Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen 
Date: Sun, 25 May 2014 12:18:52 +0800
Subject: [PATCH] Sort TODO entries more usefully

lisp/org.el (org-sort-entries, org-compare-todos-subr): Change the
   sort routine for TODO entries so that they are first sorted by
   keyword time (done or not done) and then
   alphabetically. Entries with no TODO keyword at all are sorted
   "big".
---
 lisp/org.el | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 9f14c44..2400ddf 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8703,6 +8703,15 @@ Optional argument WITH-CASE means sort case-sensitively."
 (setq s (substring st 1 -1)))
   s)
 
+(defun org-compare-todos-subr (a b)
+  (if (or (and (member a org-not-done-keywords)
+	   (member b org-not-done-keywords))
+	  (and (member a org-done-keywords)
+	   (member b org-done-keywords)))
+  (string< a b)
+(or (member a org-done-keywords)
+	(consp a
+
 (defvar org-priority-regexp) ; defined later in the file
 
 (defvar org-after-sorting-entries-or-items-hook nil
@@ -8904,8 +8913,8 @@ When sorting is done, call `org-after-sorting-entries-or-items-hook'."
 	 (or (org-entry-get nil property) ""))
 	((= dcst ?o)
 	 (if (looking-at org-complex-heading-regexp)
-		 (-  (length (member (match-string 2)
-	 org-todo-keywords-1)
+		 (car (member (match-string 2)
+org-todo-keywords-1
 	((= dcst ?f)
 	 (if getkey-func
 		 (progn
@@ -8918,6 +8927,7 @@ When sorting is done, call `org-after-sorting-entries-or-items-hook'."
  (cond
   ((= dcst ?a) 'string<)
   ((= dcst ?f) compare-func)
+	  ((= dcst ?o) 'org-compare-todos-subr)
   ((member dcst '(?p ?t ?s ?d ?c ?k)) '<)
 (run-hooks 'org-after-sorting-entries-or-items-hook)
 ;; Reset the clock marker if needed
-- 
1.9.3



Re: [O] Incorrect hexification in URLs in LaTeX Export

2014-05-24 Thread Bastien
Hi Michael,

"R. Michael Weylandt "
 writes:

> TLDR: remove ?\= from org-link-escape-chars.

Done (in master.)

I'm copying David since he's the author of this commit:
http://orgmode.org/w/?p=org-mode.git;a=commitdiff;h=1a68b6

David, sorry to jump in, but are there any reason why the
characters + ; and = where escaped in this commit?

Thanks in advance,

-- 
 Bastien



Re: [O] [PATCH] sort TODO entries more usefully

2014-05-24 Thread Bastien
Hi Eric,

Eric Abrahamsen  writes:

> For some reason I've been sorting lots of TODOs recently, and found the
> default behavior of org-sort-entries a little odd. It sorts according to
> the order found in org-todo-keywords-1, which apparently just comes from
> the order the keywords were scanned during setup. I don't think that's
> all that useful, so the attached patch sorts first by
> org-not-done-keywords vs org-done-keywords, then alphabetically.
> Headings with no keywords sort "big".

I don't think the alphabetical order is very useful here, and putting
headlines without TODO keywords first when sorting by TODO order is
counter-intuitive at least.

Let me suggest the attached patch instead: it puts TODO entries, then
entries without a TODO keyword, then DONE entries.

Would it be an improvement?

For specific needs, there is always C-c ^ f

Thanks,

diff --git a/lisp/org.el b/lisp/org.el
index dc223b4..f2963b2 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8904,8 +8904,9 @@ When sorting is done, call `org-after-sorting-entries-or-items-hook'."
 	 (or (org-entry-get nil property) ""))
 	((= dcst ?o)
 	 (if (looking-at org-complex-heading-regexp)
-		 (-  (length (member (match-string 2)
-	 org-todo-keywords-1)
+		 (let* ((m (match-string 2))
+			(s (if (member m org-done-keywords) '- '+)))
+		   (- 99 (funcall s (length (member m org-todo-keywords-1)))
 	((= dcst ?f)
 	 (if getkey-func
 		 (progn

-- 
 Bastien