[emacs-berlin] Mastering Emacs

Andreas Röhler andreas.roehler at easy-emacs.de
Thu Sep 28 06:01:11 UTC 2023


Hi Diez,

tried it after doing some compilation.

Got an error:


Debugger entered--Lisp error: (error "No side windows state found")
   signal(error ("No side windows state found"))
   error("No side windows state found")
   window-toggle-side-windows()
   (cond ((null arg) (window-toggle-side-windows)) ((listp arg) 
(deets/side-window-resize t)) ((symbolp arg) (deets/side-window-resize 
nil)))
   deets/side-window-toggle(nil)
   funcall-interactively(deets/side-window-toggle nil)
   call-interactively(deets/side-window-toggle nil nil)
   (prog1 (call-interactively cmd record-flag keys) (let* ((info (and t 
(and (symbolp cmd) (not (get cmd ...)) (get cmd 'byte-obsolete-info))))) 
(if info (progn (put cmd 'command-execute-obsolete-warned t) (message 
"%s" (macroexp--obsolete-warning cmd info "command" 
(help--key-description-fontified (where-is-internal ... nil t))))) nil)))
   (cond ((arrayp final) (if record-flag (progn (add-to-history 
'command-history (list 'execute-kbd-macro final prefixarg) nil t))) 
(execute-kbd-macro final prefixarg)) (t (prog1 (call-interactively cmd 
record-flag keys) (let* ((info (and t (and ... ... ...)))) (if info 
(progn (put cmd 'command-execute-obsolete-warned t) (message "%s" 
(macroexp--obsolete-warning cmd info "command" ...))) nil)))))
   (let ((final cmd)) (while (progn (setq final (indirect-function 
final)) (if (autoloadp final) (setq final (autoload-do-load final 
cmd))))) (cond ((arrayp final) (if record-flag (progn (add-to-history 
'command-history (list 'execute-kbd-macro final prefixarg) nil t))) 
(execute-kbd-macro final prefixarg)) (t (prog1 (call-interactively cmd 
record-flag keys) (let* ((info (and t ...))) (if info (progn (put cmd 
... t) (message "%s" ...)) nil))))))
   (if (and (symbolp cmd) (get cmd 'disabled) (or (and (setq query (and 
(consp (get cmd ...)) (eq (car ...) 'query))) (not 
(command-execute--query cmd))) (and (not query) 
disabled-command-function))) (if (not query) (progn (run-hooks 
'disabled-command-function))) (let ((final cmd)) (while (progn (setq 
final (indirect-function final)) (if (autoloadp final) (setq final 
(autoload-do-load final cmd))))) (cond ((arrayp final) (if record-flag 
(progn (add-to-history 'command-history (list ... final prefixarg) nil 
t))) (execute-kbd-macro final prefixarg)) (t (prog1 (call-interactively 
cmd record-flag keys) (let* ((info ...)) (if info (progn ... ...) nil)))))))
   (let ((prefixarg (if special nil (prog1 prefix-arg (setq 
current-prefix-arg prefix-arg) (setq prefix-arg nil) (if 
current-prefix-arg (progn (prefix-command-update)))))) query) (if (and 
(symbolp cmd) (get cmd 'disabled) (or (and (setq query (and (consp ...) 
(eq ... ...))) (not (command-execute--query cmd))) (and (not query) 
disabled-command-function))) (if (not query) (progn (run-hooks 
'disabled-command-function))) (let ((final cmd)) (while (progn (setq 
final (indirect-function final)) (if (autoloadp final) (setq final 
(autoload-do-load final cmd))))) (cond ((arrayp final) (if record-flag 
(progn (add-to-history ... ... nil t))) (execute-kbd-macro final 
prefixarg)) (t (prog1 (call-interactively cmd record-flag keys) (let* 
(...) (if info ... nil))))))))
   command-execute(deets/side-window-toggle)

Whereas install seems to work:

display-buffer-alist is a variable defined in ‘window.el’.

Its value is
(("\\*deadgrep.*\\|\\*Compilation\\*" (display-buffer-in-side-window)
   (side . bottom) (slot . 0)
   (window-parameters (no-delete-other-windows . t))))
