:group 'find-file)
(defcustom find-file-visit-truename nil
- "*Non-nil means visit a file under its truename.
+ "Non-nil means visit a file under its truename.
The truename of a file is found by chasing all links
both at the file level and at the levels of the containing directories."
:type 'boolean
(defcustom enable-local-eval 'maybe
"Control processing of the \"variable\" `eval' in a file's local variables.
The value can be t, nil or something else.
-A value of t means obey `eval' variables;
+A value of t means obey `eval' variables.
A value of nil means ignore them; anything else means query."
:type '(choice (const :tag "Obey" t)
(const :tag "Ignore" nil)
(defun locate-dominating-file (file name)
"Look up the directory hierarchy from FILE for a file named NAME.
-Stop at the first parent directory containing a file NAME return the directory.
-Return nil if not found."
+Stop at the first parent directory containing a file NAME,
+and return the directory. Return nil if not found."
;; We used to use the above locate-dominating-files code, but the
;; directory-files call is very costly, so we're much better off doing
;; multiple calls using the code in here.
- ;;
+ ;;
;; Represent /home/luser/foo as ~/foo so that we don't try to look for
;; `name' in /home or in /.
(setq file (abbreviate-file-name file))
When called from Lisp, BUFFER can be a buffer, a string \(a buffer name),
or nil. If BUFFER is nil, then this function chooses a buffer
using `other-buffer'.
-Optional second arg NORECORD non-nil means
-do not put this buffer at the front of the list of recently selected ones.
+Optional second arg NORECORD non-nil means do not put this
+buffer at the front of the list of recently selected ones.
This function returns the buffer it switched to.
This uses the function `display-buffer' as a subroutine; see its
(error "No such project class `%s'" (symbol-name class)))
(push (cons directory class) project-directory-alist))
-(defun define-project-bindings (class list)
+(defun define-project-bindings (class settings)
"Map the project type CLASS to a list of variable settings.
CLASS is the project class, a symbol.
-LIST is a list that declares variable settings for the class.
-An element in LIST is either of the form:
+SETTINGS is a list that declares variable settings for the class.
+An element in SETTINGS is either of the form:
(MAJOR-MODE . ALIST)
or
(DIRECTORY . LIST)
applied by recursively following these rules."
(let ((elt (assq class project-class-alist)))
(if elt
- (setcdr elt list)
- (push (cons class list) project-class-alist))))
+ (setcdr elt settings)
+ (push (cons class settings) project-class-alist))))
(defcustom project-settings-file ".dir-settings.el"
- "Settings file for per-project settings. Set this to nil if you dont want to load project-specific settings."
+ "Settings file for per-project settings.
+Set this to nil if you don't want to load project-specific settings."
:type '(choice
- (const :tag "Ignore" nil)
- (file :tag "File"))
-:group 'files)
+ (const :tag "Ignore" nil)
+ (file :tag "File"))
+ :group 'files)
(defun project-find-settings-file (file)
"Find the settings file for FILE.
Otherwise this returns nil."
(when project-settings-file
(setq file (expand-file-name file))
- (let* ((settings (locate-dominating-file file project-settings-file))
- (pda nil))
+ (let ((settings (locate-dominating-file file project-settings-file))
+ (pda nil))
;; `locate-dominating-file' may have abbreviated the name.
- (if settings (setq settings (expand-file-name ".dir-settings.el" settings)))
+ (when settings
+ (setq settings (expand-file-name project-settings-file settings)))
(dolist (x project-directory-alist)
(when (and (eq t (compare-strings file nil (length (car x))
(car x) nil nil))
\f
(defun not-modified (&optional arg)
"Mark current buffer as unmodified, not needing to be saved.
-With prefix arg, mark buffer as modified, so \\[save-buffer] will save.
+With prefix ARG, mark buffer as modified, so \\[save-buffer] will save.
It is not a good idea to use this function in Lisp programs, because it
prints a message in the minibuffer. Instead, use `set-buffer-modified-p'."
This command also implements an interface for special buffers
that contain text which doesn't come from a file, but reflects
some other data instead (e.g. Dired buffers, `buffer-list'
-buffers). This is done via the variable
-`revert-buffer-function'. In these cases, it should reconstruct
-the buffer contents from the appropriate data.
+buffers). This is done via the variable `revert-buffer-function'.
+In these cases, it should reconstruct the buffer contents from the
+appropriate data.
When called from Lisp, the first argument is IGNORE-AUTO; only offer
to revert from the auto-save file when this is nil. Note that the
sake of backward compatibility. IGNORE-AUTO is optional, defaulting
to nil.
-Optional second argument NOCONFIRM means don't ask for confirmation at
-all. \(The variable `revert-without-query' offers another way to
+Optional second argument NOCONFIRM means don't ask for confirmation
+at all. \(The variable `revert-without-query' offers another way to
revert buffers without querying for confirmation.)
Optional third argument PRESERVE-MODES non-nil means don't alter
(kill-buffer buffer))))
(defun kill-buffer-ask (buffer)
- "Kill buffer if confirmed."
+ "Kill BUFFER if confirmed."
(when (yes-or-no-p
(format "Buffer %s %s. Kill? " (buffer-name buffer)
(if (buffer-modified-p buffer)
(setq list (cdr list))))
(defun kill-matching-buffers (regexp &optional internal-too)
- "Kill buffers whose name matches the specified regexp.
+ "Kill buffers whose name matches the specified REGEXP.
The optional second argument indicates whether to kill internal buffers too."
(interactive "sKill buffers matching this regular expression: \nP")
(dolist (buffer (buffer-list))
(defun save-buffers-kill-emacs (&optional arg)
"Offer to save each buffer, then kill this Emacs process.
-With prefix arg, silently save all file-visiting buffers, then kill."
+With prefix ARG, silently save all file-visiting buffers, then kill."
(interactive "P")
(save-some-buffers arg t)
(and (or (not (memq t (mapcar (function
"Offer to save each buffer, then kill the current connection.
If the current frame has no client, kill Emacs itself.
-With prefix arg, silently save all file-visiting buffers, then kill.
+With prefix ARG, silently save all file-visiting buffers, then kill.
If emacsclient was started with a list of filenames to edit, then
only these files will be asked to be saved."