Re: [O] getting file properties
John Kitchin writes: > Hi everyone, > > if I have an org-file with this in it: > > #+EMAIL: jkitc...@cmu.edu > > is there an org lisp command to get the email address after I have > opened the file? I am looping through many files to generate a report, > and would like to do this in emacs-lisp. I had hoped org-entry-get > would do it, but it does not (it will retrieve it from #+PROPERTY: > EMAIL jkitc...@cmu.edu). > > Is it possible to define other keywords similar to that? E.g. > > #+ANDREWID: jkitchin > > and then to be able to read them from a lisp command (without writing > the parsing code myself)? something like (org-entry-get-keyword > "ANDREWID"). > > I could not find anything like this in the property API > (http://orgmode.org/manual/Using-the-property-API.html) which is where > i thought it would be. > > Thanks! > > John If you mean file-level properties (ie not properties on headlines), `org-export-get-environment' is one place to look. It runs `org-export--get-inbuffer-options', which parses options at the top of the file. I don't think it will read arbitrary properties, though...
Re: [O] getting file properties
da...@adboyd.com (J. David Boyd) writes: > John Kitchin writes: > >> Hi everyone, >> >> if I have an org-file with this in it: >> >> #+EMAIL: jkitc...@cmu.edu >> >> is there an org lisp command to get the email address after I have >> opened the file? I am looping through many files to generate a report, >> and would like to do this in emacs-lisp. I had hoped org-entry-get >> would do it, but it does not (it will retrieve it from #+PROPERTY: >> EMAIL jkitc...@cmu.edu). >> >> Is it possible to define other keywords similar to that? E.g. >> >> #+ANDREWID: jkitchin >> >> and then to be able to read them from a lisp command (without writing >> the parsing code myself)? something like (org-entry-get-keyword >> "ANDREWID"). >> >> I could not find anything like this in the property API >> (http://orgmode.org/manual/Using-the-property-API.html) which is where >> i thought it would be. >> >> Thanks! >> >> John >> >> --- >> John Kitchin >> Associate Professor >> Doherty Hall A207F >> Department of Chemical Engineering >> Carnegie Mellon University >> Pittsburgh, PA 15213 >> 412-268-7803 >> http://kitchingroup.cheme.cmu.edu > > > I'm interested in an answer to this as well... > > > Here's one way: --8<---cut here---start->8--- (defun jk-org-kwds () (let* ((parse-tree (org-element-parse-buffer)) (keys (org-element-map parse-tree 'keyword (function identity (mapcar (function (lambda (x) (cons (org-element-property :key x) (org-element-property :value x keys))) --8<---cut here---end--->8--- This returns a list of (KEY. VALUE) pairs. I'm sure there are other (better, cheaper) ways, but I'm going through org-element.el, and having that hammer in hand, everything looks like a nail to me :-) -- Nick
Re: [O] initiate source edits and region
Carsten Dominik writes: >> In a previous mail list discussion on this (delicate, almost heated) >> matter, Bastien finally ruled out that the preference in Org >> documentation and behaviour should use capitals. > Could you please point me to that discussion? Thanks. I tried for a few jiffies to find pointers. I did find a few related messages written around or before 2012-05, but not that one containing Bastien's decision. The simplest would be to write Bastien directly (hoping he remembers). Do you read us, Bastien? >> The above command should also insert capitals, for Org being >> consistent with itself :-) Whatever the decision about capitals is retained or reversed, I would surely like if the manual was using one convention consistently, and that Org mode itself, while recognizing any capitalization, was consistently generating the same which the manual uses, of course. > I think this would be one more useful option to add. An option could of course change how Org operates, but it would not change the manual. The default or implicit value for that option should then be consistent with the manual. > - Carsten François :-)
Re: [O] getting file properties
John Kitchin writes: > Hi everyone, > > if I have an org-file with this in it: > > #+EMAIL: jkitc...@cmu.edu > > is there an org lisp command to get the email address after I have > opened the file? I am looping through many files to generate a report, > and would like to do this in emacs-lisp. I had hoped org-entry-get > would do it, but it does not (it will retrieve it from #+PROPERTY: > EMAIL jkitc...@cmu.edu). > > Is it possible to define other keywords similar to that? E.g. > > #+ANDREWID: jkitchin > > and then to be able to read them from a lisp command (without writing > the parsing code myself)? something like (org-entry-get-keyword > "ANDREWID"). > > I could not find anything like this in the property API > (http://orgmode.org/manual/Using-the-property-API.html) which is where > i thought it would be. > > Thanks! > > John > > --- > John Kitchin > Associate Professor > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > http://kitchingroup.cheme.cmu.edu I'm interested in an answer to this as well...
Re: [O] Problem with setting up org-protocol
Hi Marcin, Since you already looked at it, I have a comment without looking at it myself :-p. On Sat, May 04, 2013 at 11:41:20PM +0200, Marcin Borkowski wrote: > *** Linux setup (Gnome) > > -For this to work, you'll need the Gnome-Libraries to be installed. > +(Instructions taken from > [[http://stackoverflow.com/questions/7464951/how-to-make-org-protocol-work][this > answer on StackOverflow]].) > + > +Create and save a file called org-protocol.desktop to > ~/.local/share/applications containing: > + > +: [Desktop Entry] > +: Name=org-protocol > +: Exec=emacsclient %u > +: Type=Application > +: Terminal=false > +: Categories=System; > +: MimeType=x-scheme-handler/org-protocol; > + > +Then run: > + > +: $ update-desktop-database ~/.local/share/applications/ > > -: gconftool-2 -s /desktop/gnome/url-handlers/org-protocol/command > '/usr/local/bin/emacsclient %s' --type String > -: gconftool-2 -s /desktop/gnome/url-handlers/org-protocol/enabled --type > Boolean true As far as I know, gconf was replaced with dconf with the new Gnome. In that case it might be better to replace the instructions with the corresponding dconf command line instead of some Gnome only binary (update-desktop-database here). Would you be willing to take a look at it? Cheers, -- Suvayu Open source is the future. It sets us free.
[O] getting file properties
Hi everyone, if I have an org-file with this in it: #+EMAIL: jkitc...@cmu.edu is there an org lisp command to get the email address after I have opened the file? I am looping through many files to generate a report, and would like to do this in emacs-lisp. I had hoped org-entry-get would do it, but it does not (it will retrieve it from #+PROPERTY: EMAIL jkitc...@cmu.edu). Is it possible to define other keywords similar to that? E.g. #+ANDREWID: jkitchin and then to be able to read them from a lisp command (without writing the parsing code myself)? something like (org-entry-get-keyword "ANDREWID"). I could not find anything like this in the property API ( http://orgmode.org/manual/Using-the-property-API.html) which is where i thought it would be. Thanks! John --- John Kitchin Associate Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu
[O] Problem with setting up org-protocol
Hi list, I tried to set up org-protocol (Ubuntu 12.04) and failed. It seems that I'm not the only one with this problem - see http://stackoverflow.com/questions/7464951/how-to-make-org-protocol-work . I edited the relevant page on my clone of Worg (I attach the patch), but I'm not sure whether this is 100% correct: I guess it might only work for Gnome (I don't use KDE, so I can't check for that), and I'm not sure whether it's legal to just copy-paste from SO. What I'm sure is that (unlike the previous description on Worg) it works for me. Could anyone check that and update Worg accordingly? Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University>From 44fe509fa9ac5a6a6d070e5b4df4efb40d5e7f04 Mon Sep 17 00:00:00 2001 From: Marcin Borkowski Date: Sat, 4 May 2013 23:31:48 +0200 Subject: [PATCH] A proper description of setting up org-protocol. Taken from this answer: http://stackoverflow.com/a/12751732/1181665 by user Mark. --- org-contrib/org-protocol.org | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/org-contrib/org-protocol.org b/org-contrib/org-protocol.org index e8419f2..088e33a 100644 --- a/org-contrib/org-protocol.org +++ b/org-contrib/org-protocol.org @@ -86,10 +86,22 @@ actions. Just register your custom sub-protocol and handler with the variable *** Linux setup (Gnome) -For this to work, you'll need the Gnome-Libraries to be installed. +(Instructions taken from [[http://stackoverflow.com/questions/7464951/how-to-make-org-protocol-work][this answer on StackOverflow]].) + +Create and save a file called org-protocol.desktop to ~/.local/share/applications containing: + +: [Desktop Entry] +: Name=org-protocol +: Exec=emacsclient %u +: Type=Application +: Terminal=false +: Categories=System; +: MimeType=x-scheme-handler/org-protocol; + +Then run: + +: $ update-desktop-database ~/.local/share/applications/ -: gconftool-2 -s /desktop/gnome/url-handlers/org-protocol/command '/usr/local/bin/emacsclient %s' --type String -: gconftool-2 -s /desktop/gnome/url-handlers/org-protocol/enabled --type Boolean true *** Linux setup (KDE) @@ -145,10 +157,6 @@ After installing EmacsClient.app you should then [[Verify the installation]]. On * Firefox If you are using Firefox on Mac OS X, see [[Mac OS X setup]]. - - Please refer to http://kb.mozillazine.org/Register_protocol and use - "org-protocol" as protocol. - # <> * Acrobat Reader :PROPERTIES: -- 1.7.9.5
Re: [O] Bug: org-archive-subtree should not include statitics counters for :ARCHIVE_OLPATH: [8.0.1 (release_8.0.1-10676-gd887b9 @ /home/mrb/dev/emacs/packages/org-mode/lisp/)]
On 29.4.2013, at 10:50, Marcel van der Boom wrote: > > When using org-archive-subtree, any statistic counters present in the > header will be copied to > the :ARCHIVE_OLPATH: property. > > Example: > > The property is set to: > > ':ARCHIVE_OLPATH: Development [22%] [82/358]/Openobject > tasks/OpenERP 7.x Interne HSD implementatie [31%] [35/112]' > > when the hierarchy is > > * Development [22%] [82/358] > ** Openobject tasks > *** OpenERP 7.x Interne HSD implementatie [31%] [35/112]' > > These statistics should not be copied to the property. I can reproduce this, and I agree that it might be useful to remove them when constructing the OLPATH. I would accept a patch to this effect. - Carsten
Re: [O] [html] centering
On 4.5.2013, at 00:28, Samuel Wales wrote: > Hi Carsten, > > On 5/3/13, Carsten Dominik wrote: >>> Has there been a recent change in HTML centering? We get this now: >>> >>> >>> >>> This does not work in browsers that do not support CSS. >> >> Specifically, which browsers are you talking about? >> >> What do you mean by "not working"? Just not centered, >> or something worse? > > Just not centered. I want my posts to work in text-oriented browsers > if possible, and I find that emacs-w3m does not seem to center. In my > test, at least, a normal export of a subtree to a buffer (with HEAD) > does not center in emacs-w3m. > > Incidentally, I normally export blog posts without HEAD, because > Blogger does not work well that way. So the new change means, as far > as I can tell, that I will have to add a CSS definition for center to > the places where I export. So that is a viable solution for you? - Carsten > > Thanks. > > Samuel > > -- > The Kafka Pandemic: http://thekafkapandemic.blogspot.com > > The disease DOES progress. MANY people have died from it. ANYBODY can get > it.
Re: [O] [PATCH] org-contacts: Fix org-contacts-gnus-article-from-goto
Applied, thanks. - Carsten On 4.5.2013, at 16:09, Rodney Lorrimar wrote: > * contrib/lisp/org-contacts.el (org-contacts-filter): Add a PROP-MATCH > argument. > (org-contacts-gnus-article-from-get-marker): Search for email as a > property not a tag. > > `org-contacts-gnus-article-from-get-marker' seems to assume that the > contact properties exist within the contact's tags as colon-separated > KEY={VALUE} entries. This isn't the case for me, using org-mode from > git master. > > This commit adds a PROP-MATCH argument to `org-contacts-filter' so > that `org-contacts-gnus-article-from-get-marker` can filter by the > EMAIL property. > --- > contrib/lisp/org-contacts.el | 19 +++ > 1 file changed, 15 insertions(+), 4 deletions(-) > > diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el > index c72e6c0..c84f1f2 100644 > --- a/contrib/lisp/org-contacts.el > +++ b/contrib/lisp/org-contacts.el > @@ -233,10 +233,15 @@ A regexp matching strings of whitespace, `,' and `;'.") > (progress-reporter-done progress-reporter))) > org-contacts-db)) > > -(defun org-contacts-filter (&optional name-match tags-match) > - "Search for a contact matching NAME-MATCH and TAGS-MATCH. > -If both match values are nil, return all contacts." > +(defun org-contacts-filter (&optional name-match tags-match prop-match) > + "Search for a contact matching any of NAME-MATCH, TAGS-MATCH, PROP-MATCH. > +If all match values are nil, return all contacts. > + > +The optional PROP-MATCH argument is a single (PROP . VALUE) cons > +cell corresponding to the contact properties. > +" > (if (and (null name-match) > +(null prop-match) > (null tags-match)) > (org-contacts-db) > (loop for contact in (org-contacts-db) > @@ -244,6 +249,11 @@ If both match values are nil, return all contacts." > (and name-match > (org-string-match-p name-match > (first contact))) > + (and prop-match > +(org-find-if (lambda (prop) > + (and (string= (car prop-match) (car prop)) > +(org-string-match-p (cdr prop-match) > (cdr prop > + (caddr contact))) > (and tags-match > (org-find-if (lambda (tag) > (org-string-match-p tags-match tag)) > @@ -523,7 +533,8 @@ A group FOO is composed of contacts with the tag FOO." > (email (cadr address))) > (cadar (or (org-contacts-filter > nil > -(concat org-contacts-email-property "={\\b" (regexp-quote > email) "\\b}")) > + nil > +(cons org-contacts-email-property (concat "\\b" > (regexp-quote email) "\\b"))) >(when name > (org-contacts-filter > (concat "^" name "$"))) > -- > 1.7.10.4 >
Re: [O] [PATCH] org-contacts: Use progress-reporter for cache update message
Applied, thanks. - Carsten On 4.5.2013, at 16:09, Rodney Lorrimar wrote: > * contrib/lisp/org-contacts.el (org-contacts-db): Use > `make-progress-reporter' instead of `message' for messages. Also > change the sentence to present progressive tense. > --- > contrib/lisp/org-contacts.el | 36 > 1 file changed, 20 insertions(+), 16 deletions(-) > > diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el > index 84ebc9d..c72e6c0 100644 > --- a/contrib/lisp/org-contacts.el > +++ b/contrib/lisp/org-contacts.el > @@ -211,22 +211,26 @@ A regexp matching strings of whitespace, `,' and `;'.") > (cdr (org-make-tags-matcher org-contacts-matcher))) >markers result) > (when (org-contacts-db-need-update-p) > - (message "Update Org Contacts Database") > - (dolist (file (org-contacts-files)) > - (org-check-agenda-file file) > - (with-current-buffer (org-get-agenda-file-buffer file) > - (unless (eq major-mode 'org-mode) > - (error "File %s is no in `org-mode'" file)) > - (org-scan-tags > -'(add-to-list 'markers (set-marker (make-marker) (point))) > -contacts-matcher > -todo-only))) > - (dolist (marker markers result) > - (org-with-point-at marker > - (add-to-list 'result > -(list (org-get-heading t) marker (org-entry-properties > marker 'all) > - (setf org-contacts-db result > - org-contacts-last-update (current-time))) > + (let ((progress-reporter > + (make-progress-reporter "Updating Org Contacts Database..." 0 > (length org-contacts-files))) > + (i 0)) > + (dolist (file (org-contacts-files)) > + (org-check-agenda-file file) > + (with-current-buffer (org-get-agenda-file-buffer file) > + (unless (eq major-mode 'org-mode) > + (error "File %s is no in `org-mode'" file)) > + (org-scan-tags > + '(add-to-list 'markers (set-marker (make-marker) (point))) > + contacts-matcher > + todo-only)) > + (progress-reporter-update progress-reporter (setq i (1+ i > + (dolist (marker markers result) > + (org-with-point-at marker > + (add-to-list 'result > + (list (org-get-heading t) marker (org-entry-properties > marker 'all) > + (setf org-contacts-db result > + org-contacts-last-update (current-time)) > + (progress-reporter-done progress-reporter))) > org-contacts-db)) > > (defun org-contacts-filter (&optional name-match tags-match) > -- > 1.7.10.4 >
Re: [O] Bug: Insert org headline errors out [8.0.2 (release_8.0.2-68-g40635b @ /home/dsubramanian/.emacs.d/thirdparty/org-mode/lisp/)]
Thanks for your response. The major mode is not org mode. The issue was not with org mode but with my dot-emacs. My apologies for reporting a false bug report. On Sat, May 4, 2013 at 1:02 AM, Nicolas Goaziou wrote: > Hello, > > deepak subramanian writes: > > > I am getting the below error when inserting a headline in org mode using > > Ctrl-Enter or M-Enter > > System : Ubuntu 10.04 > > Could you double check the major mode of the buffer from which you're > calling these commands? It looks like it isn't `org-mode'. > > > Regards, > > -- > Nicolas Goaziou >
[O] [PATCH] org-contacts: Use progress-reporter for cache update message
* contrib/lisp/org-contacts.el (org-contacts-db): Use `make-progress-reporter' instead of `message' for messages. Also change the sentence to present progressive tense. --- contrib/lisp/org-contacts.el | 36 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el index 84ebc9d..c72e6c0 100644 --- a/contrib/lisp/org-contacts.el +++ b/contrib/lisp/org-contacts.el @@ -211,22 +211,26 @@ A regexp matching strings of whitespace, `,' and `;'.") (cdr (org-make-tags-matcher org-contacts-matcher))) markers result) (when (org-contacts-db-need-update-p) - (message "Update Org Contacts Database") - (dolist (file (org-contacts-files)) - (org-check-agenda-file file) - (with-current-buffer (org-get-agenda-file-buffer file) - (unless (eq major-mode 'org-mode) - (error "File %s is no in `org-mode'" file)) - (org-scan-tags - '(add-to-list 'markers (set-marker (make-marker) (point))) - contacts-matcher - todo-only))) - (dolist (marker markers result) - (org-with-point-at marker - (add-to-list 'result - (list (org-get-heading t) marker (org-entry-properties marker 'all) - (setf org-contacts-db result - org-contacts-last-update (current-time))) + (let ((progress-reporter +(make-progress-reporter "Updating Org Contacts Database..." 0 (length org-contacts-files))) + (i 0)) + (dolist (file (org-contacts-files)) + (org-check-agenda-file file) + (with-current-buffer (org-get-agenda-file-buffer file) + (unless (eq major-mode 'org-mode) + (error "File %s is no in `org-mode'" file)) + (org-scan-tags +'(add-to-list 'markers (set-marker (make-marker) (point))) +contacts-matcher +todo-only)) + (progress-reporter-update progress-reporter (setq i (1+ i + (dolist (marker markers result) + (org-with-point-at marker + (add-to-list 'result +(list (org-get-heading t) marker (org-entry-properties marker 'all) + (setf org-contacts-db result + org-contacts-last-update (current-time)) + (progress-reporter-done progress-reporter))) org-contacts-db)) (defun org-contacts-filter (&optional name-match tags-match) -- 1.7.10.4
[O] [PATCH] org-contacts: Fix org-contacts-gnus-article-from-goto
* contrib/lisp/org-contacts.el (org-contacts-filter): Add a PROP-MATCH argument. (org-contacts-gnus-article-from-get-marker): Search for email as a property not a tag. `org-contacts-gnus-article-from-get-marker' seems to assume that the contact properties exist within the contact's tags as colon-separated KEY={VALUE} entries. This isn't the case for me, using org-mode from git master. This commit adds a PROP-MATCH argument to `org-contacts-filter' so that `org-contacts-gnus-article-from-get-marker` can filter by the EMAIL property. --- contrib/lisp/org-contacts.el | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el index c72e6c0..c84f1f2 100644 --- a/contrib/lisp/org-contacts.el +++ b/contrib/lisp/org-contacts.el @@ -233,10 +233,15 @@ A regexp matching strings of whitespace, `,' and `;'.") (progress-reporter-done progress-reporter))) org-contacts-db)) -(defun org-contacts-filter (&optional name-match tags-match) - "Search for a contact matching NAME-MATCH and TAGS-MATCH. -If both match values are nil, return all contacts." +(defun org-contacts-filter (&optional name-match tags-match prop-match) + "Search for a contact matching any of NAME-MATCH, TAGS-MATCH, PROP-MATCH. +If all match values are nil, return all contacts. + +The optional PROP-MATCH argument is a single (PROP . VALUE) cons +cell corresponding to the contact properties. +" (if (and (null name-match) + (null prop-match) (null tags-match)) (org-contacts-db) (loop for contact in (org-contacts-db) @@ -244,6 +249,11 @@ If both match values are nil, return all contacts." (and name-match (org-string-match-p name-match (first contact))) + (and prop-match + (org-find-if (lambda (prop) + (and (string= (car prop-match) (car prop)) + (org-string-match-p (cdr prop-match) (cdr prop + (caddr contact))) (and tags-match (org-find-if (lambda (tag) (org-string-match-p tags-match tag)) @@ -523,7 +533,8 @@ A group FOO is composed of contacts with the tag FOO." (email (cadr address))) (cadar (or (org-contacts-filter nil -(concat org-contacts-email-property "={\\b" (regexp-quote email) "\\b}")) + nil +(cons org-contacts-email-property (concat "\\b" (regexp-quote email) "\\b"))) (when name (org-contacts-filter (concat "^" name "$"))) -- 1.7.10.4
Re: [O] Mobileorg- Automatic pushing and pulling
The updated link would actually be: https://github.com/mobileorg/mobileorg/wiki/frequently-asked-questions The answer to this isn't there, but I will certainly be adding it! Any other community contributions are always welcome. On Sat, Apr 27, 2013 at 11:49 PM, Yagnesh Raghava Yakkala wrote: > > Hello Thomas, > > On Apr 28 2013, t...@tsdye.com (Thomas S. Dye) wrote: > >> Aloha Feng Shu, >> >> Hmm. The links to an mobileorg FAQ here >> http://mobileorg.ncogni.to/support/ and here >> https://github.com/richard/mobileorg/wiki/frequently-asked-questions are > > I think https://github.com/ksexton/mobileorg/wiki/_pages is the updated > link although I don't see exact answer to your question. > > Thanks., > -- > ఎందరో మహానుభావులు అందరికి వందనములు. > YYR
Re: [O] Bug: Insert org headline errors out [8.0.2 (release_8.0.2-68-g40635b @ /home/dsubramanian/.emacs.d/thirdparty/org-mode/lisp/)]
Hello, deepak subramanian writes: > I am getting the below error when inserting a headline in org mode using > Ctrl-Enter or M-Enter > System : Ubuntu 10.04 Could you double check the major mode of the buffer from which you're calling these commands? It looks like it isn't `org-mode'. Regards, -- Nicolas Goaziou