Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zonuexe/init-open-recentf.el

open-recentf on Emacs startup
https://github.com/zonuexe/init-open-recentf.el

Last synced: about 1 month ago
JSON representation

open-recentf on Emacs startup

Awesome Lists containing this project

README

        

* init-open-recentf.el
#+BEGIN_HTML
MELPA init-open-recentf
MELPA stable: init-open-recentf
Emacs: 28.0
#+END_HTML

Open recentf immediately after Emacs is started.
Here are some example scenarios for when Emacs is started from the command line:
- If files are opened (e.g. =$ emacs file1.txt=), nothing out of the ordinary occurs-- the file is opened.
- However if a file is not indicated (e.g. =$ emacs =), recentf will be opened after emacs is initialized.
This script uses only the inbuilt advice function for startup. It does not require or use any interactive function.

** Setup

Put the following into your .emacs file (=~/.emacs.d/init.el=)

#+BEGIN_SRC emacs-lisp
(init-open-recentf)
#+END_SRC

=init-open-recentf= supports the following frameworks: [[https://github.com/minad/consult][Consult]], [[https://emacs-helm.github.io/helm/][Helm]], [[https://www.gnu.org/software/emacs/manual/ido.html][IDO]], [[https://github.com/abo-abo/swiper][Ivy/Counsel]] and [[https://www.emacswiki.org/emacs/Anything][Anything]] (and the default Emacs setup without those frameworks).

The package determines the frameworks from your environment, but you can also indicate it explicitly.

#+BEGIN_SRC emacs-lisp
(setq init-open-recentf-interface 'ido)
(init-open-recentf)
#+END_SRC

Another possible configuration is demonstrated below if you want to specify an arbitrary function.

#+BEGIN_SRC emacs-lisp
(setq init-open-recentf-function #'awesome-open-recentf)
(init-open-recentf)
#+END_SRC

** Hook

#+BEGIN_SRC emacs-lisp
(add-hook 'init-open-recentf-after-hook 'your/init-func)

(add-hook
'init-open-recentf-before-hook
(lambda ()
(with-current-buffer "*scratch*"
(unless buffer-read-only
(goto-char (1- (point-max)))
(insert "
;;        r /
;;   __ , --ヽ!-- .、_
;;  !  `/::::;::::ヽ l
;;  !二二!::/}::::丿ハニ|
;;  !ニニ.|:/ ノ/ }::::}コ
;;  L二lイ  0´ 0 ,':ノコ
;;  lヽノ/ヘ、 '' ▽_ノイ ソ
;;  ソ´ /}`ス / ̄ ̄ ̄ ̄/
;;    .(_:;つ/ 0401 / カタカタ
;;  ̄ ̄ ̄ ̄ ̄\/____/
")))))
#+END_SRC

** Installation
*** Cask (without [[https://github.com/rdallasgray/pallet][pallet]])
See the [[http://cask.readthedocs.org/en/latest/guide/installation.html][Cask Installation]] guide. Put into your =Cask= file the following.
#+BEGIN_SRC emacs-lisp
(depends-on "init-open-recentf")
#+END_SRC
*** MELPA
See [[http://melpa.org/#/getting-started][Getting Started - MELPA]]. =M-x package-install= and type =init-open-recentf=.
*** El-get
See [[https://github.com/dimitri/el-get#installation][El-Get #Installation]]. Put into your =init.el= file the following.
#+BEGIN_SRC emacs-lisp
(el-get-bundle init-open-recentf)
#+END_SRC