Doom-emacs: projectile-find-file und + default / search-cwd (fd) erweitern '/' fälschlicherweise unter Windows auf den absoluten Pfad

Erstellt am 24. Mai 2020  ·  27Kommentare  ·  Quelle: hlissner/doom-emacs

Was hast du erwartet?

projectile-find-file und +default/search-cwd sollten verschachtelte Pfade korrekt auflisten.

Was wirklich passierte?

In Windows mit installiertem mingw wird diese Art der Ausgabe für beide Befehle angezeigt:

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

Zusätzliche Details:

Weitere Informationen finden Sie in dieser Ausgabe:

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

Ich habe dieses Problem mit dem folgenden Snippet behoben:

(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=//")))))

System Information:

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

Hilfreichster Kommentar

Versuchen Sie es mit 8024f4e. Sollte das hoffentlich beheben.

Alle 27 Kommentare

Ist dies eine universelle Lösung (für alle Windows-Benutzer)? Müssen wir mingw running bash vs mingw _not_ running bash erkennen?

Und wenn dies eine universelle Lösung ist, sollte sie (zumindest die counsel-rg-base-command Korrektur) dem Anwalt gemeldet werden?

Es wurde dem Anwalt gemeldet, aber es ist bei einem groß angelegten Refactoring blockiert.

abo-abo / swiper # 2351

@ Ruin0x11 , danke für das von Ihnen bereitgestellte Snippet. Ich bin neu in Doom-Emacs und es ist wichtig, dass ich es auf verschiedenen Systemen einschließlich Windows verwende.

GNU Emacs 26.1
Windows 10 1809

Ack, ich habe das falsche Problem verlinkt. Na ja, das sollte in f548ab6 behoben sein. Ich werde dies offen lassen, bis es stromaufwärts angesprochen wird.

Sie sollten Ihrer Umgebung MSYS2_ARG_CONV_EXCL=--path-separator= hinzufügen.
Siehe https://github.com/sharkdp/fd/issues/537#issuecomment -636422669

Ack, ich habe das falsche Problem verlinkt. Na ja , das sollte in

Dieses Commit bricht die Dinge für mich.

Vorher funktionierte +default/search-project ohne Probleme. Jetzt gibt der gleiche Befehl ein leeres Ergebnis mit

error code 2

Ich habe die Commits halbiert und das ist derjenige, der dafür verantwortlich ist

Weitere Untersuchungen zeigen, dass der neue Befehl rg unter Windows ungültig ist:

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.

während

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

funktioniert perfekt.

Ich habe die neuesten rg für Windows:

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

@hlissner
Ist dies eine universelle Lösung (für alle Windows-Benutzer)? Müssen wir mingw running bash vs mingw _not_ running bash erkennen?

Scheinbar nicht. Laufen

rg --path-separator / test

funktioniert in CMD, aber nicht in einer Mingw-Shell
während arbeitet in mingw

rg --path-separator // test

aber nicht in einer Standard-Cmd-Eingabeaufforderung.

Ich möchte nur kommentieren, dass ich auf ähnliche Weise das --path-separator // ändern musste, das irgendwo auf counsel-rg-base-command , um ein einzelnes / zu verwenden.

(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 / ."))

Auch mit Windows 10 und wahrscheinlich (?) Standard-Cmd-Shell.

Wenn Sie nicht den gesamten Befehl neu schreiben möchten (das ist eigentlich eine Liste), ist hier der Code, den ich verwende

(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))))

Keine der oben genannten Methoden hat bei mir funktioniert - ripgrep hat sich direkt geweigert zu arbeiten (oder besser gesagt, mingw? Hat nicht wirklich verstanden, wer der Böse ist), weder mit "/" noch mit "//". Nachdem mir klar wurde, dass ich seit einer Stunde keine Arbeit mehr erledigt habe, gab ich auf und entschied mich für die native Indizierung von projectile in elisp:

(setq projectile-indexing-method 'native)

Da ich kein Windows-Benutzer bin, kann ich diesbezüglich keine umfangreichen Tests durchführen. Kann jemand eine Problemumgehung empfehlen (vielleicht um zu erkennen, wann immer // notwendig ist)? Oder bin ich gezwungen, immer eine Benutzergruppe unter den Bus zu werfen? Wenn ja, gibt es Einblicke in welchen Anwendungsfall für Emacs-Benutzer unter Windows häufiger?

Ich kann im Allgemeinen nicht sprechen, aber auf meinem Arbeits-PC wirkt der Vorschlag von @guraltsev Wunder.
Ich habe gerade das Snippet von https://github.com/hlissner/doom-emacs/issues/3215#issuecomment -641581336 zu meiner .doom.d / config.el hinzugefügt und kann ripgrep wie in der Dooms-Standardkonfiguration verwenden.

PC-Konfiguration:
ripgrep und emacs per scoop installiert
nur das Snippet von @guraltsev in meiner config.el

Ich kann im Allgemeinen nicht sprechen, aber auf meinem Arbeits-PC wirkt der Vorschlag von @guraltsev Wunder.

Das ist nicht ganz das, wonach ich gefragt habe. Ich meinte eine Korrektur, um festzustellen, ob --path-separator / oder --path-separator // Zeitpunkt des Anrufs erforderlich ist. Guraltsevs Lösung besteht darin, eine einmalig und global durch die andere zu ersetzen. Dies löst jedoch nicht das Problem für Benutzer, für die diese Einstellung erforderlich ist, damit sie funktioniert.

Stimmen Sie zu, die allgemeinere Lösung besteht darin, die MSYS2_ARG_CONV_EXCL=--path-separator= -Umgebung zu verwenden, wie ich oben sagte.

@chuxubank Ah, das habe ich verpasst. Das ist perfekt. Ich werde versuchen, das bald in Doom zu integrieren. Vielen Dank!

Ab 523e945 sollte dieses Problem behoben sein. Lassen Sie mich wissen, wenn dies nicht der Fall ist, und ich werde es wieder öffnen.

@hlissner seit dieser Änderung file-remote-p Funktionsaufruf zu sein?

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 Ich

Unter Windows 10 tritt dieser Fehler immer noch auf. Wenn Sie das Pfadtrennzeichen auf einen einzelnen Schrägstrich setzen, wird er behoben. rg über Schaufel installiert.

@hliebert Bist du sicher, dass du Doom aktualisiert hast? Es ist bereits ein einzelner Schrägstrich festgelegt .

Dies war bei einer Neuinstallation, ich bekam einen neuen Windows-Laptop von der Arbeit. Ich hatte es am Tag vor dem Posten installiert.

@hlissner Gerade getestet und kann bestätigen, dass dies immer noch auf dem neuesten Doom auftritt.

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

Bearbeiten: Anscheinend wird der Standardwert irgendwo geändert.

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" "/" ".")

Dieselbe Geschichte für mich wie rg , die über scoop installiert wurden, und der ursprüngliche Wert für counsel-rg-base-command wird irgendwo geändert, um 2 Schrägstriche zu verwenden

Versuchen Sie es mit 8024f4e. Sollte das hoffentlich beheben.

Funktioniert perfekt, danke @hlissner!

War diese Seite hilfreich?
0 / 5 - 0 Bewertungen