aidan  committed 42f5135

Correct a bug with previous overlay.el patch.

  • Participants
  • Parent commits bfd3c8a
  • Branches default

Comments (0)

Files changed (2)

+2008-04-11  Aidan Kehoe  <>
+	* overlay.el (overlay-normalize-begin-end-buffer): 
+	Correct a bug where the value for BUFFER wasn't passed back; make
+	docstring clearer, make normalisation of the BUFFER argument more
+	concise. 
 2008-04-10  Aidan Kehoe  <>
 	* overlay.el: 
 (defsubst overlay-normalize-begin-end-buffer (beg end &optional buffer)
-  "BEG and END will be normalized so 1 <= BEG <= END <= \(1+ \(length BUFFER)).
+  "Normalize BEG and END so that 1 <= BEG <= END <= \(1+ \(length BUFFER)).
 If BUFFER is nil, the current buffer is assumed.  If BEG is
-greater than END, exchange their value."
+greater than END, exchange their value.
-  (if (null buffer)
-      (setq buffer (current-buffer))
-    (check-argument-type 'bufferp buffer))
+Returns values BEG END BUFFER.  See `multiple-value-setq' and
+`multiple-value-bind'. "
+  (check-argument-type #'bufferp (setq buffer (or buffer (current-buffer))))
   (setq beg (overlay-normalize-pos beg buffer)
 	end (overlay-normalize-pos end buffer))
   (when (> beg end)
     (setq beg (prog1 end (setq end beg))))
-  (values beg end))
+  (values beg end buffer))
 (defun make-overlay (beg end &optional buffer front-advance rear-advance)
   "Create a new overlay with range BEG to END in BUFFER.