[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 01/16: company-frontends-set: never modify VALUE destructively
From: |
Dmitry Gutov |
Subject: |
[elpa] 01/16: company-frontends-set: never modify VALUE destructively |
Date: |
Sat, 26 Jul 2014 04:53:18 +0000 |
dgutov pushed a commit to branch master
in repository elpa.
commit e8cfcd785af904fa88d2cc26fef640ecc70f7bc3
Author: Dmitry Gutov <address@hidden>
Date: Wed Jul 2 19:49:09 2014 +0300
company-frontends-set: never modify VALUE destructively
Fixes #148
---
company.el | 35 +++++++++++++++++------------------
1 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/company.el b/company.el
index 5d8562a..f6c5265 100644
--- a/company.el
+++ b/company.el
@@ -5,7 +5,7 @@
;; Author: Nikolaj Schumacher
;; Maintainer: Dmitry Gutov <address@hidden>
;; URL: http://company-mode.github.io/
-;; Version: 0.8.1
+;; Version: 0.9.0-cvs
;; Keywords: abbrev, convenience, matching
;; Package-Requires: ((emacs "24.1") (cl-lib "0.5"))
@@ -193,23 +193,22 @@ buffer-local wherever it is set."
"Face used for the common part of completions in the echo area.")
(defun company-frontends-set (variable value)
- ;; uniquify
- (let ((remainder value))
- (setcdr remainder (delq (car remainder) (cdr remainder))))
- (and (memq 'company-pseudo-tooltip-unless-just-one-frontend value)
- (memq 'company-pseudo-tooltip-frontend value)
- (error "Pseudo tooltip frontend cannot be used twice"))
- (and (memq 'company-preview-if-just-one-frontend value)
- (memq 'company-preview-frontend value)
- (error "Preview frontend cannot be used twice"))
- (and (memq 'company-echo value)
- (memq 'company-echo-metadata-frontend value)
- (error "Echo area cannot be used twice"))
- ;; preview must come last
- (dolist (f '(company-preview-if-just-one-frontend company-preview-frontend))
- (when (memq f value)
- (setq value (append (delq f value) (list f)))))
- (set variable value))
+ ;; Uniquify.
+ (let ((value (delete-dups (copy-sequence value))))
+ (and (memq 'company-pseudo-tooltip-unless-just-one-frontend value)
+ (memq 'company-pseudo-tooltip-frontend value)
+ (error "Pseudo tooltip frontend cannot be used twice"))
+ (and (memq 'company-preview-if-just-one-frontend value)
+ (memq 'company-preview-frontend value)
+ (error "Preview frontend cannot be used twice"))
+ (and (memq 'company-echo value)
+ (memq 'company-echo-metadata-frontend value)
+ (error "Echo area cannot be used twice"))
+ ;; Preview must come last.
+ (dolist (f '(company-preview-if-just-one-frontend
company-preview-frontend))
+ (when (cdr (memq f value))
+ (setq value (append (delq f value) (list f)))))
+ (set variable value)))
(defcustom company-frontends '(company-pseudo-tooltip-unless-just-one-frontend
company-preview-if-just-one-frontend
- [elpa] 06/16: +1 char, -1 line, (continued)
- [elpa] 06/16: +1 char, -1 line, Dmitry Gutov, 2014/07/26
- [elpa] 05/16: company-pseudo-tooltip-guard: Stabilize when the popup is displayed up, Dmitry Gutov, 2014/07/26
- [elpa] 09/16: company-sort-by-occurrence: continue search after predicate fails, Dmitry Gutov, 2014/07/26
- [elpa] 07/16: Deprecate setting company-idle-delay to t, Dmitry Gutov, 2014/07/26
- [elpa] 08/16: company-sort-by-occurrence: allow customizing the weighing logic, Dmitry Gutov, 2014/07/26
- [elpa] 11/16: company-css-property-value-regexp: prohibit opening curlies, Dmitry Gutov, 2014/07/26
- [elpa] 13/16: Fix company-occurrence-weight-function, Dmitry Gutov, 2014/07/26
- [elpa] 12/16: company-css-property-values: delete duplicates, Dmitry Gutov, 2014/07/26
- [elpa] 10/16: company-capf: get rid of caching last capf-data, Dmitry Gutov, 2014/07/26
- [elpa] 14/16: Fix tests in batch mode, Dmitry Gutov, 2014/07/26
- [elpa] 01/16: company-frontends-set: never modify VALUE destructively,
Dmitry Gutov <=
- [elpa] 15/16: Release 0.8.2, Dmitry Gutov, 2014/07/26
- [elpa] 16/16: Merge commit 'b1d019a4c815ac8bdc240d69eaa74eb4e34640e8' from company-master, Dmitry Gutov, 2014/07/26
- [elpa] 04/16: company-pseudo-tooltip-guard: Invalidate after crossing line continuation, Dmitry Gutov, 2014/07/26
- [elpa] 02/16: Fix popup when prefix is split by line continuation, Dmitry Gutov, 2014/07/26