syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.64k stars 4.89k forks source link

Keep seeing an error about `(void-function smartparens-mode)` #14439

Closed ilyagr closed 2 years ago

ilyagr commented 3 years ago

Description :octocat:

I keep getting errors saying File mode specification error: (void-function smartparens-mode) in the messages buffer after I load a file. Similar messages about something smartparens-related being void appear at other times as well, for instance after running some commands with helm-M-X (don't remember the exact wording).

I'm not sure if they cause any harm. The message was often on the screen when something went wrong, but on further investigation, the problem was usually unrelated.

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart: The message may or may not be visible on screen after Emacs loads, but it's always in the messages buffer.

Expected behaviour: :heart: :smile: No error.

Workaround: :smile: Putting (require 'smartparens) in my dotspacemacs/user-config function fixes the problem. When doing so, I can no longer disable colorful parentheses, though.

System Info :computer:

More details :paw_prints:

Here is my complete .spacemacs:

``` ;; -*- mode: emacs-lisp; lexical-binding: t -*- ;; This file is loaded by Spacemacs at startup. ;; It must be stored in your home directory. (defun dotspacemacs/layers () "Layer configuration: This function should only modify configuration layer settings." (setq-default ;; Base distribution to use. This is a layer contained in the directory ;; `+distribution'. For now available distributions are `spacemacs-base' ;; or `spacemacs'. (default 'spacemacs) dotspacemacs-distribution 'spacemacs ;; Lazy installation of layers (i.e. layers are installed only when a file ;; with a supported type is opened). Possible values are `all', `unused' ;; and `nil'. `unused' will lazy install only unused layers (i.e. layers ;; not listed in variable `dotspacemacs-configuration-layers'), `all' will ;; lazy install any layer that support lazy installation even the layers ;; listed in `dotspacemacs-configuration-layers'. `nil' disable the lazy ;; installation feature and you have to explicitly list a layer in the ;; variable `dotspacemacs-configuration-layers' to install it. ;; (default 'unused) dotspacemacs-enable-lazy-installation 'unused ;; If non-nil then Spacemacs will ask for confirmation before installing ;; a layer lazily. (default t) dotspacemacs-ask-for-lazy-installation t ;; List of additional paths where to look for configuration layers. ;; Paths must have a trailing slash (i.e. `~/.mycontribs/') dotspacemacs-configuration-layer-path '() ;; List of configuration layers to load. dotspacemacs-configuration-layers '( ;; ---------------------------------------------------------------- ;; Example of useful layers you may want to use right away. ;; Uncomment some layer names and press `SPC f e R' (Vim style) or ;; `M-m f e R' (Emacs style) to install them. ;; ---------------------------------------------------------------- auto-completion ;; better-defaults ;; Emacs style only emacs-lisp git helm html ;; lsp ;; c-c++ markdown multiple-cursors org ;; spacemacs-editing ;; Trying to fix smartparens-mode error ;; (shell :variables ;; shell-default-height 30 ;; shell-default-position 'bottom) ;; spell-checking ;; syntax-checking ;; version-control treemacs) ;; List of additional packages that will be installed without being wrapped ;; in a layer (generally the packages are installed only and should still be ;; loaded using load/require/use-package in the user-config section below in ;; this file). If you need some configuration for these packages, then ;; consider creating a layer. You can also put the configuration in ;; `dotspacemacs/user-config'. To use a local version of a package, use the ;; `:location' property: '(your-package :location "~/path/to/your-package/") ;; Also include the dependencies as they will not be resolved automatically. dotspacemacs-additional-packages '() ;; A list of packages that cannot be updated. dotspacemacs-frozen-packages '() ;; A list of packages that will not be installed and loaded. dotspacemacs-excluded-packages '() ;; Defines the behaviour of Spacemacs when installing packages. ;; Possible values are `used-only', `used-but-keep-unused' and `all'. ;; `used-only' installs only explicitly used packages and deletes any unused ;; packages as well as their unused dependencies. `used-but-keep-unused' ;; installs only the used packages but won't delete unused ones. `all' ;; installs *all* packages supported by Spacemacs and never uninstalls them. ;; (default is `used-only') dotspacemacs-install-packages 'used-only)) (defun dotspacemacs/init () "Initialization: This function is called at the very beginning of Spacemacs startup, before layer configuration. It should only modify the values of Spacemacs settings." ;; This setq-default sexp is an exhaustive list of all the supported ;; spacemacs settings. (setq-default ;; If non-nil then enable support for the portable dumper. You'll need ;; to compile Emacs 27 from source following the instructions in file ;; EXPERIMENTAL.org at to root of the git repository. ;; (default nil) dotspacemacs-enable-emacs-pdumper nil ;; Name of executable file pointing to emacs 27+. This executable must be ;; in your PATH. ;; (default "emacs") dotspacemacs-emacs-pdumper-executable-file "emacs" ;; Name of the Spacemacs dump file. This is the file will be created by the ;; portable dumper in the cache directory under dumps sub-directory. ;; To load it when starting Emacs add the parameter `--dump-file' ;; when invoking Emacs 27.1 executable on the command line, for instance: ;; ./emacs --dump-file=$HOME/.emacs.d/.cache/dumps/spacemacs-27.1.pdmp ;; (default (format "spacemacs-%s.pdmp" emacs-version)) dotspacemacs-emacs-dumper-dump-file (format "spacemacs-%s.pdmp" emacs-version) ;; If non-nil ELPA repositories are contacted via HTTPS whenever it's ;; possible. Set it to nil if you have no way to use HTTPS in your ;; environment, otherwise it is strongly recommended to let it set to t. ;; This variable has no effect if Emacs is launched with the parameter ;; `--insecure' which forces the value of this variable to nil. ;; (default t) dotspacemacs-elpa-https t ;; Maximum allowed time in seconds to contact an ELPA repository. ;; (default 5) dotspacemacs-elpa-timeout 5 ;; Set `gc-cons-threshold' and `gc-cons-percentage' when startup finishes. ;; This is an advanced option and should not be changed unless you suspect ;; performance issues due to garbage collection operations. ;; (default '(100000000 0.1)) dotspacemacs-gc-cons '(100000000 0.1) ;; Set `read-process-output-max' when startup finishes. ;; This defines how much data is read from a foreign process. ;; Setting this >= 1 MB should increase performance for lsp servers ;; in emacs 27. ;; (default (* 1024 1024)) dotspacemacs-read-process-output-max (* 1024 1024) ;; If non-nil then Spacelpa repository is the primary source to install ;; a locked version of packages. If nil then Spacemacs will install the ;; latest version of packages from MELPA. Spacelpa is currently in ;; experimental state please use only for testing purposes. ;; (default nil) dotspacemacs-use-spacelpa nil ;; If non-nil then verify the signature for downloaded Spacelpa archives. ;; (default t) dotspacemacs-verify-spacelpa-archives t ;; If non-nil then spacemacs will check for updates at startup ;; when the current branch is not `develop'. Note that checking for ;; new versions works via git commands, thus it calls GitHub services ;; whenever you start Emacs. (default nil) dotspacemacs-check-for-update nil ;; If non-nil, a form that evaluates to a package directory. For example, to ;; use different package directories for different Emacs versions, set this ;; to `emacs-version'. (default 'emacs-version) dotspacemacs-elpa-subdirectory 'emacs-version ;; One of `vim', `emacs' or `hybrid'. ;; `hybrid' is like `vim' except that `insert state' is replaced by the ;; `hybrid state' with `emacs' key bindings. The value can also be a list ;; with `:variables' keyword (similar to layers). Check the editing styles ;; section of the documentation for details on available variables. ;; (default 'vim) dotspacemacs-editing-style 'vim ;; If non-nil show the version string in the Spacemacs buffer. It will ;; appear as (spacemacs version)@(emacs version) ;; (default t) dotspacemacs-startup-buffer-show-version t ;; Specify the startup banner. Default value is `official', it displays ;; the official spacemacs logo. An integer value is the index of text ;; banner, `random' chooses a random text banner in `core/banners' ;; directory. A string value must be a path to an image format supported ;; by your Emacs build. ;; If the value is nil then no banner is displayed. (default 'official) dotspacemacs-startup-banner 'official ;; List of items to show in startup buffer or an association list of ;; the form `(list-type . list-size)`. If nil then it is disabled. ;; Possible values for list-type are: ;; `recents' `recents-by-project' `bookmarks' `projects' `agenda' `todos'. ;; List sizes may be nil, in which case ;; `spacemacs-buffer-startup-lists-length' takes effect. ;; The exceptional case is `recents-by-project', where list-type must be a ;; pair of numbers, e.g. `(recents-by-project . (7 . 5))', where the first ;; number is the project limit and the second the limit on the recent files ;; within a project. dotspacemacs-startup-lists '((recents . 5) (projects . 7)) ;; True if the home buffer should respond to resize events. (default t) dotspacemacs-startup-buffer-responsive t ;; Default major mode for a new empty buffer. Possible values are mode ;; names such as `text-mode'; and `nil' to use Fundamental mode. ;; (default `text-mode') dotspacemacs-new-empty-buffer-major-mode 'text-mode ;; Default major mode of the scratch buffer (default `text-mode') dotspacemacs-scratch-mode 'text-mode ;; If non-nil, *scratch* buffer will be persistent. Things you write down in ;; *scratch* buffer will be saved and restored automatically. dotspacemacs-scratch-buffer-persistent nil ;; If non-nil, `kill-buffer' on *scratch* buffer ;; will bury it instead of killing. dotspacemacs-scratch-buffer-unkillable nil ;; Initial message in the scratch buffer, such as "Welcome to Spacemacs!" ;; (default nil) dotspacemacs-initial-scratch-message nil ;; List of themes, the first of the list is loaded when spacemacs starts. ;; Press `SPC T n' to cycle to the next theme in the list (works great ;; with 2 themes variants, one dark and one light) dotspacemacs-themes '(spacemacs-dark spacemacs-light) ;; Set the theme for the Spaceline. Supported themes are `spacemacs', ;; `all-the-icons', `custom', `doom', `vim-powerline' and `vanilla'. The ;; first three are spaceline themes. `doom' is the doom-emacs mode-line. ;; `vanilla' is default Emacs mode-line. `custom' is a user defined themes, ;; refer to the DOCUMENTATION.org for more info on how to create your own ;; spaceline theme. Value can be a symbol or list with additional properties. ;; (default '(spacemacs :separator wave :separator-scale 1.5)) dotspacemacs-mode-line-theme '(spacemacs :separator wave :separator-scale 1.5) ;; If non-nil the cursor color matches the state color in GUI Emacs. ;; (default t) dotspacemacs-colorize-cursor-according-to-state t ;; Default font or prioritized list of fonts. The `:size' can be specified as ;; a non-negative integer (pixel size), or a floating-point (point size). ;; Point size is recommended, because it's device independent. (default 10.0) dotspacemacs-default-font '("Noto Mono" :size 11.5 :weight normal :width normal) ;; The leader key (default "SPC") dotspacemacs-leader-key "SPC" ;; The key used for Emacs commands `M-x' (after pressing on the leader key). ;; (default "SPC") dotspacemacs-emacs-command-key "SPC" ;; The key used for Vim Ex commands (default ":") dotspacemacs-ex-command-key ":" ;; The leader key accessible in `emacs state' and `insert state' ;; (default "M-m") dotspacemacs-emacs-leader-key "M-m" ;; Major mode leader key is a shortcut key which is the equivalent of ;; pressing ` m`. Set it to `nil` to disable it. (default ",") dotspacemacs-major-mode-leader-key nil ;; "C-`" ;; Major mode leader key accessible in `emacs state' and `insert state'. ;; (default "C-M-m" for terminal mode, "" for GUI mode). ;; Thus M-RET should work as leader key in both GUI and terminal modes. ;; C-M-m also should work in terminal mode, but not in GUI mode. dotspacemacs-major-mode-emacs-leader-key (if window-system "" "C-M-m") ;; These variables control whether separate commands are bound in the GUI to ;; the key pairs `C-i', `TAB' and `C-m', `RET'. ;; Setting it to a non-nil value, allows for separate commands under `C-i' ;; and TAB or `C-m' and `RET'. ;; In the terminal, these pairs are generally indistinguishable, so this only ;; works in the GUI. (default nil) dotspacemacs-distinguish-gui-tab nil ;; Name of the default layout (default "Default") dotspacemacs-default-layout-name "Default" ;; If non-nil the default layout name is displayed in the mode-line. ;; (default nil) dotspacemacs-display-default-layout nil ;; If non-nil then the last auto saved layouts are resumed automatically upon ;; start. (default nil) dotspacemacs-auto-resume-layouts nil ;; If non-nil, auto-generate layout name when creating new layouts. Only has ;; effect when using the "jump to layout by number" commands. (default nil) dotspacemacs-auto-generate-layout-names nil ;; Size (in MB) above which spacemacs will prompt to open the large file ;; literally to avoid performance issues. Opening a file literally means that ;; no major mode or minor modes are active. (default is 1) dotspacemacs-large-file-size 1 ;; Location where to auto-save files. Possible values are `original' to ;; auto-save the file in-place, `cache' to auto-save the file to another ;; file stored in the cache directory and `nil' to disable auto-saving. ;; (default 'cache) dotspacemacs-auto-save-file-location 'cache ;; Maximum number of rollback slots to keep in the cache. (default 5) dotspacemacs-max-rollback-slots 5 ;; If non-nil, the paste transient-state is enabled. While enabled, after you ;; paste something, pressing `C-j' and `C-k' several times cycles through the ;; elements in the `kill-ring'. (default nil) dotspacemacs-enable-paste-transient-state nil ;; Which-key delay in seconds. The which-key buffer is the popup listing ;; the commands bound to the current keystroke sequence. (default 0.4) dotspacemacs-which-key-delay 0.4 ;; Which-key frame position. Possible values are `right', `bottom' and ;; `right-then-bottom'. right-then-bottom tries to display the frame to the ;; right; if there is insufficient space it displays it at the bottom. ;; (default 'bottom) dotspacemacs-which-key-position 'bottom ;; Control where `switch-to-buffer' displays the buffer. If nil, ;; `switch-to-buffer' displays the buffer in the current window even if ;; another same-purpose window is available. If non-nil, `switch-to-buffer' ;; displays the buffer in a same-purpose window even if the buffer can be ;; displayed in the current window. (default nil) dotspacemacs-switch-to-buffer-prefers-purpose nil ;; If non-nil a progress bar is displayed when spacemacs is loading. This ;; may increase the boot time on some systems and emacs builds, set it to ;; nil to boost the loading time. (default t) dotspacemacs-loading-progress-bar t ;; If non-nil the frame is fullscreen when Emacs starts up. (default nil) ;; (Emacs 24.4+ only) dotspacemacs-fullscreen-at-startup nil ;; If non-nil `spacemacs/toggle-fullscreen' will not use native fullscreen. ;; Use to disable fullscreen animations in OSX. (default nil) dotspacemacs-fullscreen-use-non-native nil ;; If non-nil the frame is maximized when Emacs starts up. ;; Takes effect only if `dotspacemacs-fullscreen-at-startup' is nil. ;; (default nil) (Emacs 24.4+ only) dotspacemacs-maximized-at-startup nil ;; If non-nil the frame is undecorated when Emacs starts up. Combine this ;; variable with `dotspacemacs-maximized-at-startup' in OSX to obtain ;; borderless fullscreen. (default nil) dotspacemacs-undecorated-at-startup nil ;; A value from the range (0..100), in increasing opacity, which describes ;; the transparency level of a frame when it's active or selected. ;; Transparency can be toggled through `toggle-transparency'. (default 90) dotspacemacs-active-transparency 90 ;; A value from the range (0..100), in increasing opacity, which describes ;; the transparency level of a frame when it's inactive or deselected. ;; Transparency can be toggled through `toggle-transparency'. (default 90) dotspacemacs-inactive-transparency 90 ;; If non-nil show the titles of transient states. (default t) dotspacemacs-show-transient-state-title t ;; If non-nil show the color guide hint for transient state keys. (default t) dotspacemacs-show-transient-state-color-guide t ;; If non-nil unicode symbols are displayed in the mode line. ;; If you use Emacs as a daemon and wants unicode characters only in GUI set ;; the value to quoted `display-graphic-p'. (default t) dotspacemacs-mode-line-unicode-symbols t ;; If non-nil smooth scrolling (native-scrolling) is enabled. Smooth ;; scrolling overrides the default behavior of Emacs which recenters point ;; when it reaches the top or bottom of the screen. (default t) dotspacemacs-smooth-scrolling t ;; Control line numbers activation. ;; If set to `t', `relative' or `visual' then line numbers are enabled in all ;; `prog-mode' and `text-mode' derivatives. If set to `relative', line ;; numbers are relative. If set to `visual', line numbers are also relative, ;; but lines are only visual lines are counted. For example, folded lines ;; will not be counted and wrapped lines are counted as multiple lines. ;; This variable can also be set to a property list for finer control: ;; '(:relative nil ;; :visual nil ;; :disabled-for-modes dired-mode ;; doc-view-mode ;; markdown-mode ;; org-mode ;; pdf-view-mode ;; text-mode ;; :size-limit-kb 1000) ;; When used in a plist, `visual' takes precedence over `relative'. ;; (default nil) dotspacemacs-line-numbers nil ;; Code folding method. Possible values are `evil', `origami' and `vimish'. ;; (default 'evil) dotspacemacs-folding-method 'evil ;; If non-nil `smartparens-strict-mode' will be enabled in programming modes. ;; (default nil) dotspacemacs-smartparens-strict-mode nil ;; If non-nil pressing the closing parenthesis `)' key in insert mode passes ;; over any automatically added closing parenthesis, bracket, quote, etc... ;; This can be temporary disabled by pressing `C-q' before `)'. (default nil) dotspacemacs-smart-closing-parenthesis nil ;; Select a scope to highlight delimiters. Possible values are `any', ;; `current', `all' or `nil'. Default is `all' (highlight any scope and ;; emphasis the current one). (default 'all) dotspacemacs-highlight-delimiters 'all ;; If non-nil, start an Emacs server if one is not already running. ;; (default nil) dotspacemacs-enable-server nil ;; Set the emacs server socket location. ;; If nil, uses whatever the Emacs default is, otherwise a directory path ;; like \"~/.emacs.d/server\". It has no effect if ;; `dotspacemacs-enable-server' is nil. ;; (default nil) dotspacemacs-server-socket-dir nil ;; If non-nil, advise quit functions to keep server open when quitting. ;; (default nil) dotspacemacs-persistent-server nil ;; List of search tool executable names. Spacemacs uses the first installed ;; tool of the list. Supported tools are `rg', `ag', `pt', `ack' and `grep'. ;; (default '("rg" "ag" "pt" "ack" "grep")) dotspacemacs-search-tools '("rg" "ag" "pt" "ack" "grep") ;; Format specification for setting the frame title. ;; %a - the `abbreviated-file-name', or `buffer-name' ;; %t - `projectile-project-name' ;; %I - `invocation-name' ;; %S - `system-name' ;; %U - contents of $USER ;; %b - buffer name ;; %f - visited file name ;; %F - frame name ;; %s - process status ;; %p - percent of buffer above top of window, or Top, Bot or All ;; %P - percent of buffer above bottom of window, perhaps plus Top, or Bot or All ;; %m - mode name ;; %n - Narrow if appropriate ;; %z - mnemonics of buffer, terminal, and keyboard coding systems ;; %Z - like %z, but including the end-of-line format ;; (default "%I@%S") dotspacemacs-frame-title-format "%I@%S" ;; Format specification for setting the icon title format ;; (default nil - same as frame-title-format) dotspacemacs-icon-title-format nil ;; Show trailing whitespace (default t) dotspacemacs-show-trailing-whitespace t ;; Delete whitespace while saving buffer. Possible values are `all' ;; to aggressively delete empty line and long sequences of whitespace, ;; `trailing' to delete only the whitespace at end of lines, `changed' to ;; delete only whitespace for changed lines or `nil' to disable cleanup. ;; (default nil) dotspacemacs-whitespace-cleanup nil ;; If non nil activate `clean-aindent-mode' which tries to correct ;; virtual indentation of simple modes. This can interfer with mode specific ;; indent handling like has been reported for `go-mode'. ;; If it does deactivate it here. ;; (default t) dotspacemacs-use-clean-aindent-mode t ;; If non-nil shift your number row to match the entered keyboard layout ;; (only in insert state). Currently supported keyboard layouts are: ;; `qwerty-us', `qwertz-de' and `querty-ca-fr'. ;; New layouts can be added in `spacemacs-editing' layer. ;; (default nil) dotspacemacs-swap-number-row nil ;; Either nil or a number of seconds. If non-nil zone out after the specified ;; number of seconds. (default nil) dotspacemacs-zone-out-when-idle nil ;; Run `spacemacs/prettify-org-buffer' when ;; visiting README.org files of Spacemacs. ;; (default nil) dotspacemacs-pretty-docs nil ;; If nil the home buffer shows the full path of agenda items ;; and todos. If non nil only the file name is shown. dotspacemacs-home-shorten-agenda-source nil ;; If non-nil then byte-compile some of Spacemacs files. dotspacemacs-byte-compile nil)) (defun dotspacemacs/user-env () "Environment variables setup. This function defines the environment variables for your Emacs session. By default it calls `spacemacs/load-spacemacs-env' which loads the environment variables declared in `~/.spacemacs.env' or `~/.spacemacs.d/.spacemacs.env'. See the header of this file for more information." (spacemacs/load-spacemacs-env)) (defun dotspacemacs/user-init () "Initialization for user code: This function is called immediately after `dotspacemacs/init', before layer configuration. It is mostly for variables that should be set before packages are loaded. If you are unsure, try setting them in `dotspacemacs/user-config' first." ;; Do I need this?? (setq evil-want-C-w-in-emacs-state t) (setq evil-want-minibuffer t) ;; Symbolic link to Git-controlled source file; follow link? (setq vc-follow-symlinks t) ) (defun dotspacemacs/user-load () "Library to load while dumping. This function is called only while dumping Spacemacs configuration. You can `require' or `load' the libraries of your choice that will be included in the dump." ) (defun dotspacemacs/user-config () "Configuration for user code: This function is called at the very end of Spacemacs startup, after layer configuration. Put your configuration code here, except for variables that should be set before packages are loaded." (spacemacs/set-leader-keys "gR" 'magit-refresh-all) (global-set-key (kbd "C-c f") 'magit-file-dispatch) ;; There is magit-file-watcher, not recommended (add-hook 'after-save-hook 'magit-after-save-refresh-status t) (setq magit-save-repository-buffers 'dontask) (magit-wip-mode) ;; Experiment! Use M-x magit-wip-logw ;; (global-set-key (kbd "M-o") 'ace-window) ;; Or C-x o ;; https://github.com/syl20bnr/spacemacs/issues/4243 (with-eval-after-load 'company (define-key company-active-map (kbd "C-w") 'evil-delete-backward-word) ) (with-eval-after-load 'helm (define-key helm-map (kbd "C-w") 'evil-delete-backward-word) ) ;; (require 'smartparens) ;; !!! Uncommenting this fixes the smartparens error !!! ;; Will this fix the error?? ) ;; Do not write anything past this comment. This is where Emacs will ;; auto-generate custom variable definitions. (defun dotspacemacs/emacs-custom-settings () "Emacs custom settings. This is an auto-generated function, do not modify its content directly, use Emacs customize menu instead. This function is called at the very end of Spacemacs initialization." (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. '(evil-want-Y-yank-to-eol nil) '(package-selected-packages '(lsp-ui lsp-treemacs lsp-origami origami helm-rtags helm-lsp google-c-style flycheck-ycmd flycheck-rtags flycheck-pos-tip pos-tip disaster cpp-auto-include company-ycmd ycmd request-deferred deferred company-rtags rtags company-c-headers ccls lsp-mode dash-functional yasnippet-snippets web-mode web-beautify tagedit slim-mode scss-mode sass-mode pug-mode prettier-js mmm-mode markdown-toc impatient-mode simple-httpd helm-css-scss helm-company helm-c-yasnippet haml-mode gh-md fuzzy emmet-mode company-web web-completion-data company auto-yasnippet yasnippet ac-ispell auto-complete unfill orgit org-rich-yank org-projectile org-category-capture org-present org-pomodoro alert log4e gntp org-mime org-download org-cliplink org-brain mwim htmlize helm-org-rifle gnuplot evil-org treemacs-magit smeargle magit-svn magit-section magit-gitflow magit-popup helm-gitignore helm-git-grep gitignore-templates gitignore-mode gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link forge markdown-mode magit ghub closql emacsql-sqlite emacsql treepy git-commit with-editor transient ws-butler writeroom-mode winum which-key volatile-highlights vi-tilde-fringe uuidgen use-package undo-tree treemacs-projectile treemacs-persp treemacs-icons-dired treemacs-evil toc-org symon symbol-overlay string-inflection spaceline-all-the-icons restart-emacs request rainbow-delimiters popwin pcre2el password-generator paradox overseer org-superstar open-junk-file nameless move-text macrostep lorem-ipsum link-hint indent-guide hybrid-mode hungry-delete hl-todo highlight-parentheses highlight-numbers highlight-indentation helm-xref helm-themes helm-swoop helm-purpose helm-projectile helm-org helm-mode-manager helm-make helm-ls-git helm-flx helm-descbinds helm-ag google-translate golden-ratio font-lock+ flycheck-package flycheck-elsa flx-ido fill-column-indicator fancy-battery eyebrowse expand-region evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-textobj-line evil-surround evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-lisp-state evil-lion evil-indent-plus evil-iedit-state evil-goggles evil-exchange evil-escape evil-ediff evil-easymotion evil-collection evil-cleverparens evil-args evil-anzu eval-sexp-fu emr elisp-slime-nav editorconfig dumb-jump dotenv-mode dired-quick-sort diminish devdocs define-word column-enforce-mode clean-aindent-mode centered-cursor-mode auto-highlight-symbol auto-compile aggressive-indent ace-link ace-jump-helm-line))) (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. ) ) ```
emacs18 commented 3 years ago

Rather than (require 'smartparens-mode) you could add the following in your startup file:

(defun smartparens-mode () (debug))

Once this is defined, then any attempt at calling this function will print stack trace. Using that stack trace you can figure out who is calling this and take corrective action to fix it.

If you are not comfortable with stack traces, then you can cut and paste it into this report and others may be able to help you.

ilyagr commented 3 years ago

@emacs18 Thank you for the very helpful suggestion!

I had to put this line into user-init and not user-config to get a stacktrace after startup. Here's a stacktrace I get after running emacs ~/.spacemacs.

Debugger entered: nil
  smartparens-mode()
  run-hooks(change-major-mode-after-body-hook prog-mode-hook emacs-lisp-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook prog-mode-hook emacs-lisp-mode-hook))
  run-mode-hooks(emacs-lisp-mode-hook)
  emacs-lisp-mode()
  set-auto-mode-0(emacs-lisp-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer .spacemacs> "~/.spacemacs" nil nil "~/stow/dotfiles/.spacemacs" (693697 52))
  find-file-noselect("/home/ilyagr/.spacemacs")
  #f(compiled-function (displayable-buffers dir line column name) #<bytecode 0x1ef047293473>)((nil) "~/.local/app/Spacemacs/" (0) (0) "/home/ilyagr/.spacemacs")
  command-line-1(("/home/ilyagr/.spacemacs"))
  command-line()
  normal-top-level()

So, it seems the culprit in this particular case is emacs-lisp-mode-hook. Edit I tried disabling the elisp layer to see if it's the only thing triggering the error, but it didn't help. I get exactly the same backtrace.

Here's what I get when searching inside ~/.emacs.d/elpa/27.1/develop/, exluding the directory of the smartparens package itself:

$ cd ~/.emacs.d/elpa/27.1/develop/ && rg --files-with-matches smartparens -g "!smartparens*/" 
evil-cleverparens-20170718.413/evil-cleverparens.el
evil-cleverparens-20170718.413/evil-cleverparens-pkg.el
evil-cleverparens-20170718.413/evil-cleverparens-text-objects.el
evil-cleverparens-20170718.413/evil-cleverparens-autoloads.el
archives/melpa/archive-contents
evil-cleverparens-20170718.413/evil-cleverparens-util.el
evil-lisp-state-20160404.248/evil-lisp-state.el
evil-lisp-state-20160404.248/evil-lisp-state-pkg.el

None of the results seem like the obvious problem, though I'm not sure if I'm qualified to tell. On first look, the following seems the most suspicious (but it's not very suspicious either):

https://github.com/syl20bnr/evil-lisp-state/blob/master/evil-lisp-state.el#L117-L124

Let me know if you have any further advice.

smile13241324 commented 3 years ago

The issue you describe sounds like smartparens-mode is not loaded when emacs-lisp-mode is started. This could be an issue with deferred loading of that package. However I do not have this issue on my linux box when I execute the code you have posted.

Do you have any specfic user-config or user-init?

Here is my system:

System Info :computer:

ilyagr commented 3 years ago

@smile13241324 I can'tt think of anything obviously related. I put my full .spacemacs in the details section of the original report above (click on the triangle).

emacs18 commented 3 years ago

Following should help you identify who is adding smartparens-mode to emacs-lisp-mode-hook:

(defadvice add-hook (before check-for-smartparens activate)
  (when (and (eq hook 'emacs-lisp-mode-hook)
             (eq function 'smartparens-mode))
    (debug)))

This modifies add-hook function so that it checks if emacs-lisp-mode-hook is about to be modified to add smartparens-mode to it. If this is detected, then halt and print stack trace. In most cases add-hook should be used to add hooks. However if some other method is used such as setq, then above code will of course not work.

More brute force method could be to add something like this:

(debug-on-variable-change 'emacs-lisp-mode-hook)

This prints stack trace whenever the variable is about to be changed. Since many hooks are typically added to this variable, it may be very tedious to wade through hooks other than smartparens-mode being added.

ilyagr commented 3 years ago

Thanks, @emacs18.

Adding the hook you suggested does not trigger anything.

With debug-variable-change, I get the stacktrace I pasted at the end. Only multi-line-emacs-lisp-hook is added to it. (There's that notification, and also a let block that sets emacs-lisp-mode-hook to nil temporarily elsewhere). Note that multi-line-emacs-lisp-hook was also mentioned in the stacktrace above. It is present only in .elc files on my machine, not .el. I think it's defined in a macro in https://github.com/IvanMalison/multi-line/blob/d5ae863ced0adeb7032ada398005f27a6c669d79/multi-line.el#L125-L140, but I don't understand the code.

Stacktrace when variable was changed

Debugger entered--setting emacs-lisp-mode-hook to (multi-line-emacs-lisp-mode-hook): 
  debug--implement-debug-watch(emacs-lisp-mode-hook (multi-line-emacs-lisp-mode-hook) set nil)
  #f(compiled-function (hook function &optional depth local) "Add to the value of HOOK the function FUNCTION.\nFUNCTION is not added if already present.\n\nThe place where the function is added depends on the DEPTH\nparameter.  DEPTH defaults to 0.  By convention, it should be\na number between -100 and 100 where 100 means that the function\nshould be at the very end of the list, whereas -100 means that\nthe function should always come first.\nSince nothing is \"always\" true, don't use 100 nor -100.\nWhen two functions have the same depth, the new one gets added after the\nold one if depth is strictly positive and before otherwise.\n\nFor backward compatibility reasons, a symbol other than nil is\ninterpreted as a DEPTH of 90.\n\nThe optional fourth argument, LOCAL, if non-nil, says to modify\nthe hook's buffer-local value rather than its global value.\nThis makes the hook buffer-local, and it makes t a member of the\nbuffer-local value.  That acts as a flag to run the hook\nfunctions of the global value as well as in the local value.\n\nHOOK should be a symbol, and FUNCTION may be any valid function.  If\nHOOK is void, it is first set to nil.  If HOOK's value is a single\nfunction, it is changed to a list of functions." #<bytecode 0x1eaf6b064a0b>)(emacs-lisp-mode-hook multi-line-emacs-lisp-mode-hook t nil)
  ad-Advice-add-hook(#f(compiled-function (hook function &optional depth local) "Add to the value of HOOK the function FUNCTION.\nFUNCTION is not added if already present.\n\nThe place where the function is added depends on the DEPTH\nparameter.  DEPTH defaults to 0.  By convention, it should be\na number between -100 and 100 where 100 means that the function\nshould be at the very end of the list, whereas -100 means that\nthe function should always come first.\nSince nothing is \"always\" true, don't use 100 nor -100.\nWhen two functions have the same depth, the new one gets added after the\nold one if depth is strictly positive and before otherwise.\n\nFor backward compatibility reasons, a symbol other than nil is\ninterpreted as a DEPTH of 90.\n\nThe optional fourth argument, LOCAL, if non-nil, says to modify\nthe hook's buffer-local value rather than its global value.\nThis makes the hook buffer-local, and it makes t a member of the\nbuffer-local value.  That acts as a flag to run the hook\nfunctions of the global value as well as in the local value.\n\nHOOK should be a symbol, and FUNCTION may be any valid function.  If\nHOOK is void, it is first set to nil.  If HOOK's value is a single\nfunction, it is changed to a list of functions." #<bytecode 0x1eaf6b064a0b>) emacs-lisp-mode-hook multi-line-emacs-lisp-mode-hook t)
  apply(ad-Advice-add-hook #f(compiled-function (hook function &optional depth local) "Add to the value of HOOK the function FUNCTION.\nFUNCTION is not added if already present.\n\nThe place where the function is added depends on the DEPTH\nparameter.  DEPTH defaults to 0.  By convention, it should be\na number between -100 and 100 where 100 means that the function\nshould be at the very end of the list, whereas -100 means that\nthe function should always come first.\nSince nothing is \"always\" true, don't use 100 nor -100.\nWhen two functions have the same depth, the new one gets added after the\nold one if depth is strictly positive and before otherwise.\n\nFor backward compatibility reasons, a symbol other than nil is\ninterpreted as a DEPTH of 90.\n\nThe optional fourth argument, LOCAL, if non-nil, says to modify\nthe hook's buffer-local value rather than its global value.\nThis makes the hook buffer-local, and it makes t a member of the\nbuffer-local value.  That acts as a flag to run the hook\nfunctions of the global value as well as in the local value.\n\nHOOK should be a symbol, and FUNCTION may be any valid function.  If\nHOOK is void, it is first set to nil.  If HOOK's value is a single\nfunction, it is changed to a list of functions." #<bytecode 0x1eaf6b064a0b>) (emacs-lisp-mode-hook multi-line-emacs-lisp-mode-hook t))
  add-hook(emacs-lisp-mode-hook multi-line-emacs-lisp-mode-hook t)
  multi-line-enable-mode-hooks()
  require(multi-line nil t)
  (not (require 'multi-line nil t))
  (if (not (require 'multi-line nil t)) (display-warning 'use-package (format "Cannot load %s" 'multi-line) :error) (condition-case-unless-debug err (progn (when (run-hook-with-args-until-failure 'use-package--multi-line--pre-config-hook) t (run-hooks 'use-package--multi-line--post-config-hook)) t) (error (funcall use-package--warning127 :config err))))
  (progn (condition-case-unless-debug err (when (run-hook-with-args-until-failure 'use-package--multi-line--pre-init-hook) (progn (progn (defvar spacemacs--multi-line-transient-state-props nil "Association list containing a copy of some propert...") (if (member '... spacemacs--multi-line-transient-state-props) spacemacs--multi-line-transient-state-props (setq spacemacs--multi-line-transient-state-props (cons ... spacemacs--multi-line-transient-state-props))) (if (member '... spacemacs--multi-line-transient-state-props) spacemacs--multi-line-transient-state-props (setq spacemacs--multi-line-transient-state-props (cons ... spacemacs--multi-line-transient-state-props))) (if (member '... spacemacs--multi-line-transient-state-props) spacemacs--multi-line-transient-state-props (setq spacemacs--multi-line-transient-state-props (cons ... spacemacs--multi-line-transient-state-props))) (if (member '... spacemacs--multi-line-transient-state-props) spacemacs--multi-line-transient-state-props (setq spacemacs--multi-line-transient-state-props (cons ... spacemacs--multi-line-transient-state-props))) (if (member '... spacemacs--multi-line-transient-state-props) spacemacs--multi-line-transient-state-props (setq spacemacs--multi-line-transient-state-props (cons ... spacemacs--multi-line-transient-state-props))) (spacemacs/defer-until-after-user-config '(lambda nil ... ...))) (spacemacs/set-leader-keys "xn" 'spacemacs/multi-line-transient-state/body)) (run-hooks 'use-package--multi-line--post-init-hook)) (error (funcall use-package--warning127 :init err))) (if (not (require 'multi-line nil t)) (display-warning 'use-package (format "Cannot load %s" 'multi-line) :error) (condition-case-unless-debug err (progn (when (run-hook-with-args-until-failure 'use-package--multi-line--pre-config-hook) t (run-hooks 'use-package--multi-line--post-config-hook)) t) (error (funcall use-package--warning127 :config err)))))
  (condition-case err (progn (condition-case-unless-debug err (when (run-hook-with-args-until-failure 'use-package--multi-line--pre-init-hook) (progn (progn (defvar spacemacs--multi-line-transient-state-props nil "Association list containing a copy of some propert...") (if (member ... spacemacs--multi-line-transient-state-props) spacemacs--multi-line-transient-state-props (setq spacemacs--multi-line-transient-state-props ...)) (if (member ... spacemacs--multi-line-transient-state-props) spacemacs--multi-line-transient-state-props (setq spacemacs--multi-line-transient-state-props ...)) (if (member ... spacemacs--multi-line-transient-state-props) spacemacs--multi-line-transient-state-props (setq spacemacs--multi-line-transient-state-props ...)) (if (member ... spacemacs--multi-line-transient-state-props) spacemacs--multi-line-transient-state-props (setq spacemacs--multi-line-transient-state-props ...)) (if (member ... spacemacs--multi-line-transient-state-props) spacemacs--multi-line-transient-state-props (setq spacemacs--multi-line-transient-state-props ...)) (spacemacs/defer-until-after-user-config '...)) (spacemacs/set-leader-keys "xn" 'spacemacs/multi-line-transient-state/body)) (run-hooks 'use-package--multi-line--post-init-hook)) (error (funcall use-package--warning127 :init err))) (if (not (require 'multi-line nil t)) (display-warning 'use-package (format "Cannot load %s" 'multi-line) :error) (condition-case-unless-debug err (progn (when (run-hook-with-args-until-failure 'use-package--multi-line--pre-config-hook) t (run-hooks 'use-package--multi-line--post-config-hook)) t) (error (funcall use-package--warning127 :config err))))) ((debug error) (funcall use-package--warning127 :catch err)))
  (condition-case-unless-debug err (progn (condition-case-unless-debug err (when (run-hook-with-args-until-failure 'use-package--multi-line--pre-init-hook) (progn (progn (defvar spacemacs--multi-line-transient-state-props nil "Association list containing a copy of some propert...") (if (member ... spacemacs--multi-line-transient-state-props) spacemacs--multi-line-transient-state-props (setq spacemacs--multi-line-transient-state-props ...)) (if (member ... spacemacs--multi-line-transient-state-props) spacemacs--multi-line-transient-state-props (setq spacemacs--multi-line-transient-state-props ...)) (if (member ... spacemacs--multi-line-transient-state-props) spacemacs--multi-line-transient-state-props (setq spacemacs--multi-line-transient-state-props ...)) (if (member ... spacemacs--multi-line-transient-state-props) spacemacs--multi-line-transient-state-props (setq spacemacs--multi-line-transient-state-props ...)) (if (member ... spacemacs--multi-line-transient-state-props) spacemacs--multi-line-transient-state-props (setq spacemacs--multi-line-transient-state-props ...)) (spacemacs/defer-until-after-user-config '...)) (spacemacs/set-leader-keys "xn" 'spacemacs/multi-line-transient-state/body)) (run-hooks 'use-package--multi-line--post-init-hook)) (error (funcall use-package--warning127 :init err))) (if (not (require 'multi-line nil t)) (display-warning 'use-package (format "Cannot load %s" 'multi-line) :error) (condition-case-unless-debug err (progn (when (run-hook-with-args-until-failure 'use-package--multi-line--pre-config-hook) t (run-hooks 'use-package--multi-line--post-config-hook)) t) (error (funcall use-package--warning127 :config err))))) (error (funcall use-package--warning127 :catch err)))
  (progn (defvar use-package--warning127 #'(lambda (keyword err) (let ((msg (format "%s/%s: %s" ... keyword ...))) (display-warning 'use-package msg :error)))) (condition-case-unless-debug err (progn (condition-case-unless-debug err (when (run-hook-with-args-until-failure 'use-package--multi-line--pre-init-hook) (progn (progn (defvar spacemacs--multi-line-transient-state-props nil "Association list containing a copy of some propert...") (if ... spacemacs--multi-line-transient-state-props ...) (if ... spacemacs--multi-line-transient-state-props ...) (if ... spacemacs--multi-line-transient-state-props ...) (if ... spacemacs--multi-line-transient-state-props ...) (if ... spacemacs--multi-line-transient-state-props ...) (spacemacs/defer-until-after-user-config ...)) (spacemacs/set-leader-keys "xn" 'spacemacs/multi-line-transient-state/body)) (run-hooks 'use-package--multi-line--post-init-hook)) (error (funcall use-package--warning127 :init err))) (if (not (require 'multi-line nil t)) (display-warning 'use-package (format "Cannot load %s" 'multi-line) :error) (condition-case-unless-debug err (progn (when (run-hook-with-args-until-failure ...) t (run-hooks ...)) t) (error (funcall use-package--warning127 :config err))))) (error (funcall use-package--warning127 :catch err))))
  (use-package multi-line :init (progn (progn (defvar spacemacs--multi-line-transient-state-props nil "Association list containing a copy of some propert...") (if (member '(hint nil) spacemacs--multi-line-transient-state-props) spacemacs--multi-line-transient-state-props (setq spacemacs--multi-line-transient-state-props (cons '(hint nil) spacemacs--multi-line-transient-state-props))) (if (member '(columns nil) spacemacs--multi-line-transient-state-props) spacemacs--multi-line-transient-state-props (setq spacemacs--multi-line-transient-state-props (cons '(columns nil) spacemacs--multi-line-transient-state-props))) (if (member '(foreign-keys nil) spacemacs--multi-line-transient-state-props) spacemacs--multi-line-transient-state-props (setq spacemacs--multi-line-transient-state-props (cons '(foreign-keys nil) spacemacs--multi-line-transient-state-props))) (if (member '(entry-sexp nil) spacemacs--multi-line-transient-state-props) spacemacs--multi-line-transient-state-props (setq spacemacs--multi-line-transient-state-props (cons '(entry-sexp nil) spacemacs--multi-line-transient-state-props))) (if (member '(exit-sexp nil) spacemacs--multi-line-transient-state-props) spacemacs--multi-line-transient-state-props (setq spacemacs--multi-line-transient-state-props (cons '(exit-sexp nil) spacemacs--multi-line-transient-state-props))) (spacemacs/defer-until-after-user-config '(lambda nil (eval (append ... ...)) (when "Multi-line Transient State" (let ... ... ...))))) (spacemacs/set-leader-keys "xn" 'spacemacs/multi-line-transient-state/body)))
  spacemacs-editing/init-multi-line()
  funcall(spacemacs-editing/init-multi-line)
  (let* ((pkg-name (eieio-oref pkg ':name)) (owner (car (eieio-oref pkg ':owners)))) (spacemacs-buffer/message (format "%S -> init (%S)..." pkg-name owner)) (funcall (intern (format "%S/init-%S" owner pkg-name))))
  configuration-layer//configure-package(#<cfgl-package cfgl-package-157508155a04>)
  mapc(configuration-layer//configure-package (#<cfgl-package cfgl-package-15750815c478> #<cfgl-package cfgl-package-157508168f24> #<cfgl-package cfgl-package-157508172688> #<cfgl-package cfgl-package-15750813e4cc> #<cfgl-package cfgl-package-15750813e6d8> #<cfgl-package cfgl-package-157508150040> #<cfgl-package cfgl-package-157508139dac> #<cfgl-package cfgl-package-15750815c6e0> #<cfgl-package cfgl-package-157508168b08> #<cfgl-package cfgl-package-15750813eaf4> #<cfgl-package cfgl-package-1575081688fc> #<cfgl-package cfgl-package-15750815045c> #<cfgl-package cfgl-package-15750815cb48> #<cfgl-package cfgl-package-15750813ed00> #<cfgl-package cfgl-package-1575081512dc> #<cfgl-package cfgl-package-15750814d8e0> #<cfgl-package cfgl-package-157508169130> #<cfgl-package cfgl-package-157508177eec> #<cfgl-package cfgl-package-15750813f01c> #<cfgl-package cfgl-package-15750815cdbc> #<cfgl-package cfgl-package-157508178140> #<cfgl-package cfgl-package-15750815d024> #<cfgl-package cfgl-package-1575081399e8> #<cfgl-package cfgl-package-157508159c04> #<cfgl-package cfgl-package-157508159e6c> #<cfgl-package cfgl-package-157508165fd0> #<cfgl-package cfgl-package-15750814622c> #<cfgl-package cfgl-package-15750813a110> #<cfgl-package cfgl-package-157508145940> #<cfgl-package cfgl-package-15750815d4d8> #<cfgl-package cfgl-package-157508151540> #<cfgl-package cfgl-package-15750815d940> #<cfgl-package cfgl-package-15750813a320> #<cfgl-package cfgl-package-15750815dba8> #<cfgl-package cfgl-package-15750813f284> #<cfgl-package cfgl-package-157508145b5c> #<cfgl-package cfgl-package-15750815e1d4> #<cfgl-package cfgl-package-15750815175c> #<cfgl-package cfgl-package-15750814cf50> #<cfgl-package cfgl-package-15750815df6c> #<cfgl-package cfgl-package-157508178458> #<cfgl-package cfgl-package-157508151b68> #<cfgl-package cfgl-package-157508146954> #<cfgl-package cfgl-package-157508146b60> #<cfgl-package cfgl-package-157508147994> #<cfgl-package cfgl-package-157508147778> #<cfgl-package cfgl-package-157508158590> #<cfgl-package cfgl-package-157508147ca0> #<cfgl-package cfgl-package-157508147ebc> #<cfgl-package cfgl-package-1575081482c8> ...))
  (let (packages-to-configure) (let ((--dolist-tail-- packages) pkg-name) (while --dolist-tail-- (setq pkg-name (car --dolist-tail--)) (let ((pkg (configuration-layer/get-package pkg-name))) (cond ((eieio-oref pkg ':lazy-install) (spacemacs-buffer/message (format "%S ignored since it can be lazily installed." pkg-name))) ((and (eieio-oref pkg ...) (not ...)) (spacemacs-buffer/message (format "%S ignored since it has been excluded." pkg-name))) ((null (eieio-oref pkg ...)) (spacemacs-buffer/message (format "%S ignored since it has no owner layer." pkg-name))) ((not (configuration-layer//package-reqs-used-p pkg)) (spacemacs-buffer/message (format ... pkg-name))) ((not (cfgl-package-enabled-p pkg)) (spacemacs-buffer/message (format "%S is disabled." pkg-name))) (t (let (...) (if dir ...)) (if (memq ... ...) nil (configuration-layer//activate-package pkg-name)) (cond (... ...) (t ... ...))))) (setq --dolist-tail-- (cdr --dolist-tail--)))) (setq packages-to-configure (reverse packages-to-configure)) (mapc 'configuration-layer//configure-package packages-to-configure) (mapc 'configuration-layer//post-configure-package packages-to-configure))
  configuration-layer//configure-packages-2((abbrev ac-ispell ace-jump-helm-line ace-link ace-window add-node-modules-path aggressive-indent all-the-icons ansi-colors archive-mode auto-complete auto-highlight-symbol auto-yasnippet avy bookmark bracketed-paste centered-cursor-mode clean-aindent-mode column-enforce-mode company company-box company-quickhelp company-statistics company-web compile conf-mode css-mode cus-edit dash default-helm-config default-ivy-config default-org-config define-word desktop devdocs dired dired-quick-sort dired-x display-fill-column-indicator display-line-numbers doc-view doom-modeline dumb-jump ediff editorconfig eldoc electric-indent-mode emmet-mode eval-sexp-fu evil-anzu ...))
  configuration-layer//configure-packages((abbrev ac-ispell ace-jump-helm-line ace-link ace-window add-node-modules-path aggressive-indent all-the-icons ansi-colors archive-mode async auto-complete auto-highlight-symbol auto-yasnippet avy bind-key bind-map bookmark bracketed-paste centered-cursor-mode clean-aindent-mode column-enforce-mode company company-box company-quickhelp company-statistics company-web compile conf-mode css-mode cus-edit dash default-helm-config default-ivy-config default-org-config define-word desktop devdocs diminish dired dired-quick-sort dired-x display-fill-column-indicator display-line-numbers doc-view doom-modeline dotenv-mode dumb-jump ediff editorconfig ...))
  configuration-layer//load()
  (cond (changed-since-last-dump-p (configuration-layer//load) (if (spacemacs/emacs-with-pdumper-set-p) (progn (configuration-layer/message "Layer list has changed since last dump.") (configuration-layer//dump-emacs)))) (spacemacs-force-dump (configuration-layer//load) (if (spacemacs/emacs-with-pdumper-set-p) (progn (configuration-layer/message (concat "--force-dump passed on the command line or configu..." "been reloaded, forcing a redump.")) (configuration-layer//dump-emacs)))) ((spacemacs-is-dumping-p) (configuration-layer//load)) ((and (spacemacs/emacs-with-pdumper-set-p) (spacemacs-run-from-dump-p)) (configuration-layer/message "Running from a dumped file. Skipping the loading p...")) (t (configuration-layer//load) (if (spacemacs/emacs-with-pdumper-set-p) (progn (configuration-layer/message (concat "Layer list has not changed since last time. " "Skipping dumping process!"))))))
  configuration-layer/load()
  (let ((file-name-handler-alist nil)) (require 'core-spacemacs) (spacemacs/dump-restore-load-path) (configuration-layer/load-lock-file) (spacemacs/init) (configuration-layer/stable-elpa-init) (configuration-layer/load) (spacemacs-buffer/display-startup-note) (spacemacs/setup-startup-hook) (spacemacs/dump-eval-delayed-functions) (if (and dotspacemacs-enable-server (not (spacemacs-is-dumping-p))) (progn (require 'server) (if dotspacemacs-server-socket-dir (progn (setq server-socket-dir dotspacemacs-server-socket-dir))) (if (server-running-p) nil (message "Starting a server...") (server-start)))))
  (if (not (version<= spacemacs-emacs-min-version emacs-version)) (error (concat "Your version of Emacs (%s) is too old. " "Spacemacs requires Emacs version %s or above.") emacs-version spacemacs-emacs-min-version) (let ((file-name-handler-alist nil)) (require 'core-spacemacs) (spacemacs/dump-restore-load-path) (configuration-layer/load-lock-file) (spacemacs/init) (configuration-layer/stable-elpa-init) (configuration-layer/load) (spacemacs-buffer/display-startup-note) (spacemacs/setup-startup-hook) (spacemacs/dump-eval-delayed-functions) (if (and dotspacemacs-enable-server (not (spacemacs-is-dumping-p))) (progn (require 'server) (if dotspacemacs-server-socket-dir (progn (setq server-socket-dir dotspacemacs-server-socket-dir))) (if (server-running-p) nil (message "Starting a server...") (server-start))))))
  eval-buffer(#<buffer  *load*> nil "/home/ilyagr/.emacs.d/init.el" nil t)  ; Reading at buffer position 2531
  load-with-code-conversion("/home/ilyagr/.emacs.d/init.el" "/home/ilyagr/.emacs.d/init.el" t t)
  load("/home/ilyagr/.emacs.d/init" noerror nomessage)
  startup--load-user-init-file(#f(compiled-function () #<bytecode 0x1575079f7c2d>) #f(compiled-function () #<bytecode 0x1575079f62dd>) t)
  command-line()
  normal-top-level()
ilyagr commented 3 years ago

Here's a different stacktrace I got after pressing M-:, clicking on the minibuffer, and entering multi-line-<TAB>:

Debugger entered: nil
  smartparens-mode()
  (if (or (eq this-command 'eval-expression) (eq this-command 'eldoc-eval-expression)) (smartparens-mode))
  spacemacs//conditionally-enable-smartparens-mode()
  read-from-minibuffer("Eval: " nil (keymap (9 . completion-at-point) (27 keymap (9 . completion-at-point)) keymap (escape . keyboard-escape-quit) (18 . helm-minibuffer-history) (3 keymap (12 . helm-minibuffer-history)) (menu-bar keymap (minibuf "Minibuf" keymap (previous menu-item "Previous History Item" previous-history-element :help "Put previous minibuffer history element in the min...") (next menu-item "Next History Item" next-history-element :help "Put next minibuffer history element in the minibuf...") (isearch-backward menu-item "Isearch History Backward" isearch-backward :help "Incrementally search minibuffer history backward") (isearch-forward menu-item "Isearch History Forward" isearch-forward :help "Incrementally search minibuffer history forward") (return menu-item "Enter" exit-minibuffer :key-sequence "\15" :help "Terminate input and exit minibuffer") (quit menu-item "Quit" abort-recursive-edit :help "Abort input and exit minibuffer") "Minibuf")) (10 . exit-minibuffer) (13 . exit-minibuffer) (7 . abort-recursive-edit) (C-tab . file-cache-minibuffer-complete) (9 . self-insert-command) (XF86Back . previous-history-element) (up . previous-line-or-history-element) (prior . previous-history-element) (XF86Forward . next-history-element) (down . next-line-or-history-element) (next . next-history-element) (27 keymap (60 . minibuffer-beginning-of-buffer) (114 . previous-matching-history-element) (115 . next-matching-history-element) (112 . previous-history-element) (110 . next-history-element))) t read-expression-history)
  read--expression("Eval: ")
  byte-code("\301\302!\303\10!B\207" [current-prefix-arg read--expression "Eval: " eval-expression-get-print-arguments] 3)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

Edit So, I think it's one of these, from ~/.emacs.d/layers. I was searching in the wrong place.

Read the next comment instead of opening this. ``` $ cd ~/.emacs.d/layers/+spacemacs/spacemacs-editing/ && rg smartparens-mode -C 3 funcs.el 60- (t 61- (insert-char ?\)))))) 62- 63:(defun spacemacs//conditionally-enable-smartparens-mode () 64: "Enable `smartparens-mode' in the minibuffer, during `eval-expression'." 65- (if (or (eq this-command 'eval-expression) 66- (eq this-command 'eldoc-eval-expression)) 67: (smartparens-mode))) 68- 69-(defun spacemacs//adaptive-smartparent-pair-overlay-face () 70- (set-face-attribute 'sp-pair-overlay-face nil packages.el 395- sp-highlight-wrap-tag-overlay nil) 396- (spacemacs/add-to-hooks (if dotspacemacs-smartparens-strict-mode 397- 'smartparens-strict-mode 398: 'smartparens-mode) 399- '(prog-mode-hook comint-mode-hook)) 400: ;; enable smartparens-mode in `eval-expression' 401: (add-hook 'minibuffer-setup-hook 'spacemacs//conditionally-enable-smartparens-mode) 402- ;; toggles 403- (spacemacs|add-toggle smartparens 404: :mode smartparens-mode 405- :documentation "Enable smartparens." 406- :evil-leader "tp") 407- (spacemacs|add-toggle smartparens-globally -- 415- :config 416- (progn 417- (require 'smartparens-config) 418: (spacemacs|diminish smartparens-mode " ⓟ" " p") 419- (spacemacs//adaptive-smartparent-pair-overlay-face) 420- (add-hook 'spacemacs-post-theme-change-hook 421- 'spacemacs//adaptive-smartparent-pair-overlay-face) ```
ilyagr commented 3 years ago

I think the startup error I get is from

https://github.com/syl20bnr/spacemacs/blob/8181bc9cf23982dc8abbe97d02eeafbcf0d2fd21/layers/%2Bspacemacs/spacemacs-editing/packages.el#L396-L399

That's because changing dotspacemacs-smartparens-strict-mode from nil to 't in my .spacemacs changes the error I see to File mode specification error: (void-function smartparens-strict-mode).

The second stacktrace I get is probably from

https://github.com/syl20bnr/spacemacs/blob/8181bc9cf23982dc8abbe97d02eeafbcf0d2fd21/layers/%2Bspacemacs/spacemacs-editing/funcs.el#L63-L67

since it happened during eval-expression. This seems to happen every time I press M-:.

I have no idea why smartparens-mode is not loaded at that point.

ilyagr commented 3 years ago

[Later edit: This is comment is irrelevant. smartparens is always installed since the workaround I mentined in my original bug report works.]

Original comment Another observation that may be relevant. In my `.spacemacs` (pasted in my original bug description), there is a line ``` (custom-set-variables ;;; <...> '(package-selected-packages '(lsp-ui lsp-treemacs <...> evil-cleverparens <...>))) ) ;; Abbreviated ``` `smartparens` is not in that list.
ilyagr commented 3 years ago

I seem to have found a way to fix this (https://github.com/ilyagr/spacemacs/commit/c0fb84e3690f0fde69326e78adeeba057599df7c). I'm not sure exactly what was happening before, and why it didn't happen to others. There's also a remote possibility of this breaking something.

I'll turn this commit into a pull request if the fix seems to work for a little while, or if somebody knows that this is the correct thing to do.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!