[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 9b5d16c 13/40: Added detailed info on the README file.
From: |
Alexey Veretennikov |
Subject: |
[elpa] master 9b5d16c 13/40: Added detailed info on the README file. |
Date: |
Fri, 29 Jan 2016 23:29:34 +0000 |
branch: master
commit 9b5d16cdb00b96660313e8551dddbf3402cc6eed
Author: Leo Perrin <address@hidden>
Commit: Alexey Veretennikov <address@hidden>
Added detailed info on the README file.
---
README.md | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 118 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 3636994..4930cf8 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,56 @@
-There is a minor mode for Emacs acting like occur but w/o creating a new
window. It just hides all the text excepting lines containing matches. To use
it, add the following to your .emacs file:
+Functionnalities
+================
+
+
+Provides is a minor mode for Emacs acting like occur but without
+creating a new window. It just hides all the text except lines
+containing matches for a given regex. The following functions are
+provided:
+
+ + `loccur` Prompts for a regex and hides all the lines not containing
+ matches. If the given regex is empty, defaults to the current
+ selection and, if the selection is also empty, defaults to the word
+ at point.
+ + `loccur-previous-match` Repeats the last `loccur` search.
+ + `loccur-toggle-highlight` Disables or enables highlighting of the
+ matches.
+
+After `loccur` is ran, hit `RET` to move to the line where the cursor
+is and display everything again.
+
+The good thing about this mode is that you can navigate through the
+buffer easily. In particular, if you bind `(loccur ""
+
+
+Example
+=======
+
+If you run `loccur` on regex `[0-9]+` (finding any decimal number) on
+the following buffer,
+
+``` Lorem ipsum dolor 100 sit amet, consectetur adipisicing elit, sed
+do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
+ad minim veniam, quis 20090 nostrud exercitation ullamco laboris nisi
+ut aliquip ex ea commodo consequat. Duis aute irure dolor in
+reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
+pariatur. Excepteur sint occaecat 3 cupidatat non proident, sunt in
+culpa qui officia deserunt mollit anim id est laborum.```
+
+we obtain
+
+``` Lorem ipsum dolor 100 sit amet, consectetur adipisicing elit, sed
+ad minim veniam, quis 20090 nostrud exercitation ullamco laboris nisi
+pariatur. Excepteur sint occaecat 3 cupidatat non proident, sunt in
+```
+
+and, if we hit `RET` on the third line of this display, the first
+content is displayed again and the cursor is placed on the 6th line.
+
+
+Suggested settings
+=================
+
+You can add the following to your .emacs file:
```scheme
(require 'loccur)
@@ -10,4 +62,68 @@ There is a minor mode for Emacs acting like occur but w/o
creating a new window.
(define-key global-map [(control shift o)] 'loccur-previous-match)
```
-Now you can point the cursor to the word and press "Ctrl+o" to hide all lines
except those containing this word. Moving cursor to the required line and
pressing "Ctrl+o" again will shows all the text. The good thing about this mode
is what you can navigate through the buffer easily. "Ctrl+Shift+o" will repeat
last search.
+Now you can point the cursor to the word and press `C-o` to hide all
+lines except those containing this word. Moving cursor to the required
+line and pressing `C-o` again or `RET` will shows all the text.
+`C-S-o` will repeat the last search.
+
+
+Quick navigation
+================
+
+
+You can also use `loccur` to efficiently navigate in a buffer. For
+instance, the following function displays only the declaration of all
+the *Python* functions in the current file; making it very easy to
+jump to a particular function.
+
+```scheme
+(defun loccur/list-Python-functions()
+ "Displays only the lines corresponding to a function
+declaration in a Python file."
+ (loccur-no-highlight "^ *def "))
+```
+
+In the same way, the following snippet provides a very useful function
+for whoever uses
+[beamer](http://en.wikipedia.org/wiki/Beamer_%28LaTeX%29): it lists
+all the frame titles to easily jump to a particular one.
+
+
+```scheme
+(defun loccur/list-beamer-frames()
+ "Displays only the lines corresponding to a frame title
+declaration in a beamer LaTeX file."
+ (loccur-no-highlight "\\frametitle"))
+```
+
+When running this command, this buffer
+```
+\begin{frame}
+ \frametitle{First frame}
+
+ <insert fascinating content here>
+\end{frame}
+
+\begin{frame}
+ \frametitle{Then let's talk about this}
+
+ <insert some stunning figure here>
+\end{frame}
+
+\begin{frame}
+ \frametitle{Wrapping up}
+
+ <insert witty and challenging conclusion here>
+\end{frame}
+```
+
+becomes
+```
+
+ \frametitle{First frame}
+ \frametitle{Then let's talk about this}
+ \frametitle{Wrapping up}
+```
+and hitting `RET` will bring back the first buffer and place the
+cursor on the line wanted.
- [elpa] master 1a1fb1a 02/40: + Added highlighting of the matched strings, (continued)
- [elpa] master 1a1fb1a 02/40: + Added highlighting of the matched strings, Alexey Veretennikov, 2016/01/29
- [elpa] master d6f5c06 04/40: Applied patch by Nathaniel Flath:, Alexey Veretennikov, 2016/01/29
- [elpa] master f73cf0e 05/40: Added README file, Alexey Veretennikov, 2016/01/29
- [elpa] master 8ee09a7 06/40: Updated markdown syntax, Alexey Veretennikov, 2016/01/29
- [elpa] master 6e0c960 08/40: Changed URL, Alexey Veretennikov, 2016/01/29
- [elpa] master aa1e119 07/40: Removed cl dependency, Alexey Veretennikov, 2016/01/29
- [elpa] master 5859be9 09/40: Recenter on exit from loccur-mode, Alexey Veretennikov, 2016/01/29
- [elpa] master a1e135a 12/40: Added loccur-no-highlight function., Alexey Veretennikov, 2016/01/29
- [elpa] master 440c96e 10/40: Added possibility of desactivating regex highlighting., Alexey Veretennikov, 2016/01/29
- [elpa] master 2bc08c6 14/40: Updated change log in the loccur.el file., Alexey Veretennikov, 2016/01/29
- [elpa] master 9b5d16c 13/40: Added detailed info on the README file.,
Alexey Veretennikov <=
- [elpa] master e9d4714 15/40: Fixed displaying problems on github caused by the README file., Alexey Veretennikov, 2016/01/29
- [elpa] master 409b322 11/40: Rewrote the minor-mode using the define-minor-mode macro and added RET, Alexey Veretennikov, 2016/01/29
- [elpa] master d279b6a 16/40: Added internal link to the "quick navigation" in the README file., Alexey Veretennikov, 2016/01/29
- [elpa] master b1b1d91 18/40: Updated version, Alexey Veretennikov, 2016/01/29
- [elpa] master 8aef9f0 19/40: Added customizable option to jump to the beginnig of the line in loccur mode: loccur-jump-beginning-of-line, Alexey Veretennikov, 2016/01/29
- [elpa] master ab4804a 20/40: Removed some cl dependencies; version changed to 1.2.1, Alexey Veretennikov, 2016/01/29
- [elpa] master cb7f8ac 17/40: Merge pull request #1 from picarresursix/master, Alexey Veretennikov, 2016/01/29
- [elpa] master 7d19c16 22/40: Preparation to move to GNU ELPA., Alexey Veretennikov, 2016/01/29
- [elpa] master 8ffd028 23/40: Preparation to move to GNU ELPA., Alexey Veretennikov, 2016/01/29
- [elpa] master 43cbc15 21/40: Fixed checkdoc issues, Alexey Veretennikov, 2016/01/29