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

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

[nongnu] elpa/bash-completion e35943f37e 299/313: Fix backward-compatibi


From: ELPA Syncer
Subject: [nongnu] elpa/bash-completion e35943f37e 299/313: Fix backward-compatibility issue on 24.3: avoid using alist-get.
Date: Sat, 3 Dec 2022 10:59:39 -0500 (EST)

branch: elpa/bash-completion
commit e35943f37efb540fdce60dfbd17ac4aaaa32a0f3
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>

    Fix backward-compatibility issue on 24.3: avoid using alist-get.
---
 bash-completion.el | 39 ++++++++++++++++++---------------------
 1 file changed, 18 insertions(+), 21 deletions(-)

diff --git a/bash-completion.el b/bash-completion.el
index d177025501..0878bd1a8f 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -1509,10 +1509,9 @@ Return the status code of the command, as a number."
       (erase-buffer)
       (funcall send-string process complete-command)
       (unless (bash-completion--wait-for-regexp process "\t-?[[:digit:]]+\v" 
timeout)
-        (setf (alist-get 'error bash-completion--debug-info)
-              "timeout")
-        (setf (alist-get 'buffer-string bash-completion--debug-info)
-              (buffer-substring-no-properties (point-min) (point-max)))
+        (push (cons 'error "timeout") bash-completion--debug-info)
+        (push (cons 'buffer-string (buffer-substring-no-properties (point-min) 
(point-max)))
+              bash-completion--debug-info)
         (error "Bash completion failed. M-x bash-completion-debug for 
details."))
       (when pre-command
         ;; Detect the command having been echoed and remove it
@@ -1525,10 +1524,8 @@ Return the status code of the command, as a number."
                            (1+ (point))
                            (1- (line-end-position)))))
             (wrapped-status (bash-completion--parse-side-channel-data 
"wrapped-status")))
-        (setf (alist-get 'status bash-completion--debug-info)
-              status)
-        (setf (alist-get 'wrapped-status bash-completion--debug-info)
-              wrapped-status)
+        (push (cons 'status status) bash-completion--debug-info)
+        (push (cons 'wrapped-status wrapped-status) 
bash-completion--debug-info)
         (delete-region (point) (point-max))
         (if (string= "124" wrapped-status)
             124
@@ -1550,42 +1547,42 @@ Return the status code of the command, as a number."
     (let ((debug-info bash-completion--debug-info))
       (princ "command line:<<EOF")
       (terpri)
-      (princ (alist-get 'commandline debug-info))
+      (princ (cdr (assq 'commandline debug-info)))
       (princ "EOF")
       (terpri)
       (terpri)
-      (when (alist-get 'error debug-info)
+      (when (cdr (assq 'error debug-info))
         (princ "error: ")
-        (print (alist-get 'error debug-info))
+        (print (cdr (assq 'error debug-info)))
         (terpri)
         (princ "captured output:<<EOF")
         (terpri)
-        (princ (alist-get 'buffer-string debug-info))
+        (princ (cdr (assq 'buffer-string debug-info)))
         (princ "EOF")
         (terpri)
         (terpri))
-      (when (alist-get 'status debug-info)
+      (when (cdr (assq 'status debug-info))
         (princ "status: ")
-        (print (alist-get 'status debug-info))
-        (when (alist-get 'wrapped-status debug-info)
+        (print (cdr (assq 'status debug-info)))
+        (when (cdr (assq 'wrapped-status debug-info))
           (princ "wrapped-status: ")
-          (print (alist-get 'wrapped-status debug-info)))
+          (print (cdr (assq 'wrapped-status debug-info))))
         (terpri))
       (princ "output-buffer:<<EOF")
       (terpri)
       (princ (with-current-buffer (bash-completion--get-buffer
-                                   (alist-get 'process debug-info))
+                                   (cdr (assq 'process debug-info)))
                (buffer-substring-no-properties (point-min) (point-max))))
       (princ "EOF")
       (terpri)
       (terpri)
 
-      (let ((process (alist-get 'process debug-info)))
+      (let ((process (cdr (assq 'process debug-info))))
         (princ "process: ")
         (print process)
         (terpri)
         (princ "use-separate-process: ")
-        (print (alist-get 'separate debug-info))
+        (print (cdr (assq 'separate debug-info)))
         (terpri)
         (princ "bash-major-version:")
         (print (process-get process 'bash-major-version))
@@ -1597,9 +1594,9 @@ Return the status code of the command, as a number."
         (princ "completion-ignore-case:")
         (print (process-get process 'completion-ignore-case))
         (terpri)
-        (when (alist-get 'context debug-info)
+        (when (cdr (assq 'context debug-info))
           (princ "debug-context:\n")
-          (pp (alist-get 'context debug-info))
+          (pp (cdr (assq 'context debug-info)))
           (terpri))
         (princ "complete-p:\n")
         (pp (process-get process 'complete-p))



reply via email to

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