+(defun ibuffer-change-marks (&optional old new)
+ "Change all OLD marks to NEW marks.
+OLD and NEW are both characters used to mark buffers."
+ (interactive
+ (let* ((cursor-in-echo-area t)
+ (old (progn (message "Change (old mark): ") (read-char)))
+ (new (progn (message "Change %c marks to (new mark): " old)
+ (read-char))))
+ (list old new)))
+ (if (or (eq old ?\r) (eq new ?\r))
+ (ding)
+ (let ((count
+ (ibuffer-map-lines
+ (lambda (_buf mark)
+ (when (eq mark old)
+ (ibuffer-set-mark new) t)))))
+ (message "%s marks changed" count))))
+