1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-04 08:47:11 +00:00
Commit Graph

1437 Commits

Author SHA1 Message Date
Chong Yidong
5725bd2cc0 Merge from emacs-24; up to 2012-05-02T11:38:01Z!lekktu@gmail.com 2012-08-11 10:13:55 +08:00
Juri Linkov
53fa865294 * lisp/files.el (basic-save-buffer): Use `buffer-name' as the default
of `read-file-name' when buffer is not visiting a file.

Fixes: debbugs:12128
2012-08-08 11:17:13 +03:00
Glenn Morris
f40b9f106b hack-local-variables-filter fix for bug#12155
* lisp/files.el (hack-local-variables-filter): If an eval: form is not
known to be safe, and enable-local-variables is :safe, then ignore
the form totally, as is done for non-eval forms.
2012-08-07 14:41:39 -04:00
Chong Yidong
e5d9c0d111 Docfix for kill-buffer-hook and others.
* lisp/files.el (kill-buffer-hook): Provide a defvar.

* src/term.c (Vsuspend_tty_functions, Vresume_tty_functions):
* src/frame.c (Vdelete_frame_functions):
* src/emacs.c (Vkill_emacs_hook): Doc fix.
2012-08-05 15:45:12 +08:00
Chong Yidong
a9dd575408 * files.el (set-auto-mode): Fix invalid setq call. 2012-08-05 11:03:31 +08:00
Eli Zaretskii
6dad71783c Support symlinks on latest versions of MS-Windows.
src/w32.c: Include winioctl.h and aclapi.h.
 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
 (revert_to_self): Forward declarations of static functions.
 <static BOOL g_b_init_get_security_info>:
 <g_b_init_create_symbolic_link>: New static flags.
 (globals_of_w32): Initialize them to zero.
 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
 (map_w32_filename): Improve commentary.  Simplify switch.
 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
 headers (most versions of MinGW w32api don't).
 (get_security_info, create_symbolic_link)
 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
 New functions.
 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
 in the argument file name.
 (sys_access): Call unc_volume_file_attributes only if
 GetFileAttributes fails with network-related error codes.
 (sys_rename): Diagnose renaming of a symlink when the user doesn't
 have the required privileges.
 (get_file_security_desc_by_name): Renamed from
 get_file_security_desc.
 (stat_worker): New function, with most of the guts of 'stat', and
 with addition of handling of symlinks and support for 'lstat'.  If
 possible, get file's attributes and security information by
 handle, not by name.  Produce S_IFLNK bit for symlinks, when
 called from 'lstat'.
 (stat, lstat): New functions, call 'stat_worker'.
 (symlink, readlink, careadlinkat): Rewritten to create and resolve
 symlinks when the underlying filesystem supports them.

 lib/src/ntlib.c (lstat): New function, calls 'stat'.

 nt/inc/sys/stat.h (S_IFLNK): Define.
 (S_ISLNK): A non-trivial definition.
 (lstat): Prototype instead of a macro that redirects to 'stat'.

 lisp/files.el (file-truename): Don't skip symlink-chasing part on
 windows-nt.  Incorporate the resolution of 8+3 short aliases on
 Windows into the loop that recursively chases symlinks.  Compare
 directory and its parent case-insensitively on MS-Windows and
 MS-DOS.

 etc/NEWS: Announce the symlink support on MS-Windows.
2012-08-03 13:23:30 +03:00
Chong Yidong
b68b33375c Don't warn on toggle-read-only calls.
Clarify the documentation of toggle-read-only, and audit the code tree
for uses of toggle-read-only; where appropriate, switch to setting the
variable buffer-read-only or calling toggle-read-only with a (new)
second arg.

* lisp/files.el (toggle-read-only): Doc fix and code cleanup.  New arg
to allow printing the message when called from Lisp.

* lisp/emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions):
Remove toggle-read-only.

* lisp/bindings.el (mode-line-toggle-read-only):
* lisp/dired.el (dired-toggle-read-only):
* lisp/ibuffer.el (ibuffer-do-toggle-read-only): Call toggle-read-only
with non-nil second arg.

* lisp/bs.el (bs-toggle-readonly):
* lisp/buff-menu.el (Buffer-menu-toggle-read-only): Remove
with-no-warnings around toggle-read-only.

