emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master c2b330b 091/272: doc/ivy.org: Add @vindex and @kindex auto


From: Oleh Krehel
Subject: [elpa] master c2b330b 091/272: doc/ivy.org: Add @vindex and @kindex automatically
Date: Mon, 25 Apr 2016 10:13:18 +0000

branch: master
commit c2b330bfeadc690817472443805733627e558764
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    doc/ivy.org: Add @vindex and @kindex automatically
    
    * doc/ivy-ox.el (info-ivy): New command - easy way to reload the manual.
---
 doc/ivy-ox.el |   43 +++++++++++++++++++++---
 doc/ivy.org   |   16 +++++++--
 doc/ivy.texi  |  103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 3 files changed, 151 insertions(+), 11 deletions(-)

diff --git a/doc/ivy-ox.el b/doc/ivy-ox.el
index 37c13ec..cb69c7f 100644
--- a/doc/ivy-ox.el
+++ b/doc/ivy-ox.el
@@ -129,10 +129,24 @@ contextual information."
                                     (string-trim
                                      (substring s (1+ (match-end 1))))))
                            ((string-match "\\(.*\\)$" s)
-                            (format "@subsubheading address@hidden@end 
indentedblock"
-                                    (match-string 1 s)
-                                    (string-trim
-                                     (substring s (1+ (match-end 1))))))
+                            (let* ((line (match-string 1 s))
+                                   (body (string-trim
+                                          (substring s (1+ (match-end 1)))))
+                                   (symbol-index
+                                    (if (string-match 
"@code{\\(\\(?:ivy\\|swiper\\|counsel\\)-[^}]+\\)}" line)
+                                        (format "@vindex %s\n" (match-string 1 
line))
+                                      ""))
+                                   (key-index
+                                    (apply #'concat
+                                           (mapcar
+                                            (lambda (s)
+                                              (format "@kindex %s\n" s))
+                                            (iox-extract-kbd line)))))
+                              (format "@subsubheading address@hidden@end 
indentedblock"
+                                      line
+                                      (concat symbol-index
+                                              key-index)
+                                      body)))
                            (t
                             (concat "@subsubheading " s))))
                    (split-string (substring-no-properties contents) 
"address@hidden " t)
@@ -142,6 +156,14 @@ contextual information."
               contents
               list-type))))
 
+(defun iox-extract-kbd (str)
+  (let ((start 0)
+        res)
+    (while (string-match "@kbd{\\([^}]+\\)}" str start)
+      (setq start (match-end 0))
+      (push (match-string 1 str) res))
+    (nreverse res)))
+
 ;;* ox-html
 (require 'ox-html)
 (setq org-html-validation-link nil)
@@ -155,4 +177,17 @@ contextual information."
         (verbatim . "<code>%s</code>")))
 (setq org-html-style-default nil)
 
