Skip to content

Instantly share code, notes, and snippets.

@zeronone
Last active May 18, 2020 14:02
Show Gist options
  • Save zeronone/df94cfe1ca35f1c55d7f6936b64a6725 to your computer and use it in GitHub Desktop.
Save zeronone/df94cfe1ca35f1c55d7f6936b64a6725 to your computer and use it in GitHub Desktop.

How to run

# accept the certificates when prompted
# After "Compile complete" is printed, close the first emacs (C-x C-c)

$ docker run -ti -v $PWD/compile.el:/root/compile.el -v $PWD/test.el:/root/test.el andreacorallo/emacs-nativecomp bash -c "emacs -q -Q -L /root/lisp --load compile.el && emacs -q -Q -L /root/lisp --load test.el"
Fatal error 11: Segmentation fault
^[[IBacktrace:
emacs[0x52034e]
emacs[0x421ee7]
emacs[0x42237b]
emacs[0x51e9e8]
emacs[0x51ea59]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12730)[0x7f1e24452730]
emacs[0x561c8f]
emacs[0x561e7e]
emacs[0x561e7e]
emacs[0x561cd0]
emacs[0x561e7e]
emacs[0x561e7e]
emacs[0x561cd0]
emacs[0x561e7e]
emacs[0x561e7e]
emacs[0x561cd0]
emacs[0x56297e]
emacs[0x561e7e]
emacs[0x562365]
emacs[0x561cc7]
emacs[0x56297e]
emacs[0x561cc7]
emacs[0x56297e]
emacs[0x561cc7]
emacs[0x56297e]
emacs[0x561cc7]
emacs[0x561e7e]
emacs[0x56297e]
emacs[0x56297e]
emacs[0x561cc7]
emacs[0x56297e]
emacs[0x561e7e]
emacs[0x562365]
emacs[0x561cc7]
emacs[0x56297e]
emacs[0x561cc7]
emacs[0x56297e]
emacs[0x561cc7]
emacs[0x56297e]
emacs[0x561cc7]
emacs[0x561e7e]
...

(message load-file-name)
(message (file-name-directory load-file-name))
(setq user-emacs-directory (file-name-directory load-file-name))
;; Set up package.el to work with MELPA
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(package-initialize)
(package-refresh-contents)
;; Download Evil
(unless (package-installed-p 'evil)
(package-install 'evil))
(unless (file-expand-wildcards "./elpa/evil-20200516.1740/eln*/*.eln")
(message "Not compiled, will compile")
(native-compile "./elpa/evil-20200516.1740/evil-commands.el")
(message "Compile complete"))
(kill-emacs)
(message load-file-name)
(message (file-name-directory load-file-name))
(setq user-emacs-directory (file-name-directory load-file-name))
;; Set up package.el to work with MELPA
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(package-initialize)
(package-refresh-contents)
(with-current-buffer (get-buffer-create "test-buffer")
;; Enable Evil
(require 'evil)
(evil-mode 1)
(insert "1Hello, World\n")
(insert "2Hello, World\n")
(insert "3Hello, World\n")
(goto-char (point-min))
;; evil-next-line works
(evil-next-line)
(message (thing-at-point 'word))
(goto-char (point-min))
;; this cases segfault
(evil-visual-block)
(call-interactively 'evil-insert)
(message (buffer-substring (point-min) (point-max))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment