From 940e5099142a1bb60e76ae2cbd1f47244cb2eb44 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 11 Mar 2013 22:08:21 -0400 Subject: [PATCH] Use locate-user-emacs-file. * lisp/type-break.el (type-break-file-name): * lisp/textmodes/remember.el (remember-data-file): * lisp/strokes.el (strokes-file): * lisp/shadowfile.el (shadow-initialize): * lisp/saveplace.el (save-place-file): * lisp/ps-bdf.el (bdf-cache-file): * lisp/progmodes/idlwave.el (idlwave-config-directory): * lisp/net/quickurl.el (quickurl-url-file): * lisp/international/kkc.el (kkc-init-file-name): * lisp/ido.el (ido-save-directory-list-file): * lisp/emulation/viper.el (viper-custom-file-name): * lisp/emulation/vip.el (vip-startup-file): * lisp/calendar/todo-mode.el (todo-file-do, todo-file-done, todo-file-top): * lisp/calendar/timeclock.el (timeclock-file): Use locate-user-emacs-file. --- etc/NEWS | 20 +++++++++++++++++++- lisp/ChangeLog | 17 +++++++++++++++++ lisp/calendar/timeclock.el | 2 +- lisp/calendar/todo-mode.el | 6 +++--- lisp/emulation/vip.el | 2 +- lisp/emulation/viper-cmd.el | 6 +++--- lisp/emulation/viper.el | 2 +- lisp/ido.el | 3 ++- lisp/international/kkc.el | 2 +- lisp/net/quickurl.el | 3 ++- lisp/progmodes/idlwave.el | 4 ++-- lisp/ps-bdf.el | 7 +------ lisp/saveplace.el | 2 +- lisp/shadowfile.el | 10 ++++++---- lisp/strokes.el | 2 +- lisp/textmodes/remember.el | 2 +- lisp/type-break.el | 6 +++--- 17 files changed, 65 insertions(+), 31 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index f7b986f6bfb..a4691f7f181 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -85,7 +85,25 @@ Eg View mode, etc. * Changes in Specialized Modes and Packages in Emacs 24.4 -** Recentf looks for ~/.emacs.d/recentf additionally to ~/.recentf. +** More packages look for ~/.emacs.d/ additionally to ~/.. +Affected files: +~/.emacs.d/timelog replaces ~/.timelog +~/.emacs.d/todo-do replaces ~/.todo-do +~/.emacs.d/todo-done replaces ~/.todo-done +~/.emacs.d/todo-top replaces ~/.todo-top +~/.emacs.d/vip replaces ~/.vip +~/.emacs.d/viper replaces ~/.viper +~/.emacs.d/ido.last replaces ~/.ido.last +~/.emacs.d/kkcrc replaces ~/.kkcrc +~/.emacs.d/quickurls replaces ~/.quickurls +~/.emacs.d/idlwave replaces ~/.idlwave +~/.emacs.d/bdfcache.el replaces ~/.bdfcache.el +~/.emacs.d/places replaces ~/.emacs-places +~/.emacs.d/shadows replaces ~/.shadows +~/.emacs.d/shadow_todo replaces ~/.shadow_todo +~/.emacs.d/strokes replaces ~/.strokes +~/.emacs.d/notes replaces ~/.notes +~/.emacs.d/type-break replaces ~/.type-break ** Delphi mode is now called OPascal mode. *** All delphi-* variables and functions have been renamed to opascal-*. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e24b7198f53..a1a75d2b5aa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,20 @@ +2013-03-12 Stefan Monnier + + * type-break.el (type-break-file-name): + * textmodes/remember.el (remember-data-file): + * strokes.el (strokes-file): + * shadowfile.el (shadow-initialize): + * saveplace.el (save-place-file): + * ps-bdf.el (bdf-cache-file): + * progmodes/idlwave.el (idlwave-config-directory): + * net/quickurl.el (quickurl-url-file): + * international/kkc.el (kkc-init-file-name): + * ido.el (ido-save-directory-list-file): + * emulation/viper.el (viper-custom-file-name): + * emulation/vip.el (vip-startup-file): + * calendar/todo-mode.el (todo-file-do, todo-file-done, todo-file-top): + * calendar/timeclock.el (timeclock-file): Use locate-user-emacs-file. + 2013-03-12 Paul Eggert Switch encodings of tutorials, thai-word to UTF-8 (Bug#13880). diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el index a872e86dcf2..70d064143dc 100644 --- a/lisp/calendar/timeclock.el +++ b/lisp/calendar/timeclock.el @@ -81,7 +81,7 @@ ;;; User Variables: -(defcustom timeclock-file (convert-standard-filename "~/.timelog") +(defcustom timeclock-file (locate-user-emacs-file "timelog" ".timelog") "The file used to store timeclock data in." :type 'file :group 'timeclock) diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index fdbcb04c9db..c109ecefb7d 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el @@ -281,11 +281,11 @@ show and mark todo entries for today, but may slow down processing of the diary file somewhat." :type 'string :group 'todo) -(defcustom todo-file-do (convert-standard-filename "~/.todo-do") +(defcustom todo-file-do (locate-user-emacs-file "todo-do" ".todo-do") "TODO mode list file." :type 'file :group 'todo) -(defcustom todo-file-done (convert-standard-filename "~/.todo-done") +(defcustom todo-file-done (locate-user-emacs-file "todo-done" ".todo-done") "TODO mode archive file." :type 'file :group 'todo) @@ -315,7 +315,7 @@ window." :group 'todo) (defvar todo-edit-buffer " *TODO Edit*" "TODO Edit buffer name.") -(defcustom todo-file-top (convert-standard-filename "~/.todo-top") +(defcustom todo-file-top (locate-user-emacs-file "todo-top" ".todo-top") "TODO mode top priorities file. Not in TODO format, but diary compatible. diff --git a/lisp/emulation/vip.el b/lisp/emulation/vip.el index e086f26e8ab..ce131b854f5 100644 --- a/lisp/emulation/vip.el +++ b/lisp/emulation/vip.el @@ -159,7 +159,7 @@ If nil then it is bound to `delete-backward-char'." (defvar vip-inhibit-startup-message nil) -(defvar vip-startup-file (convert-standard-filename "~/.vip") +(defvar vip-startup-file (locate-user-emacs-file "vip" ".vip") "Filename used as startup file for vip.") ;; key bindings diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 3813c304de1..d0c0a4b4019 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el @@ -1009,9 +1009,9 @@ as a Meta key and any number of multiple escapes are allowed." (inhibit-quit t)) (if (viper-ESC-event-p event) (progn - ;; Some versions of Emacs (eg., 22.50.8 have a bug, which makes even - ;; a single ESC into ;; a fast keyseq. To guard against this, we - ;; added a check if there are other events as well. Keep the next + ;; Some versions of Emacs (eg., 22.50.8 (?)) have a bug, which makes + ;; even a single ESC into a fast keyseq. To guard against this, we + ;; added a check if there are other events as well. Keep the next ;; line for the next time the bug reappears, so that will remember to ;; report it. ;;(if (and (viper-fast-keysequence-p) unread-command-events) diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index df419420bd4..7f432cdc143 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el @@ -313,7 +313,7 @@ (require 'viper-keym) ;; better be defined before Viper custom group. -(defvar viper-custom-file-name (convert-standard-filename "~/.viper") +(defvar viper-custom-file-name (locate-user-emacs-file "viper" ".viper") "Viper customization file. If set by the user, this must be done _before_ Viper is loaded in `~/.emacs'.") diff --git a/lisp/ido.el b/lisp/ido.el index 066d8276af5..589f44175eb 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -927,7 +927,8 @@ ido is running. Copied from `icomplete-minibuffer-setup-hook'." :type 'hook :group 'ido) -(defcustom ido-save-directory-list-file (convert-standard-filename "~/.ido.last") +(defcustom ido-save-directory-list-file + (locate-user-emacs-file "ido.last" ".ido.last") "File in which the ido state is saved between invocations. Variables stored are: `ido-last-directory-list', `ido-work-directory-list', `ido-work-file-list', and `ido-dir-file-cache'. diff --git a/lisp/international/kkc.el b/lisp/international/kkc.el index 03576442ed8..a7d3ac5d017 100644 --- a/lisp/international/kkc.el +++ b/lisp/international/kkc.el @@ -40,7 +40,7 @@ "String denoting KKC input method. This string is shown at mode line when users are in KKC mode.") -(defvar kkc-init-file-name (convert-standard-filename "~/.kkcrc") +(defvar kkc-init-file-name (locate-user-emacs-file "kkcrc" ".kkcrc") "Name of a file which contains user's initial setup code for KKC.") ;; A flag to control a file specified by `kkc-init-file-name'. diff --git a/lisp/net/quickurl.el b/lisp/net/quickurl.el index 1de9feb1341..1e05d8db336 100644 --- a/lisp/net/quickurl.el +++ b/lisp/net/quickurl.el @@ -94,7 +94,8 @@ :group 'abbrev :prefix "quickurl-") -(defcustom quickurl-url-file (convert-standard-filename "~/.quickurls") +(defcustom quickurl-url-file + (locate-user-emacs-file "quickurls" ".quickurls") "File that contains the URL list." :type 'file :group 'quickurl) diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index ab65933416b..aeaf1acb2ac 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -27,7 +27,7 @@ ;;; Commentary: ;; IDLWAVE enables feature-rich development and interaction with IDL, -;; the Interactive Data Language. It provides a compelling, +;; the Interactive Data Language. It provides a compelling, ;; full-featured alternative to the IDLDE development environment ;; bundled with IDL. @@ -447,7 +447,7 @@ value of `!DIR'. See also `idlwave-library-path'." ;; Configuration files (defcustom idlwave-config-directory - (convert-standard-filename "~/.idlwave") + (locate-user-emacs-file "idlwave" ".idlwave") "Directory for configuration files and user-library catalog." :group 'idlwave-routine-info :type 'file) diff --git a/lisp/ps-bdf.el b/lisp/ps-bdf.el index 832d1cf55bc..98dd2800b77 100644 --- a/lisp/ps-bdf.el +++ b/lisp/ps-bdf.el @@ -91,12 +91,7 @@ If BDFNAME doesn't exist, return nil." (insert-file-contents bdfname) buf)))) -(defvar bdf-cache-file (if (eq system-type 'ms-dos) - ;; convert-standard-filename doesn't - ;; guarantee that the .el extension will be - ;; preserved. - "~/_bdfcache.el" - (convert-standard-filename "~/.bdfcache.el")) +(defvar bdf-cache-file (locate-user-emacs-file "bdfcache.el" ".bdfcache.el") "Name of cache file which contains information of `BDF' font files.") (defvar bdf-cache nil diff --git a/lisp/saveplace.el b/lisp/saveplace.el index baa6b794fc4..ef2f5469e29 100644 --- a/lisp/saveplace.el +++ b/lisp/saveplace.el @@ -68,7 +68,7 @@ following code in your init file: (make-variable-buffer-local 'save-place) -(defcustom save-place-file (convert-standard-filename "~/.emacs-places") +(defcustom save-place-file (locate-user-emacs-file "places" ".emacs-places") "Name of the file that records `save-place-alist' value." :type 'file :group 'save-place) diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el index d10ea99afb1..ec6e6e7ff10 100644 --- a/lisp/shadowfile.el +++ b/lisp/shadowfile.el @@ -651,7 +651,7 @@ Return t unless files were locked; then return nil." (beep) (sit-for 3) nil) - (save-excursion + (save-current-buffer (when shadow-info-file (set-buffer (setq shadow-info-buffer (find-file-noselect shadow-info-file))) @@ -683,7 +683,7 @@ Also clear `shadow-hashtable', since when there are new shadows defined, the old hashtable info is invalid." (shadow-invalidate-hashtable) (if shadow-info-file - (save-excursion + (save-current-buffer (if (not shadow-info-buffer) (setq shadow-info-buffer (find-file-noselect shadow-info-file))) (set-buffer shadow-info-buffer) @@ -802,11 +802,13 @@ look for files that have been changed and need to be copied to other systems." (file-name-as-directory (shadow-expand-file-name "~")))) (if (null shadow-info-file) (setq shadow-info-file - (shadow-expand-file-name (convert-standard-filename "~/.shadows")))) + ;; FIXME: Move defaults to their defcustom. + (shadow-expand-file-name + (locate-user-emacs-file "shadows" ".shadows")))) (if (null shadow-todo-file) (setq shadow-todo-file (shadow-expand-file-name - (convert-standard-filename "~/.shadow_todo")))) + (locate-user-emacs-file "shadow_todo" ".shadow_todo")))) (if (not (shadow-read-files)) (progn (message "Shadowfile information files not found - aborting") diff --git a/lisp/strokes.el b/lisp/strokes.el index 5acd0dc0120..2c3c3bc6dd4 100644 --- a/lisp/strokes.el +++ b/lisp/strokes.el @@ -260,7 +260,7 @@ WARNING: Changing the value of this variable will gravely affect the :type 'integer :group 'strokes) -(defcustom strokes-file (convert-standard-filename "~/.strokes") +(defcustom strokes-file (locate-user-emacs-file "strokes" ".strokes") "File containing saved strokes for Strokes mode (default is ~/.strokes)." :type 'file :group 'strokes) diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el index eeb04ef250f..16b99627400 100644 --- a/lisp/textmodes/remember.el +++ b/lisp/textmodes/remember.el @@ -380,7 +380,7 @@ Subject: %s\n\n" ;; Remembering to plain files -(defcustom remember-data-file (convert-standard-filename "~/.notes") +(defcustom remember-data-file (locate-user-emacs-file "notes" ".notes") "The file in which to store unprocessed data." :type 'file :group 'remember) diff --git a/lisp/type-break.el b/lisp/type-break.el index 212ac392e01..3ddf2e2d20a 100644 --- a/lisp/type-break.el +++ b/lisp/type-break.el @@ -204,11 +204,11 @@ key is pressed." :type 'boolean :group 'type-break) -(defcustom type-break-file-name (convert-standard-filename "~/.type-break") +(defcustom type-break-file-name + (locate-user-emacs-file "type-break" ".type-break") "Name of file used to save state across sessions. If this is nil, no data will be saved across sessions." - :type 'file - :group 'type-break) + :type 'file) (defvar type-break-post-command-hook '(type-break-check) "Hook run indirectly by `post-command-hook' for typing break functions. -- 2.11.4.GIT