Original value was nil

Grüße,

Andreas

Am 20.05.23 um 10:20 schrieb Diez B. Roggisch:
> I improved my code a bit, it looks like this now:
>
>
>   (setq switch-to-buffer-obey-display-actions t)
>   ;; Introduce a bottom side window that catches
>   ;; compilations, deadgreps etc.
>   (add-to-list 'display-buffer-alist
>    '("\\*deadgrep.*\\|\\*Compilation\\*"
>      (display-buffer-in-side-window)
>      (side . bottom)
>      (slot . 0)
>      (window-parameters
>       (no-delete-other-windows . t))))
>
>   (defun deets/side-window-resize (enlarge)
>     (let ((bottom-windows (window-at-side-list (window-normalize-frame
> nil) 'bottom)))
>       (dolist (window bottom-windows)
>         (when (symbolp (window-parameter window 'window-side))
>           (if enlarge
>               (window-resize window (window-height window))
>             (window-resize window (- (/ (window-height window) 2))))))))
>
>   (defun deets/side-window-toggle (arg)
>     (interactive "P")
>     (cond ((null arg) (window-toggle-side-windows))
>           ((listp arg) (deets/side-window-resize t))
>           ((symbolp arg) (deets/side-window-resize nil))))
>
>   ;; Remove our side-windows
>   (global-set-key (read-kbd-macro "C-x w") 'deets/side-window-toggle)
>
>
> Now using prefix-arguments (C-u C-x w) and (C-u - C-x w) the bottom side
> window is doubled or halved in size. Very useful for me. I'm already
> thinking about putting documentation/info/etc to the right side.
>
> Diez
>
> On 19.05.23 12:34, Andreas Röhler wrote:
>> Danke!
>>
>> Am 19.05.23 um 11:56 schrieb Diez B. Roggisch:
>>> Hey fellow Emacsians,
>>>
>>> I've just bought a copy of "Mastering Emacs", first and foremost to
>>> appreciate the author for this article:
>>>
>>>
>>>  https://www.masteringemacs.org/article/demystifying-emacs-window-manager 
>>>
>>>
>>>
>>>
>>> This has since just a few hours already changed my emacs life. I've
>>> always been annoyed by process buffers (compilation, ripgrep/deadgrep,
>>> etc) getting their own window, destroying my C-x 0, 1, 2, 3 - based
>>> window arrangement. Since this morning I'm using the following tiny
>>> snippet to manage (for now just a bottom) side windows:
>>>
>>>   (setq switch-to-buffer-obey-display-actions t)
>>>   ;; Introduce a bottom side window that catches
>>>   ;; compilations, deadgreps etc.
>>>   (add-to-list 'display-buffer-alist
>>>    '("\\*deadgrep.*\\|\\*Compilation\\*"
>>>      (display-buffer-in-side-window)
>>>      (side . bottom)
>>>      (slot . 0)
>>>      (window-parameters
>>>       (no-delete-other-windows . t))))
>>>   ;; Remove our side-windows
>>>   (global-set-key (read-kbd-macro "C-x w") 'window-toggle-side-windows)
>>>
>>> Life-changing for me. The rex was created with buffer list view and
>>> re-builder, the latter I also learned from the author of the book. I'm
>>> sure there's plenty of more stuff to discover once I dive deeper into
>>> the e-book! Which I read with 'nov-mode' now courtesy to his
>>> suggestion ;)
>>>
>>> Just wanted to make you aware of the website, the Emacs functionality,
>>> and the book so you can share my enjoyment.
>>>
>>> Happy hacking,
>>>
>>> Diez
>>>
>>> _______________________________________________
>>> emacs-berlin mailing list
>>> emacs-berlin at emacs-berlin.org
>>> https://mailb.org/mailman/listinfo/emacs-berlin
>> _______________________________________________
>> emacs-berlin mailing list
>> emacs-berlin at emacs-berlin.org
>> https://mailb.org/mailman/listinfo/emacs-berlin
> _______________________________________________
> emacs-berlin mailing list
> emacs-berlin at emacs-berlin.org
> https://mailb.org/mailman/listinfo/emacs-berlin


More information about the emacs-berlin mailing list