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

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

[nongnu] elpa/base32 5557b7714a 091/103: Squash obsolete function warnin


From: ELPA Syncer
Subject: [nongnu] elpa/base32 5557b7714a 091/103: Squash obsolete function warnings, maintain backwards compatibility
Date: Sat, 10 Feb 2024 13:00:13 -0500 (EST)

branch: elpa/base32
commit 5557b7714a16651875557250dff1a6b2ffc397cf
Author: Vivek Das Mohapatra <vivek@collabora.co.uk>
Commit: Vivek Das Mohapatra <vivek@collabora.co.uk>

    Squash obsolete function warnings, maintain backwards compatibility
---
 totp-auth-interop.el | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/totp-auth-interop.el b/totp-auth-interop.el
index a66d8c4ad5..f65ca5c63a 100644
--- a/totp-auth-interop.el
+++ b/totp-auth-interop.el
@@ -16,6 +16,13 @@
                     (locate-library "hmac")))
       (add-to-list 'load-path (file-name-directory this-file)))
     (require 'totp-auth))
+  ;; function declared obsolete in 29.x
+  ;; do not use #' forms here as that will trigger a different warning
+  (if (fboundp 'image-supported-file-p)
+      (defalias 'totp-auth-image-type-from-filename
+        'image-supported-file-p)
+    (defalias 'totp-auth-image-type-from-filename
+      'image-type-from-file-name))
   (require 'mailcap))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -474,7 +481,7 @@ has no entry at all."
   "Export OTP secrets to FILE as image format IMG-TYPE.
 FILE is a path to a file which may or may not exist yet.
 IMG-TYPE is a symbol representingh an image type.
-\(see ‘image-type-from-file-name’ for details).
+\(see ‘totp-auth-image-type-from-filename’ for details).
 FILE should match IMG-TYPEs well known extension but this is not enforced.
 TYPE is :otpauth or :otpauth-migration, and defaults to :otpauth.
 SECRETS is a list of ‘totp-auth-unwrap-otp-blob’ secrets, or nil for all.
@@ -504,7 +511,9 @@ of ‘totp-auth-file-export-type-map’."
                    args (mapcar (lambda (a)
                                   (if (equal "@file@" a) file a))
                                 arg-list))
-             (apply #'call-process-region (point-at-bol) (point-at-eol)
+             (apply #'call-process-region
+                    (line-beginning-position)
+                    (line-end-position)
                     cmd nil t nil args)
              (setq created (list file)))
             (t
@@ -516,7 +525,9 @@ of ‘totp-auth-file-export-type-map’."
                      args     (mapcar (lambda (a)
                                         (if (equal "@file@" a) nth-file a))
                                       arg-list))
-               (apply #'call-process-region (point-at-bol) (point-at-eol)
+               (apply #'call-process-region
+                      (line-beginning-position)
+                      (line-end-position)
                       cmd nil t nil args)
                (setq created (cons nth-file created)
                      travel (forward-line)
@@ -556,7 +567,7 @@ If it is nil, all available secrets are exported."
   "Export TOTP SECRETS to FILE.
 FILE is a destination file.
 If it matches ‘epa-file-name-regexp’ then a text file is saved.
-If ‘image-type-from-file-name’ returns an image type for file then
+If ‘totp-auth-image-type-from-filename’ returns an image type for file then
 a QR code is generated instead.
 TYPE may be :otpauth-migration or :otpauth - which URL scheme to use.
 \nSECRETS is a list of ‘totp-auth-unwrap-otp-blob’ secrets, or a string, or 
nil.
@@ -576,7 +587,7 @@ Any other string is used as a substring to look for in the 
labels."
     (error "Export file %S already exists" file))
   (let (img-type epa-ok)
     (setq epa-ok   (string-match epa-file-name-regexp file)
-          img-type (image-type-from-file-name file))
+          img-type (totp-auth-image-type-from-filename file))
     (cond (epa-ok   (totp-auth-export-text  file type secrets))
           (img-type (totp-auth-export-image file img-type type secrets))
           (t (error "%S is not an EPA file or supported image format" file)))))



reply via email to

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