all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Visuwesh <visuweshm@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 65055@debbugs.gnu.org
Subject: bug#65055: 30.0.50; save-place-abbreviation-file-names :set fails for saveplace-pdf-view places
Date: Sat, 05 Aug 2023 09:07:06 +0530	[thread overview]
Message-ID: <87r0oi5fdp.fsf@gmail.com> (raw)
In-Reply-To: <835y5uvddg.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 04 Aug 2023 22:03:39 +0300")

[வெள்ளி ஆகஸ்ட் 04, 2023] Eli Zaretskii wrote:

>> 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

It is not.  The only way to know how this comes to be is to read
`save-place-to-alist'.  BTW, another specially handled major-mode is
hexl-mode.

>, and when the change to support this
> extension was added?

In commit d4466a91f271db0b414a605ede1a7befd403b950.

    commit d4466a91f271db0b414a605ede1a7befd403b950
    Author: Ivan Kanis <ivan@kanis.fr>
    Date:   Fri Jun 14 11:32:01 2013 +0200

        Add support for dired in saveplace.


> 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?

No, you are not missing anything.

>> 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?

I understand your point,

> 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.

That was my idea two years back and till now but I simply didn't/don't
have the motivation to come up with a patch since I don't use saveplace
for anything but pdf buffers and saveplace-pdf-view did the job good
enough for me to not worry about a better way™.  In the absence of such
motivation, I will solve the problem in saveplace-pdf-view's side and
call it a day.  If/when the motivation returns, I guess we can revisit
this issue.
This report can be closed if you wish.





  reply	other threads:[~2023-08-05  3:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-04 16:15 bug#65055: 30.0.50; save-place-abbreviation-file-names :set fails for saveplace-pdf-view places Visuwesh
2023-08-04 16:18 ` Visuwesh
2023-08-04 17:49 ` Eli Zaretskii
2023-08-04 18:13   ` Visuwesh
2023-08-04 19:03     ` Eli Zaretskii
2023-08-05  3:37       ` Visuwesh [this message]
2023-08-05  9:15         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r0oi5fdp.fsf@gmail.com \
    --to=visuweshm@gmail.com \
    --cc=65055@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.