summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-21 19:01:36 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-21 19:01:36 +0100
commit565b22e7d26a852504fe09b5316cea06f767e2d1 (patch)
tree3e5cfb1b8020891fe5571636984126720ecb2c31
parentc48db15666159bf5880c4d67374c8fd6e77328fd (diff)
downloadgeiser-565b22e7d26a852504fe09b5316cea06f767e2d1.tar.gz
geiser-565b22e7d26a852504fe09b5316cea06f767e2d1.tar.bz2
Doc browser: section navigation cmmands
Details, details.
-rw-r--r--README32
-rw-r--r--doc/cheat.texi17
-rw-r--r--elisp/geiser-doc.el44
3 files changed, 61 insertions, 32 deletions
diff --git a/README b/README
index 8d7ec09..6140d2f 100644
--- a/README
+++ b/README
@@ -160,20 +160,24 @@
*** In the documentation browser:
- |------------+----------------------------------------------|
- | n, f | Next page |
- | p, b | Previous page |
- | TAB, S-TAB | Next/previous link |
- |------------+----------------------------------------------|
- | k | Kill current page and go to previous or next |
- | g, r | Refresh page |
- | c | Clear browsing history |
- |------------+----------------------------------------------|
- | ., M-. | Edit identifier at point |
- | z | Switch to REPL |
- |------------+----------------------------------------------|
- | q | Bury buffer |
- |------------+----------------------------------------------|
+ |----------+----------------------------------------------|
+ | f | Next page |
+ | b | Previous page |
+ |----------+----------------------------------------------|
+ | TAB, n | Next link |
+ | S-TAB, p | Previous link |
+ | N | Next section |
+ | P | Previous section |
+ |----------+----------------------------------------------|
+ | k | Kill current page and go to previous or next |
+ | g, r | Refresh page |
+ | c | Clear browsing history |
+ |----------+----------------------------------------------|
+ | ., M-. | Edit identifier at point |
+ | z | Switch to REPL |
+ |----------+----------------------------------------------|
+ | q | Bury buffer |
+ |----------+----------------------------------------------|
*** In backtrace (evaluation/compile result) buffers:
diff --git a/doc/cheat.texi b/doc/cheat.texi
index 68e4274..108d5a2 100644
--- a/doc/cheat.texi
+++ b/doc/cheat.texi
@@ -150,13 +150,20 @@
@multitable @columnfractions .20 .4 .4
@headitem Key @tab Command @tab Description
-@item n, f
+@item TAB, n
+@tab forward-button
+@tab Next link
+@item S-TAB, p
+@tab backwards-button
+@tab Previous link
+@item N
+@tab geiser-doc-next-section @tab Next section
+@item P
+@tab geiser-doc-previous-section @tab Previous section
+@item f
@tab geiser-doc-next @tab Next page
-@item p, b
+@item b
@tab geiser-doc-previous @tab Previous page
-@item TAB, S-TAB
-@tab forward-button, backwards-button
-@tab Next/previous link
@item k
@tab geiser-doc-kill-page
@tab Kill current page and go to previous or next
diff --git a/elisp/geiser-doc.el b/elisp/geiser-doc.el
index 7462c4a..1606dc4 100644
--- a/elisp/geiser-doc.el
+++ b/elisp/geiser-doc.el
@@ -262,6 +262,14 @@ With prefix argument, ask for symbol (with completion)."
(symbol-at-point)))))
(when symbol (geiser-doc-symbol symbol))))
+(defconst geiser-doc--sections '(("Procedures:" procs)
+ ("Syntax:" syntax)
+ ("Variables:" vars)
+ ("Submodules:" modules t)))
+
+(defconst geiser-doc--sections-re
+ (format "^%s\n" (regexp-opt (mapcar 'car geiser-doc--sections))))
+
(defun geiser-doc-module (&optional module impl)
"Display information about a given module."
(interactive)
@@ -277,17 +285,11 @@ With prefix argument, ask for symbol (with completion)."
(erase-buffer)
(geiser-doc--insert-title (format "%s" module) t)
(newline)
- (dolist (g '(("Procedures:" . procs)
- ("Syntax:" . syntax)
- ("Variables:" . vars)))
+ (dolist (g geiser-doc--sections)
(geiser-doc--insert-list (car g)
- (cdr (assoc (cdr g) exports))
- module
+ (cdr (assoc (cadr g) exports))
+ (and (not (cddr g)) module)
impl))
- (geiser-doc--insert-list "Submodules:"
- (cdr (assoc 'modules exports))
- nil
- impl)
(setq geiser-doc--buffer-link
(geiser-doc--history-push
(geiser-doc--make-link nil module impl)))
@@ -296,6 +298,18 @@ With prefix argument, ask for symbol (with completion)."
(message "%s done" msg)
(geiser-doc--pop-to-buffer))))
+(defun geiser-doc-next-section ()
+ "Move to next section in this page."
+ (interactive)
+ (next-line)
+ (re-search-forward geiser-doc--sections-re nil t)
+ (previous-line))
+
+(defun geiser-doc-previous-section ()
+ "Move to previous section in this page."
+ (interactive)
+ (re-search-backward geiser-doc--sections-re nil t))
+
(defun geiser-doc-next (&optional forget-current)
"Go to next page in documentation browser.
With prefix, the current page is deleted from history."
@@ -365,12 +379,16 @@ With prefix, the current page is deleted from history."
(switch-to-geiser nil nil (current-buffer)))
(geiser-menu--defmenu doc geiser-doc-mode-map
- ("Next page" ("n" "f") geiser-doc-next "Next item"
+ ("Next link" ("n") forward-button)
+ ("Previous link" ("p") backward-button)
+ ("Next section" ("N") geiser-doc-next-section)
+ ("Previous section" ("P") geiser-doc-previous-section)
+ --
+ ("Next page" ("f") geiser-doc-next "Next item"
:enable (geiser-doc--history-next-p))
- ("Previous page" ("p" "b") geiser-doc-previous "Previous item"
+ ("Previous page" ("b") geiser-doc-previous "Previous item"
:enable (geiser-doc--history-previous-p))
- ("Next link" nil forward-button)
- ("Previous link" nil backward-button)
+ --
("Go to REPL" ("z" "\C-cz" "\C-c\C-z") geiser-doc-switch-to-repl)
("Refresh" ("g" "r") geiser-doc-refresh "Refresh current page")
--