EmacsW32 renames buffers with old Windows shortened file names
Asked Answered
D

2

1

Let's see if I can reach the EmacsW32 users on stackoverflow.

I've just installed the patched version of EmacsW32 from http://ourcomments.org/Emacs/EmacsW32.html

I find it very nice that .txt files are associated wth Emacs, so that when you click on one, emacsclient opens it in the running instance of Emacs.

Problem is, for some reason, the buffer is renamed with the old-style shortened file names, so, for example, the buffer with file "activities-2008.txt" is renamed to "ACTIV~1.TXT", which I don't like.

How do I get EmacsW32 not to rename the buffer, and use the whole file name as the buffer name instead ?

Dermatologist answered 21/5, 2009 at 13:28 Comment(1)
I am EmacsW32 user and I cannot reproduce this, I get the whole file name for the buffer. My version is GNU Emacs 22.0.990.1 (i386-mingw-nt5.1.2600) of 2007-05-23 on LENNART-69DE564 (patched) and the EmacsW32 version is 1.54. Perhaps something in your .emacs is causing this?Nguyen
D
1

Solved.

The problem is not with emacs, but with the way Windows runs a program when a file type is associated in the registry.

In my registry, I had this value for the keys that associate txt files with Emacs:

C:\emacs-23.0.91.1\Emacs\bin\emacsclientw.exe -n "%1"

The problem is the %1, which is replaced by a short file name.

According to this message http://lists.gnu.org/archive/html/help-emacs-windows/2009-05/msg00022.html:

 %L is long file names.

 %1 is long file names IF
 * Explorer can find the exe file (it does not look very hard)
 AND
 * The file header says it is Win 95 aware Win16 exe, or
 * It is a 32 bit program

 Else %1 will be a short name.

The solution is to use %L in place of %1 in the reg keys.

Dermatologist answered 22/5, 2009 at 19:53 Comment(0)
D
1

Ick, that sucks.

Why not just use the emacsclientw that comes with the standard Windows emacs distribution?

It does have a bit of an issue in that you get an annoying "No error" error box if Emacs isn't already running, but any real emacs user starts emacs first thing when they log on anyway. :-)

Demagogic answered 21/5, 2009 at 14:11 Comment(0)
D
1

Solved.

The problem is not with emacs, but with the way Windows runs a program when a file type is associated in the registry.

In my registry, I had this value for the keys that associate txt files with Emacs:

C:\emacs-23.0.91.1\Emacs\bin\emacsclientw.exe -n "%1"

The problem is the %1, which is replaced by a short file name.

According to this message http://lists.gnu.org/archive/html/help-emacs-windows/2009-05/msg00022.html:

 %L is long file names.

 %1 is long file names IF
 * Explorer can find the exe file (it does not look very hard)
 AND
 * The file header says it is Win 95 aware Win16 exe, or
 * It is a 32 bit program

 Else %1 will be a short name.

The solution is to use %L in place of %1 in the reg keys.

Dermatologist answered 22/5, 2009 at 19:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.