Привязка клавиш в режиме трезубца в Emacs не активируется

Я новичок в Emacs. Я пытаюсь использовать режим трезубца (для Parenscript). Я скопировал команды с сайта trident-site-here-here в свой файл init.el. А вот сочетания клавиш Cc Ce в режиме трезубца не работают. Я копирую свой полный файл init.el ниже:


;; Added by Package.el.  This must come before configurations of
;; installed packages.  Don't delete this line.  If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.

;;;; Added from Melpa.org

(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
                    (not (gnutls-available-p))))
       (proto (if no-ssl "http" "https")))
  (when no-ssl (warn "\
Your version of Emacs does not support SSL connections,
which is unsafe because it allows man-in-the-middle attacks.
There are two things you can do about this warning:
1. Install an Emacs version that does support SSL and be safe.
2. Remove this warning from your init file so you won't see it again."))
  (add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
  ;; Comment/uncomment this line to enable MELPA Stable if desired.  See `package-archive-priorities`
  ;; and `package-pinned-packages`. Most users will not need or want to do this.
  ;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
  )
; Commented coz it is there in the next line (package-initialize)

;;;; End Melpa.ord addition

(package-initialize)

(load (expand-file-name "~/quicklisp/slime-helper.el"))
;; Replace "sbcl" with the path to your implementation
(setq inferior-lisp-program "sbcl")

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-selected-packages (quote (trident-mode))))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(default ((t (:family "DejaVu Sans Mono" :foundry "PfEd" :slant normal :weight normal :height 158 :width normal)))))

;;; From Trident-model.el site on Github

(add-to-list 'auto-mode-alist (cons "\\.paren\\'" 'lisp-mode))
(add-hook 'lisp-mode-hook
          #'(lambda ()
              (when (and buffer-file-name
                         (string-match-p "\\.paren\\>" buffer-file-name))
                (unless (slime-connected-p)
                  (save-excursion (slime)))
                (trident-mode +1))))


;;;; From same site, key bindings

(trident-add-keys-with-prefix "C-c C-e")

;; The key sequence for trident-eval-region is "e r", so it's now bound to "C-c C-e er" 

**This is What is Not getting Activated**


Одна вещь, которую я наблюдаю, если открываю файл.paren, заключается в том, что буфер repl оказывается наверху, а буфер файла (где показан файл.paren) опускается ниже. Я не знаю, как это исправить. Но я поменял их местами, щелкнув имена буферов, чтобы изменить их. Не знаю, актуально ли это, но пишу на всякий случай, если в этом виноват. Если возможно, я бы предпочел обычную настройку (текст программы вверху и буфер реплика внизу).

Что я делаю неправильно? Спасибо за помощь.

Edit-1: Я добавил ссылку на сайт режима трезубца.

1 ответ

Спасибо, ответ phils Филса сработал.

Я публикую внесенное мной изменение:

Раньше я использовал:

(trident-add-keys-with-prefix "C-c C-e")

Это не сработало. По предложению Фила я заменил эту строку на

(with-eval-after-load "trident-mode" (trident-add-keys-with-prefix "C-c C-e"))

Это сработало.

Я новичок, поэтому подробно изложил, казалось бы, простой / очевидный ответ. Это поможет другим новичкам вроде меня. Мы можем запутаться в самых мелочах.:-)

phils, еще раз спасибо.

Другие вопросы по тегам