elinstall-symlink-on-emacs-start now can accept slashed project names
authorTom Breton (Tehom) <tehom@panix.com>
Mon, 10 Jan 2011 02:55:02 +0000 (9 21:55 -0500)
committerTom Breton (Tehom) <tehom@panix.com>
Mon, 10 Jan 2011 02:55:02 +0000 (9 21:55 -0500)
elinstall.el

index 7346cb6..ec1c7e9 100644 (file)
@@ -788,44 +788,42 @@ PRIORITY must be an integer or nil."
    (let*
       (  
         (priority   (or priority elinstall-default-priority))
-        ;;$$IMPROVE ME  If target-basename has a directory part,
-        ;;split it and format priority onto it.  So join those args
-        ;;and resplit them.
+        ;;We join and re-split in case TARGET-BASENAME includes a
+        ;;directory part.
+        (full-path
+           (expand-file-name target-basename target-dir))
+        (target-dir
+           (file-name-directory full-path))
         (target-name-nodir
            (format
               "%d%s.el"
               priority
-              target-basename))
+              (file-name-nondirectory full-path)))
         (target 
            (expand-file-name target-name-nodir target-dir)))
       
-      
-      (cond
-        ;;Path should already exist.
-        ((not
-            (file-exists-p target-dir))
-           (message "The target directory doesn't exist."))
-        ;;$$IMPROVE ME If it is a symlink pointing to the same place,
-        ;;do nothing.
-
-        ;;$$IMPROVE ME The condition here is really not updating but
-        ;;bulldozing a possibly different symlink.  Add another
-        ;;treatment symbol meaning to bulldoze what's in the way.
-        ((elinstall-proceed-p 'preloads
-            (list
-               '( "Symlink %s? "
-                   "Really overwrite %s? "
-                   "File %s already exists")
-               target)
-            (file-exists-p target))
-           ;;Does nothing if file already exists.
-           (make-directory (file-name-directory target) t)
-           (make-symbolic-link 
-              filename
-              target
-              ;;We already checked file-existence wrt user
-              ;;preferences, so force creation.
-              t)))))
+      ;;$$IMPROVE ME If it is a symlink pointing to the same place,
+      ;;do nothing.
+
+      ;;$$IMPROVE ME The condition here is really not updating but
+      ;;bulldozing a possibly different symlink.  Add another
+      ;;treatment symbol meaning to bulldoze what's in the way.
+      (when
+        (elinstall-proceed-p 'preloads
+           (list
+              '( "Symlink %s? "
+                  "Really overwrite %s? "
+                  "File %s already exists")
+              target)
+           (file-exists-p target))
+        ;;Does nothing if file already exists.
+        (make-directory (file-name-directory target) t)
+        (make-symbolic-link 
+           filename
+           target
+           ;;We already checked file-existence wrt user
+           ;;preferences, so force creation.
+           t))))
 
 ;;;_    . elinstall-add-to-dot-emacs
 (defun elinstall-add-to-dot-emacs (dot-emacs-name filename &rest r)