emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 1c516df 01/29: Increase the minimum Emacs version dependen


From: Dmitry Gutov
Subject: [elpa] master 1c516df 01/29: Increase the minimum Emacs version dependency
Date: Tue, 28 Mar 2017 20:50:33 -0400 (EDT)

branch: master
commit 1c516df435577b2c85995c1cbe80a9968d9ae6a0
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Increase the minimum Emacs version dependency
    
    Fixes #604.
---
 NEWS.md    |  4 ++++
 company.el | 47 ++++++++++++++---------------------------------
 2 files changed, 18 insertions(+), 33 deletions(-)

diff --git a/NEWS.md b/NEWS.md
index 32d05b3..b3d9697 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,9 @@
 # History of user-visible changes
 
+## Next
+
+* The minimum required version of Emacs is now 24.3.
+
 ## 2016-11-12 (0.9.1)
 
 * `company-indent-or-complete-common` skips trying to indent if
diff --git a/company.el b/company.el
index 2639caa..7fde671 100644
--- a/company.el
+++ b/company.el
@@ -7,7 +7,7 @@
 ;; URL: http://company-mode.github.io/
 ;; Version: 0.9.2
 ;; Keywords: abbrev, convenience, matching
-;; Package-Requires: ((emacs "24.1") (cl-lib "0.5"))
+;; Package-Requires: ((emacs "24.3"))
 
 ;; This file is part of GNU Emacs.
 
@@ -63,28 +63,9 @@
 (require 'newcomment)
 (require 'pcase)
 
-;; FIXME: Use `user-error'.
-(add-to-list 'debug-ignored-errors "^.* frontend cannot be used twice$")
-(add-to-list 'debug-ignored-errors "^Echo area cannot be used twice$")
-(add-to-list 'debug-ignored-errors "^No \\(document\\|loc\\)ation available$")
-(add-to-list 'debug-ignored-errors "^Company not ")
-(add-to-list 'debug-ignored-errors "^No candidate number ")
-(add-to-list 'debug-ignored-errors "^Cannot complete at point$")
-(add-to-list 'debug-ignored-errors "^No other backend$")
-
 ;;; Compatibility
 (eval-and-compile
-  ;; `defvar-local' for Emacs 24.2 and below
-  (unless (fboundp 'defvar-local)
-    (defmacro defvar-local (var val &optional docstring)
-      "Define VAR as a buffer-local variable with default value VAL.
-Like `defvar' but additionally marks the variable as being automatically
-buffer-local wherever it is set."
-      (declare (debug defvar) (doc-string 3))
-      `(progn
-         (defvar ,var ,val ,docstring)
-         (make-variable-buffer-local ',var))))
-
+  ;; Defined in Emacs 24.4
   (unless (fboundp 'string-suffix-p)
     (defun string-suffix-p (suffix string  &optional ignore-case)
       "Return non-nil if SUFFIX is a suffix of STRING.
@@ -206,13 +187,13 @@ attention to case differences."
                   (memq 'company-pseudo-tooltip-frontend value))
              (and (memq 
'company-pseudo-tooltip-unless-just-one-frontend-with-delay value)
                   (memq 'company-pseudo-tooltip-unless-just-one-frontend 
value)))
-         (error "Pseudo tooltip frontend cannot be used more than once"))
+         (user-error "Pseudo tooltip frontend cannot be used more than once"))
     (and (memq 'company-preview-if-just-one-frontend value)
          (memq 'company-preview-frontend value)
-         (error "Preview frontend cannot be used twice"))
+         (user-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"))
+         (user-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))
@@ -795,7 +776,7 @@ means that `company-mode' is always turned on except in 
`message-mode' buffers."
 (defsubst company-assert-enabled ()
   (unless company-mode
     (company-uninstall-map)
-    (error "Company not enabled")))
+    (user-error "Company not enabled")))
 
 ;;; keymaps 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
@@ -1437,7 +1418,7 @@ prefix match (same case) will be prioritized."
       (when (ignore-errors (company-begin-backend backend))
         (cl-return t))))
   (unless company-candidates
-    (error "No other backend")))
+    (user-error "No other backend")))
 
 (defun company-require-match-p ()
   (let ((backend-value (company-call-backend 'require-match)))
@@ -1782,7 +1763,7 @@ each one wraps a part of the input string."
                company-search-filtering
                (lambda (candidate) (string-match re candidate))))
          (cc (company-calculate-candidates company-prefix)))
-    (unless cc (error "No match"))
+    (unless cc (user-error "No match"))
     (company-update-candidates cc)))
 
 (defun company--search-update-string (new)
@@ -1795,7 +1776,7 @@ each one wraps a part of the input string."
 (defun company--search-assert-input ()
   (company--search-assert-enabled)
   (when (string= company-search-string "")
-    (error "Empty search string")))
+    (user-error "Empty search string")))
 
 (defun company-search-repeat-forward ()
   "Repeat the incremental search in completion candidates forward."
@@ -1922,7 +1903,7 @@ Don't start this directly, use 
`company-search-candidates' or
   (company-assert-enabled)
   (unless company-search-mode
     (company-uninstall-map)
-    (error "Company not in search mode")))
+    (user-error "Company not in search mode")))
 
 (defun company-search-candidates ()
   "Start searching the completion candidates incrementally.
@@ -2159,7 +2140,7 @@ character, stripping the modifiers.  That character must 
be a digit."
   (when (company-manual-begin)
     (and (or (< n 1) (> n (- company-candidates-length
                              company-tooltip-offset)))
-         (error "No candidate number %d" n))
+         (user-error "No candidate number %d" n))
     (cl-decf n)
     (company-finish (nth (+ n company-tooltip-offset)
                          company-candidates))))
@@ -2251,7 +2232,7 @@ character, stripping the modifiers.  That character must 
be a digit."
     (company--electric-do
       (let* ((selected (nth company-selection company-candidates))
              (doc-buffer (or (company-call-backend 'doc-buffer selected)
-                             (error "No documentation available")))
+                             (user-error "No documentation available")))
              start)
         (when (consp doc-buffer)
           (setq start (cdr doc-buffer)
@@ -2268,7 +2249,7 @@ character, stripping the modifiers.  That character must 
be a digit."
     (company--electric-do
       (let* ((selected (nth company-selection company-candidates))
              (location (company-call-backend 'location selected))
-             (pos (or (cdr location) (error "No location available")))
+             (pos (or (cdr location) (user-error "No location available")))
              (buffer (or (and (bufferp (car location)) (car location))
                          (find-file-noselect (car location) t))))
         (setq other-window-scroll-buffer (get-buffer buffer))
@@ -2305,7 +2286,7 @@ character, stripping the modifiers.  That character must 
be a digit."
   (setq company-backend backend)
   ;; Return non-nil if active.
   (or (company-manual-begin)
-      (error "Cannot complete at point")))
+      (user-error "Cannot complete at point")))
 
 (defun company-begin-with (candidates
                            &optional prefix-length require-match callback)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]