From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augusto Stoffel Newsgroups: gmane.emacs.bugs Subject: bug#58447: [PATCH] In project-find-file, add absolute file name to history Date: Thu, 27 Oct 2022 19:48:42 +0200 Message-ID: <877d0li2dh.fsf@gmail.com> References: <8735budxiz.fsf@gmail.com> <83a662dvgo.fsf@gnu.org> <871qqvj6qb.fsf@gmail.com> <42bb91a0-60ff-2e51-dcdc-c1e1f80e31ec@yandex.ru> <837d0lmmpi.fsf@gnu.org> <1cce089a-546e-7f13-0907-3d36452aef10@yandex.ru> <83v8o5l0wa.fsf@gnu.org> <5c1cc828-5fcd-667f-41d4-f19923b2958e@yandex.ru> <87k04li5nw.fsf@gmail.com> <7c28a8f6-fc02-8519-664f-01f7d121d74a@yandex.ru> <87fsf9i4xc.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27023"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 58447@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 27 19:52:28 2022 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 1oo73L-0006oa-HJ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 27 Oct 2022 19:52:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oo704-0006c5-SV; Thu, 27 Oct 2022 13:49:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oo702-0006I3-6x for bug-gnu-emacs@gnu.org; Thu, 27 Oct 2022 13:49:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oo701-0003kA-VX for bug-gnu-emacs@gnu.org; Thu, 27 Oct 2022 13:49:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oo701-00045u-Qm for bug-gnu-emacs@gnu.org; Thu, 27 Oct 2022 13:49:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Augusto Stoffel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Oct 2022 17:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58447 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 58447-submit@debbugs.gnu.org id=B58447.166689293115720 (code B ref 58447); Thu, 27 Oct 2022 17:49:01 +0000 Original-Received: (at 58447) by debbugs.gnu.org; 27 Oct 2022 17:48:51 +0000 Original-Received: from localhost ([127.0.0.1]:59259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo6zr-00045U-3D for submit@debbugs.gnu.org; Thu, 27 Oct 2022 13:48:51 -0400 Original-Received: from mail-ej1-f52.google.com ([209.85.218.52]:42599) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo6zq-00045F-C1 for 58447@debbugs.gnu.org; Thu, 27 Oct 2022 13:48:50 -0400 Original-Received: by mail-ej1-f52.google.com with SMTP id y14so6803161ejd.9 for <58447@debbugs.gnu.org>; Thu, 27 Oct 2022 10:48:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=EsF8M1/aa4bCZBQf2D352wIdZCb09U7Us+e32ym2m3c=; b=WKGQmXGQSDeVs9z4E4OPboAIGG8xMAz+piJSaGTfg/kXGUsWUT0dhi+1DCNMf9IRpc Edv1lVo/dk7h77EXo3UhUd7ItulBm8v0UWeLUeW4L9mqg6ptOBFyDJ0AAo/9Es8foTNh v7Q9//hahZh8D4mc1hFihSh7pydVuWs96pZ2uhjBXFk+6pPhIYq0GmIcdp0jaF/6Z1qB hWRTHmtTQFx6H82QQ/fejJoqlPAIhMDDQbzAKaws9LYXa+A0EuCC4FPyeQkxenHev3CC WlUdvofnYOzMPCFtps6E4kAztBKx0hDzPSG6fXD4ppbngud7XM/qCTDhvq3ReJmASUmM Vb0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=EsF8M1/aa4bCZBQf2D352wIdZCb09U7Us+e32ym2m3c=; b=D3zcxlmZVStiaIb+aevxhc+V5h0AhrV1CEvmDwtGh/3w5sYOTPU/nGe2WvCVx8pax3 kjNIElc8IGqUbkRYmKx6+L8O5jbEHxoSgnScZST23r4XaEF8zSAnnNXqVMCfV6bXv2S4 gdCPkAdn/vm2a04orWfNYzgx6Xrfd4tz2fZWmRBEwjOl6Bi5VA+q1cW2uodELVxxrESg /Bd3hT9y17i7RibR0uA27FNQ0+UPbD95umnNJWT96WtvyEsgOoGJOj6we/oXwmZGNDlq 0PcxT2wFuboKRUxdoH6OEpRrQsJU5Wey4ct5RTgbEx2YlJzQ8zyBP0wl7Z1eF5SYZqyM zQlw== X-Gm-Message-State: ACrzQf33kxWQ7KwyNcRlS+8axZmI0QRxxDyLwNOQdLwYI/ZJO7SZ1ah1 b/3Io/IlYqb/VEEk5K+MdEDGVQtFZL4= X-Google-Smtp-Source: AMsMyM4RbwUV134q65b391iCOV456CJc4Bi/NEF1uKc0TCE30KTjMFJNk2yUxHHEcr9NfrBbmbn3EA== X-Received: by 2002:a17:907:6087:b0:78d:ee99:a06a with SMTP id ht7-20020a170907608700b0078dee99a06amr43156596ejc.52.1666892924044; Thu, 27 Oct 2022 10:48:44 -0700 (PDT) Original-Received: from ars3 ([2a02:8109:8ac0:56d0::89aa]) by smtp.gmail.com with ESMTPSA id p21-20020a170906229500b0077086d2db8esm1126291eja.140.2022.10.27.10.48.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 10:48:43 -0700 (PDT) In-Reply-To: (Dmitry Gutov's message of "Thu, 27 Oct 2022 20:34:18 +0300") 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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246349 Archived-At: On Thu, 27 Oct 2022 at 20:34, Dmitry Gutov wrote: > On 27.10.2022 19:53, Augusto Stoffel wrote: >> On Thu, 27 Oct 2022 at 19:48, Dmitry Gutov wrote: >> >>> On 27.10.2022 19:37, Augusto Stoffel wrote: >>>> The patch in my original message fixes this and shouldn't complicate a >>>> future implementation of the per-project histories. >>> OK. Are you sure that it doesn't add the relative name to the history still? >>> >>> AFAIU as long as hist is passed to project--completing-read-strict, >>> the completing-read call in there will alter the history first. >> Note that history-add-new-input is bound to nil at the appropriate >> place in the patch. > > Ah, ok. > > But how is completing-read using the history var? Only reading past > inputs? Yes, completing-read will make past inputs available for selection but not updated the history variable. Then, a couple lines later in the patch, we update the history manually: (when (and hist history-add-new-input) (add-to-history hist absname)) > Can it handle the absolute values there? The completing read reads a file name, the relname; if it's relative, then it's expanded to an absolute name (the absname). If for whatever reason the relname was already absolute, then absname will be equal to relname (what else could you do, right?)