1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-01 08:17:38 +00:00
Commit Graph

1286 Commits

Author SHA1 Message Date
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
Stefan Monnier
05623156f3 * textmodes/dns-mode.el (auto-mode-alist): Add entry for .zone files.
* files.el (auto-mode-alist): Remove redundant entries.
2010-05-07 10:18:27 -04:00
Stefan Monnier
f3ee9200b8 * files.el (auto-save-mode): Move to simple.el to fix bootstrap.
* simple.el (auto-save-mode): Move from files.el.
* minibuffer.el (completion--common-suffix): Fix copy&paste error.
2010-05-07 08:49:14 -04:00
Stefan Monnier
0c495c215a Define auto-save-mode with define-minor-mode.
* emacs-lisp/easy-mmode.el (define-minor-mode):
Make :variable more flexible.
* files.el (auto-save-mode): Use it to define using define-minor-mode.
2010-05-05 22:53:56 -04:00
Chong Yidong
99833607e0 * files.el (copy-directory): Handle symlinks (Bug#5982). 2010-04-20 18:28:26 -04:00
Karel Klíc
574c05e219 Add SELinux support.
* configure.in: New option: --with(out)-selinux, on by default.
Set HAVE_LIBSELINUX if we find libselinux, and substitute
LIBSELINUX_LIBS in Makefiles.

* src/Makefile.in (LIBSELINUX_LIBS): New.
(LIBES): Add $LIBSELINUX_LIBS.
* src/eval.c, lisp.h (call7): New function.
* src/fileio.c [HAVE_LIBSELINUX]: Include selinux headers.
(Ffile_selinux_context, Fset_file_selinux_context):
New functions.
(Fcopy_file): New parameter preserve-selinux-context.
(Frename_file): Preserve selinux context when renaming by copy-file.

* lisp/files.el (backup-buffer): Handle SELinux context, and return it
if a backup was made by renaming.
(backup-buffer-copy): Set SELinux context to the target file.
(basic-save-buffer): Set SELinux context of the newly written file.
(basic-save-buffer-1): Now it also returns any SELinux context.
(basic-save-buffer-2): Set SELinux context of the newly created file,
and return it.
* lisp/net/tramp.el (tramp-file-name-for-operation):
Add file-selinux-context.
2010-04-20 20:02:58 -07:00
Juri Linkov
b3671a51b9 Add 7z archive format support (bug#5475).
* arc-mode.el (archive-zip-extract): Try to find 7z executable.
(archive-7z-extract): New defcustom.
(archive-find-type): Add magic string for 7z.
(archive-extract-by-stdout): Add new optional arg `stderr-file'.
If `stderr-file' is non-nil, use `(t stderr-file)' for the
`buffer' arg of `call-process'.
(archive-zip-extract): Check `archive-zip-extract' for "7z" and
call the function `archive-7z-extract' with the variable
`archive-7z-extract' let-bound to `archive-zip-extract'.
(archive-7z-summarize, archive-7z-extract): New functions.

* international/mule.el (auto-coding-alist):
* files.el (auto-mode-alist): Add 7z file extension.
2010-04-19 02:08:52 +03:00
Stefan Monnier
2372f27819 * files.el (auto-mode-case-fold): Change default to t. 2010-03-30 21:51:54 -04:00
Eli Zaretskii
f4b6ba46b8 Support MS-Windows build and reversed rows in GUI frames; add initial docs.
doc/emacs/mule.texi (International): Mention support of
 bidirectional editing.
 (Bidirectional Editing): New section.
 etc/HELLO: Reorder Arabic and Hebrew into logical order, and
 insert RLM before the opening paren, to make the display more
 reasonable.  Add setting for bidi-display-reordering in the local
 variables section.
 lisp/files.el: Make bidi-display-reordering safe variable for
 boolean values.
 src/xdisp (append_glyph): If the glyph row is reversed, prepend the
 glyph rather than appending it.
 src/makefile.w32-in (OBJ1): Add $(BLD)/bidi.$(O).
 ($(BLD)/bidi.$(O)): New target.
2010-03-29 08:26:24 -04:00
Glenn Morris
0452574977 * files.el (interpreter-mode-alist): Use emacs-lisp-mode for Emacs scripts. 2010-03-17 21:54:51 -07:00
Dan Nicolaescu
8117868f0c Add .dir-locals.el support for file-less buffers.
* files.el (hack-local-variables): Split out code to apply local
variable settings ...
(hack-local-variables-apply): ... here.  New function.
(hack-dir-local-variables): Use the default directory for when the
buffer does not have an associated file.
(hack-dir-local-variables-non-file-buffer): New function.
* diff-mode.el (diff-mode):
* vc-annotate.el (vc-annotate-mode):
* vc-dir.el (vc-dir-mode):
* log-edit.el (log-edit-mode):
* log-view.el (log-view-mode): Call hack-dir-local-variables-non-file-buffer.
2010-03-12 00:04:54 -08:00
Dan Nicolaescu
855a22946b Add support for shelving snapshots and for showing shelves.
* vc-bzr.el (vc-bzr-shelve-show, vc-bzr-shelve-show-at-point)
(vc-bzr-shelve-apply-and-keep-at-point, vc-bzr-shelve-snapshot):
New functions.
(vc-bzr-shelve-map, vc-bzr-shelve-menu-map)
(vc-bzr-extra-menu-map): Map them.
2010-03-11 17:29:30 -08:00
Wilson Snyder
5f8d2ce0f8 (auto-mode-alist): Accept more verilog file patterns. 2010-03-11 08:25:46 -08:00
Chong Yidong
8c3e96d2f0 Fix save-excursion warning in files.el.
* files.el (recover-session-finish): Use with-current-buffer instead of save-excursion.
2010-02-27 20:11:15 -05:00
Chong Yidong
f95a5fd02f * files.el (hack-local-variables-filter): For eval forms, also
check safe-local-variable-p (Bug#5636).
2010-02-24 10:30:49 -05:00