From 3cba92d42ecf2156296b5f05c07a3d1ded78218e Mon Sep 17 00:00:00 2001 From: Daniel Lopez Date: Thu, 14 Feb 2019 16:05:10 +0000 Subject: [PATCH 1/2] Fix faces in compilation messages * lisp/progmodes/compile.el (compilation-parse-errors): Don't clobber the value of TYPE inside the loop. (Bug#34479) Copyright-paperwork-exempt: yes --- lisp/progmodes/compile.el | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index a5dcbd7d384..5312a55a258 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1429,17 +1429,17 @@ to `compilation-error-regexp-alist' if RULES is nil." file line end-line col end-col (or type 2) fmt)) (when (integerp file) - (setq type (if (consp type) - (compilation-type type) - (or type 2))) - (compilation--note-type type) + (let ((this-type (if (consp type) + (compilation-type type) + (or type 2)))) + (compilation--note-type type) - (compilation--put-prop - file 'font-lock-face - (symbol-value (aref [compilation-info-face - compilation-warning-face - compilation-error-face] - type)))) + (compilation--put-prop + file 'font-lock-face + (symbol-value (aref [compilation-info-face + compilation-warning-face + compilation-error-face] + this-type))))) (compilation--put-prop line 'font-lock-face compilation-line-face) From f721084f788dbbbf114c47f87af7d5771b5fb769 Mon Sep 17 00:00:00 2001 From: "Victor J. Orlikowski" Date: Sun, 10 Feb 2019 11:13:57 -0500 Subject: [PATCH 2/2] Avoid errors in erc-dcc.el when erc-dcc-verbose is non-nil * lisp/erc/erc-dcc.el (erc-dcc-get-filter): Don't assume STR is always a string. Use 'buffer-name' to get the DCC file name, as buffer-file-name is not set in the process buffer. Copyright-paperwork-exempt: yes --- lisp/erc/erc-dcc.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index c530b26c05f..2b41c8c705b 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el @@ -989,17 +989,20 @@ rather than every 1024 byte block, but nobody seems to care." (let ((inhibit-read-only t) received-bytes) (goto-char (point-max)) - (insert (string-make-unibyte str)) + (if str + (insert (string-make-unibyte str))) (when (> (point-max) erc-dcc-receive-cache) (erc-dcc-append-contents (current-buffer) erc-dcc-file-name)) - (setq received-bytes (+ (buffer-size) erc-dcc-byte-count)) + (setq received-bytes (buffer-size)) + (if erc-dcc-byte-count + (setq received-bytes (+ received-bytes erc-dcc-byte-count))) (and erc-dcc-verbose (erc-display-message nil 'notice erc-server-process 'dcc-get-bytes-received - ?f (file-name-nondirectory buffer-file-name) + ?f (file-name-nondirectory (buffer-name)) ?b (number-to-string received-bytes))) (cond ((and (> (plist-get erc-dcc-entry-data :size) 0) @@ -1007,7 +1010,7 @@ rather than every 1024 byte block, but nobody seems to care." (erc-display-message nil '(notice error) 'active 'dcc-get-file-too-long - ?f (file-name-nondirectory buffer-file-name)) + ?f (file-name-nondirectory (buffer-name))) (delete-process proc)) (t (process-send-string