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

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

[elpa] externals/ergoemacs-mode 676cd84 160/325: Fix infinite recursion


From: Stefan Monnier
Subject: [elpa] externals/ergoemacs-mode 676cd84 160/325: Fix infinite recursion in ergoemacs-compact-uncompact-block
Date: Sat, 23 Oct 2021 18:48:44 -0400 (EDT)

branch: externals/ergoemacs-mode
commit 676cd84bc1c1dac558a429e4babf8e262d87bdfa
Author: Walter Landry <wlandry@caltech.edu>
Commit: Walter Landry <wlandry@caltech.edu>

    Fix infinite recursion in ergoemacs-compact-uncompact-block
---
 ergoemacs-functions.el | 37 +++++++++++++++++++------------------
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git a/ergoemacs-functions.el b/ergoemacs-functions.el
index fe62d80..39f9545 100644
--- a/ergoemacs-functions.el
+++ b/ergoemacs-functions.el
@@ -1147,7 +1147,7 @@ See also: `ergoemacs-compact-uncompact-block'"
   (interactive)
   (let ((fill-column 90002000))
     (setq current-prefix-arg nil);; Fill paragraph is bound it M-q.
-    (ergoemacs :remap 'fill-paragraph)))
+    (fill-paragraph)))
 
 (defun ergoemacs-unfill-region (start end)
   "Replace newline char in region by space.
@@ -1163,25 +1163,26 @@ This command is similar to a toggle of `fill-paragraph'.
 When there is a text selection, act on the region."
   (interactive)
   ;; This command symbol has a property ā€œ'stateIsCompact-pā€.
-  (let (current-state-is-compact (big-fill-column-val 4333999) 
(deactivate-mark nil))
-    
-    (save-excursion
-      ;; Determine whether the text is currently compact.
-      (setq current-state-is-compact
-            (if (eq last-command this-command)
-                (get this-command 'state-is-compact-p)
-              (if (> (- (line-end-position) (line-beginning-position)) 
fill-column) t nil) ) )
-      
-      (if (region-active-p)
-          (if current-state-is-compact
-              (fill-region (region-beginning) (region-end))
-            (let ((fill-column big-fill-column-val))
-              (fill-region (region-beginning) (region-end))) )
+  (let (current-state-is-compact
+        (big-fill-column-val 4333999)
+        (deactivate-mark nil))
+    (setq current-state-is-compact
+          (if (> (- (line-end-position) (line-beginning-position)) fill-column)
+              t
+            nil
+            )
+          )
+    (if (region-active-p)
         (if current-state-is-compact
-            (ergoemacs :remap 'fill-paragraph)
+            (fill-region (region-beginning) (region-end))
           (let ((fill-column big-fill-column-val))
-            (ergoemacs :remap 'fill-paragraph))))
-      (put this-command 'stateIsCompact-p (if current-state-is-compact nil 
t)))))
+            (fill-region (region-beginning) (region-end))) )
+      (if current-state-is-compact
+          (fill-paragraph)
+        (let ((fill-column big-fill-column-val))
+          (fill-paragraph))))
+    )
+  )
 
 (defun ergoemacs-top-join-line ()
   "Join the current line with the line beneath it."



reply via email to

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