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#65055: 30.0.50; save-place-abbreviation-file-names :set fails for saveplace-pdf-view places Date: Fri, 04 Aug 2023 22:03:39 +0300 Message-ID: <835y5uvddg.fsf@gnu.org> References: <87edki4wdz.fsf@gmail.com> <83cz02vgst.fsf@gnu.org> <87v8du65gb.fsf@gmail.com> 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="15206"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65055@debbugs.gnu.org To: Visuwesh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 04 21:04:35 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 1qS06E-0003gN-QF for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 04 Aug 2023 21:04:34 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qS05q-0006Kh-Dd; Fri, 04 Aug 2023 15:04:11 -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 1qS05j-0006KX-SA for bug-gnu-emacs@gnu.org; Fri, 04 Aug 2023 15:04:04 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qS05i-000200-6P for bug-gnu-emacs@gnu.org; Fri, 04 Aug 2023 15:04:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qS05i-0005lY-1I for bug-gnu-emacs@gnu.org; Fri, 04 Aug 2023 15:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Aug 2023 19:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65055 X-GNU-PR-Package: emacs Original-Received: via spool by 65055-submit@debbugs.gnu.org id=B65055.169117582622142 (code B ref 65055); Fri, 04 Aug 2023 19:04:02 +0000 Original-Received: (at 65055) by debbugs.gnu.org; 4 Aug 2023 19:03:46 +0000 Original-Received: from localhost ([127.0.0.1]:54878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qS05R-0005l4-NS for submit@debbugs.gnu.org; Fri, 04 Aug 2023 15:03:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qS05Q-0005kr-Pm for 65055@debbugs.gnu.org; Fri, 04 Aug 2023 15:03:45 -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 1qS05L-0001va-7S; Fri, 04 Aug 2023 15:03:39 -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=SkguO/YMXGubRLJcYAfoN/ZkVYEn3ke09mvSGzwJKS0=; b=NmW9nRvRaTaMVu9UYDSh ULY0KoqmJqHGvPTOTPbK44JkX47D8A4q8vvsK//7v1M2sNrblzr5wpP3tCuARD55oTcBVf65ImRM4 JMdhvGKLk1SJB0jcf2/EtEAQqrAKMGSLyKQ/cl1CfOlhvH851VYcR+bRGIyT/A0B0YdpXaqRWHUku W4jdMukANypTtpmjh+fDC54kkYtk3afbQlJx544i1XNcALpmxSAVNR4QGeDJ3gpc8K7rtEo9Elb/2 5YSRvs2Ip+nn0hT1YQJKWI46O1uqwhUV7ihUWWQ8OuHh1BPY2kBEEQgVkMd0b4NrW5hKn9p/4FDTO ZSqblafDUOAXGA==; 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 1qS05D-0006Cp-4J; Fri, 04 Aug 2023 15:03:38 -0400 In-Reply-To: <87v8du65gb.fsf@gmail.com> (message from Visuwesh on Fri, 04 Aug 2023 23:43:56 +0530) 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:266710 Archived-At: > From: Visuwesh > Cc: 65055@debbugs.gnu.org > Date: Fri, 04 Aug 2023 23:43:56 +0530 > > [வெள்ளி ஆகஸ்ட் 04, 2023] Eli Zaretskii wrote: > > >> ("/home/viz/tmp/piron1976.pdf" > >> (pdf-view-bookmark "piron1976.pdf" > >> (filename . "~/tmp/piron1976.pdf") > >> (position . 1) > >> (last-modified 25805 5369 546130 641000) > >> (page . 2) > >> (slice) > >> (size . fit-width) > >> (origin) > >> (handler . pdf-view-bookmark-jump-handler))) > >> > >> This fails with the following backtrace because > >> (cdr (pdf-view-bookmark ...) is a list, > > > > I don't understand: the valid format of save-place-alist is documented > > in its doc string, so this looks like a bug in saveplace-pdf-view > > package? Or what am I missing? > > Unfortunately, that's only half the story. save-place-alist can also > have elements such as > > ("SOME-DIRECTORY" (dired-filename . "SOME-FILENAME")) > > to save the place for dired buffers. Where is this documented, and when the change to support this extension was added? And in any way, the form you show above, which is used by saveplace-pdf-view, is not even of that extended format, or am I again missing something? > But instead of checking if the second element of the place's cdr is a > string, the :set function simply assumes that it will be always be a > string. This is not wrong as such since that's the only allowed format > as far as core Emacs is concerned but I think having the check in place > would help expand the save-place-alist format as the user desires. I don't think we should tweak our code to support save-place-alist formats that violate the documented formats. If the documented format is not followed, how do you know which elements of which parts of the data structures are file names in the first place? The right way of extending such data structures is to allow functions as the values, and let those functions deal with non-standard formats. The way saveplace-pdf-view does it, IIUC, is simply wrong: it just happened to work by sheer luck with previous versions because Emacs never actually acted on the assumption that a file name is in a certain place in the data stricture.