소스 검색

Update

master
10sr 6 년 전
부모
커밋
54a198ba3d
로그인 계정: 10sr GPG 키 ID: 7BEC428194130EB2
1개의 변경된 파일32개의 추가작업 그리고 7개의 파일을 삭제
  1. +32
    -7
      emacs.el

+ 32
- 7
emacs.el 파일 보기

@@ -1718,7 +1718,7 @@ This mode is a simplified version of `adoc-mode'."

(defcustom awk-preview-default-program
"{
print $0
print NR, $0
}
"
"Default awk command."
@@ -1740,6 +1740,11 @@ This mode is a simplified version of `adoc-mode'."
Used by preview buffer and always same as awk-preview--point-beg.")
(make-variable-buffer-local 'awk-preview--preview-point-beg)

(defvar awk-preview--program-filename
nil
"Awk preview program file name.")
(make-variable-buffer-local 'awk-preview--program-filename)

(defvar awk-preview--source-buffer
nil
"Awk source buffer.")
@@ -1794,9 +1799,20 @@ Return that buffer."
(setq awk-preview--source-buffer source)
(setq awk-preview--preview-buffer preview)
(setq awk-preview--program-buffer (current-buffer))
(unless buffer-file-name
(setq awk-preview--program-filename (make-temp-file "awk-preview-"
nil
".awk")))

(current-buffer))))

(defun awk-preview-program-buffer-kill-hook ()
"Cleanup for awk-preview program buffer."
(when awk-preview--program-filename
(delete-file awk-preview--program-filename)))
(add-hook 'kill-buffer-hook
'awk-preview-program-buffer-kill-hook)

(defun awk-preview--create-preview-buffer (source)
"Create preview buffer of SOURCE buffer and return it."
(with-current-buffer source
@@ -1840,15 +1856,24 @@ Return that buffer."

(switch-to-buffer awk-preview--program-buffer)

)

(defun awk-preview-update ()
"Update awk preview."
(interactive)
(let ((output (with-current-buffer (get-buffer-create " *awk-preview output*")
(erase-buffer)
(current-buffer))))
(awk-preview--invoke-awk awk-preview--source-buffer beg end output)
(with-current-buffer awk-preview--preview-buffer
(delete-region awk-preview--preview-point-beg (point))
(insert (with-current-buffer output
(buffer-substring-no-properties (point-min) (point-max)))))
))
(with-current-buffer awk-preview--source-buffer
(awk-preview--invoke-awk (current-buffer)
awk-preview--point-beg
awk-preview--point-end
output)
(with-current-buffer awk-preview--preview-buffer
(delete-region awk-preview--preview-point-beg (point))
(insert (with-current-buffer output
(buffer-substring-no-properties (point-min) (point-max)))))
)))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


불러오는 중...
취소
저장