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

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

[elpa] externals/nano-modeline e772ff3375 2/2: Merge pull request #31 fr


From: ELPA Syncer
Subject: [elpa] externals/nano-modeline e772ff3375 2/2: Merge pull request #31 from plattfot/info-skip-fix
Date: Thu, 23 Jun 2022 01:57:46 -0400 (EDT)

branch: externals/nano-modeline
commit e772ff3375ae7b1f87d50e78028e57bf5383685e
Merge: 823161c889 5c41296757
Author: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Commit: GitHub <noreply@github.com>

    Merge pull request #31 from plattfot/info-skip-fix
    
    Save excursion while collecting breadcrumbs in info mode
---
 nano-modeline.el | 41 +++++++++++++++++++++--------------------
 1 file changed, 21 insertions(+), 20 deletions(-)

diff --git a/nano-modeline.el b/nano-modeline.el
index e28f4e45a3..9db5625ac9 100644
--- a/nano-modeline.el
+++ b/nano-modeline.el
@@ -634,26 +634,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]