:type 'boolean
:group 'backup)
(make-variable-buffer-local 'buffer-offer-save)
+(put 'buffer-offer-save 'permanent-local t)
(defcustom find-file-existing-other-name t
"Non-nil means find a file under alternative names, in existing buffers.
(confirm-nonexistent-file-or-buffer)))
(let ((value (find-file-noselect filename nil nil wildcards)))
(if (listp value)
- (mapcar 'switch-to-buffer (nreverse value))
- (switch-to-buffer value))))
+ (mapcar #'pop-to-buffer-same-window (nreverse value))
+ (pop-to-buffer-same-window value))))
(defun find-file-other-window (filename &optional wildcards)
"Edit file FILENAME, in another window.
((not warn) nil)
((and error (file-attributes buffer-file-name))
(setq buffer-read-only t)
- "File exists, but cannot be read")
+ (if (and (file-symlink-p buffer-file-name)
+ (not (file-exists-p
+ (file-chase-links buffer-file-name))))
+ "Symbolic link that points to nonexistent file"
+ "File exists, but cannot be read"))
((not buffer-read-only)
(if (and warn
;; No need to warn if buffer is auto-saved
("\\.icn\\'" . icon-mode)
("\\.sim\\'" . simula-mode)
("\\.mss\\'" . scribe-mode)
+ ;; The Fortran standard does not say anything about file extensions.
+ ;; .f90 was widely used for F90, now we seem to be trapped into
+ ;; using a different extension for each language revision.
+ ;; Anyway, the following extensions are supported by gfortran.
("\\.f9[05]\\'" . f90-mode)
+ ("\\.f0[38]\\'" . f90-mode)
("\\.indent\\.pro\\'" . fundamental-mode) ; to avoid idlwave-mode
("\\.\\(pro\\|PRO\\)\\'" . idlwave-mode)
("\\.srt\\'" . srecode-template-mode)
(setq char nil)))
(kill-buffer buf)
(when (and offer-save (= char ?!) unsafe-vars)
- (dolist (elt unsafe-vars)
- (add-to-list 'safe-local-variable-values elt))
- ;; When this is called from desktop-restore-file-buffer,
- ;; coding-system-for-read may be non-nil. Reset it before
- ;; writing to .emacs.
- (if (or custom-file user-init-file)
- (let ((coding-system-for-read nil))
- (customize-save-variable
- 'safe-local-variable-values
- safe-local-variable-values))))
+ (customize-push-and-save 'safe-local-variable-values unsafe-vars))
(memq char '(?! ?\s ?y))))))
(defun hack-local-variables-prop-line (&optional mode-only)
(view-mode-enter))
(t (setq buffer-read-only (not buffer-read-only))
(force-mode-line-update)))
- (if (vc-backend buffer-file-name)
+ (if (memq (vc-backend buffer-file-name) '(RCS SCCS))
(message "%s" (substitute-command-keys
(concat "File is under version-control; "
"use \\[vc-next-action] to check in/out"))))))
Noninteractively, the second (optional) argument PARENTS, if
non-nil, says whether to create parent directories that don't
-exist. Interactively, this happens by default."
+exist. Interactively, this happens by default.
+
+If creating the directory or directories fail, an error will be
+raised."
(interactive
(list (read-file-name "Make directory: " default-directory default-directory
nil nil)
contents)
(while dirs
(when (or (null (car dirs)) ; Possible if DIRPART is not wild.
- (file-directory-p (directory-file-name (car dirs))))
+ (and (file-directory-p (directory-file-name (car dirs)))
+ (file-readable-p (car dirs))))
(let ((this-dir-contents
;; Filter out "." and ".."
(delq nil