From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#15861: 24.3.50; lots of byte-compiler code written to *Messages* at runtime Date: Mon, 11 Nov 2013 11:30:02 -0800 (PST) Message-ID: <701df652-aa30-4607-97dc-d02075f9094c@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1384198287 14888 80.91.229.3 (11 Nov 2013 19:31:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Nov 2013 19:31:27 +0000 (UTC) To: 15861@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 11 20:31:31 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VfxCr-0005KW-OQ for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Nov 2013 20:31:29 +0100 Original-Received: from localhost ([::1]:39277 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfxCr-0005Sr-01 for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Nov 2013 14:31:29 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfxCe-0005Qv-MB for bug-gnu-emacs@gnu.org; Mon, 11 Nov 2013 14:31:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VfxCQ-0000MB-KE for bug-gnu-emacs@gnu.org; Mon, 11 Nov 2013 14:31:16 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33330) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfxCQ-0000M5-G8 for bug-gnu-emacs@gnu.org; Mon, 11 Nov 2013 14:31:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VfxCQ-00082a-9Q for bug-gnu-emacs@gnu.org; Mon, 11 Nov 2013 14:31:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Nov 2013 19:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15861 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.138419824730888 (code B ref -1); Mon, 11 Nov 2013 19:31:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 11 Nov 2013 19:30:47 +0000 Original-Received: from localhost ([127.0.0.1]:47349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VfxC9-000826-JC for submit@debbugs.gnu.org; Mon, 11 Nov 2013 14:30:46 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49814) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VfxC3-00081m-6S for submit@debbugs.gnu.org; Mon, 11 Nov 2013 14:30:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VfxBn-000071-Pv for submit@debbugs.gnu.org; Mon, 11 Nov 2013 14:30:33 -0500 Original-Received: from lists.gnu.org ([208.118.235.17]:34004) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfxBn-00006x-Mp for submit@debbugs.gnu.org; Mon, 11 Nov 2013 14:30:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51452) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfxBe-0005Es-Ub for bug-gnu-emacs@gnu.org; Mon, 11 Nov 2013 14:30:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VfxBW-0008TI-8u for bug-gnu-emacs@gnu.org; Mon, 11 Nov 2013 14:30:14 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:19158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfxBV-0008Qk-W7 for bug-gnu-emacs@gnu.org; Mon, 11 Nov 2013 14:30:06 -0500 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id rABJU4hD022599 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 11 Nov 2013 19:30:04 GMT Original-Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rABJU3sN004536 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 11 Nov 2013 19:30:04 GMT Original-Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rABJU3q3004514 for ; Mon, 11 Nov 2013 19:30:03 GMT X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:80273 Archived-At: The subject line might not be the best description. And you might not see that this is a bug. In that case, please let me know how to work around the behavior I see, as it is quite annoying. In a Lisp file that I byte-compile and load, I have a redefinition of `ls-lisp--insert-directory'. (I do not see another, better way to accomplish the behavior change I need.) I added this when vanilla Emacs was changed recently to use this function. The bug does not appear for older Emacs code (e.g. older Emacs 24 Dev snapshots, which do not have `ls-lisp--insert-directory'). It is true that I byte-compile this library using Emacs 20, because the library is used with multiple Emacs versions. I don't know whether byte-compiling it in Emacs 24 would make a difference wrt this annoying behavior. If doing that is the answer then I guess I'll have to split the file (the redefinition of this function is only done for Emacs 24.4+, i.e., when that function is `fboundp'). The symptom is that each time this function is called (at runtime, i.e., using Dired), a boatload of binary byte-compile stuff is printed in *Messages*, and the entire doc string is printed there as well. What's more: when I start Emacs with a directory as the target, so it opens in Dired, the entire doc string is shown in the echo area (for which my standalone minibuffer frame is expanded automatically). So a user has to see that whole, irrelevant doc string for a few seconds. Please advise, whether or not you feel this is a bug. What can I do to prevent this noise. To me it seems like a bug: byte-compiled code has no business being logged to *Messages* or shown in the echo area during runtime. But you might not see it that way. Here is the redefinition, in case its relevant to the bug or otherwise helpful (doubtful): ;; REPLACE ORIGINAL in `ls-lisp.el' ;; ;; 1. If wildcard, set FILE to `default-directory' if FILE has no dir compo= nent. ;; 2. In second header line: include the number of files and subdirs in the= directory. ;; (when (fboundp 'ls-lisp--insert-directory) ; Emacs 24.4+ (defun ls-lisp--insert-directory (orig-fun file switches &optional wildca= rd full-directory-p) "Insert directory listing for FILE, formatted according to SWITCHES. Leaves point after the inserted text. SWITCHES may be a string of options, or a list of strings. Optional third arg WILDCARD means treat FILE as shell wildcard. Optional fourth arg FULL-DIRECTORY-P means file is a directory and switches do not contain `d', so that a full listing is expected. This version of the function comes from `ls-lisp.el'. If the value of `ls-lisp-use-insert-directory-program' is non-nil then this advice just delegates the work to ORIG-FUN (the normal `insert-directo= ry' function from `files.el'). But if the value of `ls-lisp-use-insert-directory-program' is nil then it runs a Lisp emulation. The Lisp emulation does not run any external programs or shells. It supports ordinary shell wildcards if `ls-lisp-support-shell-wildcards' is non-nil; otherwise, it interprets wildcards as regular expressions to match file names. It does not support all `ls' switches -- those that work are: A a B C c F G g h i n R r S s t U u X. The l switch is assumed to be always present and cannot be turned off." (if ls-lisp-use-insert-directory-program (funcall orig-fun file switches wildcard full-directory-p) ;; We need the directory in order to find the right handler. (let ((handler (find-file-name-handler (expand-file-name file) 'insert-directory)) (orig-file file) wildcard-regexp) (if handler (funcall handler 'insert-directory file switches wildcard full-directory-p) ;; Remove --dired switch (if (string-match "--dired " switches) (setq switches (replace-match "" nil nil switches))) ;; Convert SWITCHES to a list of characters. (setq switches (delete ?\ (delete ?- (append switches nil)))) ;; Sometimes we get ".../foo*/" as FILE. While the shell and ;; `ls' don't mind, we certainly do, because it makes us think ;; there is no wildcard, only a directory name. (if (and ls-lisp-support-shell-wildcards (string-match "[[?*]" file) ;; Prefer an existing file to wildcards, like ;; dired-noselect does. (not (file-exists-p file))) (progn (or (not (eq (aref file (1- (length file))) ?/)) (setq file (substring file 0 (1- (length file))))) (setq wildcard t))) (if wildcard (setq wildcard-regexp (if ls-lisp-support-shell-wildcards (wildcard-to-regexp (file-name-nondirectory file)) (file-name-nondirectory file)) file (or (file-name-directory file) defaul= t-directory)) (if (memq ?B switches) (setq wildcard-regexp "[^~]\\'"))) (condition-case err (ls-lisp-insert-directory file switches (ls-lisp-time-index switches) wildcard-regexp full-directory-p) (invalid-regexp ;; Maybe they wanted a literal file that just happens to ;; use characters special to shell wildcards. (if (equal (cadr err) "Unmatched [ or [^") (progn (setq wildcard-regexp (if (memq ?B switches) "[^~]\\'") file (file-relative-name orig-file)) (ls-lisp-insert-directory file switches (ls-lisp-time-index switches) nil full-directory-p)) (signal (car err) (cdr err))))) ;; Try to insert the amount of free space. (save-excursion (goto-char (point-min)) (while (re-search-forward "^total" nil t) (beginning-of-line) (let ((counted (save-match-data (count-dired-files)))) (if (zerop counted) (insert "files 0/0 ") (insert "files " (number-to-string counted) "/" (number-to-string (- (length (directory-files default-director= y nil nil t)) 2)) " "))) (goto-char (point-min)) (re-search-forward "^files [0-9]+/[0-9]+ \\(total\\)" nil t) (replace-match "space used" nil nil nil 1) (let ((available (and (fboundp 'get-free-disk-space) (get-free-disk-space "."))) (map (make-sparse-keymap)) (inhibit-field-text-motion t)) ; Just to be sure, for e= ol. (define-key map [mouse-2] 'dired-mouse-describe-listed-directory) (define-key map "\r" 'dired-describe-listed-directory) (when available (end-of-line) (insert " available " availab= le)) (add-text-properties (save-excursion (beginning-of-line) (line-beginning-positi= on)) (1- (match-beginning 1)) `(mouse-face highlight keymap ,map help-echo "Files shown / total files in directory \ \[RET, mouse-2: more info]")) (add-text-properties (match-beginning 1) (line-end-position= ) `(mouse-face highlight keymap ,map help-echo "Kbytes used in directory,= Kbytes \ available on disk [RET, mouse-2: more info]")))))))))) In GNU Emacs 24.3.50.1 (i686-pc-mingw32) of 2013-10-19 on LEG570 Bzr revision: 114715 rgm@gnu.org-20131019023520-s8mwtib7xcx9e05w Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --enable-checking 'CFLAGS=3D-O0 -g3' CPPFLAGS=3D-DGLYPH_DEBUG= =3D1'