[elpa] externals/company ee3177c 2/2: Merge pull request #1108 from yugaego/echo-font

2021-05-27 Thread ELPA Syncer
branch: externals/company
commit ee3177cdad47cbe92242eeb52c7bdb9505282db6
Merge: f0caa24 b1fd922
Author: Dmitry Gutov 
Commit: GitHub 

Merge pull request #1108 from yugaego/echo-font

Change echo-common face for light themes
---
 company.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/company.el b/company.el
index c89d347..307b6df 100644
--- a/company.el
+++ b/company.el
@@ -156,8 +156,8 @@
   "Face used for completions in the echo area.")
 
 (defface company-echo-common
-  'background dark)) (:foreground "firebrick1"))
-(((background light)) (:background "firebrick4")))
+  'background light)) (:foreground "firebrick4"))
+(((background dark)) (:foreground "firebrick1")))
   "Face used for the common part of completions in the echo area.")
 
 ;; Too lazy to re-add :group to all defcustoms down below.



[elpa] externals/company b1fd922 1/2: Change echo-common face for light themes

2021-05-27 Thread ELPA Syncer
branch: externals/company
commit b1fd922d697b25254e4fa5bb0b38884ae8c05e20
Author: Y. E 
Commit: Y. E 

Change echo-common face for light themes

Improves visibility of common part(s) of completions
with echo-frontends for all built-in light themes.
---
 company.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/company.el b/company.el
index c89d347..307b6df 100644
--- a/company.el
+++ b/company.el
@@ -156,8 +156,8 @@
   "Face used for completions in the echo area.")
 
 (defface company-echo-common
-  'background dark)) (:foreground "firebrick1"))
-(((background light)) (:background "firebrick4")))
+  'background light)) (:foreground "firebrick4"))
+(((background dark)) (:foreground "firebrick1")))
   "Face used for the common part of completions in the echo area.")
 
 ;; Too lazy to re-add :group to all defcustoms down below.



[elpa] externals/javaimp 9b49ee1: Include inner classes in completion candidates

2021-05-27 Thread Filipp Gunbin
branch: externals/javaimp
commit 9b49ee123c652a5ef5630badbcc8ae91b240c457
Author: Filipp Gunbin 
Commit: Filipp Gunbin 

Include inner classes in completion candidates
---
 javaimp-tests.el  | 22 +-
 javaimp-util.el   | 52 +++
 javaimp.el| 78 +--
 testdata/test-get-file-classes-1.java | 60 +++
 4 files changed, 170 insertions(+), 42 deletions(-)

