Skip to content

A few questions about configuring smartparens package. #1070

@hongyi-zhao

Description

@hongyi-zhao

On Ubuntu 20.10, I use the latest git master version of Emacs and installed the lastest smartparens from melpa with the following settings in my ~/.emacs.d/init.el:

(use-package smartparens-config
  :ensure smartparens
  :config (progn (show-smartparens-global-mode t)))
(add-hook 'prog-mode-hook #'smartparens-strict-mode)
(setq sp-navigate-close-if-unbalanced t)

The above setting seems to be working smoothly. But I still can't understand a few questions as described below:

  1. Based on my tries, all the following forms are equivalent:
(add-hook 'prog-mode-hook 'turn-on-smartparens-strict-mode)
(add-hook 'prog-mode-hook 'smartparens-strict-mode)
(add-hook 'prog-mode-hook #'smartparens-strict-mode)

Why?

  1. As you can see, the above settings only activate the smartparens-strict-mode conditionally for prog-mode. If I want to always activate this mode in any case globally. What setting should I use?

  2. Are the following two instructions equivalent:

(require 'smartparens-config)

and

(use-package smartparens-config

Regards,
HY

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions