[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master b6da724 03/66: Clean up a little
From: |
Dmitry Gutov |
Subject: |
[elpa] master b6da724 03/66: Clean up a little |
Date: |
Tue, 13 Jan 2015 02:44:42 +0000 |
branch: master
commit b6da724d73d2186e720cbafefff4c31204ab67f0
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Clean up a little
---
company-cmake.el | 36 ++++++++++++++++++++----------------
1 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/company-cmake.el b/company-cmake.el
index d6db7e4..ca76c0c 100644
--- a/company-cmake.el
+++ b/company-cmake.el
@@ -51,36 +51,40 @@ They affect which types of symbols we get completion
candidates for.")
(defvar company-cmake-modes '(cmake-mode)
"Major modes in which cmake may complete.")
-(defvar company-cmake-candidates-cache nil
+(defvar company-cmake--candidates-cache nil
"Cache for the raw candidates.")
(defvar company-cmake--meta-command-cache nil
"Cache for command arguments to retrieve descriptions for the candidates.")
(defun company-cmake--replace-tags (rlt)
- (setq rlt (replace-regexp-in-string "\\(.*\\)<LANG>\\(.*\\)"
- (mapconcat 'identity '("\\1CXX\\2"
"\\1C\\2" "\\1Fortran\\2") "\n")
- rlt))
- (setq rlt (replace-regexp-in-string "\\(.*\\)<CONFIG>\\(.*\\)"
- (mapconcat 'identity '("\\1DEBUG\\2"
"\\1RELEASE\\2" "\\1RELWITHDEBINFO\\2" "\\1MINSIZEREL\\2") "\n")
- rlt))
+ (setq rlt (replace-regexp-in-string
+ "\\(.*\\)<LANG>\\(.*\\)"
+ (mapconcat 'identity '("\\1CXX\\2" "\\1C\\2" "\\1Fortran\\2")
"\n")
+ rlt))
+ (setq rlt (replace-regexp-in-string
+ "\\(.*\\)<CONFIG>\\(.*\\)"
+ (mapconcat 'identity '("\\1DEBUG\\2" "\\1RELEASE\\2"
+ "\\1RELWITHDEBINFO\\2" "\\1MINSIZEREL\\2")
+ "\n")
+ rlt))
rlt)
(defun company-cmake--fill-candidates-cache (arg)
"Fill candidates cache if needed."
(let (rlt)
- (unless company-cmake-candidates-cache
- (setq company-cmake-candidates-cache (make-hash-table :test 'equal)))
+ (unless company-cmake--candidates-cache
+ (setq company-cmake--candidates-cache (make-hash-table :test 'equal)))
;; If hash is empty, fill it.
- (unless (gethash arg company-cmake-candidates-cache)
+ (unless (gethash arg company-cmake--candidates-cache)
(with-temp-buffer
(setq res (call-process company-cmake-executable nil t nil arg))
(unless (eq 0 res)
(message "cmake executable exited with error=%d" res))
(setq rlt (buffer-string)))
(setq rlt (company-cmake--replace-tags rlt))
- (puthash arg rlt company-cmake-candidates-cache))
+ (puthash arg rlt company-cmake--candidates-cache))
))
(defun company-cmake-find-match (pattern line)
@@ -91,7 +95,7 @@ They affect which types of symbols we get completion
candidates for.")
(puthash match cmd company-cmake--meta-command-cache)))
match))
-(defun company-cmake-parse (prefix content cmd)
+(defun company-cmake--parse (prefix content cmd)
(let ((start 0)
(pattern (format company-cmake--completion-pattern
(regexp-quote prefix)
@@ -118,10 +122,10 @@ They affect which types of symbols we get completion
candidates for.")
(company-cmake--fill-candidates-cache arg)
(setq cmd-opts (replace-regexp-in-string "-list$" "" arg) )
- (setq str (gethash arg company-cmake-candidates-cache))
- (if str
- (setq results (nconc results (company-cmake-parse prefix str
cmd-opts)))
- ))
+ (setq str (gethash arg company-cmake--candidates-cache))
+ (when str
+ (setq results (nconc results
+ (company-cmake--parse prefix str cmd-opts)))))
results))
(defun company-cmake--unexpand-candidate (candidate)
- [elpa] master updated (0ead54c -> 092486e), Dmitry Gutov, 2015/01/12
- [elpa] master 6846466 01/66: company-capf: Distinguish between `finished' and `exact' in post-completion, Dmitry Gutov, 2015/01/12
- [elpa] master d4088c5 02/66: replace <LANG> <CONFIG> tag in variables, Dmitry Gutov, 2015/01/12
- [elpa] master 250f7af 04/66: s/Fortran/G77, Dmitry Gutov, 2015/01/12
- [elpa] master b6da724 03/66: Clean up a little,
Dmitry Gutov <=
- [elpa] master 67ead1a 06/66: Bump the year, Dmitry Gutov, 2015/01/12
- [elpa] master eb03746 09/66: company-cmake--unexpand-candidate: Remove extra underscore, Dmitry Gutov, 2015/01/12
- [elpa] master 28f8dc6 11/66: Update NEWS, Dmitry Gutov, 2015/01/12
- [elpa] master e5627dd 12/66: company-etags-file-table: Check that TAGS is not a directory, Dmitry Gutov, 2015/01/12
- [elpa] master e66f2c3 13/66: company-bbdb: Use the whole line content after `: ' as prefix, Dmitry Gutov, 2015/01/12
- [elpa] master 79d4b0d 10/66: company-cmake: Support G77/Fortran distinction, Dmitry Gutov, 2015/01/12
- [elpa] master 4375685 14/66: company-complete-number: Handle keypad events, Dmitry Gutov, 2015/01/12
- [elpa] master e692260 15/66: Show numbers in tooltip irrespective of scrolling, Dmitry Gutov, 2015/01/12
- [elpa] master c97666c 18/66: company-files--complete: Ignore case on appropriate systems, Dmitry Gutov, 2015/01/12
- [elpa] master 4d8ac8c 17/66: Support multiple-width chars in annotations, Dmitry Gutov, 2015/01/12