dot/lisp-init.lisp: Add logical pathname translations for `HOME:'.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 12 Sep 2015 17:17:25 +0000 (18:17 +0100)
Just for fun.

dot/lisp-init.lisp

index de02915..aae544a 100644 (file)
          `(("SYS:SRC;**;*.*.*" ,(#2# "src/**/*.*"))
            ("SYS:CONTRIB;**;*.*.*" ,(#2# "contrib/**/*.*"))))))
 
+#+sbcl (require :sb-posix)
+#+(and unix (or sbcl clisp cmu))
+(let ((#1=#:home (pathname (concatenate 'string
+                                       (or #+sbcl (sb-posix:getenv "HOME")
+                                           #+clisp (ext:getent "HOME")
+                                           #+cmu (unix:unix-getenv "HOME")
+                                           "/home/mdw")
+                                       "/"))))
+  (setf (logical-pathname-translations "HOME")
+       `(("HOME:**;*.*.*" ,(merge-pathnames "**/*.*" #1#)))))
+
 ;; Various fixings.
 #+clisp (setf custom:*parse-namestring-ansi* t)