--- bytecomp.el 2019-12-20 01:05:44.575414147 +0100 +++ mybytecomp.el 2019-12-22 07:35:59.509753178 +0100 @@ -154,6 +154,14 @@ :type '(choice (const nil) function) :version "23.2") +(defcustom byte-compile-allow-literal-comments nil + "If not nil, byte compiler will allow you to type + top-level comments without using semicolon in emacs lisp." + :group 'bytecomp + :type 'boolean + :safe #'booleanp + :version "27.1") + ;; This enables file name handlers such as jka-compr ;; to remove parts of the file name that should not be copied ;; through to the output file name. @@ -2079,8 +2087,8 @@ (print-level nil) ;; Prevent edebug from interfering when we compile ;; and put the output into a file. -;; (edebug-all-defs nil) -;; (edebug-all-forms nil) + ;; (edebug-all-defs nil) + ;; (edebug-all-forms nil) ;; Simulate entry to byte-compile-top-level (byte-compile-jump-tables nil) (byte-compile-constants nil) @@ -2127,19 +2135,35 @@ (= (following-char) ?\;)) (forward-line 1)) (not (eobp))) - (setq byte-compile-read-position (point) + + (setq byte-compile-read-position (point) byte-compile-last-position byte-compile-read-position) - (let* ((lread--unescaped-character-literals nil) - (form (read inbuffer)) - (warning (byte-run--unescaped-character-literals-warning))) - (when warning (byte-compile-warn "%s" warning)) - (byte-compile-toplevel-file-form form))) - ;; Compile pending forms at end of file. - (byte-compile-flush-pending) - ;; Make warnings about unresolved functions - ;; give the end of the file as their position. - (setq byte-compile-last-position (point-max)) - (byte-compile-warn-about-unresolved-functions)) + + (if byte-compile-allow-literal-comments + (progn + (if (= (following-char) ?\() + (progn + + (let* ((lread--unescaped-character-literals nil) + (form (read inbuffer)) + (warning (byte-run--unescaped-character-literals-warning))) + (when warning (byte-compile-warn "%s" warning)) + (byte-compile-toplevel-file-form form))) + (forward-line 1))) + (progn + + (let* ((lread--unescaped-character-literals nil) + (form (read inbuffer)) + (warning (byte-run--unescaped-character-literals-warning))) + (when warning (byte-compile-warn "%s" warning)) + (byte-compile-toplevel-file-form form))))) + + ;; Compile pending forms at end of file. + (byte-compile-flush-pending) + ;; Make warnings about unresolved functions + ;; give the end of the file as their position. + (setq byte-compile-last-position (point-max)) + (byte-compile-warn-about-unresolved-functions)) ;; Fix up the header at the front of the output ;; if the buffer contains multibyte characters. (and byte-compile-current-file