From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#35564: [PATCH v4] Tweak dired warning about "wildcard" characters Date: Sun, 28 Jul 2019 00:41:20 +0100 Message-ID: <87d0hvyrj3.fsf@tcd.ie> References: <87zho2cd4f.fsf@gmail.com> <87wohvf22u.fsf@gmail.com> <87h88cvpkj.fsf_-_@gmail.com> <87imsinbmr.fsf_-_@gmail.com> <87y313z3tp.fsf@gmail.com> <83wog3lo5c.fsf@gnu.org> <87imrn16fk.fsf@tcd.ie> <87lfwjoxz0.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="261585"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 35564@debbugs.gnu.org, monnier@iro.umontreal.ca, npostavs@gmail.com To: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 28 01:42:10 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hrWKG-0015tn-Sv for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Jul 2019 01:42:09 +0200 Original-Received: from localhost ([::1]:47620 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hrWKF-0002mu-9Y for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Jul 2019 19:42:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52291) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hrWKC-0002kp-LO for bug-gnu-emacs@gnu.org; Sat, 27 Jul 2019 19:42:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hrWKB-0001is-HS for bug-gnu-emacs@gnu.org; Sat, 27 Jul 2019 19:42:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36760) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hrWK9-0001fi-SM for bug-gnu-emacs@gnu.org; Sat, 27 Jul 2019 19:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hrWK9-0004q8-Md for bug-gnu-emacs@gnu.org; Sat, 27 Jul 2019 19:42:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Jul 2019 23:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35564 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 35564-submit@debbugs.gnu.org id=B35564.156427089118561 (code B ref 35564); Sat, 27 Jul 2019 23:42:01 +0000 Original-Received: (at 35564) by debbugs.gnu.org; 27 Jul 2019 23:41:31 +0000 Original-Received: from localhost ([127.0.0.1]:45581 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hrWJe-0004pJ-My for submit@debbugs.gnu.org; Sat, 27 Jul 2019 19:41:30 -0400 Original-Received: from mail-wr1-f54.google.com ([209.85.221.54]:45558) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hrWJc-0004p5-Mb for 35564@debbugs.gnu.org; Sat, 27 Jul 2019 19:41:29 -0400 Original-Received: by mail-wr1-f54.google.com with SMTP id f9so57934084wre.12 for <35564@debbugs.gnu.org>; Sat, 27 Jul 2019 16:41:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=+RuokGQqKBuczS8oAuLoeh0S552zO0prvh0UPL8YF1Y=; b=b0Pp4v2+nc7N/ybfT6lmwv6Nnc5WuCF9waGBqQstTrV84KJfF4/H/n6Ir2ZsM0Kjms u348jQgSlpIR5v+thWrTuft4ClbvP+ciedN9vKcf22XiwILS3oexj2CClcONZDATzHsZ AsWPs2va3CXbf940a1Rjf9TsQR2XcX5Q4DZVe1OEJGmQ6avDmD9XIda7cCrZy9Hp+ToM fh9MzXkr37Zcu/KIfJXDpqz41FGUsUftDa8xOE3C9gG9bGhFlRGRdfkD67wS+OpBmTPx n5gvD8lOQ4/ABjMJk+WHrpOz3rmQdVWdKa5vcpslWD9HyUxURFDWiZHhpLtKdfWXtdAt N6zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=+RuokGQqKBuczS8oAuLoeh0S552zO0prvh0UPL8YF1Y=; b=SS3dbfe6aH+qqdcQQozUneJnWnAA53UD2qalG3aY7eZ15ZyJqzfr7Bt1n0mH9qlqs4 YuxIpDMyL0/K5vwreuQPr7XHM3JAJ0XMBDLdbTOInsupBthnXiG1NP8MCBWodaFJX1B2 ilUCbHOFOftWBWtDbUGe8S5V55T3zxgIhOuOODMUk5HsspeVA968EfelhlMNhW0KeeVw CA1W1qXVlKwq984yMsE7DmOhRZikOzKjfdxixXQv8pxMa1uSoSRUkeijDYkjkCPxZUkF HmwhH53ny4Y7Jt1Mhjz6WW6knK/ta+v5wfYd0BttWFw2mE+h2ze5ygE5tfNEYwCROIyu q5Fg== X-Gm-Message-State: APjAAAXntiLVNjYLqW9Q6Sx5uaMMamMsNITQ6bCM3EW9+3qHnmAALiVO bKdva8SgFNFHET9RINsNPzTvrQ== X-Google-Smtp-Source: APXvYqxw9klneHIJeOJmzOunHWL2RwL9y3LhiNI1/hstKH6MDsOTsuSJAXRgfYSiHJ5QorR16p7MJw== X-Received: by 2002:a5d:4d81:: with SMTP id b1mr27984324wru.27.1564270882725; Sat, 27 Jul 2019 16:41:22 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:92bd:1bfd:38fc:fae2]) by smtp.gmail.com with ESMTPSA id z6sm51050746wrw.2.2019.07.27.16.41.21 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 27 Jul 2019 16:41:21 -0700 (PDT) In-Reply-To: <87lfwjoxz0.fsf@gmail.com> ("=?UTF-8?Q?K=C3=A9vin?= Le Gouguec"'s message of "Sun, 28 Jul 2019 01:32:19 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:163922 Archived-At: K=C3=A9vin Le Gouguec writes: > "Basil L. Contovounesios" writes: > >>> -(defun dired--no-subst-prompt (char-positions command) >>> +(defun dired--mark-positions (positions) >>> + (let ((markers (make-string >>> + (1+ (apply #'max positions)) >> >> Is POSITIONS guaranteed to be non-nil? (The max function takes at least >> one argument.) > > AFAICT dired--mark-positions is only called by dired--no-subst-prompt, > which is only used when there is at least one ambiguous character to > highlight. > > So as things stand now, POSITIONS will always be non-nil. Nothing > prevents someone from attempting to re-use the function with a > potentially-nil argument though. > > I don't know what makes more sense here: adding an assertion? Handling > the nil case explicitly for robustness? I think it's fine the way it is, though a docstring/comment never hurts. I was just checking. >>> Subject: [PATCH 6/6] Simplify highlighting assertions >>> >>> * test/lisp/dired-aux-tests.el (dired-test--check-highlighting): >>> New function. >>> (dired-test-highlight-metachar): Use it. >> >> Will this simplification hinder debugging of test failures? I don't >> have an opinion on the proposed change, it's just something to consider. > > Mmm. Since the assertion that fails is now nested in a more generic > function, the report shown in the ERT-Results buffer might be somewhat > less informative; one has to bring up the backtrace to understand the > context. > > I could try my hand at an ERT explainer for these assertions. Or we > could just drop the 6th patch=E2=80=A6 I do find the tests easier to rea= d and > write with it though. That's good enough for me, --=20 Basil