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

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

[nongnu] elpa/bash-completion 9b94818f88 167/313: Remove support for pre


From: ELPA Syncer
Subject: [nongnu] elpa/bash-completion 9b94818f88 167/313: Remove support for pre-Emacs24.1 backward compatibility.
Date: Sat, 3 Dec 2022 10:59:27 -0500 (EST)

branch: elpa/bash-completion
commit 9b94818f88f61c5db8450a3fdf64b07b8df6e74d
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>

    Remove support for pre-Emacs24.1 backward compatibility.
---
 bash-completion.el                       |  26 +-------
 test/bash-completion-integration-test.el |  12 +---
 test/bash-completion-test.el             |   4 +-
 test/pre24.el                            | 105 -------------------------------
 4 files changed, 7 insertions(+), 140 deletions(-)

diff --git a/bash-completion.el b/bash-completion.el
index e9fc9071fe..ea14410d2f 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -236,13 +236,6 @@ function returns status code 124, meaning that the 
completion
 should be retried. This should be a string that's unlikely
 to be included into a completion output.")
 
-(defconst bash-completion-comint-uses-standard-completion
-  (or (and (= emacs-major-version 24) (>= emacs-minor-version 1))
-      (>= emacs-major-version 25))
-  "In emacs 24.1, comint and derived modes started to use
-standard completion facilities.  Completion functions will change
-their behaviour according to this constant.")
-
 (eval-when-compile
   (unless (or (and (= emacs-major-version 24) (>= emacs-minor-version 1))
               (>= emacs-major-version 25))
@@ -317,22 +310,9 @@ When doing completion outside of a comint buffer, call
                 bash-completion-message-delay nil
                 (lambda () (message "Bash completion..."))))))
       (unwind-protect
-          (let ((result (bash-completion-dynamic-complete-nocomint
-                         (comint-line-beginning-position)
-                         (point))))
-            (if bash-completion-comint-uses-standard-completion
-                result
-              ;; pre-emacs 24.1 compatibility code
-              (let ((stub (buffer-substring-no-properties
-                           (nth 0 result)
-                           (nth 1 result)))
-                    (completions (nth 2 result))
-                    ;; Setting comint-completion-addsuffix overrides
-                    ;; configuration for comint-dynamic-simple-complete.
-                    ;; Bash adds a space suffix automatically.
-                    (comint-completion-addsuffix nil))
-                (with-no-warnings
-                  (comint-dynamic-simple-complete stub completions)))))
+          (bash-completion-dynamic-complete-nocomint
+           (comint-line-beginning-position)
+           (point))
         ;; cleanup
         (if message-timer
             (cancel-timer message-timer)))))
