[elpa] master 8536d5d 05/10: Use specified Emacs when running cask.

2015-06-18 Thread Jackson Ray Hamilton
branch: master
commit 8536d5d0a275c4b7bbf0a2d22d0b6ae014fdc280
Author: Jackson Ray Hamilton 
Commit: Jackson Ray Hamilton 

Use specified Emacs when running cask.
---
 Makefile |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 0b37043..dfa219d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-CASK = cask
 EMACS = emacs
+CASK = EMACS=${EMACS} cask
 DEPENDENCIES = .cask/
 SCOPIFIER_PORT = $$(lsof -t -i :6969)
 KILL_SCOPIFIER = if [ -n "${SCOPIFIER_PORT}" ]; then kill ${SCOPIFIER_PORT}; fi



[elpa] master updated (f89ef19 -> 61b8c49)

2015-06-18 Thread Jackson Ray Hamilton
jackson pushed a change to branch master.

  from  f89ef19   Merge commit 'd76bcd7c0dcecb33e6955e25963028600c371588'
   new  137a109   Fix bugs where parsing left point after a scope.
   new  841aac4   Add eval-expression support.
   new  c6cdb04   Benchmark coloring time separately.
   new  296f07b   Update sexps per pause.
   new  8536d5d   Use specified Emacs when running cask.
   new  b19a0a2   Add predicate option for dispatches.
   new  4eacc29   Update eval-expression recommendation for 24.3.
   new  456f6e4   Use evm in build.
   new  294b511   Version 6.5.0.
   new  61b8c49   Merge commit '294b5117b42d2622f4fb0a1da219d45d98566b6e' 
from context-coloring


Summary of changes:
 packages/context-coloring/.travis.yml  |   25 ++-
 packages/context-coloring/Makefile |2 +-
 packages/context-coloring/README.md|   12 +-
 .../benchmark/context-coloring-benchmark.el|   16 +-
 packages/context-coloring/context-coloring.el  |  211 
 .../context-coloring/test/context-coloring-test.el |   24 ++-
 6 files changed, 181 insertions(+), 109 deletions(-)



[elpa] master 294b511 09/10: Version 6.5.0.

2015-06-18 Thread Jackson Ray Hamilton
branch: master
commit 294b5117b42d2622f4fb0a1da219d45d98566b6e
Author: Jackson Ray Hamilton 
Commit: Jackson Ray Hamilton 

Version 6.5.0.
---
 context-coloring.el |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/context-coloring.el b/context-coloring.el
index 69c6eb8..327dbc3 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2014-2015  Free Software Foundation, Inc.
 
 ;; Author: Jackson Ray Hamilton 
-;; Version: 6.4.1
+;; Version: 6.5.0
 ;; Keywords: convenience faces tools
 ;; Package-Requires: ((emacs "24.3") (js2-mode "20150126"))
 ;; URL: https://github.com/jacksonrayhamilton/context-coloring



[elpa] master 296f07b 04/10: Update sexps per pause.

2015-06-18 Thread Jackson Ray Hamilton
branch: master
commit 296f07ba4db049dede8be09501d3311efec7a846
Author: Jackson Ray Hamilton 
Commit: Jackson Ray Hamilton 

Update sexps per pause.
---
 context-coloring.el |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/context-coloring.el b/context-coloring.el
index 42c1e68..1e283ac 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -447,10 +447,13 @@ bound as variables.")
 (defvar context-coloring-parse-interruptable-p t
   "Set this to nil to force parse to continue until finished.")
 
-(defconst context-coloring-elisp-sexps-per-pause 1000
+(defconst context-coloring-elisp-sexps-per-pause 350
   "Pause after this many iterations to check for user input.
 If user input is pending, stop the parse.  This makes for a
-smoother user experience for large files.")
+smoother user experience for large files.
+
+This number should trigger pausing at about 60 frames per
+second.")
 
 (defvar context-coloring-elisp-sexp-count 0
   "Current number of sexps leading up to the next pause.")



[elpa] master 841aac4 02/10: Add eval-expression support.

2015-06-18 Thread Jackson Ray Hamilton
branch: master
commit 841aac4767d49a8f24dc7b1bebd0bd59abc062f7
Author: Jackson Ray Hamilton 
Commit: Jackson Ray Hamilton 

Add eval-expression support.
---
 README.md |   10 +++-
 context-coloring.el   |   87 ++--
 test/context-coloring-test.el |   27 +
 3 files changed, 90 insertions(+), 34 deletions(-)

diff --git a/README.md b/README.md
index 40506e7..568be45 100644
--- a/README.md
+++ b/README.md
@@ -21,6 +21,7 @@ By default, comments and strings are still highlighted 
syntactically.
   - `defun`, `lambda`, `let`, `let*`, `cond`, `condition-case`, `defadvice`,
 `dolist`, `quote`, `backquote` and backquote splicing.
   - Instantaneous lazy coloring, 8000 lines-per-second full coloring.
+  - Works in `eval-expression` too.
 
 ## Installation
 
@@ -68,14 +69,17 @@ Add the following to your init file:
 
 ```lisp
 ;; js-mode:
-(add-hook 'js-mode-hook 'context-coloring-mode)
+(add-hook 'js-mode-hook #'context-coloring-mode)
 
 ;; js2-mode:
 (add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
-(add-hook 'js2-mode-hook 'context-coloring-mode)
+(add-hook 'js2-mode-hook #'context-coloring-mode)
 
 ;; emacs-lisp-mode:
-(add-hook 'emacs-lisp-mode-hook 'context-coloring-mode)
+(add-hook 'emacs-lisp-mode-hook #'context-coloring-mode)
+
+;; Minibuffer:
+(add-hook 'eval-expression-minibuffer-setup-hook #'context-coloring-mode)
 ```
 
 ## Customizing
diff --git a/context-coloring.el b/context-coloring.el
index fa85c43..42c1e68 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -993,44 +993,61 @@ point.  It could be a quoted or backquoted expression."
 (max-specpdl-size (max max-specpdl-size 3000)))
 (context-coloring-elisp-colorize-region start end)))
 
