Skip to content

Commit

Permalink
Set Emacs 30 category in display-buffer action
Browse files Browse the repository at this point in the history
* hackernews.el (hackernews--display-items): Specify hackernews
category when displaying rendered buffer.
* README.md (Customization): Give category example for
display-buffer-alist.
  • Loading branch information
basil-conto committed Apr 5, 2024
1 parent 820c324 commit 7c1e9de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,12 @@ If you prefer to roll out your own Elisp, you could add to your
`user-init-file` something as simple as:

```el
(push '("\\`\\*hackernews .*\\*\\'" (display-buffer-same-window))
(push '("\\`\\*hackernews .*\\*\\'" display-buffer-same-window)
display-buffer-alist)
;; ...or equivalently, starting with Emacs 30:
(push '((category . hackernews) display-buffer-same-window)
display-buffer-alist)
```

Expand Down
2 changes: 1 addition & 1 deletion hackernews.el
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ their respective URLs."
;; Persist new offset
(setcar reg (+ (car reg) nitem)))

(pop-to-buffer (current-buffer))
(pop-to-buffer (current-buffer) '(() (category . hackernews)))
(run-hooks 'hackernews-finalize-hook))

;; TODO: Derive from `tabulated-list-mode'?
Expand Down

0 comments on commit 7c1e9de

Please sign in to comment.