(defvar recentf-list nil
"List of recently opened files.")
-(defsubst recentf-enabled-p ()
+(defun recentf-enabled-p ()
"Return non-nil if recentf mode is currently enabled."
(memq 'recentf-save-list kill-emacs-hook))
+
\f
;;; Customization
;;
(memq system-type '(windows-nt cygwin))
"Non-nil if recentf searches and matches should ignore case.")
-(defsubst recentf-string-equal (s1 s2)
+(defun recentf-string-equal (s1 s2)
"Return non-nil if strings S1 and S2 have identical contents.
Ignore case if `recentf-case-fold-search' is non-nil."
(if recentf-case-fold-search
(string-equal (downcase s1) (downcase s2))
(string-equal s1 s2)))
-(defsubst recentf-string-lessp (s1 s2)
+(defun recentf-string-lessp (s1 s2)
"Return non-nil if string S1 is less than S2 in lexicographic order.
Ignore case if `recentf-case-fold-search' is non-nil."
(if recentf-case-fold-search
\f
;;; File functions
;;
-(defsubst recentf-push (filename)
+(defun recentf-push (filename)
"Push FILENAME into the recent list, if it isn't there yet.
If it is there yet, move it at the beginning of the list.
If `recentf-case-fold-search' is non-nil, ignore case when comparing
(error nil))
name))
-(defsubst recentf-expand-file-name (name)
+(defun recentf-expand-file-name (name)
"Convert file NAME to absolute, and canonicalize it.
NAME is first passed to the function `expand-file-name', then to
`recentf-filename-handlers' to post process it."
checks (cdr checks)))
keepit))
-(defsubst recentf-add-file (filename)
+(defun recentf-add-file (filename)
"Add or move FILENAME at the beginning of the recent list.
Does nothing if the name satisfies any of the `recentf-exclude'
regexps or predicates."
(when (recentf-include-p filename)
(recentf-push filename)))
-(defsubst recentf-remove-if-non-kept (filename)
+(defun recentf-remove-if-non-kept (filename)
"Remove FILENAME from the recent list, if file is not kept.
Return non-nil if FILENAME has been removed."
(unless (recentf-keep-p filename)
\f
;;; Menu building
;;
-(defsubst recentf-digit-shortcut-command-name (n)
+(defun recentf-digit-shortcut-command-name (n)
"Return a command name to open the Nth most recent file.
See also the command `recentf-open-most-recent-file'."
(intern (format "recentf-open-most-recent-file-%d" n)))
to the recent file list part of the menu. Before calling a menu
filter function this variable is reset to nil.")
-(defsubst recentf-elements (n)
+(defun recentf-elements (n)
"Return a list of the first N elements of the recent list."
(seq-take recentf-list n))
:help (concat "Open " value)
:active t)))))
-(defsubst recentf-menu-bar ()
+(defun recentf-menu-bar ()
"Return the keymap of the global menu bar."
(lookup-key global-map [menu-bar]))
\f
;;; Predefined menu filters
;;
-(defsubst recentf-sort-ascending (l)
+(defun recentf-sort-ascending (l)
"Sort the list of menu elements L in ascending order.
The MENU-ITEM part of each menu element is compared."
(sort (copy-sequence l)
(recentf-menu-element-item e1)
(recentf-menu-element-item e2)))))
-(defsubst recentf-sort-descending (l)
+(defun recentf-sort-descending (l)
"Sort the list of menu elements L in descending order.
The MENU-ITEM part of each menu element is compared."
(sort (copy-sequence l)
(recentf-menu-element-item e2)
(recentf-menu-element-item e1)))))
-(defsubst recentf-sort-basenames-ascending (l)
+(defun recentf-sort-basenames-ascending (l)
"Sort the list of menu elements L in ascending order.
Only filenames sans directory are compared."
(sort (copy-sequence l)
(file-name-nondirectory (recentf-menu-element-value e1))
(file-name-nondirectory (recentf-menu-element-value e2))))))
-(defsubst recentf-sort-basenames-descending (l)
+(defun recentf-sort-basenames-descending (l)
"Sort the list of menu elements L in descending order.
Only filenames sans directory are compared."
(sort (copy-sequence l)
(file-name-nondirectory (recentf-menu-element-value e2))
(file-name-nondirectory (recentf-menu-element-value e1))))))
-(defsubst recentf-sort-directories-ascending (l)
+(defun recentf-sort-directories-ascending (l)
"Sort the list of menu elements L in ascending order.
Compares directories then filenames to order the list."
(sort (copy-sequence l)
(recentf-menu-element-value e1)
(recentf-menu-element-value e2)))))
-(defsubst recentf-sort-directories-descending (l)
+(defun recentf-sort-directories-descending (l)
"Sort the list of menu elements L in descending order.
Compares directories then filenames to order the list."
(sort (copy-sequence l)
optional argument NO-DIR is non-nil, or its directory otherwise."
(recentf--filter-names l no-dir #'file-name-nondirectory))
-(defsubst recentf-show-basenames-ascending (l)
+(defun recentf-show-basenames-ascending (l)
"Filter the list of menu elements L to show filenames sans directory.
Filenames are sorted in ascending order.
This filter combines the `recentf-sort-basenames-ascending' and
`recentf-show-basenames' filters."
(recentf-show-basenames (recentf-sort-basenames-ascending l)))
-(defsubst recentf-show-basenames-descending (l)
+(defun recentf-show-basenames-descending (l)
"Filter the list of menu elements L to show filenames sans directory.
Filenames are sorted in descending order.
This filter combines the `recentf-sort-basenames-descending' and