Hot answers tagged

20

There's also a package on MELPA for this now: dashboard: https://github.com/rakanalh/emacs-dashboard. The package allows you to have a splash screen as in the image below: Here's the use-package snippet from my config to set it up with a custom banner image and line of text, as well as a list of recent files and bookmarks: (use-package dashboard :...


19

How do I remove the files that do not exist from recent files list? M-xrecentf-cleanupRET recentf-cleanup is an interactive compiled Lisp function in ‘recentf.el’. (recentf-cleanup) Cleanup the recent list. That is, remove duplicates, non-kept, and excluded files. See also the user options recentf-auto-cleanup: recentf-auto-cleanup is a variable ...


13

When you open emacs, open several files and exit emacs using C-x C-c (graceful exit), it will call the recentf-save-list function which saves recently opened files to a file specified by recentf-save-file. On the other hand if you kill emacs using kill, it is NOT a graceful exit and there is no chance for emacs to save the files. So they will not be there ...


11

Manomagically :D, after posting the question I got the working solution by removing one single quote below in my .emacs (setq initial-buffer-choice '(helm-recentf)) ;; Does not work To this: (setq initial-buffer-choice (helm-recentf)) ;; Works!!! ;; I still haven't tried doing with the built-in recentf only Or this: (setq initial-buffer-choice 'helm-...


10

You can set it with (setq recentf-save-file (expand-file-name "recentf" <other-directory>)) You can usually find settings like this by looking at the help for one of the functions, e.g. recentf-mode, then following the link to the source code, and then doing occur for defcustom to find one that looks like it might be a file storage location - e.g. in ...


8

One solution for that narrow case is to dynamically set save-silently for that invocation specific invocation. Try: (run-at-time nil (* 5 60) (lambda () (let ((save-silently t)) (recentf-save-list)))) You might alternatively use advice to globally accomplish the same thing. See Advising Functions in the Emacs ...


7

install counsel (https://oremacs.com/2015/04/09/counsel-completion/) Run M-x counsel-recentf Press C-c C-o to export the file list to a buffer


6

(add-to-list 'recentf-exclude "company-statistics-cache.el") or more accurately (add-to-list 'recentf-exclude (expand-file-name "~/.emacs.d/company-statistics-cache.el")) then run M-x recentf-cleanup to make it work. Anyway, the regexp you set in recentf-exclude must match the $HOME/.emacs.d/company-statistics-cache.el (~ is expanded into $...


6

on my side, I just ignored elpa folder by adding that: (add-to-list 'recentf-exclude (format "%s/\\.emacs\\.d/elpa/.*" (getenv "HOME")))


6

To go to the recent files list, you can press r in the *spacemacs* buffer. Then you can use j or k (if you've got vim-style editing) to navigate up and down the list. Press <RET> to open a file.


5

According to https://github.com/abo-abo/swiper/issues/648, it's simply (setq ivy-virtual-abbreviate 'full) It's not quite as nice as opened buffers (where only the differing part is shown), but good enough. (I haven't found anything like that for ido though.)


5

M-x customize-option RET recentf-keep RET, and be sure to read its description. You can use any arbitrary or conditional expression. And that includes file-remote-p.


5

Ivy already has an action bound to "k" for ivy-switch-buffer, but it just calls kill-buffer so it does not work on virtual buffers. Based on what ido is doing, here's some code to replace the default ivy kill action with one that also handles virtual buffers by dropping them from the recentf list: (defun my-ivy-kill-buffer (buf) (interactive) (if (get-...


4

You can save recent files just before shutdown by calling recentf-save-list M-x recentf-save-list RET This adds your recent files to recentf history. If you dont want to do this manually, you can add a timer which will do that for you every 5 minutes. (run-at-time (current-time) 300 'recentf-save-list) Add this to your config. So whenever you open emacs,...


4

To determine where the recentf file is, you can query the variable recentf-save-file. By default, that is ~/.emacs.d/recentf. In spacemacs that is ~/.emacs.d/.cache/recentf. You can copy this file over to the new machine, or you can open the file and copy the entries. AFAIK there is no functionality to import/export, as that's a very exclusive use case and ...


3

You can let-bind find-file-hook to prevent Recentf from recording the file, e.g., (let ((find-file-hook (remq 'recentf-track-opened-file find-file-hook))) (find-file "test.txt")) Then to bypass Recentf during M-x org-agenda, use this: (define-advice org-agenda (:around (old-fun &rest args) skip-recentf) (let ((find-file-hook (remq 'recentf-track-...


3

I am not sure if this is what you are looking for and if it works in spacemacs. I am using standard emacs and desktop-save-mode. It is configurable with several options. I am using currntly this: (setq desktop-dirname "~/.emacs.d/desktop/" desktop-base-file-name "emacs.desktop" desktop-base-lock-name "lock" desktop-path ...


3

Setting recentf-exclude may help you. cf. https://www.reddit.com/r/emacs/comments/3g468d/stop_recent_files_showing_elpa_packages/


3

Here's a package that shows recentf-open-files when starting Emacs without a file to open: https://github.com/zonuexe/init-open-recentf.el Configuration with use-package: (recentf-mode 1) (setq recentf-max-menu-items 25) (use-package init-open-recentf :config (init-open-recentf))


3

You can customize recentf-menu-action, from C-h v recentf-menu-action: recentf-menu-action is a variable defined in ‘recentf.el’. Its value is ‘find-file’ Documentation: Function to invoke with a filename item of the recentf menu. The default is to call ‘find-file’ to edit the selected file. the default value is find-file, so if you always want ...


3

You're looking for counsel-recentf, which comes with counsel. Just M-x counsel-recentf or bind it to any keys you'd like and that's all you're looking for. Loosely speaking Ivy is the completion backend, counsel provides functionality to use ivy "replacing" some popular commands with ivy-style completion.


3

This should do it. (defun no-msg (function) "Prevent FUNCTION from showing `Wrote <FILE>' messages. \(The messages are still logged to `*Messages*'.)" (let ((inhibit-message t)) (funcall function))) (advice-add 'recentf-save-list :around 'no-msg) To see the messages again, use (advice-remove 'recentf-save-list 'no-msg).


2

From the link (https://www.emacswiki.org/emacs/RecentFiles): ;; use a different set of recent files (setq recentf-save-file (recentf-expand-file-name "~/.emacs.d/.recentf"))


2

I know this thread is old, but i came across the same problem in MS Windows (i.e. Windows does know how to exit Emacs daemon gracefully). I solved this for me by hooking recentf-save-list into terminal-delete-functions. So in my init file I have the following line: (add-hook 'delete-terminal-functions (lambda (terminal) (recentf-save-list))) Then the ...


2

Seems that I used deprecated way for activating minor mode (this works across Emacs 21-24): (setq-default save-place t) (require 'saveplace) Today way to activate this minor mode is: (save-place-mode 1) Thanks to Drew for hint!


2

Removing the whole emacs cache fixed the issue: rm -rf ~/.emacs.d/.cache/


2

Evaluate : (add-to-list 'recentf-exclude "/private/var/folders/.*") To activate it permanently, save it in your init file (.emacs or .emacs.d/init.el).


2

Dired+ just uses your recentf-list of files and directories. It is library recentf.el that controls what file and dir names to record there. For that, library recentf.el provides several user options, which filter out certain file and dir names, etc. That's no doubt what you're running into. Your second question isn't clear to me (and you really should ...


1

Your problem/question about seeing only 5 recent files listed in the menu. Customize option recentf-menu-open-all-flag to t. The recentf menu then shows item All..., which lists all recent files, letting you open any of them individually. Your question about opening all recent files at once. (Use C-x C-b to navigate to their buffers.) (defun open-all-...


1

You can also do this with emacsclient. Here I'm using space to separate file names: #!/bin/sh emacsclient -e "(mapconcat #'identity recentf-list \" \")" thescript | sed 's/\s/\n/g'


Only top voted, non community-wiki answers of a minimum length are eligible