UNIX厨房の扱いについてat UNIX
UNIX厨房の扱いについて - 暇つぶし2ch55:名無しさん@お腹いっぱい。
08/02/09 15:25:30
(defun replace-white-space-to-2ch-board-format (begin end)
  (interactive
       (let ()
         (list
          (if (and transient-mark-mode mark-active)
              (region-beginning))
          (if (and transient-mark-mode mark-active)
              (region-end)))))
      (let ((temp (buffer-substring begin end))
            (buffer (get-buffer-create
                     "*replace-white-space-to-2ch-board-format*")))
        (with-current-buffer buffer
          (erase-buffer)
          (insert temp)
          (untabify (point-min) (point-max))
          (call-process-region (point-min) (point-max) shell-file-name t buffer nil
                             shell-command-switch "perl -pe 's/^\\s*/q{ } x length($&)/e'")
          (kill-ring-save (point-min) (point-max))
        (kill-buffer buffer))))

test


次ページ
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch