Skip to content

Commit

Permalink
Fix spelling of arrangement #41
Browse files Browse the repository at this point in the history
  • Loading branch information
svaante committed Dec 28, 2023
1 parent 4de787c commit 00b2263
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ For complete functionality, activate ~eldoc-mode~ in your source buffers and ena
+ No dependencies

[[https://raw.githubusercontent.com/svaante/dape/resources/c-light-left.png]]
And with ~(setq dape-buffer-window-arrangment 'gud)~ + ~corfu~ as ~completion-in-region-function~.
And with ~(setq dape-buffer-window-arrangement 'gud)~ + ~corfu~ as ~completion-in-region-function~.
[[https://raw.githubusercontent.com/svaante/dape/resources/js-light-gud.png]]
Screenshots taken with [[https://git.sr.ht/~protesilaos/modus-themes][modus-operandi-tinted]].

Expand All @@ -35,10 +35,10 @@ Currently =Dape= does not come with any debug adapter configuration.
(use-package dape
;; To use window configuration like gud (gdb-mi)
;; :init
;; (setq dape-buffer-window-arrangment 'gud)
;; (setq dape-buffer-window-arrangement 'gud)
:config
;; Info buffers to the right
;; (setq dape-buffer-window-arrangment 'right)
;; (setq dape-buffer-window-arrangement 'right)

;; To not display info and/or buffers on startup
;; (remove-hook 'dape-on-start-hooks 'dape-info)
Expand Down
20 changes: 12 additions & 8 deletions dape.el
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,16 @@ Example value:
"`display-buffer' action used when displaying source buffer."
:type 'sexp)

(defcustom dape-buffer-window-arrangment 'left
(defcustom dape-buffer-window-arrangement 'left
"Rules for display dape buffers."
:type '(choice (const :tag "GUD gdb like" gud)
(const :tag "Left side" left)
(const :tag "Right side" right)))

(define-obsolete-variable-alias
'dape-buffer-window-arrangment
'dape-buffer-window-arrangement "0.3.0")

(defcustom dape-stepping-granularity 'line
"The granularity of one step in the stepping requests."
:type '(choice (const :tag "Step statement" statement)
Expand All @@ -341,7 +345,7 @@ Example value:
:type 'natnum)

(defcustom dape-info-hide-mode-line
(and (memql dape-buffer-window-arrangment '(left right)) t)
(and (memql dape-buffer-window-arrangement '(left right)) t)
"Hide mode line in dape info buffers."
:type 'boolean)

Expand Down Expand Up @@ -814,23 +818,23 @@ On SKIP-PROCESS-BUFFERS skip deletion of buffers which has processes."
(kill-buffer buffer)))))

(defun dape--display-buffer (buffer)
"Display BUFFER according to `dape-buffer-window-arrangment'."
"Display BUFFER according to `dape-buffer-window-arrangement'."
(display-buffer
buffer
(let ((mode (with-current-buffer buffer major-mode)))
(pcase dape-buffer-window-arrangment
(pcase dape-buffer-window-arrangement
((or 'left 'right)
(cons '(display-buffer-in-side-window)
(pcase mode
('dape-repl-mode '((side . bottom) (slot . -1)))
('shell-mode '((side . bottom) (slot . 1)))
((or 'dape-info-scope-mode 'dape-info-watch-mode)
`((side . ,dape-buffer-window-arrangment) (slot . -1)))
`((side . ,dape-buffer-window-arrangement) (slot . -1)))
((or 'dape-info-stack-mode 'dape-info-modules-mode
'dape-info-sources-mode)
`((side . ,dape-buffer-window-arrangment) (slot . 0)))
`((side . ,dape-buffer-window-arrangement) (slot . 0)))
((or 'dape-info-breakpoints-mode 'dape-info-threads-mode)
`((side . ,dape-buffer-window-arrangment) (slot . 1)))
`((side . ,dape-buffer-window-arrangement) (slot . 1)))
(_ (error "Unable to display buffer of mode `%s'" mode)))))
('gud
(pcase mode
Expand All @@ -847,7 +851,7 @@ On SKIP-PROCESS-BUFFERS skip deletion of buffers which has processes."
((or 'dape-info-breakpoints-mode 'dape-info-threads-mode)
'((display-buffer-in-side-window) (side . bottom) (slot . 1)))
(_ (error "Unable to display buffer of mode `%s'" mode))))
(_ (user-error "Invalid value of `dape-buffer-window-arrangment'"))))))
(_ (user-error "Invalid value of `dape-buffer-window-arrangement'"))))))


;;; Process and parsing
Expand Down

0 comments on commit 00b2263

Please sign in to comment.