* bug#62735: 30.0.50; project.el project-search errors because project-files returns directories
@ 2023-04-08 21:45 Robert Nikander via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-09 23:15 ` Dmitry Gutov
0 siblings, 1 reply; 4+ messages in thread
From: Robert Nikander via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-04-08 21:45 UTC (permalink / raw)
To: 62735
Hi,
I tried to run the command `project-search`, documented in "29.2.1 Project Commands That Operate on Files”. It threw an error because it tried to process a directory. The backtrace from debugger is below.
The function defined right below `project-search` in project.el is `project-query-replace-regexp`. It has this comment and line:
;; XXX: Filter out Git submodules, which are not regular files.
;; `project-files' can return those, which is arguably suboptimal,
;; but removing them eagerly has performance cost.
(cl-delete-if-not #'file-regular-p (project-files (project-current t)))
I added the same to `project-search` and it seems to have “fixed” it. I don’t know how `project-files` works, but probably it would be better to fix that.
This directory “…/SomeDir/“ has a .git directory inside it. That appears to be why project-files picked it up, because deleting that .git subdir also avoids the error. But projects should be able to have nested .git directories, depending on how the ‘project’ is defined.
Rob
Debugger entered--Lisp error: (file-error "Read error" "Is a directory" "/Users/rob/Workspace/MonoRepo/Foo/SomeDir/")
insert-file-contents("/Users/rob/Workspace/MonoRepo/Foo/SomeDir/" nil)
(condition-case nil (insert-file-contents new nil) (file-missing (fileloop-next-file novisit)))
(if (not (and new novisit)) (set-buffer (find-file-noselect next)) (set-buffer (get-buffer-create " *next-file*")) (kill-all-local-variables) (erase-buffer) (setq new next) (condition-case nil (insert-file-contents new nil) (file-missing (fileloop-next-file novisit))))
(let* ((buffer (get-file-buffer next)) (new (not buffer))) (and buffer fileloop-revert-buffers (not (verify-visited-file-modtime buffer)) (if (eq fileloop-revert-buffers 'silent) (and (not (buffer-modified-p buffer)) (let ((revertible nil)) (let ((tail revert-without-query)) (while tail (let ... ... ...))) revertible)) (y-or-n-p (format (if (buffer-modified-p buffer) "File %s changed on disk. Discard your edits? " "File %s changed on disk. Reread from disk? ") next))) (save-current-buffer (set-buffer buffer) (revert-buffer t t))) (if (not (and new novisit)) (set-buffer (find-file-noselect next)) (set-buffer (get-buffer-create " *next-file*")) (kill-all-local-variables) (erase-buffer) (setq new next) (condition-case nil (insert-file-contents new nil) (file-missing (fileloop-next-file novisit)))) new)
(let ((next (condition-case nil (iter-next fileloop--iterator) (iter-end-of-sequence nil)))) (if next nil (and novisit (get-buffer " *next-file*") (kill-buffer " *next-file*")) (user-error "All files processed")) (let* ((buffer (get-file-buffer next)) (new (not buffer))) (and buffer fileloop-revert-buffers (not (verify-visited-file-modtime buffer)) (if (eq fileloop-revert-buffers 'silent) (and (not (buffer-modified-p buffer)) (let ((revertible nil)) (let (...) (while tail ...)) revertible)) (y-or-n-p (format (if (buffer-modified-p buffer) "File %s changed on disk. Discard your edits? " "File %s changed on disk. Reread from disk? ") next))) (save-current-buffer (set-buffer buffer) (revert-buffer t t))) (if (not (and new novisit)) (set-buffer (find-file-noselect next)) (set-buffer (get-buffer-create " *next-file*")) (kill-all-local-variables) (erase-buffer) (setq new next) (condition-case nil (insert-file-contents new nil) (file-missing (fileloop-next-file novisit)))) new))
fileloop-next-file(t)
fileloop-continue()
project-search("simple.*State")
In GNU Emacs 30.0.50 (build 1, x86_64-apple-darwin18.7.0, NS
appkit-1671.60 Version 10.14.6 (Build 18G95)) of 2023-03-05 built on
builder10-14.lan
Windowing system distributor 'Apple', version 10.3.2299
System Description: macOS 13.3
Configured using:
'configure --with-ns '--enable-locallisppath=/Library/Application
Support/Emacs/${version}/site-lisp:/Library/Application
Support/Emacs/site-lisp' --with-modules --with-x-toolkit=no'
Configured features:
ACL GMP GNUTLS JSON LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER SQLITE3
THREADS TOOLKIT_SCROLL_BARS ZLIB
Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Major mode: ELisp/l
Minor modes in effect:
global-git-commit-mode: t
magit-auto-revert-mode: t
server-mode: t
dap-tooltip-mode: t
dap-ui-many-windows-mode: t
dap-ui-controls-mode: t
dap-ui-mode: t
dap-auto-configure-mode: t
dap-mode: t
treemacs-filewatch-mode: t
treemacs-follow-mode: t
treemacs-git-mode: t
treemacs-fringe-indicator-mode: t
shell-dirtrack-mode: t
ivy-mode: t
org-extra-emphasis-intraword-emphasis-mode: t
cl-old-struct-compat-mode: t
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
line-number-mode: t
indent-tabs-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
Load-path shadows:
/Users/rob/.emacs.d/elpa/transient-20230315.1520/transient hides /Applications/Emacs.app/Contents/Resources/lisp/transient
/Users/rob/.emacs.d/elpa/xref-1.6.0/xref hides /Applications/Emacs.app/Contents/Resources/lisp/progmodes/xref
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-exp hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-exp
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-emacs-lisp hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-emacs-lisp
/Users/rob/.emacs.d/elpa/org-9.6.1/oc hides /Applications/Emacs.app/Contents/Resources/lisp/org/oc
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-css hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-css
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-lob hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-lob
/Users/rob/.emacs.d/elpa/org-9.6.1/ol-irc hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-irc
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-forth hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-forth
/Users/rob/.emacs.d/elpa/org-9.6.1/org-macs hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-macs
/Users/rob/.emacs.d/elpa/org-9.6.1/ob hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob
/Users/rob/.emacs.d/elpa/org-9.6.1/org-version hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-version
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-scheme hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-scheme
/Users/rob/.emacs.d/elpa/org-9.6.1/ox hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-C hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-C
/Users/rob/.emacs.d/elpa/org-9.6.1/org-capture hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-capture
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-ref hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-ref
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-clojure hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-clojure
/Users/rob/.emacs.d/elpa/org-9.6.1/org-mouse hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-mouse
/Users/rob/.emacs.d/elpa/org-9.6.1/org-persist hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-persist
/Users/rob/.emacs.d/elpa/org-9.6.1/org-ctags hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-ctags
/Users/rob/.emacs.d/elpa/org-9.6.1/org-entities hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-entities
/Users/rob/.emacs.d/elpa/org-9.6.1/org-archive hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-archive
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-screen hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-screen
/Users/rob/.emacs.d/elpa/org-9.6.1/ol-bibtex hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-bibtex
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-haskell hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-haskell
/Users/rob/.emacs.d/elpa/org-9.6.1/org-loaddefs hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-loaddefs
/Users/rob/.emacs.d/elpa/org-9.6.1/org-table hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-table
/Users/rob/.emacs.d/elpa/org-9.6.1/ol-eww hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-eww
/Users/rob/.emacs.d/elpa/org-9.6.1/ol-man hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-man
/Users/rob/.emacs.d/elpa/org-9.6.1/ox-org hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-org
/Users/rob/.emacs.d/elpa/org-9.6.1/org-num hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-num
/Users/rob/.emacs.d/elpa/org-9.6.1/org-plot hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-plot
/Users/rob/.emacs.d/elpa/org-9.6.1/ol-rmail hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-rmail
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-awk hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-awk
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-groovy hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-groovy
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-octave hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-octave
/Users/rob/.emacs.d/elpa/org-9.6.1/org-faces hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-faces
/Users/rob/.emacs.d/elpa/org-9.6.1/oc-biblatex hides /Applications/Emacs.app/Contents/Resources/lisp/org/oc-biblatex
/Users/rob/.emacs.d/elpa/org-9.6.1/org-colview hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-colview
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-R hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-R
/Users/rob/.emacs.d/elpa/org-9.6.1/org-refile hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-refile
/Users/rob/.emacs.d/elpa/org-9.6.1/org-timer hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-timer
/Users/rob/.emacs.d/elpa/org-9.6.1/org-mobile hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-mobile
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-fortran hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-fortran
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-shell hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-shell
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-perl hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-perl
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-sqlite hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-sqlite
/Users/rob/.emacs.d/elpa/org-9.6.1/oc-basic hides /Applications/Emacs.app/Contents/Resources/lisp/org/oc-basic
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-sed hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-sed
/Users/rob/.emacs.d/elpa/org-9.6.1/org-list hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-list
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-ruby hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-ruby
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-eval hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-eval
/Users/rob/.emacs.d/elpa/org-9.6.1/org-habit hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-habit
/Users/rob/.emacs.d/elpa/org-9.6.1/org-clock hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-clock
/Users/rob/.emacs.d/elpa/org-9.6.1/org-goto hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-goto
/Users/rob/.emacs.d/elpa/org-9.6.1/ox-html hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-html
/Users/rob/.emacs.d/elpa/org-9.6.1/org-src hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-src
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-lisp hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-lisp
/Users/rob/.emacs.d/elpa/org-9.6.1/ol-eshell hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-eshell
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-ditaa hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-ditaa
/Users/rob/.emacs.d/elpa/org-9.6.1/org-pcomplete hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-pcomplete
/Users/rob/.emacs.d/elpa/org-9.6.1/org-lint hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-lint
/Users/rob/.emacs.d/elpa/org-9.6.1/ox-latex hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-latex
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-sass hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-sass
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-tangle hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-tangle
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-calc hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-calc
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-java hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-java
/Users/rob/.emacs.d/elpa/org-9.6.1/ox-icalendar hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-icalendar
/Users/rob/.emacs.d/elpa/org-9.6.1/ol-mhe hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-mhe
/Users/rob/.emacs.d/elpa/org-9.6.1/org-attach-git hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-attach-git
/Users/rob/.emacs.d/elpa/org-9.6.1/ox-md hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-md
/Users/rob/.emacs.d/elpa/org-9.6.1/ox-beamer hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-beamer
/Users/rob/.emacs.d/elpa/org-9.6.1/org-element hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-element
/Users/rob/.emacs.d/elpa/org-9.6.1/oc-natbib hides /Applications/Emacs.app/Contents/Resources/lisp/org/oc-natbib
/Users/rob/.emacs.d/elpa/org-9.6.1/org-protocol hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-protocol
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-gnuplot hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-gnuplot
/Users/rob/.emacs.d/elpa/org-9.6.1/org-tempo hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-tempo
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-latex hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-latex
/Users/rob/.emacs.d/elpa/org-9.6.1/ol-w3m hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-w3m
/Users/rob/.emacs.d/elpa/org-9.6.1/org-id hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-id
/Users/rob/.emacs.d/elpa/org-9.6.1/ox-man hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-man
/Users/rob/.emacs.d/elpa/org-9.6.1/ol-doi hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-doi
/Users/rob/.emacs.d/elpa/org-9.6.1/org-feed hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-feed
/Users/rob/.emacs.d/elpa/org-9.6.1/org-fold-core hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-fold-core
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-julia hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-julia
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-lua hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-lua
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-table hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-table
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-ocaml hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-ocaml
/Users/rob/.emacs.d/elpa/org-9.6.1/oc-csl hides /Applications/Emacs.app/Contents/Resources/lisp/org/oc-csl
/Users/rob/.emacs.d/elpa/org-9.6.1/ol-gnus hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-gnus
/Users/rob/.emacs.d/elpa/org-9.6.1/org-indent hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-indent
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-lilypond hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-lilypond
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-matlab hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-matlab
/Users/rob/.emacs.d/elpa/org-9.6.1/org-datetree hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-datetree
/Users/rob/.emacs.d/elpa/org-9.6.1/ol-docview hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-docview
/Users/rob/.emacs.d/elpa/org-9.6.1/oc-bibtex hides /Applications/Emacs.app/Contents/Resources/lisp/org/oc-bibtex
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-python hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-python
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-makefile hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-makefile
/Users/rob/.emacs.d/elpa/org-9.6.1/org-duration hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-duration
/Users/rob/.emacs.d/elpa/org-9.6.1/org-agenda hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-agenda
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-dot hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-dot
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-js hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-js
/Users/rob/.emacs.d/elpa/org-9.6.1/ox-publish hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-publish
/Users/rob/.emacs.d/elpa/org-9.6.1/org-inlinetask hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-inlinetask
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-org hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-org
/Users/rob/.emacs.d/elpa/org-9.6.1/org-keys hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-keys
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-core hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-core
/Users/rob/.emacs.d/elpa/org-9.6.1/org-compat hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-compat
/Users/rob/.emacs.d/elpa/org-9.6.1/ol hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol
/Users/rob/.emacs.d/elpa/org-9.6.1/ox-odt hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-odt
/Users/rob/.emacs.d/elpa/org-9.6.1/ol-info hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-info
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-plantuml hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-plantuml
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-eshell hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-eshell
/Users/rob/.emacs.d/elpa/org-9.6.1/ox-ascii hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-ascii
/Users/rob/.emacs.d/elpa/org-9.6.1/ox-koma-letter hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-koma-letter
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-maxima hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-maxima
/Users/rob/.emacs.d/elpa/org-9.6.1/org hides /Applications/Emacs.app/Contents/Resources/lisp/org/org
/Users/rob/.emacs.d/elpa/org-9.6.1/ol-bbdb hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-bbdb
/Users/rob/.emacs.d/elpa/org-9.6.1/org-macro hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-macro
/Users/rob/.emacs.d/elpa/org-9.6.1/org-fold hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-fold
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-sql hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-sql
/Users/rob/.emacs.d/elpa/org-9.6.1/org-attach hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-attach
/Users/rob/.emacs.d/elpa/org-9.6.1/org-cycle hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-cycle
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-processing hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-processing
/Users/rob/.emacs.d/elpa/org-9.6.1/ox-texinfo hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-texinfo
/Users/rob/.emacs.d/elpa/org-9.6.1/org-crypt hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-crypt
/Users/rob/.emacs.d/elpa/org-9.6.1/org-footnote hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-footnote
/Users/rob/.emacs.d/elpa/org-9.6.1/ob-comint hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-comint
/Users/rob/.emacs.d/elpa/seq-2.20/seq hides /Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/seq
Features:
(shadow emacsbug two-column swift-mode swift-mode-imenu swift-mode-repl
swift-mode-beginning-of-defun swift-mode-font-lock
swift-mode-standard-types swift-mode-indent swift-mode-lexer timezone
org-archive wombat-theme whiteboard-theme wheatgrass-theme
tsdh-light-theme tsdh-dark-theme tango-theme modus-vivendi-tinted-theme
modus-vivendi-theme modus-vivendi-deuteranopia-theme
modus-operandi-tinted-theme modus-operandi-theme
modus-operandi-deuteranopia-theme modus-themes misterioso-theme
light-blue-theme leuven-theme manoj-dark-theme tango-dark-theme
leuven-dark-theme dichromacy-theme deeper-blue-theme cus-theme facemenu
descr-text help-fns cl-print novice cal-move sort find-dired
org-duration conf-mode rust-utils rust-mode rust-rustfmt rust-playpen
rust-compile rust-cargo rust-mode-autoloads loaddefs-gen radix-tree
tar-mode arc-mode archive-mode mm-archive url-cache org-clock
display-line-numbers pcmpl-unix octave sh-script smie executable finder
lisp-mnt dabbrev vc-hg vc-bzr vc-src vc-sccs vc-cvs vc-rcs log-view vc
bug-reference magit-extras magit-submodule magit-obsolete magit-blame
magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch
magit-clone magit-remote magit-commit magit-sequence magit-notes
magit-worktree magit-tag magit-merge magit-branch magit-reset
magit-files magit-refs magit-status magit magit-repos magit-apply
magit-wip magit-log which-func magit-diff smerge-mode diff git-commit
log-edit pcvs-util add-log magit-core magit-autorevert autorevert
magit-margin magit-transient magit-process with-editor server magit-mode
transient magit-git magit-section magit-utils crm rect grep cmake-mode
rst misearch multi-isearch lsp-diagnostics company-oddmuse
company-keywords company-etags etags fileloop company-gtags
company-dabbrev-code company-dabbrev company-files company-capf
company-cmake company-xcode company-clang company-semantic company-eclim
company-template company-bbdb company edmacro kmacro lsp-headerline
lsp-icons lsp-modeline dap-mouse dap-ui gdb-mi bindat gud bui bui-list
bui-info bui-entry bui-core bui-history bui-button bui-utils lsp-lens
dap-mode dap-tasks dap-launch posframe dap-overlays lsp-ui
lsp-ui-flycheck lsp-ui-doc goto-addr lsp-ui-imenu lsp-ui-peek
lsp-ui-sideline flycheck lsp-ui-util view lsp-zig lsp-steep lsp-svelte
lsp-sqls lsp-ruby-syntax-tree lsp-yaml lsp-xml lsp-vimscript lsp-vhdl
lsp-volar lsp-vetur lsp-html lsp-verilog lsp-vala lsp-v lsp-typeprof
lsp-ttcn3 lsp-toml lsp-terraform lsp-tex lsp-sorbet lsp-solargraph
lsp-rust lsp-rf lsp-remark lsp-racket lsp-r lsp-purescript lsp-pylsp
lsp-pyls lsp-pwsh lsp-php lsp-pls lsp-perlnavigator lsp-perl
lsp-openscad lsp-ocaml lsp-magik lsp-nix lsp-nim lsp-nginx lsp-mint
lsp-marksman lsp-markdown lsp-lua lsp-kotlin lsp-json lsp-javascript
lsp-idris lsp-haxe lsp-groovy lsp-hack lsp-graphql lsp-gleam lsp-go
lsp-completion lsp-gdscript lsp-fsharp lsp-fortran lsp-eslint lsp-erlang
lsp-emmet lsp-elixir lsp-elm lsp-dockerfile lsp-docker yaml lsp-dhall
lsp-d lsp-css lsp-csharp lsp-crystal lsp-cmake lsp-clojure lsp-treemacs
lsp-treemacs-generic lsp-treemacs-themes treemacs-treelib treemacs
treemacs-header-line treemacs-compatibility treemacs-mode
treemacs-interface treemacs-extensions treemacs-mouse-interface
treemacs-tags treemacs-persistence treemacs-filewatch-mode
treemacs-follow-mode treemacs-rendering treemacs-annotations
treemacs-async treemacs-workspaces treemacs-dom treemacs-visuals
treemacs-fringe-indicator treemacs-scope pulse treemacs-faces
treemacs-icons treemacs-themes treemacs-core-utils pfuture hl-line
treemacs-logging treemacs-customization treemacs-macros
lsp-semantic-tokens lsp-clangd lsp-beancount lsp-bash lsp-astro
lsp-ansible lsp-angular lsp-ada lsp-actionscript lsp-mode lsp-protocol
tree-widget spinner network-stream markdown-mode lv inline ht f
f-shortdoc shortdoc s dash dired-aux mail-extr diary-lib diary-loaddefs
cal-iso face-remap vc-git diff-mode vc-dispatcher disp-table org-bullets
org-indent oc-basic vc-svn ffap tramp tramp-loaddefs trampver
tramp-integration cus-start files-x tramp-compat ls-lisp ol-w3m
org-tempo tempo ol-rmail ol-mhe ol-irc ol-info org-habit ol-gnus
nnselect gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig
gnus-sum gnus-group gnus-undo gnus-start gnus-dbus dbus gnus-cloud
nnimap nnmail mail-source utf7 nnoo parse-time gnus-spec gnus-int
gnus-range message sendmail yank-media rfc822 mml mml-sec epa derived
epg rfc6068 epg-config mm-decode mm-bodies mm-encode mailabbrev
gmm-utils mailheader gnus-win ol-eww eww url-queue shr pixel-fill
kinsoku url-file svg xml dom mm-url gnus nnheader gnus-util mail-utils
range ol-doi org-link-doi ol-docview doc-view jka-compr image-mode exif
dired dired-loaddefs ol-bibtex bibtex iso8601 ol-bbdb ob-shell shell
ob-python python compat treesit finder-inf eglot array filenotify
jsonrpc ert ewoc debug backtrace xref flymake-proc flymake thingatpt
warnings compile text-property-search project imenu cc-mode cc-fonts
cc-guess cc-menus cc-cmds cl-extra yasnippet help-mode cc-styles
cc-align cc-engine cc-vars cc-defs ivy flx delsel ivy-faces ivy-overlay
colir color org-extra-emphasis easy-mmode pcase htmlfontify cus-edit pp
cus-load wid-edit ox-odt rng-loc rng-uri rng-parse rng-match rng-dt
rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util ox-latex
ox-icalendar org-agenda ox-html table ox-ascii ox-publish ox
org-download org-element org-persist xdg avl-tree generator org-attach
org-id org-refile org ob ob-tangle ob-ref ob-lob ob-table ob-exp
org-macro org-src ob-comint org-pcomplete pcomplete comint ansi-osc
ansi-color ring org-list org-footnote org-faces org-entities time-date
noutline outline icons ob-emacs-lisp ob-core ob-eval org-cycle org-table
ol rx org-fold org-fold-core org-keys oc org-loaddefs find-func cal-menu
calendar cal-loaddefs org-version org-compat org-macs format-spec
url-http url-auth mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums
mail-prsvr url-gw nsm puny async cap-words superword subword
magit-autoloads magit-section-autoloads git-commit-autoloads
ob-async-autoloads with-editor-autoloads transient-autoloads
realgud-recursive-autoloads compat-autoloads info package browse-url url
url-proxy url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x
map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc
iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads kqueue cocoa ns multi-tty
make-network-process emacs)
Memory information:
((conses 16 3510320 829670)
(symbols 48 89796 169)
(strings 32 495253 83331)
(string-bytes 1 18215573)
(vectors 16 216973)
(vector-slots 8 3903593 548031)
(floats 8 893 10048)
(intervals 56 385549 717)
(buffers 976 243))
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#62735: 30.0.50; project.el project-search errors because project-files returns directories
2023-04-08 21:45 bug#62735: 30.0.50; project.el project-search errors because project-files returns directories Robert Nikander via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-04-09 23:15 ` Dmitry Gutov
2023-04-09 23:25 ` Robert Nikander via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Gutov @ 2023-04-09 23:15 UTC (permalink / raw)
To: Robert Nikander, 62735-done
Version: 29.1
Hi!
On 09/04/2023 00:45, Robert Nikander via Bug reports for GNU Emacs, the
Swiss army knife of text editors wrote:
> Hi,
>
> I tried to run the command `project-search`, documented in "29.2.1 Project Commands That Operate on Files”. It threw an error because it tried to process a directory. The backtrace from debugger is below.
>
> The function defined right below `project-search` in project.el is `project-query-replace-regexp`. It has this comment and line:
>
> ;; XXX: Filter out Git submodules, which are not regular files.
> ;; `project-files' can return those, which is arguably suboptimal,
> ;; but removing them eagerly has performance cost.
> (cl-delete-if-not #'file-regular-p (project-files (project-current t)))
>
> I added the same to `project-search` and it seems to have “fixed” it. I don’t know how `project-files` works, but probably it would be better to fix that.
>
> This directory “…/SomeDir/“ has a .git directory inside it. That appears to be why project-files picked it up, because deleting that .git subdir also avoids the error. But projects should be able to have nested .git directories, depending on how the ‘project’ is defined.
Thanks for the report. Am I correct to understand that the directory is
a submodule? This is the main case which triggers this problem that I
know about.
I've pushed a similar fix just like you suggested. 'project-search'
should be okay now.
Note that 'project-find-regexp' (bound to 'C-x p g' by default) is
usually a more efficient command to use rather than 'project-search' --
faster, works remotely, etc. But it has a very different interface.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#62735: 30.0.50; project.el project-search errors because project-files returns directories
2023-04-09 23:15 ` Dmitry Gutov
@ 2023-04-09 23:25 ` Robert Nikander via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-09 23:32 ` Dmitry Gutov
0 siblings, 1 reply; 4+ messages in thread
From: Robert Nikander via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-04-09 23:25 UTC (permalink / raw)
To: Dmitry Gutov; +Cc: 62735-done
Hi Dmitry,
I don’t think it’s a submodule anymore. The directory does have a .git folder in it though (like a submodule). The directory was simply copied into the project tree like that, as part of moving it between projects. There is no '.gitmodules' file anywhere. So my guess is this bug was being triggered by the mere existence of the .git directory nested a few layers down in my project. That .git directory is not going to stay there, it’s going to get deleted, but of course it still shouldn’t crash the emacs command.
Rob
> On Apr 9, 2023, at 5:15 PM, Dmitry Gutov <dmitry@gutov.dev> wrote:
>
> Version: 29.1
>
> Hi!
>
> On 09/04/2023 00:45, Robert Nikander via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote:
>> Hi,
>> I tried to run the command `project-search`, documented in "29.2.1 Project Commands That Operate on Files”. It threw an error because it tried to process a directory. The backtrace from debugger is below.
>> The function defined right below `project-search` in project.el is `project-query-replace-regexp`. It has this comment and line:
>> ;; XXX: Filter out Git submodules, which are not regular files.
>> ;; `project-files' can return those, which is arguably suboptimal,
>> ;; but removing them eagerly has performance cost.
>> (cl-delete-if-not #'file-regular-p (project-files (project-current t)))
>> I added the same to `project-search` and it seems to have “fixed” it. I don’t know how `project-files` works, but probably it would be better to fix that.
>> This directory “…/SomeDir/“ has a .git directory inside it. That appears to be why project-files picked it up, because deleting that .git subdir also avoids the error. But projects should be able to have nested .git directories, depending on how the ‘project’ is defined.
>
> Thanks for the report. Am I correct to understand that the directory is a submodule? This is the main case which triggers this problem that I know about.
>
> I've pushed a similar fix just like you suggested. 'project-search' should be okay now.
>
> Note that 'project-find-regexp' (bound to 'C-x p g' by default) is usually a more efficient command to use rather than 'project-search' -- faster, works remotely, etc. But it has a very different interface.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#62735: 30.0.50; project.el project-search errors because project-files returns directories
2023-04-09 23:25 ` Robert Nikander via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-04-09 23:32 ` Dmitry Gutov
0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Gutov @ 2023-04-09 23:32 UTC (permalink / raw)
To: Robert Nikander; +Cc: 62735-done
On 10/04/2023 02:25, Robert Nikander wrote:
> I don’t think it’s a submodule anymore. The directory does have a .git folder in it though (like a submodule). The directory was simply copied into the project tree like that, as part of moving it between projects. There is no '.gitmodules' file anywhere. So my guess is this bug was being triggered by the mere existence of the .git directory nested a few layers down in my project. That .git directory is not going to stay there, it’s going to get deleted, but of course it still shouldn’t crash the emacs command.
All right. So it's a different situation, but one we shouldn't have to
try to support since it's going to be fixed manually.
But the same thing can happen when submodules are used, so the fix is
still useful. Good to know this is still the main case where we might
need to filter by file type.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-04-09 23:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-08 21:45 bug#62735: 30.0.50; project.el project-search errors because project-files returns directories Robert Nikander via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-09 23:15 ` Dmitry Gutov
2023-04-09 23:25 ` Robert Nikander via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-09 23:32 ` Dmitry Gutov
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).