Browse Source

Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode

David Maus 14 years ago
parent
commit
bb30d4f1c9
3 changed files with 38 additions and 4 deletions
  1. 36 3
      lisp/ob.el
  2. 1 1
      lisp/org-agenda.el
  3. 1 0
      lisp/org.el

+ 36 - 3
lisp/ob.el

@@ -728,8 +728,26 @@ portions of results lines."
 			      'org-babel-show-result-all 'append 'local)))
 			      'org-babel-show-result-all 'append 'local)))
 
 
 (defmacro org-babel-map-src-blocks (file &rest body)
 (defmacro org-babel-map-src-blocks (file &rest body)
-  "Evaluate BODY forms on each source-block in FILE. If FILE is
-nil evaluate BODY forms on source blocks in current buffer."
+  "Evaluate BODY forms on each source-block in FILE.
+If FILE is nil evaluate BODY forms on source blocks in current
+buffer.  During evaluation of BODY the following local variables
+are set relative to the currently matched code block.
+
+full-block ------- string holding the entirety of the code block
+beg-block -------- point at the beginning of the code block
+end-block -------- point at the end of the matched code block
+lang ------------- string holding the language of the code block
+beg-lang --------- point at the beginning of the lang
+end-lang --------- point at the end of the lang
+switches --------- string holding the switches
+beg-switches ----- point at the beginning of the switches
+end-switches ----- point at the end of the switches
+header-args ------ string holding the header-args
+beg-header-args -- point at the beginning of the header-args
+end-header-args -- point at the end of the header-args
+body ------------- string holding the body of the code block
+beg-body --------- point at the beginning of the body
+end-body --------- point at the end of the body"
   (declare (indent 1))
   (declare (indent 1))
   `(let ((visited-p (or (null ,file)
   `(let ((visited-p (or (null ,file)
 			(get-file-buffer (expand-file-name ,file))))
 			(get-file-buffer (expand-file-name ,file))))
@@ -740,7 +758,22 @@ nil evaluate BODY forms on source blocks in current buffer."
        (goto-char (point-min))
        (goto-char (point-min))
        (while (re-search-forward org-babel-src-block-regexp nil t)
        (while (re-search-forward org-babel-src-block-regexp nil t)
          (goto-char (match-beginning 0))
          (goto-char (match-beginning 0))
-         (save-match-data ,@body)
+	 (let ((full-block (match-string 0))
+	       (beg-block (match-beginning 0))
+	       (end-block (match-beginning 0))
+	       (lang (match-string 2))
+	       (beg-lang (match-beginning 2))
+	       (end-lang (match-end 2))
+	       (switches (match-string 3))
+	       (beg-switches (match-beginning 3))
+	       (end-switches (match-end 3))
+	       (header-args (match-string 4))
+	       (beg-header-args (match-beginning 4))
+	       (end-header-args (match-end 4))
+	       (body (match-string 5))
+	       (beg-body (match-beginning 5))
+	       (end-body (match-end 5)))
+	   (save-match-data ,@body))
          (goto-char (match-end 0))))
          (goto-char (match-end 0))))
      (unless visited-p
      (unless visited-p
        (kill-buffer to-be-removed))
        (kill-buffer to-be-removed))

+ 1 - 1
lisp/org-agenda.el

@@ -5117,7 +5117,7 @@ The modified list may contain inherited tags, and tags matched by
 	  (throw 'exit list))
 	  (throw 'exit list))
       (while (setq time (pop gridtimes))
       (while (setq time (pop gridtimes))
 	(unless (and remove (member time have))
 	(unless (and remove (member time have))
-	  (setq time (format "%4d" time))
+	  (setq time (replace-regexp-in-string " " "0" (format "%4s" time)))
 	  (push (org-format-agenda-item
 	  (push (org-format-agenda-item
 		 nil string "" nil
 		 nil string "" nil
 		 (concat (substring time 0 -2) ":" (substring time -2)))
 		 (concat (substring time 0 -2) ":" (substring time -2)))

+ 1 - 0
lisp/org.el

@@ -16385,6 +16385,7 @@ BEG and END default to the buffer boundaries."
 (org-defkey org-mode-map "\C-c\C-x."    'org-timer)
 (org-defkey org-mode-map "\C-c\C-x."    'org-timer)
 (org-defkey org-mode-map "\C-c\C-x-"    'org-timer-item)
 (org-defkey org-mode-map "\C-c\C-x-"    'org-timer-item)
 (org-defkey org-mode-map "\C-c\C-x0"    'org-timer-start)
 (org-defkey org-mode-map "\C-c\C-x0"    'org-timer-start)
+(org-defkey org-mode-map "\C-c\C-x_"    'org-timer-stop)
 (org-defkey org-mode-map "\C-c\C-x,"    'org-timer-pause-or-continue)
 (org-defkey org-mode-map "\C-c\C-x,"    'org-timer-pause-or-continue)
 
 
 (define-key org-mode-map "\C-c\C-x\C-c" 'org-columns)
 (define-key org-mode-map "\C-c\C-x\C-c" 'org-columns)