From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: [BUG] error with org-refile and ido-completion-help Date: Mon, 30 May 2016 16:40:45 -0500 Message-ID: <87eg8jb4wy.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7Uvn-0003CH-94 for emacs-orgmode@gnu.org; Mon, 30 May 2016 17:41:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7Uvi-00059s-8A for emacs-orgmode@gnu.org; Mon, 30 May 2016 17:41:02 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:34435) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7Uvf-00058k-Jj for emacs-orgmode@gnu.org; Mon, 30 May 2016 17:40:58 -0400 Received: from archthink (c-50-172-132-15.hsd1.il.comcast.net [50.172.132.15]) by mail.messagingengine.com (Postfix) with ESMTPA id 8821CCCD8E for ; Mon, 30 May 2016 17:40:45 -0400 (EDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Org Mode When calling org-refile with org-completion-use-ido set to t, pressing TAB in ido-mode results in an error. This is because ido-completion-help expects a list of strings. However, org-refile sends ido-completing-read a list of lists. To replicate: 1. /usr/bin/emacs -Q -l ~/.minimal.el --8<---------------cut here---------------start------------->8--- (add-to-list 'load-path "~/org-mode/lisp") (add-to-list 'load-path "~/org-mode/contrib/lisp") (ido-mode) (setq org-completion-use-ido 1) --8<---------------cut here---------------end--------------->8--- Go to an org file with headlines: --8<---------------cut here---------------start------------->8--- * One * Two * Three --8<---------------cut here---------------end--------------->8--- 2. Call org-refile on the first headline. 3. Press TAB within the ido minibuffer. (See the backtrace at the bottom of this post). A git bisect revealed that the change was introduced in 2015 with the following commit: ,---- | commit 50ba0a5ed609f3600f2590f3ba22b8ab3ff3331c | Author: Nicolas Goaziou | Date: Sun Jun 7 00:38:58 2015 +0200 |=20 | Fix 1a7364177046b8a57ade0aeb9f52bacfc0b8b088 |=20=20=20=20=20 | * lisp/org.el (org-icompleting-read): Let `completing-read' or | equivalent sort out type of completion. | (org-olpath-completing-read): Revert partially | 1a7364177046b8a57ade0aeb9f52bacfc0b8b088. `---- It looks like this commit removed some functionality from the now obsolete org-icompleting-read that made sure that the items in the completion list passed to the completing read function were strings. Matt --8<---------------cut here---------------start------------->8--- Debugger entered--Lisp error: (wrong-type-argument arrayp (#("Three" 0 5 (f= ace org-level-1 fontified t)) "/home/matt/test.org" "^\\(\\*+\\)\\(?: +\\(D= ONE\\|TODO\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?\\(?: +\\(?:\\[[0-9%/]+\\] *\\)*\= \(Three\\)\\(?: *\\[[0-9%/]+\\]\\)*\\)\\(?:[ ]+\\(:[[:alnum:]_@#%:]+:\\)\\= )?[ ]*$" 14)) ido-no-final-slash((#("Three" 0 5 (face org-level-1 fontified t)) "/home/= matt/test.org" "^\\(\\*+\\)\\(?: +\\(DONE\\|TODO\\)\\)?\\(?: +\\(\\[#.\\]\\= )\\)?\\(?: +\\(?:\\[[0-9%/]+\\] *\\)*\\(Three\\)\\(?: *\\[[0-9%/]+\\]\\)*\\= )\\(?:[ ]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ ]*$" 14)) ido-file-lessp((#("Three" 0 5 (face org-level-1 fontified t)) "/home/matt= /test.org" "^\\(\\*+\\)\\(?: +\\(DONE\\|TODO\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)= ?\\(?: +\\(?:\\[[0-9%/]+\\] *\\)*\\(Three\\)\\(?: *\\[[0-9%/]+\\]\\)*\\)\\(= ?:[ ]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ ]*$" 14) (#("Two" 0 3 (face org-leve= l-1 fontified t)) "/home/matt/test.org" "^\\(\\*+\\)\\(?: +\\(DONE\\|TODO\\= )\\)?\\(?: +\\(\\[#.\\]\\)\\)?\\(?: +\\(?:\\[[0-9%/]+\\] *\\)*\\(Two\\)\\(?= : *\\[[0-9%/]+\\]\\)*\\)\\(?:[ ]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ ]*$" 8)) sort(((#("Two" 0 3 (face org-level-1 fontified t)) "/home/matt/test.org" = "^\\(\\*+\\)\\(?: +\\(DONE\\|TODO\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?\\(?: +\\(= ?:\\[[0-9%/]+\\] *\\)*\\(Two\\)\\(?: *\\[[0-9%/]+\\]\\)*\\)\\(?:[ ]+\\(:[[= :alnum:]_@#%:]+:\\)\\)?[ ]*$" 8)) ido-file-lessp) ido-completion-help() funcall-interactively(ido-completion-help) call-interactively(ido-completion-help) ido-complete() funcall-interactively(ido-complete) call-interactively(ido-complete nil nil) command-execute(ido-complete) read-from-minibuffer("Refile subtree \"One\" to: " nil (keymap keymap (4 = . ido-magic-delete-char) (6 . ido-magic-forward-char) (2 . ido-magic-backwa= rd-char) (63 . ido-completion-help) (left . ido-prev-match) (right . ido-ne= xt-match) (0 . ido-restrict-to-matches) (27 keymap (32 . ido-take-first-mat= ch)) (67108896 . ido-restrict-to-matches) (26 . ido-undo-merge-work-directo= ry) (20 . ido-toggle-regexp) (67108908 . ido-prev-match) (67108910 . ido-ne= xt-match) (19 . ido-next-match) (18 . ido-prev-match) (16 . ido-toggle-pref= ix) (13 . ido-exit-minibuffer) (10 . ido-select-text) (32 . ido-complete-sp= ace) (9 . ido-complete) (5 . ido-edit-input) (3 . ido-toggle-case) (1 . ido= -toggle-ignore) keymap (menu-bar keymap (minibuf "Minibuf" keymap (previous= menu-item "Previous History Item" previous-history-element :help "Put prev= ious minibuffer history element in the minibuffer") (next menu-item "Next H= istory Item" next-history-element :help "Put next minibuffer history elemen= t in the minibuffer") (isearch-backward menu-item "Isearch History Backward= " isearch-backward :help "Incrementally search minibuffer history backward"= ) (isearch-forward menu-item "Isearch History Forward" isearch-forward :hel= p "Incrementally search minibuffer history forward") (return menu-item "Ent= er" exit-minibuffer :key-sequence "" :help "Terminate input and exit minibu= ffer") (quit menu-item "Quit" abort-recursive-edit :help "Abort input and e= xit minibuffer") "Minibuf")) (10 . exit-minibuffer) (13 . exit-minibuffer) = (7 . abort-recursive-edit) (C-tab . file-cache-minibuffer-complete) (9 . se= lf-insert-command) (XF86Back . previous-history-element) (up . previous-lin= e-or-history-element) (prior . previous-history-element) (XF86Forward . nex= t-history-element) (down . next-line-or-history-element) (next . next-histo= ry-element) (27 keymap (114 . previous-matching-history-element) (115 . nex= t-matching-history-element) (112 . previous-history-element) (110 . next-hi= story-element))) nil org-refile-history) ido-read-internal(list "Refile subtree \"One\" to: " org-refile-history n= il t nil) ido-completing-read("Refile subtree \"One\" to: " ((#("Two" 0 3 (face org= -level-1 fontified t)) "/home/matt/test.org" "^\\(\\*+\\)\\(?: +\\(DONE\\|T= ODO\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?\\(?: +\\(?:\\[[0-9%/]+\\] *\\)*\\(Two\\= )\\(?: *\\[[0-9%/]+\\]\\)*\\)\\(?:[ ]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ ]*$"= 8) (#("Three" 0 5 (face org-level-1 fontified t)) "/home/matt/test.org" "^= \\(\\*+\\)\\(?: +\\(DONE\\|TODO\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?\\(?: +\\(?:= \\[[0-9%/]+\\] *\\)*\\(Three\\)\\(?: *\\[[0-9%/]+\\]\\)*\\)\\(?:[ ]+\\(:[[= :alnum:]_@#%:]+:\\)\\)?[ ]*$" 14)) nil t nil org-refile-history nil) apply(ido-completing-read ("Refile subtree \"One\" to: " ((#("Two" 0 3 (f= ace org-level-1 fontified t)) "/home/matt/test.org" "^\\(\\*+\\)\\(?: +\\(D= ONE\\|TODO\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?\\(?: +\\(?:\\[[0-9%/]+\\] *\\)*\= \(Two\\)\\(?: *\\[[0-9%/]+\\]\\)*\\)\\(?:[ ]+\\(:[[:alnum:]_@#%:]+:\\)\\)?= [ ]*$" 8) (#("Three" 0 5 (face org-level-1 fontified t)) "/home/matt/test.= org" "^\\(\\*+\\)\\(?: +\\(DONE\\|TODO\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?\\(?:= +\\(?:\\[[0-9%/]+\\] *\\)*\\(Three\\)\\(?: *\\[[0-9%/]+\\]\\)*\\)\\(?:[ ]= +\\(:[[:alnum:]_@#%:]+:\\)\\)?[ ]*$" 14)) nil t nil org-refile-history nil= )) org-icompleting-read("Refile subtree \"One\" to: " ((#("Two" 0 3 (face or= g-level-1 fontified t)) "/home/matt/test.org" "^\\(\\*+\\)\\(?: +\\(DONE\\|= TODO\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?\\(?: +\\(?:\\[[0-9%/]+\\] *\\)*\\(Two\= \)\\(?: *\\[[0-9%/]+\\]\\)*\\)\\(?:[ ]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ ]*$= " 8) (#("Three" 0 5 (face org-level-1 fontified t)) "/home/matt/test.org" "= ^\\(\\*+\\)\\(?: +\\(DONE\\|TODO\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?\\(?: +\\(?= :\\[[0-9%/]+\\] *\\)*\\(Three\\)\\(?: *\\[[0-9%/]+\\]\\)*\\)\\(?:[ ]+\\(:[= [:alnum:]_@#%:]+:\\)\\)?[ ]*$" 14)) nil t nil org-refile-history nil) org-refile-get-location("Refile subtree \"One\" to" nil nil nil) org-refile(nil) funcall-interactively(org-refile nil) call-interactively(org-refile record nil) command-execute(org-refile record) execute-extended-command(nil "org-refile" nil) funcall-interactively(execute-extended-command nil "org-refile" nil) call-interactively(execute-extended-command nil nil) command-execute(execute-extended-command) --8<---------------cut here---------------end--------------->8---