Fix issue with planner-multi breaking completion for other Emacs functions. Closes...
authorJohn Sullivan <john@wjsullivan.net>
Sun, 15 Feb 2009 08:19:26 +0000 (15 03:19 -0500)
committerJohn Sullivan <john@wjsullivan.net>
Sun, 15 Feb 2009 08:19:26 +0000 (15 03:19 -0500)
ChangeLog
planner-multi.el

index 11082e7..7dc9c17 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-02-15  John Sullivan  <john@wjsullivan.net>
+
+       * planner-multi.el (planner-multi-read-name): Using SPC as the
+       planner-multi-separator no longer breaks SPC completion for other
+       Emacs functions. Closes #11953.
+
 2009-02-14  John Sullivan  <john@wjsullivan.net>
 
        * planner.el, planner-deadline.el, planner-notes-index.el,
index 64ce240..f308e30 100644 (file)
@@ -774,31 +774,31 @@ If PROMPT is specified, use that instead of \"Page:\"."
          (plist-put
           (copy-sequence minibuffer-prompt-properties)
           'read-only nil))
-        (map (copy-keymap minibuffer-local-completion-map))
          (completion-ignore-case t)
          (crm-separator (regexp-quote planner-multi-separator))
+        (map (make-sparse-keymap))
+         (minibuffer-local-completion-map
+         (progn
+           (set-keymap-parent map minibuffer-local-completion-map)
+           (define-key map planner-multi-separator 'self-insert-command)
+           map))
          (prompt (format "%s(default: %s) "
                         (or prompt "Page: ") planner-default-page))
          str)
-    (unwind-protect
-        (progn
-          (define-key minibuffer-local-completion-map
-           planner-multi-separator 'self-insert-command)
-          (setq str
-                (if (fboundp 'completing-read-multiple)
-                    (completing-read-multiple
-                     prompt file-alist nil nil initial
-                     'planner-history-list
-                     planner-default-page)
-                  (planner-multi-split
-                   (read-string prompt initial 'planner-history-list
-                               planner-default-page))))
-          (cond
-           ((or (null str)
-                (string= (car str) "")) planner-default-page)
-           ((string= (car str) "nil") nil)
-           (t (mapconcat 'identity str planner-multi-separator))))
-      (setq minibuffer-local-completion-map map))))
+    (setq str
+          (if (fboundp 'completing-read-multiple)
+              (completing-read-multiple
+               prompt file-alist nil nil initial
+               'planner-history-list
+               planner-default-page)
+           (planner-multi-split
+            (read-string prompt initial 'planner-history-list
+                         planner-default-page))))
+    (cond
+     ((or (null str)
+          (string= (car str) "")) planner-default-page)
+     ((string= (car str) "nil") nil)
+     (t (mapconcat 'identity str planner-multi-separator)))))
 
 (defun planner-multi-read-name-multiple-prompts (file-alist prompt initial)
   "Read multiple pages, completing based on FILE-ALIST.