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.67k stars 4.89k forks source link

Helm's action list fails to open with "Cannot split side window or parent of side window" when the current frame is too narrow #16184

Closed kassick closed 11 months ago

kassick commented 11 months ago

Description :octocat:

After https://github.com/emacs-helm/helm/commit/a4380caef3a9e4b1e8d11458852ab67ba9b4cf58 changed helm-show-action-window-other-window's default value to 'left, trying to open the action list for an item fails with Cannot split side window or parent of side window when the frame is too narrow (< 157 chars wide).

When the frame is wide enough ( >= 157 ), then the action window replaces the current result window, regardless of the configured value.

The issue is not present in vanilla emacs using helm on the same version -- the action list is correctly displayed on the left of the current candidates.

The issue happens on emacs-28 and emacs-29 (both tested with a fresh spacemacs config).

Resetting helm-display-function back to the default fixes the issue (though then the helm buffer may be displayed in odd places). The issue seem to be caused by the values provided in spacemacs-helm-display-buffer-regexp. When those conditions are provided, split-window will then fall in

       (and (not (eq window-combination-resize 'side))
         (window-parameter window 'window-side))

condition because (window-parameter window 'window-side) is now 'bottom. split-window will then raise the error.

I'm not sure if there is some tweak we could do in spacemacs//display-helm-window or spacemacs-helm-display-buffer-regexp that would make helm respect the desired position and work with splitted windows for the action list or if we should set helm-show-action-window-other-window to nil by default.

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart:

A Cannot split side window or parent of side window error is displayed; no action list is shown

Expected behaviour: :heart: :smile:

The action list to be shown

System Info :computer:

Backtrace :paw_prints:

Debugger entered--Lisp error: (wrong-number-of-arguments #f(compiled-function (ad--addoit-function window &optional norecord) #<bytecode -0x1000896e52a7d7fe>) 1)
  ad-Advice-select-window(#<subr select-window>)
  apply(ad-Advice-select-window #<subr select-window> nil)
  select-window()
  (window-parameter (select-window) 'split-window)
  eval-expression((window-parameter (select-window) 'split-window) nil nil 127)
  funcall-interactively(eval-expression (window-parameter (select-window) 'split-window) nil nil 127)
  command-execute(eval-expression)
kassick commented 11 months ago

(these settings seem to have been last changed by @syl20bnr back in 2017 ...)

kassick commented 11 months ago

( https://github.com/syl20bnr/spacemacs/issues/9044 is slightly related and may offer some background )