Skip to content

Commit eb40a89

Browse files
committed
Use abbreviate-file-name instead of manual regex replacement
1 parent 58de9a7 commit eb40a89

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: php.el

+2-3
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,8 @@ When `DOCUMENT-ROOT' is NIL, the document root is obtained from `ROUTER-OR-DIR'.
393393
(if (file-directory-p router-or-dir)
394394
router-or-dir
395395
(directory-file-name router-or-dir))))
396-
(pattern (rx-form `(: bos ,(getenv "HOME"))))
397-
(short-dirname (replace-regexp-in-string pattern "~" default-directory))
398-
(short-filename (replace-regexp-in-string pattern "~" router-or-dir))
396+
(short-dirname (abbreviate-file-name default-directory))
397+
(short-filename (abbreviate-file-name router-or-dir))
399398
(buf-name (format "php -S %s:%s -t %s %s"
400399
hostname
401400
port

0 commit comments

Comments
 (0)