Doom-emacs: projectile-find-file e + default / search-cwd (fd) incorretamente expandem '/' para o caminho absoluto no Windows

Criado em 24 mai. 2020  ·  27Comentários  ·  Fonte: hlissner/doom-emacs

O que você esperava que fosse acontecer?

projectile-find-file e +default/search-cwd devem listar os caminhos aninhados corretamente.

O que realmente aconteceu?

No Windows com o mingw instalado, esse tipo de saída é exibido para ambos os comandos:

2020-05-24 14_07_08-_Minibuf-1_ – Doom Emacs

Detalhes adicionais:

Veja este problema para obter detalhes:

https://github.com/BurntSushi/ripgrep/issues/501#issuecomment -305960492

Corrigi esse problema com o seguinte snippet:

(after! ivy
  (when IS-WINDOWS
    (setq counsel-rg-base-command "rg -M 240 --with-filename --no-heading --line-number --color never %s --path-separator // .")))

(after! projectile
  (when (executable-find doom-projectile-fd-binary)
    (setq projectile-generic-command
          (concat (format "%s . -0 -H -E .git --color=never --type file --type symlink --follow"
                          doom-projectile-fd-binary)
                  (if IS-WINDOWS " --path-separator=//")))))

Informação do sistema:

emacs   version    26.2
        features   XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS THREADS LCMS2
        build      4 13, 2019
        buildopts  (--without-dbus --host=x86_64-w64-mingw32 --without-compress-install 'CFLAGS=-O2 -static -g3')
        windowsys  w32
        daemonp    server-running
doom    version    2.0.9
        build      HEAD -> develop, origin/develop, origin/HEAD a262527a7 2020-05-21 04:33:39 -0400
        dir        ~/.doom.d/
system  type       windows-nt
        config     x86_64-w64-mingw32
        shell      C:\Program Files\Git\usr\bin\bash.exe
        uname      n/a
        path       (C:\Users\kuzuki\bin C:\Program Files\Git\mingw64\bin C:\Program Files\Git\usr\local\bin C:\Program Files\Git\usr\bin C:\Program Files\Git\usr\bin C:\Program Files\Git\mingw64\bin C:\Program Files\Git\usr\bin C:\Users\kuzuki\bin C:\Program Files\ImageMagick-7.0.10-Q16 C:\Python27 C:\Python27\Scripts C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\libnvvp C:\bin\ImageMagick C:\Windows\system32 C:\Windows C:\Windows\System32\Wbem C:\Windows\System32\WindowsPowerShell\v1.0 C:\bin C:\Program Files\PuTTY C:\Program Files\Microsoft SQL Server\110\Tools\Binn C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common C:\Program Files (x86)\LuaRocks C:\Program Files\LOVE C:\bin\Ruby26-x64\bin C:\bin\emacs-26.2\bin C:\Program Files\NVIDIA Corporation\Nsight Compute 2019.4.0 C:\WINDOWS\system32 C:\WINDOWS C:\WINDOWS\System32\Wbem C:\WINDOWS\System32\WindowsPowerShell\v1.0 C:\WINDOWS\System32\OpenSSH C:\Program Files (x86)\arbtt\bin C:\Program Files\TortoiseHg C:\bin\nodejs C:\ProgramData\chocolatey\bin C:\Program Files\dotnet C:\Program Files\Microsoft SQL Server\130\Tools\Binn C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn C:\Program Files\CMake\bin C:\Program Files\Microsoft SQL Server\120\Tools\Binn C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn C:\Program Files\Microsoft SQL Server\100\Tools\Binn C:\Program Files\Microsoft SQL Server\100\DTS\Binn C:\Program Files (x86)\Common Files\GTK\2.0\bin C:\Program Files\Zulu\zulu-13-jre\bin C:\bin\graphviz\bin C:\bin\luajit\bin C:\Program Files\Git\cmd C:\Users\kuzuki\.cargo\bin C:\Program Files (x86)\Nmap C:\Users\kuzuki\AppData\Local\Microsoft\WindowsApps C:\bin\Ruby26-x64\bin C:\Program Files (x86)\FlacSquisher C:\bin\vgmstream C:\bin\hsp351 C:\Users\kuzuki\AppData\Local\Programs\Microsoft VS Code\bin C:\Users\kuzuki\AppData\Roaming\npm C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.3\bin C:\Users\kuzuki\MacOS9\GTK\2.0\bin C:\bin\graphviz\bin C:\bin\luajit\src C:\Program Files\smartmontools\bin C:\Users\kuzuki\build\doom-emacs\bin C:\Program Files\Git\usr\bin\vendor_perl C:\Program Files\Git\usr\bin\core_perl c:/bin/emacs-26.2/libexec/emacs/26.2/x86_64-w64-mingw32/)
