From 7c1e9de10fd6b299d45b383302d223d7e3285da9 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Fri, 5 Apr 2024 10:07:12 +0200 Subject: [PATCH] Set Emacs 30 category in display-buffer action * hackernews.el (hackernews--display-items): Specify hackernews category when displaying rendered buffer. * README.md (Customization): Give category example for display-buffer-alist. --- README.md | 7 ++++++- hackernews.el | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b48f9b8..6c3420f 100644 --- a/README.md +++ b/README.md @@ -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) ``` diff --git a/hackernews.el b/hackernews.el index 72fc484..9fffd1b 100644 --- a/hackernews.el +++ b/hackernews.el @@ -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'?