comparison lib-src/emacsclient.c @ 90776:dd7c098af727

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 638-652) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 202) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-177
author Miles Bader <miles@gnu.org>
date Mon, 26 Feb 2007 23:03:45 +0000
parents 95d0cdf160ea 6ef0c279b18c
children f55f9811f5d7
comparison
equal deleted inserted replaced
90775:7d8921cab8aa 90776:dd7c098af727
482 482
483 /* Empty filenames (which shouldn't happen) are relative. */ 483 /* Empty filenames (which shouldn't happen) are relative. */
484 if (filename[0] == '\0') return FALSE; 484 if (filename[0] == '\0') return FALSE;
485 485
486 #ifdef WINDOWSNT 486 #ifdef WINDOWSNT
487 /* X:\xxx is always absolute; X:xxx is an error and will fail. */ 487 /* X:\xxx is always absolute. */
488 if (isalpha (filename[0]) 488 if (isalpha (filename[0])
489 && filename[1] == ':' && (filename[2] == '\\' || filename[2] == '/')) 489 && filename[1] == ':' && (filename[2] == '\\' || filename[2] == '/'))
490 return TRUE; 490 return TRUE;
491 491
492 /* Both \xxx and \\xxx\yyy are absolute. */ 492 /* Both \xxx and \\xxx\yyy are absolute. */
493 if (filename[0] == '\\') return TRUE; 493 if (filename[0] == '\\') return TRUE;
494
495 /*
496 FIXME: There's a corner case not dealt with, "x:y", where:
497
498 1) x is a valid drive designation (usually a letter in the A-Z range)
499 and y is a path, relative to the current directory on drive x. This
500 is absolute, *after* fixing the y part to include the current
501 directory in x.
502
503 2) x is a relative file name, and y is an NTFS stream name. This is a
504 correct relative path, but it is very unusual.
505
506 The trouble is that first case items are also valid examples of the
507 second case, i.e., "c:test" can be understood as drive:path or as
508 file:stream.
509
510 The "right" fix would involve checking whether
511 - the current drive/partition is NTFS,
512 - x is a valid (and accesible) drive designator,
513 - x:y already exists as a file:stream in the current directory,
514 - y already exists on the current directory of drive x,
515 - the auspices are favorable,
516 and then taking an "informed decision" based on the above.
517
518 Whatever the result, Emacs currently does a very bad job of dealing
519 with NTFS file:streams: it cannot visit them, and the only way to
520 create one is by setting `buffer-file-name' to point to it (either
521 manually or with emacsclient). So perhaps resorting to 1) and ignoring
522 2) for now is the right thing to do.
523
524 Anyway, something to decide After the Release.
525 */
494 #endif 526 #endif
495 527
496 return FALSE; 528 return FALSE;
497 } 529 }
498 530
882 void 914 void
883 w32_give_focus () 915 w32_give_focus ()
884 { 916 {
885 HMODULE hUser32; 917 HMODULE hUser32;
886 918
887 /* It should'nt happen when dealing with TCP sockets. */ 919 /* It shouldn't happen when dealing with TCP sockets. */
888 if (!emacs_pid) return; 920 if (!emacs_pid) return;
889 921
890 if (!(hUser32 = LoadLibrary ("user32.dll"))) return; 922 if (!(hUser32 = LoadLibrary ("user32.dll"))) return;
891 923
892 /* Modern Windows restrict which processes can set the foreground window. 924 /* Modern Windows restrict which processes can set the foreground window.