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

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

[elpa] externals/consult b27ea3e793 2/3: Indentation


From: ELPA Syncer
Subject: [elpa] externals/consult b27ea3e793 2/3: Indentation
Date: Wed, 19 Oct 2022 04:57:33 -0400 (EDT)

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

    Indentation
---
 consult.el | 94 +++++++++++++++++++++++++++++++-------------------------------
 1 file changed, 47 insertions(+), 47 deletions(-)

diff --git a/consult.el b/consult.el
index ec9287b435..1726a128a4 100644
--- a/consult.el
+++ b/consult.el
@@ -1421,30 +1421,30 @@ The function can be used as the `:state' argument of 
`consult--read'."
                 (set-buffer saved-buffer)
                 (narrow-to-region saved-min saved-max)
                 (goto-char saved-pos)))
-            ;; Handle positions with overlay information
-            (consult--jump-1 (or (car-safe cand) cand))
-            (setq invisible (consult--invisible-open-temporarily)
-                  overlays
-                  (list (save-excursion
-                          (let ((vbeg (progn (beginning-of-visual-line) 
(point)))
-                                (vend (progn (end-of-visual-line) (point)))
-                                (end (line-end-position)))
-                            (consult--overlay vbeg (if (= vend end) (1+ end) 
vend)
-                                              'face 'consult-preview-line
-                                              'window (selected-window)
-                                              'priority 1)))
-                        (consult--overlay (point) (1+ (point))
-                                          'face 'consult-preview-cursor
-                                          'window (selected-window)
-                                          'priority 3)))
-            (dolist (match (cdr-safe cand))
-              (push (consult--overlay (+ (point) (car match))
-                                      (+ (point) (cdr match))
-                                      'face 'consult-preview-match
-                                      'window (selected-window)
-                                      'priority 2)
-                    overlays))
-            (run-hooks 'consult-after-jump-hook))))))
+          ;; Handle positions with overlay information
+          (consult--jump-1 (or (car-safe cand) cand))
+          (setq invisible (consult--invisible-open-temporarily)
+                overlays
+                (list (save-excursion
+                        (let ((vbeg (progn (beginning-of-visual-line) (point)))
+                              (vend (progn (end-of-visual-line) (point)))
+                              (end (line-end-position)))
+                          (consult--overlay vbeg (if (= vend end) (1+ end) 
vend)
+                                            'face 'consult-preview-line
+                                            'window (selected-window)
+                                            'priority 1)))
+                      (consult--overlay (point) (1+ (point))
+                                        'face 'consult-preview-cursor
+                                        'window (selected-window)
+                                        'priority 3)))
+          (dolist (match (cdr-safe cand))
+            (push (consult--overlay (+ (point) (car match))
+                                    (+ (point) (cdr match))
+                                    'face 'consult-preview-match
+                                    'window (selected-window)
+                                    'priority 2)
+                  overlays))
+          (run-hooks 'consult-after-jump-hook))))))
 
 (defun consult--jump-state ()
   "The state function used if selecting from a list of candidate positions."
@@ -2650,15 +2650,15 @@ of functions and in `consult-completion-in-region'."
           (delete-overlay ov)
           (setq ov nil))
          ((and (eq action 'preview) cand)
-           (unless ov
-             (setq ov (consult--overlay start end
-                                        'invisible t
-                                        'window (selected-window))))
-           ;; Use `add-face-text-property' on a copy of "cand in order to 
merge face properties
-           (setq cand (copy-sequence cand))
-           (add-face-text-property 0 (length cand) 'consult-preview-insertion 
t cand)
-           ;; Use the `before-string' property since the overlay might be 
empty.
-           (overlay-put ov 'before-string cand)))))))
+          (unless ov
+            (setq ov (consult--overlay start end
+                                       'invisible t
+                                       'window (selected-window))))
+          ;; Use `add-face-text-property' on a copy of "cand in order to merge 
face properties
+          (setq cand (copy-sequence cand))
+          (add-face-text-property 0 (length cand) 'consult-preview-insertion t 
cand)
+          ;; Use the `before-string' property since the overlay might be empty.
+          (overlay-put ov 'before-string cand)))))))
 
 ;;;###autoload
 (defun consult-completion-in-region (start end collection &optional predicate)
@@ -3195,12 +3195,12 @@ INITIAL is the initial input."
             (minibuffer-message
              (substitute-command-keys
               " [Unlocked read-only buffer. \\[minibuffer-keyboard-quit] to 
quit.]"))))
-        (consult--with-increased-gc
-         (consult--prompt
-          :prompt "Keep lines: "
-          :initial initial
-          :history 'consult--keep-lines-history
-          :state (consult--keep-lines-state filter))))))
+      (consult--with-increased-gc
+       (consult--prompt
+        :prompt "Keep lines: "
+        :initial initial
+        :history 'consult--keep-lines-history
+        :state (consult--keep-lines-state filter))))))
 
 ;;;;; Command: consult-focus-lines
 
@@ -4043,8 +4043,8 @@ The command supports previewing the currently selected 
theme."
   "Normalize directory DIR.
 DIR can be project, nil or a path."
   (cond
-    ((eq dir 'project) (consult--project-root))
-    (dir (expand-file-name dir))))
+   ((eq dir 'project) (consult--project-root))
+   (dir (expand-file-name dir))))
 
 (defun consult--buffer-query-prompt (prompt query)
   "Buffer query function returning a scope description.
@@ -4121,7 +4121,7 @@ Report progress and return a list of the results"
                               (prog1 (apply app)
                                 (progress-reporter-update
                                  reporter (1+ idx) (buffer-name)))))
-                 buffer)
+                          buffer)
        (progress-reporter-done reporter)))))
 
 (defun consult--buffer-file-hash ()
@@ -4340,7 +4340,7 @@ The command may prompt you for a project directory if it 
is invoked from
 outside a project. See `consult-buffer' for more details."
   (interactive)
   (consult--with-project
-    (consult-buffer consult-project-buffer-sources)))
+   (consult-buffer consult-project-buffer-sources)))
 
 ;;;###autoload
 (defun consult-buffer-other-window ()
@@ -4361,10 +4361,10 @@ outside a project. See `consult-buffer' for more 
details."
 (defun consult--kmacro-candidates ()
   "Return alist of kmacros and indices."
   (thread-last
-      ;; List of macros
-      (append (when last-kbd-macro
-                `((,last-kbd-macro ,kmacro-counter ,kmacro-counter-format)))
-              kmacro-ring)
+    ;; List of macros
+    (append (when last-kbd-macro
+              `((,last-kbd-macro ,kmacro-counter ,kmacro-counter-format)))
+            kmacro-ring)
     ;; Add indices
     (seq-map-indexed #'cons)
     ;; Filter mouse clicks



reply via email to

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