Fix problem introduced by recent commit that broke using SPC as separator.
authorJohn Sullivan <john@wjsullivan.net>
Tue, 17 Feb 2009 22:27:15 +0000 (17 17:27 -0500)
committerJohn Sullivan <john@wjsullivan.net>
Tue, 17 Feb 2009 22:27:15 +0000 (17 17:27 -0500)
ChangeLog
planner-multi.el

index eed366f..1b41813 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2009-02-17  John Sullivan  <john@wjsullivan.net>
+
+       * planner-multi.el (planner-multi-read-name): I don't think the
+       value for `crm-separator' sohuld be regexp quoted. If we're using
+       crm, then we need to modify its completion map in the same way we
+       do if we're not. I'm setting up the map inside the function
+       instead of defvar because I'm concerned about what happens when
+       people modify `planner-multi-separator' after loading
+       planner-multi. Better ways of doing this welcome, but it seems to
+       work.
+
 2009-02-15  John Sullivan  <john@wjsullivan.net>
 
        * planner.el (planner-annotation-from-file-relative): Delete this
index f308e30..aa8921e 100644 (file)
@@ -775,25 +775,31 @@ If PROMPT is specified, use that instead of \"Page:\"."
           (copy-sequence minibuffer-prompt-properties)
           'read-only nil))
          (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))
+         (crm-separator planner-multi-separator)
+         (map (make-sparse-keymap))
+         (planner-multi-local-completion-map
+          (progn
+            (if (featurep 'crm)
+                (set-keymap-parent map crm-local-completion-map)
+              (set-keymap-parent map minibuffer-local-completion-map))
+            (define-key map planner-multi-separator 'self-insert-command)
+            map))
          str)
     (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))))
+              (let ((crm-local-completion-map 
+                     planner-multi-local-completion-map))
+                (completing-read-multiple
+                 prompt file-alist nil nil initial
+                 'planner-history-list
+                 planner-default-page))
+            (let ((minibuffer-local-completion-map 
+                   planner-multi-local-completion-map))
+              (planner-multi-split
+               (read-string prompt initial 'planner-history-list
+                            planner-default-page)))))
     (cond
      ((or (null str)
           (string= (car str) "")) planner-default-page)