Emacs projectile1/4/2023 ![]() You can match your minibuffer input against either or both parts. And the completion candidates are two-part multi-completions: (1) the (absolute) file name and (2) the file’s last modification date. ‘icicle-recent-file’ is also a multi-command, so you can use it to open several recently used files at once. Icicles command ‘icicle-recent-file’ lets you use the usual ‘find-file’ minibuffer interface, with completion and cycling among your recent files. ‘recentf-mode’ of vanilla Emacs forces you to open a file using a menu interface. Icicles lets you take advantage of library recentf.el in two ways. (funcall recentf-menu-action file))) find-file by default (item (completing-read "Open recent: " items)) (files (nth i (recentf-list-entries 'cdr num))) (items (nth i (recentf-list-entries 'car num))) (i (recentf-memindex menu (recentf-list-submenus num))) (message "There are only %d recent items." (let* ((num (prog1 (if (and (not (null arg)) Otherwise, show the default maximum number of recent items." With positive prefix ARG, show the ARG most recent items. "Open the recentf menu via the minubuffer, with completion. (when (equal (car l) mem) (setq ret mempos)) fact that it isn't makes me wonder if there's a preferred way of other contexts that I'm surprised it's not part of Emacs, and the This function is not specific to recentf mode but is needed by ![]() (mapcar 'cdr (recentf-filtered-list ,arg)) When FN is `'car' return the menu entry names, when FN is `'cdr' "Return a list of ARG recentf menu entries as determined by FN. (delq nil (mapcar 'car (recentf-filtered-list arg))))) (if (listp (cdar (recentf-filtered-list arg))) submenues exist ![]() "Return a list of the recentf submenu names." (butlast recentf-list (- (length recentf-list) arg))))) (mapcar 'recentf-make-default-menu-element "Return a filtered list of ARG recentf items." (I find it convenient to globally bind ‘C-c r’ to the command ‘recentf-minibuffer-dialog’.) – SteveBerman (defun recentf-filtered-list (arg) ![]() #Emacs projectile code#So I wrote some code that makes the filtering and structuring of the recent file menu accessible from the minibuffer, with standard tabbed completion. Steve: Why don’t you upload this as an Emacs-Lisp library? – DrewAdams One of the features of recentf.el that I find most useful is the possibility of filtering ‘recentf-list’ and structuring the recent file menu in accordance with the filter. This requires enabling recursive minibuffer editing: (setq enable-recursive-minibuffers t). Here is Steve’s commentary, followed by his code. , SteveBerman posted some code to that takes recentf filters into account in another way. ![]() If you use, say, the recentf filter ‘recentf-arrange-by-dir’, then the File > Open Recent menu is organized by directory, and this is reflected in the completion candidates used by ‘lacarte-execute-menu-command’. You can take advantage of recentf filters (that is, structured menus) from the keyboard (with completion and so on) by using library LaCarte.Īssuming that you have ‘ESC ESC x’ (that is, ‘ESC M-x’) bound to ‘lacarte-execute-menu-command’ (which you should -)), just type part of a recent file name (any part, or a regexp), then hit ‘S-TAB’ to complete to matching recent files. This section describes ways to take advantage of that menu organization at the keyboard, with completion. Recentf lets you structure its menus in various ways, using what it calls filters. every 5 minutes: (run-at-time nil (* 5 60) 'recentf-save-list) If Emacs exits abruptly for some reason the recent file list will be lost - therefore you may wish to call `recentf-save-list` periodically, e.g. Periodically saving the list of filesīy default, Recentf saves the list of recent files on exiting Emacs (specifically, `recentf-save-list` is called on `kill-emacs-hook`). This mode has been part of GNU Emacs since version 21. (global-set-key " \C-x \ \C-r" 'recentf-open-files) To enable ‘recentf-mode’, put this in your `~/.emacs’: (recentf-mode 1) This list is is automatically saved across sessions on exiting Emacs - you can then access this list through a command or the menu. Recentf is a minor mode that builds a list of recently opened files. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |