Update parinfer module to comply with review.
Also add support for BSD systems. Signed-off-by: Johan Thoren <johan@thoren.xyz>
This commit is contained in:
parent
ec747395c6
commit
4ff23752f2
3 changed files with 59 additions and 43 deletions
|
@ -1,7 +1,7 @@
|
||||||
;;; editor/parinfer/config.el -*- lexical-binding: t; -*-
|
;;; editor/parinfer/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(if (not (featurep! +rust))
|
(use-package! parinfer
|
||||||
(use-package! parinfer
|
:unless (featurep! +rust)
|
||||||
:hook ((emacs-lisp-mode
|
:hook ((emacs-lisp-mode
|
||||||
clojure-mode
|
clojure-mode
|
||||||
scheme-mode
|
scheme-mode
|
||||||
|
@ -22,14 +22,10 @@
|
||||||
:i "<tab>" #'parinfer-smart-tab:dwim-right-or-complete
|
:i "<tab>" #'parinfer-smart-tab:dwim-right-or-complete
|
||||||
:i "<backtab>" #'parinfer-smart-tab:dwim-left
|
:i "<backtab>" #'parinfer-smart-tab:dwim-left
|
||||||
:localleader
|
:localleader
|
||||||
:desc "Toggle parinfer-mode" "m" #'parinfer-toggle-mode))
|
"m" #'parinfer-toggle-mode))
|
||||||
(defvar parinfer-rust--doom-lib-name (cond ((eq system-type 'darwin)
|
(use-package! parinfer-rust-mode
|
||||||
"parinfer-rust-darwin.so")
|
:when (featurep! +rust)
|
||||||
((eq system-type 'gnu/linux)
|
:when (bound-and-true-p module-file-suffix)
|
||||||
"parinfer-rust-linux.so")
|
|
||||||
((eq system-type 'windows-nt)
|
|
||||||
"parinfer-rust-windows.dll")))
|
|
||||||
(use-package! parinfer-rust-mode
|
|
||||||
:hook ((emacs-lisp-mode
|
:hook ((emacs-lisp-mode
|
||||||
clojure-mode
|
clojure-mode
|
||||||
scheme-mode
|
scheme-mode
|
||||||
|
@ -37,12 +33,19 @@
|
||||||
racket-mode
|
racket-mode
|
||||||
hy-mode) . parinfer-rust-mode)
|
hy-mode) . parinfer-rust-mode)
|
||||||
:init
|
:init
|
||||||
(setq! parinfer-rust-library (concat user-emacs-directory
|
(setq! parinfer-rust-library
|
||||||
|
(concat user-emacs-directory
|
||||||
".local/etc/parinfer-rust/"
|
".local/etc/parinfer-rust/"
|
||||||
parinfer-rust--doom-lib-name))
|
(cond ((eq system-type 'darwin) "parinfer-rust-darwin.so")
|
||||||
|
((eq system-type 'gnu/linux) "parinfer-rust-linux.so")
|
||||||
|
((eq system-type 'windows-nt) "parinfer-rust-windows.dll")
|
||||||
|
((eq system-type 'berkeley-unix "libparinfer_rust.so"))))
|
||||||
|
parinfer-rust-auto-download
|
||||||
|
(if (eq system-type 'berkeley-unix)
|
||||||
|
nil
|
||||||
|
t))
|
||||||
:config
|
:config
|
||||||
(map! :map parinfer-rust-mode-map
|
(map! :map parinfer-rust-mode-map
|
||||||
:localleader
|
:localleader
|
||||||
:desc "Switch parinfer-rust-mode" "m" #'parinfer-rust-switch-mode
|
"m" #'parinfer-rust-switch-mode
|
||||||
:desc "Temporarily disable parinfer-rust-mode" "M"
|
"M" #'parinfer-rust-toggle-disable))
|
||||||
#'parinfer-rust-switch-mode)))
|
|
||||||
|
|
11
modules/editor/parinfer/doctor.el
Normal file
11
modules/editor/parinfer/doctor.el
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
;;; editor/parinfer/doctor.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
(when (featurep! +rust)
|
||||||
|
(unless (fboundp 'module-load)
|
||||||
|
(warn! "Your emacs wasn't built with dynamic modules support. `parinfer-rust-mode' won't work"))
|
||||||
|
(when (and (eq system-type 'berkeley-unix)
|
||||||
|
(not (file-readable-p
|
||||||
|
(concat user-emacs-directory ".local/etc/parinfer-rust/libparinfer_rust.so"))))
|
||||||
|
(warn! (concat "Could not read " user-emacs-directory
|
||||||
|
".local/etc/parinfer-rust/libparinfer_rust.so. "
|
||||||
|
"`parinfer-rust-mode' won't work"))))
|
|
@ -13,4 +13,6 @@
|
||||||
|
|
||||||
(if (featurep! +rust)
|
(if (featurep! +rust)
|
||||||
(package! parinfer-rust-mode :pin "c825606e6aca4a2ed18c0af321df5f36a3c8c774")
|
(package! parinfer-rust-mode :pin "c825606e6aca4a2ed18c0af321df5f36a3c8c774")
|
||||||
(package! parinfer :pin "8659c99a9475ee34af683fdf8f272728c6bebb3a"))
|
(package! parinfer
|
||||||
|
:recipe (:host github :repo "emacsattic/parinfer")
|
||||||
|
:pin "8659c99a9475ee34af683fdf8f272728c6bebb3a"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue