@manateelazycat 今天在Emacs28上使用snails发现这个错误:
Debugger entered--Lisp error: (error "Window #<window 27 on *snails content*> too small...")
signal(error ("Window #<window 27 on *snails content*> too small..."))
error("Window %s too small for splitting" #<window 27 on *snails content*>)
split-window(#<window 27 on *snails content*> 32 below t)
(progn (select-frame snails-frame 'norecord) (delete-other-windows) (set-frame-parameter snails-frame 'menu-bar-lines 0) (set-frame-position snails-frame frame-x frame-y) (set-frame-size snails-frame frame-width frame-height t) (switch-to-buffer snails-input-buffer) (set-window-margins (selected-window) 1 1) (split-window (selected-window) (line-pixel-height) nil t) (other-window 1) (switch-to-buffer snails-content-buffer) (set-window-margins (selected-window) 1 1) (other-window 1) (setq snails-frame-window-conf (current-window-configuration)) (other-window 1) (split-window (selected-window) (* 2 (line-pixel-height)) 'below t) (switch-to-buffer snails-tips-buffer) (set-window-margins (selected-window) 1 1) (other-window 2) (add-hook 'after-change-functions 'snails-monitor-input nil t) (if snails-default-show-prefix-tips nil (snails-toggle-prefix-tips-buffer)) (if (featurep 'cocoa) (progn (add-hook 'focus-out-hook 'snails-quit))))
(unwind-protect (progn (select-frame snails-frame 'norecord) (delete-other-windows) (set-frame-parameter snails-frame 'menu-bar-lines 0) (set-frame-position snails-frame frame-x frame-y) (set-frame-size snails-frame frame-width frame-height t) (switch-to-buffer snails-input-buffer) (set-window-margins (selected-window) 1 1) (split-window (selected-window) (line-pixel-height) nil t) (other-window 1) (switch-to-buffer snails-content-buffer) (set-window-margins (selected-window) 1 1) (other-window 1) (setq snails-frame-window-conf (current-window-configuration)) (other-window 1) (split-window (selected-window) (* 2 (line-pixel-height)) 'below t) (switch-to-buffer snails-tips-buffer) (set-window-margins (selected-window) 1 1) (other-window 2) (add-hook 'after-change-functions 'snails-monitor-input nil t) (if snails-default-show-prefix-tips nil (snails-toggle-prefix-tips-buffer)) (if (featurep 'cocoa) (progn (add-hook 'focus-out-hook 'snails-quit)))) (if (frame-live-p old-frame) (progn (select-frame old-frame 'norecord))) (if (buffer-live-p old-buffer) (progn (set-buffer old-buffer))))
(let ((old-frame (selected-frame)) (old-buffer (current-buffer))) (unwind-protect (progn (select-frame snails-frame 'norecord) (delete-other-windows) (set-frame-parameter snails-frame 'menu-bar-lines 0) (set-frame-position snails-frame frame-x frame-y) (set-frame-size snails-frame frame-width frame-height t) (switch-to-buffer snails-input-buffer) (set-window-margins (selected-window) 1 1) (split-window (selected-window) (line-pixel-height) nil t) (other-window 1) (switch-to-buffer snails-content-buffer) (set-window-margins (selected-window) 1 1) (other-window 1) (setq snails-frame-window-conf (current-window-configuration)) (other-window 1) (split-window (selected-window) (* 2 (line-pixel-height)) 'below t) (switch-to-buffer snails-tips-buffer) (set-window-margins (selected-window) 1 1) (other-window 2) (add-hook 'after-change-functions 'snails-monitor-input nil t) (if snails-default-show-prefix-tips nil (snails-toggle-prefix-tips-buffer)) (if (featurep 'cocoa) (progn (add-hook 'focus-out-hook 'snails-quit)))) (if (frame-live-p old-frame) (progn (select-frame old-frame 'norecord))) (if (buffer-live-p old-buffer) (progn (set-buffer old-buffer)))))
(let* ((edges (frame-edges)) (x (nth 0 edges)) (y (nth 1 edges)) (width (- (nth 2 edges) x)) (height (nth 3 edges)) (frame-width (truncate (* snails-fame-width-proportion width))) (frame-height (truncate (* snails-fame-height-proportion height))) (frame-x (+ x (/ (- width frame-width) 2))) (frame-y (+ y (/ (- height frame-height) 3)))) (setq snails-project-root-dir (let ((project (project-current))) (if project (progn (expand-file-name (cdr project)))))) (if (and snails-frame (frame-visible-p snails-frame)) nil (setq snails-frame (make-frame '((parent-frame window-frame) (skip-taskbar . t) (minibuffer) (visibility) (internal-border-width . 0) (left-fringe . 0) (right-fringe . 0) (vertical-scroll-bars) (horizontal-scroll-bars) (undecorated . t) (unsplittable . t) (tool-bar-lines . 0) (menu-bar-lines . 0))))) (let ((old-frame (selected-frame)) (old-buffer (current-buffer))) (unwind-protect (progn (select-frame snails-frame 'norecord) (delete-other-windows) (set-frame-parameter snails-frame 'menu-bar-lines 0) (set-frame-position snails-frame frame-x frame-y) (set-frame-size snails-frame frame-width frame-height t) (switch-to-buffer snails-input-buffer) (set-window-margins (selected-window) 1 1) (split-window (selected-window) (line-pixel-height) nil t) (other-window 1) (switch-to-buffer snails-content-buffer) (set-window-margins (selected-window) 1 1) (other-window 1) (setq snails-frame-window-conf (current-window-configuration)) (other-window 1) (split-window (selected-window) (* 2 (line-pixel-height)) 'below t) (switch-to-buffer snails-tips-buffer) (set-window-margins (selected-window) 1 1) (other-window 2) (add-hook 'after-change-functions 'snails-monitor-input nil t) (if snails-default-show-prefix-tips nil (snails-toggle-prefix-tips-buffer)) (if (featurep 'cocoa) (progn (add-hook 'focus-out-hook 'snails-quit)))) (if (frame-live-p old-frame) (progn (select-frame old-frame 'norecord))) (if (buffer-live-p old-buffer) (progn (set-buffer old-buffer))))) (make-frame-visible snails-frame) (select-frame-set-input-focus snails-frame))
snails-create-frame()
(if (snails-frame-is-visible-p) (snails-quit) (if (and (listp backends) (> (length backends) 0)) (progn (setq snails-search-backends backends))) (setq snails-start-buffer (current-buffer)) (setq snails-start-buffer-dir-path default-directory) (setq snails-start-buffer-lines (line-number-at-pos (point-max))) (snails-init-face-with-theme) (snails-create-input-buffer) (snails-create-tips-buffer) (snails-create-content-buffer) (snails-create-frame) (cond ((and (stringp search-object) (not (string-empty-p search-object))) (save-current-buffer (set-buffer snails-input-buffer) (insert search-object)) (snails-search search-object)) (search-object (run-with-timer 0.05 nil #'(lambda nil (let (...) (save-current-buffer ... ...) (snails-search search-string))))) (t (snails-search ""))))
(if (display-graphic-p) (if (snails-frame-is-visible-p) (snails-quit) (if (and (listp backends) (> (length backends) 0)) (progn (setq snails-search-backends backends))) (setq snails-start-buffer (current-buffer)) (setq snails-start-buffer-dir-path default-directory) (setq snails-start-buffer-lines (line-number-at-pos (point-max))) (snails-init-face-with-theme) (snails-create-input-buffer) (snails-create-tips-buffer) (snails-create-content-buffer) (snails-create-frame) (cond ((and (stringp search-object) (not (string-empty-p search-object))) (save-current-buffer (set-buffer snails-input-buffer) (insert search-object)) (snails-search search-object)) (search-object (run-with-timer 0.05 nil #'(lambda nil (let ... ... ...)))) (t (snails-search "")))) (message "Snails render candidates in new frame that only ca..."))
snails()
funcall-interactively(snails)
call-interactively(snails record nil)
#f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\n\nOptional second arg RECORD-FLAG non-nil means unconditionally put\nthis command in the variable `command-history'. Otherwise, that\nis done only if an arg is read using the minibuffer.\n\nThe argument KEYS specifies the value to use instead of the\nreturn value of the `this-command-keys' function when reading the\narguments; if it is nil, `this-command-keys' is used.\n\nThe argument SPECIAL, if non-nil, means that this command is\nexecuting a special event, so ignore the prefix argument and\ndon't clear it." #<bytecode 0x1afd3f3bd61607c3>)(snails record nil nil)
ad-Advice-command-execute(#f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\n\nOptional second arg RECORD-FLAG non-nil means unconditionally put\nthis command in the variable `command-history'. Otherwise, that\nis done only if an arg is read using the minibuffer.\n\nThe argument KEYS specifies the value to use instead of the\nreturn value of the `this-command-keys' function when reading the\narguments; if it is nil, `this-command-keys' is used.\n\nThe argument SPECIAL, if non-nil, means that this command is\nexecuting a special event, so ignore the prefix argument and\ndon't clear it." #<bytecode 0x1afd3f3bd61607c3>) snails record)
apply(ad-Advice-command-execute #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\n\nOptional second arg RECORD-FLAG non-nil means unconditionally put\nthis command in the variable `command-history'. Otherwise, that\nis done only if an arg is read using the minibuffer.\n\nThe argument KEYS specifies the value to use instead of the\nreturn value of the `this-command-keys' function when reading the\narguments; if it is nil, `this-command-keys' is used.\n\nThe argument SPECIAL, if non-nil, means that this command is\nexecuting a special event, so ignore the prefix argument and\ndon't clear it." #<bytecode 0x1afd3f3bd61607c3>) (snails record))
command-execute(snails record)
counsel-M-x-action("snails")
#f(compiled-function (x) #<bytecode 0x1dc09c490a120044>)("snails")
ivy-call()
#f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially. An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero. Otherwise, use the first occurrence of\nPRESELECT in the collection. Comparison is first done with\n`equal'. If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input. It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0x1b9d2243fe6c543>)("M-x " ("snails" "toggle-debug-on-error" "snails-quit" "package-refresh-contents" "centaur-update-packages" "package-reinstall" "global-hl-line-mode" "hl-line-mode" "hi-lock-line-face-buffer" "markdown-toggle-inline-images" "markdown-toggle-fontify-code-blocks-natively" "all-the-icons-ibuffer-mode" "centaur-update" "flycheck-posframe-mode" "package-autoremove" "markdown-toggle-url-hiding" "xwidget-webkit-browse-url" "centaur-webkit-browse-url" "tooltip-mode" "dap-tooltip-mode" "list-processes" "counsel-company" "company-box-mode" "all-the-icons-ivy-rich-mode" "org-tree-slide-mode" "ivy-rich-mode" "org-roam-server-mode" "lsp-pyright-format-buffer" "all-the-icons-ivy-rich-kill-buffer" "list-packages" "doom-modeline-mode" "checkdoc" "lsp-mode" "lsp-update-server" "lsp-organize-imports" "lsp-install-server" "all-the-icons-insert" "package-install" "treemacs-load-theme" "grip-mode" "persp-mode" "describe-char" "org-toggle-link-display" "display-time" "tab-bar-mode" "tab-bar-switch-to-next-tab" "package-lint-current-buffer" "rainbow-mode" "customize-group" "isearch-forward" ...) :predicate #f(compiled-function (x) #<bytecode 0x1fc8c94baa108f>) :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x :sort t)
apply(#f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially. An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero. Otherwise, use the first occurrence of\nPRESELECT in the collection. Comparison is first done with\n`equal'. If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input. It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0x1b9d2243fe6c543>) ("M-x " ("snails" "toggle-debug-on-error" "snails-quit" "package-refresh-contents" "centaur-update-packages" "package-reinstall" "global-hl-line-mode" "hl-line-mode" "hi-lock-line-face-buffer" "markdown-toggle-inline-images" "markdown-toggle-fontify-code-blocks-natively" "all-the-icons-ibuffer-mode" "centaur-update" "flycheck-posframe-mode" "package-autoremove" "markdown-toggle-url-hiding" "xwidget-webkit-browse-url" "centaur-webkit-browse-url" "tooltip-mode" "dap-tooltip-mode" "list-processes" "counsel-company" "company-box-mode" "all-the-icons-ivy-rich-mode" "org-tree-slide-mode" "ivy-rich-mode" "org-roam-server-mode" "lsp-pyright-format-buffer" "all-the-icons-ivy-rich-kill-buffer" "list-packages" "doom-modeline-mode" "checkdoc" "lsp-mode" "lsp-update-server" "lsp-organize-imports" "lsp-install-server" "all-the-icons-insert" "package-install" "treemacs-load-theme" "grip-mode" "persp-mode" "describe-char" "org-toggle-link-display" "display-time" "tab-bar-mode" "tab-bar-switch-to-next-tab" "package-lint-current-buffer" "rainbow-mode" "customize-group" "isearch-forward" ...) :predicate #f(compiled-function (x) #<bytecode 0x1fc8c94baa108f>) :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x :sort t))
ivy-read("M-x " ("snails" "toggle-debug-on-error" "snails-quit" "package-refresh-contents" "centaur-update-packages" "package-reinstall" "global-hl-line-mode" "hl-line-mode" "hi-lock-line-face-buffer" "markdown-toggle-inline-images" "markdown-toggle-fontify-code-blocks-natively" "all-the-icons-ibuffer-mode" "centaur-update" "flycheck-posframe-mode" "package-autoremove" "markdown-toggle-url-hiding" "xwidget-webkit-browse-url" "centaur-webkit-browse-url" "tooltip-mode" "dap-tooltip-mode" "list-processes" "counsel-company" "company-box-mode" "all-the-icons-ivy-rich-mode" "org-tree-slide-mode" "ivy-rich-mode" "org-roam-server-mode" "lsp-pyright-format-buffer" "all-the-icons-ivy-rich-kill-buffer" "list-packages" "doom-modeline-mode" "checkdoc" "lsp-mode" "lsp-update-server" "lsp-organize-imports" "lsp-install-server" "all-the-icons-insert" "package-install" "treemacs-load-theme" "grip-mode" "persp-mode" "describe-char" "org-toggle-link-display" "display-time" "tab-bar-mode" "tab-bar-switch-to-next-tab" "package-lint-current-buffer" "rainbow-mode" "customize-group" "isearch-forward" ...) :predicate #f(compiled-function (x) #<bytecode 0x1fc8c94baa108f>) :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
counsel-M-x()
funcall-interactively(counsel-M-x)
call-interactively(counsel-M-x nil nil)
#f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\n\nOptional second arg RECORD-FLAG non-nil means unconditionally put\nthis command in the variable `command-history'. Otherwise, that\nis done only if an arg is read using the minibuffer.\n\nThe argument KEYS specifies the value to use instead of the\nreturn value of the `this-command-keys' function when reading the\narguments; if it is nil, `this-command-keys' is used.\n\nThe argument SPECIAL, if non-nil, means that this command is\nexecuting a special event, so ignore the prefix argument and\ndon't clear it." #<bytecode 0x1afd3f3bd61607c3>)(counsel-M-x nil nil nil)
ad-Advice-command-execute(#f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\n\nOptional second arg RECORD-FLAG non-nil means unconditionally put\nthis command in the variable `command-history'. Otherwise, that\nis done only if an arg is read using the minibuffer.\n\nThe argument KEYS specifies the value to use instead of the\nreturn value of the `this-command-keys' function when reading the\narguments; if it is nil, `this-command-keys' is used.\n\nThe argument SPECIAL, if non-nil, means that this command is\nexecuting a special event, so ignore the prefix argument and\ndon't clear it." #<bytecode 0x1afd3f3bd61607c3>) counsel-M-x)
apply(ad-Advice-command-execute #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\n\nOptional second arg RECORD-FLAG non-nil means unconditionally put\nthis command in the variable `command-history'. Otherwise, that\nis done only if an arg is read using the minibuffer.\n\nThe argument KEYS specifies the value to use instead of the\nreturn value of the `this-command-keys' function when reading the\narguments; if it is nil, `this-command-keys' is used.\n\nThe argument SPECIAL, if non-nil, means that this command is\nexecuting a special event, so ignore the prefix argument and\ndon't clear it." #<bytecode 0x1afd3f3bd61607c3>) counsel-M-x)
command-execute(counsel-M-x)