comparison lisp/files.el @ 83556:07774e5c3ff5

Merged from emacs@sv.gnu.org Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-619 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-620 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-621 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-622 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-623 Remove RCS keywords * emacs@sv.gnu.org/emacs--devo--0--patch-624 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-625 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-626 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-627 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-628 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-629 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-630 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-631 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-632 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-633 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-634 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-635 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-636 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-637 Remove RCS keywords * emacs@sv.gnu.org/emacs--devo--0--patch-638 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-639 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-640 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-641 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-642 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-643 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-644 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-645 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-646 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-647 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-648 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-649 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-197 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-198 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-199 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-200 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-201 Update from CVS: lisp/nnweb.el (nnweb-google-parse-1): Update parser. * emacs@sv.gnu.org/gnus--rel--5.10--patch-202 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-596
author Karoly Lorentey <karoly@lorentey.hu>
date Sat, 24 Feb 2007 19:26:54 +0000
parents b8d9a391daf3 732f9b589f8e
children edf631bdbb7a
comparison
equal deleted inserted replaced
83555:053bf1a38bfa 83556:07774e5c3ff5
2828 (defcustom change-major-mode-with-file-name t 2828 (defcustom change-major-mode-with-file-name t
2829 "Non-nil means \\[write-file] should set the major mode from the file name. 2829 "Non-nil means \\[write-file] should set the major mode from the file name.
2830 However, the mode will not be changed if 2830 However, the mode will not be changed if
2831 \(1) a local variables list or the `-*-' line specifies a major mode, or 2831 \(1) a local variables list or the `-*-' line specifies a major mode, or
2832 \(2) the current major mode is a \"special\" mode, 2832 \(2) the current major mode is a \"special\" mode,
2833 \ not suitable for ordinary files, or 2833 \ not suitable for ordinary files, or
2834 \(3) the new file name does not particularly specify any mode." 2834 \(3) the new file name does not particularly specify any mode."
2835 :type 'boolean 2835 :type 'boolean
2836 :group 'editing-basics) 2836 :group 'editing-basics)
2837 2837
2838 (defun set-visited-file-name (filename &optional no-query along-with-file) 2838 (defun set-visited-file-name (filename &optional no-query along-with-file)
4748 4748
4749 (defun get-free-disk-space (dir) 4749 (defun get-free-disk-space (dir)
4750 "Return the amount of free space on directory DIR's file system. 4750 "Return the amount of free space on directory DIR's file system.
4751 The result is a string that gives the number of free 1KB blocks, 4751 The result is a string that gives the number of free 1KB blocks,
4752 or nil if the system call or the program which retrieve the information 4752 or nil if the system call or the program which retrieve the information
4753 fail. 4753 fail. It returns also nil when DIR is a remote directory.
4754 4754
4755 This function calls `file-system-info' if it is available, or invokes the 4755 This function calls `file-system-info' if it is available, or invokes the
4756 program specified by `directory-free-space-program' if that is non-nil." 4756 program specified by `directory-free-space-program' if that is non-nil."
4757 ;; Try to find the number of free blocks. Non-Posix systems don't 4757 (when (not (file-remote-p dir))
4758 ;; always have df, but might have an equivalent system call. 4758 ;; Try to find the number of free blocks. Non-Posix systems don't
4759 (if (fboundp 'file-system-info) 4759 ;; always have df, but might have an equivalent system call.
4760 (let ((fsinfo (file-system-info dir))) 4760 (if (fboundp 'file-system-info)
4761 (if fsinfo 4761 (let ((fsinfo (file-system-info dir)))
4762 (format "%.0f" (/ (nth 2 fsinfo) 1024)))) 4762 (if fsinfo
4763 (save-match-data 4763 (format "%.0f" (/ (nth 2 fsinfo) 1024))))
4764 (with-temp-buffer 4764 (save-match-data
4765 (when (and directory-free-space-program 4765 (with-temp-buffer
4766 (eq 0 (call-process directory-free-space-program 4766 (when (and directory-free-space-program
4767 nil t nil 4767 (eq 0 (call-process directory-free-space-program
4768 directory-free-space-args 4768 nil t nil
4769 dir))) 4769 directory-free-space-args
4770 ;; Usual format is a header line followed by a line of 4770 dir)))
4771 ;; numbers. 4771 ;; Usual format is a header line followed by a line of
4772 (goto-char (point-min)) 4772 ;; numbers.
4773 (forward-line 1) 4773 (goto-char (point-min))
4774 (if (not (eobp)) 4774 (forward-line 1)
4775 (progn 4775 (if (not (eobp))
4776 ;; Move to the end of the "available blocks" number. 4776 (progn
4777 (skip-chars-forward "^ \t") 4777 ;; Move to the end of the "available blocks" number.
4778 (forward-word 3) 4778 (skip-chars-forward "^ \t")
4779 ;; Copy it into AVAILABLE. 4779 (forward-word 3)
4780 (let ((end (point))) 4780 ;; Copy it into AVAILABLE.
4781 (forward-word -1) 4781 (let ((end (point)))
4782 (buffer-substring (point) end))))))))) 4782 (forward-word -1)
4783 (buffer-substring (point) end))))))))))
4783 4784
4784 ;; The following expression replaces `dired-move-to-filename-regexp'. 4785 ;; The following expression replaces `dired-move-to-filename-regexp'.
4785 (defvar directory-listing-before-filename-regexp 4786 (defvar directory-listing-before-filename-regexp
4786 (let* ((l "\\([A-Za-z]\\|[^\0-\177]\\)") 4787 (let* ((l "\\([A-Za-z]\\|[^\0-\177]\\)")
4787 (l-or-quote "\\([A-Za-z']\\|[^\0-\177]\\)") 4788 (l-or-quote "\\([A-Za-z']\\|[^\0-\177]\\)")