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

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

[elpa] externals/nano-modeline 5c41296757 1/2: Save excursion while coll


From: ELPA Syncer
Subject: [elpa] externals/nano-modeline 5c41296757 1/2: Save excursion while collecting breadcrumbs in info mode
Date: Thu, 23 Jun 2022 01:57:46 -0400 (EDT)

branch: externals/nano-modeline
commit 5c4129675706b82d97742150cc975b1e4b2c1c5a
Author: Fredrik Salomonsson <plattfot@posteo.net>
Commit: Fredrik Salomonsson <plattfot@posteo.net>

    Save excursion while collecting breadcrumbs in info mode
    
    This corrects the issue when navigating up one level and then press up
    or down. As before this would result in the cursor skipping one line
    when going down and going to the beginning of the previous line if
    navigating up.
---
 nano-modeline.el | 41 +++++++++++++++++++++--------------------
 1 file changed, 21 insertions(+), 20 deletions(-)

diff --git a/nano-modeline.el b/nano-modeline.el
index 7b1cdf30b6..de43d8d66a 100644
--- a/nano-modeline.el
+++ b/nano-modeline.el
@@ -539,26 +539,27 @@ KEY mode name, for reference only. Easier to do lookups 
and/or replacements.
         (crumbs ())
         (depth Info-breadcrumbs-depth)
     line)
-    (while  (> depth 0)
-      (setq node (nth 1 (assoc node nodes)))
-      (if node (push node crumbs))
-      (setq depth (1- depth)))
-    (setq crumbs (cons "Top" (if (member (pop crumbs) '(nil "Top"))
-                     crumbs (cons nil crumbs))))
-    (forward-line 1)
-    (dolist (node crumbs)
-      (let ((text
-         (if (not (equal node "Top")) node
-           (format "%s"
-               (if (stringp Info-current-file)
-               (file-name-sans-extension
-                (file-name-nondirectory Info-current-file))
-             Info-current-file)))))
-    (setq line (concat line (if (null line) "" " > ")
-                                (if (null node) "..." text)))))
-    (if (and cnode (not (equal cnode "Top")))
-        (setq line (concat line (if (null line) "" " > ") cnode)))
-    line))
+    (save-excursion
+      (while  (> depth 0)
+        (setq node (nth 1 (assoc node nodes)))
+        (if node (push node crumbs))
+        (setq depth (1- depth)))
+      (setq crumbs (cons "Top" (if (member (pop crumbs) '(nil "Top"))
+                       crumbs (cons nil crumbs))))
+      (forward-line 1)
+      (dolist (node crumbs)
+        (let ((text
+           (if (not (equal node "Top")) node
+             (format "%s"
+                 (if (stringp Info-current-file)
+                 (file-name-sans-extension
+                  (file-name-nondirectory Info-current-file))
+               Info-current-file)))))
+      (setq line (concat line (if (null line) "" " > ")
+                                  (if (null node) "..." text)))))
+      (if (and cnode (not (equal cnode "Top")))
+          (setq line (concat line (if (null line) "" " > ") cnode)))
+      line)))
 
 (defun nano-modeline-info-mode-p ()
   (derived-mode-p 'Info-mode))



reply via email to

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