mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-04 11:00:45 -08:00
* lisp/subr.el (locate-user-emacs-file): If both old and new name exist, use
the new name.
This commit is contained in:
parent
be883b34f2
commit
85e5541248
2 changed files with 11 additions and 5 deletions
|
|
@ -1,5 +1,8 @@
|
||||||
2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
|
2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||||
|
|
||||||
|
* subr.el (locate-user-emacs-file): If both old and new name exist, use
|
||||||
|
the new name.
|
||||||
|
|
||||||
* progmodes/js.el (js--filling-paragraph): New var.
|
* progmodes/js.el (js--filling-paragraph): New var.
|
||||||
(c-forward-sws, c-backward-sws, c-beginning-of-macro): Advise.
|
(c-forward-sws, c-backward-sws, c-beginning-of-macro): Advise.
|
||||||
(js-c-fill-paragraph): Prefer advice to cl-letf so the rebinding is
|
(js-c-fill-paragraph): Prefer advice to cl-letf so the rebinding is
|
||||||
|
|
|
||||||
13
lisp/subr.el
13
lisp/subr.el
|
|
@ -2657,13 +2657,17 @@ See also `locate-user-emacs-file'.")
|
||||||
|
|
||||||
(defun locate-user-emacs-file (new-name &optional old-name)
|
(defun locate-user-emacs-file (new-name &optional old-name)
|
||||||
"Return an absolute per-user Emacs-specific file name.
|
"Return an absolute per-user Emacs-specific file name.
|
||||||
If OLD-NAME is non-nil and ~/OLD-NAME exists, return ~/OLD-NAME.
|
If NEW-NAME exists in `user-emacs-directory', return it.
|
||||||
|
Else If OLD-NAME is non-nil and ~/OLD-NAME exists, return ~/OLD-NAME.
|
||||||
Else return NEW-NAME in `user-emacs-directory', creating the
|
Else return NEW-NAME in `user-emacs-directory', creating the
|
||||||
directory if it does not exist."
|
directory if it does not exist."
|
||||||
(convert-standard-filename
|
(convert-standard-filename
|
||||||
(let* ((home (concat "~" (or init-file-user "")))
|
(let* ((home (concat "~" (or init-file-user "")))
|
||||||
(at-home (and old-name (expand-file-name old-name home))))
|
(at-home (and old-name (expand-file-name old-name home)))
|
||||||
(if (and at-home (file-readable-p at-home))
|
(bestname (abbreviate-file-name
|
||||||
|
(expand-file-name new-name user-emacs-directory))))
|
||||||
|
(if (and at-home (not (file-readable-p bestname))
|
||||||
|
(file-readable-p at-home))
|
||||||
at-home
|
at-home
|
||||||
;; Make sure `user-emacs-directory' exists,
|
;; Make sure `user-emacs-directory' exists,
|
||||||
;; unless we're in batch mode or dumping Emacs
|
;; unless we're in batch mode or dumping Emacs
|
||||||
|
|
@ -2677,8 +2681,7 @@ directory if it does not exist."
|
||||||
(set-default-file-modes ?\700)
|
(set-default-file-modes ?\700)
|
||||||
(make-directory user-emacs-directory))
|
(make-directory user-emacs-directory))
|
||||||
(set-default-file-modes umask))))
|
(set-default-file-modes umask))))
|
||||||
(abbreviate-file-name
|
bestname))))
|
||||||
(expand-file-name new-name user-emacs-directory))))))
|
|
||||||
|
|
||||||
;;;; Misc. useful functions.
|
;;;; Misc. useful functions.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue