diff options
| author | Glenn Morris | 2011-02-28 19:25:24 -0800 |
|---|---|---|
| committer | Glenn Morris | 2011-02-28 19:25:24 -0800 |
| commit | 9903d828df3cf1ddfd21c880a0887079b16ec17e (patch) | |
| tree | 41472b84f9309280c78b624cae0934889df44b78 | |
| parent | 75da6eb97218018fcc0290529149cb1d2c1ceede (diff) | |
| download | emacs-9903d828df3cf1ddfd21c880a0887079b16ec17e.tar.gz emacs-9903d828df3cf1ddfd21c880a0887079b16ec17e.zip | |
Give dired-actual-switches a safe-local-variable property. (Bug#3230)
* lisp/dired.el (dired-safe-switches-p): Beef it up.
(dired-actual-switches): Use it for the safe-local-variable property.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/dired.el | 13 |
2 files changed, 15 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c4154b9a56e..2b42e0f24a1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-03-01 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * dired.el (dired-safe-switches-p): Beef it up. | ||
| 4 | (dired-actual-switches): Use it for the safe-local prop. (Bug#3230) | ||
| 5 | |||
| 1 | 2011-03-01 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2011-03-01 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * dired.el (dired-safe-switches-p): New function. | 8 | * dired.el (dired-safe-switches-p): New function. |
diff --git a/lisp/dired.el b/lisp/dired.el index 4b9bc19c8d9..c113f0cb2f4 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -249,12 +249,19 @@ Local to each dired buffer. May be a list, in which case the car is the | |||
| 249 | directory name and the cdr is the list of files to mention. | 249 | directory name and the cdr is the list of files to mention. |
| 250 | The directory name must be absolute, but need not be fully expanded.") | 250 | The directory name must be absolute, but need not be fully expanded.") |
| 251 | 251 | ||
| 252 | ;; Beware of "-l;reboot" etc. See bug#3230. | ||
| 252 | (defun dired-safe-switches-p (switches) | 253 | (defun dired-safe-switches-p (switches) |
| 253 | (string-match "\\`[- [:alnum:]]+\\'" switches)) | 254 | "Return non-nil if string SWITCHES does not look risky for dired." |
| 255 | (or (not switches) | ||
| 256 | (and (stringp switches) | ||
| 257 | (< (length switches) 100) ; arbitrary | ||
| 258 | (string-match "\\` *-[- [:alnum:]]+\\'" switches)))) | ||
| 254 | 259 | ||
| 255 | (defvar dired-actual-switches nil | 260 | (defvar dired-actual-switches nil |
| 256 | "The value of `dired-listing-switches' used to make this buffer's text.") | 261 | "The value of `dired-listing-switches' used to make this buffer's text.") |
| 257 | 262 | ||
| 263 | (put 'dired-actual-switches 'safe-local-variable 'dired-safe-switches-p) | ||
| 264 | |||
| 258 | (defvar dired-re-inode-size "[0-9 \t]*" | 265 | (defvar dired-re-inode-size "[0-9 \t]*" |
| 259 | "Regexp for optional initial inode and file size as made by `ls -i -s'.") | 266 | "Regexp for optional initial inode and file size as made by `ls -i -s'.") |
| 260 | 267 | ||
| @@ -3617,7 +3624,7 @@ Ask means pop up a menu for the user to select one of copy, move or link." | |||
| 3617 | ;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command | 3624 | ;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command |
| 3618 | ;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown | 3625 | ;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown |
| 3619 | ;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff | 3626 | ;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff |
| 3620 | ;;;;;; dired-diff) "dired-aux" "dired-aux.el" "9d6333fab9c0f1b49e0bf2a536b8f245") | 3627 | ;;;;;; dired-diff) "dired-aux" "dired-aux.el" "154cdfbf451aedec60c5012b625ff329") |
| 3621 | ;;; Generated autoloads from dired-aux.el | 3628 | ;;; Generated autoloads from dired-aux.el |
| 3622 | 3629 | ||
| 3623 | (autoload 'dired-diff "dired-aux" "\ | 3630 | (autoload 'dired-diff "dired-aux" "\ |
| @@ -4076,7 +4083,7 @@ true then the type of the file linked to by FILE is printed instead. | |||
| 4076 | ;;;*** | 4083 | ;;;*** |
| 4077 | 4084 | ||
| 4078 | ;;;### (autoloads (dired-do-relsymlink dired-jump) "dired-x" "dired-x.el" | 4085 | ;;;### (autoloads (dired-do-relsymlink dired-jump) "dired-x" "dired-x.el" |
| 4079 | ;;;;;; "c24f202ea049990539accfd4c2c73fe9") | 4086 | ;;;;;; "3b8851132739ab3f9054bf639873c53e") |
| 4080 | ;;; Generated autoloads from dired-x.el | 4087 | ;;; Generated autoloads from dired-x.el |
| 4081 | 4088 | ||
| 4082 | (autoload 'dired-jump "dired-x" "\ | 4089 | (autoload 'dired-jump "dired-x" "\ |