Chong Yidong
82d84d3fc9
Fix bug in copy-directory copying into an existing directory.
...
http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg01007.html
* files.el (copy-directory): If destination is an existing
directory, copy into a subdirectory there.
2011-01-29 17:10:51 -05:00
Glenn Morris
73b0cd5003
Convert consecutive FSF copyright years to ranges.
2011-01-24 20:08:28 -08:00
Glenn Morris
06d8ace515
Merge from emacs-23.
...
Note setting of CANNOT_DUMP on ia64 hpux is still to be merged manually.
2011-01-24 19:47:47 -08:00
Stefan Monnier
10e1d5f30f
* files.el (file-name-non-special): Only change buffer-file-name after
...
insert-file-contents if it's `visit'ing the file.
Fixes: debbugs:7854
2011-01-24 15:34:44 -05:00
Chong Yidong
9aea757bb0
Revert changes adding format args to yes-or-no-p and y-or-n-p.
...
See discussion on emacs-devel at
http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg00388.html
* src/fns.c (Fyes_or_no_p): Revert 2011-01-07 change, removing ARGS.
* lisp/subr.el (y-or-n-p): Revert 2011-01-07 change, removing ARGS.
* lisp/files.el (find-alternate-file, basic-save-buffer)
(basic-save-buffer-2, revert-buffer, recover-file)
(kill-buffer-ask, abort-if-file-too-large)
(set-visited-file-name, write-file, backup-buffer)
(basic-save-buffer, save-some-buffers):
* lisp/dired-aux.el (dired-compress-file): Callers changed.
2011-01-19 21:55:36 -05:00
Glenn Morris
d52969e8af
Merge from emacs-23 branch, up to 2010-05-20T21:33:58Z!juri@jurta.org.
...
Note:
emacs-23 2010-05-20T01:32:08Z!lekktu@gmail.com is rendered unnecessary by pre-existing 2010-05-20
trunk change.
2011-01-15 12:38:27 -08:00
Glenn Morris
362b9d483c
Merge from emacs-23 branch.
2011-01-15 12:03:38 -08:00
Mark Diekhans
b024d9f02d
Make last-resort backup file in .emacs.d (Bug#6953).
...
* lisp/files.el (backup-buffer): Make last-resort backup file in
.emacs.d.
* lisp/subr.el (locate-user-emacs-file): If .emacs.d does not exist,
make it with permission 700.
* doc/emacs/files.texi (Backup Names): Document the new location of the
last-resort backup file.
2011-01-14 21:32:19 -05:00
Chong Yidong
2b9f65621b
* lisp/files.el (directory-abbrev-alist): Minor doc fix (Bug#7777).
...
* doc/lispref/files.texi: Likewise.
2011-01-08 16:22:19 -05:00
Chong Yidong
3ef01959de
New function read-char-choice for reading a restricted set of chars.
...
* lisp/subr.el (read-char-choice): New function, factored out from
dired-query and hack-local-variables-confirm.
* lisp/dired-aux.el (dired-query):
* lisp/files.el (hack-local-variables-confirm): Use it.
2011-01-08 14:17:23 -05:00
Eli Zaretskii
4320be4251
Fix bug #7777 with documentation of directory-abbrev-alist.
...
lisp/files.el (directory-abbrev-alist): Doc fix.
doc/lispref/files.texi (Directory Names): Explain why FROM in
directory-abbrev-alist should begin with \`.
2011-01-07 17:55:13 +02:00
Chong Yidong
7c420169ba
Merge changes from emacs-23 branch
2011-01-02 15:31:19 -05:00
Stefan Monnier
2a8a455e77
* lisp/files.el (file-local-variables-alist): Make permanent-local.
...
Fixes: debbugs:7767
2011-01-01 22:57:26 -05:00
Tassilo Horn
291cc04566
* doc-view.el (doc-view-set-doc-type): New function refactored
...
from doc-view-mode.
(doc-view-fallback-mode): New function.
(doc-view-mode): Use it.
(doc-view-mode-maybe): New function that checks if doc-view-mode
can be used and falls back to the next best mode otherwise.
* files.el (auto-mode-alist): Use doc-view-mode-maybe for PDF,
DVI, OpenDocument, and MS Office files.
2010-12-30 19:08:18 +01:00
Stefan Monnier
f49d1f52b2
Merge from emacs-23
2010-12-13 10:27:36 -05:00
Karel Klíc
1e5d2a048d
* lisp/files.el (auto-mode-alist): Use html-mode for *.xhtml.
...
(This really only affects empty files.)
Fixes: debbugs:7606
2010-12-10 18:48:23 -08:00
Glenn Morris
66f782de2e
* lisp/files.el (diff-no-select): Declare.
2010-12-09 19:47:49 -08:00
Stefan Monnier
33cf0fb226
* lisp/files.el (dir-locals-collect-variables): Don't let errors stop us.
...
Use string-prefix-p.
(file-name-version-regexp): New var.
(file-name-sans-versions):
* lisp/jka-cmpr-hook.el (jka-compr-build-file-regexp): Use it,
(jka-compr-get-compression-info): Use dolist.
(jka-compr-compression-info-list): Don't bother specifying
version/backup regexps.
2010-12-07 21:18:02 -05:00
W. Martin Borgert
11cb1e35ff
* lisp/files.el (auto-mode-alist): Handle .dbk (DocBook) with xml-mode.
...
* etc/schema/schemas.xml: Handle *.dbk as DocBook.
2010-12-04 16:45:17 -05:00
Eli Zaretskii
2472c214a6
Fix bug #4674 with UNCs in file-relative-name.
...
files.el (file-relative-name): Handle UNC file names on DOS/Windows.
Also fixes bug#4673.
2010-12-04 14:52:04 +02:00
Stefan Monnier
b2e4481906
Cleanup diff-buffer-with-file.
...
* lisp/vc/diff.el (diff-old-temp-file, diff-new-temp-file): Remove.
(diff-sentinel): Get them as arguments instead.
(diff-old-file, diff-new-file, diff-extra-args): Remove.
(diff-file-local-copy, diff-better-file-name): New funs.
(diff-no-select): Rename from diff-into-buffer.
Support buffers additionally to files. Move `buf' arg. Don't display buf.
Prefer closures to buffer-local variables.
(diff): Adjust accordingly.
(diff-buffer-with-file): Move from files.el.
* lisp/files.el (diff-buffer-with-file): Move to vc/diff.el.
(diff-buffer-internal): Remove.
(diff-buffer-buffer): Remove.
(save-some-buffers-action-alist): Use diff-no-select so as not to guess
the buffer name used, and so as not to mess up windows and frames.
2010-11-22 14:22:03 -05:00
Bob Rogers
6a7662bb7d
* lisp/files.el: Make revert work with diff-buffer-with-file.
...
(diff-buffer-internal): New function extracted from diff-buffer-with-file
(diff-buffer-with-file): Use it.
* lisp/vc/diff.el (diff-into-buffer): New fun, extracted from diff.
(diff): Use it.
Fixes: debbugs:7277
2010-11-22 12:57:46 -05:00
Michael Albinus
e274eb13e0
* files.el (backup-by-copying-when-mismatch): The default value is
...
now t.
* startup.el (normal-top-level):
* net/tramp.el (tramp-handle-insert-file-contents): Do not set
`backup-by-copying-when-mismatch'.
2010-11-21 20:39:21 +01:00
Stefan Monnier
4a47c27573
Merge from emacs-23
2010-11-17 22:54:14 -05:00
Stefan Monnier
acef0722fc
* lisp/files.el (safe-local-variable-p): Gracefully handle errors.
...
* lisp/emacs-lisp/bytecomp.el (byte-compile-warnings): Simplify the
safety predicate.
2010-11-11 17:19:01 -05:00
Stefan Monnier
d607b96bc2
Merge from emacs-23
2010-11-09 15:07:10 -05:00
Michael Albinus
6ce78fdc20
* files.el (backup-by-copying-when-mismatch): Make it a buffer local
...
variable (permanent-local).
* net/tramp.el (tramp-handle-insert-file-contents): Do not set
`permanent-local' property for `(backup-by-copying-when-mismatch'.
2010-11-06 15:04:23 +01:00
Glenn Morris
e088c02a81
Remove duplicate Lisp definition of temporary-file-directory, from filelock.c.
...
* lisp/files.el (temporary-file-directory): Remove (already defined in C).
* lisp/cus-start.el: Add temporary-file-directory.
2010-10-28 23:51:36 -07:00
Stefan Monnier
43f964fcf0
* lisp/files.el (locate-file-completion-table): Strip non-matching elements
...
before checking length of list.
Fixes: debbugs:7238
2010-10-18 17:02:00 -04:00
Michael Albinus
4bc3c53d1d
* files.el (remote-file-name-inhibit-cache): New defcustom.
...
* time.el (display-time-file-nonempty-p): Use
`remote-file-name-inhibit-cache'.
* net/tramp.el (tramp-completion-reread-directory-timeout): Fix
docstring.
* net/tramp-cache.el (tramp-cache-inhibit-cache): Remove.
(tramp-get-file-property): Replace `tramp-cache-inhibit-cache' by
`remote-file-name-inhibit-cache'. Check also for an integer
value. Add/increase counter when `tramp-verbose' >= 10.
(tramp-set-file-property): Add/increase counter when
`tramp-verbose' >= 10.
* net/tramp-cmds.el (tramp-cleanup-all-connections)
(tramp-cleanup-all-buffers): Set tramp-autoload cookie.
(tramp-bug): Set tramp-autoload cookie. Report all interned
tramp-* variables. Report also `remote-file-name-inhibit-cache'.
(tramp-reporter-dump-variable): Fix docstring. Mask non-7bit
characters only in strings.
* net/tramp-compat.el (remote-file-name-inhibit-cache): Define due
to backward compatibility.
* net/tramp-sh.el (tramp-handle-verify-visited-file-modtime)
(tramp-handle-file-name-all-completions)
(tramp-handle-vc-registered): Use
`remote-file-name-inhibit-cache'.
(tramp-open-connection-setup-interactive-shell): Call
`tramp-cleanup-connection' directly.
2010-10-02 15:21:43 +02:00
Glenn Morris
1ef075bb27
Tweak temporary-file-directory on darwin systems.
...
* lisp/files.el (temporary-file-directory): On darwin, also try
DARWIN_USER_TEMP_DIR (see discussion in bug#7135).
2010-09-30 20:57:26 -07:00
Chong Yidong
41f54b7388
* files.el (get-free-disk-space): Don't assume "df" output columns line up (Bug#6995).
2010-09-25 16:16:35 -04:00
Glenn Morris
5e339ee2a3
Move some autoloaded auto-mode-alist entries to files.el.
...
* image-mode.el, progmodes/compile.el, progmodes/gud.el:
* progmodes/mixal-mode.el, textmodes/bibtex-style.el:
* textmodes/css-mode.el, textmodes/dns-mode.el:
Move autoloaded auto-mode-alist entries to files.el.
* files.el (auto-mode-alist): Move entries here.
2010-09-23 20:06:33 -07:00
Glenn Morris
19543b17af
* lisp/files.el (auto-mode-alist): Add .xa, .xw, .xsw for ld-script-mode.
2010-09-23 00:40:11 -07:00
Glenn Morris
54238e6d10
* lisp/files.el (auto-mode-alist): Prefer C-mode for .xs. (Bug#7071)
2010-09-23 00:34:40 -07:00
Glenn Morris
ce009d0b26
Define ld-script auto-mode-alist entries in the standard place.
...
* lisp/progmodes/ld-script.el (auto-mode-alist): Move to files.el.
* lisp/files.el (auto-mode-alist): Move ld-script entries here,
further down the list.
2010-09-23 00:26:10 -07:00
Chong Yidong
1099930585
Merge changes from emacs-23 branch.
2010-09-06 12:38:03 -04:00
Alexander Klimov
3fa0dc8f4d
* doc/lispref/files.texi (Directory Names): Use \` rather than ^.
...
* lisp/files.el (directory-abbrev-alist): Use \` as default regexp.
2010-09-06 00:03:56 +02:00
Chong Yidong
93a596e11b
* files.el (get-free-disk-space): Search more robustly for "available" column.
...
Suggested by Ehud Karni <ehud@unix.mvs.co.il>:
http://lists.gnu.org/archive/html/emacs-devel/2010-09/msg00163.html
2010-09-05 15:03:20 -04:00
Chong Yidong
bd78fa1d54
Add "Package:" file headers to denote built-in packages.
2010-08-29 12:17:13 -04:00
Chong Yidong
b0126eac41
Merge changes from emacs-23 branch.
2010-08-22 16:02:16 -04:00
Stefan Monnier
118cf45490
* lisp/files.el (locate-file-completion-table): Only list the .el and .elc
...
extensions if there's no other choice.
Fixes: debbugs:5955
2010-08-19 23:21:21 +02:00
Kenichi Handa
f3cc64f808
files.el: Add word-wrap as safe local variable.
2010-08-18 17:07:58 +09:00
Eli Zaretskii
cd83d52209
Add a Hebrew translation of the tutorial.
...
etc/tutorials/TUTORIAL.he: New file.
etc/tutorials/TUTORIAL.translators: Add TUTORIAL.he.
lisp/files.el (bidi-paragraph-direction): Define safe local values.
lisp/language/hebrew.el ("Hebrew"): Add TUTORIAL.he to
language-info-alist. Remove outdated FIXME in a comment.
2010-07-31 18:46:58 +03:00
Eli Zaretskii
9d1f18b5d3
Fix bug #6396 .
...
files.el (make-directory): Doc fix.
2010-06-12 14:17:12 +03:00
Drew Adams
949544ed26
Backport from trunk: Fix bug#6298.
2010-05-31 17:24:46 +02:00
Drew Adams
1603358c07
* files.el (directory-files-no-dot-files-regexp): Doc fix (bug#6298).
2010-05-31 17:15:20 +02:00
Chong Yidong
f1a5d776c4
Change delete-by-moving-to-trash so Lisp calls explicitly request trashing.
...
* src/fileio.c (Fdelete_file): Change meaning of optional arg to mean
whether to trash.
(internal_delete_file, Frename_file): Callers changed.
(delete_by_moving_to_trash): Doc fix.
(Fdelete_directory_internal): Don't move to trash.
* src/callproc.c (delete_temp_file):
* src/buffer.c (Fkill_buffer): Callers changed.
* src/lisp.h: Update prototype.
* lisp/diff.el (diff-sentinel):
* lisp/epg.el (epg--make-temp-file, epg-decrypt-string)
(epg-verify-string, epg-sign-string, epg-encrypt-string):
* lisp/jka-compr.el (jka-compr-partial-uncompress)
(jka-compr-call-process, jka-compr-write-region):
* lisp/server.el (server-sentinel): Remove optional arg from
delete-file, reverting 2010-05-03 change.
* lisp/dired.el (dired-delete-file): New arg TRASH.
(dired-internal-do-deletions): New arg TRASH. Use progress
reporter.
(dired-do-flagged-delete, dired-do-delete): Use trash.
* lisp/files.el (delete-directory): New arg TRASH.
* lisp/speedbar.el (speedbar-item-delete): Allow trashing.
* lisp/net/ange-ftp.el (ange-ftp-del-tmp-name, ange-ftp-delete-file)
(ange-ftp-rename-remote-to-remote)
(ange-ftp-rename-local-to-remote)
(ange-ftp-rename-remote-to-local, ange-ftp-load)
(ange-ftp-compress, ange-ftp-uncompress): Remove optional arg from
`delete-file'.
(ange-ftp-delete-directory): Add optional arg to `delete-file', to
allow trashing.
* lisp/net/tramp-compat.el (tramp-compat-delete-file): Rewrite to
handle new TRASH arg of `delete-file'.
* lisp/net/tramp-fish.el (tramp-fish-handle-delete-directory)
(tramp-fish-handle-delete-file)
(tramp-fish-handle-make-symbolic-link)
(tramp-fish-handle-process-file): Use null TRASH arg in
`tramp-compat-delete-file' call.
* lisp/net/tramp-ftp.el (tramp-ftp-file-name-handler): Use null TRASH
arg in `tramp-compat-delete-file' call.
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-delete-file): Rename arg.
(tramp-gvfs-handle-write-region): Use null TRASH arg in
`tramp-compat-delete-file' call.
* lisp/net/tramp-imap.el (tramp-imap-handle-delete-file): Rename arg.
(tramp-imap-do-copy-or-rename-file): Use null TRASH arg in
`tramp-compat-delete-file' call.
* lisp/net/tramp-smb.el (tramp-smb-handle-copy-file)
(tramp-smb-handle-file-local-copy, tramp-smb-handle-rename-file)
(tramp-smb-handle-write-region): Use null TRASH arg in
tramp-compat-delete-file call.
(tramp-smb-handle-delete-directory): Use tramp-compat-delete-file.
(tramp-smb-handle-delete-file): Rename arg.
* lisp/net/tramp.el (tramp-handle-delete-file): Change FORCE arg to TRASH.
(tramp-handle-make-symbolic-link, tramp-handle-load)
(tramp-do-copy-or-rename-file-via-buffer)
(tramp-do-copy-or-rename-file-directly)
(tramp-do-copy-or-rename-file-out-of-band)
(tramp-handle-process-file, tramp-handle-call-process-region)
(tramp-handle-shell-command, tramp-handle-file-local-copy)
(tramp-handle-insert-file-contents, tramp-handle-write-region)
(tramp-delete-temp-file-function): Use null TRASH arg in
tramp-compat-delete-file call.
2010-05-27 19:30:11 -04:00
Eli Zaretskii
98d8b17e45
Don't override standard definition of convert-standard-filename.
...
Add obsolete aliases for dos-fns.el functions.
files.el (convert-standard-filename): Call
w32-convert-standard-filename and dos-convert-standard-filename on
the corresponding systems.
w32-fns.el (w32-convert-standard-filename): Rename from
convert-standard-filename. Doc fix.
dos-fns.el (dos-convert-standard-filename): Doc fix.
(convert-standard-filename): Don't defalias.
(register-name-alist, make-register, register-value)
(set-register-value, intdos): Obsolete aliases for the
corresponding dos-* functions and variables.
(dos-intdos): Add a doc string.
2010-05-15 11:31:40 +03:00
Stefan Monnier
0235128c15
Merge from emacs-23
2010-05-08 14:47:07 -04:00