unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Thierry Volpiatto <thievol@posteo.net>,
	Lars Ingebrigtsen <larsi@gnus.org>,
	58446@debbugs.gnu.org
Subject: bug#58446: 28.2; file-attribute-device-number returns a cons cell instead of an integer
Date: Fri, 14 Oct 2022 19:28:10 +0200	[thread overview]
Message-ID: <87wn92xql1.fsf@gmx.de> (raw)
In-Reply-To: <jwvo7uee409.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Fri, 14 Oct 2022 13:04:31 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

Hi Stefan,

>> (defsubst file-attribute-file-number (attributes)
>>   "The inode and device numbers in ATTRIBUTES returned by `file-attributes'.
>> It can be used to determine whether two files are identical."
>>   (nthcdr 10 attributes))
>>
>> WDYT?
>
> Sounds good, except:
>
> - The name `file-attribute-file-number` doesn't sound right
>   because it doesn't return a number.

The name is a reminiscence of the existing variable buffer-file-number,
which serves exactly the same purpose.

> - I wouldn't use `defsubst` (so it can more easily be modified in the
>   future, e.g. in case we add more fields to the attributes or use some
>   other representation for attributes).

All other accessor functions for file-attributes are defsubsts.

> - I would document it more abstractly, mentioning inode and device
>   number only as *examples* of things it might contain.

There is no intention to use it for anything else. It shall return
(nthcdr 10 attributes) like all the other file-attributes accessor
functions return for the respective slots.

>         Stefan

Best regards, Michael.





  reply	other threads:[~2022-10-14 17:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-11 18:11 bug#58446: 28.2; file-attribute-device-number returns a cons cell instead of an integer Thierry Volpiatto
2022-10-12 11:13 ` Lars Ingebrigtsen
2022-10-12 14:57   ` Michael Albinus
2022-10-13  6:31     ` Lars Ingebrigtsen
2022-10-13  7:09       ` Eli Zaretskii
2022-10-13 19:16         ` Michael Albinus
2022-10-14 17:04     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-14 17:28       ` Michael Albinus [this message]
2022-10-14 18:34         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-14 19:03           ` Michael Albinus
2022-10-14 19:14             ` Eli Zaretskii
2022-10-14 19:33               ` Michael Albinus

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87wn92xql1.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=58446@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=thievol@posteo.net \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).