1886 |
;; Don't wait for outline.el to be loaded, for the sake of outline-minor-mode. |
;; Don't wait for outline.el to be loaded, for the sake of outline-minor-mode. |
1887 |
(put 'outline-level 'risky-local-variable t) |
(put 'outline-level 'risky-local-variable t) |
1888 |
(put 'rmail-output-file-alist 'risky-local-variable t) |
(put 'rmail-output-file-alist 'risky-local-variable t) |
1889 |
|
(put 'font-lock-defaults 'risky-local-variable t) |
1890 |
|
|
1891 |
;; This one is safe because the user gets to check it before it is used. |
;; This one is safe because the user gets to check it before it is used. |
1892 |
(put 'compile-command 'safe-local-variable t) |
(put 'compile-command 'safe-local-variable t) |
1909 |
;; Likewise for setting hook variables. |
;; Likewise for setting hook variables. |
1910 |
((or (get var 'risky-local-variable) |
((or (get var 'risky-local-variable) |
1911 |
(and |
(and |
1912 |
(string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|-command$\\|-predicate$" |
(string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|-command$\\|-predicate$\\|font-lock-keywords$\\|font-lock-keywords-[0-9]+$\\|font-lock-syntactic-keywords$" |
1913 |
(symbol-name var)) |
(symbol-name var)) |
1914 |
(not (get var 'safe-local-variable)))) |
(not (get var 'safe-local-variable)))) |
1915 |
;; Permit evalling a put of a harmless property. |
;; Permit evalling a put of a harmless property. |
3555 |
(defvar insert-directory-program "ls" |
(defvar insert-directory-program "ls" |
3556 |
"Absolute or relative name of the `ls' program used by `insert-directory'.") |
"Absolute or relative name of the `ls' program used by `insert-directory'.") |
3557 |
|
|
3558 |
|
(defcustom directory-free-space-program "df" |
3559 |
|
"*Program to get the amount of free space on a file system. |
3560 |
|
We assume the output has the format of `df'. |
3561 |
|
The value of this variable must be just a command name or file name; |
3562 |
|
if you want to specify options, use `directory-free-space-args'. |
3563 |
|
|
3564 |
|
A value of nil disables this feature." |
3565 |
|
:type '(choice (string :tag "Program") (const :tag "None" nil)) |
3566 |
|
:group 'dired) |
3567 |
|
|
3568 |
|
(defcustom directory-free-space-args "-Pk" |
3569 |
|
"*Options to use when running `directory-free-space-program'." |
3570 |
|
:type 'string |
3571 |
|
:group 'dired) |
3572 |
|
|
3573 |
;; insert-directory |
;; insert-directory |
3574 |
;; - must insert _exactly_one_line_ describing FILE if WILDCARD and |
;; - must insert _exactly_one_line_ describing FILE if WILDCARD and |
3575 |
;; FULL-DIRECTORY-P is nil. |
;; FULL-DIRECTORY-P is nil. |
3690 |
;; First find the line to put it on. |
;; First find the line to put it on. |
3691 |
(when (re-search-forward "^total" nil t) |
(when (re-search-forward "^total" nil t) |
3692 |
;; Try to find the number of free blocks. |
;; Try to find the number of free blocks. |
3693 |
(save-match-data |
;; Non-Posix systems don't always have df, |
3694 |
(with-temp-buffer |
;; but might have an equivalent system call. |
3695 |
(call-process "df" nil t nil ".") |
(if (fboundp 'file-system-info) |
3696 |
;; Usual format is a header line |
(let ((fsinfo (file-system-info "."))) |
3697 |
;; followed by a line of numbers. |
(if fsinfo |
3698 |
(goto-char (point-min)) |
(setq available (format "%.0f" (/ (nth 2 fsinfo) 1024))))) |
3699 |
(forward-line 1) |
(save-match-data |
3700 |
(if (not (eobp)) |
(with-temp-buffer |
3701 |
(progn |
(when (and directory-free-space-program |
3702 |
;; Move to the end of the "available blocks" number. |
(zerop (call-process directory-free-space-program |
3703 |
(skip-chars-forward "^ \t") |
nil t nil |
3704 |
(forward-word 3) |
directory-free-space-args |
3705 |
;; Copy it into AVAILABLE. |
"."))) |
3706 |
(let ((end (point))) |
;; Usual format is a header line |
3707 |
(forward-word -1) |
;; followed by a line of numbers. |
3708 |
(setq available (buffer-substring (point) end))))))) |
(goto-char (point-min)) |
3709 |
|
(forward-line 1) |
3710 |
|
(if (not (eobp)) |
3711 |
|
(progn |
3712 |
|
;; Move to the end of the "available blocks" number. |
3713 |
|
(skip-chars-forward "^ \t") |
3714 |
|
(forward-word 3) |
3715 |
|
;; Copy it into AVAILABLE. |
3716 |
|
(let ((end (point))) |
3717 |
|
(forward-word -1) |
3718 |
|
(setq available (buffer-substring (point) end))))))))) |
3719 |
(when available |
(when available |
3720 |
;; Replace "total" with "used", to avoid confusion. |
;; Replace "total" with "used", to avoid confusion. |
3721 |
(replace-match "used") |
(replace-match "used") |