From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Phil Sainty Newsgroups: gmane.emacs.bugs Subject: bug#42930: [PATCH][ELPA] 27.1; 'vlf' package byte-compilation and load errors Date: Thu, 20 Aug 2020 00:52:14 +1200 Message-ID: <96c30e2f-5da4-a632-e62d-3bfe1a43f39d@orcon.net.nz> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------5256AAFA08F85BA6870A5F76" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28496"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 To: 42930@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 19 14:53:09 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k8NaW-0007J1-Li for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Aug 2020 14:53:08 +0200 Original-Received: from localhost ([::1]:49828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k8NaV-0006NA-Nq for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Aug 2020 08:53:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k8NaQ-0006N3-26 for bug-gnu-emacs@gnu.org; Wed, 19 Aug 2020 08:53:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55203) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k8NaP-00042g-PW for bug-gnu-emacs@gnu.org; Wed, 19 Aug 2020 08:53:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k8NaP-0000Ih-OY for bug-gnu-emacs@gnu.org; Wed, 19 Aug 2020 08:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Aug 2020 12:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 42930 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15978415451106 (code B ref -1); Wed, 19 Aug 2020 12:53:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Aug 2020 12:52:25 +0000 Original-Received: from localhost ([127.0.0.1]:38516 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8NZp-0000Hl-6p for submit@debbugs.gnu.org; Wed, 19 Aug 2020 08:52:25 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:56702) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8NZn-0000He-ID for submit@debbugs.gnu.org; Wed, 19 Aug 2020 08:52:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k8NZn-0005wx-A1 for bug-gnu-emacs@gnu.org; Wed, 19 Aug 2020 08:52:23 -0400 Original-Received: from smtp-2.orcon.net.nz ([60.234.4.43]:36477) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k8NZl-0003xL-9G for bug-gnu-emacs@gnu.org; Wed, 19 Aug 2020 08:52:23 -0400 Original-Received: from [101.53.216.96] (port=1792 helo=[192.168.20.103]) by smtp-2.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1k8NZe-00086u-BX for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2020 00:52:14 +1200 Content-Language: en-GB X-GeoIP: NZ Received-SPF: pass client-ip=60.234.4.43; envelope-from=psainty@orcon.net.nz; helo=smtp-2.orcon.net.nz X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/19 08:52:16 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:185590 Archived-At: This is a multi-part message in MIME format. --------------5256AAFA08F85BA6870A5F76 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit When `large-file-warning-threshold' is set to nil (meaning "never request confirmation"), the definition for `vlf-tune-max' calls `max' with nil as an argument. This then signals "Wrong type argument: number-or-marker-p, nil" when byte-compiling or loading any of the libraries which (require 'vlf-tune). On 27.1 with that var set to nil, M-x package-install RET vlf RET gives: Compiling file /path/to/vlf-1.7.1/vlf-base.el at Thu Aug 20 00:06:31 2020 vlf-base.el:30:1:Error: Wrong type argument: number-or-marker-p, nil Compiling file /path/to/vlf-1.7.1/vlf-ediff.el at Thu Aug 20 00:06:31 2020 vlf-ediff.el:30:1:Error: Wrong type argument: number-or-marker-p, nil Compiling file /path/to/vlf-1.7.1/vlf-follow.el at Thu Aug 20 00:06:31 2020 vlf-follow.el:30:1:Error: Wrong type argument: number-or-marker-p, nil Compiling file /path/to/vlf-1.7.1/vlf-occur.el at Thu Aug 20 00:06:32 2020 vlf-occur.el:30:1:Error: Wrong type argument: number-or-marker-p, nil Compiling file /path/to/vlf-1.7.1/vlf-pkg.el at Thu Aug 20 00:06:32 2020 Compiling file /path/to/vlf-1.7.1/vlf-search.el at Thu Aug 20 00:06:32 2020 vlf-search.el:30:1:Error: Wrong type argument: number-or-marker-p, nil Compiling file /path/to/vlf-1.7.1/vlf-setup.el at Thu Aug 20 00:06:32 2020 Compiling file /path/to/vlf-1.7.1/vlf-tune.el at Thu Aug 20 00:06:32 2020 Compiling file /path/to/vlf-1.7.1/vlf-write.el at Thu Aug 20 00:06:32 2020 vlf-write.el:30:1:Error: Wrong type argument: number-or-marker-p, nil Compiling file /path/to/vlf-1.7.1/vlf.el at Thu Aug 20 00:06:32 2020 vlf.el:42:1:Error: Wrong type argument: number-or-marker-p, nil I've attached a patch to make it use the *standard* value (currently 10000000) of `large-file-warning-threshold' in that scenario. There's probably an argument to use something bigger, given that the nil value is really saying that the user will happily cope with much *larger* file sizes than the standard value; but as this piece of code is only determining a fallback value in case `vlf-tune-ram-size' failing to produce a value[1], and the user can simply customize the option if they're not happy with the default, I concluded it was fine. -Phil [1] Or if `vlf-tune-ram-size' produces a value which isn't 20 times larger than `large-file-warning-threshold' -- that part of the logic seems slightly iffy, but the issue is probably moot in 2020, given that 20 x 10,000,000 is only 200M of RAM :) --------------5256AAFA08F85BA6870A5F76 Content-Type: text/x-patch; charset=UTF-8; name="0001-packages-vlf-Fix-byte-compilation-and-load-errors.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-packages-vlf-Fix-byte-compilation-and-load-errors.patch" >From 0d8e72ca0a450c5da8fe6c47b582b6ecf66eff84 Mon Sep 17 00:00:00 2001 From: Phil Sainty Date: Wed, 19 Aug 2020 23:55:51 +1200 Subject: [PATCH] packages/vlf: Fix byte-compilation and load errors * packages/vlf/vlf-tune.el (vlf-tune-max): Handle a nil value of 'large-file-warning-threshold'. --- packages/vlf/vlf-tune.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/vlf/vlf-tune.el b/packages/vlf/vlf-tune.el index 566f2d6..df92551 100644 --- a/packages/vlf/vlf-tune.el +++ b/packages/vlf/vlf-tune.el @@ -60,7 +60,9 @@ but don't change batch size. If t, measure and change." (if ram-size (/ ram-size 20) 0)) - large-file-warning-threshold) + (or large-file-warning-threshold + (eval (car (get 'large-file-warning-threshold + 'standard-value))))) "Maximum batch size in bytes when auto tuning. Avoid increasing this after opening file with VLF." :group 'vlf :type 'integer) -- 2.8.3 --------------5256AAFA08F85BA6870A5F76--