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

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

[elpa] externals/consult eda8dbd1a7 3/3: Untabify


From: ELPA Syncer
Subject: [elpa] externals/consult eda8dbd1a7 3/3: Untabify
Date: Mon, 10 Jan 2022 22:57:22 -0500 (EST)

branch: externals/consult
commit eda8dbd1a78547fe86e611fe02558e63b57dcf45
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Untabify
---
 consult.el | 96 +++++++++++++++++++++++++++++++-------------------------------
 1 file changed, 48 insertions(+), 48 deletions(-)

diff --git a/consult.el b/consult.el
index a0d4ab9bf5..590d0fcaa0 100644
--- a/consult.el
+++ b/consult.el
@@ -2250,8 +2250,8 @@ of functions and in `consult-completion-in-region'."
               ;; completed in a different buffer than the original buffer. 
This completion is
               ;; probably also problematic in my Corfu completion package.
               (not (eq (window-buffer) (current-buffer)))
-             (and (markerp start) (not (eq (marker-buffer start) 
(current-buffer))))
-             (and (markerp end) (not (eq (marker-buffer end) 
(current-buffer)))))
+              (and (markerp start) (not (eq (marker-buffer start) 
(current-buffer))))
+              (and (markerp end) (not (eq (marker-buffer end) 
(current-buffer)))))
     (let (ov)
       (lambda (cand restore)
         (if restore
@@ -2315,8 +2315,8 @@ These configuration options are supported:
                 completion-extra-properties)))
     ;; error if `threshold' is t or the improper list `all' is too short
     (if (and threshold
-            (or (not (consp (ignore-errors (nthcdr threshold all))))
-                (and completion-cycling completion-all-sorted-completions)))
+             (or (not (consp (ignore-errors (nthcdr threshold all))))
+                 (and completion-cycling completion-all-sorted-completions)))
         (completion--in-region start end collection predicate)
       (let* ((limit (car (completion-boundaries initial collection predicate 
"")))
              (category (completion-metadata-get metadata 'category))
@@ -2890,10 +2890,10 @@ QUERY can be set to a plist according to 
`consult--buffer-query'."
           ;; Use the same behavior as `keep-lines'.
           (let ((rbeg (region-beginning))
                 (rend (save-excursion
-                       (goto-char (region-end))
-                       (unless (or (bolp) (eobp))
-                         (forward-line 0))
-                       (point))))
+                        (goto-char (region-end))
+                        (unless (or (bolp) (eobp))
+                          (forward-line 0))
+                        (point))))
             (consult--fontify-region rbeg rend)
             (narrow-to-region rbeg rend)
             (consult--each-line beg end
@@ -3006,64 +3006,64 @@ INITIAL is the initial input."
            ;; Behave the same as `keep-lines'.
            ;; Move to the next line.
            (save-excursion
-            (goto-char (region-end))
-            (unless (or (bolp) (eobp))
-              (forward-line 0))
-            (point))))
+             (goto-char (region-end))
+             (unless (or (bolp) (eobp))
+               (forward-line 0))
+             (point))))
         (setq pt-orig (point) pt-min (point-min) pt-max (point-max))
         (let ((i 0))
-         (consult--each-line beg end
-           (let ((line (if (eq beg end) (char-to-string ?\n)
-                         (buffer-substring-no-properties beg end))))
+          (consult--each-line beg end
+            (let ((line (if (eq beg end) (char-to-string ?\n)
+                          (buffer-substring-no-properties beg end))))
               (put-text-property 0 1 'line `(,(cl-incf i) ,beg . ,end) line)
-             (push line lines)))
-         (setq lines (nreverse lines)))))
+              (push line lines)))
+          (setq lines (nreverse lines)))))
     (lambda (input restore)
       ;; New input provided -> Update
       (when (and input (not (equal input last-input)))
-       (mapc #'delete-overlay overlays)
-       (setq last-input input overlays nil)
-       (unless (string-match-p "\\`!? ?\\'" input) ;; empty input.
-         (let* ((not (string-prefix-p "! " input))
+        (mapc #'delete-overlay overlays)
+        (setq last-input input overlays nil)
+        (unless (string-match-p "\\`!? ?\\'" input) ;; empty input.
+          (let* ((not (string-prefix-p "! " input))
                  (stripped (string-remove-prefix "! " input))
-                ;; Heavy computation is interruptible if *not* committing!
-                (matches (if restore
-                             (funcall filter stripped lines)
-                           (while-no-input (funcall filter stripped lines))))
-                (old-ind 0)
-                (block-beg pt-min)
+                 ;; Heavy computation is interruptible if *not* committing!
+                 (matches (if restore
+                              (funcall filter stripped lines)
+                            (while-no-input (funcall filter stripped lines))))
+                 (old-ind 0)
+                 (block-beg pt-min)
                  (block-end pt-min))
-           (unless (eq matches t)      ;; input arrived
+            (unless (eq matches t)      ;; input arrived
               (while (< block-end pt-max)
-               (pcase-let ((`(,ind ,beg . ,end)
+                (pcase-let ((`(,ind ,beg . ,end)
                              (if matches
                                  (get-text-property 0 'line (pop matches))
                                `(,most-positive-fixnum ,pt-max . ,pt-max))))
-                 (when (/= ind (1+ old-ind))
+                  (when (/= ind (1+ old-ind))
                     (let ((a (if not block-beg block-end))
                           (b (if not block-end beg)))
                       (when (/= a b)
-                       (push (consult--overlay a b 'invisible t) overlays)))
+                        (push (consult--overlay a b 'invisible t) overlays)))
                     (setq block-beg beg))
-                 (setq block-end (1+ end) old-ind ind)))))))
+                  (setq block-end (1+ end) old-ind ind)))))))
       (when restore
-       (cond
-        ((not input)
-         (mapc #'delete-overlay overlays)
-         (goto-char pt-orig))
-        ((equal input "")
-         (consult-focus-lines 'show)
-         (goto-char pt-orig))
-        (t
-         ;; Sucessfully terminated -> Remember invisible overlays
-         (setq consult--focus-lines-overlays
+        (cond
+         ((not input)
+          (mapc #'delete-overlay overlays)
+          (goto-char pt-orig))
+         ((equal input "")
+          (consult-focus-lines 'show)
+          (goto-char pt-orig))
+         (t
+          ;; Sucessfully terminated -> Remember invisible overlays
+          (setq consult--focus-lines-overlays
                 (nconc consult--focus-lines-overlays overlays))
           ;; move point past invisible
-         (goto-char (if-let (ov (and (invisible-p pt-orig)
+          (goto-char (if-let (ov (and (invisible-p pt-orig)
                                       (seq-find (lambda (ov) (overlay-get ov 
'invisible))
                                                 (overlays-at pt-orig))))
-                        (overlay-end ov)
-                      pt-orig))))))))
+                         (overlay-end ov)
+                       pt-orig))))))))
 
 ;;;###autoload
 (defun consult-focus-lines (&optional show filter initial)
@@ -3512,8 +3512,8 @@ This command can act as a drop-in replacement for 
`repeat-complex-command'."
     ;; Taken from `repeat-complex-command'
     (add-to-history 'command-history cmd)
     (apply #'funcall-interactively
-          (car cmd)
-          (mapcar (lambda (e) (eval e t)) (cdr cmd)))))
+           (car cmd)
+           (mapcar (lambda (e) (eval e t)) (cdr cmd)))))
 
 ;;;;; Command: consult-history
 
@@ -3840,7 +3840,7 @@ QUERY is passed to `consult--buffer-query'."
                   (if (= count 1) "" "s")
                   (cond
                    ((and ndir (eq dir 'project))
-                   (format ", Project %s" (consult--project-name ndir)))
+                    (format ", Project %s" (consult--project-name ndir)))
                    (ndir (concat  ", " (consult--abbreviate-directory ndir)))
                    (t "")))
           buffers)))



reply via email to

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