all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bug?: (file-name-extension "some.html~") gives "html"
@ 2006-05-10  8:51 Lennart Borgman
  2006-05-10 16:11 ` Kevin Rodgers
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Lennart Borgman @ 2006-05-10  8:51 UTC (permalink / raw)


Is the behaviour in the subject line correct? I have tested this on w32:

GNU Emacs 22.0.50.1 (i386-mingw-nt5.0.2195) of 2006-05-01

If this is the correct behaviour then maybe the docstring should tell 
about it?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug?: (file-name-extension "some.html~") gives "html"
  2006-05-10  8:51 Bug?: (file-name-extension "some.html~") gives "html" Lennart Borgman
@ 2006-05-10 16:11 ` Kevin Rodgers
  2006-05-10 16:22 ` Luc Teirlinck
  2006-05-11  3:45 ` Richard Stallman
  2 siblings, 0 replies; 8+ messages in thread
From: Kevin Rodgers @ 2006-05-10 16:11 UTC (permalink / raw)


Lennart Borgman wrote:
> Is the behaviour in the subject line correct? I have tested this on w32:
> 
> GNU Emacs 22.0.50.1 (i386-mingw-nt5.0.2195) of 2006-05-01
> 
> If this is the correct behaviour then maybe the docstring should tell 
> about it?

It is correct (file-name-extension calls file-name-sans-versions
before looking for the extension), and it should be documented.

-- 
Kevin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug?: (file-name-extension "some.html~") gives "html"
  2006-05-10  8:51 Bug?: (file-name-extension "some.html~") gives "html" Lennart Borgman
  2006-05-10 16:11 ` Kevin Rodgers
@ 2006-05-10 16:22 ` Luc Teirlinck
  2006-05-10 19:45   ` Lennart Borgman
  2006-05-11  3:45 ` Richard Stallman
  2 siblings, 1 reply; 8+ messages in thread
From: Luc Teirlinck @ 2006-05-10 16:22 UTC (permalink / raw)
  Cc: emacs-devel

Lennart Borgman wrote:

   Is the behaviour in the subject line correct? I have tested this on w32:

   GNU Emacs 22.0.50.1 (i386-mingw-nt5.0.2195) of 2006-05-01

   If this is the correct behaviour then maybe the docstring should tell 
   about it?

Yes, it is documented in the Elisp manual (but not in the docstring).
>From `(elisp)File Name Components':

 -- Function: file-name-extension filename &optional period
     This function returns FILENAME's final "extension", if any, after
     applying `file-name-sans-versions' to remove any version/backup
     part.

Sincerely,

Luc.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug?: (file-name-extension "some.html~") gives "html"
  2006-05-10 16:22 ` Luc Teirlinck
@ 2006-05-10 19:45   ` Lennart Borgman
  2006-05-10 21:02     ` Kevin Rodgers
  0 siblings, 1 reply; 8+ messages in thread
From: Lennart Borgman @ 2006-05-10 19:45 UTC (permalink / raw)
  Cc: emacs-devel

Luc Teirlinck wrote:
> Lennart Borgman wrote:
>
>    Is the behaviour in the subject line correct? I have tested this on w32:
>
>    GNU Emacs 22.0.50.1 (i386-mingw-nt5.0.2195) of 2006-05-01
>
>    If this is the correct behaviour then maybe the docstring should tell 
>    about it?
>
> Yes, it is documented in the Elisp manual (but not in the docstring).
> >From `(elisp)File Name Components':
>
>  -- Function: file-name-extension filename &optional period
>      This function returns FILENAME's final "extension", if any, after
>      applying `file-name-sans-versions' to remove any version/backup
>      part.
>
> Sincerely,
>
> Luc.
>   
Then maybe a line saying something like

    This function removes any version/backup parts in the file name first.

could be added to the doc string?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug?: (file-name-extension "some.html~") gives "html"
  2006-05-10 19:45   ` Lennart Borgman
