Browse Source

Merge branch 'maint'

Bastien Guerry 13 years ago
parent
commit
95e318ae06
3 changed files with 17 additions and 9 deletions
  1. 6 7
      lisp/org-habit.el
  2. 10 1
      lisp/org-src.el
  3. 1 1
      lisp/org.el

+ 6 - 7
lisp/org-habit.el

@@ -346,13 +346,12 @@ current time."
 	    (delete-char (min (+ 1 org-habit-preceding-days
 				 org-habit-following-days)
 			      (- (line-end-position) (point))))
-	    (insert (org-habit-build-graph
-		     habit
-		     (time-subtract moment
-				    (days-to-time org-habit-preceding-days))
-		     moment
-		     (time-add moment
-			       (days-to-time org-habit-following-days))))))
+	    (insert-before-markers
+	     (org-habit-build-graph
+	      habit
+	      (time-subtract moment (days-to-time org-habit-preceding-days))
+	      moment
+	      (time-add moment (days-to-time org-habit-following-days))))))
 	(forward-line)))))
 
 (defun org-habit-toggle-habits ()

+ 10 - 1
lisp/org-src.el

@@ -42,7 +42,7 @@
 (declare-function org-get-indentation "org" (&optional line))
 (declare-function org-switch-to-buffer-other-window "org" (&rest args))
 (declare-function org-strip-protective-commas "org" (beg end))
-(declare-function org-pop-to-buffer-same-window 
+(declare-function org-pop-to-buffer-same-window
 		  "org-compat" (&optional buffer-or-name norecord label))
 
 (defcustom org-edit-src-region-extra nil
@@ -375,6 +375,15 @@ buffer."
   "Construct the buffer name for a source editing buffer."
   (concat "*Org Src " org-buffer-name "[ " lang " ]*"))
 
+(defun org-src-edit-buffer-p (&optional buffer)
+  "Test whether BUFFER (or the current buffer if BUFFER is nil)
+is a source block editing buffer."
+  (let ((buffer (org-base-buffer (or buffer (current-buffer)))))
+    (and (buffer-name buffer)
+	 (string-match "\\`*Org Src " (buffer-name buffer))
+	 (local-variable-p 'org-edit-src-beg-marker buffer)
+	 (local-variable-p 'org-edit-src-end-marker buffer))))
+
 (defun org-edit-src-find-buffer (beg end)
   "Find a source editing buffer that is already editing the region BEG to END."
   (catch 'exit

+ 1 - 1
lisp/org.el

@@ -8687,7 +8687,7 @@ For file links, arg negates `org-context-in-file-links'."
        (setq link (plist-get org-store-link-plist :link)
 	     desc (or (plist-get org-store-link-plist :description) link)))
 
-      ((equal (buffer-name) "*Org Edit Src Example*")
+      ((org-src-edit-buffer-p)
        (let (label gc)
 	 (while (or (not label)
 		    (save-excursion