Re: [Orgmode] suggestion/feature-request for dynamic blocks
On 9/21/2010 11:41 AM, Eric Schulte wrote: Tables created by named code block are already prefixed with a #+results: source-name line. This allows them to be referenced by other code blocks. Is there some property of #+tblname: lines which is not shared by #+results: lines which would make #+tblname: lines preferable? Sorry for the terminology confusion. I was referring to the dynamic code block features of org-mode such as org-dblock-write:columnview or org-update-dblock. Such functions take a pair of lines like #+BEGIN: columnview :hlines 1 :id local :maxlevel 4 #+END: and fill them in with information automatically extracted from the org-mode file. I would like to be able to specify something like #+BEGIN: columnview :hlines 1 :id local :maxlevel 4 :dtname #+END: and have a #+TBLNAME get inserted in automatically so that I can then use org-babel to further process the results. I think things like this would be useful for all the various kinds of org-dblock-write: functions and so suggested a generic library for writers of org-dblock-write: functions to handle things like this. Thanks, -I.S. ___ 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] proposal for enhanced org-get-priority function
Dear Experts, I'd like to propose a replacement for the org-get-priority function which is backward compatible with the current version but allows the user to add a sub-priority such as [#A]-5 or [#B]+3: (defun org-get-priority (s) "Find priority cookie and return priority. Priorities of the form [#]- or [#]+ are supported with +/- being optional and modifying the letter priority. The letter priority is multiplied by 10 and then the number priority is added on. Thus a priority string of [#B]+5 is higher than [#B] which is higher than [#B]-2 and all are lower than [#A]. The number sub-priorities allow finer control of sorting in org agendas. " (save-match-data (let* ((priority-match (string-match org-priority-regexp s)) (priority-value (if priority-match (* 10 (- org-lowest-priority (string-to-char (match-string 2 s (* 10 (- org-lowest-priority org-default-priority (sub-priority-match (match-string 3 s)) (sub-priority-value (if sub-priority-match (string-to-number sub-priority-match) 0))) (+ priority-value sub-priority-value ___ 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] proposal for enhanced org-get-priority function
On 10/24/2010 3:18 PM, David Maus wrote: At Wed, 20 Oct 2010 13:14:39 -0400, I.S. wrote: Dear Experts, I'd like to propose a replacement for the org-get-priority function which is backward compatible with the current version but allows the user to add a sub-priority such as [#A]-5 or [#B]+3: Could you provide a patch against current master and send it to the list as a text/plain attachment? This way the proposed modification will end up in Org's patchtracker[1]. Best, -- David [1] http://patchwork.newartisans.com/project/org-mode/ -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de I tried looing at patchwork but couldn't figure out what I was supposed to do. Please advise on usage instructions. Instead, I attached a manually generated patch against org.el in the development version from git. I created this patch via $ git clone git://repo.or.cz/org-mode.git $ emacs org-mode/lisp/org.el # to modify the file and write it to org.mine.el $ diff -rup org.el org.mine.el > org-get-priority.patch Please advise on proper procedure as I love org and would enjoy the chance to contribute in the future. Thanks, -I.S. e...@martinian.com's password: --- org.el 2010-10-27 07:47:50.702497227 -0400 +++ org.mine.el 2010-10-27 07:48:59.090619203 -0400 @@ -12211,13 +12211,27 @@ ACTION can be `set', `up', `down', or a (message "Priority of current item set to %s" news (defun org-get-priority (s) - "Find priority cookie and return priority." - (save-match-data -(if (not (string-match org-priority-regexp s)) - (* 1000 (- org-lowest-priority org-default-priority)) - (* 1000 (- org-lowest-priority -(string-to-char (match-string 2 s))) + "Find priority cookie and return priority. +Priorities of the form [#]- or +[#]+ are supported with +/- being +optional and modifying the letter priority. The letter priority +is multiplied by 10 and then the number priority is added +on. Thus a priority string of [#B]+5 is higher than [#B] which is +higher than [#B]-2 and all are lower than [#A]. +" + (save-match-data +(let* ((priority-match (string-match org-priority-regexp s)) + (priority-value (if priority-match + (* 10 (- org-lowest-priority + (string-to-char (match-string 2 s + (* 10 (- org-lowest-priority +org-default-priority + (sub-priority-match (match-string 3 s)) + (sub-priority-value (if sub-priority-match + (string-to-number sub-priority-match) 0))) + (+ priority-value sub-priority-value + Tags (defvar org-agenda-archives-mode) ___ 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] proposal for enhanced org-get-priority function
Sorry, I realized the previous patch did not contain updates to the org-priority-regexp. An updated patch is attached. Sorry, -I.S. On 10/27/2010 8:01 AM, I.S. wrote: On 10/24/2010 3:18 PM, David Maus wrote: At Wed, 20 Oct 2010 13:14:39 -0400, I.S. wrote: Dear Experts, I'd like to propose a replacement for the org-get-priority function which is backward compatible with the current version but allows the user to add a sub-priority such as [#A]-5 or [#B]+3: Could you provide a patch against current master and send it to the list as a text/plain attachment? This way the proposed modification will end up in Org's patchtracker[1]. Best, -- David [1] http://patchwork.newartisans.com/project/org-mode/ -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de I tried looing at patchwork but couldn't figure out what I was supposed to do. Please advise on usage instructions. Instead, I attached a manually generated patch against org.el in the development version from git. I created this patch via $ git clone git://repo.or.cz/org-mode.git $ emacs org-mode/lisp/org.el # to modify the file and write it to org.mine.el $ diff -rup org.el org.mine.el > org-get-priority.patch Please advise on proper procedure as I love org and would enjoy the chance to contribute in the future. Thanks, -I.S. -- Thanks, -I.S. e...@martinian.com's password: --- org.el 2010-10-29 07:41:17.254401572 -0400 +++ org.mine.el 2010-10-29 07:41:49.162423931 -0400 @@ -6,7 +6,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 7.02trans +;; Version: 7.01trans ;; ;; This file is part of GNU Emacs. ;; @@ -185,7 +185,7 @@ identifier." ;;; Version -(defconst org-version "7.02trans" +(defconst org-version "7.01trans" "The version number of the file org.el.") (defun org-version (&optional here) @@ -12129,7 +12129,7 @@ from the `before-change-functions' in th Priorities -(defvar org-priority-regexp ".*?\\(\\[#\\([A-Z0-9]\\)\\] ?\\)" +(defvar org-priority-regexp ".*?\\(\\[#\\([A-Z0-9]\\)\\]\\(-[0-9]+\\)? ?\\)" "Regular expression matching the priority indicator.") (defvar org-remove-priority-next-time nil) @@ -12211,13 +12211,27 @@ ACTION can be `set', `up', `down', or a (message "Priority of current item set to %s" news (defun org-get-priority (s) - "Find priority cookie and return priority." - (save-match-data -(if (not (string-match org-priority-regexp s)) - (* 1000 (- org-lowest-priority org-default-priority)) - (* 1000 (- org-lowest-priority -(string-to-char (match-string 2 s))) + "Find priority cookie and return priority. +Priorities of the form [#]- or +[#]+ are supported with +/- being +optional and modifying the letter priority. The letter priority +is multiplied by 10 and then the number priority is added +on. Thus a priority string of [#B]+5 is higher than [#B] which is +higher than [#B]-2 and all are lower than [#A]. +" + (save-match-data +(let* ((priority-match (string-match org-priority-regexp s)) + (priority-value (if priority-match + (* 10 (- org-lowest-priority + (string-to-char (match-string 2 s + (* 10 (- org-lowest-priority +org-default-priority + (sub-priority-match (match-string 3 s)) + (sub-priority-value (if sub-priority-match + (string-to-number sub-priority-match) 0))) + (+ priority-value sub-priority-value + Tags (defvar org-agenda-archives-mode) ___ 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] proposal for enhanced org-get-priority function
Sorry, previous patch had some junk in it. Attached is the final version (really). Sorry again for the confusion, -I.S. On 10/29/2010 7:45 AM, I.S. wrote: Sorry, I realized the previous patch did not contain updates to the org-priority-regexp. An updated patch is attached. Sorry, -I.S. On 10/27/2010 8:01 AM, I.S. wrote: On 10/24/2010 3:18 PM, David Maus wrote: At Wed, 20 Oct 2010 13:14:39 -0400, I.S. wrote: Dear Experts, I'd like to propose a replacement for the org-get-priority function which is backward compatible with the current version but allows the user to add a sub-priority such as [#A]-5 or [#B]+3: Could you provide a patch against current master and send it to the list as a text/plain attachment? This way the proposed modification will end up in Org's patchtracker[1]. Best, -- David [1] http://patchwork.newartisans.com/project/org-mode/ -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de I tried looing at patchwork but couldn't figure out what I was supposed to do. Please advise on usage instructions. Instead, I attached a manually generated patch against org.el in the development version from git. I created this patch via $ git clone git://repo.or.cz/org-mode.git $ emacs org-mode/lisp/org.el # to modify the file and write it to org.mine.el $ diff -rup org.el org.mine.el > org-get-priority.patch Please advise on proper procedure as I love org and would enjoy the chance to contribute in the future. Thanks, -I.S. --- org.el 2010-10-29 07:41:17.254401572 -0400 +++ org.mine.el 2010-10-29 07:49:11.814892725 -0400 @@ -12129,7 +12129,7 @@ from the `before-change-functions' in th Priorities -(defvar org-priority-regexp ".*?\\(\\[#\\([A-Z0-9]\\)\\] ?\\)" +(defvar org-priority-regexp ".*?\\(\\[#\\([A-Z0-9]\\)\\]\\(-[0-9]+\\)? ?\\)" "Regular expression matching the priority indicator.") (defvar org-remove-priority-next-time nil) @@ -12211,13 +12211,27 @@ ACTION can be `set', `up', `down', or a (message "Priority of current item set to %s" news (defun org-get-priority (s) - "Find priority cookie and return priority." - (save-match-data -(if (not (string-match org-priority-regexp s)) - (* 1000 (- org-lowest-priority org-default-priority)) - (* 1000 (- org-lowest-priority -(string-to-char (match-string 2 s))) + "Find priority cookie and return priority. +Priorities of the form [#]- or +[#]+ are supported with +/- being +optional and modifying the letter priority. The letter priority +is multiplied by 10 and then the number priority is added +on. Thus a priority string of [#B]+5 is higher than [#B] which is +higher than [#B]-2 and all are lower than [#A]. +" + (save-match-data +(let* ((priority-match (string-match org-priority-regexp s)) + (priority-value (if priority-match + (* 10 (- org-lowest-priority + (string-to-char (match-string 2 s + (* 10 (- org-lowest-priority +org-default-priority + (sub-priority-match (match-string 3 s)) + (sub-priority-value (if sub-priority-match + (string-to-number sub-priority-match) 0))) + (+ priority-value sub-priority-value + Tags (defvar org-agenda-archives-mode) ___ 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] confusion with file search with org-links
Dear Experts, I am a little confused about how file links are supposed to work in orgmode. I have a link like [[file:/tmp/bug.bib::a bug][blah]] linking to a BiBTeX file but when I try to follow it via C-c C-o it just goes to the top of the file. Interestingly, when I open the file and set it to be in text mode and then follow the link, org puts me to the proper place in the file. I suspect that org-mode is getting confused with the file search feature when it opens a BiBTeX file. Why do I care? I'd like to be able to use a function like the one below to link to bib items: (defun store-bibtex-link () "Make link to a bibtex entry. Calling this function inside a BiBTeX entry will create a link to that entry and store it so you can extract it via C-c C-l. This is useful for making links to BiBTeX items from your org files. " (interactive) (let* ((title (bibtex-autokey-get-field "title")) (myfile (buffer-file-name)) (mylink (format "file:%s::%s" myfile title)) ) (setq org-stored-links (cons (list mylink title) org-stored-links)) (message "Stored: %s" (or title mylink)) )) An example of the bug.bib illustrating the problem is shown below % start bug.bib % foo % bar @article{me98, title={a bug}, author={me}, journal={it}, year=1998, } %blah -- Thanks, -I.S. ___ 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] proposal for enhanced org-get-priority function
On 11/15/2010 7:07 AM, Juan Pechiar wrote: I'm against feature-itis. Orgmode has been losing some of its elegance to feature requests. And by 'elegance' I mean ease of learning and using and maintaining, and not having to decide between N different ways of achieving something just because so many border-case features exist. The agenda is for things you have to do today. Just do them. If you need ordering, you have outlines and lists, properties, LISP, hooks, column view, custom agenda views, etc. Regards, .j. On Mon, Nov 15, 2010 at 11:25:30AM +0100, Carsten Dominik wrote: I would like to have a show of hands who is interested in this treatment of finer priorities. That may be a fair point (although I tend to think that most of the features in orgmode are really useful). I'd like to point out, however, that the proposed change is completely backward compatible. If you don't want finer grained priorities, just don't add -. Personally, I vote yes because I find the priorities in TODO lists very useful. In addition, I often find that I want to insert a new item between two existing ones and therefore having fine-grained priorities makes this easy to do. -- Thanks, -I.S. ___ 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] confusion with file search with org-links
On 11/11/2010 11:09 AM, Carsten Dominik wrote: Hi I.S. This should already work out of the box in bibtex files, but it will use the citation key instead of the title as the thing to search for. the code for this functionality is in org-bibtex.el - Carsten You are right, it does work out of the box. Thanks again for such great features that new things I want are already there. :) Sorry for troubling you, -I. S. ___ 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] proposal for enhanced org-get-priority function
On 11/17/2010 3:16 AM, Carsten Dominik wrote: Hi I.S. I have not added you patch as it is, because in some ways the syntax it adds is questionable, and, as others have pointed out, sorting can be done in different ways, too. However, instead, I have introduced a variable that can be set to a user-defined function to compute the base priority of a node. So you can simply put your function into that variable and continue to use your special syntax, with us making it an official Org syntax. The name of the variable is org-get-priority-function. I hope this helps. - Carsten Thank you. That is a fine solution for me. -- Thanks, -I.S. ___ 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] Is it possible to do literate programming without org-babel?
Dear Experts, I think org-babel is great and use it when I can. But on larger projects where some people are not emacs users, it may not be feasible for the master file to be an org-mode file. Do you have any suggestions on using literate programming techniques when the source code must be in a .py file? One thing I have tried is switching to org-mode when I want to write comments, create links, etc. and do that in org-mode and then switch back to python mode. This actually works reasonably well but it's annoying to switch modess. Any better ideas? -- Thanks, -I.S. ___ 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