Re: [Orgmode][PATCH] How do I include text between a range of line numbers with #INCLUDE
On Fri, Jan 7, 2011 at 10:03 AM, Venkatesh Choppella venkatesh.choppe...@iiit.ac.in wrote: I would like to include a part of a file (between a given range of line numbers) instead of the whole file. Is there a way to do that in org-mode? It isn't possible to include files using line numbers, as of now. Here's a quick patch that would add this feature. I have tested it with small files and works fine. Can somebody tell me if it looks good? :lines 5-10 will include the lines from 5 to 10, 10 excluded. :lines -10 will include the lines from 1 to 10, 10 excluded. :lines 5- will include the lines from 1 to the end of the file. HTH, Puneeth diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 3d466fa..5afa266 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -2130,13 +2130,14 @@ TYPE must be a string, any of: (defun org-export-handle-include-files () Include the contents of include files, with proper formatting. (let ((case-fold-search t) - params file markup lang start end prefix prefix1 switches all minlevel) + params file markup lang start end prefix prefix1 switches all minlevel lines) (goto-char (point-min)) (while (re-search-forward ^#\\+INCLUDE:?[ \t]+\\(.*\\) nil t) (setq params (read (concat ( (match-string 1) ))) prefix (org-get-and-remove-property 'params :prefix) prefix1 (org-get-and-remove-property 'params :prefix1) minlevel (org-get-and-remove-property 'params :minlevel) + lines (org-get-and-remove-property 'params :lines) file (org-symname-or-string (pop params)) markup (org-symname-or-string (pop params)) lang (and (member markup '(src SRC)) @@ -2159,7 +2160,7 @@ TYPE must be a string, any of: end (format #+end_%s markup (insert (or start )) (insert (org-get-file-contents (expand-file-name file) - prefix prefix1 markup minlevel)) + prefix prefix1 markup minlevel lines)) (or (bolp) (newline)) (insert (or end all)) @@ -2176,15 +2177,32 @@ TYPE must be a string, any of: (when intersection (error Recursive #+INCLUDE: %S intersection)) -(defun org-get-file-contents (file optional prefix prefix1 markup minlevel) +(defun org-get-file-contents (file optional prefix prefix1 markup minlevel lines) Get the contents of FILE and return them as a string. If PREFIX is a string, prepend it to each line. If PREFIX1 is a string, prepend it to the first line instead of PREFIX. If MARKUP, don't protect org-like lines, the exporter will -take care of the block they are in. +take care of the block they are in. You can include a part +of a file by specifying a range of line numbers, \P-Q\ +which includes lines from P to Q, excluding Q. P and/or Q +may be ommitted to assume the obvious defaults. (if (stringp markup) (setq markup (downcase markup))) (with-temp-buffer (insert-file-contents file) +(when lines + (let (beg end) + (setq lines (split-string lines -) + beg (if (string= (car lines)) + (point-min) + (goto-char (point-min)) + (forward-line (1- (string-to-number (car lines + (point)) + end (if (string= (cadr lines)) + (point-max) + (goto-char (point-min)) + (forward-line (1- (string-to-number (cadr lines + (point))) + (narrow-to-region beg end))) (when (or prefix prefix1) (goto-char (point-min)) (while (not (eobp)) ___ 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: inline images
eimp.el uses an external program (mogrify) to actually modify the image. That's not what is wanted. The image should remain the same, just be displayed in emacs in a smaller size ___ 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] [ENH] ditaa version
I think org-mode\contrib\scripts\ditaa.jar should be upgraded to the newest version from http://sourceforge.net/projects/ditaa/ which is 0.9 of 2009-11-24. I've been running with it for a month, no problems. ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Capture template and elisp expression
On 01/06/2011 11:44 PM, Carsten Dominik wrote: On Jan 6, 2011, at 11:26 PM, Nick Dokos wrote: Rainer M Krug r.m.k...@gmail.com wrote: Hi I want to use a Capture Template to record changes to files under version control. Everything works as expected, but I would like to include the current revision in the template. Therefore I tried the following: * %T %? at %a by Rainer M Krug, email: rai...@krugs.de %(vc-working-revision buffer-file-name) for the template, but I get an error: 2011-01-06 Thu 13:06 at [[file:~/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/nsa.org::*Finalise][Finalise]] by Rainer M Krug, email: rai...@krugs.de %![Error: (wrong-type-argument stringp nil)] Any idea how I could get the revision of the org file from which the Capture has been initiated (here ~/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/nsa.org )? There are a few problems: the evaluation of the sexp happens in the capture buffer where buffer-file-name returns nil. Even if you could get the file name, vc-working-revision would return nil on a file that is not VC-registered and the template would barf. Those are easy problems to solve but there is another one that seems insurmountable (with current code): my original thought was to use the %a escape to pass the link to a lisp function, extract the file name from it[fn:1] and run vc-working-revision on it (with appropriate safeguards to catch non-VC files), something like this: * %T %? at %a by Rainer M Krug, email: rai...@krugs.de %(rk-custom-function-to-get-vc-revision \%a\) However, this fails because at the time that %(sexp) constructs are expanded, simple %a etc. constructs have not been expanded yet, so what the function above gets is a literal %a: the subtitution sequence is ;; %[] Insert contents of a file. ... ;; %() embedded elisp ... ;; Simple %-escapes (see lisp/org-capture.el, lines 1181-1229 or so). Moreover, this sequence was different and was changed deliberately (see the thread http://thread.gmane.org/gmane.emacs.orgmode/27649), so if it is changed back, Sebastion Rose will not be happy :-) So it seems there is no way to pass values from the capture context to a lisp function in the capture template, but maybe I'm missing something. Thanks, Nick Footnotes: [fn:1] Is there an easier way to get the filename of the file I was visiting when I initiated the capture? If not, should there be? Perhaps a %f escape? Hi Nick, Hi Carsten, you can use (buffer-file-name (org-capture-get :original-buffer)) This works perfectly - thanks a million. For the record: I use %(vc-working-revision (buffer-file-name (org-capture-get :original-buffer))) to get the vc revision number. But now I thought - OK - now I can add the state of the file, returned by vc-state (this is working i a nother document in the org-document). So I added: %(vc-state (buffer-file-name (org-capture-get :original-buffer))) but I get the error Capture abort: (wrong-type-argument char-or-string-p edited) It seems, that vc-state (which should be up-to-date or edited) does return a different type then vc-working-revision ? Can I convert vc-state, so that it works? and we could certainly introduce a special escape for it if helpful. as this is a basic info, I think it would be useful to have a special escape for this. If it is easier, we can also put the filename itself into the property list, and any other information we like. This should happen in the function org-capture, close to the location where the buffer is stored, so near this line: (org-capture-put :original-buffer orig-buf :annotation annotation :initial initial) org-capture uses this property list precisely so that it is simple to add any information required. In addition to above, it should also be in the properties, oncluding with other information, like e.g. path. Note that, after the template has been filled in, it is better to access information in the property list with (org-capture-get PROPERTY 'local) to avoid conflicts with other ongoing capture processes. Does this affect me for my template, or does it concern the implementation of the buffer name as a property (above)? Because if it does affect my template, I should ask for clarification, because I don't understand what you mean here. Hope this helps. This definitely helps, Thanks a lot, Cheers, Rainer - Carsten ___ 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 -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Natural Sciences Building Office
[Orgmode] BUG? - Capture escape %n not working
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi I am not sure if it is a bug, or a configuration issue, but %n (user name (taken from `user-full-name')) is not working - it is not expanded and displayed as %n Emacs : GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1) of 2010-07-05 on ecolmod Package: Org-mode version 7.4 (release_7.4.100.gdf7d) Cheers, Rainer - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Natural Sciences Building Office Suite 2039 Stellenbosch University Main Campus, Merriman Avenue Stellenbosch South Africa Tel:+33 - (0)9 53 10 27 44 Cell: +27 - (0)8 39 47 90 42 Fax (SA): +27 - (0)8 65 16 27 82 Fax (D) : +49 - (0)3 21 21 25 22 44 Fax (FR): +33 - (0)9 58 10 27 44 email: rai...@krugs.de Skype: RMkrug -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0mzpYACgkQoYgNqgF2egpDYgCfdhwTTZ+yHK5NqidbcaNQ2h2p jwsAmwREFjnqSMUavfrIKjV2dH9oEis6 =GmNX -END PGP SIGNATURE- ___ 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-mode table with backslash inside fails to export to DocBook
Hi Baoqiu, A file with the following contents fails to export to Docbook: #+begin_src org ,* Table with a backslash in it , | \ | #+end_src It gives the following error #+begin_example Invalid use of `\' in replacement text #+end_example The following changes (replace-match literally in `org-export-docbook-finalize-table') solves this problem for me, but I would not know whether this would break anything else. #+begin_src diff diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el index 91ebb97..ed835b0 100644 --- a/lisp/org-docbook.el +++ b/lisp/org-docbook.el @@ -1367,7 +1367,7 @@ TABLE is a string containing the HTML code generated by (match-string 1 table) (match-string 4 table) /table) -nil nil table) +nil t table) table)) ;; Change table into informaltable if caption does not exist. (if (string-match @@ -1377,7 +1377,7 @@ TABLE is a string containing the HTML code generated by (match-string 1 table-with-label) (match-string 3 table-with-label) /informaltable) - nil nil table-with-label) + nil t table-with-label) table-with-label))) ;; Note: This function is very similar to #+end_src Regards, Niels. -- http://pft.github.com pgplH6vDsyEZK.pgp Description: PGP signature ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: Introducing gnugol - an org-mode-output web search client
I know--the *eshell* is not necessary too--its illustrative--its just an example--showing that you could (using your new module) create multiple asynchronous/coprocesses (in their own dedicated buffers) uniquely named shells and maybe make calls out to goosh and use surfraw and/or gnugol somehow. And, many thanks to you too Konrad for your new org-eshell.el module--hopefully more people will realize the possibilities of these great tools. Eshell has some unique properties that ought to be explored more. On Thu, Jan 6, 2011 at 3:11 PM, Konrad Hinsen konrad.hin...@fastmail.netwrote: On 6 Jan 2011, at 19:19, brian powell wrote: ** Example/possibilities: apt-get install surfraw ... [[eshell:*eshell*:(rename-buffer vvv)]] [[eshell:*eshell*:(rename-buffer ttt)]] There's no need for those two lines, because... [[eshell:vvv:date]] ... this one will create the eshell buffer vvv if it doesn't exist already. [[eshell:ttt:sr wikipedia goosh]] Same here. Konrad. ___ 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: Capture template and elisp expression
Carsten Dominik carsten.domi...@gmail.com writes: On Jan 6, 2011, at 11:26 PM, Nick Dokos wrote: Rainer M Krug r.m.k...@gmail.com wrote: Hi I want to use a Capture Template to record changes to files under version control. Everything works as expected, but I would like to include the current revision in the template. Therefore I tried the following: * %T %? at %a by Rainer M Krug, email: rai...@krugs.de %(vc-working-revision buffer-file-name) for the template, but I get an error: 2011-01-06 Thu 13:06 at [[file:~/Documents/Projects/BiocontrolAndAlienDynamics/ nonSpatialAcacia/trunc/R/nsa.org::*Finalise][Finalise]] by Rainer M Krug, email: rai...@krugs.de %![Error: (wrong-type- argument stringp nil)] Any idea how I could get the revision of the org file from which the Capture has been initiated (here ~/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/ trunc/R/nsa.org )? There are a few problems: the evaluation of the sexp happens in the capture buffer where buffer-file-name returns nil. Even if you could get the file name, vc-working-revision would return nil on a file that is not VC-registered and the template would barf. Those are easy problems to solve but there is another one that seems insurmountable (with current code): my original thought was to use the %a escape to pass the link to a lisp function, extract the file name from it[fn:1] and run vc-working-revision on it (with appropriate safeguards to catch non-VC files), something like this: * %T %? at %a by Rainer M Krug, email: rai...@krugs.de%(rk- custom-function-to-get-vc-revision \%a\) However, this fails because at the time that %(sexp) constructs are expanded, simple %a etc. constructs have not been expanded yet, so what the function above gets is a literal %a: the subtitution sequence is ;; %[] Insert contents of a file. ... ;; %() embedded elisp ... ;; Simple %-escapes (see lisp/org-capture.el, lines 1181-1229 or so). Moreover, this sequence was different and was changed deliberately (see the thread http://thread.gmane.org/gmane.emacs.orgmode/27649), so if it is changed back, Sebastion Rose will not be happy :-) So it seems there is no way to pass values from the capture context to a lisp function in the capture template, but maybe I'm missing something. Thanks, Nick Footnotes: [fn:1] Is there an easier way to get the filename of the file I was visiting when I initiated the capture? If not, should there be? Perhaps a %f escape? Hi Nick, you can use (buffer-file-name (org-capture-get :original-buffer)) and we could certainly introduce a special escape for it if helpful. If it is easier, we can also put the filename itself into the property list, and any other information we like. This should happen in the function org-capture, close to the location where the buffer is stored, so near this line: (org-capture-put :original-buffer orig-buf :annotation annotation :initial initial) org-capture uses this property list precisely so that it is simple to add any information required. Note that, after the template has been filled in, it is better to access information in the property list with (org-capture-get PROPERTY 'local) to avoid conflicts with other ongoing capture processes. Hope this helps. Why aren't the %() expressions simply evaluated in the original buffer (if available)? That would solve these issues in a general way. It seems to me that there is no advantage to evaluating the expressions in the temporary capture buffer, but I'm not familiar with the code so I might be missing something. Is there a reason for that? Štěpán ___ 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] [PATCH] Always add sitemap file to project files if sitemap is requested
Greetings! I noticed some wonkiness in getting my sitemap created on my webserver when pushing my website, and the problem seems to lie in org-publish-get-base-files only returning existing files, and not picking up on the soon to be generated sitemap. My patch always adds the sitemap file to the list of returned files if a sitemap is requested, regardless of if it exists or not. Regards, Jan Seeger diff --git a/lisp/org-publish.el b/lisp/org-publish.el index f29b402..baf282a 100644 --- a/lisp/org-publish.el +++ b/lisp/org-publish.el @@ -434,6 +434,9 @@ matching filenames. ;; org-publish-compare-directory-files: (sitemap-requested (plist-get project-plist :auto-sitemap)) +(sitemap-filename + (or (plist-get project-plist :sitemap-filename) + sitemap.org)) (sitemap-sort-folders (if (plist-member project-plist :sitemap-sort-folders) (plist-get project-plist :sitemap-sort-folders) @@ -454,6 +457,9 @@ matching filenames. (setq sitemap-sort-folders nil)) (setq org-publish-temp-files nil) +(if sitemap-requested + (pushnew (expand-file-name (concat base-dir sitemap-filename)) + org-publish-temp-files)) (org-publish-get-base-files-1 base-dir recurse match ;; FIXME distinguish exclude regexp ;; for skip-file and skip-dir? ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Capture template and elisp expression
Rainer M Krug r.m.k...@gmail.com wrote: But now I thought - OK - now I can add the state of the file, returned by vc-state (this is working i a nother document in the org-document). So I added: %(vc-state (buffer-file-name (org-capture-get :original-buffer))) but I get the error Capture abort: (wrong-type-argument char-or-string-p edited) It seems, that vc-state (which should be up-to-date or edited) does return a different type then vc-working-revision ? Can I convert vc-state, so that it works? Yes, vc-state returns a symbol. You can convert it to a string with symbol-name. Nick ___ 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: Capture template and elisp expression
On Jan 7, 2011, at 1:08 PM, Štěpán Němec wrote: Carsten Dominik carsten.domi...@gmail.com writes: On Jan 6, 2011, at 11:26 PM, Nick Dokos wrote: Rainer M Krug r.m.k...@gmail.com wrote: Hi I want to use a Capture Template to record changes to files under version control. Everything works as expected, but I would like to include the current revision in the template. Therefore I tried the following: * %T %? at %a by Rainer M Krug, email: rai...@krugs.de %(vc-working-revision buffer-file-name) for the template, but I get an error: 2011-01-06 Thu 13:06 at [[file:~/Documents/Projects/BiocontrolAndAlienDynamics/ nonSpatialAcacia/trunc/R/nsa.org::*Finalise][Finalise]] by Rainer M Krug, email: rai...@krugs.de %![Error: (wrong-type- argument stringp nil)] Any idea how I could get the revision of the org file from which the Capture has been initiated (here ~/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/ trunc/R/nsa.org )? There are a few problems: the evaluation of the sexp happens in the capture buffer where buffer-file-name returns nil. Even if you could get the file name, vc-working-revision would return nil on a file that is not VC-registered and the template would barf. Those are easy problems to solve but there is another one that seems insurmountable (with current code): my original thought was to use the %a escape to pass the link to a lisp function, extract the file name from it[fn:1] and run vc-working-revision on it (with appropriate safeguards to catch non-VC files), something like this: * %T %? at %a by Rainer M Krug, email: rai...@krugs.de%(rk- custom-function-to-get-vc-revision \%a\) However, this fails because at the time that %(sexp) constructs are expanded, simple %a etc. constructs have not been expanded yet, so what the function above gets is a literal %a: the subtitution sequence is ;; %[] Insert contents of a file. ... ;; %() embedded elisp ... ;; Simple %-escapes (see lisp/org-capture.el, lines 1181-1229 or so). Moreover, this sequence was different and was changed deliberately (see the thread http://thread.gmane.org/gmane.emacs.orgmode/27649), so if it is changed back, Sebastion Rose will not be happy :-) So it seems there is no way to pass values from the capture context to a lisp function in the capture template, but maybe I'm missing something. Thanks, Nick Footnotes: [fn:1] Is there an easier way to get the filename of the file I was visiting when I initiated the capture? If not, should there be? Perhaps a %f escape? Hi Nick, you can use (buffer-file-name (org-capture-get :original-buffer)) and we could certainly introduce a special escape for it if helpful. If it is easier, we can also put the filename itself into the property list, and any other information we like. This should happen in the function org-capture, close to the location where the buffer is stored, so near this line: (org-capture-put :original-buffer orig-buf :annotation annotation :initial initial) org-capture uses this property list precisely so that it is simple to add any information required. Note that, after the template has been filled in, it is better to access information in the property list with (org-capture-get PROPERTY 'local) to avoid conflicts with other ongoing capture processes. Hope this helps. Why aren't the %() expressions simply evaluated in the original buffer (if available)? That would solve these issues in a general way. It seems to me that there is no advantage to evaluating the expressions in the temporary capture buffer, but I'm not familiar with the code so I might be missing something. Is there a reason for that? The sexp can be used to insert stuff into the template, so I think it is correct to evaluate it in the template buffer. - Carsten ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] BUG? - Capture escape %n not working
Rainer M Krug r.m.k...@gmail.com wrote: Hi I am not sure if it is a bug, or a configuration issue, but %n (user name (taken from `user-full-name')) is not working - it is not expanded and displayed as %n Emacs : GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1) of 2010-07-05 on ecolmod Package: Org-mode version 7.4 (release_7.4.100.gdf7d) It's a bug - there is an n missing from the regexp: diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 85747ee..2076f68 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1213,7 +1213,7 @@ The template may still contain \%?\ for cursor positioning. ;; Simple %-escapes (goto-char (point-min)) - (while (re-search-forward %\\([tTuUaiAcxkKI]\\) nil t) + (while (re-search-forward %\\([tTuUaiAcxkKIn]\\) nil t) (unless (org-capture-escaped-%) (when (and initial (equal (match-string 0) %i)) (save-match-data Nick ___ 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: Capture template and elisp expression
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/07/2011 03:14 PM, Carsten Dominik wrote: On Jan 7, 2011, at 1:08 PM, Štěpán Němec wrote: Carsten Dominik carsten.domi...@gmail.com writes: On Jan 6, 2011, at 11:26 PM, Nick Dokos wrote: Rainer M Krug r.m.k...@gmail.com wrote: Hi I want to use a Capture Template to record changes to files under version control. Everything works as expected, but I would like to include the current revision in the template. Therefore I tried the following: * %T %? at %a by Rainer M Krug, email: rai...@krugs.de %(vc-working-revision buffer-file-name) for the template, but I get an error: 2011-01-06 Thu 13:06 at [[file:~/Documents/Projects/BiocontrolAndAlienDynamics/ nonSpatialAcacia/trunc/R/nsa.org::*Finalise][Finalise]] by Rainer M Krug, email: rai...@krugs.de %![Error: (wrong-type- argument stringp nil)] Any idea how I could get the revision of the org file from which the Capture has been initiated (here ~/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/ trunc/R/nsa.org )? There are a few problems: the evaluation of the sexp happens in the capture buffer where buffer-file-name returns nil. Even if you could get the file name, vc-working-revision would return nil on a file that is not VC-registered and the template would barf. Those are easy problems to solve but there is another one that seems insurmountable (with current code): my original thought was to use the %a escape to pass the link to a lisp function, extract the file name from it[fn:1] and run vc-working-revision on it (with appropriate safeguards to catch non-VC files), something like this: * %T %? at %a by Rainer M Krug, email: rai...@krugs.de%(rk- custom-function-to-get-vc-revision \%a\) However, this fails because at the time that %(sexp) constructs are expanded, simple %a etc. constructs have not been expanded yet, so what the function above gets is a literal %a: the subtitution sequence is ;; %[] Insert contents of a file. ... ;; %() embedded elisp ... ;; Simple %-escapes (see lisp/org-capture.el, lines 1181-1229 or so). Moreover, this sequence was different and was changed deliberately (see the thread http://thread.gmane.org/gmane.emacs.orgmode/27649), so if it is changed back, Sebastion Rose will not be happy :-) So it seems there is no way to pass values from the capture context to a lisp function in the capture template, but maybe I'm missing something. Thanks, Nick Footnotes: [fn:1] Is there an easier way to get the filename of the file I was visiting when I initiated the capture? If not, should there be? Perhaps a %f escape? Hi Nick, you can use (buffer-file-name (org-capture-get :original-buffer)) and we could certainly introduce a special escape for it if helpful. If it is easier, we can also put the filename itself into the property list, and any other information we like. This should happen in the function org-capture, close to the location where the buffer is stored, so near this line: (org-capture-put :original-buffer orig-buf :annotation annotation :initial initial) org-capture uses this property list precisely so that it is simple to add any information required. Note that, after the template has been filled in, it is better to access information in the property list with (org-capture-get PROPERTY 'local) to avoid conflicts with other ongoing capture processes. Hope this helps. Why aren't the %() expressions simply evaluated in the original buffer (if available)? That would solve these issues in a general way. It seems to me that there is no advantage to evaluating the expressions in the temporary capture buffer, but I'm not familiar with the code so I might be missing something. Is there a reason for that? The sexp can be used to insert stuff into the template, so I think it is correct to evaluate it in the template buffer. Just an idea - as you said, it makes sense to evaluate it in the template buffer. But, if it is technically nod difficult, what about adding an additional escape, e.g. %ob(sexp) for which sexp is evaluated in the original buffer, from which capture is called? in that way, many problems could be solved with a minimum of effort. Cheers, Rainer - Carsten - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Natural Sciences Building Office Suite 2039 Stellenbosch University Main Campus, Merriman Avenue Stellenbosch South Africa Tel:+33 - (0)9 53 10 27 44 Cell: +27 - (0)8 39 47 90 42 Fax (SA): +27 - (0)8 65 16 27 82 Fax (D) : +49 - (0)3 21 21 25 22 44 Fax (FR): +33 - (0)9 58 10 27 44 email: rai...@krugs.de Skype: RMkrug -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with
Re: [Orgmode] BUG? - Capture escape %n not working
Applied, thanks. - Carsten On Jan 7, 2011, at 3:15 PM, Nick Dokos wrote: Rainer M Krug r.m.k...@gmail.com wrote: Hi I am not sure if it is a bug, or a configuration issue, but %n (user name (taken from `user-full-name')) is not working - it is not expanded and displayed as %n Emacs : GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1) of 2010-07-05 on ecolmod Package: Org-mode version 7.4 (release_7.4.100.gdf7d) It's a bug - there is an n missing from the regexp: diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 85747ee..2076f68 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1213,7 +1213,7 @@ The template may still contain \%?\ for cursor positioning. ;; Simple %-escapes (goto-char (point-min)) - (while (re-search-forward %\\([tTuUaiAcxkKI]\\) nil t) + (while (re-search-forward %\\([tTuUaiAcxkKIn]\\) nil t) (unless (org-capture-escaped-%) (when (and initial (equal (match-string 0) %i)) (save-match-data Nick ___ 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 - Carsten ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] BUG? - Capture escape %n not working
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/07/2011 03:29 PM, Carsten Dominik wrote: Applied, thanks. Thanks a lot, Rainer - Carsten On Jan 7, 2011, at 3:15 PM, Nick Dokos wrote: Rainer M Krug r.m.k...@gmail.com wrote: Hi I am not sure if it is a bug, or a configuration issue, but %n (user name (taken from `user-full-name')) is not working - it is not expanded and displayed as %n Emacs : GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1) of 2010-07-05 on ecolmod Package: Org-mode version 7.4 (release_7.4.100.gdf7d) It's a bug - there is an n missing from the regexp: diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 85747ee..2076f68 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1213,7 +1213,7 @@ The template may still contain \%?\ for cursor positioning. ;; Simple %-escapes (goto-char (point-min)) - (while (re-search-forward %\\([tTuUaiAcxkKI]\\) nil t) + (while (re-search-forward %\\([tTuUaiAcxkKIn]\\) nil t) (unless (org-capture-escaped-%) (when (and initial (equal (match-string 0) %i)) (save-match-data Nick ___ 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 - Carsten - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Natural Sciences Building Office Suite 2039 Stellenbosch University Main Campus, Merriman Avenue Stellenbosch South Africa Tel:+33 - (0)9 53 10 27 44 Cell: +27 - (0)8 39 47 90 42 Fax (SA): +27 - (0)8 65 16 27 82 Fax (D) : +49 - (0)3 21 21 25 22 44 Fax (FR): +33 - (0)9 58 10 27 44 email: rai...@krugs.de Skype: RMkrug -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0nI1oACgkQoYgNqgF2ego7HwCfd3dtbG/nqZqDfKB2XpW/EKMG ywIAn3mj/V+Tqg8QwTvttR9ICudi9/r1 =xsLC -END PGP SIGNATURE- ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode][PATCH] How do I include text between a range of line numbers with #INCLUDE
The patch looks OK to me. However, line numers are notorioously bad references - Carsten On Jan 7, 2011, at 8:59 AM, Puneeth wrote: On Fri, Jan 7, 2011 at 10:03 AM, Venkatesh Choppella venkatesh.choppe...@iiit.ac.in wrote: I would like to include a part of a file (between a given range of line numbers) instead of the whole file. Is there a way to do that in org-mode? It isn't possible to include files using line numbers, as of now. Here's a quick patch that would add this feature. I have tested it with small files and works fine. Can somebody tell me if it looks good? :lines 5-10 will include the lines from 5 to 10, 10 excluded. :lines -10 will include the lines from 1 to 10, 10 excluded. :lines 5- will include the lines from 1 to the end of the file. HTH, Puneeth patch-include- lines.diff.txt___ 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 - Carsten ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Capture template and elisp expression
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/07/2011 03:03 PM, Nick Dokos wrote: Rainer M Krug r.m.k...@gmail.com wrote: But now I thought - OK - now I can add the state of the file, returned by vc-state (this is working i a nother document in the org-document). So I added: %(vc-state (buffer-file-name (org-capture-get :original-buffer))) but I get the error Capture abort: (wrong-type-argument char-or-string-p edited) It seems, that vc-state (which should be up-to-date or edited) does return a different type then vc-working-revision ? Can I convert vc-state, so that it works? Yes, vc-state returns a symbol. You can convert it to a string with symbol-name. Thanks - it's working perfectly now Cheers, Rainer Nick - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Natural Sciences Building Office Suite 2039 Stellenbosch University Main Campus, Merriman Avenue Stellenbosch South Africa Tel:+33 - (0)9 53 10 27 44 Cell: +27 - (0)8 39 47 90 42 Fax (SA): +27 - (0)8 65 16 27 82 Fax (D) : +49 - (0)3 21 21 25 22 44 Fax (FR): +33 - (0)9 58 10 27 44 email: rai...@krugs.de Skype: RMkrug -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0nI8gACgkQoYgNqgF2egpK8QCghhEbFrO6ENA93fEM8KonkB13 grwAmwas8uKA83JdoyLwXlImZtmTVtfS =h2xa -END PGP SIGNATURE- ___ 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: Capture template and elisp expression
Carsten Dominik carsten.domi...@gmail.com writes: On Jan 7, 2011, at 1:08 PM, Štěpán Němec wrote: Why aren't the %() expressions simply evaluated in the original buffer (if available)? That would solve these issues in a general way. It seems to me that there is no advantage to evaluating the expressions in the temporary capture buffer, but I'm not familiar with the code so I might be missing something. Is there a reason for that? The sexp can be used to insert stuff into the template, so I think it is correct to evaluate it in the template buffer. I don't understand this argument. Of course the _result_ of the evaluation is inserted into the template, but why is it useful to evaluate the expression itself in the context of the template buffer? Is it likely that one would be interested in some information only available in the template buffer? To me it seems that the much more likely case is the one of Rainer -- i.e. the need to access variable bindings from the original buffer (buffer name, mode, other local variables etc.). Štěpán ___ 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: Simple wiki system like VIMWiki
Forgot to add the link to VIMWiki: http://code.google.com/p/vimwiki/ Regards, Marcelo. On Thu, Jan 6, 2011 at 9:07 AM, Marcelo de Moraes Serpa celose...@gmail.com wrote: Hi list, I've started using vim lately for my programming needs and I love it, mostly because the motion and shortcuts are much more efficient. That aside, I still think emacs is a great platform and text-editor and I still use it for other stuff, mainly organizing myself (thanks to orgmode). Most of the todo/GTD stuff is well handled by org, but I do find that for reference and brainstorming, a real-time (and straightforward) wiki is the best solution. I have been managing to keep things simple by keeping all my reference org files under a (/wiki) folder and setting peepopen (an OSX cocoa fuzzy-finder (http://peepcode.com/products/peepopen)) to index specifically this folder and bound this to Command-w, and it works great for getting a quick index of the wiki and quickly open a file from it. However, linking and creating new files is far from optimal. Org-mode still tries to keep things at the headline-level, instead of at file level. This works, but for me, not so well. Why? The simple fact that org asks me if I want to create a target in the current file or in a another file already gets me out of the zone. I prefer some convetion over configuration. It'd be nice if org had, for example, a more org-like wiki (like wikinodes) and a more traditional one (like VIMwiki). Not sure if there's another mode I could combo with org that would give the functionality I want, I'm open to suggestions :) Marcelo. ___ 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] Bug: Schedule in agenda gives wrong overdue days [7.4]
Dear Sirs, For an org file containing just the two following lines: * TODO Water plants at work SCHEDULED: 2010-12-27 Mon .+1w creating an agenda with C-c a a on 2011-01-06 displays the following three lines: Day-agenda (W01): Thursday6 January 2011 org_mode_bug:Sched. 4x: TODO Water plants at work I expected is for the schedule overdue days to be 11x instead of 4x. I've attached relevant files to reproduce this result with something like emacs --no-init-file --load bug.el bug.org Kind regards, Paul Stansell Emacs : GNU Emacs 23.1.1 (i386-redhat-linux-gnu, GTK+ Version 2.18.9) of 2010-06-03 on xb-01.phx2.fedoraproject.org Package: Org-mode version 7.4 current state: == (setq org-log-done 'time org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars) org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook) org-agenda-files '(~/org/org_mode_bug/org_mode_bug.org) org-metaup-hook '(org-babel-load-in-session-maybe) org-after-todo-state-change-hook '(org-clock-out-if-current) org-export-blocks-postblock-hook '(org-exp-res/src-name-cleanup) org-export-latex-format-toc-function 'org-export-latex-format-toc-default org-tab-first-hook '(org-hide-block-toggle-maybe org-src-native-tab-command-maybe org-babel-hide-result-toggle-maybe) org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-confirm-shell-link-function 'yes-or-no-p org-export-first-hook '(org-beamer-initialize-open-trackers) org-agenda-before-write-hook '(org-agenda-add-entry-text) org-babel-pre-tangle-hook '(save-buffer) org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-export-preprocess-before-normalizing-links-hook '(org-remove-file-link-modifiers) org-mode-hook '(#[nil \300\301\302\303\304$\207 [org-add-hook change-major-mode-hook org-show-block-all append local] 5] #[nil \300\301\302\303\304$\207 [org-add-hook change-major-mode-hook org-babel-show-result-all append local] 5] org-babel-result-hide-spec org-babel-hide-all-hashes) org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe) org-confirm-elisp-link-function 'yes-or-no-p org-export-interblocks '((lob org-babel-exp-lob-one-liners) (src org-babel-exp-inline-src-blocks)) org-occur-hook '(org-first-headline-recenter) org-export-preprocess-before-selecting-backend-code-hook '(org-beamer-select-beamer-code) org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc org-beamer-auto-fragile-frames org-beamer-place-default-actions-for-lists) org-metadown-hook '(org-babel-pop-to-session-maybe) org-export-blocks '((src org-babel-exp-src-blocks nil) (comment org-export-blocks-format-comment t) (ditaa org-export-blocks-format-ditaa nil) (dot org-export-blocks-format-dot nil)) ) ;; emacs --no-init-file --load bug.el bug.org (add-to-list 'load-path ~/local/share/emacs/site-lisp) (require 'org-install) (add-to-list 'auto-mode-alist '(\\.org$ . org-mode)) (define-key global-map \C-cl 'org-store-link) (define-key global-map \C-ca 'org-agenda) (setq org-log-done t) (setq org-agenda-files (list ~/org/org_mode_bug/bug.org)) bug.org Description: Lotus Organizer ___ 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] Simple wiki system like VIMWiki
Hi list, I've started using vim lately for my programming needs and I love it, mostly because the motion and shortcuts are much more efficient. That aside, I still think emacs is a great platform and text-editor and I still use it for other stuff, mainly organizing myself (thanks to orgmode). Most of the todo/GTD stuff is well handled by org, but I do find that for reference and brainstorming, a real-time (and straightforward) wiki is the best solution. I have been managing to keep things simple by keeping all my reference org files under a (/wiki) folder and setting peepopen (an OSX cocoa fuzzy-finder (http://peepcode.com/products/peepopen)) to index specifically this folder and bound this to Command-w, and it works great for getting a quick index of the wiki and quickly open a file from it. However, linking and creating new files is far from optimal. Org-mode still tries to keep things at the headline-level, instead of at file level. This works, but for me, not so well. Why? The simple fact that org asks me if I want to create a target in the current file or in a another file already gets me out of the zone. I prefer some convetion over configuration. It'd be nice if org had, for example, a more org-like wiki (like wikinodes) and a more traditional one (like VIMwiki). Not sure if there's another mode I could combo with org that would give the functionality I want, I'm open to suggestions :) Marcelo. ___ 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-write-agenda failure
On Mac OS X 10.5.8, GNU Emacs 23.2.1, Org Mode 7.4, setting the following: (setq org-todo-keywords '((sequence TODO WAIT DONE))) (setq org-todo-keyword-faces '((WAIT . lightgoldenrod2))) has the intended effect, with WAIT items properly displayed, ... *until* I do org-write-agenda in the Agenda buffer (writing to foobar.pdf), which fails in ps-print with the stack trace shown below. (The failure is not dependent on the color chosen in the string.) Note, however, that when doing the following instead everything works: (setq org-todo-keywords '((sequence TODO WAIT DONE))) (copy-face 'org-todo 'org-wait-face) ; bug with string when doing org-write-agenda (set-face-foreground 'org-wait-face lightgoldenrod2) (setq org-todo-keyword-faces '((WAIT . org-wait-face))) In the former case (which fails), the problem appears in the call (ps-face-attribute-list '(:inherit org-todo :foreground lightgoldenrod2)) but if the property list is itself wrapped in a list as (ps-face-attribute-list '((:inherit org-todo :foreground lightgoldenrod2))) then this function does not raise an error. This seems like a bug to me, as I'm pretty sure I'm matching the documented form required for org-todo-keyword-faces (in both cases), but I could be wrong. I have not had a chance to track this down all the way, but I thought I'd pass it on in hopes it is either helpful or will help someone show me the error of my ways. Thanks for your help. The backtrace for the original problem is given below. Debugger entered--Lisp error: (wrong-type-argument listp lightgoldenrod2) ps-face-attributes(lightgoldenrod2) ps-face-attribute-list((:inherit org-todo :foreground lightgoldenrod2)) ps-plot-with-face(662 666 (:inherit org-todo :foreground lightgoldenrod2)) ps-generate-postscript-with-faces1(1 1549) ps-generate-postscript-with-faces(1 1549) ps-generate(#buffer Agenda View 1 1549 ps-generate-postscript-with-faces) ps-spool-with-faces(1 1549 nil) ps-print-with-faces(1 1549 ~/foobar.ps) ps-print-buffer-with-faces(~/foobar.ps) (cond ((org-bound-and-true-p org-mobile-creating-agendas) (org-mobile-write-agenda-for-mobile file)) ((string-match \\.html?\\' file) (require ...) (set-buffer ...) (when ... ... ... ...) (write-file file) (kill-buffer ...) (message HTML written to %s file)) ((string-match \\.ps\\' file) (require ...) (ps-print-buffer-with-faces file) (message Postscript written to %s file)) ((string-match \\.pdf\\' file) (require ...) (ps-print-buffer-with-faces ...) (call-process ps2pdf nil nil nil ... ...) (delete-file ...) (message PDF written to %s file)) ((string-match \\.ics\\' file) (require ...) (let ... ...)) (t (let ... ... ... ... ... ... ...))) (progn (rename-buffer Agenda View t) (set-buffer-modified-p nil) (insert bs) (org-agenda-remove-marked-text (quote org-filtered)) (while (setq beg ...) (delete-region beg ...)) (run-hooks (quote org-agenda-before-write-hook)) (cond (... ...) (... ... ... ... ... ... ...) (... ... ... ...) (... ... ... ... ... ...) (... ... ...) (t ...))) (unwind-protect (progn (rename-buffer Agenda View t) (set-buffer-modified-p nil) (insert bs) (org-agenda-remove-marked-text ...) (while ... ...) (run-hooks ...) (cond ... ... ... ... ... ...)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ... ... ... ... ... ... ...) (and ... ...))) (with-current-buffer temp-buffer (unwind-protect (progn ... ... ... ... ... ... ...) (and ... ...))) (let ((temp-buffer ...)) (with-current-buffer temp-buffer (unwind-protect ... ...))) (with-temp-buffer (rename-buffer Agenda View t) (set-buffer-modified-p nil) (insert bs) (org-agenda-remove-marked-text (quote org-filtered)) (while (setq beg ...) (delete-region beg ...)) (run-hooks (quote org-agenda-before-write-hook)) (cond (... ...) (... ... ... ... ... ... ...) (... ... ... ...) (... ... ... ... ... ...) (... ... ...) (t ...))) (let ((bs ...) beg) (org-agenda-unmark-filtered-text) (with-temp-buffer (rename-buffer Agenda View t) (set-buffer-modified-p nil) (insert bs) (org-agenda-remove-marked-text ...) (while ... ...) (run-hooks ...) (cond ... ... ... ... ... ...))) (save-window-excursion (org-agenda-mark-filtered-text) (let (... beg) (org-agenda-unmark-filtered-text) (with-temp-buffer ... ... ... ... ... ... ...))) (save-excursion (save-window-excursion (org-agenda-mark-filtered-text) (let ... ... ...))) (let nil (save-excursion (save-window-excursion ... ...)) #buffer *Org Agenda*) eval((let nil (save-excursion (save-window-excursion ... ...)) #buffer *Org Agenda*)) org-let(nil (save-excursion (save-window-excursion (org-agenda-mark-filtered-text) (let ... ... ...))) #buffer *Org Agenda*) org-write-agenda(~/foobar.pdf) ___
[Orgmode] [PATCH] Markup on same line as text
I just discovered a problem with colorization and references in code snippets due to the way org-mode and htmlize interact. Consider the org-mode fragment: #+BEGIN_SRC emacs-lisp (let ((x 42)) ; meaning of l.u.e. (print x)) ; (ref:2) #+END_SRC Without the reference on line 2, doing an org-export-as-html would generate markup like this: (let ((x 42)) span style=comment; meaning of l.u.e. /span (print x)) Note that htmlize put the newline character on the end of the first line together with the text of the comment, both which is put inside the span. The closing tag of the span to colorize the comment thus ends up on the next line. When a reference is put on the next line, org-mode will subsequently add markup to highlight each line, so the markup ends up like this: (let ((x 42)) span style=comment; meaning of l.u.e. span id=ref-2/span (print x))/span ^^^ The first closing tag is really the end of the comment which is spilled to the next line, but it erraneously closes the id span. The color of the comment then proceeds to the end of the second line, where the id span was to close. To remedy this, I wrote a patch which postpone writing the newline to the html buffer until after the closing tag has been emitted. The patch is attached and should be applicable to the current Git repository. It should be applicable to version 1.37 of htmlize.el as well, with the command `patch -p3 0001-Markup-on-same-line-as-text.patch`. I refactored the insert-text functions so that they return the markup that should be applied instead of doing the insertion itself, and then let this go through a new function add-markup which puts the tags around the text, putting any trailing newline in the text at the very end, before the main htmlize-buffer-1 does the actual insertion in the buffer. I have tested this with all three kinds of htmlize-output-type, and it seems to give the expected result. -- Roland. From 86f1508f58dd304471d768481944d34e220e24f1 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann rlndkfmn+orgm...@gmail.com Date: Thu, 6 Jan 2011 11:22:49 +0100 Subject: [PATCH] Markup on same line as text MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=1.7.3.1.msysgit.0 This is a multi-part message in MIME format. --1.7.3.1.msysgit.0 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit * contrib/lisp/htmlize.el: Markup on same line as text Newline was considered to be a part of the text to be marked up; thus the closing tag was put on the next line. Since org-mode does line processing on the result, the line number span was closed prematurely by this tag and the formatting erraneously extended through the next line. This fix replaces the insert-text functions with new get-markup variants which return a pair (start-tag end-tag) for the appropriate formatting. The newline is then removed from the text with `split-trailing-newline` and appended again after the close tag in `add-markup`. The text is sent to the buffer after this processing instead of in each behavioral insert-text function. The names of the functions are changed so reflect that the signatures are different. --- contrib/lisp/htmlize.el | 67 ++- 1 files changed, 37 insertions(+), 30 deletions(-) --1.7.3.1.msysgit.0 Content-Type: text/x-patch; name=0001-Markup-on-same-line-as-text.patch Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename=0001-Markup-on-same-line-as-text.patch diff --git a/contrib/lisp/htmlize.el b/contrib/lisp/htmlize.el index 5f4cb5b..f952b80 100644 --- a/contrib/lisp/htmlize.el +++ b/contrib/lisp/htmlize.el @@ -1209,7 +1209,7 @@ property and by buffer overlays that specify `face'. ;; `htmlize-buffer-1' calls a number of methods, which indirect to ;; the functions that depend on `htmlize-output-type'. The currently ;; used methods are `doctype', `insert-head', `body-tag', and -;; `insert-text'. Not all output types define all methods. +;; `get-markup'. Not all output types define all methods. ;; ;; Methods are called either with (htmlize-method METHOD ARGS...) ;; special form, or by accessing the function with @@ -1347,18 +1347,18 @@ it's called with the same value of KEY. All other times, the cached (insert htmlize-hyperlink-style --\n/style\n)) -(defun htmlize-css-insert-text (text fstruct-list buffer) - ;; Insert TEXT colored with FACES into BUFFER. In CSS mode, this is - ;; easy: just nest the text in one span class=... tag for each - ;; face in FSTRUCT-LIST. - (dolist (fstruct fstruct-list) -(princ span class=\ buffer) -(princ (htmlize-fstruct-css-name fstruct) buffer) -(princ \ buffer)) - (princ text buffer) - (dolist (fstruct fstruct-list) -(ignore fstruct) ; shut up the byte-compiler -(princ /span buffer))) +(defun htmlize-css-get-markup
[Orgmode] Re: Simple wiki system like VIMWiki
Is no one interested in such feature? Marcelo. On Thu, Jan 6, 2011 at 10:22 AM, Marcelo de Moraes Serpa celose...@gmail.com wrote: Forgot to add the link to VIMWiki: http://code.google.com/p/vimwiki/ Regards, Marcelo. On Thu, Jan 6, 2011 at 9:07 AM, Marcelo de Moraes Serpa celose...@gmail.com wrote: Hi list, I've started using vim lately for my programming needs and I love it, mostly because the motion and shortcuts are much more efficient. That aside, I still think emacs is a great platform and text-editor and I still use it for other stuff, mainly organizing myself (thanks to orgmode). Most of the todo/GTD stuff is well handled by org, but I do find that for reference and brainstorming, a real-time (and straightforward) wiki is the best solution. I have been managing to keep things simple by keeping all my reference org files under a (/wiki) folder and setting peepopen (an OSX cocoa fuzzy-finder (http://peepcode.com/products/peepopen)) to index specifically this folder and bound this to Command-w, and it works great for getting a quick index of the wiki and quickly open a file from it. However, linking and creating new files is far from optimal. Org-mode still tries to keep things at the headline-level, instead of at file level. This works, but for me, not so well. Why? The simple fact that org asks me if I want to create a target in the current file or in a another file already gets me out of the zone. I prefer some convetion over configuration. It'd be nice if org had, for example, a more org-like wiki (like wikinodes) and a more traditional one (like VIMwiki). Not sure if there's another mode I could combo with org that would give the functionality I want, I'm open to suggestions :) Marcelo. ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Simple wiki system like VIMWiki
I'm interested. - Jeongtae 2011/1/7 Marcelo de Moraes Serpa celose...@gmail.com Hi list, I've started using vim lately for my programming needs and I love it, mostly because the motion and shortcuts are much more efficient. That aside, I still think emacs is a great platform and text-editor and I still use it for other stuff, mainly organizing myself (thanks to orgmode). Most of the todo/GTD stuff is well handled by org, but I do find that for reference and brainstorming, a real-time (and straightforward) wiki is the best solution. I have been managing to keep things simple by keeping all my reference org files under a (/wiki) folder and setting peepopen (an OSX cocoa fuzzy-finder (http://peepcode.com/products/peepopen)) to index specifically this folder and bound this to Command-w, and it works great for getting a quick index of the wiki and quickly open a file from it. However, linking and creating new files is far from optimal. Org-mode still tries to keep things at the headline-level, instead of at file level. This works, but for me, not so well. Why? The simple fact that org asks me if I want to create a target in the current file or in a another file already gets me out of the zone. I prefer some convetion over configuration. It'd be nice if org had, for example, a more org-like wiki (like wikinodes) and a more traditional one (like VIMwiki). Not sure if there's another mode I could combo with org that would give the functionality I want, I'm open to suggestions :) Marcelo. ___ 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 ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: Simple wiki system like VIMWiki
Marcelo de Moraes Serpa celose...@gmail.com wrote: Is no one interested in such feature? Just an fyi: I don't know whether it's generally the case, but I received your original mail (with date Thu, 6 Jan 2011 09:07:57 -0600) at the same time as I received your follow-up (with date Fri, 7 Jan 2011 09:03:46 -0600), so either the original mail was hung up at your end or it was hung up on the list server or some other unfortunate event happened. In any case, even if I were interested, I would have had no time to consider it. Regards, Nick ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: Simple wiki system like VIMWiki
Nick Dokos nicholas.do...@hp.com wrote: Marcelo de Moraes Serpa celose...@gmail.com wrote: Is no one interested in such feature? Just an fyi: I don't know whether it's generally the case, but I received your original mail (with date Thu, 6 Jan 2011 09:07:57 -0600) at the same time as I received your follow-up (with date Fri, 7 Jan 2011 09:03:46 -0600), so either the original mail was hung up at your end or it was hung up on the list server or some other unfortunate event happened. In any case, even if I were interested, I would have had no time to consider it. Looking at it more closely, it seems to have kicked around the list server for 24 hours: , | ... | Received: from localhost ([127.0.0.1]:56564 helo=lists.gnu.org) | by lists.gnu.org with esmtp (Exim 4.43) | id 1PbE8I-0002JO-KX | for nicholas.do...@hp.com; Fri, 07 Jan 2011 10:21:38 -0500 | Received: from [140.186.70.92] (port=54242 helo=eggs.gnu.org) | by lists.gnu.org with esmtp (Exim 4.43) id 1ParRh-0003Vq-78 | for emacs-orgmode@gnu.org; Thu, 06 Jan 2011 10:08:17 -0500 | ... ` Nick ___ 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] [babel] How to fontify blocks other than begin_src?
I would like blocks like begin_html/end_html to be fontified just like begin_src blocks are. I would also like to define my own source blocks for clojure (basically a shorthand) and also have them highlighted. Heres what i have to turn on fontifying and define a block. (setq org-src-fontify-natively t) ;; define #+clj as start of clojure code block and #+end as end of block (add-to-list 'org-edit-src-region-extra '(^[ \t]*#\\+clj.*\n \n[ \t]*#\\+end clojure)) Ive also noticed that the code block (#+clj ... #+end) doesnt fold - however, if i define the block as begin_clj and end_clj it will fold, so im guessing org assumes a certain block format for folding code. Any way to do the above two things? ___ 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] [PATCH] org-display-inline-images to reduce image size
Here's a patch that introduces two custom options org-display-inline-image-width, org-display-inline-image-height and patches org-display-inline-images to respect them as max width, height settings for inline images. (Someone please defcustom them for me, I only know defvar syntax). org-display-inline-images uses overlay-put. (iimage.el uses text-properties, which are recommended in emacs). (The refs below are (elisp) info nodes.) Both overlays and text-properties use Display Property, Other Display Specifications to setup an image. Of all Image formats, only ImageMagick Images (maybe XBM and PS) support scaling. That is, IF you build Emacs with ImageMagick (a big if indeed!) So the patch uses scaling if (fboundp 'imagemagick-types) and in this case you must call (imagemagick-register-types) in your .emacs; else it uses a slice the top left corner (cropping the rest). diff --git a/doc/org.texi b/doc/org.texi index 96ea986..9e1c5cf 100755 --- a/doc/org.texi +++ b/doc/org.texi @@ -3266,13 +3266,31 @@ variable @code{org-display-internal-link-with-indirect- buffer}}. @vindex org-startup-with-inline-images @cindex @code{inlineimages}, STARTUP keyword @cindex @code{noinlineimages}, STARTUP keyword -Toggle the inline display of linked images. Normally this will only inline +Toggle the inline display of linked images. +Works only for links that start with @code{file:}, +. (current dir), / (root dir) or ~ (home dir). +Normally this will only inline images that have no description part in the link, i.e. images that will also be inlined during export. When called with a prefix argument, also display images that do have a link description. You can ask for inline images to be displayed at startup by configuring the variable @code{org-startup-with-inline-imag...@footnote{with corresponding @code{#+STARTUP} keywords @code{inlineimages} and @code{inlineimages}}. + +...@vindex org-display-inline-image-width +...@vindex org-display-inline-image-height +Maximum image size that Orgmode will display inline. Images are reduced by EITHER: +...@itemize @bullet +...@itemize Scaling down: supported when Emacs is compiled with ImageMagic, in which case + the function @code{imagemagick-types} is bound. You should invoke + @code{(imagemagick-register-types)} in your @code{.emacs}, OR +...@itemize Slicing the top left corner and cropping the rest +...@end itemize +Integer specifies maximum number of pixels. +Floating number specifies maximum ratio to the frame width/height respectively. +nil places no restriction on the respective dimension. +If both are set, scaling can distort the aspect ratio + @orgcmd{C-c %,org-mark-ring-push} @cindex mark ring Push the current position onto the mark ring, to be able to return Modified lisp/org.el diff --git a/lisp/org.el b/lisp/org.el index 53039e4..836286c 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -16156,6 +16156,55 @@ INCLUDE-LINKED is passed to `org-display-inline- images'. (length org-inline-image-overlays)) (message No images to display inline +;; TODO: defcustom +(defvar org-display-inline-image-width nil +*Maximum image width that Orgmode will display inline. +Images are reduced by: +- Scaling down: supported when Emacs is compiled with ImageMagic, in which case + (fboundp 'imagemagick-types). You should invoke (imagemagick-register-types) in .emacs. +- Otherwise: slicing the top left corner and cropping the rest +Integer specifies maximum number of pixels. +Floating point specifies maximum ratio to the frame width. +nil places no restriction. +If both org-display-inline-image-width and org-display-inline-image-height are set, +scaling can distort the aspect ratio) + +;; TODO: defcustom +(defvar org-display-inline-image-height nil +*Maximum image height that Orgmode will display inline. +Works similarly to org-display-inline-image-width, which see.) + +;; TODO tested only in GNU Emacs 24.0.50.1 +;; TODO scaling not tested (don't have ImageMagick)! +(defun org-display-inline-images-scale-or-slice (img) + ;; Return eventually scaled or sliced down version of image IMG. + ;; Scaling is an image property (after 'image) + ;; Slicing is a display property (for overlay or text-property) (before 'image). + (when (or org-display-inline-image-width org-display-inline-image-height) +(let (c w h width height width height) + (setq c (image-size img 'pixels)) + (setq w (car c) h (cdr c)) + (setq width (cond + ((integerp org-display-inline-image-width) +org-display-inline-image-width) + ((floatp org-display-inline-image-width) +(truncate (* org-display-inline-image-width (frame-pixel- width)) + (setq height (cond +((integerp org-display-inline-image-height) + org-display-inline-image-height) +((floatp org-display-inline-image-height) +
[Orgmode] Images from R in LaTeX and PDF
Hi All, I've been doing some work with babel and R to generate graphs that I've then been including useing attr latex. But when I include images the always appear very very small, even when I mess about with the width settings of the attr latex line and remove the options for wrap and such. Does anybody else use R with images and org, and could tell me how they handle including R graphics in their documents? Thanks, Ben. W ___ 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: noob question about word wrap
Hi again. I send the msg below a few weeks ago, and got a reasonable response from Ross Glover. However, I'm still convinced that I would prefer to try orgmode with different word wrapping. I'm looking for a way to get orgmode buffers to be in visual-line-mode and org-indent-mode only. That is, I'm looking to turn off truncate-lines and auto-fill-mode. Can anyone point me in the right direction? Much obliged. Cheers. Fil Salustri On 25 December 2010 00:30, Filippo A. Salustri salus...@ryerson.ca wrote: Hi, I'm new to org-mode (though I've been a causal emacs user for more than 10 yrs). I'm running org 7.4 on the current Aquamacs, and I prefer larger than normal windows (120 col x 36 rows). The problem is that org seems to do hard auto-fill linebreaks regardless of window size. I have honestly looked everywhere I can think of for a solution. The only thing I've figured out is that if org buffers seem to be set to org-indent-mode, truncate-lines, auto-fill-mode, and visual-line-mode. I seem to get the effect I desire if there's only visual-line-mode and org-indent-mode. I can set these via the menu, but I want this to be the global org way. So the question is: How can I turn off truncate-lines and auto-fill-mode globally for all org files? Cheers. Fil Salustri -- Filippo A. Salustri, Ph.D., P.Eng. Mechanical and Industrial Engineering Ryerson University 350 Victoria St, Toronto, ON M5B 2K3, Canada Tel: 416/979-5000 ext 7749 Fax: 416/979-5265 Email: salus...@ryerson.ca http://deseng.ryerson.ca/~fil/ -- Filippo A. Salustri, Ph.D., P.Eng. Mechanical and Industrial Engineering Ryerson University 350 Victoria St, Toronto, ON M5B 2K3, Canada Tel: 416/979-5000 ext 7749 Fax: 416/979-5265 Email: salus...@ryerson.ca http://deseng.ryerson.ca/~fil/ ___ 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-mode table with backslash inside fails to export to DocBook (now right)
Hi list, Baoqiu, A file with the following contents fails to export to Docbook: #+begin_src org ,* Table with a backslash in it , | \ | #+end_src It gives the following error #+begin_example Invalid use of `\' in replacement text #+end_example The following changes (replace-match literally in `org-export-docbook-finalize-table') solves this problem for me, but I would not know whether this would break anything else. #+begin_src diff diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el index 91ebb97..ed835b0 100644 --- a/lisp/org-docbook.el +++ b/lisp/org-docbook.el @@ -1367,7 +1367,7 @@ TABLE is a string containing the HTML code generated by (match-string 1 table) (match-string 4 table) /table) -nil nil table) +nil t table) table)) ;; Change table into informaltable if caption does not exist. (if (string-match @@ -1377,7 +1377,7 @@ TABLE is a string containing the HTML code generated by (match-string 1 table-with-label) (match-string 3 table-with-label) /informaltable) - nil nil table-with-label) + nil t table-with-label) table-with-label))) ;; Note: This function is very similar to #+end_src Regards, Niels. (note: i inadvertently posted a multi-mime message before this one, playing with org-mime-subtree, please forget that one) -- http://pft.github.com ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Images from R in LaTeX and PDF
Aloha Ben, Can you share an example that doesn't work for you? All the best, Tom On Jan 7, 2011, at 7:23 AM, Ben Ward wrote: Hi All, I've been doing some work with babel and R to generate graphs that I've then been including useing attr latex. But when I include images the always appear very very small, even when I mess about with the width settings of the attr latex line and remove the options for wrap and such. Does anybody else use R with images and org, and could tell me how they handle including R graphics in their documents? Thanks, Ben. W ___ 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 ___ 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: Simple wiki system like VIMWiki
Marcelo de Moraes Serpa celose...@gmail.com writes: However, linking and creating new files is far from optimal. Could you please explain what you mean here? I find C-u C-c C-l to be a very efficient way of creating file links (both to new and existing files). Also, the following two settings make it quite easy to open new links: (setq org-return-follows-link t) (setq org-open-non-existing-files t) Org-mode still tries to keep things at the headline-level, instead of at file level. Again, could you please explain what you mean by this? The following instructions will make org behave less like an outline and more like a tradition wiki (such as muse mode): 1. Create links with C-u C-c C-l (even better: rebind this to something simpler). 2. Use the settings above to open links easily. 3. [Optional] Set org-startup-folded to nil for a full-page view. 4. [Optional] Create a single wrapper function that creates a new link, opens the file, and adds the file to the list of agenda files. And since org-mode supports inline images and all sorts of hyperlinks, this will provide everything necessary for a nice wiki system. Well, almost everything I suppose the last step would be to modify org-wikinodes to allow CamelCase links to files. Best, Matt ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [babel] How to fontify blocks other than begin_src?
Hi Seth, The easiest way to fontify embedded html is most likely to wrap the html in #+begin_src html code blocks. As for defining your own clojure blocks that sounds like a risky proposition to me. All of the code block evaluation functions are built to use standard org-mode syntax for code blocks, e.g. #+begin_src lang. That said you can easily use clj as an alias for clojure in your code blocks, use the following elisp code to add this alias to org-src-lang-modes #+begin_src emacs-lisp (add-to-list 'org-src-lang-modes '(clj . clojure)) #+end_src Once that is done you will notice clj blocks like the one below are fontified. Also, after pulling the latest version of Org-mode (I just made a small change to make this possible), it is also possible to evaluate #+begin_src clj blocks as though they were regular clojure blocks. #+begin_src clj (map (partial + 1) (range 20)) #+end_src Hope this helps -- Eric Seth Burleigh wbur...@gmail.com writes: I would like blocks like begin_html/end_html to be fontified just like begin_src blocks are. I would also like to define my own source blocks for clojure (basically a shorthand) and also have them highlighted. Heres what i have to turn on fontifying and define a block. (setq org-src-fontify-natively t) ;; define #+clj as start of clojure code block and #+end as end of block (add-to-list 'org-edit-src-region-extra '(^[ \t]*#\\+clj.*\n \n[ \t]*#\\+end clojure)) Ive also noticed that the code block (#+clj ... #+end) doesnt fold - however, if i define the block as begin_clj and end_clj it will fold, so im guessing org assumes a certain block format for folding code. Any way to do the above two things? ___ 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 ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: Simple wiki system like VIMWiki
I'd think org could do anything needed for this. I know Marcelo asked about separate files, but in principle, a command can allow ido to help select olpaths, for ease of use. In principle, it can even create a header and refile it using ido to a suitable location, and put an org ID link to it at point. Offhand I don't know of an existing way of doing this. To get even fancier, agenda can search for the current node's ID -- or (for excellent fanciness) any other designator in any mode such as capture recognizes -- so that you have the equivalent of a reverse link without having to explicitly create a bidirectional link. I wrote something about this possibility and can dredge it up if there is interest. Samuel -- The Kafka Pandemic: http://thekafkapandemic.blogspot.com I support WPI: http://www.wpinstitute.org/xmrv/index.html -- PLEASE DONATE === I want to see the original (pre-hold) Lo et al. 2010 NIH/FDA/Harvard MLV paper. ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: Including current time in agenda
Hi all, thanks for this very nice feature. It's working mostly for me, but now, whenever I try to insert a 'date, deadline,scheduled date' I get an error saying: Symbol's value as variable is void: date which I don't quite understand. Any ideas? Thanks, Erik On Sun, Dec 12, 2010 at 10:31 PM, Matt Lundin m...@imapmail.org wrote: Eric S Fraga e.fr...@ucl.ac.uk writes: Carsten Dominik carsten.domi...@gmail.com writes: [...] I agree that this is creative and great. However having the current time in the time grid is so useful that I have now made it the default, no diary sexp needed. Thanks for this, Carsten. I like being able to change the face easily (in my case, I simply set it to underline with no agenda string to keep a minimalist approach). However, there is one problem (?): if I change my view to another day (using, say, j in the agenda day view), I get the current time highlighted for that other day and obviously the current time makes no sense other than for today, I would argue. The patch below fixes the issue for me. Best, Matt --8---cut here---start-8--- diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index fb26ee9..67c8d89 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -5353,7 +5353,7 @@ The modified list may contain inherited tags, and tags matched by new) (put-text-property 2 (length (car new)) 'face 'org-time-grid (car new - (when org-agenda-show-current-time-in-grid + (when (and todayp org-agenda-show-current-time-in-grid) (push (org-format-agenda-item nil org-agenda-current-time-string --8---cut here---end---8--- ___ 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 ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Images from R in LaTeX and PDF
#+begin_src R :exports both full - read.csv(file=~/Documents/BSc Biology/Third Year/BY6001-40 - Dissertation/Data and Analysis/Evolution Results.csv, head=T) library(lattice) ecoli = subset(full, Bacterium==E.coli) edett = subset(ecoli, Cleaner==Dettol) egarl = subset(ecoli, Cleaner==Garlic) MIC.mod = lm(MIC. ~ 1+Challenge*Cleaner*Replicate, data=ecoli) #+end_src #+begin_src R :file fig1.pdf xyplot( MIC.+fitted(MIC.mod) ~ Challenge, data=ecoli, xlab=Challenge, ylab=MIC %, auto.key=TRUE) #+end_src #+attr_latex: width=0.6\textwidth wrap placement={h}{0.4\textwidth} #+label: fig:one #+caption: Linar Plot of real data and fitted model values #+results: fig1 [[file:fig1.pdf]] In the case of this code, actually altering size works, but it keeps putting the image at the end of my document. Then other images, placed with pretty much the same code, give or take for filenames and such, won't increace in size, but will alter their movement. I'm wondering if using pure latex for my images would be an easier solution. Cheers, Ben. On 07/01/2011 18:30, Thomas S. Dye wrote: Aloha Ben, Can you share an example that doesn't work for you? All the best, Tom On Jan 7, 2011, at 7:23 AM, Ben Ward wrote: Hi All, I've been doing some work with babel and R to generate graphs that I've then been including useing attr latex. But when I include images the always appear very very small, even when I mess about with the width settings of the attr latex line and remove the options for wrap and such. Does anybody else use R with images and org, and could tell me how they handle including R graphics in their documents? Thanks, Ben. W ___ 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 ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Images from R in LaTeX and PDF
I'm using 7.4, which I think (unless a new versions recently arisen), the latest one, as it was recommended for interacting with R through babel. Thanks, Ben W. On 07/01/2011 19:45, Erik Iverson wrote: And what version of org are you using? Ben Ward wrote: #+begin_src R :exports both full - read.csv(file=~/Documents/BSc Biology/Third Year/BY6001-40 - Dissertation/Data and Analysis/Evolution Results.csv, head=T) library(lattice) ecoli = subset(full, Bacterium==E.coli) edett = subset(ecoli, Cleaner==Dettol) egarl = subset(ecoli, Cleaner==Garlic) MIC.mod = lm(MIC. ~ 1+Challenge*Cleaner*Replicate, data=ecoli) #+end_src #+begin_src R :file fig1.pdf xyplot( MIC.+fitted(MIC.mod) ~ Challenge, data=ecoli, xlab=Challenge, ylab=MIC %, auto.key=TRUE) #+end_src #+attr_latex: width=0.6\textwidth wrap placement={h}{0.4\textwidth} #+label: fig:one #+caption: Linar Plot of real data and fitted model values #+results: fig1 [[file:fig1.pdf]] In the case of this code, actually altering size works, but it keeps putting the image at the end of my document. Then other images, placed with pretty much the same code, give or take for filenames and such, won't increace in size, but will alter their movement. I'm wondering if using pure latex for my images would be an easier solution. Cheers, Ben. On 07/01/2011 18:30, Thomas S. Dye wrote: Aloha Ben, Can you share an example that doesn't work for you? All the best, Tom On Jan 7, 2011, at 7:23 AM, Ben Ward wrote: Hi All, I've been doing some work with babel and R to generate graphs that I've then been including useing attr latex. But when I include images the always appear very very small, even when I mess about with the width settings of the attr latex line and remove the options for wrap and such. Does anybody else use R with images and org, and could tell me how they handle including R graphics in their documents? Thanks, Ben. W ___ 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 ___ 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 ___ 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] IMPORTANT: Migration of org-mode.git to the new server on sunday 5pm-7pm CET (UTC+1)
Dear all, Jason will migrate org-mode.git to the new server next sunday, 5pm-7pm CET (UTC+1). Pulling will not be possible during that time. I will send instructions on how to clone the new repo when the migration is done. It will be important to clone again after the migration as this repo comes with a major change: there is no ORGWEBPAGES/ directory anymore. We have moved ORGWEBPAGES/ in a separate repo, which might get public later. http://repo.or.cz/w/org-mode.git will still exist as a mirror, we will install this next week. Thanks! -- Bastien ___ 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: IMPORTANT: Migration of org-mode.git to the new server on sunday 5pm-7pm CET (UTC+1)
Bastien bastien.gue...@wikimedia.fr writes: Dear all, Jason will migrate org-mode.git to the new server next sunday, 5pm-7pm CET (UTC+1). Pulling will not be possible during that time. I will send instructions on how to clone the new repo when the migration is done. It will be important to clone again after the migration as this repo comes with a major change: there is no ORGWEBPAGES/ directory anymore. We have moved ORGWEBPAGES/ in a separate repo, which might get public later. http://repo.or.cz/w/org-mode.git will still exist as a mirror, we will install this next week. Thanks! Hi Bastien, Is it really necessary to rebuild the org-mode git repository (with filter-branch) to remove the ORGWEBPAGES/ content. Anyone with a clone and local branches of the existing repository will need to move all of these to the new repository. Would creating a commit to remove the ORGWEBPAGES directory in the existing repository not work just as well? This will keep all of the existing SHA1s for historical commits intact. If you remove the ORGWEBPAGES directory with just a commit in the org-mode repository then the SHA1's of previous commits will not change and we can just change the URL to point at the new server and we're done. Regards, Bernt ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [babel] How to fontify blocks other than begin_src?
Thanks, it does. Yep, i looked at the code, and everything was based on begin_src - so i think i will keep it at that! ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: Including current time in agenda
On Fri, Jan 7, 2011 at 11:31 AM, Erik Butz erik.b...@googlemail.com wrote: Hi all, thanks for this very nice feature. It's working mostly for me, but now, whenever I try to insert a 'date, deadline,scheduled date' I get an error saying: Symbol's value as variable is void: date which I don't quite understand. Any ideas? I have been using it without any problems so far. Could you elaborate a little on how you are trying to use it? I just set these variables, (both are optional though, defaults should work out of the box) (setq org-agenda-current-time-string - - - NOW! - - - org-agenda-time-grid '((daily today) (800 1000 1200 1400 1600 1800 2000))) Thanks, Erik -- Suvayu Open source is the future. It sets us free. ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: Including current time in agenda
I have (defun jd:org-current-time () Return current-time if date is today. (when (equal date (calendar-current-date)) (format-time-string %H:%M ◄—— (current-time in the .emacs file and and entry * Current Time :PROPERTIES: :CATEGORY: NOW ——► :END: %%(org-current-time) in one of my .org files. That's about all I did. Any clues from this? Thanks, Erik On Sat, Jan 8, 2011 at 12:27 AM, suvayu ali fatkasuvayu+li...@gmail.com wrote: On Fri, Jan 7, 2011 at 11:31 AM, Erik Butz erik.b...@googlemail.com wrote: Hi all, thanks for this very nice feature. It's working mostly for me, but now, whenever I try to insert a 'date, deadline,scheduled date' I get an error saying: Symbol's value as variable is void: date which I don't quite understand. Any ideas? I have been using it without any problems so far. Could you elaborate a little on how you are trying to use it? I just set these variables, (both are optional though, defaults should work out of the box) (setq org-agenda-current-time-string - - - NOW! - - - org-agenda-time-grid '((daily today) (800 1000 1200 1400 1600 1800 2000))) Thanks, Erik -- Suvayu Open source is the future. It sets us free. ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: Including current time in agenda
Hi Erik, On Fri, Jan 7, 2011 at 3:46 PM, Erik Butz erik.b...@googlemail.com wrote: I have (defun jd:org-current-time () Return current-time if date is today. (when (equal date (calendar-current-date)) (format-time-string %H:%M ◄—— (current-time in the .emacs file and and entry * Current Time :PROPERTIES: :CATEGORY: NOW ——► :END: %%(org-current-time) in one of my .org files. That's about all I did. To get the current time, you don't need to do that any more. After Carsten's change org shows that by default. Just remove that entry from your agenda file and if you have any entries for today, the current time shows up as NOW by default. You can even customise the face by customising the face `org-agenda-current-time'. As for your problem with your current setup, I think the problem is you call the incorrect sexp. The entry should be, %%(jd:org-current-time) Any clues from this? Thanks, Erik Hope this helps -- Suvayu Open source is the future. It sets us free. ___ 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