From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 75d9a55: Fix bug 32543 Date: Wed, 19 Sep 2018 07:03:28 +0900 (JST) Message-ID: References: <20180918123203.24597.514@vcs0.savannah.gnu.org> <20180918123205.8BE9B204DF@vcs0.savannah.gnu.org> <87bm8u906v.fsf@calancha-pc.dy.bbexcite.jp> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Trace: blaine.gmane.org 1537308141 20534 195.159.176.226 (18 Sep 2018 22:02:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 18 Sep 2018 22:02:21 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Cc: Emacs developers , Tino Calancha To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 19 00:02:17 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g2O4W-0005DD-VI for ged-emacs-devel@m.gmane.org; Wed, 19 Sep 2018 00:02:17 +0200 Original-Received: from localhost ([::1]:42758 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2O6d-0005m3-F4 for ged-emacs-devel@m.gmane.org; Tue, 18 Sep 2018 18:04:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2O5v-0005jt-3u for emacs-devel@gnu.org; Tue, 18 Sep 2018 18:03:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g2O5r-0006En-9x for emacs-devel@gnu.org; Tue, 18 Sep 2018 18:03:43 -0400 Original-Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:51844) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g2O5p-0006C6-4i for emacs-devel@gnu.org; Tue, 18 Sep 2018 18:03:38 -0400 Original-Received: by mail-wm1-x32b.google.com with SMTP id y2-v6so4094716wma.1 for ; Tue, 18 Sep 2018 15:03:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=GuFdMixD1y3zH6LZw5GfsX7YmOEb0O8LJ2mLoJwsOfg=; b=NUCxUloKQOXheBu/DshH/NRGd7ejb4oSmxZqBl4PTFz4KTGEZO5iUhvEGD9GSNCQZS IWxSZz5HuzQVJbAgwmTPQ6t36Hx+F9zxjpS4C2ZmwpliRdGKG32dFWZHBDMVLtjf+Mg9 SA2H9/Y01a+oDixvoH518GtQftwT5AbFfhRTTGg+ExSLkSwqrLNetCwNVcH/MZAXOdSc Rtlb8jQHJkCE8Sx1aElonqa3kRdq7lvlgvWx0bIfL1821mou2MJvd0MEqFlR8BDmNSKS a0hSCQrlA4cGq3ne+8FVETrhfLQg6zzMlhraHW6MQF5fwpQsgfj5tGumBRJ/BcAvev22 /V7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=GuFdMixD1y3zH6LZw5GfsX7YmOEb0O8LJ2mLoJwsOfg=; b=skDhWBzS0pMA1EkHlbpAs1AJeQZE9HsWX9cjjDDu607JHJOzv+TjbaDSh3HyTN9Q8j DH8wrtCJfcSnPX9VP4KE8glVIV4HcOH9cfX+oRuLXk8EjKo4l10bH4Onpd2YrZEHQh63 CUeZqlWvzRfrO61S5kIesGP9lup859xatm8/NGniAfF0KJHt8zEpoIfr01FefKqN6HJo AolfOhDNEhJd0rMowfe9Q+9LJKdWgxA3iwSX1Q7o0Ka+kYn0VxBpdEJIBTpUbO2n/q6m f1wz06+oU7yDrCj0QaaHTtt/n1K1XOgYMVZOXGQUpi8Gmjlk8/KRNI/gAoWPUR5ei9HR pqlg== X-Gm-Message-State: APzg51BFQfB8cWX7R+bcz6kSxs15e7VS+l9ygQja/C0fbytlJu1UPq2o yyOxXYAGD8QRMUPRgd+9Wh8= X-Google-Smtp-Source: ANB0VdbNk+cyuQrVqKeEhIE6wbCZJHMhOCzHpTeplC/bXAOr1Q00ucEpdiK9/LTLLJvFLGkuMBsp+A== X-Received: by 2002:a1c:114:: with SMTP id 20-v6mr17030427wmb.4.1537308210533; Tue, 18 Sep 2018 15:03:30 -0700 (PDT) Original-Received: from calancha-pc.dy.bbexcite.jp (15.red-83-50-151.dynamicip.rima-tde.net. [83.50.151.15]) by smtp.gmail.com with ESMTPSA id j20-v6sm2066304wmh.9.2018.09.18.15.03.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Sep 2018 15:03:29 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc.dy.bbexcite.jp In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:229956 Archived-At: On Tue, 18 Sep 2018, Stefan Monnier wrote: >>> - why store this info in text-properties rather than in >>> buffer-local variables? >> I realized the buffer was already saved there with property >> `occur-title'; I didn't wanted to scatter around related info. > > Hmmm... do you happen to have some intuition about why the buffer was > saved in a text-property rather than in a buffer-local var? > It's a really odd choice (less efficient, more work for the coder, with > various side-problems like "on which char should I put it", etc...). I think the favourite answer of my ex-boss fits well here: For historical reasons. > [ Also, why is it saved under a name like `occur-title` rather > than, say `occur-buffer`? ] Ditto. >>>> + (with-current-buffer buffer >>>> + (when (wholenump orig-line) >>>> + (goto-char 1) >>> >>> I'd recommend `point-min` instead of 1 here. >> OK. I always remember the discussion at >> https://lists.gnu.org/archive/html/emacs-devel/2009-08/msg00520.html >> but I forgot which was the encouraged practice there: in these cases >> I follow the 50% rule to reject 0% success ratio (I know, it brings >> 50% failure ratio: life is full of injustice). > > I just always recommend `point-min`. Hard-coded constants are always > weird in source code, whereas `point-min` clearly says what this > constant is (and in terms of efficiency, it's a wash, or `point-min` > might even be marginally more efficient). I have a private library to autocomplete `point-min' (not just that!); I just type (pmin) a and I get (point-min) During prototyping I sometimes write things like: (goto-char 1) I replace those `1' with `point-min' once I get something ready. I forgot this time.