comparison lisp/prim/files.el @ 100:4be1180a9e89 r20-1b2

Import from CVS: tag r20-1b2
author cvs
date Mon, 13 Aug 2007 09:15:11 +0200
parents 0d2f883870bc
children a145efe76779
comparison
equal deleted inserted replaced
99:2d83cbd90d8d 100:4be1180a9e89
142 "*Control use of version numbers for backup files. 142 "*Control use of version numbers for backup files.
143 t means make numeric backup versions unconditionally. 143 t means make numeric backup versions unconditionally.
144 nil means make them for files that have some already. 144 nil means make them for files that have some already.
145 `never' means do not make them.") 145 `never' means do not make them.")
146 146
147 (defvar dired-kept-versions 2 147 ;; This is now defined in efs.
148 "*When cleaning directory, number of versions to keep.") 148 ;(defvar dired-kept-versions 2
149 ; "*When cleaning directory, number of versions to keep.")
149 150
150 (defvar delete-old-versions nil 151 (defvar delete-old-versions nil
151 "*If t, delete excess backup versions silently. 152 "*If t, delete excess backup versions silently.
152 If nil, ask confirmation. Any other value prevents any trimming.") 153 If nil, ask confirmation. Any other value prevents any trimming.")
153 154
1407 (or (if suffix (looking-at suffix) (eolp)) 1408 (or (if suffix (looking-at suffix) (eolp))
1408 (error "Local variables entry is terminated incorrectly")) 1409 (error "Local variables entry is terminated incorrectly"))
1409 ;; Set the variable. "Variables" mode and eval are funny. 1410 ;; Set the variable. "Variables" mode and eval are funny.
1410 (hack-one-local-variable var val)))))))) 1411 (hack-one-local-variable var val))))))))
1411 1412
1412 1413 ;; jwz - New Version 20.1/19.15
1413 (defun hack-local-variables-prop-line (&optional force) 1414 (defun hack-local-variables-prop-line (&optional force)
1414 ;; Set local variables specified in the -*- line. 1415 ;; Set local variables specified in the -*- line.
1415 ;; Returns t if mode was set. 1416 ;; Returns t if mode was set.
1416 (let ((result nil)) 1417 (let ((result nil))
1417 (save-excursion 1418 (save-excursion
1428 (end-of-line (and (looking-at "^#!") 2)) 1429 (end-of-line (and (looking-at "^#!") 2))
1429 (point)))) 1430 (point))))
1430 ;; Parse the -*- line into the `result' alist. 1431 ;; Parse the -*- line into the `result' alist.
1431 (cond ((not (search-forward "-*-" end t)) 1432 (cond ((not (search-forward "-*-" end t))
1432 ;; doesn't have one. 1433 ;; doesn't have one.
1433 (setq force t)) 1434 nil)
1434 ((looking-at "[ \t]*\\([^ \t\n\r:;]+\\)\\([ \t]*-\\*-\\)") 1435 ((looking-at "[ \t]*\\([^ \t\n\r:;]+\\)\\([ \t]*-\\*-\\)")
1435 ;; Antiquated form: "-*- ModeName -*-". 1436 ;; Antiquated form: "-*- ModeName -*-".
1436 (setq result 1437 (setq result
1437 (list (cons 'mode 1438 (list (cons 'mode
1438 (intern (buffer-substring 1439 (intern (buffer-substring
1463 (if (equal (downcase (symbol-name key)) "mode") 1464 (if (equal (downcase (symbol-name key)) "mode")
1464 (setq key 'mode)) 1465 (setq key 'mode))
1465 (setq result (cons (cons key val) result)) 1466 (setq result (cons (cons key val) result))
1466 (skip-chars-forward " \t;"))) 1467 (skip-chars-forward " \t;")))
1467 (setq result (nreverse result)))))) 1468 (setq result (nreverse result))))))
1468 1469
1469 (if result 1470 (let ((set-any-p (or force (hack-local-variables-p t)))
1470 (let ((set-any-p (or force (hack-local-variables-p t))) 1471 (mode-p nil))
1471 (mode-p nil)) 1472 (while result
1472 (while result 1473 (let ((key (car (car result)))
1473 (let ((key (car (car result))) 1474 (val (cdr (car result))))
1474 (val (cdr (car result)))) 1475 (cond ((eq key 'mode)
1475 (cond ((eq key 'mode) 1476 (setq mode-p t)
1476 (setq mode-p t) 1477 (funcall (intern (concat (downcase (symbol-name val))
1477 (funcall (intern (concat (downcase (symbol-name val)) 1478 "-mode"))))
1478 "-mode")))) 1479 (set-any-p
1479 (set-any-p 1480 (hack-one-local-variable key val))
1480 (hack-one-local-variable key val)) 1481 (t
1481 (t 1482 nil)))
1482 nil))) 1483 (setq result (cdr result)))
1483 (setq result (cdr result))) 1484 mode-p)))
1484 mode-p))))
1485 1485
1486 (defconst ignored-local-variables 1486 (defconst ignored-local-variables
1487 (list 'enable-local-eval) 1487 (list 'enable-local-eval)
1488 "Variables to be ignored in a file's local variable spec.") 1488 "Variables to be ignored in a file's local variable spec.")
1489 1489
2942 ;; Suggested by Michael Kifer <kifer@CS.SunySB.EDU> 2942 ;; Suggested by Michael Kifer <kifer@CS.SunySB.EDU>
2943 (defun file-remote-p (file) 2943 (defun file-remote-p (file)
2944 "Test whether file resides on the local system. 2944 "Test whether file resides on the local system.
2945 The special value 'unknown is returned if no remote file access package 2945 The special value 'unknown is returned if no remote file access package
2946 has been loaded." 2946 has been loaded."
2947 (cond ((fboundp 'efs-ftp-path) (efs-ftp-path name)) 2947 (cond ((featurep 'ange-ftp) (ange-ftp-ftp-path file-name))
2948 ((fboundp 'ange-ftp-ftp-name) (ange-ftp-ftp-name name)) 2948 (t (require 'efs)
2949 (t 'unknown))) 2949 (efs-ftp-path file-name))))
2950 2950
2951 ;;; files.el ends here 2951 ;;; files.el ends here