[elpa] javaimp_devel updated (327e1ba -> 0d6cb9e)

2016-04-08 Thread Filipp Gunbin
fgunbin pushed a change to branch javaimp_devel.

  from  327e1ba   in progress
   new  2f8450a   in progress
   new  0d6cb9e   in progress


Summary of changes:
 packages/javaimp/javaimp.el |  743 ++-
 1 files changed, 376 insertions(+), 367 deletions(-)



[elpa] javaimp_devel 0d6cb9e 2/2: in progress

2016-04-08 Thread Filipp Gunbin
branch: javaimp_devel
commit 0d6cb9e7b7d4082408db66df8072e5aac3f4b528
Author: Filipp Gunbin 
Commit: Filipp Gunbin 

in progress
---
 packages/javaimp/javaimp.el |  452 +++
 1 files changed, 241 insertions(+), 211 deletions(-)

diff --git a/packages/javaimp/javaimp.el b/packages/javaimp/javaimp.el
index 3bf11e3..233d7ae 100644
--- a/packages/javaimp/javaimp.el
+++ b/packages/javaimp/javaimp.el
@@ -4,7 +4,7 @@
 
 ;; Author: Filipp Gunbin 
 ;; Maintainer: Filipp Gunbin 
-;; Version: 0.6
+;; Version: 0.7
 ;; Keywords: java, maven, programming
 
 ;;; Commentary:
@@ -46,8 +46,8 @@
 ;; If you make some changes which change project hierarchy, you should
 ;; re-visit the parent again with `javaimp-maven-visit-project'.
 ;;
-;; May work unreliable with inner classes, but you can always import
-;; top-level class and use qualified name.
+;; Currently inner classes are filtered out from completion alternatives.
+;; You can always import top-level class and use qualified name.
 ;;
 ;; User options:
 ;; 
@@ -140,6 +140,7 @@
 
 (require 'cl-macs)
 (require 'seq)
+(require 'xml)
 
 
 ;; User options
@@ -205,8 +206,9 @@ to the completion alternatives list.")
 (defvar javaimp-project-forest nil
   "Visited projects")
 
-(defvar javaimp-jar-cache nil
-  "Cache for jar contents")
+(defvar javaimp-cached-jars nil
+  "Alist of cached jars.  Each element is of the form (FILE
+  . CACHED-JAR).")
 
 (defconst javaimp-debug-buf-name "*javaimp-debug*")
 
@@ -216,10 +218,9 @@ to the completion alternatives list.")
   parent children contents)
 
 (cl-defstruct javaimp-module
-  id parent-id file file-ts final-name packaging
-  source-dir test-source-dir build-dir
-  modules
-  dep-jars)
+  id parent-id file final-name packaging
+  source-dir test-source-dir build-dir modules
+  dep-jars load-ts)
 
 (defun javaimp-print-id (id)
   (format "%s:%s:%s"
@@ -231,12 +232,13 @@ to the completion alternatives list.")
   (:print-function #'javaimp-print-id))
   group artifact version)
 
-(cl-defstruct javaimp-jar
-  file file-ts classes)
+(cl-defstruct javaimp-cached-jar
+  file read-ts classes)
 
 
+;; Utilities
 
-(defun javaimp-xml-child-list (xml-tree child-name)
+(defun javaimp--xml-child-list (xml-tree child-name)
   "Returns list of children of XML-TREE filtered by CHILD-NAME"
   (let (result)
 (dolist (child (cddr xml-tree) result)
@@ -244,18 +246,42 @@ to the completion alternatives list.")
 (eq (car child) child-name))
(push child result)
 
-(defun javaimp-xml-child (name el)
+(defun javaimp--xml-child (name el)
   "Returns a child of EL named by symbol NAME"
   (assq name (cddr el)))
 
-(defun javaimp-xml-first-child (el)
+(defun javaimp--xml-first-child (el)
   "Returns a first child of EL"
   (car (cddr el)))
 
+(defun javaimp--get-file-ts (file)
+  (nth 5 (file-attributes file)))
 
-(defun javaimp-cygpath-convert-maybe (path)
-  (if (eq system-type 'cygwin) 
-  (car (process-lines javaimp-cygpath-program "-u" path))
+(defun javaimp--get-jdk-jars ()
+  (if javaimp-jdk-home
+  (let ((jre-lib-dir
+(concat (file-name-as-directory javaimp-jdk-home)
+(file-name-as-directory "jre")
+(file-name-as-directory "lib"
+   (directory-files jre-lib-dir t "\\.jar\\'"
+
+(defun javaimp-cygpath-convert-maybe (path &optional mode is-really-path)
+  "On Cygwin, converts PATH using cygpath according to MODE and
+IS-REALLY-PATH.  If MODE is `unix' (the default), adds -u switch.
+If MODE is `windows', adds -m switch.  If `is-really-path' is
+non-nil, adds `-p' switch.  On other systems, PATH is returned
+unchanged."
+  (if (eq system-type 'cygwin)
+  (progn
+   (unless mode (setq mode 'unix))
+   (let (args)
+ (push (cond ((eq mode 'unix) "-u")
+ ((eq mode 'windows) "-m")
+ (t (error "Invalid mode: %s" mode)))
+   args)
+ (and is-really-path (push "-p" args))
+ (push path args)
+ (car (apply #'process-lines javaimp-cygpath-program args
 path))
 
 
@@ -280,6 +306,9 @@ directory containing pom.xml."
 ;; TODO file should start to sink down from there; at each step append 
directory
 ;; from  to it
 
+
+;; Maven XML routines 
+
 (defun javaimp--maven-xml-load-tree (file)
   "Invokes `mvn help:effective-pom' on FILE and using its output
 creates a tree of Maven projects starting from FILE.  Children