config  envfile    envvar-file
        elc-files  0
        modules    (:input japanese :completion company ivy :ui doom doom-dashboard doom-quit hl-todo modeline ophints (popup +defaults) vc-gutter vi-tilde-fringe workspaces :editor (evil +everywhere) file-templates fold snippets :emacs dired electric undo vc :checkers syntax :tools (eval +overlay) lookup lsp magit :lang emacs-lisp lua markdown org sh :config (default +bindings +smartparens))
        packages   ((lispyville))
        unpin      (n/a)
        elpa       (n/a)

:completion ivy bug external windows resolved

Comentários muito úteis

Experimente 8024f4e. Espero que conserte isso.

Todos 27 comentários

Esta é uma solução universal (para todos os usuários do Windows)? Precisamos detectar mingw executando bash vs mingw _not_ executando bash?

E se esta _é_ uma solução universal, ela deve (pelo menos a correção counsel-rg-base-command ) ser relatada ao advogado ?

Foi relatado ao conselho, mas está bloqueado em uma refatoração em grande escala.

abo-abo / swiper # 2351

@ Ruin0x11 , obrigado pelo snippet que você forneceu, eu sou novo no doom-emacs e é essencial para mim usá-lo em diferentes sistemas, incluindo Windows.

GNU Emacs 26.1
Windows10 1809

Ack, liguei o problema errado. Bem, isso deve ser corrigido em f548ab6. Vou deixar isso aberto até que seja resolvido no upstream.

Você deve adicionar MSYS2_ARG_CONV_EXCL=--path-separator= em seu ambiente.
Consulte https://github.com/sharkdp/fd/issues/537#issuecomment -636422669

Ack, liguei o problema errado. Bem, isso deve ser corrigido em f548ab6 . Vou deixar isso aberto até que seja resolvido no upstream.

Este commit quebra as coisas para mim.

Antes disso, +default/search-project funcionava sem problemas. Agora, o mesmo comando dá um resultado vazio com

error code 2

Eu dividi os commits e esse é o responsável

Na verdade, uma investigação mais aprofundada mostra que o novo comando rg é inválido no Windows:

C:\Users\guraltsev\.config>rg --path-separator // test
A path separator must be exactly one byte, but the given separator is 2 bytes: //
In some shells on Windows '/' is automatically expanded. Use '//' instead.

enquanto

C:\Users\guraltsev\.config>rg --path-separator / test

funciona perfeitamente.

Tenho o último rg para windows:

C:\Users\guraltsev\.config>rg --version
ripgrep 12.1.1 (rev 7cb211378a)
-SIMD -AVX (compiled)

@hlissner
Esta é uma solução universal (para todos os usuários do Windows)? Precisamos detectar mingw executando bash vs mingw _not_ executando bash?

Aparentemente não. Corrida

rg --path-separator / test

funciona em CMD, mas não em um shell mingw
enquanto trabalha no mingw

rg --path-separator // test

mas não em um prompt de cmd padrão.

Só quero comentar que, de maneira semelhante, tive que mudar o --path-separator // que foi definido para counsel-rg-base-command algum lugar para usar um único /.

