summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Oteiza <mvoteiza@udel.edu>2017-04-08 11:27:17 -0400
committerMark Oteiza <mvoteiza@udel.edu>2017-04-08 11:36:56 -0400
commit1c69215c511789ddcdeab60192087733c521652b (patch)
treeb72d66ab815483d1193403705dae431ef32d4093
parent98bfac68b98e051425c41873edc48f9af5c92361 (diff)
downloademacs-1c69215c511789ddcdeab60192087733c521652b.tar.gz
Replace some uses of cl-member-if with apply
From the mhtml-mode series. Some of the uses of cl-lib are not necessary. * lisp/align.el: Don't require cl-lib. (align-region): Use apply instead of cl-member-if. * lisp/emulation/viper.el: Don't require cl-lib. (viper-mode, this-major-mode-requires-vi-state): Use apply instead of cl-member-if.
-rw-r--r--lisp/align.el5
-rw-r--r--lisp/emulation/viper.el19
2 files changed, 7 insertions, 17 deletions
diff --git a/lisp/align.el b/lisp/align.el
index 102f009a2df..081f587d4b2 100644
--- a/lisp/align.el
+++ b/lisp/align.el
@@ -118,8 +118,6 @@
;;; Code:
-(require 'cl-lib)
-
(defgroup align nil
"Align text to a specific column, by regexp."
:version "21.1"
@@ -1324,8 +1322,7 @@ aligner would have dealt with are."
(modes (assq 'modes rule)))
;; unless the `run-if' form tells us not to, look for the
;; rule..
- (unless (or (and modes (not (cl-member-if #'derived-mode-p
- (eval (cdr modes)))))
+ (unless (or (and modes (not (apply #'derived-mode-p (eval (cdr modes)))))
(and run-if (not (funcall (cdr run-if)))))
(let* ((case-fold-search case-fold-search)
(case-fold (assq 'case-fold rule))
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index 4b4b4be8978..bded174b0d3 100644
--- a/lisp/emulation/viper.el
+++ b/lisp/emulation/viper.el
@@ -14,8 +14,6 @@
;; filed in the Emacs bug reporting system against this file, a copy
;; of the bug report be sent to the maintainer's email address.
-(require 'cl-lib)
-
(defconst viper-version "3.14.2 of July 4, 2013"
"The current version of Viper")
@@ -594,10 +592,8 @@ This startup message appears whenever you load Viper, unless you type `y' now."
))
(viper-set-expert-level 'dont-change-unless)))
- (or (cl-member-if #'derived-mode-p
- viper-emacs-state-mode-list) ; don't switch to Vi
- (cl-member-if #'derived-mode-p
- viper-insert-state-mode-list) ; don't switch
+ (or (apply #'derived-mode-p viper-emacs-state-mode-list) ; don't switch to Vi
+ (apply #'derived-mode-p viper-insert-state-mode-list) ; don't switch
(viper-change-state-to-vi))
))
@@ -609,13 +605,10 @@ This startup message appears whenever you load Viper, unless you type `y' now."
;; Apply a little heuristic to invoke vi state on major-modes
;; that are not listed in viper-vi-state-mode-list
(defun this-major-mode-requires-vi-state (mode)
- (let ((check (lambda (one-mode)
- (provided-mode-derived-p mode one-mode))))
- (cond ((cl-member-if check viper-vi-state-mode-list) t)
- ((cl-member-if check viper-emacs-state-mode-list)
- nil)
- ((cl-member-if check viper-insert-state-mode-list)
- nil)
+ (let ((major-mode mode))
+ (cond ((apply #'derived-mode-p viper-vi-state-mode-list) t)
+ ((apply #'derived-mode-p viper-emacs-state-mode-list) nil)
+ ((apply #'derived-mode-p viper-insert-state-mode-list) nil)
(t (and (eq (key-binding "a") 'self-insert-command)
(eq (key-binding " ") 'self-insert-command))))))