Commits

jpw  committed dfe2076

* ibuffer.el (toplevel): fix indentation.
(ibuffer-compile-formats-quieten-log): remove.
(ibuffer-compile-format): don't use it.

  • Participants
  • Parent commits e97671e

Comments (0)

Files changed (2)

+2002-02-22  John Paul Wallington  <jpw@xemacs.org>
+
+	* ibuffer.el (toplevel): fix indentation.
+	(ibuffer-compile-formats-quieten-log): remove.
+	(ibuffer-compile-format): don't use it.
+	
 2002-02-21  John Paul Wallington  <jpw@xemacs.org>
 
 	* ibuffer.el (ibuffer-buffer-display-time): make it buffer local.
   (if (fboundp 'make-temp-file)
       (defalias 'ibuffer-make-temp-file 'make-temp-file)
     (defun ibuffer-make-temp-file (prefix &optional dir-flag)
-  "Create a temporary file.
+      "Create a temporary file.
 The returned file name (created by appending some random characters at the end
 of PREFIX, and expanding against `temporary-file-directory' if necessary,
 is guaranteed to point to a newly created empty file.
 You can then use `write-region' to write new data into the file.
 
 If DIR-FLAG is non-nil, create a new empty directory instead of a file."
-  (let (file)
-    (while (condition-case ()
-	       (progn
-		 (setq file
-		       (make-temp-name
-			(expand-file-name prefix temporary-file-directory)))
-		 (if dir-flag
-		     (make-directory file)
-		   (write-region "" nil file nil 'silent nil 'excl))
-		 nil)
-	     (file-already-exists t))
-      ;; the file was somehow created by someone else between
-      ;; `make-temp-name' and `write-region', let's try again.
-      nil)
-    file)))
+      (let (file)
+	(while (condition-case ()
+		   (progn
+		     (setq file
+			   (make-temp-name
+			    (expand-file-name prefix temporary-file-directory)))
+		     (if dir-flag
+			 (make-directory file)
+		       (write-region "" nil file nil 'silent nil 'excl))
+		     nil)
+		 (file-already-exists t))
+	  ;; the file was somehow created by someone else between
+	  ;; `make-temp-name' and `write-region', let's try again.
+	  nil)
+	file)))
   
   (if (fboundp 'propertize)
       (defalias 'ibuffer-propertize 'propertize)
 First argument is the string to copy.
 Remaining arguments form a sequence of PROPERTY VALUE pairs for text
 properties to add to the result."
-    (let ((str (copy-sequence string)))
-      (add-text-properties 0 (length str)
-                           properties
-                           str)
-      str)))
+      (let ((str (copy-sequence string)))
+	(add-text-properties 0 (length str)
+			     properties
+			     str)
+	str)))
   
   ;; Deal with different interfaces to mouse events. Sigh.
   (cond ((fboundp 'posn-point)
  	 (error "Couldn't make a suitable definition of `ibuffer-event-window'")))
   
   (if (fboundp 'line-beginning-position)
-    (defalias 'ibuffer-line-beginning-position 'line-beginning-position)
-  (defun ibuffer-line-beginning-position ()
-    (save-excursion
-      (beginning-of-line)
-      (point))))
+      (defalias 'ibuffer-line-beginning-position 'line-beginning-position)
+    (defun ibuffer-line-beginning-position ()
+      (save-excursion
+	(beginning-of-line)
+	(point))))
 
-(if (fboundp 'line-end-position)
-    (defalias 'ibuffer-line-end-position 'line-end-position)
-  (defun ibuffer-line-end-position ()
-    (save-excursion
-      (end-of-line)
-      (point))))
+  (if (fboundp 'line-end-position)
+      (defalias 'ibuffer-line-end-position 'line-end-position)
+    (defun ibuffer-line-end-position ()
+      (save-excursion
+	(end-of-line)
+	(point))))
 
-(if (fboundp 'window-buffer-height)
-    (defalias 'ibuffer-window-buffer-height 'window-buffer-height)
-  (defalias 'ibuffer-window-buffer-height 'window-displayed-height))
+  (if (fboundp 'window-buffer-height)
+      (defalias 'ibuffer-window-buffer-height 'window-buffer-height)
+    (defalias 'ibuffer-window-buffer-height 'window-displayed-height))
 
-(if (fboundp 'fit-window-to-buffer)
+  (if (fboundp 'fit-window-to-buffer)
+      (defun ibuffer-shrink-to-fit (&optional owin)
+	(fit-window-to-buffer nil (when owin (/ (frame-height)
+					      (length (window-list (selected-frame)))))))
     (defun ibuffer-shrink-to-fit (&optional owin)
-      (fit-window-to-buffer nil (when owin (/ (frame-height)
-					      (length (window-list (selected-frame)))))))
-  (defun ibuffer-shrink-to-fit (&optional owin)
-    "Make window the right size to display its contents exactly."
-    (interactive)
-    (when (> (length (window-list (selected-frame))) 1)
-      (let* ((window (selected-window))
-	     (buf (window-buffer window))
-	     (height (window-height (selected-window)))
-	     (new-height (with-current-buffer buf
-			   (+ (count-lines (point-min) (point-max) 3))))
-	     (diff (- new-height height)))
-	(unless (zerop diff)
-	  (enlarge-window diff))   
-	(let ((end (with-current-buffer buf (point-max))))
-	  (while (not (pos-visible-in-window-p end window))
-	    (enlarge-window 1)))))))
+      "Make window the right size to display its contents exactly."
+      (interactive)
+      (when (> (length (window-list (selected-frame))) 1)
+	(let* ((window (selected-window))
+	       (buf (window-buffer window))
+	       (height (window-height (selected-window)))
+	       (new-height (with-current-buffer buf
+			     (+ (count-lines (point-min) (point-max) 3))))
+	       (diff (- new-height height)))
+	  (unless (zerop diff)
+	    (enlarge-window diff))   
+	  (let ((end (with-current-buffer buf (point-max))))
+	    (while (not (pos-visible-in-window-p end window))
+	      (enlarge-window 1)))))))
     
-(if (fboundp 'replace-regexp-in-string)
-    (defalias 'ibuffer-replace-regexp-in-string 'replace-regexp-in-string)
-  (defun ibuffer-replace-regexp-in-string (regexp rep string &optional
+  (if (fboundp 'replace-regexp-in-string)
+      (defalias 'ibuffer-replace-regexp-in-string 'replace-regexp-in-string)
+    (defun ibuffer-replace-regexp-in-string (regexp rep string &optional
 					fixedcase literal subexp start)
-  "Replace all matches for REGEXP with REP in STRING.
+      "Replace all matches for REGEXP with REP in STRING.
 Return a new string containing the replacements.
 
 Optional arguments FIXEDCASE, LITERAL and SUBEXP are like the
 function.  If it is a function it is applied to each match to generate
 the replacement passed to `replace-match'; the match-data at this
 point are such that match 0 is the function's argument."
-  (let ((l (length string))
-	(start (or start 0))
-	matches str mb me)
-    (save-match-data
-      (while (and (< start l) (string-match regexp string start))
-	(setq mb (match-beginning 0)
-	      me (match-end 0))
-	(when (= me mb) (setq me (min l (1+ mb))))
-	(string-match regexp (setq str (substring string mb me)))
-	(setq matches
-	      (cons (replace-match (if (stringp rep)
-				       rep
-				     (funcall rep (match-string 0 str)))
-				   fixedcase literal str subexp)
-		    (cons (substring string start mb)
-			  matches)))
-	(setq start me))
-      (setq matches (cons (substring string start l) matches))
-      (apply #'concat (nreverse matches))))))
+      (let ((l (length string))
+	    (start (or start 0))
+	    matches str mb me)
+	(save-match-data
+	  (while (and (< start l) (string-match regexp string start))
+	    (setq mb (match-beginning 0)
+		  me (match-end 0))
+	    (when (= me mb) (setq me (min l (1+ mb))))
+	    (string-match regexp (setq str (substring string mb me)))
+	    (setq matches
+		  (cons (replace-match (if (stringp rep)
+					   rep
+					 (funcall rep (match-string 0 str)))
+				       fixedcase literal str subexp)
+			(cons (substring string start mb)
+			      matches)))
+	    (setq start me))
+	  (setq matches (cons (substring string start l) matches))
+	  (apply #'concat (nreverse matches))))))
 
-(if (and (boundp 'header-line-format)
-	 (not (string-match "Lucid\\|XEmacs" emacs-version)))
-    (defun ibuffer-set-header-line (format)
-      (setq header-line-format format))
-  (defun ibuffer-set-header-line-format (format)
-    (save-excursion
-      (let ((top (goto-char (point-min)))
-	    (inhibit-read-only t))
-	(when (get-text-property top 'ibuffer-header-line)
-	  (delete-region top (next-single-property-change top 'ibuffer-title)))
-	(goto-char top)
-	(when format
-	  (if (> (length format) (- (window-width) 2))
-	      (setq format (substring format 0 (- (window-width) 2))))
-	  (insert format)
-	  (insert-char ?\  (max 0 (- (window-width) (current-column) 1)))
-	  (put-text-property top (point) 'ibuffer-header-line t)
-	  (unless (eolp)
-	    (insert "\n")))))))
+  (if (and (boundp 'header-line-format)
+	   (not (string-match "Lucid\\|XEmacs" emacs-version)))
+      (defun ibuffer-set-header-line (format)
+	(setq header-line-format format))
+    (defun ibuffer-set-header-line-format (format)
+      (save-excursion
+	(let ((top (goto-char (point-min)))
+	      (inhibit-read-only t))
+	  (when (get-text-property top 'ibuffer-header-line)
+	    (delete-region top (next-single-property-change top 'ibuffer-title)))
+	  (goto-char top)
+	  (when format
+	    (if (> (length format) (- (window-width) 2))
+		(setq format (substring format 0 (- (window-width) 2))))
+	    (insert format)
+	    (insert-char ?\  (max 0 (- (window-width) (current-column) 1)))
+	    (put-text-property top (point) 'ibuffer-header-line t)
+	    (unless (eolp)
+	      (insert "\n")))))))
   )
 
 ;; XEmacs doesn't have buffer-display-time.  Nor are enter-window-hook or
   :type 'boolean
   :group 'ibuffer)
 
-(defcustom ibuffer-compile-formats-quieten-log nil
-  "If non-nil, quieten byte-compiler's log when optimizing `ibuffer-formats'."
-  :type 'boolean
-  :group 'ibuffer)
-
 (defgroup ibuffer-faces nil
   "Faces used by Ibuffer package."
   :group 'ibuffer
 		 `(let ,letbindings
 		    ,@outforms)))))
        result))
-    (let ((byte-compile-verbose 
-	   (if ibuffer-compile-formats-quieten-log nil byte-compile-verbose))
-	  (byte-optimize-log 
-	   (if ibuffer-compile-formats-quieten-log nil byte-optimize-log))
-	  (byte-compile-warnings 
-	   (if ibuffer-compile-formats-quieten-log nil byte-compile-warnings)))
-      (setq result
-	    (funcall (if (or ibuffer-always-compile-formats
-			     (featurep 'bytecomp))
-			 #'byte-compile
-		       #'identity)
-		     (nconc (list 'lambda '(buffer mark))
-			    `((let ,(append
-				     (when str-used
-				       '(str))
-				     (when global-strlen-used
-				       '(strlen))
-				     (when tmp1-used
-				       '(tmp1))
-				     (when tmp2-used
-				       '(tmp2)))
-				,@(nreverse result)))))))))
+    (setq result
+	  (funcall (if (or ibuffer-always-compile-formats
+			   (featurep 'bytecomp))
+		       #'byte-compile
+		     #'identity)
+		   (nconc (list 'lambda '(buffer mark))
+			  `((let ,(append
+				   (when str-used
+				     '(str))
+				   (when global-strlen-used
+				     '(strlen))
+				   (when tmp1-used
+				     '(tmp1))
+				   (when tmp2-used
+				     '(tmp2)))
+			      ,@(nreverse result))))))))
 
 (defvar ibuffer-compiled-formats nil)
 (defvar ibuffer-cached-formats nil)