DogLooksGood / parinfer-mode

Parinfer for Emacs :)
GNU General Public License v3.0
407 stars 33 forks source link

Emacs (mac): Inspection of the parenthesis pairs with cursor movement is not working. #53

Closed ghost closed 6 years ago

ghost commented 6 years ago

I just install Parinfer for Emacs and i can’t find out how set on the inspection of parens. You know, the little underscore and the background color to the closing (or opening) paren that indicates a pair of parens around an expression. Although in ATOM it works fine and without any special instructions, in Emacs is not working at all.

The lines added in .emacs file are as follows:

;; Parinfer setup.
(use-package parinfer
  :ensure t
  :bind
  (("C-," . parinfer-toggle-mode))
  :init
  (progn
    (setq parinfer-extensions
          '(defaults         ; should be included.
         pretty-parens   ; different paren styles for different modes.
         ;evil            ; If you use Evil.
         ;lispy           ; If you use Lispy. With this extension, you should install Lispy and do not enable lispy-mode directly. (disabled. not installed yet.)
         ;paredit         ; Introduce some paredit commands. (disabled. not installed yet.)
         smart-tab       ; C-b & C-f jump positions and smart shift with tab & S-tab.
         smart-yank))      ; Yank behavior depend on mode.

    (setq parinfer-auto-switch-indent-mode nil)  ;; default
    (setq parinfer-auto-switch-indent-mode-when-closing nil)  ;; default
    (setq parinfer-delay-invoke-threshold 6000)  ;; default
    (setq parinfer-delay-invoke-idle 0.3)  ;; default
    (setq parinfer-lighters '(" Parinfer:Indent" . "Parinfer:Paren"))
    (add-hook 'clojure-mode-hook #'parinfer-mode)
    (add-hook 'emacs-lisp-mode-hook #'parinfer-mode)
    (add-hook 'common-lisp-mode-hook #'parinfer-mode)
    (add-hook 'scheme-mode-hook #'parinfer-mode)
    (add-hook 'lisp-mode-hook #'parinfer-mode)))
DogLooksGood commented 6 years ago

I think this is what you want?

(use-package highlight-parentheses
    :init
    (add-hook 'clojure-mode-hook 'highlight-parentheses-mode)
    (add-hook 'emacs-lisp-mode-hook 'highlight-parentheses-mode))
ghost commented 6 years ago

Should i delete the old code and replace it with this? I'm using emacs to write common lisp. Sorry about all these questions but i'm a newbie.

DogLooksGood commented 6 years ago

Parinfer is designed to provide parens inference. If you want paren inspection, the package highlight-parentheses does it.

(use-package highlight-parentheses
    :init
    (add-hook 'common-lisp-mode-hook 'highlight-parentheses-mode))

Additional adding this should work.

ghost commented 6 years ago

Thank you very much Tianshu. I'll try it and get back to you tomorrow

ghost commented 6 years ago

Ok Tianshu, you were right. I tried and it works. It's not quite useful though. I'm trying to find the package used to inspect the parens in https://shaunlebron.github.io/parinfer/#editor-plugins github presentation. It's the one that working also in Atom editor when you install Atom-Slime and Parinfer.

Do you have any more info about this?

Thank you.

DogLooksGood commented 6 years ago

@nicon-git Hi, I have no experience with other parentheses highlighting plugins.

There's a lot plugins can provide you all kinds of features, you have to explore by yourself:)

ghost commented 6 years ago

Hi! I manage to emulate the behavior i wanted, from within emacs. So, it's ok.

Thank you very much for your help1

nicon