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

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

[elpa] externals/compat 79d4778 23/99: Use compat--string-trim-left in f


From: ELPA Syncer
Subject: [elpa] externals/compat 79d4778 23/99: Use compat--string-trim-left in file-name-with-extension
Date: Sun, 17 Oct 2021 05:57:50 -0400 (EDT)

branch: externals/compat
commit 79d4778af629a494b30756cedbd10cb2dfa6b996
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Use compat--string-trim-left in file-name-with-extension
    
    The function was moved from subr-x to subr in Emacs 28, and cannot be
    used directly in older versions, without requiring subr-x.  To avoid
    this overhead, we use our own implementation.
---
 compat-28.1.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/compat-28.1.el b/compat-28.1.el
index 2d45223..50e93bf 100644
--- a/compat-28.1.el
+++ b/compat-28.1.el
@@ -334,6 +334,8 @@ as the new values of the bound variables in the recursive 
invocation."
 
 ;;;; Defined in files.el
 
+(declare-function compat--string-trim-left "compat-26.1"
+                  (string &optional regexp))
 (compat-defun file-name-with-extension (filename extension)
   "Set the EXTENSION of a FILENAME.
 The extension (in a file name) is the part that begins with the last \".\".
@@ -345,7 +347,7 @@ Errors if the FILENAME or EXTENSION are empty, or if the 
given
 FILENAME has the format of a directory.
 
 See also `file-name-sans-extension'."
-  (let ((extn (string-trim-left extension "[.]")))
+  (let ((extn (compat--string-trim-left extension "[.]")))
     (cond
      ((string= filename "")
       (error "Empty filename"))



reply via email to

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