-(defun context-coloring-elisp-colorize ()
-  "Color the current buffer, parsing elisp to determine its
-scopes and variables."
-  (interactive)
+(defun context-coloring-elisp-colorize-guard (callback)
+  "Silently color in CALLBACK."
   (with-silent-modifications
 (save-excursion
   (condition-case nil
-  (cond
-   ;; Just colorize the changed region.
-   (context-coloring-changed-p
-(let* (;; Prevent `beginning-of-defun' from making poor 
assumptions.
-   (open-paren-in-column-0-is-defun-start nil)
-   ;; Seek the beginning and end of the previous and next
-   ;; offscreen defuns, so just enough is colored.
-   (start (progn (goto-char context-coloring-changed-start)
- (while (and (< (point-min) (point))
- (pos-visible-in-window-p))
-   (end-of-line 0))
- (beginning-of-defun)
- (point)))
-   (end (progn (goto-char context-coloring-changed-end)
-   (while (and (> (point-max) (point))
-   (pos-visible-in-window-p))
- (forward-line 1))
-   (end-of-defun)
-   (point
-  (context-coloring-elisp-colorize-region-initially start end)
-  ;; Fast coloring is nice, but if the code is not well-formed
-  ;; (e.g. an unclosed string literal is parsed at any time) then
-  ;; there could be leftover incorrectly-colored code offscreen.  
So
-  ;; do a clean sweep as soon as appropriate.
-  (context-coloring-schedule-coloring 
context-coloring-default-delay)))
-   (t
-(context-coloring-elisp-colorize-region-initially (point-min) 
(point-max
+  (funcall callback)
 ;; Scan errors can happen virtually anywhere if parenthesis are
 ;; unbalanced.  Just swallow them.  (`progn' for test coverage.)
 (scan-error (progn))
 
+(defun context-coloring-elisp-colorize ()
+  "Color the current buffer, parsing elisp to determine its
+scopes and variables."
+  (interactive)
+  (context-coloring-elisp-colorize-guard
+   (lambda ()
+ (cond
+  ;; Just colorize the changed region.
+  (context-coloring-changed-p
+   (let* ( ;; Prevent `beginning-of-defun' from making poor assumptions.
+  (open-paren-in-column-0-is-defun-start nil)
+  ;; Seek the beginning and end of the previous and next
+  ;; offscreen defuns, so just enough is colored.
+  (start (progn (goto-char context-coloring-changed-start)
+(while (and (< (point-min) (point))
+(pos-visible-in-window-p))
+  (end-of-line 0))
+(beginning-of-defun)
+(point)))
+  (end (progn (goto-char context-coloring-changed-end)
+  (whil

[elpa] master 4eacc29 07/10: Update eval-expression recommendation for 24.3.

2015-06-18 Thread Jackson Ray Hamilton
branch: master
commit 4eacc29a5dd6a725f4885709f9f352d810a36e94
Author: Jackson Ray Hamilton 
Commit: Jackson Ray Hamilton 

Update eval-expression recommendation for 24.3.
---
 README.md |4 ++--
 context-coloring.el   |   11 +--
 test/context-coloring-test.el |   35 +++
 3 files changed, 26 insertions(+), 24 deletions(-)

diff --git a/README.md b/README.md
index 568be45..0ced14c 100644
--- a/README.md
+++ b/README.md
@@ -78,8 +78,8 @@ Add the following to your init file:
 ;; emacs-lisp-mode:
 (add-hook 'emacs-lisp-mode-hook #'context-coloring-mode)
 
-;; Minibuffer:
-(add-hook 'eval-expression-minibuffer-setup-hook #'context-coloring-mode)
+;; eval-expression:
+(add-hook 'minibuffer-setup-hook #'context-coloring-mode)
 ```
 
 ## Customizing
diff --git a/context-coloring.el b/context-coloring.el
index 6ebf924..69c6eb8 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -5,7 +5,7 @@
 ;; Author: Jackson Ray Hamilton 
 ;; Version: 6.4.1
 ;; Keywords: convenience faces tools
-;; Package-Requires: ((emacs "24") (js2-mode "20150126"))
+;; Package-Requires: ((emacs "24.3") (js2-mode "20150126"))
 ;; URL: https://github.com/jacksonrayhamilton/context-coloring
 
 ;; This file is part of GNU Emacs.
@@ -1760,9 +1760,16 @@ precedence, i.e. the car of `custom-enabled-themes'."
  :setup #'context-coloring-setup-idle-change-detection
  :teardown #'context-coloring-teardown-idle-change-detection)
 
+;; `eval-expression-minibuffer-setup-hook' is not available in Emacs 24.3, so
+;; the backwards-compatible recommendation is to use `minibuffer-setup-hook' 
and
+;; rely on this predicate instead.
+(defun context-coloring-eval-expression-predicate ()
+  "Non-nil if the minibuffer is for `eval-expression'."
+  (eq this-command 'eval-expression))
+
 (context-coloring-define-dispatch
  'eval-expression
- :predicate #'window-minibuffer-p
+ :predicate #'context-coloring-eval-expression-predicate
  :colorizer #'context-coloring-eval-expression-colorize
  :delay 0.016
  :setup #'context-coloring-setup-idle-change-detection
diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el
index f7c7a20..39f2f80 100644
--- a/test/context-coloring-test.el
+++ b/test/context-coloring-test.el
@@ -1272,28 +1272,23 @@ n n nnn ")))
  111
  nn")))
 
-(defun context-coloring-test-eval-expression-let ()
-  "Test that coloring works inside `eval-expression.'"
-  (let ((input "(ignore-errors (let (a) (message a free)))"))
-(insert input)
-(context-coloring-colorize)
-(context-coloring-test-assert-coloring "
-: 000-00  111  1 110")))
-
 (context-coloring-test-deftest-eval-expression let
   (lambda ()
-(add-hook
- 'eval-expression-minibuffer-setup-hook
- #'context-coloring-test-eval-expression-let)
-(execute-kbd-macro
- (vconcat
-  [?\C-u] ;; Don't output to stdout.
-  [?\M-x]
-  (vconcat "eval-expression"
-  :after (lambda ()
-   (remove-hook
-'eval-expression-minibuffer-setup-hook
-#'context-coloring-test-eval-expression-let)))
+(minibuffer-with-setup-hook
+(lambda ()
+  ;; Perform the test in a hook as it's the only way I know of 
examining
+  ;; the minibuffer's contents.  The contents are implicitly submitted,
+  ;; so we have to ignore the errors in the arbitrary test subject 
code.
+  (insert "(ignore-errors (let (a) (message a free)))")
+  (context-coloring-colorize)
+  (context-coloring-test-assert-coloring "
+: 000-00  111  1 110"))
+  ;; Simulate user input because `call-interactively' is blocking and
+  ;; doesn't seem to run the hook.
+  (execute-kbd-macro
+   (vconcat
+[?\C-u] ;; Don't output the result of the arbitrary test subject code.
+[?\M-:])
 
 (provide 'context-coloring-test)
 



[elpa] master c6cdb04 03/10: Benchmark coloring time separately.

2015-06-18 Thread Jackson Ray Hamilton
branch: master
commit c6cdb04ffbe70015dd1c32cfee97c0ffe989a272
Author: Jackson Ray Hamilton 
Commit: Jackson Ray Hamilton 

Benchmark coloring time separately.

`elp-instrument-package' significantly affects the performance of
coloring.
---
 benchmark/context-coloring-benchmark.el |   16 
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/benchmark/context-coloring-benchmark.el 
b/benchmark/context-coloring-benchmark.el
index c2dd653..1f5885c 100644
--- a/benchmark/context-coloring-benchmark.el
+++ b/benchmark/context-coloring-benchmark.el
@@ -26,6 +26,7 @@
 ;;; Code:
 
 (require 'context-coloring)
+(require 'elp)
 (require 'js2-mode)
 
 
@@ -115,7 +116,6 @@ with STATISTICS."
 callbacks.  Measure the performance of all FIXTURES, calling
 CALLBACK when all are done."
   (funcall setup)
-  (elp-instrument-package "context-coloring-")
   (let ((result-file (context-coloring-benchmark-resolve-path
   (format "./logs/results-%s-%s.log"
   title (format-time-string "%s")
@@ -134,10 +134,12 @@ CALLBACK when all are done."
original-function
(lambda ()
  (setq count (+ count 1))
- (push (- (float-time) colorization-start-time) 
colorization-times)
- ;; Test 5 times.
+ ;; First 5 runs are for gathering real coloring times,
+ ;; unaffected by elp instrumentation.
+ (when (<= count 5)
+   (push (- (float-time) colorization-start-time) 
colorization-times))
  (cond
-  ((= count 5)
+  ((= count 10)
(advice-remove #'context-coloring-colorize advice)
(context-coloring-benchmark-log-results
 result-file
@@ -148,8 +150,14 @@ CALLBACK when all are done."
  :words (count-words (point-min) (point-max))
  :colorization-times colorization-times
  :average-colorization-time (/ (apply #'+ 
colorization-times) 5)))
+   (elp-restore-all)
(kill-buffer)
(funcall callback))
+  ;; The last 5 runs are for gathering function call and
+  ;; duration statistics.
+  ((= count 5)
+   (elp-instrument-package "context-coloring-")
+   (context-coloring-colorize))
   (t
(setq colorization-start-time (float-time))
(context-coloring-colorize



[elpa] master 137a109 01/10: Fix bugs where parsing left point after a scope.

2015-06-18 Thread Jackson Ray Hamilton
branch: master
commit 137a109b6d17466526cc6c63a47cae141013a8e7
Author: Jackson Ray Hamilton 
Commit: Jackson Ray Hamilton 

Fix bugs where parsing left point after a scope.
---
 context-coloring.el |   53 ++
 1 files changed, 19 insertions(+), 34 deletions(-)

diff --git a/context-coloring.el b/context-coloring.el
index c4423f0..fa85c43 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -635,37 +635,25 @@ header in CALLBACK."
 (forward-char)
 (context-coloring-elisp-pop-scope)))
 
-(defun context-coloring-elisp-parse-header (callback start)
-  "Parse a function header at point with CALLBACK.  If there is
-no header, skip past the sexp at START."
-  (cond
-   ((= (context-coloring-get-syntax-code) 
context-coloring-OPEN-PARENTHESIS-CODE)
-(funcall callback))
-   (t
-;; Skip it.
-(goto-char start)
-(context-coloring-elisp-forward-sexp
+(defun context-coloring-elisp-parse-header (callback)
+  "Parse a function header at point with CALLBACK."
+  (when (= (context-coloring-get-syntax-code) 
context-coloring-OPEN-PARENTHESIS-CODE)
+(funcall callback)))
 
 (defun context-coloring-elisp-colorize-defun-like (callback)
   "Color the defun-like function at point, parsing the header
 with CALLBACK."
-  (let ((start (point)))
-(context-coloring-elisp-colorize-scope
- (lambda ()
-   (cond
-((context-coloring-elisp-identifier-p 
(context-coloring-get-syntax-code))
- ;; Color the defun's name with the top-level color.
- (context-coloring-colorize-region
-  (point)
-  (progn (forward-sexp)
- (point))
-  0)
- (context-coloring-elisp-forward-sws)
- (context-coloring-elisp-parse-header callback start))
-(t
- ;; Skip it.
- (goto-char start)
- (context-coloring-elisp-forward-sexp)))
+  (context-coloring-elisp-colorize-scope
+   (lambda ()
+ (when (context-coloring-elisp-identifier-p 
(context-coloring-get-syntax-code))
+   ;; Color the defun's name with the top-level color.
+   (context-coloring-colorize-region
+(point)
+(progn (forward-sexp)
+   (point))
+0)
+   (context-coloring-elisp-forward-sws)
+   (context-coloring-elisp-parse-header callback)
 
 (defun context-coloring-elisp-colorize-defun ()
   "Color the `defun' at point."
@@ -687,17 +675,14 @@ with CALLBACK."
   (t
;; Ignore artifacts.
(context-coloring-elisp-forward-sexp)))
- (context-coloring-elisp-forward-sws))
-   ;; Exit.
-   (forward-char)
+ (context-coloring-elisp-forward-sws))
 
 (defun context-coloring-elisp-colorize-lambda-like (callback)
   "Color the lambda-like function at point, parsing the header
 with CALLBACK."
-  (let ((start (point)))
-(context-coloring-elisp-colorize-scope
- (lambda ()
-   (context-coloring-elisp-parse-header callback start)
+  (context-coloring-elisp-colorize-scope
+   (lambda ()
+ (context-coloring-elisp-parse-header callback
 
 (defun context-coloring-elisp-colorize-lambda ()
   "Color the `lambda' at point."



[elpa] master 456f6e4 08/10: Use evm in build.

2015-06-18 Thread Jackson Ray Hamilton
branch: master
commit 456f6e49dd8360f782a0d1d01ed0b573ba368c0c
Author: Jackson Ray Hamilton 
Commit: Jackson Ray Hamilton 

Use evm in build.
---
 .travis.yml |   25 +
 README.md   |2 +-
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index a732f67..8a9d303 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,23 +1,24 @@
-# https://github.com/rolandwalker/emacs-travis
-
 language: emacs-lisp
 
 node_js:
   - "0.10"
 
 env:
-  matrix:
-- EMACS=emacs24
+  - EVM_EMACS=emacs-24.3-bin
+  - EVM_EMACS=emacs-24.4-bin
+  - EVM_EMACS=emacs-24.5-bin
 
-install:
-  - if [ "$EMACS" = "emacs24" ]; then
-sudo add-apt-repository -y ppa:cassou/emacs &&
-sudo apt-get update -qq &&
-sudo apt-get install -qq emacs24 emacs24-el;
-fi
-  - curl -fsSL https://raw.github.com/cask/cask/master/go | python
+before_install:
+  - sudo mkdir /usr/local/evm
+  - sudo chown travis:travis /usr/local/evm
   - export PATH="/home/travis/.cask/bin:$PATH"
+  - export PATH="/home/travis/.evm/bin:$PATH"
+  - curl -fsSkL https://raw.github.com/rejeep/evm/master/go | bash
+  - evm install ${EVM_EMACS} --use
+  - curl -fsSkL https://raw.github.com/cask/cask/master/go | python
+  - cask
   - npm install -g scopifier
 
 script:
-  make test EMACS=${EMACS}
+  - emacs --version
+  - make test
diff --git a/README.md b/README.md
index 0ced14c..6e8865f 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@ By default, comments and strings are still highlighted 
syntactically.
 
 ## Installation
 
-Requires Emacs 24+.
+Requires Emacs 24.3+.
 
 JavaScript language support requires either [js2-mode][], or
 [Node.js 0.10+][node] and the [scopifier][] executable.



[elpa] master 61b8c49 10/10: Merge commit '294b5117b42d2622f4fb0a1da219d45d98566b6e' from context-coloring

2015-06-18 Thread Jackson Ray Hamilton
branch: master
commit 61b8c493c44211bb0d7ee0aab5883f51de129bf9
Merge: f89ef19 294b511
Author: Jackson Ray Hamilton 
Commit: Jackson Ray Hamilton 

Merge commit '294b5117b42d2622f4fb0a1da219d45d98566b6e' from 
context-coloring
---
 packages/context-coloring/.travis.yml  |   25 ++-
 packages/context-coloring/Makefile |2 +-
 packages/context-coloring/README.md|   12 +-
 .../benchmark/context-coloring-benchmark.el|   16 +-
 packages/context-coloring/context-coloring.el  |  211 
 .../context-coloring/test/context-coloring-test.el |   24 ++-
 6 files changed, 181 insertions(+), 109 deletions(-)

diff --git a/packages/context-coloring/.travis.yml 
b/packages/context-coloring/.travis.yml
index a732f67..8a9d303 100644
--- a/packages/context-coloring/.travis.yml
+++ b/packages/context-coloring/.travis.yml
@@ -1,23 +1,24 @@
-# https://github.com/rolandwalker/emacs-travis
-
 language: emacs-lisp
 
 node_js:
   - "0.10"
 
 env:
-  matrix:
-- EMACS=emacs24
+  - EVM_EMACS=emacs-24.3-bin
+  - EVM_EMACS=emacs-24.4-bin
+  - EVM_EMACS=emacs-24.5-bin
 
-install:
-  - if [ "$EMACS" = "emacs24" ]; then
-sudo add-apt-repository -y ppa:cassou/emacs &&
-sudo apt-get update -qq &&
-sudo apt-get install -qq emacs24 emacs24-el;
-fi
-  - curl -fsSL https://raw.github.com/cask/cask/master/go | python
+before_install:
+  - sudo mkdir /usr/local/evm
+  - sudo chown travis:travis /usr/local/evm
   - export PATH="/home/travis/.cask/bin:$PATH"
+  - export PATH="/home/travis/.evm/bin:$PATH"
+  - curl -fsSkL https://raw.github.com/rejeep/evm/master/go | bash
+  - evm install ${EVM_EMACS} --use
+  - curl -fsSkL https://raw.github.com/cask/cask/master/go | python
+  - cask
   - npm install -g scopifier
 
 script:
-  make test EMACS=${EMACS}
+  - emacs --version
+  - make test
diff --git a/packages/context-coloring/Makefile 
b/packages/context-coloring/Makefile
index 0b37043..dfa219d 100644
--- a/packages/context-coloring/Makefile
+++ b/packages/context-coloring/Makefile
@@ -1,5 +1,5 @@
-CASK = cask
 EMACS = emacs
+CASK = EMACS=${EMACS} cask
 DEPENDENCIES = .cask/
 SCOPIFIER_PORT = $$(lsof -t -i :6969)
 KILL_SCOPIFIER = if [ -n "${SCOPIFIER_PORT}" ]; then kill ${SCOPIFIER_PORT}; fi
diff --git a/packages/context-coloring/README.md 
b/packages/context-coloring/README.md
index 40506e7..6e8865f 100644
--- a/packages/context-coloring/README.md
+++ b/packages/context-coloring/README.md
@@ -21,10 +21,11 @@ By default, comments and strings are still highlighted 
syntactically.
   - `defun`, `lambda`, `let`, `let*`, `cond`, `condition-case`, `defadvice`,
 `dolist`, `quote`, `backquote` and backquote splicing.
   - Instantaneous lazy coloring, 8000 lines-per-second full coloring.
+  - Works in `eval-expression` too.
 
 ## Installation
 
-Requires Emacs 24+.
+Requires Emacs 24.3+.
 
 JavaScript language support requires either [js2-mode][], or
 [Node.js 0.10+][node] and the [scopifier][] executable.
@@ -68,14 +69,17 @@ Add the following to your init file:
 
 ```lisp
 ;; js-mode:
-(add-hook 'js-mode-hook 'context-coloring-mode)
+(add-hook 'js-mode-hook #'context-coloring-mode)
 
 ;; js2-mode:
 (add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
-(add-hook 'js2-mode-hook 'context-coloring-mode)
+(add-hook 'js2-mode-hook #'context-coloring-mode)
 
 ;; emacs-lisp-mode:
-(add-hook 'emacs-lisp-mode-hook 'context-coloring-mode)
+(add-hook 'emacs-lisp-mode-hook #'context-coloring-mode)
+
+;; eval-expression:
+(add-hook 'minibuffer-setup-hook #'context-coloring-mode)
 ```
 
 ## Customizing
diff --git a/packages/context-coloring/benchmark/context-coloring-benchmark.el 
b/packages/context-coloring/benchmark/context-coloring-benchmark.el
index c2dd653..1f5885c 100644
--- a/packages/context-coloring/benchmark/context-coloring-benchmark.el
+++ b/packages/context-coloring/benchmark/context-coloring-benchmark.el
@@ -26,6 +26,7 @@
 ;;; Code:
 
 (require 'context-coloring)
+(require 'elp)
 (require 'js2-mode)
 
 
@@ -115,7 +116,6 @@ with STATISTICS."
 callbacks.  Measure the performance of all FIXTURES, calling
 CALLBACK when all are done."
   (funcall setup)
-  (elp-instrument-package "context-coloring-")
   (let ((result-file (context-coloring-benchmark-resolve-path
   (format "./logs/results-%s-%s.log"
   title (format-time-string "%s")
@@ -134,10 +134,12 @@ CALLBACK when all are done."
original-function
(lambda ()
  (setq count (+ count 1))
- (push (- (float-time) colorization-start-time) 
colorization-times)
- ;; Test 5 times.
+ ;; First 5 runs are for gathering real coloring times,
+ ;; unaffected by elp instrumentation.
+ (when (<= count 5)
+   (push (- (float-time) colorization-start-time) 
colorization-times))
  (cond
-

[elpa] master b19a0a2 06/10: Add predicate option for dispatches.

2015-06-18 Thread Jackson Ray Hamilton
branch: master
commit b19a0a24b36ce39cc9d36c8c448c7bc26b40d30b
Author: Jackson Ray Hamilton 
Commit: Jackson Ray Hamilton 

Add predicate option for dispatches.

The minibuffer does not always have a major mode.  It is more reliable
to check for it with `window-minibuffer-p'.
---
 context-coloring.el   |   55 ++--
 test/context-coloring-test.el |2 +-
 2 files changed, 37 insertions(+), 20 deletions(-)

diff --git a/context-coloring.el b/context-coloring.el
index 1e283ac..6ebf924 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -196,7 +196,7 @@ Supported modes: `js-mode', `js3-mode'"
 
 (defun context-coloring-setup-idle-change-detection ()
   "Setup idle change detection."
-  (let ((dispatch (context-coloring-get-dispatch-for-mode major-mode)))
+  (let ((dispatch (context-coloring-get-current-dispatch)))
 (add-hook
  'after-change-functions #'context-coloring-change-function nil t)
 (add-hook
@@ -1228,13 +1228,22 @@ lists, which contain details about the strategies.")
 (defvar context-coloring-mode-hash-table (make-hash-table :test #'eq)
   "Map major mode names to dispatch property lists.")
 
-(defun context-coloring-get-dispatch-for-mode (mode)
-  "Return the dispatch for MODE (or a derivative mode)."
-  (let ((parent mode)
+(defvar context-coloring-dispatch-predicates '()
+  "Functions which may return a dispatch.")
+
+(defun context-coloring-get-current-dispatch ()
+  "Return the first dispatch appropriate for the current state."
+  (let ((predicates context-coloring-dispatch-predicates)
+(parent major-mode)
 dispatch)
-(while (and parent
-(not (setq dispatch (gethash parent 
context-coloring-mode-hash-table)))
-(setq parent (get parent 'derived-mode-parent
+;; Maybe a predicate will be satisfied and return a dispatch.
+(while (and predicates
+(not (setq dispatch (funcall (pop predicates))
+;; If not, maybe a major mode (or a derivative) will define a dispatch.
+(when (not dispatch)
+  (while (and parent
+  (not (setq dispatch (gethash parent 
context-coloring-mode-hash-table)))
+  (setq parent (get parent 'derived-mode-parent)
 dispatch))
 
 (defun context-coloring-define-dispatch (symbol &rest properties)
@@ -1248,13 +1257,15 @@ server that returns scope data (`:command', `:host' and 
`:port').
 In the latter two cases, the scope data will be used to
 automatically color the buffer.
 
-PROPERTIES must include `:modes' and one of `:colorizer',
-`:scopifier' or `:command'.
+PROPERTIES must include one of `:modes' or `:predicate', and one
+of `:colorizer' or `:command'.
 
 `:modes' - List of major modes this dispatch is valid for.
 
-`:colorizer' - Symbol referring to a function that parses and
-colors the buffer.
+`:predicate' - Function that determines if the dispatch is valid
+for any given state.
+
+`:colorizer' - Function that parses and colors the buffer.
 
 `:executable' - Optional name of an executable required by
 `:command'.
@@ -1281,16 +1292,22 @@ should be numeric, e.g. \"2\", \"19700101\", \"1.2.3\",
 `:teardown' - Arbitrary code to tear down this dispatch when
 `context-coloring-mode' is disabled."
   (let ((modes (plist-get properties :modes))
+(predicate (plist-get properties :predicate))
 (colorizer (plist-get properties :colorizer))
 (command (plist-get properties :command)))
-(when (null modes)
-  (error "No mode defined for dispatch"))
+(when (null (or modes
+predicate))
+  (error "No mode or predicate defined for dispatch"))
 (when (not (or colorizer
command))
   (error "No colorizer or command defined for dispatch"))
 (puthash symbol properties context-coloring-dispatch-hash-table)
 (dolist (mode modes)
-  (puthash mode properties context-coloring-mode-hash-table
+  (puthash mode properties context-coloring-mode-hash-table))
+(when predicate
+  (push (lambda ()
+  (when (funcall predicate)
+properties)) context-coloring-dispatch-predicates
 
 
 ;;; Colorization
@@ -1355,7 +1372,7 @@ produces (1 0 0), \"19700101\" produces (19700101), etc."
   "Asynchronously invoke CALLBACK with a predicate indicating
 whether the current scopifier version satisfies the minimum
 version number required for the current major mode."
-  (let ((dispatch (context-coloring-get-dispatch-for-mode major-mode)))
+  (let ((dispatch (context-coloring-get-current-dispatch)))
 (when dispatch
   (let ((version (plist-get dispatch :version))
 (command (plist-get dispatch :command)))
@@ -1745,7 +1762,7 @@ precedence, i.e. the car of `custom-enabled-themes'."
 
 (context-coloring-define-dispatch
  'eval-expression
- :modes '(minibuffer-inactive-mode)
+ :predicate #'window-minibuffer-p
  :colorizer #'context-coloring-eval-expressio

[elpa] master 122c098 1/4: Rework indentation based on changes.

2015-06-18 Thread Artur Malabarba
branch: master
commit 122c09842d83361de08ca49164ec5aabbdc5a1cd
Author: Artur Malabarba 
Commit: Artur Malabarba 

Rework indentation based on changes.
---
 aggressive-indent.el |   79 ++---
 1 files changed, 48 insertions(+), 31 deletions(-)

diff --git a/aggressive-indent.el b/aggressive-indent.el
index aa7e4e1..fb96771 100644
--- a/aggressive-indent.el
+++ b/aggressive-indent.el
@@ -217,6 +217,11 @@ change."
   '(when (boundp 'iedit-mode)
  (add-to-list 'aggressive-indent--internal-dont-indent-if
   'iedit-mode)))
+(eval-after-load 'coq
+  '(add-to-list 'aggressive-indent--internal-dont-indent-if
+'(and (derived-mode-p 'coq-mode)
+  (not (string-match "\\.[[:space:]]*$"
+ (thing-at-point 'line))
 
 (defcustom dont-indent-if '()
   "List of variables and functions to prevent aggressive indenting.
@@ -249,28 +254,34 @@ erroring again."
   (setq -has-errored t)
   (message -error-message er))
 
+
 :autoload
-(defun indent-defun ()
+(defun indent-defun (&optional l r)
   "Indent current defun.
-Throw an error if parentheses are unbalanced."
+Throw an error if parentheses are unbalanced.
+If L and R are provided, use them for finding the start and end of defun."
   (interactive)
   (let ((p (point-marker)))
 (set-marker-insertion-type p t)
 (indent-region
- (save-excursion (beginning-of-defun 1) (point))
- (save-excursion (end-of-defun 1) (point)))
+ (save-excursion
+   (when l (goto-char l))
+   (beginning-of-defun 1) (point))
+ (save-excursion
+   (when r (goto-char r))
+   (end-of-defun 1) (point)))
 (goto-char p)))
 
-(defun -softly-indent-defun ()
+(defun -softly-indent-defun (&optional l r)
   "Indent current defun unobstrusively.
 Like `aggressive-indent-indent-defun', but without errors or
-messages."
+messages.  L and R passed to `aggressive-indent-indent-defun'."
   (unless (or (run-hook-wrapped
'aggressive-indent--internal-dont-indent-if
#'eval)
   (aggressive-indent--run-user-hooks))
 (cl-letf (((symbol-function 'message) #'ignore))
-  (ignore-errors (indent-defun)
+  (ignore-errors (indent-defun l r)
 
 :autoload
 (defun indent-region-and-on (l r)
@@ -298,12 +309,19 @@ until nothing more happens."
 (indent-according-to-mode))
   ;; And then we indent each following line until nothing happens.
   (forward-line 1)
-  (while (and (null (eobp))
-  (/= (progn (skip-chars-forward "[:blank:]\n")
- (point))
-  (progn (indent-according-to-mode)
- (point
-(forward-line 1)))
+  (skip-chars-forward "[:blank:]\n")
+  (let* ((eod (ignore-errors
+(save-excursion (end-of-defun)
+(point-marker
+ (point-limit (if (and eod (< (point) eod))
+  eod (point-max-marker
+(while (and (null (eobp))
+(< (point) point-limit)
+(/= (point)
+(progn (indent-according-to-mode)
+   (point
+  (forward-line 1)
+  (skip-chars-forward "[:blank:]\n"
   (goto-char p
 
 (defun -softly-indent-region-and-on (l r &rest _)
@@ -317,26 +335,26 @@ or messages."
 (cl-letf (((symbol-function 'message) #'ignore))
   (ignore-errors (indent-region-and-on l r)
 
-(defvar -changed-list-right nil
-  "List of right limit of regions changed in the last command loop.")
-
-(defvar -changed-list-left nil
-  "List of left limit of regions changed in the last command loop.")
+(defvar -changed-list nil
+  "List of (left right) limit of regions changed in the last command loop.")
 
 (defun -indent-if-changed ()
   "Indent any region that changed in the last command loop."
-  (let ((inhibit-modification-hooks t))
-(when -changed-list-left
-  (-softly-indent-region-and-on
-   (apply #'min -changed-list-left)
-   (apply #'max -changed-list-right))
-  (setq -changed-list-left nil
--changed-list-right nil
+  (when -changed-list
+(while-no-input
+  (let ((inhibit-modification-hooks t)
+(inhibit-point-motion-hooks t)
+(indent-function
+ (if (cl-member-if #'derived-mode-p modes-to-prefer-defun)
+ #'-softly-indent-defun
+   #'-softly-indent-region-and-on)))
+(while -changed-list
+  (apply indent-function (car -changed-list))
+  (setq -changed-list (cdr -changed-list)))
 
 (defun -keep-track-of-changes (l r &rest _)
   "Store the limits (L and R) of each change in the buffer."
-  (push l -ch

[elpa] master updated (61b8c49 -> 951b5e3)

2015-06-18 Thread Artur Malabarba
malabarba pushed a change to branch master.

  from  61b8c49   Merge commit '294b5117b42d2622f4fb0a1da219d45d98566b6e' 
from context-coloring
   new  122c098   Rework indentation based on changes.
   new  24ecbb9   Version 1.1
   new  c7e65ca   Doc improvement
   new  951b5e3   Merge commit 'c7e65ca646a7fff43df94bb5f95d9953345ef666'


Summary of changes:
 packages/aggressive-indent/README.md|2 +-
 packages/aggressive-indent/aggressive-indent.el |   83 ++-
 2 files changed, 51 insertions(+), 34 deletions(-)



[elpa] master c7e65ca 3/4: Doc improvement

2015-06-18 Thread Artur Malabarba
branch: master
commit c7e65ca646a7fff43df94bb5f95d9953345ef666
Author: Artur Malabarba 
Commit: Artur Malabarba 

Doc improvement
---
 README.md|2 +-
 aggressive-indent.el |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index b5006f5..8873568 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@ transposing lines, or slurping and barfing sexps, indentation 
is bound
 to go wrong.
 
 **`aggressive-indent-mode`** is a minor mode that keeps your code **always**
-indented. It reindents after every command, making it more reliable
+indented. It reindents after every change, making it more reliable
 than `electric-indent-mode`.
 
 ### Demonstration ###
diff --git a/aggressive-indent.el b/aggressive-indent.el
index bfab5ad..e56ee6c 100644
--- a/aggressive-indent.el
+++ b/aggressive-indent.el
@@ -18,7 +18,7 @@
 ;; to go wrong.
 ;;
 ;; `aggressive-indent-mode' is a minor mode that keeps your code always
-;; indented.  It reindents after every command, making it more reliable
+;; indented.  It reindents after every change, making it more reliable
 ;; than `electric-indent-mode'.
 ;;
 ;; ### Instructions ###



[elpa] master 24ecbb9 2/4: Version 1.1

2015-06-18 Thread Artur Malabarba
branch: master
commit 24ecbb940df1c1dd619c337ffef40626416a432f
Author: Artur Malabarba 
Commit: Artur Malabarba 

Version 1.1
---
 aggressive-indent.el |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/aggressive-indent.el b/aggressive-indent.el
index fb96771..bfab5ad 100644
--- a/aggressive-indent.el
+++ b/aggressive-indent.el
@@ -4,7 +4,7 @@
 
 ;; Author: Artur Malabarba 
 ;; URL: http://github.com/Malabarba/aggressive-indent-mode
-;; Version: 1.0.2
+;; Version: 1.1
 ;; Package-Requires: ((emacs "24.1") (names "20150125.9") (cl-lib "0.5"))
 ;; Keywords: indent lisp maint tools
 ;; Prefix: aggressive-indent



[elpa] master 951b5e3 4/4: Merge commit 'c7e65ca646a7fff43df94bb5f95d9953345ef666'

2015-06-18 Thread Artur Malabarba
branch: master
commit 951b5e388108af26263a6ab6892391fea976a220
Merge: 61b8c49 c7e65ca
Author: Artur Malabarba 
Commit: Artur Malabarba 

Merge commit 'c7e65ca646a7fff43df94bb5f95d9953345ef666'
---
 packages/aggressive-indent/README.md|2 +-
 packages/aggressive-indent/aggressive-indent.el |   83 ++-
 2 files changed, 51 insertions(+), 34 deletions(-)

diff --git a/packages/aggressive-indent/README.md 
b/packages/aggressive-indent/README.md
index b5006f5..8873568 100644
--- a/packages/aggressive-indent/README.md
+++ b/packages/aggressive-indent/README.md
@@ -7,7 +7,7 @@ transposing lines, or slurping and barfing sexps, indentation 
is bound
 to go wrong.
 
 **`aggressive-indent-mode`** is a minor mode that keeps your code **always**
-indented. It reindents after every command, making it more reliable
+indented. It reindents after every change, making it more reliable
 than `electric-indent-mode`.
 
 ### Demonstration ###
diff --git a/packages/aggressive-indent/aggressive-indent.el 
b/packages/aggressive-indent/aggressive-indent.el
index 5d91396..989ab51 100644
--- a/packages/aggressive-indent/aggressive-indent.el
+++ b/packages/aggressive-indent/aggressive-indent.el
@@ -4,7 +4,7 @@
 
 ;; Author: Artur Malabarba 
 ;; URL: http://github.com/Malabarba/aggressive-indent-mode
-;; Version: 1.0.2
+;; Version: 1.1
 ;; Package-Requires: ((emacs "24.1") (names "20150125.9") (cl-lib "0.5"))
 ;; Keywords: indent lisp maint tools
 ;; Prefix: aggressive-indent
@@ -18,7 +18,7 @@
 ;; to go wrong.
 ;;
 ;; `aggressive-indent-mode' is a minor mode that keeps your code always
-;; indented.  It reindents after every command, making it more reliable
+;; indented.  It reindents after every change, making it more reliable
 ;; than `electric-indent-mode'.
 ;;
 ;; ### Instructions ###
@@ -217,6 +217,11 @@ change."
   '(when (boundp 'iedit-mode)
  (add-to-list 'aggressive-indent--internal-dont-indent-if
   'iedit-mode)))
+(eval-after-load 'coq
+  '(add-to-list 'aggressive-indent--internal-dont-indent-if
+'(and (derived-mode-p 'coq-mode)
+  (not (string-match "\\.[[:space:]]*$"
+ (thing-at-point 'line))
 
 (defcustom dont-indent-if '()
   "List of variables and functions to prevent aggressive indenting.
@@ -249,28 +254,34 @@ erroring again."
   (setq -has-errored t)
   (message -error-message er))
 
+
 :autoload
-(defun indent-defun ()
+(defun indent-defun (&optional l r)
   "Indent current defun.
-Throw an error if parentheses are unbalanced."
+Throw an error if parentheses are unbalanced.
+If L and R are provided, use them for finding the start and end of defun."
   (interactive)
   (let ((p (point-marker)))
 (set-marker-insertion-type p t)
 (indent-region
- (save-excursion (beginning-of-defun 1) (point))
- (save-excursion (end-of-defun 1) (point)))
+ (save-excursion
+   (when l (goto-char l))
+   (beginning-of-defun 1) (point))
+ (save-excursion
+   (when r (goto-char r))
+   (end-of-defun 1) (point)))
 (goto-char p)))
 
-(defun -softly-indent-defun ()
+(defun -softly-indent-defun (&optional l r)
   "Indent current defun unobstrusively.
 Like `aggressive-indent-indent-defun', but without errors or
-messages."
+messages.  L and R passed to `aggressive-indent-indent-defun'."
   (unless (or (run-hook-wrapped
'aggressive-indent--internal-dont-indent-if
#'eval)
   (aggressive-indent--run-user-hooks))
 (cl-letf (((symbol-function 'message) #'ignore))
-  (ignore-errors (indent-defun)
+  (ignore-errors (indent-defun l r)
 
 :autoload
 (defun indent-region-and-on (l r)
@@ -298,12 +309,19 @@ until nothing more happens."
 (indent-according-to-mode))
   ;; And then we indent each following line until nothing happens.
   (forward-line 1)
-  (while (and (null (eobp))
-  (/= (progn (skip-chars-forward "[:blank:]\n")
- (point))
-  (progn (indent-according-to-mode)
- (point
-(forward-line 1)))
+  (skip-chars-forward "[:blank:]\n")
+  (let* ((eod (ignore-errors
+(save-excursion (end-of-defun)
+(point-marker
+ (point-limit (if (and eod (< (point) eod))
+  eod (point-max-marker
+(while (and (null (eobp))
+(< (point) point-limit)
+(/= (point)
+(progn (indent-according-to-mode)
+   (point
+  (forward-line 1)
+  (skip-chars-forward "[:blank:]\n"
   (goto-char p
 
 (defun -softly-indent-region-and-on (l r &rest _)
@@ -317,26 +335

[elpa] master 5de5766 02/11: packages/names: Version bump

2015-06-18 Thread Artur Malabarba
branch: master
commit 5de5766e3fa22ff9dc3c7ef7d0185e970d6a1818
Author: Artur Malabarba 
Commit: Artur Malabarba 

packages/names: Version bump
---
 names.el |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/names.el b/names.el
index 5cc70e2..6d25805 100644
--- a/names.el
+++ b/names.el
@@ -5,7 +5,7 @@
 ;; Author: Artur Malabarba 
 ;; Maintainer: Artur Malabarba 
 ;; URL: http://github.com/Bruce-Connor/names
-;; Version: 20150115.1
+;; Version: 20150125.9
 ;; Package-Requires: ((emacs "24.1") (cl-lib "0.5"))
 ;; Keywords: extensions lisp
 ;; Prefix: names
@@ -120,7 +120,7 @@ it will set PROP."
 
 ;;; ---
 ;;; Variables
-(defconst names-version "20150115.1" "Version of the names.el package.")
+(defconst names-version "20150125.9" "Version of the names.el package.")
 
 (defvar names--name nil
   "Name of the current namespace inside the `define-namespace' macro.")



[elpa] master 99de0ba 09/11: Fix comp warnings

2015-06-18 Thread Artur Malabarba
branch: master
commit 99de0ba2e0d1c03302a2d07238c354b87427ba6d
Author: Artur Malabarba 
Commit: Artur Malabarba 

Fix comp warnings
---
 names.el |   17 +
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/names.el b/names.el
index 1695a21..535050f 100644
--- a/names.el
+++ b/names.el
@@ -82,7 +82,8 @@ it will set PROP."
 (defalias 'names--compat-macrop #'macrop)
   (defun names--compat-macrop (object)
 "Non-nil if and only if OBJECT is a macro."
-(let ((def (indirect-function object t)))
+(let ((def (or (ignore-errors (indirect-function object t))
+   (ignore-errors (indirect-function object)
   (when (consp def)
 (or (eq 'macro (car def))
 (and (names--autoloadp def) (memq (nth 4 def) '(macro t
@@ -765,6 +766,10 @@ returns nil."
(and (names--keyword :global)
 (boundp (names--prepend sbl))
 
+(defvar names--verbose nil
+  "If non-nil, verbose message are printed regardless of the :verbose keyword.
+Use this to easily turn on verbosity during tests.")
+
 (defun names--args-of-function-or-macro (function args macro)
   "Namespace FUNCTION's arguments ARGS, with special treatment if MACRO is 
non-nil."
   (if macro
@@ -857,14 +862,10 @@ phenomenally. So we hack into edebug instead."
 (symbol-function 'message))
   "Where names stores `message's definition while overriding it.")
 
-(defvar names--verbose nil
-  "If non-nil, verbose message are printed regardless of the :verbose keyword.
-Use this to easily turn on verbosity during tests.")
-
-(defun names--edebug-message (&rest _)
+(defun names--edebug-message (&rest args)
   (if (or (names--keyword :verbose) names--verbose)
-  (apply names--message-backup _)
-(when _ (apply 'format _
+  (apply names--message-backup args)
+(when args (apply #'format args
 
 (defun names--edebug-make-enter-wrapper (forms)
   (setq edebug-def-name



[elpa] master d75791d 11/11: Merge commit 'b1da26d96cbe8308d0988f6b92737819f98f20fd'

2015-06-18 Thread Artur Malabarba
branch: master
commit d75791d74e92fac5ab8c757276a048c4d029180c
Merge: 951b5e3 b1da26d
Author: Artur Malabarba 
Commit: Artur Malabarba 

Merge commit 'b1da26d96cbe8308d0988f6b92737819f98f20fd'
---
 packages/names/TheNittyGritty.org |   35 +++
 packages/names/UsageExample.org   |5 ++-
 packages/names/names-dev.el   |   48 ++---
 packages/names/names.el   |   86 +++-
 4 files changed, 126 insertions(+), 48 deletions(-)

diff --git a/packages/names/TheNittyGritty.org 
b/packages/names/TheNittyGritty.org
index 78bf88b..84bf6b8 100644
--- a/packages/names/TheNittyGritty.org
+++ b/packages/names/TheNittyGritty.org
@@ -139,6 +139,41 @@ need to worry about, it should just do what you expect 
from it.
 
 This is only relevant if you write your own macros. If you do,
 remember to add a debug declaration in them.
+
+*** The theading macros (~->~ and ~-->~)
+
+The threading macros would require special treatment to namespace
+correctly. However, you can use the ~:functionlike-macros~ keyword to
+tell *Names* to treat them as regular functions.
+
+For example, in the following snippet:
+#+BEGIN_SRC emacs-lisp
+(require 'dash)
+(define-namespace foo-
+:functionlike-macros (-> ->>)
+
+(defvar var nil)
+(defun fun (x &optional y)
+  (concat x y))
+
+(-> "some string"
+(fun var)
+fun)
+)
+#+END_SRC
+the ~(fun var)~ part would be namespaced prefectly fine (~fun~ and
+~var~ will be identified as a function and variable respectively),
+because it looks like a regular function call. However, the second use
+of ~fun~ will not be correctly namespaced, because that ~fun~ looks
+like a variable.
+
+In other words, you should use these macros like this instead:
+#+BEGIN_SRC emacs-lisp
+(-> "some string"
+(fun var)
+(fun))
+#+END_SRC
+
 ** Accessing Global Symbols
 If one of your definitions shadows a global definition, you can still
 access it by prefixing it with =::=.
diff --git a/packages/names/UsageExample.org b/packages/names/UsageExample.org
index b27160e..5730966 100644
--- a/packages/names/UsageExample.org
+++ b/packages/names/UsageExample.org
@@ -14,7 +14,10 @@ The important items are already listed in the Readme:
 
 ;;; Code:
 
-;; `define-namespace' is autoloaded, so there's no need to require `names'.
+;; `define-namespace' is autoloaded, so there's no need to require
+;; `names'. However, requiring it here means it will also work for
+;; people who don't install through package.el.
+(eval-when-compile (require 'names))
 
 ;;;###autoload
 (define-namespace example-
diff --git a/packages/names/names-dev.el b/packages/names/names-dev.el
index 0133604..0c2dc20 100644
--- a/packages/names/names-dev.el
+++ b/packages/names/names-dev.el
@@ -62,11 +62,11 @@
 (defmacro names-print (name &rest forms)
   "Return the expanded results of (namespace NAME :global :verbose FORMS).
 Ideal for determining why a specific form isn't being parsed
-correctly."
+correctly. You may need to set `eval-expression-print-level' and
+`eval-expression-print-length' to nil in order to see your full
+expansion."
   (declare (indent (lambda (&rest x) 0)) (debug 0))
-  `(let ((eval-expression-print-level (max eval-expression-print-level 300))
- (eval-expression-print-length (max eval-expression-print-length 300)))
- (macroexpand '(define-namespace ,name :global :verbose ,@forms
+  `(define-namespace ,name :global :verbose ,@forms))
 
 (defvar names-font-lock
   '(("^:autoload\\_>" 0 'font-lock-warning-face prepend)
@@ -152,12 +152,17 @@ If KILL is non-nil, kill the temp buffer afterwards."
(kill-buffer b))
 
 (defun names--top-of-namespace ()
-  ""
-  (progn
-(beginning-of-defun)
-(ignore-errors
-  (backward-up-list)
-  (names--looking-at-namespace
+  "Move to the top of current namespace, and return non-nil.
+If not inside a namespace, return nil and don't move point."
+  (let ((top (save-excursion
+   (beginning-of-defun)
+   (ignore-errors
+ (backward-up-list))
+   (when (names--looking-at-namespace)
+ (point)
+(when top
+  (goto-char top)
+  t)))
 
 (defun names-eval-defun (edebug-it)
   "Identical to `eval-defun', except it works for forms inside namespaces.
@@ -176,7 +181,9 @@ to be edebugged."
 
 ;;; eval-last-sexp
 (defalias 'names--preceding-sexp-original
-  (symbol-function 'elisp--preceding-sexp))
+  (if (fboundp 'elisp--preceding-sexp)
+  (symbol-function 'elisp--preceding-sexp)
+(symbol-function 'preceding-sexp)))
 
 (defun names--preceding-sexp ()
   "Like `elisp--preceding-sexp', but expand namespaces."
@@ -188,19 +195,28 @@ to be edebugged."
   "Identical to `eval-last-sexp', except it works for forms inside namespaces.
 Argument EVAL-LAST-SEXP-ARG-INTERNAL is the same as `eval-last-sexp'."
   (interactive "P")
-  (cl-letf (((symbol-function 'elisp--preceding-sexp)
- #'names--preceding-sex

[elpa] master 23bf9ae 05/11: Improve usage-example

2015-06-18 Thread Artur Malabarba
branch: master
commit 23bf9aeaadb0d5aae9dd2c6d797ab6c5e6a4c6bd
Author: Artur Malabarba 
Commit: Artur Malabarba 

Improve usage-example
---
 UsageExample.org |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/UsageExample.org b/UsageExample.org
index b27160e..5730966 100644
--- a/UsageExample.org
+++ b/UsageExample.org
@@ -14,7 +14,10 @@ The important items are already listed in the Readme:
 
 ;;; Code:
 
-;; `define-namespace' is autoloaded, so there's no need to require `names'.
+;; `define-namespace' is autoloaded, so there's no need to require
+;; `names'. However, requiring it here means it will also work for
+;; people who don't install through package.el.
+(eval-when-compile (require 'names))
 
 ;;;###autoload
 (define-namespace example-



[elpa] master ed32ba8 04/11: New names-pprint command, to pretty-print entire namespace

2015-06-18 Thread Artur Malabarba
branch: master
commit ed32ba84ee1433c698ca9c8562b63014036df947
Author: Artur Malabarba 
Commit: Artur Malabarba 

New names-pprint command, to pretty-print entire namespace

Affects #17
---
 names-dev.el |   21 +++--
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/names-dev.el b/names-dev.el
index 4efc12e..87a6d58 100644
--- a/names-dev.el
+++ b/names-dev.el
@@ -62,11 +62,11 @@
 (defmacro names-print (name &rest forms)
   "Return the expanded results of (namespace NAME :global :verbose FORMS).
 Ideal for determining why a specific form isn't being parsed
-correctly."
+correctly. You may need to set `eval-expression-print-level' and
+`eval-expression-print-length' to nil in order to see your full
+expansion."
   (declare (indent (lambda (&rest x) 0)) (debug 0))
-  `(let ((eval-expression-print-level (max eval-expression-print-level 300))
- (eval-expression-print-length (max eval-expression-print-length 300)))
- (macroexpand '(define-namespace ,name :global :verbose ,@forms
+  `(define-namespace ,name :global :verbose ,@forms))
 
 (defvar names-font-lock
   '(("^:autoload\\_>" 0 'font-lock-warning-face prepend)
@@ -156,8 +156,8 @@ If KILL is non-nil, kill the temp buffer afterwards."
   (progn
 (beginning-of-defun)
 (ignore-errors
-  (backward-up-list)
-  (names--looking-at-namespace
+  (backward-up-list))
+(names--looking-at-namespace)))
 
 (defun names-eval-defun (edebug-it)
   "Identical to `eval-defun', except it works for forms inside namespaces.
@@ -204,6 +204,15 @@ Argument EVAL-LAST-SEXP-ARG-INTERNAL is the same as 
`eval-print-last-sexp'."
 
 ;; (pp (symbol-function 'names--preceding-sexp-original) (current-buffer))
 
+(defun names-pprint ()
+  "Pretty-print an expansion of the namespace around point."
+  (interactive)
+  (let ((ns (save-excursion
+  (names--top-of-namespace)
+  (cdr-safe (read (current-buffer))
+(pp-macroexpand-expression
+ (macroexpand (cons 'names-print ns)
+
 
 ;;; Find stuff
 (require 'find-func nil t)



[elpa] master ea57986 01/11: packages/names: Make names--preceeding-sexp compatible with 24.4 again.

2015-06-18 Thread Artur Malabarba
branch: master
commit ea57986aee56e4996d55a76cccde1b4fe1da9f34
Author: Artur Malabarba 
Commit: Artur Malabarba 

packages/names: Make names--preceeding-sexp compatible with 24.4 again.

Fixes #14
---
 names-dev.el |   14 --
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/names-dev.el b/names-dev.el
index 0133604..4efc12e 100644
--- a/names-dev.el
+++ b/names-dev.el
@@ -176,7 +176,9 @@ to be edebugged."
 
 ;;; eval-last-sexp
 (defalias 'names--preceding-sexp-original
-  (symbol-function 'elisp--preceding-sexp))
+  (if (fboundp 'elisp--preceding-sexp)
+  (symbol-function 'elisp--preceding-sexp)
+(symbol-function 'preceding-sexp)))
 
 (defun names--preceding-sexp ()
   "Like `elisp--preceding-sexp', but expand namespaces."
@@ -188,19 +190,19 @@ to be edebugged."
   "Identical to `eval-last-sexp', except it works for forms inside namespaces.
 Argument EVAL-LAST-SEXP-ARG-INTERNAL is the same as `eval-last-sexp'."
   (interactive "P")
-  (cl-letf (((symbol-function 'elisp--preceding-sexp)
- #'names--preceding-sexp))
+  (cl-letf (((symbol-function 'elisp--preceding-sexp) #'names--preceding-sexp)
+((symbol-function 'preceding-sexp) #'names--preceding-sexp))
 (eval-last-sexp eval-last-sexp-arg-internal)))
 
 (defun names-eval-print-last-sexp (eval-last-sexp-arg-internal)
   "Identical to `eval-print-last-sexp', except it works for forms inside 
namespaces.
 Argument EVAL-LAST-SEXP-ARG-INTERNAL is the same as `eval-print-last-sexp'."
   (interactive "P")
-  (cl-letf (((symbol-function 'elisp--preceding-sexp)
- #'names--preceding-sexp))
+  (cl-letf (((symbol-function 'elisp--preceding-sexp) #'names--preceding-sexp)
+((symbol-function 'preceding-sexp) #'names--preceding-sexp))
 (eval-print-last-sexp eval-last-sexp-arg-internal)))
 
-;; (pp (symbol-function 'names-eval-defun) (current-buffer))
+;; (pp (symbol-function 'names--preceding-sexp-original) (current-buffer))
 
 
 ;;; Find stuff



[elpa] master ca4c411 08/11: Version bump

2015-06-18 Thread Artur Malabarba
branch: master
commit ca4c4117af38aaef22d76f7feee05d85b2a74b68
Author: Artur Malabarba 
Commit: Artur Malabarba 

Version bump
---
 names.el |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/names.el b/names.el
index 7ae9521..1695a21 100644
--- a/names.el
+++ b/names.el
@@ -5,7 +5,7 @@
 ;; Author: Artur Malabarba 
 ;; Maintainer: Artur Malabarba 
 ;; URL: http://github.com/Bruce-Connor/names
-;; Version: 20150125.9
+;; Version: 20150617.0
 ;; Package-Requires: ((emacs "24.1") (cl-lib "0.5"))
 ;; Keywords: extensions lisp
 ;; Prefix: names
@@ -120,7 +120,7 @@ it will set PROP."
 
 ;;; ---
 ;;; Variables
-(defconst names-version "20150125.9" "Version of the names.el package.")
+(defconst names-version "20150617.0" "Version of the names.el package.")
 
 (defvar names--name nil
   "Name of the current namespace inside the `define-namespace' macro.")



[elpa] master updated (951b5e3 -> d75791d)

2015-06-18 Thread Artur Malabarba
malabarba pushed a change to branch master.

  from  951b5e3   Merge commit 'c7e65ca646a7fff43df94bb5f95d9953345ef666'
   new  ea57986   packages/names: Make names--preceeding-sexp compatible 
with 24.4 again.
   new  5de5766   packages/names: Version bump
   new  0728e24   Only advise find-function-search-for-symbol after loading 
find-func
   new  ed32ba8   New names-pprint command, to pretty-print entire namespace
   new  23bf9ae   Improve usage-example
   new  c13c3dc   Improve names--top-of-namespace
   new  7020c67   Implement :functionlike-macros. Affects #17
   new  ca4c411   Version bump
   new  99de0ba   Fix comp warnings
   new  b1da26d   Stefans fixes
   new  d75791d   Merge commit 'b1da26d96cbe8308d0988f6b92737819f98f20fd'


Summary of changes:
 packages/names/TheNittyGritty.org |   35 +++
 packages/names/UsageExample.org   |5 ++-
 packages/names/names-dev.el   |   48 ++---
 packages/names/names.el   |   86 +++-
 4 files changed, 126 insertions(+), 48 deletions(-)



[elpa] master b1da26d 10/11: Stefans fixes

2015-06-18 Thread Artur Malabarba
branch: master
commit b1da26d96cbe8308d0988f6b92737819f98f20fd
Author: Artur Malabarba 
Commit: Artur Malabarba 

Stefans fixes
---
 names.el |  115 +++--
 1 files changed, 58 insertions(+), 57 deletions(-)

diff --git a/names.el b/names.el
index 535050f..b5f403e 100644
--- a/names.el
+++ b/names.el
@@ -1,11 +1,11 @@
-;;; names.el --- Namespaces for emacs-lisp. Avoid name clobbering without 
hiding symbols.
+;;; names.el --- Namespaces for emacs-lisp. Avoid name clobbering without 
hiding symbols.  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2015 Free Software Foundation, Inc.
 
 ;; Author: Artur Malabarba 
 ;; Maintainer: Artur Malabarba 
 ;; URL: http://github.com/Bruce-Connor/names
-;; Version: 20150617.0
+;; Version: 20150618.0
 ;; Package-Requires: ((emacs "24.1") (cl-lib "0.5"))
 ;; Keywords: extensions lisp
 ;; Prefix: names
@@ -44,10 +44,12 @@
 ;; If `C-x' is not a prefix.
 (unless (consp (key-binding "\C-x"))
   ;; Disable the `C-xC-a' binds.
+  (defvar edebug-inhibit-emacs-lisp-mode-bindings)
   (setq edebug-inhibit-emacs-lisp-mode-bindings t)
   ;; And the `C-xX' binds.
+  (defvar global-edebug-prefix)
   (when (or (null (boundp 'global-edebug-prefix))
-(eq 24 (elt global-edebug-prefix 0)))
+(eq ?\C-x (elt global-edebug-prefix 0)))
 (setq global-edebug-prefix "")))
 (require 'edebug)
 (require 'bytecomp)
@@ -55,44 +57,46 @@
 
 ;;; Support
 (declare-function names--autoload-do-load "names" 2)
-(if (fboundp 'function-get)
-(defalias 'names--function-get #'function-get)
-  (defun names--function-get (f prop &rest _)
-"Return the value of property PROP of function F.
+(defalias 'names--function-get
+  (if (fboundp 'function-get) #'function-get
+
+(defun names--autoload-do-load (def name)
+  "Load autoloaded definition DEF from function named NAME."
+  (unless (load (cadr def) 'noerror)
+(error "Macro `%s' is autoloaded, but its file (%s) couldn't be loaded"
+  name (cadr def)))
+  (symbol-function name))
+
+(lambda (f prop &rest _)
+  "Return the value of property PROP of function F.
 If F is an autoloaded macro, try to autoload it in the hope that
 it will set PROP."
-(let ((val nil))
-  (while (and (symbolp f)
-  (null (setq val (get f prop)))
-  (fboundp f))
-(let ((fundef (symbol-function f)))
-  (if (and (names--autoloadp fundef)
-   (not (equal fundef (names--autoload-do-load fundef f
-  nil ;Re-try `get' on the same `f'.
-(setq f fundef
-  val))
-  (defun names--autoload-do-load (def name)
-"Load autoloaded definition DEF from function named NAME."
-(unless (load (cadr def) 'noerror)
-  (error "Macro `%s' is autoloaded, but its file (%s) couldn't be loaded"
- name (cadr def)))
-(symbol-function name)))
-
-(if (fboundp 'macrop)
-(defalias 'names--compat-macrop #'macrop)
-  (defun names--compat-macrop (object)
-"Non-nil if and only if OBJECT is a macro."
-(let ((def (or (ignore-errors (indirect-function object t))
-   (ignore-errors (indirect-function object)
-  (when (consp def)
-(or (eq 'macro (car def))
-(and (names--autoloadp def) (memq (nth 4 def) '(macro t
-
-(if (fboundp 'autoloadp)
-(defalias 'names--autoloadp #'autoloadp)
-  (defsubst names--autoloadp (object)
-"Non-nil if OBJECT is an autoload."
-(eq 'autoload (car-safe object
+  (let ((val nil))
+(while (and (symbolp f)
+(null (setq val (get f prop)))
+(fboundp f))
+  (let ((fundef (symbol-function f)))
+(if (and (names--autoloadp fundef)
+ (not (equal fundef (names--autoload-do-load fundef f
+nil ;Re-try `get' on the same `f'.
+  (setq f fundef
+val
+
+(defalias 'names--compat-macrop
+  (if (fboundp 'macrop) #'macrop
+(lambda (object)
+  "Non-nil if and only if OBJECT is a macro."
+  (let ((def (or (ignore-errors (indirect-function object t))
+ (ignore-errors (indirect-function object)
+(when (consp def)
+  (or (eq 'macro (car def))
+  (and (names--autoloadp def) (memq (nth 4 def) '(macro t)
+
+(defalias 'names--autoloadp
+  (if (fboundp 'autoloadp) #'autoloadp
+(lambda (object)
+  "Non-nil if OBJECT is an autoload."
+  (eq 'autoload (car-safe object)
 
 (unless (get-edebug-spec 'cl-defun)
   (def-edebug-spec cl-defun defun*))
@@ -121,7 +125,7 @@ it will set PROP."
 
 ;;; ---
 ;;; Variables
-(defconst names-version "20150617.0" "Version of the names.el package.")
+(defconst names-version "20150618.0" "Version of the names.el

[elpa] master c13c3dc 06/11: Improve names--top-of-namespace

2015-06-18 Thread Artur Malabarba
branch: master
commit c13c3dcb567677df570d3fc75ea8daaaf19bdb4d
Author: Artur Malabarba 
Commit: Artur Malabarba 

Improve names--top-of-namespace
---
 names-dev.el |   27 ---
 1 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/names-dev.el b/names-dev.el
index 87a6d58..0c2dc20 100644
--- a/names-dev.el
+++ b/names-dev.el
@@ -152,12 +152,17 @@ If KILL is non-nil, kill the temp buffer afterwards."
(kill-buffer b))
 
 (defun names--top-of-namespace ()
-  ""
-  (progn
-(beginning-of-defun)
-(ignore-errors
-  (backward-up-list))
-(names--looking-at-namespace)))
+  "Move to the top of current namespace, and return non-nil.
+If not inside a namespace, return nil and don't move point."
+  (let ((top (save-excursion
+   (beginning-of-defun)
+   (ignore-errors
+ (backward-up-list))
+   (when (names--looking-at-namespace)
+ (point)
+(when top
+  (goto-char top)
+  t)))
 
 (defun names-eval-defun (edebug-it)
   "Identical to `eval-defun', except it works for forms inside namespaces.
@@ -207,11 +212,11 @@ Argument EVAL-LAST-SEXP-ARG-INTERNAL is the same as 
`eval-print-last-sexp'."
 (defun names-pprint ()
   "Pretty-print an expansion of the namespace around point."
   (interactive)
-  (let ((ns (save-excursion
-  (names--top-of-namespace)
-  (cdr-safe (read (current-buffer))
-(pp-macroexpand-expression
- (macroexpand (cons 'names-print ns)
+  (save-excursion
+(when (names--top-of-namespace)
+  (let ((ns (cdr (read (current-buffer)
+(pp-macroexpand-expression
+ (macroexpand (cons 'names-print ns)))
 
 
 ;;; Find stuff



[elpa] master 7020c67 07/11: Implement :functionlike-macros. Affects #17

2015-06-18 Thread Artur Malabarba
branch: master
commit 7020c671b048d4ef104ec29da9fbcdbfe4bde60d
Author: Artur Malabarba 
Commit: Artur Malabarba 

Implement :functionlike-macros. Affects #17
---
 TheNittyGritty.org |   35 +++
 names.el   |   27 +--
 2 files changed, 60 insertions(+), 2 deletions(-)

diff --git a/TheNittyGritty.org b/TheNittyGritty.org
index 78bf88b..84bf6b8 100644
--- a/TheNittyGritty.org
+++ b/TheNittyGritty.org
@@ -139,6 +139,41 @@ need to worry about, it should just do what you expect 
from it.
 
 This is only relevant if you write your own macros. If you do,
 remember to add a debug declaration in them.
+
+*** The theading macros (~->~ and ~-->~)
+
+The threading macros would require special treatment to namespace
+correctly. However, you can use the ~:functionlike-macros~ keyword to
+tell *Names* to treat them as regular functions.
+
+For example, in the following snippet:
+#+BEGIN_SRC emacs-lisp
+(require 'dash)
+(define-namespace foo-
+:functionlike-macros (-> ->>)
+
+(defvar var nil)
+(defun fun (x &optional y)
+  (concat x y))
+
+(-> "some string"
+(fun var)
+fun)
+)
+#+END_SRC
+the ~(fun var)~ part would be namespaced prefectly fine (~fun~ and
+~var~ will be identified as a function and variable respectively),
+because it looks like a regular function call. However, the second use
+of ~fun~ will not be correctly namespaced, because that ~fun~ looks
+like a variable.
+
+In other words, you should use these macros like this instead:
+#+BEGIN_SRC emacs-lisp
+(-> "some string"
+(fun var)
+(fun))
+#+END_SRC
+
 ** Accessing Global Symbols
 If one of your definitions shadows a global definition, you can still
 access it by prefixing it with =::=.
diff --git a/names.el b/names.el
index 4cd23a1..7ae9521 100644
--- a/names.el
+++ b/names.el
@@ -182,6 +182,22 @@ Is only non-nil if the :group keyword is passed to 
`define-namespace'.")
   "The version number given by :version.
 Used to define a constant and a command.")
 
+(defvar names--functionlike-macros nil
+  "Function-like macros, even if their debug-spec says otherwise.
+When expanding the namespace, these macros will be treated
+exactly like functions. This means that their contents will be
+namespaced like regular function arguments.
+
+To add macros to this list, pass the :functionlike-macros keyword
+to your namespace along with a list of macro names (as unquoted
+symbols).
+Example:
+
+(define-namespace foo-
+:functionlike-macros (-> ->> thread-first thread-last)
+;; Rest of code
+)")
+
 (defconst names--keyword-list
   `((:group
  1 ,(lambda (x)
@@ -240,6 +256,12 @@ needed by the :version and :group keywords.")
 (format "\\`%s" (regexp-quote val)
  "Change the value of the `names--protection' variable.")
 
+(:functionlike-macros
+ 1
+ ,(lambda (x) (setq names--functionlike-macros
+   (append x names--functionlike-macros)))
+ "A list of values to be appended to `names--functionlike-macros'.")
+
 (:no-let-vars
  0 nil
  "Indicates variables assigned in let-bind are NOT candidates for 
namespacing.")
@@ -407,6 +429,7 @@ See `define-namespace' for more information."
   (names--remove-namespace-from-list
(names--filter-if-bound byte-compile-macro-environment (lambda 
(x) (not (names--compat-macrop x
(names--filter-if-bound byte-compile-function-environment 
(lambda (x) (not (names--compat-macrop x))
+ (names--functionlike-macros names--functionlike-macros)
  names--keywords names--local-vars key-and-args
  names--version names--package names--group-parent)
 ;; Read keywords
@@ -742,7 +765,6 @@ returns nil."
(and (names--keyword :global)
 (boundp (names--prepend sbl))
 
-;;; This is calling edebug even on `when' and `unless'
 (defun names--args-of-function-or-macro (function args macro)
   "Namespace FUNCTION's arguments ARGS, with special treatment if MACRO is 
non-nil."
   (if macro
@@ -750,7 +772,8 @@ returns nil."
 (names--verbose (eq function 'push)))
 (names--message "Edebug-spec of `%s' is %s" function it)
 ;; Macros where we evaluate all arguments are like functions.
-(if (equal it t)
+(if (or (equal it t)
+(memq function names--functionlike-macros))
 (names--args-of-function-or-macro function args nil)
   ;; Macros where nothing is evaluated we can just return.
   (if (equal it 0)



[elpa] master 0728e24 03/11: Only advise find-function-search-for-symbol after loading find-func

2015-06-18 Thread Artur Malabarba
branch: master
commit 0728e24cd1fd3c14b256c08b0142192c63f1401f
Author: Artur Malabarba 
Commit: Artur Malabarba 

Only advise find-function-search-for-symbol after loading find-func

Fix #10
---
 names.el |   45 +++--
 1 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/names.el b/names.el
index 6d25805..4cd23a1 100644
--- a/names.el
+++ b/names.el
@@ -593,28 +593,29 @@ Also adds `version' to `names--fbound' and 
`names--bound'."
byte-compile-macro-environment
 
 ;;;###autoload
-(defadvice find-function-search-for-symbol
-(around names-around-find-function-search-for-symbol-advice
-(symbol type library) activate)
-  "Make sure `find-function-search-for-symbol' understands namespaces."
-  ad-do-it
-  (ignore-errors
-(unless (cdr ad-return-value)
-  (with-current-buffer (car ad-return-value)
-(search-forward-regexp "^(define-namespace\\_>")
-(skip-chars-forward "\r\n[:blank:]")
-(let* ((names--regexp
-(concat "\\`" (regexp-quote
-   (symbol-name (read (current-buffer))
-   (short-symbol
-;; We manually implement `names--remove-namespace'
-;; because it might not be loaded.
-(let ((name (symbol-name symbol)))
-  (when (string-match names--regexp name)
-(intern (replace-match "" nil nil name))
-  (when short-symbol
-(ad-set-arg 0 short-symbol)
-ad-do-it))
+(eval-after-load 'find-func
+  '(defadvice find-function-search-for-symbol
+   (around names-around-find-function-search-for-symbol-advice
+   (symbol type library) activate)
+ "Make sure `find-function-search-for-symbol' understands namespaces."
+ ad-do-it
+ (ignore-errors
+   (unless (cdr ad-return-value)
+ (with-current-buffer (car ad-return-value)
+   (search-forward-regexp "^(define-namespace\\_>")
+   (skip-chars-forward "\r\n[:blank:]")
+   (let* ((names--regexp
+   (concat "\\`" (regexp-quote
+  (symbol-name (read (current-buffer))
+  (short-symbol
+   ;; We manually implement `names--remove-namespace'
+   ;; because it might not be loaded.
+   (let ((name (symbol-name symbol)))
+ (when (string-match names--regexp name)
+   (intern (replace-match "" nil nil name))
+ (when short-symbol
+   (ad-set-arg 0 short-symbol)
+   ad-do-it)))
 
 (defun names--extract-autoloads (body)
   "Return a list of the forms in BODY preceded by :autoload."



[elpa] master 476cc66: * context-coloring/benchmark/fixtures: Tweak copyright lines

2015-06-18 Thread Stefan Monnier
branch: master
commit 476cc661d1fb1bc28a1dcc80344a6a969acd7b48
Author: Stefan Monnier 
Commit: Stefan Monnier 

* context-coloring/benchmark/fixtures: Tweak copyright lines
---
 .../context-coloring/benchmark/fixtures/lisp.el|3 +--
 .../context-coloring/benchmark/fixtures/subr.el|3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/packages/context-coloring/benchmark/fixtures/lisp.el 
b/packages/context-coloring/benchmark/fixtures/lisp.el
index f8ca6f6..7ebd80a 100644
--- a/packages/context-coloring/benchmark/fixtures/lisp.el
+++ b/packages/context-coloring/benchmark/fixtures/lisp.el
@@ -1,7 +1,6 @@
 ;;; lisp.el --- Lisp editing commands for Emacs  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1985-1986, 1994, 2000-2015 Free Software Foundation,
-;; Inc.
+;; Copyright (C) 1985-1986, 1994, 2000-2015 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-de...@gnu.org
 ;; Keywords: lisp, languages
diff --git a/packages/context-coloring/benchmark/fixtures/subr.el 
b/packages/context-coloring/benchmark/fixtures/subr.el
index a48038f..d4da916 100644
--- a/packages/context-coloring/benchmark/fixtures/subr.el
+++ b/packages/context-coloring/benchmark/fixtures/subr.el
@@ -1,7 +1,6 @@
 ;;; subr.el --- basic lisp subroutines for Emacs  -*- coding: utf-8; 
lexical-binding:t -*-
 
-;; Copyright (C) 1985-1986, 1992, 1994-1995, 1999-2015 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1985-1986, 1992, 1994-1995, 1999-2015 Free Software 
Foundation, Inc.
 
 ;; Maintainer: emacs-de...@gnu.org
 ;; Keywords: internal



[elpa] master b3fcbf3: * packages/wisi: Use lexical binding. Fix dos EOL. Fix EOB markers

2015-06-18 Thread Stefan Monnier
branch: master
commit b3fcbf3fe75f6f5bf32c7d492204720c409c4a72
Author: Stefan Monnier 
Commit: Stefan Monnier 

* packages/wisi: Use lexical binding.  Fix dos EOL.  Fix EOB markers

* packages/wisi/wisi-compat-24.2.el: Use lexical-binding.  Fix EOB 
convention.
* packages/wisi/wisi-compile.el: Use lexical-binding.  Fix EOB convention.
(wisi-compile-grammar): Declare dyn-bound variables.
* packages/wisi/wisi.el: Use lexical-binding.  Fix EOB convention.
(wisi-number-p): Remove unused var `end'.
---
 packages/wisi/wisi-compat-24.2.el |7 +++
 packages/wisi/wisi-compile.el |   21 +++--
 packages/wisi/wisi-parse.el   |4 ++--
 packages/wisi/wisi.el |   31 +++
 4 files changed, 35 insertions(+), 28 deletions(-)

diff --git a/packages/wisi/NEWS b/packages/wisi/NEWS
old mode 100755
new mode 100644
diff --git a/packages/wisi/README b/packages/wisi/README
old mode 100755
new mode 100644
diff --git a/packages/wisi/wisi-compat-24.2.el 
b/packages/wisi/wisi-compat-24.2.el
old mode 100755
new mode 100644
index e4300d7..03bae80
--- a/packages/wisi/wisi-compat-24.2.el
+++ b/packages/wisi/wisi-compat-24.2.el
@@ -1,6 +1,6 @@
-;;; wisi-compat-24.2.el --- Implement current Emacs features not present in 
Emacs 24.2
+;;; wisi-compat-24.2.el --- Implement current Emacs features not present in 
Emacs 24.2  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2015 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -31,5 +31,4 @@ buffer-local wherever it is set."
   )
 
 (provide 'wisi-compat-24.2)
-
-;; end of file
+;;; wisi-compat-24.2.el ends here
diff --git a/packages/wisi/wisi-compile.el b/packages/wisi/wisi-compile.el
old mode 100755
new mode 100644
index 2b8807a..463fb01
--- a/packages/wisi/wisi-compile.el
+++ b/packages/wisi/wisi-compile.el
@@ -1,4 +1,4 @@
-;;; Grammar compiler for the wisent LALR parser, integrating Wisi OpenToken 
output.
+;;; Grammar compiler for the wisent LALR parser, integrating Wisi OpenToken 
output.  -*- lexical-binding:t -*-
 ;;
 ;; Copyright (C) 2012, 2013, 2015 Free Software Foundation, Inc.
 ;;
@@ -135,6 +135,13 @@ side-effects only."
 (list (car (aref actn 2)) action-symbol n)))
 
 (defun wisi-compile-grammar (grammar)
+  ;; FIXME: This docstring is full of ambiguities making it unclear whether
+  ;; we're talking for example about data that includes the symbol `nonterm' as
+  ;; opposed to data that includes some non terminal object we denote
+  ;; with the meta-variable "nonterm".
+  ;; The convention in Elisp's docstrings is to use all-caps for metavariables
+  ;; (and `...' quoting as opposed to the '... quoting used below in a few
+  ;; spots).
   "Compile the LALR(1) GRAMMAR; return the automaton for wisi-parse.
 GRAMMAR is a list TERMINALS NONTERMS ACTIONS GOTOS, where:
 
@@ -169,10 +176,10 @@ state.
 The automaton is an array with 3 elements:
 
 parser-actions is a copy of the input ACTIONS, with reduction
-actions replaced by a list (nonterm action-symbol token-count),
-where `nonterm' is a symbol from NONTERMS, and is the
-non-terminal to reduce to, token-count is the number of tokens in
-the reduction, action-symbol is nil if there is no user action,
+actions replaced by a list (NONTERM ACTION-SYMBOL TOKEN-COUNT),
+where NONTERM is a symbol from NONTERMS, and is the
+non-terminal to reduce to, TOKEN-COUNT is the number of tokens in
+the reduction, ACTION-SYMBOL is nil if there is no user action,
 or a symbol from semantic-actions (below).
 
 gotos is a copy of GOTOS.
@@ -180,6 +187,8 @@ gotos is a copy of GOTOS.
 semantic-actions is an obarray containing functions that
 implement the user action for each nonterminal; the function
 names have the format nonterm:index."
+  (defvar nrules) (defvar ptable) (defvar rcode) (defvar rlhs) (defvar tags)
+  (defvar token-list) (defvar var-list)
   (let (nrules ptable rcode rlhs tags token-list var-list)
 (wisent-parse-grammar;; set global vars used by wisent-semantic-action
  (cons
@@ -214,4 +223,4 @@ names have the format nonterm:index."
 
 (provide 'wisi-compile)
 
- end of file
+;;; wisi-compile.el ends here
diff --git a/packages/wisi/wisi-parse.el b/packages/wisi/wisi-parse.el
old mode 100755
new mode 100644
index 852ecdc..4fa300e
--- a/packages/wisi/wisi-parse.el
+++ b/packages/wisi/wisi-parse.el
@@ -1,6 +1,6 @@
-;;; wisi-parse.el --- Wisi parser
+;;; wisi-parse.el --- Wisi parser  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2013, 2014  Free Software Foundation, Inc.
+;; Copyright (C) 2013-2015  Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/packages/wisi/wisi.el b/packages/wisi/wisi.el
old mode 100755
new mode 100644
index 5a7c17d..a748f62
--- a/packages/wisi/wisi.el
+++ b/packages/wisi/wisi.el
@@ -1,4 +1,4 @@
-;;; wisi.el --- Utilities for implementing an indentation/navigation engine 
using a generalized L

[elpa] master afda2e6: * packages/ada-mode: Miscellaneous tweaks to fix warnings

2015-06-18 Thread Stefan Monnier
branch: master
commit afda2e6a9ddff208fb7dbcda5043aa779ccfd2bc
Author: Stefan Monnier 
Commit: Stefan Monnier 

* packages/ada-mode: Miscellaneous tweaks to fix warnings

* packages/ada-mode/ada-mode.el (ada-in-numeric-literal-p): Refine call to
looking-back.
(): Fix broken use of cl-case.

* packages/ada-mode/ada-skel.el: Use #' to quote function names.

* packages/ada-mode/ada-wisi.el (ada-wisi-which-function-1): Remove unused 
var
`region' and avoid unneeded setq.

* packages/ada-mode/gnat-inspect.el (gnat-inspect-compilation):
* packages/ada-mode/gpr-query.el (gpr-query-compilation): Silence warning.
---
 packages/ada-mode/ada-mode.el |6 +++---
 packages/ada-mode/ada-skel.el |   10 +-
 packages/ada-mode/ada-wisi.el |9 +++--
 packages/ada-mode/gnat-inspect.el |4 ++--
 packages/ada-mode/gpr-query.el|2 +-
 5 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/packages/ada-mode/ada-mode.el b/packages/ada-mode/ada-mode.el
index 57e5ebc..fc3552e 100644
--- a/packages/ada-mode/ada-mode.el
+++ b/packages/ada-mode/ada-mode.el
@@ -1071,7 +1071,7 @@ User is prompted to choose a file from project variable 
casing if it is a list."
 (defun ada-in-numeric-literal-p ()
   "Return t if point is after a prefix of a numeric literal."
   ;; FIXME: this is actually a based numeric literal; excludes 1234
-  (looking-back "\\([0-9]+#[0-9a-fA-F_]+\\)"))
+  (looking-back "\\([0-9]+#[0-9a-fA-F_]+\\)" (line-beginning-position)))
 
 (defvar ada-keywords nil
   "List of Ada keywords for current `ada-language-version'.")
@@ -2818,8 +2818,8 @@ The paragraph is indented on the first line."
 
 (unless (featurep 'ada-xref-tool)
   (cl-case ada-xref-tool
-((nil 'gnat) (require 'ada-gnat-xref))
-('gpr_query (require 'gpr-query))
+((nil gnat) (require 'ada-gnat-xref))
+(gpr_query (require 'gpr-query))
 ))
 
 (unless (featurep 'ada-compiler)
diff --git a/packages/ada-mode/ada-skel.el b/packages/ada-mode/ada-skel.el
index 9544222..e6c5430 100644
--- a/packages/ada-mode/ada-skel.el
+++ b/packages/ada-mode/ada-skel.el
@@ -1,6 +1,6 @@
 ;;; ada-skel.el --- an extension to Ada mode for inserting statement skeletons
 
-;; Copyright (C) 1987, 1993, 1994, 1996-2014  Free Software Foundation, Inc.
+;; Copyright (C) 1987, 1993, 1994, 1996-2015  Free Software Foundation, Inc.
 
 ;; Authors: Stephen Leake 
 
@@ -453,10 +453,10 @@ it is a name, and use the word before that as the token."
 (provide 'ada-skeletons)
 (provide 'ada-skel)
 
-(setq ada-expand 'ada-skel-expand)
-(setq ada-next-placeholder 'ada-skel-next-placeholder)
-(setq ada-prev-placeholder 'ada-skel-prev-placeholder)
+(setq ada-expand #'ada-skel-expand)
+(setq ada-next-placeholder #'ada-skel-next-placeholder)
+(setq ada-prev-placeholder #'ada-skel-prev-placeholder)
 
-(add-hook 'ada-mode-hook 'ada-skel-setup)
+(add-hook 'ada-mode-hook #'ada-skel-setup)
 
 ;;; ada-skel.el ends here
diff --git a/packages/ada-mode/ada-wisi.el b/packages/ada-mode/ada-wisi.el
index a325b0f..7bb3bd9 100644
--- a/packages/ada-mode/ada-wisi.el
+++ b/packages/ada-mode/ada-wisi.el
@@ -1571,12 +1571,9 @@ Also return cache at start."
 paramlist))
 
 (defun ada-wisi-which-function-1 (keyword add-body)
-  "used in `ada-wisi-which-function'."
-  (let (region
-   result
-   (cache (wisi-forward-find-class 'name (point-max
-
-(setq result (wisi-cache-text cache))
+  "Used in `ada-wisi-which-function'."
+  (let* ((cache (wisi-forward-find-class 'name (point-max)))
+ (result (wisi-cache-text cache)))
 
 (when (not ff-function-name)
   (setq ff-function-name
diff --git a/packages/ada-mode/gnat-inspect.el 
b/packages/ada-mode/gnat-inspect.el
index 5fb2d4b..eb1c488 100644
--- a/packages/ada-mode/gnat-inspect.el
+++ b/packages/ada-mode/gnat-inspect.el
@@ -4,7 +4,7 @@
 ;;; gnatinspect supports Ada and any gcc language that supports the
 ;;; -fdump-xref switch (which includes C, C++).
 ;;
-;;; Copyright (C) 2013, 2014  Free Software Foundation, Inc.
+;;; Copyright (C) 2013-2015  Free Software Foundation, Inc.
 
 ;; Author: Stephen Leake 
 ;; Maintainer: Stephen Leake 
@@ -215,7 +215,7 @@ set compilation-mode with compilation-error-regexp-alist 
set to COMP-ERR."
   (setq result-count (- (line-number-at-pos) 1))
   (if (fboundp 'font-lock-ensure)
   (font-lock-ensure)
-(font-lock-fontify-buffer))
+(with-no-warnings (font-lock-fontify-buffer)))
   ;; font-lock-fontify-buffer applies compilation-message text properties
   ;; NOTE: Won't be needed in 24.5 any more, since compilation-next-error
   ;; will apply compilation-message text properties on the fly.
diff --git a/packages/ada-mode/gpr-query.el b/packages/ada-mode/gpr-query.el
index 06ebbb0..7fa91bd 100644
--- a/packages/ada-mode/gpr-query.el
+++ b/packages/ada-mode/gpr-query.el
@@ -256,7 +256,7 @@ set compilation-mode with compilation-error-regexp-alist 
set to COMP-ERR."