The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [files]

Use this tag for questions about moving, deleting, or opening files. Or for questions about the difference between a buffer and its file. For topics such as "Saving Files", use "buffers" instead.

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

How to prompt user for a proper writable file in Emacs Lisp?

I need to prompt the user for a file which is 1) not a directory 2) if already exists, is writable. I know I can use read-file-name, but I'm not sure how to filter out the improper files. ...
0
votes
1answer
30 views

How delete folder named “build” in all subfolders?

Emacs 26.1, Dired+, Windows 10 Suppose I has the next dir tree: myproject myproject\app\ myproject\app\build myproject\app\src myproject\lib\build myproject\lib\src myproject\lib2\build myproject\...
1
vote
1answer
37 views

get the full path (path + filename) of the currently editing file in to the OS clipboard

when editing a file (for example a .pl file) Whats the quickest way to get the full path (path + filename) of the currently editing file in to the OS clipboard. I'm on macOS, where echo "hello" | ...
0
votes
0answers
12 views

Disable Flycheck for different file extensions with the same mode

I use verilog-mode for both Verilog (extension .v) and System Verilog (extension .sv). I want to disable flycheck for .v files only. (Because they are typically multi-gigabyte netlists that take lots ...
0
votes
0answers
43 views

How to get a list of all folder names under a folder?

I have a folder structure like this,i want get a list that all folder names in pack folder. Then traverse the list and load them ├── pack │   ├── completion │   │   ├── company │   │   │   └── pack-...
4
votes
2answers
202 views

How to open all the opened files from a previous session?

Whenever I open my spacemacs I see the recentf buffer which lists 5 files I had open in my previous session. There is only an option to open them one by one, and only five of them, because others are ...
0
votes
1answer
25 views

Using the :match attribute for custom matching for a Helm source

I'm trying to create a Helm source which matches the basename of files. I created a source which splits the basename of files in recentf list and puts the path behind it in parens (it uses the (...
1
vote
0answers
45 views

Sharing .org file between two users

My secretory creates a daily agenda for me by capturing task to shared org file mytodo.org. When I open the agenda or mark the task done, her ability to capture new task gets limited as the mytodo.org ...
0
votes
2answers
46 views

read epub with nov

Upon reading epub on emacs, I tried https://github.com/wasamasa/nov.el. Installed and configured step by step as its instructions. When C-x C-f to open an epub, it is displayed as M Filemode ...
-1
votes
2answers
32 views

What tool can I use to compare files by content in dired mode? [closed]

windows 10 (64 bit) Emacs 26.1, Dired+ I need tool that can compare files by content with highlight different symbols. Example: As you can see I mark two files. Is it possible to compare this ...
2
votes
0answers
34 views

Simple Atom-style jump-to-file

I'm upgrading Emacs and moving from macOS to Windows after quite a few years getting by with a very old setup (eg, custom scripts for Anything). I've installed Helm. I'm interested in a simple way to: ...
1
vote
0answers
29 views

How to make find-file-other-window reuse existing window

Is it possible to make find-file-other-window open the file in a pre-existing window instead of creating a new one? Currently: |A---|B---| |A-|C-|B---| |----|----| -> ...
0
votes
1answer
40 views

how to ignore current selection from ivy when my typed text matches one

I run into this issue from time to time when I want to create a new file but the new name matches a pattern already so my Ivy auto-complete setup will pick the matched option when I press Enter ...
0
votes
2answers
55 views

Save place in files but don't move the cursor to the saved position automatically

I'd like to have a command that moves the cursor to the last position it was in when I left the buffer (either by killing it or by killing Emacs). I know I can use saveplace.el to save the position ...
1
vote
1answer
44 views

Why does a certain file always gets opened on startup?

I'm using desktop-save-mode to automatically open the files that I had opened in the last session. This mode should also remember the files that I closed so that it no longer opens them in the next ...
1
vote
1answer
32 views

how to copy a deeply nested binary file from one git repo to another [closed]

I want to copy an image file from one github repo to another. The source and destination file paths are deeply nested within the repo (eg. copy ~/code/repo1/src/components/A/components/B/common/...
2
votes
1answer
99 views

Why Emacs (dired+) asks me twice to delete file?

windows 10, Emacs 26.1, dired+ Suppose I want to delete (move to trash) file in dired mode. D Emacs asks me: I press y and now it's asking me again to kill file. Why Emacs asks me twice? I want ...
4
votes
1answer
102 views

Open directory containing file during counsel-file-jump

I use counsel-file-jump to search files recursively. I would like to open the directory that contains a particular file candidate. I can execute counsel-dired after I open the file, which allows me to ...
0
votes
0answers
12 views

How to use helm-locate (or similar) when saving a buffer?

When opening a file, I often use helm-locate to quickly access any file anywhere. But when saving a new buffer, I navigate through the directory structure to get the location I need. Is there a way to ...
1
vote
1answer
33 views

emacs 25: display-buffer-other-window behavior change, how to tune for the old way?

I have a number of macros for browsing source code for many emacs versions. I wrote this in 2009 and it's been solid until upgrading to U18.04. I know it worked in U16.04: (defun get-file-from-...
0
votes
0answers
49 views

Don't use completion text

When i am trying to rename a file in dired-mode, for just find a file with (C-x f), it uses auto-completion to help me out. Most of the time this is super useful. However when I am trying to rename a ...
1
vote
1answer
340 views

How do I silently write to a temporary file?

I made a modification in org-pomodoro to send the mode line to a pipe which I use in xmobar, but it keeps spamming my *Messages* buffer, thus making the line which displays it almost useless. (write-...
0
votes
0answers
23 views

Ada mode : navigating through code, always open in new window

when I navigate in ada-mode, The first time that I press C-cC-d (ada-goto-declaration), Emacs divide vertically the frame, and open the new file in the other window. Most times, every C-cC-d press, ...
0
votes
6answers
273 views

How to append contents of multiple files into one file?

Emacs 26.1, Windows 10, Dired+ How to append contents of multiple files in one folder into one file?
2
votes
2answers
62 views

Rename file from space to underscore in dired just the filename. Xah function for this also renames all parent directories

I found this function by xah to do this but it also looks at the parent directories. Ideally, this would just look at the filename not including the parent name or parent directories. Something along ...
0
votes
2answers
131 views

What does the prompt mean for `has changed since visited or saved. Save anyway?`

When I try to save a buffer back to a file: install-packages.sh has changed since visited or saved. Save anyway? (yes or no) I don't know why it happens, but I also see #install-packages.sh# ...
5
votes
0answers
83 views

Why is cloning of file buffers prohibited?

Why does clone-buffer not work on file buffers. I can make it work by the following advice: (advice-add 'clone-buffer :around (lambda (oldfun &rest args) "Allow cloning file buffers." ...
3
votes
1answer
24 views

How to get TRAMP to respect group sticky bit?

In using TRAMP to create a new file in a remote (Unix) directory, I discovered that TRAMP is not respecting the group sticky bit in that directory. As is standard on a Unix system, the group ...
1
vote
1answer
104 views

Emacs freezes when saving org file in org-mode

For some reason I cannot save files while in org-mode. This happened after I updated to a most recent version of org-mode. If I change to text mode I can save without a problem. I have tried C-x C-w ...
0
votes
1answer
61 views

Tramp keep losing remote file permissions

I use: Emacs 26.1 on Windows 10 with tramp with plink/pscp to edit perl scripts on a remote Linux server The scripts are executable (permissions 755). When I load and then save them, if short time ...
1
vote
0answers
65 views

Problem saving (C-x C-s) files on a NFS drive with emacs 24/25

Starting with Emacs 24 (using various different versions of Ubuntu and Linux Mint), if I open a file on an NFS drive, modify it and attempt to save it C-x C-s, I get the message of: Saving <...
0
votes
1answer
156 views

How to save a file history?

Is there any packages or extension that will save a file history when you save the file? Example when I save the file it will create a file history of the file and on the later time when I save it ...
2
votes
2answers
251 views

How to open multiple files in multiple windows at startup

In earlier versions of emacs one could use emacs -nw file1 file2 file3 and see three files (and no buffer list) at startup. For recent versions this no longer works. Is it possible to add some code to ...
1
vote
0answers
86 views

How to mount/unmount devices?

I'm interested in mount/umount usb and other devices directly from emacs. In many file mangers (like nautilus) the devices are automatically discovered and indicated with an icon, it's possible to do ...
3
votes
1answer
218 views

Dired: How to find all files under a directory that match a glob pattern (wildcards)?

Emacs 26.1, Windows 10 In my directory: d:/TEMP/test/ I has 2 text files. Also in subdirectories I has 2 text files. If I want to find all files in directory d:/TEMP/test/ I do: C-x d d:/TEMP/test/*...
0
votes
1answer
38 views

Including standard boiler-plate on opening a new latex file [duplicate]

Most of my \LaTeX files have the same boiler plate code, so I would like Emacs to automatically insert this boiler-plate whenever I open a fresh, blank \LaTeX file. In particular, I would like to ...
0
votes
1answer
50 views

Backtrace on file open

I am curious about the origin of certain files under ~/.emacs.d, such as: places, url/cookies, tramp, eshell/history, eshell/lastdir, auto-save-list/.saves-15234-mymachine~, request/curl-cookie-jar. ...
0
votes
2answers
241 views

Get file name relative to projectile root

I am trying to write a little function to get the projectile relative path of a buffer. My idea is to delete the substring projectile-project-root from the string buffer-file-name. For example: root-...
1
vote
1answer
61 views

Problem with file-exists-p function on Linux running as VirtualBox guest

Until this morning, my emacs setup (running on Arch Linux as a VirtualBox guest) was working absolutely fine. Then for no obvious reason I started experiencing the following issue: If I opened an ...
0
votes
1answer
81 views

Dired: File open using external viewers, based on filetype, and without prompting

When I hit RETURN on a filename in Dired, I'd like Emacs to automatically do one of several things, depending on the file's type: 1 - If it's a text file, I'd like to open the file in a new buffer in ...
2
votes
1answer
102 views

Normalize string to make it file/path safe

Often I find my self doing this C-x C-f to create a file, while in the mini buffer prompt, paste a url like "https://github.com/seamusabshere/cache_method/issues/15" from the clipboard. Since "https:...
1
vote
1answer
89 views

Autocompletion of relative, not absolute, file name

I am typing a Tex file with Emacs and I want to be able to include the relative path of an image file name from inside Emacs. For example, my Tex file that is being opened in Emacs is located at ~/...
1
vote
1answer
112 views

Open a file in read-only preprocessed mode

I often create files with a special extension, e.g. pkl (python pickle), and would like to display these in a read-only buffer after processing them with some external command. E.g. in the case of ...
1
vote
1answer
245 views

Move a file to a directory in the filesystem with emacs lisp

What is the function to move files? I want to emulate the following shell command: mv file dir As described here, the closest is rename-file, but this would be emulating this: mv file newfile
2
votes
0answers
258 views

Navigate C/C++ Source Code with Emacs [closed]

So, i'm finally starting to work with a multi-file Project in C++ and am in need for smart navigation and completion! So far, i've used company-mode (with irony and company-headers), which is great if ...
0
votes
2answers
137 views

Multiple buffers for same file

The find-file command automatically selects and uses a preexisting buffer that is visiting the same file. My problem is, when using the same buffer in multiple frames, the frames will lag ...
2
votes
1answer
46 views

How can I make Emacs wait until a file is unlocked and then lock it?

I want to override Emacs' default locking behavior to work in a noninteractive setting. To that end, when Emacs encounters a lock (as in file-locked-p), I would like it to wait patiently for the lock ...
1
vote
0answers
56 views

f.el: f-split behaviour

Using f-split from f.el: (require 'f) (f-split "c:/a/b") returns ("/" "c:" "a" "b") What is the rationale? Shouldn't it be ("c:" "a" "b")? Also in Emacs for Windows the value of: (f-path-...
2
votes
1answer
40 views

Ignore both uppercase and lowercase versions of the extensions listed in completion-ignored-extensions

How can I get Emacs to ignore, say, both .pdf and .PDF files without listing both ".pdf" and ".PDF" in completion-ignored-extensions?
1
vote
3answers
55 views

Is there a way to periodically record the files being opened in emacs?

Sometimes my ubuntu freezes, and I am using Emacs that has many files opened inside it. I have to reboot Ubuntu, and lose the track of what files I have opened. Is there a way to periodically record ...