From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: empty-directory predicate, native implementation Date: Mon, 19 Oct 2020 10:04:31 +0200 Message-ID: <87d01ezlo0.fsf@gmx.de> References: <87y2kaj799.fsf@gmx.de> <83blh60wgr.fsf@gnu.org> <87h7qxjh7g.fsf@gmx.de> <878sc8kgy8.fsf@gmx.de> <87imbcls71.fsf@gmx.de> <83eem0zt0b.fsf@gnu.org> <87k0vsrd6m.fsf@gmx.de> <83a6wozs7h.fsf@gnu.org> <87sgafq2e2.fsf@gmx.de> <87h7qvptm3.fsf@gmx.de> <871rhxp8we.fsf@gmx.de> <87k0vnoio5.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37229"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Arthur Miller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 19 10:18:10 2020 Return-path: Envelope-to: ged-emacs-devel@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 1kUQMr-0009as-Jf for ged-emacs-devel@m.gmane-mx.org; Mon, 19 Oct 2020 10:18:09 +0200 Original-Received: from localhost ([::1]:52188 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUQMq-0005Mv-Ec for ged-emacs-devel@m.gmane-mx.org; Mon, 19 Oct 2020 04:18:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUQ9o-0001Uq-VY for emacs-devel@gnu.org; Mon, 19 Oct 2020 04:04:41 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:45821) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUQ9k-0003fb-4N; Mon, 19 Oct 2020 04:04:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1603094672; bh=9QSDqVoOEseEQqZYoYlsNuF0nmi7cNgqz9RwpG3ZPbE=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=Hv+2VIOhoX4LhLqh8G5gyKQ5UhcR3N5CPVPiB7nOd8UlrkNKirGpxnCVmmzsqXpBA UGL3W8vQHb3N2VJgrfAcalHvoJeDGbvAaWsh29C5OIweV/ClZTqGw2zb/GhFClH+Qv ColbuTCBXNfK7vEknXzisc+USp2onhKP5qoxrP3o= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([212.91.242.51]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MulqN-1kDAWJ2qfL-00rm0e; Mon, 19 Oct 2020 10:04:32 +0200 In-Reply-To: (Arthur Miller's message of "Mon, 19 Oct 2020 00:21:58 +0200") X-Provags-ID: V03:K1:DY6TEolAiqB8BagkdqBQd/M/G4RS/FQNjisrqHB2ZfWN20IWLRr jD330RDPeJdagdVndKVhCvlCGVsageKVTDCxvcLTXBTRDBN8B5geqtSWT3Ej2d0TCSjZUUM l8XhKU3590trL4nwFt9PoEcuNBQdsJl6V0ooEzmJSaWMeXzhNzj68OnG45fVUd7IOoWrJdE FvDXXmwi86cT+NlSHPWHQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:+2juoF7ZQtQ=:awS5b5/1xkrBVLWg27JGM4 xhGntCqC2Rvbk7nn+XgzxnGQaOzHhTMhrLq+3QIDgn4v5rAlG/uYwfF7ZkbTFE4OiYbTUkD8w HlXn5ViUDLS+LIpSz5Iy2lYIKswyK+kBWSbnimvomjYFkhqv9h+mivfr8IO1rgJlCl7MHwpxM ZlQWfzCL2S3cSeIkRpkiZ95yOEASH7GErCbI/XSjGDT+xJ6KQm/EhVdLD/P/laQaLeh6FpJBN Qtr4uEagf9HC7Xi3Fb4ELPujoMtEia5wOU1i6t+IfNOWRrErMoyAHtWxR0pVujvQeUE4BUXhy BP9Dk+lm6t6B7FqCfViLrAkP4CCQR3rwPIInJQw2PZIXLOKxSgowOnMZDwR69ie1Kl4Kirxx0 7WoQulPzxIIUY94LfT0yXsSNUftSgZUhqq5U8hwz1I/rG6JrnwXc4LluS7HCQbpuCtNK+X74x Uwqo6YvQ744h9FtrMDkBke9oIQrXzEwyM+In4kUUV+03YfQjdi6MvJb1l7zMAcPuyNomyk4k9 kcjuC3YEECYsSGpDQyaZiDekDVQQO0dXZZQ49HdfO+TU61Bs/eMi8GHtvM0ZhLovuZ4nHYoMW C526cdmLMkHg+Hlj7uZ9RKP8bnsNJ8te/tFjUAFmZKeFwc5EKzdh7u1tFui4X0jgXxTwx3xfx miT7SWS7iyb9T/sO63Me4P4qsdGwZKHOmArzZhsSHcIfAh/xEBOQNJdrhZuyDM+x0I1abVbGN CiJWoijiKQqiDmZPQV9q0T5V7WobYevKEXhv1W1uy0XtacTSGT7MQTK8F7+Hk8flB901D5xe Received-SPF: pass client-ip=212.227.17.22; envelope-from=michael.albinus@gmx.de; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/19 04:04:33 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:258100 Archived-At: Arthur Miller writes: Hi Arthur, >> What's wrong using FIXNATP and XFIXNAT everywhere? > > If we return nil for 0 count, then it make sense to return nil for > negative count too? *Any* non-nil COUNT, which is not a natural number, is handled as it were nil. That's what my proposal for the docstring tries to say ("If COUNT is a natural number ..."). > XFIXNAT will turn it negative num into some big int. > I thought first it is fine, but after second thought I don't think it is > best thing to do. > > if (FIXNUMP(return_count)) > { > last = XFIXNUM(return_count); > > if (last < 1) > return Qnil; > } > > This works better. But if you use FIXNATP instead of FIXNUMP, there's no problem at all. >>> --- a/lisp/net/tramp-adb.el >>> +++ b/lisp/net/tramp-adb.el >>> @@ -312,7 +312,7 @@ tramp-adb-handle-directory-files-and-attributes >>> (copy-tree >>> (with-tramp-file-property >>> v localname (format "directory-files-and-attributes-%s-%s-%s-%s" >>> - full match id-format nosort) >>> + full match id-format nosort count) > I did that first, but then decided to skip count in format and forgot > to delete the count from the argument list. I didn't know how format was > used so I didn't want to mess with it; but if it is only for the name, > then it is maybe useful? Well, the name is used for caches. If we want to use the cache also for a non-nil COUNT, we must use it also for the cache entry. >>> diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el >>> index 6d44ad23ad..a99af70196 100644 >>> --- a/lisp/net/tramp.el >>> +++ b/lisp/net/tramp.el >>> +(defun tramp-handle-directory-files (directory &optional full match >>> + nosort count) >> >> This fits into one line (80 chars). > It is 81 chars so Emacs breaks the line. I can call it num, saves 2 chars. It's not important. But in my Emacs, the closing parenthesis is at position 80, IIRC :-) > Best regards; sorry for giving you so much work! Best regards, Michael.