[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Is it necessary to expand the tilde symbol before setting default-directory?


I saw "no such direcoty: ~/.w3m" error when calling w3m-perldoc().
In order to avoid the above error, the attached patch is effective and
has been installed.

But, I still have a doubt...  there are several places to set
w3m-profile-directory to default-directory without expanding the tilde
symbol.  I worry whether these places occur other problems.

How do you think about this qustion, Yamaoka-san ?

TSUCHIYA Masatoshi
--- w3m-perldoc.el	28 Jun 2017 00:53:11 -0000	1.12
+++ w3m-perldoc.el	5 Mar 2018 13:45:03 -0000	1.13
@@ -85,10 +85,10 @@
     (let ((docname (if (= (length url) (match-end 0))
 		     (w3m-url-decode-string (substring url (match-end 0)))))
-	  (default-directory w3m-profile-directory)
+	  (default-directory (expand-file-name w3m-profile-directory))
 	  (process-environment (copy-sequence process-environment)))
       ;; To specify the place in which pod2html generates its cache files.
-      (setenv "HOME" (expand-file-name w3m-profile-directory))
+      (setenv "HOME" default-directory)
       (and (let ((coding-system-for-read w3m-perldoc-output-coding-system))
 	     (zerop (call-process w3m-perldoc-command
 				  nil t nil "-u" docname)))