@ 2006-05-10 21:02     ` Kevin Rodgers
  2006-05-10 21:32       ` Andreas Schwab
  0 siblings, 1 reply; 8+ messages in thread
From: Kevin Rodgers @ 2006-05-10 21:02 UTC (permalink / raw)


Lennart Borgman wrote:
> Luc Teirlinck wrote:
>> Yes, it is documented in the Elisp manual (but not in the docstring).
>> >From `(elisp)File Name Components':
>>
>>  -- Function: file-name-extension filename &optional period
>>      This function returns FILENAME's final "extension", if any, after
>>      applying `file-name-sans-versions' to remove any version/backup
>>      part.
>
> Then maybe a line saying something like
> 
>    This function removes any version/backup parts in the file name first.
> 
> could be added to the doc string?

If so, file-name-sans-extension should get the same treatment, for the
same reason.

BTW, why does file-name-extension accept an optional PERIOD argument
to include the extension delimiter in the result, but
file-name-sans-extension does not?

Symmetry baby,
-- 
Kevin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug?: (file-name-extension "some.html~") gives "html"
  2006-05-10 21:02     ` Kevin Rodgers
@ 2006-05-10 21:32       ` Andreas Schwab
  2006-05-11 15:46         ` Kevin Rodgers
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2006-05-10 21:32 UTC (permalink / raw)
  Cc: emacs-devel

Kevin Rodgers <ihs_4664@yahoo.com> writes:

> BTW, why does file-name-extension accept an optional PERIOD argument
> to include the extension delimiter in the result, but
> file-name-sans-extension does not?

I don't think there is a need to cut off the extension while keeping the
period, whereas keeping the period together with the extension is quite
common.

> Symmetry baby,

This is asymmetric in nature.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug?: (file-name-extension "some.html~") gives "html"
  2006-05-10  8:51 Bug?: (file-name-extension "some.html~") gives "html" Lennart Borgman
  2006-05-10 16:11 ` Kevin Rodgers
  2006-05-10 16:22 ` Luc Teirlinck
@ 2006-05-11  3:45 ` Richard Stallman
  2 siblings, 0 replies; 8+ messages in thread
From: Richard Stallman @ 2006-05-11  3:45 UTC (permalink / raw)
  Cc: emacs-devel

It is intentional.  I will document it.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug?: (file-name-extension "some.html~") gives "html"
  2006-05-10 21:32       ` Andreas Schwab
@ 2006-05-11 15:46         ` Kevin Rodgers
  0 siblings, 0 replies; 8+ messages in thread
From: Kevin Rodgers @ 2006-05-11 15:46 UTC (permalink / raw)


Andreas Schwab wrote:
> Kevin Rodgers <ihs_4664@yahoo.com> writes:
> 
>> BTW, why does file-name-extension accept an optional PERIOD argument
>> to include the extension delimiter in the result, but
>> file-name-sans-extension does not?
> 
> I don't think there is a need to cut off the extension while keeping the
> period, whereas keeping the period together with the extension is quite
> common.

I suppose that the utility of keeping the period with the extension is
to allow it to be appended to some other extension-less file name.  And
likewise the utility of keeping the period with the file name would be
to allow some extension to be appended to it.

>> Symmetry baby,
> 
> This is asymmetric in nature.

I guess it depends on your perspective.  I see the file name base and
extension as symmetric components on either side of the period.

-- 
Kevin

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-05-11 15:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-10  8:51 Bug?: (file-name-extension "some.html~") gives "html" Lennart Borgman
2006-05-10 16:11 ` Kevin Rodgers
2006-05-10 16:22 ` Luc Teirlinck
2006-05-10 19:45   ` Lennart Borgman
2006-05-10 21:02     ` Kevin Rodgers
2006-05-10 21:32       ` Andreas Schwab
2006-05-11 15:46         ` Kevin Rodgers
2006-05-11  3:45 ` Richard Stallman

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.