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

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

[elpa] externals/denote e7a176e4e7 13/20: DEPRECATE 'denote-add-missing-


From: ELPA Syncer
Subject: [elpa] externals/denote e7a176e4e7 13/20: DEPRECATE 'denote-add-missing-links'
Date: Sat, 25 Nov 2023 00:57:51 -0500 (EST)

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

    DEPRECATE 'denote-add-missing-links'
    
    It does not work reliably on my end and has been the source of
    confusion as a result. I don't think we can guarantee the correct
    behaviour at all times.
---
 README.org           | 14 --------------
 denote-org-dblock.el | 14 ++++----------
 denote.el            | 25 +------------------------
 3 files changed, 5 insertions(+), 48 deletions(-)

diff --git a/README.org b/README.org
index 43e8670f61..5f41fecf17 100644
--- a/README.org
+++ b/README.org
@@ -1860,20 +1860,6 @@ will get this link: =[[denote:20230925T144303][abc My 
first signature note]]=.
 For more advanced uses, refer to the doc string of the ~denote-link~
 function.
 
-** Insert links, but only those missing from current buffer
-:PROPERTIES:
-:CUSTOM_ID: h:0c1fdaab-5a6b-4792-9694-fed53cd042e6
-:END:
-
-#+findex: denote-add-missing-links
-As a variation on the ~denote-add-links~ command, one may wish to only
-include 'missing links', i.e. links that are not yet present in the
-current file.
-
-This can be achieved with ~denote-add-missing-links~. The command is
-similar to ~denote-add-links~, but will only include links to notes
-that are not yet linked to ([[#h:9bec2c83-36ca-4951-aefc-7187c5463f90][Insert 
links matching a regexp]]).
-
 ** Insert links from marked files in Dired
 :PROPERTIES:
 :CUSTOM_ID: h:9cbb692e-5d8a-44a6-9193-899a07872a07
diff --git a/denote-org-dblock.el b/denote-org-dblock.el
index a5dbce3fec..fffcd80e06 100644
--- a/denote-org-dblock.el
+++ b/denote-org-dblock.el
@@ -50,7 +50,6 @@
      (read-regexp "Search for notes matching REGEX: " nil 
'denote-link--add-links-history)))
   (org-create-dblock (list :name "denote-links"
                            :regexp regexp
-                           :missing-only nil
                            :reverse nil))
   (org-update-dblock))
 
@@ -64,20 +63,15 @@
 Used by `org-dblock-update' with PARAMS provided by the dynamic block."
   (let* ((regexp (plist-get params :regexp))
          (rx (if (listp regexp) (macroexpand `(rx ,regexp)) regexp))
-         (missing-only (plist-get params :missing-only))
          (block-name (plist-get params :block-name))
          (denote-link-add-links-sort (plist-get params :reverse))
          (current-file (buffer-file-name)))
     (when block-name
       (insert "#+name: " block-name "\n"))
-    (if missing-only
-        (progn
-          (denote-add-missing-links rx)
-          (join-line)) ;; remove trailing empty line left by 
denote-link--prepare-links
-      (when-let ((files (delete current-file
-                                (denote-directory-files-matching-regexp rx))))
-        (insert (denote-link--prepare-links files current-file nil))
-        (join-line))))) ;; remove trailing empty line
+    (when-let ((files (delete current-file
+                              (denote-directory-files-matching-regexp rx))))
+      (insert (denote-link--prepare-links files current-file nil))
+      (join-line)))) ;; remove trailing empty line
 
 ;;;; Dynamic block to insert backlinks
 
diff --git a/denote.el b/denote.el
index 7cd7f9a9f3..cb6b542e28 100644
--- a/denote.el
+++ b/denote.el
@@ -3537,30 +3537,7 @@ inserts links with just the identifier."
   'denote-add-missing-links
   "2.0.0")
 
-;;;###autoload
-(defun denote-add-missing-links (regexp &optional id-only)
-  "Insert missing links to all notes matching REGEXP.
-Similar to `denote-add-links' but insert only links not yet
-present in the current buffer.
-
-Optional ID-ONLY has the same meaning as in `denote-link': it
-inserts links with just the identifier."
-  (interactive
-   (list
-    (read-regexp "Insert links matching REGEX: " nil 
'denote-link--add-links-history)
-    current-prefix-arg))
-  (let* ((current-file (buffer-file-name))
-         (file-type (denote-filetype-heuristics current-file))
-         (current-id (denote--link-in-context-regexp file-type))
-         (linked-files (denote-link--expand-identifiers current-id)))
-    (if-let ((found-files (delete current-file
-                                  (denote-directory-files-matching-regexp 
regexp)))
-             (final-files (seq-difference found-files linked-files))
-             (beg (point)))
-        (progn
-          (insert (denote-link--prepare-links final-files file-type id-only))
-          (denote-link-buttonize-buffer beg (point)))
-      (message "No links matching `%s' that aren't yet present in the current 
buffer" regexp))))
+(make-obsolete 'denote-add-missing-links nil "2.2.0")
 
 ;;;;; Links from Dired marks
 



reply via email to

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