다음 이전 차례

6. Bzip2를 emacs와 같이 쓰기

6.1 모두를 위해 emacs 바꾸기:

나는 자동압축모드를 추가한 jka-compr.el 패치에 따라 썼다. 부인서: 나는 emacs-20.0에서만 테스트를 해봤다, 그러나 다른 버전에 비슷 하게 접근하지 못한다고 믿을 이유가 없다. 이 것을 써라,

  1. emacs-20.2/lisp 소스 디렉토리에 가라 (당신이 tar을 푼 곳)
  2. jka-compr.el.diff 부르는 파일의 아래에 패치를 놓아라 (그 것은 저 파일 에 단독으로 있어야한다 ;).
  3. 해라 patch < jka-compr.el.diff
  4. Emacs를 시작해라, 그리고 해라 M-x byte-compile-file jka-compr.el
  5. Emacs를 종료해라.
  6. 당신의 최초의 jka-compr.elc를 버그의 케이스안의 안전한 곳으로 옮겨라.
  7. 새로운 jka-compr.elc와 그 것을 바꿔라.
  8. 즐겨라!


   --- jka-compr.el        Sat Jul 26 17:02:39 1997
     +++ jka-compr.el.new    Thu Feb  5 17:44:35 1998
     @@ -44,7 +44,7 @@
      ;; The variable, jka-compr-compression-info-list can be used to
      ;; customize jka-compr to work with other compression programs.
      ;; The default value of this variable allows jka-compr to work with
     -;; Unix compress and gzip.
     +;; Unix compress and gzip.  David Fetter added bzip2 support :)
      ;;
      ;; If you are concerned about the stderr output of gzip and other
      ;; compression/decompression programs showing up in your buffers, you
     @@ -121,7 +121,9 @@

    ;;; I have this defined so that .Z files are assumed to be in unix
     -;;; compress format; and .gz files, in gzip format.
     +;;; compress format; and .gz files, in gzip format, and .bz2 files,
     +;;; in the snappy new bzip2 format from <url url="http://www.muraroa.demon.co.uk" name="www.muraroa.demon.co.uk" >.
     +;;; Keep up the good work, people!
      (defcustom jka-compr-compression-info-list
        ;;[regexp
        ;; compr-message  compr-prog  compr-args
     @@ -131,6 +133,10 @@
           "compressing"    "compress"     ("-c")
           "uncompressing"  "uncompress"   ("-c")
           nil t]
     +    ["\\.bz2\\'"
     +     "bzip2ing"        "bzip2"         ("")
     +     "bunzip2ing"      "bzip2"         ("-d")
     +     nil t]
          ["\\.tgz\\'"
           "zipping"        "gzip"         ("-c" "-q")
           "unzipping"      "gzip"         ("-c" "-q" "-d")

6.2 한 사람을 위해 emacs 바꾸기:

Kampsax Technology에 있는 시스템 프로그래머인 Ulrik Dickow, ukd@kampsax.dk <mailto:ukdATkampsax.dk> 에게 이것에 관해 감사한다: 당신이 시스템관리자가 아닐때 그것을 만들면 bzip2를 자동적으로 쓸 수 있다. 당신의 .emacs 파일다음에 지금 추가해라.


  ;; Automatic (un)compression on loading/saving files (gzip(1) and similar)
  ;; We start it in the off state, so that bzip2(1) support can be added.
  ;; Code thrown together by Ulrik Dickow for ~/.emacs with Emacs 19.34.
  ;; Should work with many older and newer Emacsen too.  No warranty though.
  ;;
  (if (fboundp 'auto-compression-mode) ; Emacs 19.30+
      (auto-compression-mode 0)
    (require 'jka-compr)
    (toggle-auto-compression 0))
  ;; Now add bzip2 support and turn auto compression back on.
  (add-to-list 'jka-compr-compression-info-list
               ["\\.bz2\\(~\\|\\.~[0-9]+~\\)?\\'"
                "zipping"        "bzip2"         ()
                "unzipping"      "bzip2"         ("-d")
                nil t])
  (toggle-auto-compression 1 t)


다음 이전 차례