aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2020-01-23 12:22:49 -0800
committerGlenn Morris2020-01-23 12:22:49 -0800
commitcd2d812ec1745a7e6de2b29db1a9bf9f1125b501 (patch)
tree9cddda666565b8990778ff1af6814d779dd9b1ec
parentc4687d920db081f29e93cca8156793d545a827e2 (diff)
downloademacs-cd2d812ec1745a7e6de2b29db1a9bf9f1125b501.tar.gz
emacs-cd2d812ec1745a7e6de2b29db1a9bf9f1125b501.zip
Unbreak byte compilation
* lisp/emacs-lisp/bytecomp.el (byte-compile-fix-header): Update for recent header changes. (byte-compile-insert-header): Add more padding.
-rw-r--r--lisp/emacs-lisp/bytecomp.el61
1 files changed, 31 insertions, 30 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 89831823975..d35ce663507 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -2153,36 +2153,36 @@ With argument ARG, insert value in current buffer after the form."
2153 (when (< (point-max) (position-bytes (point-max))) 2153 (when (< (point-max) (position-bytes (point-max)))
2154 (goto-char (point-min)) 2154 (goto-char (point-min))
2155 ;; Find the comment that describes the version condition. 2155 ;; Find the comment that describes the version condition.
2156 (search-forward "\n;;; This file uses") 2156 (when (search-forward "\n;;; This file does not contain utf-8" nil t)
2157 (narrow-to-region (line-beginning-position) (point-max)) 2157 (narrow-to-region (line-beginning-position) (point-max))
2158 ;; Find the first line of ballast semicolons. 2158 ;; Find the first line of ballast semicolons.
2159 (search-forward ";;;;;;;;;;") 2159 (search-forward ";;;;;;;;;;")
2160 (beginning-of-line) 2160 (beginning-of-line)
2161 (narrow-to-region (point-min) (point)) 2161 (narrow-to-region (point-min) (point))
2162 (let ((old-header-end (point)) 2162 (let ((old-header-end (point))
2163 (minimum-version "23") 2163 (minimum-version "23")
2164 delta) 2164 delta)
2165 (delete-region (point-min) (point-max)) 2165 (delete-region (point-min) (point-max))
2166 (insert 2166 (insert
2167 ";;; This file contains utf-8 non-ASCII characters,\n" 2167 ";;; This file contains utf-8 non-ASCII characters,\n"
2168 ";;; and so cannot be loaded into Emacs 22 or earlier.\n" 2168 ";;; and so cannot be loaded into Emacs 22 or earlier.\n"
2169 ;; Have to check if emacs-version is bound so that this works 2169 ;; Have to check if emacs-version is bound so that this works
2170 ;; in files loaded early in loadup.el. 2170 ;; in files loaded early in loadup.el.
2171 "(and (boundp 'emacs-version)\n" 2171 "(and (boundp 'emacs-version)\n"
2172 ;; If there is a name at the end of emacs-version, 2172 ;; If there is a name at the end of emacs-version,
2173 ;; don't try to check the version number. 2173 ;; don't try to check the version number.
2174 " (< (aref emacs-version (1- (length emacs-version))) ?A)\n" 2174 " (< (aref emacs-version (1- (length emacs-version))) ?A)\n"
2175 (format " (string-lessp emacs-version \"%s\")\n" minimum-version) 2175 (format " (string-lessp emacs-version \"%s\")\n" minimum-version)
2176 ;; Because the header must fit in a fixed width, we cannot 2176 ;; Because the header must fit in a fixed width, we cannot
2177 ;; insert arbitrary-length file names (Bug#11585). 2177 ;; insert arbitrary-length file names (Bug#11585).
2178 " (error \"`%s' was compiled for " 2178 " (error \"`%s' was compiled for "
2179 (format "Emacs %s or later\" #$))\n\n" minimum-version)) 2179 (format "Emacs %s or later\" #$))\n\n" minimum-version))
2180 ;; Now compensate for any change in size, to make sure all 2180 ;; Now compensate for any change in size, to make sure all
2181 ;; positions in the file remain valid. 2181 ;; positions in the file remain valid.
2182 (setq delta (- (point-max) old-header-end)) 2182 (setq delta (- (point-max) old-header-end))
2183 (goto-char (point-max)) 2183 (goto-char (point-max))
2184 (widen) 2184 (widen)
2185 (delete-char delta)))) 2185 (delete-char delta)))))
2186 2186
2187(defun byte-compile-insert-header (_filename outbuffer) 2187(defun byte-compile-insert-header (_filename outbuffer)
2188 "Insert a header at the start of OUTBUFFER. 2188 "Insert a header at the start of OUTBUFFER.
@@ -2222,6 +2222,7 @@ Call from the source buffer."
2222 ;; can delete them so as to keep the buffer positions 2222 ;; can delete them so as to keep the buffer positions
2223 ;; constant for the actual compiled code. 2223 ;; constant for the actual compiled code.
2224 ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n" 2224 ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n"
2225 ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n"
2225 ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\n")))) 2226 ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\n"))))
2226 2227
2227(defun byte-compile-output-file-form (form) 2228(defun byte-compile-output-file-form (form)