[elpa] master ada08b0: * rnc-mode: New package

2016-01-29 Thread Stefan Monnier
branch: master
commit ada08b05a1ff278c1e20d9af60fb22fe9f8e65fc
Author: Stefan Monnier 
Commit: Stefan Monnier 

* rnc-mode: New package
---
 packages/rnc-mode/rnc-mode.el |  153 +
 1 files changed, 153 insertions(+), 0 deletions(-)

diff --git a/packages/rnc-mode/rnc-mode.el b/packages/rnc-mode/rnc-mode.el
new file mode 100644
index 000..81f891b
--- /dev/null
+++ b/packages/rnc-mode/rnc-mode.el
@@ -0,0 +1,153 @@
+;;; rnc-mode.el --- Emacs mode to edit Relax-NG Compact files  -*- 
lexical-binding:t -*-
+
+;; Copyright (C) 1994-1998, 2001-2016 Free Software Foundation, Inc.
+
+;; Author: Stefan Monnier 
+;; Keywords: xml relaxng
+;; Version: 0.1
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see .
+
+
+;;; Commentary:
+
+(require 'smie)
+(require 'nxml-mode)
+
+;;; Code:
+
+;;;###autoload
+(add-to-list 'auto-mode-alist '("\\.rnc\\'" . rnc-mode))
+
+(defconst rnc-mode-syntax-table
+  (let ((st (make-syntax-table)))
+(modify-syntax-entry ?# "<" st)
+(modify-syntax-entry ?\n ">" st)
+(modify-syntax-entry ?\" "\"" st)
+(modify-syntax-entry ?- "_" st)
+(modify-syntax-entry ?. "_" st)
+(modify-syntax-entry ?: "_" st)
+(modify-syntax-entry ?_ "_" st)
+st))
+
+(defconst rnc--keywords
+  ;; Taken from the grammar in http://relaxng.org/compact-20021121.html,
+  ;; by order of appearance.
+  '("namespace" "default" "datatypes" "element" "attribute"
+"list" "mixed" "parent" "empty" "text" "notAllowed" "external"
+"grammar" "div" "include" ;; "start"
+"string" "token" "inherit"))
+
+(defconst rnc--def-regexp "^[ \t]*\\([\\[:alpha:]][[:alnum:]-._]*\\)[ \t]*=")
+
+(defconst rnc-font-lock-keywords
+  `((,rnc--def-regexp (1 font-lock-function-name-face))
+(,(concat "\\_<" (regexp-opt rnc--keywords) "\\_>")
+ (0 font-lock-keyword-face))
+("attribute[ \t\n]+\\([^ ]+\\)" (1 'nxml-attribute-local-name))
+;; FIXME: We'd like to use nxml-element-local-name for element names,
+;; but by default this looks exactly like font-lock-function-name-face,
+;; which we want to use for local pattern definitions.
+;; ("element[ \t\n]+\\([^ ]+\\)" (1 'nxml-element-local-name))
+))
+
+(defconst rnc-imenu-generic-expression `((nil ,rnc--def-regexp 1)))
+
+(defconst rnc-smie-grammar
+  ;; The body of an RNC file is a sequence of definitions.
+  ;; Problem is: these definitions are not separated by any special keyword.
+  ;; It's basically a repetition of (id "=" pattern), where
+  ;; patterns can end with:
+  ;; "}", ")" "*", "+", "?", id, stringliteral
+  ;; Since this is way beyond the power of SMIE, we resort to using a pseudo
+  ;; " ; " separator which is introduced by the tokenizer.
+  (smie-prec2->grammar
+   (smie-bnf->prec2
+'((id) (atom) (args)
+  (header (header "include" atom))
+  (decls (id "=" pattern) (id "|=" pattern) (id "&=" pattern)
+ (decls " ; " decls))
+  (pattern ("element" args) ("attribute" args)
+   ("list" args) ("mixed" args)
+   ("parent" id) ("external" id)
+   ("grammar" atom)
+  ("{" pattern "}")
+  (pattern "," pattern)
+  (pattern "&" pattern)
+  (pattern "|" pattern)
+  (pattern "?")
+  (pattern "*")
+  (pattern "+")))
+;; The spec says "There is no notion of operator precedence".
+'((assoc " ; "))
+'((assoc "," "&" "|") (nonassoc "?" "*" "+"))
+)))
+
+(defun rnc-smie-forward-token ()
+  (let ((start (point)))
+(forward-comment (point-max))
+(if (and (> (point) start)
+ (looking-at "\\(?:\\s_\\|\\sw\\)+[ \t\n]*[|&]?=")
+ (save-excursion
+   (goto-char start)
+   (forward-comment -1)
+   (= (point) start)))
+" ; "
+  (smie-default-forward-token
+
+(defun rnc-smie-backward-token ()
+  (let ((start (point)))
+(forward-comment (- (point)))
+(if (and (< (point) start)
+ (let ((pos (point)))
+   (goto-char start)
+   (prog1
+   (looking-at "\\(?:\\s_\\|\\sw\\)+[ \t\n]*[|&]?=")
+ (goto-char pos
+" ; "
+  (smie-default-backward-token
+
+(defun rnc-smie-rules (kind token)
+  (pcase (cons kind token)
+(`(:list-intro . "element") t)
+  

[elpa] master 915846a 03/40: Removed implemented TODO note from comments

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 915846ab26b6ee95629f92ed97ed043e98d97e5e
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Removed implemented TODO note from comments
---
 loccur.el |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/loccur.el b/loccur.el
index d4b37cd..3228966 100644
--- a/loccur.el
+++ b/loccur.el
@@ -41,7 +41,6 @@
 ;; gives unexpected jumps in loccur mode
 ;;
 ;;; TODO:
-;; 1. Highlight matched strings
 ;; 
 ;;; Change Log:
 ;;



[elpa] master updated (ada08b0 -> 8f6fe36)

2016-01-29 Thread Alexey Veretennikov
fourier pushed a change to branch master.

  from  ada08b0   * rnc-mode: New package
   new  b84471a   Initial revision, v1.0
   new  1a1fb1a   + Added highlighting of the matched strings + Now inserts 
selected region to the prompt + Added defun for applying last found 
regexp(loccur-previous-match) + Added intangible property together with 
invisibility
   new  915846a   Removed implemented TODO note from comments
   new  d6f5c06   Applied patch by Nathaniel Flath: "This patch changes the 
prompt so that the default value is not in the edit area, but in the prompt.  
This makes it easier to change if the default value is not what you wanted."
   new  f73cf0e   Added README file
   new  8ee09a7   Updated markdown syntax
   new  aa1e119   Removed cl dependency
   new  6e0c960   Changed URL
   new  5859be9   Recenter on exit from loccur-mode
   new  440c96e   Added possibility of desactivating regex highlighting.
   new  409b322   Rewrote the minor-mode using the define-minor-mode macro 
and added RET key in loccur-mode to select line.
   new  a1e135a   Added loccur-no-highlight function.
   new  9b5d16c   Added detailed info on the README file.
   new  2bc08c6   Updated change log in the loccur.el file.
   new  e9d4714   Fixed displaying problems on github caused by the README 
file.
   new  d279b6a   Added internal link to the "quick navigation" in the 
README file.
   new  cb7f8ac   Merge pull request #1 from picarresursix/master
   new  b1b1d91   Updated version
   new  8aef9f0   Added customizable option to jump to the beginnig of the 
line in loccur mode: loccur-jump-beginning-of-line
   new  ab4804a   Removed some cl dependencies; version changed to 1.2.1
   new  43cbc15   Fixed checkdoc issues
   new  7d19c16   Preparation to move to GNU ELPA.
   new  8ffd028   Preparation to move to GNU ELPA.
   new  b6655e3   Preparation to move to GNU ELPA.
   new  359fae1   Preparation to move to GNU ELPA.
   new  900eb51   Preparation to move to GNU ELPA.
   new  aae3563   Preparation to move to GNU ELPA.
   new  f95c8d6   Preparation to move to GNU ELPA.
   new  59b8dd1   Implemented removed features and added face loccur-face
   new  194dd68   Reimplemented loccur-no-highlight and fixed checkdoc
   new  e5d1061   Define group for customize and fixing byte-compile 
warnings
   new  66a9810   Merge pull request #3 from syohex/group
   new  2cacc68   Added types to custom
   new  2680df7   Fixed bug when loccur called with empty argument.
   new  03789fa   Updated README
   new  d08fdac   Updated README and rearranged functions.
   new  61dcaaf   Removed redundand code
   new  a90bd54   Preparation to submission to GNU ELPA
   new  fb1fbc0   Fixed compilation warnings.
   new  8f6fe36   Add 'packages/loccur/' from commit 
'fb1fbc0ff5da7a8b117542ab8083d29cd79e12b2'


Summary of changes:
 packages/loccur/README.md |   50 +++
 packages/loccur/loccur.el |  323 +
 2 files changed, 373 insertions(+), 0 deletions(-)
 create mode 100644 packages/loccur/README.md
 create mode 100644 packages/loccur/loccur.el



[elpa] master 1a1fb1a 02/40: + Added highlighting of the matched strings

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 1a1fb1aedf93a92ef5b6b97b8508189e26811479
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

+ Added highlighting of the matched strings
+ Now inserts selected region to the prompt
+ Added defun for applying last found regexp(loccur-previous-match)
+ Added intangible property together with invisibility
---
 loccur.el |  126 +++--
 1 files changed, 97 insertions(+), 29 deletions(-)

diff --git a/loccur.el b/loccur.el
index a946253..d4b37cd 100644
--- a/loccur.el
+++ b/loccur.el
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Alexey Veretennikov 
 ;; Created: 2009-09-08
-;; Version: 1.0
+;; Version: 1.1.0
 ;; Keywords: matching
 ;; URL: http://loccur.sourceforge.net/
 ;; Compatibility: GNU Emacs 22.x, GNU Emacs 23.x
@@ -27,9 +27,14 @@
 ;;; Commentary:
 ;;
 ;; Add the following to your .emacs file:
+;; 
 ;; (require 'loccur)
-;; (define-key global-map "\C-o" 'loccur-current)
-;; (define-key global-map "\C-\M-o" 'loccur)
+;; ;; defines shortcut for loccur of the current word
+;; (define-key global-map [(control o)] 'loccur-current)
+;; ;; defines shortcut for the interactive loccur command
+;; (define-key global-map [(control meta o)] 'loccur)
+;; ;; defines shortcut for the loccur of the previously found word
+;; (define-key global-map [(control shift o)] 'loccur-previous-match)
 ;;
 ;;; Issues:
 ;; Using with smooth-scrolling.el sometimes
@@ -40,6 +45,12 @@
 ;; 
 ;;; Change Log:
 ;;
+;; 2009-10-05 (1.1.0)
+;;+ Added highlighting of the matched strings
+;;+ Now inserts selected region to the prompt
+;;+ Added defun for applying last found regexp(loccur-previous-match)
+;;+ Added intangible property together with invisibility
+;;
 ;; 2009-09-08 (1.0.0)
 ;;Initial Release.
 ;;
@@ -60,9 +71,14 @@
 
 
 (defvar loccur-history nil
-  "History of previously searched expressions.")
+  "History of previously searched expressions for the prompt")
 (make-variable-buffer-local 'loccur-history)
 
+(defvar loccur-last-match nil
+  "Last match found")
+(make-variable-buffer-local 'loccur-last-match)
+
+
 
 (defvar loccur-overlay-list nil
   "A list of currently active overlays.")
@@ -88,6 +104,12 @@
   (loccur (current-word)))
 
 
+(defun loccur-previous-match ()
+  "Call `loccur' for the previously found word."
+  (interactive)
+  (loccur loccur-last-match))
+
+
 (defun loccur (regex)
   "Perform a simple grep in current buffer for the regular
 expression REGEX
@@ -98,30 +120,69 @@ unhides lines again"
   (interactive 
(if loccur-mode
   (list nil)
-(list (read-string "Regexp: " (current-word) 'loccur-history
+ (loccur-prompt)))
   (loccur-mode regex))
 
 
+(defun loccur-prompt ()
+  "Prompts for a regexp to search
+
+Default value for prompt is a current word or active region(selection),
+if its size is 1 line"
+  (let ((prompt
+ (if (and transient-mark-mode
+  mark-active)
+ (let ((pos1 (region-beginning))
+   (pos2 (region-end)))
+   ;; Check if the start and the of an active region is on
+   ;; the same line
+   (if (= (line-number-at-pos pos1)
+  (line-number-at-pos pos2))
+   (buffer-substring-no-properties pos1 pos2)))
+   (current-word
+(list (read-string "Regexp: " prompt 'loccur-history 
+
+
 (defun loccur-1 (regex)
-  (let* ((buffer-lines (loccur-find-match-lines regex))
-(ovl-bounds (loccur-create-overlay-bounds-btw-lines 
buffer-lines)))
+  (let* ((buffer-matches (loccur-find-matches regex))
+(ovl-bounds (loccur-create-overlay-bounds-btw-lines 
buffer-matches)))
(setq loccur-overlay-list 
- (loccur-create-overlays ovl-bounds))
+ (loccur-create-invisible-overlays ovl-bounds))
+(setq loccur-overlay-list
+  (append loccur-overlay-list
+  (loccur-create-highlighted-overlays buffer-matches)))
+(setq loccur-last-match regex)
(recenter)))
 
+(defun loccur-create-highlighted-overlays(buffer-matches)
+  (let ((overlays 
+(map 'list #'(lambda (match)
+   (make-overlay
+(nth 1 match)
+(nth 2 match)
+(current-buffer) t nil))
+ buffer-matches)))
+   (mapcar (lambda (ovl) 
+  (overlay-put ovl loccur-overlay-property-name t)
+ (overlay-put ovl 'face 'isearch))
+overlays)))
+
 
-(defun loccur-create-overlays (ovl-bounds)
+(defun loccur-create-invisible-overlays (ovl-bounds)
   (let ((overlays 
 (map 'list #'(lambda (bnd)
(make-overlay
-(first bnd)
-   

[elpa] master 8ee09a7 06/40: Updated markdown syntax

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 8ee09a77fef09985b0fcd2e3b4bdbedd9d497c5b
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Updated markdown syntax
---
 README.md |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/README.md b/README.md
index fea8bd6..3636994 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 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:
 
-```elisp
+```scheme
 (require 'loccur)
 ;; defines shortcut for loccur of the current word
 (define-key global-map [(control o)] 'loccur-current)



[elpa] master b84471a 01/40: Initial revision, v1.0

2016-01-29 Thread Alexey Veretennikov
branch: master
commit b84471ae969c1356c73c7f87cbc42a37dca88fdd
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Initial revision, v1.0
---
 loccur.el |  174 +
 1 files changed, 174 insertions(+), 0 deletions(-)

diff --git a/loccur.el b/loccur.el
new file mode 100644
index 000..a946253
--- /dev/null
+++ b/loccur.el
@@ -0,0 +1,174 @@
+;;; loccur.el --- Perform an occur-like folding in current buffer
+
+;; Copyright (C) 2009 Alexey Veretennikov
+;;
+;; Author: Alexey Veretennikov 
+;; Created: 2009-09-08
+;; Version: 1.0
+;; Keywords: matching
+;; URL: http://loccur.sourceforge.net/
+;; Compatibility: GNU Emacs 22.x, GNU Emacs 23.x
+;;
+;; This file is NOT part of GNU Emacs.
+;;
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License
+;; as published by the Free Software Foundation; either version 2
+;; of the License, or (at your option) any later version.
+;;
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see .
+;;
+;;; Commentary:
+;;
+;; Add the following to your .emacs file:
+;; (require 'loccur)
+;; (define-key global-map "\C-o" 'loccur-current)
+;; (define-key global-map "\C-\M-o" 'loccur)
+;;
+;;; Issues:
+;; Using with smooth-scrolling.el sometimes
+;; gives unexpected jumps in loccur mode
+;;
+;;; TODO:
+;; 1. Highlight matched strings
+;; 
+;;; Change Log:
+;;
+;; 2009-09-08 (1.0.0)
+;;Initial Release.
+;;
+;;; Code:
+
+(eval-when-compile (require 'cl))
+
+(defconst loccur-overlay-property-name 'loccur-custom-buffer-grep)
+
+
+(or (assq 'loccur-mode minor-mode-alist)
+(nconc minor-mode-alist
+  (list '(loccur-mode loccur-mode
+
+
+(defvar loccur-mode nil) ;; name of the minor mode
+(make-variable-buffer-local 'loccur-mode)
+
+
+(defvar loccur-history nil
+  "History of previously searched expressions.")
+(make-variable-buffer-local 'loccur-history)
+
+
+(defvar loccur-overlay-list nil
+  "A list of currently active overlays.")
+(make-variable-buffer-local 'loccur-overlay-list)
+
+
+(defun loccur-mode (regex)
+  (setqloccur-mode 
+   (if (or loccur-mode
+   (null regex)
+   (zerop (length regex)))
+   nil
+ " Loccur"))
+  (force-mode-line-update)
+  (loccur-remove-overlays)
+  (when loccur-mode
+   (loccur-1 regex)))
+
+
+(defun loccur-current ()
+  "Call `loccur' for the current word."
+  (interactive)
+  (loccur (current-word)))
+
+
+(defun loccur (regex)
+  "Perform a simple grep in current buffer for the regular
+expression REGEX
+
+This command hides all lines from the current buffer except those
+containing the regular expression REGEX. A second call of the function
+unhides lines again"
+  (interactive 
+   (if loccur-mode
+  (list nil)
+(list (read-string "Regexp: " (current-word) 'loccur-history
+  (loccur-mode regex))
+
+
+(defun loccur-1 (regex)
+  (let* ((buffer-lines (loccur-find-match-lines regex))
+(ovl-bounds (loccur-create-overlay-bounds-btw-lines 
buffer-lines)))
+   (setq loccur-overlay-list 
+ (loccur-create-overlays ovl-bounds))
+   (recenter)))
+
+
+(defun loccur-create-overlays (ovl-bounds)
+  (let ((overlays 
+(map 'list #'(lambda (bnd)
+   (make-overlay
+(first bnd)
+(second bnd)
+(current-buffer) t nil))
+ ovl-bounds)))
+   (dolist (ovl overlays)
+ (overlay-put ovl loccur-overlay-property-name t)
+ (overlay-put ovl 'invisible t))
+   overlays))
+
+
+(defun loccur-remove-overlays ()
+  (remove-overlays (point-min) (point-max) loccur-overlay-property-name t)
+  (setq loccur-overlay-list nil))
+
+
+(defun loccur-create-overlay-bounds-btw-lines (buffer-lines)
+  (let ((prev-end (point-min))
+   (overlays (list)))
+   (when buffer-lines
+ (dolist (line buffer-lines)
+   (let ((beginning (first line)))
+ (unless ( = (- beginning prev-end) 1)
+   (let ((ovl-start (if (= prev-end 1) 1 prev-end))
+ (ovl-end  (1- beginning)))
+ (push (list ovl-start ovl-end) overlays)))
+ (setq prev-end (second line
+ (push (list (1+ prev-end) (point-max)) overlays)
+ (setq overlays (nreverse overlays)))

[elpa] master d279b6a 16/40: Added internal link to the "quick navigation" in the README file.

2016-01-29 Thread Alexey Veretennikov
branch: master
commit d279b6a336e5e1379f91515c2b918561efcf7633
Author: Leo Perrin 
Commit: Alexey Veretennikov 

Added internal link to the "quick navigation" in the README file.
---
 README.md |   16 +---
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/README.md b/README.md
index 939d7a0..a047bc1 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,14 @@
-Functionnalities
-
+Functionalities
+===
 
 
 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
+containing matches for a given regexp. 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
+ + `loccur` Prompts for a regexp and hides all the lines not containing
+ matches. If the given regexp 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.
@@ -19,13 +19,15 @@ 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 ""
+buffer easily. In particular, hopefully useful functions using
+`loccur` are suggested in Section
+[Quick Navigation](#quick-navigation).
 
 
 Example
 ===
 
-If you run `loccur` on regex `[0-9]+` (finding any decimal number) on
+If you run `loccur` on regexp `[0-9]+` (finding any decimal number) on
 the following buffer,
 
 



[elpa] master 7d19c16 22/40: Preparation to move to GNU ELPA.

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 7d19c166920576711add53f6449d14e181a6028d
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Preparation to move to GNU ELPA.

In order to move to GNU ELPA it is necessary to remove the code
from contributors who were not able/willing to sign FSF papers.

Revert "Added internal link to the "quick navigation" in the README file."

This reverts commit d279b6a336e5e1379f91515c2b918561efcf7633.
---
 README.md |   16 +++-
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/README.md b/README.md
index a047bc1..939d7a0 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,14 @@
-Functionalities
-===
+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 regexp. The following functions are
+containing matches for a given regex. The following functions are
 provided:
  
- + `loccur` Prompts for a regexp and hides all the lines not containing
- matches. If the given regexp is empty, defaults to the current
+ + `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.
@@ -19,15 +19,13 @@ 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, hopefully useful functions using
-`loccur` are suggested in Section
-[Quick Navigation](#quick-navigation).
+buffer easily. In particular, if you bind `(loccur ""
 
 
 Example
 ===
 
-If you run `loccur` on regexp `[0-9]+` (finding any decimal number) on
+If you run `loccur` on regex `[0-9]+` (finding any decimal number) on
 the following buffer,
 
 



[elpa] master 440c96e 10/40: Added possibility of desactivating regex highlighting.

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 440c96ebd3ae0b8e51a82da6835240489d62a35b
Author: Leo Perrin 
Commit: Alexey Veretennikov 

Added possibility of desactivating regex highlighting.
---
 loccur.el |  139 
 1 files changed, 74 insertions(+), 65 deletions(-)

diff --git a/loccur.el b/loccur.el
index a9aec5a..5c55f8a 100644
--- a/loccur.el
+++ b/loccur.el
@@ -1,13 +1,13 @@
 ;;; loccur.el --- Perform an occur-like folding in current buffer
 
-;; Copyright (C) 2009-2012 Alexey Veretennikov
+;; Copyright (C) 2009 Alexey Veretennikov
 ;;
 ;; Author: Alexey Veretennikov 
 ;; Created: 2009-09-08
-;; Version: 1.1.3
+;; Version: 1.1.1
 ;; Keywords: matching
-;; URL: https://github.com/fourier/loccur
-;; Compatibility: GNU Emacs 23.x, GNU Emacs 24.x
+;; URL: http://loccur.sourceforge.net/
+;; Compatibility: GNU Emacs 22.x, GNU Emacs 23.x
 ;;
 ;; This file is NOT part of GNU Emacs.
 ;;
@@ -44,14 +44,6 @@
 ;; 
 ;;; Change Log:
 ;;
-;; 2012-09-27 (1.1.3)
-;;+ Recenter on exit from loccur-mode
-;;
-;;
-;; 2012-09-25 (1.1.2)
-;;+ Removed cl dependency
-;;
-;; 
 ;; 2010-03-07 (1.1.1)
 ;;+ Default value is taken from prompt instead of an edit area
 ;;(thanks to Nathaniel Flath)
@@ -68,12 +60,28 @@
 ;;
 ;;; Code:
 
+(eval-when-compile (require 'cl))
+
 (defconst loccur-overlay-property-name 'loccur-custom-buffer-grep)
 
+(defvar loccur-highlight-matching-regexp t
+  "If set to a non-nil value, the part of the line matching the
+regex is highlighted. Use loccur-toggle-highlight to modify its
+value interactively.")
+
+
+(defun loccur-toggle-highlight()
+  "Toggles the highlighting of the part of the line matching the
+regex given in the loccur buffer."
+  (interactive)
+  (if loccur-highlight-matching-regexp
+  (setq loccur-highlight-matching-regexp nil)
+(setq loccur-highlight-matching-regexp t)))
+
 
 (or (assq 'loccur-mode minor-mode-alist)
 (nconc minor-mode-alist
-   (list '(loccur-mode loccur-mode
+  (list '(loccur-mode loccur-mode
 
 
 (defvar loccur-mode nil) ;; name of the minor mode
@@ -97,16 +105,15 @@
 
 (defun loccur-mode (regex)
   (setqloccur-mode 
-(if (or loccur-mode
-(null regex)
-(zerop (length regex)))
-nil
-  " Loccur"))
+   (if (or loccur-mode
+   (null regex)
+   (zerop (length regex)))
+   nil
+ " Loccur"))
   (force-mode-line-update)
   (loccur-remove-overlays)
-  (if loccur-mode
-  (loccur-1 regex)
-(recenter)))
+  (when loccur-mode
+   (loccur-1 regex)))
 
 
 (defun loccur-current ()
@@ -158,38 +165,40 @@ if its size is 1 line"
 
 (defun loccur-1 (regex)
   (let* ((buffer-matches (loccur-find-matches regex))
- (ovl-bounds (loccur-create-overlay-bounds-btw-lines buffer-matches)))
-(setq loccur-overlay-list 
-  (loccur-create-invisible-overlays ovl-bounds))
+(ovl-bounds (loccur-create-overlay-bounds-btw-lines 
buffer-matches)))
+   (setq loccur-overlay-list 
+ (loccur-create-invisible-overlays ovl-bounds))
 (setq loccur-overlay-list
   (append loccur-overlay-list
   (loccur-create-highlighted-overlays buffer-matches)))
 (setq loccur-last-match regex)
-(recenter)))
+   (recenter)))
 
 (defun loccur-create-highlighted-overlays(buffer-matches)
   (let ((overlays 
- (mapcar (lambda (match)
-   (make-overlay
-(nth 1 match)
-(nth 2 match)
-(current-buffer) t nil))
- buffer-matches)))
-(mapcar (lambda (ovl) 
-  (overlay-put ovl loccur-overlay-property-name t)
-  (overlay-put ovl 'face 'isearch))
-overlays)))
+(map 'list #'(lambda (match)
+   (make-overlay
+(nth 1 match)
+(nth 2 match)
+(current-buffer) t nil))
+ buffer-matches)))
+;; !ME! To remove highlighting of the matching regexp
+(if loccur-highlight-matching-regexp
+  (mapcar (lambda (ovl) 
+(overlay-put ovl loccur-overlay-property-name t)
+(overlay-put ovl 'face 'isearch))
+  overlays
 
 
 (defun loccur-create-invisible-overlays (ovl-bounds)
   (let ((overlays 
- (mapcar (lambda (bnd)
-   (make-overlay
-(car bnd)
-(cadr bnd)
-(current-buffer) t nil))
- ovl-bounds)))
-(mapcar (lambda (ovl) 
+(map 'list #'(lambda (bnd)
+   (make-overlay
+  

[elpa] master 6e0c960 08/40: Changed URL

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 6e0c960f05cd93c0b7d47c916cfab9cdbb299968
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Changed URL
---
 loccur.el |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/loccur.el b/loccur.el
index 13b934c..2002634 100644
--- a/loccur.el
+++ b/loccur.el
@@ -6,8 +6,8 @@
 ;; Created: 2009-09-08
 ;; Version: 1.1.2
 ;; Keywords: matching
-;; URL: http://loccur.sourceforge.net/
-;; Compatibility: GNU Emacs 22.x, GNU Emacs 23.x, 24.x
+;; URL: https://github.com/fourier/loccur
+;; Compatibility: GNU Emacs 23.x, GNU Emacs 24.x
 ;;
 ;; This file is NOT part of GNU Emacs.
 ;;



[elpa] master 409b322 11/40: Rewrote the minor-mode using the define-minor-mode macro and added RET

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 409b322aeb30005d1da4780dc9adc9bbd5bd4b38
Author: Leo Perrin 
Commit: Alexey Veretennikov 

Rewrote the minor-mode using the define-minor-mode macro and added RET
key in loccur-mode to select line.
---
 loccur.el |  226 +
 1 files changed, 121 insertions(+), 105 deletions(-)

diff --git a/loccur.el b/loccur.el
index 5c55f8a..1dc93d8 100644
--- a/loccur.el
+++ b/loccur.el
@@ -1,4 +1,4 @@
-;;; loccur.el --- Perform an occur-like folding in current buffer
+;;; loccur.el --- Performs an occur-like folding in current buffer.
 
 ;; Copyright (C) 2009 Alexey Veretennikov
 ;;
@@ -6,8 +6,8 @@
 ;; Created: 2009-09-08
 ;; Version: 1.1.1
 ;; Keywords: matching
-;; URL: http://loccur.sourceforge.net/
-;; Compatibility: GNU Emacs 22.x, GNU Emacs 23.x
+;; URL: https://github.com/fourier/loccur
+;; Compatibility: GNU Emacs 22.x, GNU Emacs 23.x, GNU Emacs 24.x
 ;;
 ;; This file is NOT part of GNU Emacs.
 ;;
@@ -61,9 +61,11 @@
 ;;; Code:
 
 (eval-when-compile (require 'cl))
-
 (defconst loccur-overlay-property-name 'loccur-custom-buffer-grep)
 
+
+; !SECTION! Possible highlighting of the matching regex
+
 (defvar loccur-highlight-matching-regexp t
   "If set to a non-nil value, the part of the line matching the
 regex is highlighted. Use loccur-toggle-highlight to modify its
@@ -79,14 +81,35 @@ regex given in the loccur buffer."
 (setq loccur-highlight-matching-regexp t)))
 
 
-(or (assq 'loccur-mode minor-mode-alist)
-(nconc minor-mode-alist
-  (list '(loccur-mode loccur-mode
-
+; !SECTION! Defining the minor-mode
+
+;; Custom Minor Mode
+(define-minor-mode loccur-mode
+  "Performs an occur-like folding in current buffer."
+  ;; The initial value - Set to 1 to enable by default
+  nil
+  ;; The indicator for the mode line.
+  " Loccur"
+  ;; The minor mode keymap
+  `(
+(,(kbd "RET") . loccur-current)))
+
+(defun loccur-toggle-mode (regex)
+  (if (or loccur-mode
+  (null regex)
+  (zerop (length regex)))
+  (loccur-mode -1)
+(loccur-mode 1))
+  (force-mode-line-update)
+  (loccur-remove-overlays)
+  (if loccur-mode
+  (loccur-1 regex)
+(recenter)))
+  
 
-(defvar loccur-mode nil) ;; name of the minor mode
-(make-variable-buffer-local 'loccur-mode)
+; !SECTION! Utils
 
+; !SUBSECTION! History
 
 (defvar loccur-history nil
   "History of previously searched expressions for the prompt")
@@ -97,36 +120,74 @@ regex given in the loccur buffer."
 (make-variable-buffer-local 'loccur-last-match)
 
 
+(defun loccur-previous-match ()
+  "Call `loccur' for the previously found word."
+  (interactive)
+  (loccur loccur-last-match))
+
+
+; !SUBSECTION! Functions dealing with overlays
+
 
 (defvar loccur-overlay-list nil
   "A list of currently active overlays.")
 (make-variable-buffer-local 'loccur-overlay-list)
 
+(defun loccur-create-highlighted-overlays(buffer-matches)
+  (let ((overlays 
+ (map 'list #'(lambda (match)
+(make-overlay
+ (nth 1 match)
+ (nth 2 match)
+ (current-buffer) t nil))
+  buffer-matches)))
+;; To possibly remove highlighting of the matching regexp
+(if loccur-highlight-matching-regexp
+(mapcar (lambda (ovl) 
+  (overlay-put ovl loccur-overlay-property-name t)
+  (overlay-put ovl 'face 'isearch))
+overlays
 
-(defun loccur-mode (regex)
-  (setqloccur-mode 
-   (if (or loccur-mode
-   (null regex)
-   (zerop (length regex)))
-   nil
- " Loccur"))
-  (force-mode-line-update)
-  (loccur-remove-overlays)
-  (when loccur-mode
-   (loccur-1 regex)))
 
+(defun loccur-create-invisible-overlays (ovl-bounds)
+  (let ((overlays 
+ (map 'list #'(lambda (bnd)
+(make-overlay
+ (car bnd)
+ (cadr bnd)
+ (current-buffer) t nil))
+  ovl-bounds)))
+(mapcar (lambda (ovl) 
+  (overlay-put ovl loccur-overlay-property-name t)
+  (overlay-put ovl 'invisible t)
+  ;; force intangible property if invisible property
+  ;; does not automatically set it
+  (overlay-put ovl 'intangible t))
+overlays)))
 
-(defun loccur-current ()
-  "Call `loccur' for the current word."
-  (interactive)
-  (loccur (current-word)))
 
+(defun loccur-remove-overlays ()
+  (remove-overlays (point-min) (point-max) loccur-overlay-property-name t)
+  (setq loccur-overlay-list nil))
 
-(defun loccur-previous-match ()
-  "Call `loccur' for the previously found word."
-  (interactive)
-  (loccur loccur-last-match))
 
+(defun loccur-create-overlay-bounds-btw-lines (buffer-matches)
+  (let ((prev-end (point-min))
+(overlays (list

[elpa] master 900eb51 26/40: Preparation to move to GNU ELPA.

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 900eb51c989ce7af80bc1ba7e9b8a66ac35ea99f
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Preparation to move to GNU ELPA.

In order to move to GNU ELPA it is necessary to remove the code
from contributors who were not able/willing to sign FSF papers.

Revert "Added loccur-no-highlight function."

This reverts commit a1e135af6ffd1018ba86e2dd2f3dbc630674a63e.
---
 loccur.el |8 
 1 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/loccur.el b/loccur.el
index cb17e80..6dafcda 100644
--- a/loccur.el
+++ b/loccur.el
@@ -286,14 +286,6 @@ containing match"
 (forward-line 1))
   (setq lines (nreverse lines)
 
-(defun loccur-no-highlight(regex)
-  "Displays only the lines matching a given regex with no
-highlithing of any part of the lines."
-  (let (old-highlighting)
-(setq old-highlighting loccur-highlight-matching-regexp)
-(setq loccur-highlight-matching-regexp nil)
-(loccur regex)
-(setq loccur-highlight-matching-regexp old-highlighting)))
 
 
 (provide 'loccur)



[elpa] master d6f5c06 04/40: Applied patch by Nathaniel Flath:

2016-01-29 Thread Alexey Veretennikov
branch: master
commit d6f5c063259501ac4fefb5d7b205a0a043779f4e
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Applied patch by Nathaniel Flath:
"This patch changes
the prompt so that the default value is not in the edit
area, but in the prompt.  This makes it easier to change if
the default value is not what you wanted."
---
 loccur.el |   17 -
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/loccur.el b/loccur.el
index 3228966..d45cc8f 100644
--- a/loccur.el
+++ b/loccur.el
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Alexey Veretennikov 
 ;; Created: 2009-09-08
-;; Version: 1.1.0
+;; Version: 1.1.1
 ;; Keywords: matching
 ;; URL: http://loccur.sourceforge.net/
 ;; Compatibility: GNU Emacs 22.x, GNU Emacs 23.x
@@ -44,6 +44,11 @@
 ;; 
 ;;; Change Log:
 ;;
+;; 2010-03-07 (1.1.1)
+;;+ Default value is taken from prompt instead of an edit area
+;;(thanks to Nathaniel Flath)
+;;
+;;
 ;; 2009-10-05 (1.1.0)
 ;;+ Added highlighting of the matched strings
 ;;+ Now inserts selected region to the prompt
@@ -118,13 +123,15 @@ containing the regular expression REGEX. A second call of 
the function
 unhides lines again"
   (interactive 
(if loccur-mode
-  (list nil)
- (loccur-prompt)))
+   (list nil)
+   (list (read-string (concat "Regexp<" (loccur-prompt)
+  ">: ") "" 'loccur-history 
+  (if (string-equal "" regex) (setq regex (loccur-prompt)))
   (loccur-mode regex))
 
 
 (defun loccur-prompt ()
-  "Prompts for a regexp to search
+  "Returns the default value of the prompt.
 
 Default value for prompt is a current word or active region(selection),
 if its size is 1 line"
@@ -139,7 +146,7 @@ if its size is 1 line"
   (line-number-at-pos pos2))
(buffer-substring-no-properties pos1 pos2)))
(current-word
-(list (read-string "Regexp: " prompt 'loccur-history 
+prompt))
 
 
 (defun loccur-1 (regex)



[elpa] master e5d1061 31/40: Define group for customize and fixing byte-compile warnings

2016-01-29 Thread Alexey Veretennikov
branch: master
commit e5d1061cfe903c1aca4a540c8aa647bcf6001910
Author: Syohei YOSHIDA 
Commit: Syohei YOSHIDA 

Define group for customize and fixing byte-compile warnings
---
 loccur.el |   10 --
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/loccur.el b/loccur.el
index a076a5d..6b29022 100644
--- a/loccur.el
+++ b/loccur.el
@@ -70,6 +70,10 @@
 
 (require 'cl-lib)
 
+(defgroup loccur nil
+  "Perform an occur-like folding in current buffer."
+  :group 'tools)
+
 ;; should be defined before define-minor-mode
 (defvar loccur-mode-map
   (let ((map (make-sparse-keymap)))
@@ -95,7 +99,8 @@ a new window."
 
 (defface loccur-face
   '((t (:inherit isearch)))
-  "Loccur face")
+  "Loccur face"
+  :group 'loccur)
 
 
 (defconst loccur-overlay-invisible-property-name 'loccur-invisible-overlay
@@ -110,7 +115,8 @@ Default: nil")
 
 (defcustom loccur-highlight-matching-regexp t
   "If set to nil, do not highlight matching words.
-Default: t")
+Default: t"
+  :group 'loccur)
 
 (defvar loccur-history nil
   "History of previously searched expressions for the prompt.")



[elpa] master 43cbc15 21/40: Fixed checkdoc issues

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 43cbc153eb1037d5575c0eb5c24666abb59efafb
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Fixed checkdoc issues
---
 loccur.el |   34 +-
 1 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/loccur.el b/loccur.el
index 863bee3..56c92d7 100644
--- a/loccur.el
+++ b/loccur.el
@@ -75,13 +75,12 @@
 ;; !SECTION! Possible highlighting of the matching regex
 
 (defvar loccur-highlight-matching-regexp t
-  "If set to a non-nil value, the part of the line matching the
-regex is highlighted. Use loccur-toggle-highlight to modify its
-value interactively.")
+  "Determines if the part of the line matching the regex is highlighted.
+If set to a non-nil value, highlight.  Use `loccur-toggle-highlight' to
+modify its value interactively.")
 
 (defcustom loccur-jump-beginning-of-line nil
-  "Determines if cursor shall be at the beginning of the line
-when the loccur function is called.")
+  "Set cursor to the beginning of the line when the loccur function is 
called.")
 
 (defun loccur-toggle-highlight()
   "Toggles the highlighting of the part of the line matching the
@@ -103,6 +102,7 @@ regex given in the loccur buffer."
 (,(kbd "RET") . loccur-current)))
 
 (defun loccur-toggle-mode (regex)
+  "Toggle the function `loccur-mode' for REGEX."
   (if (or loccur-mode
   (null regex)
   (zerop (length regex)))
@@ -120,11 +120,11 @@ regex given in the loccur buffer."
 ;; !SUBSECTION! History
 
 (defvar loccur-history nil
-  "History of previously searched expressions for the prompt")
+  "History of previously searched expressions for the prompt.")
 (make-variable-buffer-local 'loccur-history)
 
 (defvar loccur-last-match nil
-  "Last match found")
+  "Last match found.")
 (make-variable-buffer-local 'loccur-last-match)
 
 
@@ -141,7 +141,8 @@ regex given in the loccur buffer."
   "A list of currently active overlays.")
 (make-variable-buffer-local 'loccur-overlay-list)
 
-(defun loccur-create-highlighted-overlays(buffer-matches)
+(defun loccur-create-highlighted-overlays (buffer-matches)
+  "Create the list of overlays for BUFFER-MATCHES."
   (let ((overlays
  (mapcar (lambda (match)
(make-overlay
@@ -158,6 +159,7 @@ regex given in the loccur buffer."
 
 
 (defun loccur-create-invisible-overlays (ovl-bounds)
+  "Create a list of invisible overlays by given OVL-BOUNDS."
   (let ((overlays
  (mapcar (lambda (bnd)
(make-overlay
@@ -175,11 +177,13 @@ regex given in the loccur buffer."
 
 
 (defun loccur-remove-overlays ()
+  "Remove all overlays."
   (remove-overlays (point-min) (point-max) loccur-overlay-property-name t)
   (setq loccur-overlay-list nil))
 
 
 (defun loccur-create-overlay-bounds-btw-lines (buffer-matches)
+  "Create a list of overlays between matched lines BUFFER-MATCHES."
   (let ((prev-end (point-min))
 (overlays (list)))
 (when buffer-matches
@@ -198,11 +202,10 @@ regex given in the loccur buffer."
 ;; !SECTION! Main functions, those actually performing the loccur
 
 (defun loccur (regex)
-  "Perform a simple grep in current buffer for the regular
-expression REGEX
+  "Perform a simple grep in current buffer.
 
 This command hides all lines from the current buffer except those
-containing the regular expression REGEX. A second call of the function
+containing the regular expression REGEX.  A second call of the function
 unhides lines again"
   (interactive
(if loccur-mode
@@ -222,7 +225,7 @@ unhides lines again"
   (loccur (current-word)))
 
 (defun loccur-prompt ()
-  "Returns the default value of the prompt.
+  "Return the default value of the prompt.
 
 Default value for prompt is a current word or active region(selection),
 if its size is 1 line"
@@ -241,6 +244,9 @@ if its size is 1 line"
 
 
 (defun loccur-1 (regex)
+  "Implementation of the `loccur' functionality.
+
+REGEX is an argument to `loccur'."
   (let* ((buffer-matches (loccur-find-matches regex))
  (ovl-bounds (loccur-create-overlay-bounds-btw-lines buffer-matches)))
 (setq loccur-overlay-list
@@ -253,7 +259,9 @@ if its size is 1 line"
 
 
 (defun loccur-find-matches (regex)
-  "Returns a list of 4-number tuples, specifying begnning of the line,
+  "Find all occurences in the current buffer for given REGEX.
+
+Returns a list of 4-number tuples, specifying begnning of the line,
 1st match begin of a line, 1st match end of a line, end of a line
 containing match"
   (save-excursion



[elpa] master 5859be9 09/40: Recenter on exit from loccur-mode

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 5859be95a1fcfeac7169fc53c414763936f6f4d5
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Recenter on exit from loccur-mode
---
 loccur.el |   11 ---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/loccur.el b/loccur.el
index 2002634..a9aec5a 100644
--- a/loccur.el
+++ b/loccur.el
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Alexey Veretennikov 
 ;; Created: 2009-09-08
-;; Version: 1.1.2
+;; Version: 1.1.3
 ;; Keywords: matching
 ;; URL: https://github.com/fourier/loccur
 ;; Compatibility: GNU Emacs 23.x, GNU Emacs 24.x
@@ -44,6 +44,10 @@
 ;; 
 ;;; Change Log:
 ;;
+;; 2012-09-27 (1.1.3)
+;;+ Recenter on exit from loccur-mode
+;;
+;;
 ;; 2012-09-25 (1.1.2)
 ;;+ Removed cl dependency
 ;;
@@ -100,8 +104,9 @@
   " Loccur"))
   (force-mode-line-update)
   (loccur-remove-overlays)
-  (when loccur-mode
-(loccur-1 regex)))
+  (if loccur-mode
+  (loccur-1 regex)
+(recenter)))
 
 
 (defun loccur-current ()



[elpa] master f95c8d6 28/40: Preparation to move to GNU ELPA.

2016-01-29 Thread Alexey Veretennikov
branch: master
commit f95c8d6acbd3ebdfb127679115cbc59d979d5437
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Preparation to move to GNU ELPA.

In order to move to GNU ELPA it is necessary to remove the code
from contributors who were not able/willing to sign FSF papers.

Revert "Added possibility of desactivating regex highlighting."

This reverts commit 440c96ebd3ae0b8e51a82da6835240489d62a35b.
---
 loccur.el |   35 +++
 1 files changed, 11 insertions(+), 24 deletions(-)

diff --git a/loccur.el b/loccur.el
index 93e3d51..c9c3d1d 100644
--- a/loccur.el
+++ b/loccur.el
@@ -52,7 +52,6 @@
 ;;+ Default value is taken from prompt instead of an edit area
 ;;(thanks to Nathaniel Flath)
 ;;
-;;
 ;; 2009-10-05 (1.1.0)
 ;;+ Added highlighting of the matched strings
 ;;+ Now inserts selected region to the prompt
@@ -67,19 +66,9 @@
 (defconst loccur-overlay-property-name 'loccur-custom-buffer-grep
   "Property name of the overlay for all visible text")
 
-(defvar loccur-highlight-matching-regexp t
-  "Determines if the part of the line matching the regex is highlighted.
-If set to a non-nil value, highlight.  Use `loccur-toggle-highlight' to
-modify its value interactively.")
-
 (defcustom loccur-jump-beginning-of-line nil
   "Set cursor to the beginning of the line when the loccur function is 
called.")
 
-(defun loccur-toggle-highlight()
-  "Toggles the highlighting of the part of the line matching the
-regex given in the loccur buffer."
-  (interactive)
-  (setq loccur-highlight-matching-regexp (not 
loccur-highlight-matching-regexp)))
 
 ;; FIXME wtf?
 (or (assq 'loccur-mode minor-mode-alist)
@@ -103,7 +92,7 @@ regex given in the loccur buffer."
 (make-variable-buffer-local 'loccur-overlay-list)
 
 (defun loccur-mode (regex)
-  (setqloccur-mode 
+  (setq loccur-mode 
 (if (or loccur-mode
 (null regex)
 (zerop (length regex)))
@@ -180,18 +169,16 @@ REGEX is an argument to `loccur'."
 (defun loccur-create-highlighted-overlays(buffer-matches)
   "Create the list of overlays for BUFFER-MATCHES."
   (let ((overlays 
- (map 'list #'(lambda (match)
-(make-overlay
- (nth 1 match)
- (nth 2 match)
- (current-buffer) t nil))
-  buffer-matches)))
-;; !ME! To remove highlighting of the matching regexp
-(if loccur-highlight-matching-regexp
-(mapcar (lambda (ovl) 
-  (overlay-put ovl loccur-overlay-property-name t)
-  (overlay-put ovl 'face 'isearch))
-overlays
+ (mapcar (lambda (match)
+   (make-overlay
+(nth 1 match)
+(nth 2 match)
+(current-buffer) t nil))
+ buffer-matches)))
+(mapcar (lambda (ovl) 
+  (overlay-put ovl loccur-overlay-property-name t)
+  (overlay-put ovl 'face 'isearch))
+overlays)))
 
 
 (defun loccur-create-invisible-overlays (ovl-bounds)



[elpa] master b6655e3 24/40: Preparation to move to GNU ELPA.

2016-01-29 Thread Alexey Veretennikov
branch: master
commit b6655e303690af53e4aec7f0942dddf4eee9a10b
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Preparation to move to GNU ELPA.

In order to move to GNU ELPA it is necessary to remove the code
from contributors who were not able/willing to sign FSF papers.

Revert "Updated change log in the loccur.el file."

This reverts commit 2bc08c63f6ebf89ca71fc0c0897daa3b02c23101.
---
 loccur.el |5 -
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/loccur.el b/loccur.el
index 56c92d7..cb17e80 100644
--- a/loccur.el
+++ b/loccur.el
@@ -48,11 +48,6 @@
 ;;+ Added custom option loccur-jump-beginning-of-line; removed some
 ;;of cl dependencies
 ;;
-;; 2013-03-31 (1.2)
-;;+ Added possibility to desactivate regex highlight, moved
-;;function in different sections and added the RET keyboard
-;;shortcut in loccur-mode (Leo Perrin).
-;;
 ;; 2010-03-07 (1.1.1)
 ;;+ Default value is taken from prompt instead of an edit area
 ;;(thanks to Nathaniel Flath)



[elpa] master ab4804a 20/40: Removed some cl dependencies; version changed to 1.2.1

2016-01-29 Thread Alexey Veretennikov
branch: master
commit ab4804a2c090529ad0f664e43598f93391463b3b
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Removed some cl dependencies; version changed to 1.2.1
---
 loccur.el |   51 ++-
 1 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/loccur.el b/loccur.el
index 753a62a..863bee3 100644
--- a/loccur.el
+++ b/loccur.el
@@ -4,10 +4,10 @@
 ;;
 ;; Author: Alexey Veretennikov 
 ;; Created: 2009-09-08
-;; Version: 1.2
+;; Version: 1.2.1
 ;; Keywords: matching
 ;; URL: https://github.com/fourier/loccur
-;; Compatibility: GNU Emacs 22.x, GNU Emacs 23.x, GNU Emacs 24.x
+;; Compatibility: GNU Emacs 23.x, GNU Emacs 24.x
 ;;
 ;; This file is NOT part of GNU Emacs.
 ;;
@@ -43,6 +43,10 @@
 ;;; TODO:
 ;; 
 ;;; Change Log:
+;; 
+;; 2013-10-22 (1.2.1)
+;;+ Added custom option loccur-jump-beginning-of-line; removed some
+;;of cl dependencies
 ;;
 ;; 2013-03-31 (1.2)
 ;;+ Added possibility to desactivate regex highlight, moved
@@ -68,7 +72,7 @@
 (defconst loccur-overlay-property-name 'loccur-custom-buffer-grep)
 
 
-; !SECTION! Possible highlighting of the matching regex
+;; !SECTION! Possible highlighting of the matching regex
 
 (defvar loccur-highlight-matching-regexp t
   "If set to a non-nil value, the part of the line matching the
@@ -83,12 +87,9 @@ when the loccur function is called.")
   "Toggles the highlighting of the part of the line matching the
 regex given in the loccur buffer."
   (interactive)
-  (if loccur-highlight-matching-regexp
-  (setq loccur-highlight-matching-regexp nil)
-(setq loccur-highlight-matching-regexp t)))
-
+  (setq loccur-highlight-matching-regexp (not 
loccur-highlight-matching-regexp)))
 
-; !SECTION! Defining the minor-mode
+;; !SECTION! Defining the minor-mode
 
 ;; Custom Minor Mode
 (define-minor-mode loccur-mode
@@ -112,11 +113,11 @@ regex given in the loccur buffer."
   (if loccur-mode
   (loccur-1 regex)
 (recenter)))
-  
 
-; !SECTION! Utils
 
-; !SUBSECTION! History
+;; !SECTION! Utils
+
+;; !SUBSECTION! History
 
 (defvar loccur-history nil
   "History of previously searched expressions for the prompt")
@@ -133,7 +134,7 @@ regex given in the loccur buffer."
   (loccur loccur-last-match))
 
 
-; !SUBSECTION! Functions dealing with overlays
+;; !SUBSECTION! Functions dealing with overlays
 
 
 (defvar loccur-overlay-list nil
@@ -142,12 +143,12 @@ regex given in the loccur buffer."
 
 (defun loccur-create-highlighted-overlays(buffer-matches)
   (let ((overlays
- (map 'list #'(lambda (match)
-(make-overlay
- (nth 1 match)
- (nth 2 match)
- (current-buffer) t nil))
-  buffer-matches)))
+ (mapcar (lambda (match)
+   (make-overlay
+(nth 1 match)
+(nth 2 match)
+(current-buffer) t nil))
+ buffer-matches)))
 ;; To possibly remove highlighting of the matching regexp
 (if loccur-highlight-matching-regexp
 (mapcar (lambda (ovl)
@@ -158,12 +159,12 @@ regex given in the loccur buffer."
 
 (defun loccur-create-invisible-overlays (ovl-bounds)
   (let ((overlays
- (map 'list #'(lambda (bnd)
-(make-overlay
- (car bnd)
- (cadr bnd)
- (current-buffer) t nil))
-  ovl-bounds)))
+ (mapcar (lambda (bnd)
+   (make-overlay
+(car bnd)
+(cadr bnd)
+(current-buffer) t nil))
+ ovl-bounds)))
 (mapcar (lambda (ovl)
   (overlay-put ovl loccur-overlay-property-name t)
   (overlay-put ovl 'invisible t)
@@ -194,7 +195,7 @@ regex given in the loccur buffer."
   (setq overlays (nreverse overlays)
 
 
-; !SECTION! Main functions, those actually performing the loccur
+;; !SECTION! Main functions, those actually performing the loccur
 
 (defun loccur (regex)
   "Perform a simple grep in current buffer for the regular



[elpa] master 8aef9f0 19/40: Added customizable option to jump to the beginnig of the line in loccur mode: loccur-jump-beginning-of-line

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 8aef9f046e353700b708b5f59301e2925be94e32
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Added customizable option to jump to the beginnig of the line in loccur 
mode: loccur-jump-beginning-of-line
---
 loccur.el |   19 +++
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/loccur.el b/loccur.el
index 3f0dfaf..753a62a 100644
--- a/loccur.el
+++ b/loccur.el
@@ -65,7 +65,6 @@
 ;;
 ;;; Code:
 
-(eval-when-compile (require 'cl))
 (defconst loccur-overlay-property-name 'loccur-custom-buffer-grep)
 
 
@@ -76,6 +75,9 @@
 regex is highlighted. Use loccur-toggle-highlight to modify its
 value interactively.")
 
+(defcustom loccur-jump-beginning-of-line nil
+  "Determines if cursor shall be at the beginning of the line
+when the loccur function is called.")
 
 (defun loccur-toggle-highlight()
   "Toggles the highlighting of the part of the line matching the
@@ -139,7 +141,7 @@ regex given in the loccur buffer."
 (make-variable-buffer-local 'loccur-overlay-list)
 
 (defun loccur-create-highlighted-overlays(buffer-matches)
-  (let ((overlays 
+  (let ((overlays
  (map 'list #'(lambda (match)
 (make-overlay
  (nth 1 match)
@@ -148,21 +150,21 @@ regex given in the loccur buffer."
   buffer-matches)))
 ;; To possibly remove highlighting of the matching regexp
 (if loccur-highlight-matching-regexp
-(mapcar (lambda (ovl) 
+(mapcar (lambda (ovl)
   (overlay-put ovl loccur-overlay-property-name t)
   (overlay-put ovl 'face 'isearch))
 overlays
 
 
 (defun loccur-create-invisible-overlays (ovl-bounds)
-  (let ((overlays 
+  (let ((overlays
  (map 'list #'(lambda (bnd)
 (make-overlay
  (car bnd)
  (cadr bnd)
  (current-buffer) t nil))
   ovl-bounds)))
-(mapcar (lambda (ovl) 
+(mapcar (lambda (ovl)
   (overlay-put ovl loccur-overlay-property-name t)
   (overlay-put ovl 'invisible t)
   ;; force intangible property if invisible property
@@ -201,14 +203,15 @@ expression REGEX
 This command hides all lines from the current buffer except those
 containing the regular expression REGEX. A second call of the function
 unhides lines again"
-  (interactive 
+  (interactive
(if loccur-mode
(list nil)
  (list (read-string (concat "Regexp<" (loccur-prompt)
 ">: ") "" 'loccur-history 
   (if (string-equal "" regex) (setq regex (loccur-prompt)))
   (loccur-toggle-mode regex)
-  (beginning-of-line)) ; Handier to be at the beginning of line
+  (when loccur-jump-beginning-of-line
+(beginning-of-line))) ; optionally jump to the beginning of line
 
 
 
@@ -239,7 +242,7 @@ if its size is 1 line"
 (defun loccur-1 (regex)
   (let* ((buffer-matches (loccur-find-matches regex))
  (ovl-bounds (loccur-create-overlay-bounds-btw-lines buffer-matches)))
-(setq loccur-overlay-list 
+(setq loccur-overlay-list
   (loccur-create-invisible-overlays ovl-bounds))
 (setq loccur-overlay-list
   (append loccur-overlay-list



[elpa] master 61dcaaf 37/40: Removed redundand code

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 61dcaaf53622ece672cc6114f3f75e5ce3544c09
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Removed redundand code

Removed ovl-start after comments in emacs-devel since
it was redundant
---
 loccur.el |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/loccur.el b/loccur.el
index 9b110b0..add5a44 100644
--- a/loccur.el
+++ b/loccur.el
@@ -274,9 +274,8 @@ REGEX is an argument to `loccur'."
   (mapcar (lambda (line)
 (let ((beginning (car line)))
   (unless ( = (- beginning prev-end) 1)
-(let ((ovl-start (if (= prev-end 1) 1 prev-end))
-  (ovl-end  (1- beginning)))
-  (push (list ovl-start ovl-end) overlays)))
+(let ((ovl-end  (1- beginning)))
+  (push (list prev-end ovl-end) overlays)))
   (setq prev-end (nth 3 line
   buffer-matches)
   (push (list (1+ prev-end) (point-max)) overlays)



[elpa] master f73cf0e 05/40: Added README file

2016-01-29 Thread Alexey Veretennikov
branch: master
commit f73cf0e6796858b4e44ccffb9dcf6247ca220bd0
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Added README file
---
 README.md |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/README.md b/README.md
new file mode 100644
index 000..fea8bd6
--- /dev/null
+++ b/README.md
@@ -0,0 +1,13 @@
+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:
+
+```elisp
+(require 'loccur)
+;; defines shortcut for loccur of the current word
+(define-key global-map [(control o)] 'loccur-current)
+;; defines shortcut for the interactive loccur command
+(define-key global-map [(control meta o)] 'loccur)
+;; defines shortcut for the loccur of the previously found word
+(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. 



[elpa] master 2bc08c6 14/40: Updated change log in the loccur.el file.

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 2bc08c63f6ebf89ca71fc0c0897daa3b02c23101
Author: Leo Perrin 
Commit: Alexey Veretennikov 

Updated change log in the loccur.el file.
---
 loccur.el |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/loccur.el b/loccur.el
index e374f6e..ae3919f 100644
--- a/loccur.el
+++ b/loccur.el
@@ -44,6 +44,11 @@
 ;; 
 ;;; Change Log:
 ;;
+;; 2013-03-31 (1.2)
+;;+ Added possibility to desactivate regex highlight, moved
+;;function in different sections and added the RET keyboard
+;;shortcut in loccur-mode (Leo Perrin).
+;;
 ;; 2010-03-07 (1.1.1)
 ;;+ Default value is taken from prompt instead of an edit area
 ;;(thanks to Nathaniel Flath)



[elpa] master 2680df7 34/40: Fixed bug when loccur called with empty argument.

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 2680df7e01ce119d0d36185c769048ff6b0b9ee5
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Fixed bug when loccur called with empty argument.
---
 loccur.el |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/loccur.el b/loccur.el
index eaed577..a59d406 100644
--- a/loccur.el
+++ b/loccur.el
@@ -162,9 +162,10 @@ containing the regular expression REGEX.  A second call of 
the function
 unhides lines again"
   (interactive
(if loccur-mode
-   nil
+   (list nil)
  (list (read-string "Loccur: " (loccur-prompt) 'loccur-history
-  (if (or (not regex) loccur-mode)
+  (if (or loccur-mode
+  (= (length regex) 0))
   (progn
 ;; remove current search and turn off loccur mode
 ;; to allow to call `loccur' multiple times



[elpa] master b1b1d91 18/40: Updated version

2016-01-29 Thread Alexey Veretennikov
branch: master
commit b1b1d917e5fc56a899f1b2443dd3c415352755fb
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Updated version
---
 loccur.el |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/loccur.el b/loccur.el
index ae3919f..3f0dfaf 100644
--- a/loccur.el
+++ b/loccur.el
@@ -1,10 +1,10 @@
 ;;; loccur.el --- Performs an occur-like folding in current buffer.
 
-;; Copyright (C) 2009 Alexey Veretennikov
+;; Copyright (C) 2009-2013 Alexey Veretennikov
 ;;
 ;; Author: Alexey Veretennikov 
 ;; Created: 2009-09-08
-;; Version: 1.1.1
+;; Version: 1.2
 ;; Keywords: matching
 ;; URL: https://github.com/fourier/loccur
 ;; Compatibility: GNU Emacs 22.x, GNU Emacs 23.x, GNU Emacs 24.x



[elpa] master 9b5d16c 13/40: Added detailed info on the README file.

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 9b5d16cdb00b96660313e8551dddbf3402cc6eed
Author: Leo Perrin 
Commit: Alexey Veretennikov 

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}
+
+  
+\end{frame}
+
+\begin{frame}
+  \frametitle{Then let's talk about this}
+
+  
+\end{frame}
+
+\begin{frame}
+  \frametitle{Wrapping up}
+
+  
+\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 a1e135a 12/40: Added loccur-no-highlight function.

2016-01-29 Thread Alexey Veretennikov
branch: master
commit a1e135af6ffd1018ba86e2dd2f3dbc630674a63e
Author: Leo Perrin 
Commit: Alexey Veretennikov 

Added loccur-no-highlight function.
---
 loccur.el |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/loccur.el b/loccur.el
index 1dc93d8..e374f6e 100644
--- a/loccur.el
+++ b/loccur.el
@@ -274,6 +274,14 @@ containing match"
 (forward-line 1))
   (setq lines (nreverse lines)
 
+(defun loccur-no-highlight(regex)
+  "Displays only the lines matching a given regex with no
+highlithing of any part of the lines."
+  (let (old-highlighting)
+(setq old-highlighting loccur-highlight-matching-regexp)
+(setq loccur-highlight-matching-regexp nil)
+(loccur regex)
+(setq loccur-highlight-matching-regexp old-highlighting)))
 
 
 (provide 'loccur)



[elpa] master aa1e119 07/40: Removed cl dependency

2016-01-29 Thread Alexey Veretennikov
branch: master
commit aa1e1193ffafe932031d1820612090543a1a5fbb
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Removed cl dependency
---
 loccur.el |  118 +++--
 1 files changed, 60 insertions(+), 58 deletions(-)

diff --git a/loccur.el b/loccur.el
index d45cc8f..13b934c 100644
--- a/loccur.el
+++ b/loccur.el
@@ -1,13 +1,13 @@
 ;;; loccur.el --- Perform an occur-like folding in current buffer
 
-;; Copyright (C) 2009 Alexey Veretennikov
+;; Copyright (C) 2009-2012 Alexey Veretennikov
 ;;
 ;; Author: Alexey Veretennikov 
 ;; Created: 2009-09-08
-;; Version: 1.1.1
+;; Version: 1.1.2
 ;; Keywords: matching
 ;; URL: http://loccur.sourceforge.net/
-;; Compatibility: GNU Emacs 22.x, GNU Emacs 23.x
+;; Compatibility: GNU Emacs 22.x, GNU Emacs 23.x, 24.x
 ;;
 ;; This file is NOT part of GNU Emacs.
 ;;
@@ -44,6 +44,10 @@
 ;; 
 ;;; Change Log:
 ;;
+;; 2012-09-25 (1.1.2)
+;;+ Removed cl dependency
+;;
+;; 
 ;; 2010-03-07 (1.1.1)
 ;;+ Default value is taken from prompt instead of an edit area
 ;;(thanks to Nathaniel Flath)
@@ -60,14 +64,12 @@
 ;;
 ;;; Code:
 
-(eval-when-compile (require 'cl))
-
 (defconst loccur-overlay-property-name 'loccur-custom-buffer-grep)
 
 
 (or (assq 'loccur-mode minor-mode-alist)
 (nconc minor-mode-alist
-  (list '(loccur-mode loccur-mode
+   (list '(loccur-mode loccur-mode
 
 
 (defvar loccur-mode nil) ;; name of the minor mode
@@ -91,15 +93,15 @@
 
 (defun loccur-mode (regex)
   (setqloccur-mode 
-   (if (or loccur-mode
-   (null regex)
-   (zerop (length regex)))
-   nil
- " Loccur"))
+(if (or loccur-mode
+(null regex)
+(zerop (length regex)))
+nil
+  " Loccur"))
   (force-mode-line-update)
   (loccur-remove-overlays)
   (when loccur-mode
-   (loccur-1 regex)))
+(loccur-1 regex)))
 
 
 (defun loccur-current ()
@@ -124,8 +126,8 @@ unhides lines again"
   (interactive 
(if loccur-mode
(list nil)
-   (list (read-string (concat "Regexp<" (loccur-prompt)
-  ">: ") "" 'loccur-history 
+ (list (read-string (concat "Regexp<" (loccur-prompt)
+">: ") "" 'loccur-history 
   (if (string-equal "" regex) (setq regex (loccur-prompt)))
   (loccur-mode regex))
 
@@ -151,38 +153,38 @@ if its size is 1 line"
 
 (defun loccur-1 (regex)
   (let* ((buffer-matches (loccur-find-matches regex))
-(ovl-bounds (loccur-create-overlay-bounds-btw-lines 
buffer-matches)))
-   (setq loccur-overlay-list 
- (loccur-create-invisible-overlays ovl-bounds))
+ (ovl-bounds (loccur-create-overlay-bounds-btw-lines buffer-matches)))
+(setq loccur-overlay-list 
+  (loccur-create-invisible-overlays ovl-bounds))
 (setq loccur-overlay-list
   (append loccur-overlay-list
   (loccur-create-highlighted-overlays buffer-matches)))
 (setq loccur-last-match regex)
-   (recenter)))
+(recenter)))
 
 (defun loccur-create-highlighted-overlays(buffer-matches)
   (let ((overlays 
-(map 'list #'(lambda (match)
-   (make-overlay
-(nth 1 match)
-(nth 2 match)
-(current-buffer) t nil))
- buffer-matches)))
-   (mapcar (lambda (ovl) 
+ (mapcar (lambda (match)
+   (make-overlay
+(nth 1 match)
+(nth 2 match)
+(current-buffer) t nil))
+ buffer-matches)))
+(mapcar (lambda (ovl) 
   (overlay-put ovl loccur-overlay-property-name t)
- (overlay-put ovl 'face 'isearch))
+  (overlay-put ovl 'face 'isearch))
 overlays)))
 
 
 (defun loccur-create-invisible-overlays (ovl-bounds)
   (let ((overlays 
-(map 'list #'(lambda (bnd)
-   (make-overlay
-(car bnd)
-(cadr bnd)
-(current-buffer) t nil))
- ovl-bounds)))
-   (mapcar (lambda (ovl) 
+ (mapcar (lambda (bnd)
+   (make-overlay
+(car bnd)
+(cadr bnd)
+(current-buffer) t nil))
+ ovl-bounds)))
+(mapcar (lambda (ovl) 
   (overlay-put ovl loccur-overlay-property-name t)
   (overlay-put ovl 'invisible t)
   ;; force intangible property if invisible property
@@ -198,18 +200,18 @@ if its size is 1 line"
 

[elpa] master 8ffd028 23/40: Preparation to move to GNU ELPA.

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 8ffd028a62647ec94830c3308cf95d703f46f810
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Preparation to move to GNU ELPA.

In order to move to GNU ELPA it is necessary to remove the code
from contributors who were not able/willing to sign FSF papers.

Revert "Fixed displaying problems on github caused by the README file."

This reverts commit e9d47144c12e689a650bf4fa36d587ce985c66e6.
---
 README.md |   29 +
 1 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/README.md b/README.md
index 939d7a0..4930cf8 100644
--- a/README.md
+++ b/README.md
@@ -28,22 +28,20 @@ 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.
+``` 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
-enim ad minim veniam, quis 20090 nostrud exercitation ullamco
-fugiat nulla pariatur. Excepteur sint occaecat 3 cupidatat non
-
+``` 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.
@@ -100,12 +98,11 @@ declaration in a beamer LaTeX file."
 ```
 
 When running this command, this buffer
-
 ```
 \begin{frame}
- \frametitle{First frame}
+  \frametitle{First frame}
 
- 
+  
 \end{frame}
 
 \begin{frame}



[elpa] master 59b8dd1 29/40: Implemented removed features and added face loccur-face

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 59b8dd1078ef34d3e8b583a66e5a5011ff5341e4
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Implemented removed features and added face loccur-face
---
 loccur.el |  164 +++--
 1 files changed, 105 insertions(+), 59 deletions(-)

diff --git a/loccur.el b/loccur.el
index c9c3d1d..0a5bab5 100644
--- a/loccur.el
+++ b/loccur.el
@@ -1,10 +1,10 @@
 ;;; loccur.el --- Perform an occur-like folding in current buffer
 
-;; Copyright (C) 2009-2013 Alexey Veretennikov
+;; Copyright (C) 2009-2015 Alexey Veretennikov
 ;;
 ;; Author: Alexey Veretennikov 
 ;; Created: 2009-09-08
-;; Version: 1.2.1
+;; Version: 1.2.2
 ;; Keywords: matching
 ;; URL: https://github.com/fourier/loccur
 ;; Compatibility: GNU Emacs 23.x, GNU Emacs 24.x
@@ -43,6 +43,11 @@
 ;;; TODO:
 ;; 
 ;;; Change Log:
+;;
+;; 2015-12-27 (1.2.2)
+;;+ Preparation for GNU ELPA submission. Removed contributions
+;;without signed papers
+;;+ added loccur-face - face to highlight text, by default isearch
 ;; 
 ;; 2013-10-22 (1.2.1)
 ;;+ Added custom option loccur-jump-beginning-of-line; removed some
@@ -63,46 +68,61 @@
 ;;
 ;;; Code:
 
-(defconst loccur-overlay-property-name 'loccur-custom-buffer-grep
-  "Property name of the overlay for all visible text")
+(require 'cl-lib)
+
+;; should be defined before define-minor-mode
+(defvar loccur-mode-map
+  (let ((map (make-sparse-keymap)))
+(define-key map (kbd "RET") '(lambda () (interactive) (loccur nil)))
+;; redefine Ctrl+Up/Down to Up/Down, since it looks like some problem
+;; with backward-paragraph and forward-paragraph with invisible overlays
+(define-key map (kbd "") 'previous-line)
+(define-key map (kbd "") 'next-line)
+map)
+  "Keymap for the variable `loccur-mode'.")
+
+;;;###autoload
+(define-minor-mode loccur-mode
+  "Minor mode for navigating through the file.
+Hides all lines without matches like `occur' does, but without opening
+a new window."
+  :lighter " loccur"
+  :keymap loccur-mode-map
+  (if loccur-mode
+  (loccur-1 loccur-current-search)
+(loccur-remove-overlays)
+(recenter)))
 
-(defcustom loccur-jump-beginning-of-line nil
-  "Set cursor to the beginning of the line when the loccur function is 
called.")
+(defface loccur-face
+  '((t (:inherit isearch)))
+  "Loccur face")
 
 
-;; FIXME wtf?
-(or (assq 'loccur-mode minor-mode-alist)
-(nconc minor-mode-alist
-   (list '(loccur-mode loccur-mode
+(defconst loccur-overlay-invisible-property-name 'loccur-invisible-overlay
+  "Property name of the overlay for all invisible text.")
 
+(defconst loccur-overlay-visible-property-name 'loccur-visible-overlay
+  "Property name of the overlay for all visible text.")
 
-(defvar loccur-mode nil) ;; name of the minor mode
-(make-variable-buffer-local 'loccur-mode)
+(defcustom loccur-jump-beginning-of-line nil
+  "Set cursor to the beginning of the line when the loccur function is called.
+Default: nil")
+
+(defcustom loccur-highlight-matching-regexp t
+  "If set to nil, the `loccur-mode' will not highlight matching words.
+Default: t")
 
 (defvar loccur-history nil
   "History of previously searched expressions for the prompt.")
-(make-variable-buffer-local 'loccur-history)
 
-(defvar loccur-last-match nil
+(defvar-local loccur-last-match nil
   "Last match found.")
-(make-variable-buffer-local 'loccur-last-match)
 
-(defvar loccur-overlay-list nil
+(defvar-local loccur-overlay-list nil
   "A list of currently active overlays.")
-(make-variable-buffer-local 'loccur-overlay-list)
-
-(defun loccur-mode (regex)
-  (setq loccur-mode 
-(if (or loccur-mode
-(null regex)
-(zerop (length regex)))
-nil
-  " Loccur"))
-  (force-mode-line-update)
-  (loccur-remove-overlays)
-  (when loccur-mode
-(loccur-1 regex)))
 
+(defvar-local loccur-current-search nil
+  "The expression to search in the current active mode.")
 
 (defun loccur-current ()
   "Call `loccur' for the current word."
@@ -123,13 +143,22 @@ containing the regular expression REGEX.  A second call 
of the function
 unhides lines again"
   (interactive
(if loccur-mode
-   (list nil)
- (list (read-string (concat "Regexp<" (loccur-prompt)
-">: ") "" 'loccur-history 
-  (if (string-equal "" regex) (setq regex (loccur-prompt)))
-  (loccur-mode regex)
-  (when loccur-jump-beginning-of-line
-(beginning-of-line))) ; optionally jump to the beginning of line
+   nil
+ (list (read-string "Loccur: " (loccur-prompt) 'loccur-history
+  (if (or (not regex) loccur-mode)
+  (progn
+;; remove current search and turn off loccur mode
+;; to allow to call `loccur' multiple times
+(setf loccur-current-search nil)
+(loccur-mode 0))
+;; otherwise do as usual
+;; if the regex argument is not equal to previous search
+(when (not (string-equal regex loccur-cu

[elpa] master 194dd68 30/40: Reimplemented loccur-no-highlight and fixed checkdoc

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 194dd688633069a1a28599b2a8d79e2e35ea4e77
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Reimplemented loccur-no-highlight and fixed checkdoc
---
 loccur.el |   15 +--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/loccur.el b/loccur.el
index 0a5bab5..a076a5d 100644
--- a/loccur.el
+++ b/loccur.el
@@ -109,7 +109,7 @@ a new window."
 Default: nil")
 
 (defcustom loccur-highlight-matching-regexp t
-  "If set to nil, the `loccur-mode' will not highlight matching words.
+  "If set to nil, do not highlight matching words.
 Default: t")
 
 (defvar loccur-history nil
@@ -135,6 +135,16 @@ Default: t")
   (interactive)
   (loccur loccur-last-match))
 
+(defun loccur-no-highlight (regex)
+  "Perform search like loccur, but temporary removing match highlight.
+REGEX is regexp to search"
+  (interactive
+   (if loccur-mode
+   nil
+ (list (read-string "Loccur: " (loccur-prompt) 'loccur-history
+  (let ((loccur-highlight-matching-regexp nil))
+(loccur regex)))
+
 (defun loccur (regex)
   "Perform a simple grep in current buffer.
 
@@ -291,7 +301,8 @@ containing match"
   (setq lines (nreverse lines)
 
 (defun loccur-toggle-highlight (&optional arg)
-  "Toggle the highlighting of the matches"
+  "Toggle the highlighting of the match.
+Optional argument ARG if t turn highlight on, off otherwise."
   (interactive)
   (setq loccur-highlight-matching-regexp (not 
loccur-highlight-matching-regexp))
   (when loccur-mode



[elpa] master 359fae1 25/40: Preparation to move to GNU ELPA.

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 359fae1dc8b0158cf455c60f4f68ba48755e2edf
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Preparation to move to GNU ELPA.

In order to move to GNU ELPA it is necessary to remove the code
from contributors who were not able/willing to sign FSF papers.

Revert "Added detailed info on the README file."

This reverts commit 9b5d16cdb00b96660313e8551dddbf3402cc6eed.
---
 README.md |  120 +---
 1 files changed, 2 insertions(+), 118 deletions(-)

diff --git a/README.md b/README.md
index 4930cf8..3636994 100644
--- a/README.md
+++ b/README.md
@@ -1,56 +1,4 @@
-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:
+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:
 
 ```scheme
 (require 'loccur)
@@ -62,68 +10,4 @@ You can add the following to your .emacs file:
 (define-key global-map [(control shift o)] 'loccur-previous-match)
 ```
 
-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}
-
-  
-\end{frame}
-
-\begin{frame}
-  \frametitle{Then let's talk about this}
-
-  
-\end{frame}
-
-\begin{frame}
-  \frametitle{Wrapping up}
-
-  
-\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.
+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. 



[elpa] master 2cacc68 33/40: Added types to custom

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 2cacc6877804b148e06d0e86f64478a562114064
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Added types to custom
---
 loccur.el |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/loccur.el b/loccur.el
index 6b29022..eaed577 100644
--- a/loccur.el
+++ b/loccur.el
@@ -111,11 +111,14 @@ a new window."
 
 (defcustom loccur-jump-beginning-of-line nil
   "Set cursor to the beginning of the line when the loccur function is called.
-Default: nil")
+Default: nil"
+  :type '(boolean)
+  :group 'loccur)
 
 (defcustom loccur-highlight-matching-regexp t
   "If set to nil, do not highlight matching words.
 Default: t"
+  :type '(boolean)  
   :group 'loccur)
 
 (defvar loccur-history nil



[elpa] master 66a9810 32/40: Merge pull request #3 from syohex/group

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 66a981064903a4fd9d220fcec27bdabee3f8cdcc
Merge: 194dd68 e5d1061
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Merge pull request #3 from syohex/group

Define group for customize and fixing byte-compile warnings
---
 loccur.el |   10 --
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/loccur.el b/loccur.el
index a076a5d..6b29022 100644
--- a/loccur.el
+++ b/loccur.el
@@ -70,6 +70,10 @@
 
 (require 'cl-lib)
 
+(defgroup loccur nil
+  "Perform an occur-like folding in current buffer."
+  :group 'tools)
+
 ;; should be defined before define-minor-mode
 (defvar loccur-mode-map
   (let ((map (make-sparse-keymap)))
@@ -95,7 +99,8 @@ a new window."
 
 (defface loccur-face
   '((t (:inherit isearch)))
-  "Loccur face")
+  "Loccur face"
+  :group 'loccur)
 
 
 (defconst loccur-overlay-invisible-property-name 'loccur-invisible-overlay
@@ -110,7 +115,8 @@ Default: nil")
 
 (defcustom loccur-highlight-matching-regexp t
   "If set to nil, do not highlight matching words.
-Default: t")
+Default: t"
+  :group 'loccur)
 
 (defvar loccur-history nil
   "History of previously searched expressions for the prompt.")



[elpa] master cb7f8ac 17/40: Merge pull request #1 from picarresursix/master

2016-01-29 Thread Alexey Veretennikov
branch: master
commit cb7f8ac75f8895eb13563ef95564927955498b23
Merge: 5859be9 d279b6a
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Merge pull request #1 from picarresursix/master

Support for RET in loccur-mode
---
 README.md |  125 +++-
 loccur.el |  214 -
 2 files changed, 249 insertions(+), 90 deletions(-)

diff --git a/README.md b/README.md
index 3636994..a047bc1 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,60 @@
-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:
+Functionalities
+===
+
+
+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 regexp. The following functions are
+provided:
+ 
+ + `loccur` Prompts for a regexp and hides all the lines not containing
+ matches. If the given regexp 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, hopefully useful functions using
+`loccur` are suggested in Section
+[Quick Navigation](#quick-navigation).
+
+
+Example
+===
+
+If you run `loccur` on regexp `[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
+enim ad minim veniam, quis 20090 nostrud exercitation ullamco
+fugiat nulla pariatur. Excepteur sint occaecat 3 cupidatat non
+
+
+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 +66,69 @@ 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}
+
+ 
+\end{frame}
+
+\begin{frame}
+  \frametitle{Then let's talk about this}
+
+  
+\end{frame}
+
+\begin{frame}
+  \frametitle{Wrapping up}
+
+  
+\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.
diff --git a/loccur.el b/loccur.el
index a9aec5a..ae3919f 100644
--- a/loccur.el
+++ b/loccur.el
@@ -1,13 +1,13 @@
-;

[elpa] master e9d4714 15/40: Fixed displaying problems on github caused by the README file.

2016-01-29 Thread Alexey Veretennikov
branch: master
commit e9d47144c12e689a650bf4fa36d587ce985c66e6
Author: Leo Perrin 
Commit: Alexey Veretennikov 

Fixed displaying problems on github caused by the README file.
---
 README.md |   29 -
 1 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/README.md b/README.md
index 4930cf8..939d7a0 100644
--- a/README.md
+++ b/README.md
@@ -28,20 +28,22 @@ 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.```
+
+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
-```
+Lorem ipsum dolor 100 sit amet, consectetur adipisicing elit, sed
+enim ad minim veniam, quis 20090 nostrud exercitation ullamco
+fugiat nulla pariatur. Excepteur sint occaecat 3 cupidatat non
+
 
 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.
@@ -98,11 +100,12 @@ declaration in a beamer LaTeX file."
 ```
 
 When running this command, this buffer
+
 ```
 \begin{frame}
-  \frametitle{First frame}
+ \frametitle{First frame}
 
-  
+ 
 \end{frame}
 
 \begin{frame}



[elpa] master 03789fa 35/40: Updated README

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 03789faf4d113a410ddb3e568ff86d804e9fb42e
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Updated README
---
 README.md |   27 +--
 1 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 3636994..5cba2b3 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,27 @@
-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:
+# Loccur
+## Introduction
+**Loccur** is an amazing tool to quickly navigate in a file. It 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.
+## Installation
+Add to your `.emacs` or `.emacs.d/init.el` following lines:
+
+```scheme
+(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/";)
+ ("melpa" . "http://melpa.milkbox.net/packages/";)))
+```
+ 
+Press `M-x` in GNU Emacs and write `list-packages`. Find the `loccur` in the 
list of packages and press `i` to select this package, `x` to install the 
package.
+
+
+## Screenshots
+Better to see it once:
+
+![loccur_gui](https://github.com/fourier/loccur/raw/screenshots/gui_emacs_with_loccur.gif
 "GUI Emacs with loccur")
+![loccur_term](https://github.com/fourier/loccur/raw/screenshots/emacs_with_loccur.gif
 "Emacs in terminal with loccur")
+
+
+## Usage
+
+To use it, add the following to your .emacs file:
 
 ```scheme
 (require 'loccur)
@@ -10,4 +33,4 @@ 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 `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. 



[elpa] master a90bd54 38/40: Preparation to submission to GNU ELPA

2016-01-29 Thread Alexey Veretennikov
branch: master
commit a90bd547b40e5dc8acf51a33de6f9821f613aade
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Preparation to submission to GNU ELPA
---
 loccur.el |   35 ++-
 1 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/loccur.el b/loccur.el
index add5a44..6249d44 100644
--- a/loccur.el
+++ b/loccur.el
@@ -1,28 +1,30 @@
-;;; loccur.el --- Perform an occur-like folding in current buffer
+;;; loccur.el --- Perform an occur-like folding in current buffer -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2009-2015 Alexey Veretennikov
+;; Copyright (C) 2009-2016 Free Software Foundation, Inc
+;;
+;; Author: Alexey Veretennikov 
 ;;
-;; Author: Alexey Veretennikov 
 ;; Created: 2009-09-08
 ;; Version: 1.2.2
+;; Package-Requires: ((cl-lib "0"))
 ;; Keywords: matching
 ;; URL: https://github.com/fourier/loccur
 ;; Compatibility: GNU Emacs 23.x, GNU Emacs 24.x
 ;;
-;; This file is NOT part of GNU Emacs.
+;; This file is part of GNU Emacs.
 ;;
-;; This program is free software; you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License
-;; as published by the Free Software Foundation; either version 2
-;; of the License, or (at your option) any later version.
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 ;;
-;; This program is distributed in the hope that it will be useful,
+;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; GNU General Public License for more details.
 ;;
 ;; You should have received a copy of the GNU General Public License
-;; along with this program.  If not, see .
+;; along with GNU Emacs.  If not, see .
 ;;
 ;;; Commentary:
 ;;
@@ -91,7 +93,6 @@
 Hides all lines without matches like `occur' does, but without opening
 a new window."
   :lighter " loccur"
-  :keymap loccur-mode-map
   (if loccur-mode
   (loccur-1 loccur-current-search)
 (loccur-remove-overlays)
@@ -99,8 +100,7 @@ a new window."
 
 (defface loccur-face
   '((t (:inherit isearch)))
-  "Loccur face"
-  :group 'loccur)
+  "Loccur face")
 
 
 (defconst loccur-overlay-invisible-property-name 'loccur-invisible-overlay
@@ -118,7 +118,7 @@ Default: nil"
 (defcustom loccur-highlight-matching-regexp t
   "If set to nil, do not highlight matching words.
 Default: t"
-  :type '(boolean)  
+  :type '(boolean)
   :group 'loccur)
 
 (defvar loccur-history nil
@@ -201,10 +201,11 @@ if its size is 1 line"
   mark-active)
  (let ((pos1 (region-beginning))
(pos2 (region-end)))
-   ;; Check if the start and the of an active region is on
+   ;; Check if the start and the end of an active region is on
;; the same line
-   (if (= (line-number-at-pos pos1)
-  (line-number-at-pos pos2))
+   (when (save-excursion
+   (goto-char pos1)
+   (<= pos2 (line-end-position)))
(buffer-substring-no-properties pos1 pos2)))
(current-word
 prompt))



[elpa] master d08fdac 36/40: Updated README and rearranged functions.

2016-01-29 Thread Alexey Veretennikov
branch: master
commit d08fdac495552f3dc70e671f4c14ac0863abae27
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Updated README and rearranged functions.
---
 README.md |   16 +++-
 loccur.el |   20 ++--
 2 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/README.md b/README.md
index 5cba2b3..cea09cd 100644
--- a/README.md
+++ b/README.md
@@ -33,4 +33,18 @@ To use it, add the following to your .emacs file:
 (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 `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.
+
+### Available commands
+Below is the list of interactive commands available for user:
+
+* `loccur` interactively asks user for regexp to search or toggle search off 
(if `loccur-mode` is already enabled)
+* `loccur-current` searches for the current word under the cursor
+* `loccur-previous-match` repeat previous `loccur` command
+* `loccur-no-highlight` is the same as `loccur` but not highlighting matches
+* `loccur-toggle-highlight` toggles highlighting of matches
+
+### Customization
+* `loccur-jump-beginning-of-line` variable specifies if move the cursor to the 
beginning of the matching line. Default `nil`
+* `loccur-highlight-matching-regexp` variable whenever `loccur` should 
highlight matching words. Default `t`.
+* `loccur-face` face to be used while highlighting. Default points to 
`isearch` face.
diff --git a/loccur.el b/loccur.el
index a59d406..9b110b0 100644
--- a/loccur.el
+++ b/loccur.el
@@ -154,6 +154,16 @@ REGEX is regexp to search"
   (let ((loccur-highlight-matching-regexp nil))
 (loccur regex)))
 
+(defun loccur-toggle-highlight (&optional arg)
+  "Toggle the highlighting of the match.
+Optional argument ARG if t turn highlight on, off otherwise."
+  (interactive)
+  (setq loccur-highlight-matching-regexp (not 
loccur-highlight-matching-regexp))
+  (when loccur-mode
+(dolist (ovl loccur-overlay-list)
+  (when (overlay-get ovl loccur-overlay-visible-property-name)
+(overlay-put ovl 'face (if loccur-highlight-matching-regexp 
'loccur-face nil))
+
 (defun loccur (regex)
   "Perform a simple grep in current buffer.
 
@@ -181,7 +191,6 @@ unhides lines again"
 (beginning-of-line) ; optionally jump to the beginning of line
 
 
-
 (defun loccur-prompt ()
   "Return the default value of the prompt.
 
@@ -310,15 +319,6 @@ containing match"
 (forward-line 1))
   (setq lines (nreverse lines)
 
-(defun loccur-toggle-highlight (&optional arg)
-  "Toggle the highlighting of the match.
-Optional argument ARG if t turn highlight on, off otherwise."
-  (interactive)
-  (setq loccur-highlight-matching-regexp (not 
loccur-highlight-matching-regexp))
-  (when loccur-mode
-(dolist (ovl loccur-overlay-list)
-  (when (overlay-get ovl loccur-overlay-visible-property-name)
-(overlay-put ovl 'face (if loccur-highlight-matching-regexp 
'loccur-face nil))
 
 
 



[elpa] master fb1fbc0 39/40: Fixed compilation warnings.

2016-01-29 Thread Alexey Veretennikov
branch: master
commit fb1fbc0ff5da7a8b117542ab8083d29cd79e12b2
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Fixed compilation warnings.
---
 loccur.el |   24 ++--
 1 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/loccur.el b/loccur.el
index 6249d44..2921ba0 100644
--- a/loccur.el
+++ b/loccur.el
@@ -154,9 +154,8 @@ REGEX is regexp to search"
   (let ((loccur-highlight-matching-regexp nil))
 (loccur regex)))
 
-(defun loccur-toggle-highlight (&optional arg)
-  "Toggle the highlighting of the match.
-Optional argument ARG if t turn highlight on, off otherwise."
+(defun loccur-toggle-highlight ()
+  "Toggle the highlighting of the match."
   (interactive)
   (setq loccur-highlight-matching-regexp (not 
loccur-highlight-matching-regexp))
   (when loccur-mode
@@ -272,13 +271,13 @@ REGEX is an argument to `loccur'."
   (let ((prev-end (point-min))
 (overlays (list)))
 (when buffer-matches
-  (mapcar (lambda (line)
-(let ((beginning (car line)))
-  (unless ( = (- beginning prev-end) 1)
-(let ((ovl-end  (1- beginning)))
-  (push (list prev-end ovl-end) overlays)))
-  (setq prev-end (nth 3 line
-  buffer-matches)
+  (mapc (lambda (line)
+  (let ((beginning (car line)))
+(unless ( = (- beginning prev-end) 1)
+  (let ((ovl-end  (1- beginning)))
+(push (list prev-end ovl-end) overlays)))
+(setq prev-end (nth 3 line
+buffer-matches)
   (push (list (1+ prev-end) (point-max)) overlays)
   (setq overlays (nreverse overlays)
 
@@ -293,13 +292,10 @@ containing match"
 ;; Go to the beginnig of buffer
 (goto-char (point-min))
 ;; Set initial values for variables
-(let ((matches 0)
-  (curpoint nil)
-  (endpoint nil)
+(let ((endpoint nil)
   (lines (list)))
   ;; Search loop
   (while (not (eobp))
-(setq curpoint (point))
 ;; if something found
 (when (setq endpoint (re-search-forward regex nil t))
   (save-excursion



[elpa] master 8f6fe36 40/40: Add 'packages/loccur/' from commit 'fb1fbc0ff5da7a8b117542ab8083d29cd79e12b2'

2016-01-29 Thread Alexey Veretennikov
branch: master
commit 8f6fe36e1ad23834e9b772e8fcdfe85d5eb47356
Merge: ada08b0 fb1fbc0
Author: Alexey Veretennikov 
Commit: Alexey Veretennikov 

Add 'packages/loccur/' from commit 
'fb1fbc0ff5da7a8b117542ab8083d29cd79e12b2'

git-subtree-dir: packages/loccur
git-subtree-mainline: ada08b05a1ff278c1e20d9af60fb22fe9f8e65fc
git-subtree-split: fb1fbc0ff5da7a8b117542ab8083d29cd79e12b2
---
 packages/loccur/README.md |   50 +++
 packages/loccur/loccur.el |  323 +
 2 files changed, 373 insertions(+), 0 deletions(-)

diff --git a/packages/loccur/README.md b/packages/loccur/README.md
new file mode 100644
index 000..cea09cd
--- /dev/null
+++ b/packages/loccur/README.md
@@ -0,0 +1,50 @@
+# Loccur
+## Introduction
+**Loccur** is an amazing tool to quickly navigate in a file. It 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.
+## Installation
+Add to your `.emacs` or `.emacs.d/init.el` following lines:
+
+```scheme
+(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/";)
+ ("melpa" . "http://melpa.milkbox.net/packages/";)))
+```
+ 
+Press `M-x` in GNU Emacs and write `list-packages`. Find the `loccur` in the 
list of packages and press `i` to select this package, `x` to install the 
package.
+
+
+## Screenshots
+Better to see it once:
+
+![loccur_gui](https://github.com/fourier/loccur/raw/screenshots/gui_emacs_with_loccur.gif
 "GUI Emacs with loccur")
+![loccur_term](https://github.com/fourier/loccur/raw/screenshots/emacs_with_loccur.gif
 "Emacs in terminal with loccur")
+
+
+## Usage
+
+To use it, add the following to your .emacs file:
+
+```scheme
+(require 'loccur)
+;; defines shortcut for loccur of the current word
+(define-key global-map [(control o)] 'loccur-current)
+;; defines shortcut for the interactive loccur command
+(define-key global-map [(control meta o)] 'loccur)
+;; defines shortcut for the loccur of the previously found word
+(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.
+
+### Available commands
+Below is the list of interactive commands available for user:
+
+* `loccur` interactively asks user for regexp to search or toggle search off 
(if `loccur-mode` is already enabled)
+* `loccur-current` searches for the current word under the cursor
+* `loccur-previous-match` repeat previous `loccur` command
+* `loccur-no-highlight` is the same as `loccur` but not highlighting matches
+* `loccur-toggle-highlight` toggles highlighting of matches
+
+### Customization
+* `loccur-jump-beginning-of-line` variable specifies if move the cursor to the 
beginning of the matching line. Default `nil`
+* `loccur-highlight-matching-regexp` variable whenever `loccur` should 
highlight matching words. Default `t`.
+* `loccur-face` face to be used while highlighting. Default points to 
`isearch` face.
diff --git a/packages/loccur/loccur.el b/packages/loccur/loccur.el
new file mode 100644
index 000..2921ba0
--- /dev/null
+++ b/packages/loccur/loccur.el
@@ -0,0 +1,323 @@
+;;; loccur.el --- Perform an occur-like folding in current buffer -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2016 Free Software Foundation, Inc
+;;
+;; Author: Alexey Veretennikov 
+;;
+;; Created: 2009-09-08
+;; Version: 1.2.2
+;; Package-Requires: ((cl-lib "0"))
+;; Keywords: matching
+;; URL: https://github.com/fourier/loccur
+;; Compatibility: GNU Emacs 23.x, GNU Emacs 24.x
+;;
+;; This file is part of GNU Emacs.
+;;
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see .
+;;
+;;; Commentary:
+;;
+;; Add the following to your .emacs file:
+;; 
+;; (require 'loccur)
+;; ;; defines shortcut for loccur of the current word
+;; (define-key global-map [(control o)] 'loccur-current)
+;; ;; defines shortcut for the interactive loccur command
+;; (define-key global-map [(control meta o)] 'loccur)
+;; ;; defines shortcut for the loccur of the previously found word
+;; (define-key global-map [(contro

[elpa] master 59cb26c 2/5: multishell - add multishell-list, solidify facilities

2016-01-29 Thread ken manheimer
branch: master
commit 59cb26c3984c59047c186b040689643a4b81bf17
Author: Ken Manheimer 
Commit: Ken Manheimer 

multishell - add multishell-list, solidify facilities

- multishell-list.el based on tabulated-list
- refactor multishell-pop-to-shell so users can activate multishell-list
  from universal-arg prompt in minibuffer, via throw/catch
- ensure pivotal multishell-name-from-entry reliability
- remove unnecessary complications from multishell-all-entries
---
 multishell-list.el |  137 ++
 multishell.el  |  323 +---
 2 files changed, 294 insertions(+), 166 deletions(-)

diff --git a/multishell-list.el b/multishell-list.el
new file mode 100644
index 000..5dab00a
--- /dev/null
+++ b/multishell-list.el
@@ -0,0 +1,137 @@
+;;; multishell-list.el --- tabulated-list-mode for multishell shell buffers
+
+;; Copyright (C) 2016 Free Software Foundation, Inc. and Ken Manheimer
+
+;; Author: Ken Manheimer 
+;; Version: 1.0.9
+;; Created: 2016 -- first public availability
+;; Keywords: processes
+;; URL: https://github.com/kenmanheimer/EmacsMultishell
+
+(require 'tabulated-list)
+
+(defun multishell-list-open-pop ()
+  "Pop to current entry's shell, and refresh the listing buffer."
+  (interactive)
+  (multishell-pop-to-shell nil (tabulated-list-get-id)))
+(defun multishell-list-open-here ()
+  "Switch to current entry's shell buffer."
+  (interactive)
+  (multishell-pop-to-shell nil (tabulated-list-get-id) 'here))
+
+(defun multishell-list-delete ()
+  "Remove current environment variable value."
+  (interactive)
+  (let* ((where (save-excursion (beginning-of-line) (point)))
+ (entry (tabulated-list-get-id))
+ (name (multishell-name-from-entry entry))
+ (name-bracketed (multishell-bracket name))
+ (buffer (get-buffer name-bracketed)))
+(when (multishell-delete-history-name name)
+  (and buffer
+   ;; If the process is live, let shell-mode get confirmation:
+   (or (comint-check-proc (current-buffer))
+   (y-or-n-p (format "Kill buffer %s? " name-bracketed)))
+   (kill-buffer name-bracketed)))
+(revert-buffer)
+(if (not tabulated-list-sort-key)
+(revert-buffer))
+(goto-char where)))
+
+(defun multishell-list-edit-entry ()
+  "Edit the value of current shell entry."
+  (interactive)
+  (let* ((where (save-excursion (beginning-of-line) (point)))
+ (entry (tabulated-list-get-id))
+ (name (multishell-name-from-entry entry))
+ (revised (multishell-read-unbracketed-entry
+   (format "Edit shell spec for %s: " name)
+   nil
+   entry))
+ (revised-pair (when revised (multishell-split-entry revised
+(when revised-pair
+  (multishell-delete-history-name name)
+  (multishell-register-name-to-path (car revised-pair) (cadr revised-pair))
+  (revert-buffer)
+  (if (not tabulated-list-sort-key)
+  (revert-buffer))
+  (goto-char where
+
+(defun multishell-list-placeholder (value default)
+  "Return VALUE if non-empty string, else DEFAULT."
+  (if (or (not value) (string= value ""))
+  default
+value))
+(defun multishell-list-entries ()
+  "Generate multishell name/path entries list for tabulated-list."
+  (let ((recency 0))
+(mapcar #'(lambda (entry)
+(setq recency (1+ recency))
+(let* ((splat (multishell-split-entry entry))
+   (name (car splat))
+   (buffer (and name
+(get-buffer
+ (multishell-bracket name
+   (status (cond ((not buffer) " ")
+ ((comint-check-proc buffer) "+")
+ (t "-")))
+   (rest (cadr splat))
+   (dissected (and rest (file-remote-p rest)
+   (tramp-dissect-file-name rest t)))
+   (path (or (and dissected (aref dissected 3))
+ rest))
+   (hops (and dissected
+  (substring
+   rest 0 (- (length rest) (length path))
+  (when (not name)
+(setq name (multishell-name-from-entry entry)))
+  (list entry
+(vector (format "%d" recency)
+status
+name
+(multishell-list-placeholder hops "-")
+(multishell-list-placeholder path ":")
+(multishell-all-entries
+
+(defun compare-strings-as-numbers (a b)
+  (let ((a (aref (cadr a) 0))
+(b (aref (cadr b) 0)))
+(> (string-to-number a) (string-to-number b
+(define-derived-mode

[elpa] master 30ba444 5/5: Merge multishell 1.0.9

2016-01-29 Thread ken manheimer
branch: master
commit 30ba44404311276d2650664001c5261e52d3008f
Merge: 8f6fe36 46bdd13
Author: Ken Manheimer 
Commit: Ken Manheimer 

Merge multishell 1.0.9
---
 packages/multishell/multishell-list.el |  137 
 packages/multishell/multishell.el  |  271 +++-
 2 files changed, 296 insertions(+), 112 deletions(-)

diff --git a/packages/multishell/multishell-list.el 
b/packages/multishell/multishell-list.el
new file mode 100644
index 000..ae72f92
--- /dev/null
+++ b/packages/multishell/multishell-list.el
@@ -0,0 +1,137 @@
+;;; multishell-list.el --- tabulated-list-mode for multishell shell buffers
+
+;; Copyright (C) 2016 Free Software Foundation, Inc. and Ken Manheimer
+
+;; Author: Ken Manheimer 
+;; Version: 1.0.9
+;; Created: 2016 -- first public availability
+;; Keywords: processes
+;; URL: https://github.com/kenmanheimer/EmacsMultishell
+
+(require 'tabulated-list)
+
+(defun multishell-list-open-pop ()
+  "Pop to current entry's shell, and refresh the listing buffer."
+  (interactive)
+  (multishell-pop-to-shell nil (tabulated-list-get-id)))
+(defun multishell-list-open-here ()
+  "Switch to current entry's shell buffer."
+  (interactive)
+  (multishell-pop-to-shell nil (tabulated-list-get-id) 'here))
+
+(defun multishell-list-delete ()
+  "Remove current environment variable value."
+  (interactive)
+  (let* ((where (save-excursion (beginning-of-line) (point)))
+ (entry (tabulated-list-get-id))
+ (name (multishell-name-from-entry entry))
+ (name-bracketed (multishell-bracket name))
+ (buffer (get-buffer name-bracketed)))
+(when (multishell-delete-history-name name)
+  (and buffer
+   ;; If the process is live, let shell-mode get confirmation:
+   (or (comint-check-proc (current-buffer))
+   (y-or-n-p (format "Kill buffer %s? " name-bracketed)))
+   (kill-buffer name-bracketed)))
+(revert-buffer)
+(if (not tabulated-list-sort-key)
+(revert-buffer))
+(goto-char where)))
+
+(defun multishell-list-edit-entry ()
+  "Edit the value of current shell entry."
+  (interactive)
+  (let* ((where (save-excursion (beginning-of-line) (point)))
+ (entry (tabulated-list-get-id))
+ (name (multishell-name-from-entry entry))
+ (revised (multishell-read-unbracketed-entry
+   (format "Edit shell spec for %s: " name)
+   nil
+   entry))
+ (revised-pair (when revised (multishell-split-entry revised
+(when revised-pair
+  (multishell-delete-history-name name)
+  (multishell-register-name-to-path (car revised-pair) (cadr revised-pair))
+  (revert-buffer)
+  (if (not tabulated-list-sort-key)
+  (revert-buffer))
+  (goto-char where
+
+(defun multishell-list-placeholder (value default)
+  "Return VALUE if non-empty string, else DEFAULT."
+  (if (or (not value) (string= value ""))
+  default
+value))
+(defun multishell-list-entries ()
+  "Generate multishell name/path entries list for tabulated-list."
+  (let ((recency 0))
+(mapcar #'(lambda (entry)
+(setq recency (1+ recency))
+(let* ((splat (multishell-split-entry entry))
+   (name (car splat))
+   (buffer (and name
+(get-buffer
+ (multishell-bracket name
+   (status (cond ((not buffer) "x")
+ ((comint-check-proc buffer) "+")
+ (t ".")))
+   (rest (cadr splat))
+   (dissected (and rest (file-remote-p rest)
+   (tramp-dissect-file-name rest t)))
+   (path (or (and dissected (aref dissected 3))
+ rest))
+   (hops (and dissected
+  (substring
+   rest 0 (- (length rest) (length path))
+  (when (not name)
+(setq name (multishell-name-from-entry entry)))
+  (list entry
+(vector (format "%d" recency)
+status
+name
+(multishell-list-placeholder hops "-")
+(multishell-list-placeholder path ":")
+(multishell-all-entries
+
+(defun compare-strings-as-numbers (a b)
+  (let ((a (aref (cadr a) 0))
+(b (aref (cadr b) 0)))
+(> (string-to-number a) (string-to-number b
+(define-derived-mode multishell-list-mode
+tabulated-list-mode "Shells"
+  "Major mode for listing current and historically registered shells..
+\\{multishell-list-mode-map\}"
+  (setq tabulated-list-format [("#" 0 compare-strings-as-numbers)
+  

[elpa] master 04a0dec 1/5: multishell - start multishell-list-shells tabulated list functionality.

2016-01-29 Thread ken manheimer
branch: master
commit 04a0dec67dab70f378c49277178ba294e7392a38
Author: Ken Manheimer 
Commit: Ken Manheimer 

multishell - start multishell-list-shells tabulated list functionality.
---
 multishell.el |   56 
 1 files changed, 56 insertions(+), 0 deletions(-)

diff --git a/multishell.el b/multishell.el
index 2f43752..353ef92 100644
--- a/multishell.el
+++ b/multishell.el
@@ -139,6 +139,7 @@
 (require 'comint)
 (require 'shell)
 (require 'savehist)
+(require 'tabulated-list)
 
 (defvar multishell-version "1.0.8")
 (defun multishell-version (&optional here)
@@ -280,6 +281,7 @@ Promote added/changed entry to the front of the list."
   (setq got (cons entry got
   got)))
 
+;;;###autoload
 (defun multishell-pop-to-shell (&optional arg)
   "Easily navigate to and within multiple shell buffers, local and remote.
 
@@ -680,6 +682,60 @@ Returns nil for empty parts, rather than the empty string."
   (setq name (substring name 0 -1)))
   name)
 
+(defun multishell-list-add-shell ()
+  "Pop to new shell, and refresh the listing buffer."
+  (interactive)
+  (multishell-pop-to-shell '(4))
+  (tabulated-list-revert))
+
+(defun multishell-list-remove ()
+  "Remove current environment variable value."
+  (interactive)
+  (let ((current-prefix-arg t))
+(multishell-list-setenv)))
+
+(defun multishell-list-setenv ()
+  "Edit the value of current shell entry."
+  (interactive)
+;;  (let ((name (tabulated-list-get-id)))
+  (let* ((name "shell")
+ (path (or (cadr (multishell-history-entries name)) "")))
+(minibuffer-with-setup-hook
+(lambda () (insert (concat name path)))
+  (call-interactively 'multishell-register-name-to-path))
+(tabulated-list-revert)))
+
+(defun multishell-list-entries ()
+  "Generate multishell name/path entries list for tabulated-list."
+  (mapcar #'(lambda (entry)
+(multishell-split-entry entry))
+  multishell-history)
+
+(define-derived-mode multishell-list-mode
+tabulated-list-mode "Shells"
+  "Major mode for listing current and historically registered shells..
+\\{multishell-list-mode-map\}"
+  (setq tabulated-list-format [("Name" 15 t)
+   ("Path" 60 t)]
+tabulated-list-sort-key (cons "Name" nil)
+tabulated-list-padding 2
+tabulated-list-entries #'multishell-list-entries)
+  (tabulated-list-init-header))
+
+(define-key multishell-list-mode-map (kbd "s") 'multishell-list-add-)
+(define-key multishell-list-mode-map (kbd "a") 'multishell-list-addenv)
+(define-key multishell-list-mode-map (kbd "d") 'multishell-list-clear)
+
+;;;###autoload
+(defun multishell-list ()
+  "List process environment in a tabulated view."
+  (interactive)
+  (let ((buffer (get-buffer-create "*Process-Environment*")))
+(pop-to-buffer buffer)
+(multishell-list-mode)
+(tabulated-list-print)))
+
+
 (provide 'multishell)
 
 ;;; multishell.el ends here



[elpa] master updated (8f6fe36 -> 30ba444)

2016-01-29 Thread ken manheimer
kenmanheimer pushed a change to branch master.

  from  8f6fe36   Add 'packages/loccur/' from commit 
'fb1fbc0ff5da7a8b117542ab8083d29cd79e12b2'
   new  04a0dec   multishell - start multishell-list-shells tabulated list 
functionality.
   new  59cb26c   multishell - add multishell-list, solidify facilities
   new  7b19a19   multishell - whoops, changed commentary while editing 
commit message.
   new  46bdd13   multishell - list active the present then historical 
buffers
   new  30ba444   Merge multishell 1.0.9


Summary of changes:
 packages/multishell/multishell-list.el |  137 
 packages/multishell/multishell.el  |  271 +++-
 2 files changed, 296 insertions(+), 112 deletions(-)
 create mode 100644 packages/multishell/multishell-list.el



[elpa] master 7b19a19 3/5: multishell - whoops, changed commentary while editing commit message.

2016-01-29 Thread ken manheimer
branch: master
commit 7b19a19976c67a532ef349c84843275e3ab8a0c2
Author: Ken Manheimer 
Commit: Ken Manheimer 

multishell - whoops, changed commentary while editing commit message.
---
 multishell.el |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/multishell.el b/multishell.el
index 4e6cc36..422c55f 100644
--- a/multishell.el
+++ b/multishell.el
@@ -44,8 +44,7 @@
 ;;   the auspices of the target account, and relative to the current
 ;;   directory, on the host where the shell is running.
 ;;
-;; * Manage your list of active and historically registered shells, as a
-;;   collection.
+;; * Manage your list of shells, current and past, as a collection.
 ;;
 ;; See the `multishell-pop-to-shell` docstring for details.
 ;;



[elpa] master 46bdd13 4/5: multishell - list active the present then historical buffers

2016-01-29 Thread ken manheimer
branch: master
commit 46bdd13d97357cd624de91fb19e5a602aabfa8e6
Author: Ken Manheimer 
Commit: Ken Manheimer 

multishell - list active the present then historical buffers

and identify them in multishell-list as "+" = active, "." = present, and
"x" = past/not present.
---
 multishell-list.el |4 ++--
 multishell.el  |   17 +
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/multishell-list.el b/multishell-list.el
index 5dab00a..ae72f92 100644
--- a/multishell-list.el
+++ b/multishell-list.el
@@ -72,9 +72,9 @@
(buffer (and name
 (get-buffer
  (multishell-bracket name
-   (status (cond ((not buffer) " ")
+   (status (cond ((not buffer) "x")
  ((comint-check-proc buffer) "+")
- (t "-")))
+ (t ".")))
(rest (cadr splat))
(dissected (and rest (file-remote-p rest)
(tramp-dissect-file-name rest t)))
diff --git a/multishell.el b/multishell.el
index 422c55f..7aa4b46 100644
--- a/multishell.el
+++ b/multishell.el
@@ -540,19 +540,20 @@ Optional ACTIVE-DUPLICATED will return a copy of
 `multishell-history' with unbracketed names of active buffers,
 sans paths, appended to the list, so they have short and long
 completions."
-  ;; Reorder so active buffers are listed first:
-  (let (active-entries active-names historicals splat name path buffer)
+  ;; Reorder so active lead present lead historical entries:
+  (let (active-entries active-names present past splat name path buffer)
 (dolist (entry multishell-history)
   (setq splat (multishell-split-entry entry)
 name (car splat)
 path (cadr splat)
 buffer (and name (get-buffer (multishell-bracket name
-  (if (and (buffer-live-p buffer)
-   (comint-check-proc buffer))
-  (setq active-entries (push entry active-entries)
-active-names (push name active-names))
-(setq historicals (push entry historicals
-(setq multishell-history (append active-entries historicals))
+  (if (buffer-live-p buffer)
+  (if (comint-check-proc buffer)
+  (setq active-entries (push entry active-entries)
+active-names (push name active-names))
+(setq present (push entry present)))
+(setq past (push entry past
+(setq multishell-history (append active-entries present past))
 (if active-duplicated
 (append multishell-history active-names)
   multishell-history)))