commit 3744185e7bcec54baf72339850a94178718fda15
parent d4a7aa11c282358e1882b390a1a9dc94275b34d6
Author: Lou Woell <lou.woell@posteo.de>
Date: Sun, 14 Sep 2025 13:24:13 +0200
[haredoc.el] headerline for haredoc-mode
Diffstat:
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/haredoc.el b/haredoc.el
@@ -104,6 +104,8 @@
(put 'haredoc-forward-stack 'permanent-local t)
(defvar-local haredoc-stack-item nil)
(put 'haredoc-stack-item 'permanent-local t)
+(defvar-local haredoc-current-path nil)
+(put 'haredoc-current-path 'permanent-local t)
(defvar-local haredoc-namespace nil)
(put 'haredoc-namespace 'permanent-local t)
@@ -138,17 +140,17 @@ the results in a new buffer."
(module? (= col line 0))
(namespace (if module? current-word
(string-join (butlast components) "::")))
- (buffer (get-buffer-create "*haredoc*")))
(when haredoc-stack-item
(push haredoc-stack-item haredoc-backward-stack)
(setq haredoc-forward-stack nil))
(setq haredoc-stack-item current-word)
- (let ((inhibit-read-only t))
+
+ (let ((buffer (get-buffer-create "*haredoc*"))
+ (inhibit-read-only t))
(with-current-buffer buffer
- (setq haredoc-namespace namespace)
(erase-buffer)
- ;; 'display-buffer-same-window nil
- (insert "\033[1;4m" current-word "\033[0m")
+ (setq haredoc-current-path current-word)
+ (setq haredoc-namespace namespace)
(ensure-empty-lines 1)
(with-environment-variables
@@ -177,9 +179,10 @@ the results in a new buffer."
(insert-text-button "[forw]" :type 'haredoc-forw))
(insert "\n")))
- (haredoc-mode)
(goto-char (point-min))
- (display-buffer buffer)))))
+ (haredoc-mode)
+ (display-buffer buffer)
+ ))))
;;;###autoload
(defun haredoc/describe-thing-at-point ()
@@ -252,7 +255,8 @@ the results in a new buffer."
"N" 'haredoc/narrow
"w" 'haredoc/widen))
-(define-derived-mode haredoc-mode help-mode "🐇")
+(define-derived-mode haredoc-mode help-mode "🐇"
+ (setq header-line-format `((:propertize ,haredoc-current-path face bold))))
(provide 'haredoc)
;;; haredoc.el ends here