Doom-emacs: projectile-find-file dan + default / search-cwd (fd) salah memperluas '/' ke jalur absolut di Windows

Dibuat pada 24 Mei 2020  ·  27Komentar  ·  Sumber: hlissner/doom-emacs

Apa yang Anda harapkan terjadi?

projectile-find-file dan +default/search-cwd harus mencantumkan jalur bertingkat dengan benar.

Apa yang sebenarnya terjadi?

Di Windows dengan mingw diinstal, jenis keluaran ini ditampilkan untuk kedua perintah:

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

Detil tambahan:

Lihat masalah ini untuk detailnya:

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

Saya memperbaiki masalah ini dengan cuplikan berikut:

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

Sistem Informasi:

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

Komentar yang paling membantu

Coba 8024f4e. Semoga harus memperbaiki ini.

Semua 27 komentar

Apakah ini solusi universal (untuk semua pengguna Windows)? Apakah kita perlu mendeteksi mingw running bash vs mingw _not_ running bash?

Dan jika ini _adalah solusi universal, haruskah itu (setidaknya counsel-rg-base-command perbaikan) dilaporkan ke penasihat ?

Ini telah dilaporkan ke penasihat hukum, tetapi diblokir pada pemfaktoran ulang skala besar.

abo-abo / swiper # 2351

@ Ruin0x11 , terima kasih atas cuplikan yang telah Anda berikan, saya baru

GNU Emacs 26.1
Windows10 1809

Ya ampun, saya menautkan masalah yang salah. Ah, ini harus diperbaiki di f548ab6. Saya akan membiarkan ini terbuka sampai ditangani di bagian hulu.

Anda harus menambahkan MSYS2_ARG_CONV_EXCL=--path-separator= ke lingkungan Anda.
Lihat https://github.com/sharkdp/fd/issues/537#issuecomment -636422669

Ya ampun, saya menautkan masalah yang salah. Ah, ini harus diperbaiki di f548ab6 . Saya akan membiarkan ini terbuka sampai ditangani di bagian hulu.

Komitmen ini merusak banyak hal bagi saya.

Sebelum itu +default/search-project bekerja tanpa masalah. Sekarang perintah yang sama memberikan hasil kosong dengan

error code 2

Saya membagi dua komitmen dan itulah yang bertanggung jawab

Sebenarnya, penyelidikan lebih lanjut menunjukkan bahwa perintah rg baru tidak valid di bawah 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.

sementara

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

bekerja dengan sempurna.

Saya memiliki rg untuk windows:

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

@tokopedia
Apakah ini solusi universal (untuk semua pengguna Windows)? Apakah kita perlu mendeteksi mingw running bash vs mingw _not_ running bash?

Sepertinya tidak. Lari

rg --path-separator / test

bekerja di CMD tetapi tidak di shell mingw
saat bekerja di mingw

rg --path-separator // test

tetapi tidak dalam prompt cmd standar.

Hanya ingin memberi komentar bahwa dengan cara yang sama saya harus mengubah --path-separator // yang disetel menjadi counsel-rg-base-command suatu tempat untuk menggunakan satu /.

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

Juga menggunakan Windows 10 dan mungkin (?) Shell cmd standar.

Jika Anda tidak ingin menulis ulang seluruh perintah (yang sebenarnya adalah daftar), berikut adalah kode yang saya gunakan

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

Tak satu pun dari metode di atas berhasil untuk saya - ripgrep straight up menolak untuk bekerja (atau lebih tepatnya, mingw? Tidak benar-benar mengerti siapa orang jahatnya), baik dengan "/" maupun dengan "//". Setelah menyadari saya belum menyelesaikan pekerjaan apa pun selama satu jam, saya menyerah dan memilih pengindeksan asli proyektil di elisp:

(setq projectile-indexing-method 'native)

Bukan pengguna Windows, jadi saya tidak dapat melakukan pengujian ekstensif tentang ini. Adakah yang bisa merekomendasikan solusi (mungkin untuk mendeteksi kapan pun // diperlukan)? Atau apakah saya dipaksa untuk selalu membuang satu grup pengguna ke bawah bus? Jika ya, apakah ada informasi tentang kasus penggunaan mana yang lebih umum untuk pengguna Emacs di Windows?

Tidak dapat berbicara secara umum, tetapi pada PC kerja saya, saran dari @guraltsev sangat bermanfaat .
Saya baru saja menambahkan cuplikan dari https://github.com/hlissner/doom-emacs/issues/3215#issuecomment -641581336 ke .doom.d / config.el saya dan dapat menggunakan ripgrep sebagaimana dari konfigurasi default dooms.

Konfigurasi PC:
ripgrep dan emacs dipasang melalui scoop
hanya cuplikan dari @guraltsev di config.el saya

Tidak dapat berbicara secara umum, tetapi pada PC kerja saya, saran dari @guraltsev sangat bermanfaat .

Bukan itu yang saya minta. Maksud saya perbaikan untuk menentukan apakah --path-separator / atau --path-separator // diperlukan pada waktu panggilan. Solusi Guraltsev adalah mengganti satu dengan yang lain, sekali dan secara global, tetapi itu tidak menyelesaikan masalah bagi pengguna yang memerlukan pengaturan tersebut agar dapat berfungsi.

Setuju, solusi yang lebih umum adalah menggunakan lingkungan MSYS2_ARG_CONV_EXCL=--path-separator= seperti yang saya katakan di atas .

@chuxubank Ah, saya melewatkan itu. Itu sempurna. Saya akan segera mempertimbangkan untuk memasukkannya ke dalam Doom. Terima kasih!

Sejak 523e945 masalah ini harus diselesaikan. Beri tahu saya jika bukan itu masalahnya dan saya akan membukanya kembali.

@hlissner sejak perubahan ini saya mendapatkan kesalahan saat mencoba beralih proyek. Sepertinya ada di sekitar perubahan untuk file-remote-p function call?

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 Tidak yakin apakah Anda menyadarinya, tetapi 4205f1bbeae4 dan da1030985d4c seharusnya menyelesaikan masalah itu.

Saya masih mengalami bug ini di Windows 10. Mengatur pemisah jalur ke satu garis miring mengatasinya. rg diinstal melalui scoop.

@hliebert Apakah Anda yakin telah memperbarui Doom? Ini sudah disetel ke satu garis miring .

Ini adalah instalasi baru, saya mendapat laptop windows baru dari pekerjaan. Saya telah menginstalnya sehari sebelum saya memposting.

@hlissner Baru saja diuji dan dapat memastikan bahwa ini masih terjadi pada malapetaka terbaru.

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

Edit: Rupanya nilai default diubah di suatu tempat.

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

Cerita yang sama untuk saya seperti @hliebert , Doom, Emacs, dan rg terbaru diinstal melalui scoop, dan nilai asli untuk counsel-rg-base-command sedang diubah di suatu tempat untuk menggunakan 2 garis miring

Coba 8024f4e. Semoga harus memperbaiki ini.

Bekerja dengan sempurna, terima kasih @hlissner!

Apakah halaman ini membantu?
0 / 5 - 0 peringkat