summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2024-11-03 14:37:36 +0100
committerUlrich Müller <ulm@gentoo.org>2024-11-04 19:50:44 +0100
commit409d6f7cc250fe1177d717c5d44bd2cbb07232ce (patch)
tree66aee7f52fd11bc6d3327f211b868316d3f43bb6
parentDelete XEmacs 21.4 compat function for format-time-string (diff)
downloadebuild-mode-409d6f7cc250fe1177d717c5d44bd2cbb07232ce.tar.gz
ebuild-mode-409d6f7cc250fe1177d717c5d44bd2cbb07232ce.tar.bz2
ebuild-mode-409d6f7cc250fe1177d717c5d44bd2cbb07232ce.zip
Delete XEmacs 21.4 compatibility code
* ebuild-mode.el (ebuild-mode-get-completion-function): (ebuild-mode-get-keywords, ebuild-mode-unescape-string): * test/ebuild-mode-tests.el (ebuild-mode-test-unescape-string): Delete XEmacs 21.4 compatibility code. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r--ChangeLog5
-rw-r--r--ebuild-mode.el21
-rw-r--r--test/ebuild-mode-tests.el10
3 files changed, 14 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index 651170e..fb7fa99 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2024-11-03 Ulrich Müller <ulm@gentoo.org>
+ * ebuild-mode.el (ebuild-mode-get-completion-function):
+ (ebuild-mode-get-keywords, ebuild-mode-unescape-string):
+ * test/ebuild-mode-tests.el (ebuild-mode-test-unescape-string):
+ Delete XEmacs 21.4 compatibility code.
+
* ebuild-mode.el (ebuild-mode-time-string): Delete compatibility
function for XEmacs 21.4.
(ebuild-mode-update-copyright, ebuild-mode-insert-skeleton)
diff --git a/ebuild-mode.el b/ebuild-mode.el
index 520b9a6..b6744c6 100644
--- a/ebuild-mode.el
+++ b/ebuild-mode.el
@@ -338,7 +338,6 @@ of the elements."
(defun ebuild-mode-delete-trailing-whitespace ()
"Delete all the trailing spaces and tabs across the current buffer."
;; Simple non-interactive version of delete-trailing-whitespace
- ;; which doesn't exist in XEmacs
(save-excursion
(goto-char (point-min))
(while (re-search-forward "[ \t]+$" nil t)
@@ -481,12 +480,7 @@ must be non-nil for this to have any effect."
"Get completion function for completion mode MODE."
(cond ((null mode) #'try-completion)
((eq mode t) #'all-completions)
- ((eq mode 'lambda)
- (static-if (fboundp 'test-completion)
- #'test-completion
- ;; XEmacs 21.4 doesn't have test-completion
- (lambda (&rest args)
- (eq (apply #'try-completion args) t))))
+ ((eq mode 'lambda) #'test-completion)
(t #'ignore)))
(defun ebuild-mode-ebuild-cmd-complete (s predicate mode)
@@ -626,12 +620,8 @@ the output of the \"declare -p\" Bash command."
(while (setq i (string-match re s i))
(let* ((m (match-string 1 s))
(c (aref m 0))
- (byte (cond ((and (>= c ?0) (< c ?8))
- ;; no string-to-number with base in XEmacs 21.4
- (let ((n 0))
- (dotimes (j (length m))
- (setq n (+ (* n 8) (- (aref m j) ?0))))
- (logand n #xff)))
+ (byte (cond ((<= ?0 c ?7)
+ (logand (string-to-number m 8) #xff))
((cdr (assq c map)))
(t c))))
(setq s (replace-match
@@ -712,10 +702,7 @@ optional argument NOERROR is non-nil."
(mapcar (lambda (s)
(string-match "^\\([-~]?\\)\\(.*\\)" s)
(cons (match-string 2 s) (match-string 1 s)))
- (split-string
- ;;(match-string-no-properties 1) ; not in XEmacs 21.4
- (buffer-substring-no-properties (match-beginning 1)
- (match-end 1)))))))))
+ (split-string (match-string-no-properties 1))))))))
(defun ebuild-mode-put-keywords (kw &optional noerror)
"Replace the ebuild's KEYWORDS by those given in the string KW.
diff --git a/test/ebuild-mode-tests.el b/test/ebuild-mode-tests.el
index c88a990..1a7db49 100644
--- a/test/ebuild-mode-tests.el
+++ b/test/ebuild-mode-tests.el
@@ -163,11 +163,11 @@
(should (string-equal
(ebuild-mode-unescape-string "äöü" 'ansi-c)
"äöü"))
- (let ((s (ebuild-mode-unescape-string "\\360\\237\\221\\215" 'ansi-c)))
- (if (or (not (featurep 'xemacs))
- (emacs-version>= 21 5))
- (setq s (decode-coding-string s 'utf-8-unix)))
- (should (string-equal s "👍"))))
+ (should (string-equal
+ (decode-coding-string
+ (ebuild-mode-unescape-string "\\360\\237\\221\\215" 'ansi-c)
+ 'utf-8-unix)
+ "👍")))
(ert-deftest ebuild-mode-test-get-keywords ()
(with-temp-buffer