From 796318b21545a1c9ffb1e51ceaaf02d0b4803421 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Mon, 16 Aug 2010 14:28:29 +0200 Subject: [PATCH 1/4] Fix Table attribute issue during PDF export * lisp/org-latex.el (org-export-latex-first-lines): Do not protect meta lines that have nothing to do with babel. --- lisp/org-latex.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 9142747de..4f27f425a 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -1257,9 +1257,13 @@ If END is non-nil, it is the end of the region." '(:org-license-to-kill t)) (save-excursion (goto-char pt) - (while (re-search-forward "^[ \t]*#+.*\n?" limit t) - (remove-text-properties (match-beginning 0) (match-end 0) - '(:org-license-to-kill t)))))))))) + (while (re-search-forward "^[ \t]*#\\+.*\n?" limit t) + (let ((case-fold-search t)) + (unless (org-string-match-p + "^[ \t]*#\\+\\(attr_\\|caption\\>\\|label\\>\\)" + (match-string 0)) + (remove-text-properties (match-beginning 0) (match-end 0) + '(:org-license-to-kill t)))))))))))) (defvar org-export-latex-header-defs nil From ac8e3fb8d1fd8fffe784f6edd672d3c93f78664f Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Mon, 16 Aug 2010 15:28:39 +0200 Subject: [PATCH 2/4] New hook to add more properties to new agenda items, or to filter * lisp/org-agenda.el (org-agenda-before-sorting-filter-function): New hook function. (org-finalize-agenda-entries): Apply `org-agenda-before-sorting-filter-function'. --- lisp/org-agenda.el | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 670ac8214..194f392fc 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -5198,12 +5198,34 @@ HH:MM." (int-to-string t0)))) (if string (concat (substring t1 -4 -2) ":" (substring t1 -2)) t0))))) +(defvar org-agenda-before-sorting-filter-function nil + "Function to be applied to agenda items prior to sorting. +Prior to sorting also means just before they are inserted into the agenda. + +To aid sorting, you may revisit the original entries and add more text +properties which will later be used by the sorting functions. + +The function should take a string argument, an agenda line. +It has access to the text properties in that line, which contain among +other things, the property `org-hd-marker' that points to the entry +where the line comes from. Note that not all lines going into the agenda +have this property, only most. + +The function should return the modified string. It is probably best +to ONLY change text properties. + +You can also use this function as a filter, by returning nil for lines +you don't want to have in the agenda at all. For this application, you +could bind the variable in the options section of a custom command.") + (defun org-finalize-agenda-entries (list &optional nosort) "Sort and concatenate the agenda items." (setq list (mapcar 'org-agenda-highlight-todo list)) (if nosort list - (mapconcat 'identity (sort list 'org-entries-lessp) "\n"))) + (when org-agenda-before-sorting-filter-function + (setq list (mapcar org-agenda-before-sorting-filter-function list))) + (delq nil (mapconcat 'identity (sort list 'org-entries-lessp) "\n")))) (defun org-agenda-highlight-todo (x) (let ((org-done-keywords org-done-keywords-for-agenda) From 652e7f28401064d010b4aa5aa7ff9527a30821ad Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Mon, 16 Aug 2010 17:13:53 +0200 Subject: [PATCH 3/4] Revert "Bug fix in pw script" This reverts commit 3363a7b9952a61b0bc8e9375e3030e54cd824f94. --- UTILITIES/pw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UTILITIES/pw b/UTILITIES/pw index cc1244a77..8bf861d17 100755 --- a/UTILITIES/pw +++ b/UTILITIES/pw @@ -285,7 +285,7 @@ def action_apply(rpc, patch_id): sys.exit(1) def action_update_patch(rpc, patch_id, state = None, commit = None, - delegate_str = "", comment_str, archived = False): + delegate_str = "", comment_str = "No comment", archived = False): patch = rpc.patch_get(patch_id) if patch == {}: sys.stderr.write("Error getting information on patch ID %d\n" % \ From 4a523e0cf0fba620b0296d376c6efb617c31e7a4 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Mon, 16 Aug 2010 17:17:15 +0200 Subject: [PATCH 4/4] Big bug in pw script --- UTILITIES/pw | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UTILITIES/pw b/UTILITIES/pw index 8bf861d17..edf101858 100755 --- a/UTILITIES/pw +++ b/UTILITIES/pw @@ -471,7 +471,8 @@ def merge_with(patch_id, rpc, delegate_str, comment_str): # If it succeeded this far, mark the patch as "Accepted" by the invoking # user. action_update_patch(rpc, patch_id, state = 'Accepted', commit = sha, - delegate_str = delegate_str, archived = True) + delegate_str = delegate_str, comment_str = comment_str, + archived = True) print sha