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

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

[elpa] externals/denote 6374751ee2 4/4: REMOVE 'denote-faces-broken-link


From: ELPA Syncer
Subject: [elpa] externals/denote 6374751ee2 4/4: REMOVE 'denote-faces-broken-link'
Date: Sun, 25 Sep 2022 23:57:31 -0400 (EDT)

branch: externals/denote
commit 6374751ee20be95637dcf5eefd52c0da321158a6
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    REMOVE 'denote-faces-broken-link'
    
    It leads to performance issues in Org under certain circumstances.
    Fundamentally, this has to do with the fontification mechanism, which
    would call the 'denote-link-ol-face' function too often.
    
    Thanks to Peter Prevos for reporting the issue and discussing it with
    me: 
<https://lists.sr.ht/~protesilaos/denote/%3C87k05umyyo.fsf%40prevos.net%3E>.
---
 README.org |  7 -------
 denote.el  | 21 ++-------------------
 2 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/README.org b/README.org
index 2631b91106..451450633d 100644
--- a/README.org
+++ b/README.org
@@ -1142,13 +1142,6 @@ like an ordinary link by default.  This is just a 
convenience for the
 user/theme in case they want =denote:= links to remain distinct from
 other links.
 
-#+vindex: denote-faces-broken-link
-In Org files, broken links get the ~denote-faces-broken-link~ if the
-linked identifier does not resolve to a file path with a note.  The
-ability to use distinct faces for such a scenario is a feature of Org,
-which is not available in other supported file types that use Emacs'
-generic button mechanism.
-
 ** Insert links matching a regexp
 :PROPERTIES:
 :CUSTOM_ID: h:9bec2c83-36ca-4951-aefc-7187c5463f90
diff --git a/denote.el b/denote.el
index 4cf1a5cc94..37a077caa1 100644
--- a/denote.el
+++ b/denote.el
@@ -1938,12 +1938,7 @@ relevant front matter."
   :group 'denote-faces
   :package-version '(denote . "0.5.0"))
 
-(defface denote-faces-broken-link '((t :inherit (error link)))
-  "Face used to style Denote broken links in the buffer.
-This only works in Org files, as Emacs' generic buttons do not
-provide a facility that uses a face based on certain conditions."
-  :group 'denote-faces
-  :package-version '(denote . "0.5.0"))
+(make-obsolete 'denote-faces-broken-link nil "1.0.0")
 
 (defface denote-faces-subdirectory '((t :inherit bold))
   "Face for subdirectory of file name.
@@ -2575,18 +2570,6 @@ file."
    (denote-link--ol-resolve-link-to-target link)
    nil))
 
-(defun denote-link-ol-face (link)
-  "Return appropriate face for LINK.
-If the LINK resolves to a note, use `denote-faces-link', else
-return `denote-faces-broken-link'.  When links are propertized in
-other contexts, apply the generic `link' face (this happens with
-the Org agenda)."
-  (if (not (denote--current-file-is-note-p))
-      'link
-    (if (denote-link--ol-resolve-link-to-target link)
-        'denote-faces-link
-      'denote-faces-broken-link)))
-
 (defun denote-link-ol-complete ()
   "Like `denote-link' but for Org integration.
 This lets the user complete a link through the `org-insert-link'
@@ -2642,7 +2625,7 @@ backend."
           (org-link-set-parameters
            "denote"
            :follow #'denote-link-ol-follow
-           :face #'denote-link-ol-face
+           :face 'denote-faces-link
            :complete #'denote-link-ol-complete
            :store #'denote-link-ol-store
            :export #'denote-link-ol-export)))))



reply via email to

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