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

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

[nongnu] elpa/helm 2937d692ac 2/5: Don't jump to first match when saving


From: ELPA Syncer
Subject: [nongnu] elpa/helm 2937d692ac 2/5: Don't jump to first match when saving helm-grep-mode buffer
Date: Wed, 20 Jul 2022 13:58:34 -0400 (EDT)

branch: elpa/helm
commit 2937d692ac574ca59eddcd7d041609d26fb34446
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>

    Don't jump to first match when saving helm-grep-mode buffer
---
 helm-grep.el | 44 ++++++++++++++++++++++----------------------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/helm-grep.el b/helm-grep.el
index 02da1b082d..6c508f86c3 100644
--- a/helm-grep.el
+++ b/helm-grep.el
@@ -725,29 +725,29 @@ WHERE can be `other-window' or `other-frame'."
                         (doc-view-goto-page lineno))))
       (t            (find-file fname)))
     (unless (or (eq where 'grep) (eq where 'pdf))
-      (helm-goto-line lineno))
-    ;; Move point to the nearest matching regexp from bol.
-    (cl-loop for reg in split-pat
-             when (save-excursion
-                    (condition-case _err
-                        (if helm-migemo-mode
-                            (helm-mm-migemo-forward reg (point-at-eol) t)
-                          (re-search-forward reg (point-at-eol) t))
-                      (invalid-regexp nil)))
-             collect (match-beginning 0) into pos-ls
-             finally (when pos-ls (goto-char (apply #'min pos-ls))))
-    ;; Save history
-    (unless (or helm-in-persistent-action
-                (eq major-mode 'helm-grep-mode)
-                (string= helm-pattern ""))
-      (setq helm-grep-history
-            (cons helm-pattern
-                  (delete helm-pattern helm-grep-history)))
-      (when (> (length helm-grep-history)
-               helm-grep-max-length-history)
+      (helm-goto-line lineno)
+      ;; Move point to the nearest matching regexp from bol.
+      (cl-loop for reg in split-pat
+               when (save-excursion
+                      (condition-case _err
+                          (if helm-migemo-mode
+                              (helm-mm-migemo-forward reg (point-at-eol) t)
+                            (re-search-forward reg (point-at-eol) t))
+                        (invalid-regexp nil)))
+               collect (match-beginning 0) into pos-ls
+               finally (when pos-ls (goto-char (apply #'min pos-ls))))
+      ;; Save history
+      (unless (or helm-in-persistent-action
+                  (eq major-mode 'helm-grep-mode)
+                  (string= helm-pattern ""))
         (setq helm-grep-history
-              (delete (car (last helm-grep-history))
-                      helm-grep-history))))))
+              (cons helm-pattern
+                    (delete helm-pattern helm-grep-history)))
+        (when (> (length helm-grep-history)
+                 helm-grep-max-length-history)
+          (setq helm-grep-history
+                (delete (car (last helm-grep-history))
+                        helm-grep-history)))))))
 
 (defun helm-grep-persistent-action (candidate)
   "Persistent action for `helm-do-grep-1'.



reply via email to

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