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

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

[nongnu] elpa/php-mode cf10f7c217 08/12: Use compat-string-trim-* functi


From: ELPA Syncer
Subject: [nongnu] elpa/php-mode cf10f7c217 08/12: Use compat-string-trim-* functions for compatibility
Date: Thu, 3 Nov 2022 12:59:20 -0400 (EDT)

branch: elpa/php-mode
commit cf10f7c217bcf876c67957df852a10d2293fffae
Author: USAMI Kenta <tadsan@zonu.me>
Commit: USAMI Kenta <tadsan@zonu.me>

    Use compat-string-trim-* functions for compatibility
---
 Cask             | 1 +
 Makefile         | 5 ++++-
 lisp/php-mode.el | 9 +++++++--
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/Cask b/Cask
index e847468562..527f7eddb8 100644
--- a/Cask
+++ b/Cask
@@ -1,4 +1,5 @@
 (package "php-mode" "1.24.1" "Major mode for editing PHP code")
+(source gnu)
 (source melpa)
 
 (package-file "lisp/php-mode.el")
diff --git a/Makefile b/Makefile
index 97922d2a50..883ec9f8f2 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,10 @@ AUTOLOADS = php-mode-autoloads.el
 ELCS = $(ELS:.el=.elc)
 
 %.elc: %.el
-       $(EMACS) --batch -L lisp/ -f batch-byte-compile $<
+       $(EMACS) --batch -L lisp/ --eval \
+       "(let ((default-directory (expand-file-name \".cask\" 
default-directory))) \
+          (normal-top-level-add-subdirs-to-load-path))" \
+           -f batch-byte-compile $<
 
 all: autoloads $(ELCS) authors
 
diff --git a/lisp/php-mode.el b/lisp/php-mode.el
index 24932bf25a..461b73ce34 100644
--- a/lisp/php-mode.el
+++ b/lisp/php-mode.el
@@ -10,7 +10,7 @@
 ;; URL: https://github.com/emacs-php/php-mode
 ;; Keywords: languages php
 ;; Version: 1.24.1
-;; Package-Requires: ((emacs "25.2"))
+;; Package-Requires: ((emacs "25.2") (compat "28.1.1.0"))
 ;; License: GPL-3.0-or-later
 
 (eval-and-compile
@@ -82,6 +82,7 @@
   (require 'rx)
   (require 'cl-lib)
   (require 'regexp-opt)
+  (require 'compat-26 nil t)
   (defvar add-log-current-defun-header-regexp)
   (defvar add-log-current-defun-function)
   (defvar c-syntactic-context)
@@ -92,7 +93,11 @@
   (eval-when-compile
     (let* ((fallback-version (format "%s-non-vcs" (with-no-warnings 
php-mode-version-number))))
       (if (locate-dominating-file default-directory ".git")
-          (string-trim-left (string-trim-right (shell-command-to-string "git 
describe --tags")) "v")
+          (funcall
+           (if (and (boundp 'string-trim-left) (boundp 'string-trim-right))
+               (lambda (s) (string-trim-left (string-trim-right s) "v"))
+             (lambda (s) (compat-string-trim-left (compat-string-trim-right s) 
"v")))
+           (shell-command-to-string "git describe --tags"))
         fallback-version)))
   "PHP Mode build ID.
 



reply via email to

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