从今天开始,Emacs里面可以运行任何你想要的程序 (Linux & Windows & Mac & BSD)

目前对which-key 如何显示描述不太了解 暂时只能这样显示

更新到最新的pymupdf以后,eaf打开pdf出现了问题:

EAF process starting... Traceback (most recent call last): File "/home/zaichuan/.emacs.d/lisp/emacs-application-framework/eaf.py", line 153, in create_app self.create_buffer(buffer_id, url, module_path, arguments) File "/home/zaichuan/.emacs.d/lisp/emacs-application-framework/eaf.py", line 166, in create_buffer module = importlib.import_module(module_path) File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 783, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/zaichuan/.emacs.d/lisp/emacs-application-framework/app/pdf-viewer/buffer.py", line 29, in <module> import fitz File "/usr/lib/python3.8/site-packages/fitz/__init__.py", line 3, in <module> from fitz.fitz import * File "/usr/lib/python3.8/site-packages/fitz/fitz.py", line 18, in <module> from . import _fitz ImportError: /usr/lib/python3.8/site-packages/fitz/_fitz.cpython-38-x86_64-linux-gnu.so: undefined symbol: jbig2_page_out

emacs 26.3

manjaro kde

这样设置,键的前缀都是对的。但是我之前设置 (set eaf-evil-leader-key "M-SPC") 前缀就不对,不是很清楚为什么

    (setq eaf-evil-leader-keymap  spacemacs-cmds)
    (setq eaf-evil-leader-key "SPC")

