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
emacs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emacs
emacs
Commits
11f4d68f
Commit
11f4d68f
authored
Mar 05, 2013
by
Michael Albinus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* net/tramp-compat.el (tramp-compat-delete-directory): Implement
TRASH argument.
parent
2054a6c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
18 deletions
+28
-18
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/net/tramp-compat.el
lisp/net/tramp-compat.el
+23
-18
No files found.
lisp/ChangeLog
View file @
11f4d68f
2013-03-05 Michael Albinus <michael.albinus@gmx.de>
* net/tramp-compat.el (tramp-compat-delete-directory): Implement
TRASH argument.
2013-03-05 Dmitry Gutov <dgutov@yandex.ru>
Keep pre-existing highlighting in completion candidates (Bug#13250).
...
...
lisp/net/tramp-compat.el
View file @
11f4d68f
...
...
@@ -384,25 +384,30 @@ Not actually used. Use `(format \"%o\" i)' instead?"
trash
)))
(
delete-file
filename
)))))
;; RECURSIVE has been introduced with Emacs 23.2.
(
defun
tramp-compat-delete-directory
(
directory
&optional
recursive
)
;; RECURSIVE has been introduced with Emacs 23.2. TRASH has been
;; introduced with Emacs 24.1.
(
defun
tramp-compat-delete-directory
(
directory
&optional
recursive
trash
)
"Like `delete-directory' for Tramp files (compat function)."
(
if
(
null
recursive
)
(
delete-directory
directory
)
(
condition-case
nil
(
tramp-compat-funcall
'delete-directory
directory
recursive
)
;; This Emacs version does not support the RECURSIVE flag. We
;; use the implementation from Emacs 23.2.
(
wrong-number-of-arguments
(
setq
directory
(
directory-file-name
(
expand-file-name
directory
)))
(
if
(
not
(
file-symlink-p
directory
))
(
mapc
(
lambda
(
file
)
(
if
(
eq
t
(
car
(
file-attributes
file
)))
(
tramp-compat-delete-directory
file
recursive
)
(
delete-file
file
)))
(
directory-files
directory
'full
"^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"
)))
(
delete-directory
directory
)))))
(
condition-case
nil
(
cond
(
trash
(
tramp-compat-funcall
'delete-directory
directory
recursive
trash
))
(
recursive
(
tramp-compat-funcall
'delete-directory
directory
recursive
))
(
t
(
delete-directory
directory
)))
;; This Emacs version does not support the RECURSIVE or TRASH flag. We
;; use the implementation from Emacs 23.2.
(
wrong-number-of-arguments
(
setq
directory
(
directory-file-name
(
expand-file-name
directory
)))
(
if
(
not
(
file-symlink-p
directory
))
(
mapc
(
lambda
(
file
)
(
if
(
eq
t
(
car
(
file-attributes
file
)))
(
tramp-compat-delete-directory
file
recursive
trash
)
(
tramp-compat-delete-file
file
trash
)))
(
directory-files
directory
'full
"^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"
)))
(
delete-directory
directory
))))
;; `number-sequence' does not exist in XEmacs. Implementation is
;; taken from Emacs 23.
...
...
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