diff --git a/javaimp-tests.el b/javaimp-tests.el
index f382302..36b4686 100644
--- a/javaimp-tests.el
+++ b/javaimp-tests.el
@@ -6,7 +6,7 @@
 ;; Maintainer: Filipp Gunbin 
 
 (require 'ert)
-(require 'javaimp-maven)
+(require 'javaimp)
 
 (ert-deftest javaimp-test--maven-projects-from-xml--project ()
   (with-temp-buffer
@@ -21,3 +21,23 @@
 (let ((projects (javaimp--maven-projects-from-xml
 (xml-parse-region (point-min) (point-max)
   (should (eql (length projects) 2)
+
+
+(ert-deftest javaimp-test--get-package ()
+  (with-temp-buffer
+(insert "//package org.commented1;
+/*package org.commented2;*/
+  package org.foo;")
+(should (equal (javaimp--get-package) "org.foo"
+
+(ert-deftest javaimp-test--get-file-classes ()
+  (should (equal (javaimp--get-file-classes
+  (concat javaimp--basedir 
"testdata/test-get-file-classes-1.java"))
+ '("org.foo.Top"
+   "org.foo.Top.CInner1"
+   "org.foo.Top.CInner1.CInner1_CInner1"
+   "org.foo.Top.IInner1"
+   "org.foo.Top.IInner1.IInner1_IInner1"
+   "org.foo.Top.IInner1.IInner1_CInner1"
+   "org.foo.Top.EInner1"
+   "org.foo.Top.EInner1.EInner1_EInner1"
diff --git a/javaimp-util.el b/javaimp-util.el
index 9304fce..f2f4c00 100644
--- a/javaimp-util.el
+++ b/javaimp-util.el
@@ -157,4 +157,56 @@ buffer and returns its result"
   (setf (javaimp-node-children this-node) child-nodes)
   this-node)))
 
+
+;; Java source parsing
+
+(defun javaimp--get-package ()
+  (save-excursion
+(save-restriction
+  (widen)
+  (goto-char (point-min))
+  (catch 'found
+(while (re-search-forward "^\\s *package\\s +\\([^;]+\\)\\s *;" nil t)
+  (let ((state (syntax-ppss)))
+(unless (syntax-ppss-context state)
+  (throw 'found (match-string 1)
+
+(defun javaimp--get-file-classes (file)
+  (with-temp-buffer
+(insert-file-contents file)
+(let ((parse-sexp-ignore-comments t)
+  (class-re (concat
+ (regexp-opt '("class" "interface" "enum") 'words)
+ (rx (and (+ (syntax whitespace))
+  (group (+ (any alnum ?_)))
+  res)
+  (while (re-search-forward class-re nil t)
+(let ((state (syntax-ppss))
+  curr)
+  (unless (syntax-ppss-context state)
+(setq curr (list (match-string 2)))
+;; collect enclosing classes, if any
+(save-excursion
+  (catch 'stop
+(while (nth 1 state)
+  ;; find innermost enclosing open-bracket
+  (goto-char (nth 1 state))
+  (if (and (= (char-after) ?{)
+   (re-search-backward class-re nil t)
+   ;; if there's no paren in between - assume
+   ;; it's a valid class (not a method - this
+   ;; way we exclude local classes)
+   (not (save-match-data
+  (search-forward "(" (nth 1 state) t
+  (progn
+(push (match-string 2) curr)
+(setq state (syntax-ppss)))
+(setq curr nil)
+(throw 'stop nil)
+(when curr
+  (let ((package (javaimp--get-package)))
+(if package (push package curr)))
+  (push (mapconcat #'identity curr ".") res)
+  (nreverse res
+
 (provide 'javaimp-util)
diff --git a/javaimp.el b/javaimp.el
index b3338c5..1ea804d 100644
--- a/javaimp.el
+++ b/javaimp.el
@@ -49,9 +49,6 @@
 ;; from the build tool again.  If a jar file was changed, its contents
 ;; are re-read.
 ;;
-;; Currently inner classes are filtered out from completion alternatives.
-;; You can always import top-level class and use qualified name.
-;;
 ;;
 ;;   Example:
 ;;
@@ -275,16 +272,24 @@ any module file."
  ;; needs to be converted appropriately.
  (javaimp-cygpath-convert-maybe file 'windows)))
   (goto-char (point-min))
-  (save-excursion
-(while (re-search-forward "^classes/" nil t)
- (replace-match "")))
-  (save-excursion
-(while (search-forward "/" nil t)
- (replace-match ".")))
-  (let (result)
-   (while (re-search-forw

[elpa] externals/pyim 6416f62: v3.7.8

2021-05-27 Thread ELPA Syncer
branch: externals/pyim
commit 6416f62728c82082bc0eda780c17dd15ca866137
Author: Feng Shu 
Commit: Feng Shu 

v3.7.8
---
 pyim.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pyim.el b/pyim.el
index ce11b01..57b87e9 100644
--- a/pyim.el
+++ b/pyim.el
@@ -7,7 +7,7 @@
 ;; Feng Shu 
 ;; Maintainer: Feng Shu 
 ;; URL: https://github.com/tumashu/pyim
-;; Version: 3.7.7
+;; Version: 3.7.8
 ;; Keywords: convenience, Chinese, pinyin, input-method
 ;; Package-Requires: ((emacs "24.4") (async "1.6") (xr "1.13"))
 



[elpa] externals/pyim updated (6416f62 -> 20d2ae0)

2021-05-27 Thread ELPA Syncer
elpasync pushed a change to branch externals/pyim.

  from  6416f62   v3.7.8
   new  680c90f   * pyim-dhashcache.el (cl-lib): required.
   new  20d2ae0   v3.7.9


Summary of changes:
 pyim-dhashcache.el | 3 ++-
 pyim.el| 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)



[elpa] externals/pyim 20d2ae0 2/2: v3.7.9

2021-05-27 Thread ELPA Syncer
branch: externals/pyim
commit 20d2ae0721371f572edc03afe46b7d510749bd0a
Author: Feng Shu 
Commit: Feng Shu 

v3.7.9
---
 pyim.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pyim.el b/pyim.el
index 57b87e9..ac1459a 100644
--- a/pyim.el
+++ b/pyim.el
@@ -7,7 +7,7 @@
 ;; Feng Shu 
 ;; Maintainer: Feng Shu 
 ;; URL: https://github.com/tumashu/pyim
-;; Version: 3.7.8
+;; Version: 3.7.9
 ;; Keywords: convenience, Chinese, pinyin, input-method
 ;; Package-Requires: ((emacs "24.4") (async "1.6") (xr "1.13"))
 



[elpa] externals/pyim 680c90f 1/2: * pyim-dhashcache.el (cl-lib): required.

2021-05-27 Thread ELPA Syncer
branch: externals/pyim
commit 680c90f722c39f6d3fb724a4ff68d01468e58208
Author: Feng Shu 
Commit: Feng Shu 

* pyim-dhashcache.el (cl-lib): required.
---
 pyim-dhashcache.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pyim-dhashcache.el b/pyim-dhashcache.el
index 69bb57a..b6d1838 100644
--- a/pyim-dhashcache.el
+++ b/pyim-dhashcache.el
@@ -33,11 +33,12 @@
 
 ;;; Code:
 ;; * 代码 :code:
+(require 'cl-lib)
+(require 'async nil t)
 (require 'pyim-common)
 (require 'pyim-pymap)
 (require 'pyim-dcache)
 (require 'pyim-scheme)
-(require 'async nil t)
 
 ;; Pyim 词库缓存文件,注意:变量名称中不能出现 ":" 等,不能作为文件名称的字符。
 (defvar pyim-dhashcache-code2word nil)