* lisp/ffap.el (ffap--toggle-read-only): Accept a list of buffers.
Remove with-no-warnings around toggle-read-only.
(ffap-read-only, ffap-read-only-other-window)
(ffap-read-only-other-frame): Callers changed.

* lisp/help-mode.el: Don't require view package.
(help-mode-finish): Set buffer-read-only instead of calling
toggle-read-only.

* lisp/emacs-lisp/eieio-custom.el (eieio-customize-object):
* lisp/vc/ediff.el (ediff-set-read-only-in-buf-A): Set buffer-read-only
directly.

* lisp/gnus/smime.el (smime-certificate-info): Set buffer-read-only directly,
instead of calling toggle-read-only with a (bogus) argument.

* doc/emacs/buffers.texi (Misc Buffer): Document view-read-only.

* doc/lispref/buffers.texi (Read Only Buffers): Document toggle-read-only
changes.  Reword to account for the fact that read-only is currently not
supported in overlay properties.
2012-07-13 15:06:09 +08:00
Glenn Morris
133a11fc59 * lisp/files.el (toggle-read-only): Restrict message to interactive use. 2012-07-06 15:06:54 -04:00
Chong Yidong
226c3633fd Merge from emacs-24; up to 2012-05-01T00:16:02Z!rgm@gnu.org 2012-07-06 12:31:46 +08:00
Stefan Monnier
0781098af7 * lisp/files.el (locate-dominating-file): Allow `name' to be a predicate.
(find-file--read-only): New function.
(find-file-read-only, find-file-read-only-other-window)
(find-file-read-only-other-frame): Use it.
(insert-file-contents-literally): Don't `fset'.
(get-free-disk-space): Use locate-dominating-file.
2012-07-04 11:59:12 -04:00
Eli Zaretskii
93842198fc Fix bug #11827 with file-relative-name on MS-Windows.
lisp/files.el (file-relative-name): Compare file names
 case-insensitively if on MS-Windows or MS-DOS, or if
 read-file-name-completion-ignore-case is non-nil.  Don't use
 case-fold-search for this purpose.
