comparison lisp/files.el @ 276:6330739388db r21-0b36

Import from CVS: tag r21-0b36
author cvs
date Mon, 13 Aug 2007 10:30:37 +0200
parents ca9a9ec9c1c1
children 7df0dd720c89
comparison
equal deleted inserted replaced
275:a68ae4439f57 276:6330739388db
127 This variable is relevant only if `backup-by-copying' is nil." 127 This variable is relevant only if `backup-by-copying' is nil."
128 :type 'boolean 128 :type 'boolean
129 :group 'backup) 129 :group 'backup)
130 130
131 (defvar backup-enable-predicate 131 (defvar backup-enable-predicate
132 '(lambda (name) 132 #'(lambda (name)
133 (not (or (string-match "^/tmp/" name) 133 (not (or (null name)
134 (string-match "^/tmp/" name)
134 (let ((tmpdir (temp-directory))) 135 (let ((tmpdir (temp-directory)))
135 (and tmpdir 136 (and tmpdir
136 (string-match (concat "^" (regexp-quote tmpdir) "/") 137 (string-match (concat "\\`" (regexp-quote tmpdir) "/")
137 tmpdir)))))) 138 tmpdir))))))
138 "Predicate that looks at a file name and decides whether to make backups. 139 "Predicate that looks at a file name and decides whether to make backups.
139 Called with an absolute file name as argument, it returns t to enable backup.") 140 Called with an absolute file name as argument, it returns t to enable backup.")
140 141
141 (defcustom buffer-offer-save nil 142 (defcustom buffer-offer-save nil
2452 (display-message 'command "Modification-flag set") 2453 (display-message 'command "Modification-flag set")
2453 (display-message 'command "Modification-flag cleared")) 2454 (display-message 'command "Modification-flag cleared"))
2454 (set-buffer-modified-p arg)) 2455 (set-buffer-modified-p arg))
2455 2456
2456 (defun toggle-read-only (&optional arg) 2457 (defun toggle-read-only (&optional arg)
2457 "Change whether this buffer is visiting its file read-only. 2458 "Toggle the current buffer's read-only status.
2458 With arg, set read-only iff arg is positive." 2459 With arg, set read-only iff arg is positive."
2459 (interactive "_P") 2460 (interactive "_P")
2460 (setq buffer-read-only 2461 (setq buffer-read-only
2461 (if (null arg) 2462 (if (null arg)
2462 (not buffer-read-only) 2463 (not buffer-read-only)