comparison src/dired-msw.c @ 282:c42ec1d1cded r21-0b39

Import from CVS: tag r21-0b39
author cvs
date Mon, 13 Aug 2007 10:33:18 +0200
parents c5d627a313b1
children e11d67e05968
comparison
equal deleted inserted replaced
281:090b52736db2 282:c42ec1d1cded
84 #if ROUND_FILE_SIZES > 0 84 #if ROUND_FILE_SIZES > 0
85 #include <math.h> /* for floor() */ 85 #include <math.h> /* for floor() */
86 #endif 86 #endif
87 87
88 88
89 Lisp_Object Vmswindows_ls_sort_case_insensitive; 89 static int mswindows_ls_sort_case_insensitive;
90 Lisp_Object Vmswindows_ls_round_file_size; 90 static int mswindows_ls_round_file_size;
91
91 Lisp_Object Qmswindows_insert_directory; 92 Lisp_Object Qmswindows_insert_directory;
92 93
93 extern Lisp_Object Vmswindows_downcase_file_names; /* in device-msw.c */ 94 extern Lisp_Object Vmswindows_downcase_file_names; /* in device-msw.c */
95
94 96
95 97
96 enum mswindows_sortby { 98 enum mswindows_sortby {
97 MSWINDOWS_SORT_BY_NAME, 99 MSWINDOWS_SORT_BY_NAME,
98 MSWINDOWS_SORT_BY_NAME_NOCASE, 100 MSWINDOWS_SORT_BY_NAME_NOCASE,
441 switchstr = NULL; 443 switchstr = NULL;
442 hide_system = 1; 444 hide_system = 1;
443 hide_dot = 1; 445 hide_dot = 1;
444 display_size = 0; 446 display_size = 0;
445 reverse = 0; 447 reverse = 0;
446 if (NILP(Vmswindows_ls_sort_case_insensitive)) 448 sort_by = (mswindows_ls_sort_case_insensitive
447 { 449 ? MSWINDOWS_SORT_BY_NAME_NOCASE
448 sort_by = MSWINDOWS_SORT_BY_NAME; 450 : MSWINDOWS_SORT_BY_NAME);
449 } else {
450 sort_by = MSWINDOWS_SORT_BY_NAME_NOCASE;
451 }
452 nfiles = 0; 451 nfiles = 0;
453 while (1) 452 while (1)
454 { 453 {
455 handler = Ffind_file_name_handler (file, Qmswindows_insert_directory); 454 handler = Ffind_file_name_handler (file, Qmswindows_insert_directory);
456 if (!NILP(handler)) 455 if (!NILP(handler))
570 * Hopefully, we won't have to handle these file sizes anytime 569 * Hopefully, we won't have to handle these file sizes anytime
571 * soon. 570 * soon.
572 */ 571 */
573 double total_size, file_size, block_size; 572 double total_size, file_size, block_size;
574 573
575 if ((block_size = XINT(Vmswindows_ls_round_file_size)) <= 0) 574 if ((block_size = mswindows_ls_round_file_size) <= 0)
576 { 575 {
577 block_size = 0; 576 block_size = 0;
578 } 577 }
579 total_size = 0; 578 total_size = 0;
580 for (i = 0; i < nfiles; ++i) 579 for (i = 0; i < nfiles; ++i)
633 632
634 633
635 void 634 void
636 vars_of_dired_mswindows (void) 635 vars_of_dired_mswindows (void)
637 { 636 {
638 DEFVAR_LISP ("mswindows-ls-sort-case-insensitive", &Vmswindows_ls_sort_case_insensitive, /* 637 DEFVAR_BOOL ("mswindows-ls-sort-case-insensitive", &mswindows_ls_sort_case_insensitive, /*
639 *Non-nil means filenames are sorted in a case-insensitive fashion. 638 *Non-nil means filenames are sorted in a case-insensitive fashion.
640 Nil means filenames are sorted in a case-sensitive fashion, just like Unix. 639 Nil means filenames are sorted in a case-sensitive fashion, just like Unix.
641 */ ); 640 */ );
642 Vmswindows_ls_sort_case_insensitive = Qt; 641 mswindows_ls_sort_case_insensitive = 1;
643 642
644 DEFVAR_INT ("mswindows-ls-round-file-size", &Vmswindows_ls_round_file_size /* 643 DEFVAR_INT ("mswindows-ls-round-file-size", &mswindows_ls_round_file_size /*
645 *If non-zero, file sizes are rounded in terms of this block size when 644 *If non-zero, file sizes are rounded in terms of this block size when
646 the file totals are being calculated. This is useful for getting a more 645 the file totals are being calculated. This is useful for getting a more
647 accurate estimate of allocated disk space. Note that this only affects 646 accurate estimate of allocated disk space. Note that this only affects
648 the total size calculation; the individual displayed file sizes are not 647 the total size calculation; the individual displayed file sizes are not
649 changed. This block size should also be a power of 2 (but this is not 648 changed. This block size should also be a power of 2 (but this is not
655 * plain FAT, but, hopefully, plain FAT will go away someday. 654 * plain FAT, but, hopefully, plain FAT will go away someday.
656 * 655 *
657 * We should allow something like a alist here, to make the size 656 * We should allow something like a alist here, to make the size
658 * dependent on the drive letter, etc.. 657 * dependent on the drive letter, etc..
659 */ 658 */
660 Vmswindows_ls_round_file_size = 4096; 659 mswindows_ls_round_file_size = 4096;
661 } 660 }