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

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

[nongnu] elpa/toc-org 215d3e41e3 114/128: fix C-c C-o for links with coo


From: ELPA Syncer
Subject: [nongnu] elpa/toc-org 215d3e41e3 114/128: fix C-c C-o for links with cookies
Date: Sun, 2 Jan 2022 09:59:15 -0500 (EST)

branch: elpa/toc-org
commit 215d3e41e3708241bdf9447254fd9b5905f2d992
Author: Sergei Nosov <sergei.nosov@gmail.com>
Commit: Sergei Nosov <sergei.nosov@gmail.com>

    fix C-c C-o for links with cookies
---
 toc-org.el | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/toc-org.el b/toc-org.el
index a05196ebb9..e2fff1d882 100644
--- a/toc-org.el
+++ b/toc-org.el
@@ -311,15 +311,13 @@ each heading into a link."
                    (end (line-end-position))
                    (heading (buffer-substring-no-properties
                              beg end))
-                   (hrefified (funcall hrefify heading hash)))
+                   (hrefified (funcall hrefify heading hash))
+                  (visible-link (toc-org-format-visible-link heading)))
 
               (if markdown-syntax-p
                   (progn
                     (insert "[")
-                    (insert
-                     (toc-org-format-visible-link
-                      (buffer-substring-no-properties
-                       (point) (line-end-position))))
+                    (insert visible-link)
                     (delete-region (point) (line-end-position))
                     (insert "]")
                     (insert "(")
@@ -328,16 +326,13 @@ each heading into a link."
                 (insert "[[")
                 (insert hrefified)
                 (insert "][")
-                (insert
-                 (toc-org-format-visible-link
-                  (buffer-substring-no-properties
-                   (point) (line-end-position))))
+                (insert visible-link)
                 (delete-region (point) (line-end-position))
                 (insert "]]"))
 
               ;; maintain the hash table, if provided
               (when hash
-                (puthash hrefified heading hash)))
+                (puthash hrefified visible-link hash)))
             (= 0 (forward-line 1)))))
 
     (buffer-substring-no-properties



reply via email to

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