unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#24359: 25.1; batch-byte-compile exits with code 0 even if errors occurred
@ 2016-09-03 17:28 Philipp
       [not found] ` <handler.24359.B.147292373921430.ack@debbugs.gnu.org>
  0 siblings, 1 reply; 13+ messages in thread
From: Philipp @ 2016-09-03 17:28 UTC (permalink / raw)
  To: 24359


Create a file /tmp/a.el with the following content:

;;; -*- lexical-binding: t; -*-
(let (a)
  (add-to-list 'a t))

Then run:

$ emacs -batch -Q -f batch-byte-compile /tmp/a.el ; echo $?

In toplevel form:
/tmp/a.el:2:1:Error: ‘add-to-list’ can’t use lexical var ‘a’; use ‘push’ or
    ‘cl-pushnew’
0

Expected behavior: The status code is nonzero because an error occurred.

Actual behavior: The status code is zero.

This is because this class of error (and others) use
byte-compile-log-warning, which doesn't properly set the error flag.



In GNU Emacs 25.1.3 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8)
 of 2016-09-03 built on unknown
Repository revision: 803ad6f7e7a9c6bcf8a6cbf8eaad17501b114a33
Windowing system distributor 'The X.Org Foundation', version 11.0.11702000
System Description:	Ubuntu 14.04 LTS

Configured features:
XPM JPEG TIFF GIF PNG SOUND GSETTINGS NOTIFY GNUTLS FREETYPE XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode easymenu
cl-loaddefs pcase cl-lib mail-prsvr mail-utils time-date mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 87400 6705)
 (symbols 48 19696 0)
 (miscs 40 300 146)
 (strings 32 14554 3984)
 (string-bytes 1 425298)
 (vectors 16 11995)
 (vector-slots 8 435911 5924)
 (floats 8 162 31)
 (intervals 56 184 0)
 (buffers 976 22)
 (heap 1024 35418 1075))





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#24360: Patch for byte compilation bugs
       [not found] ` <handler.24359.B.147292373921430.ack@debbugs.gnu.org>
@ 2016-09-03 18:45   ` Philipp Stephani
  2016-09-04  7:33     ` bug#24359: " martin rudalics
  2016-09-04 21:07     ` bug#24359: " npostavs
  0 siblings, 2 replies; 13+ messages in thread
From: Philipp Stephani @ 2016-09-03 18:45 UTC (permalink / raw)
  To: 24359, 24360


[-- Attachment #1.1: Type: text/plain, Size: 57 bytes --]

I've attached a patch for the two byte compilation bugs.

[-- Attachment #1.2: Type: text/html, Size: 82 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Stop-calling-byte-compile-log-warning.patch --]
[-- Type: text/x-patch; charset=US-ASCII;  name="0001-Stop-calling-byte-compile-log-warning.patch", Size: 12748 bytes --]

From 17e0a8a85c0e3e7da101219dac448dab42be9315 Mon Sep 17 00:00:00 2001
From: Philipp Stephani <phst@google.com>
Date: Sat, 3 Sep 2016 20:37:47 +0200
Subject: [PATCH] =?UTF-8?q?Stop=20calling=20=E2=80=98byte-compile-log-warn?=
 =?UTF-8?q?ing=E2=80=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

For errors, use ‘byte-compile-report-error’ instead so that the error
is registered and causes compilation to fail (Bug#24359).

For warnings, use ‘byte-compile-warn’ instead so that
‘byte-compile-error-on-warn’ is honored (Bug#24360).

* lisp/emacs-lisp/macroexp.el (macroexp--funcall-if-compiled)
(macroexp--warn-and-return): Use ‘byte-compile-warn’ instead of
‘byte-compile-log-warning’.

* lisp/emacs-lisp/bytecomp.el (byte-compile-form, byte-compile-unfold-bcf)
(byte-compile-setq, byte-compile-funcall): Use
‘byte-compile-report-error’ instead of ‘byte-compile-log-warning’.
(byte-compile-log-warning): Convert comment to documentation
string.  Explain that the function shouldn’t be called directly.
(byte-compile-report-error): Add optional FILL argument.

* lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use)
(cconv--analyze-function, cconv-analyze-form): Use
‘byte-compile-warn’ instead of ‘byte-compile-log-warning’.

* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand): Use
‘byte-compile-warn’ instead of ‘byte-compile-log-warning’.

* lisp/subr.el (add-to-list): Use ‘byte-compile-report-error’ instead
of ‘byte-compile-log-warning’.
(do-after-load-evaluation): Use ‘byte-compile-warn’ instead of
‘byte-compile-log-warning’.
---
 lisp/emacs-lisp/byte-opt.el |  4 ++--
 lisp/emacs-lisp/bytecomp.el | 39 ++++++++++++++++++++-------------------
 lisp/emacs-lisp/cconv.el    | 33 ++++++++++++++++-----------------
 lisp/emacs-lisp/macroexp.el |  4 ++--
 lisp/subr.el                |  4 ++--
 5 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index dbaf2bc..610c3b6 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -288,8 +288,8 @@ byte-compile-inline-expand
            (if (eq (car-safe newfn) 'function)
                (byte-compile-unfold-lambda `(,(cadr newfn) ,@(cdr form)))
              ;; This can happen because of macroexp-warn-and-return &co.