@@ -290,18 +319,18 @@ inheritance are not included."
 (cond ((assq 'project xml-tree)
   ;; no real children
   (let ((project-elt (assq 'project xml-tree))
-(submodules (javaimp-xml-child-list
-  (javaimp-xml-child 'modules project-elt) 'module)))
+(submodules (javaimp--xml-child-list
+  (javaimp--xml-child 'modules project-elt) 'module)))
 (and submodules
  (message "Inde

[elpa] javaimp_devel 2f8450a 1/2: in progress

2016-04-08 Thread Filipp Gunbin
branch: javaimp_devel
commit 2f8450a2b4cdf0297b11a929aeeb90753506d7d9
Author: Filipp Gunbin 
Commit: Filipp Gunbin 

in progress
---
 packages/javaimp/javaimp.el |  325 ---
 1 files changed, 152 insertions(+), 173 deletions(-)

diff --git a/packages/javaimp/javaimp.el b/packages/javaimp/javaimp.el
index 6a50e76..3bf11e3 100644
--- a/packages/javaimp/javaimp.el
+++ b/packages/javaimp/javaimp.el
@@ -11,26 +11,45 @@
 
 ;; Allows to manage Java import statements in Maven projects.
 ;;
-;;   Quick start: customize `javaimp-import-group-alist', `javaimp-jdk-home'
-;; and call `javaimp-maven-visit-project', then in a Java buffer visiting a
-;; file under that module or one of its submodules call
-;; `javaimp-organize-imports' or `javaimp-add-import'.  `javaimp-add-import'
-;; will provide you a helpful completion, and the default value (the one
-;; you'll get if you hit `M-n' in the minibuffer) is the symbol under point,
-;; so usually it's enough to hit `M-n', then add some starting letters of a
-;; package and hit `TAB'.  The module does not add all needed imports
-;; automatically!  It only helps you to quickly add imports when stepping
-;; through compilation errors.
+;;   Quick start:
+;;
+;; - customize `javaimp-import-group-alist'
+;;
+;; - call `javaimp-maven-visit-project', giving it the top-level project
+;; directory where pom.xml resides
+;;
+;; Then in a Java buffer visiting a file under that project or one of its
+;; submodules call `javaimp-organize-imports' or `javaimp-add-import'.
+;;
+;;
+;;   Details:
+;; 
+;; `javaimp-add-import' will provide you a helpful completion with the list
+;; of classes taken from this module's dependencies.  Completion default
+;; value (the one you'll get if you hit `M-n' in the minibuffer) is the
+;; symbol under point, so usually it's enough to hit `M-n', then add some
+;; starting letters of a package and hit `TAB'.
+;;
+;; This module does not add all needed imports automatically!  It only helps
+;; you to quickly add imports when stepping through compilation errors.
 ;;
 ;; If Maven failed, you can see its output in the buffer named by
 ;; `javaimp-debug-buf-name' (default is "*javaimp-debug*").
 ;;
 ;; Contents of jar files and Maven project structures (pom.xml) are cached,
 ;; so usually only first command should take a considerable amount of time
-;; to complete.  When it is detected that a particular jar or pom.xml file's
-;; timestamp changed, it is re-read and cache is updated.
+;; to complete.  If a modules's pom.xml or any of its parents pom.xml was
+;; changed (modification timestamp is checked), `mvn
+;; dependency:build-classpath' is re-run on the current module.  If a jar
+;; file was changed, its contents is reloaded.
+;;
+;; If you make some changes which change project hierarchy, you should
+;; re-visit the parent again with `javaimp-maven-visit-project'.
+;;
+;; May work unreliable with inner classes, but you can always import
+;; top-level class and use qualified name.
 ;;
-;; Details on variables.
+;; User options:
 ;; 
 ;;   `javaimp-import-group-alist' defines the order of import statement
 ;; groups.  By default java.* and javax.* imports are assigned an order of
@@ -38,33 +57,40 @@
 ;; project's imports typically should come after, so the sample config below
 ;; sets 80 for them.
 ;; 
-;;  `javaimp-jdk-home' is a path for JDK.  It is used to scan JDK jars.
-;; Usually you will need to set this.
+;;  `javaimp-jdk-home' is a path for JDK.  It is used to scan JDK jars.  By
+;;  default, it is set from the JAVA_HOME environment variable.
 ;;
 ;;  `javaimp-additional-source-dirs' is a list specifying directories where
 ;; additional (e.g. generated) source files reside.  Each directory is a
 ;; relative path from ${project.build.directory} project property value.
 ;; 
-;;  `javaimp-mvn-program' defines path of the `mvn' program.  Use if it's
-;; not on `exec-path'.
+;;  `javaimp-mvn-program' defines path to the `mvn' program.  Customize it
+;; if `mvn' is not on `exec-path'.
 ;;
-;;  `javaimp-cygpath-program' defines path of the `cygpath' program (applies
-;; to Cygwin only, of course).  Use if it's not on `exec-path'.
+;;  `javaimp-cygpath-program' defines path to the `cygpath' program (Cygwin
+;; only).  Customize it if `cygpath' is not on `exec-path'
 ;;
-;;  `javaimp-jar-program' defines path of the `jar' program.  Use if it's
-;; not on `exec-path'.
+;;  `javaimp-jar-program' defines path to the `jar' program.  Customize it
+;;  if `jar' is not on `exec-path'.
 ;;  
-;; Details on commands.
+;; Commands:
 ;;
-;;   `javaimp-maven-visit-project' is the first command you should issue to
-;; use this module.  It reads the pom structure recursively and records
-;; which files belong to which module.  Maven help:effective-pom command is
-;; used to do that.
+;;   `javaimp-maven-visit-project' asks for the project directory, calls
+;; `mvn help:effective-pom' on the pom.xml in that directory, reads proj

[elpa] master d66f65a: packages/arbitools.el: Added new functions

2016-04-08 Thread David Gonzalez Gandara
branch: master
commit d66f65a0586fce6b797b9f892db261410c911305
Author: David Gonzalez Gandara 
Commit: David Gonzalez Gandara 

packages/arbitools.el: Added new functions
---
 packages/arbitools/arbitools.el |  150 ---
 1 files changed, 124 insertions(+), 26 deletions(-)

diff --git a/packages/arbitools/arbitools.el b/packages/arbitools/arbitools.el
index 0adc5b9..1e42e3a 100644
--- a/packages/arbitools/arbitools.el
+++ b/packages/arbitools/arbitools.el
@@ -3,7 +3,7 @@
 ;; Copyright 2016 Free Software Foundation, Inc.
 
 ;; Author: David Gonzalez Gandara 
-;; Version: 0.53
+;; Version: 0.55
 ;; Package-Requires: ((cl-lib "0.5"))
 
 ;; This program is free software: you can redistribute it and/or modify
@@ -59,6 +59,10 @@
 ;;
 ;; - Delete player. Adjust all rank numbers - Native
 ;;
+;; - Adjust points for each player, according to results of rounds - Native
+;;
+;; - Print standings - Native
+;;
 ;; TODO:
 ;; -
 ;;
@@ -77,21 +81,25 @@
 ;; - Add player to team. Prompt for team and player number.
 ;;
 ;; - Generate pgn file for a round or the whole tournament.
-;; 
-;; - Adjust points for each player, according to results of rounds
 ;;
 ;; - Reorder the ranking
 ;;
 ;; - Reorder the players list
 ;;
-;; - Print Stantings
-;; 
 ;; You will find more information in www.ourenxadrez.org/arbitools.htm
 
 ;;; Code:
 
 (eval-when-compile (require 'cl-lib))
 
+(defun arbitools-prepare-feda ()
+  "Prepare file to FEDA: add carriage return at the end of lines."
+  (interactive)
+  (save-excursion
+(goto-char (point-min))
+(while (search-forward "\n" nil t)
+  (replace-match "\r\n"
+
 (defun arbitools-update (elolist)
   "Update the players ratings in a database file based on a elo list file."
   (interactive "selolist:")
@@ -233,33 +241,120 @@
   ;; (insert "013 NNN   \n")
 )
 
-;; (defun aribitools-number-of-rounds ()
-;;   "Get the number of rounds in the tournament"
-   ;; FIXME: EXPERIMENTAL
-;;   (let ((numberofrounds 0))
-;; (save-excursion
-;;  (goto-char (point-min))
-;;  (re-search-forward "^132" nil t)
-;;(let* ((linestringrounds (thing-at-point 'line))
+ (defun arbitools-number-of-rounds ()
+   "Get the number of rounds in the tournament. It has to be executed in the 
principal buffer."
+   (let* ((numberofrounds 0))
+ (save-excursion
+  (goto-char (point-min))
+  (re-search-forward "^132" nil t)
+(let* ((linestringrounds (thing-at-point 'line))
 ;; (actualround " ")
-;;(beginning-of-round 91)
-;;(end-of-round 99)
-;;(continue t))
+(beginning-of-round 91)
+(end-of-round 99)
+(continue t))
 
-   ;; (with-current-buffer "Arbitools-output" (insert (format "rounds: 
%s" linestringrounds)))
-   ;; (with-current-buffer "Arbitools-output" (insert (format "length: 
%s" (- (length linestringrounds) 4
+;; (with-current-buffer "Arbitools-output" (insert (format 
"rounds: %s" linestringrounds)))
+;; (with-current-buffer "Arbitools-output" (insert (format 
"length: %s" (- (length linestringrounds) 4
;; For some reason, the length of the string is 4 characters longer 
than the real line
-;;   (while continue
-;; (if (< end-of-round (length linestringrounds))
+   (while continue
+ (if (< end-of-round (length linestringrounds))
 
-;;   (progn
+   (progn
   ;; (setq actualround (substring-no-properties 
linestringrounds beginning-of-round end-of-round))
-;;  (setq numberofrounds (+ numberofrounds 1))
-;;  (setq beginning-of-round (+ beginning-of-round 10))
-;;  (setq end-of-round (+ end-of-round 10)))
+  (setq numberofrounds (+ numberofrounds 1))
+  (setq beginning-of-round (+ beginning-of-round 10))
+  (setq end-of-round (+ end-of-round 10)))
   
-;;  (setq continue nil))
-;; (numberofrounds))
+  (setq continue nil)
+ numberofrounds))
+
+(defun arbitools-calculate-points ()
+  "Automatically calculate the points of each player"
+  (interactive)
+  (save-excursion
+(let ( (numberofrounds (arbitools-number-of-rounds))
+   (pointsstring   "")
+   (points 0.0)
+   (pointstosum0.0)
+   (roundcount 1))
+  (goto-char (point-min))
+  (while (re-search-forward "^001" nil t)
+(setq points 0.0)
+(setq roundcount 1)
+(while (<= roundcount numberofrounds)
+  (beginning-of-line)
+ (forward-char (+ 98 (* (- roundcount 1) 10))) ;; go to where the 
result is for each round
+  (setq pointsstring (thing-at-point 'symbol))
+  (cond ((string= (thing-at-poin

[elpa] master 9d24d5d 3/3: packages/yasnippet: subtree pull from external

2016-04-08 Thread Noam Postavsky
branch: master
commit 9d24d5d30085ba6d9a62d3f8ea2d52a358ea98c8
Merge: d66f65a 4af9fc9
Author: Noam Postavsky 
Commit: Noam Postavsky 

packages/yasnippet: subtree pull from external
---
 packages/yasnippet/yasnippet.el |  169 --
 1 files changed, 89 insertions(+), 80 deletions(-)

diff --git a/packages/yasnippet/yasnippet.el b/packages/yasnippet/yasnippet.el
index f345e48..cff623f 100644
--- a/packages/yasnippet/yasnippet.el
+++ b/packages/yasnippet/yasnippet.el
@@ -1,12 +1,15 @@
 ;;; yasnippet.el --- Yet another snippet extension for Emacs.
 
-;; Copyright (C) 2008-2013, 2015 Free Software Foundation, Inc.
-;; Authors: pluskid ,  João Távora , 
Noam Postavsky 
+;; Copyright (C) 2008-2016 Free Software Foundation, Inc.
+;; Authors: pluskid ,
+;;  João Távora ,
+;;  Noam Postavsky 
 ;; Maintainer: Noam Postavsky 
 ;; Version: 0.9.1
 ;; X-URL: http://github.com/capitaomorte/yasnippet
 ;; Keywords: convenience, emulation
 ;; URL: http://github.com/capitaomorte/yasnippet
+;; Package-Requires: ((cl-lib "0.5"))
 ;; EmacsWiki: YaSnippetMode
 
 ;; This program is free software: you can redistribute it and/or modify
@@ -153,10 +156,10 @@
 (defvar yas-installed-snippets-dir nil)
 (setq yas-installed-snippets-dir
   (when load-file-name
-(concat (file-name-directory load-file-name) "snippets")))
+(expand-file-name "snippets" (file-name-directory load-file-name
 
 (defconst yas--default-user-snippets-dir
-  (concat user-emacs-directory "snippets"))
+  (expand-file-name "snippets" user-emacs-directory))
 
 (defcustom yas-snippet-dirs (remove nil
 (list yas--default-user-snippets-dir
@@ -172,8 +175,9 @@ snippets.
 
 The first directory is taken as the default for storing snippet's
 created with `yas-new-snippet'. "
-  :type '(choice (string :tag "Single directory (string)")
- (repeat :args (string) :tag "List of directories (strings)"))
+  :type '(choice (directory :tag "Single directory")
+ (repeat :tag "List of directories"
+ (choice (directory) (variable
   :group 'yasnippet
   :require 'yasnippet
   :set #'(lambda (symbol new)
@@ -507,7 +511,7 @@ snippets returning the symbol 'force-in-comment in their
 conditions.
 
  (add-hook 'python-mode-hook
-   '(lambda ()
+   (lambda ()
   (setq yas-buffer-local-condition
 '(if (python-in-string/comment)
  '(require-snippet-condition . force-in-comment)
@@ -726,22 +730,24 @@ defined direct keybindings to the command
yas--tables))
 
 (defun yas--modes-to-activate (&optional mode)
-  "Compute list of mode symbols that are active for `yas-expand'
-and friends."
+  "Compute list of mode symbols that are active for `yas-expand' and friends."
+  (defvar yas--dfs);We rely on dynbind.  We could use `letrec' instead!
   (let* ((explored (if mode (list mode) ; Building up list in reverse.
  (cons major-mode (reverse yas--extra-modes
- (dfs
+ (yas--dfs
   (lambda (mode)
 (cl-loop for neighbour
  in (cl-list* (get mode 'derived-mode-parent)
-  (ignore-errors (symbol-function mode))
+  ;; NOTE: `fboundp' check is redundant
+  ;; since Emacs 24.4.
+  (and (fboundp mode) (symbol-function mode))
   (gethash mode yas--parents))
  when (and neighbour
(not (memq neighbour explored))
(symbolp neighbour))
  do (push neighbour explored)
- (funcall dfs neighbour)
-(mapcar dfs explored)
+ (funcall yas--dfs neighbour)
+(mapc yas--dfs explored)
 (nreverse explored)))
 
 (defvar yas-minor-mode-hook nil
@@ -773,8 +779,8 @@ Key bindings:
  ;;
  ;; Also install the post-command-hook.
  ;;
- (add-hook 'emulation-mode-map-alists 'yas--direct-keymaps)
- (add-hook 'post-command-hook 'yas--post-command-handler nil t)
+ (cl-pushnew 'yas--direct-keymaps emulation-mode-map-alists)
+ (add-hook 'post-command-hook #'yas--post-command-handler nil t)
  ;; Set the `yas--direct-%s' vars for direct keymap expansion
  ;;
  (dolist (mode (yas--modes-to-activate))
@@ -787,8 +793,9 @@ Key bindings:
 (t
  ;; Uninstall the direct keymaps and the post-command hook
  ;;
- (remove-hook 'post-command-hook 'yas--post-command-handler t)
- (remove-hook 'emulation-mode-map-alists 'yas--direct-keymaps
+ (remove-hook 'post-command-hook #'yas--post-command-handler t)
+ (setq emulation-mode-map-alists
+   (remove 'yas--direct-keym

[elpa] master 4af9fc9 2/3: Further cleanup

2016-04-08 Thread Noam Postavsky
branch: master
commit 4af9fc98155eff79797302eb587c68079fa56149
Author: Noam Postavsky 
Commit: Noam Postavsky 

Further cleanup

* yasnippet.el (yas-snippet-dirs): Fix :type.
(yas--modes-to-activate): Add explicit fboundp check instead of
ignore-errors.
(yas--font-lock-keywords): Remove redundant entries.
(yas--guess-snippet-directories): Simplify.
(yas-load-snippet-buffer-and-close): Use read-file-name.
---
 yasnippet.el |   30 ++
 1 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/yasnippet.el b/yasnippet.el
index 3e3f6eb..cff623f 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -175,9 +175,9 @@ snippets.
 
 The first directory is taken as the default for storing snippet's
 created with `yas-new-snippet'. "
-  ;; FIXME: Why use type `string' rather than `directory'?
-  :type '(choice (string :tag "Single directory (string)")
- (repeat :args (string) :tag "List of directories (strings)"))
+  :type '(choice (directory :tag "Single directory")
+ (repeat :tag "List of directories"
+ (choice (directory) (variable
   :group 'yasnippet
   :require 'yasnippet
   :set #'(lambda (symbol new)
@@ -738,9 +738,9 @@ defined direct keybindings to the command
   (lambda (mode)
 (cl-loop for neighbour
  in (cl-list* (get mode 'derived-mode-parent)
-  ;; FIXME: `ignore-errors' can be dropped here
-  ;; in Emacs≥24.3.
-  (ignore-errors (symbol-function mode))
+  ;; NOTE: `fboundp' check is redundant
+  ;; since Emacs 24.4.
+  (and (fboundp mode) (symbol-function mode))
   (gethash mode yas--parents))
  when (and neighbour
(not (memq neighbour explored))
@@ -892,8 +892,6 @@ Honour `yas-dont-activate', which see."
 ("${\\([0-9]+\\):?"
  (0 font-lock-keyword-face)
  (1 font-lock-warning-face t))
-("${" . font-lock-keyword-face);FIXME: Redundant?
-("$[0-9]+?" . font-lock-preprocessor-face) ;FIXME: Redundant?
 ("\\(\\$(\\)" 1 font-lock-preprocessor-face)
 ("}"
  (0 font-lock-keyword-face)
@@ -2416,11 +2414,11 @@ tables (or optional TABLE).
 Returns a list of elements (TABLE . DIRS) where TABLE is a
 `yas--table' object and DIRS is a list of all possible directories
 where snippets of table might exist."
-  (let ((main-dir (or (cl-first (or (yas-snippet-dirs)
-(setq yas-snippet-dirs (list 
yas--default-user-snippets-dir))
-(tables (or (and table
- (list table))
-(yas--get-snippet-tables
+  (let ((main-dir (car (or (yas-snippet-dirs)
+   (setq yas-snippet-dirs
+ (list yas--default-user-snippets-dir)
+(tables (if table (list table)
+  (yas--get-snippet-tables
 ;; HACK! the snippet table created here is actually registered!
 ;;
 (unless (or table (gethash major-mode yas--tables))
@@ -2592,9 +2590,9 @@ and `kill-buffer' instead."
 (when chosen
   (let ((default-file-name (or (and file (file-name-nondirectory file))
(yas--template-name 
yas--editing-template
-(write-file (expand-file-name ;; FIXME: Why not read-file-name?
- (read-from-minibuffer (format "File name to create in 
%s? " chosen)
-   default-file-name)
+(write-file (expand-file-name
+ (read-file-name (format "File name to create in %s? " 
chosen)
+ chosen default-file-name)
  chosen))
 (setf (yas--template-load-file yas--editing-template) 
buffer-file-name))
   (when buffer-file-name



[elpa] master 18f7b1b 1/3: Various cleanup

2016-04-08 Thread Noam Postavsky
branch: master
commit 18f7b1b9fe99339f1bb350779ec43e26e8df1c5c
Author: Stefan Monnier 
Commit: Noam Postavsky 

Various cleanup

* yasnippet/yasnippet.el: Add Package-Requires since we use cl-lib.
(yas-installed-snippets-dir, yas--default-user-snippets-dir)
(yas--load-directory-1, yas-load-snippet-buffer-and-close):
Use expand-file-name.
(yas-buffer-local-condition): Let's not quote lambdas.
(yas--modes-to-activate): Fix compiler warning about free `dfs' var and
unused return value of `mapcar'.
(yas-minor-mode): Don't confuse emulation-mode-map-alists for a hook.
(yas--font-lock-keywords): Don't hardcode the name of emacs-lisp-mode's
font-lock keywords.
(yas--calculate-group): Use file-relative-name.
(yas--subdirs): Don't mismatch \n in file name.
(yas-expand-from-trigger-key, yas-tryout-snippet): Prefer numbers to
number names.
(yas--guess-snippet-directories): Use expand-file-name rather than
removing&adding / by hand.
(yas--on-field-overlay-modification): Mark `length' as unused.
(yas--update-mirrors): Try to better fit within 80 columns.
(yas--backported-syms, yas--exported-syms): Don't mismatch \n in
symbol name.
---
 yasnippet.el |  159 +++---
 1 files changed, 85 insertions(+), 74 deletions(-)

diff --git a/yasnippet.el b/yasnippet.el
index f345e48..3e3f6eb 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -1,12 +1,15 @@
 ;;; yasnippet.el --- Yet another snippet extension for Emacs.
 
-;; Copyright (C) 2008-2013, 2015 Free Software Foundation, Inc.
-;; Authors: pluskid ,  João Távora , 
Noam Postavsky 
+;; Copyright (C) 2008-2016 Free Software Foundation, Inc.
+;; Authors: pluskid ,
+;;  João Távora ,
+;;  Noam Postavsky 
 ;; Maintainer: Noam Postavsky 
 ;; Version: 0.9.1
 ;; X-URL: http://github.com/capitaomorte/yasnippet
 ;; Keywords: convenience, emulation
 ;; URL: http://github.com/capitaomorte/yasnippet
+;; Package-Requires: ((cl-lib "0.5"))
 ;; EmacsWiki: YaSnippetMode
 
 ;; This program is free software: you can redistribute it and/or modify
@@ -153,10 +156,10 @@
 (defvar yas-installed-snippets-dir nil)
 (setq yas-installed-snippets-dir
   (when load-file-name
-(concat (file-name-directory load-file-name) "snippets")))
+(expand-file-name "snippets" (file-name-directory load-file-name
 
 (defconst yas--default-user-snippets-dir
-  (concat user-emacs-directory "snippets"))
+  (expand-file-name "snippets" user-emacs-directory))
 
 (defcustom yas-snippet-dirs (remove nil
 (list yas--default-user-snippets-dir
@@ -172,6 +175,7 @@ snippets.
 
 The first directory is taken as the default for storing snippet's
 created with `yas-new-snippet'. "
+  ;; FIXME: Why use type `string' rather than `directory'?
   :type '(choice (string :tag "Single directory (string)")
  (repeat :args (string) :tag "List of directories (strings)"))
   :group 'yasnippet
@@ -507,7 +511,7 @@ snippets returning the symbol 'force-in-comment in their
 conditions.
 
  (add-hook 'python-mode-hook
-   '(lambda ()
+   (lambda ()
   (setq yas-buffer-local-condition
 '(if (python-in-string/comment)
  '(require-snippet-condition . force-in-comment)
@@ -726,22 +730,24 @@ defined direct keybindings to the command
yas--tables))
 
 (defun yas--modes-to-activate (&optional mode)
-  "Compute list of mode symbols that are active for `yas-expand'
-and friends."
+  "Compute list of mode symbols that are active for `yas-expand' and friends."
+  (defvar yas--dfs);We rely on dynbind.  We could use `letrec' instead!
   (let* ((explored (if mode (list mode) ; Building up list in reverse.
  (cons major-mode (reverse yas--extra-modes
- (dfs
+ (yas--dfs
   (lambda (mode)
 (cl-loop for neighbour
  in (cl-list* (get mode 'derived-mode-parent)
+  ;; FIXME: `ignore-errors' can be dropped here
+  ;; in Emacs≥24.3.
   (ignore-errors (symbol-function mode))
   (gethash mode yas--parents))
  when (and neighbour
(not (memq neighbour explored))
(symbolp neighbour))
  do (push neighbour explored)
- (funcall dfs neighbour)
-(mapcar dfs explored)
+ (funcall yas--dfs neighbour)
+(mapc yas--dfs explored)
 (nreverse explored)))
 
 (defvar yas-minor-mode-hook nil
@@ -773,8 +779,8 @@ Key bindings:
  ;;
  ;; Also install the post-command-hook.
  ;;
- (add-hook 'emulation-mode-map-alists 'yas--direct-keymaps)
- (add-hook 'post-command-hook 'yas--post-com

[elpa] master updated (d66f65a -> 9d24d5d)

2016-04-08 Thread Noam Postavsky
npostavs pushed a change to branch master.

  from  d66f65a   packages/arbitools.el: Added new functions
   new  18f7b1b   Various cleanup
   new  4af9fc9   Further cleanup
   new  9d24d5d   packages/yasnippet: subtree pull from external


Summary of changes:
 packages/yasnippet/yasnippet.el |  169 --
 1 files changed, 89 insertions(+), 80 deletions(-)