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
5f904e50
Commit
5f904e50
authored
Jun 23, 2022
by
Stefan Kangas
Browse files
Revert "Allow shortening filenames in recentf-mode menu"
This reverts commit
32906819
.
parent
2bd49c82
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
22 deletions
+5
-22
etc/NEWS
etc/NEWS
+0
-5
lisp/recentf.el
lisp/recentf.el
+5
-17
No files found.
etc/NEWS
View file @
5f904e50
...
...
@@ -1855,11 +1855,6 @@ Enabling this minor mode turns on hiding header material, like
If non-nil, files untracked by a VCS are considered to be part of
the project by a VC project based on that VCS.
---
***
The 'recentf-mode' menu can now use shortened filenames.
Set the user option 'recentf-menu-filter' to
'recentf-show-abbreviated'
to enable it.
---
**
The autoarg.el library is now marked obsolete.
This library provides the 'autoarg-mode' and 'autoarg-kp-mode' minor
...
...
lisp/recentf.el
View file @
5f904e50
...
...
@@ -187,8 +187,6 @@ A nil value means no filter. The following functions are predefined:
Sort menu items by directories in ascending order.
- `recentf-sort-directories-descending'
Sort menu items by directories in descending order.
- `recentf-show-abbreviated'
Show shortened filenames.
- `recentf-show-basenames'
Show filenames sans directory in menu items.
- `recentf-show-basenames-ascending'
...
...
@@ -217,7 +215,6 @@ elements (see `recentf-make-menu-element' for menu element form)."
(
function-item
recentf-sort-basenames-descending
)
(
function-item
recentf-sort-directories-ascending
)
(
function-item
recentf-sort-directories-descending
)
(
function-item
recentf-show-abbreviated
)
(
function-item
recentf-show-basenames
)
(
function-item
recentf-show-basenames-ascending
)
(
function-item
recentf-show-basenames-descending
)
...
...
@@ -724,11 +721,14 @@ Compares directories then filenames to order the list."
(
recentf-menu-element-value
e2
)
(
recentf-menu-element-value
e1
)))))
(
defun
recentf--filter-names
(
l
no-dir
fun
)
(
defun
recentf-show-basenames
(
l
&optional
no-dir
)
"Filter the list of menu elements L to show filenames sans directory.
When a filename is duplicated, it is appended a sequence number if
optional argument NO-DIR is non-nil, or its directory otherwise."
(
let
(
filtered-names
filtered-list
full
name
counters
sufx
)
(
dolist
(
elt
l
(
nreverse
filtered-list
))
(
setq
full
(
recentf-menu-element-value
elt
)
name
(
f
uncall
fun
full
))
name
(
f
ile-name-nondirectory
full
))
(
if
(
not
(
member
name
filtered-names
))
(
push
name
filtered-names
)
(
if
no-dir
...
...
@@ -740,18 +740,6 @@ Compares directories then filenames to order the list."
(
setq
name
(
format
"%s(%s)"
name
sufx
)))
(
push
(
recentf-make-menu-element
name
full
)
filtered-list
))))
(
defun
recentf-show-abbreviated
(
l
&optional
no-dir
)
"Filter the list of menu elements L to show shortened filenames.
When a filename is duplicated, it is appended a sequence number if
optional argument NO-DIR is non-nil, or its directory otherwise."
(
recentf--filter-names
l
no-dir
#'
abbreviate-file-name
))
(
defun
recentf-show-basenames
(
l
&optional
no-dir
)
"Filter the list of menu elements L to show filenames sans directory.
When a filename is duplicated, it is appended a sequence number if
optional argument NO-DIR is non-nil, or its directory otherwise."
(
recentf--filter-names
l
no-dir
#'
file-name-nondirectory
))
(
defun
recentf-show-basenames-ascending
(
l
)
"Filter the list of menu elements L to show filenames sans directory.
Filenames are sorted in ascending order.
...
...
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