From 217ceb89834ee04c1a706b5d1e75c9c7d58b1bba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20R=C3=B6hler?= Date: Sat, 16 Oct 2010 12:26:15 +0200 Subject: [PATCH 01/10] command-name org-insert-heading-respect-content Hi Carsten, herewith a first patch continuing command-name insertion (should be sent already but seems not). As the remaining has to be done manually, several patches will result. Maybe consider granting write-access. Cheers Andreas -- https://code.launchpad.net/~a-roehler/python-mode/python-mode-components https://code.launchpad.net/s-x-emacs-werkstatt/ --- doc/org.texi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index bd22ce9cb..eeb068201 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -1072,8 +1072,7 @@ the content of that line is made the new heading. If the command is used at the end of a folded subtree (i.e. behind the ellipses at the end of a headline), then a headline like the current one will be inserted after the end of the subtree. -@kindex C-@key{RET} -@item C-@key{RET} +@orgcmd{C-@key{RET},org-insert-heading-respect-content} Just like @kbd{M-@key{RET}}, except when adding a new heading below the current heading, the new heading is placed after the body instead of before it. This command works from anywhere in the entry. From c41409c530e714ee13bdd119c3f955e2ffbda67f Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Sun, 17 Oct 2010 18:35:02 +0200 Subject: [PATCH 02/10] Enhance XEmacs compatibility * lisp/org-list.el (org-list-search-unenclosed-generic): Replace call to booleanp. * lisp/org-compat.el (org-decompose-region): New defsubst. * lisp/org.el (org-toggle-pretty-entities): (org-unfontify-region): Use `org-decompose-region'. --- lisp/org-compat.el | 9 +++++++++ lisp/org-list.el | 2 +- lisp/org.el | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 4383bec67..298ce476a 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -162,6 +162,15 @@ If DELETE is non-nil, delete all those overlays." (let ((x (org-get-x-clipboard-compat value))) (if x (org-no-properties x))))) +(defsubst org-decompose-region (beg end) + "Decompose from BEG to END." + (if (featurep 'xemacs) + (let ((modified-p (buffer-modified-p)) + (buffer-read-only nil)) + (remove-text-properties beg end '(composition nil)) + (set-buffer-modified-p modified-p)) + (decompose-region beg end))) + ;; Miscellaneous functions (defun org-add-hook (hook function &optional append local) diff --git a/lisp/org-list.el b/lisp/org-list.el index baa89af42..737cfb128 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -343,7 +343,7 @@ Arguments SEARCH, RE, BOUND and NOERR are similar to those in (while t ;; 1. No match: return to origin or bound, depending on NOERR. (unless (funcall search re bound noerr) - (throw 'exit (and (goto-char (if (booleanp noerr) origin bound)) + (throw 'exit (and (goto-char (if (memq noerr '(t nil)) origin bound)) nil))) ;; 2. Match not in block or protected: return point. Else ;; skip the block and carry on. diff --git a/lisp/org.el b/lisp/org.el index 17bce2532..6ea9d259f 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5543,7 +5543,7 @@ needs to be inserted at a specific position in the font-lock sequence.") (message "Entities are displayed as UTF8 characers") (save-restriction (widen) - (decompose-region (point-min) (point-max)) + (org-decompose-region (point-min) (point-max)) (message "Entities are displayed plain")))) (defun org-fontify-entities (limit) @@ -5643,7 +5643,7 @@ If KWD is a number, get the corresponding match group." (inhibit-read-only t) (inhibit-point-motion-hooks t) (inhibit-modification-hooks t) deactivate-mark buffer-file-name buffer-file-truename) - (decompose-region beg end) + (org-decompose-region beg end) (remove-text-properties beg end (if org-indent-mode From 0cb3c523df2052c42086f001b6ccd07d2eaee24c Mon Sep 17 00:00:00 2001 From: "Thomas S. Dye" Date: Sun, 17 Oct 2010 16:27:57 -0600 Subject: [PATCH 03/10] documentation patch, Babel header arguments --- doc/org.texi | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index bd22ce9cb..84df41357 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -456,6 +456,7 @@ Using header arguments * Buffer-wide header arguments:: Set default values for a specific buffer * Header arguments in Org-mode properties:: Set default values for a buffer or heading * Code block specific header arguments:: The most common way to set values +* Header arguments in function calls:: Specific header arguments @@ -11299,7 +11300,7 @@ Code blocks defined in the ``Library of Babel'' can be called remotely as if they were in the current Org-mode buffer (see @ref{Evaluating code blocks} for information on the syntax of remote code block evaluation). -@kindex C-c C-v l +@kindex C-c C-v i Code blocks located in any Org-mode file can be loaded into the ``Library of Babel'' with the @code{org-babel-lob-ingest} function, bound to @kbd{C-c C-v i}. @@ -11378,7 +11379,7 @@ describes each header argument in detail. @node Using header arguments, Specific header arguments, Header arguments, Header arguments @subsection Using header arguments -The values of header arguments can be set in five different ways, each more +The values of header arguments can be set in six different ways, each more specific (and having higher priority) than the last. @menu * System-wide header arguments:: Set global default values @@ -11386,6 +11387,7 @@ specific (and having higher priority) than the last. * Buffer-wide header arguments:: Set default values for a specific buffer * Header arguments in Org-mode properties:: Set default values for a buffer or heading * Code block specific header arguments:: The most common way to set values +* Header arguments in function calls:: The most specific level @end menu @@ -11480,7 +11482,7 @@ Properties defined in this way override the properties set in @code{org-set-property} function bound to @kbd{C-c C-x p} to set properties in Org-mode documents. -@node Code block specific header arguments, , Header arguments in Org-mode properties, Using header arguments +@node Code block specific header arguments, Header arguments in function calls, Header arguments in Org-mode properties, Using header arguments @subsubheading Code block specific header arguments The most common way to assign values to header arguments is at the @@ -11501,14 +11503,18 @@ fac 0 = 1 fac n = n * fac (n-1) #+end_src @end example - Similarly, it is possible to set header arguments for inline code blocks: @example src_haskell[:exports both]@{fac 5@} @end example -Header arguments for ``Library of Babel'' or function call lines can be set as shown below: +@node Header arguments in function calls, , Code block specific header arguments, Using header arguments +@comment node-name, next, previous, up +@subsubheading Header arguments in function calls + +At the most specific level, header arguments for ``Library of Babel'' or +function call lines can be set as shown below: @example #+call: factorial(n=5) :exports results From c5a8bc9db4afafef02311e2e7d486c4f7bab35cf Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Mon, 18 Oct 2010 14:23:38 +0200 Subject: [PATCH 04/10] Improve XEmacs compatibility * lisp/org-compat.el (org-number-sequence): New function. * lisp/ob-R.el (org-babel-expand-body:R): Use `org-number-sequence'. * lisp/ob.el (org-babel-where-is-src-block-result): Use `org-number-sequence'. (org-babel-current-buffer-properties): Fix variable definition. * lisp/ob-ref.el (org-babel-ref-index-list): Use `org-number-sequence'. * lisp/ob-latex.el (org-babel-latex-tex-to-pdf): Use the 2-argument version of `shell-command'. * lisp/org-latex.el (org-export-as-pdf): Use the 2-argument version of `shell-command'. --- lisp/ob-R.el | 2 +- lisp/ob-latex.el | 2 +- lisp/ob-ref.el | 2 +- lisp/ob.el | 5 +++-- lisp/org-compat.el | 20 ++++++++++++++++++++ lisp/org-latex.el | 2 +- 6 files changed, 27 insertions(+), 6 deletions(-) diff --git a/lisp/ob-R.el b/lisp/ob-R.el index c709064c3..ca731cac3 100644 --- a/lisp/ob-R.el +++ b/lisp/ob-R.el @@ -61,7 +61,7 @@ (cdr (nth i (nth 1 processed-params))) (cdr (nth i (nth 4 processed-params))) (cdr (nth i (nth 5 processed-params)))))) - (number-sequence 0 (1- (length (nth 1 processed-params)))))) + (org-number-sequence 0 (1- (length (nth 1 processed-params)))))) (out-file (cdr (assoc :file params)))) (mapconcat ;; define any variables #'org-babel-trim diff --git a/lisp/ob-latex.el b/lisp/ob-latex.el index dde3eae20..f9960495e 100644 --- a/lisp/ob-latex.el +++ b/lisp/ob-latex.el @@ -150,7 +150,7 @@ Extracted from `org-export-as-pdf' in org-latex.el." (save-match-data (shell-quote-argument output-dir)) t t cmd))) - (shell-command cmd outbuf outbuf))) + (shell-command cmd outbuf))) (message (concat "Processing LaTeX file " file "...done")) (if (not (file-exists-p pdffile)) (error (concat "PDF file " pdffile " was not produced")) diff --git a/lisp/ob-ref.el b/lisp/ob-ref.el index 99960c869..e96bf3b2e 100644 --- a/lisp/ob-ref.el +++ b/lisp/ob-ref.el @@ -199,7 +199,7 @@ to \"0:-1\"." (if (or (= 0 (length portion)) (string-match ind-re portion)) (mapcar (lambda (n) (nth n lis)) - (apply 'number-sequence + (apply 'org-number-sequence (if (and (> (length portion) 0) (match-string 2 portion)) (list (wrap (string-to-number (match-string 2 portion))) diff --git a/lisp/ob.el b/lisp/ob.el index 3c81baf77..705040173 100644 --- a/lisp/ob.el +++ b/lisp/ob.el @@ -263,7 +263,8 @@ specific header arguments as well.") '((:session . "none") (:results . "silent") (:exports . "results")) "Default arguments to use when evaluating an inline source block.") -(defvar org-babel-current-buffer-properties) +(defvar org-babel-current-buffer-properties nil + "Local cache for buffer properties.") (make-variable-buffer-local 'org-babel-current-buffer-properties) (defvar org-babel-result-regexp @@ -1217,7 +1218,7 @@ following the source block." (if indent (mapconcat (lambda (el) " ") - (number-sequence 1 indent) "") + (org-number-sequence 1 indent) "") "") "#+results" (when hash (concat "["hash"]")) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 298ce476a..e7e4fa3d1 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -206,6 +206,26 @@ ignored in this case." (shrink-window-if-larger-than-buffer window))) (or window (selected-window))) +(defun org-number-sequence (from &optional to inc) + "Call `number-sequence or emulate it." + (if (fboundp 'number-sequence) + (number-sequence from to inc) + (if (or (not to) (= from to)) + (list from) + (or inc (setq inc 1)) + (when (zerop inc) (error "The increment can not be zero")) + (let (seq (n 0) (next from)) + (if (> inc 0) + (while (<= next to) + (setq seq (cons next seq) + n (1+ n) + next (+ from (* n inc)))) + (while (>= next to) + (setq seq (cons next seq) + n (1+ n) + next (+ from (* n inc))))) + (nreverse seq))))) + ;; Region compatibility (defvar org-ignore-region nil diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 4cbc031ff..57106eadd 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -944,7 +944,7 @@ when PUB-DIR is set, use this as the publishing directory." (save-match-data (shell-quote-argument output-dir)) t t cmd))) - (shell-command cmd outbuf outbuf))) + (shell-command cmd outbuf))) (message (concat "Processing LaTeX file " file "...done")) (setq errors (org-export-latex-get-error outbuf)) (if (not (file-exists-p pdffile)) From 33f947dcb538af51792b79bfd482a8fdde3ff191 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Wed, 20 Oct 2010 07:36:48 +0200 Subject: [PATCH 05/10] Fix typos --- lisp/org-latex.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 57106eadd..4fcbbb7d6 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -534,21 +534,21 @@ This function should accept the file name as its single argument." (repeat :tag "Shell command sequence" (string :tag "Shell command")) (const :tag "2 runs of pdflatex" - '("pdflatex -interaction nonstopmode -output-directory %o %f" + ("pdflatex -interaction nonstopmode -output-directory %o %f" "pdflatex -interaction nonstopmode -output-directory %o %f")) (const :tag "3 runs of pdflatex" - '("pdflatex -interaction nonstopmode -output-directory %o %f" + ("pdflatex -interaction nonstopmode -output-directory %o %f" "pdflatex -interaction nonstopmode -output-directory %o %f" "pdflatex -interaction nonstopmode -output-directory %o %f")) (const :tag "pdflatex,bibtex,pdflatex,pdflatex" - '("pdflatex -interaction nonstopmode -output-directory %o %f" + ("pdflatex -interaction nonstopmode -output-directory %o %f" "bibtex %b" "pdflatex -interaction nonstopmode -output-directory %o %f" "pdflatex -interaction nonstopmode -output-directory %o %f")) (const :tag "texi2dvi" - '("texi2dvi -p -b -c -V %f")) + ("texi2dvi -p -b -c -V %f")) (const :tag "rubber" - '("rubber -d --into %o %f")) + ("rubber -d --into %o %f")) (function))) (defcustom org-export-pdf-logfiles From 3829447296517e3be8398202301db1e60230a50b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20R=C3=B6hler?= Date: Wed, 20 Oct 2010 16:12:55 +0000 Subject: [PATCH 06/10] 20101020_texi-command-names.patch BTW can't see where the meaning of key "S" is told... Cheers --- doc/org.texi | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index 4a725d3ee..a59e8e818 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -1077,13 +1077,11 @@ after the end of the subtree. Just like @kbd{M-@key{RET}}, except when adding a new heading below the current heading, the new heading is placed after the body instead of before it. This command works from anywhere in the entry. -@kindex M-S-@key{RET} -@item M-S-@key{RET} +@orgcmd{M-S-@key{RET},org-insert-todo-heading} @vindex org-treat-insert-todo-heading-as-state-change Insert new TODO entry with same level as current heading. See also the variable @code{org-treat-insert-todo-heading-as-state-change}. -@kindex C-S-@key{RET} -@item C-S-@key{RET} +@orgcmd{C-S-@key{RET},org-insert-todo-heading-respect-content} Insert new TODO entry with same level as current heading. Like @kbd{C-@key{RET}}, the new headline will be inserted after the current subtree. From 92531f3049523476005b6cc236980cf3d2285d14 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Tue, 19 Oct 2010 17:08:28 +0000 Subject: [PATCH 07/10] typo in variable name: org-inlinetask-defaut-state --- lisp/org-inlinetask.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/org-inlinetask.el b/lisp/org-inlinetask.el index 29b154431..041ee2914 100644 --- a/lisp/org-inlinetask.el +++ b/lisp/org-inlinetask.el @@ -106,7 +106,7 @@ When nil, they will not be exported." (defvar org-complex-heading-regexp) (defvar org-property-end-re) -(defcustom org-inlinetask-defaut-state nil +(defcustom org-inlinetask-default-state nil "Non-nil means make inline tasks have a TODO keyword initially. This should be the state `org-inlinetask-insert-task' should use by default, or nil of no state should be assigned." @@ -117,16 +117,16 @@ default, or nil of no state should be assigned." (defun org-inlinetask-insert-task (&optional no-state) "Insert an inline task. -If prefix arg NO-STATE is set, ignore `org-inlinetask-defaut-state'." +If prefix arg NO-STATE is set, ignore `org-inlinetask-default-state'." (interactive "P") (or (bolp) (newline)) (let ((indent org-inlinetask-min-level)) (if org-odd-levels-only (setq indent (- (* 2 indent) 1))) (insert (make-string indent ?*) - (if (or no-state (not org-inlinetask-defaut-state)) + (if (or no-state (not org-inlinetask-default-state)) " \n" - (concat " " org-inlinetask-defaut-state " \n")) + (concat " " org-inlinetask-default-state " \n")) (make-string indent ?*) " END\n")) (end-of-line -1)) (define-key org-mode-map "\C-c\C-xt" 'org-inlinetask-insert-task) From 9542f8fa985cd94e9982868a72b3862dd017b1c7 Mon Sep 17 00:00:00 2001 From: Christian Egli Date: Tue, 19 Oct 2010 12:17:16 +0000 Subject: [PATCH 08/10] Fix an error in org-taskjuggler-get-unique-id Don't try to pop from an empty list and downcase the result --- lisp/org-taskjuggler.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-taskjuggler.el b/lisp/org-taskjuggler.el index 23f4b6261..6367b7a39 100644 --- a/lisp/org-taskjuggler.el +++ b/lisp/org-taskjuggler.el @@ -503,7 +503,7 @@ finally add more underscore characters (\"_\")." (parts (split-string headline)) (id (org-taskjuggler-clean-id (downcase (pop parts))))) ; try to add more parts of the headline to make it unique - (while (member id unique-ids) + (while (and (member id unique-ids) (car parts)) (setq id (concat id "_" (org-taskjuggler-clean-id (downcase (pop parts)))))) ; if its still not unique add "_" (while (member id unique-ids) From 4cd56cfa7b93902544acb32848e36ee4004239a3 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Wed, 20 Oct 2010 14:10:46 +0200 Subject: [PATCH 09/10] org.texi: add a menu description. --- doc/org.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/org.texi b/doc/org.texi index a59e8e818..637eee9f7 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -456,7 +456,7 @@ Using header arguments * Buffer-wide header arguments:: Set default values for a specific buffer * Header arguments in Org-mode properties:: Set default values for a buffer or heading * Code block specific header arguments:: The most common way to set values -* Header arguments in function calls:: +* Header arguments in function calls:: The most specific level Specific header arguments From e290e9e2f4716acbe6ef011f3e5574c6c926aa8b Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Wed, 20 Oct 2010 14:49:41 -0600 Subject: [PATCH 10/10] fixed some compilation warnings * lisp/ob.el (org-number-sequence): declared * lisp/ob-R.el (org-number-sequence): declared --- lisp/ob-R.el | 1 + lisp/ob.el | 1 + 2 files changed, 2 insertions(+) diff --git a/lisp/ob-R.el b/lisp/ob-R.el index ca731cac3..ea4df18fd 100644 --- a/lisp/ob-R.el +++ b/lisp/ob-R.el @@ -38,6 +38,7 @@ (declare-function inferior-ess-send-input "ext:ess-inf" ()) (declare-function ess-make-buffer-current "ext:ess-inf" ()) (declare-function ess-eval-buffer "ext:ess-inf" (vis)) +(declare-function org-number-sequence "org-compat" (from &optional to inc)) (defconst org-babel-header-arg-names:R '(width height bg units pointsize antialias quality compression diff --git a/lisp/ob.el b/lisp/ob.el index 705040173..a47492ff3 100644 --- a/lisp/ob.el +++ b/lisp/ob.el @@ -72,6 +72,7 @@ (declare-function org-babel-ref-resolve-reference "ob-ref" (ref &optional params)) (declare-function org-babel-lob-execute-maybe "ob-lob" ()) +(declare-function org-number-sequence "org-compat" (from &optional to inc)) (defgroup org-babel nil "Code block evaluation and management in `org-mode' documents."