Skip to content

Commit

Permalink
Specify minimum emacs version (#787)
Browse files Browse the repository at this point in the history
cl-lib has been bundled since Emacs 24.3.

And replace mozc-string-match-p with string-match-p. string-match-p was
introduced at version 23. And inhibit-changing-match-data is obsoleted
from Emacs 29.1.

PiperOrigin-RevId: 554502964
  • Loading branch information
syohex authored Aug 7, 2023
1 parent 267fda2 commit 9a925ee
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/unix/emacs/mozc.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
;; Copyright 2010-2021, Google Inc. All rights reserved.

;; Keywords: mule, multilingual, input method
;; Package-Requires: ((emacs "24.3"))

;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -1689,8 +1690,8 @@ A returned object is alist on success. Otherwise, an error symbol."
(condition-case nil
(let ((obj-index
(read-from-string response))) ; may signal end-of-file.
(if (mozc-string-match-p "^[ \t\n\v\f\r]*$"
(substring response (cdr obj-index)))
(if (string-match-p "^[ \t\n\v\f\r]*$"
(substring response (cdr obj-index)))
;; Only white spaces remain.
(car obj-index)
;; Unexpected characters remain at the end.
Expand Down Expand Up @@ -1753,16 +1754,6 @@ and LIST. The default value of N is 1."
(setcdr pre-boundary nil) ; Drop the rest of list.
(cons list post-boundary))))

(defun mozc-string-match-p (regexp string &optional start)
"Same as `string-match' except this function never change the match data.
REGEXP, STRING and optional START are the same as for `string-match'.
This function is equivalent to `string-match-p', which is available since
Emacs 23."
(let ((inhibit-changing-match-data t))
(string-match regexp string start)))



;;;; Custom keymap

Expand Down

0 comments on commit 9a925ee

Please sign in to comment.