Questions tagged [dired]

Dired is a major mode that allows users to edit files and directories on a file system. It is essentially a file browser, with a wide range of features and an appearance similar to the `ls` command.

Filter by
Sorted by
Tagged with
1 vote
1 answer
14 views

Using `ls' Switches Instead of Omit Mode

As per this page An alternative to using Omit mode: Use C-u s to change the ls switches and immediately refresh. (C-u s refreshes also, so there is very little typing involved.) You can remove -a ...
user avatar
  • 101
1 vote
1 answer
44 views

How can I get the name of the file on the current Dired line?

I'm running emacs on WSL. The following function launches the binary file marked in dired: (defun wsl/execute () "execute file at point in dired" (interactive) (dired-do-shell-command ...
user avatar
  • 145
0 votes
1 answer
61 views

How can I recursively find and replace text in case sensetive?

I am using combination of following solutions in order to find-and-replace matched text in all Python files: Using Emacs to recursively find and replace in text files not already open How can I ...
user avatar
  • 1,066
2 votes
4 answers
51 views

find-name-dired : save selection of files for reuse?

I try to use find-name-dired, everything works out as expected. Is there a way to save the selection of files for reuse?
user avatar
  • 21
1 vote
1 answer
20 views

Why does counsel-find-file use the current Dired directory when I specify argument INITIAL-DIRECTORY?

I am trying to use counsel-find-file to open the folder containing my Emacs configuration through a call such as the following: (counsel-find-file 'nil "~/Documents/test-emacs/.emacs.d/") ...
user avatar
3 votes
1 answer
120 views

Tramp mode - Copying files

when copying files in tramp mode via ssh with Dired I am not able to do anything else in Emacs. Emacs is just not usable till this process has finished. Is there any way to use Emacs while it copies ...
user avatar
  • 131
1 vote
2 answers
36 views

Read-only mode gets in the way when query-replacing text in multiple files

I am searching and replacing text within all marked files in a Dired buffer, as per this post: https://emacs.stackexchange.com/a/9497/37866 I am successful until the point where it finds the first ...
user avatar
  • 11
0 votes
1 answer
115 views

all-the-icons are all white in dired

I recently setup all-the-icons with dired (all-the-icons-dired) and the appropriate icons do appear but they're all white for some reason. I tried reducing my ~/.emacs down to just the dired settings ...
user avatar
  • 191
2 votes
1 answer
138 views

How to show current directory in Dired with symlinks resolved

I have ~/bin -> ~/some/long/path/bin. When I open ~/bin in Dired, it tells me at the top that it is looking at /Users/username/bin, i.e. it expands '~' in the current directory printed on the ...
user avatar
  • 21
0 votes
0 answers
10 views

Error in dired-find-file-place when saving

I've been an Emacs user for 30 years. This week I'm switching to a new machine with Ubuntu 21.10 installed. Now when I save a file, it always errors out with the error message: "Error in dired-...
user avatar
  • 101
3 votes
1 answer
58 views

How to not hide Dired details initially, with Dired+?

I have GNU Emacs 27.2 (of 2021-11-18; on macOS 12.1) and updated dired+.el from dired+ just now (to fix a bug, so I can't go back to the old version of dired+.el I had). Before the update, dired-mode ...
user avatar
2 votes
1 answer
61 views

Save excursion not working for dired-find-file-other-window

I wrote this function to basically bring my cursor back to the dired buffer, after opening the file in another window. This is so that I can scroll down the buffer, pressing o to keep previewing the ...
user avatar
  • 288
2 votes
1 answer
84 views

Deleting a file to ~/.Trash produces "File already exists..." if a file of that name is there [duplicate]

I have (setq trash-directory "~/.Trash") and (setq delete-by-moving-to-trash t) in .emacs to be able to have files moved to ~/.Trash via d and then x in dired-mode. (This is in macOS.) But ...
user avatar
0 votes
1 answer
35 views

Problems saving files and creating directory

I have recently set-up a new Emacs on my OSx 10.15. Every time I try to create a directory in Dired with + I got a warning telling the files already exist. Another strange result I got when I try to ...
user avatar
-1 votes
2 answers
31 views

Not correct reverse sort in dired mode

Linux Mint 20.2 Emacs 27.2 Installed packages: dired+ dired-hacks-utils-20201005.2318 dired-k-20200322.2035 dired-narrow-20181114.1723 dired-quick-sort-20201221.403 dired-recent-20211004.1924 dired-...
user avatar
  • 3,435
0 votes
0 answers
14 views

dired: read/write access to local folder contents (root/wheel), similar to "sudo -s" [duplicate]

The local folder /private/var/root (owner: root / group: wheel) on OSX (El Capitan) contains certain data that I would like to have "read/write" access; e.g., /private/var/root/Library/...
user avatar
  • 17.7k
1 vote
2 answers
40 views

Exotic dired-based window-splitting mode

NOTE: I added more info to this query. Initially, I didn't mention dired, but after experimenting, I see that it needs to be explicitly discussed here, because of how it manages buffers. I'm using ...
user avatar
  • 522
2 votes
1 answer
52 views

How to create independent Dired buffers for the same directory?

I'm trying to programmatically define the windows in my frame. I have 4 windows, two with dired buffers in them so that I can select the file I want to visit. (delete-other-windows) (split-window-...
user avatar
  • 3,885
0 votes
0 answers
70 views

Dired: open file in another frame, but reuse an already existing one

I use a two-screen setup, and I like to have a frame with dired on one screen and another frame on the second screen. When I want to work on a specific file, I usually copy the file path from dired ...
user avatar
0 votes
2 answers
156 views

How to debug error in process sentinel?

I've recently switched to doom emacs, and for the most part it's working great. However, when I'm looking at a folder in dired-mode, if I copy a file using C the file is copied but *Messages* contains ...
user avatar
1 vote
0 answers
48 views

gzip: stdin: unexpected end of file

Linux Mint 20.1 Emacs 27.1 I connect to remote Linux host by tramp mode. Success connect. Nice. But when in dired mode I try to open log file (press Enter) I get the next message: gzip: stdin: ...
user avatar
  • 3,435
1 vote
1 answer
55 views

dired-do-delete fails to delete file

In Dired, with point on a file name, I invoke dired-do-delete and confirm. The line disappears, as it normally does when a file is deleted. But the file is not in fact deleted, as I can see by e.g. ...
user avatar
  • 164
0 votes
2 answers
25 views

Unable to remap mouse under dired in macos emacs

I'm not sure whether this should be considered an appropriate post for emacs.stackexchange, or whether this should go to some sort of macos forum. Please let me know if I need to ask the following ...
user avatar
  • 522
1 vote
1 answer
51 views

How do you target the present directory, once in a while, with do-what-I-mean enabled?

After setting Dired do-what-I-mean (setq dired-dwim-target t) which, quoting the man pages If non-nil, Dired tries to guess a default target directory. This means: if there is a Dired buffer ...
user avatar
  • 473
1 vote
1 answer
27 views

How can I prevent ` running timer: (void-function vc-git-root)` error

vc-git-root walks up the tree until it finds the directory that contains the .git subdir and declares that to be the root of the repo. But if there is not .git folder in the root directory, (vc-git-...
user avatar
  • 1,066
0 votes
0 answers
61 views

`void-variable: Symbol’s value as variable is void: v` when deleting remote directory in dired

This recently started happening. Whenever I try to recursively delete any remote directory from dired (i.e. D over the dired entry), I get this after Emacs asks me for confirmation: void-variable: ...
user avatar
  • 113
0 votes
1 answer
78 views

Search and Replace for a block on many lines in a dozen files

I have a a bunch of HTML files and in each of them I want to replace a fixed block of approx 30 lines with a one liner. Is there an Emacs command or package which makes this easier? Using e.g. dired-...
user avatar
  • 1,041
0 votes
3 answers
145 views

How can I recursively find and replace in the current git repository

I am working inside a git-repo. Here I want to apply my search operation based on the root directory of the git repo that current buffer is open. Here I do: find-dired "~/my_project" ... in ...
user avatar
  • 1,066
1 vote
4 answers
57 views

How to programmatically mark files in dired based on file modification time?

I'd like to write a bit of elisp to mark all files in a dired buffer that are "old": the files were last modified more than 10 days ago, say. What would be a good way to do that? It seems ...
user avatar
  • 297
0 votes
0 answers
45 views

dired+: Not correct show marked files/dirs in doom-modeline

Linux Mint 20.2 Emacs 27.2 Install packages: dired, dired+, doom-modeline. If I use doom-modeline and when I mark files/dirs in mode line not correct show marked files. But if I'm not use dired+ - ...
user avatar
  • 3,435
1 vote
0 answers
31 views

dired-icon not show icons in dired-subtree

Linux Mint 20 Emacs 27.1 package: dired, dired+, dired-icon dired-icon In folder Temp has: Folder: MyFolder Files: someFile.txt someFile2.txt In folder MyFolder has: Folders: mySubFolder_1 ...
user avatar
  • 3,435
1 vote
1 answer
34 views

How not select dot and double dots in dired mode

Linux Mint 20 Emacs 27 package dired, dired+ In folder Downloads I has: one folder and two files. I want to delete all content of folder Downloads So as result on Dired mode I press t. Here result: ...
user avatar
  • 3,435
0 votes
1 answer
16 views

How to show recent directories on separate lines in echo area?

Linux Mint 20, Emacs 27.2 Install package dired, dired+ I want to show recent directories visited in the minibuffer. Something like this: I tried this: (defun my-recent-dir () (interactive) ...
user avatar
  • 3,435
0 votes
1 answer
37 views

How to see all recent directories?

Linux Mint 20 Emacs 27 package: dired, diredp (https://www.emacswiki.org/emacs/dired%2b.el) Jump to bookmark. Input Temp Press ENTER. As result open folder MyFolder Press ENTER. As result open ...
user avatar
  • 3,435
1 vote
1 answer
41 views

dired-recent - not show correct recent visited directories

Linux Mint 20 Emacs 27 dired, dired-recent Steps: 1. "recentf-mode" is turn on 2. Go to directory "Download". Use "Jump to bookmark" (C-x r b). Input "Download"...
user avatar
  • 3,435
0 votes
0 answers
12 views

dired--unhide: Buffer is read-only: #<buffer bufferName> when set bookmark in a dired buffer

When I use C-x r m in a Dired buffer to add this directory to my bookmark, it complains: dired--unhide: Buffer is read-only: # The enabled minor modes in this buffer include: Async-Bytecomp-Package ...
user avatar
  • 111
1 vote
2 answers
655 views

Dired mode: Toggle show hidden files/folders by keyboard shortcut

I am using Emacs 27.1 (GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0) of 2021-03-28, modified by Debian) with "default" dired mode. There are no ...
user avatar
  • 509
3 votes
1 answer
106 views

How can I set the ls program dired uses only for local directories

I have set the ls program dired uses via (setq insert-directory-program "gls")) (so that I can specify --group-directories-first in dired-listing-switches). Trouble is when I browse a ...
user avatar
  • 1,041
0 votes
1 answer
66 views

Searching in Dired for content in files while filtering files

From Dired, I'd like to be able to search for content pretty much like I do on my MAC Finder, while showing the files that match the criteria/regular expression (and no other files). I don't want the ...
user avatar
  • 35
1 vote
1 answer
123 views

How can I load Dired+ only if I actually use Dired?

I'm loading dired+ from a file ( as it has been removed from Melpa ), but it won't load when I try to make it conditional of opening a dired buffer. ;; ---- Dired + -------- ;; Loads Dired+ (use-...
user avatar
  • 558
0 votes
0 answers
32 views

Plus symbols near some directory names in dired?

I've noticed in recent versions of emacs that some directoies in a dired listing have + "plus" symbols near them (see image). Would someone be so kind as to explain the meaning? I have not ...
user avatar
  • 701
0 votes
1 answer
101 views

Git track flag in Dired

How can I show an additional column in Dired, where I can see if the file is tracked or not by git in the current branch?
user avatar
1 vote
1 answer
39 views

Can't unbind mouse button from keymap

This is more of an academic question than a practical one, as I've already worked around it. However, the curiosity / mystery is killing me. I'm about 10 days into emacs, so new to a lot of this. As I'...
user avatar
  • 135
1 vote
2 answers
121 views

Dired: How to open file with ace-window while keeping focus on dired buffer?

I have this Elisp code that allows me to use ace-window to open a file in a selected window from Dired: (defun find-file-dired-ace-window () "Use ace window to select a window for opening a ...
user avatar
2 votes
2 answers
85 views

Open recent directories like Ido opens files

When I want to open a recent file, I use ido-find-find (C-x C-f) or ido-switch-buffer (C-x b) and type a few characters and Ido automatically finds the right file among the recent files I have visited....
user avatar
  • 191
3 votes
3 answers
229 views

Copy a file content to clipboard with dired

I would like to emulate the fonctionnality of xclip in dired. That is, copying file content to clipboard (but without opening it in Emacs). Sadly, using dired-do-async-shell-command and xclip does not ...
user avatar
0 votes
1 answer
160 views

Pseudo-terminal will not be allocated because stdin is not a terminal. ssh_askpass: exec(/usr/libexec/openssh/ssh-askpass): No such file or directory

CentOS 7, Emacs 27.1 Here content of file myFile.sh: ssh myuser@10.111.11.111 So when in vterm mode I use this: ./myFile.sh then I success connect to the remote machine (ip = 10.111.11.111) by ...
user avatar
  • 3,435
0 votes
2 answers
86 views

How to remove gray color in Dired mode?

Linux Mint , Emacs 27.2 Dired, Dired+, Dired-k As a result here is the dired mode view As you can see, the names of files: to.do.org to.do.org_archive_2017 to.do.org_archive_2019 are gray. Can I ...
user avatar
  • 3,435
2 votes
1 answer
103 views

How do I get all marked files from all Dired buffers?

I'm trying to write a function that opens all marked files externally in their default programs. I've tried using (dired-get-marked-files) to get the filepaths, but that only returns the marked files ...
user avatar
1 vote
3 answers
122 views

Append some text to multiple files in a directory

I want to append some text to multiple files in a directory. So, I opened the directory in dired buffer and selected the files. After this, is there any shortcut/ command to append some text to these ...
user avatar
  • 1,668

1
2 3 4 5
10