• Alan Mackenzie's avatar
    Make compilation mode work with warnings from compiled buffer functions · 1ca436a3
    Alan Mackenzie authored
    In particular, warning messages from compile_defun now contain the source
    buffer name and line and column numbers.  Typing CR on such a warning now
    moves to the pertinent place in the source buffer.
    
    This fixes bug #33475
    
    * lisp/emacs-lisp/bytecomp.el (top-level): Require compile.elc?.
    (emacs-lisp-compilation-file-name-or-buffer)
    (emacs-lisp-compilation-parse-errors-filename-function): New
    variables/constants.
    (emacs-lisp-compilation-mode): New mode derived from compilation-mode.
    (byte-compile-log-file): Check byte-compile-current-file for being a string,
    not merely non-nil.  Change wording in message from "buffer" to "in buffer".
    Go into emacs-lisp-compilation-mode rather than the plain compilation-mode.
    (compile-defun): Bind byte-compile-current-file to current-buffer, not nil.
    
    * lisp/progmodes/compilation-mode
    (compilation-parse-errors-filename-function): Amend comments to specify that
    this function may return a buffer, and that it need not save the match data.
    (Several places): Amend comments to allow for the use of a buffer rather than
    a file name.
    (compilation-next-error-function): If the "file name" in file struct is
    actually a buffer, use it rather than compilation-find-file's result.
    (compilation-get-file-structure): save-match-data around the call to
    compilation-parse-errors-filename-function.  Only call
    command-line-normalize-file-name when `filename' is a string.
    1ca436a3
compile.el 123 KB