-             (byte-compile-log-warning
-              (format "Inlining closure %S failed" name))
+             (byte-compile-warn
+              "Inlining closure %S failed" name)
              form))))
 
       (_ ;; Give up on inlining.
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 175690a..628f7cb 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1160,9 +1160,13 @@ byte-compile-log-file
 	   (compilation-forget-errors)
 	   pt))))
 
-;; Log a message STRING in `byte-compile-log-buffer'.
-;; Also log the current function and file if not already done.
 (defun byte-compile-log-warning (string &optional fill level)
+  "Log a message STRING in `byte-compile-log-buffer'.
+Also log the current function and file if not already done.  If
+FILL is non-nil, set ‘warning-fill-prefix’ to four spaces.  LEVEL
+is the warning level (‘:warning’ or ‘:error’).  Do not call this
+function directly; use ‘byte-compile-warn’ or
+‘byte-compile-report-error’ instead."
   (let ((warning-prefix-function 'byte-compile-warning-prefix)
 	(warning-type-format "")
 	(warning-fill-prefix (if fill "    ")))
@@ -1186,15 +1190,16 @@ byte-compile-warn-obsolete
       (unless (and funcp (memq symbol byte-compile-not-obsolete-funcs))
 	(byte-compile-warn "%s" msg)))))
 
-(defun byte-compile-report-error (error-info)
+(defun byte-compile-report-error (error-info &optional fill)
   "Report Lisp error in compilation.
 ERROR-INFO is the error data, in the form of either (ERROR-SYMBOL . DATA)
-or STRING."
+or STRING.  If FILL is non-nil, set ‘warning-fill-prefix’ to four spaces
+when printing the error message."
   (setq byte-compiler-error-flag t)
   (byte-compile-log-warning
    (if (stringp error-info) error-info
      (error-message-string error-info))
-   nil :error))
+   fill :error))
 \f
 ;;; sanity-checking arglists
 