set 和 setq的用法不一样 set 应该这样用 (set 'eaf-evil-leader-key "M-SPC")

不好意思是我贴子发错啦,配置是没配置错的。

问题是将eaf-evil-leader-key设置成"M-SPC"which-key的前缀就会消失,但是设置成其他键,前缀就没有问题

使用eaf 一直以来还有一个问题

我窗口管理器是用的dwm,每次使用eaf-browser,我的chrome就会被冻住。使用emacs -Q 测试,也会出现这个问题,不知道有没有什么解决方案。

没遇到过,去发个Issue吧

EAF Browser按理来说与chrome没有任何关系,没用过dwm不是很清楚

我也遇到了这个问题。用 pip 更新一下 fitz 就好了。

不过我又遇到了新的问题。@MatthewZMD

Emacs 启动后第一次用 eaf 打开任意 pdf 的时候没有任何反应,*eaf* 里只显示 EAF process starting... 。 后面再打开任意 pdf 就会在 *Message* 里报错:(*eaf* 还是只显示 EAF process starting...)

dbus-call-method: D-Bus error: "Traceback (most recent call last):
  File \"/usr/lib/python3.8/site-packages/dbus/service.py\", line 711, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File \"/home/linying/.emacs.d/extensions/emacs-application-framework/eaf.py\", line 106, in new_buffer
    return self.create_app(buffer_id, str(url), \"app.{0}.buffer\".format(str(app_name)), str(arguments))
  File \"/home/linying/.emacs.d/extensions/emacs-application-framework/eaf.py\", line 153, in create_app
    self.create_buffer(buffer_id, url, module_path, arguments)
  File \"/home/linying/.emacs.d/extensions/emacs-application-framework/eaf.py\", line 166, in create_buffer
    module = importlib.import_module(module_path)
  File \"/usr/lib/python3.8/importlib/__init__.py\", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File \"<frozen importlib._bootstrap>\", line 1014, in _gcd_import
  File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load
  File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked
  File \"<frozen importlib._bootstrap>\", line 671, in _load_unlocked
  File \"<frozen importlib._bootstrap_external>\", line 783, in exec_module
  File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed
  File \"/home/linying/.emacs.d/extensions/emacs-application-framework/app/pdf-viewer/buffer.py\", line 29, in <module>
    import fitz
  File \"/home/linying/.local/lib/python3.8/site-packages/fitz/__init__.py\", line 1, in <module>
    from frontend import *
  File \"/home/linying/.local/lib/python3.8/site-packages/frontend/__init__.py\", line 1, in <module>
    from .events import *
  File \"/home/linying/.local/lib/python3.8/site-packages/frontend/events/__init__.py\", line 1, in <module>
    from .clipboard import *
  File \"/home/linying/.local/lib/python3.8/site-packages/frontend/events/clipboard.py\", line 2, in <module>
    from ..dom import Event
  File \"/home/linying/.local/lib/python3.8/site-packages/frontend/dom.py\", line 439, in <module>
    from . import dispatcher
  File \"/home/linying/.local/lib/python3.8/site-packages/frontend/dispatcher.py\", line 15, in <module>
    from . import config, server
  File \"/home/linying/.local/lib/python3.8/site-packages/frontend/server.py\", line 24, in <module>
    app.mount(config.STATIC_ROUTE, StaticFiles(directory=config.STATIC_DIRECTORY), name=config.STATIC_NAME)
  File \"/home/linying/.local/lib/python3.8/site-packages/starlette/staticfiles.py\", line 55, in __init__
    raise RuntimeError(f\"Directory '{directory}' does not exist\")
RuntimeError: Directory 'static/' does not exist

然后就没反应了。

试试 pip install frontend 之前我也遇到这个

Session is not restored, as no data about /home/feng/桌面/pandas.pdf.
Traceback (most recent call last):
  File "/home/feng/projects/emacs-packages/emacs-application-framework/app/pdf-viewer/buffer.py", line 462, in paintEvent
    qpixmap = self.get_page_pixmap(index, self.scale)
  File "/home/feng/projects/emacs-packages/emacs-application-framework/app/pdf-viewer/buffer.py", line 350, in get_page_pixmap
    imagelist = page.getImageList(full=True)
TypeError: getImageList() got an unexpected keyword argument 'full'
EAF process starting...
Session is not restored, as no data about /home/feng/桌面/pandas.pdf.
Traceback (most recent call last):
  File "/home/feng/projects/emacs-packages/emacs-application-framework/app/pdf-viewer/buffer.py", line 462, in paintEvent
    qpixmap = self.get_page_pixmap(index, self.scale)
  File "/home/feng/projects/emacs-packages/emacs-application-framework/app/pdf-viewer/buffer.py", line 350, in get_page_pixmap
    imagelist = page.getImageList(full=True)
TypeError: getImageList() got an unexpected keyword argument 'full'

pdf 浏览器好像挂了。。。

刚才写了一个命令,帮助有些用户有时候需要在EAF浏览器和Firefox/Chrome 设置之间切换的场景。

(defun eaf-toggle-default-browser ()
    "Toggle overriding default web browser with EAF web browser."
    (interactive)
    (if (eq browse-url-browser-function (default-value 'browse-url-browser-function))
        (progn
          (setq browse-url-browser-function 'eaf-open-browser)
          (message "Now setting default browser to EAF Web Browser."))
      (setq browse-url-browser-function (default-value 'browse-url-browser-function))
      (message "Now revert default browser to your default function.")))

欢迎报issue

欢迎报issue

贡献个目录跳转的命令给ivy用户

(defun counsel-eaf-pdf-outline-jump (toc)
  (interactive)
  (let ((page-num (replace-regexp-in-string "\n" "" (car (last (s-split " " toc))))))
    ;; Jump to page.
    (eaf-call "call_function_with_args" eaf--buffer-id "jump_to_page_with_num" (format "%s" page-num))
    ))

(defun counsel-eaf-pdf-outline ()
  (interactive)
  (let ((tocs (split-string (eaf-call "call_function" eaf--buffer-id "get_toc") "\n"))
        (page-number (string-to-number (eaf-call "call_function" eaf--buffer-id "current_page")))
        (preselect 0))

    (dolist (toc tocs)
      (when (< (string-to-number (replace-regexp-in-string "\n" "" (car (last (s-split " " toc))))) page-number)
        (setq preselect (1+ preselect)))
      )
    (ivy-read "Table of contents: " tocs
              :preselect preselect
              :action '(1
                        ("o" counsel-eaf-pdf-outline-jump "jump to content")
                        )
              :caller 'counsel-eaf-pdf-outline
              )
    ))
(advice-add 'eaf-pdf-outline :override #'counsel-eaf-pdf-outline)

可以修改ivy-re-builders-alist以支持拼音首字母跳转,看中文文档时更方便。

@manateelazycat 我看您在 #52 中提到eaf不能在gnome3 的桌面环境下使用,也就是说eaf 不能在ubuntu 18.04 以及以后的版本中使用吗,因为ubuntu在18.04以后用的是gnome3了?

已经可以支持wayland和gnome3了

真希望能够支持 Mac……

希望添加和Snails一样的渲染环境检测

Snails render candidates in new frame that only can be run in a graphical environment.

这个很简单,欢迎提PR