2012-07-01 19:38:53 +03:00
Sam Steingold
d2c32364fd * lisp/files.el (file-name-base): New convenience function.
* lisp/autoinsert.el, lisp/cus-dep.el, lisp/doc-view.el, lisp/image-dired.el,
* lisp/woman.el, lisp/eshell/esh-cmd.el, lisp/progmodes/ada-xref.el,
* lisp/progmodes/cc-defs.el, lisp/progmodes/cperl-mode.el,
* lisp/progmodes/flymake.el, lisp/progmodes/gud.el, lisp/progmodes/idlwave.el,
* lisp/textmodes/ispell.el, lisp/textmodes/reftex-ref.el,
* lisp/textmodes/tex-mode.el: Use it.
Did not touch cedet and org because they are maintained elsewhere.
2012-06-26 12:23:01 -04:00
Stefan Monnier
36cec983d4 Further GV/CL cleanups.
* lisp/emacs-lisp/gv.el (gv-get): Autoload functions to find their
gv-expander.
(gv--defun-declaration): New function.
(defun-declarations-alist): Use it.
(gv-define-modify-macro, gv-pushnew!, gv-inc!, gv-dec!): Remove.
(gv-place): Autoload.
* lisp/emacs-lisp/cl.el (cl--dotimes, cl--dolist): Remember subr.el's
original definition of dotimes and dolist.
* lisp/emacs-lisp/cl-macs.el (cl-expr-access-order): Remove unused.
(cl-dolist, cl-dotimes): Use `dolist' and `dotimes'.
* lisp/emacs-lisp/cl-lib.el: Move gv handlers from cl-macs to here.
(cl-fifth, cl-sixth, cl-seventh, cl-eighth)
(cl-ninth, cl-tenth): Move gv handler to the function's definition.
* lisp/emacs-lisp/cl-extra.el (cl-subseq, cl-get, cl-getf): Move gv handler
to the function's definition.
* lisp/Makefile.in (COMPILE_FIRST): Re-order to speed it up by about 50%.
* lisp/window.el:
* lisp/files.el:
* lisp/faces.el:
* lisp/env.el: Don't use CL.
2012-06-22 17:24:54 -04:00
Bastien Guerry
76386c5a98 Fix bug #11726 -- send a message after `toggle-read-only'.
Thanks to Drew Adam for reporting this.
2012-06-22 16:12:42 +02:00
Stefan Monnier
2ee3d7f0aa Provide generalized variables in core Elisp.
* lisp/emacs-lisp/gv.el: New file.
* lisp/subr.el (push, pop): Extend to generalized variables.
* lisp/loadup.el (macroexp): Unload if preloaded and uncompiled.
* lisp/emacs-lisp/cl-lib.el (cl-pop, cl-push, cl--set-nthcdr): Remove.
* lisp/emacs-lisp/cl-macs.el: Require gv.  Use gv-define-setter,
gv-define-simple-setter, and gv-define-expander.
Remove setf-methods defined in gv.  Rename cl-setf -> setf.
(cl-setf, cl-do-pop, cl-get-setf-method): Remove.
(cl-letf, cl-letf*, cl-define-modify-macro, cl-defsetf)
(cl-define-setf-expander, cl-struct-setf-expander): Move to cl.el.
(cl-remf, cl-shiftf, cl-rotatef, cl-callf, cl-callf2): Rewrite with
gv-letplace.
(cl-defstruct): Don't define setf-method any more.
* lisp/emacs-lisp/cl.el (flet): Don't autoload.
(cl--letf, letf, cl--letf*, letf*, cl--gv-adapt)
(define-setf-expander, defsetf, define-modify-macro)
(cl-struct-setf-expander): Move from cl-lib.el.
* lisp/emacs-lisp/syntax.el:
* lisp/emacs-lisp/ewoc.el:
* lisp/emacs-lisp/smie.el:
* lisp/emacs-lisp/cconv.el:
* lisp/emacs-lisp/timer.el: Rename cl-setf -> setf, cl-push -> push.
(timer--time): Use gv-define-simple-setter.
* lisp/emacs-lisp/macroexp.el (macroexp-let2): Rename from macroexp-let²
to avoid coding-system problems in subr.el.  Adjust all users.
(macroexp--maxsize, macroexp-small-p): New functions.
* lisp/emacs-lisp/bytecomp.el (byte-compile-file): Don't use cl-letf.
* lisp/scroll-bar.el (scroll-bar-mode):
* lisp/simple.el (auto-fill-mode, overwrite-mode, binary-overwrite-mode)
(normal-erase-is-backspace-mode): Don't use the `eq' place.
* lisp/winner.el (winner-configuration, winner-make-point-alist)
(winner-set-conf, winner-get-point, winner-set): Don't abuse letf.
* lisp/files.el (locate-file-completion-table): Avoid list*.

