Browse Source

Fix read-only property removal bug

* lisp/org-capture.el (org-capture): Compute the length of the
correct string when removing properties.
Carsten Dominik 14 years ago
parent
commit
8302e2b0d8
1 changed files with 4 additions and 3 deletions
  1. 4 3
      lisp/org-capture.el

+ 4 - 3
lisp/org-capture.el

@@ -383,10 +383,11 @@ bypassed."
 	   (initial (and (org-region-active-p)
 	   (initial (and (org-region-active-p)
 			 (buffer-substring (point) (mark))))
 			 (buffer-substring (point) (mark))))
 	   (entry (org-capture-select-template keys)))
 	   (entry (org-capture-select-template keys)))
-      (when initial
+      (when (stringp initial)
 	(remove-text-properties 0 (length initial) '(read-only t) initial))
 	(remove-text-properties 0 (length initial) '(read-only t) initial))
-      (when annotation
-	(remove-text-properties 0 (length initial) '(read-only t) annotation))
+      (when (stringp annotation)
+	(remove-text-properties 0 (length annotation)
+				'(read-only t) annotation))
       (cond
       (cond
        ((equal entry "C")
        ((equal entry "C")
 	(customize-variable 'org-capture-templates))
 	(customize-variable 'org-capture-templates))