GNU bug report logs -
#40915
[PATCH] Make leaving Info-summary more intuitive
Previous Next
Reported by: Stefan Kangas <stefan <at> marxist.se>
Date: Mon, 27 Apr 2020 22:29:01 UTC
Severity: minor
Tags: patch
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> > For (a), what do you mean by a "general" help
> > command? The point of Info-summary is to provide
> > succinct help about Info.
>
> I meant that you can have a command which works in any major mode very
> easily:
>
> (defun Info-summary ()
> "Display a brief summary of all Info commands."
> (interactive)
> (save-window-excursion
> (switch-to-buffer "*Help*")
> (setq buffer-read-only nil)
> (erase-buffer)
> - (insert (documentation 'Info-mode))
> + (insert (documentation major-mode))
> (help-mode)
> (goto-char (point-min))
> (let (ch flag)
> (while (progn (setq flag (not (pos-visible-in-window-p (point-
> max))))
> (message (if flag "Type Space to see more"
> "Type Space to return to Info"))
> (if (not (eq ?\s (setq ch (read-event))))
> (progn (push ch unread-command-events) nil)
> flag))
> (scroll-up)))
> (bury-buffer "*Help*")))
I see. +1.
But maybe consider something like this instead.
IOW, let it be useful for any major mode, from
anywhere, not just for the current major mode.
(defun summarize-major-mode (mode)
(interactive
(list (completing-read
(format "Mode (default %s): " major-mode)
obarray
(lambda (ss)
(and (commandp ss)
(boundp ss)
(string-match-p "-mode\\'"
(symbol-name ss))))
t nil nil major-mode)))
...) ; The rest as you showed
This bug report was last modified 4 years and 308 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.