1

I have the following in the display-buffer-alist list:

    (("*"
      (display-buffer-in-side-window
       ((side . left)
        (window-width . 110)))))

While display-buffer-overriding-action is (nil).

If I understand correctly, this means that (display-buffer (get-buffer-create "New buffer")) should be equivalent to (display-buffer-in-side-window (get-buffer-create "New buffer") '((side . left) (window-width . 110)).

But it is not: the first command opens the buffer New buffer at the bottom, but the second one opens it at the left.

Why does this happen?

2 Answers 2

1

The condition needs to be a regular expression, but "*" is not a valid regular expression. If you want to match all buffers, you need ".*" (or perhaps an empty string).

0

I figured it out, the correct code is

(add-to-list 'display-buffer-alist
         '(".*" display-buffer-in-side-window
          (side . left) (window-width . 110)))

The differences are:

  • As Toby Speight said, ".*" should be used in place of "*".
  • The function display-buffer-in-side-window and its arguments should be on the same level as the regex, i.e. not (regex (fun args)) but (regex fun args).

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .