Now on revision 105077. ------------------------------------------------------------ revno: 105077 committer: martin rudalics branch nick: trunk timestamp: Sun 2011-07-10 14:41:47 +0200 message: Revert last change of display-buffer-normalize-default. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-07-10 10:19:47 +0000 +++ lisp/ChangeLog 2011-07-10 12:41:47 +0000 @@ -1,9 +1,3 @@ -2011-07-10 Martin Rudalics - - * window.el (display-buffer-normalize-default): Don't invert - meaning of even-window-heights. Reported by Eli Zaretskii - . - 2011-07-10 Bob Rogers * vc/vc.el (vc-diff-internal): Fix race condition (Bug#1256). === modified file 'lisp/window.el' --- lisp/window.el 2011-07-10 10:19:47 +0000 +++ lisp/window.el 2011-07-10 12:41:47 +0000 @@ -5347,7 +5347,7 @@ ;; `even-window-heights' (unless (and (boundp 'even-window-heights) - even-window-heights) + (not even-window-heights)) (setq specifiers (cons (cons 'reuse-window-even-sizes t) specifiers))) ------------------------------------------------------------ revno: 105076 committer: martin rudalics branch nick: trunk timestamp: Sun 2011-07-10 12:19:47 +0200 message: Don't invert meaning of even-window-heights in display-buffer-normalize-default. * window.el (display-buffer-normalize-default): Don't invert meaning of even-window-heights. Reported by Eli Zaretskii . diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-07-10 02:04:45 +0000 +++ lisp/ChangeLog 2011-07-10 10:19:47 +0000 @@ -1,3 +1,9 @@ +2011-07-10 Martin Rudalics + + * window.el (display-buffer-normalize-default): Don't invert + meaning of even-window-heights. Reported by Eli Zaretskii + . + 2011-07-10 Bob Rogers * vc/vc.el (vc-diff-internal): Fix race condition (Bug#1256). === modified file 'lisp/window.el' --- lisp/window.el 2011-07-10 01:40:32 +0000 +++ lisp/window.el 2011-07-10 10:19:47 +0000 @@ -5347,7 +5347,7 @@ ;; `even-window-heights' (unless (and (boundp 'even-window-heights) - (not even-window-heights)) + even-window-heights) (setq specifiers (cons (cons 'reuse-window-even-sizes t) specifiers))) ------------------------------------------------------------ revno: 105075 committer: Andreas Schwab branch nick: emacs timestamp: Sun 2011-07-10 10:52:10 +0200 message: Protoize * src/alloc.c (reset_malloc_hooks): Protoize. * src/cm.c (losecursor): Likewise. * src/ralloc.c (r_alloc_check): Likewise. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-07-10 08:20:10 +0000 +++ src/ChangeLog 2011-07-10 08:52:10 +0000 @@ -1,7 +1,9 @@ 2011-07-10 Andreas Schwab + * alloc.c (reset_malloc_hooks): Protoize. * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge) - (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Protoize. + (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise. + * cm.c (losecursor): Likewise. * data.c (fmod): Likewise. * dispnew.c (swap_glyphs_in_rows): Likewise. * emacs.c (memory_warning_signal): Likewise. @@ -16,6 +18,7 @@ (inc_interval_count, count_intervals, root_interval) (adjust_intervals_for_insertion, make_new_interval): Likewise. * lread.c (defalias): Likewise. + * ralloc.c (r_alloc_check): Likewise. * regex.c (set_image_of_range_1, set_image_of_range) (regex_grow_registers): Likewise. * sysdep.c (strerror): Likewise. === modified file 'src/alloc.c' --- src/alloc.c 2011-07-06 22:22:32 +0000 +++ src/alloc.c 2011-07-10 08:52:10 +0000 @@ -1258,7 +1258,7 @@ calls malloc because it is the first call, and we have an endless loop. */ void -reset_malloc_hooks () +reset_malloc_hooks (void) { __free_hook = old_free_hook; __malloc_hook = old_malloc_hook; === modified file 'src/cm.c' --- src/cm.c 2011-03-23 08:06:21 +0000 +++ src/cm.c 2011-07-10 08:52:10 +0000 @@ -305,7 +305,8 @@ } #if 0 -losecursor () +void +losecursor (void) { curY = -1; } === modified file 'src/ralloc.c' --- src/ralloc.c 2011-02-07 05:47:56 +0000 +++ src/ralloc.c 2011-07-10 08:52:10 +0000 @@ -1079,7 +1079,7 @@ #include void -r_alloc_check () +r_alloc_check (void) { int found = 0; heap_ptr h, ph = 0; ------------------------------------------------------------ revno: 105074 committer: Andreas Schwab branch nick: emacs timestamp: Sun 2011-07-10 10:20:10 +0200 message: Protoize * src/buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge) (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Protoize. * src/data.c (fmod): Likewise. * src/dispnew.c (swap_glyphs_in_rows): Likewise. * src/emacs.c (memory_warning_signal): Likewise. * src/floatfns.c (float_error): Likewise. * src/font.c (check_gstring, check_otf_features, otf_tag_symbol) (otf_open, font_otf_capability, generate_otf_features) (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor): Likewise. * src/image.c (pbm_read_file): Likewise. * src/indent.c (string_display_width): Likewise. * src/intervals.c (check_for_interval, search_for_interval) (inc_interval_count, count_intervals, root_interval) (adjust_intervals_for_insertion, make_new_interval): Likewise. * src/lread.c (defalias): Likewise. * src/regex.c (set_image_of_range_1, set_image_of_range) (regex_grow_registers): Likewise. * src/sysdep.c (strerror): Likewise. * src/termcap.c (valid_filename_p, tprint, main): Likewise. * src/tparam.c (main): Likewise. * src/unexhp9k800.c (run_time_remap, save_data_space) (update_file_ptrs, read_header, write_header, calculate_checksum) (copy_file, copy_rest, display_header): Likewise. * src/widget.c (mark_shell_size_user_specified, create_frame_gcs): Likewise. * src/xdisp.c (check_it): Likewise. * src/xfaces.c (register_color, unregister_color, unregister_colors): Likewise. * src/xfns.c (print_fontset_result): Likewise. * src/xrdb.c (member, fatal, main): Likewise. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-07-10 04:58:22 +0000 +++ src/ChangeLog 2011-07-10 08:20:10 +0000 @@ -1,3 +1,37 @@ +2011-07-10 Andreas Schwab + + * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge) + (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Protoize. + * data.c (fmod): Likewise. + * dispnew.c (swap_glyphs_in_rows): Likewise. + * emacs.c (memory_warning_signal): Likewise. + * floatfns.c (float_error): Likewise. + * font.c (check_gstring, check_otf_features, otf_tag_symbol) + (otf_open, font_otf_capability, generate_otf_features) + (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor): + Likewise. + * image.c (pbm_read_file): Likewise. + * indent.c (string_display_width): Likewise. + * intervals.c (check_for_interval, search_for_interval) + (inc_interval_count, count_intervals, root_interval) + (adjust_intervals_for_insertion, make_new_interval): Likewise. + * lread.c (defalias): Likewise. + * regex.c (set_image_of_range_1, set_image_of_range) + (regex_grow_registers): Likewise. + * sysdep.c (strerror): Likewise. + * termcap.c (valid_filename_p, tprint, main): Likewise. + * tparam.c (main): Likewise. + * unexhp9k800.c (run_time_remap, save_data_space) + (update_file_ptrs, read_header, write_header, calculate_checksum) + (copy_file, copy_rest, display_header): Likewise. + * widget.c (mark_shell_size_user_specified, create_frame_gcs): + Likewise. + * xdisp.c (check_it): Likewise. + * xfaces.c (register_color, unregister_color, unregister_colors): + Likewise. + * xfns.c (print_fontset_result): Likewise. + * xrdb.c (member, fatal, main): Likewise. + 2011-07-10 Paul Eggert Fix minor problems found by static checking (Bug#9031). === modified file 'src/buffer.c' --- src/buffer.c 2011-07-06 22:22:32 +0000 +++ src/buffer.c 2011-07-10 08:20:10 +0000 @@ -4466,24 +4466,40 @@ #define MMAP_ALLOCATED_P(start, end) 1 #endif -/* Function prototypes. */ - -static int mmap_free_1 (struct mmap_region *); -static int mmap_enlarge (struct mmap_region *, int); -static struct mmap_region *mmap_find (POINTER_TYPE *, POINTER_TYPE *); -static POINTER_TYPE *mmap_alloc (POINTER_TYPE **, size_t); -static POINTER_TYPE *mmap_realloc (POINTER_TYPE **, size_t); -static void mmap_free (POINTER_TYPE **ptr); -static void mmap_init (void); - +/* Perform necessary intializations for the use of mmap. */ + +static void +mmap_init (void) +{ +#if MAP_ANON == 0 + /* The value of mmap_fd is initially 0 in temacs, and -1 + in a dumped Emacs. */ + if (mmap_fd <= 0) + { + /* No anonymous mmap -- we need the file descriptor. */ + mmap_fd = open ("/dev/zero", O_RDONLY); + if (mmap_fd == -1) + fatal ("Cannot open /dev/zero: %s", emacs_strerror (errno)); + } +#endif /* MAP_ANON == 0 */ + + if (mmap_initialized_p) + return; + mmap_initialized_p = 1; + +#if MAP_ANON != 0 + mmap_fd = -1; +#endif + + mmap_page_size = getpagesize (); +} /* Return a region overlapping address range START...END, or null if none. END is not including, i.e. the last byte in the range is at END - 1. */ static struct mmap_region * -mmap_find (start, end) - POINTER_TYPE *start, *end; +mmap_find (POINTER_TYPE *start, POINTER_TYPE *end); { struct mmap_region *r; char *s = (char *) start, *e = (char *) end; @@ -4512,8 +4528,7 @@ the region. Value is non-zero if successful. */ static int -mmap_free_1 (r) - struct mmap_region *r; +mmap_free_1 (struct mmap_region *r) { if (r->next) r->next->prev = r->prev; @@ -4536,9 +4551,7 @@ Value is non-zero if successful. */ static int -mmap_enlarge (r, npages) - struct mmap_region *r; - int npages; +mmap_enlarge (struct mmap_region *r, int npages) { char *region_end = (char *) r + r->nbytes_mapped; size_t nbytes; @@ -4602,8 +4615,7 @@ when Emacs starts. */ void -mmap_set_vars (restore_p) - int restore_p; +mmap_set_vars (int restore_p) { struct mmap_region *r; @@ -4636,9 +4648,7 @@ return null. */ static POINTER_TYPE * -mmap_alloc (var, nbytes) - POINTER_TYPE **var; - size_t nbytes; +mmap_alloc (POINTER_TYPE **var, size_t nbytes) { void *p; size_t map; @@ -4675,15 +4685,29 @@ } +/* Free a block of relocatable storage whose data is pointed to by + PTR. Store 0 in *PTR to show there's no block allocated. */ + +static void +mmap_free (POINTER_TYPE **var) +{ + mmap_init (); + + if (*var) + { + mmap_free_1 (MMAP_REGION (*var)); + *var = NULL; + } +} + + /* Given a pointer at address VAR to data allocated with mmap_alloc, resize it to size NBYTES. Change *VAR to reflect the new block, and return this value. If more memory cannot be allocated, then leave *VAR unchanged, and return null. */ static POINTER_TYPE * -mmap_realloc (var, nbytes) - POINTER_TYPE **var; - size_t nbytes; +mmap_realloc (POINTER_TYPE **var, size_t nbytes) { POINTER_TYPE *result; @@ -4753,51 +4777,6 @@ } -/* Free a block of relocatable storage whose data is pointed to by - PTR. Store 0 in *PTR to show there's no block allocated. */ - -static void -mmap_free (var) - POINTER_TYPE **var; -{ - mmap_init (); - - if (*var) - { - mmap_free_1 (MMAP_REGION (*var)); - *var = NULL; - } -} - - -/* Perform necessary intializations for the use of mmap. */ - -static void -mmap_init () -{ -#if MAP_ANON == 0 - /* The value of mmap_fd is initially 0 in temacs, and -1 - in a dumped Emacs. */ - if (mmap_fd <= 0) - { - /* No anonymous mmap -- we need the file descriptor. */ - mmap_fd = open ("/dev/zero", O_RDONLY); - if (mmap_fd == -1) - fatal ("Cannot open /dev/zero: %s", emacs_strerror (errno)); - } -#endif /* MAP_ANON == 0 */ - - if (mmap_initialized_p) - return; - mmap_initialized_p = 1; - -#if MAP_ANON != 0 - mmap_fd = -1; -#endif - - mmap_page_size = getpagesize (); -} - #endif /* USE_MMAP_FOR_BUFFERS */ === modified file 'src/data.c' --- src/data.c 2011-06-19 18:44:58 +0000 +++ src/data.c 2011-07-10 08:20:10 +0000 @@ -2736,8 +2736,7 @@ #ifndef HAVE_FMOD double -fmod (f1, f2) - double f1, f2; +fmod (double f1, double f2) { double r = f1; === modified file 'src/dispnew.c' --- src/dispnew.c 2011-06-25 18:21:00 +0000 +++ src/dispnew.c 2011-07-10 08:20:10 +0000 @@ -1062,8 +1062,7 @@ B without changing glyph pointers in A and B. */ static void -swap_glyphs_in_rows (a, b) - struct glyph_row *a, *b; +swap_glyphs_in_rows (struct glyph_row *a, struct glyph_row *b) { int area; === modified file 'src/emacs.c' --- src/emacs.c 2011-07-08 10:04:23 +0000 +++ src/emacs.c 2011-07-10 08:20:10 +0000 @@ -354,8 +354,7 @@ /* Handler for SIGDANGER. */ void -memory_warning_signal (sig) - int sig; +memory_warning_signal (int sig) { signal (sig, memory_warning_signal); SIGNAL_THREAD_CHECK (sig); === modified file 'src/floatfns.c' --- src/floatfns.c 2011-06-13 02:27:16 +0000 +++ src/floatfns.c 2011-07-10 08:20:10 +0000 @@ -961,8 +961,7 @@ #ifdef FLOAT_CATCH_SIGILL static void -float_error (signo) - int signo; +float_error (int signo) { if (! in_float) fatal_error_signal (signo); === modified file 'src/font.c' --- src/font.c 2011-07-06 22:43:48 +0000 +++ src/font.c 2011-07-10 08:20:10 +0000 @@ -1738,8 +1738,7 @@ #define LGSTRING_GLYPH_SIZE 8 static int -check_gstring (gstring) - Lisp_Object gstring; +check_gstring (Lisp_Object gstring) { Lisp_Object val; int i, j; @@ -1793,8 +1792,7 @@ } static void -check_otf_features (otf_features) - Lisp_Object otf_features; +check_otf_features (Lisp_Object otf_features) { Lisp_Object val; @@ -1827,8 +1825,7 @@ Lisp_Object otf_list; static Lisp_Object -otf_tag_symbol (tag) - OTF_Tag tag; +otf_tag_symbol (OTF_Tag tag) { char name[5]; @@ -1837,8 +1834,7 @@ } static OTF * -otf_open (file) - Lisp_Object file; +otf_open (Lisp_Object file) { Lisp_Object val = Fassoc (file, otf_list); OTF *otf; @@ -1860,8 +1856,7 @@ (struct font_driver).otf_capability. */ Lisp_Object -font_otf_capability (font) - struct font *font; +font_otf_capability (struct font *font) { OTF *otf; Lisp_Object capability = Fcons (Qnil, Qnil); @@ -1935,9 +1930,7 @@ FEATURES. */ static void -generate_otf_features (spec, features) - Lisp_Object spec; - char *features; +generate_otf_features (Lisp_Object spec, char *features) { Lisp_Object val; char *p; @@ -1972,8 +1965,7 @@ } Lisp_Object -font_otf_DeviceTable (device_table) - OTF_DeviceTable *device_table; +font_otf_DeviceTable (OTF_DeviceTable *device_table) { int len = device_table->StartSize - device_table->EndSize + 1; @@ -1982,9 +1974,7 @@ } Lisp_Object -font_otf_ValueRecord (value_format, value_record) - int value_format; - OTF_ValueRecord *value_record; +font_otf_ValueRecord (int value_format, OTF_ValueRecord *value_record) { Lisp_Object val = Fmake_vector (make_number (8), Qnil); @@ -2008,8 +1998,7 @@ } Lisp_Object -font_otf_Anchor (anchor) - OTF_Anchor *anchor; +font_otf_Anchor (OTF_Anchor *anchor) { Lisp_Object val; === modified file 'src/image.c' --- src/image.c 2011-06-23 00:46:41 +0000 +++ src/image.c 2011-07-10 08:20:10 +0000 @@ -5007,9 +5007,7 @@ occurred. *SIZE is set to the size of the file. */ static char * -pbm_read_file (file, size) - Lisp_Object file; - int *size; +pbm_read_file (Lisp_Object file, int *size) { FILE *fp = NULL; char *buf = NULL; === modified file 'src/indent.c' --- src/indent.c 2011-06-18 18:29:19 +0000 +++ src/indent.c 2011-07-10 08:20:10 +0000 @@ -725,8 +725,7 @@ If END is nil, that stands for the end of STRING. */ static double -string_display_width (string, beg, end) - Lisp_Object string, beg, end; +string_display_width (Lisp_Object string, Lisp_Object beg, Lisp_Object end) { register int col; register unsigned char *ptr, *stop; === modified file 'src/intervals.c' --- src/intervals.c 2011-06-21 16:47:56 +0000 +++ src/intervals.c 2011-07-10 08:20:10 +0000 @@ -247,8 +247,7 @@ INTERVAL search_interval, found_interval; void -check_for_interval (i) - register INTERVAL i; +check_for_interval (INTERVAL i) { if (i == search_interval) { @@ -258,8 +257,7 @@ } INTERVAL -search_for_interval (i, tree) - register INTERVAL i, tree; +search_for_interval (INTERVAL i, INTERVAL tree) { icount = 0; search_interval = i; @@ -269,8 +267,7 @@ } static void -inc_interval_count (i) - INTERVAL i; +inc_interval_count (INTERVAL i) { icount++; if (LENGTH (i) == 0) @@ -280,8 +277,7 @@ } int -count_intervals (i) - register INTERVAL i; +count_intervals (INTERVAL i) { icount = 0; idepth = 0; @@ -292,8 +288,7 @@ } static INTERVAL -root_interval (interval) - INTERVAL interval; +root_interval (INTERVAL interval) { register INTERVAL i = interval; @@ -804,9 +799,8 @@ to the root. */ static INTERVAL -adjust_intervals_for_insertion (tree, position, length) - INTERVAL tree; - EMACS_INT position, length; +adjust_intervals_for_insertion (INTERVAL tree, EMACS_INT position, + EMACS_INT length) { register EMACS_INT relative_position; register INTERVAL this; @@ -1615,9 +1609,7 @@ interval. */ static INTERVAL -make_new_interval (intervals, start, length) - INTERVAL intervals; - EMACS_INT start, length; +make_new_interval (INTERVAL intervals, EMACS_INT start, EMACS_INT length) { INTERVAL slot; === modified file 'src/lread.c' --- src/lread.c 2011-07-02 16:18:24 +0000 +++ src/lread.c 2011-07-10 08:20:10 +0000 @@ -4000,9 +4000,7 @@ #ifdef NOTDEF /* use fset in subr.el now */ void -defalias (sname, string) - struct Lisp_Subr *sname; - char *string; +defalias (struct Lisp_Subr *sname, char *string) { Lisp_Object sym; sym = intern (string); === modified file 'src/regex.c' --- src/regex.c 2011-04-16 18:26:30 +0000 +++ src/regex.c 2011-07-10 08:20:10 +0000 @@ -2202,10 +2202,9 @@ Returns -1 if successful, REG_ESPACE if ran out of space. */ static int -set_image_of_range_1 (work_area, start, end, translate) - RE_TRANSLATE_TYPE translate; - struct range_table_work_area *work_area; - re_wchar_t start, end; +set_image_of_range_1 (struct range_table_work_area *work_area, + re_wchar_t start, re_wchar_t end, + RE_TRANSLATE_TYPE translate) { /* `one_case' indicates a character, or a run of characters, each of which is an isolate (no case-equivalents). @@ -2355,10 +2354,9 @@ Returns -1 if successful, REG_ESPACE if ran out of space. */ static int -set_image_of_range (work_area, start, end, translate) - RE_TRANSLATE_TYPE translate; - struct range_table_work_area *work_area; - re_wchar_t start, end; +set_image_of_range (struct range_table_work_area *work_area, + re_wchar_t start, re_wchar_t end, + RE_TRANSLATE_TYPE translate) { re_wchar_t cmin, cmax; @@ -2445,8 +2443,7 @@ but don't make them smaller. */ static -regex_grow_registers (num_regs) - int num_regs; +regex_grow_registers (int num_regs) { if (num_regs > regs_allocated_size) { === modified file 'src/sysdep.c' --- src/sysdep.c 2011-07-06 18:04:23 +0000 +++ src/sysdep.c 2011-07-10 08:20:10 +0000 @@ -1802,8 +1802,7 @@ #ifndef HAVE_STRERROR #ifndef WINDOWSNT char * -strerror (errnum) - int errnum; +strerror (int errnum) { extern char *sys_errlist[]; extern int sys_nerr; === modified file 'src/termcap.c' --- src/termcap.c 2011-06-20 07:21:06 +0000 +++ src/termcap.c 2011-07-10 08:20:10 +0000 @@ -338,8 +338,7 @@ #ifdef MSDOS /* MW, May 1993 */ static int -valid_filename_p (fn) - char *fn; +valid_filename_p (char *fn) { return *fn == '/' || fn[1] == ':'; } @@ -669,9 +668,29 @@ #include -main (argc, argv) - int argc; - char **argv; +static void +tprint (char *cap) +{ + char *x = tgetstr (cap, 0); + register char *y; + + printf ("%s: ", cap); + if (x) + { + for (y = x; *y; y++) + if (*y <= ' ' || *y == 0177) + printf ("\\%0o", *y); + else + putchar (*y); + free (x); + } + else + printf ("none"); + putchar ('\n'); +} + +int +main (int argc, char **argv) { char *term; char *buf; @@ -693,27 +712,8 @@ printf ("co: %d\n", tgetnum ("co")); printf ("am: %d\n", tgetflag ("am")); -} - -tprint (cap) - char *cap; -{ - char *x = tgetstr (cap, 0); - register char *y; - - printf ("%s: ", cap); - if (x) - { - for (y = x; *y; y++) - if (*y <= ' ' || *y == 0177) - printf ("\\%0o", *y); - else - putchar (*y); - free (x); - } - else - printf ("none"); - putchar ('\n'); + + return 0; } #endif /* TEST */ === modified file 'src/tparam.c' --- src/tparam.c 2011-03-08 18:26:34 +0000 +++ src/tparam.c 2011-07-10 08:20:10 +0000 @@ -265,9 +265,8 @@ #ifdef DEBUG -main (argc, argv) - int argc; - char **argv; +int +main (int argc, char **argv) { char buf[50]; int args[3]; === modified file 'src/unexhp9k800.c' --- src/unexhp9k800.c 2011-03-17 18:41:30 +0000 +++ src/unexhp9k800.c 2011-07-10 08:20:10 +0000 @@ -64,8 +64,7 @@ /* Called from main, if we use shared libraries. */ int -run_time_remap (ignored) - char *ignored; +run_time_remap (char *ignored) { brk ((char *) brk_on_dump); } @@ -74,74 +73,11 @@ #define roundup(x,n) (((x) + ((n) - 1)) & ~((n) - 1)) /* n is power of 2 */ #define min(x,y) (((x) < (y)) ? (x) : (y)) - -/* Create a new a.out file, same as old but with current data space */ -void -unexec (const char *new_name, /* name of the new a.out file to be created */ - const char *old_name) /* name of the old a.out file */ -{ - int old, new; - int old_size, new_size; - struct header hdr; - struct som_exec_auxhdr auxhdr; - long i; - - /* For the greatest flexibility, should create a temporary file in - the same directory as the new file. When everything is complete, - rename the temp file to the new name. - This way, a program could update its own a.out file even while - it is still executing. If problems occur, everything is still - intact. NOT implemented. */ - - /* Open the input and output a.out files */ - old = open (old_name, O_RDONLY); - if (old < 0) - { perror (old_name); exit (1); } - new = open (new_name, O_CREAT|O_RDWR|O_TRUNC, 0777); - if (new < 0) - { perror (new_name); exit (1); } - - /* Read the old headers */ - read_header (old, &hdr, &auxhdr); - - brk_on_dump = (long) sbrk (0); - - /* Decide how large the new and old data areas are */ - old_size = auxhdr.exec_dsize; - /* I suspect these two statements are separate - to avoid a compiler bug in hpux version 8. */ - i = (long) sbrk (0); - new_size = i - auxhdr.exec_dmem; - - /* Copy the old file to the new, up to the data space */ - lseek (old, 0, 0); - copy_file (old, new, auxhdr.exec_dfile); - - /* Skip the old data segment and write a new one */ - lseek (old, old_size, 1); - save_data_space (new, &hdr, &auxhdr, new_size); - - /* Copy the rest of the file */ - copy_rest (old, new); - - /* Update file pointers since we probably changed size of data area */ - update_file_ptrs (new, &hdr, &auxhdr, auxhdr.exec_dfile, new_size-old_size); - - /* Save the modified header */ - write_header (new, &hdr, &auxhdr); - - /* Close the binary file */ - close (old); - close (new); -} - /* Save current data space in the file, update header. */ -save_data_space (file, hdr, auxhdr, size) - int file; - struct header *hdr; - struct som_exec_auxhdr *auxhdr; - int size; +static void +save_data_space (int file, struct header *hdr, struct som_exec_auxhdr *auxhdr, + int size) { /* Write the entire data space out to the file */ if (write (file, auxhdr->exec_dmem, size) != size) @@ -154,12 +90,9 @@ /* Update the values of file pointers when something is inserted. */ -update_file_ptrs (file, hdr, auxhdr, location, offset) - int file; - struct header *hdr; - struct som_exec_auxhdr *auxhdr; - unsigned int location; - int offset; +static void +update_file_ptrs (int file, struct header *hdr, struct som_exec_auxhdr *auxhdr, + unsigned int location, int offset) { struct subspace_dictionary_record subspace; int i; @@ -205,10 +138,8 @@ /* Read in the header records from an a.out file. */ -read_header (file, hdr, auxhdr) - int file; - struct header *hdr; - struct som_exec_auxhdr *auxhdr; +static void +read_header (int file, struct header *hdr, struct som_exec_auxhdr *auxhdr) { /* Read the header in */ @@ -233,10 +164,8 @@ /* Write out the header records into an a.out file. */ -write_header (file, hdr, auxhdr) - int file; - struct header *hdr; - struct som_exec_auxhdr *auxhdr; +static void +write_header (int file, struct header *hdr, struct som_exec_auxhdr *auxhdr) { /* Update the checksum */ hdr->checksum = calculate_checksum (hdr); @@ -252,8 +181,8 @@ /* Calculate the checksum of a SOM header record. */ -calculate_checksum (hdr) - struct header *hdr; +static int +calculate_checksum (struct header *hdr) { int checksum, i, *ptr; @@ -267,9 +196,8 @@ /* Copy size bytes from the old file to the new one. */ -copy_file (old, new, size) - int new, old; - int size; +static void +copy_file (int old, int new, int size) { int len; int buffer[8192]; /* word aligned will be faster */ @@ -286,8 +214,8 @@ /* Copy the rest of the file, up to EOF. */ -copy_rest (old, new) - int new, old; +static void +copy_rest (int old, int new) { int buffer[4096]; int len; @@ -301,9 +229,8 @@ } #ifdef DEBUG -display_header (hdr, auxhdr) - struct header *hdr; - struct som_exec_auxhdr *auxhdr; +static void +display_header (struct header *hdr, struct som_exec_auxhdr *auxhdr) { /* Display the header information (debug) */ printf ("\n\nFILE HEADER\n"); @@ -320,3 +247,64 @@ hdr->unloadable_sp_location, hdr->unloadable_sp_size); } #endif /* DEBUG */ + + +/* Create a new a.out file, same as old but with current data space */ +void +unexec (const char *new_name, /* name of the new a.out file to be created */ + const char *old_name) /* name of the old a.out file */ +{ + int old, new; + int old_size, new_size; + struct header hdr; + struct som_exec_auxhdr auxhdr; + long i; + + /* For the greatest flexibility, should create a temporary file in + the same directory as the new file. When everything is complete, + rename the temp file to the new name. + This way, a program could update its own a.out file even while + it is still executing. If problems occur, everything is still + intact. NOT implemented. */ + + /* Open the input and output a.out files */ + old = open (old_name, O_RDONLY); + if (old < 0) + { perror (old_name); exit (1); } + new = open (new_name, O_CREAT|O_RDWR|O_TRUNC, 0777); + if (new < 0) + { perror (new_name); exit (1); } + + /* Read the old headers */ + read_header (old, &hdr, &auxhdr); + + brk_on_dump = (long) sbrk (0); + + /* Decide how large the new and old data areas are */ + old_size = auxhdr.exec_dsize; + /* I suspect these two statements are separate + to avoid a compiler bug in hpux version 8. */ + i = (long) sbrk (0); + new_size = i - auxhdr.exec_dmem; + + /* Copy the old file to the new, up to the data space */ + lseek (old, 0, 0); + copy_file (old, new, auxhdr.exec_dfile); + + /* Skip the old data segment and write a new one */ + lseek (old, old_size, 1); + save_data_space (new, &hdr, &auxhdr, new_size); + + /* Copy the rest of the file */ + copy_rest (old, new); + + /* Update file pointers since we probably changed size of data area */ + update_file_ptrs (new, &hdr, &auxhdr, auxhdr.exec_dfile, new_size-old_size); + + /* Save the modified header */ + write_header (new, &hdr, &auxhdr); + + /* Close the binary file */ + close (old); + close (new); +} === modified file 'src/widget.c' --- src/widget.c 2011-06-13 08:00:15 +0000 +++ src/widget.c 2011-07-10 08:20:10 +0000 @@ -224,8 +224,7 @@ #if 0 /* Currently not used. */ static void -mark_shell_size_user_specified (wmshell) - Widget wmshell; +mark_shell_size_user_specified (Widget wmshell) { if (! XtIsWMShell (wmshell)) abort (); /* This is kind of sleazy, but I can't see how else to tell it to make it @@ -510,8 +509,7 @@ #if 0 static void -create_frame_gcs (ew) - EmacsFrame ew; +create_frame_gcs (EmacsFrame ew) { struct frame *s = ew->emacs_frame.frame; === modified file 'src/xdisp.c' --- src/xdisp.c 2011-07-07 16:18:25 +0000 +++ src/xdisp.c 2011-07-10 08:20:10 +0000 @@ -2209,8 +2209,7 @@ This is for debugging. It is too slow to do unconditionally. */ static void -check_it (it) - struct it *it; +check_it (struct it *it) { if (it->method == GET_FROM_STRING) { === modified file 'src/xfaces.c' --- src/xfaces.c 2011-07-03 22:16:07 +0000 +++ src/xfaces.c 2011-07-10 08:20:10 +0000 @@ -536,8 +536,7 @@ /* Register color PIXEL as allocated. */ void -register_color (pixel) - unsigned long pixel; +register_color (unsigned long pixel) { xassert (pixel < 256); ++color_count[pixel]; @@ -547,8 +546,7 @@ /* Register color PIXEL as deallocated. */ void -unregister_color (pixel) - unsigned long pixel; +unregister_color (unsigned long pixel) { xassert (pixel < 256); if (color_count[pixel] > 0) @@ -561,9 +559,7 @@ /* Register N colors from PIXELS as deallocated. */ void -unregister_colors (pixels, n) - unsigned long *pixels; - int n; +unregister_colors (unsigned long *pixels, int n) { int i; for (i = 0; i < n; ++i) === modified file 'src/xfns.c' --- src/xfns.c 2011-07-04 18:31:29 +0000 +++ src/xfns.c 2011-07-10 08:20:10 +0000 @@ -2001,11 +2001,8 @@ #ifdef DEBUG_XIC_FONTSET static void -print_fontset_result (xfs, name, missing_list, missing_count) - XFontSet xfs; - char *name; - char **missing_list; - int missing_count; +print_fontset_result (XFontSet xfs, char *name, char **missing_list, + int missing_count) { if (xfs) fprintf (stderr, "XIC Fontset created: %s\n", name); === modified file 'src/xrdb.c' --- src/xrdb.c 2011-06-21 02:15:16 +0000 +++ src/xrdb.c 2011-07-10 08:20:10 +0000 @@ -651,9 +651,7 @@ #define free_arglist(list) static List -member (elt, list) - char *elt; - List list; +member (char *elt, List list) { List p; @@ -665,20 +663,17 @@ } static void -fatal (msg, prog, x1, x2, x3, x4, x5) - char *msg, *prog; - int x1, x2, x3, x4, x5; +fatal (char *msg, char *prog) { - if (errno) - perror (prog); + if (errno) + perror (prog); - (void) fprintf (stderr, msg, prog, x1, x2, x3, x4, x5); - exit (1); + (void) fprintf (stderr, msg, prog); + exit (1); } -main (argc, argv) - int argc; - char **argv; +int +main (int argc, char **argv) { Display *display; char *displayname, *resource_string, *class, *name; @@ -749,5 +744,7 @@ printf ("\tExit.\n\n"); XCloseDisplay (display); + + return 0; } #endif /* TESTRM */ ------------------------------------------------------------ revno: 105073 [merge] fixes bug(s): http://debbugs.gnu.org/9031 committer: Paul Eggert branch nick: trunk timestamp: Sat 2011-07-09 22:12:16 -0700 message: Merge: Fix minor problems found by static checking (Bug#9031). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-07-09 13:58:09 +0000 +++ src/ChangeLog 2011-07-10 04:58:22 +0000 @@ -1,3 +1,11 @@ +2011-07-10 Paul Eggert + + Fix minor problems found by static checking (Bug#9031). + * chartab.c (char_table_set_range, map_sub_char_table): + Remove unused locals. + (uniprop_table): Now static. + * composite.c (_work_char): Remove unused static var. + 2011-07-09 Juanma Barranquero * chartab.c (uniprop_table_uncompress): Remove unused local variable. === modified file 'src/chartab.c' --- src/chartab.c 2011-07-09 13:58:09 +0000 +++ src/chartab.c 2011-07-10 04:54:04 +0000 @@ -485,7 +485,6 @@ char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val) { struct Lisp_Char_Table *tbl = XCHAR_TABLE (table); - Lisp_Object *contents = tbl->contents; if (from == to) char_table_set (table, from, val); @@ -759,8 +758,6 @@ Lisp_Object function, Lisp_Object table, Lisp_Object arg, Lisp_Object val, Lisp_Object range, Lisp_Object top) { - /* Pointer to the elements of TABLE. */ - Lisp_Object *contents; /* Depth of TABLE. */ int depth; /* Minimum and maxinum characters covered by TABLE. */ @@ -777,14 +774,12 @@ struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); depth = XINT (tbl->depth); - contents = tbl->contents; min_char = XINT (tbl->min_char); max_char = min_char + chartab_chars[depth - 1] - 1; } else { depth = 0; - contents = XCHAR_TABLE (table)->contents; min_char = 0; max_char = MAX_CHAR; } @@ -1315,7 +1310,7 @@ function may load a Lisp file and thus may cause garbage-collection. */ -Lisp_Object +static Lisp_Object uniprop_table (Lisp_Object prop) { Lisp_Object val, table, result; === modified file 'src/composite.c' --- src/composite.c 2011-07-07 16:18:25 +0000 +++ src/composite.c 2011-07-09 06:28:40 +0000 @@ -967,7 +967,6 @@ } static Lisp_Object _work_val; -static int _work_char; /* 1 iff the character C is composable. Characters of general category Z? or C? are not composable except for ZWNJ and ZWJ. */ ------------------------------------------------------------ revno: 105072 committer: Chong Yidong branch nick: trunk timestamp: Sun 2011-07-10 00:12:48 -0400 message: * doc/emacs/misc.texi (Amusements): Don't mention Yow; it's crippled. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-07-10 04:05:33 +0000 +++ doc/emacs/ChangeLog 2011-07-10 04:12:48 +0000 @@ -1,5 +1,7 @@ 2011-07-10 Chong Yidong + * misc.texi (Amusements): Don't mention Yow; it's crippled. + * modes.texi: Rename from major.texi. (Modes): New node. Make Major Modes and Minor Modes subsections of this. All callers changed. === modified file 'doc/emacs/misc.texi' --- doc/emacs/misc.texi 2011-06-25 18:05:48 +0000 +++ doc/emacs/misc.texi 2011-07-10 04:12:48 +0000 @@ -2794,7 +2794,6 @@ @section Other Amusements @cindex boredom @findex hanoi -@findex yow @findex gomoku @cindex tower of Hanoi @@ -2882,9 +2881,6 @@ When you are frustrated, try the famous Eliza program. Just do @kbd{M-x doctor}. End each input by typing @key{RET} twice. -@cindex Zippy - When you are feeling strange, type @kbd{M-x yow}. - @findex zone The command @kbd{M-x zone} plays games with the display when Emacs is idle. ------------------------------------------------------------ revno: 105071 committer: Chong Yidong branch nick: trunk timestamp: Sun 2011-07-10 00:05:33 -0400 message: Move Minor Modes node of Emacs manual next to the Major Modes node and out of the Customizations chapter. * doc/emacs/modes.texi: Rename from major.texi. (Modes): New node. Make Major Modes and Minor Modes subsections of this. All callers changed. * doc/emacs/custom.texi (Minor Modes): Move to modes.texi. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-07-10 03:11:47 +0000 +++ doc/emacs/ChangeLog 2011-07-10 04:05:33 +0000 @@ -1,5 +1,13 @@ 2011-07-10 Chong Yidong + * modes.texi: Rename from major.texi. + (Modes): New node. Make Major Modes and Minor Modes subsections + of this. All callers changed. + + * custom.texi (Minor Modes): Move to modes.texi. + +2011-07-10 Chong Yidong + * custom.texi (Syntax): Node deleted. * help.texi (Help Summary): === modified file 'doc/emacs/Makefile.in' --- doc/emacs/Makefile.in 2011-03-23 03:09:55 +0000 +++ doc/emacs/Makefile.in 2011-07-10 04:05:33 +0000 @@ -84,7 +84,7 @@ ${srcdir}/windows.texi \ ${srcdir}/frames.texi \ ${srcdir}/mule.texi \ - ${srcdir}/major.texi \ + ${srcdir}/modes.texi \ ${srcdir}/indent.texi \ ${srcdir}/text.texi \ ${srcdir}/programs.texi \ === modified file 'doc/emacs/custom.texi' --- doc/emacs/custom.texi 2011-07-10 03:11:47 +0000 +++ doc/emacs/custom.texi 2011-07-10 04:05:33 +0000 @@ -23,8 +23,6 @@ @end ifnottex @menu -* Minor Modes:: Each minor mode is a feature you can turn on - independently of any others. * Easy Customization:: Convenient way to browse and change settings. * Variables:: Many Emacs commands examine Emacs variables to decide what to do; by setting variables, @@ -35,155 +33,6 @@ @file{.emacs} file. @end menu -@node Minor Modes -@section Minor Modes -@cindex minor modes -@cindex mode, minor - - Minor modes are optional features which you can turn on or off. For -example, Auto Fill mode is a minor mode in which @key{SPC} breaks -lines between words as you type. Minor modes are independent of one -another and of the selected major mode. Most minor modes say in the -mode line when they are enabled; for example, @samp{Fill} in the mode -line means that Auto Fill mode is enabled. - - Each minor mode is associated with a command, called the @dfn{mode -command}, which turns it on or off. The name of this command consists -of the name of the minor mode, followed by @samp{-mode}; for instance, -the mode command for Auto Fill mode is @code{auto-fill-mode}. Calling -the minor mode command with no prefix argument @dfn{toggles} the mode, -turning it on if it was off, and off if it was on. A positive -argument always turns the mode on, and a zero or negative argument -always turns it off. Mode commands are usually invoked with -@kbd{M-x}, but you can bind keys to them if you wish (@pxref{Key -Bindings}). - - Most minor modes also have a @dfn{mode variable}, with the same name -as the mode command. Its value is non-@code{nil} if the mode is -enabled, and @code{nil} if it is disabled. In some minor modes---but -not all---the value of the variable alone determines whether the mode -is active: the mode command works simply by setting the variable, and -changing the value of the variable has the same effect as calling the -mode command. Because not all minor modes work this way, we recommend -that you avoid changing the mode variables directly; use the mode -commands instead. - - Some minor modes are @dfn{buffer-local}: they apply only to the -current buffer, so you can enable the mode in certain buffers and not -others. Other minor modes are @dfn{global}: while enabled, they -affect everything you do in the Emacs session, in all buffers. Some -global minor modes are enabled by default. - - The following is a list of some buffer-local minor modes: - -@itemize @bullet -@item -Abbrev mode automatically expands text based on pre-defined -abbreviation definitions. @xref{Abbrevs}. - -@item -Auto Fill mode inserts newlines as you type to prevent lines from -becoming too long. @xref{Filling}. - -@item -Auto Save mode saves the buffer contents periodically to reduce the -amount of work you can lose in case of a crash. @xref{Auto Save}. - -@item -Enriched mode enables editing and saving of formatted text. -@xref{Formatted Text}. - -@item -Flyspell mode automatically highlights misspelled words. -@xref{Spelling}. - -@item -Font-Lock mode automatically highlights certain textual units found in -programs. It is enabled globally by default, but you can disable it -in individual buffers. @xref{Faces}. - -@findex linum-mode -@cindex Linum mode -@item -Linum mode displays each line's line number in the window's left -margin. Its mode command is @code{linum-mode}. - -@item -Outline minor mode provides similar facilities to the major mode -called Outline mode. @xref{Outline Mode}. - -@cindex Overwrite mode -@cindex mode, Overwrite -@findex overwrite-mode -@kindex INSERT -@item -Overwrite mode causes ordinary printing characters to replace existing -text instead of shoving it to the right. For example, if point is in -front of the @samp{B} in @samp{FOOBAR}, then in Overwrite mode typing -a @kbd{G} changes it to @samp{FOOGAR}, instead of producing -@samp{FOOGBAR} as usual. In Overwrite mode, the command @kbd{C-q} -inserts the next character whatever it may be, even if it is a -digit---this gives you a way to insert a character instead of -replacing an existing character. The mode command, -@code{overwrite-mode}, is bound to the @key{Insert} key. - -@findex binary-overwrite-mode -@item -Binary Overwrite mode is a variant of Overwrite mode for editing -binary files; it treats newlines and tabs like other characters, so -that they overwrite other characters and can be overwritten by them. -In Binary Overwrite mode, digits after @kbd{C-q} specify an octal -character code, as usual. - -@item -Visual Line mode performs ``word wrapping'', causing long lines to be -wrapped at word boundaries. @xref{Visual Line Mode}. -@end itemize - - Here are some useful global minor modes. Since Line Number mode and -Transient Mark mode can be enabled or disabled just by setting the -value of the minor mode variable, you @emph{can} set them differently -for particular buffers, by explicitly making the corresponding -variable local in those buffers. @xref{Locals}. - -@itemize @bullet -@item -Column Number mode enables display of the current column number in the -mode line. @xref{Mode Line}. - -@item -Delete Selection mode causes text insertion to first delete the text -in the region, if the region is active. @xref{Using Region}. - -@item -Icomplete mode displays an indication of available completions when -you are in the minibuffer and completion is active. @xref{Completion -Options}. - -@item -Line Number mode enables display of the current line number in the -mode line. It is enabled by default. @xref{Mode Line}. - -@item -Menu Bar mode gives each frame a menu bar. It is enabled by default. -@xref{Menu Bars}. - -@item -Scroll Bar mode gives each window a scroll bar. It is enabled by -default, but the scroll bar is only displayed on graphical terminals. -@xref{Scroll Bars}. - -@item -Tool Bar mode gives each frame a tool bar. It is enabled by default, -but the tool bar is only displayed on graphical terminals. @xref{Tool -Bars}. - -@item -Transient Mark mode highlights the region, and makes many Emacs -commands operate on the region when the mark is active. It is enabled -by default. @xref{Mark}. -@end itemize - @node Easy Customization @section Easy Customization Interface === modified file 'doc/emacs/emacs.texi' --- doc/emacs/emacs.texi 2011-07-10 03:11:47 +0000 +++ doc/emacs/emacs.texi 2011-07-10 04:05:33 +0000 @@ -184,7 +184,7 @@ * International:: Using non-@acronym{ASCII} character sets. Advanced Features -* Major Modes:: Text mode vs. Lisp mode vs. C mode... +* Modes:: Major and minor modes alter Emacs' basic behavior. * Indentation:: Editing the white space at the beginnings of lines. * Text:: Commands and modes for editing English. * Programs:: Commands and modes for editing programs. @@ -549,9 +549,12 @@ to use without multibyte characters. * Charsets:: How Emacs groups its internal character codes. -Major Modes +Modes -* Choosing Modes:: How major modes are specified or chosen. +* Major Modes:: Text mode vs. Lisp mode vs. C mode... +* Minor Modes:: Each minor mode is a feature you can turn on + independently of any others. +* Choosing Modes:: How modes are chosen when visiting files. Indentation @@ -1058,8 +1061,6 @@ Customization -* Minor Modes:: Each minor mode is a feature you can turn on - independently of any others. * Easy Customization:: Convenient way to browse and change settings. * Variables:: Many Emacs commands examine Emacs variables to decide what to do; by setting variables, @@ -1485,7 +1486,7 @@ @include windows.texi @include frames.texi @include mule.texi -@include major.texi +@include modes.texi @include indent.texi @include text.texi @c Includes fortran-xtra. === modified file 'doc/emacs/indent.texi' --- doc/emacs/indent.texi 2011-01-25 04:08:28 +0000 +++ doc/emacs/indent.texi 2011-07-10 04:05:33 +0000 @@ -2,7 +2,7 @@ @c Copyright (C) 1985-1987, 1993-1995, 1997, 2001-2011 @c Free Software Foundation, Inc. @c See file emacs.texi for copying conditions. -@node Indentation, Text, Major Modes, Top +@node Indentation, Text, Modes, Top @chapter Indentation @cindex indentation @cindex tabs === renamed file 'doc/emacs/major.texi' => 'doc/emacs/modes.texi' --- doc/emacs/major.texi 2011-07-10 03:11:47 +0000 +++ doc/emacs/modes.texi 2011-07-10 04:05:33 +0000 @@ -2,35 +2,67 @@ @c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2011 @c Free Software Foundation, Inc. @c See file emacs.texi for copying conditions. -@node Major Modes, Indentation, International, Top -@chapter Major Modes +@node Modes, Indentation, International, Top +@chapter Editing Modes + + Emacs contains many @dfn{editing modes}, each of which alters its +basic behavior in useful ways. These are divided into @dfn{major +modes} and @dfn{minor modes}. + + Major modes provide specialized facilities for working on a +particular file type, such as a C source file (@pxref{Programs}), or a +particular type of non-file buffer, such as a shell buffer +(@pxref{Shell}). Major modes are mutually exclusive; each buffer has +one and only one major mode at any time. + + Minor modes are optional features which you can turn on or off, not +necessarily specific to a type of file or buffer. For example, Auto +Fill mode is a minor mode in which @key{SPC} breaks lines between +words as you type (@pxref{Auto Fill}). Minor modes are independent of +one another, and of the selected major mode. + +@menu +* Major Modes:: Text mode vs. Lisp mode vs. C mode... +* Minor Modes:: Each minor mode is a feature you can turn on + independently of any others. +* Choosing Modes:: How modes are chosen when visiting files. +@end menu + +@node Major Modes +@section Major Modes @cindex major modes @cindex mode, major @kindex TAB @r{(and major modes)} @kindex DEL @r{(and major modes)} @kindex C-j @r{(and major modes)} - Emacs provides many alternative @dfn{major modes}, each of which -customizes Emacs for editing text of a particular sort. The major modes -are mutually exclusive, and each buffer has one major mode at any time. -The mode line normally shows the name of the current major mode, in -parentheses (@pxref{Mode Line}). + Every buffer possesses a major mode, which determines the editing +behavior of Emacs while that buffer is current. The mode line +normally shows the name of the current major mode, in parentheses. +@xref{Mode Line}. + + Usually, the major mode is automatically set by Emacs, when you +first visit a file or create a buffer. @xref{Choosing Modes}. You +can explicitly select a new major mode by using an @kbd{M-x} command. +Take the name of the mode and add @code{-mode} to get the name of the +command to select that mode. Thus, you can enter Lisp mode with +@kbd{M-x lisp-mode}. The least specialized major mode is called @dfn{Fundamental mode}. This mode has no mode-specific redefinitions or variable settings, so that each Emacs command behaves in its most general manner, and each -user option variable is in its default state. For editing text of a -specific type that Emacs knows about, such as Lisp code or English -text, you should switch to the appropriate major mode, such as Lisp -mode or Text mode. +user option variable is in its default state. - Selecting a major mode changes the meanings of a few keys to become -more specifically adapted to the language being edited. The ones that -are changed frequently are @key{TAB}, @key{DEL}, and @kbd{C-j}. The -prefix key @kbd{C-c} normally contains mode-specific commands. In -addition, the commands which handle comments use the mode to determine -how comments are to be delimited. Many major modes redefine the -syntactical properties of characters appearing in the buffer. + For editing text of a specific type that Emacs knows about, such as +Lisp code or English text, you typically use a more specialized major +mode, such as Lisp mode or Text mode. Such major modes change the +meanings of some keys to become more specifically adapted to the +language being edited. The ones that are commonly changed are +@key{TAB}, @key{DEL}, and @kbd{C-j}. The prefix key @kbd{C-c} +normally contains mode-specific commands. In addition, the commands +which handle comments use the mode to determine how comments are to be +delimited. Many major modes redefine the syntactical properties of +characters appearing in the buffer. The major modes fall into three major groups. The first group contains modes for normal text, either plain or with mark-up. It @@ -52,37 +84,176 @@ because most lines in a program are usually indented (@pxref{Indentation}). -@menu -* Choosing Modes:: How major modes are specified or chosen. -@end menu - -@node Choosing Modes,,Major Modes,Major Modes -@section How Major Modes are Chosen +@node Minor Modes +@section Minor Modes +@cindex minor modes +@cindex mode, minor + + A minor mode is an optional editing modes that alters the behavior +of Emacs in some well-defined way. Unlike major modes, any number of +minor modes can be in effect at any time. Some minor modes are +@dfn{buffer-local}: they apply only to the current buffer, so you can +enable the mode in certain buffers and not others. Other minor modes +are @dfn{global}: while enabled, they affect everything you do in the +Emacs session, in all buffers. Some global minor modes are enabled by +default. + + Most minor modes say in the mode line when they are enabled, just +after the major mode indicator. For example, @samp{Fill} in the mode +line means that Auto Fill mode is enabled. @xref{Mode Line}. + + Each minor mode is associated with a command, called the @dfn{mode +command}, which turns it on or off. The name of this command consists +of the name of the minor mode, followed by @samp{-mode}; for instance, +the mode command for Auto Fill mode is @code{auto-fill-mode}. Calling +the minor mode command with no prefix argument @dfn{toggles} the mode, +turning it on if it was off, and off if it was on. A positive +argument always turns the mode on, and a zero or negative argument +always turns it off. Mode commands are usually invoked with +@kbd{M-x}, but you can bind keys to them if you wish (@pxref{Key +Bindings}). + + Most minor modes also have a @dfn{mode variable}, with the same name +as the mode command. Its value is non-@code{nil} if the mode is +enabled, and @code{nil} if it is disabled. In some minor modes---but +not all---the value of the variable alone determines whether the mode +is active: the mode command works simply by setting the variable, and +changing the value of the variable has the same effect as calling the +mode command. Because not all minor modes work this way, we recommend +that you avoid changing the mode variables directly; use the mode +commands instead. + + The following is a list of some buffer-local minor modes: + +@itemize @bullet +@item +Abbrev mode automatically expands text based on pre-defined +abbreviation definitions. @xref{Abbrevs}. + +@item +Auto Fill mode inserts newlines as you type to prevent lines from +becoming too long. @xref{Filling}. + +@item +Auto Save mode saves the buffer contents periodically to reduce the +amount of work you can lose in case of a crash. @xref{Auto Save}. + +@item +Enriched mode enables editing and saving of formatted text. +@xref{Formatted Text}. + +@item +Flyspell mode automatically highlights misspelled words. +@xref{Spelling}. + +@item +Font-Lock mode automatically highlights certain textual units found in +programs. It is enabled globally by default, but you can disable it +in individual buffers. @xref{Faces}. + +@findex linum-mode +@cindex Linum mode +@item +Linum mode displays each line's line number in the window's left +margin. Its mode command is @code{linum-mode}. + +@item +Outline minor mode provides similar facilities to the major mode +called Outline mode. @xref{Outline Mode}. + +@cindex Overwrite mode +@cindex mode, Overwrite +@findex overwrite-mode +@kindex INSERT +@item +Overwrite mode causes ordinary printing characters to replace existing +text instead of shoving it to the right. For example, if point is in +front of the @samp{B} in @samp{FOOBAR}, then in Overwrite mode typing +a @kbd{G} changes it to @samp{FOOGAR}, instead of producing +@samp{FOOGBAR} as usual. In Overwrite mode, the command @kbd{C-q} +inserts the next character whatever it may be, even if it is a +digit---this gives you a way to insert a character instead of +replacing an existing character. The mode command, +@code{overwrite-mode}, is bound to the @key{Insert} key. + +@findex binary-overwrite-mode +@item +Binary Overwrite mode is a variant of Overwrite mode for editing +binary files; it treats newlines and tabs like other characters, so +that they overwrite other characters and can be overwritten by them. +In Binary Overwrite mode, digits after @kbd{C-q} specify an octal +character code, as usual. + +@item +Visual Line mode performs ``word wrapping'', causing long lines to be +wrapped at word boundaries. @xref{Visual Line Mode}. +@end itemize + + Here are some useful global minor modes. Since Line Number mode and +Transient Mark mode can be enabled or disabled just by setting the +value of the minor mode variable, you @emph{can} set them differently +for particular buffers, by explicitly making the corresponding +variable local in those buffers. @xref{Locals}. + +@itemize @bullet +@item +Column Number mode enables display of the current column number in the +mode line. @xref{Mode Line}. + +@item +Delete Selection mode causes text insertion to first delete the text +in the region, if the region is active. @xref{Using Region}. + +@item +Icomplete mode displays an indication of available completions when +you are in the minibuffer and completion is active. @xref{Completion +Options}. + +@item +Line Number mode enables display of the current line number in the +mode line. It is enabled by default. @xref{Mode Line}. + +@item +Menu Bar mode gives each frame a menu bar. It is enabled by default. +@xref{Menu Bars}. + +@item +Scroll Bar mode gives each window a scroll bar. It is enabled by +default, but the scroll bar is only displayed on graphical terminals. +@xref{Scroll Bars}. + +@item +Tool Bar mode gives each frame a tool bar. It is enabled by default, +but the tool bar is only displayed on graphical terminals. @xref{Tool +Bars}. + +@item +Transient Mark mode highlights the region, and makes many Emacs +commands operate on the region when the mark is active. It is enabled +by default. @xref{Mark}. +@end itemize + +@node Choosing Modes +@section Choosing File Modes @cindex choosing a major mode - You can select a major mode explicitly for the current buffer, but -most of the time Emacs determines which mode to use based on the file -name or on special text in the file. - - To explicitly select a new major, you use an @kbd{M-x} command. -Take the name of a major mode and add @code{-mode} to get the name of -the command to select that mode. Thus, you can enter Lisp mode by -executing @kbd{M-x lisp-mode}. - +@cindex choosing a minor mode @vindex auto-mode-alist - When you visit a file, Emacs usually chooses the right major mode -automatically. Normally, it makes the choice based on the file -name---for example, files whose names end in @samp{.c} are normally -edited in C mode---but sometimes it chooses the major mode based on -the contents of the file. Here is the exact procedure: - - First, Emacs checks whether the file contains a file-local variable -that specifies the major mode. If so, it uses that major mode, -ignoring all other criteria. @xref{File Variables}. There are -several methods to specify a major mode using a file-local variable; -the simplest is to put the mode name in the first nonblank line, -preceded and followed by @samp{-*-}. Other text may appear on the -line as well. For example, + When you visit a file, Emacs chooses a major mode automatically. +Normally, it makes the choice based on the file name---for example, +files whose names end in @samp{.c} are normally edited in C mode---but +sometimes it chooses the major mode based on special text in the file. +This special text can also be used to enable buffer-local minor modes. + + Here is the exact procedure: + + First, Emacs checks whether the file contains file-local mode +variables. @xref{File Variables}. If there is a file-local variable +that specifies a major mode, then Emacs uses that major mode, ignoring +all other criteria. There are several methods to specify a major mode +using a file-local variable; the simplest is to put the mode name in +the first nonblank line, preceded and followed by @samp{-*-}. Other +text may appear on the line as well. For example, @example ; -*-Lisp-*- @@ -104,16 +275,19 @@ ; -*- mode: Lisp; tab-width: 4; -*- @end example + If a file variable specifies a buffer-local minor mode, Emacs +enables that minor mode in the buffer. + @vindex interpreter-mode-alist - Second, Emacs checks whether the file's contents begin with -@samp{#!}. If so, that indicates that the file can serve as an -executable shell command, which works by running an interpreter named -on the file's first line (the rest of the file is used as input to the -interpreter). Therefore, Emacs tries to use the interpreter name to -choose a mode. For instance, a file that begins with -@samp{#!/usr/bin/perl} is opened in Perl mode. The variable -@code{interpreter-mode-alist} specifies the correspondence between -interpreter program names and major modes. + Second, if there is no file variable specifying a major mode, Emacs +checks whether the file's contents begin with @samp{#!}. If so, that +indicates that the file can serve as an executable shell command, +which works by running an interpreter named on the file's first line +(the rest of the file is used as input to the interpreter). +Therefore, Emacs tries to use the interpreter name to choose a mode. +For instance, a file that begins with @samp{#!/usr/bin/perl} is opened +in Perl mode. The variable @code{interpreter-mode-alist} specifies +the correspondence between interpreter program names and major modes. When the first line starts with @samp{#!}, you usually cannot use the @samp{-*-} feature on the first line, because the system would get === modified file 'doc/emacs/mule.texi' --- doc/emacs/mule.texi 2011-07-01 17:59:15 +0000 +++ doc/emacs/mule.texi 2011-07-10 04:05:33 +0000 @@ -1,7 +1,7 @@ @c This is part of the Emacs manual. @c Copyright (C) 1997, 1999-2011 Free Software Foundation, Inc. @c See file emacs.texi for copying conditions. -@node International, Major Modes, Frames, Top +@node International, Modes, Frames, Top @chapter International Character Set Support @c This node is referenced in the tutorial. When renaming or deleting @c it, the tutorial needs to be adjusted. (TUTORIAL.de) ------------------------------------------------------------ revno: 105070 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-07-09 23:11:47 -0400 message: Remove Syntax node from Emacs manual. This node served no purpose in the Customization section. * doc/emacs/custom.texi (Syntax): Node deleted. * doc/emacs/emacs.texi (Top): Update node listing. * doc/emacs/help.texi (Help Summary): * doc/emacs/major.texi (Major Modes): * doc/emacs/programs.texi (Parentheses): * doc/emacs/search.texi (Regexp Backslash, Regexp Backslash) (Regexp Backslash): * doc/emacs/text.texi (Words): Callers changed. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-07-10 02:38:26 +0000 +++ doc/emacs/ChangeLog 2011-07-10 03:11:47 +0000 @@ -1,5 +1,14 @@ 2011-07-10 Chong Yidong + * custom.texi (Syntax): Node deleted. + + * help.texi (Help Summary): + * major.texi (Major Modes): + * programs.texi (Parentheses): + * search.texi (Regexp Backslash, Regexp Backslash) + (Regexp Backslash): + * text.texi (Words): Callers changed. + * text.texi (Refill, Longlines): Delete nodes. * ack.texi (Acknowledgments): Longlines removed from manual. === modified file 'doc/emacs/custom.texi' --- doc/emacs/custom.texi 2011-06-09 20:22:06 +0000 +++ doc/emacs/custom.texi 2011-07-10 03:11:47 +0000 @@ -31,8 +31,6 @@ you can control their functioning. * Key Bindings:: The keymaps say what command each key runs. By changing them, you can "redefine keys". -* Syntax:: The syntax table controls how words and - expressions are parsed. * Init File:: How to write common customizations in the @file{.emacs} file. @end menu @@ -2085,36 +2083,6 @@ @kbd{M-x}. However, disabling a command has no effect on calling it as a function from Lisp programs. -@node Syntax -@section The Syntax Table -@cindex syntax table - - All the Emacs commands which parse words or balance parentheses are -controlled by the @dfn{syntax table}. The syntax table says which -characters are opening delimiters, which are parts of words, which are -string quotes, and so on. It does this by assigning each character to -one of fifteen-odd @dfn{syntax classes}. In some cases it specifies -some additional information also. - - Each major mode has its own syntax table (though related major modes -sometimes share one syntax table), which it installs in each buffer -that uses the mode. The syntax table installed in the current buffer -is the one that all commands use, so we call it ``the'' syntax table. - -@kindex C-h s -@findex describe-syntax - To display a description of the contents of the current syntax -table, type @kbd{C-h s} (@code{describe-syntax}). The description of -each character includes the string you would have to give to -@code{modify-syntax-entry} to set up that character's current syntax, -starting with the character which designates its syntax class, plus -some English text to explain its meaning. - - A syntax table is actually a Lisp object, a char-table, whose -elements are cons cells. For full information on the syntax table, -see @ref{Syntax Tables,, Syntax Tables, elisp, The Emacs Lisp -Reference Manual}. - @node Init File @section The Init File, @file{~/.emacs} @cindex init file === modified file 'doc/emacs/emacs.texi' --- doc/emacs/emacs.texi 2011-07-10 02:38:26 +0000 +++ doc/emacs/emacs.texi 2011-07-10 03:11:47 +0000 @@ -168,15 +168,13 @@ * Killing:: Killing (cutting) text. * Yanking:: Recovering killed text. Moving text. (Pasting.) * Accumulating Text:: Other ways of copying text. -* Rectangles:: Operating on the text inside a rectangle on the screen. -* CUA Bindings:: Using @kbd{C-x}, @kbd{C-c}, @kbd{C-v} for copy - and paste, with enhanced rectangle support. +* Rectangles:: Operating on text in rectangular areas. +* CUA Bindings:: Using @kbd{C-x}, @kbd{C-c}, @kbd{C-v} to kill and yank. * Registers:: Saving a text string or a location in the buffer. * Display:: Controlling what text is displayed. * Search:: Finding or replacing occurrences of a string. * Fixit:: Commands especially useful for fixing typos. -* Keyboard Macros:: A keyboard macro records a sequence of - keystrokes to be replayed with a single command. +* Keyboard Macros:: Recording a sequence of keystrokes to be replayed. Major Structures of Emacs * Files:: All about handling files. @@ -192,7 +190,7 @@ * Programs:: Commands and modes for editing programs. * Building:: Compiling, running and debugging programs. * Maintaining:: Features for maintaining large programs. -* Abbrevs:: How to define text abbreviations to reduce +* Abbrevs:: Defining text abbreviations to reduce the number of characters you must type. @c AFAICS, the tex stuff generates its own index and does not use this one. @ifnottex @@ -204,9 +202,9 @@ * Dired:: You can ``edit'' a directory to manage files in it. * Calendar/Diary:: The calendar and diary facilities. * Document View:: Viewing PDF, PS and DVI files. -* Gnus:: How to read netnews with Emacs. +* Gnus:: A flexible mail and news reader. * Shell:: Executing shell commands from Emacs. -* Emacs Server:: Using Emacs as an editing server for @code{mail}, etc. +* Emacs Server:: Using Emacs as an editing server. * Printing:: Printing hardcopies of buffers or regions. * Sorting:: Sorting lines, paragraphs or pages within Emacs. * Narrowing:: Restricting display and editing to a portion @@ -1066,10 +1064,8 @@ * Variables:: Many Emacs commands examine Emacs variables to decide what to do; by setting variables, you can control their functioning. -* Key Bindings:: The keymaps say what command each key runs. - By changing them, you can "redefine keys". -* Syntax:: The syntax table controls how words and - expressions are parsed. +* Key Bindings:: Keymaps say what command each key runs. + By changing them, you can ``redefine'' keys. * Init File:: How to write common customizations in the @file{.emacs} file. === modified file 'doc/emacs/glossary.texi' --- doc/emacs/glossary.texi 2011-01-25 04:08:28 +0000 +++ doc/emacs/glossary.texi 2011-07-10 03:11:47 +0000 @@ -962,7 +962,7 @@ @item Parsing We say that certain Emacs commands parse words or expressions in the text being edited. Really, all they know how to do is find the other -end of a word or expression. @xref{Syntax}. +end of a word or expression. @item Point Point is the place in the buffer at which insertion and deletion @@ -1212,7 +1212,8 @@ @item Syntax Table The syntax table tells Emacs which characters are part of a word, which characters balance each other like parentheses, etc. -@xref{Syntax}. +@xref{Syntax Tables,, Syntax Tables, elisp, The Emacs Lisp Reference +Manual}. @item Super Super is the name of a modifier bit that a keyboard input character may === modified file 'doc/emacs/help.texi' --- doc/emacs/help.texi 2011-07-01 14:37:32 +0000 +++ doc/emacs/help.texi 2011-07-10 03:11:47 +0000 @@ -139,8 +139,11 @@ @item C-h r Display the Emacs manual in Info (@code{info-emacs-manual}). @item C-h s -Display the current contents of the syntax table, with an explanation of -what they mean (@code{describe-syntax}). @xref{Syntax}. +Display the current contents of the @dfn{syntax table}, with an +explanation of what they mean (@code{describe-syntax}). The syntax +table says which characters are opening delimiters, which are parts of +words, which are string quotes, and so on. @xref{Syntax Tables,, +Syntax Tables, elisp, The Emacs Lisp Reference Manual}, for details. @item C-h t Enter the Emacs interactive tutorial (@code{help-with-tutorial}). @item C-h v @var{var} @key{RET} @@ -583,7 +586,8 @@ modes, then the local bindings defined by the current major mode, and finally the global bindings (@pxref{Key Bindings}). @kbd{C-h s} displays the contents of the syntax table, with explanations of each -character's syntax (@pxref{Syntax}). +character's syntax (@pxref{Syntax Tables,, Syntax Tables, elisp, The +Emacs Lisp Reference Manual}). You can get a list of subcommands for a particular prefix key by typing @kbd{C-h} after the prefix key. (There are a few prefix keys === modified file 'doc/emacs/killing.texi' --- doc/emacs/killing.texi 2011-01-25 04:08:28 +0000 +++ doc/emacs/killing.texi 2011-07-10 03:11:47 +0000 @@ -19,7 +19,7 @@ * Yanking:: Commands that insert text. * Accumulating Text:: Other methods to add text to the buffer. * Rectangles:: Operating on text in rectangular areas. -* CUA Bindings:: Using C-x/C-c/C-v to kill and yank. +* CUA Bindings:: Using @kbd{C-x}/@kbd{C-c}/@kbd{C-v} to kill and yank. @end menu @node Deletion and Killing === modified file 'doc/emacs/major.texi' --- doc/emacs/major.texi 2011-01-25 04:08:28 +0000 +++ doc/emacs/major.texi 2011-07-10 03:11:47 +0000 @@ -31,7 +31,6 @@ addition, the commands which handle comments use the mode to determine how comments are to be delimited. Many major modes redefine the syntactical properties of characters appearing in the buffer. -@xref{Syntax}. The major modes fall into three major groups. The first group contains modes for normal text, either plain or with mark-up. It === modified file 'doc/emacs/programs.texi' --- doc/emacs/programs.texi 2011-05-17 02:26:56 +0000 +++ doc/emacs/programs.texi 2011-07-10 03:11:47 +0000 @@ -643,8 +643,9 @@ When talking about these facilities, the term ``parenthesis'' also includes braces, brackets, or whatever delimiters are defined to match in pairs. The major mode controls which delimiters are significant, -through the syntax table (@pxref{Syntax}). In Lisp, only parentheses -count; in C, these commands apply to braces and brackets too. +through the syntax table (@pxref{Syntax Tables,, Syntax Tables, elisp, +The Emacs Lisp Reference Manual}). In Lisp, only parentheses count; +in C, these commands apply to braces and brackets too. You can use @kbd{M-x check-parens} to find any unbalanced parentheses and unbalanced string quotes in the buffer. === modified file 'doc/emacs/search.texi' --- doc/emacs/search.texi 2011-03-10 05:48:33 +0000 +++ doc/emacs/search.texi 2011-07-10 03:11:47 +0000 @@ -870,8 +870,9 @@ word-constituent character. @item \w -matches any word-constituent character. The syntax table -determines which characters these are. @xref{Syntax}. +matches any word-constituent character. The syntax table determines +which characters these are. @xref{Syntax Tables,, Syntax Tables, +elisp, The Emacs Lisp Reference Manual}. @item \W matches any character that is not a word-constituent. @@ -892,7 +893,8 @@ matches any character whose syntax is @var{c}. Here @var{c} is a character that designates a particular syntax class: thus, @samp{w} for word constituent, @samp{-} or @samp{ } for whitespace, @samp{.} -for ordinary punctuation, etc. @xref{Syntax}. +for ordinary punctuation, etc. @xref{Syntax Tables,, Syntax Tables, +elisp, The Emacs Lisp Reference Manual}. @item \S@var{c} matches any character whose syntax is not @var{c}. @@ -911,8 +913,9 @@ @var{c}. @end table - The constructs that pertain to words and syntax are controlled by the -setting of the syntax table (@pxref{Syntax}). + The constructs that pertain to words and syntax are controlled by +the setting of the syntax table. @xref{Syntax Tables,, Syntax Tables, +elisp, The Emacs Lisp Reference Manual}. @node Regexp Example @section Regular Expression Example === modified file 'doc/emacs/text.texi' --- doc/emacs/text.texi 2011-07-10 02:38:26 +0000 +++ doc/emacs/text.texi 2011-07-10 03:11:47 +0000 @@ -154,9 +154,10 @@ argument that says how many words to scan for the place to put the mark. - The word commands' understanding of word boundaries is controlled -by the syntax table. Any character can, for example, be declared to -be a word delimiter. @xref{Syntax}. + The word commands' understanding of word boundaries is controlled by +the syntax table. Any character can, for example, be declared to be a +word delimiter. @xref{Syntax Tables,, Syntax Tables, elisp, The Emacs +Lisp Reference Manual}. @node Sentences @section Sentences ------------------------------------------------------------ revno: 105069 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-07-09 22:38:26 -0400 message: Remove documentation for Refill and Longlines modes. These will be obsoleted in a future version of Emacs. * text.texi (Refill, Longlines): Delete nodes. * ack.texi (Acknowledgments): Longlines removed from manual. * emacs.texi (Top): Update node listing. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-07-09 00:51:42 +0000 +++ doc/emacs/ChangeLog 2011-07-10 02:38:26 +0000 @@ -1,3 +1,11 @@ +2011-07-10 Chong Yidong + + * text.texi (Refill, Longlines): Delete nodes. + + * ack.texi (Acknowledgments): Longlines removed from manual. + + * emacs.texi (Top): Update node listing. + 2011-07-09 Glenn Morris * fortran-xtra.texi (Fortran): Update handled extensions. === modified file 'doc/emacs/ack.texi' --- doc/emacs/ack.texi 2011-05-18 03:39:45 +0000 +++ doc/emacs/ack.texi 2011-07-10 02:38:26 +0000 @@ -190,9 +190,7 @@ @item Chong Yidong was the Emacs co-maintainer for Emacs 23. He made many -improvements to the Emacs display engine; and, together with Kai -Großjohann and Alex Schroeder, wrote @file{longlines.el}, a minor -mode for wrapping long lines. +improvements to the Emacs display engine. @item James Clark wrote SGML mode, a mode for editing SGML documents; and @@ -689,14 +687,12 @@ for motion in ``CapitalizedWordIdentifiers''; @file{latin1-disp.el}, a package that lets you display ISO 8859 characters on Latin-1 terminals by setting up appropriate display tables; @file{python.el}, a major mode -for the Python programming language; @file{refill.el}, a mode for -automatic paragraph refilling, akin to typical word processors; -@file{smiley.el}, a facility for displaying smiley faces; -@file{sym-comp.el}, a library for performing mode-dependent symbol -completion; @file{benchmark.el} for timing code execution; and -@file{tool-bar.el}, a mode to control the display of the Emacs tool bar. -With Riccardo Murri he wrote @file{vc-bzr.el}, support for the Bazaar -version control system. +for the Python programming language; @file{smiley.el}, a facility for +displaying smiley faces; @file{sym-comp.el}, a library for performing +mode-dependent symbol completion; @file{benchmark.el} for timing code +execution; and @file{tool-bar.el}, a mode to control the display of +the Emacs tool bar. With Riccardo Murri he wrote @file{vc-bzr.el}, +support for the Bazaar version control system. @item Eric Ludlam wrote the Speedbar package; @file{checkdoc.el}, for checking === modified file 'doc/emacs/emacs.texi' --- doc/emacs/emacs.texi 2011-05-17 02:26:56 +0000 +++ doc/emacs/emacs.texi 2011-07-10 02:38:26 +0000 @@ -585,8 +585,6 @@ * Fill Prefix:: Filling paragraphs that are indented or in a comment, etc. * Adaptive Fill:: How Emacs can determine the fill prefix automatically. -* Refill:: Keeping paragraphs filled. -* Longlines:: Editing text with very long lines. Outline Mode === modified file 'doc/emacs/text.texi' --- doc/emacs/text.texi 2011-05-17 02:26:56 +0000 +++ doc/emacs/text.texi 2011-07-10 02:38:26 +0000 @@ -406,8 +406,6 @@ * Fill Commands:: Commands to refill paragraphs and center lines. * Fill Prefix:: Filling paragraphs that are indented or in a comment, etc. * Adaptive Fill:: How Emacs can determine the fill prefix automatically. -* Refill:: Keeping paragraphs filled. -* Longlines:: Editing text with very long lines. @end menu @node Auto Fill @@ -722,92 +720,6 @@ line. If it returns @code{nil}, @code{adaptive-fill-regexp} gets a chance to find a prefix. -@node Refill -@subsection Refill Mode -@cindex refilling text, word processor style -@cindex modes, Refill -@cindex Refill minor mode - - Refill minor mode provides support for keeping paragraphs filled as -you type or modify them in other ways. It provides an effect similar -to typical word processor behavior. This works by running a -paragraph-filling command at suitable times. - - To toggle the use of Refill mode in the current buffer, type -@kbd{M-x refill-mode}. When you are typing text, only characters -which normally trigger auto filling, like the space character, will -trigger refilling. This is to avoid making it too slow. Apart from -self-inserting characters, other commands which modify the text cause -refilling. - - The current implementation is preliminary and not robust. You can -get better ``line wrapping'' behavior using Longlines mode. -@xref{Longlines}. However, Longlines mode has an important -side-effect: the newlines that it inserts for you are not saved to -disk, so the files that you make with Longlines mode will appear to be -completely unfilled if you edit them without Longlines mode. - -@node Longlines -@subsection Long Lines Mode -@cindex refilling text, word processor style -@cindex modes, Long Lines -@cindex word wrap -@cindex Long Lines minor mode - - Sometimes, you may come across ``unfilled'' text files, which Emacs -normally displays as a bunch of extremely long lines. Comfortably -reading and editing such files normally requires ``word wrap'', a -feature that breaks up each long text line into multiple screen lines -in a readable manner---by putting the breaks at word boundaries. Many -text editors, such as those built into many web browsers, perform word -wrapping by default. - - There are two different minor modes in Emacs that perform word -wrapping. The first is Visual Line mode, which does it by altering -the behavior of screen line continuation. @xref{Visual Line Mode}, -for information about Visual Line mode. - -@findex longlines-mode - Instead of using Visual Line mode, you can use a minor mode called -Long Lines mode. Long Lines mode wraps lines by inserting or deleting -@dfn{soft newlines} as you type (@pxref{Hard and Soft Newlines}). -These soft newlines won't show up when you save the buffer into a -file, or when you copy the text into the kill ring, clipboard, or a -register. Unlike Visual Line mode, Lone Lines mode breaks long lines -at the fill column (@pxref{Fill Commands}), rather than the right -window edge. To enable Long Lines mode, type @kbd{M-x -longlines-mode}. If the text is full of long lines, this also -immediately ``wraps'' them all. - -@findex longlines-auto-wrap - The word wrap performed by Long Lines mode is @emph{not} the same as -ordinary filling (@pxref{Fill Commands}). It does not contract -multiple spaces into a single space, recognize fill prefixes -(@pxref{Fill Prefix}), or perform adaptive filling (@pxref{Adaptive -Fill}). The reason for this is that a wrapped line is still, -conceptually, a single line. Each soft newline is equivalent to -exactly one space in that long line, and vice versa. However, you can -still call filling functions such as @kbd{M-q}, and these will work as -expected, inserting soft newlines that won't show up on disk or when -the text is copied. You can even rely entirely on the normal fill -commands by turning off automatic line wrapping, with @kbd{C-u M-x -longlines-auto-wrap}. To turn automatic line wrapping back on, type -@kbd{M-x longlines-auto-wrap}. - -@findex longlines-show-hard-newlines - Type @kbd{RET} to insert a hard newline, one which automatic -refilling will not remove. If you want to see where all the hard -newlines are, type @kbd{M-x longlines-show-hard-newlines}. This will -mark each hard newline with a special symbol. The same command with a -prefix argument turns this display off. - - Long Lines mode does not change normal text files that are already -filled, since the existing newlines are considered hard newlines. -Before Long Lines can do anything, you need to transform each -paragraph into a long line. One way is to set @code{fill-column} to a -large number (e.g., @kbd{C-u 9999 C-x f}), re-fill all the paragraphs, -and then set @code{fill-column} back to its original value. - @node Case @section Case Conversion Commands @cindex case conversion ------------------------------------------------------------ revno: 105068 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-07-09 22:06:09 -0400 message: Fix last change. diff: === modified file 'lisp/startup.el' --- lisp/startup.el 2011-07-10 02:04:45 +0000 +++ lisp/startup.el 2011-07-10 02:06:09 +0000 @@ -1350,7 +1350,7 @@ `:face FACE', like `fancy-splash-insert' accepts them.") (defconst fancy-about-text - `((:face (:inherit (variable-pitch font-lock-comment-face)) + `((:face (variable-pitch font-lock-comment-face) "This is " :link ("GNU Emacs" ,(lambda (_button) (browse-url "http://www.gnu.org/software/emacs/")) ------------------------------------------------------------ revno: 105067 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-07-09 22:04:45 -0400 message: Tweak link and startup screen faces. See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00478.html for a discussion of the link face. The changes to the startup faces are so that they can take advantage of the light/dark background settings already defined for those faces. * lisp/faces.el (link): Use a less saturated blue on light backgrounds. * lisp/startup.el (fancy-startup-text, fancy-about-text) (fancy-startup-tail): Use font-lock faces, for background safety. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-07-10 01:42:39 +0000 +++ lisp/ChangeLog 2011-07-10 02:04:45 +0000 @@ -7,6 +7,11 @@ * window.el (display-buffer): Fix arguments to display-buffer-reuse-window in last change. + * faces.el (link): Use a less saturated blue on light backgrounds. + + * startup.el (fancy-startup-text, fancy-about-text) + (fancy-startup-tail): Use font-lock faces, for background safety. + 2011-07-09 Bob Nnamtrop (tiny change) * emulation/viper-cmd.el (viper-change-state-to-vi): Limit === modified file 'lisp/faces.el' --- lisp/faces.el 2011-07-03 22:16:07 +0000 +++ lisp/faces.el 2011-07-10 02:04:45 +0000 @@ -2109,7 +2109,7 @@ (defface link '((((class color) (min-colors 88) (background light)) - :foreground "blue1" :underline t) + :foreground "RoyalBlue3" :underline t) (((class color) (background light)) :foreground "blue" :underline t) (((class color) (min-colors 88) (background dark)) === modified file 'lisp/startup.el' --- lisp/startup.el 2011-05-28 23:30:17 +0000 +++ lisp/startup.el 2011-07-10 02:04:45 +0000 @@ -1293,7 +1293,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defconst fancy-startup-text - `((:face (variable-pitch (:foreground "red")) + `((:face (variable-pitch font-lock-comment-face) "Welcome to " :link ("GNU Emacs" ,(lambda (_button) (browse-url "http://www.gnu.org/software/emacs/")) @@ -1350,7 +1350,7 @@ `:face FACE', like `fancy-splash-insert' accepts them.") (defconst fancy-about-text - `((:face (variable-pitch (:foreground "red")) + `((:face (:inherit (variable-pitch font-lock-comment-face)) "This is " :link ("GNU Emacs" ,(lambda (_button) (browse-url "http://www.gnu.org/software/emacs/")) @@ -1366,11 +1366,7 @@ `("GNU" ,(lambda (_button) (describe-gnu-project)) "Display info on the GNU project."))) " operating system.\n" - :face ,(lambda () - (list 'variable-pitch - (list :foreground - (if (eq (frame-parameter nil 'background-mode) 'dark) - "cyan" "darkblue")))) + :face (variable-pitch font-lock-builtin-face) "\n" ,(lambda () (emacs-version)) "\n" @@ -1426,8 +1422,7 @@ ,(lambda (_button) (browse-url "http://www.gnu.org/software/emacs/tour/")) "Browse http://www.gnu.org/software/emacs/tour/") - "\tSee an overview of Emacs features at gnu.org" - )) + "\tSee an overview of Emacs features at gnu.org")) "A list of texts to show in the middle part of the About screen. Each element in the list should be a list of strings or pairs `:face FACE', like `fancy-splash-insert' accepts them.") @@ -1537,93 +1532,91 @@ (defun fancy-startup-tail (&optional concise) "Insert the tail part of the splash screen into the current buffer." - (let ((fg (if (eq (frame-parameter nil 'background-mode) 'dark) - "cyan" "darkblue"))) - (unless concise - (fancy-splash-insert - :face 'variable-pitch - "\nTo start... " - :link `("Open a File" - ,(lambda (_button) (call-interactively 'find-file)) - "Specify a new file's name, to edit the file") - " " - :link `("Open Home Directory" - ,(lambda (_button) (dired "~")) - "Open your home directory, to operate on its files") - " " - :link `("Customize Startup" - ,(lambda (_button) (customize-group 'initialization)) - "Change initialization settings including this screen") - "\n")) + (unless concise (fancy-splash-insert - :face 'variable-pitch "To quit a partially entered command, type " - :face 'default "Control-g" - :face 'variable-pitch ".\n") - (fancy-splash-insert :face `(variable-pitch (:foreground ,fg)) - "\nThis is " - (emacs-version) - "\n" - :face '(variable-pitch (:height 0.8)) - emacs-copyright - "\n") - (and auto-save-list-file-prefix - ;; Don't signal an error if the - ;; directory for auto-save-list files - ;; does not yet exist. - (file-directory-p (file-name-directory - auto-save-list-file-prefix)) - (directory-files - (file-name-directory auto-save-list-file-prefix) - nil - (concat "\\`" - (regexp-quote (file-name-nondirectory - auto-save-list-file-prefix))) - t) - (fancy-splash-insert :face '(variable-pitch (:foreground "red")) - "\nIf an Emacs session crashed recently, " - "type " - :face '(fixed-pitch :foreground "red") - "Meta-x recover-session RET" - :face '(variable-pitch (:foreground "red")) - "\nto recover" - " the files you were editing.")) + :face 'variable-pitch + "\nTo start... " + :link `("Open a File" + ,(lambda (_button) (call-interactively 'find-file)) + "Specify a new file's name, to edit the file") + " " + :link `("Open Home Directory" + ,(lambda (_button) (dired "~")) + "Open your home directory, to operate on its files") + " " + :link `("Customize Startup" + ,(lambda (_button) (customize-group 'initialization)) + "Change initialization settings including this screen") + "\n")) + (fancy-splash-insert + :face 'variable-pitch "To quit a partially entered command, type " + :face 'default "Control-g" + :face 'variable-pitch ".\n") + (fancy-splash-insert :face `(variable-pitch font-lock-builtin-face) + "\nThis is " + (emacs-version) + "\n" + :face '(variable-pitch (:height 0.8)) + emacs-copyright + "\n") + (and auto-save-list-file-prefix + ;; Don't signal an error if the + ;; directory for auto-save-list files + ;; does not yet exist. + (file-directory-p (file-name-directory + auto-save-list-file-prefix)) + (directory-files + (file-name-directory auto-save-list-file-prefix) + nil + (concat "\\`" + (regexp-quote (file-name-nondirectory + auto-save-list-file-prefix))) + t) + (fancy-splash-insert :face '(variable-pitch font-lock-comment-face) + "\nIf an Emacs session crashed recently, " + "type " + :face '(fixed-pitch font-lock-comment-face) + "Meta-x recover-session RET" + :face '(variable-pitch font-lock-comment-face) + "\nto recover" + " the files you were editing.")) - (when concise - (fancy-splash-insert - :face 'variable-pitch "\n" - :link `("Dismiss this startup screen" - ,(lambda (_button) - (when startup-screen-inhibit-startup-screen - (customize-set-variable 'inhibit-startup-screen t) - (customize-mark-to-save 'inhibit-startup-screen) - (custom-save-all)) - (let ((w (get-buffer-window "*GNU Emacs*"))) - (and w (not (one-window-p)) (delete-window w))) - (kill-buffer "*GNU Emacs*"))) - " ") - (when (or user-init-file custom-file) - (let ((checked (create-image "checked.xpm" - nil nil :ascent 'center)) - (unchecked (create-image "unchecked.xpm" - nil nil :ascent 'center))) - (insert-button - " " - :on-glyph checked - :off-glyph unchecked - 'checked nil 'display unchecked 'follow-link t - 'action (lambda (button) - (if (overlay-get button 'checked) - (progn (overlay-put button 'checked nil) - (overlay-put button 'display - (overlay-get button :off-glyph)) - (setq startup-screen-inhibit-startup-screen - nil)) - (overlay-put button 'checked t) - (overlay-put button 'display - (overlay-get button :on-glyph)) - (setq startup-screen-inhibit-startup-screen t))))) - (fancy-splash-insert :face '(variable-pitch (:height 0.9)) - " Never show it again."))))) + (when concise + (fancy-splash-insert + :face 'variable-pitch "\n" + :link `("Dismiss this startup screen" + ,(lambda (_button) + (when startup-screen-inhibit-startup-screen + (customize-set-variable 'inhibit-startup-screen t) + (customize-mark-to-save 'inhibit-startup-screen) + (custom-save-all)) + (let ((w (get-buffer-window "*GNU Emacs*"))) + (and w (not (one-window-p)) (delete-window w))) + (kill-buffer "*GNU Emacs*"))) + " ") + (when (or user-init-file custom-file) + (let ((checked (create-image "checked.xpm" + nil nil :ascent 'center)) + (unchecked (create-image "unchecked.xpm" + nil nil :ascent 'center))) + (insert-button + " " + :on-glyph checked + :off-glyph unchecked + 'checked nil 'display unchecked 'follow-link t + 'action (lambda (button) + (if (overlay-get button 'checked) + (progn (overlay-put button 'checked nil) + (overlay-put button 'display + (overlay-get button :off-glyph)) + (setq startup-screen-inhibit-startup-screen + nil)) + (overlay-put button 'checked t) + (overlay-put button 'display + (overlay-get button :on-glyph)) + (setq startup-screen-inhibit-startup-screen t))))) + (fancy-splash-insert :face '(variable-pitch (:height 0.9)) + " Never show it again.")))) (defun exit-splash-screen () "Stop displaying the splash screen buffer." ------------------------------------------------------------ revno: 105066 author: Bob Rogers committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-07-09 21:42:39 -0400 message: * vc/vc.el (vc-diff-internal): Fix race condition (Bug#1256). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-07-10 01:40:32 +0000 +++ lisp/ChangeLog 2011-07-10 01:42:39 +0000 @@ -1,3 +1,7 @@ +2011-07-10 Bob Rogers + + * vc/vc.el (vc-diff-internal): Fix race condition (Bug#1256). + 2011-07-10 Chong Yidong * window.el (display-buffer): Fix arguments to === modified file 'lisp/vc/vc.el' --- lisp/vc/vc.el 2011-07-03 01:15:38 +0000 +++ lisp/vc/vc.el 2011-07-10 01:42:39 +0000 @@ -1605,10 +1605,13 @@ ;; bindings are nicer for read only buffers. pcl-cvs does the ;; same thing. (setq buffer-read-only t) - (vc-exec-after `(vc-diff-finish ,(current-buffer) ',(when verbose - messages))) ;; Display the buffer, but at the end because it can change point. (pop-to-buffer (current-buffer)) + ;; The diff process may finish early, so call `vc-diff-finish' + ;; after `pop-to-buffer'; the former assumes the diff buffer is + ;; shown in some window. + (vc-exec-after `(vc-diff-finish ,(current-buffer) + ',(when verbose messages))) ;; In the async case, we return t even if there are no differences ;; because we don't know that yet. t))) ------------------------------------------------------------ revno: 105065 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-07-09 21:40:32 -0400 message: Fix incorrect args to display-buffer-reuse-window in revno 105058. * lisp/window.el (display-buffer): Fix arguments to display-buffer-reuse-window in last change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-07-09 19:32:42 +0000 +++ lisp/ChangeLog 2011-07-10 01:40:32 +0000 @@ -1,3 +1,8 @@ +2011-07-10 Chong Yidong + + * window.el (display-buffer): Fix arguments to + display-buffer-reuse-window in last change. + 2011-07-09 Bob Nnamtrop (tiny change) * emulation/viper-cmd.el (viper-change-state-to-vi): Limit === modified file 'lisp/window.el' --- lisp/window.el 2011-07-09 12:32:38 +0000 +++ lisp/window.el 2011-07-10 01:40:32 +0000 @@ -5737,19 +5737,19 @@ (or (and (window-live-p window) window) ;; on the selected frame, (display-buffer-reuse-window - buffer '(nil nil nil) other-window) + buffer '(nil nil nil) nil other-window) ;; showing BUFFER on any visible frame, (display-buffer-reuse-window - buffer '(nil same visible) other-window) + buffer '(nil same visible) nil other-window) ;; not showing BUFFER on any visible frame, (display-buffer-reuse-window - buffer '(nil other visible) other-window) + buffer '(nil other visible) nil other-window) ;; showing BUFFER on any visible or iconified frame, (display-buffer-reuse-window - buffer '(nil same 0) other-window) + buffer '(nil same 0) nil other-window) ;; not showing BUFFER on any visible or iconified frame. (display-buffer-reuse-window - buffer '(nil other 0) other-window) + buffer '(nil other 0) nil other-window) ;; If everything failed so far, try popping up a new frame ;; regardless of graphic-only restrictions. (display-buffer-pop-up-frame buffer))))) ------------------------------------------------------------ revno: 105064 fixes bug(s): http://debbugs.gnu.org/9025 committer: Paul Eggert branch nick: trunk timestamp: Sat 2011-07-09 15:03:22 -0700 message: * lib/stdint.in.h: Merge from gnulib (Bug#9025). This fixes a build problem on older Mac OS X hosts. diff: === modified file 'ChangeLog' --- ChangeLog 2011-07-09 08:56:25 +0000 +++ ChangeLog 2011-07-09 22:03:22 +0000 @@ -1,5 +1,8 @@ 2011-07-09 Paul Eggert + * lib/stdint.in.h: Merge from gnulib (Bug#9025). + This fixes a build problem on older Mac OS X hosts. + * m4/pthread_sigmask.m4 (gl_FUNC_PTHREAD_SIGMASK): Omit gl_THREADLIB test, which runs afoul of Automake installations where, for example, /usr/share/aclocal contains a copy of gl_THREADLIB. === modified file 'lib/stdint.in.h' --- lib/stdint.in.h 2011-05-29 21:52:18 +0000 +++ lib/stdint.in.h 2011-07-09 22:03:22 +0000 @@ -270,26 +270,36 @@ /* Note: These types are compiler dependent. It may be unwise to use them in public header files. */ -#undef intmax_t -#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +/* If the system defines INTMAX_MAX, assume that intmax_t works, and + similarly for UINTMAX_MAX and uintmax_t. This avoids problems with + assuming one type where another is used by the system. */ + +#ifndef INTMAX_MAX +# undef INTMAX_C +# undef intmax_t +# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 typedef long long int gl_intmax_t; -# define intmax_t gl_intmax_t -#elif defined GL_INT64_T -# define intmax_t int64_t -#else +# define intmax_t gl_intmax_t +# elif defined GL_INT64_T +# define intmax_t int64_t +# else typedef long int gl_intmax_t; -# define intmax_t gl_intmax_t +# define intmax_t gl_intmax_t +# endif #endif -#undef uintmax_t -#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +#ifndef UINTMAX_MAX +# undef UINTMAX_C +# undef uintmax_t +# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 typedef unsigned long long int gl_uintmax_t; -# define uintmax_t gl_uintmax_t -#elif defined GL_UINT64_T -# define uintmax_t uint64_t -#else +# define uintmax_t gl_uintmax_t +# elif defined GL_UINT64_T +# define uintmax_t uint64_t +# else typedef unsigned long int gl_uintmax_t; -# define uintmax_t gl_uintmax_t +# define uintmax_t gl_uintmax_t +# endif #endif /* Verify that intmax_t and uintmax_t have the same size. Too much code @@ -431,21 +441,23 @@ /* 7.18.2.5. Limits of greatest-width integer types */ -#undef INTMAX_MIN -#undef INTMAX_MAX -#ifdef INT64_MAX -# define INTMAX_MIN INT64_MIN -# define INTMAX_MAX INT64_MAX -#else -# define INTMAX_MIN INT32_MIN -# define INTMAX_MAX INT32_MAX +#ifndef INTMAX_MAX +# undef INTMAX_MIN +# ifdef INT64_MAX +# define INTMAX_MIN INT64_MIN +# define INTMAX_MAX INT64_MAX +# else +# define INTMAX_MIN INT32_MIN +# define INTMAX_MAX INT32_MAX +# endif #endif -#undef UINTMAX_MAX -#ifdef UINT64_MAX -# define UINTMAX_MAX UINT64_MAX -#else -# define UINTMAX_MAX UINT32_MAX +#ifndef UINTMAX_MAX +# ifdef UINT64_MAX +# define UINTMAX_MAX UINT64_MAX +# else +# define UINTMAX_MAX UINT32_MAX +# endif #endif /* 7.18.3. Limits of other integer types */ @@ -568,22 +580,24 @@ /* 7.18.4.2. Macros for greatest-width integer constants */ -#undef INTMAX_C -#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 -# define INTMAX_C(x) x##LL -#elif defined GL_INT64_T -# define INTMAX_C(x) INT64_C(x) -#else -# define INTMAX_C(x) x##L +#ifndef INTMAX_C +# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# define INTMAX_C(x) x##LL +# elif defined GL_INT64_T +# define INTMAX_C(x) INT64_C(x) +# else +# define INTMAX_C(x) x##L +# endif #endif -#undef UINTMAX_C -#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 -# define UINTMAX_C(x) x##ULL -#elif defined GL_UINT64_T -# define UINTMAX_C(x) UINT64_C(x) -#else -# define UINTMAX_C(x) x##UL +#ifndef UINTMAX_C +# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# define UINTMAX_C(x) x##ULL +# elif defined GL_UINT64_T +# define UINTMAX_C(x) UINT64_C(x) +# else +# define UINTMAX_C(x) x##UL +# endif #endif #endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */ ------------------------------------------------------------ revno: 105063 committer: Bill Wohler branch nick: trunk timestamp: Sat 2011-07-09 13:25:54 -0700 message: Document "ignored" arguments to keep checkdoc happy. * mh-speed.el (mh-speed-toggle,mh-speed-view): Ditto * mh-search.el (mh-flists-execute): Ditto. * mh-funcs.el (mh-undo-folder): Ditto. * mh-comp.el (mh-user-agent-compose): Ditto. diff: === modified file 'lisp/mh-e/ChangeLog' --- lisp/mh-e/ChangeLog 2011-07-04 02:53:16 +0000 +++ lisp/mh-e/ChangeLog 2011-07-09 20:25:54 +0000 @@ -1,3 +1,18 @@ +2011-07-09 Bill Wohler + + * mh-speed.el (mh-speed-toggle,mh-speed-view): Document "ignored" + arguments to keep checkdoc happy. + + * mh-search.el (mh-flists-execute): Ditto. + + * mh-funcs.el (mh-undo-folder): Ditto. + + * mh-comp.el (mh-user-agent-compose): Ditto. + + * mh-xface.el (mh-face-to-png, mh-uncompface) + (mh-picon-file-contents): Only call set-buffer-multibyte if it + exists, which it doesn't in XEmacs. + 2011-07-04 Bill Wohler * mh-e.el: Just require mh-loaddefs since loading it in an === modified file 'lisp/mh-e/mh-comp.el' --- lisp/mh-e/mh-comp.el 2011-07-04 02:17:42 +0000 +++ lisp/mh-e/mh-comp.el 2011-07-09 20:25:54 +0000 @@ -213,7 +213,7 @@ are strings. CONTINUE, SWITCH-FUNCTION, YANK-ACTION, SEND-ACTIONS, and -RETURN-ACTION are ignored." +RETURN-ACTION and any additional arguments are IGNORED." (mh-find-path) (let ((mh-error-if-no-draft t)) (mh-send to "" subject) === modified file 'lisp/mh-e/mh-funcs.el' --- lisp/mh-e/mh-funcs.el 2011-04-06 01:14:03 +0000 +++ lisp/mh-e/mh-funcs.el 2011-07-09 20:25:54 +0000 @@ -349,7 +349,7 @@ (error "Error occurred during execution of %s" command))))) ;;;###mh-autoload -(defun mh-undo-folder (&rest _ignored) +(defun mh-undo-folder (&rest ignored) "Undo all refiles and deletes in the current folder. Arguments are IGNORED (for `revert-buffer')." (interactive) === modified file 'lisp/mh-e/mh-search.el' --- lisp/mh-e/mh-search.el 2011-07-04 02:17:42 +0000 +++ lisp/mh-e/mh-search.el 2011-07-09 20:25:54 +0000 @@ -454,12 +454,12 @@ (defvar mh-flists-search-folders) -(defun mh-flists-execute (&rest args) +(defun mh-flists-execute (&rest ignored) "Execute flists. Search for messages belonging to `mh-flists-sequence' in the folders specified by `mh-flists-search-folders'. If `mh-recursive-folders-flag' is t, then the folders are searched -recursively. All parameters ARGS are ignored." +recursively. All arguments are IGNORED." (set-buffer (get-buffer-create mh-temp-index-buffer)) (erase-buffer) (unless (executable-find "sh") === modified file 'lisp/mh-e/mh-speed.el' --- lisp/mh-e/mh-speed.el 2011-01-26 08:36:39 +0000 +++ lisp/mh-e/mh-speed.el 2011-07-09 20:25:54 +0000 @@ -126,9 +126,9 @@ ;; Otherwise on to your regular programming (t t))) -(defun mh-speed-toggle (&rest args) +(defun mh-speed-toggle (&rest ignored) "Toggle the display of child folders in the speedbar. -The optional ARGS from speedbar are ignored." +The optional arguments from speedbar are IGNORED." (interactive) (declare (ignore args)) (beginning-of-line) @@ -165,9 +165,9 @@ (mh-line-beginning-position) (1+ (line-beginning-position)) `(mh-expanded t))))))) -(defun mh-speed-view (&rest args) +(defun mh-speed-view (&rest ignored) "Visits the selected folder just as if you had used \\\\[mh-visit-folder]. -The optional ARGS from speedbar are ignored." +The optional arguments from speedbar are IGNORED." (interactive) (declare (ignore args)) (let* ((folder (get-text-property (mh-line-beginning-position) 'mh-folder)) ------------------------------------------------------------ revno: 105062 committer: Bill Wohler branch nick: trunk timestamp: Sat 2011-07-09 13:19:10 -0700 message: * mh-xface.el (mh-face-to-png, mh-uncompface) (mh-picon-file-contents): Only call set-buffer-multibyte if it exists, which it doesn't in XEmacs. diff: === modified file 'lisp/mh-e/mh-xface.el' --- lisp/mh-e/mh-xface.el 2011-01-26 08:36:39 +0000 +++ lisp/mh-e/mh-xface.el 2011-07-09 20:19:10 +0000 @@ -125,7 +125,8 @@ (defun mh-face-to-png (data) "Convert base64 encoded DATA to png image." (with-temp-buffer - (set-buffer-multibyte nil) + (if (fboundp 'set-buffer-multibyte) + (set-buffer-multibyte nil)) (insert data) (ignore-errors (base64-decode-region (point-min) (point-max))) (buffer-string))) @@ -133,7 +134,8 @@ (defun mh-uncompface (data) "Run DATA through `uncompface' to generate bitmap." (with-temp-buffer - (set-buffer-multibyte nil) + (if (fboundp 'set-buffer-multibyte) + (set-buffer-multibyte nil)) (insert data) (when (and mh-uncompface-executable (equal (call-process-region (point-min) (point-max) @@ -271,7 +273,8 @@ elements of the list are nil." (if (stringp file) (with-temp-buffer - (set-buffer-multibyte nil) + (if (fboundp 'set-buffer-multibyte) + (set-buffer-multibyte nil)) (let ((type (and (string-match ".*\\.\\(...\\)$" file) (intern (match-string 1 file))))) (insert-file-contents-literally file) ------------------------------------------------------------ revno: 105061 author: Bob Nnamtrop committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-07-09 15:32:42 -0400 message: Limit triggering of abbrev expansion in viper-mode (Bug#9038) * lisp/emulation/viper-cmd.el (viper-change-state-to-vi): Limit triggering of abbrev expansion. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-07-09 18:12:29 +0000 +++ lisp/ChangeLog 2011-07-09 19:32:42 +0000 @@ -1,3 +1,8 @@ +2011-07-09 Bob Nnamtrop (tiny change) + + * emulation/viper-cmd.el (viper-change-state-to-vi): Limit + triggering of abbrev expansion (Bug#9038). + 2011-07-09 Martin Rudalics * window.el (display-buffer-default-specifiers): Remove. === modified file 'lisp/emulation/viper-cmd.el' --- lisp/emulation/viper-cmd.el 2011-05-23 17:57:17 +0000 +++ lisp/emulation/viper-cmd.el 2011-07-09 19:32:42 +0000 @@ -617,7 +617,10 @@ (or (viper-overlay-p viper-replace-overlay) (viper-set-replace-overlay (point-min) (point-min))) (viper-hide-replace-overlay) - (if abbrev-mode (expand-abbrev)) + ;; Expand abbrevs iff the previous character has word syntax. + (and abbrev-mode + (eq (char-syntax (preceding-char)) ?w) + (expand-abbrev)) (if (and auto-fill-function (> (current-column) fill-column)) (funcall auto-fill-function)) ;; don't leave whitespace lines around ------------------------------------------------------------ revno: 105060 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-07-09 11:12:29 -0700 message: Remove duplicate ChangeLog entry. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-07-09 12:32:38 +0000 +++ lisp/ChangeLog 2011-07-09 18:12:29 +0000 @@ -70,9 +70,6 @@ The order of searching the available programs is the same as in `archive-zip-extract' (bug#8968). -2011-07-07 Lars Magne Ingebrigtsen - - * cus-edit.el (custom-show): Marked as obsolete. 2011-07-07 Chong Yidong * menu-bar.el (menu-bar-line-wrapping-menu): Revert last change. ------------------------------------------------------------ revno: 105059 committer: Juanma Barranquero branch nick: trunk timestamp: Sat 2011-07-09 15:58:09 +0200 message: src/chartab.c (uniprop_table_uncompress): Remove unused local variable. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-07-09 07:59:22 +0000 +++ src/ChangeLog 2011-07-09 13:58:09 +0000 @@ -1,3 +1,7 @@ +2011-07-09 Juanma Barranquero + + * chartab.c (uniprop_table_uncompress): Remove unused local variable. + 2011-07-09 Jan Djärv * gtkutil.c (qttip_cb): Remove code without function. === modified file 'src/chartab.c' --- src/chartab.c 2011-07-07 04:16:52 +0000 +++ src/chartab.c 2011-07-09 13:58:09 +0000 @@ -1143,7 +1143,6 @@ Lisp_Object sub = make_sub_char_table (3, min_char, Qnil); struct Lisp_Sub_Char_Table *subtbl = XSUB_CHAR_TABLE (sub); const unsigned char *p, *pend; - int i; XSUB_CHAR_TABLE (table)->contents[idx] = sub; p = SDATA (val), pend = p + SBYTES (val); ------------------------------------------------------------ revno: 105058 committer: martin rudalics branch nick: trunk timestamp: Sat 2011-07-09 14:32:38 +0200 message: Simplify normalization of default buffer display specifieres and options. * window.el (display-buffer-default-specifiers): Remove. (display-buffer-macro-specifiers): Remove default specifiers. (display-buffer-alist): Default to nil. (display-buffer-reuse-window): New optional argument other-window. (display-buffer-pop-up-window): Allow splitting internal windows. Check whether a live window was created. (display-buffer-other-window-means-other-frame) (display-buffer-normalize-arguments): Rename to display-buffer-normalize-argument and rewrite. Set the other-window specifier. (display-buffer-normalize-special): New function. (display-buffer-normalize-options): Rename to display-buffer-normalize-default and rewrite. (display-buffer-normalize-options-inhibit): Remove. (display-buffer-normalize-specifiers): Rewrite. (display-buffer): Process other-window specifier and call display-buffer-reuse-window with it. Emulate Emacs 23 behavior more faithfully. (pop-up-windows, even-window-heights): Restore Emacs 23 default values. (display-buffer-alist-set): Don't handle 'unset default values. (display-buffer-in-window, display-buffer-alist-set): Replace symbol "dedicated" by "dedicate". Reported by Tassilo Horn . diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-07-09 03:11:57 +0000 +++ lisp/ChangeLog 2011-07-09 12:32:38 +0000 @@ -1,3 +1,31 @@ +2011-07-09 Martin Rudalics + + * window.el (display-buffer-default-specifiers): Remove. + (display-buffer-macro-specifiers): Remove default specifiers. + (display-buffer-alist): Default to nil. + (display-buffer-reuse-window): New optional argument + other-window. + (display-buffer-pop-up-window): Allow splitting internal + windows. Check whether a live window was created. + (display-buffer-other-window-means-other-frame) + (display-buffer-normalize-arguments): Rename to + display-buffer-normalize-argument and rewrite. Set the + other-window specifier. + (display-buffer-normalize-special): New function. + (display-buffer-normalize-options): Rename to + display-buffer-normalize-default and rewrite. + (display-buffer-normalize-options-inhibit): Remove. + (display-buffer-normalize-specifiers): Rewrite. + (display-buffer): Process other-window specifier and call + display-buffer-reuse-window with it. Emulate Emacs 23 behavior + more faithfully. + (pop-up-windows, even-window-heights): Restore Emacs 23 default + values. + (display-buffer-alist-set): Don't handle 'unset default values. + (display-buffer-in-window, display-buffer-alist-set): Replace + symbol "dedicated" by "dedicate". Reported by Tassilo Horn + . + 2011-07-09 Leo Liu * register.el (insert-register): Restore accidental change on @@ -42,6 +70,9 @@ The order of searching the available programs is the same as in `archive-zip-extract' (bug#8968). +2011-07-07 Lars Magne Ingebrigtsen + + * cus-edit.el (custom-show): Marked as obsolete. 2011-07-07 Chong Yidong * menu-bar.el (menu-bar-line-wrapping-menu): Revert last change. === modified file 'lisp/window.el' --- lisp/window.el 2011-07-07 01:46:59 +0000 +++ lisp/window.el 2011-07-09 12:32:38 +0000 @@ -3829,22 +3829,6 @@ (window-state-put-2 ignore)) (window-check frame)))) -;;; Displaying buffers. -(defconst display-buffer-default-specifiers - '((reuse-window nil same visible) - (pop-up-window (largest . nil) (lru . nil)) - (pop-up-window-min-height . 40) - (pop-up-window-min-width . 80) - (reuse-window other nil nil) - (reuse-window nil other visible) - (reuse-window nil nil t) - (reuse-window-even-sizes . t)) - "Buffer display default specifiers. -The value specified here is used when no other specifiers have -been specified by the user or the application. Consult the -documentation of `display-buffer-alist' for a description of -buffer display specifiers.") - (defconst display-buffer-macro-specifiers '((same-window ;; Use the same window. @@ -3854,11 +3838,6 @@ (reuse-window nil same nil) (pop-up-window (largest . nil) (lru . nil)) (reuse-window nil other nil)) - ;; (other-window - ;; ;; Avoid selected window. - ;; (reuse-window other same visible) - ;; (pop-up-window (largest . nil) (lru . nil)) - ;; (reuse-window other other visible)) (same-frame-other-window ;; Avoid other frames and selected window. (reuse-window other same nil) @@ -3868,25 +3847,10 @@ ;; Avoid selected frame. (reuse-window nil same other) (pop-up-frame) - (reuse-window nil other other)) - (default - ;; The default specifiers. - display-buffer-default-specifiers)) + (reuse-window nil other other))) "Buffer display macro specifiers.") -(defcustom display-buffer-alist - '((((regexp . ".*")) - ;; Reuse window showing same buffer on same frame. - reuse-window (reuse-window nil same nil) - ;; Pop up window. - pop-up-window - ;; Split largest or lru window. - (pop-up-window (largest . nil) (lru . nil)) - (pop-up-window-min-height . 40) ; split-height-threshold / 2 - (pop-up-window-min-width . 80) ; split-width-threshold / 2 - ;; Reuse any but selected window on same frame. - reuse-window (reuse-window other nil nil) - (reuse-window-even-sizes . t))) +(defcustom display-buffer-alist nil "List associating buffer identifiers with display specifiers. The car of each element of this list is built from a set of cons cells called buffer identifiers. `display-buffer' shows a buffer @@ -4751,15 +4715,15 @@ (setq window (window-normalize-live-window window)) (let* ((old-frame (selected-frame)) (new-frame (window-frame window)) - (dedicated (cdr (assq 'dedicated specifiers))) + (dedicate (cdr (assq 'dedicate specifiers))) (no-other-window (cdr (assq 'no-other-window specifiers)))) ;; Show BUFFER in WINDOW. (unless (eq buffer (window-buffer window)) ;; If we show another buffer in WINDOW, undedicate it first. (set-window-dedicated-p window nil)) (set-window-buffer window buffer) - (when dedicated - (set-window-dedicated-p window dedicated)) + (when dedicate + (set-window-dedicated-p window dedicate)) (when no-other-window (set-window-parameter window 'no-other-window t)) (unless (or (eq old-frame new-frame) @@ -4775,7 +4739,7 @@ ;; Return window. window)) -(defun display-buffer-reuse-window (buffer method &optional specifiers) +(defun display-buffer-reuse-window (buffer method &optional specifiers other-window) "Display BUFFER in an existing window. METHOD must be a list in the form of the cdr of a `reuse-window' buffer display specifier, see `display-buffer-alist' for an @@ -4787,8 +4751,9 @@ frame. Optional argument SPECIFIERS must be a list of valid display -specifiers. Return the window chosen to display BUFFER, nil if -none was found." +specifiers. Optional argument OTHER-WINDOW, if non-nil, means do +not use the selected window. Return the window chosen to display +BUFFER, nil if none was found." (let* ((method-window (nth 0 method)) (method-buffer (nth 1 method)) (method-frame (nth 2 method)) @@ -4806,6 +4771,7 @@ (eq window-buffer buffer)) (or (not method-window) (and (eq method-window 'same) + (not other-window) (eq window (selected-window))) (and (eq method-window 'other) (not (eq window (selected-window)))) @@ -5064,7 +5030,7 @@ ;; A window, directly specified. cand))) - (when (and (window-live-p window) + (when (and (window-any-p window) ;; The window must be on the correct frame, (eq (window-frame window) frame) ;; and must be neither a minibuffer window @@ -5084,7 +5050,7 @@ ;; Don't pass any specifiers to this function. (funcall side window))))) - (when window + (when (window-live-p window) ;; Adjust sizes if asked for. (display-buffer-set-height window specifiers) (display-buffer-set-width window specifiers) @@ -5324,201 +5290,225 @@ The calculation of the return value is exclusively based on the user preferences expressed in `display-buffer-alist'." - (let* ((buffer (window-normalize-buffer buffer-or-name)) - (list (display-buffer-normalize-alist (buffer-name buffer) label)) - (value (assq 'other-window-means-other-frame - (or (car list) (cdr list))))) - (when value (cdr value)))) - -(defun display-buffer-normalize-arguments (buffer-name specifiers label other-frame) - "Normalize second and third argument of `display-buffer'. -BUFFER-NAME is the name of the buffer that shall be displayed, -SPECIFIERS is the second argument of `display-buffer'. LABEL is -the same argument of `display-buffer'. OTHER-FRAME non-nil means -use other-frame for other-window." - (let (normalized entry specifier pars) - (setq specifier - (cond - ((not specifiers) - nil) - ((listp specifiers) - ;; If SPECIFIERS is a list, we assume it is a list of specifiers. - (dolist (specifier specifiers) - (cond - ((consp specifier) - (setq normalized (cons specifier normalized))) - ((eq specifier 'other-window) - ;; `other-window' must be treated separately. - (let ((entry (assq (if other-frame - 'other-frame - 'same-frame-other-window) - display-buffer-macro-specifiers))) - (dolist (item (cdr entry)) - (setq normalized (cons item normalized))))) - ((symbolp specifier) - ;; Might be a macro specifier, try to expand it (the cdr is a - ;; list and we have to reverse it later, so do it one at a - ;; time). - (let ((entry (assq specifier display-buffer-macro-specifiers))) - (dolist (item (cdr entry)) - (setq normalized (cons item normalized))))))) - ;; Reverse list. - (nreverse normalized)) - ((setq entry (assq specifiers display-buffer-macro-specifiers)) - ;; A macro specifier. - (cdr entry)) - ((or other-frame (with-no-warnings pop-up-frames)) - ;; `special-display-p' group. - (if (and (with-no-warnings special-display-function) - ;; `special-display-p' returns either t or a list - ;; of frame parameters to pass to - ;; `special-display-function'. - (setq pars (with-no-warnings - (special-display-p buffer-name)))) - (list (list 'function - (with-no-warnings special-display-function) - (when (listp pars) pars))) - ;; Pop up another frame. - (cddr (assq 'other-frame display-buffer-macro-specifiers)))) - (t - ;; In any other case pop up a new window. - (cdr (assq 'same-frame-other-window - display-buffer-macro-specifiers))))) - - ;; Handle the old meaning of the LABEL argument of `display-buffer'. - (cond - ((or (memq label '(visible 0 t)) (frame-live-p label)) - ;; LABEL must be one of visible (and visible frame), 0 (any - ;; visible or iconfied frame), t (any frame), or a live frame. - (cons `(reuse-window nil same ,label) specifier)) - ((or other-frame - (with-no-warnings pop-up-frames) - (with-no-warnings display-buffer-reuse-frames)) - (cons '(reuse-window nil same 0) specifier)) - (t - specifier)))) - -(defun display-buffer-normalize-options (buffer-or-name) + (let* ((buffer-name + (buffer-name (window-normalize-buffer buffer-or-name))) + (default (display-buffer-normalize-default buffer-name)) + (alist (display-buffer-normalize-alist buffer-name label))) + (or (cdr (assq 'other-window-means-other-frame default)) + (cdr (assq 'other-window-means-other-frame (cdr alist)))))) + +(defun display-buffer-normalize-special (&optional args) + "Return buffer display specifiers for `special-display-frame-alist'." + (progn ;; <-- reserved for with-no-warnings + (if (and (listp args) (symbolp (car args))) + ;; Note: `display-buffer' funcalls this so take "(nth 1 args)" + ;; where `special-display-popup-frame' (which uses apply) takes + ;; "(cdr args)". + `((function ,(car args) ,(nth 1 args))) + (append + '((reuse-window nil same 0)) + (when (and (listp args) (cdr (assq 'same-window args))) + '((reuse-window same nil nil) (reuse-dedicated . weak))) + (when (and (listp args) + (or (cdr (assq 'same-frame args)) + (cdr (assq 'same-window args)))) + '((pop-up-window (largest . nil) (lru . nil)) + (reuse-window nil nil nil))) + (unless display-buffer-mark-dedicated + ;; Don't make anything created above dedicated unless requested. + ;; Otherwise the dedication request below gets in our way. + '((dedicated . nil))) + `((pop-up-frame t) + ,(append '(pop-up-frame-alist) + (when (listp args) args) + special-display-frame-alist) + (dedicated . t)))))) + +(defun display-buffer-normalize-default (buffer-or-name) "Subroutine of `display-buffer-normalize-specifiers'. -BUFFER-OR-NAME is the buffer to display. This routine provides a -compatibility layer for the now obsolete Emacs 23 buffer display -options." - (with-no-warnings +BUFFER-OR-NAME is the buffer to display. + +This routine provides a compatibility layer for the obsolete +Emacs 23 buffer display options to set up the corresponding +buffer display specifiers." + (progn ;; <-- reserved for with-no-warnings (let* ((buffer (window-normalize-buffer buffer-or-name)) (buffer-name (buffer-name buffer)) - (use-pop-up-frames - (or (and (eq pop-up-frames 'graphic-only) - (display-graphic-p)) - pop-up-frames)) - specifiers) - ;; `even-window-heights', unless nil or unset. - (unless (memq even-window-heights '(nil unset)) + (pop-up-frames + (and (boundp 'pop-up-frames) + (or (and (eq pop-up-frames 'graphic-only) + (display-graphic-p)) + pop-up-frames))) + specifiers args) + ;; `other-window-means-other-frame' + (when pop-up-frames + (setq specifiers + (cons (cons 'other-window-means-other-frame t) specifiers))) + + ;; `even-window-heights' + (unless (and (boundp 'even-window-heights) + (not even-window-heights)) (setq specifiers (cons (cons 'reuse-window-even-sizes t) specifiers))) ;; `display-buffer-mark-dedicated' - (when display-buffer-mark-dedicated + (when (and (boundp 'display-buffer-mark-dedicated) + display-buffer-mark-dedicated) (setq specifiers (cons (cons 'dedicate display-buffer-mark-dedicated) specifiers))) - ;; `pop-up-window' group. Anything is added here iff - ;; `pop-up-windows' is neither nil nor unset. - (let ((pop-up-window (not (memq pop-up-windows '(nil unset)))) - (fun (unless (eq split-window-preferred-function - 'split-window-sensibly) - split-window-preferred-function)) - (min-height (if (numberp split-height-threshold) - (/ split-height-threshold 2) - 1.0)) - (min-width (if (numberp split-width-threshold) - (/ split-width-threshold 2) - 1.0))) - ;; Create an entry only if a default value was changed. - (when (or pop-up-window - (not (equal split-height-threshold 80)) - (not (equal split-width-threshold 160))) - ;; `reuse-window' (needed as fallback when popping up the new - ;; window fails). - (setq specifiers - (cons (list 'reuse-window 'other nil nil) - specifiers)) - ;; `split-width-threshold' - (setq specifiers - (cons (cons 'pop-up-window-min-width min-width) - specifiers)) - ;; `split-height-threshold' - (setq specifiers - (cons (cons 'pop-up-window-min-height min-height) - specifiers)) + ;; `pop-up-window-min-height' + (let ((min-height + (if (boundp 'split-height-threshold) + (if (numberp split-height-threshold) + (/ split-height-threshold 2) + 1.0) + 40))) + (setq specifiers + (cons (cons 'pop-up-window-min-height min-height) + specifiers))) + + ;; `pop-up-window-min-width' + (let ((min-width + (if (boundp 'split-width-threshold) + (if (numberp split-width-threshold) + (/ split-width-threshold 2) + 1.0) + 80))) + (setq specifiers + (cons (cons 'pop-up-window-min-width min-width) + specifiers))) + + ;; `pop-up-window' + (unless (and (boundp 'pop-up-windows) (not pop-up-windows)) + (let ((fun (when (and (boundp 'split-window-preferred-function) + (not (eq split-window-preferred-function + 'split-window-sensibly))) + split-window-preferred-function))) ;; `pop-up-window' (setq specifiers - (cons (list 'pop-up-window - (cons 'largest fun) (cons 'lru fun)) - specifiers)))) - - ;; `pop-up-frame' group. - (when use-pop-up-frames + (cons + (list 'pop-up-window (cons 'largest fun) (cons 'lru fun)) + specifiers)))) + + ;; `pop-up-frame-function' + (when (and (boundp 'pop-up-frame-function) + (not (equal pop-up-frame-function + '(lambda nil + (make-frame pop-up-frame-alist))))) + (setq specifiers + (cons (cons 'pop-up-frame-function pop-up-frame-function) + specifiers))) + + ;; `pop-up-frame-alist' + (when pop-up-frame-alist + (setq specifiers + (cons (cons 'pop-up-frame-alist pop-up-frame-alist) + specifiers))) + + ;; `pop-up-frame' + (when pop-up-frames ;; `pop-up-frame-function'. If `pop-up-frame-function' uses the ;; now obsolete `pop-up-frame-alist' it will continue to do so. - (setq specifiers - (cons (cons 'pop-up-frame-function pop-up-frame-function) - specifiers)) ;; `pop-up-frame' (setq specifiers + ;; Maybe we should merge graphic-only into the following? (cons (list 'pop-up-frame t) specifiers))) - ;; `pop-up-windows' and `use-pop-up-frames' both nil means means - ;; we are supposed to reuse any window on the same frame (unless - ;; we find one showing the same buffer already). - (unless (or pop-up-windows use-pop-up-frames) - ;; `reuse-window' showing any buffer on same frame. - (setq specifiers - (cons (list 'reuse-window nil nil nil) - specifiers))) - - ;; `special-display-p' group. - (when special-display-function - ;; `special-display-p' returns either t or a list of frame - ;; parameters to pass to `special-display-function'. - (let ((pars (special-display-p buffer-name))) - (when pars + ;; `special-display' + (when (and (boundp 'special-display-function) + special-display-function + (fboundp 'special-display-p) + (setq args (special-display-p buffer-name))) + ;; `special-display-p' returns either t or a list of arguments + ;; to pass to `special-display-function'. + (if (eq special-display-function 'special-display-popup-frame) (setq specifiers - (cons (list 'function special-display-function - (when (listp pars) pars)) - specifiers))))) + (append (display-buffer-normalize-special args) + specifiers)) + (setq specifiers + (cons + `(function ,special-display-function ,(when (listp args) args)) + specifiers)))) + ;; Reuse window showing same buffer on visible or iconified frame. ;; `pop-up-frames', `display-buffer-reuse-frames' means search for ;; a window showing the buffer on some visible or iconfied frame. - ;; `last-nonminibuffer-frame' set and not the same frame means - ;; search that frame. - (let ((frames (or (and (or use-pop-up-frames - display-buffer-reuse-frames + ;; `last-nonminibuffer-frame' non-nil means search that frame. + (let ((frames (or (and (or pop-up-frames + (and (boundp 'display-buffer-reuse-frames) + display-buffer-reuse-frames) (not (last-nonminibuffer-frame))) ;; All visible or iconfied frames. 0) - ;; Same frame. + ;; The following usually returns the same frame + ;; so we implicitly search for a window showing + ;; the buffer on the same frame already. (last-nonminibuffer-frame)))) (when frames (setq specifiers (cons (list 'reuse-window 'other 'same frames) specifiers)))) - ;; `same-window-p' group. - (when (same-window-p buffer-name) + ;; `same-window' + (when (and (fboundp 'same-window-p) (same-window-p buffer-name)) ;; Try to reuse the same (selected) window. (setq specifiers - (cons (list 'reuse-window 'same nil nil) - specifiers))) + (cons (list 'reuse-window 'same nil nil) specifiers))) - ;; Prepend "reuse window on same frame if showing the buffer - ;; already" specifier. It will be overriden by the application - ;; supplied 'other-window specifier. - (setq specifiers (cons (list 'reuse-window nil 'same nil) - specifiers)) + ;; Same window if showing this buffer already. Can be overridden + ;; by `other-window' argument if the buffer is already shown in + ;; the same window. + (setq specifiers + (cons (list 'reuse-window 'same 'same nil) specifiers)) specifiers))) +(defun display-buffer-normalize-argument (buffer-name specifiers other-window-means-other-frame) + "Normalize second argument of `display-buffer'. +BUFFER-NAME is the name of the buffer that shall be displayed, +SPECIFIERS is the second argument of `display-buffer'. +OTHER-WINDOW-MEANS-OTHER-FRAME non-nil means use other-frame for +other-window." + (progn ;; <-- reserved for with-no-warnings + (let (normalized entry specifier pars) + (cond + ((not specifiers) + nil) + ((listp specifiers) + ;; If SPECIFIERS is a list, we assume it is a list of valid + ;; specifiers. + (dolist (specifier specifiers) + (cond + ((consp specifier) + (setq normalized (cons specifier normalized))) + ((eq specifier 'other-window) + ;; `other-window' must be treated separately. + (let ((entry (assq (if other-window-means-other-frame + 'other-frame + 'same-frame-other-window) + display-buffer-macro-specifiers))) + (dolist (item (cdr entry)) + (setq normalized (cons item normalized))))) + ((symbolp specifier) + ;; Might be a macro specifier, try to expand it (the cdr is a + ;; list and we have to reverse it later, so do it one at a + ;; time). + (let ((entry (assq specifier display-buffer-macro-specifiers))) + (dolist (item (cdr entry)) + (setq normalized (cons item normalized))))))) + ;; Reverse list. + (nreverse normalized)) + ((setq entry (assq specifiers display-buffer-macro-specifiers)) + ;; A macro specifier. + (cdr entry)) + (t + ;; Anything else means use another window according to the + ;; non-overriding specifiers of `display-buffer-alist' and the + ;; specifiers produced by `display-buffer-normalize-default'. + '((other-window . t))))))) + (defun display-buffer-normalize-alist-1 (specifiers label) "Subroutine of `display-buffer-normalize-alist'. SPECIFIERS is a list of buffer display specfiers. LABEL is the @@ -5579,9 +5569,6 @@ (cons list-1 list-2))) -(defvar display-buffer-normalize-options-inhibit nil - "If non-nil, `display-buffer' doesn't process obsolete options.") - (defun display-buffer-normalize-specifiers (buffer-name specifiers label) "Return normalized specifiers for a buffer matching BUFFER-NAME or LABEL. BUFFER-NAME must be a string specifying a valid buffer name. @@ -5600,25 +5587,33 @@ - The specifiers in `display-buffer-alist' whose buffer identifier matches BUFFER-NAME or LABEL and whose 'override - component is not set. - -- `display-buffer-default-specifiers'." - (let* ((list (display-buffer-normalize-alist buffer-name label)) - (other-frame (cdr (assq 'other-window-means-other-frame - (or (car list) (cdr list)))))) + component is not set." + (let* ((default (display-buffer-normalize-default buffer-name)) + (alist (display-buffer-normalize-alist buffer-name label)) + (other-window-means-other-frame + (or (cdr (assq 'other-window-means-other-frame default)) + (cdr (assq 'other-window-means-other-frame (cdr alist))))) + (arg2 (display-buffer-normalize-argument + buffer-name specifiers other-window-means-other-frame)) + (arg3 + ;; Handle special meaning of the LABEL argument of + ;; `display-buffer'. + (when (or (memq label '(visible 0 t)) (frame-live-p label)) + ;; LABEL must be one of visible (any visible frame), 0 (any + ;; visible or iconfied frame), t (any frame), or a live + ;; frame. + `((reuse-window nil same ,label))))) (append ;; Overriding user specifiers. - (car list) - ;; Application specifiers. - (display-buffer-normalize-arguments - buffer-name specifiers label other-frame) - ;; Emacs 23 compatibility specifiers. - (unless display-buffer-normalize-options-inhibit - (display-buffer-normalize-options buffer-name)) + (car alist) + ;; Special value of third argument of display-buffer. + arg3 + ;; Second argument of display-buffer. + arg2 ;; Non-overriding user specifiers. - (cdr list) + (cdr alist) ;; Default specifiers. - display-buffer-default-specifiers))) + default))) ;; Minibuffer-only frames should be documented better. They really ;; deserve a separate section in the manual. Also @@ -5653,9 +5648,8 @@ display location specifier or t, where the latter means to display the buffer in any but the selected window. If SPECIFIERS is nil or omitted, this means to exclusively use the specifiers -provided by `display-buffer-alist'. If the value of the latter -is nil too, all specifiers are provided by the constant -`display-buffer-default-specifiers'. +provided by the variable `display-buffer-alist' and the function +`display-buffer-normalize-default'. As a special case, the `reuse-window' specifier allows to specify as second element an arbitrary window, as third element an @@ -5707,7 +5701,7 @@ ;; Don't use a minibuffer frame. (frame (display-buffer-frame)) ;; `window' is the window we use for showing `buffer'. - window specifier method) + window specifier method other-window) ;; Reset this. (setq display-buffer-window nil) (if display-buffer-function @@ -5723,7 +5717,7 @@ (cond ((eq method 'reuse-window) (display-buffer-reuse-window - buffer (cdr specifier) normalized)) + buffer (cdr specifier) normalized other-window)) ((eq method 'pop-up-window) (display-buffer-pop-up-window buffer (cdr specifier) normalized)) @@ -5734,25 +5728,31 @@ (display-buffer-in-side-window buffer (nth 1 specifier) (nth 2 specifier) normalized)) ((eq method 'function) - (funcall (nth 1 specifier) buffer (nth 2 specifier)))))) + (funcall (nth 1 specifier) buffer (nth 2 specifier))) + ((eq method 'other-window) + (setq other-window t))))) ;; If we don't have a window yet, try a fallback method. All - ;; specifiers have been used up by now. + ;; specifiers have been used up by now. Try reusing a window (or (and (window-live-p window) window) - ;; Try reusing a window showing BUFFER on any visible or - ;; iconfied frame. - (display-buffer-reuse-window buffer `(nil ,buffer 0)) - ;; Try reusing a window not showing BUFFER on any visible or - ;; iconified frame. - (display-buffer-reuse-window buffer '(nil other 0)) - ;; Eli says it's better to never try making a new frame. - ;; (display-buffer-pop-up-frame buffer) - ;; Try using a weakly dedicated window. - (display-buffer-reuse-window - buffer '(nil nil t) '((reuse-window-dedicated . weak))) - ;; Try using a strongly dedicated window. - (display-buffer-reuse-window - buffer '(nil nil t) '((reuse-window-dedicated . t))))))) + ;; on the selected frame, + (display-buffer-reuse-window + buffer '(nil nil nil) other-window) + ;; showing BUFFER on any visible frame, + (display-buffer-reuse-window + buffer '(nil same visible) other-window) + ;; not showing BUFFER on any visible frame, + (display-buffer-reuse-window + buffer '(nil other visible) other-window) + ;; showing BUFFER on any visible or iconified frame, + (display-buffer-reuse-window + buffer '(nil same 0) other-window) + ;; not showing BUFFER on any visible or iconified frame. + (display-buffer-reuse-window + buffer '(nil other 0) other-window) + ;; If everything failed so far, try popping up a new frame + ;; regardless of graphic-only restrictions. + (display-buffer-pop-up-frame buffer))))) (defsubst display-buffer-same-window (&optional buffer-or-name label) "Display buffer specified by BUFFER-OR-NAME in the selected window. @@ -6395,10 +6395,9 @@ ;; 'display-buffer-reuse-frames ;; "use 2nd arg of `display-buffer' instead." "24.1") -(defcustom pop-up-windows 'unset ; t - "Set and non-nil means `display-buffer' should make a new window." +(defcustom pop-up-windows t + "Non-nil means `display-buffer' should make a new window." :type 'boolean - :version "24.1" :group 'windows) ;; (make-obsolete-variable ;; 'pop-up-windows @@ -6459,13 +6458,12 @@ ;; 'split-width-threshold ;; "use 2nd arg of `display-buffer' instead." "24.1") -(defcustom even-window-heights 'unset ; t - "If set and non-nil `display-buffer' will try to even window heights. +(defcustom even-window-heights t + "If non-nil `display-buffer' will try to even window heights. Otherwise `display-buffer' will leave the window configuration -alone. Heights are evened only when `display-buffer' reuses a +alone. Heights are evened only when `display-buffer' chooses a window that appears above or below the selected window." :type 'boolean - :version "24.1" :group 'windows) ;; (make-obsolete-variable ;; 'even-window-heights @@ -6635,7 +6633,7 @@ 1.0))) (list 'pop-up-window - (when pop-up-windows ; unset qualifies as t + (when pop-up-windows (list 'pop-up-window (cons 'largest fun) @@ -6789,7 +6787,7 @@ ;; "0" (all visible and iconified frames) is hardcoded in ;; Emacs 23. 0)) - (unless (memq even-window-heights '(nil unset)) + (when even-window-heights (cons 'reuse-window-even-sizes t))) no-custom) @@ -6798,7 +6796,7 @@ (display-buffer-alist-add nil (list - (cons 'dedicated display-buffer-mark-dedicated)) + (cons 'dedicate display-buffer-mark-dedicated)) no-custom))) display-buffer-alist) ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.