golf-buffer-scheme
ゴルフしたコードが余りに読み辛いのでscheme-modeを導入した上で作成。
(defun golf-buffer-scheme () (interactive) (let ((spc "[ \r\n\t]") (-- "\\|")) (replace-buffer (compile-regexp (concatenate 'string spc "*" "\\(" ; <1> "\"\\(?:[^\"]\\|\\\\.\\)*\"" ; string -- "/\\(?:[^/]*\\|\\\\.\\)*/" ; regexp -- "[]()'`,[]" ; paren / quote -- spc ; extra spaces "\\)" ; </1> spc "*" )) "\\1" :regexp t))) (add-hook '*scheme-mode-hook* #'(lambda () (define-key *scheme-mode-map* #\C-M-g 'golf-buffer-scheme) ))