+(defvar ivy-info-dir (file-name-directory
+                      (or load-file-name
+                          (buffer-file-name))))
+
+(defun info-ivy ()
+  (interactive)
+  (let ((buf (get-buffer "*info*")))
+    (when buf
+      (kill-buffer buf)))
+  (Info-find-node
+   (expand-file-name "ivy.info" ivy-info-dir)
+   "Top"))
+
 (provide 'ivy-ox)
diff --git a/doc/ivy.org b/doc/ivy.org
index 4d20cce..8a00bdd 100644
--- a/doc/ivy.org
+++ b/doc/ivy.org
@@ -8,8 +8,6 @@
 #+TEXINFO_DIR_DESC: Using Ivy for completion.
 #+SETUPFILE: ~/git/org-html-themes/setup/theme-readtheorg.setup
 #+HTML_HEAD: <link rel="stylesheet" type="text/css" href="kbd-style.css"/>
-#+EXPORT_FILE_NAME: index.html
-
 #+OPTIONS: H:6 num:6 toc:4
 #+STARTUP: indent
 * Setup                                                                        
       :noexport:
@@ -25,6 +23,13 @@ paragraphs. New paragraphs can also be started, as long as 
they have
 the 5 spaces indent.
 Definition lists need to be separated from regular lists with two newlines.
 
+Many times, definitions lists like this one are used:
+#+BEGIN_EXAMPLE
+- ~C-M-j~ (=ivy-immediate-done=) ::
+#+END_EXAMPLE
+The code and kbd part of this heading will be recognized and added as
address@hidden and address@hidden appropriately.
+
 For declaring a address@hidden section for =defcustom= or =defvar=, also
 use definition lists. They need to have the following form in order to
 be recognized in the texinfo export:
@@ -265,6 +270,7 @@ The recommended key bindings are:
 :CUSTOM_ID: minibuffer-key-bindings
 :END:
 
+#+VINDEX: ivy-minibuffer-map
 Ivy includes several minibuffer bindings, which are defined in the
 =ivy-minibuffer-map= keymap variable. The most frequently used ones
 are described here.
@@ -1270,3 +1276,9 @@ that they appear:
 :INDEX:    vr
 :CUSTOM_ID: variable-index
 :END:
+
+* Keystroke Index
+:PROPERTIES:
+:CUSTOM_ID: key-index
+:INDEX:    ky
+:END:
diff --git a/doc/ivy.texi b/doc/ivy.texi
index dc7c156..9a2ab4a 100644
--- a/doc/ivy.texi
+++ b/doc/ivy.texi
@@ -67,6 +67,7 @@ modify this GNU manual.''
 * Commands::
 * API::
 * Variable Index::
+* Keystroke Index::
 
 @detailmenu
 --- The Detailed Node Listing ---
@@ -88,8 +89,8 @@ Key bindings
 Minibuffer key bindings
 
 * Key bindings for navigation::
-* Key bindings for single selection, action, then exit minibuffer: Key 
bindings for single selection action then exit minibuffer.
-* Key bindings for multiple selections and actions, keep minibuffer open: Key 
bindings for multiple selections and actions keep minibuffer open.
+* Key bindings for single selection, action, then exit minibuffer: Key 
bindings for single selection action then exit minibuffer. 
+* Key bindings for multiple selections and actions, keep minibuffer open: Key 
bindings for multiple selections and actions keep minibuffer open. 
 * Key bindings that alter the minibuffer input::
 * Other key bindings::
 * Hydra in the minibuffer::
@@ -347,6 +348,7 @@ The recommended key bindings are:
 @node Minibuffer key bindings
 @section Minibuffer key bindings
 
address@hidden ivy-minibuffer-map
 Ivy includes several minibuffer bindings, which are defined in the
 @code{ivy-minibuffer-map} keymap variable. The most frequently used ones
 are described here.
@@ -362,8 +364,8 @@ fully capable editing area: bindings like @kbd{C-a}, 
@kbd{C-f}, @kbd{M-d},
 @code{fundamental-mode} buffer.
 @menu
 * Key bindings for navigation::
-* Key bindings for single selection, action, then exit minibuffer: Key 
bindings for single selection action then exit minibuffer.
-* Key bindings for multiple selections and actions, keep minibuffer open: Key 
bindings for multiple selections and actions keep minibuffer open.
+* Key bindings for single selection, action, then exit minibuffer: Key 
bindings for single selection action then exit minibuffer. 
+* Key bindings for multiple selections and actions, keep minibuffer open: Key 
bindings for multiple selections and actions keep minibuffer open. 
 * Key bindings that alter the minibuffer input::
 * Other key bindings::
 * Hydra in the minibuffer::
@@ -417,22 +419,31 @@ action to run. This delayed flexibility and customization 
of actions
 extends usability of lists in Emacs.
 
 @subsubheading @kbd{C-m} or @kbd{RET} (@code{ivy-done})
address@hidden ivy-done
address@hidden C-m
address@hidden RET
 @indentedblock
 Calls the default action and exits the minibuffer.
 @end indentedblock
 @subsubheading @kbd{M-o} (@code{ivy-dispatching-done})
address@hidden ivy-dispatching-done
address@hidden M-o
 @indentedblock
 Presents all available valid actions from which to choose. When
 there is only one action available, there is no difference
 between @kbd{M-o} and @kbd{C-m}.
 @end indentedblock
 @subsubheading @kbd{C-j} (@code{ivy-alt-done})
address@hidden ivy-alt-done
address@hidden C-j
 @indentedblock
 When completing file names, selects the current directory
 candidate and starts a new completion session there. Otherwise,
 it's the same as @code{ivy-done}.
 @end indentedblock
 @subsubheading @kbd{TAB} (@code{ivy-partial-or-done})
address@hidden ivy-partial-or-done
address@hidden TAB
 @indentedblock
 Attempts partial completion, extending current input as much as
 possible. @kbd{TAB TAB} is the same as @kbd{C-j}.
@@ -450,6 +461,8 @@ Example ERT test:
 @end lisp
 @end indentedblock
 @subsubheading @kbd{C-M-j} (@code{ivy-immediate-done})
address@hidden ivy-immediate-done
address@hidden C-M-j
 @indentedblock
 Exits with @emph{the current input} instead of @emph{the current candidate}
 (like other commands).
@@ -460,6 +473,8 @@ case, using @kbd{C-j} would select that existing file, 
which isn't
 what you want - use this command instead.
 @end indentedblock
 @subsubheading @kbd{C-'} (@code{ivy-avy})
address@hidden ivy-avy
address@hidden C-'
 @indentedblock
 Uses avy to select one of the candidates on the current candidate
 page.  This can often be faster than multiple @kbd{C-n} or @kbd{C-p}
@@ -478,6 +493,8 @@ version of the regular commands that enables applying 
multiple
 actions.
 
 @subsubheading @kbd{C-M-m} (@code{ivy-call})
address@hidden ivy-call
address@hidden C-M-m
 @indentedblock
 Is the non-exiting version of @kbd{C-m} (@code{ivy-done}).
 
@@ -488,6 +505,8 @@ functions list invokes @code{describe-function}. When 
combined with
 succession.
 @end indentedblock
 @subsubheading @kbd{C-M-o} (@code{ivy-dispatching-call})
address@hidden ivy-dispatching-call
address@hidden C-M-o
 @indentedblock
 Is the non-exiting version of @kbd{M-o} (@code{ivy-dispatching-done}).
 
@@ -497,6 +516,8 @@ For example, during the @code{counsel-rhythmbox} 
completion, press
 the default one after @kbd{C-M-o}.
 @end indentedblock
 @subsubheading @kbd{C-M-n} (@code{ivy-next-line-and-call})
address@hidden ivy-next-line-and-call
address@hidden C-M-n
 @indentedblock
 Combines @kbd{C-n} and @kbd{C-M-m}. Applies an action and moves to next
 line.
@@ -507,6 +528,8 @@ Comes in handy when opening multiple files from
 action on each successive element of the list.
 @end indentedblock
 @subsubheading @kbd{C-M-p} (@code{ivy-previous-line-and-call})
address@hidden ivy-previous-line-and-call
address@hidden C-M-p
 @indentedblock
 Combines @kbd{C-p} and @kbd{C-M-m}.
 
@@ -514,6 +537,7 @@ Similar to the above except it moves through the list in the
 other direction.
 @end indentedblock
 @subsubheading @code{ivy-resume}
address@hidden ivy-resume
 @indentedblock
 Recalls the state of the completion session just before its last exit.
 
@@ -524,6 +548,8 @@ Useful after an accidental @kbd{C-m} (@code{ivy-done}).
 @subsection Key bindings that alter the minibuffer input
 
 @subsubheading @kbd{M-n} (@code{ivy-next-history-element})
address@hidden ivy-next-history-element
address@hidden M-n
 @indentedblock
 Cycles forward through the Ivy command history.
 
@@ -532,10 +558,14 @@ history list is empty, @kbd{M-n} inserts symbol (or URL) 
at point
 into the minibuffer.
 @end indentedblock
 @subsubheading @kbd{M-p} (@code{ivy-previous-history-element})
address@hidden ivy-previous-history-element
address@hidden M-p
 @indentedblock
 Cycles forward through the Ivy command history.
 @end indentedblock
 @subsubheading @kbd{M-i} (@code{ivy-insert-current})
address@hidden ivy-insert-current
address@hidden M-i
 @indentedblock
 Inserts the current candidate into the minibuffer.
 
@@ -544,6 +574,8 @@ insert the original file name string, edit it, and then 
@kbd{C-m} to
 complete the renaming.
 @end indentedblock
 @subsubheading @kbd{M-j} (@code{ivy-yank-word})
address@hidden ivy-yank-word
address@hidden M-j
 @indentedblock
 Inserts the sub-word at point into the minibuffer.
 
@@ -551,6 +583,8 @@ This is similar to @kbd{C-s C-w} with @code{isearch}. Ivy 
reserves @kbd{C-w}
 for @code{kill-region}.
 @end indentedblock
 @subsubheading @kbd{S-SPC} (@code{ivy-restrict-to-matches})
address@hidden ivy-restrict-to-matches
address@hidden S-SPC
 @indentedblock
 Deletes the current input, and resets the candidates list to the
 currently restricted matches.
@@ -558,6 +592,8 @@ currently restricted matches.
 This is how Ivy provides narrowing in successive tiers.
 @end indentedblock
 @subsubheading @kbd{C-r} (@code{ivy-reverse-i-search})
address@hidden ivy-reverse-i-search
address@hidden C-r
 @indentedblock
 Starts a recursive completion session through the command's
 history.
@@ -571,6 +607,8 @@ selected candidate string is inserted into the minibuffer.
 @subsection Other key bindings
 
 @subsubheading @kbd{M-w} (@code{ivy-kill-ring-save})
address@hidden ivy-kill-ring-save
address@hidden M-w
 @indentedblock
 Copies selected candidates to the kill ring.
 
@@ -581,6 +619,7 @@ When the region is active, copies active region instead.
 @subsection Hydra in the minibuffer
 
 @subsubheading @kbd{C-o} (@code{hydra-ivy/body})
address@hidden C-o
 @indentedblock
 Invokes the hydra menu with short key bindings.
 @end indentedblock
@@ -628,35 +667,51 @@ Additionally, you get access to the folowing commands 
that are
 normally not bound:
 
 @subsubheading @kbd{c} (@code{ivy-toggle-calling})
address@hidden ivy-toggle-calling
address@hidden c
 @indentedblock
 Toggle calling the action after each candidate change. This
 effectively modifies @kbd{j} to @kbd{jg}, @kbd{k} to @kbd{kg} etc.
 @end indentedblock
 @subsubheading @kbd{m} (@code{ivy-toggle-fuzzy})
address@hidden ivy-toggle-fuzzy
address@hidden m
 @indentedblock
 Toggle the current regexp matcher.
 @end indentedblock
 @subsubheading @kbd{>} (@code{ivy-minibuffer-grow})
address@hidden ivy-minibuffer-grow
address@hidden >
 @indentedblock
 Increase @code{ivy-height} for the current minibuffer.
 @end indentedblock
 @subsubheading @kbd{<} (@code{ivy-minibuffer-shrink})
address@hidden ivy-minibuffer-shrink
address@hidden <
 @indentedblock
 Decrease @code{ivy-height} for the current minibuffer.
 @end indentedblock
 @subsubheading @kbd{w} (@code{ivy-prev-action})
address@hidden ivy-prev-action
address@hidden w
 @indentedblock
 Select the previous action.
 @end indentedblock
 @subsubheading @kbd{s} (@code{ivy-next-action})
address@hidden ivy-next-action
address@hidden s
 @indentedblock
 Select the next action.
 @end indentedblock
 @subsubheading @kbd{a} (@code{ivy-read-action})
address@hidden ivy-read-action
address@hidden a
 @indentedblock
 Use a menu to select an action.
 @end indentedblock
 @subsubheading @kbd{C} (@code{ivy-toggle-case-fold})
address@hidden ivy-toggle-case-fold
address@hidden C
 @indentedblock
 Toggle case folding (matching both upper and lower case
 characters with lower case input).
@@ -666,6 +721,8 @@ characters with lower case input).
 @subsection Saving the current completion session to a buffer
 
 @subsubheading @kbd{C-c C-o} (@code{ivy-occur})
address@hidden ivy-occur
address@hidden C-c C-o
 @indentedblock
 Saves the current candidates to a new buffer and exits
 completion.
@@ -674,30 +731,42 @@ completion.
 The new buffer is read-only and has a few useful bindings defined.
 
 @subsubheading @kbd{RET} or @kbd{j} (@code{ivy-occur-press})
address@hidden ivy-occur-press
address@hidden RET
address@hidden j
 @indentedblock
 Call the current action on the selected candidate.
 @end indentedblock
 @subsubheading @kbd{mouse-1} (@code{ivy-occur-click})
address@hidden ivy-occur-click
address@hidden mouse-1
 @indentedblock
 Call the current action on the selected candidate.
 @end indentedblock
 @subsubheading @kbd{j} (@code{next-line})
address@hidden j
 @indentedblock
 Move to next line.
 @end indentedblock
 @subsubheading @kbd{k} (@code{previous-line})
address@hidden k
 @indentedblock
 Move to previous line.
 @end indentedblock
 @subsubheading @kbd{a} (@code{ivy-occur-read-action})
address@hidden ivy-occur-read-action
address@hidden a
 @indentedblock
 Read an action and make it current for this buffer.
 @end indentedblock
 @subsubheading @kbd{o} (@code{ivy-occur-dispatch})
address@hidden ivy-occur-dispatch
address@hidden o
 @indentedblock
 Read an action and call it on the selected candidate.
 @end indentedblock
 @subsubheading @kbd{q} (@code{quit-window})
address@hidden q
 @indentedblock
 Bury the current buffer.
 @end indentedblock
@@ -845,26 +914,32 @@ toggle it during completion with @kbd{C-o m}.
 @section Faces
 
 @subsubheading @code{ivy-current-match}
address@hidden ivy-current-match
 @indentedblock
 Highlights the currently selected candidate.
 @end indentedblock
 @subsubheading @code{ivy-minibuffer-match-face-1}
address@hidden ivy-minibuffer-match-face-1
 @indentedblock
 Highlights the background of the match.
 @end indentedblock
 @subsubheading @code{ivy-minibuffer-match-face-2}
address@hidden ivy-minibuffer-match-face-2
 @indentedblock
 Highlights the first (modulo 3) matched group.
 @end indentedblock
 @subsubheading @code{ivy-minibuffer-match-face-3}
address@hidden ivy-minibuffer-match-face-3
 @indentedblock
 Highlights the second (modulo 3) matched group.
 @end indentedblock
 @subsubheading @code{ivy-minibuffer-match-face-4}
address@hidden ivy-minibuffer-match-face-4
 @indentedblock
 Highlights the third (modulo 3) matched group.
 @end indentedblock
 @subsubheading @code{ivy-confirm-face}
address@hidden ivy-confirm-face
 @indentedblock
 Highlights the "(confirm)" part of the prompt.
 
@@ -886,6 +961,7 @@ prompt will be appended with "(confirm)". Press @kbd{RET} 
once more
 to confirm, or any key to continue the completion.
 @end indentedblock
 @subsubheading @code{ivy-match-required-face}
address@hidden ivy-match-required-face
 @indentedblock
 Highlights the "(match required)" part of the prompt.
 
@@ -899,14 +975,17 @@ For example, call @code{describe-variable}, enter "waldo" 
and press
 Press any key and the prompt warning will disappear.
 @end indentedblock
 @subsubheading @code{ivy-subdir}
address@hidden ivy-subdir
 @indentedblock
 Highlights directories when completing file names.
 @end indentedblock
 @subsubheading @code{ivy-remote}
address@hidden ivy-remote
 @indentedblock
 Highlights remote files when completing file names.
 @end indentedblock
 @subsubheading @code{ivy-virtual}
address@hidden ivy-virtual
 @indentedblock
 Highlights virtual buffers when completing buffer names.
 
@@ -1182,30 +1261,39 @@ Since file name completion is so essential, ivy has a 
few extra
 bindings that work here.
 
 @subsubheading @kbd{C-j} (@code{ivy-alt-done})
address@hidden ivy-alt-done
address@hidden C-j
 @indentedblock
 Use on a directory to restart the completion from that
 directory. Use it on a file or @code{./} to exit the completion with
 the selected candidate.
 @end indentedblock
 @subsubheading @kbd{DEL} (@code{ivy-backward-delete-char})
address@hidden ivy-backward-delete-char
address@hidden DEL
 @indentedblock
 When completing file names, and the current input is empty,
 restart the completion in the parent directory.
 @end indentedblock
 @subsubheading @kbd{//} (@code{self-insert-command})
address@hidden //
 @indentedblock
 Switch to the root directory.
 @end indentedblock
 @subsubheading @kbd{~} (@code{self-insert-command})
address@hidden ~
 @indentedblock
 Switch to the home directory.
 @end indentedblock
 @subsubheading @kbd{/} (@code{self-insert-command})
address@hidden /
 @indentedblock
 If the current input is precisely an existing directory, switch
 the completion to that directory.
 @end indentedblock
 @subsubheading @kbd{M-q} (@code{ivy-toggle-regexp-quote})
address@hidden ivy-toggle-regexp-quote
address@hidden M-q
 @indentedblock
 Toggle between your input being a regexp and not.
 
@@ -1575,4 +1663,9 @@ we want to kill the running process created by
 
 @printindex vr
 
address@hidden
address@hidden Keystroke Index
address@hidden Keystroke Index
+
address@hidden ky
+
address@hidden
\ No newline at end of file



reply via email to

[Prev in Thread] Current Thread [Next in Thread]