Fixes: debbugs:11657
2012-06-22 09:42:38 -04:00
Sam Steingold
54c5ba1a5f * lisp/files.el (abort-if-file-too-large): Use `file-size-human-readable'. 2012-06-14 15:55:28 -04:00
Stefan Monnier
5a315f9ce9 * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Don't add print-func.
* lisp/files.el: Require cl-lib.
(file-name-non-special): Replace case -> cl-case.
2012-06-13 16:52:25 -04:00
Stefan Monnier
513749ee18 Clean up scoping rule of predefined single-word vars.
* lisp/startup.el (argv, argi): Make lexically scoped.
* lisp/emacs-lisp/float-sup.el (pi): Use internal-make-var-non-special.
* lisp/emacs-lisp/cl-macs.el: Use lexical-binding.
Rename cl-bind-* to cl--bind-*.
* lisp/files.el: Don't require `cl' since it doesn't use it.
* lisp/emacs-lisp/pcase.el, lisp/emacs-lisp/macroexp.el: Add coding cookie.
* src/eval.c (Fmake_var_non_special): New primitive.
(syms_of_eval): Defsubr it.
* src/lread.c (syms_of_lread): Mark `values' as lexically scoped.
2012-06-08 09:18:26 -04:00
Michael Albinus
dfb308badd * files.el (enable-remote-dir-locals): New option.
(hack-dir-local-variables): Use it.  (Bug#1933, Bug#6731)
2012-06-06 14:34:09 +02:00
Glenn Morris
532f361c96 Fix previous (slogin and rlogin not appropriate for remote-shell-program) 2012-05-24 17:27:22 -04:00
Glenn Morris
ead5edc086 Move prune-directory-list, remote-shell-program from paths.el to files.el
* lisp/paths.el (prune-directory-list, remote-shell-program): Move to ...
* lisp/files.el (prune-directory-list, remote-shell-program): ...here.
For the latter, delay initialization, prefer ssh, just search PATH.
2012-05-24 16:40:19 -04:00
Stefan Monnier
e5bd0a2895 Move define-obsolete-variable-alias before the var's definition.
* lisp/vc/log-edit.el (vc-comment-ring, vc-comment-ring-index):
* lisp/tooltip.el (tooltip-hook):
* lisp/textmodes/reftex-toc.el (reftex-toc-map):
* lisp/textmodes/reftex-sel.el (reftex-select-label-map)
(reftex-select-bib-map):
* lisp/textmodes/reftex-index.el (reftex-index-map)
(reftex-index-phrases-map):
* lisp/speedbar.el (speedbar-syntax-table, speedbar-key-map):
* lisp/progmodes/meta-mode.el (meta-mode-map):
* lisp/novice.el (disabled-command-hook):
* lisp/loadhist.el (unload-hook-features-list):
* lisp/frame.el (blink-cursor):
* lisp/files.el (find-file-not-found-hooks, write-file-hooks)
(write-contents-hooks):
* lisp/emulation/tpu-edt.el (GOLD-map):
* lisp/emacs-lock.el (emacs-lock-from-exiting):
* lisp/emacs-lisp/generic.el (generic-font-lock-defaults):
* lisp/emacs-lisp/chart.el (chart-map):
* lisp/dos-fns.el (register-name-alist):
* lisp/dired-x.el (dired-omit-files-p):
* lisp/desktop.el (desktop-enable):
* lisp/cus-edit.el (custom-mode-hook):
* lisp/buff-menu.el (buffer-menu-mode-hook):
* lisp/bookmark.el (bookmark-read-annotation-text-func)
(bookmark-exit-hooks):
* lisp/allout.el (allout-mode-deactivate-hook)
(allout-exposure-change-hook, allout-structure-added-hook)
(allout-structure-deleted-hook, allout-structure-shifted-hook):
* lisp/dirtrack.el (dirtrack-toggle, dirtrackp, dirtrack-debug-toggle)
(dirtrack-debug): Move call to define-obsolete-variable-alias so it
comes before the corresponding variable's definition.
2012-05-12 23:05:06 -04:00
Glenn Morris
666b903b91 Merge from emacs-24; up to 2012-04-21T14:12:27Z!sdl.web@gmail.com 2012-05-08 20:06:08 -07:00
Glenn Morris
ad89bb83f7 * lisp/files.el (auto-mode-alist): Treat ".make" like ".mk". 2012-05-08 13:23:09 -04:00
Glenn Morris
188d270185 Improve previous dir-locals-read-from-file change 2012-05-06 21:29:59 -07:00
Glenn Morris
fd075e7b2b * files.el (dir-locals-read-from-file): Mention dir-locals in any error message. 2012-05-06 10:57:28 -07:00
Ransom Williams
248da2f497 * lisp/files.el (file-auto-mode-skip): New var.
(set-auto-mode-1): Use it.
2012-05-04 23:21:47 -04:00
Stefan Monnier
71873e2b33 Add new error and function `user-error'.
* lisp/subr.el (user-error): New function.
* lisp/window.el (switch-to-buffer):
* lisp/vc/smerge-mode.el (smerge-resolve-function, smerge-resolve)
(smerge-match-conflict):
* lisp/simple.el (previous-matching-history-element)
(next-matching-history-element, goto-history-element, undo-more)
(undo-start):
* lisp/progmodes/etags.el (visit-tags-table-buffer, find-tag-tag)
(find-tag-noselect, find-tag-in-order, etags-goto-tag-location)
(next-file, tags-loop-scan, list-tags, complete-tag):
* lisp/progmodes/compile.el (compilation-loop):
* lisp/mouse.el (mouse-minibuffer-check):
* lisp/man.el (Man-bgproc-sentinel, Man-goto-page):
* lisp/info.el (Info-find-node-2, Info-extract-pointer, Info-history-back)
(Info-history-forward, Info-follow-reference, Info-menu)
(Info-extract-menu-item, Info-extract-menu-counting)
(Info-forward-node, Info-backward-node, Info-next-menu-item)
(Info-last-menu-item, Info-next-preorder, Info-last-preorder)
(Info-next-reference, Info-prev-reference, Info-index)
(Info-index-next, Info-follow-nearest-node)
(Info-copy-current-node-name):
* lisp/imenu.el (imenu--make-index-alist)
(imenu-default-create-index-function, imenu-add-to-menubar):
* lisp/files.el (basic-save-buffer, recover-file):
* lisp/emacs-lisp/easy-mmode.el (easy-mmode-define-navigation):
* lisp/emacs-lisp/checkdoc.el (checkdoc-continue, checkdoc-comments)
(checkdoc-message-text, checkdoc-defun):
* lisp/dabbrev.el (dabbrev-completion, dabbrev--abbrev-at-point):
* lisp/cus-edit.el (customize-changed-options, customize-rogue)
(customize-saved, custom-variable-set, custom-variable-mark-to-save)
(custom-variable-mark-to-reset-standard)
(custom-variable-reset-backup, custom-face-mark-to-reset-standard)
(custom-file):
* lisp/completion.el (check-completion-length):
* lisp/comint.el (comint-search-arg)
(comint-previous-matching-input-string-position)
(comint-previous-matching-input)
(comint-replace-by-expanded-history-before-point, comint-send-input)
(comint-copy-old-input, comint-backward-matching-input)
(comint-goto-process-mark, comint-set-process-mark):
* lisp/calendar/calendar.el (calendar-cursor-to-date): Use it.
* lisp/bindings.el (debug-ignored-errors): Remove regexps, add `user-error'.
* src/data.c (PUT_ERROR): New macro.
(syms_of_data): Use it.  Add new error type `user-error'.
* src/undo.c (user_error): New function.
(Fprimitive_undo): Use it.
* src/print.c (print_error_message): Adjust print style for `user-error'.
* src/keyboard.c (user_error): New function.
(Fexit_recursive_edit, Fabort_recursive_edit): Use it.
2012-05-04 19:16:47 -04:00
Stefan Monnier
8a61ee2295 * lisp/files.el (automount-dir-prefix): Mark as obsolete. 2012-05-04 15:14:42 -04:00
Stefan Monnier
0d42eb3e96 * lisp/vc/vc-mtn.el:
* lisp/vc/vc-hg.el:
* lisp/vc/vc-git.el:
* lisp/vc/vc-dir.el:
* lisp/vc/vc-cvs.el:
* lisp/vc/vc-bzr.el:
* lisp/vc/vc-arch.el:
* lisp/vc/vc.el: Replace lexical-let by lexical-binding.
* lisp/minibuffer.el (lazy-completion-table): Avoid ((λ ...) ...).
* lisp/emacs-lisp/cl-macs.el (lexical-let): Fix use in lexical-binding.
* lisp/emacs-lisp/cconv.el (cconv-analyse-form): Warn use of ((λ ...) ...).
2012-04-25 23:18:47 -04:00
Leo Liu
5055880d39 * lisp/files.el (auto-mode-alist): Use javascript-mode instead. 2012-04-25 22:47:33 +08:00
Christopher Schmidt
c09c46b263 Fix require-final-newline interaction with read-only buffers.
* lisp/files.el (after-find-file): Do not try to add a final newline
if the buffer is read-only.

Fixes: debbugs:11156
2012-04-18 14:24:13 +08:00
Glenn Morris
35dc09a19c Merge from emacs-24, up to 2012-04-10T02:06:19Z!larsi@gnus.org 2012-04-13 18:46:06 -07:00
Glenn Morris
4a427f5883 * lisp/files.el (dir-locals-set-class-variables): Doc fix. 2012-04-10 00:13:54 -07:00
Glenn Morris
fd06db5dd6 Remove ucs-set-table-for-input dead code
This function was removed with ucs-tables.el in 2008.

* lisp/international/mule-cmds.el (set-default-coding-systems):
* lisp/files.el (normal-mode):
Remove guarded calls to ucs-set-table-for-input. 

* src/buffer.c (Qucs_set_table_for_input): Remove.
(Fget_buffer_create): Don't call Qucs_set_table_for_input.
(init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.

Fixes: debbugs:9821
2012-04-08 17:58:00 -07:00
Chong Yidong
42ee526b1a Rename file-subdir-of-p to file-in-directory-p.
* lisp/files.el (file-in-directory-p): Rename from file-subdir-of-p.
Handle root directory properly.
(copy-directory): Caller changed.

* lisp/dired-aux.el (dired-copy-file-recursive, dired-create-files):
* lisp/net/tramp.el (tramp-file-name-for-operation): Callers changed.

* doc/lispref/files.texi (Kinds of Files): file-subdir-of-p renamed to
file-in-directory-p.
2012-04-01 10:44:24 +08:00
Thierry Volpiatto
40311efcba Fix copying of symlinks.
* dired-aux.el (dired-copy-file-recursive, dired-create-files):
Check if file is a symlink (Bug#10489).

* files.el (copy-directory): Likewise.
2012-03-31 00:49:29 +08:00
Glenn Morris
02243d9dc1 More small edits for lispref/os.texi
* doc/lispref/os.texi (Killing Emacs): Copyedits.
(Suspending Emacs): Copyedits.  Mention not very relevant with GUIs.
Shorten the example, use more standard shell prompts.

* lisp/files.el (save-buffers-kill-emacs): Doc fix.
2012-03-25 18:35:47 -07:00
Stefan Monnier
1acad97c3e * lisp/files.el (move-file-to-trash): Files aren't regexps.
Fixes: debbugs:11055
2012-03-21 13:44:55 -04:00
Glenn Morris
f7fd3d79b7 Another dir-locals iteration
* lisp/files.el (dir-locals-find-file):
Don't check result is regular, readable.
(dir-locals-read-from-file): Demote errors.
2012-03-08 22:21:49 -05:00
Glenn Morris
9a40b8d45e Undo 2012-03-06T08:22:42Z!rgm@gnu.org
* lisp/files.el (locate-dominating-file, dir-locals-find-file):
Undo 2012-03-06 change.
2012-03-07 22:06:28 -08:00
Glenn Morris
99a8306435 Tweak previous dir-locals-find-file change
* lisp/files.el (locate-dominating-file): Add optional predicate argument.
(dir-locals-find-file): Make use of above change.
2012-03-06 00:22:42 -08:00
Glenn Morris
8f2114eef3 dir-locals-find-file tweak for "odd" .dir-locals.el (bug#10928)
* lisp/files.el (dir-locals-find-file):
Ignore non-readable or non-regular files.
2012-03-05 21:50:28 -05:00
Glenn Morris
eb18244605 * lisp/files.el (locate-dominating-file): Doc fix. 2012-03-05 21:31:32 -05:00
Michael Albinus
a032a70212 * files.el (file-equal-p): Fix docstring. Avoid unnecessary
access of FILE2, if FILE1 does not exist.
2012-03-01 09:33:50 +01:00
thierry volpiatto
96b4930127 * lisp/files.el (file-equal-p): renamed from `files-equal-p'.
Now return nil when one or both files doesn't exists.
(file-subdir-of-p): Now only top directory must exists,
return nil if it doesn't.
(copy-directory): No need to test with `file-subdir-of-p' after creating dir.
* tramp.el (tramp-file-name-for-operation): Rename `files-equal-p' to `file-equal-p'.
* files.texi: Rename `files-equal-p' to `file-equal-p'.
2012-02-28 10:28:52 +01:00
Glenn Morris
44e97401cd Standardize possessive apostrophe usage in manuals, docs, and comments
Ref: http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00649.html
2012-02-28 00:17:21 -08:00
Chong Yidong
9a4888c093 Code and doc fixes for file-subdir-of-p and files-equal-p.
* lisp/files.el (files-equal-p): Doc fix.
(file-subdir-of-p): Doc fix.  Convert loop macro to plain Lisp,
and quit the loop once a mismatch is found.

* doc/lispref/files.texi (Kinds of Files): Improve documentation of
files-equal-p and file-subdir-of-p.
2012-02-26 17:08:19 +08:00
Glenn Morris
ec70a47da9 Fix previous change files.el change 2012-02-24 14:25:38 -05:00
thierry volpiatto
25b2e303b0 Fix bug#10489: 24.0.92 `dired-do-copy' may create infinite directory hierarchy.
* lisp/files.el (files-equal-p): New, simple equality check between two filename.
(file-subdir-of-p): New, Check if dir1 is subdir of dir2.
(copy-directory): Return error when trying to copy a directory on itself.
Add missing copy-contents arg to tramp handler.

* lisp/dired-aux.el (dired-copy-file-recursive): Same.
(dired-create-files): Modify destination when source is equal to dest when copying files.
Return also when dest is a subdir of source.
2012-02-24 19:04:03 +01:00