{"action":"opened","issue":{"url":"https://api.github.com/repos/abo-abo/swiper/issues/68","labels_url":"https://api.github.com/repos/abo-abo/swiper/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/abo-abo/swiper/issues/68/comments","events_url":"https://api.github.com/repos/abo-abo/swiper/issues/68/events","html_url":"https://github.com/abo-abo/swiper/issues/68","id":71787998,"number":68,"title":"Switching to hidden buffers with ivy","user":{"login":"tsdh","id":103854,"avatar_url":"https://avatars.githubusercontent.com/u/103854?v=3","gravatar_id":"","url":"https://api.github.com/users/tsdh","html_url":"https://github.com/tsdh","followers_url":"https://api.github.com/users/tsdh/followers","following_url":"https://api.github.com/users/tsdh/following{/other_user}","gists_url":"https://api.github.com/users/tsdh/gists{/gist_id}","starred_url":"https://api.github.com/users/tsdh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsdh/subscriptions","organizations_url":"https://api.github.com/users/tsdh/orgs","repos_url":"https://api.github.com/users/tsdh/repos","events_url":"https://api.github.com/users/tsdh/events{/privacy}","received_events_url":"https://api.github.com/users/tsdh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-29T06:09:10Z","updated_at":"2015-04-29T06:09:10Z","closed_at":null,"body":"It seems it's impossible to switch to a hidden buffer (a buffer whose name starts with a space) using ivy.  At first, I've thought the problem is that with `ivy--regex` or `ivy--regex-plus` spaces are wild, so I've set\r\n\r\n```elisp\r\n(setq ivy-re-builders-alist '((read-file-name-internal\r\n                               . (lambda (x)\r\n                                   (concat \"^\" (regexp-quote x))))\r\n                              (internal-complete-buffer\r\n                               . (lambda (x)\r\n                                   ;; If the input starts with a space, ensure\r\n                                   ;; that this must match literally.\r\n                                   (ivy--regex-plus (if (string-match-p \"^ \" x)\r\n                                                        (concat  \"^[[:space:]]\" x)\r\n                                                      x))))\r\n                              (t . ivy--regex-plus)))\r\n```\r\n\r\nBut that seems to be only part of the problem.  When do <kbd>C-x b SPC</kbd> I get zero completions although the regexp build by my lambda above would match hidden buffers.  So it seems like the hidden buffers are never offered to ivy at all.\r\n\r\nOh, and this seems to confirm that:\r\n\r\n```elisp\r\n;; Empty input => only normal buffers are offered\r\n(internal-complete-buffer \"\" (lambda (x) x) t)\r\n;;=> (\"*scratch*\" \"*Help*\" \"dot-emacs.el\" \"*ielm*\" \"*Group*\" \"*Messages*\"\r\n;;    \"*imap log*\" \"*nntp-log*\" \".newsrc-dribble\" \"*helm*\")\r\n\r\n;; Input starting with \" \" => only hidden buffers are offered\r\n(internal-complete-buffer \" \" (lambda (x) x) t)\r\n;;=> (\" *Minibuf-1*\" \" *Minibuf-0*\" \" *code-conversion-work*\" \" *Echo Area 0*\"\r\n;;    \" *Echo Area 1*\" \" *code-converting-work*\" \" *edit-server*\" ...)\r\n```\r\n\r\nSo I guess ivy must ask for all completions whenever the input string toggles between not starting with a space and starting with a space."}}