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

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

[elpa] externals/denote 1bd8e36f2f 3/6: Define compatibility aliases for


From: ELPA Syncer
Subject: [elpa] externals/denote 1bd8e36f2f 3/6: Define compatibility aliases for all history variables (don't use 'define-obsolete-variable-alias')
Date: Thu, 25 Jan 2024 00:57:44 -0500 (EST)

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

    Define compatibility aliases for all history variables (don't use 
'define-obsolete-variable-alias')
    
    The define-obsolete-variable-alias is producing a warning each time
    Emacs runs about how the old symbol's value is copied to the new
    symbol. We do not want this.
    
    Thanks to Jean-Philippe Gagné Guay and Jousimies for mentioning this
    in issue 224: <https://github.com/protesilaos/denote/issues/224>.
---
 denote-silo-extras.el |  8 ++----
 denote-sort.el        |  8 ++----
 denote.el             | 80 +++++++++++++++++++--------------------------------
 3 files changed, 36 insertions(+), 60 deletions(-)

diff --git a/denote-silo-extras.el b/denote-silo-extras.el
index 69ff5d89c4..367e1eb749 100644
--- a/denote-silo-extras.el
+++ b/denote-silo-extras.el
@@ -50,14 +50,12 @@ as the variable `denote-directory'."
   :link '(info-link "(denote) Maintain separate directories for notes")
   :type '(repeat directory))
 
-(define-obsolete-variable-alias
-  'denote-silo-extras--directory-history
-  'denote-silo-extras-directory-history
-  "3.0.0")
-
 (defvar denote-silo-extras-directory-history nil
   "Minibuffer history for `denote-silo-extras--directory-prompt'.")
 
+(defalias 'denote-silo-extras--directory-history 
'denote-silo-extras-directory-history
+  "Compatibility alias for `denote-silo-extras-directory-history'.")
+
 (defun denote-silo-extras--directory-prompt ()
   "Prompt for directory among `denote-silo-extras-directories'."
   (let ((default (car denote-silo-extras-directory-history)))
diff --git a/denote-sort.el b/denote-sort.el
index 21883c998a..de443dc9bc 100644
--- a/denote-sort.el
+++ b/denote-sort.el
@@ -136,14 +136,12 @@ With optional REVERSE as a non-nil value, reverse the 
sort order."
    current-file-type
    id-only))
 
-(define-obsolete-variable-alias
-  'denote-sort--component-hist
-  'denote-sort-component-history
-  "3.0.0")
-
 (defvar denote-sort-component-history nil
   "Minibuffer history of `denote-sort-component-prompt'.")
 
+(defalias 'denote-sort--component-hist 'denote-sort-component-history
+  "Compatibility alias for `denote-sort-component-history'.")
+
 (defun denote-sort-component-prompt ()
   "Prompt `denote-sort-files' for sorting key among `denote-sort-components'."
   (let ((default (car denote-sort-component-history)))
diff --git a/denote.el b/denote.el
index 48728d0991..f2263c4ff8 100644
--- a/denote.el
+++ b/denote.el
@@ -1083,14 +1083,12 @@ With optional OMIT-CURRENT, do not include the current 
Denote
 file in the returned list."
   (denote-directory-files nil omit-current nil))
 
-(define-obsolete-variable-alias
-  'denote--file-history
-  'denote-file-history
-  "3.0.0")
-
 (defvar denote-file-history nil
   "Minibuffer history of `denote-file-prompt'.")
 
+(defalias 'denote--file-history 'denote-file-history
+  "Compatibility alias for `denote-file-history'.")
+
 (defun denote-file-prompt (&optional files-matching-regexp)
   "Prompt for file with identifier in variable `denote-directory'.
 With optional FILES-MATCHING-REGEXP, filter the candidates per
@@ -1904,14 +1902,12 @@ increment it 1 second at a time until an available id 
is found."
 
 (make-obsolete 'denote-barf-duplicate-id nil "2.1.0")
 
-(define-obsolete-variable-alias
-  'denote--command-prompt-history
-  'denote-command-prompt-history
-  "3.0.0")
-
 (defvar denote-command-prompt-history nil
   "Minibuffer history for `denote-command-prompt'.")
 
+(defalias 'denote--command-prompt-history 'denote-command-prompt-history
+  "Compatibility alias for `denote-command-prompt-history'.")
+
 (defun denote-command-prompt ()
   "Prompt for command among `denote-commands-for-new-notes'."
   (let ((default (car denote-command-prompt-history)))
@@ -2055,14 +2051,12 @@ When called from Lisp, all arguments are optional.
     (denote--keywords-add-to-history keywords)
     (run-hooks 'denote-after-new-note-hook)))
 
-(define-obsolete-variable-alias
-  'denote--title-history
-  'denote-title-history
-  "3.0.0")
-
 (defvar denote-title-history nil
   "Minibuffer history of `denote-title-prompt'.")
 
+(defalias 'denote--title-history 'denote-title-history
+  "Compatibility alias for `denote-title-history'.")
+
 (defun denote-title-prompt (&optional default-title prompt-text)
   "Prompt for title string.
 
@@ -2089,14 +2083,12 @@ histories between sessions."
      denote-title-history
      nil nil default-title 'denote-title-history 
denote-title-prompt-current-default)))
 
-(define-obsolete-variable-alias
-  'denote--file-type-history
-  'denote-file-type-history
-  "3.0.0")
-
 (defvar denote-file-type-history nil
   "Minibuffer history of `denote-file-type-prompt'.")
 
+(defalias 'denote--file-type-history 'denote-file-type-history
+  "Compatibility alias for `denote-file-type-history'.")
+
 (defun denote-file-type-prompt ()
   "Prompt for `denote-file-type'.
 Note that a non-nil value other than `text', `markdown-yaml', and
@@ -2106,14 +2098,12 @@ here for clarity."
    "Select file type: " (denote--file-type-keys) nil t
    nil 'denote-file-type-history))
 
-(define-obsolete-variable-alias
-  'denote--date-history
-  'denote-date-history
-  "3.0.0")
-
 (defvar denote-date-history nil
   "Minibuffer history of `denote-date-prompt'.")
 
+(defalias 'denote--date-history 'denote-date-history
+  "Compatibility alias for `denote-date-history'.")
+
 (declare-function org-read-date "org" (&optional with-time to-time from-string 
prompt default-time default-input inactive))
 
 (defun denote-date-prompt ()
@@ -2140,14 +2130,12 @@ Use Org's more advanced date selection utility if the 
user option
    denote-id-format
    (denote--valid-date (denote-date-prompt))))
 
-(define-obsolete-variable-alias
-  'denote--subdir-history
-  'denote-subdirectory-history
-  "3.0.0")
-
 (defvar denote-subdirectory-history nil
   "Minibuffer history of `denote-subdirectory-prompt'.")
 
+(defalias 'denote--subdir-history 'denote-subdirectory-history
+  "Compatibility alias for `denote-subdirectory-history'.")
+
 ;; Making it a completion table is useful for packages that read the
 ;; metadata, such as `marginalia' and `embark'.
 (defun denote--subdirs-completion-table (dirs)
@@ -2168,14 +2156,12 @@ packages such as `marginalia' and `embark')."
          (dirs (push root subdirs)))
     (denote--subdirs-completion-table dirs)))
 
-(define-obsolete-variable-alias
-  'denote--template-history
-  'denote-template-history
-  "3.0.0")
-
 (defvar denote-template-history nil
   "Minibuffer history of `denote-template-prompt'.")
 
+(defalias 'denote--template-history 'denote-template-history
+  "Compatibility alias for `denote-template-history'.")
+
 (defun denote-template-prompt ()
   "Prompt for template key in `denote-templates' and return its value."
   (let ((templates denote-templates))
@@ -2186,14 +2172,12 @@ packages such as `marginalia' and `embark')."
        nil t nil 'denote-template-history))
      templates)))
 
-(define-obsolete-variable-alias
-  'denote--signature-history
-  'denote-signature-history
-  "3.0.0")
-
 (defvar denote-signature-history nil
   "Minibuffer history of `denote-signature-prompt'.")
 
+(defalias 'denote--signature-history 'denote-signature-history
+  "Compatibility alias for `denote-signature-history'.")
+
 (defun denote-signature-prompt (&optional default-signature prompt-text)
   "Prompt for signature string.
 With optional DEFAULT-SIGNATURE use it as the initial minibuffer
@@ -2221,14 +2205,12 @@ histories between sessions."
      denote-signature-history
      nil nil default-signature 'denote-signature-history)))
 
-(define-obsolete-variable-alias
-  'denote--files-matching-regexp-hist
-  'denote-files-matching-regexp-history
-  "3.0.0")
-
 (defvar denote-files-matching-regexp-history nil
   "Minibuffer history of `denote-files-matching-regexp-prompt'.")
 
+(defalias 'denote--files-matching-regexp-hist 
'denote-files-matching-regexp-history
+  "Compatibility alias for `denote-files-matching-regexp-history'.")
+
 (defun denote-files-matching-regexp-prompt (&optional prompt-text)
   "Prompt for REGEXP to filter Denote files by.
 With optional PROMPT-TEXT use it instead of a generic prompt."
@@ -3447,14 +3429,12 @@ function."
           (push file found-files))))
     found-files))
 
-(define-obsolete-variable-alias
-  'denote-link--find-file-history
-  'denote-link-find-file-history
-  "3.0.0")
-
 (defvar denote-link-find-file-history nil
   "History for `denote-find-link'.")
 
+(defalias 'denote-link--find-file-history 'denote-link-find-file-history
+  "Compatibility alias for `denote-link-find-file-history'.")
+
 (defun denote-link--find-file-prompt (files)
   "Prompt for linked file among FILES."
   (let ((file-names (mapcar #'denote-get-file-name-relative-to-denote-directory



reply via email to

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