~niklaseklund/egerrit

Fix indentation in egerrit.el--- v1 APPLIED

Niklas Eklund: 1
 Fix indentation in egerrit.el---

 1 files changed, 43 insertions(+), 43 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~niklaseklund/egerrit/patches/31699/mbox | git am -3
Learn more about email & git

[PATCH] Fix indentation in egerrit.el--- Export this patch

Fix incorrect indentation in file.

---
 egerrit.el | 86 +++++++++++++++++++++++++++---------------------------
 1 file changed, 43 insertions(+), 43 deletions(-)

diff --git a/egerrit.el b/egerrit.el
index 42bed37..0ebf9c1 100644
--- a/egerrit.el
+++ b/egerrit.el
@@ -845,19 +845,19 @@ PARSER: Optional parser to apply to the response."
    `((,query . (,query)))))

(defun egerrit-query-from-url ()
    "Create a Gerrit query based on an URL."
    (let ((url (read-string "Enter URL: "))
          (re (rx-to-string `(and bol (regexp ".*")
                                  ,egerrit-request-url
                                  "/c/" (group (regexp ".*?"))
                                  "/+/" (group (one-or-more digit)))))
          (query))
      (string-match re url)
      (setq query
            (format "project:%s %s"
                    (match-string 1 url)
                    (match-string 2 url)))
      `((,query . (,query)))))
  "Create a Gerrit query based on an URL."
  (let ((url (read-string "Enter URL: "))
        (re (rx-to-string `(and bol (regexp ".*")
                                ,egerrit-request-url
                                "/c/" (group (regexp ".*?"))
                                "/+/" (group (one-or-more digit)))))
        (query))
    (string-match re url)
    (setq query
          (format "project:%s %s"
                  (match-string 1 url)
                  (match-string 2 url)))
    `((,query . (,query)))))

(defun egerrit-select-revision (change &optional revisions)
  "Select one of CHANGE's REVISIONS."
@@ -1568,7 +1568,7 @@ This function will work both for review/feedback comments."
                (egerrit-select-revision egerrit--current-change
                                         (thread-last (egerrit--change-revisions egerrit--current-change)
                                                      (seq-filter (lambda (it) (> (egerrit--revision-number it)
                                                                             (egerrit--revision-number old-revision))))))
                                                                                  (egerrit--revision-number old-revision))))))
              (seq-first (seq-reverse (egerrit--change-revisions egerrit--current-change))))))
      (if (= (egerrit--revision-number old-revision)
             (egerrit--revision-number new-revision))
@@ -2250,30 +2250,30 @@ Optionally provide a NAME-CONTAIN variable to narrow the search space."

        ;; Conversations from a previous patch set are not always found in the diff
        (if (search-forward-regexp file-regexp nil t)
          (pcase-let ((`(,file-start ,file-end) (diff-bounds-of-file))
                      (location)
                      (conversation-line (egerrit--range-start-line
                                          (egerrit--conversation-range conversation))))
            ;; 2) Find the hunk that best matches the range described in
            ;; the conversation
            (goto-char (1- file-end))
            (setq location `(,(egerrit--diff-hunk-line-offset side)
                             ,(save-excursion
                                (goto-char (1- (diff-end-of-hunk)))
                                (line-number-at-pos))))

            (save-excursion
              (while (and (<= file-start (point))
                          (<= conversation-line (egerrit--diff-hunk-line-offset side))
                          (not (eobp)))
                (diff-hunk-prev)
                (goto-char (1- (point)))
                (setq location `(,(egerrit--diff-hunk-line-offset side)
                                 ,(line-number-at-pos)))))

            ;; 3) Return the location info
            (diff-beginning-of-hunk)
            location)
            (pcase-let ((`(,file-start ,file-end) (diff-bounds-of-file))
                        (location)
                        (conversation-line (egerrit--range-start-line
                                            (egerrit--conversation-range conversation))))
              ;; 2) Find the hunk that best matches the range described in
              ;; the conversation
              (goto-char (1- file-end))
              (setq location `(,(egerrit--diff-hunk-line-offset side)
                               ,(save-excursion
                                  (goto-char (1- (diff-end-of-hunk)))
                                  (line-number-at-pos))))

              (save-excursion
                (while (and (<= file-start (point))
                            (<= conversation-line (egerrit--diff-hunk-line-offset side))
                            (not (eobp)))
                  (diff-hunk-prev)
                  (goto-char (1- (point)))
                  (setq location `(,(egerrit--diff-hunk-line-offset side)
                                   ,(line-number-at-pos)))))

              ;; 3) Return the location info
              (diff-beginning-of-hunk)
              location)
          ;; File can not be found
          '(0 0))))))

@@ -3200,9 +3200,9 @@ or previous revisions."
(defun egerrit--update-git-branch (buffers branch)
  "Update the git BRANCH in BUFFERS."
  (seq-do (lambda (it)
             (with-current-buffer it
               (setq egerrit--current-git-branch branch)))
           buffers))
            (with-current-buffer it
              (setq egerrit--current-git-branch branch)))
          buffers))

(defun egerrit--prepare-review (change revision)
  "Prepare for review of CHANGE's REVISION."
@@ -3316,8 +3316,8 @@ or previous revisions."
    (egerrit-job-mode)
    (setq-local next-error-find-buffer-function
                (lambda (_avoid-current
                    _extra-test-inclusive
                    _extra-test-exclusive)
                         _extra-test-inclusive
                         _extra-test-exclusive)
                  buffer))
    (setq egerrit--current-job job)
    (run-hooks 'egerrit-job-hooks)
-- 
2.34.0