Commits

Anonymous committed a89d5ba

2004-05-12 Steve Youngs <steve@youngs.au.com>

* lisp/xwem-keymacro.el (xwem-keymacro-save-macros): Use
`expand-file-name'.
(xwem-keymacro-load-macros): Ditto.

* lisp/xwem-strokes.el (xwem-strokes-save-strokes): Use
`expand-file-name' to define `strokes-file'.
(xwem-strokes-load-strokes): Ditto.

* lisp/xwem-main.el (xwem-dir): Change to custom type `directory'
and use `file-name-as-directory' to define the default.
(xwem-init): Simplify the `expand-file-name' call on xwemrc.el.

  • Participants
  • Parent commits 3c4d973

Comments (0)

Files changed (4)

+2004-05-12  Steve Youngs  <steve@youngs.au.com>
+
+	* lisp/xwem-keymacro.el (xwem-keymacro-save-macros): Use
+	`expand-file-name'.
+	(xwem-keymacro-load-macros): Ditto.
+
+	* lisp/xwem-strokes.el (xwem-strokes-save-strokes): Use
+	`expand-file-name' to define `strokes-file'.
+	(xwem-strokes-load-strokes): Ditto.
+
+	* lisp/xwem-main.el (xwem-dir): Change to custom type `directory'
+	and use `file-name-as-directory' to define the default.
+	(xwem-init): Simplify the `expand-file-name' call on xwemrc.el.
+
 2004-05-11  Zajcev Evgeny  <zevlg@yandex.ru>
 
 	* lisp/xwem-frame.el (xwem-frame-config-dump): [fix] Save only

lisp/xwem-keymacro.el

 		      (insert (format "(define-key xwem-user-macros-map '%S %S)\n" kseq fbind))))
 		  xwem-user-macros-map)
 
-      (write-file (or file (concat xwem-dir "/" xwem-keymacro-macrofile)))
+      (write-file (or file (expand-file-name xwem-keymacro-macrofile xwem-dir)))
       (kill-buffer buf))))
 
 ;;;###autoload
 (defun xwem-keymacro-load-macros (&optional file)
   "Load macros saved with `xwem-key-save-macros' from FILE.
 Default value for FILE is ~/.xwem/xwem-macros.el"
-  (load (or file (concat xwem-dir "/" xwem-keymacro-macrofile))))
+  (load (or file (expand-file-name xwem-keymacro-macrofile xwem-dir))))
 
 
 (provide 'xwem-keymacro)

lisp/xwem-main.el

   :group 'xwem)
 
 ;;;###autoload
-(defcustom xwem-dir "~/.xwem"
+(defcustom xwem-dir (file-name-as-directory
+		     (expand-file-name ".xwem" (getenv "HOME")))
   "Directory to store XWEM's files."
-  :type 'string
+  :type 'directory
   :group 'xwem)
 
 ;;;###autoload
   (setq inhibit-startup-message t)
 
   ;; read configuration
-  (let ((cfg (expand-file-name (concat xwem-dir "/xwemrc.el"))))
+  (let ((cfg (expand-file-name "xwemrc.el" xwem-dir)))
     (if (file-exists-p cfg)
 	(load cfg)
       (xwem-message 'warn "Configuration file `%s' does not exists" cfg)))

lisp/xwem-strokes.el

   "Save user defined strokes to file named by `xwem-strokes-file'.
 Modification to `strokes-prompt-user-save-strokes' to work with xwem's stuff."
   (let ((strokes-global-map xwem-strokes-map)
-	(strokes-file (concat xwem-dir "/" xwem-strokes-file)))
+	(strokes-file (expand-file-name xwem-strokes-file xwem-dir)))
 
     (flet ((yes-or-no-p-maybe-dialog-box (prompt)
 	    (lambda () (xwem-under-minib-focus (yes-or-no-p prompt)))))
 
 (defun xwem-strokes-load-strokes ()
   "Load user defined strokes from file named by `xwem-strokes-file'."
-  (if (file-exists-p (concat xwem-dir "/" xwem-strokes-file))
+  (if (file-exists-p (expand-file-name xwem-strokes-file xwem-dir))
 ;      (xwem-under-minib-focus
 ;       (and (y-or-n-p
 ;	     (format "XWEM: No strokes loaded.  Load `%s'? "
-;		     (concat xwem-dir "/" xwem-strokes-file)))
-      (let ((strokes-file (concat xwem-dir "/" xwem-strokes-file)))
+;		     (expand-file-name xwem-strokes-file xwem-dir)))
+      (let ((strokes-file (expand-file-name xwem-strokes-file xwem-dir)))
 	(strokes-load-user-strokes))))
 
 (defun xwem-strokes-cmd-valid-p (cmd)