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

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

[elpa] externals/ergoemacs-mode 19fea7e 77/87: Fix byte compile of ergoe


From: Stefan Monnier
Subject: [elpa] externals/ergoemacs-mode 19fea7e 77/87: Fix byte compile of ergoemacs-command-loop
Date: Wed, 14 Apr 2021 18:47:12 -0400 (EDT)

branch: externals/ergoemacs-mode
commit 19fea7ee63683ef9dd9ffb1b70221f187c38d994
Author: Matthew Fidler <514778+mattfidler@users.noreply.github.com>
Commit: Matthew Fidler <514778+mattfidler@users.noreply.github.com>

    Fix byte compile of ergoemacs-command-loop
---
 ergoemacs-command-loop.el | 18 ++++++++++--------
 ergoemacs-macros.el       |  8 ++------
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/ergoemacs-command-loop.el b/ergoemacs-command-loop.el
index e6f9f8e..a97e59c 100644
--- a/ergoemacs-command-loop.el
+++ b/ergoemacs-command-loop.el
@@ -1,5 +1,4 @@
 ;;; ergoemacs-command-loop.el --- Keyboard translation functions -*- 
lexical-binding: t -*-
-
 ;; Copyright © 2013-2016  Free Software Foundation, Inc.
 
 ;; Filename: ergoemacs-command-loop.el
@@ -219,13 +218,17 @@ Returns the mode-line text."
        (ergoemacs-mode-line)
        nil)))))
 
+(defun ergoemacs-command-loop--match-buffer-name-p (reg)
+  "Determine if the REG is found in `buffer-name'."
+  (and (stringp (buffer-name))
+       (string-match reg (buffer-name))))
+
 (defun ergoemacs-command-loop--modal-p ()
   "Determine if the command should be modal.
 If so return the translation."
   (if (not ergoemacs-command-loop--modal-stack) nil
     (let* ((translation (nth 0 ergoemacs-command-loop--modal-stack))
            (always)
-          tmp
            ret)
       (when (ergoemacs-translation-struct-p translation)
         (setq always (ergoemacs-translation-struct-modal-always translation))
@@ -237,8 +240,8 @@ If so return the translation."
          ((and (not always)
                (catch 'match-modal
                  (dolist (reg ergoemacs-modal-ignored-buffers)
-                   ((when (and (setq tmp (buffer-name)) (stringp tmp) 
(string-match reg tmp))
-                     (throw 'match-modal t))))
+                   (when (ergoemacs-command-loop--match-buffer-name-p reg)
+                     (throw 'match-modal t)))
                  nil)))
          (t
           (setq ret translation))))
@@ -808,8 +811,7 @@ KEYS is the keys information"
 
 (defun ergoemacs-command--echo-prefix ()
   "Echos prefix keys in the ergoemacs-mode way."
-  (let ((keys (this-single-command-keys))
-       ret timeout)
+  (let ((keys (this-single-command-keys)))
     (when (and ergoemacs-command--timeout-timer
               (not (equal keys ergoemacs-command--timeout-keys)))
       (cancel-timer ergoemacs-command--timeout-timer)
@@ -817,8 +819,8 @@ KEYS is the keys information"
            ergoemacs-command--timeout-timer nil))
     (unless (or (equal [] keys)
                (ergoemacs-command-loop-p))
-      (when (ergoemacs-keymapp (setq ret (key-binding keys)))
-       (when (setq timeout (key-binding (vconcat keys [ergoemacs-timeout])))
+      (when (ergoemacs-keymapp (key-binding keys))
+       (when (key-binding (vconcat keys [ergoemacs-timeout]))
          (cond
           ((eq ergoemacs-handle-ctl-c-or-ctl-x 'only-copy-cut) 
            (push 'ergoemacs-timeout unread-command-events))
diff --git a/ergoemacs-macros.el b/ergoemacs-macros.el
index 4cb1dda..b2f9d4a 100644
--- a/ergoemacs-macros.el
+++ b/ergoemacs-macros.el
@@ -853,17 +853,13 @@ When arg1 can be a property.  The following properties 
are supported:
         (arg4 (nth 3 args)))
     (cond
      ((and arg1 (symbolp arg1) (eq arg1 :reset-prefix))
-      (if (>= 25 emacs-major-version)
+      (if (<= 25 emacs-major-version)
          `(prefix-command-preserve-state)
        `(reset-this-command-lengths)))
      ((and arg1 (symbolp arg1) (eq arg1 :set-selection))
-      (if (>= 25 emacs-major-version)
+      (if (<= 25 emacs-major-version)
           `(gui-set-selection ,@(cdr args))
         `(x-set-selection ,@(cdr args))))
-     ((and arg1 (symbolp arg1) (eq arg1 :set-selection))
-      (if (>= 25 emacs-major-version)
-         `(gui-set-selection ,@(cdr args))
-       `(x-set-selection ,@(cdr args))))
      ((and arg1 (symbolp arg1) (eq arg1 :width))
       `(ergoemacs-mode--eval-width ,arg2))
      ((and arg1 (symbolp arg1) (eq arg1 :mode-if) arg2)



reply via email to

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