diff --git a/test/bash-completion-integration-test.el 
b/test/bash-completion-integration-test.el
index 98b2b6c2cc..55198dea58 100644
--- a/test/bash-completion-integration-test.el
+++ b/test/bash-completion-integration-test.el
@@ -31,11 +31,7 @@
 ;;; Code:
 (require 'bash-completion)
 (require 'dired)
-
-(if (>= emacs-major-version 24)
-    (require 'ert)
-  (require 'pre24)
-  (require 'dired))
+(require 'ert)
 
 (defmacro bash-completion_test-harness (&rest body)
   `(progn
@@ -73,10 +69,8 @@
            ;; do a completion and return the result
            (with-current-buffer shell-buffer
              (insert ,complete-me)
-             (if bash-completion-comint-uses-standard-completion
-                 (let ((comint-dynamic-complete-functions 
'(bash-completion-dynamic-complete)))
-                   (completion-at-point))
-               (bash-completion-dynamic-complete))
+              (let ((comint-dynamic-complete-functions 
'(bash-completion-dynamic-complete)))
+                (completion-at-point))
              (buffer-substring-no-properties
                (comint-line-beginning-position) (point))))
        ;; finally
diff --git a/test/bash-completion-test.el b/test/bash-completion-test.el
index 5c112affa7..375ac635ff 100644
--- a/test/bash-completion-test.el
+++ b/test/bash-completion-test.el
@@ -31,9 +31,7 @@
 ;;; Code:
 (require 'bash-completion)
 (require 'cl)
-(if (>= emacs-major-version 24)
-    (require 'ert)
-  (require 'pre24))
+(require 'ert)
 
 (defmacro bash-completion-test-with-buffer (content &rest body)
   "Create a temporary buffer with CONTENT and execute BODY.
diff --git a/test/pre24.el b/test/pre24.el
deleted file mode 100644
index 240d711967..0000000000
--- a/test/pre24.el
+++ /dev/null
@@ -1,105 +0,0 @@
-;;; pre24.el --- run bash-completion tests under Emacs 22 and 23
-
-;; Copyright (C) 2017 Stephane Zermatten
-
-;; Author: Stephane Zermatten <szermatt@gmx.net>
-
-;; This program is free software: you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License as
-;; published by the Free Software Foundation; either version 2 of the
-;; License, or (at your option) any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-;; General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with this program.  If not, see
-;; `http://www.gnu.org/licenses/'.
-
-
-;;; Commentary:
-;;
-;; This file defines just enough macros and functions to run the
-;; bash-completion tests on Emacs 22 and 23 from the command line, using
-;; run_tests.sh.
-;;
-;; When this is used, the tests are run immediately, as they are
-;; defined. This file isn't meant to be used from an interactive emacs
-;; session.
-;;
-
-;;; Code:
-(require 'cl)
-(require 'dired)
-
-(if (>= emacs-major-version 24)
-    (error "Don't use pre24.el with Emacs 24 or later."))
-
-(defvar pre24-error-count 0
-  "Number of errors encountered by `ert-deftest'.
-
-`ert-run-tests-batch-and-exit' relies on this to exit with the
-appropriate return code.")
-
-(defmacro ert-deftest (name args &rest body)
-  "Run a test and reports the result."
-  `(let ((pre24-test (symbol-name (quote ,name))))
-     (princ (format "%s..." pre24-test))
-     (princ (catch 'pre24-return (prog1 "OK" (progn ,@body))))
-     (princ "\n")))
-
-(defmacro should (&rest body)
-  "Fail the containing `ert-deftest' unless BODY is t."
-  `(unless (progn ,@body)
-     (setq pre24-error-count (1+ pre24-error-count))
-     (throw 'pre24-return
-            (format "FAILED\n  (should %s)\n\n"
-                    (quote ,@body)))))
-
-(defmacro should-not (&rest body)
-  "Fail the containing `ert-deftest' unless BODY is not t."
-  `(when (progn ,@body)
-    (error "Test failed")))
-
-(defun skip-unless (condition)
-  "Skip the test if CONDITION doesn't hold."
-  (unless condition (throw 'pre24-return "SKIP")))
-
-(defmacro cl-letf (definitions &rest body)
-  "Backward-compatibility adapter for cl-letf.
-
-This macro only supports redefining symbol functions."
-  `(flet ,(mapcar
-           (lambda (def)
-             ;; ((symbol-function ',name) (lambda ,args ,func-body))
-             (let ((lhs (car def)) (rhs (cadr def)))
-               (unless (and (eq 'symbol-function (car lhs))
-                            (eq 'quote (car (nth 1 lhs)))
-                            (eq 'lambda (car rhs)))
-                 "Unsupported pattern")
-               (cons (cadr (cadr (car def))) ; name
-                     (cons
-                      (car (cdr (cadr def))) ; args
-                      (cdr (cdr (cadr def))) ; func-body
-                      ))))
-           definitions)
-     ,@body))
-
-
-(defun ert-run-tests-batch-and-exit ()
-  "Exit tests.
-
-Exit status is 1 if at least on test run with `ert-deftest'
-failed."
-  (if (> pre24-error-count 0)
-      (progn
-        (princ "FAIL")
-        (kill-emacs 1)))
-  (progn
-    (princ "PASS\n")
-    (kill-emacs 0)))
-
-(provide 'pre24)
-;;; pre24.el ends here



reply via email to

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