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#62413: 29.0.60; [PATCH] save-place-mode cannot restore saved position Date: Thu, 06 Apr 2023 13:27:55 +0300 Message-ID: <83h6ttqp90.fsf@gnu.org> References: <83tty9caku.fsf@gnu.org> <83y1nkc3vc.fsf@gnu.org> <83zg809jgv.fsf@gnu.org> <83cz4t84mv.fsf@gnu.org> <83v8ii6bw4.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28159"; mail-complaints-to="usenet@ciao.gmane.io" Cc: ruijie@netyu.xyz, 62413-done@debbugs.gnu.org To: Liu Hui Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 06 12:28:32 2023 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 1pkMr2-00078N-0H for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Apr 2023 12:28:32 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkMqe-0005um-Iz; Thu, 06 Apr 2023 06:28:08 -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 1pkMqY-0005uA-JV for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 06:28:04 -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 1pkMqY-00012p-AG for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 06:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pkMqY-0008Kk-5e for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 06:28:02 -0400 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Apr 2023 10:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 62413 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Mail-Followup-To: 62413@debbugs.gnu.org, eliz@gnu.org, liuhui1610@gmail.com Original-Received: via spool by 62413-done@debbugs.gnu.org id=D62413.168077685331980 (code D ref 62413); Thu, 06 Apr 2023 10:28:01 +0000 Original-Received: (at 62413-done) by debbugs.gnu.org; 6 Apr 2023 10:27:33 +0000 Original-Received: from localhost ([127.0.0.1]:53512 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkMq5-0008Jk-Fu for submit@debbugs.gnu.org; Thu, 06 Apr 2023 06:27:33 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45620) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkMq3-0008JV-ID for 62413-done@debbugs.gnu.org; Thu, 06 Apr 2023 06:27:32 -0400 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 1pkMpy-0000rA-6V; Thu, 06 Apr 2023 06:27:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=pTHEnFaJbA7KzYbe6Dvz9ZbivzUEXeNkxtcBK6LJ8go=; b=qcFyaNALQVpcrbrA8Gln l5W1X4JG3RfNDckwX1+ZXrMt3qYpWp70jJ9dPd0Hmux3fNLEtVv5fCo9SlOyQBUQXCxl906xKw3gC 5VlIN/y9sGpEoCHyHkRQdlHOM+MhGC0DjUoQf8IwbNzXntSMl1fsuvlrrOv5kk5o7xHOUcV+Z41tO qdJoRF/DUdhBsK0Nfozc/cBCH0vss0h/bxGGeJ2+CZj3jgKwGdyWsNF1jabIpDO3FAUFiNuv/DlFX tfp9HQPOyQ4Ox5VL5JIEuosNUwpAzrEq4KwgWQah+UX9TWRr9p6wpLYhmL9QO881cm1Sm2pmyCeUj pTPoFBku4q1BRA==; 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 1pkMpx-0005JP-He; Thu, 06 Apr 2023 06:27:25 -0400 In-Reply-To: (message from Liu Hui on Tue, 4 Apr 2023 09:37:26 +0800) 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:259310 Archived-At: > From: Liu Hui > Date: Tue, 4 Apr 2023 09:37:26 +0800 > Cc: Eli Zaretskii , 62413@debbugs.gnu.org, bug-gnu-emacs@gnu.org > > Ruijie Yu 于2023年4月3日周一 11:06写道: > > > Two minor comments below. > > > > > @@ -90,8 +92,32 @@ save-place-forget-unreadable-files > > > (defcustom save-place-abbreviate-file-names nil > > > [...] > > > + :set (lambda (sym val) > > > + (set-default sym val) > > > + (let ((fun (if val 'abbreviate-file-name 'expand-file-name))) > > > > I believe function quotes "#'" are preferred over simple quotes "'" when > > dealing with functions. > > OK > > > > @@ -214,7 +241,11 @@ save-place-to-alist > > > ((and (derived-mode-p 'dired-mode) directory) > > > (let ((filename (dired-get-filename nil t))) > > > (if filename > > > - `((dired-filename . ,filename)) > > > + (list > > > + (cons 'dired-filename > > > + (if save-place-abbreviate-file-names > > > + (abbreviate-file-name filename) > > > + filename))) > > > > It seems that you rewrote the quote-backquote thing with regular > > list-cons construct -- no comments on that. I noticed that here, and in > > a few other places, you are reusing the exact `if' construct multiple > > times. Does that warrant defining a helper function? > > I feel such a function is too short. > > > Also, while I was about to send the mail, regarding the docstring of > > `save-place-abbreviate-file-names', instead of letting the user enable > > `save-place-mode', would it be better if you directly call facilities in > > saveplace to load `save-place-alist' from file system, within your :set > > function? > > Thanks for the suggestion. I have added `save-place-load-alist-from-file' > to the :set function in the new patch. Thanks, I installed this on the master branch, and I'm therefore closing this bug.