From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#60097: 29.0.60; emacsclient adds unabbreviated names to file-name-history Date: Sat, 17 Dec 2022 14:48:36 +0200 Message-ID: <83wn6qgpqz.fsf@gnu.org> References: <87wn6sleju.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8411"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60097@debbugs.gnu.org To: Augusto Stoffel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 17 13:49:38 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 1p6WdG-0001xv-FJ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Dec 2022 13:49:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6Wcr-0007TT-6F; Sat, 17 Dec 2022 07:49:13 -0500 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 1p6Wcg-0007R8-Iv for bug-gnu-emacs@gnu.org; Sat, 17 Dec 2022 07:49:12 -0500 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 1p6Wcf-00036V-QN for bug-gnu-emacs@gnu.org; Sat, 17 Dec 2022 07:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p6Wcf-0000VN-JC for bug-gnu-emacs@gnu.org; Sat, 17 Dec 2022 07:49:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Dec 2022 12:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60097 X-GNU-PR-Package: emacs Original-Received: via spool by 60097-submit@debbugs.gnu.org id=B60097.16712813191920 (code B ref 60097); Sat, 17 Dec 2022 12:49:01 +0000 Original-Received: (at 60097) by debbugs.gnu.org; 17 Dec 2022 12:48:39 +0000 Original-Received: from localhost ([127.0.0.1]:55748 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6WcJ-0000Uu-86 for submit@debbugs.gnu.org; Sat, 17 Dec 2022 07:48:39 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39674) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6WcH-0000Uo-Vw for 60097@debbugs.gnu.org; Sat, 17 Dec 2022 07:48:38 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6WcC-00033V-L4; Sat, 17 Dec 2022 07:48:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=YuSYqmUTou2ch+oEAWn9lSuP1sw+ZolLoKmKnR8ySLE=; b=FbxVqUZ95H3S bRWtXmlc6cVKNHJAIIEt/WfzMjQglYikTP6MLCN71Yhoz/xzsETvKU3T5pr43WKb17O3J71KtSs/b B8gEUMdienhGP8JE7YkS4syB0eZJYNIm8hO7US/zLd5gbwiv+h8Vi2X4VlIveKEd7PU6oZvXKZKCC z079EolPYIBdTk6YJp9FFJWlE9ZJglbgggSPKTpHvLTHppiGSIyjjpAR1ajEzbFd7wUcROhZk3nqD OQ4LjutaIKl5b08UOg0mfVpkT8G2YpGj8c7i26GU/dk1pdijLwM/1dW3GSAtZxyDRt179+01hGlw9 lSBcPVEVhc/RBbSYcbfnkA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6WcC-0007Zs-3l; Sat, 17 Dec 2022 07:48:32 -0500 In-Reply-To: <87wn6sleju.fsf@gmail.com> (message from Augusto Stoffel on Thu, 15 Dec 2022 19:14:45 +0100) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:251277 Archived-At: > From: Augusto Stoffel > Date: Thu, 15 Dec 2022 19:14:45 +0100 > > > 1. Start emacs -Q > 2. M-x server-start RET > 3. In a terminal, type /home/user/somefile I guess you meant to type "emacsclient /home/user/somefile"? > Then "/home/user/somefile" is added to file-name-history. I would > instead expect the abbreviated name, "~/somefile", to be added to > history. Does the patch below do what you want? Btw, we don't do this consistently: "C-x C-f" doesn't record the abbreviated file name, it records the original one. diff --git a/lisp/server.el b/lisp/server.el index fd740d1..d963ee5 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -1495,7 +1495,7 @@ server-visit-files minibuffer-auto-raise)) (filen (car file)) (obuf (get-file-buffer filen))) - (add-to-history 'file-name-history filen) + (file-name-history--add filen) (if (null obuf) (progn (run-hooks 'pre-command-hook)