---
title: "emacs-eaf 이맥스 애플리케이션 프레임워크 설치 및 활용법"
url: "https://notes.junghanacs.com/notes/20250407T155726"
author: "Junghan Kim"
date: "2025-04-07T15:57:00+09:00"
lastmod: "2025-04-07T15:57:00+09:00"
tags: ["bib","emacs","framework","howtouse"]
description: "Emacs Application Framework 설치와 활용법을 다시 정리해 둔 노트이다."
---

> [!abstract] 이 노트에 대하여
> 
> EAF가 Emacs에 그래픽 애플리케이션 기능을 어떻게 확장하는지, 그리고 설치 과정에서 무엇을 주의해야 하는지 다룬다. 다시 설치하고 검토할 때 참고할 수 있는 실용 노트다.

## BIBLIOGRAPHY

- “Emacs-Eaf/Emacs-Application-Framework.” 2024. <https://github.com/emacs-eaf/emacs-application-framework>.

## 히스토리

-   [2025-04-07 Mon 15:57] 설치부터 다시 정리한다. [#설치](https://notes.junghanacs.com/meta/20241014T052540)

## 관련노트

-   [@manateelazycat #이맥스 구루 eaf deno python clojure bridge](https://notes.junghanacs.com/bib/20230328T115900)
-   [junghan0611§popweb #이맥스 #애플리케이션 #프레임워크 #브라우저](https://notes.junghanacs.com/notes/20240214T164002)

## manateelazycat emacs-eaf/emacs-application-framework

([“Emacs-Eaf/Emacs-Application-Framework” 2024](https://notes.junghanacs.com/notes/20250407T155726#citeproc_bib_item_1))

-   EAF, an extensible framework that revolutionizes the graphical capabilities of Emacs

## 2025 둠이맥스 한방에 되다니?!

뭐지?! 다 소용 없던 것인가?

### 패키지 정의

```elisp
;;;; Emacs Application Framework (EAF)

(defun +eaf-install-deps-for-app(app-dir)
  "Install deps from dependencies.json."
  (let* ((deps-dict (with-temp-buffer
                      (insert-file-contents
                       (expand-file-name "dependencies.json" app-dir))
                      (json-parse-string (buffer-string))))
         (pip-deps (gethash (if IS-LINUX "linux" "darwin")
                            (or (gethash "pip" deps-dict)
                                (make-hash-table))))
         (vue-install (gethash "vue_install" deps-dict))
         (npm-install (gethash "npm_install" deps-dict))
         (npm-rebuild (gethash "npm_rebuild" deps-dict)))
    (when pip-deps
      (dolist (pkg (append pip-deps nil))
        (message "%s" (shell-command-to-string (format "pip install %s" pkg)))))
    (when vue-install
      (let ((default-directory app-dir))
        (message "%s" (shell-command-to-string "npm install"))
        (message "%s" (shell-command-to-string "npm run build"))))
    (when npm-install
      (let ((default-directory app-dir))
        (message "%s" (shell-command-to-string "npm install"))))
    (when npm-rebuild
      (let ((default-directory app-dir))
        (message "%s" (shell-command-to-string "npm rebuild"))))))

(package! eaf
  :recipe (:host github :repo "emacs-eaf/emacs-application-framework"
           :files ("*")
           :post-build
           (shell-command "/usr/bin/python install-eaf.py --install-core-deps"))) ;; use builtin python

(package! eaf-browser
  :recipe (:host github :repo "emacs-eaf/eaf-browser"
           :files ("*")
           :post-build
           (+eaf-install-deps-for-app
            (concat straight-base-dir "/straight/" straight-build-dir "/eaf-browser"))))

(package! eaf-pdf-viewer
  :recipe (:host github :repo "emacs-eaf/eaf-pdf-viewer"
           :files ("*")
           :post-build
           (+eaf-install-deps-for-app
            (concat straight-base-dir "/straight/" straight-build-dir "/eaf-pdf-viewer"))))

(package! eaf-mind-elixir
  :recipe (:host github :repo "emacs-eaf/eaf-mind-elixir"
           :files ("*")
           :post-build
           (+eaf-install-deps-for-app
            (concat straight-base-dir "/straight/" straight-build-dir "/eaf-mind-elixir"))))

```

```text
➜ ps aux | grep emacs
junghan   683052  0.0  0.0  86896  2820 ?        Ss   16:52   0:00 gpg-agent --homedir /home/junghan/doomemacs-git/.local/elpa/gpg --use-standard-socket --daemon
junghan   724682  0.0  0.0   2800  1664 ?        S    17:09   0:00 sh /home/junghan/doomemacs-git/bin/doom run
junghan   724691  0.0  0.0   2800  1664 ?        S    17:09   0:00 sh /tmp//doom.724682.0.sh /home/junghan/doomemacs-git/bin/doom run
junghan   724692 27.3  6.1 1524728 744632 ?      Sl   17:09   0:30 emacs-git
junghan   725396  2.8  2.5 3217900 310192 pts/3  Ssl+ 17:09   0:02 /usr/bin/python /home/junghan/doomemacs-git/.local/straight/build-30.1.50/eaf/eaf.py 1920 1013 33449
junghan   729245  0.0  0.0  10488  2304 pts/0    S+   17:11   0:00 grep --color=auto emacs
(base) ~ via  v20.14.0
```

### 설정

```elisp
;;; Emacs Application Framework (EAF)

;; check  'C-h v' eaf-var-list

(progn
  (setq eaf-python-command "/usr/bin/python")
  (require 'eaf)
  (require 'eaf-browser)
  (require 'eaf-pdf-viewer)
  (require 'eaf-mind-elixir)

  (add-hook 'eaf-mode-hook #'doom-mark-buffer-as-real-h)

  (progn
    ;; https://github.com/emacs-eaf/emacs-application-framework/wiki/Evil
    (require 'eaf-evil)
    (define-key key-translation-map (kbd "SPC")
                (lambda (prompt)
                  (if (derived-mode-p 'eaf-mode)
                      (pcase eaf--buffer-app-name
                        ("browser" (if  eaf-buffer-input-focus
                                       (kbd "SPC")
                                     (kbd eaf-evil-leader-key)))
                        ("pdf-viewer" (kbd eaf-evil-leader-key))
                        ("mind-elixir" (kbd eaf-evil-leader-key))
                        ;; ("image-viewer" (kbd eaf-evil-leader-key))
                        (_  (kbd "SPC")))
                    (kbd "SPC"))))
    )

  ;; See https://github.com/emacs-eaf/emacs-application-framework/wiki/Customization
  (progn
    (setq eaf-browser-translate-language "ko")

    ;; make default browser
    ;; (setq browse-url-browser-function 'eaf-open-browser)
    ;; (defalias 'browse-web #'eaf-open-browser)
    (eaf-bind-key nil "M-q" eaf-browser-keybinding) ;; unbind, see more in the Wiki

    ;; /home/junghan/sync/man/dotsamples/vanilla/gavinok-dotfiles/lisp/eaf-config.el
    (defun slurp (f)
      (with-temp-buffer
        (insert-file-contents f)
        (buffer-substring-no-properties
         (point-min)
         (point-max))))

    ;; https://www.abc.com abc
    (defun my/bm ()
      (interactive)
      (require 'eaf-browser)
      (let ((selected (completing-read
                       "Select URL: " (split-string
                                       (slurp "~/url-bookmarks.el") "\n" t))))
        (let ((url (car (split-string
                         selected
                         " " t))))
          (if (string-match-p "\\http.*\\'" url)
              ;; Open selected url
              (eaf-open-browser url)
            ;; Search entered text
            (eaf-search-it selected)))))
    (setq eaf-browser-continue-where-left-off t)
    (setq eaf-browser-dnefault-search-engine "duckduckgo")
    (setq eaf-browser-enable-adblocker "true")
    ;; (eaf-bind-key scroll_up "C-n" eaf-pdf-viewer-keybinding)
    ;; (eaf-bind-key scroll_down "C-p" eaf-pdf-viewer-keybinding)
    )
  ) ; end-of eaf

```

## 스크린샷

-   [이맥스: 조직모드 EAF 그래픽 브라우저 EWW 텍스트브라우저](https://notes.junghanacs.com/notes/20250411T064714) [2025-04-11 Fri 06:48] 의미가 커서 따로 뺀다

## 보관

### 실패: 시스템 패키지로 설치해야 동작한다
