[clang-tools-extra] r283861 - Make Emacs libraries compatible with Emacs 24.
Manuel Klimek via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 11 02:15:10 PDT 2016
Author: klimek
Date: Tue Oct 11 04:15:10 2016
New Revision: 283861
URL: http://llvm.org/viewvc/llvm-project?rev=283861&view=rev
Log:
Make Emacs libraries compatible with Emacs 24.
Emacs 24 doesn't have format-message, fall back to format in that case.
Patch by Philipp Stephani.
Modified:
clang-tools-extra/trunk/clang-rename/tool/clang-rename.el
clang-tools-extra/trunk/include-fixer/tool/clang-include-fixer.el
Modified: clang-tools-extra/trunk/clang-rename/tool/clang-rename.el
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-rename/tool/clang-rename.el?rev=283861&r1=283860&r2=283861&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-rename/tool/clang-rename.el (original)
+++ clang-tools-extra/trunk/clang-rename/tool/clang-rename.el Tue Oct 11 04:15:10 2016
@@ -52,7 +52,7 @@
(kill-buffer output-buffer)
(revert-buffer :ignore-auto :noconfirm :preserve-modes))
;; Failure; append exit code to output buffer and display it.
- (let ((message (format-message
+ (let ((message (clang-rename--format-message
"clang-rename failed with %s %s"
(if (integerp exit-code) "exit status" "signal")
exit-code)))
@@ -69,6 +69,11 @@
(lambda (position &optional _quality _coding-system)
(1- (position-bytes position)))))
+;; âformat-messageâ is new in Emacs 25.1. Provide a fallback for older
+;; versions.
+(defalias 'clang-rename--format-message
+ (if (fboundp 'format-message) 'format-message 'format))
+
(provide 'clang-rename)
;;; clang-rename.el ends here
Modified: clang-tools-extra/trunk/include-fixer/tool/clang-include-fixer.el
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/include-fixer/tool/clang-include-fixer.el?rev=283861&r1=283860&r2=283861&view=diff
==============================================================================
--- clang-tools-extra/trunk/include-fixer/tool/clang-include-fixer.el (original)
+++ clang-tools-extra/trunk/include-fixer/tool/clang-include-fixer.el Tue Oct 11 04:15:10 2016
@@ -281,8 +281,8 @@ They are replaced by the single element
(cl-flet ((header (info) (let-alist info .Header)))
;; The header-infos is already sorted by include-fixer.
(let* ((header (ido-completing-read
- (format-message "Select include for '%s': "
- symbol)
+ (clang-include-fixer--format-message
+ "Select include for '%s': " symbol)
(mapcar #'header .HeaderInfos)
nil :require-match nil
'clang-include-fixer--history))
@@ -402,5 +402,10 @@ non-nil. Otherwise return nil."
(lambda (byte &optional _quality _coding-system)
(byte-to-position (1+ byte)))))
+;; âformat-messageâ is new in Emacs 25.1. Provide a fallback for older
+;; versions.
+(defalias 'clang-include-fixer--format-message
+ (if (fboundp 'format-message) 'format-message 'format))
+
(provide 'clang-include-fixer)
;;; clang-include-fixer.el ends here
More information about the cfe-commits
mailing list