@@ -3025,9 +3030,8 @@ byte-compile-form
           (pcase (cdr form)
             (`(',var . ,_)
              (when (assq var byte-compile-lexical-variables)
-               (byte-compile-log-warning
-                (format-message "%s cannot use lexical var `%s'" fn var)
-                nil :error)))))
+               (byte-compile-report-error
+                (format-message "%s cannot use lexical var `%s'" fn var))))))
         (when (macroexp--const-symbol-p fn)
           (byte-compile-warn "`%s' called as a function" fn))
 	(when (and (byte-compile-warning-enabled-p 'interactive-only)
@@ -3044,9 +3048,8 @@ byte-compile-form
                                                     interactive-only))
 				   (t "."))))
         (if (eq (car-safe (symbol-function (car form))) 'macro)
-            (byte-compile-log-warning
-             (format "Forgot to expand macro %s in %S" (car form) form)
-             nil :error))
+            (byte-compile-report-error
+             (format "Forgot to expand macro %s in %S" (car form) form)))
         (if (and handler
                  ;; Make sure that function exists.
                  (and (functionp handler)
@@ -3143,9 +3146,8 @@ byte-compile-unfold-bcf
       (dotimes (_ (- (/ (1+ fmax2) 2) alen))
         (byte-compile-push-constant nil)))
      ((zerop (logand fmax2 1))
-      (byte-compile-log-warning
-       (format "Too many arguments for inlined function %S" form)
-       nil :error)
+      (byte-compile-report-error
+       (format "Too many arguments for inlined function %S" form))
       (byte-compile-discard (- alen (/ fmax2 2))))
      (t
       ;; Turn &rest args into a list.
@@ -3755,10 +3757,9 @@ byte-compile-setq
          (len (length args)))
     (if (= (logand len 1) 1)
         (progn
-          (byte-compile-log-warning
+          (byte-compile-report-error
            (format-message
-            "missing value for `%S' at end of setq" (car (last args)))
-           nil :error)
+            "missing value for `%S' at end of setq" (car (last args))))
           (byte-compile-form
            `(signal 'wrong-number-of-arguments '(setq ,len))
            byte-compile--for-effect))
@@ -4028,8 +4029,8 @@ byte-compile-funcall
       (progn
         (mapc 'byte-compile-form (cdr form))
         (byte-compile-out 'byte-call (length (cdr (cdr form)))))
-    (byte-compile-log-warning
-     (format-message "`funcall' called with no arguments") nil :error)
+    (byte-compile-report-error
+     (format-message "`funcall' called with no arguments"))
     (byte-compile-form '(signal 'wrong-number-of-arguments '(funcall 0))
                        byte-compile--for-effect)))
 
diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el
index 9f84367..46b5a7f 100644
--- a/lisp/emacs-lisp/cconv.el
+++ b/lisp/emacs-lisp/cconv.el
@@ -325,9 +325,9 @@ cconv-convert
 		(var (if (not (consp binder))
 			 (prog1 binder (setq binder (list binder)))
                        (when (cddr binder)
-                         (byte-compile-log-warning
-                          (format-message "Malformed `%S' binding: %S"
-                                          letsym binder)))
+                         (byte-compile-warn
+                          "Malformed `%S' binding: %S"
+                          letsym binder))
 		       (setq value (cadr binder))
 		       (car binder)))
 		(new-val
@@ -568,8 +568,8 @@ cconv--analyze-use
     (`(,_ nil nil nil nil) nil)
     (`((,(and var (guard (eq ?_ (aref (symbol-name var) 0)))) . ,_)
        ,_ ,_ ,_ ,_)
-     (byte-compile-log-warning
-      (format-message "%s `%S' not left unused" varkind var))))
+     (byte-compile-warn
+      "%s `%S' not left unused" varkind var)))
   (pcase vardata
     (`((,var . ,_) nil ,_ ,_ nil)
      ;; FIXME: This gives warnings in the wrong order, with imprecise line
@@ -581,8 +581,8 @@ cconv--analyze-use
               (eq ?_ (aref (symbol-name var) 0))
 	      ;; As a special exception, ignore "ignore".
 	      (eq var 'ignored))
-       (byte-compile-log-warning (format-message "Unused lexical %s `%S'"
-                                                 varkind var))))
+       (byte-compile-warn "Unused lexical %s `%S'"
+                          varkind var)))
     ;; If it's unused, there's no point converting it into a cons-cell, even if
     ;; it's captured and mutated.
     (`(,binder ,_ t t ,_)
@@ -606,9 +606,9 @@ cconv--analyze-function
     (dolist (arg args)
       (cond
        ((byte-compile-not-lexical-var-p arg)
-        (byte-compile-log-warning
-         (format "Lexical argument shadows the dynamic variable %S"
-                 arg)))
+        (byte-compile-warn
+         "Lexical argument shadows the dynamic variable %S"
+         arg))
        ((eq ?& (aref (symbol-name arg) 0)) nil) ;Ignore &rest, &optional, ...
        (t (let ((varstruct (list arg nil nil nil nil)))
             (cl-pushnew arg byte-compile-lexical-variables)
@@ -690,9 +690,8 @@ cconv-analyze-form
        (setq forms (cddr forms))))
 
     (`((lambda . ,_) . ,_)             ; First element is lambda expression.
-     (byte-compile-log-warning
-      (format "Use of deprecated ((lambda %s ...) ...) form" (nth 1 (car form)))
-      t :warning)
+     (byte-compile-warn
+      "Use of deprecated ((lambda %s ...) ...) form" (nth 1 (car form)))
      (dolist (exp `((function ,(car form)) . ,(cdr form)))
        (cconv-analyze-form exp env)))
 
@@ -701,8 +700,8 @@ cconv-analyze-form
        (dolist (form forms) (cconv-analyze-form form env))))
 
     ;; ((and `(quote ,v . ,_) (guard (assq v env)))
-    ;;  (byte-compile-log-warning
-    ;;   (format-message "Possible confusion variable/symbol for `%S'" v)))
+    ;;  (byte-compile-warn
+    ;;   "Possible confusion variable/symbol for `%S'" v))
 
     (`(quote . ,_) nil)                 ; quote form
     (`(function . ,_) nil)              ; same as quote
