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

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

[elpa] externals/latex-table-wizard 02ddb6e01c 41/70: Fix bug occurring


From: ELPA Syncer
Subject: [elpa] externals/latex-table-wizard 02ddb6e01c 41/70: Fix bug occurring when in Emacs 27
Date: Sat, 13 May 2023 08:59:13 -0400 (EDT)

branch: externals/latex-table-wizard
commit 02ddb6e01c68276172e33ef81ef7dd8f60c0778e
Author: Enrico Flor <nericoflor@gmail.com>
Commit: Enrico Flor <nericoflor@gmail.com>

    Fix bug occurring when in Emacs 27
    
    When sorting the table, return the result of sorting a copy of the
    table instead of the table itself.  If you sort the table itself then
    the list is destructively modified so that only the car of the
    original list is left.
---
 latex-table-wizard.el | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/latex-table-wizard.el b/latex-table-wizard.el
index 410bb37c50..12a3802748 100644
--- a/latex-table-wizard.el
+++ b/latex-table-wizard.el
@@ -5,7 +5,7 @@
 ;; Author: Enrico Flor <enrico@eflor.net>
 ;; Maintainer: Enrico Flor <enrico@eflor.net>
 ;; URL: https://github.com/enricoflor/latex-table-wizard
-;; Version: 1.0.2
+;; Version: 1.0.3
 ;; Keywords: convenience
 
 ;; Package-Requires: ((emacs "27.1") (auctex "12.1") (transient "0.3.7"))
@@ -488,21 +488,22 @@ F, C precedes D and so on; and if DIR is either 
\\='next\\=' or
          (prop (if vert :row :column))
          (thing (if vert
                     (latex-table-wizard--get-thing 'column table)
-                  (latex-table-wizard--get-thing 'row table))))
+                  (latex-table-wizard--get-thing 'row table)))
+         (copy-table (copy-sequence table)))
     (if (not same-line)
-        (sort table (lambda (x y)
-                      (let ((rows `(,(plist-get x :row)
-                                    ,(plist-get y :row)))
-                            (cols `(,(plist-get x :column)
-                                    ,(plist-get y :column))))
-                        (cond ((and vert (apply #'= cols))
-                               (apply #'< rows))
-                              (vert
-                               (apply #'< cols))
-                              ((apply #'= rows)
-                               (apply #'< cols))
-                              (t
-                               (apply #'< rows))))))
+        (sort copy-table (lambda (x y)
+                           (let ((rows `(,(plist-get x :row)
+                                         ,(plist-get y :row)))
+                                 (cols `(,(plist-get x :column)
+                                         ,(plist-get y :column))))
+                             (cond ((and vert (apply #'= cols))
+                                    (apply #'< rows))
+                                   (vert
+                                    (apply #'< cols))
+                                   ((apply #'= rows)
+                                    (apply #'< cols))
+                                   (t
+                                    (apply #'< rows))))))
       (sort thing (lambda (x y) (< (plist-get x prop)
                                    (plist-get y prop)))))))
 



reply via email to

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