File tree 2 files changed +21
-3
lines changed
2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -37,3 +37,16 @@ manual intervention, use:
37
37
(add-hook 'compilation-start-hook #'epithet-rename-buffer-ignoring-arguments)
38
38
(add-hook 'compilation-finish-functions #'epithet-rename-buffer-ignoring-arguments)
39
39
#+end_src
40
+
41
+ Due to a quirk in =describe-bindings=, even though it produces a help
42
+ mode buffer, having =epithet-rename-buffer= in the =help-mode-hook= will
43
+ not rename the buffer it creates. If you want those buffers renamed
44
+ automatically too, you should also add this to your configuration:
45
+
46
+ #+begin_src emacs-lisp
47
+ (defun rename-describe-bindings (&rest _)
48
+ (with-current-buffer (help-buffer)
49
+ (epithet-rename-buffer)))
50
+
51
+ (advice-add 'describe-bindings :after #'rename-describe-bindings)
52
+ #+end_src
Original file line number Diff line number Diff line change 64
64
65
65
(defun epithet-for-help ()
66
66
" Suggest a name for a `help-mode' buffer."
67
- (when (and (derived-mode-p 'help-mode ) (equal (buffer-name ) " *Help*" ))
67
+ (when (and (derived-mode-p 'help-mode )
68
+ (equal (buffer-name ) " *Help*" )
69
+ (not (and (eq (car help-xref-stack-item) 'describe-bindings )
70
+ (= (buffer-size ) 0 ))))
68
71
(format " *Help: %s * " (pcase help-xref-stack-item
69
- (`(describe-bindings nil , buffer )
70
- (format " describe-bindings for %s " (with-current-buffer buffer major-mode)))
72
+ ((or `(,(and fn 'describe-bindings ) , _ , buffer )
73
+ `(,(and fn 'describe-mode ) , buffer ))
74
+ (format " %s for %s "
75
+ fn (buffer-local-value 'major-mode buffer)))
71
76
(`(, _ , name , _ ) name)))))
72
77
73
78
(defun epithet-for-occur ()
You can’t perform that action at this time.
0 commit comments