@@ -719,8 +718,8 @@ cconv-analyze-form
     (`(condition-case ,var ,protected-form . ,handlers)
      (cconv-analyze-form protected-form env)
      (when (and var (symbolp var) (byte-compile-not-lexical-var-p var))
-       (byte-compile-log-warning
-        (format "Lexical variable shadows the dynamic variable %S" var)))
+       (byte-compile-warn
+        "Lexical variable shadows the dynamic variable %S" var))
      (let* ((varstruct (list var nil nil nil nil)))
        (if var (push varstruct env))
        (dolist (handler handlers)
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index 310ca29..6d89145 100644
--- a/lisp/emacs-lisp/macroexp.el
+++ b/lisp/emacs-lisp/macroexp.el
@@ -103,7 +103,7 @@ macroexp--compiler-macro
 (defun macroexp--funcall-if-compiled (_form)
   "Pseudo function used internally by macroexp to delay warnings.
 The purpose is to delay warnings to bytecomp.el, so they can use things
-like `byte-compile-log-warning' to get better file-and-line-number data
+like `byte-compile-warn' to get better file-and-line-number data
 and also to avoid outputting the warning during normal execution."
   nil)
 (put 'macroexp--funcall-if-compiled 'byte-compile
@@ -122,7 +122,7 @@ macroexp--compiling-p
 (defvar macroexp--warned (make-hash-table :test #'equal :weakness 'key))
 
 (defun macroexp--warn-and-return (msg form &optional compile-only)
-  (let ((when-compiled (lambda () (byte-compile-log-warning msg t))))
+  (let ((when-compiled (lambda () (byte-compile-warn "%s" msg))))
     (cond
      ((null msg) form)
      ((macroexp--compiling-p)
diff --git a/lisp/subr.el b/lisp/subr.el
index 96917b9..e913e37 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1635,7 +1635,7 @@ add-to-list
                           ;; FIXME: We should also emit a warning for let-bound
                           ;; variables with dynamic binding.
                           (when (assq sym byte-compile--lexical-environment)
-                            (byte-compile-log-warning msg t :error))))
+                            (byte-compile-report-error msg :fill))))
                (code
                 (macroexp-let2 macroexp-copyable-p x element
                   `(if ,(if compare-fn
@@ -4058,7 +4058,7 @@ do-after-load-evaluation
 				       (expand-file-name
 					byte-compile-current-file
 					byte-compile-root-dir)))
-	    (byte-compile-log-warning msg))
+	    (byte-compile-warn "%s" msg))
 	(run-with-timer 0 nil
 			(lambda (msg)
 			  (message "%s" msg))
-- 
2.8.0.rc3.226.g39d4020


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* bug#24359: bug#24360: Patch for byte compilation bugs
  2016-09-03 18:45   ` bug#24360: Patch for byte compilation bugs Philipp Stephani
@ 2016-09-04  7:33     ` martin rudalics
  2016-09-04  8:45       ` bug#24360: " Andreas Schwab
  2016-09-04  8:56       ` Philipp Stephani
  2016-09-04 21:07     ` bug#24359: " npostavs
  1 sibling, 2 replies; 13+ messages in thread
From: martin rudalics @ 2016-09-04  7:33 UTC (permalink / raw)
  To: Philipp Stephani, 24359, 24360

Pardon me this technical question: Receiving this in Thunderbird (on
Windows XP) gets me:


From: Philipp Stephani <phst@google.com>
Date: Sat, 3 Sep 2016 20:37:47 +0200
Subject: [PATCH] =?UTF-8?q?Stop=20calling=20=E2=80=98byte-compile-log-warn?=
  =?UTF-8?q?ing=E2=80=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

For errors, use ‘byte-compile-report-error’ instead so that the error
is registered and causes compilation to fail (Bug#24359).

For warnings, use ‘byte-compile-warn’ instead so that
‘byte-compile-error-on-warn’ is honored (Bug#24360).



What do I have to do to see the '`'...'´' correctly?

martin






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#24360: bug#24359: bug#24360: Patch for byte compilation bugs
  2016-09-04  7:33     ` bug#24359: " martin rudalics
@ 2016-09-04  8:45       ` Andreas Schwab
  2016-09-04  9:34         ` martin rudalics
  2016-09-04  8:56       ` Philipp Stephani
  1 sibling, 1 reply; 13+ messages in thread
From: Andreas Schwab @ 2016-09-04  8:45 UTC (permalink / raw)
  To: martin rudalics; +Cc: 24359, Philipp Stephani, 24360

On Sep 04 2016, martin rudalics <rudalics@gmx.at> wrote:

> Pardon me this technical question: Receiving this in Thunderbird (on
> Windows XP) gets me:
>
>
> From: Philipp Stephani <phst@google.com>
> Date: Sat, 3 Sep 2016 20:37:47 +0200
> Subject: [PATCH] =?UTF-8?q?Stop=20calling=20=E2=80=98byte-compile-log-warn?=
>  =?UTF-8?q?ing=E2=80=99?=
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> For errors, use ‘byte-compile-report-error’ instead so that the error
> is registered and causes compilation to fail (Bug#24359).
>
> For warnings, use ‘byte-compile-warn’ instead so that
> ‘byte-compile-error-on-warn’ is honored (Bug#24360).
>
>
>
> What do I have to do to see the '`'...'´' correctly?

You can pass it directly to git am.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#24359: bug#24360: Patch for byte compilation bugs
  2016-09-04  7:33     ` bug#24359: " martin rudalics
  2016-09-04  8:45       ` bug#24360: " Andreas Schwab
@ 2016-09-04  8:56       ` Philipp Stephani
  2016-09-04  9:35         ` martin rudalics
  1 sibling, 1 reply; 13+ messages in thread
From: Philipp Stephani @ 2016-09-04  8:56 UTC (permalink / raw)
  To: martin rudalics, 24359, 24360

[-- Attachment #1: Type: text/plain, Size: 1200 bytes --]

Seems Inbox generates an incorrect header for the attachment:

  Content-Type: text/x-patch; charset=US-ASCII

The following would be more appropriate:

  Content-Type: text/plain; charset=UTF-8

I've reported this; sorry for the trouble. You should be able to correctly
see the patch by downloading it an opening the file in Emacs.

martin rudalics <rudalics@gmx.at> schrieb am So., 4. Sep. 2016 um 09:33 Uhr:

> Pardon me this technical question: Receiving this in Thunderbird (on
> Windows XP) gets me:
>
>
> From: Philipp Stephani <phst@google.com>
> Date: Sat, 3 Sep 2016 20:37:47 +0200
> Subject: [PATCH]
> =?UTF-8?q?Stop=20calling=20=E2=80=98byte-compile-log-warn?=
>   =?UTF-8?q?ing=E2=80=99?=
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> For errors, use ‘byte-compile-report-error’ instead so that the error
> is registered and causes compilation to fail (Bug#24359).
>
> For warnings, use ‘byte-compile-warn’ instead so that
> ‘byte-compile-error-on-warn’ is honored (Bug#24360).
>
>
>
> What do I have to do to see the '`'...'´' correctly?
>
> martin
>
>

[-- Attachment #2: Type: text/html, Size: 1662 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#24359: bug#24360: Patch for byte compilation bugs
  2016-09-04  8:45       ` bug#24360: " Andreas Schwab
@ 2016-09-04  9:34         ` martin rudalics
  0 siblings, 0 replies; 13+ messages in thread
From: martin rudalics @ 2016-09-04  9:34 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 24359, Philipp Stephani

 >> From: Philipp Stephani <phst@google.com>
 >> Date: Sat, 3 Sep 2016 20:37:47 +0200
 >> Subject: [PATCH] =?UTF-8?q?Stop=20calling=20=E2=80=98byte-compile-log-warn?=
 >>   =?UTF-8?q?ing=E2=80=99?=
 >> MIME-Version: 1.0
 >> Content-Type: text/plain; charset=UTF-8
 >> Content-Transfer-Encoding: 8bit
 >>
 >> For errors, use ‘byte-compile-report-error’ instead so that the error
 >> is registered and causes compilation to fail (Bug#24359).
 >>
 >> For warnings, use ‘byte-compile-warn’ instead so that
 >> ‘byte-compile-error-on-warn’ is honored (Bug#24360).
 >>
 >>
 >>
 >> What do I have to do to see the '`'...'´' correctly?
 >
 > You can pass it directly to git am.

Yes.  But I wonder why Thunderbird does not handle that.  IIUC
there's nothing fishy in the headers above.

martin






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#24359: bug#24360: Patch for byte compilation bugs
  2016-09-04  8:56       ` Philipp Stephani
@ 2016-09-04  9:35         ` martin rudalics
  2016-09-04 10:40           ` Andreas Schwab
  0 siblings, 1 reply; 13+ messages in thread
From: martin rudalics @ 2016-09-04  9:35 UTC (permalink / raw)
  To: Philipp Stephani, 24359

 > Seems Inbox generates an incorrect header for the attachment:
 >
 >    Content-Type: text/x-patch; charset=US-ASCII
 >
 > The following would be more appropriate:
 >
 >    Content-Type: text/plain; charset=UTF-8

But what I see is the latter.  I'm afraid there's some internal setting
that confuses Thunderbird.

 > I've reported this; sorry for the trouble. You should be able to correctly
 > see the patch by downloading it an opening the file in Emacs.

Sure.  No problems in this regard.

martin





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#24359: bug#24360: Patch for byte compilation bugs
  2016-09-04  9:35         ` martin rudalics
@ 2016-09-04 10:40           ` Andreas Schwab
  2016-09-04 11:22             ` martin rudalics
  0 siblings, 1 reply; 13+ messages in thread
From: Andreas Schwab @ 2016-09-04 10:40 UTC (permalink / raw)
  To: martin rudalics; +Cc: 24359, Philipp Stephani

On Sep 04 2016, martin rudalics <rudalics@gmx.at> wrote:

>> Seems Inbox generates an incorrect header for the attachment:
>>
>>    Content-Type: text/x-patch; charset=US-ASCII
>>
>> The following would be more appropriate:
>>
>>    Content-Type: text/plain; charset=UTF-8
>
> But what I see is the latter.  I'm afraid there's some internal setting
> that confuses Thunderbird.

The former is part of the attachment header.  You can only see it in the
raw message.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#24359: bug#24360: Patch for byte compilation bugs
  2016-09-04 10:40           ` Andreas Schwab
@ 2016-09-04 11:22             ` martin rudalics
  0 siblings, 0 replies; 13+ messages in thread
From: martin rudalics @ 2016-09-04 11:22 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 24359, Philipp Stephani

 >>> Seems Inbox generates an incorrect header for the attachment:
 >>>
 >>>     Content-Type: text/x-patch; charset=US-ASCII
 >>>
 >>> The following would be more appropriate:
 >>>
 >>>     Content-Type: text/plain; charset=UTF-8
 >>
 >> But what I see is the latter.  I'm afraid there's some internal setting
 >> that confuses Thunderbird.
 >
 > The former is part of the attachment header.  You can only see it in the
 > raw message.

I can see it now.  Thank you.

martin





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#24359: Patch for byte compilation bugs
  2016-09-03 18:45   ` bug#24360: Patch for byte compilation bugs Philipp Stephani
  2016-09-04  7:33     ` bug#24359: " martin rudalics
@ 2016-09-04 21:07     ` npostavs
  2016-09-11 16:05       ` Philipp Stephani
  1 sibling, 1 reply; 13+ messages in thread
From: npostavs @ 2016-09-04 21:07 UTC (permalink / raw)
  To: Philipp Stephani; +Cc: 24359


There was some suggestion in #23495 (to which I've merged this bug) that
it may have been on purpose, but no confirmation of that, and it doesn't
really make sense to me, so I think your patch is a good idea.

Philipp Stephani <p.stephani2@gmail.com> writes:
>
> * lisp/emacs-lisp/macroexp.el (macroexp--funcall-if-compiled)
> (macroexp--warn-and-return): Use ‘byte-compile-warn’ instead of
> ‘byte-compile-log-warning’.
>
> * lisp/emacs-lisp/bytecomp.el (byte-compile-form, byte-compile-unfold-bcf)
> (byte-compile-setq, byte-compile-funcall): Use
> ‘byte-compile-report-error’ instead of ‘byte-compile-log-warning’.
[...]
> * lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use)
> (cconv--analyze-function, cconv-analyze-form): Use
> ‘byte-compile-warn’ instead of ‘byte-compile-log-warning’.
>
> * lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand): Use
> ‘byte-compile-warn’ instead of ‘byte-compile-log-warning’.
>
> * lisp/subr.el (add-to-list): Use ‘byte-compile-report-error’ instead
> of ‘byte-compile-log-warning’.
> (do-after-load-evaluation): Use ‘byte-compile-warn’ instead of
> ‘byte-compile-log-warning’.

I think you can combine all these into one entry.

>  (defun byte-compile-log-warning (string &optional fill level)
> +  "Log a message STRING in `byte-compile-log-buffer'.
> +Also log the current function and file if not already done.  If
> +FILL is non-nil, set ‘warning-fill-prefix’ to four spaces.  LEVEL

Docstrings should use `', which will be converted to ‘’ upon display.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#24359: Patch for byte compilation bugs
  2016-09-04 21:07     ` bug#24359: " npostavs
@ 2016-09-11 16:05       ` Philipp Stephani
  2016-09-11 16:36         ` npostavs
  2016-10-08 23:53         ` npostavs
  0 siblings, 2 replies; 13+ messages in thread
From: Philipp Stephani @ 2016-09-11 16:05 UTC (permalink / raw)
  To: npostavs; +Cc: 24359

[-- Attachment #1: Type: text/plain, Size: 2026 bytes --]

<npostavs@users.sourceforge.net> schrieb am So., 4. Sep. 2016 um 23:07 Uhr:

>
> There was some suggestion in #23495 (to which I've merged this bug) that
> it may have been on purpose, but no confirmation of that, and it doesn't
> really make sense to me, so I think your patch is a good idea.
>

Thanks. Since nobody complained or provided arguments for the current
behavior, I've pushed it to master.


>
> Philipp Stephani <p.stephani2@gmail.com> writes:
> >
> > * lisp/emacs-lisp/macroexp.el (macroexp--funcall-if-compiled)
> > (macroexp--warn-and-return): Use ‘byte-compile-warn’ instead of
> > ‘byte-compile-log-warning’.
> >
> > * lisp/emacs-lisp/bytecomp.el (byte-compile-form,
> byte-compile-unfold-bcf)
> > (byte-compile-setq, byte-compile-funcall): Use
> > ‘byte-compile-report-error’ instead of ‘byte-compile-log-warning’.
> [...]
> > * lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use)
> > (cconv--analyze-function, cconv-analyze-form): Use
> > ‘byte-compile-warn’ instead of ‘byte-compile-log-warning’.
> >
> > * lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand): Use
> > ‘byte-compile-warn’ instead of ‘byte-compile-log-warning’.
> >
> > * lisp/subr.el (add-to-list): Use ‘byte-compile-report-error’ instead
> > of ‘byte-compile-log-warning’.
> > (do-after-load-evaluation): Use ‘byte-compile-warn’ instead of
> > ‘byte-compile-log-warning’.
>
> I think you can combine all these into one entry.
>

I wouldn't know how, as they are for different files, and AFAIK the
changelog format doesn't allow combining messages across files.


>
> >  (defun byte-compile-log-warning (string &optional fill level)
> > +  "Log a message STRING in `byte-compile-log-buffer'.
> > +Also log the current function and file if not already done.  If
> > +FILL is non-nil, set ‘warning-fill-prefix’ to four spaces.  LEVEL
>
> Docstrings should use `', which will be converted to ‘’ upon display.
>

Done.

[-- Attachment #2: Type: text/html, Size: 3481 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#24359: Patch for byte compilation bugs
  2016-09-11 16:05       ` Philipp Stephani
@ 2016-09-11 16:36         ` npostavs
  2016-10-08 23:53         ` npostavs
  1 sibling, 0 replies; 13+ messages in thread
From: npostavs @ 2016-09-11 16:36 UTC (permalink / raw)
  To: Philipp Stephani; +Cc: 24359

Philipp Stephani <p.stephani2@gmail.com> writes:

>  Philipp Stephani <p.stephani2@gmail.com> writes:
>  >
>  > * lisp/emacs-lisp/macroexp.el (macroexp--funcall-if-compiled)
>  > (macroexp--warn-and-return): Use ‘byte-compile-warn’ instead of
>  > ‘byte-compile-log-warning’.
>  >
>  > * lisp/emacs-lisp/bytecomp.el (byte-compile-form, byte-compile-unfold-bcf)
>  > (byte-compile-setq, byte-compile-funcall): Use
>  > ‘byte-compile-report-error’ instead of ‘byte-compile-log-warning’.
>  [...]
>  > * lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use)
>  > (cconv--analyze-function, cconv-analyze-form): Use
>  > ‘byte-compile-warn’ instead of ‘byte-compile-log-warning’.
>  >
>  > * lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand): Use
>  > ‘byte-compile-warn’ instead of ‘byte-compile-log-warning’.
>  >
>  > * lisp/subr.el (add-to-list): Use ‘byte-compile-report-error’ instead
>  > of ‘byte-compile-log-warning’.
>  > (do-after-load-evaluation): Use ‘byte-compile-warn’ instead of
>  > ‘byte-compile-log-warning’.
>
>  I think you can combine all these into one entry.
>
> I wouldn't know how, as they are for different files, and AFAIK the changelog format doesn't allow combining messages across files.

Just put them together like entries in the same file, e.g.

* lisp/emacs-lisp/macroexp.el (macroexp--funcall-if-compiled)
(macroexp--warn-and-return):
* lisp/emacs-lisp/bytecomp.el (byte-compile-form, byte-compile-unfold-bcf)
(byte-compile-setq, byte-compile-funcall): Use
‘byte-compile-report-error’ and ‘byte-compile-warn’ instead of
‘byte-compile-log-warning’.

Another example is in 6acff252:

    * src/window.c (window_scroll_pixel_based):
    * src/xdisp.c (pos_visible_p): Don't allow simulated redisplay to
    start outside the accessible portion of the buffer.  This avoids
    assertion violations when some Lisp narrows the buffer to less
    than the current window, and then attempts to scroll the buffer.






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#24359: Patch for byte compilation bugs
  2016-09-11 16:05       ` Philipp Stephani
  2016-09-11 16:36         ` npostavs
@ 2016-10-08 23:53         ` npostavs
  1 sibling, 0 replies; 13+ messages in thread
From: npostavs @ 2016-10-08 23:53 UTC (permalink / raw)
  To: Philipp Stephani; +Cc: 24359

merge 24359 24360
tags 24359 fixed
close 24359 26
quit

Philipp Stephani <p.stephani2@gmail.com> writes:

> <npostavs@users.sourceforge.net> schrieb am So., 4. Sep. 2016 um 23:07 Uhr:
>
>  There was some suggestion in #23495 (to which I've merged this bug) that
>  it may have been on purpose, but no confirmation of that, and it doesn't
>  really make sense to me, so I think your patch is a good idea.
>
> Thanks. Since nobody complained or provided arguments for the current behavior, I've pushed it to master.

Closing as fixed.






^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-10-08 23:53 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-03 17:28 bug#24359: 25.1; batch-byte-compile exits with code 0 even if errors occurred Philipp
     [not found] ` <handler.24359.B.147292373921430.ack@debbugs.gnu.org>
2016-09-03 18:45   ` bug#24360: Patch for byte compilation bugs Philipp Stephani
2016-09-04  7:33     ` bug#24359: " martin rudalics
2016-09-04  8:45       ` bug#24360: " Andreas Schwab
2016-09-04  9:34         ` martin rudalics
2016-09-04  8:56       ` Philipp Stephani
2016-09-04  9:35         ` martin rudalics
2016-09-04 10:40           ` Andreas Schwab
2016-09-04 11:22             ` martin rudalics
2016-09-04 21:07     ` bug#24359: " npostavs
2016-09-11 16:05       ` Philipp Stephani
2016-09-11 16:36         ` npostavs
2016-10-08 23:53         ` npostavs

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).