Subject: [PATCH] gnu: emacs-rime: Emit deprecation warning.

From: Hilton Chain <[email-masked]>
Date: Thu, 22 Sep 2022 12:58:38 +0800

* gnu/packages/patches/emacs-rime-update-define-minor-mode-usage.patch: New
file.
* gnu/local.mk (dist_patch_DATA): Add patch.
* gnu/packages/emacs-xyz.scm (emacs-rime)[patches]: Add
emacs-rime-update-define-minor-mode-usage.patch
---
 gnu/local.mk                                  |  1 +
 gnu/packages/emacs-xyz.scm                    |  6 ++-
 ...-rime-update-define-minor-mode-usage.patch | 38 +++++++++++++++++++
 3 files changed, 44 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/emacs-rime-update-define-minor-mode-usage.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index ef1bae5f3c..82e980a272 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1051,6 +1051,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/emacs-libgit-use-system-libgit2.patch    \
   %D%/packages/patches/emacs-lispy-fix-thread-last-test.patch   \
   %D%/packages/patches/emacs-polymode-fix-lexical-variable-error.patch  \
+  %D%/packages/patches/emacs-rime-update-define-minor-mode-usage.patch	\
   %D%/packages/patches/emacs-source-date-epoch.patch		\
   %D%/packages/patches/emacs-telega-path-placeholder.patch	\
   %D%/packages/patches/emacs-telega-test-env.patch		\
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 32e4c33f16..5811fb410a 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -29523,7 +29523,11 @@ (define-public emacs-rime
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0z0iwsqr92g8ykxb51gkawwxwzx0faw0027zgdi7c38ngjqld237"))))
+        (base32 "0z0iwsqr92g8ykxb51gkawwxwzx0faw0027zgdi7c38ngjqld237"))
+       (patches
+        (search-patches
+         ;; NOTE: Cherry-picked from upstream, remove when bumping.
+         "emacs-rime-update-define-minor-mode-usage.patch"))))
     (build-system emacs-build-system)
     (arguments
      '(#:include (cons "\\.so$" %default-include)
diff --git a/gnu/packages/patches/emacs-rime-update-define-minor-mode-usage.patch b/gnu/packages/patches/emacs-rime-update-define-minor-mode-usage.patch
new file mode 100644
index 0000000000..4f905ca0bf
--- /dev/null
+++ b/gnu/packages/patches/emacs-rime-update-define-minor-mode-usage.patch
@@ -0,0 +1,38 @@
+From 5c2ade217134f6f20cd405447af20825e5b44513 Mon Sep 17 00:00:00 2001
+From: tianshu <[email-masked]>
+Date: Sat, 11 Dec 2021 02:06:35 +0800
+Subject: [PATCH] update define-minor-mode usage
+
+---
+ rime.el | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/rime.el b/rime.el
+index 64a4d70..044ab97 100644
+--- a/rime.el
++++ b/rime.el
+@@ -1084,18 +1084,18 @@ Argument NAME ignored."
+   "Mode used in composition.
+ 
+ Should not be enabled manually."
+-  nil
+-  nil
+-  nil
++  :lighter nil
++  :init-value nil
++  :keymap nil
+   (if rime-active-mode
+       (rime-active-mode--init)
+     (rime-active-mode--uninit)))
+ 
+ (define-minor-mode rime-mode
+   "Mode used when input method is activated."
+-  nil
+-  nil
+-  rime-mode-map)
++  :lighter nil
++  :init-value nil
++  :keymap rime-mode-map)
+ 
+ ;;;###autoload
+ (register-input-method "rime" "euc-cn" 'rime-activate rime-title)

base-commit: 33d4992b69bfed2ec6b15b7b842599efb1cb1e31
-- 
2.37.3