filter-selection

(defunkey filter-selection #\C-\| (cmd)
  (interactive "*e| " :history0 'execute)
  (if (get-selection-type)
    (let ((s (selection-mark))
          (e (selection-point)))
      (and (> s e) (rotatef s e))
      (filter-region cmd s e))
    (filter-region cmd)))

filter-region の選択範囲版。defunkey はコレ↓。

(defmacro defunkey (name key . body)
  `(progn
     (defun ,name ,@body)
     (global-set-key ,key ',name)))
(setf (get 'defunkey 'lisp-indent-hook) 'defun)