-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] dirvish not working with latest denote-sort #249
Comments
I think this can be fixed by the following diff, @@ -657,12 +657,12 @@ buffer, it defaults to filename under the cursor when it is nil."
(defun dirvish-dired-noselect-a (fn dir &optional flags)
"Return buffer for DIR with FLAGS, FN is `dired-noselect'."
- (let* ((key (file-name-as-directory (expand-file-name dir)))
+ (let* ((key (file-name-as-directory (expand-file-name (if (stringp dir) dir (car dir)))))
(this dirvish--this)
(dv (if (and this (eq this-command 'dired-other-frame)) (dirvish-new)
(or this (car (dirvish--find-reusable)) (dirvish-new))))
(bname buffer-file-name)
- (remote (file-remote-p dir))
+ (remote (file-remote-p key))
(flags (or flags (dv-ls-switches dv)))
(buffer (alist-get key (dv-roots dv) nil nil #'equal))
(new-buffer-p (not buffer))) |
Hi, I'm on vacation so I haven't been keeping up with this but thank you! |
The diff doesn't go into config but you can try putting the snippet below in your config and see if it helps: (with-eval-after-load 'dirvish
(defun my-dirvish-dired-noselect-a (fn dir &optional flags)
"Return buffer for DIR with FLAGS, FN is `dired-noselect'."
(let* ((key (file-name-as-directory (expand-file-name (if (stringp dir) dir (car dir)))))
(this dirvish--this)
(dv (if (and this (eq this-command 'dired-other-frame)) (dirvish-new)
(or this (car (dirvish--find-reusable)) (dirvish-new))))
(bname buffer-file-name)
(remote (file-remote-p key))
(flags (or flags (dv-ls-switches dv)))
(buffer (alist-get key (dv-roots dv) nil nil #'equal))
(new-buffer-p (not buffer)))
(if this (set-window-dedicated-p nil nil) (setcar (dv-layout dv) nil))
(when new-buffer-p
(if (not remote)
(let ((dired-buffers nil)) ; disable reuse from dired
(setq buffer (apply fn (list dir flags))))
(require 'dirvish-extras)
(setq buffer (dirvish-noselect-tramp fn dir flags remote)))
(with-current-buffer buffer (dirvish-init-dired-buffer))
(push (cons key buffer) (dv-roots dv))
(push (cons key buffer) dired-buffers))
(with-current-buffer buffer
(cond (new-buffer-p nil)
((and (not remote) (not (equal flags dired-actual-switches)))
(dired-sort-other flags))
((eq dired-auto-revert-buffer t) (revert-buffer))
((functionp dired-auto-revert-buffer)
(when (funcall dired-auto-revert-buffer dir) (revert-buffer))))
(dirvish-prop :dv (dv-name dv))
(dirvish-prop :gui (display-graphic-p))
(dirvish-prop :remote remote)
(dirvish-prop :root key)
(when bname (dired-goto-file bname))
(setf (dv-index dv) (cons key buffer))
(run-hook-with-args 'dirvish-find-entry-hook key buffer)
buffer)))
(advice-add 'dirvish-dired-noselect-a :override #'my-dirvish-dired-noselect-a)) |
Thank you for the bug report
dirvish
related packages.the command
emacs -Q
.Bug description
When I use the new denote-sort method, it displays an error:
dirvish-dired-noselect-a: Wrong type argument: stringp, ("Denote sort by `keywords' at 09:29:22" "reference/20230702T080512--multiple-cursors-in-emacs__emacs_package_reference.org" "reference/20230520T071146--burlyel-for-emacs-windows__emacs_package_reference.org")Error during redisplay: (dirvish-selection-change-h #<frame reference<2> 0x12aa5b440>) signaled (error "Specified program for new process is a directory")
Steps to reproduce
Just go to any directory and use denote-sort-dired, put in some values, watch what happens.
Expected behavior
It should produce a list of sorted files by the values entered.
OS
MacOS
Emacs Version
29
Emacs Configurations
Emacs Plus
Error callstack
No response
Anything else
I should note that I'm on Emacs Plus 30.0.5 but I don't think that it's the cause here. Please let me know if it is. TY!
The text was updated successfully, but these errors were encountered: