xhcoding / emacs-aichat

AI Chat in Emacs, including OpenAI and Bing Chat
61 stars 9 forks source link

how can i display buffer on the right side instead of the bottom? #26

Open yongzhengw opened 1 year ago

yongzhengw commented 1 year ago

I want to make the buffer display on the right side instead of the bottom. How can I do that?

xhcoding commented 1 year ago

set aichat-bingai-assistant-display-function, https://github.com/xhcoding/emacs-aichat#options

yongzhengw commented 1 year ago

Sorry, I’m not familiar with emacs, I tried (setq aichat-bingai-chat-display-function 'display-buffer-in-side-window), not working

then i tried

(defcustom aichat-openai-assistant-display-function
  (lambda (buffer alist)
    (display-buffer-in-side-window buffer (cons '(side . right) alist)))
  "The function of display `aichat-openai-assistant-buffer'."
  :group 'aichat
  :type 'symbol)

still not working, can you give me an example, thanks

xhcoding commented 1 year ago

If you are not using any window management plugins, you can set the display-buffer-alist variable.

(add-to-list 'display-buffer-alist '("*Aichat-BingAI-Assistant*"  display-buffer-in-side-window))