(if (eq system-type 'windows-nt)
    (setq counsel-rg-base-command
          "rg -M 240 --with-filename --no-heading --line-number --color never %s --path-separator / ."))

Também usando Windows 10 e provavelmente (?) Shell cmd padrão.

Se você não quiser reescrever todo o comando (na verdade, é uma lista), aqui está o código que uso

(after! ivy
  (let* ((counsel-rg counsel-rg-base-command)
      (post-path-sep (member "--path-separator" counsel-rg)))
  (when post-path-sep
    (setcdr post-path-sep (cons "/" (cddr post-path-sep)))
    (setq counsel-rg-base-command counsel-rg))))

Nenhum dos métodos acima funcionou para mim - ripgrep diretamente se recusou a funcionar (ou melhor, mingw? Não entendi realmente quem é o bandido), nem com "/" nem com "//". Depois de perceber que não tinha feito nenhum trabalho por uma hora, desisti e optei pela indexação nativa do projétil no elisp:

(setq projectile-indexing-method 'native)

Não sou um usuário do Windows, então não posso fazer testes extensivos nisso. Alguém pode recomendar uma solução alternativa (talvez para detectar sempre que // é necessário)? Ou sou forçado a sempre jogar um grupo de usuários debaixo do ônibus? Em caso afirmativo, alguma ideia sobre qual caso de uso é mais comum para usuários do Emacs no Windows?

Não posso falar em geral, mas no meu PC de trabalho a sugestão de @guraltsev faz maravilhas.
Acabei de adicionar o snippet de https://github.com/hlissner/doom-emacs/issues/3215#issuecomment -641581336 ao meu .doom.d / config.el e posso usar o ripgrep como está na configuração padrão do dooms.

Configuração do PC:
ripgrep e emacs instalados via scoop
apenas o snippet de @guraltsev em meu config.el

Não posso falar em geral, mas no meu PC de trabalho a sugestão de @guraltsev faz maravilhas.

Não era bem isso que eu estava pedindo. Eu quis dizer uma correção para determinar se --path-separator / ou --path-separator // é necessário no momento da chamada. A solução de Guraltsev é substituir um pelo outro, uma vez e globalmente, mas isso não resolve o problema para os usuários para os quais essa configuração é necessária para que funcione.

Concordo, a solução mais geral é usar o ambiente MSYS2_ARG_CONV_EXCL=--path-separator= como eu disse acima .

@chuxubank Ah, eu perdi isso. Perfeito. Vou pensar em incorporar isso ao Doom em breve. Obrigado!

Em 523e945, esse problema deve ser resolvido. Avise-me se não for o caso e reabrirei.

@hlissner desde essa mudança, estou recebendo um erro ao tentar mudar de projeto. Parece haver alteração na chamada de função file-remote-p ?

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  find-file-name-handler(nil file-remote-p)
  file-remote-p(nil nil t)
  (if (file-remote-p buffer-file-name nil t) (cl-find-if find-exe-fn (list "fdfind" "fd")) doom-projectile-fd-binary)
  (and t (if (file-remote-p buffer-file-name nil t) (cl-find-if find-exe-fn (list "fdfind" "fd")) doom-projectile-fd-binary))
  (let* ((bin (and t (if (file-remote-p buffer-file-name nil t) (cl-find-if find-exe-fn (list "fdfind" "fd")) doom-projectile-fd-binary)))) (if bin (concat (format "%s . -0 -H -E .git --color=never --type file --typ..." bin) (if IS-WINDOWS " --path-separator=/")) nil))
  (cond ((let* ((bin (and t (if (file-remote-p buffer-file-name nil t) (cl-find-if find-exe-fn ...) doom-projectile-fd-binary)))) (if bin (concat (format "%s . -0 -H -E .git --color=never --type file --typ..." bin) (if IS-WINDOWS " --path-separator=/")) nil))) ((funcall find-exe-fn "rg") (concat "rg -0 --files --follow --color=never --hidden" (let* ((--cl-var-- projectile-globally-ignored-directories) (dir nil) (--cl-var-- "")) (while (consp --cl-var--) (setq dir (car --cl-var--)) (setq --cl-var-- (concat --cl-var-- " --glob ")) (setq --cl-var-- (concat --cl-var-- (shell-quote-argument ...))) (setq --cl-var-- (cdr --cl-var--))) --cl-var--) (if IS-WINDOWS " --path-separator /"))) ("find . -type f -print0"))
  (let ((find-exe-fn (if EMACS27+ (doom-rpartial #'executable-find t) #'executable-find))) (cond ((let* ((bin (and t (if ... ... doom-projectile-fd-binary)))) (if bin (concat (format "%s . -0 -H -E .git --color=never --type file --typ..." bin) (if IS-WINDOWS " --path-separator=/")) nil))) ((funcall find-exe-fn "rg") (concat "rg -0 --files --follow --color=never --hidden" (let* ((--cl-var-- projectile-globally-ignored-directories) (dir nil) (--cl-var-- "")) (while (consp --cl-var--) (setq dir (car --cl-var--)) (setq --cl-var-- (concat --cl-var-- " --glob ")) (setq --cl-var-- (concat --cl-var-- ...)) (setq --cl-var-- (cdr --cl-var--))) --cl-var--) (if IS-WINDOWS " --path-separator /"))) ("find . -type f -print0")))
  (closure (t) (_) (let ((find-exe-fn (if EMACS27+ (doom-rpartial #'executable-find t) #'executable-find))) (cond ((let* ((bin ...)) (if bin (concat ... ...) nil))) ((funcall find-exe-fn "rg") (concat "rg -0 --files --follow --color=never --hidden" (let* (... ... ...) (while ... ... ... ... ...) --cl-var--) (if IS-WINDOWS " --path-separator /"))) ("find . -type f -print0"))))(git)
  funcall((closure (t) (_) (let ((find-exe-fn (if EMACS27+ (doom-rpartial #'executable-find t) #'executable-find))) (cond ((let* ((bin ...)) (if bin (concat ... ...) nil))) ((funcall find-exe-fn "rg") (concat "rg -0 --files --follow --color=never --hidden" (let* (... ... ...) (while ... ... ... ... ...) --cl-var--) (if IS-WINDOWS " --path-separator /"))) ("find . -type f -print0")))) git)
  (if (functionp projectile-generic-command) (funcall projectile-generic-command vcs) projectile-generic-command)
  doom--only-use-generic-command-a(git)
  apply(doom--only-use-generic-command-a git)
  projectile-get-ext-command(git)
  projectile-dir-files-alien("/Users/jsmestad/code/headsdown/app/")
  projectile-dir-files("/Users/jsmestad/code/headsdown/app/")
  #f(compiled-function (dir) #<bytecode 0xf8036c2177f509f>)("/Users/jsmestad/code/headsdown/app/")
  mapcan(#f(compiled-function (dir) #<bytecode 0xf8036c2177f509f>) ("/Users/jsmestad/code/headsdown/app/"))
  cl-mapcan(#f(compiled-function (dir) #<bytecode 0xf8036c2177f509f>) ("/Users/jsmestad/code/headsdown/app/"))
  projectile-project-files("/Users/jsmestad/code/headsdown/app/")
  projectile-current-project-files()
  counsel-projectile-find-file(nil)
  funcall-interactively(counsel-projectile-find-file nil)
  call-interactively(counsel-projectile-find-file)
  (cond ((and projectile-project-root (file-equal-p projectile-project-root default-directory)) (if (doom-project-p default-directory) nil (setq projectile-enable-caching nil)) (call-interactively (if (doom-module-p :completion 'ivy) #'counsel-projectile-find-file #'projectile-find-file))) ((fboundp 'counsel-file-jump) (call-interactively #'counsel-file-jump)) ((project-current) (project-find-file-in nil (list default-directory) nil)) ((fboundp 'helm-find-files) (call-interactively #'helm-find-files)) ((call-interactively #'find-file)))
  (let* ((default-directory (file-truename (expand-file-name dir))) (projectile-project-root (doom-project-root default-directory)) (projectile-enable-caching projectile-enable-caching)) (cond ((and projectile-project-root (file-equal-p projectile-project-root default-directory)) (if (doom-project-p default-directory) nil (setq projectile-enable-caching nil)) (call-interactively (if (doom-module-p :completion 'ivy) #'counsel-projectile-find-file #'projectile-find-file))) ((fboundp 'counsel-file-jump) (call-interactively #'counsel-file-jump)) ((project-current) (project-find-file-in nil (list default-directory) nil)) ((fboundp 'helm-find-files) (call-interactively #'helm-find-files)) ((call-interactively #'find-file))))
  doom-project-find-file("~/code/headsdown/app/")
  funcall(doom-project-find-file "~/code/headsdown/app/")
  (if current-prefix-arg nil (funcall +workspaces-switch-project-function +workspaces--project-dir))
  (if (and (not (null +workspaces-on-switch-project-behavior)) (or (eq +workspaces-on-switch-project-behavior t) (equal (safe-persp-name (get-current-persp)) persp-nil-name) (+workspace-buffer-list))) (let* ((persp (let ((project-name (doom-project-name +workspaces--project-dir))) (or (+workspace-get project-name t) (+workspace-new project-name)))) (new-name (progn (progn (aref persp 1))))) (+workspace-switch new-name) (save-current-buffer (set-buffer (doom-fallback-buffer)) (setq default-directory +workspaces--project-dir) (hack-dir-local-variables-non-file-buffer)) (if current-prefix-arg nil (funcall +workspaces-switch-project-function +workspaces--project-dir)) (+workspace-message (format "Switched to '%s' in new workspace" new-name) 'success)) (save-current-buffer (set-buffer (doom-fallback-buffer)) (setq default-directory +workspaces--project-dir) (hack-dir-local-variables-non-file-buffer) (message "Switched to '%s'" (doom-project-name +workspaces--project-dir))) (condition-case err (+workspace-rename (+workspace-current-name) (doom-project-name +workspaces--project-dir)) ((debug error) (message "Workspace error: %s" err) nil)) (if current-prefix-arg nil (funcall +workspaces-switch-project-function +workspaces--project-dir)))
  (unwind-protect (if (and (not (null +workspaces-on-switch-project-behavior)) (or (eq +workspaces-on-switch-project-behavior t) (equal (safe-persp-name (get-current-persp)) persp-nil-name) (+workspace-buffer-list))) (let* ((persp (let ((project-name ...)) (or (+workspace-get project-name t) (+workspace-new project-name)))) (new-name (progn (progn (aref persp 1))))) (+workspace-switch new-name) (save-current-buffer (set-buffer (doom-fallback-buffer)) (setq default-directory +workspaces--project-dir) (hack-dir-local-variables-non-file-buffer)) (if current-prefix-arg nil (funcall +workspaces-switch-project-function +workspaces--project-dir)) (+workspace-message (format "Switched to '%s' in new workspace" new-name) 'success)) (save-current-buffer (set-buffer (doom-fallback-buffer)) (setq default-directory +workspaces--project-dir) (hack-dir-local-variables-non-file-buffer) (message "Switched to '%s'" (doom-project-name +workspaces--project-dir))) (condition-case err (+workspace-rename (+workspace-current-name) (doom-project-name +workspaces--project-dir)) ((debug error) (message "Workspace error: %s" err) nil)) (if current-prefix-arg nil (funcall +workspaces-switch-project-function +workspaces--project-dir))) (run-hooks 'projectile-after-switch-project-hook) (setq +workspaces--project-dir nil))
  (progn (if projectile-before-switch-project-hook (progn (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (setq default-directory +workspaces--project-dir) (hack-dir-local-variables-non-file-buffer) (run-hooks ...)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))) (unwind-protect (if (and (not (null +workspaces-on-switch-project-behavior)) (or (eq +workspaces-on-switch-project-behavior t) (equal (safe-persp-name (get-current-persp)) persp-nil-name) (+workspace-buffer-list))) (let* ((persp (let (...) (or ... ...))) (new-name (progn (progn ...)))) (+workspace-switch new-name) (save-current-buffer (set-buffer (doom-fallback-buffer)) (setq default-directory +workspaces--project-dir) (hack-dir-local-variables-non-file-buffer)) (if current-prefix-arg nil (funcall +workspaces-switch-project-function +workspaces--project-dir)) (+workspace-message (format "Switched to '%s' in new workspace" new-name) 'success)) (save-current-buffer (set-buffer (doom-fallback-buffer)) (setq default-directory +workspaces--project-dir) (hack-dir-local-variables-non-file-buffer) (message "Switched to '%s'" (doom-project-name +workspaces--project-dir))) (condition-case err (+workspace-rename (+workspace-current-name) (doom-project-name +workspaces--project-dir)) ((debug error) (message "Workspace error: %s" err) nil)) (if current-prefix-arg nil (funcall +workspaces-switch-project-function +workspaces--project-dir))) (run-hooks 'projectile-after-switch-project-hook) (setq +workspaces--project-dir nil)))
  (if (and persp-mode +workspaces--project-dir) (progn (if projectile-before-switch-project-hook (progn (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ... ... ...) (and ... ...)))))) (unwind-protect (if (and (not (null +workspaces-on-switch-project-behavior)) (or (eq +workspaces-on-switch-project-behavior t) (equal (safe-persp-name ...) persp-nil-name) (+workspace-buffer-list))) (let* ((persp (let ... ...)) (new-name (progn ...))) (+workspace-switch new-name) (save-current-buffer (set-buffer (doom-fallback-buffer)) (setq default-directory +workspaces--project-dir) (hack-dir-local-variables-non-file-buffer)) (if current-prefix-arg nil (funcall +workspaces-switch-project-function +workspaces--project-dir)) (+workspace-message (format "Switched to '%s' in new workspace" new-name) 'success)) (save-current-buffer (set-buffer (doom-fallback-buffer)) (setq default-directory +workspaces--project-dir) (hack-dir-local-variables-non-file-buffer) (message "Switched to '%s'" (doom-project-name +workspaces--project-dir))) (condition-case err (+workspace-rename (+workspace-current-name) (doom-project-name +workspaces--project-dir)) ((debug error) (message "Workspace error: %s" err) nil)) (if current-prefix-arg nil (funcall +workspaces-switch-project-function +workspaces--project-dir))) (run-hooks 'projectile-after-switch-project-hook) (setq +workspaces--project-dir nil))))
  (let (projectile-project-root) (if (and persp-mode +workspaces--project-dir) (progn (if projectile-before-switch-project-hook (progn (let ((temp-buffer ...)) (save-current-buffer (set-buffer temp-buffer) (unwind-protect ... ...))))) (unwind-protect (if (and (not (null +workspaces-on-switch-project-behavior)) (or (eq +workspaces-on-switch-project-behavior t) (equal ... persp-nil-name) (+workspace-buffer-list))) (let* ((persp ...) (new-name ...)) (+workspace-switch new-name) (save-current-buffer (set-buffer ...) (setq default-directory +workspaces--project-dir) (hack-dir-local-variables-non-file-buffer)) (if current-prefix-arg nil (funcall +workspaces-switch-project-function +workspaces--project-dir)) (+workspace-message (format "Switched to '%s' in new workspace" new-name) 'success)) (save-current-buffer (set-buffer (doom-fallback-buffer)) (setq default-directory +workspaces--project-dir) (hack-dir-local-variables-non-file-buffer) (message "Switched to '%s'" (doom-project-name +workspaces--project-dir))) (condition-case err (+workspace-rename (+workspace-current-name) (doom-project-name +workspaces--project-dir)) ((debug error) (message "Workspace error: %s" err) nil)) (if current-prefix-arg nil (funcall +workspaces-switch-project-function +workspaces--project-dir))) (run-hooks 'projectile-after-switch-project-hook) (setq +workspaces--project-dir nil)))))
  +workspaces-switch-to-project-h("~/code/headsdown/app/")
  ivy-call()
  #f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially.  An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero.  Otherwise, use the first occurrence of\nPRESELECT in the collection.  Comparison is first done with\n`equal'.  If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input.  It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0x1b52ab6db99ed806>)("[app] Switch to project: " ("~/code/headsdown/app/" "~/org/" "~/.emacs-doom.d/" "~/code/self/justinsmestad-static/") :preselect "~/code/headsdown/app/" :action (1 ("o" +workspaces-switch-to-project-h "open project in new workspace") ("O" counsel-projectile-switch-project-action "jump to a project buffer or file") ("f" counsel-projectile-switch-project-action-find-file "jump to a project file") ("d" counsel-projectile-switch-project-action-find-dir "jump to a project directory") ("b" counsel-projectile-switch-project-action-switch-to-buffer "jump to a project buffer") ("m" counsel-projectile-switch-project-action-find-file-manually "find file manually from project root") ("w" counsel-projectile-switch-project-action-save-all-buffers "save all project buffers") ("k" counsel-projectile-switch-project-action-kill-buffers "kill all project buffers") ("r" counsel-projectile-switch-project-action-remove-known-project "remove project from known projects") ("c" counsel-projectile-switch-project-action-compile "run project compilation command") ("C" counsel-projectile-switch-project-action-configure "run project configure command") ("e" counsel-projectile-switch-project-action-edit-dir-locals "edit project dir-locals") ("v" counsel-projectile-switch-project-action-vc "open project in vc-dir / magit / monky") ("s" (lambda (project) (let ((projectile-switch-project-action ...)) (counsel-projectile-switch-project-by-name project))) "search project") ("xs" counsel-projectile-switch-project-action-run-shell "invoke shell from project root") ("xe" counsel-projectile-switch-project-action-run-eshell "invoke eshell from project root") ("xt" counsel-projectile-switch-project-action-run-term "invoke term from project root") ("X" counsel-projectile-switch-project-action-org-capture "org-capture into project")) :require-match t :sort nil :caller counsel-projectile-switch-project :sort t)
  apply(#f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially.  An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero.  Otherwise, use the first occurrence of\nPRESELECT in the collection.  Comparison is first done with\n`equal'.  If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input.  It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0x1b52ab6db99ed806>) ("[app] Switch to project: " ("~/code/headsdown/app/" "~/org/" "~/.emacs-doom.d/" "~/code/self/justinsmestad-static/") :preselect "~/code/headsdown/app/" :action (1 ("o" +workspaces-switch-to-project-h "open project in new workspace") ("O" counsel-projectile-switch-project-action "jump to a project buffer or file") ("f" counsel-projectile-switch-project-action-find-file "jump to a project file") ("d" counsel-projectile-switch-project-action-find-dir "jump to a project directory") ("b" counsel-projectile-switch-project-action-switch-to-buffer "jump to a project buffer") ("m" counsel-projectile-switch-project-action-find-file-manually "find file manually from project root") ("w" counsel-projectile-switch-project-action-save-all-buffers "save all project buffers") ("k" counsel-projectile-switch-project-action-kill-buffers "kill all project buffers") ("r" counsel-projectile-switch-project-action-remove-known-project "remove project from known projects") ("c" counsel-projectile-switch-project-action-compile "run project compilation command") ("C" counsel-projectile-switch-project-action-configure "run project configure command") ("e" counsel-projectile-switch-project-action-edit-dir-locals "edit project dir-locals") ("v" counsel-projectile-switch-project-action-vc "open project in vc-dir / magit / monky") ("s" (lambda (project) (let ((projectile-switch-project-action ...)) (counsel-projectile-switch-project-by-name project))) "search project") ("xs" counsel-projectile-switch-project-action-run-shell "invoke shell from project root") ("xe" counsel-projectile-switch-project-action-run-eshell "invoke eshell from project root") ("xt" counsel-projectile-switch-project-action-run-term "invoke term from project root") ("X" counsel-projectile-switch-project-action-org-capture "org-capture into project")) :require-match t :sort nil :caller counsel-projectile-switch-project :sort t))
  ivy-read("[app] Switch to project: " ("~/code/headsdown/app/" "~/org/" "~/.emacs-doom.d/" "~/code/self/justinsmestad-static/") :preselect "~/code/headsdown/app/" :action (1 ("o" +workspaces-switch-to-project-h "open project in new workspace") ("O" counsel-projectile-switch-project-action "jump to a project buffer or file") ("f" counsel-projectile-switch-project-action-find-file "jump to a project file") ("d" counsel-projectile-switch-project-action-find-dir "jump to a project directory") ("b" counsel-projectile-switch-project-action-switch-to-buffer "jump to a project buffer") ("m" counsel-projectile-switch-project-action-find-file-manually "find file manually from project root") ("w" counsel-projectile-switch-project-action-save-all-buffers "save all project buffers") ("k" counsel-projectile-switch-project-action-kill-buffers "kill all project buffers") ("r" counsel-projectile-switch-project-action-remove-known-project "remove project from known projects") ("c" counsel-projectile-switch-project-action-compile "run project compilation command") ("C" counsel-projectile-switch-project-action-configure "run project configure command") ("e" counsel-projectile-switch-project-action-edit-dir-locals "edit project dir-locals") ("v" counsel-projectile-switch-project-action-vc "open project in vc-dir / magit / monky") ("s" (lambda (project) (let ((projectile-switch-project-action (lambda nil ...))) (counsel-projectile-switch-project-by-name project))) "search project") ("xs" counsel-projectile-switch-project-action-run-shell "invoke shell from project root") ("xe" counsel-projectile-switch-project-action-run-eshell "invoke eshell from project root") ("xt" counsel-projectile-switch-project-action-run-term "invoke term from project root") ("X" counsel-projectile-switch-project-action-org-capture "org-capture into project")) :require-match t :sort nil :caller counsel-projectile-switch-project)
  counsel-projectile-switch-project()
  funcall-interactively(counsel-projectile-switch-project)
  call-interactively(counsel-projectile-switch-project nil nil)
  command-execute(counsel-projectile-switch-project)

@jsmestad Não tenho certeza se você percebeu, mas 4205f1bbeae4 e da1030985d4c devem ter resolvido esse problema.

Ainda estou tendo esse bug no Windows 10. Definir o separador de caminho para uma única barra resolve isso. rg instalado via scoop.

@hliebert Tem certeza de que atualizou Doom? Já está definido para uma única barra .

Esta foi uma nova instalação, ganhei um novo laptop com Windows do trabalho. Eu o tinha instalado um dia antes de postar.

@hlissner Acabei de testar e posso confirmar que isso ainda ocorre no último destino.

Doom v2.0.9 (ffbd7b63bf7290b6cd6fc3f1b41110876864fe83)
Emacs v26.3
Branch: develop
Build date: 2020-08-02 01:33:51 -0400

Edit: Aparentemente, o valor padrão é alterado em algum lugar.

counsel-rg-base-command is a variable defined in counsel.el.

Value
("rg" "-M" "240" "--with-filename" "--no-heading" "--line-number" "--color" "never" "%s" "--path-separator" "//" ".")

Original Value
("rg" "-M" "240" "--with-filename" "--no-heading" "--line-number" "--color" "never" "%s" "--path-separator" "/" ".")

A mesma história para mim que @hliebert , o último Doom, Emacs e rg instalado via scoop, e o valor original para counsel-rg-base-command está sendo alterado em algum lugar para usar 2 barras

Experimente 8024f4e. Espero que conserte isso.

Funcionando perfeitamente, obrigado @hlissner!

Esta página foi útil?
0 / 5 - 0 avaliações