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

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

[elpa] externals/ergoemacs-mode 825d6e9d58 1/4: Some emacs 24 backward c


From: ELPA Syncer
Subject: [elpa] externals/ergoemacs-mode 825d6e9d58 1/4: Some emacs 24 backward compatibility changes
Date: Mon, 9 Jan 2023 13:57:51 -0500 (EST)

branch: externals/ergoemacs-mode
commit 825d6e9d58983ff22c445ab951641911ee3587e6
Author: Matthew Fidler <matthew.fidler@gmail.com>
Commit: Matthew Fidler <matthew.fidler@gmail.com>

    Some emacs 24 backward compatibility changes
---
 ergoemacs-cua.el       | 12 ++++++++++--
 ergoemacs-functions.el |  4 ++--
 ergoemacs-mode.el      |  2 +-
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/ergoemacs-cua.el b/ergoemacs-cua.el
index 7d23aa06e5..20cfa16591 100644
--- a/ergoemacs-cua.el
+++ b/ergoemacs-cua.el
@@ -186,6 +186,13 @@ This override is enabled for active regions before the 
copy and paste are enable
       (setq overriding-terminal-local-map nil))
     (ergoemacs--select-keymaps)))
 
+(defun ergoemacs-prefix-command-preserve-state (arg)
+  "Compatibility layer for `prefix-command-preserve-state'."
+  (if (fboundp 'prefix-command-preserve-state)
+      (prefix-command-preserve-state)
+    (setq prefix-arg current-prefix-arg)
+    (reset-this-command-lengths)))
+
 (defun ergoemacs--prefix-override-replay (repeat)
   "This replays the events from the intial key press.
 
@@ -212,7 +219,8 @@ REPEAT is the flag that tells it if is repeated 
environmennt."
     ;; This should make it so that exchange-point-and-mark gets the prefix when
     ;; you do C-u C-x C-x C-x work (where the C-u is properly passed to the C-x
     ;; C-x binding after the first C-x C-x was rewritten to just C-x).
-    (prefix-command-preserve-state)
+    (ergoemacs-prefix-command-preserve-state)
+    
     ;; Push the key back on the event queue
     (setq unread-command-events (cons (cons 'no-record key)
                                       unread-command-events))))
@@ -296,7 +304,7 @@ PREFIX is the key prefix that is being sent for these keys."
   ;; This should make it so that exchange-point-and-mark gets the prefix when
   ;; you do C-u S-C-x C-x work (where the C-u is properly passed to the C-x
   ;; C-x binding after the first S-C-x was rewritten to just C-x).
-  (prefix-command-preserve-state)
+  (ergoemacs-prefix-command-preserve-state)
   ;; Activate the cua--prefix-repeat-keymap
   (setq ergoemacs--prefix-override-timer 'shift)
   ;; Push duplicate keys back on the event queue
diff --git a/ergoemacs-functions.el b/ergoemacs-functions.el
index 71a7c163fc..cec7d7e34a 100644
--- a/ergoemacs-functions.el
+++ b/ergoemacs-functions.el
@@ -112,7 +112,7 @@ KEY3 is the optional third key in the sequence."
   (setq ergoemacs--temporary-disable t
         this-command last-command)
   ;; Restore the prefix arg
-  (prefix-command-preserve-state)
+  (ergoemacs-prefix-command-preserve-state)
   ;; Push the key back on the event queue
   (when key3
     (setq unread-command-events (cons (cons 'no-record key3)
@@ -2032,7 +2032,7 @@ initial pair in the unread command events."
         (setq last-input-event tmp)
         (setq prefix-arg current-prefix-arg)
         (setq unread-command-events (append (listify-key-sequence tmp) 
unread-command-events))
-        (prefix-command-preserve-state))
+        (ergoemacs-prefix-command-preserve-state))
     (if (region-active-p)
         (let ((p1 (region-beginning))
               (p2 (region-end)))
diff --git a/ergoemacs-mode.el b/ergoemacs-mode.el
index 4ca2b45a25..24b0704979 100644
--- a/ergoemacs-mode.el
+++ b/ergoemacs-mode.el
@@ -10,7 +10,7 @@
 ;; Created: August 01 2007
 ;; Keywords: convenience
 ;; Version: 5.16.10.12
-;; Package-Requires: ((emacs "24.1") (cl-lib "0.5"))
+;; Package-Requires: ((emacs "24.1") (cl-lib "0.5") ("nadvice"))
 ;; URL: https://github.com/ergoemacs/ergoemacs-mode
 
 ;; ErgoEmacs is free software: you can redistribute it and/or modify



reply via email to

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