changeset 38641:2e6dd0de246f

(uniquify-rationalize-file-buffer-names): Reshuffled the code for clarity and speed (maybe).
author Francesco Potortì <pot@gnu.org>
date Wed, 01 Aug 2001 14:39:56 +0000
parents 3ad03111e566
children 4d538c0a8afc
files lisp/uniquify.el
diffstat 1 files changed, 19 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/uniquify.el	Wed Aug 01 14:39:28 2001 +0000
+++ b/lisp/uniquify.el	Wed Aug 01 14:39:56 2001 +0000
@@ -194,32 +194,29 @@
 	(newbuffile-nd (and newbuffile
 			    (uniquify-file-name-nondirectory newbuffile))))
     (dolist (buffer (buffer-list))
-      (let* ((bfn (if (eq buffer newbuf)
-		      (and newbuffile
-			   (expand-file-name
-			    (if (file-directory-p newbuffile)
-				(directory-file-name newbuffile)
-			      newbuffile)))
-		    (uniquify-buffer-file-name buffer)))
-	     (rawname (and bfn (uniquify-file-name-nondirectory bfn)))
-	     (bufname (buffer-name buffer))
-	     (deserving (and rawname
-			     (not (string= bufname " **lose**"))
-			     (not (and uniquify-ignore-buffers-re
-				       (string-match uniquify-ignore-buffers-re
-						     bufname)))
-			     (or (not newbuffile)
-				 (equal rawname newbuffile-nd))))
-	     (min-proposed (if deserving
-			       (uniquify-get-proposed-name
-				rawname bfn uniquify-min-dir-content))))
-	(if deserving
+      (let ((bufname (buffer-name buffer))
+	    bfn rawname min-proposed)
+	(if (and (not (string= " **lose**" bufname))
+		 (not (and uniquify-ignore-buffers-re
+			   (string-match uniquify-ignore-buffers-re
+					 bufname)))
+		 (setq bfn (if (eq buffer newbuf)
+			       (when newbuffile
+				 (expand-file-name
+				  (if (file-directory-p newbuffile)
+				      (directory-file-name newbuffile)
+				    newbuffile)))
+			     (uniquify-buffer-file-name buffer)))
+		 (setq rawname (uniquify-file-name-nondirectory bfn))
+		 (or (not newbuffile)
+		     (equal rawname newbuffile-nd))
+		 (setq min-proposed (uniquify-get-proposed-name
+				     rawname bfn uniquify-min-dir-content)))
 	    (push (list rawname bfn buffer min-proposed) fix-list)
 	  (push (list bufname) uniquify-non-file-buffer-names))))
     ;; selects buffers whose names may need changing, and others that
     ;; may conflict.
-    (setq fix-list
-	  (sort fix-list 'uniquify-item-lessp))
+    (setq fix-list (sort fix-list 'uniquify-item-lessp))
     ;; bringing conflicting names together
     (uniquify-rationalize-a-list fix-list uniquify-min-dir-content)))