Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
a30ccae6
Commit
a30ccae6
authored
Oct 25, 2000
by
Miles Bader
Browse files
(recentf-mode): Variable removed.
(recentf-mode): Use `define-minor-mode'.
parent
e90813b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
39 deletions
+30
-39
lisp/recentf.el
lisp/recentf.el
+30
-39
No files found.
lisp/recentf.el
View file @
a30ccae6
...
...
@@ -177,19 +177,6 @@ used to build the menu and must return a new list of menu elements (see
(
add-hook
'kill-buffer-hook
'recentf-remove-file-hook
))
(
custom-set-default
sym
val
)))
(
defcustom
recentf-mode
nil
"Toggle recentf mode.
When recentf mode is enabled, it maintains a menu for visiting files that
were operated on recently.
Setting this variable directly does not take effect;
use either \\[customize] or the function `recentf-mode'."
:set
(
lambda
(
symbol
value
)
(
recentf-mode
(
or
value
0
)))
:initialize
'custom-initialize-default
:type
'boolean
:group
'recentf
:require
'recentf
)
(
defcustom
recentf-load-hook
nil
"*Normal hook run at end of loading the `recentf' package."
:group
'recentf
...
...
@@ -1021,37 +1008,41 @@ which buffer to use for the interaction."
(
recentf-open-files
(
nthcdr
recentf-max-menu-items
recentf-list
)
(
concat
"*"
recentf-menu-title
" - More*"
)))
;;; Note this definition must be at the end of the file, because
;;; `define-minor-mode' actually calls the mode-function if the
;;; associated variable is non-nil, which requires that all needed
;;; functions be already defined. [This is arguably a bug in d-m-m]
;;;###autoload
(
def
un
recentf-mode
(
&optional
arg
)
(
def
ine-minor-mode
recentf-mode
"Toggle recentf mode.
With prefix ARG, turn
recentf mode on if and only if ARG is positive
.
Returns the new stat
us of recentf mode (non-nil means on)
.
With prefix
argument
ARG, turn
on if positive, otherwise off
.
Returns
non-nil if
the new stat
e is enabled
.
When recentf mode is enabled, it maintains a menu for visiting files that
were operated on recently."
(
interactive
"P"
)
(
let
((
on-p
(
if
arg
(
>
(
prefix-numeric-value
arg
)
0
)
(
not
recentf-mode
))))
(
if
on-p
(
unless
recentf-initialized-p
(
setq
recentf-initialized-p
t
)
(
if
(
file-readable-p
recentf-save-file
)
(
load-file
recentf-save-file
))
(
setq
recentf-update-menu-p
t
)
(
add-hook
'find-file-hooks
'recentf-add-file-hook
)
(
add-hook
'write-file-hooks
'recentf-add-file-hook
)
(
add-hook
'menu-bar-update-hook
'recentf-update-menu-hook
)
(
add-hook
'kill-emacs-hook
'recentf-save-list
))
(
when
recentf-initialized-p
(
setq
recentf-initialized-p
nil
)
(
recentf-save-list
)
(
easy-menu-remove-item
nil
recentf-menu-path
recentf-menu-title
)
(
remove-hook
'find-file-hooks
'recentf-add-file-hook
)
(
remove-hook
'write-file-hooks
'recentf-add-file-hook
)
(
remove-hook
'menu-bar-update-hook
'recentf-update-menu-hook
)
(
remove-hook
'kill-emacs-hook
'recentf-save-list
)))
(
setq
recentf-mode
on-p
)))
nil
nil
nil
:global
t
:group
'recentf
(
if
recentf-mode
(
unless
recentf-initialized-p
(
setq
recentf-initialized-p
t
)
(
if
(
file-readable-p
recentf-save-file
)
(
load-file
recentf-save-file
))
(
setq
recentf-update-menu-p
t
)
(
add-hook
'find-file-hooks
'recentf-add-file-hook
)
(
add-hook
'write-file-hooks
'recentf-add-file-hook
)
(
add-hook
'menu-bar-update-hook
'recentf-update-menu-hook
)
(
add-hook
'kill-emacs-hook
'recentf-save-list
))
(
when
recentf-initialized-p
(
setq
recentf-initialized-p
nil
)
(
recentf-save-list
)
(
easy-menu-remove-item
nil
recentf-menu-path
recentf-menu-title
)
(
remove-hook
'find-file-hooks
'recentf-add-file-hook
)
(
remove-hook
'write-file-hooks
'recentf-add-file-hook
)
(
remove-hook
'menu-bar-update-hook
'recentf-update-menu-hook
)
(
remove-hook
'kill-emacs-hook
'recentf-save-list
))))
(
provide
'recentf
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment