From c17d5a38db885685aa57bf5560e9dedb1f494819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Sun, 12 Aug 2012 11:31:53 +0200 Subject: [PATCH 001/212] Backports for 1995-05-29T20:16:10Z!kwzh@gnu.org, 1995-05-03T21:38:13Z!rms@gnu.org and 1995-05-31T19:46:12Z!kwzh@gnu.org. * nsmenu.m (ns_update_menubar): Add braces to ambigous if-else. * nsmenu.m (Popdown_data): New struct. (pop_down_menu): p->pointer is Popdown_data. Release the pool and free Popdown_data. (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu. (initWithContentRect): Make imgView and contentView non-static and autorelease them. Also autorelease img and matrix. (dealloc): Remove (Bug#1995-05-29T20:16:10Z!kwzh@gnu.org). * nsterm.m (keyDown:): Interpret flags without left/right bits as the left key (Bug#1995-05-03T21:38:13Z!rms@gnu.org). * nsterm.m (ns_read_socket): Return early if there is a modal window (Bug#1995-05-31T19:46:12Z!kwzh@gnu.org). --- src/ChangeLog | 18 +++++++++++++ src/nsmenu.m | 75 ++++++++++++++++++++++++++++++++------------------- src/nsterm.m | 31 ++++++++++++++++----- 3 files changed, 91 insertions(+), 33 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 963179cb08f..3a0ea19c1b1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,21 @@ +2012-08-12 Jan Djärv + + * nsterm.m (ns_read_socket): Return early if there is a modal + window (Bug#12043). + + * nsmenu.m (Popdown_data): New struct. + (pop_down_menu): p->pointer is Popdown_data. Release the pool and + free Popdown_data. + (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu. + (initWithContentRect): Make imgView and contentView non-static + and autorelease them. Also autorelease img and matrix (Bug#12005). + (dealloc): Remove (Bug#12005). + + * nsterm.m (keyDown:): Interpret flags without left/right bits + as the left key (Bug#11670). + + * nsmenu.m (ns_update_menubar): Add braces to ambigous if-else. + 2012-08-08 YAMAMOTO Mitsuharu * unexmacosx.c (copy_data_segment): Copy initialized data in diff --git a/src/nsmenu.m b/src/nsmenu.m index 7a6434941d2..1fb795243ae 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -422,11 +422,13 @@ if (EQ (string, make_number (0))) // FIXME: Why??? --Stef continue; if (NILP (string)) - if (previous_strings[i][0]) - break; - else - continue; - if (strncmp (previous_strings[i], SDATA (string), 10)) + { + if (previous_strings[i][0]) + break; + else + continue; + } + else if (strncmp (previous_strings[i], SDATA (string), 10)) break; } @@ -1346,20 +1348,32 @@ - (NSRect) frame ========================================================================== */ +struct Popdown_data +{ + NSAutoreleasePool *pool; + EmacsDialogPanel *dialog; +}; static Lisp_Object pop_down_menu (Lisp_Object arg) { struct Lisp_Save_Value *p = XSAVE_VALUE (arg); + struct Popdown_data *unwind_data = (struct Popdown_data *) p->pointer; + + BLOCK_INPUT; if (popup_activated_flag) { + EmacsDialogPanel *panel = unwind_data->dialog; popup_activated_flag = 0; - BLOCK_INPUT; [NSApp endModalSession: popupSession]; - [((EmacsDialogPanel *) (p->pointer)) close]; + [panel close]; + [unwind_data->pool release]; [[FRAME_NS_VIEW (SELECTED_FRAME ()) window] makeKeyWindow]; - UNBLOCK_INPUT; } + + xfree (unwind_data); + UNBLOCK_INPUT; + return Qnil; } @@ -1372,6 +1386,7 @@ - (NSRect) frame struct frame *f; NSPoint p; BOOL isQ; + NSAutoreleasePool *pool; NSTRACE (x-popup-dialog); @@ -1426,11 +1441,17 @@ - (NSRect) frame contents = Fcons (title, Fcons (Fcons (build_string ("Ok"), Qt), Qnil)); BLOCK_INPUT; + pool = [[NSAutoreleasePool alloc] init]; dialog = [[EmacsDialogPanel alloc] initFromContents: contents isQuestion: isQ]; { int specpdl_count = SPECPDL_INDEX (); - record_unwind_protect (pop_down_menu, make_save_value (dialog, 0)); + struct Popdown_data *unwind_data = xmalloc (sizeof (*unwind_data)); + + unwind_data->pool = pool; + unwind_data->dialog = dialog; + + record_unwind_protect (pop_down_menu, make_save_value (unwind_data, 0)); popup_activated_flag = 1; tem = [dialog runDialogAt: p]; unbind_to (specpdl_count, Qnil); /* calls pop_down_menu */ @@ -1473,24 +1494,22 @@ @implementation EmacsDialogPanel NSRect area; char this_cmd_name[80]; id cell; - static NSImageView *imgView; - static FlippedView *contentView; + NSImageView *imgView; + FlippedView *contentView; + NSImage *img; - if (imgView == nil) - { - NSImage *img; - area.origin.x = 3*SPACER; - area.origin.y = 2*SPACER; - area.size.width = ICONSIZE; - area.size.height= ICONSIZE; - img = [[NSImage imageNamed: @"NSApplicationIcon"] copy]; - [img setScalesWhenResized: YES]; - [img setSize: NSMakeSize (ICONSIZE, ICONSIZE)]; - imgView = [[NSImageView alloc] initWithFrame: area]; - [imgView setImage: img]; - [imgView setEditable: NO]; - [img release]; - } + area.origin.x = 3*SPACER; + area.origin.y = 2*SPACER; + area.size.width = ICONSIZE; + area.size.height= ICONSIZE; + img = [[NSImage imageNamed: @"NSApplicationIcon"] copy]; + [img setScalesWhenResized: YES]; + [img setSize: NSMakeSize (ICONSIZE, ICONSIZE)]; + imgView = [[NSImageView alloc] initWithFrame: area]; + [imgView setImage: img]; + [imgView setEditable: NO]; + [img autorelease]; + [imgView autorelease]; aStyle = NSTitledWindowMask; flag = YES; @@ -1499,6 +1518,8 @@ @implementation EmacsDialogPanel [super initWithContentRect: contentRect styleMask: aStyle backing: backingType defer: flag]; contentView = [[FlippedView alloc] initWithFrame: [[self contentView] frame]]; + [contentView autorelease]; + [self setContentView: contentView]; [[self contentView] setAutoresizesSubviews: YES]; @@ -1550,7 +1571,7 @@ @implementation EmacsDialogPanel numberOfRows: 0 numberOfColumns: 1]; [[self contentView] addSubview: matrix]; - [matrix release]; + [matrix autorelease]; [matrix setFrameOrigin: NSMakePoint (area.origin.x, area.origin.y + (TEXTHEIGHT+3*SPACER))]; [matrix setIntercellSpacing: spacing]; diff --git a/src/nsterm.m b/src/nsterm.m index aad1f3283d6..33318315889 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -3397,6 +3397,9 @@ overwriting cursor (usually when cursor on a tab) */ /* NSTRACE (ns_read_socket); */ + if ([NSApp modalWindow] != nil) + return -1; + if (interrupt_input_blocked) { interrupt_input_pending = 1; @@ -4731,6 +4734,8 @@ most recently updated (I guess), which is not the correct one. */ if (!processingCompose) { + int is_left_key, is_right_key; + code = ([[theEvent charactersIgnoringModifiers] length] == 0) ? 0 : [[theEvent charactersIgnoringModifiers] characterAtIndex: 0]; /* (Carbon way: [theEvent keyCode]) */ @@ -4757,13 +4762,17 @@ most recently updated (I guess), which is not the correct one. */ if (flags & NSShiftKeyMask) emacs_event->modifiers |= shift_modifier; - if ((flags & NSRightCommandKeyMask) == NSRightCommandKeyMask) + is_right_key = (flags & NSRightCommandKeyMask) == NSRightCommandKeyMask; + is_left_key = (flags & NSLeftCommandKeyMask) == NSLeftCommandKeyMask + || (! is_right_key && (flags & NSCommandKeyMask) == NSCommandKeyMask); + + if (is_right_key) emacs_event->modifiers |= parse_solitary_modifier (EQ (ns_right_command_modifier, Qleft) ? ns_command_modifier : ns_right_command_modifier); - if ((flags & NSLeftCommandKeyMask) == NSLeftCommandKeyMask) + if (is_left_key) { emacs_event->modifiers |= parse_solitary_modifier (ns_command_modifier); @@ -4800,13 +4809,17 @@ most recently updated (I guess), which is not the correct one. */ } } - if ((flags & NSRightControlKeyMask) == NSRightControlKeyMask) + is_right_key = (flags & NSRightControlKeyMask) == NSRightControlKeyMask; + is_left_key = (flags & NSLeftControlKeyMask) == NSLeftControlKeyMask + || (! is_right_key && (flags & NSControlKeyMask) == NSControlKeyMask); + + if (is_right_key) emacs_event->modifiers |= parse_solitary_modifier (EQ (ns_right_control_modifier, Qleft) ? ns_control_modifier : ns_right_control_modifier); - if ((flags & NSLeftControlKeyMask) == NSLeftControlKeyMask) + if (is_left_key) emacs_event->modifiers |= parse_solitary_modifier (ns_control_modifier); @@ -4817,7 +4830,13 @@ most recently updated (I guess), which is not the correct one. */ left_is_none = NILP (ns_alternate_modifier) || EQ (ns_alternate_modifier, Qnone); - if ((flags & NSRightAlternateKeyMask) == NSRightAlternateKeyMask) + is_right_key = (flags & NSRightAlternateKeyMask) + == NSRightAlternateKeyMask; + is_left_key = (flags & NSLeftAlternateKeyMask) == NSLeftAlternateKeyMask + || (! is_right_key + && (flags & NSAlternateKeyMask) == NSAlternateKeyMask); + + if (is_right_key) { if ((NILP (ns_right_alternate_modifier) || EQ (ns_right_alternate_modifier, Qnone) @@ -4837,7 +4856,7 @@ most recently updated (I guess), which is not the correct one. */ : ns_right_alternate_modifier); } - if ((flags & NSLeftAlternateKeyMask) == NSLeftAlternateKeyMask) /* default = meta */ + if (is_left_key) /* default = meta */ { if (left_is_none && !fnKeysym) { /* accept pre-interp alt comb */ From 170aedb97ebee3edb81d2c447e6baa465978b03f Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 13 Aug 2012 13:11:19 +0800 Subject: [PATCH 002/212] Backport fix for Bug#11677 from trunk --- src/ChangeLog | 6 ++++++ src/window.c | 40 +++++++++++++++++++++++----------------- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3a0ea19c1b1..96c6d244bd1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-08-13 Eli Zaretskii + + * window.c (Fdelete_other_windows_internal) + (Fdelete_window_internal): Don't access frame's mouse highlight + info of the initial frame. (Bug#11677) + 2012-08-12 Jan Djärv * nsterm.m (ns_read_socket): Return early if there is a modal diff --git a/src/window.c b/src/window.c index ae8d209df74..f05bba8aedf 100644 --- a/src/window.c +++ b/src/window.c @@ -2565,7 +2565,6 @@ window-start value is reasonable when this function is called. */) Lisp_Object sibling, pwindow, swindow IF_LINT (= Qnil), delta; EMACS_INT startpos IF_LINT (= 0); int top IF_LINT (= 0), new_top, resize_failed; - Mouse_HLInfo *hlinfo; w = decode_any_window (window); CHECK_LIVE_FRAME (w->frame); @@ -2648,19 +2647,23 @@ window-start value is reasonable when this function is called. */) } BLOCK_INPUT; - hlinfo = MOUSE_HL_INFO (f); - /* We are going to free the glyph matrices of WINDOW, and with that - we might lose any information about glyph rows that have some of - their glyphs highlighted in mouse face. (These rows are marked - with a non-zero mouse_face_p flag.) If WINDOW indeed has some - glyphs highlighted in mouse face, signal to frame's up-to-date - hook that mouse highlight was overwritten, so that it will - arrange for redisplaying the highlight. */ - if (EQ (hlinfo->mouse_face_window, window)) + if (!FRAME_INITIAL_P (f)) { - hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; - hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; - hlinfo->mouse_face_window = Qnil; + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); + + /* We are going to free the glyph matrices of WINDOW, and with + that we might lose any information about glyph rows that have + some of their glyphs highlighted in mouse face. (These rows + are marked with a non-zero mouse_face_p flag.) If WINDOW + indeed has some glyphs highlighted in mouse face, signal to + frame's up-to-date hook that mouse highlight was overwritten, + so that it will arrange for redisplaying the highlight. */ + if (EQ (hlinfo->mouse_face_window, window)) + { + hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; + hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; + hlinfo->mouse_face_window = Qnil; + } } free_window_matrices (r); @@ -3903,7 +3906,6 @@ Signal an error when WINDOW is the only window on its frame. */) && EQ (r->new_total, (horflag ? r->total_cols : r->total_lines))) /* We can delete WINDOW now. */ { - Mouse_HLInfo *hlinfo; /* Block input. */ BLOCK_INPUT; @@ -3911,9 +3913,13 @@ Signal an error when WINDOW is the only window on its frame. */) /* If this window is referred to by the dpyinfo's mouse highlight, invalidate that slot to be safe (Bug#9904). */ - hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); - if (EQ (hlinfo->mouse_face_window, window)) - hlinfo->mouse_face_window = Qnil; + if (!FRAME_INITIAL_P (f)) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); + + if (EQ (hlinfo->mouse_face_window, window)) + hlinfo->mouse_face_window = Qnil; + } windows_or_buffers_changed++; Vwindow_list = Qnil; From 4432d2e25bc56cd06c9ed0c987d6570b2d57f230 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Tue, 14 Aug 2012 01:22:42 +0800 Subject: [PATCH 003/212] * lisp/net/rcirc.el (rcirc-split-message): New function. (rcirc-send-message): Use it. Fixes: debbugs:12051 --- lisp/ChangeLog | 5 +++++ lisp/net/rcirc.el | 39 ++++++++++++++++++++++++--------------- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 65017383de8..4e03a56111c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-13 Leo Liu + + * net/rcirc.el (rcirc-split-message): New function. + (rcirc-send-message): Use it. (Bug#12051) + 2012-08-10 Glenn Morris * emacs-lisp/copyright.el (copyright-update-directory): Logic fix. diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index e34b7c79b3b..0eb6c7ea51b 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -794,26 +794,35 @@ With no argument or nil as argument, use the current buffer." (defvar rcirc-max-message-length 420 "Messages longer than this value will be split.") +(defun rcirc-split-message (message) + "Split MESSAGE into chunks within `rcirc-max-message-length'." + (with-temp-buffer + (insert message) + (goto-char (point-min)) + (let (result) + (while (not (eobp)) + (goto-char (or (byte-to-position rcirc-max-message-length) + (point-max))) + ;; max message length is 512 including CRLF + (while (and (not (bobp)) + (> (length + (encode-coding-region (point-min) (point) + rcirc-encode-coding-system t)) + rcirc-max-message-length)) + (forward-char -1)) + (push (delete-and-extract-region (point-min) (point)) result)) + (nreverse result)))) + (defun rcirc-send-message (process target message &optional noticep silent) "Send TARGET associated with PROCESS a privmsg with text MESSAGE. If NOTICEP is non-nil, send a notice instead of privmsg. If SILENT is non-nil, do not print the message in any irc buffer." - ;; max message length is 512 including CRLF - (let* ((response (if noticep "NOTICE" "PRIVMSG")) - (oversize (> (length message) rcirc-max-message-length)) - (text (if oversize - (substring message 0 rcirc-max-message-length) - message)) - (text (if (string= text "") - " " - text)) - (more (if oversize - (substring message rcirc-max-message-length)))) + (let ((response (if noticep "NOTICE" "PRIVMSG"))) (rcirc-get-buffer-create process target) - (rcirc-send-string process (concat response " " target " :" text)) - (unless silent - (rcirc-print process (rcirc-nick process) response target text)) - (when more (rcirc-send-message process target more noticep)))) + (dolist (msg (rcirc-split-message message)) + (rcirc-send-string process (concat response " " target " :" msg)) + (unless silent + (rcirc-print process (rcirc-nick process) response target msg))))) (defvar rcirc-input-ring nil) (defvar rcirc-input-ring-index 0) From b7f501c736b4f45b4dee1d4d54a6f710c52f2530 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 13 Aug 2012 21:34:37 +0300 Subject: [PATCH 004/212] Backport: Don't disable Unicode menus on Windows NT and later. src/w32menu.c: Include w32heap.h. (add_menu_item): If the call to AppendMenuW (via unicode_append_menu) fails, disable Unicode menus only if we are running on Windows 9X/Me. src/makefile.w32-in ($(BLD)/w32menu.$(O)): Depend on w32heap.h. --- src/ChangeLog | 7 +++++++ src/makefile.w32-in | 1 + src/w32menu.c | 9 +++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 96c6d244bd1..fbe4f06da58 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,12 @@ 2012-08-13 Eli Zaretskii + * w32menu.c: Include w32heap.h. + (add_menu_item): If the call to AppendMenuW (via + unicode_append_menu) fails, disable Unicode menus only if we are + running on Windows 9X/Me. + + * makefile.w32-in ($(BLD)/w32menu.$(O)): Depend on w32heap.h. + * window.c (Fdelete_other_windows_internal) (Fdelete_window_internal): Don't access frame's mouse highlight info of the initial frame. (Bug#11677) diff --git a/src/makefile.w32-in b/src/makefile.w32-in index d7ca325e223..06e633c1443 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in @@ -1506,6 +1506,7 @@ $(BLD)/w32menu.$(O) : \ $(SRC)/w32menu.c \ $(SRC)/buffer.h \ $(SRC)/keymap.h \ + $(SRC)/w32heap.h \ $(BLOCKINPUT_H) \ $(CHARSET_H) \ $(CODING_H) \ diff --git a/src/w32menu.c b/src/w32menu.c index 9091cb81627..0f45532ed53 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -40,6 +40,8 @@ along with GNU Emacs. If not, see . */ if this is not done before the other system files. */ #include "w32term.h" +#include "w32heap.h" + /* Load sys/types.h if not already loaded. In some systems loading it twice is suicidal. */ #ifndef makedev @@ -1498,8 +1500,11 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item) AppendMenu (menu, fuFlags, item != NULL ? (UINT) item: (UINT) wv->call_data, out_string); - /* Don't use Unicode menus in future. */ - unicode_append_menu = NULL; + /* Don't use Unicode menus in future, unless this is Windows + NT or later, where a failure of AppendMenuW does NOT mean + Unicode menus are unsupported. */ + if (osinfo_cache.dwPlatformId != VER_PLATFORM_WIN32_NT) + unicode_append_menu = NULL; } if (unicode_append_menu && (fuFlags & MF_OWNERDRAW)) From 45e7ed71652ff194ea9389d40c49c7109af3d2d5 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 14 Aug 2012 12:04:25 +0800 Subject: [PATCH 005/212] Improve the file-local variable regression test. * test/automated/files.el: Test every combination of values for enable-local-variables and enable-local-eval. --- test/ChangeLog | 5 ++ test/automated/files.el | 139 ++++++++++++++++++++++++++++++++++------ 2 files changed, 123 insertions(+), 21 deletions(-) diff --git a/test/ChangeLog b/test/ChangeLog index b4195ea7d58..1cdd054da3e 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2012-08-14 Chong Yidong + + * automated/files.el: Test every combination of values for + enable-local-variables and enable-local-eval. + 2012-08-10 Glenn Morris * automated/files.el (files-test-disable-local-variables): New test. diff --git a/test/automated/files.el b/test/automated/files.el index e43d8c32f85..b6011395bfd 100644 --- a/test/automated/files.el +++ b/test/automated/files.el @@ -21,32 +21,129 @@ (require 'ert) -(defvar files-test-var1 nil) +;; Set to t if the local variable was set, `query' if the query was +;; triggered. +(defvar files-test-result) + +(defvar files-test-safe-result) +(put 'files-test-safe-result 'safe-local-variable 'booleanp) (defun files-test-fun1 () - (setq files-test-var1 t)) + (setq files-test-result t)) -(ert-deftest files-test-bug12155 () - "Test for http://debbugs.gnu.org/12155 ." - (with-temp-buffer - (insert "text\n" - ";; Local Variables:\n" - ";; eval: (files-test-fun1)\n" - ";; End:\n") - (let ((enable-local-variables :safe) - (enable-local-eval 'maybe)) - (hack-local-variables) - (should (eq files-test-var1 nil))))) +;; Test combinations: +;; `enable-local-variables' t, nil, :safe, :all, or something else. +;; `enable-local-eval' t, nil, or something else. -(ert-deftest files-test-disable-local-variables () - "Test that setting enable-local-variables to nil works." +(defvar files-test-local-variable-data + ;; Unsafe eval form + '((("eval: (files-test-fun1)") + (t t (eq files-test-result t)) + (t nil (eq files-test-result nil)) + (t maybe (eq files-test-result 'query)) + (nil t (eq files-test-result nil)) + (nil nil (eq files-test-result nil)) + (nil maybe (eq files-test-result nil)) + (:safe t (eq files-test-result nil)) + (:safe nil (eq files-test-result nil)) + (:safe maybe (eq files-test-result nil)) + (:all t (eq files-test-result t)) + (:all nil (eq files-test-result nil)) + (:all maybe (eq files-test-result t)) ; This combination is ambiguous. + (maybe t (eq files-test-result 'query)) + (maybe nil (eq files-test-result 'query)) + (maybe maybe (eq files-test-result 'query))) + ;; Unsafe local variable value + (("files-test-result: t") + (t t (eq files-test-result 'query)) + (t nil (eq files-test-result 'query)) + (t maybe (eq files-test-result 'query)) + (nil t (eq files-test-result nil)) + (nil nil (eq files-test-result nil)) + (nil maybe (eq files-test-result nil)) + (:safe t (eq files-test-result nil)) + (:safe nil (eq files-test-result nil)) + (:safe maybe (eq files-test-result nil)) + (:all t (eq files-test-result t)) + (:all nil (eq files-test-result t)) + (:all maybe (eq files-test-result t)) + (maybe t (eq files-test-result 'query)) + (maybe nil (eq files-test-result 'query)) + (maybe maybe (eq files-test-result 'query))) + ;; Safe local variable + (("files-test-safe-result: t") + (t t (eq files-test-safe-result t)) + (t nil (eq files-test-safe-result t)) + (t maybe (eq files-test-safe-result t)) + (nil t (eq files-test-safe-result nil)) + (nil nil (eq files-test-safe-result nil)) + (nil maybe (eq files-test-safe-result nil)) + (:safe t (eq files-test-safe-result t)) + (:safe nil (eq files-test-safe-result t)) + (:safe maybe (eq files-test-safe-result t)) + (:all t (eq files-test-safe-result t)) + (:all nil (eq files-test-safe-result t)) + (:all maybe (eq files-test-safe-result t)) + (maybe t (eq files-test-result 'query)) + (maybe nil (eq files-test-result 'query)) + (maybe maybe (eq files-test-result 'query))) + ;; Safe local variable with unsafe value + (("files-test-safe-result: 1") + (t t (eq files-test-result 'query)) + (t nil (eq files-test-result 'query)) + (t maybe (eq files-test-result 'query)) + (nil t (eq files-test-safe-result nil)) + (nil nil (eq files-test-safe-result nil)) + (nil maybe (eq files-test-safe-result nil)) + (:safe t (eq files-test-safe-result nil)) + (:safe nil (eq files-test-safe-result nil)) + (:safe maybe (eq files-test-safe-result nil)) + (:all t (eq files-test-safe-result 1)) + (:all nil (eq files-test-safe-result 1)) + (:all maybe (eq files-test-safe-result 1)) + (maybe t (eq files-test-result 'query)) + (maybe nil (eq files-test-result 'query)) + (maybe maybe (eq files-test-result 'query)))) + "List of file-local variable tests. +Each list element should have the form + + (LOCAL-VARS-LIST . TEST-LIST) + +where LOCAL-VARS-LISTS should be a list of local variable +definitions (strings) and TEST-LIST is a list of tests to +perform. Each entry of TEST-LIST should have the form + + (ENABLE-LOCAL-VARIABLES ENABLE-LOCAL-EVAL FORM) + +where ENABLE-LOCAL-VARIABLES is the value to assign to +`enable-local-variables', ENABLE-LOCAL-EVAL is the value to +assign to `enable-local-eval', and FORM is a desired `should' +form.") + +(defun file-test--do-local-variables-test (str test-settings) (with-temp-buffer - (insert "text\n" - ";; Local Variables:\n" - ";; files-test-var1: t\n" - ";; End:\n") - (let ((enable-local-variables nil)) + (insert str) + (let ((enable-local-variables (nth 0 test-settings)) + (enable-local-eval (nth 1 test-settings)) + (files-test-result nil) + (files-test-queried nil) + (files-test-safe-result nil)) (hack-local-variables) - (should (eq files-test-var1 nil))))) + (eval (nth 2 test-settings))))) + +(ert-deftest files-test-local-variables () + "Test the file-local variables implementation." + (unwind-protect + (progn + (defadvice hack-local-variables-confirm (around files-test activate) + (setq files-test-result 'query) + nil) + (dolist (test files-test-local-variable-data) + (let ((str (concat "text\n\n;; Local Variables:\n;; " + (mapconcat 'identity (car test) "\n;; ") + "\n;; End:\n"))) + (dolist (subtest (cdr test)) + (should (file-test--do-local-variables-test str subtest)))))) + (ad-disable-advice 'hack-local-variables-confirm 'around 'files-test))) ;;; files.el ends here From 7f654971e061afdaa4df62486cde4452abe698de Mon Sep 17 00:00:00 2001 From: Ulrich Mueller Date: Tue, 14 Aug 2012 14:58:01 +0800 Subject: [PATCH 006/212] * systime.h (EMACS_TIME_CMP): Don't cast time_t values to long. Fixes: debbugs:11712 --- src/ChangeLog | 5 +++++ src/systime.h | 11 ++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index fbe4f06da58..28e053be63f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-08-14 Ulrich Mueller + + * systime.h (EMACS_TIME_CMP): Don't cast time_t values to long + (Bug#11712). + 2012-08-13 Eli Zaretskii * w32menu.c: Include w32heap.h. diff --git a/src/systime.h b/src/systime.h index 9e7a1173a20..e6ebe4689df 100644 --- a/src/systime.h +++ b/src/systime.h @@ -147,15 +147,12 @@ extern int lisp_time_argument (Lisp_Object, time_t *, int *); #endif /* Compare times T1 and T2. Value is 0 if T1 and T2 are the same. - Value is < 0 if T1 is less than T2. Value is > 0 otherwise. (Cast - to long is for those platforms where time_t is an unsigned - type, and where otherwise T1 will always be grater than T2.) */ + Value is < 0 if T1 is less than T2. Value is > 0 otherwise. */ #define EMACS_TIME_CMP(T1, T2) \ - ((long)EMACS_SECS (T1) - (long)EMACS_SECS (T2) \ - + (EMACS_SECS (T1) == EMACS_SECS (T2) \ - ? EMACS_USECS (T1) - EMACS_USECS (T2) \ - : 0)) + (EMACS_SECS (T1) == EMACS_SECS (T2) \ + ? EMACS_USECS (T1) - EMACS_USECS (T2) \ + : (EMACS_SECS (T1) < EMACS_SECS (T2) ? -1 : 1)) /* Compare times T1 and T2 for equality, inequality etc. */ From dd3c46bd95fc245e54c9ed036f844b0430407732 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 14 Aug 2012 17:59:25 +0800 Subject: [PATCH 007/212] Fix build failure with glibc-2.16. * lib/gnulib.mk: * lib/stdio.in.h: * m4/stdio_h.m4: Do not assume that gets is defined. Fixes: debbugs:11873 --- ChangeLog | 6 ++++++ lib/gnulib.mk | 1 - lib/stdio.in.h | 21 +++++---------------- m4/stdio_h.m4 | 10 ++++------ 4 files changed, 15 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index db8de760ba6..6cc23499bb1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-08-14 Ulrich Mueller + + * lib/gnulib.mk: + * lib/stdio.in.h: + * m4/stdio_h.m4: Do not assume that gets is defined (Bug#11873). + 2012-06-21 Ulrich Mueller * configure.in: Use m/intel386.h for amd64 with x32 ABI. (Bug#11669) diff --git a/lib/gnulib.mk b/lib/gnulib.mk index 154ae9882da..781027d6e7a 100644 --- a/lib/gnulib.mk +++ b/lib/gnulib.mk @@ -599,7 +599,6 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) -e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \ -e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \ -e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \ - -e 's/@''GNULIB_GETS''@/$(GNULIB_GETS)/g' \ -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \ -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \ -e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \ diff --git a/lib/stdio.in.h b/lib/stdio.in.h index ce00af574a8..1920830cc14 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -699,22 +699,11 @@ _GL_WARN_ON_USE (getline, "getline is unportable - " # endif #endif -#if @GNULIB_GETS@ -# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef gets -# define gets rpl_gets -# endif -_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (gets, char *, (char *s)); -# else -_GL_CXXALIAS_SYS (gets, char *, (char *s)); -# undef gets -# endif -_GL_CXXALIASWARN (gets); /* It is very rare that the developer ever has full control of stdin, - so any use of gets warrants an unconditional warning. Assume it is - always declared, since it is required by C89. */ + so any use of gets warrants an unconditional warning. Besides, C11 + removed it. */ +#undef gets +#if HAVE_RAW_DECL_GETS _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); #endif @@ -1054,7 +1043,7 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - " # endif #endif -/* Some people would argue that sprintf should be handled like gets +/* Some people would argue that sprintf uses should be warned about (for example, OpenBSD issues a link warning for both functions), since both can cause security holes due to buffer overruns. However, we believe that sprintf can be used safely, and is more diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4 index 39bf80e2ac9..b362458d1cf 100644 --- a/m4/stdio_h.m4 +++ b/m4/stdio_h.m4 @@ -1,4 +1,4 @@ -# stdio_h.m4 serial 40 +# stdio_h.m4 serial 41 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -18,7 +18,6 @@ AC_DEFUN([gl_STDIO_H], GNULIB_GETC=1 GNULIB_GETCHAR=1 GNULIB_FGETS=1 - GNULIB_GETS=1 GNULIB_FREAD=1 dnl This ifdef is necessary to avoid an error "missing file lib/stdio-read.c" dnl "expected source file, required through AC_LIBSOURCES, not found". It is @@ -72,10 +71,10 @@ AC_DEFUN([gl_STDIO_H], dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use, and which is not - dnl guaranteed by C89. + dnl guaranteed by C89 and C11. gl_WARN_ON_USE_PREPARE([[#include - ]], [dprintf fpurge fseeko ftello getdelim getline pclose popen renameat - snprintf tmpfile vdprintf vsnprintf]) + ]], [dprintf fpurge fseeko ftello getdelim getline gets pclose popen + renameat snprintf tmpfile vdprintf vsnprintf]) ]) AC_DEFUN([gl_STDIO_MODULE_INDICATOR], @@ -113,7 +112,6 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS], GNULIB_GETCHAR=0; AC_SUBST([GNULIB_GETCHAR]) GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM]) GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE]) - GNULIB_GETS=0; AC_SUBST([GNULIB_GETS]) GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF]) GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX]) GNULIB_PCLOSE=0; AC_SUBST([GNULIB_PCLOSE]) From 6bdcb2b28f1efc5d7116a3e41e5da845a7eeda33 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 14 Aug 2012 07:17:35 -0400 Subject: [PATCH 008/212] Auto-commit of generated files. --- autogen/Makefile.in | 2 -- autogen/configure | 3 --- 2 files changed, 5 deletions(-) diff --git a/autogen/Makefile.in b/autogen/Makefile.in index 4ade989d095..4b12085206e 100644 --- a/autogen/Makefile.in +++ b/autogen/Makefile.in @@ -230,7 +230,6 @@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ -GNULIB_GETS = @GNULIB_GETS@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ @@ -1361,7 +1360,6 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) -e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \ -e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \ -e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \ - -e 's/@''GNULIB_GETS''@/$(GNULIB_GETS)/g' \ -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \ -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \ -e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \ diff --git a/autogen/configure b/autogen/configure index 33576638fdd..3d3556dd8c6 100755 --- a/autogen/configure +++ b/autogen/configure @@ -719,7 +719,6 @@ GNULIB_PERROR GNULIB_PCLOSE GNULIB_OBSTACK_PRINTF_POSIX GNULIB_OBSTACK_PRINTF -GNULIB_GETS GNULIB_GETLINE GNULIB_GETDELIM GNULIB_GETCHAR @@ -18729,7 +18728,6 @@ $as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h GNULIB_GETCHAR=0; GNULIB_GETDELIM=0; GNULIB_GETLINE=0; - GNULIB_GETS=0; GNULIB_OBSTACK_PRINTF=0; GNULIB_OBSTACK_PRINTF_POSIX=0; GNULIB_PCLOSE=0; @@ -21286,7 +21284,6 @@ $as_echo "$gl_cv_next_stdio_h" >&6; } GNULIB_GETC=1 GNULIB_GETCHAR=1 GNULIB_FGETS=1 - GNULIB_GETS=1 GNULIB_FREAD=1 From 8c95e664530b0287a4755f6a945d8ac624bf6bd9 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 14 Aug 2012 14:43:08 -0400 Subject: [PATCH 009/212] * src/eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747) --- src/ChangeLog | 4 ++++ src/eval.c | 9 ++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 28e053be63f..26369903c33 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-08-14 Glenn Morris + + * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747) + 2012-08-14 Ulrich Mueller * systime.h (EMACS_TIME_CMP): Don't cast time_t values to long diff --git a/src/eval.c b/src/eval.c index 4a3f5083b3b..a2df5bfcff5 100644 --- a/src/eval.c +++ b/src/eval.c @@ -560,11 +560,10 @@ thinking of using it for any other purpose, it is quite likely that you're making a mistake. Think: what do you want to do when the command is called from a keyboard macro? -This function is meant for implementing advice and other -function-modifying features. Instead of using this, it is sometimes -cleaner to give your function an extra optional argument whose -`interactive' spec specifies non-nil unconditionally (\"p\" is a good -way to do this), or via (not (or executing-kbd-macro noninteractive)). */) +Instead of using this function, it is sometimes cleaner to give your +function an extra optional argument whose `interactive' spec specifies +non-nil unconditionally (\"p\" is a good way to do this), or via +\(not (or executing-kbd-macro noninteractive)). */) (Lisp_Object kind) { return ((INTERACTIVE || !EQ (kind, intern ("interactive"))) From 6f97980a9a0ca66d7b177005295cd7d6b68bf610 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 14 Aug 2012 15:07:53 -0400 Subject: [PATCH 010/212] Add CVE number to ChangeLog --- lisp/ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4e03a56111c..5b2c16edaf7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -17,6 +17,7 @@ * files.el (hack-local-variables-filter): If an eval: form is not known to be safe, and enable-local-variables is :safe, then ignore the form totally, as is done for non-eval forms. (Bug#12155) + This is CVE-2012-3479. 2012-08-07 Chong Yidong From 27d6c5a891036a40c1242f1f53cc794023f31283 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Wed, 15 Aug 2012 20:26:48 +0800 Subject: [PATCH 011/212] Fix for the buffer-local rcirc-encode-coding-system case in rcirc-split-message. --- lisp/ChangeLog | 5 +++++ lisp/net/rcirc.el | 33 +++++++++++++++++---------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5b2c16edaf7..143c255136f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-15 Leo Liu + + * net/rcirc.el (rcirc-split-message): Fix for buffer-local + rcirc-encode-coding-system. + 2012-08-13 Leo Liu * net/rcirc.el (rcirc-split-message): New function. diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 0eb6c7ea51b..0491e23ee24 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -796,22 +796,23 @@ With no argument or nil as argument, use the current buffer." (defun rcirc-split-message (message) "Split MESSAGE into chunks within `rcirc-max-message-length'." - (with-temp-buffer - (insert message) - (goto-char (point-min)) - (let (result) - (while (not (eobp)) - (goto-char (or (byte-to-position rcirc-max-message-length) - (point-max))) - ;; max message length is 512 including CRLF - (while (and (not (bobp)) - (> (length - (encode-coding-region (point-min) (point) - rcirc-encode-coding-system t)) - rcirc-max-message-length)) - (forward-char -1)) - (push (delete-and-extract-region (point-min) (point)) result)) - (nreverse result)))) + ;; `rcirc-encode-coding-system' can have buffer-local value. + (let ((encoding rcirc-encode-coding-system)) + (with-temp-buffer + (insert message) + (goto-char (point-min)) + (let (result) + (while (not (eobp)) + (goto-char (or (byte-to-position rcirc-max-message-length) + (point-max))) + ;; max message length is 512 including CRLF + (while (and (not (bobp)) + (> (length (encode-coding-region + (point-min) (point) encoding t)) + rcirc-max-message-length)) + (forward-char -1)) + (push (delete-and-extract-region (point-min) (point)) result)) + (nreverse result))))) (defun rcirc-send-message (process target message &optional noticep silent) "Send TARGET associated with PROCESS a privmsg with text MESSAGE. From ddf0e868c2461257cb922f415dea8d713400c1f8 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Thu, 16 Aug 2012 00:12:37 +0800 Subject: [PATCH 012/212] Bump version to 24.2 --- ChangeLog | 4 ++++ README | 2 +- admin/ChangeLog | 4 ++++ configure.in | 2 +- doc/emacs/ChangeLog | 4 ++++ doc/emacs/emacsver.texi | 2 +- doc/lispintro/ChangeLog | 4 ++++ doc/lispref/ChangeLog | 4 ++++ doc/man/ChangeLog | 4 ++++ doc/man/emacs.1 | 2 +- doc/misc/ChangeLog | 4 ++++ etc/ChangeLog | 4 ++++ leim/ChangeLog | 4 ++++ lib-src/ChangeLog | 4 ++++ lisp/ChangeLog | 4 ++++ lisp/cedet/ChangeLog | 4 ++++ lisp/erc/ChangeLog | 4 ++++ lisp/mh-e/ChangeLog | 4 ++++ lisp/org/ChangeLog | 4 ++++ lisp/url/ChangeLog | 4 ++++ lwlib/ChangeLog | 4 ++++ msdos/ChangeLog | 4 ++++ msdos/sed2v2.inp | 2 +- nextstep/ChangeLog | 4 ++++ nextstep/Cocoa/Emacs.base/Contents/Info.plist | 4 ++-- .../Contents/Resources/English.lproj/InfoPlist.strings | 4 ++-- nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop | 2 +- nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist | 4 ++-- nt/ChangeLog | 4 ++++ nt/config.nt | 2 +- nt/emacs.rc | 8 ++++---- nt/emacsclient.rc | 8 ++++---- nt/makefile.w32-in | 2 +- oldXMenu/ChangeLog | 4 ++++ src/ChangeLog | 4 ++++ test/ChangeLog | 4 ++++ 36 files changed, 114 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6cc23499bb1..31091767f93 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-08-14 Ulrich Mueller * lib/gnulib.mk: diff --git a/README b/README index 42267218627..590296461d9 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ Copyright (C) 2001-2012 Free Software Foundation, Inc. See the end of the file for license conditions. -This directory tree holds version 24.1 of GNU Emacs, the extensible, +This directory tree holds version 24.2 of GNU Emacs, the extensible, customizable, self-documenting real-time display editor. The file INSTALL in this directory says how to build and install GNU diff --git a/admin/ChangeLog b/admin/ChangeLog index abe759dc53c..57b5ac0bd24 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-08-10 Glenn Morris * bzrmerge.el (bzrmerge-resolve): Disable local eval:. diff --git a/configure.in b/configure.in index f9aef8195c6..2b0b2f7e9bd 100644 --- a/configure.in +++ b/configure.in @@ -22,7 +22,7 @@ dnl You should have received a copy of the GNU General Public License dnl along with GNU Emacs. If not, see . AC_PREREQ(2.65) -AC_INIT(emacs, 24.1) +AC_INIT(emacs, 24.2) AC_CONFIG_HEADER(src/config.h:src/config.in) AC_CONFIG_SRCDIR(src/lisp.h) AC_CONFIG_AUX_DIR(build-aux) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 1253a7cec61..bb3863858a3 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-07-31 Chong Yidong * emacs.texi: Fix ISBN (Bug#12080). diff --git a/doc/emacs/emacsver.texi b/doc/emacs/emacsver.texi index 1c12f47497c..7313b62c25a 100644 --- a/doc/emacs/emacsver.texi +++ b/doc/emacs/emacsver.texi @@ -1,4 +1,4 @@ @c It would be nicer to generate this using configure and @version@. @c However, that would mean emacsver.texi would always be newer @c then the info files in release tarfiles. -@set EMACSVER 24.1 +@set EMACSVER 24.2 diff --git a/doc/lispintro/ChangeLog b/doc/lispintro/ChangeLog index 0cf74ae5878..9a5f0a43fca 100644 --- a/doc/lispintro/ChangeLog +++ b/doc/lispintro/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-06-19 Glenn Morris * Makefile.in: Rename infodir to buildinfodir throughout. (Bug#11737) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index f91f99d9c3d..8acf76c93b0 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-08-06 Eli Zaretskii * functions.texi (Closures): Put the main index entry for diff --git a/doc/man/ChangeLog b/doc/man/ChangeLog index 8355e674212..07504ebaf6e 100644 --- a/doc/man/ChangeLog +++ b/doc/man/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-06-01 Chong Yidong * Version 24.1 released. diff --git a/doc/man/emacs.1 b/doc/man/emacs.1 index 6dd8c55b013..c6caebf890c 100644 --- a/doc/man/emacs.1 +++ b/doc/man/emacs.1 @@ -1,5 +1,5 @@ .\" See section COPYING for copyright and redistribution information. -.TH EMACS 1 "2007 April 13" "GNU Emacs 24.1" +.TH EMACS 1 "2007 April 13" "GNU Emacs 24.2" . . .SH NAME diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 5a414e66f9a..33118558cbb 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-08-06 Aurélien Aptel * url.texi (Parsed URLs): Adjust to the code's use of defstruct diff --git a/etc/ChangeLog b/etc/ChangeLog index 903407e47d5..af72e050e43 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-06-01 Chong Yidong * Version 24.1 released. diff --git a/leim/ChangeLog b/leim/ChangeLog index 2d062f6e54d..c30e0fc7878 100644 --- a/leim/ChangeLog +++ b/leim/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-06-01 Chong Yidong * Version 24.1 released. diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index bdb6058c09a..6ae19d1fdf4 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-06-01 Chong Yidong * Version 24.1 released. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 143c255136f..7293a4626ff 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-08-15 Leo Liu * net/rcirc.el (rcirc-split-message): Fix for buffer-local diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog index 9d7da3430ad..59b1b480d45 100644 --- a/lisp/cedet/ChangeLog +++ b/lisp/cedet/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-06-01 Chong Yidong * Version 24.1 released. diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index b4d4586b6f3..37ef37f1edc 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-06-01 Chong Yidong * Version 24.1 released. diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index 0a15a65dc71..6e431cb8095 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-06-01 Chong Yidong * Version 24.1 released. diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog index dc3b532b537..8c588c4d559 100644 --- a/lisp/org/ChangeLog +++ b/lisp/org/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-06-01 Chong Yidong * Version 24.1 released. diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 685f32505b1..e71f266c544 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-06-23 Leo Liu * url-http.el (url-http-codes): Fix mal-formed defconst. diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog index 4b07b7927ae..8b8b3418c77 100644 --- a/lwlib/ChangeLog +++ b/lwlib/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-06-01 Chong Yidong * Version 24.1 released. diff --git a/msdos/ChangeLog b/msdos/ChangeLog index de20128d88c..e7113ce2669 100644 --- a/msdos/ChangeLog +++ b/msdos/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-06-01 Chong Yidong * Version 24.1 released. diff --git a/msdos/sed2v2.inp b/msdos/sed2v2.inp index 2e215bfd4e4..48ab482f7f4 100644 --- a/msdos/sed2v2.inp +++ b/msdos/sed2v2.inp @@ -59,7 +59,7 @@ /^#undef PACKAGE_STRING/s/^.*$/#define PACKAGE_STRING ""/ /^#undef PACKAGE_TARNAME/s/^.*$/#define PACKAGE_TARNAME ""/ /^#undef PACKAGE_VERSION/s/^.*$/#define PACKAGE_VERSION ""/ -/^#undef VERSION/s/^.*$/#define VERSION "24.1"/ +/^#undef VERSION/s/^.*$/#define VERSION "24.2"/ /^#undef HAVE_DECL_GETENV/s/^.*$/#define HAVE_DECL_GETENV 1/ /^#undef SYS_SIGLIST_DECLARED/s/^.*$/#define SYS_SIGLIST_DECLARED 1/ /^#undef HAVE_DIRENT_H/s/^.*$/#define HAVE_DIRENT_H 1/ diff --git a/nextstep/ChangeLog b/nextstep/ChangeLog index f5cbdc33847..07dc3d1bb4c 100644 --- a/nextstep/ChangeLog +++ b/nextstep/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-06-01 Chong Yidong * Version 24.1 released. diff --git a/nextstep/Cocoa/Emacs.base/Contents/Info.plist b/nextstep/Cocoa/Emacs.base/Contents/Info.plist index 793e022f868..34af9f34c4e 100644 --- a/nextstep/Cocoa/Emacs.base/Contents/Info.plist +++ b/nextstep/Cocoa/Emacs.base/Contents/Info.plist @@ -553,7 +553,7 @@ along with GNU Emacs. If not, see . CFBundleExecutable Emacs CFBundleGetInfoString - Emacs 24.1 Copyright (C) 2012 Free Software Foundation, Inc. + Emacs 24.2 Copyright (C) 2012 Free Software Foundation, Inc. CFBundleIconFile Emacs.icns CFBundleIdentifier @@ -566,7 +566,7 @@ along with GNU Emacs. If not, see . APPL CFBundleShortVersionString - 24.1 + 24.2 CFBundleSignature EMAx diff --git a/nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings b/nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings index 19cdba8a0dd..02baa7ba6cc 100644 --- a/nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings +++ b/nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings @@ -1,6 +1,6 @@ /* Localized versions of Info.plist keys */ CFBundleName = "Emacs"; -CFBundleShortVersionString = "Version 24.1"; -CFBundleGetInfoString = "Emacs version 24.1, NS Windowing"; +CFBundleShortVersionString = "Version 24.2"; +CFBundleGetInfoString = "Emacs version 24.2, NS Windowing"; NSHumanReadableCopyright = "Copyright (C) 2012 Free Software Foundation, Inc."; diff --git a/nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop b/nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop index da1a3be2f86..fe8702a4909 100644 --- a/nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop +++ b/nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Encoding=UTF-8 Type=Application -Version=24.1 +Version=24.2 Categories=GNUstep Name=Emacs Comment=GNU Emacs for NeXT/Open/GNUstep and OS X diff --git a/nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist b/nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist index 2c95656af5c..cfbf09c9efa 100644 --- a/nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist +++ b/nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist @@ -2,7 +2,7 @@ ApplicationDescription = "GNU Emacs for GNUstep / OS X"; ApplicationIcon = emacs.tiff; ApplicationName = Emacs; - ApplicationRelease = "24.1"; + ApplicationRelease = "24.2"; Authors = ( "Adrian Robert (GNUstep)", "Christophe de Dinechin (MacOS X)", @@ -13,7 +13,7 @@ ); Copyright = "Copyright (C) 2012 Free Software Foundation, Inc."; CopyrightDescription = "Released under the GNU General Public License Version 3 or later"; - FullVersionID = "Emacs 24.1, NS Windowing"; + FullVersionID = "Emacs 24.2, NS Windowing"; NSExecutable = Emacs; NSIcon = emacs.tiff; NSPrincipalClass = NSApplication; diff --git a/nt/ChangeLog b/nt/ChangeLog index f27b4867ebe..abc71a1bb19 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-06-01 Chong Yidong * Version 24.1 released. diff --git a/nt/config.nt b/nt/config.nt index 94cb6072603..d44df3c21f0 100644 --- a/nt/config.nt +++ b/nt/config.nt @@ -331,7 +331,7 @@ along with GNU Emacs. If not, see . */ #define PACKAGE "emacs" /* Version number of package */ -#define VERSION "24.1" +#define VERSION "24.2" /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ diff --git a/nt/emacs.rc b/nt/emacs.rc index e9d472de79f..e92b665ef44 100644 --- a/nt/emacs.rc +++ b/nt/emacs.rc @@ -7,8 +7,8 @@ Emacs ICON icons\emacs.ico #endif VS_VERSION_INFO VERSIONINFO - FILEVERSION 24,1,0,0 - PRODUCTVERSION 24,1,0,0 + FILEVERSION 24,2,0,0 + PRODUCTVERSION 24,2,0,0 FILEFLAGSMASK 0x3FL #ifdef EMACSDEBUG FILEFLAGS 0x1L @@ -25,12 +25,12 @@ BEGIN BEGIN VALUE "CompanyName", "Free Software Foundation\0" VALUE "FileDescription", "GNU Emacs: The extensible self-documenting text editor\0" - VALUE "FileVersion", "24, 1, 0, 0\0" + VALUE "FileVersion", "24, 2, 0, 0\0" VALUE "InternalName", "Emacs\0" VALUE "LegalCopyright", "Copyright (C) 2001-2012\0" VALUE "OriginalFilename", "emacs.exe" VALUE "ProductName", "Emacs\0" - VALUE "ProductVersion", "24, 1, 0, 0\0" + VALUE "ProductVersion", "24, 2, 0, 0\0" VALUE "OLESelfRegister", "\0" END END diff --git a/nt/emacsclient.rc b/nt/emacsclient.rc index 0af025c6c0f..5c905a8c533 100644 --- a/nt/emacsclient.rc +++ b/nt/emacsclient.rc @@ -5,8 +5,8 @@ Emacs ICON icons\emacs.ico #endif VS_VERSION_INFO VERSIONINFO - FILEVERSION 24,1,0,0 - PRODUCTVERSION 24,1,0,0 + FILEVERSION 24,2,0,0 + PRODUCTVERSION 24,2,0,0 FILEFLAGSMASK 0x3FL #ifdef EMACSDEBUG FILEFLAGS 0x1L @@ -23,12 +23,12 @@ BEGIN BEGIN VALUE "CompanyName", "Free Software Foundation\0" VALUE "FileDescription", "GNU EmacsClient: Client for the extensible self-documenting text editor\0" - VALUE "FileVersion", "24, 1, 0, 0\0" + VALUE "FileVersion", "24, 2, 0, 0\0" VALUE "InternalName", "EmacsClient\0" VALUE "LegalCopyright", "Copyright (C) 2001-2012\0" VALUE "OriginalFilename", "emacsclientw.exe" VALUE "ProductName", "EmacsClient\0" - VALUE "ProductVersion", "24, 1, 0, 0\0" + VALUE "ProductVersion", "24, 2, 0, 0\0" VALUE "OLESelfRegister", "\0" END END diff --git a/nt/makefile.w32-in b/nt/makefile.w32-in index cb151785888..161fc8fd706 100644 --- a/nt/makefile.w32-in +++ b/nt/makefile.w32-in @@ -22,7 +22,7 @@ # FIXME: This file uses DOS EOLs. Convert to Unix after 22.1 is out # (and remove or replace this comment). -VERSION = 24.1 +VERSION = 24.2 TMP_DIST_DIR = emacs-$(VERSION) diff --git a/oldXMenu/ChangeLog b/oldXMenu/ChangeLog index 2d42a65356f..338f9e75429 100644 --- a/oldXMenu/ChangeLog +++ b/oldXMenu/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-06-01 Chong Yidong * Version 24.1 released. diff --git a/src/ChangeLog b/src/ChangeLog index 26369903c33..7da25a856e6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-08-14 Glenn Morris * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747) diff --git a/test/ChangeLog b/test/ChangeLog index 1cdd054da3e..4f707a4e74a 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2012-08-15 Chong Yidong + + * Version 24.2 released. + 2012-08-14 Chong Yidong * automated/files.el: Test every combination of values for From e84a9018eca592c250831398edfcfc30780b4f34 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Thu, 16 Aug 2012 00:13:34 +0800 Subject: [PATCH 013/212] Regenerate ldefs-boot.el --- lisp/ldefs-boot.el | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index f004f03e8f3..be81935160e 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -1611,7 +1611,7 @@ insert a template for the file depending on the mode of the buffer. ;;;### (autoloads (batch-update-autoloads update-directory-autoloads ;;;;;; update-file-autoloads) "autoload" "emacs-lisp/autoload.el" -;;;;;; (20400 62402)) +;;;;;; (20517 48515)) ;;; Generated autoloads from emacs-lisp/autoload.el (put 'generated-autoload-file 'safe-local-variable 'stringp) @@ -2705,7 +2705,7 @@ columns on its right towards the left. ;;;*** ;;;### (autoloads (bug-reference-prog-mode bug-reference-mode) "bug-reference" -;;;;;; "progmodes/bug-reference.el" (20352 65510)) +;;;;;; "progmodes/bug-reference.el" (20487 24216)) ;;; Generated autoloads from progmodes/bug-reference.el (put 'bug-reference-url-format 'safe-local-variable (lambda (s) (or (stringp s) (and (symbolp s) (get s 'bug-reference-url-format))))) @@ -2859,7 +2859,7 @@ and corresponding effects. ;;;*** -;;;### (autoloads nil "cal-dst" "calendar/cal-dst.el" (20352 65510)) +;;;### (autoloads nil "cal-dst" "calendar/cal-dst.el" (20461 49352)) ;;; Generated autoloads from calendar/cal-dst.el (put 'calendar-daylight-savings-starts 'risky-local-variable t) @@ -4748,8 +4748,8 @@ Randomly permute the elements of VECTOR (all permutations equally likely). ;;;*** ;;;### (autoloads (copyright-update-directory copyright copyright-fix-years -;;;;;; copyright-update) "copyright" "emacs-lisp/copyright.el" (20400 -;;;;;; 62402)) +;;;;;; copyright-update) "copyright" "emacs-lisp/copyright.el" (20517 +;;;;;; 48515)) ;;; Generated autoloads from emacs-lisp/copyright.el (put 'copyright-at-end-flag 'safe-local-variable 'booleanp) (put 'copyright-names-regexp 'safe-local-variable 'stringp) @@ -4788,7 +4788,7 @@ If FIX is non-nil, run `copyright-fix-years' instead. ;;;*** ;;;### (autoloads (cperl-perldoc-at-point cperl-perldoc cperl-mode) -;;;;;; "cperl-mode" "progmodes/cperl-mode.el" (20352 65510)) +;;;;;; "cperl-mode" "progmodes/cperl-mode.el" (20512 35261)) ;;; Generated autoloads from progmodes/cperl-mode.el (put 'cperl-indent-level 'safe-local-variable 'integerp) (put 'cperl-brace-offset 'safe-local-variable 'integerp) @@ -6372,7 +6372,7 @@ This requires the external program `diff' to be in your `exec-path'. ;;;*** ;;;### (autoloads (diff-minor-mode diff-mode) "diff-mode" "vc/diff-mode.el" -;;;;;; (20400 62402)) +;;;;;; (20461 49352)) ;;; Generated autoloads from vc/diff-mode.el (autoload 'diff-mode "diff-mode" "\ @@ -8406,7 +8406,7 @@ Emerge two RCS revisions of a file, with another revision as ancestor. ;;;*** ;;;### (autoloads (enriched-decode enriched-encode enriched-mode) -;;;;;; "enriched" "textmodes/enriched.el" (20352 65510)) +;;;;;; "enriched" "textmodes/enriched.el" (20461 49352)) ;;; Generated autoloads from textmodes/enriched.el (autoload 'enriched-mode "enriched" "\ @@ -10136,7 +10136,7 @@ This is used only in conjunction with `expand-add-abbrevs'. ;;;*** -;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (20400 62402)) +;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (20461 49352)) ;;; Generated autoloads from progmodes/f90.el (autoload 'f90-mode "f90" "\ @@ -11366,7 +11366,7 @@ and choose the directory as the fortune-file. ;;;*** ;;;### (autoloads (gdb gdb-enable-debug) "gdb-mi" "progmodes/gdb-mi.el" -;;;;;; (20400 62402)) +;;;;;; (20500 124)) ;;; Generated autoloads from progmodes/gdb-mi.el (defvar gdb-enable-debug nil "\ @@ -14045,7 +14045,7 @@ bound to the current value of the filter. ;;;*** ;;;### (autoloads (ibuffer ibuffer-other-window ibuffer-list-buffers) -;;;;;; "ibuffer" "ibuffer.el" (20400 62402)) +;;;;;; "ibuffer" "ibuffer.el" (20461 49352)) ;;; Generated autoloads from ibuffer.el (autoload 'ibuffer-list-buffers "ibuffer" "\ @@ -18060,7 +18060,7 @@ The return value is always nil. ;;;### (autoloads (multi-isearch-files-regexp multi-isearch-files ;;;;;; multi-isearch-buffers-regexp multi-isearch-buffers multi-isearch-setup) -;;;;;; "misearch" "misearch.el" (20352 65510)) +;;;;;; "misearch" "misearch.el" (20487 24216)) ;;; Generated autoloads from misearch.el (add-hook 'isearch-mode-hook 'multi-isearch-setup) @@ -23745,7 +23745,7 @@ Display `quickurl-list' as a formatted list using `quickurl-list-mode'. ;;;*** ;;;### (autoloads (rcirc-track-minor-mode rcirc-connect rcirc) "rcirc" -;;;;;; "net/rcirc.el" (20400 62402)) +;;;;;; "net/rcirc.el" (20523 50225)) ;;; Generated autoloads from net/rcirc.el (autoload 'rcirc "rcirc" "\ @@ -25825,7 +25825,7 @@ To work around that, do: ;;;*** ;;;### (autoloads (sh-mode) "sh-script" "progmodes/sh-script.el" -;;;;;; (20400 62402)) +;;;;;; (20487 24216)) ;;; Generated autoloads from progmodes/sh-script.el (put 'sh-shell 'safe-local-variable 'symbolp) @@ -26028,8 +26028,8 @@ Otherwise, one argument `-i' is passed to the shell. ;;;*** -;;;### (autoloads (shr-insert-document) "shr" "gnus/shr.el" (20352 -;;;;;; 65510)) +;;;### (autoloads (shr-insert-document) "shr" "gnus/shr.el" (20487 +;;;;;; 24216)) ;;; Generated autoloads from gnus/shr.el (autoload 'shr-insert-document "shr" "\ @@ -29817,8 +29817,8 @@ Discard Tramp from loading remote files. ;;;*** -;;;### (autoloads (help-with-tutorial) "tutorial" "tutorial.el" (20400 -;;;;;; 62402)) +;;;### (autoloads (help-with-tutorial) "tutorial" "tutorial.el" (20517 +;;;;;; 48515)) ;;; Generated autoloads from tutorial.el (autoload 'help-with-tutorial "tutorial" "\ @@ -30445,7 +30445,7 @@ accessible. ;;;*** ;;;### (autoloads (url-http-options url-http-file-attributes url-http-file-exists-p -;;;;;; url-http) "url-http" "url/url-http.el" (20400 62402)) +;;;;;; url-http) "url-http" "url/url-http.el" (20461 49352)) ;;; Generated autoloads from url/url-http.el (autoload 'url-http "url-http" "\ @@ -30830,7 +30830,7 @@ This uses `url-current-object', set locally to the buffer. ;;;*** ;;;### (autoloads (ask-user-about-supersession-threat ask-user-about-lock) -;;;;;; "userlock" "userlock.el" (20352 65510)) +;;;;;; "userlock" "userlock.el" (20487 24216)) ;;; Generated autoloads from userlock.el (autoload 'ask-user-about-lock "userlock" "\ @@ -32664,7 +32664,7 @@ Please submit bug reports and other feedback to the author, Neil W. Van Dyke ;;;*** ;;;### (autoloads (which-function-mode which-func-mode) "which-func" -;;;;;; "progmodes/which-func.el" (20400 62402)) +;;;;;; "progmodes/which-func.el" (20461 49352)) ;;; Generated autoloads from progmodes/which-func.el (put 'which-func-format 'risky-local-variable t) (put 'which-func-current 'risky-local-variable t) @@ -33754,7 +33754,7 @@ Zone out, completely. ;;;;;; "vc/ediff-ptch.el" "vc/ediff-vers.el" "vc/ediff-wind.el" ;;;;;; "vc/pcvs-info.el" "vc/pcvs-parse.el" "vc/pcvs-util.el" "vc/vc-dav.el" ;;;;;; "vcursor.el" "vt-control.el" "vt100-led.el" "w32-fns.el" -;;;;;; "w32-vars.el" "x-dnd.el") (20436 19807 651595)) +;;;;;; "w32-vars.el" "x-dnd.el") (20523 50589 129181)) ;;;*** From 6652b0bc0ab3eb055f64f819fdb3c2329d7400b3 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 15 Aug 2012 15:03:14 -0400 Subject: [PATCH 014/212] * lisp/vc/log-edit.el (log-edit-font-lock-gnu-style): Mark safe if boolean. Do not merge to trunk. --- lisp/ChangeLog | 4 ++++ lisp/vc/log-edit.el | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7293a4626ff..d205e36a749 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -2,6 +2,10 @@ * Version 24.2 released. +2012-08-15 Glenn Morris + + * vc/log-edit.el (log-edit-font-lock-gnu-style): Mark safe if boolean. + 2012-08-15 Leo Liu * net/rcirc.el (rcirc-split-message): Fix for buffer-local diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el index 54d548c09da..4ef2732382e 100644 --- a/lisp/vc/log-edit.el +++ b/lisp/vc/log-edit.el @@ -360,6 +360,12 @@ automatically." 'log-edit-header) nil lax))))) +;; Used in Emacs 24.3+, and in Emacs's .dir-locals.el file. +;; This is a convenience setting so that people committing files +;; to Emacs trunk with Emacs 24point2 do not always get queried +;; about this variable being potentially unsafe. +(put 'log-edit-font-lock-gnu-style 'safe-local-variable 'booleanp) + ;;;###autoload (defun log-edit (callback &optional setup params buffer mode &rest _ignore) "Setup a buffer to enter a log message. From 879b6116e2ee1ed8b6ad20086bfc5f333013c100 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 15 Aug 2012 15:12:03 -0400 Subject: [PATCH 015/212] Add 24.2 NEWS section (do not merge to trunk) --- etc/NEWS | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index 4379f0c180b..6c0014d0bf7 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -14,6 +14,11 @@ and NEWS.1-17 for changes in older Emacs versions. You can narrow news to a specific version by calling `view-emacs-news' with a prefix argument or by typing C-u C-h C-n. + +* Changes in Emacs 24.2 + +** This is mainly a bug-fix release. + * Installation Changes in Emacs 24.1 From 5defc805f7987454b07e2bd80b3a3942dc20fde2 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 16 Aug 2012 07:17:31 -0400 Subject: [PATCH 016/212] Auto-commit of generated files. --- autogen/configure | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/autogen/configure b/autogen/configure index 3d3556dd8c6..cc9e5054ecb 100755 --- a/autogen/configure +++ b/autogen/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for emacs 24.1. +# Generated by GNU Autoconf 2.65 for emacs 24.2. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -549,8 +549,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='emacs' PACKAGE_TARNAME='emacs' -PACKAGE_VERSION='24.1' -PACKAGE_STRING='emacs 24.1' +PACKAGE_VERSION='24.2' +PACKAGE_STRING='emacs 24.2' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1886,7 +1886,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures emacs 24.1 to adapt to many kinds of systems. +\`configure' configures emacs 24.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1960,7 +1960,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of emacs 24.1:";; + short | recursive ) echo "Configuration of emacs 24.2:";; esac cat <<\_ACEOF @@ -2123,7 +2123,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -emacs configure 24.1 +emacs configure 24.2 generated by GNU Autoconf 2.65 Copyright (C) 2009 Free Software Foundation, Inc. @@ -2845,7 +2845,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by emacs $as_me 24.1, which was +It was created by emacs $as_me 24.2, which was generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ @@ -3678,7 +3678,7 @@ fi # Define the identity of the package. PACKAGE='emacs' - VERSION='24.1' + VERSION='24.2' cat >>confdefs.h <<_ACEOF @@ -23160,7 +23160,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by emacs $as_me 24.1, which was +This file was extended by emacs $as_me 24.2, which was generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -23226,7 +23226,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -emacs config.status 24.1 +emacs config.status 24.2 configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" From d7191076ce331e8c78dbc93b76d0e346c268daa0 Mon Sep 17 00:00:00 2001 From: Alp Aker Date: Sat, 18 Aug 2012 20:53:29 -0400 Subject: [PATCH 017/212] * nsfont.m (ns_ascii_average_width): Ensure the string ascii_printable is initialized with a null-terminated character array. Otherwise, it can contain undesired extra characters. --- src/ChangeLog | 6 ++++++ src/nsfont.m | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 1956d602e6a..5956eea1c51 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-08-18 Alp Aker + + * nsfont.m (ns_ascii_average_width): Ensure the string + ascii_printable is initialized with a null-terminated character + array. Otherwise, it can contain undesired extra characters. + 2012-08-18 Paul Eggert port new setting code to Sun C 5.8 2005/10/13 diff --git a/src/nsfont.m b/src/nsfont.m index 1f8d28cd238..412a6777c64 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -270,10 +270,11 @@ static void ns_glyph_metrics (struct nsfont_info *font_info, if (!ascii_printable) { - char chars[95]; + char chars[96]; int ch; for (ch = 0; ch < 95; ch++) chars[ch] = ' ' + ch; + chars[95] = '\0'; ascii_printable = [[NSString alloc] initWithFormat: @"%s", chars]; } From 17975d7ff9fd734e67dfb97dc9f8be45fcdaec7c Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 19 Aug 2012 14:37:15 +0800 Subject: [PATCH 018/212] * xml.el (xml-escape-string): Don't refer to xml-entity-alist. Fixes: debbugs:12228 --- lisp/ChangeLog | 5 +++++ lisp/xml.el | 26 +++++++++++++++++++------- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ec89b3784d9..17c7fa0f06a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-19 Chong Yidong + + * xml.el (xml-escape-string): Don't refer to xml-entity-alist + (Bug#12228). + 2012-08-18 Chong Yidong * simple.el (yank-handled-properties): New defcustom. diff --git a/lisp/xml.el b/lisp/xml.el index 179fdd6b5cc..d395f75ec0f 100644 --- a/lisp/xml.el +++ b/lisp/xml.el @@ -1011,13 +1011,25 @@ The first line is indented with the optional INDENT-STRING." (defalias 'xml-print 'xml-debug-print) (defun xml-escape-string (string) - "Return STRING with entity substitutions made from `xml-entity-alist'." - (mapconcat (lambda (byte) - (let ((char (char-to-string byte))) - (if (rassoc char xml-entity-alist) - (concat "&" (car (rassoc char xml-entity-alist)) ";") - char))) - string "")) + "Convert STRING into a string containing valid XML character data. +Replace occurrences of &<>'\" in STRING with their default XML +entity references (e.g. replace each & with &). + +XML character data must not contain & or < characters, nor the > +character under some circumstances. The XML spec does not impose +restriction on \" or ', but we just substitute for these too +\(as is permitted by the spec)." + (with-temp-buffer + (insert string) + (dolist (substitution '(("&" . "&") + ("<" . "<") + (">" . ">") + ("'" . "'") + ("\"" . """))) + (goto-char (point-min)) + (while (search-forward (car substitution) nil t) + (replace-match (cdr substitution) t t nil))) + (buffer-string))) (defun xml-debug-print-internal (xml indent-string) "Outputs the XML tree in the current buffer. From 9e677988f40fcbcd0a2283cbc7f8b7b087427fae Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sun, 19 Aug 2012 10:40:12 +0200 Subject: [PATCH 019/212] * data.c (set_internal): Don't use set_blv_found. (Fkill_local_variable): Likewise. --- src/ChangeLog | 5 +++++ src/data.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5956eea1c51..84271438a81 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-08-19 Andreas Schwab + + * data.c (set_internal): Don't use set_blv_found. + (Fkill_local_variable): Likewise. + 2012-08-18 Alp Aker * nsfont.m (ns_ascii_average_width): Ensure the string diff --git a/src/data.c b/src/data.c index ea511824e6d..6dd852dd710 100644 --- a/src/data.c +++ b/src/data.c @@ -1184,7 +1184,7 @@ set_internal (register Lisp_Object symbol, register Lisp_Object newval, register ? XFRAME (where)->param_alist : BVAR (XBUFFER (where), local_var_alist))); set_blv_where (blv, where); - set_blv_found (blv, 1); + blv->found = 1; if (NILP (tem1)) { @@ -1199,7 +1199,7 @@ set_internal (register Lisp_Object symbol, register Lisp_Object newval, register if (bindflag || !blv->local_if_set || let_shadows_buffer_binding_p (sym)) { - set_blv_found (blv, 0); + blv->found = 0; tem1 = blv->defcell; } /* If it's a local_if_set, being set not bound, @@ -1735,7 +1735,7 @@ From now on the default value will apply in this buffer. Return VARIABLE. */) if (EQ (buf, blv->where)) { set_blv_where (blv, Qnil); - set_blv_found (blv, 0); + blv->found = 0; find_symbol_value (variable); } } From 6b1319cec2cc1753ca527533f78fe45069342dfa Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sun, 19 Aug 2012 12:50:03 +0200 Subject: [PATCH 020/212] * .gdbinit: Use call instead of set when calling a function in the inferior. --- src/.gdbinit | 6 +++--- src/ChangeLog | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/.gdbinit b/src/.gdbinit index c0a1bbfffd8..b703842f4cf 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -89,7 +89,7 @@ define pp set $tmp = $arg0 set $output_debug = print_output_debug_flag set print_output_debug_flag = 0 - set safe_debug_print ($tmp) + call safe_debug_print ($tmp) set print_output_debug_flag = $output_debug end document pp @@ -102,7 +102,7 @@ define pv set $tmp = "$arg0" set $output_debug = print_output_debug_flag set print_output_debug_flag = 0 - set safe_debug_print (find_symbol_value (intern ($tmp))) + call safe_debug_print (find_symbol_value (intern ($tmp))) set print_output_debug_flag = $output_debug end document pv @@ -1162,7 +1162,7 @@ end define xwhichsymbols set $output_debug = print_output_debug_flag set print_output_debug_flag = 0 - set safe_debug_print (which_symbols ($arg0, $arg1)) + call safe_debug_print (which_symbols ($arg0, $arg1)) set print_output_debug_flag = $output_debug end document xwhichsymbols diff --git a/src/ChangeLog b/src/ChangeLog index 84271438a81..a287474ec06 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2012-08-19 Andreas Schwab + * .gdbinit: Use call instead of set when calling a function in the + inferior. + * data.c (set_internal): Don't use set_blv_found. (Fkill_local_variable): Likewise. From 450809af98c857e5161aa28f31871e52a22dacad Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 20 Aug 2012 00:19:05 +0800 Subject: [PATCH 021/212] * src/xdisp.c (handle_invisible_prop): Fix ellipses at overlay string ends. * test/redisplay-testsuite.el (test-redisplay): Use switch-to-buffer. Fixes: debbugs:3874 --- src/ChangeLog | 5 +++++ src/xdisp.c | 21 ++++++++++----------- test/ChangeLog | 4 ++++ test/redisplay-testsuite.el | 2 +- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index a287474ec06..63b968c8bb5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-08-19 Chong Yidong + + * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string + ends (Bug#3874). + 2012-08-19 Andreas Schwab * .gdbinit: Use call instead of set when calling a function in the diff --git a/src/xdisp.c b/src/xdisp.c index ff74af98304..aab643f9fe8 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -4088,35 +4088,33 @@ handle_invisible_prop (struct it *it) /* Record whether we have to display an ellipsis for the invisible text. */ int display_ellipsis_p = (invis_p == 2); - ptrdiff_t endpos; + ptrdiff_t len, endpos; handled = HANDLED_RECOMPUTE_PROPS; /* Get the position at which the next visible text can be found in IT->string, if any. */ - XSETINT (limit, SCHARS (it->string)); + len = SCHARS (it->string); + XSETINT (limit, len); do { end_charpos = Fnext_single_property_change (charpos, Qinvisible, it->string, limit); - if (!NILP (end_charpos)) + if (INTEGERP (end_charpos)) { + endpos = XFASTINT (end_charpos); prop = Fget_text_property (end_charpos, Qinvisible, it->string); invis_p = TEXT_PROP_MEANS_INVISIBLE (prop); if (invis_p == 2) display_ellipsis_p = 1; } } - while (!NILP (end_charpos) && invis_p); + while (invis_p && INTEGERP (end_charpos) && endpos < len); if (display_ellipsis_p) - { - it->ellipsis_p = 1; - handled = HANDLED_RETURN; - } + it->ellipsis_p = 1; - if (INTEGERP (end_charpos) - && (endpos = XFASTINT (end_charpos)) < XFASTINT (limit)) + if (INTEGERP (end_charpos) && endpos < len) { /* Text at END_CHARPOS is visible. Move IT there. */ struct text_pos old; @@ -4154,7 +4152,8 @@ handle_invisible_prop (struct it *it) /* The rest of the string is invisible. If this is an overlay string, proceed with the next overlay string or whatever comes and return a character from there. */ - if (it->current.overlay_string_index >= 0) + if (it->current.overlay_string_index >= 0 + && !display_ellipsis_p) { next_overlay_string (it); /* Don't check for overlay strings when we just diff --git a/test/ChangeLog b/test/ChangeLog index cd7e9fd7ccc..c3183406ea2 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2012-08-19 Chong Yidong + + * redisplay-testsuite.el (test-redisplay): Use switch-to-buffer. + 2012-08-18 Chong Yidong * redisplay-testsuite.el (test-redisplay-4): New test (Bug#3874). diff --git a/test/redisplay-testsuite.el b/test/redisplay-testsuite.el index 99924daa3d9..39f81a13c60 100644 --- a/test/redisplay-testsuite.el +++ b/test/redisplay-testsuite.el @@ -260,7 +260,7 @@ static unsigned char x_bits[] = {0xff, 0x81, 0xbd, 0xa5, 0xa5, 0xbd, 0x81, 0xff (let ((buf (get-buffer "*Redisplay Test*"))) (if buf (kill-buffer buf)) - (pop-to-buffer (get-buffer-create "*Redisplay Test*")) + (switch-to-buffer (get-buffer-create "*Redisplay Test*")) (erase-buffer) (setq buffer-invisibility-spec '(test-redisplay--simple-invis From 7cef3569a3d872ea5be07a529b68910bf1d8b790 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 19 Aug 2012 11:41:35 -0700 Subject: [PATCH 022/212] Fix previous rmail-output-read-file-name change * lisp/mail/rmailout.el (rmail-output-read-file-name): Fix previous change (when the alist is nil or does not match). --- lisp/ChangeLog | 5 +++++ lisp/mail/rmailout.el | 45 +++++++++++++++++++++++-------------------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 17c7fa0f06a..7865b9a39f6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-19 Glenn Morris + + * mail/rmailout.el (rmail-output-read-file-name): + Fix previous change (when the alist is nil or does not match). + 2012-08-19 Chong Yidong * xml.el (xml-escape-string): Don't refer to xml-entity-alist diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el index 5d500135b7a..c325824eb28 100644 --- a/lisp/mail/rmailout.el +++ b/lisp/mail/rmailout.el @@ -61,27 +61,30 @@ The function `rmail-delete-unwanted-fields' uses this, ignoring case." Set `rmail-default-file' to this name as well as returning it. This uses `rmail-output-file-alist'." (let* ((default-file - (when rmail-output-file-alist - (or rmail-buffer (error "There is no Rmail buffer")) - (save-current-buffer - (set-buffer rmail-buffer) - (let ((beg (rmail-msgbeg rmail-current-message)) - (end (rmail-msgend rmail-current-message))) - (if (rmail-buffers-swapped-p) (set-buffer rmail-view-buffer)) - (save-excursion - (save-restriction - (widen) - (narrow-to-region beg end) - (let ((tail rmail-output-file-alist) - answer) - ;; Suggest a file based on a pattern match. - (while (and tail (not answer)) - (goto-char (point-min)) - (if (re-search-forward (caar tail) nil t) - (setq answer (eval (cdar tail)))) - (setq tail (cdr tail))) - ;; If no suggestion, use same file as last time. - (or answer rmail-default-file)))))))) + (or + (when rmail-output-file-alist + (or rmail-buffer (error "There is no Rmail buffer")) + (save-current-buffer + (set-buffer rmail-buffer) + (let ((beg (rmail-msgbeg rmail-current-message)) + (end (rmail-msgend rmail-current-message))) + (if (rmail-buffers-swapped-p) (set-buffer rmail-view-buffer)) + (save-excursion + (save-restriction + (widen) + (narrow-to-region beg end) + (let ((tail rmail-output-file-alist) + answer) + ;; Suggest a file based on a pattern match. + (while (and tail (not answer)) + (goto-char (point-min)) + (if (re-search-forward (caar tail) nil t) + ;; FIXME trap and report any errors. + (setq answer (eval (cdar tail)))) + (setq tail (cdr tail))) + answer)))))) + ;; If no suggestion, use same file as last time. + rmail-default-file)) (read-file (expand-file-name (read-file-name From 32bd425074e32184d3d4d9f985fd1a60814d78b2 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 19 Aug 2012 12:22:41 -0700 Subject: [PATCH 023/212] * xdisp.c (handle_invisible_prop): Make it a bit faster and avoid a gcc -Wmaybe-uninitialized diagnostic. --- src/ChangeLog | 5 +++++ src/xdisp.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 63b968c8bb5..7f15a1a7921 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-08-19 Paul Eggert + + * xdisp.c (handle_invisible_prop): Make it a bit faster + and avoid a gcc -Wmaybe-uninitialized diagnostic. + 2012-08-19 Chong Yidong * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string diff --git a/src/xdisp.c b/src/xdisp.c index aab643f9fe8..e41783d03c1 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -4094,7 +4094,7 @@ handle_invisible_prop (struct it *it) /* Get the position at which the next visible text can be found in IT->string, if any. */ - len = SCHARS (it->string); + endpos = len = SCHARS (it->string); XSETINT (limit, len); do { @@ -4109,12 +4109,12 @@ handle_invisible_prop (struct it *it) display_ellipsis_p = 1; } } - while (invis_p && INTEGERP (end_charpos) && endpos < len); + while (invis_p && endpos < len); if (display_ellipsis_p) it->ellipsis_p = 1; - if (INTEGERP (end_charpos) && endpos < len) + if (endpos < len) { /* Text at END_CHARPOS is visible. Move IT there. */ struct text_pos old; From 22d7feb28c95cec0c940fc7b933491550730512b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 19 Aug 2012 13:02:24 -0700 Subject: [PATCH 024/212] * unexaix.c, unexcoff.c: Include "mem-limits.h". (start_of_data): Remove decl; mem-limits.h provides it. --- src/ChangeLog | 3 +++ src/unexaix.c | 3 ++- src/unexcoff.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 7f15a1a7921..e922ede7a0c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2012-08-19 Paul Eggert + * unexaix.c, unexcoff.c: Include "mem-limits.h". + (start_of_data): Remove decl; mem-limits.h provides it. + * xdisp.c (handle_invisible_prop): Make it a bit faster and avoid a gcc -Wmaybe-uninitialized diagnostic. diff --git a/src/unexaix.c b/src/unexaix.c index 29fa0fd6287..c09156296f7 100644 --- a/src/unexaix.c +++ b/src/unexaix.c @@ -56,8 +56,9 @@ what you give them. Help stamp out software-hoarding! */ #include #include +#include "mem-limits.h" + char *start_of_text (void); /* Start of text */ -extern char *start_of_data (void); /* Start of initialized data */ extern int _data; extern int _text; diff --git a/src/unexcoff.c b/src/unexcoff.c index 5b269737839..e83042a379d 100644 --- a/src/unexcoff.c +++ b/src/unexcoff.c @@ -98,7 +98,7 @@ struct aouthdr #include -extern char *start_of_data (void); /* Start of initialized data */ +#include "mem-limits.h" static long block_copy_start; /* Old executable start point */ static struct filehdr f_hdr; /* File header */ From b69a6d228467365b4ed2545dcb1ecc3582d20e2a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 19 Aug 2012 14:00:09 -0700 Subject: [PATCH 025/212] Rely on to declare 'environ', as gnulib does this if the system doesn't. * lib-src/emacsclient.c (environ): Remove decl. * src/callproc.c, src/editfns.c, src/process.c (environ) [!USE_CRT_DLL]: * src/emacs.c (environ) [DOUG_LEA_MALLOC]: * src/vm-limit.c (environ) [ORDINARY_LINK]: Remove decl. * src/vm-limit.c: Include , for 'environ'. --- lib-src/ChangeLog | 5 +++++ lib-src/emacsclient.c | 5 ----- src/ChangeLog | 7 +++++++ src/callproc.c | 4 ---- src/editfns.c | 4 ---- src/emacs.c | 4 ---- src/process.c | 3 --- src/vm-limit.c | 2 +- 8 files changed, 13 insertions(+), 21 deletions(-) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index fe90917a70b..464b9e37359 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,8 @@ +2012-08-19 Paul Eggert + + Rely on to declare 'environ'. + * emacsclient.c (environ): Remove decl. + 2012-08-17 Juanma Barranquero * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies. diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 20afe1cad11..07300dbf249 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -1584,11 +1584,6 @@ main (int argc, char **argv) /* Send over our environment and current directory. */ if (!current_frame) { -#ifndef WINDOWSNT - /* This is defined in stdlib.h on MS-Windows. It's defined in - unistd.h on some POSIX hosts, but not all (Bug#10155). */ - extern char **environ; -#endif int i; for (i = 0; environ[i]; i++) { diff --git a/src/ChangeLog b/src/ChangeLog index e922ede7a0c..fa3eaa281d7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,12 @@ 2012-08-19 Paul Eggert + Rely on to declare 'environ', + as gnulib does this if the system doesn't. + * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]: + * emacs.c (environ) [DOUG_LEA_MALLOC]: + * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl. + * vm-limit.c: Include , for 'environ'. + * unexaix.c, unexcoff.c: Include "mem-limits.h". (start_of_data): Remove decl; mem-limits.h provides it. diff --git a/src/callproc.c b/src/callproc.c index 10a80168fb2..4bf1da04e1a 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -65,10 +65,6 @@ along with GNU Emacs. If not, see . */ #include "nsterm.h" #endif -#ifndef USE_CRT_DLL -extern char **environ; -#endif - #ifdef HAVE_SETPGID #if !defined (USG) #undef setpgrp diff --git a/src/editfns.c b/src/editfns.c index c4725aa0ff3..fa57edead28 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -58,10 +58,6 @@ along with GNU Emacs. If not, see . */ #include "window.h" #include "blockinput.h" -#ifndef USE_CRT_DLL -extern char **environ; -#endif - #define TM_YEAR_BASE 1900 #ifdef WINDOWSNT diff --git a/src/emacs.c b/src/emacs.c index 8d458c612cc..9e7efcabbf7 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -642,10 +642,6 @@ argmatch (char **argv, int argc, const char *sstr, const char *lstr, static void malloc_initialize_hook (void) { -#ifndef USE_CRT_DLL - extern char **environ; -#endif - if (initialized) { if (!malloc_using_checking) diff --git a/src/process.c b/src/process.c index ea463cd9187..7f6f6bafbea 100644 --- a/src/process.c +++ b/src/process.c @@ -1623,9 +1623,6 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) /* Use volatile to protect variables from being clobbered by longjmp. */ volatile int forkin, forkout; volatile int pty_flag = 0; -#ifndef USE_CRT_DLL - extern char **environ; -#endif inchannel = outchannel = -1; diff --git a/src/vm-limit.c b/src/vm-limit.c index c313a900f2c..cf697b56fdf 100644 --- a/src/vm-limit.c +++ b/src/vm-limit.c @@ -18,6 +18,7 @@ along with GNU Emacs. If not, see . */ #include #include +#include /* for 'environ', on AIX */ #include "lisp.h" #include "mem-limits.h" @@ -268,7 +269,6 @@ start_of_data (void) * is known to live at or near the start of the system crt0.c, and * we don't sweat the handful of bytes that might lose. */ - extern char **environ; return ((POINTER) &environ); #else extern int data_start; From 562d4436bce90adc8535aeb2b9b1517952ee67ad Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 19 Aug 2012 16:31:24 -0700 Subject: [PATCH 026/212] Merge from gnulib. 2012-08-19 ignore-value, stat-time, timespec: omit AC_C_INLINE 2012-08-19 mktime, sys_select: avoid 'static inline' 2012-08-19 gnulib-tool: Fix indentation. --- ChangeLog | 7 ++ lib/gnulib.mk | 2 +- lib/mktime.c | 4 +- lib/sys_select.in.h | 2 +- m4/gnulib-comp.m4 | 299 ++++++++++++++++++++++---------------------- m4/mktime.m4 | 7 +- m4/stat-time.m4 | 2 - m4/timespec.m4 | 8 +- 8 files changed, 164 insertions(+), 167 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9336b112b4f..4a531145e20 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-08-19 Paul Eggert + + Merge from gnulib, incorporating: + 2012-08-19 ignore-value, stat-time, timespec: omit AC_C_INLINE + 2012-08-19 mktime, sys_select: avoid 'static inline' + 2012-08-19 gnulib-tool: Fix indentation. + 2012-08-18 Paul Eggert * lib/sigprocmask.c, m4/signalblocking.m4: Remove. diff --git a/lib/gnulib.mk b/lib/gnulib.mk index 0cc0e68bb7b..a90cc59bbde 100644 --- a/lib/gnulib.mk +++ b/lib/gnulib.mk @@ -21,7 +21,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings MOSTLYCLEANFILES += core *.stackdump diff --git a/lib/mktime.c b/lib/mktime.c index 952c82983bb..74d1b84949b 100644 --- a/lib/mktime.c +++ b/lib/mktime.c @@ -142,7 +142,7 @@ verify (twos_complement_arithmetic, verify (base_year_is_a_multiple_of_100, TM_YEAR_BASE % 100 == 0); /* Return 1 if YEAR + TM_YEAR_BASE is a leap year. */ -static inline int +static int leapyear (long_int year) { /* Don't add YEAR to TM_YEAR_BASE, as that might overflow. @@ -196,7 +196,7 @@ isdst_differ (int a, int b) The result may overflow. It is the caller's responsibility to detect overflow. */ -static inline time_t +static time_t ydhms_diff (long_int year1, long_int yday1, int hour1, int min1, int sec1, int year0, int yday0, int hour0, int min0, int sec0) { diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h index 0aee2a16cbf..ae8f90cae74 100644 --- a/lib/sys_select.in.h +++ b/lib/sys_select.in.h @@ -130,7 +130,7 @@ /* Re-define FD_ISSET to avoid a WSA call while we are not using network sockets. */ -static inline int +static int rpl_fd_isset (SOCKET fd, fd_set * set) { u_int i; diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index c4deb8d42fb..12c8ca8734b 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -136,135 +136,134 @@ AC_DEFUN([gl_INIT], m4_pushdef([gl_LIBSOURCES_DIR], []) gl_COMMON gl_source_base='lib' -gl_FUNC_ALLOCA -AC_CHECK_FUNCS_ONCE([readlinkat]) -gl_CLOCK_TIME -gl_MD5 -gl_SHA1 -gl_SHA256 -gl_SHA512 -AC_REQUIRE([gl_C99_STRTOLD]) -gl_FUNC_DUP2 -if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then - AC_LIBOBJ([dup2]) - gl_PREREQ_DUP2 -fi -gl_UNISTD_MODULE_INDICATOR([dup2]) -gl_ENVIRON -gl_UNISTD_MODULE_INDICATOR([environ]) -AC_REQUIRE([gl_EXTERN_INLINE]) -gl_FILEMODE -gl_GETLOADAVG -if test $HAVE_GETLOADAVG = 0; then - AC_LIBOBJ([getloadavg]) - gl_PREREQ_GETLOADAVG -fi -gl_STDLIB_MODULE_INDICATOR([getloadavg]) -gl_FUNC_GETOPT_GNU -if test $REPLACE_GETOPT = 1; then - AC_LIBOBJ([getopt]) - AC_LIBOBJ([getopt1]) - gl_PREREQ_GETOPT - dnl Arrange for unistd.h to include getopt.h. - GNULIB_GL_UNISTD_H_GETOPT=1 -fi -AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) -gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu]) -gl_FUNC_GETOPT_POSIX -if test $REPLACE_GETOPT = 1; then - AC_LIBOBJ([getopt]) - AC_LIBOBJ([getopt1]) - gl_PREREQ_GETOPT - dnl Arrange for unistd.h to include getopt.h. - GNULIB_GL_UNISTD_H_GETOPT=1 -fi -AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) -gl_GETTIME -gl_FUNC_GETTIMEOFDAY -if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then - AC_LIBOBJ([gettimeofday]) - gl_PREREQ_GETTIMEOFDAY -fi -gl_SYS_TIME_MODULE_INDICATOR([gettimeofday]) -AC_REQUIRE([AC_C_INLINE]) -gl_INTTYPES_INCOMPLETE -AC_REQUIRE([gl_LARGEFILE]) -gl_FUNC_LSTAT -if test $REPLACE_LSTAT = 1; then - AC_LIBOBJ([lstat]) - gl_PREREQ_LSTAT -fi -gl_SYS_STAT_MODULE_INDICATOR([lstat]) -gl_FUNC_MKTIME -if test $REPLACE_MKTIME = 1; then - AC_LIBOBJ([mktime]) - gl_PREREQ_MKTIME -fi -gl_TIME_MODULE_INDICATOR([mktime]) -gl_MULTIARCH -gl_FUNC_PSELECT -if test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1; then - AC_LIBOBJ([pselect]) -fi -gl_SYS_SELECT_MODULE_INDICATOR([pselect]) -gl_FUNC_PTHREAD_SIGMASK -if test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1; then - AC_LIBOBJ([pthread_sigmask]) - gl_PREREQ_PTHREAD_SIGMASK -fi -gl_SIGNAL_MODULE_INDICATOR([pthread_sigmask]) -gl_FUNC_READLINK -if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then - AC_LIBOBJ([readlink]) - gl_PREREQ_READLINK -fi -gl_UNISTD_MODULE_INDICATOR([readlink]) -gl_SIGNAL_H -gl_TYPE_SOCKLEN_T -gt_TYPE_SSIZE_T -gl_STAT_TIME -gl_STAT_BIRTHTIME -gl_STDALIGN_H -gl_STDARG_H -AM_STDBOOL_H -gl_STDDEF_H -gl_STDINT_H -gl_STDIO_H -gl_STDLIB_H -gl_FUNC_GNU_STRFTIME -gl_FUNC_STRTOIMAX -if test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then - AC_LIBOBJ([strtoimax]) - gl_PREREQ_STRTOIMAX -fi -gl_INTTYPES_MODULE_INDICATOR([strtoimax]) -gl_FUNC_STRTOUMAX -if test $ac_cv_func_strtoumax = no; then - AC_LIBOBJ([strtoumax]) - gl_PREREQ_STRTOUMAX -fi -gl_INTTYPES_MODULE_INDICATOR([strtoumax]) -gl_FUNC_SYMLINK -if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then - AC_LIBOBJ([symlink]) -fi -gl_UNISTD_MODULE_INDICATOR([symlink]) -gl_HEADER_SYS_SELECT -AC_PROG_MKDIR_P -gl_HEADER_SYS_STAT_H -AC_PROG_MKDIR_P -gl_HEADER_SYS_TIME_H -AC_PROG_MKDIR_P -gl_HEADER_TIME_H -gl_TIME_R -if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then - AC_LIBOBJ([time_r]) - gl_PREREQ_TIME_R -fi -gl_TIME_MODULE_INDICATOR([time_r]) -gl_TIMESPEC -gl_UNISTD_H -gl_UTIMENS + gl_FUNC_ALLOCA + AC_CHECK_FUNCS_ONCE([readlinkat]) + gl_CLOCK_TIME + gl_MD5 + gl_SHA1 + gl_SHA256 + gl_SHA512 + AC_REQUIRE([gl_C99_STRTOLD]) + gl_FUNC_DUP2 + if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then + AC_LIBOBJ([dup2]) + gl_PREREQ_DUP2 + fi + gl_UNISTD_MODULE_INDICATOR([dup2]) + gl_ENVIRON + gl_UNISTD_MODULE_INDICATOR([environ]) + AC_REQUIRE([gl_EXTERN_INLINE]) + gl_FILEMODE + gl_GETLOADAVG + if test $HAVE_GETLOADAVG = 0; then + AC_LIBOBJ([getloadavg]) + gl_PREREQ_GETLOADAVG + fi + gl_STDLIB_MODULE_INDICATOR([getloadavg]) + gl_FUNC_GETOPT_GNU + if test $REPLACE_GETOPT = 1; then + AC_LIBOBJ([getopt]) + AC_LIBOBJ([getopt1]) + gl_PREREQ_GETOPT + dnl Arrange for unistd.h to include getopt.h. + GNULIB_GL_UNISTD_H_GETOPT=1 + fi + AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) + gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu]) + gl_FUNC_GETOPT_POSIX + if test $REPLACE_GETOPT = 1; then + AC_LIBOBJ([getopt]) + AC_LIBOBJ([getopt1]) + gl_PREREQ_GETOPT + dnl Arrange for unistd.h to include getopt.h. + GNULIB_GL_UNISTD_H_GETOPT=1 + fi + AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) + gl_GETTIME + gl_FUNC_GETTIMEOFDAY + if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then + AC_LIBOBJ([gettimeofday]) + gl_PREREQ_GETTIMEOFDAY + fi + gl_SYS_TIME_MODULE_INDICATOR([gettimeofday]) + gl_INTTYPES_INCOMPLETE + AC_REQUIRE([gl_LARGEFILE]) + gl_FUNC_LSTAT + if test $REPLACE_LSTAT = 1; then + AC_LIBOBJ([lstat]) + gl_PREREQ_LSTAT + fi + gl_SYS_STAT_MODULE_INDICATOR([lstat]) + gl_FUNC_MKTIME + if test $REPLACE_MKTIME = 1; then + AC_LIBOBJ([mktime]) + gl_PREREQ_MKTIME + fi + gl_TIME_MODULE_INDICATOR([mktime]) + gl_MULTIARCH + gl_FUNC_PSELECT + if test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1; then + AC_LIBOBJ([pselect]) + fi + gl_SYS_SELECT_MODULE_INDICATOR([pselect]) + gl_FUNC_PTHREAD_SIGMASK + if test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1; then + AC_LIBOBJ([pthread_sigmask]) + gl_PREREQ_PTHREAD_SIGMASK + fi + gl_SIGNAL_MODULE_INDICATOR([pthread_sigmask]) + gl_FUNC_READLINK + if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then + AC_LIBOBJ([readlink]) + gl_PREREQ_READLINK + fi + gl_UNISTD_MODULE_INDICATOR([readlink]) + gl_SIGNAL_H + gl_TYPE_SOCKLEN_T + gt_TYPE_SSIZE_T + gl_STAT_TIME + gl_STAT_BIRTHTIME + gl_STDALIGN_H + gl_STDARG_H + AM_STDBOOL_H + gl_STDDEF_H + gl_STDINT_H + gl_STDIO_H + gl_STDLIB_H + gl_FUNC_GNU_STRFTIME + gl_FUNC_STRTOIMAX + if test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then + AC_LIBOBJ([strtoimax]) + gl_PREREQ_STRTOIMAX + fi + gl_INTTYPES_MODULE_INDICATOR([strtoimax]) + gl_FUNC_STRTOUMAX + if test $ac_cv_func_strtoumax = no; then + AC_LIBOBJ([strtoumax]) + gl_PREREQ_STRTOUMAX + fi + gl_INTTYPES_MODULE_INDICATOR([strtoumax]) + gl_FUNC_SYMLINK + if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then + AC_LIBOBJ([symlink]) + fi + gl_UNISTD_MODULE_INDICATOR([symlink]) + gl_HEADER_SYS_SELECT + AC_PROG_MKDIR_P + gl_HEADER_SYS_STAT_H + AC_PROG_MKDIR_P + gl_HEADER_SYS_TIME_H + AC_PROG_MKDIR_P + gl_HEADER_TIME_H + gl_TIME_R + if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then + AC_LIBOBJ([time_r]) + gl_PREREQ_TIME_R + fi + gl_TIME_MODULE_INDICATOR([time_r]) + gl_TIMESPEC + gl_UNISTD_H + gl_UTIMENS gl_gnulib_enabled_dosname=false gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false gl_gnulib_enabled_pathmax=false @@ -281,27 +280,27 @@ gl_UTIMENS func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36 () { if ! $gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36; then -AC_SUBST([LIBINTL]) -AC_SUBST([LTLIBINTL]) + AC_SUBST([LIBINTL]) + AC_SUBST([LTLIBINTL]) gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=true fi } func_gl_gnulib_m4code_pathmax () { if ! $gl_gnulib_enabled_pathmax; then -gl_PATHMAX + gl_PATHMAX gl_gnulib_enabled_pathmax=true fi } func_gl_gnulib_m4code_stat () { if ! $gl_gnulib_enabled_stat; then -gl_FUNC_STAT -if test $REPLACE_STAT = 1; then - AC_LIBOBJ([stat]) - gl_PREREQ_STAT -fi -gl_SYS_STAT_MODULE_INDICATOR([stat]) + gl_FUNC_STAT + if test $REPLACE_STAT = 1; then + AC_LIBOBJ([stat]) + gl_PREREQ_STAT + fi + gl_SYS_STAT_MODULE_INDICATOR([stat]) gl_gnulib_enabled_stat=true if test $REPLACE_STAT = 1; then func_gl_gnulib_m4code_dosname @@ -317,24 +316,24 @@ gl_SYS_STAT_MODULE_INDICATOR([stat]) func_gl_gnulib_m4code_strtoll () { if ! $gl_gnulib_enabled_strtoll; then -gl_FUNC_STRTOLL -if test $HAVE_STRTOLL = 0; then - AC_LIBOBJ([strtoll]) - gl_PREREQ_STRTOLL -fi -gl_STDLIB_MODULE_INDICATOR([strtoll]) + gl_FUNC_STRTOLL + if test $HAVE_STRTOLL = 0; then + AC_LIBOBJ([strtoll]) + gl_PREREQ_STRTOLL + fi + gl_STDLIB_MODULE_INDICATOR([strtoll]) gl_gnulib_enabled_strtoll=true fi } func_gl_gnulib_m4code_strtoull () { if ! $gl_gnulib_enabled_strtoull; then -gl_FUNC_STRTOULL -if test $HAVE_STRTOULL = 0; then - AC_LIBOBJ([strtoull]) - gl_PREREQ_STRTOULL -fi -gl_STDLIB_MODULE_INDICATOR([strtoull]) + gl_FUNC_STRTOULL + if test $HAVE_STRTOULL = 0; then + AC_LIBOBJ([strtoull]) + gl_PREREQ_STRTOULL + fi + gl_STDLIB_MODULE_INDICATOR([strtoull]) gl_gnulib_enabled_strtoull=true fi } diff --git a/m4/mktime.m4 b/m4/mktime.m4 index 00ee2dabea5..f509bc4da07 100644 --- a/m4/mktime.m4 +++ b/m4/mktime.m4 @@ -1,4 +1,4 @@ -# serial 23 +# serial 24 dnl Copyright (C) 2002-2003, 2005-2007, 2009-2012 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -247,7 +247,4 @@ AC_DEFUN([gl_FUNC_MKTIME_INTERNAL], [ ]) # Prerequisites of lib/mktime.c. -AC_DEFUN([gl_PREREQ_MKTIME], -[ - AC_REQUIRE([AC_C_INLINE]) -]) +AC_DEFUN([gl_PREREQ_MKTIME], [:]) diff --git a/m4/stat-time.m4 b/m4/stat-time.m4 index 2dbb1f3c752..9371d7bb960 100644 --- a/m4/stat-time.m4 +++ b/m4/stat-time.m4 @@ -19,7 +19,6 @@ dnl From Paul Eggert. AC_DEFUN([gl_STAT_TIME], [ - AC_REQUIRE([AC_C_INLINE]) AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_CHECK_HEADERS_ONCE([sys/time.h]) @@ -70,7 +69,6 @@ AC_DEFUN([gl_STAT_TIME], # AC_DEFUN([gl_STAT_BIRTHTIME], [ - AC_REQUIRE([AC_C_INLINE]) AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_CHECK_HEADERS_ONCE([sys/time.h]) AC_CHECK_MEMBERS([struct stat.st_birthtimespec.tv_nsec], [], diff --git a/m4/timespec.m4 b/m4/timespec.m4 index 597b9c2d1af..63c00e83cdf 100644 --- a/m4/timespec.m4 +++ b/m4/timespec.m4 @@ -1,4 +1,4 @@ -#serial 14 +#serial 15 # Copyright (C) 2000-2001, 2003-2007, 2009-2012 Free Software Foundation, Inc. @@ -8,8 +8,4 @@ dnl From Jim Meyering -AC_DEFUN([gl_TIMESPEC], -[ - dnl Prerequisites of lib/timespec.h. - AC_REQUIRE([AC_C_INLINE]) -]) +AC_DEFUN([gl_TIMESPEC], [:]) From c06c96903aed621abdf215013f4ce3a09aa1e144 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 20 Aug 2012 03:28:35 +0200 Subject: [PATCH 027/212] src/makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies. --- src/ChangeLog | 4 ++++ src/makefile.w32-in | 1 + 2 files changed, 5 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index fa3eaa281d7..93f522519a1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-08-20 Juanma Barranquero + + * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies. + 2012-08-19 Paul Eggert Rely on to declare 'environ', diff --git a/src/makefile.w32-in b/src/makefile.w32-in index 9c13f561a04..bdb292099bc 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in @@ -1448,6 +1448,7 @@ $(BLD)/unexw32.$(O) : \ $(BLD)/vm-limit.$(O) : \ $(SRC)/vm-limit.c \ $(SRC)/mem-limits.h \ + $(NT_INC)/unistd.h \ $(CONFIG_H) \ $(LISP_H) From bad03192c4ed4ffc4996c331b76e506d625f134d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 19 Aug 2012 21:04:58 -0700 Subject: [PATCH 028/212] Clarify recent ChangeLog entry. --- lib-src/ChangeLog | 2 +- src/ChangeLog | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 464b9e37359..4e3f3424c91 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,6 +1,6 @@ 2012-08-19 Paul Eggert - Rely on to declare 'environ'. + Rely on + to declare 'environ'. * emacsclient.c (environ): Remove decl. 2012-08-17 Juanma Barranquero diff --git a/src/ChangeLog b/src/ChangeLog index 93f522519a1..8cffccdad37 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -4,7 +4,7 @@ 2012-08-19 Paul Eggert - Rely on to declare 'environ', + Rely on + to declare 'environ', as gnulib does this if the system doesn't. * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]: * emacs.c (environ) [DOUG_LEA_MALLOC]: From b96e5814f9fdb124f283b8051cc11d667d948d01 Mon Sep 17 00:00:00 2001 From: Edward Reingold Date: Mon, 20 Aug 2012 00:23:51 -0700 Subject: [PATCH 029/212] * calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance): New function. (This is basically cal-tex-cursor-filofax-week with a different papersize, mini-calendars, and color.) Fixes: debbugs:12160 --- lisp/ChangeLog | 5 ++ lisp/calendar/cal-tex.el | 162 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 167 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7865b9a39f6..2895aef3a7e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-20 Edward Reingold + + * calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance): + New function. (Bug12160) + 2012-08-19 Glenn Morris * mail/rmailout.el (rmail-output-read-file-name): diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index a40c05f45ca..c8c80370dfa 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -1009,6 +1009,168 @@ shown are hard-coded to 8-12, 13-17." (cal-tex-e-framebox) (cal-tex-hspace "1cm"))) +(defun cal-tex-cursor-week-at-a-glance (&optional n event) + "One-week-at-a-glance full page calendar for week indicated by cursor. +Optional prefix argument N specifies number of weeks (default 1), +starting on Mondays. The calendar shows holiday and diary entries +if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil. +It does not show hours of the day. Optional EVENT indicates a buffer +position to use instead of point." + (interactive (list (prefix-numeric-value current-prefix-arg) + last-nonmenu-event)) + (or n (setq n 1)) + (let* ((date (calendar-gregorian-from-absolute + (calendar-dayname-on-or-before + 1 + (calendar-absolute-from-gregorian + (calendar-cursor-to-date t event))))) + (month (calendar-extract-month date)) + (year (calendar-extract-year date)) + (day (calendar-extract-day date)) + (d1 (calendar-absolute-from-gregorian date)) + (d2 (+ (* 7 n) d1)) + (holidays (if cal-tex-holidays + (holiday-in-range d1 d2))) + (diary-list (if cal-tex-diary + (cal-tex-list-diary-entries d1 d2)))) + (cal-tex-preamble "twoside,12pt") + (cal-tex-cmd "\\usepackage{color}") + (cal-tex-cmd "\\textwidth 7in") + (cal-tex-cmd "\\textheight 10.5in") + (cal-tex-cmd "\\oddsidemargin 0in") + (cal-tex-cmd "\\evensidemargin 0in") + (cal-tex-cmd "\\topmargin 0pt") + (cal-tex-cmd "\\headheight -0.875in") + (cal-tex-cmd "\\headsep 0.125in") + (cal-tex-cmd "\\footskip .125in") + (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]} +\\long\\def\\rightday#1#2#3#4#5{% + \\rule{\\textwidth}{0.3pt}\\\\% + \\hbox to \\textwidth{% + \\vbox to 2.75in{% + \\vspace*{2pt}% + \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% + \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em \\textcolor{red}{#4}}}% + \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize \\textcolor{blue}{#3}}}}}\\\\} +\\long\\def\\weekend#1#2#3#4#5{% + \\rule{\\textwidth}{0.3pt}\\\\% + \\hbox to \\textwidth{% + \\vbox to 1.8in{% + \\vspace*{2pt}% + \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% + \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em \\textcolor{red}{#4}}}% + \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize \\textcolor{blue}{#3}}}}}\\\\} +\\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]} +\\long\\def\\leftday#1#2#3#4#5{% + \\rule{\\textwidth}{0.3pt}\\\\% + \\hbox to \\textwidth{% + \\vbox to 2.75in{% + \\vspace*{2pt}% + \\hbox to \\textwidth{\\noindent {\\normalsize \\bf #2} \\small #1 \\hfill #5}% + \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em \\textcolor{red}{#4}}}% + \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize \\textcolor{blue}{#3}}}}}\\\\} +") + (cal-tex-b-document) + (cal-tex-cmd "\\pagestyle{empty}\\ ") + (cal-tex-newpage) + (dotimes (i n) + (insert "\\lefthead") + (cal-tex-arg + (let ((d (cal-tex-incr-date date 2))) + (if (= (calendar-extract-month date) + (calendar-extract-month d)) + (format "%s %s" + (cal-tex-month-name (calendar-extract-month date)) + (calendar-extract-year date)) + (if (= (calendar-extract-year date) + (calendar-extract-year d)) + (format "%s---%s %s" + (cal-tex-month-name (calendar-extract-month date)) + (cal-tex-month-name (calendar-extract-month d)) + (calendar-extract-year date)) + (format "%s %s---%s %s" + (cal-tex-month-name (calendar-extract-month date)) + (calendar-extract-year date) + (cal-tex-month-name (calendar-extract-month d)) + (calendar-extract-year d)))))) + (insert "%\n") + (dotimes (_jdummy 3) + (insert "\\leftday") + (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date))) + (cal-tex-arg (number-to-string (calendar-extract-day date))) + (cal-tex-arg (cal-tex-latexify-list diary-list date)) + (cal-tex-arg (cal-tex-latexify-list holidays date)) + (cal-tex-arg (eval cal-tex-daily-string)) + (insert "%\n") + (setq date (cal-tex-incr-date date))) + (insert "\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n") + (cal-tex-nl) + (insert (cal-tex-mini-calendar + (calendar-extract-month (cal-tex-previous-month date)) + (calendar-extract-year (cal-tex-previous-month date)) + "lastmonth" "1.1in" "1in")) + (insert (cal-tex-mini-calendar + (calendar-extract-month date) + (calendar-extract-year date) + "thismonth" "1.1in" "1in")) + (insert (cal-tex-mini-calendar + (calendar-extract-month (cal-tex-next-month date)) + (calendar-extract-year (cal-tex-next-month date)) + "nextmonth" "1.1in" "1in")) + (insert "\\hbox to \\textwidth{") + (cal-tex-hfill) + (insert "\\lastmonth") + (cal-tex-hfill) + (insert "\\thismonth") + (cal-tex-hfill) + (insert "\\nextmonth") + (cal-tex-hfill) + (insert "}") + (cal-tex-newpage) + (insert "\\righthead") + (cal-tex-arg + (let ((d (cal-tex-incr-date date 3))) + (if (= (calendar-extract-month date) + (calendar-extract-month d)) + (format "%s %s" + (cal-tex-month-name (calendar-extract-month date)) + (calendar-extract-year date)) + (if (= (calendar-extract-year date) + (calendar-extract-year d)) + (format "%s---%s %s" + (cal-tex-month-name (calendar-extract-month date)) + (cal-tex-month-name (calendar-extract-month d)) + (calendar-extract-year date)) + (format "%s %s---%s %s" + (cal-tex-month-name (calendar-extract-month date)) + (calendar-extract-year date) + (cal-tex-month-name (calendar-extract-month d)) + (calendar-extract-year d)))))) + (insert "%\n") + (dotimes (_jdummy 2) + (insert "\\rightday") + (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date))) + (cal-tex-arg (number-to-string (calendar-extract-day date))) + (cal-tex-arg (cal-tex-latexify-list diary-list date)) + (cal-tex-arg (cal-tex-latexify-list holidays date)) + (cal-tex-arg (eval cal-tex-daily-string)) + (insert "%\n") + (setq date (cal-tex-incr-date date))) + (dotimes (_jdummy 2) + (insert "\\weekend") + (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date))) + (cal-tex-arg (number-to-string (calendar-extract-day date))) + (cal-tex-arg (cal-tex-latexify-list diary-list date)) + (cal-tex-arg (cal-tex-latexify-list holidays date)) + (cal-tex-arg (eval cal-tex-daily-string)) + (insert "%\n") + (setq date (cal-tex-incr-date date))) + (unless (= i (1- n)) + (run-hooks 'cal-tex-week-hook) + (cal-tex-newpage))) + (cal-tex-end-document) + (run-hooks 'cal-tex-hook))) + ;;;###cal-autoload (defun cal-tex-cursor-filofax-2week (&optional n event) "Two-weeks-at-a-glance Filofax style calendar for week cursor is in. From 36e8d1eb27b39ea35e9a57575858cb86a8784f2a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 20 Aug 2012 00:30:40 -0700 Subject: [PATCH 030/212] * lisp/font-lock.el (font-lock-add-keywords): Doc fix (quote face names since most non-font-lock faces are not also variables). --- lisp/ChangeLog | 5 +++++ lisp/font-lock.el | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2895aef3a7e..b944746861c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-20 Glenn Morris + + * font-lock.el (font-lock-add-keywords): Doc fix (quote face names + since most non-font-lock faces are not also variables). + 2012-08-20 Edward Reingold * calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance): diff --git a/lisp/font-lock.el b/lisp/font-lock.el index f3e313e9c35..77c21d26535 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -146,8 +146,8 @@ ;; fontified automagically. In your ~/.emacs there could be: ;; ;; (defvar foo-font-lock-keywords -;; '(("\\<\\(one\\|two\\|three\\)\\>" . font-lock-keyword-face) -;; ("\\<\\(four\\|five\\|six\\)\\>" . font-lock-type-face)) +;; '(("\\<\\(one\\|two\\|three\\)\\>" . 'font-lock-keyword-face) +;; ("\\<\\(four\\|five\\|six\\)\\>" . 'font-lock-type-face)) ;; "Default expressions to highlight in Foo mode.") ;; ;; (add-hook 'foo-mode-hook @@ -167,8 +167,8 @@ ;; could be: ;; ;; (defvar bar-font-lock-keywords -;; '(("\\<\\(uno\\|due\\|tre\\)\\>" . font-lock-keyword-face) -;; ("\\<\\(quattro\\|cinque\\|sei\\)\\>" . font-lock-type-face)) +;; '(("\\<\\(uno\\|due\\|tre\\)\\>" . 'font-lock-keyword-face) +;; ("\\<\\(quattro\\|cinque\\|sei\\)\\>" . 'font-lock-type-face)) ;; "Default expressions to highlight in Bar mode.") ;; ;; and within `bar-mode' there could be: @@ -679,8 +679,8 @@ end of the current highlighting list. For example: (font-lock-add-keywords 'c-mode - '((\"\\\\\\=<\\\\(FIXME\\\\):\" 1 font-lock-warning-face prepend) - (\"\\\\\\=<\\\\(and\\\\|or\\\\|not\\\\)\\\\\\=>\" . font-lock-keyword-face))) + '((\"\\\\\\=<\\\\(FIXME\\\\):\" 1 'font-lock-warning-face prepend) + (\"\\\\\\=<\\\\(and\\\\|or\\\\|not\\\\)\\\\\\=>\" . 'font-lock-keyword-face))) adds two fontification patterns for C mode, to fontify `FIXME:' words, even in comments, and to fontify `and', `or' and `not' words as keywords. @@ -694,9 +694,9 @@ For example: (add-hook 'c-mode-hook (lambda () (font-lock-add-keywords nil - '((\"\\\\\\=<\\\\(FIXME\\\\):\" 1 font-lock-warning-face prepend) + '((\"\\\\\\=<\\\\(FIXME\\\\):\" 1 'font-lock-warning-face prepend) (\"\\\\\\=<\\\\(and\\\\|or\\\\|not\\\\)\\\\\\=>\" . - font-lock-keyword-face))))) + 'font-lock-keyword-face))))) The above procedure may fail to add keywords to derived modes if some involved major mode does not follow the standard conventions. From 4ce60d2ec56748e74fb56487b7761a2bdba1d644 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Mon, 20 Aug 2012 11:42:06 +0400 Subject: [PATCH 031/212] Inline getter and setter functions for per-buffer values. * buffer.h (per_buffer_default, set_per_buffer_default) (per_buffer_value, set_per_buffer_value): New functions. (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove. * buffer.c, data.c: Adjust users. --- src/ChangeLog | 8 ++++++++ src/buffer.c | 10 +++++----- src/buffer.h | 36 +++++++++++++++++++++++++++--------- src/data.c | 16 ++++++++-------- 4 files changed, 48 insertions(+), 22 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 8cffccdad37..c5ab370d311 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2012-08-20 Dmitry Antipov + + Inline getter and setter functions for per-buffer values. + * buffer.h (per_buffer_default, set_per_buffer_default) + (per_buffer_value, set_per_buffer_value): New functions. + (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove. + * buffer.c, data.c: Adjust users. + 2012-08-20 Juanma Barranquero * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies. diff --git a/src/buffer.c b/src/buffer.c index 9373e3cd363..c900ef8c5a8 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -695,7 +695,7 @@ clone_per_buffer_values (struct buffer *from, struct buffer *to) if (offset == PER_BUFFER_VAR_OFFSET (name)) continue; - obj = PER_BUFFER_VALUE (from, offset); + obj = per_buffer_value (from, offset); if (MARKERP (obj) && XMARKER (obj)->buffer == from) { struct Lisp_Marker *m = XMARKER (obj); @@ -704,7 +704,7 @@ clone_per_buffer_values (struct buffer *from, struct buffer *to) XMARKER (obj)->insertion_type = m->insertion_type; } - PER_BUFFER_VALUE (to, offset) = obj; + set_per_buffer_value (to, offset, obj); } memcpy (to->local_flags, from->local_flags, sizeof to->local_flags); @@ -1063,7 +1063,7 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too) if ((idx > 0 && (permanent_too || buffer_permanent_local_flags[idx] == 0))) - PER_BUFFER_VALUE (b, offset) = PER_BUFFER_DEFAULT (offset); + set_per_buffer_value (b, offset, per_buffer_default (offset)); } } @@ -1239,7 +1239,7 @@ buffer_local_value_1 (Lisp_Object variable, Lisp_Object buffer) { union Lisp_Fwd *fwd = SYMBOL_FWD (sym); if (BUFFER_OBJFWDP (fwd)) - result = PER_BUFFER_VALUE (buf, XBUFFER_OBJFWD (fwd)->offset); + result = per_buffer_value (buf, XBUFFER_OBJFWD (fwd)->offset); else result = Fdefault_value (variable); break; @@ -1319,7 +1319,7 @@ No argument or nil as argument means use current buffer as BUFFER. */) && SYMBOLP (PER_BUFFER_SYMBOL (offset))) { Lisp_Object sym = PER_BUFFER_SYMBOL (offset); - Lisp_Object val = PER_BUFFER_VALUE (buf, offset); + Lisp_Object val = per_buffer_value (buf, offset); result = Fcons (EQ (val, Qunbound) ? sym : Fcons (sym, val), result); } diff --git a/src/buffer.h b/src/buffer.h index 510a8e55682..6c63c52dc47 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -1203,18 +1203,36 @@ extern int last_per_buffer_idx; #define PER_BUFFER_IDX(OFFSET) \ XINT (*(Lisp_Object *)((OFFSET) + (char *) &buffer_local_flags)) -/* Return the default value of the per-buffer variable at offset - OFFSET in the buffer structure. */ +/* Functions to get and set default value of the per-buffer + variable at offset OFFSET in the buffer structure. */ -#define PER_BUFFER_DEFAULT(OFFSET) \ - (*(Lisp_Object *)((OFFSET) + (char *) &buffer_defaults)) +BUFFER_INLINE Lisp_Object +per_buffer_default (int offset) +{ + return *(Lisp_Object *)(offset + (char *) &buffer_defaults); +} -/* Return the buffer-local value of the per-buffer variable at offset - OFFSET in the buffer structure. */ +BUFFER_INLINE void +set_per_buffer_default (int offset, Lisp_Object value) +{ + *(Lisp_Object *)(offset + (char *) &buffer_defaults) = value; +} + +/* Functions to get and set buffer-local value of the per-buffer + variable at offset OFFSET in the buffer structure. */ + +BUFFER_INLINE Lisp_Object +per_buffer_value (struct buffer *b, int offset) +{ + return *(Lisp_Object *)(offset + (char *) b); +} + +BUFFER_INLINE void +set_per_buffer_value (struct buffer *b, int offset, Lisp_Object value) +{ + *(Lisp_Object *)(offset + (char *) b) = value; +} -#define PER_BUFFER_VALUE(BUFFER, OFFSET) \ - (*(Lisp_Object *)((OFFSET) + (char *) (BUFFER))) - /* Downcase a character C, or make no change if that cannot be done. */ BUFFER_INLINE int downcase (int c) diff --git a/src/data.c b/src/data.c index 6dd852dd710..f812c280b40 100644 --- a/src/data.c +++ b/src/data.c @@ -847,7 +847,7 @@ do_symval_forwarding (register union Lisp_Fwd *valcontents) return *XOBJFWD (valcontents)->objvar; case Lisp_Fwd_Buffer_Obj: - return PER_BUFFER_VALUE (current_buffer, + return per_buffer_value (current_buffer, XBUFFER_OBJFWD (valcontents)->offset); case Lisp_Fwd_Kboard_Obj: @@ -919,7 +919,7 @@ store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newva b = XBUFFER (lbuf); if (! PER_BUFFER_VALUE_P (b, idx)) - PER_BUFFER_VALUE (b, offset) = newval; + set_per_buffer_value (b, offset, newval); } } break; @@ -937,7 +937,7 @@ store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newva if (buf == NULL) buf = current_buffer; - PER_BUFFER_VALUE (buf, offset) = newval; + set_per_buffer_value (buf, offset, newval); } break; @@ -1309,7 +1309,7 @@ default_value (Lisp_Object symbol) { int offset = XBUFFER_OBJFWD (valcontents)->offset; if (PER_BUFFER_IDX (offset) != 0) - return PER_BUFFER_DEFAULT (offset); + return per_buffer_default (offset); } /* For other variables, get the current value. */ @@ -1396,7 +1396,7 @@ for this variable. */) int offset = XBUFFER_OBJFWD (valcontents)->offset; int idx = PER_BUFFER_IDX (offset); - PER_BUFFER_DEFAULT (offset) = value; + set_per_buffer_default (offset, value); /* If this variable is not always local in all buffers, set it in the buffers that don't nominally have a local value. */ @@ -1406,7 +1406,7 @@ for this variable. */) FOR_EACH_BUFFER (b) if (!PER_BUFFER_VALUE_P (b, idx)) - PER_BUFFER_VALUE (b, offset) = value; + set_per_buffer_value (b, offset, value); } return value; } @@ -1705,8 +1705,8 @@ From now on the default value will apply in this buffer. Return VARIABLE. */) if (idx > 0) { SET_PER_BUFFER_VALUE_P (current_buffer, idx, 0); - PER_BUFFER_VALUE (current_buffer, offset) - = PER_BUFFER_DEFAULT (offset); + set_per_buffer_value (current_buffer, offset, + per_buffer_default (offset)); } } return variable; From 3d300447843086aa7ae4df85dd0a97f27b0b885a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 20 Aug 2012 00:45:10 -0700 Subject: [PATCH 032/212] * lisp/mail/rmailout.el (rmail-output-read-file-name): Trap errors in rmail-output-file-alist elements, and report them. --- lisp/ChangeLog | 3 +++ lisp/mail/rmailout.el | 14 +++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b944746861c..97bad569955 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-08-20 Glenn Morris + * mail/rmailout.el (rmail-output-read-file-name): + Trap and report errors in rmail-output-file-alist elements. + * font-lock.el (font-lock-add-keywords): Doc fix (quote face names since most non-font-lock faces are not also variables). diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el index c325824eb28..63cc26360b7 100644 --- a/lisp/mail/rmailout.el +++ b/lisp/mail/rmailout.el @@ -74,13 +74,21 @@ This uses `rmail-output-file-alist'." (widen) (narrow-to-region beg end) (let ((tail rmail-output-file-alist) - answer) + answer err) ;; Suggest a file based on a pattern match. (while (and tail (not answer)) (goto-char (point-min)) (if (re-search-forward (caar tail) nil t) - ;; FIXME trap and report any errors. - (setq answer (eval (cdar tail)))) + (setq answer + (condition-case err + (eval (cdar tail)) + (error + (display-warning + :error + (format "Error evaluating \ +`rmail-output-file-alist' element:\nregexp: %s\naction: %s\nerror: %S\n" + (caar tail) (cdar tail) err)) + nil)))) (setq tail (cdr tail))) answer)))))) ;; If no suggestion, use same file as last time. From e83064befad4b03bae2f873ece63c050f2c4ca22 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Mon, 20 Aug 2012 12:07:38 +0400 Subject: [PATCH 033/212] Inline setter functions for hash table members. * lisp.h (set_hash_key, set_hash_value, set_hash_next) (set_hash_hash, set_hash_index): Rename with _slot suffix. (set_hash_key_and_value, set_hash_index, set_hash_next) (set_hash_hash): New functions. * charset.c, fns.c: Adjust users. --- src/ChangeLog | 9 ++++++++ src/charset.c | 2 +- src/fns.c | 64 +++++++++++++++++++++++++-------------------------- src/lisp.h | 34 +++++++++++++++++++++++---- 4 files changed, 71 insertions(+), 38 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c5ab370d311..cc5b2b2eb77 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2012-08-20 Dmitry Antipov + + Inline setter functions for hash table members. + * lisp.h (set_hash_key, set_hash_value, set_hash_next) + (set_hash_hash, set_hash_index): Rename with _slot suffix. + (set_hash_key_and_value, set_hash_index, set_hash_next) + (set_hash_hash): New functions. + * charset.c, fns.c: Adjust users. + 2012-08-20 Dmitry Antipov Inline getter and setter functions for per-buffer values. diff --git a/src/charset.c b/src/charset.c index 87c16e12008..3e286fa947d 100644 --- a/src/charset.c +++ b/src/charset.c @@ -1131,7 +1131,7 @@ usage: (define-charset-internal ...) */) { new_definition_p = 0; id = XFASTINT (CHARSET_SYMBOL_ID (args[charset_arg_name])); - set_hash_value (hash_table, charset.hash_index, attrs); + set_hash_value_slot (hash_table, charset.hash_index, attrs); } else { diff --git a/src/fns.c b/src/fns.c index 443e98b2f04..79f8e233fb5 100644 --- a/src/fns.c +++ b/src/fns.c @@ -3663,7 +3663,7 @@ make_hash_table (Lisp_Object test, Lisp_Object size, Lisp_Object rehash_size, /* Set up the free list. */ for (i = 0; i < sz - 1; ++i) - set_hash_next (h, i, make_number (i + 1)); + set_hash_next_slot (h, i, make_number (i + 1)); h->next_free = make_number (0); XSET_HASH_TABLE (table, h); @@ -3760,17 +3760,17 @@ maybe_resize_hash_table (struct Lisp_Hash_Table *h) } #endif - h->key_and_value = larger_vector (h->key_and_value, - 2 * (new_size - old_size), -1); - h->next = larger_vector (h->next, new_size - old_size, -1); - h->hash = larger_vector (h->hash, new_size - old_size, -1); - h->index = Fmake_vector (make_number (index_size), Qnil); + set_hash_key_and_value (h, larger_vector (h->key_and_value, + 2 * (new_size - old_size), -1)); + set_hash_next (h, larger_vector (h->next, new_size - old_size, -1)); + set_hash_hash (h, larger_vector (h->hash, new_size - old_size, -1)); + set_hash_index (h, Fmake_vector (make_number (index_size), Qnil)); /* Update the free list. Do it so that new entries are added at the end of the free list. This makes some operations like maphash faster. */ for (i = old_size; i < new_size - 1; ++i) - set_hash_next (h, i, make_number (i + 1)); + set_hash_next_slot (h, i, make_number (i + 1)); if (!NILP (h->next_free)) { @@ -3781,7 +3781,7 @@ maybe_resize_hash_table (struct Lisp_Hash_Table *h) !NILP (next)) last = next; - set_hash_next (h, XFASTINT (last), make_number (old_size)); + set_hash_next_slot (h, XFASTINT (last), make_number (old_size)); } else XSETFASTINT (h->next_free, old_size); @@ -3792,8 +3792,8 @@ maybe_resize_hash_table (struct Lisp_Hash_Table *h) { EMACS_UINT hash_code = XUINT (HASH_HASH (h, i)); ptrdiff_t start_of_bucket = hash_code % ASIZE (h->index); - set_hash_next (h, i, HASH_INDEX (h, start_of_bucket)); - set_hash_index (h, start_of_bucket, make_number (i)); + set_hash_next_slot (h, i, HASH_INDEX (h, start_of_bucket)); + set_hash_index_slot (h, start_of_bucket, make_number (i)); } } } @@ -3852,16 +3852,16 @@ hash_put (struct Lisp_Hash_Table *h, Lisp_Object key, Lisp_Object value, /* Store key/value in the key_and_value vector. */ i = XFASTINT (h->next_free); h->next_free = HASH_NEXT (h, i); - set_hash_key (h, i, key); - set_hash_value (h, i, value); + set_hash_key_slot (h, i, key); + set_hash_value_slot (h, i, value); /* Remember its hash code. */ - set_hash_hash (h, i, make_number (hash)); + set_hash_hash_slot (h, i, make_number (hash)); /* Add new entry to its collision chain. */ start_of_bucket = hash % ASIZE (h->index); - set_hash_next (h, i, HASH_INDEX (h, start_of_bucket)); - set_hash_index (h, start_of_bucket, make_number (i)); + set_hash_next_slot (h, i, HASH_INDEX (h, start_of_bucket)); + set_hash_index_slot (h, start_of_bucket, make_number (i)); return i; } @@ -3892,16 +3892,16 @@ hash_remove_from_table (struct Lisp_Hash_Table *h, Lisp_Object key) { /* Take entry out of collision chain. */ if (NILP (prev)) - set_hash_index (h, start_of_bucket, HASH_NEXT (h, i)); + set_hash_index_slot (h, start_of_bucket, HASH_NEXT (h, i)); else - set_hash_next (h, XFASTINT (prev), HASH_NEXT (h, i)); + set_hash_next_slot (h, XFASTINT (prev), HASH_NEXT (h, i)); /* Clear slots in key_and_value and add the slots to the free list. */ - set_hash_key (h, i, Qnil); - set_hash_value (h, i, Qnil); - set_hash_hash (h, i, Qnil); - set_hash_next (h, i, h->next_free); + set_hash_key_slot (h, i, Qnil); + set_hash_value_slot (h, i, Qnil); + set_hash_hash_slot (h, i, Qnil); + set_hash_next_slot (h, i, h->next_free); h->next_free = make_number (i); h->count--; eassert (h->count >= 0); @@ -3927,10 +3927,10 @@ hash_clear (struct Lisp_Hash_Table *h) for (i = 0; i < size; ++i) { - set_hash_next (h, i, i < size - 1 ? make_number (i + 1) : Qnil); - set_hash_key (h, i, Qnil); - set_hash_value (h, i, Qnil); - set_hash_hash (h, i, Qnil); + set_hash_next_slot (h, i, i < size - 1 ? make_number (i + 1) : Qnil); + set_hash_key_slot (h, i, Qnil); + set_hash_value_slot (h, i, Qnil); + set_hash_hash_slot (h, i, Qnil); } for (i = 0; i < ASIZE (h->index); ++i) @@ -3994,18 +3994,18 @@ sweep_weak_table (struct Lisp_Hash_Table *h, int remove_entries_p) { /* Take out of collision chain. */ if (NILP (prev)) - set_hash_index (h, bucket, next); + set_hash_index_slot (h, bucket, next); else - set_hash_next (h, XFASTINT (prev), next); + set_hash_next_slot (h, XFASTINT (prev), next); /* Add to free list. */ - set_hash_next (h, i, h->next_free); + set_hash_next_slot (h, i, h->next_free); h->next_free = idx; /* Clear key, value, and hash. */ - set_hash_key (h, i, Qnil); - set_hash_value (h, i, Qnil); - set_hash_hash (h, i, Qnil); + set_hash_key_slot (h, i, Qnil); + set_hash_value_slot (h, i, Qnil); + set_hash_hash_slot (h, i, Qnil); h->count--; } @@ -4512,7 +4512,7 @@ VALUE. In any case, return VALUE. */) i = hash_lookup (h, key, &hash); if (i >= 0) - set_hash_value (h, i, value); + set_hash_value_slot (h, i, value); else hash_put (h, key, value, hash); diff --git a/src/lisp.h b/src/lisp.h index f08e7af8959..3a6eb72d020 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2345,31 +2345,55 @@ gc_aset (Lisp_Object array, ptrdiff_t idx, Lisp_Object val) } LISP_INLINE void -set_hash_key (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) +set_hash_key_and_value (struct Lisp_Hash_Table *h, Lisp_Object key_and_value) +{ + h->key_and_value = key_and_value; +} + +LISP_INLINE void +set_hash_key_slot (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) { gc_aset (h->key_and_value, 2 * idx, val); } LISP_INLINE void -set_hash_value (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) +set_hash_value_slot (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) { gc_aset (h->key_and_value, 2 * idx + 1, val); } LISP_INLINE void -set_hash_next (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) +set_hash_next (struct Lisp_Hash_Table *h, Lisp_Object next) +{ + h->next = next; +} + +LISP_INLINE void +set_hash_next_slot (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) { gc_aset (h->next, idx, val); } LISP_INLINE void -set_hash_hash (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) +set_hash_hash (struct Lisp_Hash_Table *h, Lisp_Object hash) +{ + h->hash = hash; +} + +LISP_INLINE void +set_hash_hash_slot (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) { gc_aset (h->hash, idx, val); } LISP_INLINE void -set_hash_index (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) +set_hash_index (struct Lisp_Hash_Table *h, Lisp_Object index) +{ + h->index = index; +} + +LISP_INLINE void +set_hash_index_slot (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) { gc_aset (h->index, idx, val); } From f1a959923a6ead8f3a3e0590c16fa3114d91dc27 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Mon, 20 Aug 2012 12:20:25 +0400 Subject: [PATCH 034/212] Use AREF and ASET for docstrings of category tables. * category.h (CATEGORY_DOCSTRING): Use AREF. (SET_CATEGORY_DOCSTRING): Use ASET. * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING. --- src/ChangeLog | 7 +++++++ src/category.c | 2 +- src/category.h | 8 ++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index cc5b2b2eb77..58fa0de36b2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2012-08-20 Dmitry Antipov + + Use AREF and ASET for docstrings of category tables. + * category.h (CATEGORY_DOCSTRING): Use AREF. + (SET_CATEGORY_DOCSTRING): Use ASET. + * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING. + 2012-08-20 Dmitry Antipov Inline setter functions for hash table members. diff --git a/src/category.c b/src/category.c index a9bbf596abc..1c9085fd558 100644 --- a/src/category.c +++ b/src/category.c @@ -143,7 +143,7 @@ the current buffer's category table. */) error ("Category `%c' is already defined", (int) XFASTINT (category)); if (!NILP (Vpurify_flag)) docstring = Fpurecopy (docstring); - CATEGORY_DOCSTRING (table, XFASTINT (category)) = docstring; + SET_CATEGORY_DOCSTRING (table, XFASTINT (category), docstring); return Qnil; } diff --git a/src/category.h b/src/category.h index f29034acff1..9fb981ed383 100644 --- a/src/category.h +++ b/src/category.h @@ -96,8 +96,12 @@ CHAR_HAS_CATEGORY (int ch, int category) #define Vstandard_category_table BVAR (&buffer_defaults, category_table) /* Return the doc string of CATEGORY in category table TABLE. */ -#define CATEGORY_DOCSTRING(table, category) \ - XVECTOR (Fchar_table_extra_slot (table, make_number (0)))->contents[(category) - ' '] +#define CATEGORY_DOCSTRING(table, category) \ + AREF (Fchar_table_extra_slot (table, make_number (0)), ((category) - ' ')) + +/* Set the doc string of CATEGORY to VALUE in category table TABLE. */ +#define SET_CATEGORY_DOCSTRING(table, category, value) \ + ASET (Fchar_table_extra_slot (table, make_number (0)), ((category) - ' '), value) /* Return the version number of category table TABLE. Not used for the moment. */ From 734fbd863cc9e3475294f800e62283ea09e6c3ba Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Mon, 20 Aug 2012 11:28:39 +0200 Subject: [PATCH 035/212] In select_window always make selected window's buffer current. * window.c (select_window): Always make selected window's buffer current. --- src/ChangeLog | 5 +++++ src/window.c | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 58fa0de36b2..c6a45756ec5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-08-20 Martin Rudalics + + * window.c (select_window): Always make selected window's buffer + current. + 2012-08-20 Dmitry Antipov Use AREF and ASET for docstrings of category tables. diff --git a/src/window.c b/src/window.c index b379eecabdd..9045721009d 100644 --- a/src/window.c +++ b/src/window.c @@ -477,6 +477,9 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap) record_buffer (w->buffer); } + /* Make the selected window's buffer current. */ + Fset_buffer (w->buffer); + if (EQ (window, selected_window) && !inhibit_point_swap) return window; @@ -496,9 +499,9 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap) else fset_selected_window (sf, window); - /* Store the current buffer's actual point into the - old selected window. It belongs to that window, - and when the window is not selected, must be in the window. */ + /* Store the old selected window's buffer's point in pointm of the old + selected window. It belongs to that window, and when the window is + not selected, must be in the window. */ if (!inhibit_point_swap) { ow = XWINDOW (selected_window); @@ -509,9 +512,6 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap) } selected_window = window; - - Fset_buffer (w->buffer); - bset_last_selected_window (XBUFFER (w->buffer), window); /* Go to the point recorded in the window. From e46f2325850b4588ee27efbf37c1dc5bf67af00d Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Mon, 20 Aug 2012 13:39:57 +0400 Subject: [PATCH 036/212] Inline setter functions for Lisp_Objects slots of struct specbinding. * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions. Adjust users. --- src/ChangeLog | 6 ++++++ src/eval.c | 30 ++++++++++++++++++++++-------- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c6a45756ec5..1e25015da20 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-08-20 Dmitry Antipov + + Inline setter functions for Lisp_Objects slots of struct specbinding. + * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions. + Adjust users. + 2012-08-20 Martin Rudalics * window.c (select_window): Always make selected window's buffer diff --git a/src/eval.c b/src/eval.c index 771cd7b160a..c41e3f54d4d 100644 --- a/src/eval.c +++ b/src/eval.c @@ -133,7 +133,21 @@ Lisp_Object inhibit_lisp_code; static Lisp_Object funcall_lambda (Lisp_Object, ptrdiff_t, Lisp_Object *); static int interactive_p (int); static Lisp_Object apply_lambda (Lisp_Object fun, Lisp_Object args); - + +/* Functions to set Lisp_Object slots of struct specbinding. */ + +static inline void +set_specpdl_symbol (Lisp_Object symbol) +{ + specpdl_ptr->symbol = symbol; +} + +static inline void +set_specpdl_old_value (Lisp_Object oldval) +{ + specpdl_ptr->old_value = oldval; +} + void init_eval_once (void) { @@ -3136,8 +3150,8 @@ specbind (Lisp_Object symbol, Lisp_Object value) case SYMBOL_PLAINVAL: /* The most common case is that of a non-constant symbol with a trivial value. Make that as fast as we can. */ - specpdl_ptr->symbol = symbol; - specpdl_ptr->old_value = SYMBOL_VAL (sym); + set_specpdl_symbol (symbol); + set_specpdl_old_value (SYMBOL_VAL (sym)); specpdl_ptr->func = NULL; ++specpdl_ptr; if (!sym->constant) @@ -3152,7 +3166,7 @@ specbind (Lisp_Object symbol, Lisp_Object value) { Lisp_Object ovalue = find_symbol_value (symbol); specpdl_ptr->func = 0; - specpdl_ptr->old_value = ovalue; + set_specpdl_old_value (ovalue); eassert (sym->redirect != SYMBOL_LOCALIZED || (EQ (SYMBOL_BLV (sym)->where, @@ -3186,7 +3200,7 @@ specbind (Lisp_Object symbol, Lisp_Object value) let_shadows_buffer_binding_p which is itself only used in set_internal for local_if_set. */ eassert (NILP (where) || EQ (where, cur_buf)); - specpdl_ptr->symbol = Fcons (symbol, Fcons (where, cur_buf)); + set_specpdl_symbol (Fcons (symbol, Fcons (where, cur_buf))); /* If SYMBOL is a per-buffer variable which doesn't have a buffer-local value here, make the `let' change the global @@ -3203,7 +3217,7 @@ specbind (Lisp_Object symbol, Lisp_Object value) } } else - specpdl_ptr->symbol = symbol; + set_specpdl_symbol (symbol); specpdl_ptr++; set_internal (symbol, value, Qnil, 1); @@ -3221,8 +3235,8 @@ record_unwind_protect (Lisp_Object (*function) (Lisp_Object), Lisp_Object arg) if (specpdl_ptr == specpdl + specpdl_size) grow_specpdl (); specpdl_ptr->func = function; - specpdl_ptr->symbol = Qnil; - specpdl_ptr->old_value = arg; + set_specpdl_symbol (Qnil); + set_specpdl_old_value (arg); specpdl_ptr++; } From a6342fc83511b1c4bff8e7f1dce42e8c7edb70b0 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 20 Aug 2012 06:17:51 -0400 Subject: [PATCH 037/212] Auto-commit of generated files. --- autogen/Makefile.in | 2 +- autogen/configure | 89 ++++++++++++++++++++------------------------- 2 files changed, 41 insertions(+), 50 deletions(-) diff --git a/autogen/Makefile.in b/autogen/Makefile.in index 49dad9ea96d..16af943f331 100644 --- a/autogen/Makefile.in +++ b/autogen/Makefile.in @@ -36,7 +36,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ diff --git a/autogen/configure b/autogen/configure index 961d1acbd38..7efbd25f0d6 100755 --- a/autogen/configure +++ b/autogen/configure @@ -17317,9 +17317,7 @@ cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETENV $ac_have_decl _ACEOF - - - +: @@ -20051,7 +20049,7 @@ $as_echo "$gl_cv_func_dup2_works" >&6; } fi -if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then + if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then @@ -20063,7 +20061,7 @@ if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext" -fi + fi @@ -20487,7 +20485,7 @@ else fi -if test $HAVE_GETLOADAVG = 0; then + if test $HAVE_GETLOADAVG = 0; then @@ -20615,7 +20613,7 @@ fi done -fi + fi @@ -20632,7 +20630,7 @@ fi -if test $REPLACE_GETOPT = 1; then + if test $REPLACE_GETOPT = 1; then @@ -20656,8 +20654,8 @@ if test $REPLACE_GETOPT = 1; then - GNULIB_GL_UNISTD_H_GETOPT=1 -fi + GNULIB_GL_UNISTD_H_GETOPT=1 + fi @@ -20680,7 +20678,7 @@ $as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h fi -if test $REPLACE_GETOPT = 1; then + if test $REPLACE_GETOPT = 1; then @@ -20704,8 +20702,8 @@ if test $REPLACE_GETOPT = 1; then - GNULIB_GL_UNISTD_H_GETOPT=1 -fi + GNULIB_GL_UNISTD_H_GETOPT=1 + fi @@ -20865,7 +20863,7 @@ cat >>confdefs.h <<_ACEOF _ACEOF -if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then + if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then @@ -20901,7 +20899,7 @@ fi done -fi + fi @@ -20918,7 +20916,6 @@ fi - if test $ac_cv_func_lstat = yes; then case "$gl_cv_func_lstat_dereferences_slashed_symlink" in @@ -20930,7 +20927,7 @@ fi HAVE_LSTAT=0 fi -if test $REPLACE_LSTAT = 1; then + if test $REPLACE_LSTAT = 1; then @@ -20945,7 +20942,7 @@ if test $REPLACE_LSTAT = 1; then : -fi + fi @@ -21194,7 +21191,7 @@ $as_echo "$gl_cv_func_working_mktime" >&6; } REPLACE_MKTIME=0 fi -if test $REPLACE_MKTIME = 1; then + if test $REPLACE_MKTIME = 1; then @@ -21205,10 +21202,8 @@ if test $REPLACE_MKTIME = 1; then gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext" - - - -fi + : + fi @@ -21263,7 +21258,7 @@ $as_echo "$gl_cv_sig_pselect" >&6; } REPLACE_PSELECT=1 fi -if test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1; then + if test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1; then @@ -21274,7 +21269,7 @@ if test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1; then gl_LIBOBJS="$gl_LIBOBJS pselect.$ac_objext" -fi + fi @@ -21492,7 +21487,7 @@ $as_echo "#define PTHREAD_SIGMASK_UNBLOCK_BUG 1" >>confdefs.h esac fi -if test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1; then + if test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1; then @@ -21510,7 +21505,7 @@ $as_echo "#define HAVE_PTHREAD_SIGMASK 1" >>confdefs.h fi -fi + fi @@ -21613,7 +21608,7 @@ $as_echo "#define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h esac fi -if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then + if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then @@ -21627,7 +21622,7 @@ if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then : -fi + fi @@ -21741,7 +21736,7 @@ fi - ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" " + ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" " /* is not needed according to POSIX, but the in i386-unknown-freebsd4.10 and powerpc-apple-darwin5.5 required it. */ @@ -21841,7 +21836,6 @@ $as_echo "#define ssize_t int" >>confdefs.h - ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "#include #include " @@ -21937,7 +21931,6 @@ fi - ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimespec.tv_nsec" "ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" "#include #include " @@ -22648,7 +22641,7 @@ $as_echo "$gl_cv_func_strtoimax" >&6; } HAVE_STRTOIMAX=0 fi -if test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then + if test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then @@ -22673,7 +22666,7 @@ _ACEOF -fi + fi @@ -22693,7 +22686,7 @@ fi HAVE_DECL_STRTOUMAX=0 fi -if test $ac_cv_func_strtoumax = no; then + if test $ac_cv_func_strtoumax = no; then @@ -22718,7 +22711,7 @@ _ACEOF -fi + fi @@ -22790,7 +22783,7 @@ $as_echo "$gl_cv_func_symlink_works" >&6; } esac fi -if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then + if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then @@ -22801,7 +22794,7 @@ if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then gl_LIBOBJS="$gl_LIBOBJS symlink.$ac_objext" -fi + fi @@ -23192,7 +23185,7 @@ $as_echo "$gl_cv_time_r_posix" >&6; } HAVE_LOCALTIME_R=0 fi -if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then + if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then @@ -23206,7 +23199,7 @@ if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then : -fi + fi @@ -23218,9 +23211,7 @@ fi - - - + : @@ -23512,7 +23503,7 @@ $as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h ;; esac -if test $REPLACE_STAT = 1; then + if test $REPLACE_STAT = 1; then @@ -23527,7 +23518,7 @@ if test $REPLACE_STAT = 1; then : -fi + fi @@ -23574,7 +23565,7 @@ done fi fi -if test $HAVE_STRTOLL = 0; then + if test $HAVE_STRTOLL = 0; then @@ -23588,7 +23579,7 @@ if test $HAVE_STRTOLL = 0; then : -fi + fi @@ -23626,7 +23617,7 @@ done fi fi -if test $HAVE_STRTOULL = 0; then + if test $HAVE_STRTOULL = 0; then @@ -23640,7 +23631,7 @@ if test $HAVE_STRTOULL = 0; then : -fi + fi From a05731a0cc2553af0469bd9b7d6ac10cd2e6a817 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 20 Aug 2012 19:12:16 +0800 Subject: [PATCH 038/212] Make C-u C-x = report on empty overlays at point. * lisp/descr-text.el (describe-text-properties-1): Use overlays-in to report on empty overlays. Fixes: debbugs:3322 --- lisp/ChangeLog | 5 +++++ lisp/descr-text.el | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 97bad569955..d748214959d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-20 Chong Yidong + + * descr-text.el (describe-text-properties-1): Use overlays-in to + report on empty overlays (Bug#3322). + 2012-08-20 Glenn Morris * mail/rmailout.el (rmail-output-read-file-name): diff --git a/lisp/descr-text.el b/lisp/descr-text.el index 34d61b80d66..0c7f82d516e 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el @@ -140,7 +140,7 @@ otherwise." (defun describe-text-properties-1 (pos output-buffer) (let* ((properties (text-properties-at pos)) - (overlays (overlays-at pos)) + (overlays (overlays-in pos (1+ pos))) (wid-field (get-char-property pos 'field)) (wid-button (get-char-property pos 'button)) (wid-doc (get-char-property pos 'widget-doc)) From a32fbbcf262a71891032ef84f596bf5525f9124a Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 20 Aug 2012 16:06:06 +0200 Subject: [PATCH 039/212] * net/tramp.el (tramp-accept-process-output): Accept only output from PROC. Otherwise, process filters and sentinels might be confused. (Bug#12145) --- lisp/ChangeLog | 6 ++++++ lisp/net/tramp.el | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d748214959d..f16d8c36344 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-08-20 Michael Albinus + + * net/tramp.el (tramp-accept-process-output): Accept only output + from PROC. Otherwise, process filters and sentinels might be + confused. (Bug#12145) + 2012-08-20 Chong Yidong * descr-text.el (describe-text-properties-1): Use overlays-in to diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 848599104c5..a17bbfa0d14 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3293,7 +3293,7 @@ for process communication also." ;; Under Windows XP, accept-process-output doesn't return ;; sometimes. So we add an additional timeout. (with-timeout ((or timeout 1)) - (accept-process-output proc timeout timeout-msecs))) + (accept-process-output proc timeout timeout-msecs (and proc t)))) (tramp-message proc 10 "\n%s" (buffer-string)))) (defun tramp-check-for-regexp (proc regexp) From 0c53f13cb5e48f308ba68fb09cf7b2fec73869bb Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 20 Aug 2012 22:13:16 +0800 Subject: [PATCH 040/212] Fix comment in log-edit.el. --- lisp/vc/log-edit.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el index 4ef2732382e..a84f49884ca 100644 --- a/lisp/vc/log-edit.el +++ b/lisp/vc/log-edit.el @@ -360,10 +360,10 @@ automatically." 'log-edit-header) nil lax))))) -;; Used in Emacs 24.3+, and in Emacs's .dir-locals.el file. -;; This is a convenience setting so that people committing files -;; to Emacs trunk with Emacs 24point2 do not always get queried -;; about this variable being potentially unsafe. +;; Used in Emacs 24.3+, and in Emacs's .dir-locals.el file. This is a +;; convenience setting so that people committing files to Emacs trunk +;; with Emacs 24.2 do not always get queried about this variable being +;; potentially unsafe. (put 'log-edit-font-lock-gnu-style 'safe-local-variable 'booleanp) ;;;###autoload From d30aca1b7a03b76bb055e1895b96a18a6fbff404 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Mon, 20 Aug 2012 11:26:46 -0400 Subject: [PATCH 041/212] * lisp/progmodes/hideshow.el (hs-block-end-regexp): Restore lost buffer local setting. --- lisp/ChangeLog | 5 +++++ lisp/progmodes/hideshow.el | 2 ++ 2 files changed, 7 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d205e36a749..d37b054e9d0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-20 Dan Nicolaescu + + * progmodes/hideshow.el (hs-block-end-regexp): Restore lost + buffer local setting. + 2012-08-15 Chong Yidong * Version 24.2 released. diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index 26db60ddbc2..8463648e679 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el @@ -408,6 +408,8 @@ element (using `match-beginning') before calling `hs-forward-sexp-func'.") (defvar hs-block-end-regexp nil "Regexp for end of block.") +(make-variable-buffer-local 'hs-block-end-regexp) + (defvar hs-forward-sexp-func 'forward-sexp "Function used to do a `forward-sexp'. From 487a247f1d48faac2aa789baddd5ee5d7fa28d4a Mon Sep 17 00:00:00 2001 From: Josh Feinstein Date: Mon, 20 Aug 2012 09:08:51 -0700 Subject: [PATCH 042/212] Hide specified message types sent by lurkers * erc.el (erc-display-message): Abstract message hiding decision to new function erc-hide-current-message-p. (erc-lurker): New customization group. (erc-lurker-state, erc-lurker-trim-nicks, erc-lurker-ignore-chars) (erc-lurker-hide-list, erc-lurker-cleanup-interval) (erc-lurker-threshold-time): New variables. (erc-lurker-maybe-trim, erc-lurker-initialize, erc-lurker-cleanup) (erc-hide-current-message-p, erc-canonicalize-server-name) (erc-lurker-update-status, erc-lurker-p): New functions. Together they maintain state about which users have spoken in the last erc-lurker-threshold-time, with all other users being considered lurkers whose messages of types in erc-lurker-hide-list will not be displayed by erc-display-message. --- lisp/erc/ChangeLog | 16 +++++ lisp/erc/erc.el | 174 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 189 insertions(+), 1 deletion(-) diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index b87cfd41f61..dd62cae7de1 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,19 @@ +2012-08-20 Josh Feinstein + + * erc.el (erc-display-message): Abstract message hiding decision + to new function erc-hide-current-message-p. + (erc-lurker): New customization group. + (erc-lurker-state, erc-lurker-trim-nicks, erc-lurker-ignore-chars) + (erc-lurker-hide-list, erc-lurker-cleanup-interval) + (erc-lurker-threshold-time): New variables. + (erc-lurker-maybe-trim, erc-lurker-initialize, erc-lurker-cleanup) + (erc-hide-current-message-p, erc-canonicalize-server-name) + (erc-lurker-update-status, erc-lurker-p): New functions. Together + they maintain state about which users have spoken in the last + erc-lurker-threshold-time, with all other users being considered + lurkers whose messages of types in erc-lurker-hide-list will not + be displayed by erc-display-message. + 2012-08-06 Julien Danjou * erc-match.el (erc-match-exclude-server-buffer) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 0fc308621b1..feef75940f3 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -100,6 +100,10 @@ "Ignoring certain messages" :group 'erc) +(defgroup erc-lurker nil + "Hide specified message types sent by lurkers" + :group 'erc-ignore) + (defgroup erc-query nil "Using separate buffers for private discussions" :group 'erc) @@ -2455,6 +2459,174 @@ See also `erc-make-notice'." string) string))) +(defvar erc-lurker-state nil + "Track the time of the last PRIVMSG for each (server,nick) pair. + +This is implemented as a hash of hashes, where the outer key is +the canonicalized server name (as returned by +`erc-canonicalize-server-name') and the outer value is a hash +table mapping nicks (as returned by `erc-lurker-maybe-trim') to +the times of their most recently received PRIVMSG on any channel +on the given server.") + +(defcustom erc-lurker-trim-nicks t + "If t, trim trailing `erc-lurker-ignore-chars' from nicks. + +This causes e.g. nick and nick` to be considered as the same +individual for activity tracking and lurkiness detection +purposes." + :group 'erc-lurker + :type 'boolean) + +(defun erc-lurker-maybe-trim (nick) + "Maybe trim trailing `erc-lurker-ignore-chars' from NICK. + +Returns NICK unmodified unless `erc-lurker-trim-nicks' is +non-nil." + (if erc-lurker-trim-nicks + (replace-regexp-in-string + (format "[%s]" + (mapconcat (lambda (char) + (regexp-quote (char-to-string char))) + erc-lurker-ignore-chars "")) + "" nick) + nick)) + +(defcustom erc-lurker-ignore-chars "`_" + "Characters at the end of a nick to strip for activity tracking purposes. + +See also `erc-lurker-trim-nicks'." + :group 'erc-lurker + :type 'string) + +(defcustom erc-lurker-hide-list nil + "List of IRC type messages to hide when sent by lurkers. + +A typical value would be '(\"JOIN\" \"PART\" \"QUIT\"). +See also `erc-lurker-p' and `erc-hide-list'." + :group 'erc-lurker + :type 'erc-message-type) + +(defcustom erc-lurker-threshold-time (* 60 60 24) ; 24h by default + "Nicks from which no PRIVMSGs have been received within this +interval (in units of seconds) are considered lurkers by +`erc-lurker-p' and as a result their messages of types in +`erc-lurker-hide-list' will be hidden." + :group 'erc-lurker + :type 'integer) + +(defun erc-lurker-initialize () + "Initialize ERC lurker tracking functionality. + +This function adds `erc-lurker-update-status' to +`erc-insert-pre-hook' in order to record the time of each nick's +most recent PRIVMSG as well as initializing the state variable +storing this information." + (setq erc-lurker-state (make-hash-table :test 'equal)) + (add-hook 'erc-insert-pre-hook 'erc-lurker-update-status)) + +(defun erc-lurker-cleanup () + "Remove all last PRIVMSG state older than `erc-lurker-threshold-time'. + +This should be called regularly to avoid excessive resource +consumption for long-lived IRC or Emacs sessions." + (maphash + (lambda (server hash) + (maphash + (lambda (nick last-PRIVMSG-time) + (when + (> (time-to-seconds (time-subtract + (current-time) + last-PRIVMSG-time)) + erc-lurker-threshold-time) + (remhash nick hash))) + hash) + (if (zerop (hash-table-count hash)) + (remhash server erc-lurker-state))) + erc-lurker-state)) + +(defvar erc-lurker-cleanup-count 0 + "Internal counter variable for use with `erc-lurker-cleanup-interval'.") + +(defvar erc-lurker-cleanup-interval 100 + "Specifies frequency of cleaning up stale erc-lurker state. + +`erc-lurker-update-status' calls `erc-lurker-cleanup' once for +every `erc-lurker-cleanup-interval' updates to +`erc-lurker-state'. This is designed to limit the memory +consumption of lurker state during long Emacs sessions and/or ERC +sessions with large numbers of incoming PRIVMSGs.") + +(defun erc-lurker-update-status (message) + "Update `erc-lurker-state' if necessary. + +This function is called from `erc-insert-pre-hook'. If the +current message is a PRIVMSG, update `erc-lurker-state' to +reflect the fact that its sender has issued a PRIVMSG at the +current time. Otherwise, take no action. + +This function depends on the fact that `erc-display-message' +dynamically binds `parsed', which is used to check if the current +message is a PRIVMSG and to determine its sender. See also +`erc-lurker-trim-nicks' and `erc-lurker-ignore-chars'. + +In order to limit memory consumption, this function also calls +`erc-lurker-cleanup' once every `erc-lurker-cleanup-interval' +updates of `erc-lurker-state'." + (when (and (boundp 'parsed) (erc-response-p parsed)) + (let* ((command (erc-response.command parsed)) + (sender + (erc-lurker-maybe-trim + (car (erc-parse-user (erc-response.sender parsed))))) + (server + (erc-canonicalize-server-name erc-server-announced-name))) + (when (equal command "PRIVMSG") + (when (>= (incf erc-lurker-cleanup-count) erc-lurker-cleanup-interval) + (setq erc-lurker-cleanup-count 0) + (erc-lurker-cleanup)) + (unless (gethash server erc-lurker-state) + (puthash server (make-hash-table :test 'equal) erc-lurker-state)) + (puthash sender (current-time) + (gethash server erc-lurker-state)))))) + +(defun erc-lurker-p (nick) + "Predicate indicating NICK's lurking status on the current server. + +Lurking is the condition where NICK has issued no PRIVMSG on this +server within `erc-lurker-threshold-time'. See also +`erc-lurker-trim-nicks' and `erc-lurker-ignore-chars'." + (unless erc-lurker-state (erc-lurker-initialize)) + (let* ((server + (erc-canonicalize-server-name erc-server-announced-name)) + (last-PRIVMSG-time + (gethash (erc-lurker-maybe-trim nick) + (gethash server erc-lurker-state (make-hash-table))))) + (or (null last-PRIVMSG-time) + (> (time-to-seconds + (time-subtract (current-time) last-PRIVMSG-time)) + erc-lurker-threshold-time)))) + +(defun erc-canonicalize-server-name (server) + "Returns the canonical network name for SERVER if any, +otherwise `erc-server-announced-name'. SERVER is matched against +`erc-common-server-suffixes'." + (when server + (or (cdar (erc-remove-if-not + (lambda (net) (string-match (car net) server)) + erc-common-server-suffixes)) + erc-server-announced-name))) + +(defun erc-hide-current-message-p (parsed) + "Predicate indicating whether the parsed ERC response PARSED should be hidden. + +Messages are always hidden if the message type of PARSED appears in +`erc-hide-list'. In addition, messages whose type is a member of +`erc-lurker-hide-list' are hidden if `erc-lurker-p' returns true." + (let* ((command (erc-response.command parsed)) + (sender (car (erc-parse-user (erc-response.sender parsed))))) + (or (member command erc-hide-list) + (and (member command erc-lurker-hide-list) (erc-lurker-p sender))))) + (defun erc-display-message (parsed type buffer msg &rest args) "Display MSG in BUFFER. @@ -2479,7 +2651,7 @@ See also `erc-format-message' and `erc-display-line'." (if (not (erc-response-p parsed)) (erc-display-line string buffer) - (unless (member (erc-response.command parsed) erc-hide-list) + (unless (erc-hide-current-message-p parsed) (erc-put-text-property 0 (length string) 'erc-parsed parsed string) (erc-put-text-property 0 (length string) 'rear-sticky t string) (erc-display-line string buffer))))) From 72279493cc35c01b488884687fcbe0a0d12beaa5 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 20 Aug 2012 19:48:10 +0300 Subject: [PATCH 043/212] Improve MS-Windows related commentary and log entry for 2012-08-19T21:00:09Z!eggert@cs.ucla.edu. --- src/ChangeLog | 2 ++ src/conf_post.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 1e25015da20..bdfb4e3fcb1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -42,6 +42,8 @@ Rely on + to declare 'environ', as gnulib does this if the system doesn't. * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]: + Remove declaration. MS-Windows declares it on stdlib.h which is + included by conf_post.h. * emacs.c (environ) [DOUG_LEA_MALLOC]: * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl. * vm-limit.c: Include , for 'environ'. diff --git a/src/conf_post.h b/src/conf_post.h index ead7298e98d..f90ef90fb83 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -178,6 +178,9 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */ #endif #include +/* If you think about removing the line below, note that the + MS-Windows build relies on it for declaration of 'environ' needed + by a few source files. */ #include #if __GNUC__ >= 3 /* On GCC 3.0 we might get a warning. */ From 0a05a035f680b0fcd50b5e5201e056ead479511d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 20 Aug 2012 20:32:31 +0300 Subject: [PATCH 044/212] Avoid GDB 7.5 warnings about "set main" in src/.gdbinit. src/.gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5 and later about non-assignments with no effect. See discussion at http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for details. --- src/.gdbinit | 4 ++-- src/ChangeLog | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/.gdbinit b/src/.gdbinit index b703842f4cf..de980c6345f 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -18,9 +18,9 @@ # Boston, MA 02110-1301, USA. # Force loading of symbols, enough to give us VALBITS etc. -set main +set $dummy = main + 8 # With some compilers, we need this to give us struct Lisp_Symbol etc.: -set Fmake_symbol +set $dummy = Fmake_symbol + 8 # Find lwlib source files too. dir ../lwlib diff --git a/src/ChangeLog b/src/ChangeLog index bdfb4e3fcb1..bc18c0eafee 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2012-08-20 Eli Zaretskii + + * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5 + and later about non-assignments with no effect. See discussion at + http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for + details. + 2012-08-20 Dmitry Antipov Inline setter functions for Lisp_Objects slots of struct specbinding. From 327576483cd198b11b39bb88a42d0495f5724684 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 20 Aug 2012 14:13:03 -0400 Subject: [PATCH 045/212] Use display-warning in a few places in calendar * lisp/calendar/diary-lib.el (diary-include-files, diary-sexp-entry): * lisp/calendar/holidays.el (calendar-holiday-list): Report errors with display-warning rather than beep'n'sleep. --- lisp/ChangeLog | 6 ++++++ lisp/calendar/diary-lib.el | 31 +++++++++++++++++-------------- lisp/calendar/holidays.el | 13 ++++++++----- 3 files changed, 31 insertions(+), 19 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f16d8c36344..a1464b52e6c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-08-20 Glenn Morris + + * calendar/diary-lib.el (diary-include-files, diary-sexp-entry): + * calendar/holidays.el (calendar-holiday-list): + Report errors with display-warning rather than beep'n'sleep. + 2012-08-20 Michael Albinus * net/tramp.el (tramp-accept-process-output): Accept only output diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 2e073fd1267..8fa5b0ddb07 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -951,12 +951,12 @@ This is recursive; that is, included files may include other files." (setq diary-entries-list (append diary-entries-list (diary-list-entries original-date number t))))) - (beep) - (message "Can't read included diary file %s" diary-file) - (sleep-for 2)) - (beep) - (message "Can't find included diary file %s" diary-file) - (sleep-for 2)))) + (display-warning + :error + (format "Can't read included diary file %s\n" diary-file))) + (display-warning + :error + (format "Can't find included diary file %s\n" diary-file))))) (goto-char (point-min))) (defun diary-include-other-diary-files () @@ -1456,14 +1456,17 @@ marks. This is intended to deal with deleted diary entries." (let ((result (if calendar-debug-sexp (let ((debug-on-error t)) (eval (car (read-from-string sexp)))) - (condition-case nil - (eval (car (read-from-string sexp))) - (error - (beep) - (message "Bad sexp at line %d in %s: %s" - (count-lines (point-min) (point)) - diary-file sexp) - (sleep-for 2)))))) + (let (err) + (condition-case err + (eval (car (read-from-string sexp))) + (error + (display-warning + :error + (format "Bad diary sexp at line %d in %s:\n%s\n\ +Error: %s\n" + (count-lines (point-min) (point)) + diary-file sexp err)) + nil)))))) (cond ((stringp result) result) ((and (consp result) (stringp (cdr result))) result) diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el index 0bb3c231840..043d402f612 100644 --- a/lisp/calendar/holidays.el +++ b/lisp/calendar/holidays.el @@ -458,17 +458,20 @@ with descriptive strings such as (defun calendar-holiday-list () "Form the list of holidays that occur on dates in the calendar window. The holidays are those in the list `calendar-holidays'." - (let (res h) + (let (res h err) (sort (dolist (p calendar-holidays res) (if (setq h (if calendar-debug-sexp (let ((debug-on-error t)) (eval p)) - (condition-case nil + (condition-case err (eval p) - (error (beep) - (message "Bad holiday list item: %s" p) - (sleep-for 2))))) + (error + (display-warning + :error + (format "Bad holiday list item: %s\nError: %s\n" + p err)) + nil)))) (setq res (append h res)))) 'calendar-date-compare))) From 9aa0092cdd378dd8f7a55896c31bb68d2be18b1c Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 20 Aug 2012 18:12:35 -0400 Subject: [PATCH 046/212] Use symlink in installed bin/ directory, where supported * configure.ac (AC_PROG_LN_S): Test for ln. * Makefile.in (LN_S): New, set by configure. (install-arch-dep): Use $LN_S. --- ChangeLog | 6 ++++++ Makefile.in | 3 ++- configure.ac | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4a531145e20..16afbdd3c99 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-08-20 Glenn Morris + + * configure.ac (AC_PROG_LN_S): Test for ln. + * Makefile.in (LN_S): New, set by configure. + (install-arch-dep): Use $LN_S. + 2012-08-19 Paul Eggert Merge from gnulib, incorporating: diff --git a/Makefile.in b/Makefile.in index ab9f16c0353..bf4c4b853a0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -246,6 +246,7 @@ INSTALL_INFO = @INSTALL_INFO@ # By default, we uphold the dignity of our programs. INSTALL_STRIP = MKDIR_P = @MKDIR_P@ +LN_S = @LN_S@ # We use gzip to compress installed .el files. GZIP_PROG = @GZIP_PROG@ @@ -437,7 +438,7 @@ install-arch-dep: install-arch-indep install-doc ${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs${EXEEXT} $(DESTDIR)${bindir}/$(EMACSFULL) || exit 1 ; \ chmod 1755 $(DESTDIR)${bindir}/$(EMACSFULL) ; \ rm -f $(DESTDIR)${bindir}/$(EMACS) ; \ - ln $(DESTDIR)${bindir}/$(EMACSFULL) $(DESTDIR)${bindir}/$(EMACS) || true ; \ + cd $(DESTDIR)${bindir} && $(LN_S) $(EMACSFULL) $(EMACS); \ else \ subdir=${ns_appresdir}/site-lisp; \ ${write_subdir} || exit 1; \ diff --git a/configure.ac b/configure.ac index 2394790c455..b10cb24bab6 100644 --- a/configure.ac +++ b/configure.ac @@ -731,6 +731,7 @@ dnl AC_PROG_MKDIR_P dnl if test "x$RANLIB" = x; then dnl AC_PROG_RANLIB dnl fi +AC_PROG_LN_S AC_PATH_PROG(INSTALL_INFO, install-info, :, $PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin) From 24564fe1aab428c41e053b9c0848d9e7a8f2cb69 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 20 Aug 2012 19:57:35 -0400 Subject: [PATCH 047/212] * src/Makefile.in: Don't assume that `ln -f' works. Presumably it does work fine on all platforms currently building Emacs, but the autoconf manual says not to rely on it. --- src/ChangeLog | 5 +++++ src/Makefile.in | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index bc18c0eafee..22383088763 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-08-20 Glenn Morris + + * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)): + Don't assume that `ln -f' works. + 2012-08-20 Eli Zaretskii * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5 diff --git a/src/Makefile.in b/src/Makefile.in index 4b1520ada62..1d89af31401 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -402,11 +402,13 @@ $(leimdir)/leim-list.el: bootstrap-emacs$(EXEEXT) ## on all of $lisp, and emacs depends on DOC, so it is ok to use $lisp here. emacs$(EXEEXT): temacs$(EXEEXT) $(etc)/DOC $(lisp) $(leimdir)/leim-list.el if test "$(CANNOT_DUMP)" = "yes"; then \ - ln -f temacs$(EXEEXT) emacs$(EXEEXT); \ + rm -f emacs$(EXEEXT); \ + ln temacs$(EXEEXT) emacs$(EXEEXT); \ else \ LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump || exit 1; \ test "X$(PAXCTL)" = X || $(PAXCTL) -zex emacs$(EXEEXT); \ - ln -f emacs$(EXEEXT) bootstrap-emacs$(EXEEXT); \ + rm -f bootstrap-emacs$(EXEEXT); \ + ln emacs$(EXEEXT) bootstrap-emacs$(EXEEXT); \ fi ## We run make-docfile twice because the command line may get too long @@ -600,7 +602,8 @@ $(lispsource)/loaddefs.el: $(BOOTSTRAPEMACS) $(VCSWITNESS) bootstrap-emacs$(EXEEXT): temacs$(EXEEXT) cd ../lisp; $(MAKE) $(MFLAGS) update-subdirs if test "$(CANNOT_DUMP)" = "yes"; then \ - ln -f temacs$(EXEEXT) bootstrap-emacs$(EXEEXT); \ + rm -f bootstrap-emacs$(EXEEXT); \ + ln temacs$(EXEEXT) bootstrap-emacs$(EXEEXT); \ else \ $(RUN_TEMACS) --batch --load loadup bootstrap || exit 1; \ test "X$(PAXCTL)" = X || $(PAXCTL) -zex emacs$(EXEEXT); \ From 64cde19918824433ac8b0d753ff94cc7bfc36118 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 21 Aug 2012 03:12:42 +0300 Subject: [PATCH 048/212] * lisp/info.el (Info-file-attributes): New variable. (info-insert-file-contents): Add file attributes to `Info-file-attributes'. Clear the caches `Info-index-nodes' and `Info-toc-nodes' when previous modtime of the Info file is less than new modtime. (Info-toc-nodes, Info-index-nodes): Move definitions up to the top of info.el. Fixes: debbugs:12230 --- lisp/ChangeLog | 10 ++++++++++ lisp/info.el | 47 +++++++++++++++++++++++++++++++++++------------ 2 files changed, 45 insertions(+), 12 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a1464b52e6c..0b9a95ef352 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2012-08-21 Juri Linkov + + * info.el (Info-file-attributes): New variable. + (info-insert-file-contents): Add file attributes to + `Info-file-attributes'. Clear the caches `Info-index-nodes' and + `Info-toc-nodes' when previous modtime of the Info file is less + than new modtime. + (Info-toc-nodes, Info-index-nodes): Move definitions up to the top + of info.el. (Bug#12230) + 2012-08-20 Glenn Morris * calendar/diary-lib.el (diary-include-files, diary-sexp-entry): diff --git a/lisp/info.el b/lisp/info.el index 317cba86500..15478f9063c 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -417,6 +417,21 @@ If number, the point is moved to the corresponding line.") (defvar Info-standalone nil "Non-nil if Emacs was started solely as an Info browser.") +(defvar Info-file-attributes nil + "Alist of file attributes of visited Info files. +Each element is a list (FILE-NAME FILE-ATTRIBUTES...).") + +(defvar Info-toc-nodes nil + "Alist of cached parent-children node information in visited Info files. +Each element is (FILE (NODE-NAME PARENT SECTION CHILDREN) ...) +where PARENT is the parent node extracted from the Up pointer, +SECTION is the section name in the Top node where this node is placed, +CHILDREN is a list of child nodes extracted from the node menu.") + +(defvar Info-index-nodes nil + "Alist of cached index node names of visited Info files. +Each element has the form (INFO-FILE INDEX-NODE-NAMES-LIST).") + (defvar Info-virtual-files nil "List of definitions of virtual Info files. Each element of the list has the format (FILENAME (OPERATION . HANDLER) ...) @@ -609,7 +624,26 @@ Do the right thing if the file has been compressed or zipped." (apply 'call-process-region (point-min) (point-max) (car decoder) t t nil (cdr decoder)))) (let ((inhibit-null-byte-detection t)) ; Index nodes include null bytes - (insert-file-contents fullname visit))))) + (insert-file-contents fullname visit))) + + ;; Clear the caches of modified Info files. + (let* ((attribs-old (cdr (assoc fullname Info-file-attributes))) + (modtime-old (and attribs-old (nth 5 attribs-old))) + (attribs-new (and (stringp fullname) (file-attributes fullname))) + (modtime-new (and attribs-new (nth 5 attribs-new)))) + (when (and modtime-old modtime-new + (> (float-time modtime-new) (float-time modtime-old))) + (setq Info-index-nodes (remove (assoc (or Info-current-file filename) + Info-index-nodes) + Info-index-nodes)) + (setq Info-toc-nodes (remove (assoc (or Info-current-file filename) + Info-toc-nodes) + Info-toc-nodes))) + ;; Add new modtime to `Info-file-attributes'. + (setq Info-file-attributes + (cons (cons fullname attribs-new) + (remove (assoc fullname Info-file-attributes) + Info-file-attributes)))))) (defun Info-file-supports-index-cookies (&optional file) "Return non-nil value if FILE supports Info index cookies. @@ -2394,13 +2428,6 @@ Table of contents is created from the tree structure of menus." (message "") (nreverse nodes)))) -(defvar Info-toc-nodes nil - "Alist of cached parent-children node information in visited Info files. -Each element is (FILE (NODE-NAME PARENT SECTION CHILDREN) ...) -where PARENT is the parent node extracted from the Up pointer, -SECTION is the section name in the Top node where this node is placed, -CHILDREN is a list of child nodes extracted from the node menu.") - (defun Info-toc-nodes (filename) "Return a node list of Info FILENAME with parent-children information. This information is cached in the variable `Info-toc-nodes' with the help @@ -3032,10 +3059,6 @@ See `Info-scroll-down'." (if (looking-at "^\\* ") (forward-char 2))))) -(defvar Info-index-nodes nil - "Alist of cached index node names of visited Info files. -Each element has the form (INFO-FILE INDEX-NODE-NAMES-LIST).") - (defun Info-index-nodes (&optional file) "Return a list of names of all index nodes in Info FILE. If FILE is omitted, it defaults to the current Info file. From 6d74698e4bc745cf2f5e985b482371ab4a7c49e7 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 20 Aug 2012 21:10:27 -0400 Subject: [PATCH 049/212] cal-tex small fix * lisp/calendar/cal-tex.el (cal-tex-cursor-week-iso) (cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week) (cal-tex-cursor-filofax-daily): Correct start date for diary entries. --- lisp/ChangeLog | 6 ++++++ lisp/calendar/cal-tex.el | 20 ++++---------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0b9a95ef352..b3efc458149 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-08-21 Glenn Morris + + * calendar/cal-tex.el (cal-tex-cursor-week-iso) + (cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week) + (cal-tex-cursor-filofax-daily): Correct start date for diary entries. + 2012-08-21 Juri Linkov * info.el (Info-file-attributes): New variable. diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index c8c80370dfa..3063c657b93 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -816,10 +816,7 @@ position to use instead of point." (holidays (if cal-tex-holidays (holiday-in-range d1 d2))) (diary-list (if cal-tex-diary - (cal-tex-list-diary-entries - ;; FIXME d1? - (calendar-absolute-from-gregorian (list month 1 year)) - d2))) + (cal-tex-list-diary-entries d1 d2))) s) (cal-tex-preamble "11pt") (cal-tex-cmd "\\textwidth 6.5in") @@ -1194,10 +1191,7 @@ Optional EVENT indicates a buffer position to use instead of point." (holidays (if cal-tex-holidays (holiday-in-range d1 d2))) (diary-list (if cal-tex-diary - (cal-tex-list-diary-entries - ;; FIXME d1? - (calendar-absolute-from-gregorian (list month 1 year)) - d2)))) + (cal-tex-list-diary-entries d1 d2)))) (cal-tex-preamble "twoside") (cal-tex-cmd "\\textwidth 3.25in") (cal-tex-cmd "\\textheight 6.5in") @@ -1291,10 +1285,7 @@ Optional EVENT indicates a buffer position to use instead of point." (holidays (if cal-tex-holidays (holiday-in-range d1 d2))) (diary-list (if cal-tex-diary - (cal-tex-list-diary-entries - ;; FIXME d1? - (calendar-absolute-from-gregorian (list month 1 year)) - d2)))) + (cal-tex-list-diary-entries d1 d2)))) (cal-tex-preamble "twoside") (cal-tex-cmd "\\textwidth 3.25in") (cal-tex-cmd "\\textheight 6.5in") @@ -1434,10 +1425,7 @@ Optional EVENT indicates a buffer position to use instead of point." (holidays (if cal-tex-holidays (holiday-in-range d1 d2))) (diary-list (if cal-tex-diary - (cal-tex-list-diary-entries - ;; FIXME d1? - (calendar-absolute-from-gregorian (list month 1 year)) - d2)))) + (cal-tex-list-diary-entries d1 d2)))) (cal-tex-preamble "twoside") (cal-tex-cmd "\\textwidth 3.25in") (cal-tex-cmd "\\textheight 6.5in") From 891403f6d1b63dd2f82c4e67ff9a311308906f67 Mon Sep 17 00:00:00 2001 From: Katsumi Yamaoka Date: Tue, 21 Aug 2012 01:23:57 +0000 Subject: [PATCH 050/212] gnus-msg.el (gnus-summary-resend-message): Honor posting-style for `name' and `address' in Resent-From header --- lisp/gnus/ChangeLog | 5 +++++ lisp/gnus/gnus-msg.el | 16 +++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index df35e998c31..7592c405076 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2012-08-21 Katsumi Yamaoka + + * gnus-msg.el (gnus-summary-resend-message): Honor posting-style for + `name' and `address' in Resent-From header. + 2012-08-14 Chong Yidong * gnus-art.el (article-display-face): Handle failure in diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index 594f68bb86f..07748bebb81 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -1369,7 +1369,21 @@ For the \"inline\" alternatives, also see the variable (nnmail-fetch-field "to")))) current-prefix-arg)) (let ((message-header-setup-hook (copy-sequence message-header-setup-hook)) - (message-sent-hook (copy-sequence message-sent-hook))) + (message-sent-hook (copy-sequence message-sent-hook)) + ;; Honor posting-style for `name' and `address' in Resent-From header. + (styles (gnus-group-find-parameter gnus-newsgroup-name + 'posting-style t)) + (user-full-name user-full-name) + (user-mail-address user-mail-address) + tem) + (dolist (style (if styles + (append gnus-posting-styles (list (cons ".*" styles))) + gnus-posting-styles)) + (when (string-match (pop style) gnus-newsgroup-name) + (when (setq tem (cadr (assq 'name style))) + (setq user-full-name tem)) + (when (setq tem (cadr (assq 'address style))) + (setq user-mail-address tem)))) ;; `gnus-summary-resend-message-insert-gcc' must run last. (add-hook 'message-header-setup-hook 'gnus-summary-resend-message-insert-gcc t) From 1941e1344e7c7e8f49a48faefba55e5c23c08448 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 20 Aug 2012 21:32:26 -0400 Subject: [PATCH 051/212] cal-tex-cursor-week-at-a-glance small fixes * lisp/calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance): Add autoload cookie. For now at least, don't use color, since no other cal-tex function does. --- lisp/ChangeLog | 4 ++++ lisp/calendar/cal-tex.el | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b3efc458149..b4ce13b3cdd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2012-08-21 Glenn Morris + * calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance): + Add autoload cookie. For now at least, don't use color, since + no other cal-tex function does. + * calendar/cal-tex.el (cal-tex-cursor-week-iso) (cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week) (cal-tex-cursor-filofax-daily): Correct start date for diary entries. diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index 3063c657b93..cab3951673e 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -1006,12 +1006,13 @@ shown are hard-coded to 8-12, 13-17." (cal-tex-e-framebox) (cal-tex-hspace "1cm"))) +;;;###cal-autoload (defun cal-tex-cursor-week-at-a-glance (&optional n event) "One-week-at-a-glance full page calendar for week indicated by cursor. Optional prefix argument N specifies number of weeks (default 1), starting on Mondays. The calendar shows holiday and diary entries if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil. -It does not show hours of the day. Optional EVENT indicates a buffer +It does not show hours of the day. Optional EVENT indicates a buffer position to use instead of point." (interactive (list (prefix-numeric-value current-prefix-arg) last-nonmenu-event)) @@ -1031,7 +1032,6 @@ position to use instead of point." (diary-list (if cal-tex-diary (cal-tex-list-diary-entries d1 d2)))) (cal-tex-preamble "twoside,12pt") - (cal-tex-cmd "\\usepackage{color}") (cal-tex-cmd "\\textwidth 7in") (cal-tex-cmd "\\textheight 10.5in") (cal-tex-cmd "\\oddsidemargin 0in") @@ -1047,16 +1047,16 @@ position to use instead of point." \\vbox to 2.75in{% \\vspace*{2pt}% \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% - \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em \\textcolor{red}{#4}}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize \\textcolor{blue}{#3}}}}}\\\\} + \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% + \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} \\long\\def\\weekend#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox to 1.8in{% \\vspace*{2pt}% \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% - \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em \\textcolor{red}{#4}}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize \\textcolor{blue}{#3}}}}}\\\\} + \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% + \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} \\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]} \\long\\def\\leftday#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% @@ -1064,8 +1064,8 @@ position to use instead of point." \\vbox to 2.75in{% \\vspace*{2pt}% \\hbox to \\textwidth{\\noindent {\\normalsize \\bf #2} \\small #1 \\hfill #5}% - \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em \\textcolor{red}{#4}}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize \\textcolor{blue}{#3}}}}}\\\\} + \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em #4}}% + \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} ") (cal-tex-b-document) (cal-tex-cmd "\\pagestyle{empty}\\ ") From 9dca480127a5642b94b2736b855099cf302c90d4 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 20 Aug 2012 21:36:27 -0400 Subject: [PATCH 052/212] Remove some blank pages from cal-tex output * lisp/calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance) (cal-tex-cursor-filofax-week): Remove leading blank page. (Were these supposed to serve some purpose? Printing?) --- lisp/ChangeLog | 3 +++ lisp/calendar/cal-tex.el | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b4ce13b3cdd..3e68ed43b80 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-08-21 Glenn Morris + * calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance) + (cal-tex-cursor-filofax-week): Remove leading blank page. + * calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance): Add autoload cookie. For now at least, don't use color, since no other cal-tex function does. diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index cab3951673e..8868c2495f9 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -1069,7 +1069,6 @@ position to use instead of point." ") (cal-tex-b-document) (cal-tex-cmd "\\pagestyle{empty}\\ ") - (cal-tex-newpage) (dotimes (i n) (insert "\\lefthead") (cal-tex-arg @@ -1324,7 +1323,6 @@ Optional EVENT indicates a buffer position to use instead of point." ") (cal-tex-b-document) (cal-tex-cmd "\\pagestyle{empty}\\ ") - (cal-tex-newpage) (dotimes (i n) (insert "\\lefthead") (cal-tex-arg From c68cd5d433e1bbb4478dca51ef5c7ec53259e77e Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 20 Aug 2012 22:29:25 -0400 Subject: [PATCH 053/212] Reduce some cal-tex code duplication * lisp/calendar/cal-tex.el (cal-tex-filofax-paper): New function. (cal-tex-cursor-filofax-year, cal-tex-cursor-filofax-2week) (cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily): Use it. (cal-tex-weekly-paper): New function. (cal-tex-cursor-week, cal-tex-cursor-week2) (cal-tex-cursor-week-iso, cal-tex-cursor-week-monday) (cal-tex-cursor-day): Use it. --- lisp/ChangeLog | 8 ++++ lisp/calendar/cal-tex.el | 85 +++++++++++++++++----------------------- 2 files changed, 45 insertions(+), 48 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3e68ed43b80..5f98620084c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,13 @@ 2012-08-21 Glenn Morris + * calendar/cal-tex.el (cal-tex-filofax-paper): New function. + (cal-tex-cursor-filofax-year, cal-tex-cursor-filofax-2week) + (cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily): Use it. + (cal-tex-weekly-paper): New function. + (cal-tex-cursor-week, cal-tex-cursor-week2) + (cal-tex-cursor-week-iso, cal-tex-cursor-week-monday) + (cal-tex-cursor-day): Use it. + * calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance) (cal-tex-cursor-filofax-week): Remove leading blank page. diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index 8868c2495f9..fc813040537 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -344,6 +344,25 @@ landscape mode with three rows of four months each." (run-hooks 'cal-tex-year-hook)) (run-hooks 'cal-tex-hook)) + +(defun cal-tex-filofax-paper (&optional year) + "Insert some page size settings for filofax layouts." + (insert "\\textwidth 3.25in +\\textheight 6.5in +\\headheight -0.875in +\\topmargin 0pt +") + (insert + ;; Why is this one subtly different? Who knows... + (if year "\\oddsidemargin 1.675in +\\evensidemargin 1.675in +" + "\\oddsidemargin 1.75in +\\evensidemargin 1.5in +\\headsep 0.125in +\\footskip 0.125in +"))) + ;;;###cal-autoload (defun cal-tex-cursor-filofax-year (&optional n event) "Make a Filofax one page yearly calendar of year indicated by cursor. @@ -354,12 +373,7 @@ Optional EVENT indicates a buffer position to use instead of point." (or n (setq n 1)) (let ((year (calendar-extract-year (calendar-cursor-to-date t event)))) (cal-tex-preamble "twoside") - (cal-tex-cmd "\\textwidth 3.25in") - (cal-tex-cmd "\\textheight 6.5in") - (cal-tex-cmd "\\oddsidemargin 1.675in") - (cal-tex-cmd "\\evensidemargin 1.675in") - (cal-tex-cmd "\\topmargin 0pt") - (cal-tex-cmd "\\headheight -0.875in") + (cal-tex-filofax-paper 'year) (cal-tex-cmd "\\fboxsep 0.5mm") (cal-tex-cmd "\\pagestyle{empty}") (cal-tex-b-document) @@ -653,6 +667,15 @@ this is only an upper bound." {\\makebox[2em]{\\rule{0cm}{#2ex}#1}\\rule{3in}{.15mm}}\n" "One hour and a line on the right.") +(defun cal-tex-weekly-paper (&optional nomargins) + "Insert some page size settings for weekly layouts." + (insert "\\textwidth 6.5in +\\textheight 10.5in +") + (or nomargins (insert "\\oddsidemargin 0in +\\evensidemargin 0in +"))) + ;; TODO cal-tex-diary-support. ;; TODO respect cal-tex-daily-start,end (see cal-tex-week-hours). ;;;###cal-autoload @@ -677,10 +700,7 @@ entries are not shown). The calendar shows the hours 8-12am, 1-5pm." (holidays (if cal-tex-holidays (holiday-in-range d1 d2)))) (cal-tex-preamble "11pt") - (cal-tex-cmd "\\textwidth 6.5in") - (cal-tex-cmd "\\textheight 10.5in") - (cal-tex-cmd "\\oddsidemargin 0in") - (cal-tex-cmd "\\evensidemargin 0in") + (cal-tex-weekly-paper) (insert cal-tex-LaTeX-hourbox) (cal-tex-b-document) (cal-tex-cmd "\\pagestyle{empty}") @@ -732,10 +752,7 @@ Optional EVENT indicates a buffer position to use instead of point." (holidays (if cal-tex-holidays (holiday-in-range d1 d2)))) (cal-tex-preamble "12pt") - (cal-tex-cmd "\\textwidth 6.5in") - (cal-tex-cmd "\\textheight 10.5in") - (cal-tex-cmd "\\oddsidemargin 0in") - (cal-tex-cmd "\\evensidemargin 0in") + (cal-tex-weekly-paper) (insert cal-tex-LaTeX-hourbox) (cal-tex-b-document) (cal-tex-cmd "\\pagestyle{empty}") @@ -819,10 +836,7 @@ position to use instead of point." (cal-tex-list-diary-entries d1 d2))) s) (cal-tex-preamble "11pt") - (cal-tex-cmd "\\textwidth 6.5in") - (cal-tex-cmd "\\textheight 10.5in") - (cal-tex-cmd "\\oddsidemargin 0in") - (cal-tex-cmd "\\evensidemargin 0in") + (cal-tex-weekly-paper) (cal-tex-b-document) (cal-tex-cmd "\\pagestyle{empty}") (dotimes (i n) @@ -941,10 +955,7 @@ to use instead of point." (calendar-absolute-from-gregorian (calendar-cursor-to-date t event)))))) (cal-tex-preamble "11pt") - (cal-tex-cmd "\\textwidth 6.5in") - (cal-tex-cmd "\\textheight 10.5in") - (cal-tex-cmd "\\oddsidemargin 0in") - (cal-tex-cmd "\\evensidemargin 0in") + (cal-tex-weekly-paper) (cal-tex-b-document) (dotimes (i n) (cal-tex-vspace "-1cm") @@ -1192,14 +1203,7 @@ Optional EVENT indicates a buffer position to use instead of point." (diary-list (if cal-tex-diary (cal-tex-list-diary-entries d1 d2)))) (cal-tex-preamble "twoside") - (cal-tex-cmd "\\textwidth 3.25in") - (cal-tex-cmd "\\textheight 6.5in") - (cal-tex-cmd "\\oddsidemargin 1.75in") - (cal-tex-cmd "\\evensidemargin 1.5in") - (cal-tex-cmd "\\topmargin 0pt") - (cal-tex-cmd "\\headheight -0.875in") - (cal-tex-cmd "\\headsep 0.125in") - (cal-tex-cmd "\\footskip .125in") + (cal-tex-filofax-paper) (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]} \\long\\def\\rightday#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% @@ -1286,14 +1290,7 @@ Optional EVENT indicates a buffer position to use instead of point." (diary-list (if cal-tex-diary (cal-tex-list-diary-entries d1 d2)))) (cal-tex-preamble "twoside") - (cal-tex-cmd "\\textwidth 3.25in") - (cal-tex-cmd "\\textheight 6.5in") - (cal-tex-cmd "\\oddsidemargin 1.75in") - (cal-tex-cmd "\\evensidemargin 1.5in") - (cal-tex-cmd "\\topmargin 0pt") - (cal-tex-cmd "\\headheight -0.875in") - (cal-tex-cmd "\\headsep 0.125in") - (cal-tex-cmd "\\footskip .125in") + (cal-tex-filofax-paper) (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]} \\long\\def\\rightday#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% @@ -1425,14 +1422,7 @@ Optional EVENT indicates a buffer position to use instead of point." (diary-list (if cal-tex-diary (cal-tex-list-diary-entries d1 d2)))) (cal-tex-preamble "twoside") - (cal-tex-cmd "\\textwidth 3.25in") - (cal-tex-cmd "\\textheight 6.5in") - (cal-tex-cmd "\\oddsidemargin 1.75in") - (cal-tex-cmd "\\evensidemargin 1.5in") - (cal-tex-cmd "\\topmargin 0pt") - (cal-tex-cmd "\\headheight -0.875in") - (cal-tex-cmd "\\headsep 0.125in") - (cal-tex-cmd "\\footskip .125in") + (cal-tex-filofax-paper) (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]} \\long\\def\\rightday#1#2#3{% \\rule{\\textwidth}{0.3pt}\\\\% @@ -1525,8 +1515,7 @@ a buffer position to use instead of point." (let ((date (calendar-absolute-from-gregorian (calendar-cursor-to-date t event)))) (cal-tex-preamble "12pt") - (cal-tex-cmd "\\textwidth 6.5in") - (cal-tex-cmd "\\textheight 10.5in") + (cal-tex-weekly-paper 'nomargins) (cal-tex-b-document) (cal-tex-cmd "\\pagestyle{empty}") (dotimes (i n) From 6d470bddb081435461b67f039b5c9960e23bea8e Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Tue, 21 Aug 2012 08:46:05 +0400 Subject: [PATCH 054/212] Setter macros for fontsets. * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII) (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE) (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros. Adjust users. --- src/ChangeLog | 8 +++++ src/fontset.c | 97 +++++++++++++++++++++++++++++++-------------------- 2 files changed, 67 insertions(+), 38 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 22383088763..5a7c6923029 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2012-08-21 Dmitry Antipov + + Setter macros for fontsets. + * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII) + (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE) + (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros. + Adjust users. + 2012-08-20 Glenn Morris * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)): diff --git a/src/fontset.c b/src/fontset.c index c39d68a8ecf..f9b6e8139ef 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -214,26 +214,46 @@ fontset_id_valid_p (int id) #define FONTSET_FROM_ID(id) AREF (Vfontset_table, id) /* Macros to access special values of FONTSET. */ -#define FONTSET_ID(fontset) XCHAR_TABLE (fontset)->extras[0] + +#define FONTSET_ID(fontset) XCHAR_TABLE (fontset)->extras[0] +#define SET_FONTSET_ID(fontset, id) \ + set_char_table_extras ((fontset), 0, (id)) /* Macros to access special values of (base) FONTSET. */ -#define FONTSET_NAME(fontset) XCHAR_TABLE (fontset)->extras[1] -#define FONTSET_ASCII(fontset) XCHAR_TABLE (fontset)->extras[4] -/* #define FONTSET_SPEC(fontset) XCHAR_TABLE (fontset)->extras[5] */ + +#define FONTSET_NAME(fontset) XCHAR_TABLE (fontset)->extras[1] +#define SET_FONTSET_NAME(fontset, name) \ + set_char_table_extras ((fontset), 1, (name)) + +#define FONTSET_ASCII(fontset) XCHAR_TABLE (fontset)->extras[4] +#define SET_FONTSET_ASCII(fontset, ascii) \ + set_char_table_extras ((fontset), 4, (ascii)) /* Macros to access special values of (realized) FONTSET. */ -#define FONTSET_BASE(fontset) XCHAR_TABLE (fontset)->extras[2] -#define FONTSET_FRAME(fontset) XCHAR_TABLE (fontset)->extras[3] -/* #define FONTSET_OBJLIST(fontset) XCHAR_TABLE (fontset)->extras[4] */ -#define FONTSET_NOFONT_FACE(fontset) XCHAR_TABLE (fontset)->extras[5] -/* #define FONTSET_REPERTORY(fontset) XCHAR_TABLE (fontset)->extras[6] */ -#define FONTSET_DEFAULT(fontset) XCHAR_TABLE (fontset)->extras[7] + +#define FONTSET_BASE(fontset) XCHAR_TABLE (fontset)->extras[2] +#define SET_FONTSET_BASE(fontset, base) \ + set_char_table_extras ((fontset), 2, (base)) + +#define FONTSET_FRAME(fontset) XCHAR_TABLE (fontset)->extras[3] +#define SET_FONTSET_FRAME(fontset, frame) \ + set_char_table_extras ((fontset), 3, (frame)) + +#define FONTSET_NOFONT_FACE(fontset) XCHAR_TABLE (fontset)->extras[5] +#define SET_FONTSET_NOFONT_FACE(fontset, face) \ + set_char_table_extras ((fontset), 5, (face)) + +#define FONTSET_DEFAULT(fontset) XCHAR_TABLE (fontset)->extras[7] +#define SET_FONTSET_DEFAULT(fontset, def) \ + set_char_table_extras ((fontset), 7, (def)) /* For both base and realized fontset. */ -#define FONTSET_FALLBACK(fontset) XCHAR_TABLE (fontset)->extras[8] -#define BASE_FONTSET_P(fontset) (NILP (FONTSET_BASE (fontset))) +#define FONTSET_FALLBACK(fontset) XCHAR_TABLE (fontset)->extras[8] +#define SET_FONTSET_FALLBACK(fontset, fallback) \ + set_char_table_extras ((fontset), 8, (fallback)) +#define BASE_FONTSET_P(fontset) (NILP (FONTSET_BASE (fontset))) /* Macros for FONT-DEF and RFONT-DEF of fontset. */ #define FONT_DEF_NEW(font_def, font_spec, encoding, repertory) \ @@ -265,7 +285,7 @@ fontset_id_valid_p (int id) #define RFONT_DEF_NEW(rfont_def, font_def) \ do { \ (rfont_def) = Fmake_vector (make_number (4), Qnil); \ - ASET ((rfont_def), 1, (font_def)); \ + ASET ((rfont_def), 1, (font_def)); \ RFONT_DEF_SET_SCORE ((rfont_def), 0); \ } while (0) @@ -307,12 +327,13 @@ fontset_ref (Lisp_Object fontset, int c) replace with ELT, if ADD is `prepend', prepend ELT, otherwise, append ELT. */ -#define FONTSET_ADD(fontset, range, elt, add) \ - (NILP (add) \ - ? (NILP (range) \ - ? (FONTSET_FALLBACK (fontset) = Fmake_vector (make_number (1), (elt))) \ - : Fset_char_table_range ((fontset), (range), \ - Fmake_vector (make_number (1), (elt)))) \ +#define FONTSET_ADD(fontset, range, elt, add) \ + (NILP (add) \ + ? (NILP (range) \ + ? (SET_FONTSET_FALLBACK \ + (fontset, Fmake_vector (make_number (1), (elt)))) \ + : Fset_char_table_range ((fontset), (range), \ + Fmake_vector (make_number (1), (elt)))) \ : fontset_add ((fontset), (range), (elt), (add))) static Lisp_Object @@ -341,8 +362,8 @@ fontset_add (Lisp_Object fontset, Lisp_Object range, Lisp_Object elt, Lisp_Objec else { args[idx] = FONTSET_FALLBACK (fontset); - FONTSET_FALLBACK (fontset) - = NILP (args[idx]) ? args[1 - idx] : Fvconcat (2, args); + SET_FONTSET_FALLBACK + (fontset, NILP (args[idx]) ? args[1 - idx] : Fvconcat (2, args)); } return Qnil; } @@ -485,7 +506,7 @@ fontset_get_font_group (Lisp_Object fontset, int c) if (c >= 0) char_table_set_range (fontset, from, to, font_group); else - FONTSET_FALLBACK (fontset) = font_group; + SET_FONTSET_FALLBACK (fontset, font_group); return font_group; } @@ -720,8 +741,9 @@ fontset_font (Lisp_Object fontset, int c, struct face *face, int id) if (! EQ (base_fontset, Vdefault_fontset)) { if (NILP (FONTSET_DEFAULT (fontset))) - FONTSET_DEFAULT (fontset) - = make_fontset (FONTSET_FRAME (fontset), Qnil, Vdefault_fontset); + SET_FONTSET_DEFAULT + (fontset, + make_fontset (FONTSET_FRAME (fontset), Qnil, Vdefault_fontset)); FONT_DEFERRED_LOG ("default fontset: font for", make_number (c), Qnil); default_rfont_def = fontset_find_font (FONTSET_DEFAULT (fontset), c, face, id, 0); @@ -781,16 +803,14 @@ make_fontset (Lisp_Object frame, Lisp_Object name, Lisp_Object base) fontset = Fmake_char_table (Qfontset, Qnil); - FONTSET_ID (fontset) = make_number (id); + SET_FONTSET_ID (fontset, make_number (id)); if (NILP (base)) - { - FONTSET_NAME (fontset) = name; - } + SET_FONTSET_NAME (fontset, name); else { - FONTSET_NAME (fontset) = Qnil; - FONTSET_FRAME (fontset) = frame; - FONTSET_BASE (fontset) = base; + SET_FONTSET_NAME (fontset, Qnil); + SET_FONTSET_FRAME (fontset, frame); + SET_FONTSET_BASE (fontset, base); } ASET (Vfontset_table, id, fontset); @@ -958,7 +978,7 @@ face_for_char (FRAME_PTR f, struct face *face, int c, int pos, Lisp_Object objec else { face_id = face_for_font (f, Qnil, face); - FONTSET_NOFONT_FACE (fontset) = make_number (face_id); + SET_FONTSET_NOFONT_FACE (fontset, make_number (face_id)); } } eassert (face_id >= 0); @@ -1580,7 +1600,7 @@ appended. By default, FONT-SPEC overrides the previous settings. */) Lisp_Object tail, fr, alist; int fontset_id = XINT (FONTSET_ID (fontset)); - FONTSET_ASCII (fontset) = fontname; + SET_FONTSET_ASCII (fontset, fontname); name = FONTSET_NAME (fontset); FOR_EACH_FRAME (tail, fr) { @@ -1658,7 +1678,7 @@ FONT-SPEC is a vector, a cons, or a string. See the documentation of len = font_unparse_xlfd (font_spec, 0, xlfd, 256); if (len < 0) error ("Invalid fontset name (perhaps too long): %s", SDATA (name)); - FONTSET_ASCII (fontset) = make_unibyte_string (xlfd, len); + SET_FONTSET_ASCII (fontset, make_unibyte_string (xlfd, len)); } else { @@ -1744,7 +1764,7 @@ fontset_from_font (Lisp_Object font_object) Fset_fontset_font (name, Qnil, font_spec, Qnil, Qnil); } - FONTSET_ASCII (fontset) = font_name; + SET_FONTSET_ASCII (fontset, font_name); return XINT (FONTSET_ID (fontset)); } @@ -2161,9 +2181,10 @@ syms_of_fontset (void) Vdefault_fontset = Fmake_char_table (Qfontset, Qnil); staticpro (&Vdefault_fontset); - FONTSET_ID (Vdefault_fontset) = make_number (0); - FONTSET_NAME (Vdefault_fontset) - = build_pure_c_string ("-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default"); + SET_FONTSET_ID (Vdefault_fontset, make_number (0)); + SET_FONTSET_NAME + (Vdefault_fontset, + build_pure_c_string ("-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default")); ASET (Vfontset_table, 0, Vdefault_fontset); next_fontset_id = 1; From 1cebb5c0e43f3d279d4050ecfd00e885de015f4d Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 20 Aug 2012 23:35:48 -0700 Subject: [PATCH 055/212] Improve cal-tex-cmd usage * lisp/calendar/cal-tex.el (cal-tex-cursor-filofax-year) (cal-tex-cursor-week, cal-tex-cursor-week2) (cal-tex-cursor-week-iso, cal-tex-cursor-week-at-a-glance) (cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week) (cal-tex-cursor-filofax-daily, cal-tex-cursor-day) (cal-tex-insert-preamble, cal-tex-b-document) (cal-tex-e-document, cal-tex-b-center, cal-tex-e-center): Improve cal-tex-cmd usage. --- lisp/ChangeLog | 9 +++++++ lisp/calendar/cal-tex.el | 55 ++++++++++++++++++++-------------------- 2 files changed, 37 insertions(+), 27 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5f98620084c..6c158945705 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,14 @@ 2012-08-21 Glenn Morris + * calendar/cal-tex.el (cal-tex-cursor-filofax-year) + (cal-tex-cursor-week, cal-tex-cursor-week2) + (cal-tex-cursor-week-iso, cal-tex-cursor-week-at-a-glance) + (cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week) + (cal-tex-cursor-filofax-daily, cal-tex-cursor-day) + (cal-tex-insert-preamble, cal-tex-b-document) + (cal-tex-e-document, cal-tex-b-center, cal-tex-e-center): + Improve cal-tex-cmd usage. + * calendar/cal-tex.el (cal-tex-filofax-paper): New function. (cal-tex-cursor-filofax-year, cal-tex-cursor-filofax-2week) (cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily): Use it. diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index fc813040537..b0facb07d4e 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -375,9 +375,9 @@ Optional EVENT indicates a buffer position to use instead of point." (cal-tex-preamble "twoside") (cal-tex-filofax-paper 'year) (cal-tex-cmd "\\fboxsep 0.5mm") - (cal-tex-cmd "\\pagestyle{empty}") + (cal-tex-cmd "\\pagestyle" "empty") (cal-tex-b-document) - (cal-tex-cmd "\\vspace*{0.25in}") + (cal-tex-cmd "\\vspace*" "0.25in") (dotimes (j n) (insert (format "\\hfil \\textbf{\\Large %s} \\hfil\\\\\n" year)) (cal-tex-b-center) @@ -405,7 +405,7 @@ Optional EVENT indicates a buffer position to use instead of point." (if (= j (1- n)) (cal-tex-end-document) (cal-tex-newpage) - (cal-tex-cmd "\\vspace*{0.25in}")) + (cal-tex-cmd "\\vspace*" "0.25in")) (run-hooks 'cal-tex-year-hook)) (run-hooks 'cal-tex-hook))) @@ -703,7 +703,7 @@ entries are not shown). The calendar shows the hours 8-12am, 1-5pm." (cal-tex-weekly-paper) (insert cal-tex-LaTeX-hourbox) (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle{empty}") + (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) (cal-tex-vspace "-1.5in") (cal-tex-b-center) @@ -755,7 +755,7 @@ Optional EVENT indicates a buffer position to use instead of point." (cal-tex-weekly-paper) (insert cal-tex-LaTeX-hourbox) (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle{empty}") + (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) (cal-tex-vspace "-1.5in") (cal-tex-b-center) @@ -838,7 +838,7 @@ position to use instead of point." (cal-tex-preamble "11pt") (cal-tex-weekly-paper) (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle{empty}") + (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) (cal-tex-vspace "-1.5in") (cal-tex-b-center) @@ -1043,14 +1043,15 @@ position to use instead of point." (diary-list (if cal-tex-diary (cal-tex-list-diary-entries d1 d2)))) (cal-tex-preamble "twoside,12pt") - (cal-tex-cmd "\\textwidth 7in") - (cal-tex-cmd "\\textheight 10.5in") - (cal-tex-cmd "\\oddsidemargin 0in") - (cal-tex-cmd "\\evensidemargin 0in") - (cal-tex-cmd "\\topmargin 0pt") - (cal-tex-cmd "\\headheight -0.875in") - (cal-tex-cmd "\\headsep 0.125in") - (cal-tex-cmd "\\footskip .125in") + (insert "\\textwidth 7in +\\textheight 10.5in +\\oddsidemargin 0in +\\evensidemargin 0in +\\topmargin 0pt +\\headheight -0.875in +\\headsep 0.125in +\\footskip .125in +") (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]} \\long\\def\\rightday#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% @@ -1079,7 +1080,7 @@ position to use instead of point." \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} ") (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle{empty}\\ ") + (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) (insert "\\lefthead") (cal-tex-arg @@ -1224,7 +1225,7 @@ Optional EVENT indicates a buffer position to use instead of point." \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} ") (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle{empty}") + (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) (if (zerop (mod i 2)) (insert "\\righthead") @@ -1319,7 +1320,7 @@ Optional EVENT indicates a buffer position to use instead of point." \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} ") (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle{empty}\\ ") + (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) (insert "\\lefthead") (cal-tex-arg @@ -1455,7 +1456,7 @@ Optional EVENT indicates a buffer position to use instead of point." \\def\\linesfill{\\par\\leaders\\copy\\LineBox\\vfill} ") (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle{empty}") + (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) (dotimes (j 4) (let ((even (zerop (% j 2)))) @@ -1517,7 +1518,7 @@ a buffer position to use instead of point." (cal-tex-preamble "12pt") (cal-tex-weekly-paper 'nomargins) (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle{empty}") + (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) (cal-tex-vspace "-1.7in") (cal-tex-daily-page (calendar-gregorian-from-absolute date)) @@ -1736,16 +1737,16 @@ non-nil, means add to end of buffer without erasing current contents." (if (not landscape) (progn (cal-tex-cmd "\\oddsidemargin -1.75cm") - (cal-tex-cmd "\\def\\holidaymult{.06}")) - (cal-tex-cmd "\\special{landscape}") + (cal-tex-cmd "\\def\\holidaymult" ".06")) + (cal-tex-cmd "\\special" "landscape") (cal-tex-cmd "\\textwidth 9.5in") (cal-tex-cmd "\\textheight 7in") (cal-tex-comment) - (cal-tex-cmd "\\def\\holidaymult{.08}")) + (cal-tex-cmd "\\def\\holidaymult" ".08")) (cal-tex-cmd cal-tex-caldate) (cal-tex-cmd cal-tex-myday) (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle{empty}")) + (cal-tex-cmd "\\pagestyle" "empty")) (cal-tex-cmd "\\setlength{\\cellwidth}" width) (insert (format "\\setlength{\\cellwidth}{%f\\cellwidth}\n" (/ 1.1 (length cal-tex-which-days)))) @@ -1853,20 +1854,20 @@ Add trailing COMMENT if present." (defun cal-tex-b-document () "Insert beginning of document." - (cal-tex-cmd "\\begin{document}")) + (cal-tex-cmd "\\begin" "document")) (defun cal-tex-e-document () "Insert end of document." - (cal-tex-cmd "\\end{document}")) + (cal-tex-cmd "\\end" "document")) (defun cal-tex-b-center () "Insert beginning of centered block." - (cal-tex-cmd "\\begin{center}")) + (cal-tex-cmd "\\begin" "center")) (defun cal-tex-e-center () "Insert end of centered block." (cal-tex-comment) - (cal-tex-cmd "\\end{center}")) + (cal-tex-cmd "\\end" "center")) ;;; From b2403709bbae878659c5ddf321862a734bfb0953 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 20 Aug 2012 23:50:55 -0700 Subject: [PATCH 056/212] Use cal-tex-* functions more * lisp/calendar/cal-tex.el (cal-tex-cursor-filofax-year): Use cal-tex-vspace. (cal-tex-vspace, cal-tex-hspace, cal-tex-em, cal-tex-bf) (cal-tex-Huge-bf, cal-tex-large-bf): Use cal-tex-cmd. --- lisp/ChangeLog | 5 +++++ lisp/calendar/cal-tex.el | 18 ++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6c158945705..d0595f108cf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2012-08-21 Glenn Morris + * calendar/cal-tex.el (cal-tex-cursor-filofax-year): + Use cal-tex-vspace. + (cal-tex-vspace, cal-tex-hspace, cal-tex-em, cal-tex-bf) + (cal-tex-Huge-bf, cal-tex-large-bf): Use cal-tex-cmd. + * calendar/cal-tex.el (cal-tex-cursor-filofax-year) (cal-tex-cursor-week, cal-tex-cursor-week2) (cal-tex-cursor-week-iso, cal-tex-cursor-week-at-a-glance) diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index b0facb07d4e..326deef69ba 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -377,7 +377,7 @@ Optional EVENT indicates a buffer position to use instead of point." (cal-tex-cmd "\\fboxsep 0.5mm") (cal-tex-cmd "\\pagestyle" "empty") (cal-tex-b-document) - (cal-tex-cmd "\\vspace*" "0.25in") + (cal-tex-vspace "0.25in") (dotimes (j n) (insert (format "\\hfil \\textbf{\\Large %s} \\hfil\\\\\n" year)) (cal-tex-b-center) @@ -405,7 +405,7 @@ Optional EVENT indicates a buffer position to use instead of point." (if (= j (1- n)) (cal-tex-end-document) (cal-tex-newpage) - (cal-tex-cmd "\\vspace*" "0.25in")) + (cal-tex-vspace "0.25in")) (run-hooks 'cal-tex-year-hook)) (run-hooks 'cal-tex-hook))) @@ -1809,13 +1809,11 @@ non-nil, means add to end of buffer without erasing current contents." (defun cal-tex-vspace (space) "Insert vspace command to move SPACE vertically." - (insert "\\vspace*{" space "}") - (cal-tex-comment)) + (cal-tex-cmd "\\vspace*" space)) (defun cal-tex-hspace (space) "Insert hspace command to move SPACE horizontally." - (insert "\\hspace*{" space "}") - (cal-tex-comment)) + (cal-tex-cmd "\\hspace*" space)) (defun cal-tex-comment (&optional comment) "Insert `% ', followed by optional string COMMENT, followed by newline. @@ -1922,11 +1920,11 @@ Add trailing COMMENT if present." (defun cal-tex-em (string) "Insert STRING in italic font." - (insert "\\textit{" string "}")) + (cal-tex-cmd "\\textit" string)) (defun cal-tex-bf (string) "Insert STRING in bf font." - (insert "\\textbf{ " string "}")) + (cal-tex-cmd "\\textbf" string)) (defun cal-tex-scriptsize (string) "Insert STRING in scriptsize font." @@ -1942,7 +1940,7 @@ Add trailing COMMENT if present." (defun cal-tex-Huge-bf (string) "Insert STRING in Huge bf font." - (insert "\\textbf{\\Huge " string "}")) + (cal-tex-cmd "\\textbf" (concat "\\Huge " string))) (defun cal-tex-large (string) "Insert STRING in large font." @@ -1950,7 +1948,7 @@ Add trailing COMMENT if present." (defun cal-tex-large-bf (string) "Insert STRING in large bf font." - (insert "\\textbf{\\large " string "}")) + (cal-tex-cmd "\\textbf" (concat "\\large " string))) (provide 'cal-tex) From 2d225a3a99c155e47043a4fa1f3b011e0a78a4cb Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 21 Aug 2012 00:01:29 -0700 Subject: [PATCH 057/212] Use cal-tex-arg more * lisp/calendar/cal-tex.el (cal-tex-scriptsize, cal-tex-huge) (cal-tex-Huge, cal-tex-large): Use cal-tex-arg. --- lisp/ChangeLog | 2 ++ lisp/calendar/cal-tex.el | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d0595f108cf..5a843fd0f5a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -4,6 +4,8 @@ Use cal-tex-vspace. (cal-tex-vspace, cal-tex-hspace, cal-tex-em, cal-tex-bf) (cal-tex-Huge-bf, cal-tex-large-bf): Use cal-tex-cmd. + (cal-tex-scriptsize, cal-tex-huge, cal-tex-Huge, cal-tex-large): + Use cal-tex-arg. * calendar/cal-tex.el (cal-tex-cursor-filofax-year) (cal-tex-cursor-week, cal-tex-cursor-week2) diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index 326deef69ba..5fbb20bac3b 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -1928,15 +1928,15 @@ Add trailing COMMENT if present." (defun cal-tex-scriptsize (string) "Insert STRING in scriptsize font." - (insert "{\\scriptsize " string "}")) + (cal-tex-arg (concat "\\scriptsize " string))) (defun cal-tex-huge (string) "Insert STRING in huge font." - (insert "{\\huge " string "}")) + (cal-tex-arg (concat "\\huge " string))) (defun cal-tex-Huge (string) "Insert STRING in Huge font." - (insert "{\\Huge " string "}")) + (cal-tex-arg (concat "\\Huge " string))) (defun cal-tex-Huge-bf (string) "Insert STRING in Huge bf font." @@ -1944,7 +1944,7 @@ Add trailing COMMENT if present." (defun cal-tex-large (string) "Insert STRING in large font." - (insert "{\\large " string "}")) + (cal-tex-arg (concat "\\large " string))) (defun cal-tex-large-bf (string) "Insert STRING in large bf font." From d346b2b4c70b5b1c1f612c715d0c1a4ec18458e0 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 21 Aug 2012 00:08:50 -0700 Subject: [PATCH 058/212] Allow multiple cal-tex-buffer buffers to exist * lisp/calendar/cal-tex.el (cal-tex-preamble): Generate new buffers. (cal-tex-end-document): Don't rely on buffer name. --- lisp/ChangeLog | 3 +++ lisp/calendar/cal-tex.el | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5a843fd0f5a..1d249cfa30f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-08-21 Glenn Morris + * calendar/cal-tex.el (cal-tex-preamble): Generate new buffers. + (cal-tex-end-document): Don't rely on buffer name. + * calendar/cal-tex.el (cal-tex-cursor-filofax-year): Use cal-tex-vspace. (cal-tex-vspace, cal-tex-hspace, cal-tex-em, cal-tex-bf) diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index 5fbb20bac3b..d891c9e639c 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -253,8 +253,7 @@ This definition is the heart of the calendar!") "Insert the LaTeX calendar preamble into `cal-tex-buffer'. Preamble includes initial definitions for various LaTeX commands. Optional string ARGS are included as options for the article document class." - ;; FIXME use generate-new-buffer, and adjust cal-tex-end-document. - (set-buffer (get-buffer-create cal-tex-buffer)) + (set-buffer (generate-new-buffer cal-tex-buffer)) (insert (format "\\documentclass%s{article}\n" (if (stringp args) (format "[%s]" args) @@ -1712,7 +1711,7 @@ informative header, and run HOOK." ;; FIXME latin1 might not always be right. (insert "\\usepackage[latin1]{inputenc}\n")))) (latex-mode) - (pop-to-buffer cal-tex-buffer) + (pop-to-buffer (current-buffer)) (goto-char (point-min)) ;; FIXME auctex equivalents? (cal-tex-comment From 798581599b14bd781d7d74adef5fe269fa8b5d17 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 21 Aug 2012 00:46:47 -0700 Subject: [PATCH 059/212] Remove more cal-tex code duplication * lisp/calendar/cal-tex.el (cal-tex-lefthead, cal-tex-righthead): New constants. (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-2week) (cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily): Use them. --- lisp/ChangeLog | 5 ++++ lisp/calendar/cal-tex.el | 56 ++++++++++++++++++++++++++-------------- 2 files changed, 41 insertions(+), 20 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1d249cfa30f..87222fa568a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2012-08-21 Glenn Morris + * calendar/cal-tex.el (cal-tex-lefthead, cal-tex-righthead): + New constants. + (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-2week) + (cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily): Use them. + * calendar/cal-tex.el (cal-tex-preamble): Generate new buffers. (cal-tex-end-document): Don't rely on buffer name. diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index d891c9e639c..dccb1f1bfc7 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -237,6 +237,14 @@ The names are taken from `calendar-day-name-array'.") "LaTeX code to insert one box with date info in calendar. This definition is the heart of the calendar!") +(defconst cal-tex-lefthead + "\\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]}\n" + "LaTeX code for left header.") + +(defconst cal-tex-righthead + "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]}\n" + "LaTeX code for right header.") + (autoload 'holiday-in-range "holidays") (define-obsolete-function-alias 'cal-tex-list-holidays 'holiday-in-range "24.3") @@ -1051,8 +1059,8 @@ position to use instead of point." \\headsep 0.125in \\footskip .125in ") - (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]} -\\long\\def\\rightday#1#2#3#4#5{% + (insert cal-tex-righthead) + (insert "\\long\\def\\rightday#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox to 2.75in{% @@ -1060,7 +1068,8 @@ position to use instead of point." \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} -\\long\\def\\weekend#1#2#3#4#5{% +") + (insert "\\long\\def\\weekend#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox to 1.8in{% @@ -1068,8 +1077,9 @@ position to use instead of point." \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} -\\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]} -\\long\\def\\leftday#1#2#3#4#5{% +") + (insert cal-tex-lefthead) + (insert "\\long\\def\\leftday#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox to 2.75in{% @@ -1204,8 +1214,8 @@ Optional EVENT indicates a buffer position to use instead of point." (cal-tex-list-diary-entries d1 d2)))) (cal-tex-preamble "twoside") (cal-tex-filofax-paper) - (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]} -\\long\\def\\rightday#1#2#3#4#5{% + (insert cal-tex-righthead) + (insert "\\long\\def\\rightday#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox to 0.7in{% @@ -1213,8 +1223,9 @@ Optional EVENT indicates a buffer position to use instead of point." \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} -\\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]} -\\long\\def\\leftday#1#2#3#4#5{% +") + (insert cal-tex-lefthead) + (insert "\\long\\def\\leftday#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox to 0.7in{% @@ -1291,8 +1302,8 @@ Optional EVENT indicates a buffer position to use instead of point." (cal-tex-list-diary-entries d1 d2)))) (cal-tex-preamble "twoside") (cal-tex-filofax-paper) - (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]} -\\long\\def\\rightday#1#2#3#4#5{% + (insert cal-tex-righthead) + (insert "\\long\\def\\rightday#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox to 1.85in{% @@ -1300,7 +1311,8 @@ Optional EVENT indicates a buffer position to use instead of point." \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} -\\long\\def\\weekend#1#2#3#4#5{% +") + (insert "\\long\\def\\weekend#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox to .8in{% @@ -1308,8 +1320,9 @@ Optional EVENT indicates a buffer position to use instead of point." \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} -\\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]} -\\long\\def\\leftday#1#2#3#4#5{% +") + (insert cal-tex-lefthead) + (insert "\\long\\def\\leftday#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox to 1.85in{% @@ -1423,8 +1436,8 @@ Optional EVENT indicates a buffer position to use instead of point." (cal-tex-list-diary-entries d1 d2)))) (cal-tex-preamble "twoside") (cal-tex-filofax-paper) - (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]} -\\long\\def\\rightday#1#2#3{% + (insert cal-tex-righthead) + (insert "\\long\\def\\rightday#1#2#3{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox {% @@ -1432,7 +1445,8 @@ Optional EVENT indicates a buffer position to use instead of point." \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}% \\hbox to \\textwidth{\\vbox {\\raggedleft \\em #2}}% \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}} -\\long\\def\\weekend#1#2#3{% +") + (insert "\\long\\def\\weekend#1#2#3{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox {% @@ -1440,8 +1454,9 @@ Optional EVENT indicates a buffer position to use instead of point." \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}% \\hbox to \\textwidth{\\vbox {\\noindent \\em #2}}% \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}} -\\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]} -\\long\\def\\leftday#1#2#3{% +") + (insert cal-tex-lefthead) + (insert "\\long\\def\\leftday#1#2#3{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox {% @@ -1449,7 +1464,8 @@ Optional EVENT indicates a buffer position to use instead of point." \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}% \\hbox to \\textwidth{\\vbox {\\noindent \\em #2}}% \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}} -\\newbox\\LineBox +") + (insert "\\newbox\\LineBox \\setbox\\LineBox=\\hbox to\\textwidth{% \\vrule height.2in width0pt\\leaders\\hrule\\hfill} \\def\\linesfill{\\par\\leaders\\copy\\LineBox\\vfill} From a878d0f2c1e1ffd144dbbb455e2bc7fe23845d26 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 21 Aug 2012 09:52:42 +0200 Subject: [PATCH 060/212] erc-match: fix erc-match server buffer exclusion * erc-match.el (erc-match-message): Use `erc-match-exclude-server-buffer' not `erc-track-exclude-server-buffer'. --- lisp/erc/ChangeLog | 6 ++++++ lisp/erc/erc-match.el | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index dd62cae7de1..27b1fe8617a 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,9 @@ +2012-08-21 Julien Danjou + + * erc-match.el (erc-match-message): Use + `erc-match-exclude-server-buffer' not + `erc-track-exclude-server-buffer'. + 2012-08-20 Josh Feinstein * erc.el (erc-display-message): Abstract message hiding decision diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el index 8daf9be2b14..cac042c0298 100644 --- a/lisp/erc/erc-match.el +++ b/lisp/erc/erc-match.el @@ -458,7 +458,7 @@ Use this defun with `erc-insert-modify-hook'." (point-min)) (point-max)))) (when (and vector - (not (and erc-track-exclude-server-buffer + (not (and erc-match-exclude-server-buffer (erc-server-buffer-p)))) (mapc (lambda (match-type) From 9f1ee09efc42e82df21d0697cda35189f0618cd8 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 21 Aug 2012 00:59:25 -0700 Subject: [PATCH 061/212] Remove still more cal-tex code duplication * lisp/calendar/cal-tex.el (cal-tex-leftday, cal-tex-rightday): New functions. (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-2week) (cal-tex-cursor-filofax-week): Use them. --- lisp/ChangeLog | 5 +++ lisp/calendar/cal-tex.el | 87 +++++++++++++++------------------------- 2 files changed, 38 insertions(+), 54 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 87222fa568a..11bdce9a230 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2012-08-21 Glenn Morris + * calendar/cal-tex.el (cal-tex-leftday, cal-tex-rightday): + New functions. + (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-2week) + (cal-tex-cursor-filofax-week): Use them. + * calendar/cal-tex.el (cal-tex-lefthead, cal-tex-righthead): New constants. (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-2week) diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index dccb1f1bfc7..1a64edc2071 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -370,6 +370,28 @@ landscape mode with three rows of four months each." \\footskip 0.125in "))) +(defun cal-tex-leftday (height) + "Insert LaTeX code for leftday function." + (insert "\\long\\def\\leftday#1#2#3#4#5{% + \\rule{\\textwidth}{0.3pt}\\\\% + \\hbox to \\textwidth{% + \\vbox to " height "{% + \\vspace*{2pt}% + \\hbox to \\textwidth{\\noindent {\\normalsize \\bf #2} \\small #1 \\hfill #5}% + \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em #4}}% + \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}\n")) + +(defun cal-tex-rightday (height) + "Insert LaTeX code for rightday function." + (insert "\\long\\def\\rightday#1#2#3#4#5{% + \\rule{\\textwidth}{0.3pt}\\\\% + \\hbox to \\textwidth{% + \\vbox to " height "{% + \\vspace*{2pt}% + \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% + \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% + \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}\n")) + ;;;###cal-autoload (defun cal-tex-cursor-filofax-year (&optional n event) "Make a Filofax one page yearly calendar of year indicated by cursor. @@ -1060,15 +1082,8 @@ position to use instead of point." \\footskip .125in ") (insert cal-tex-righthead) - (insert "\\long\\def\\rightday#1#2#3#4#5{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox to 2.75in{% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% - \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} -") + (cal-tex-rightday "2.75in") + ;; FIXME this is just (cal-tex-rightday "1.8in"). (insert "\\long\\def\\weekend#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% @@ -1079,15 +1094,7 @@ position to use instead of point." \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} ") (insert cal-tex-lefthead) - (insert "\\long\\def\\leftday#1#2#3#4#5{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox to 2.75in{% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\noindent {\\normalsize \\bf #2} \\small #1 \\hfill #5}% - \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em #4}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} -") + (cal-tex-leftday "2.75in") (cal-tex-b-document) (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) @@ -1215,25 +1222,9 @@ Optional EVENT indicates a buffer position to use instead of point." (cal-tex-preamble "twoside") (cal-tex-filofax-paper) (insert cal-tex-righthead) - (insert "\\long\\def\\rightday#1#2#3#4#5{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox to 0.7in{% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% - \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} -") + (cal-tex-rightday "0.7in") (insert cal-tex-lefthead) - (insert "\\long\\def\\leftday#1#2#3#4#5{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox to 0.7in{% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\noindent {\\normalsize \\bf #2} \\small #1 \\hfill #5}% - \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em #4}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} -") + (cal-tex-leftday "0.7in") (cal-tex-b-document) (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) @@ -1303,15 +1294,8 @@ Optional EVENT indicates a buffer position to use instead of point." (cal-tex-preamble "twoside") (cal-tex-filofax-paper) (insert cal-tex-righthead) - (insert "\\long\\def\\rightday#1#2#3#4#5{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox to 1.85in{% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% - \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} -") + (cal-tex-rightday "1.85in") + ;; FIXME this is just (cal-tex-rightday "0.8in"). (insert "\\long\\def\\weekend#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% @@ -1322,15 +1306,7 @@ Optional EVENT indicates a buffer position to use instead of point." \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} ") (insert cal-tex-lefthead) - (insert "\\long\\def\\leftday#1#2#3#4#5{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox to 1.85in{% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\noindent {\\normalsize \\bf #2} \\small #1 \\hfill #5}% - \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em #4}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} -") + (cal-tex-leftday "1.85in") (cal-tex-b-document) (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) @@ -1437,6 +1413,7 @@ Optional EVENT indicates a buffer position to use instead of point." (cal-tex-preamble "twoside") (cal-tex-filofax-paper) (insert cal-tex-righthead) + ;; Not quite cal-tex-rightday. (insert "\\long\\def\\rightday#1#2#3{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% @@ -1446,6 +1423,7 @@ Optional EVENT indicates a buffer position to use instead of point." \\hbox to \\textwidth{\\vbox {\\raggedleft \\em #2}}% \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}} ") + ;; FIXME this is just \rightday from above. (insert "\\long\\def\\weekend#1#2#3{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% @@ -1456,6 +1434,7 @@ Optional EVENT indicates a buffer position to use instead of point." \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}} ") (insert cal-tex-lefthead) + ;; Not quite cal-tex-leftday. (insert "\\long\\def\\leftday#1#2#3{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% From 5481664ac42e532f7636941e29cf31b3163587c6 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Tue, 21 Aug 2012 11:27:07 +0200 Subject: [PATCH 062/212] For selected window have (set-)window-point always operate on buffer's point. * window.c (Fwindow_point): For the selected window always return the position of its buffer's point. (Fset_window_point): For the selected window always go in its buffer to the specified position. * window.el (window-point-1, set-window-point-1): Remove. (window-in-direction, record-window-buffer) (set-window-buffer-start-and-point, split-window-below) (window--state-get-1, display-buffer-record-window): Replace calls to window-point-1 and set-window-point-1 by calls to window-point and set-window-point respectively. --- lisp/ChangeLog | 9 +++++++++ lisp/window.el | 40 +++++++--------------------------------- src/ChangeLog | 7 +++++++ src/window.c | 50 ++++++++++++++++++++++++++++++-------------------- 4 files changed, 53 insertions(+), 53 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 11bdce9a230..3098d1657fc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2012-08-21 Martin Rudalics + + * window.el (window-point-1, set-window-point-1): Remove. + (window-in-direction, record-window-buffer) + (set-window-buffer-start-and-point, split-window-below) + (window--state-get-1, display-buffer-record-window): Replace + calls to window-point-1 and set-window-point-1 by calls to + window-point and set-window-point respectively. + 2012-08-21 Glenn Morris * calendar/cal-tex.el (cal-tex-leftday, cal-tex-rightday): diff --git a/lisp/window.el b/lisp/window.el index 142e80e1666..f6209730a7a 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -1062,32 +1062,6 @@ windows nor the buffer list." (dolist (walk-windows-window (window-list-1 nil minibuf all-frames)) (funcall fun walk-windows-window)))) -(defun window-point-1 (&optional window) - "Return value of WINDOW's point. -WINDOW can be any live window and defaults to the selected one. - -This function is like `window-point' with one exception: If -WINDOW is selected, it returns the value of `point' of WINDOW's -buffer regardless of whether that buffer is current or not." - (setq window (window-normalize-window window t)) - (if (eq window (selected-window)) - (with-current-buffer (window-buffer window) - (point)) - (window-point window))) - -(defun set-window-point-1 (window pos) - "Set value of WINDOW's point to POS. -WINDOW can be any live window and defaults to the selected one. - -This function is like `set-window-point' with one exception: If -WINDOW is selected, it moves `point' of WINDOW's buffer to POS -regardless of whether that buffer is current or not." - (setq window (window-normalize-window window t)) - (if (eq window (selected-window)) - (with-current-buffer (window-buffer window) - (goto-char pos)) - (set-window-point window pos))) - (defun window-at-side-p (&optional window side) "Return t if WINDOW is at SIDE of its containing frame. WINDOW must be a valid window and defaults to the selected one. @@ -1146,7 +1120,7 @@ IGNORE non-nil means a window can be returned even if its (last (+ first (if hor (window-total-width window) (window-total-height window)))) - (posn-cons (nth 6 (posn-at-point (window-point-1 window) window))) + (posn-cons (nth 6 (posn-at-point (window-point window) window))) ;; The column / row value of `posn-at-point' can be nil for the ;; mini-window, guard against that. (posn (if hor @@ -2613,7 +2587,7 @@ WINDOW must be a live window and defaults to the selected one." ;; Add an entry for buffer to WINDOW's previous buffers. (with-current-buffer buffer (let ((start (window-start window)) - (point (window-point-1 window))) + (point (window-point window))) (setq entry (cons buffer (if entry @@ -2657,7 +2631,7 @@ before was current this also makes BUFFER the current buffer." ;; Don't force window-start here (even if POINT is nil). (set-window-start window start t)) (when point - (set-window-point-1 window point)))) + (set-window-point window point)))) (defcustom switch-to-visible-buffer t "If non-nil, allow switching to an already visible buffer. @@ -3393,7 +3367,7 @@ Otherwise, the window starts are chosen so as to minimize the amount of redisplay; this is convenient on slow terminals." (interactive "P") (let ((old-window (selected-window)) - (old-point (window-point-1)) + (old-point (window-point)) (size (and size (prefix-numeric-value size))) moved-by-window-height moved new-window bottom) (when (and size (< size 0) (< (- size) window-min-height)) @@ -3418,7 +3392,7 @@ amount of redisplay; this is convenient on slow terminals." (setq bottom (point))) (and moved-by-window-height (<= bottom (point)) - (set-window-point-1 old-window (1- bottom))) + (set-window-point old-window (1- bottom))) (and moved-by-window-height (<= (window-start new-window) old-point) (set-window-point new-window old-point) @@ -3727,7 +3701,7 @@ specific buffers." `((parameters . ,list)))) ,@(when buffer ;; All buffer related things go in here. - (let ((point (window-point-1 window)) + (let ((point (window-point window)) (start (window-start window))) `((buffer ,(buffer-name buffer) @@ -4020,7 +3994,7 @@ element is BUFFER." (list 'other ;; A quadruple of WINDOW's buffer, start, point and height. (list (window-buffer window) (window-start window) - (window-point-1 window) (window-total-size window)) + (window-point window) (window-total-size window)) (selected-window) buffer)))) ((eq type 'window) ;; WINDOW has been created on an existing frame. diff --git a/src/ChangeLog b/src/ChangeLog index 5a7c6923029..15eac722f8e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2012-08-21 Martin Rudalics + + * window.c (Fwindow_point): For the selected window always return + the position of its buffer's point. + (Fset_window_point): For the selected window always go in its + buffer to the specified position. + 2012-08-21 Dmitry Antipov Setter macros for fontsets. diff --git a/src/window.c b/src/window.c index 9045721009d..4d92566b243 100644 --- a/src/window.c +++ b/src/window.c @@ -1407,22 +1407,21 @@ DEFUN ("window-point", Fwindow_point, Swindow_point, 0, 1, 0, doc: /* Return current value of point in WINDOW. WINDOW must be a live window and defaults to the selected one. -For a nonselected window, this is the value point would have -if that window were selected. +For a nonselected window, this is the value point would have if that +window were selected. -Note that, when WINDOW is the selected window and its buffer -is also currently selected, the value returned is the same as (point). -It would be more strictly correct to return the `top-level' value -of point, outside of any save-excursion forms. -But that is hard to define. */) +Note that, when WINDOW is selected, the value returned is the same as +that returned by `point' for WINDOW's buffer. It would be more strictly +correct to return the `top-level' value of `point', outside of any +`save-excursion' forms. But that is hard to define. */) (Lisp_Object window) { register struct window *w = decode_live_window (window); - if (w == XWINDOW (selected_window) - && current_buffer == XBUFFER (w->buffer)) - return Fpoint (); - return Fmarker_position (w->pointm); + if (w == XWINDOW (selected_window)) + return make_number (BUF_PT (XBUFFER (w->buffer))); + else + return Fmarker_position (w->pointm); } DEFUN ("window-start", Fwindow_start, Swindow_start, 0, 1, 0, @@ -1532,16 +1531,27 @@ Return POS. */) register struct window *w = decode_live_window (window); CHECK_NUMBER_COERCE_MARKER (pos); - if (w == XWINDOW (selected_window) - && XBUFFER (w->buffer) == current_buffer) - Fgoto_char (pos); - else - set_marker_restricted (w->pointm, pos, w->buffer); - /* We have to make sure that redisplay updates the window to show - the new value of point. */ - if (!EQ (window, selected_window)) - ++windows_or_buffers_changed; + if (w == XWINDOW (selected_window)) + { + if (XBUFFER (w->buffer) == current_buffer) + Fgoto_char (pos); + else + { + struct buffer *old_buffer = current_buffer; + + set_buffer_internal (XBUFFER (w->buffer)); + Fgoto_char (pos); + set_buffer_internal (old_buffer); + } + } + else + { + set_marker_restricted (w->pointm, pos, w->buffer); + /* We have to make sure that redisplay updates the window to show + the new value of point. */ + ++windows_or_buffers_changed; + } return pos; } From 342dac71b199ededa5fe250b6cf12775394112b7 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Tue, 21 Aug 2012 11:50:58 +0200 Subject: [PATCH 063/212] Document recent changes for select-window, window-point and set-window-point. * windows.texi (Window Point): Document recent changes in window-point and set-window-point. (Selecting Windows): Document recent change in select-window. --- doc/lispref/ChangeLog | 6 ++++++ doc/lispref/windows.texi | 30 ++++++++++++++---------------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 6579cc48fd5..c014c0fce45 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,9 @@ +2012-08-21 Martin Rudalics + + * windows.texi (Window Point): Document recent changes in + window-point and set-window-point. + (Selecting Windows): Document recent change in select-window. + 2012-08-06 Eli Zaretskii * functions.texi (Closures): Put the main index entry for diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index c7c466c7d36..ba2a944215d 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -1129,16 +1129,15 @@ are the opposite of what they are in those other functions. @defun select-window window &optional norecord This function makes @var{window} the selected window, as well as the -window selected within its frame (@pxref{Basic Windows}). -@var{window} must be a live window. Unless @var{window} already is the -selected window, its buffer becomes the current buffer (@pxref{Buffers -and Windows}). The return value is @var{window}. +window selected within its frame (@pxref{Basic Windows}). @var{window} +must be a live window. This function makes also @var{window}'s buffer +current (@pxref{Buffers and Windows}). The return value is +@var{window}. -By default, this function also moves @var{window}'s selected buffer to -the front of the buffer list (@pxref{The Buffer List}), and makes -@var{window} the most recently selected window. However, if the -optional argument @var{norecord} is non-@code{nil}, these additional -actions are omitted. +By default, this function also moves @var{window}'s buffer to the front +of the buffer list (@pxref{The Buffer List}), and makes @var{window} the +most recently selected window. However, if the optional argument +@var{norecord} is non-@code{nil}, these additional actions are omitted. @end defun @cindex most recently selected windows @@ -2276,19 +2275,18 @@ For a nonselected window, this is the value point would have (in that window's buffer) if that window were selected. The default for @var{window} is the selected window. -When @var{window} is the selected window and its buffer is also the -current buffer, the value returned is the same as point in that buffer. -Strictly speaking, it would be more correct to return the ``top-level'' -value of point, outside of any @code{save-excursion} forms. But that -value is hard to find. +When @var{window} is the selected window, the value returned is the +value of point in that window's buffer. Strictly speaking, it would be +more correct to return the ``top-level'' value of point, outside of any +@code{save-excursion} forms. But that value is hard to find. @end defun @defun set-window-point window position This function positions point in @var{window} at position @var{position} in @var{window}'s buffer. It returns @var{position}. -If @var{window} is selected, and its buffer is current, -this simply does @code{goto-char}. +If @var{window} is selected, this simply does @code{goto-char} in +@var{window}'s buffer. @end defun @defvar window-point-insertion-type From 0e733db9150ea50dc1a3687a0898d6264c4cabd8 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 21 Aug 2012 06:17:31 -0400 Subject: [PATCH 064/212] Auto-commit of generated files. --- autogen/Makefile.in | 1 + autogen/configure | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/autogen/Makefile.in b/autogen/Makefile.in index 16af943f331..ebcbed86fc7 100644 --- a/autogen/Makefile.in +++ b/autogen/Makefile.in @@ -561,6 +561,7 @@ LIB_MATH = @LIB_MATH@ LIB_PTHREAD = @LIB_PTHREAD@ LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@ LIB_STANDARD = @LIB_STANDARD@ +LN_S = @LN_S@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ M17N_FLT_CFLAGS = @M17N_FLT_CFLAGS@ diff --git a/autogen/configure b/autogen/configure index 7efbd25f0d6..7a94dcb7598 100755 --- a/autogen/configure +++ b/autogen/configure @@ -1224,6 +1224,7 @@ HAVE_MAKEINFO PAXCTL GZIP_PROG INSTALL_INFO +LN_S GNULIB_WARN_CFLAGS WARN_CFLAGS WERROR_CFLAGS @@ -7758,6 +7759,17 @@ fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + # Extract the first word of "install-info", so it can be a program name with args. set dummy install-info; ac_word=$2 From 086ca913a8495b1d4f0d7eae58aea75f2f5e44ae Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Tue, 21 Aug 2012 14:21:04 +0400 Subject: [PATCH 065/212] Avoid direct writes to contents member of struct Lisp_Vector. * lisp.h (vcopy): New function to copy data into vector. * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET. * fns.c (Ffillarray): Use ASET. * keyboard.c (timer_check_2): Use AREF and ASET. (append_tool_bar_item, Frecent_keys): Use vcopy. * lread.c (read_vector): Use ASET. * msdos.c (Frecent_doskeys): Use vcopy. * xface.c (Finternal_copy_lisp_face): Use vcopy. (Finternal_merge_in_global_face): Use ASET and vcopy. * xfont.c (xfont_list_pattern): Likewise. --- src/ChangeLog | 14 +++++++++++ src/dispnew.c | 63 ++++++++++++++++++++++++++------------------------ src/fns.c | 8 ++----- src/keyboard.c | 20 +++++++--------- src/lisp.h | 14 +++++++++++ src/lread.c | 6 ++--- src/msdos.c | 8 +++---- src/xfaces.c | 9 ++++---- src/xfont.c | 8 +++---- 9 files changed, 86 insertions(+), 64 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 15eac722f8e..75853f3d354 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,17 @@ +2012-08-21 Dmitry Antipov + + Avoid direct writes to contents member of struct Lisp_Vector. + * lisp.h (vcopy): New function to copy data into vector. + * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET. + * fns.c (Ffillarray): Use ASET. + * keyboard.c (timer_check_2): Use AREF and ASET. + (append_tool_bar_item, Frecent_keys): Use vcopy. + * lread.c (read_vector): Use ASET. + * msdos.c (Frecent_doskeys): Use vcopy. + * xface.c (Finternal_copy_lisp_face): Use vcopy. + (Finternal_merge_in_global_face): Use ASET and vcopy. + * xfont.c (xfont_list_pattern): Likewise. + 2012-08-21 Martin Rudalics * window.c (Fwindow_point): For the selected window always return diff --git a/src/dispnew.c b/src/dispnew.c index 8db4f93dc70..ce7c4ebcb4c 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -6044,8 +6044,7 @@ pass nil for VARIABLE. */) (Lisp_Object variable) { Lisp_Object state, tail, frame, buf; - Lisp_Object *vecp, *end; - ptrdiff_t n; + ptrdiff_t n, idx; if (! NILP (variable)) { @@ -6057,18 +6056,16 @@ pass nil for VARIABLE. */) else state = frame_and_buffer_state; - vecp = XVECTOR (state)->contents; - end = vecp + ASIZE (state); - + idx = 0; FOR_EACH_FRAME (tail, frame) { - if (vecp == end) + if (idx == ASIZE (state)) goto changed; - if (!EQ (*vecp++, frame)) + if (!EQ (AREF (state, idx++), frame)) goto changed; - if (vecp == end) + if (idx == ASIZE (state)) goto changed; - if (!EQ (*vecp++, XFRAME (frame)->name)) + if (!EQ (AREF (state, idx++), XFRAME (frame)->name)) goto changed; } /* Check that the buffer info matches. */ @@ -6078,23 +6075,23 @@ pass nil for VARIABLE. */) /* Ignore buffers that aren't included in buffer lists. */ if (SREF (BVAR (XBUFFER (buf), name), 0) == ' ') continue; - if (vecp == end) + if (idx == ASIZE (state)) goto changed; - if (!EQ (*vecp++, buf)) + if (!EQ (AREF (state, idx++), buf)) goto changed; - if (vecp == end) + if (idx == ASIZE (state)) goto changed; - if (!EQ (*vecp++, BVAR (XBUFFER (buf), read_only))) + if (!EQ (AREF (state, idx++), BVAR (XBUFFER (buf), read_only))) goto changed; - if (vecp == end) + if (idx == ASIZE (state)) goto changed; - if (!EQ (*vecp++, Fbuffer_modified_p (buf))) + if (!EQ (AREF (state, idx++), Fbuffer_modified_p (buf))) goto changed; } - if (vecp == end) + if (idx == ASIZE (state)) goto changed; /* Detect deletion of a buffer at the end of the list. */ - if (EQ (*vecp, Qlambda)) + if (EQ (AREF (state, idx), Qlambda)) return Qnil; /* Come here if we decide the data has changed. */ @@ -6121,11 +6118,13 @@ pass nil for VARIABLE. */) } /* Record the new data in the (possibly reallocated) vector. */ - vecp = XVECTOR (state)->contents; + idx = 0; FOR_EACH_FRAME (tail, frame) { - *vecp++ = frame; - *vecp++ = XFRAME (frame)->name; + ASET (state, idx, frame); + idx++; + ASET (state, idx, XFRAME (frame)->name); + idx++; } for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) { @@ -6133,19 +6132,23 @@ pass nil for VARIABLE. */) /* Ignore buffers that aren't included in buffer lists. */ if (SREF (BVAR (XBUFFER (buf), name), 0) == ' ') continue; - *vecp++ = buf; - *vecp++ = BVAR (XBUFFER (buf), read_only); - *vecp++ = Fbuffer_modified_p (buf); + ASET (state, idx, buf); + idx++; + ASET (state, idx, BVAR (XBUFFER (buf), read_only)); + idx++; + ASET (state, idx, Fbuffer_modified_p (buf)); + idx++; } /* Fill up the vector with lambdas (always at least one). */ - *vecp++ = Qlambda; - while (vecp - XVECTOR (state)->contents - < ASIZE (state)) - *vecp++ = Qlambda; + ASET (state, idx, Qlambda); + idx++; + while (idx < ASIZE (state)) + { + ASET (state, idx, Qlambda); + idx++; + } /* Make sure we didn't overflow the vector. */ - if (vecp - XVECTOR (state)->contents - > ASIZE (state)) - abort (); + eassert (idx <= ASIZE (state)); return Qt; } diff --git a/src/fns.c b/src/fns.c index 79f8e233fb5..34238e4cd6a 100644 --- a/src/fns.c +++ b/src/fns.c @@ -2139,12 +2139,8 @@ ARRAY is a vector, string, char-table, or bool-vector. */) register ptrdiff_t size, idx; if (VECTORP (array)) - { - register Lisp_Object *p = XVECTOR (array)->contents; - size = ASIZE (array); - for (idx = 0; idx < size; idx++) - p[idx] = item; - } + for (idx = 0, size = ASIZE (array); idx < size; idx++) + ASET (array, idx, item); else if (CHAR_TABLE_P (array)) { int i; diff --git a/src/keyboard.c b/src/keyboard.c index 868d0c8d2c1..3d4061accfc 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -4419,7 +4419,6 @@ timer_check_2 (void) while (CONSP (timers) || CONSP (idle_timers)) { - Lisp_Object *vector; Lisp_Object timer = Qnil, idle_timer = Qnil; EMACS_TIME timer_time, idle_timer_time; EMACS_TIME difference; @@ -4495,15 +4494,14 @@ timer_check_2 (void) /* If timer is ripe, run it if it hasn't been run. */ if (ripe) { - vector = XVECTOR (chosen_timer)->contents; - if (NILP (vector[0])) + if (NILP (AREF (chosen_timer, 0))) { ptrdiff_t count = SPECPDL_INDEX (); Lisp_Object old_deactivate_mark = Vdeactivate_mark; /* Mark the timer as triggered to prevent problems if the lisp code fails to reschedule it right. */ - vector[0] = Qt; + ASET (chosen_timer, 0, Qt); specbind (Qinhibit_quit, Qt); @@ -8447,7 +8445,6 @@ init_tool_bar_items (Lisp_Object reuse) static void append_tool_bar_item (void) { - Lisp_Object *to, *from; ptrdiff_t incr = (ntool_bar_items - (ASIZE (tool_bar_items_vector) - TOOL_BAR_ITEM_NSLOTS)); @@ -8459,9 +8456,8 @@ append_tool_bar_item (void) /* Append entries from tool_bar_item_properties to the end of tool_bar_items_vector. */ - to = XVECTOR (tool_bar_items_vector)->contents + ntool_bar_items; - from = XVECTOR (tool_bar_item_properties)->contents; - memcpy (to, from, TOOL_BAR_ITEM_NSLOTS * sizeof *to); + vcopy (tool_bar_items_vector, ntool_bar_items, + XVECTOR (tool_bar_item_properties)->contents, TOOL_BAR_ITEM_NSLOTS); ntool_bar_items += TOOL_BAR_ITEM_NSLOTS; } @@ -10490,10 +10486,10 @@ DEFUN ("recent-keys", Frecent_keys, Srecent_keys, 0, 0, 0, else { val = Fvector (NUM_RECENT_KEYS, keys); - memcpy (XVECTOR (val)->contents, keys + recent_keys_index, - (NUM_RECENT_KEYS - recent_keys_index) * word_size); - memcpy (XVECTOR (val)->contents + NUM_RECENT_KEYS - recent_keys_index, - keys, recent_keys_index * word_size); + vcopy (val, 0, keys + recent_keys_index, + NUM_RECENT_KEYS - recent_keys_index); + vcopy (val, NUM_RECENT_KEYS - recent_keys_index, + keys, recent_keys_index); return val; } } diff --git a/src/lisp.h b/src/lisp.h index 3a6eb72d020..587e584b091 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2344,6 +2344,20 @@ gc_aset (Lisp_Object array, ptrdiff_t idx, Lisp_Object val) XVECTOR (array)->contents[idx] = val; } +/* Copy COUNT Lisp_Objects from ARGS to contents of V starting from OFFSET. */ + +LISP_INLINE void +vcopy (Lisp_Object v, ptrdiff_t offset, Lisp_Object *args, ptrdiff_t count) +{ + ptrdiff_t i; + + eassert (offset + count <= ASIZE (v)); + for (i = 0; i < count; i++) + ASET (v, offset + i, args[i]); +} + +/* Functions to modify hash tables. */ + LISP_INLINE void set_hash_key_and_value (struct Lisp_Hash_Table *h, Lisp_Object key_and_value) { diff --git a/src/lread.c b/src/lread.c index e2ad03b349f..f3ab1610d2c 100644 --- a/src/lread.c +++ b/src/lread.c @@ -3406,7 +3406,7 @@ read_vector (Lisp_Object readcharfun, int bytecodeflag) /* Delay handling the bytecode slot until we know whether it is lazily-loaded (we can tell by whether the constants slot is nil). */ - ptr[COMPILED_CONSTANTS] = item; + ASET (vector, COMPILED_CONSTANTS, item); item = Qnil; } else if (i == COMPILED_CONSTANTS) @@ -3432,7 +3432,7 @@ read_vector (Lisp_Object readcharfun, int bytecodeflag) } /* Now handle the bytecode slot. */ - ptr[COMPILED_BYTECODE] = bytestr; + ASET (vector, COMPILED_BYTECODE, bytestr); } else if (i == COMPILED_DOC_STRING && STRINGP (item) @@ -3444,7 +3444,7 @@ read_vector (Lisp_Object readcharfun, int bytecodeflag) item = Fstring_as_multibyte (item); } } - ptr[i] = item; + ASET (vector, i, item); otem = XCONS (tem); tem = Fcdr (tem); free_cons (otem); diff --git a/src/msdos.c b/src/msdos.c index 30435820d9e..a214456d104 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -2434,10 +2434,10 @@ and then the scan code. */) else { val = Fvector (NUM_RECENT_DOSKEYS, keys); - memcpy (XVECTOR (val)->contents, keys + recent_doskeys_index, - (NUM_RECENT_DOSKEYS - recent_doskeys_index) * word_size); - memcpy (XVECTOR (val)->contents + NUM_RECENT_DOSKEYS - recent_doskeys_index, - keys, recent_doskeys_index * word_size); + vcopy (val, 0, keys + recent_doskeys_index, + NUM_RECENT_DOSKEYS - recent_doskeys_index); + vcopy (val, NUM_RECENT_DOSKEYS - recent_doskeys_index, + keys, recent_doskeys_index); return val; } } diff --git a/src/xfaces.c b/src/xfaces.c index 46121d66606..820d764d0a8 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -2781,8 +2781,7 @@ The value is TO. */) copy = Finternal_make_lisp_face (to, new_frame); } - memcpy (XVECTOR (copy)->contents, XVECTOR (lface)->contents, - LFACE_VECTOR_SIZE * word_size); + vcopy (copy, 0, XVECTOR (lface)->contents, LFACE_VECTOR_SIZE); /* Changing a named face means that all realized faces depending on that face are invalid. Since we cannot tell which realized faces @@ -3831,9 +3830,9 @@ Default face attributes override any local face attributes. */) gvec = XVECTOR (global_lface)->contents; for (i = 1; i < LFACE_VECTOR_SIZE; ++i) if (IGNORE_DEFFACE_P (gvec[i])) - lvec[i] = Qunspecified; + ASET (local_lface, i, Qunspecified); else if (! UNSPECIFIEDP (gvec[i])) - lvec[i] = gvec[i]; + ASET (local_lface, i, AREF (global_lface, i)); /* If the default face was changed, update the face cache and the `font' frame parameter. */ @@ -3850,7 +3849,7 @@ Default face attributes override any local face attributes. */) the previously-cached vector. */ memcpy (attrs, oldface->lface, sizeof attrs); merge_face_vectors (f, lvec, attrs, 0); - memcpy (lvec, attrs, sizeof attrs); + vcopy (local_lface, 0, attrs, LFACE_VECTOR_SIZE); newface = realize_face (c, lvec, DEFAULT_FACE_ID); if ((! UNSPECIFIEDP (gvec[LFACE_FAMILY_INDEX]) diff --git a/src/xfont.c b/src/xfont.c index 072bce7bb0a..cbb24622ae9 100644 --- a/src/xfont.c +++ b/src/xfont.c @@ -390,7 +390,7 @@ xfont_list_pattern (Display *display, const char *pattern, Lisp_Object scripts = Qnil; for (i = 0; i < ASIZE (xfont_scratch_props); i++) - props[i] = Qnil; + ASET (xfont_scratch_props, i, Qnil); for (i = 0; i < num_fonts; i++) indices[i] = names[i]; qsort (indices, num_fonts, sizeof (char *), compare_font_names); @@ -467,9 +467,9 @@ xfont_list_pattern (Display *display, const char *pattern, word_size * 7) || ! EQ (AREF (entity, FONT_SPACING_INDEX), props[7])) { - memcpy (props, aref_addr (entity, FONT_FOUNDRY_INDEX), - word_size * 7); - props[7] = AREF (entity, FONT_SPACING_INDEX); + vcopy (xfont_scratch_props, 0, + aref_addr (entity, FONT_FOUNDRY_INDEX), 7); + ASET (xfont_scratch_props, 7, AREF (entity, FONT_SPACING_INDEX)); scripts = xfont_supported_scripts (display, indices[i], xfont_scratch_props, encoding); } From 01b13eb7fae39e64a3a6e2a0f5ef4ec058d16363 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 21 Aug 2012 07:37:56 -0700 Subject: [PATCH 066/212] Merge from gnulib. --- ChangeLog | 5 +++++ m4/extern-inline.m4 | 30 ++++++++++++++++++++++-------- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 16afbdd3c99..4f339482a98 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-08-21 Paul Eggert + + Merge from gnulib, incorporating: + 2012-08-20 extern-inline: support old GCC 'inline' + 2012-08-20 Glenn Morris * configure.ac (AC_PROG_LN_S): Test for ln. diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4 index 187a33599a3..12f24fab95f 100644 --- a/m4/extern-inline.m4 +++ b/m4/extern-inline.m4 @@ -21,20 +21,34 @@ AC_DEFUN([gl_EXTERN_INLINE], #if __GNUC__ ? __GNUC_STDC_INLINE__ : 199901L <= __STDC_VERSION__ # define _GL_INLINE inline # define _GL_EXTERN_INLINE extern inline -# if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ -# define _GL_INLINE_HEADER_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") -# define _GL_INLINE_HEADER_END \ - _Pragma ("GCC diagnostic pop") +#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# if __GNUC_GNU_INLINE__ + /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ +# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) +# else +# define _GL_INLINE extern inline # endif +# define _GL_EXTERN_INLINE extern #else # define _GL_INLINE static inline # define _GL_EXTERN_INLINE static inline #endif -#ifndef _GL_INLINE_HEADER_BEGIN +#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) +# if __GNUC_STDC_INLINE__ +# define _GL_INLINE_HEADER_CONST_PRAGMA +# else +# define _GL_INLINE_HEADER_CONST_PRAGMA \ + _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") +# endif +# define _GL_INLINE_HEADER_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \ + _GL_INLINE_HEADER_CONST_PRAGMA +# define _GL_INLINE_HEADER_END \ + _Pragma ("GCC diagnostic pop") +#else # define _GL_INLINE_HEADER_BEGIN # define _GL_INLINE_HEADER_END #endif]) From 9b994fed3cc7af2cd748f92316e75d962b545728 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 21 Aug 2012 09:54:50 -0700 Subject: [PATCH 067/212] * dbusbind.c (xd_remove_watch): Do not assume C99 comments. --- src/ChangeLog | 4 ++++ src/dbusbind.c | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 75853f3d354..b8da88f3d6c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-08-21 Paul Eggert + + * dbusbind.c (xd_remove_watch): Do not assume C99 comments. + 2012-08-21 Dmitry Antipov Avoid direct writes to contents member of struct Lisp_Vector. diff --git a/src/dbusbind.c b/src/dbusbind.c index c1b1310454c..f63f2948304 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -1039,11 +1039,13 @@ xd_remove_watch (DBusWatch *watch, void *data) return; /* Unset session environment. */ +#if 0 if (XSYMBOL (QCdbus_session_bus) == data) { - // XD_DEBUG_MESSAGE ("unsetenv DBUS_SESSION_BUS_ADDRESS"); - // unsetenv ("DBUS_SESSION_BUS_ADDRESS"); + XD_DEBUG_MESSAGE ("unsetenv DBUS_SESSION_BUS_ADDRESS"); + unsetenv ("DBUS_SESSION_BUS_ADDRESS"); } +#endif if (flags & DBUS_WATCH_WRITABLE) delete_write_fd (fd); From b2f09701eadc7dfb70f331869daf295628926af6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 21 Aug 2012 20:14:08 +0300 Subject: [PATCH 068/212] Fix bug #11860 with displaying composite RTL characters on MS-Windows. src/w32uniscribe.c (uniscribe_shape): Fix producing gstring components for RTL text. Adjust X-OFFSET of each non-base glyph for the width of the base character, according to what x_draw_composite_glyph_string_foreground expects. Generate WADJUST value according to composition_gstring_width's expectations, to produce correct width of the composed character. Reverse the sign of the DU offset produced by ScriptPlace. --- src/ChangeLog | 10 ++++++++ src/w32uniscribe.c | 57 ++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 60 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index b8da88f3d6c..960639af152 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2012-08-21 Eli Zaretskii + + * w32uniscribe.c (uniscribe_shape): Fix producing gstring + components for RTL text (Bug#11860). Adjust X-OFFSET of each + non-base glyph for the width of the base character, according to + what x_draw_composite_glyph_string_foreground expects. Generate + WADJUST value according to composition_gstring_width's + expectations, to produce correct width of the composed character. + Reverse the sign of the DU offset produced by ScriptPlace. + 2012-08-21 Paul Eggert * dbusbind.c (xd_remove_watch): Do not assume C99 comments. diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c index 06f7b1bd192..50532acaff3 100644 --- a/src/w32uniscribe.c +++ b/src/w32uniscribe.c @@ -320,7 +320,23 @@ uniscribe_shape (Lisp_Object lgstring) } if (SUCCEEDED (result)) { - int j, from, to; + int j, from, to, adj_offset = 0; + + /* For RTL text, the Uniscribe shaper prepares the + values in ADVANCES array for layout in reverse order, + whereby "advance width" is applied to move the pen in + reverse direction and _before_ drawing the glyph. + Since we draw glyphs in their normal left-to-right + order, we need to adjust the coordinates of each + non-base glyph in a grapheme cluster via X-OFF + component of the gstring's ADJUSTMENT sub-vector. + This loop computes the initial value of the + adjustment for the base character, which is then + updated for each successive glyph in the grapheme + cluster. */ + if (items[i].a.fRTL) + for (j = 1; j < nglyphs; j++) + adj_offset += advances[j]; from = 0; to = from; @@ -392,9 +408,11 @@ uniscribe_shape (Lisp_Object lgstring) if (SUCCEEDED (result)) { - LGLYPH_SET_LBEARING (lglyph, char_metric.abcA); - LGLYPH_SET_RBEARING (lglyph, (char_metric.abcA - + char_metric.abcB)); + int lbearing = char_metric.abcA; + int rbearing = char_metric.abcA + char_metric.abcB; + + LGLYPH_SET_LBEARING (lglyph, lbearing); + LGLYPH_SET_RBEARING (lglyph, rbearing); } else { @@ -402,18 +420,43 @@ uniscribe_shape (Lisp_Object lgstring) LGLYPH_SET_RBEARING (lglyph, advances[j]); } - if (offsets[j].du || offsets[j].dv) + if (offsets[j].du || offsets[j].dv + /* For non-base glyphs of RTL grapheme clusters, + adjust the X offset even if both DU and DV + are zero. */ + || (!attributes[j].fClusterStart && items[i].a.fRTL)) { Lisp_Object vec; vec = Fmake_vector (make_number (3), Qnil); - ASET (vec, 0, make_number (offsets[j].du)); + if (items[i].a.fRTL) + { + /* Empirically, it looks like Uniscribe + interprets DU in reverse direction for + RTL clusters. E.g., if we don't reverse + the direction, the Hebrew point HOLAM is + drawn above the right edge of the base + consonant, instead of above the left edge. */ + ASET (vec, 0, make_number (-offsets[j].du + + adj_offset)); + /* Update the adjustment value for the width + advance of the glyph we just emitted. */ + adj_offset -= 2 * advances[j]; + } + else + ASET (vec, 0, make_number (offsets[j].du + adj_offset)); ASET (vec, 1, make_number (offsets[j].dv)); /* Based on what ftfont.c does... */ ASET (vec, 2, make_number (advances[j])); LGLYPH_SET_ADJUSTMENT (lglyph, vec); } else - LGLYPH_SET_ADJUSTMENT (lglyph, Qnil); + { + LGLYPH_SET_ADJUSTMENT (lglyph, Qnil); + /* Update the adjustment value to compensate for + the width of the base character. */ + if (items[i].a.fRTL) + adj_offset -= advances[j]; + } } } } From 1b9d9d1659f819252abb4d8f49e5fd0f7bb56efd Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 21 Aug 2012 10:18:21 -0700 Subject: [PATCH 069/212] * lisp.h (vcopy): Use memcpy rather than our own loop. This fixes a performance regression introduced by the recent addition of vcopy. This means 'vcopy' will need to be modified for a copying collector, but that's OK. Also, tighten the checking in the assertion. --- src/ChangeLog | 8 ++++++++ src/lisp.h | 7 ++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 960639af152..ffd706a9a82 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2012-08-21 Paul Eggert + + * lisp.h (vcopy): Use memcpy rather than our own loop. + This fixes a performance regression introduced by the recent + addition of vcopy. This means 'vcopy' will need to be modified + for a copying collector, but that's OK. Also, tighten the + checking in the assertion. + 2012-08-21 Eli Zaretskii * w32uniscribe.c (uniscribe_shape): Fix producing gstring diff --git a/src/lisp.h b/src/lisp.h index 587e584b091..30bbb65f4fa 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2349,11 +2349,8 @@ gc_aset (Lisp_Object array, ptrdiff_t idx, Lisp_Object val) LISP_INLINE void vcopy (Lisp_Object v, ptrdiff_t offset, Lisp_Object *args, ptrdiff_t count) { - ptrdiff_t i; - - eassert (offset + count <= ASIZE (v)); - for (i = 0; i < count; i++) - ASET (v, offset + i, args[i]); + eassert (0 <= offset && 0 <= count && offset + count <= ASIZE (v)); + memcpy (XVECTOR (v)->contents + offset, args, count * sizeof *args); } /* Functions to modify hash tables. */ From 52f56d5a54184b4e9c5147d06ec3911bf559c9b4 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 21 Aug 2012 14:15:56 -0400 Subject: [PATCH 070/212] Remove more cal-tex code duplication * calendar/cal-tex.el (cal-tex-rightday): Add optional funcname arg. (cal-tex-shortday): New function. (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-week) (cal-tex-cursor-filofax-daily): Use the above. --- lisp/ChangeLog | 5 +++ lisp/calendar/cal-tex.el | 73 ++++++++++++---------------------------- 2 files changed, 26 insertions(+), 52 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3098d1657fc..c1c8c629083 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -9,6 +9,11 @@ 2012-08-21 Glenn Morris + * calendar/cal-tex.el (cal-tex-rightday): Add optional funcname arg. + (cal-tex-shortday): New function. + (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-week) + (cal-tex-cursor-filofax-daily): Use the above. + * calendar/cal-tex.el (cal-tex-leftday, cal-tex-rightday): New functions. (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-2week) diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index 1a64edc2071..4e32407c158 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -268,6 +268,7 @@ Optional string ARGS are included as options for the article document class." ""))) (if (stringp cal-tex-preamble-extra) (insert cal-tex-preamble-extra "\n")) + ;; FIXME boxwidth and boxheight unused? (insert "\\hbadness 20000 \\hfuzz=1000pt \\vbadness 20000 @@ -381,9 +382,9 @@ landscape mode with three rows of four months each." \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em #4}}% \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}\n")) -(defun cal-tex-rightday (height) +(defun cal-tex-rightday (height &optional funcname) "Insert LaTeX code for rightday function." - (insert "\\long\\def\\rightday#1#2#3#4#5{% + (insert "\\long\\def\\" (or funcname "rightday") "#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox to " height "{% @@ -392,6 +393,19 @@ landscape mode with three rows of four months each." \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}\n")) +(defun cal-tex-shortday (funcname) + "Insert LaTeX code for a short day function." + (insert "\\long\\def\\" funcname "#1#2#3{% + \\rule{\\textwidth}{0.3pt}\\\\% + \\hbox to \\textwidth{% + \\vbox {% + \\vspace*{2pt}% + \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}% + \\hbox to \\textwidth{\\vbox {\\" + (if (string-equal funcname "rightday") "raggedleft" "noindent") + " \\em #2}}% + \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}}\n")) + ;;;###cal-autoload (defun cal-tex-cursor-filofax-year (&optional n event) "Make a Filofax one page yearly calendar of year indicated by cursor. @@ -1083,16 +1097,7 @@ position to use instead of point." ") (insert cal-tex-righthead) (cal-tex-rightday "2.75in") - ;; FIXME this is just (cal-tex-rightday "1.8in"). - (insert "\\long\\def\\weekend#1#2#3#4#5{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox to 1.8in{% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% - \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} -") + (cal-tex-rightday "1.8in" "weekend") (insert cal-tex-lefthead) (cal-tex-leftday "2.75in") (cal-tex-b-document) @@ -1295,16 +1300,7 @@ Optional EVENT indicates a buffer position to use instead of point." (cal-tex-filofax-paper) (insert cal-tex-righthead) (cal-tex-rightday "1.85in") - ;; FIXME this is just (cal-tex-rightday "0.8in"). - (insert "\\long\\def\\weekend#1#2#3#4#5{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox to .8in{% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% - \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} -") + (cal-tex-rightday "0.8in" "weekend") (insert cal-tex-lefthead) (cal-tex-leftday "1.85in") (cal-tex-b-document) @@ -1413,37 +1409,10 @@ Optional EVENT indicates a buffer position to use instead of point." (cal-tex-preamble "twoside") (cal-tex-filofax-paper) (insert cal-tex-righthead) - ;; Not quite cal-tex-rightday. - (insert "\\long\\def\\rightday#1#2#3{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox {% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}% - \\hbox to \\textwidth{\\vbox {\\raggedleft \\em #2}}% - \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}} -") - ;; FIXME this is just \rightday from above. - (insert "\\long\\def\\weekend#1#2#3{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox {% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}% - \\hbox to \\textwidth{\\vbox {\\noindent \\em #2}}% - \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}} -") + (cal-tex-shortday "rightday") + (cal-tex-shortday "weekend") (insert cal-tex-lefthead) - ;; Not quite cal-tex-leftday. - (insert "\\long\\def\\leftday#1#2#3{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox {% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}% - \\hbox to \\textwidth{\\vbox {\\noindent \\em #2}}% - \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}} -") + (cal-tex-shortday "leftday") (insert "\\newbox\\LineBox \\setbox\\LineBox=\\hbox to\\textwidth{% \\vrule height.2in width0pt\\leaders\\hrule\\hfill} From b7fa26919ec7a5d17022cdf21afbab01ca769db5 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 21 Aug 2012 14:27:14 -0400 Subject: [PATCH 071/212] Remove yet more cal-tex code duplication * lisp/calendar/cal-tex.el (cal-tex-weekly-common): New function. (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-week): Use it. --- lisp/ChangeLog | 4 + lisp/calendar/cal-tex.el | 327 ++++++--------------------------------- 2 files changed, 49 insertions(+), 282 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c1c8c629083..3eda0b626a3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -9,6 +9,10 @@ 2012-08-21 Glenn Morris + * calendar/cal-tex.el (cal-tex-weekly-common): New function. + (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-week): + Use it. + * calendar/cal-tex.el (cal-tex-rightday): Add optional funcname arg. (cal-tex-shortday): New function. (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-week) diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index 4e32407c158..b5c92a3b0e8 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -1060,16 +1060,8 @@ shown are hard-coded to 8-12, 13-17." (cal-tex-e-framebox) (cal-tex-hspace "1cm"))) -;;;###cal-autoload -(defun cal-tex-cursor-week-at-a-glance (&optional n event) - "One-week-at-a-glance full page calendar for week indicated by cursor. -Optional prefix argument N specifies number of weeks (default 1), -starting on Mondays. The calendar shows holiday and diary entries -if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil. -It does not show hours of the day. Optional EVENT indicates a buffer -position to use instead of point." - (interactive (list (prefix-numeric-value current-prefix-arg) - last-nonmenu-event)) +(defun cal-tex-weekly-common (n event &optional filofax) + "Common code for weekly calendars." (or n (setq n 1)) (let* ((date (calendar-gregorian-from-absolute (calendar-dayname-on-or-before @@ -1085,6 +1077,15 @@ position to use instead of point." (holiday-in-range d1 d2))) (diary-list (if cal-tex-diary (cal-tex-list-diary-entries d1 d2)))) + (if filofax + (progn + (cal-tex-preamble "twoside") + (cal-tex-filofax-paper) + (insert cal-tex-righthead) + (cal-tex-rightday "1.85in") + (cal-tex-rightday "0.8in" "weekend") + (insert cal-tex-lefthead) + (cal-tex-leftday "1.85in")) (cal-tex-preamble "twoside,12pt") (insert "\\textwidth 7in \\textheight 10.5in @@ -1099,7 +1100,7 @@ position to use instead of point." (cal-tex-rightday "2.75in") (cal-tex-rightday "1.8in" "weekend") (insert cal-tex-lefthead) - (cal-tex-leftday "2.75in") + (cal-tex-leftday "2.75in")) (cal-tex-b-document) (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) @@ -1133,34 +1134,35 @@ position to use instead of point." (insert "%\n") (setq date (cal-tex-incr-date date))) (insert "\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n") - (cal-tex-nl) - (insert (cal-tex-mini-calendar - (calendar-extract-month (cal-tex-previous-month date)) - (calendar-extract-year (cal-tex-previous-month date)) - "lastmonth" "1.1in" "1in")) - (insert (cal-tex-mini-calendar - (calendar-extract-month date) - (calendar-extract-year date) - "thismonth" "1.1in" "1in")) - (insert (cal-tex-mini-calendar - (calendar-extract-month (cal-tex-next-month date)) - (calendar-extract-year (cal-tex-next-month date)) - "nextmonth" "1.1in" "1in")) - (insert "\\hbox to \\textwidth{") - (cal-tex-hfill) - (insert "\\lastmonth") - (cal-tex-hfill) - (insert "\\thismonth") - (cal-tex-hfill) - (insert "\\nextmonth") - (cal-tex-hfill) - (insert "}") + (unless filofax + (cal-tex-nl) + (insert (cal-tex-mini-calendar + (calendar-extract-month (cal-tex-previous-month date)) + (calendar-extract-year (cal-tex-previous-month date)) + "lastmonth" "1.1in" "1in")) + (insert (cal-tex-mini-calendar + (calendar-extract-month date) + (calendar-extract-year date) + "thismonth" "1.1in" "1in")) + (insert (cal-tex-mini-calendar + (calendar-extract-month (cal-tex-next-month date)) + (calendar-extract-year (cal-tex-next-month date)) + "nextmonth" "1.1in" "1in")) + (insert "\\hbox to \\textwidth{") + (cal-tex-hfill) + (insert "\\lastmonth") + (cal-tex-hfill) + (insert "\\thismonth") + (cal-tex-hfill) + (insert "\\nextmonth") + (cal-tex-hfill) + (insert "}")) (cal-tex-newpage) (insert "\\righthead") (cal-tex-arg (let ((d (cal-tex-incr-date date 3))) (if (= (calendar-extract-month date) - (calendar-extract-month d)) + (calendar-extract-month d)) (format "%s %s" (cal-tex-month-name (calendar-extract-month date)) (calendar-extract-year date)) @@ -1201,76 +1203,16 @@ position to use instead of point." (run-hooks 'cal-tex-hook))) ;;;###cal-autoload -(defun cal-tex-cursor-filofax-2week (&optional n event) - "Two-weeks-at-a-glance Filofax style calendar for week cursor is in. -Optional prefix argument N specifies number of weeks (default 1). -The calendar shows holiday and diary entries if -`cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil. -Optional EVENT indicates a buffer position to use instead of point." +(defun cal-tex-cursor-week-at-a-glance (&optional n event) + "One-week-at-a-glance full page calendar for week indicated by cursor. +Optional prefix argument N specifies number of weeks (default 1), +starting on Mondays. The calendar shows holiday and diary entries +if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil. +It does not show hours of the day. Optional EVENT indicates a buffer +position to use instead of point." (interactive (list (prefix-numeric-value current-prefix-arg) last-nonmenu-event)) - (or n (setq n 1)) - (let* ((date (calendar-gregorian-from-absolute - (calendar-dayname-on-or-before - calendar-week-start-day - (calendar-absolute-from-gregorian - (calendar-cursor-to-date t event))))) - (month (calendar-extract-month date)) - (year (calendar-extract-year date)) - (day (calendar-extract-day date)) - (d1 (calendar-absolute-from-gregorian date)) - (d2 (+ (* 7 n) d1)) - (holidays (if cal-tex-holidays - (holiday-in-range d1 d2))) - (diary-list (if cal-tex-diary - (cal-tex-list-diary-entries d1 d2)))) - (cal-tex-preamble "twoside") - (cal-tex-filofax-paper) - (insert cal-tex-righthead) - (cal-tex-rightday "0.7in") - (insert cal-tex-lefthead) - (cal-tex-leftday "0.7in") - (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle" "empty") - (dotimes (i n) - (if (zerop (mod i 2)) - (insert "\\righthead") - (insert "\\lefthead")) - (cal-tex-arg - (let ((d (cal-tex-incr-date date 6))) - (if (= (calendar-extract-month date) - (calendar-extract-month d)) - (format "%s %s" - (cal-tex-month-name (calendar-extract-month date)) - (calendar-extract-year date)) - (if (= (calendar-extract-year date) - (calendar-extract-year d)) - (format "%s---%s %s" - (cal-tex-month-name (calendar-extract-month date)) - (cal-tex-month-name (calendar-extract-month d)) - (calendar-extract-year date)) - (format "%s %s---%s %s" - (cal-tex-month-name (calendar-extract-month date)) - (calendar-extract-year date) - (cal-tex-month-name (calendar-extract-month d)) - (calendar-extract-year d)))))) - (insert "%\n") - (dotimes (_jdummy 7) - (if (zerop (mod i 2)) - (insert "\\rightday") - (insert "\\leftday")) - (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date))) - (cal-tex-arg (number-to-string (calendar-extract-day date))) - (cal-tex-arg (cal-tex-latexify-list diary-list date)) - (cal-tex-arg (cal-tex-latexify-list holidays date)) - (cal-tex-arg (eval cal-tex-daily-string)) - (insert "%\n") - (setq date (cal-tex-incr-date date))) - (unless (= i (1- n)) - (run-hooks 'cal-tex-week-hook) - (cal-tex-newpage))) - (cal-tex-end-document) - (run-hooks 'cal-tex-hook))) + (cal-tex-weekly-common n event)) ;;;###cal-autoload (defun cal-tex-cursor-filofax-week (&optional n event) @@ -1281,186 +1223,7 @@ if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil. Optional EVENT indicates a buffer position to use instead of point." (interactive (list (prefix-numeric-value current-prefix-arg) last-nonmenu-event)) - (or n (setq n 1)) - (let* ((date (calendar-gregorian-from-absolute - (calendar-dayname-on-or-before - 1 - (calendar-absolute-from-gregorian - (calendar-cursor-to-date t event))))) - (month (calendar-extract-month date)) - (year (calendar-extract-year date)) - (day (calendar-extract-day date)) - (d1 (calendar-absolute-from-gregorian date)) - (d2 (+ (* 7 n) d1)) - (holidays (if cal-tex-holidays - (holiday-in-range d1 d2))) - (diary-list (if cal-tex-diary - (cal-tex-list-diary-entries d1 d2)))) - (cal-tex-preamble "twoside") - (cal-tex-filofax-paper) - (insert cal-tex-righthead) - (cal-tex-rightday "1.85in") - (cal-tex-rightday "0.8in" "weekend") - (insert cal-tex-lefthead) - (cal-tex-leftday "1.85in") - (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle" "empty") - (dotimes (i n) - (insert "\\lefthead") - (cal-tex-arg - (let ((d (cal-tex-incr-date date 2))) - (if (= (calendar-extract-month date) - (calendar-extract-month d)) - (format "%s %s" - (cal-tex-month-name (calendar-extract-month date)) - (calendar-extract-year date)) - (if (= (calendar-extract-year date) - (calendar-extract-year d)) - (format "%s---%s %s" - (cal-tex-month-name (calendar-extract-month date)) - (cal-tex-month-name (calendar-extract-month d)) - (calendar-extract-year date)) - (format "%s %s---%s %s" - (cal-tex-month-name (calendar-extract-month date)) - (calendar-extract-year date) - (cal-tex-month-name (calendar-extract-month d)) - (calendar-extract-year d)))))) - (insert "%\n") - (dotimes (_jdummy 3) - (insert "\\leftday") - (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date))) - (cal-tex-arg (number-to-string (calendar-extract-day date))) - (cal-tex-arg (cal-tex-latexify-list diary-list date)) - (cal-tex-arg (cal-tex-latexify-list holidays date)) - (cal-tex-arg (eval cal-tex-daily-string)) - (insert "%\n") - (setq date (cal-tex-incr-date date))) - (insert "\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n") - (cal-tex-newpage) - (insert "\\righthead") - (cal-tex-arg - (let ((d (cal-tex-incr-date date 3))) - (if (= (calendar-extract-month date) - (calendar-extract-month d)) - (format "%s %s" - (cal-tex-month-name (calendar-extract-month date)) - (calendar-extract-year date)) - (if (= (calendar-extract-year date) - (calendar-extract-year d)) - (format "%s---%s %s" - (cal-tex-month-name (calendar-extract-month date)) - (cal-tex-month-name (calendar-extract-month d)) - (calendar-extract-year date)) - (format "%s %s---%s %s" - (cal-tex-month-name (calendar-extract-month date)) - (calendar-extract-year date) - (cal-tex-month-name (calendar-extract-month d)) - (calendar-extract-year d)))))) - (insert "%\n") - (dotimes (_jdummy 2) - (insert "\\rightday") - (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date))) - (cal-tex-arg (number-to-string (calendar-extract-day date))) - (cal-tex-arg (cal-tex-latexify-list diary-list date)) - (cal-tex-arg (cal-tex-latexify-list holidays date)) - (cal-tex-arg (eval cal-tex-daily-string)) - (insert "%\n") - (setq date (cal-tex-incr-date date))) - (dotimes (_jdummy 2) - (insert "\\weekend") - (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date))) - (cal-tex-arg (number-to-string (calendar-extract-day date))) - (cal-tex-arg (cal-tex-latexify-list diary-list date)) - (cal-tex-arg (cal-tex-latexify-list holidays date)) - (cal-tex-arg (eval cal-tex-daily-string)) - (insert "%\n") - (setq date (cal-tex-incr-date date))) - (unless (= i (1- n)) - (run-hooks 'cal-tex-week-hook) - (cal-tex-newpage))) - (cal-tex-end-document) - (run-hooks 'cal-tex-hook))) - -;;;###cal-autoload -(defun cal-tex-cursor-filofax-daily (&optional n event) - "Day-per-page Filofax style calendar for week indicated by cursor. -Optional prefix argument N specifies number of weeks (default 1), -starting on Mondays. The calendar shows holiday and diary -entries if `cal-tex-holidays' and `cal-tex-diary', respectively, -are non-nil. Pages are ruled if `cal-tex-rules' is non-nil. -Optional EVENT indicates a buffer position to use instead of point." - (interactive (list (prefix-numeric-value current-prefix-arg) - last-nonmenu-event)) - (or n (setq n 1)) - (let* ((date (calendar-gregorian-from-absolute - (calendar-dayname-on-or-before - 1 - (calendar-absolute-from-gregorian - (calendar-cursor-to-date t event))))) - (month (calendar-extract-month date)) - (year (calendar-extract-year date)) - (day (calendar-extract-day date)) - (d1 (calendar-absolute-from-gregorian date)) - (d2 (+ (* 7 n) d1)) - (holidays (if cal-tex-holidays - (holiday-in-range d1 d2))) - (diary-list (if cal-tex-diary - (cal-tex-list-diary-entries d1 d2)))) - (cal-tex-preamble "twoside") - (cal-tex-filofax-paper) - (insert cal-tex-righthead) - (cal-tex-shortday "rightday") - (cal-tex-shortday "weekend") - (insert cal-tex-lefthead) - (cal-tex-shortday "leftday") - (insert "\\newbox\\LineBox -\\setbox\\LineBox=\\hbox to\\textwidth{% -\\vrule height.2in width0pt\\leaders\\hrule\\hfill} -\\def\\linesfill{\\par\\leaders\\copy\\LineBox\\vfill} -") - (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle" "empty") - (dotimes (i n) - (dotimes (j 4) - (let ((even (zerop (% j 2)))) - (insert (if even - "\\righthead" - "\\lefthead")) - (cal-tex-arg (calendar-date-string date)) - (insert "%\n") - (insert (if even - "\\rightday" - "\\leftday"))) - (cal-tex-arg (cal-tex-latexify-list diary-list date)) - (cal-tex-arg (cal-tex-latexify-list holidays date "\\\\" t)) - (cal-tex-arg (eval cal-tex-daily-string)) - (insert "%\n") - (if cal-tex-rules - (insert "\\linesfill\n") - (insert "\\vfill\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n")) - (cal-tex-newpage) - (setq date (cal-tex-incr-date date))) - (insert "%\n") - (dotimes (_jdummy 2) - (insert "\\lefthead") - (cal-tex-arg (calendar-date-string date)) - (insert "\\weekend") - (cal-tex-arg (cal-tex-latexify-list diary-list date)) - (cal-tex-arg (cal-tex-latexify-list holidays date "\\\\" t)) - (cal-tex-arg (eval cal-tex-daily-string)) - (insert "%\n") - (if cal-tex-rules - (insert "\\linesfill\n") - (insert "\\vfill")) - (setq date (cal-tex-incr-date date))) - (or cal-tex-rules - (insert "\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n")) - (unless (= i (1- n)) - (run-hooks 'cal-tex-week-hook) - (cal-tex-newpage))) - (cal-tex-end-document) - (run-hooks 'cal-tex-hook))) - + (cal-tex-weekly-common n event t)) ;;; ;;; Daily calendars From 79aba01279160e9c1dea4a4f0b74ef6b2cb9f025 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 21 Aug 2012 15:18:56 -0400 Subject: [PATCH 072/212] Revert accidental deletion from previous change --- lisp/calendar/cal-tex.el | 155 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 154 insertions(+), 1 deletion(-) diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index b5c92a3b0e8..5891693282f 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -1214,6 +1214,78 @@ position to use instead of point." last-nonmenu-event)) (cal-tex-weekly-common n event)) +;;;###cal-autoload +(defun cal-tex-cursor-filofax-2week (&optional n event) + "Two-weeks-at-a-glance Filofax style calendar for week cursor is in. +Optional prefix argument N specifies number of weeks (default 1). +The calendar shows holiday and diary entries if +`cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil. +Optional EVENT indicates a buffer position to use instead of point." + (interactive (list (prefix-numeric-value current-prefix-arg) + last-nonmenu-event)) + (or n (setq n 1)) + (let* ((date (calendar-gregorian-from-absolute + (calendar-dayname-on-or-before + calendar-week-start-day + (calendar-absolute-from-gregorian + (calendar-cursor-to-date t event))))) + (month (calendar-extract-month date)) + (year (calendar-extract-year date)) + (day (calendar-extract-day date)) + (d1 (calendar-absolute-from-gregorian date)) + (d2 (+ (* 7 n) d1)) + (holidays (if cal-tex-holidays + (holiday-in-range d1 d2))) + (diary-list (if cal-tex-diary + (cal-tex-list-diary-entries d1 d2)))) + (cal-tex-preamble "twoside") + (cal-tex-filofax-paper) + (insert cal-tex-righthead) + (cal-tex-rightday "0.7in") + (insert cal-tex-lefthead) + (cal-tex-leftday "0.7in") + (cal-tex-b-document) + (cal-tex-cmd "\\pagestyle" "empty") + (dotimes (i n) + (if (zerop (mod i 2)) + (insert "\\righthead") + (insert "\\lefthead")) + (cal-tex-arg + (let ((d (cal-tex-incr-date date 6))) + (if (= (calendar-extract-month date) + (calendar-extract-month d)) + (format "%s %s" + (cal-tex-month-name (calendar-extract-month date)) + (calendar-extract-year date)) + (if (= (calendar-extract-year date) + (calendar-extract-year d)) + (format "%s---%s %s" + (cal-tex-month-name (calendar-extract-month date)) + (cal-tex-month-name (calendar-extract-month d)) + (calendar-extract-year date)) + (format "%s %s---%s %s" + (cal-tex-month-name (calendar-extract-month date)) + (calendar-extract-year date) + (cal-tex-month-name (calendar-extract-month d)) + (calendar-extract-year d)))))) + (insert "%\n") + (dotimes (_jdummy 7) + (if (zerop (mod i 2)) + (insert "\\rightday") + (insert "\\leftday")) + (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date))) + (cal-tex-arg (number-to-string (calendar-extract-day date))) + (cal-tex-arg (cal-tex-latexify-list diary-list date)) + (cal-tex-arg (cal-tex-latexify-list holidays date)) + (cal-tex-arg (eval cal-tex-daily-string)) + (insert "%\n") + (setq date (cal-tex-incr-date date))) + (unless (= i (1- n)) + (run-hooks 'cal-tex-week-hook) + (cal-tex-newpage))) + (cal-tex-end-document) + (run-hooks 'cal-tex-hook))) + ;;;###cal-autoload (defun cal-tex-cursor-filofax-week (&optional n event) "One-week-at-a-glance Filofax style calendar for week indicated by cursor. @@ -1223,7 +1295,88 @@ if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil. Optional EVENT indicates a buffer position to use instead of point." (interactive (list (prefix-numeric-value current-prefix-arg) last-nonmenu-event)) - (cal-tex-weekly-common n event t)) + (cal-tex-weekly-common n event t)) + +;;;###cal-autoload +(defun cal-tex-cursor-filofax-daily (&optional n event) + "Day-per-page Filofax style calendar for week indicated by cursor. +Optional prefix argument N specifies number of weeks (default 1), +starting on Mondays. The calendar shows holiday and diary +entries if `cal-tex-holidays' and `cal-tex-diary', respectively, +are non-nil. Pages are ruled if `cal-tex-rules' is non-nil. +Optional EVENT indicates a buffer position to use instead of point." + (interactive (list (prefix-numeric-value current-prefix-arg) + last-nonmenu-event)) + (or n (setq n 1)) + (let* ((date (calendar-gregorian-from-absolute + (calendar-dayname-on-or-before + 1 + (calendar-absolute-from-gregorian + (calendar-cursor-to-date t event))))) + (month (calendar-extract-month date)) + (year (calendar-extract-year date)) + (day (calendar-extract-day date)) + (d1 (calendar-absolute-from-gregorian date)) + (d2 (+ (* 7 n) d1)) + (holidays (if cal-tex-holidays + (holiday-in-range d1 d2))) + (diary-list (if cal-tex-diary + (cal-tex-list-diary-entries d1 d2)))) + (cal-tex-preamble "twoside") + (cal-tex-filofax-paper) + (insert cal-tex-righthead) + (cal-tex-shortday "rightday") + (cal-tex-shortday "weekend") + (insert cal-tex-lefthead) + (cal-tex-shortday "leftday") + (insert "\\newbox\\LineBox +\\setbox\\LineBox=\\hbox to\\textwidth{% +\\vrule height.2in width0pt\\leaders\\hrule\\hfill} +\\def\\linesfill{\\par\\leaders\\copy\\LineBox\\vfill} +") + (cal-tex-b-document) + (cal-tex-cmd "\\pagestyle" "empty") + (dotimes (i n) + (dotimes (j 4) + (let ((even (zerop (% j 2)))) + (insert (if even + "\\righthead" + "\\lefthead")) + (cal-tex-arg (calendar-date-string date)) + (insert "%\n") + (insert (if even + "\\rightday" + "\\leftday"))) + (cal-tex-arg (cal-tex-latexify-list diary-list date)) + (cal-tex-arg (cal-tex-latexify-list holidays date "\\\\" t)) + (cal-tex-arg (eval cal-tex-daily-string)) + (insert "%\n") + (if cal-tex-rules + (insert "\\linesfill\n") + (insert "\\vfill\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n")) + (cal-tex-newpage) + (setq date (cal-tex-incr-date date))) + (insert "%\n") + (dotimes (_jdummy 2) + (insert "\\lefthead") + (cal-tex-arg (calendar-date-string date)) + (insert "\\weekend") + (cal-tex-arg (cal-tex-latexify-list diary-list date)) + (cal-tex-arg (cal-tex-latexify-list holidays date "\\\\" t)) + (cal-tex-arg (eval cal-tex-daily-string)) + (insert "%\n") + (if cal-tex-rules + (insert "\\linesfill\n") + (insert "\\vfill")) + (setq date (cal-tex-incr-date date))) + (or cal-tex-rules + (insert "\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n")) + (unless (= i (1- n)) + (run-hooks 'cal-tex-week-hook) + (cal-tex-newpage))) + (cal-tex-end-document) + (run-hooks 'cal-tex-hook))) + ;;; ;;; Daily calendars From d18e2bb65d39d73954c422c1f36657f026cf2f56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Tue, 21 Aug 2012 22:50:31 +0200 Subject: [PATCH 073/212] * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in the loop. Fixes: debbugs:12247 --- src/ChangeLog | 5 +++++ src/nsterm.m | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index ffd706a9a82..79406894a58 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-08-21 Jan Djärv + + * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in + the loop (Bug#12247). + 2012-08-21 Paul Eggert * lisp.h (vcopy): Use memcpy rather than our own loop. diff --git a/src/nsterm.m b/src/nsterm.m index 3ab9358467a..12ca52684e6 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -4600,11 +4600,15 @@ - (void)fd_handler:(id)unused SELECT_TYPE readfds, writefds, *wfds; EMACS_TIME timeout, *tmo; + NSAutoreleasePool *pool = nil; /* NSTRACE (fd_handler); */ for (;;) { + [pool release]; + pool = [[NSAutoreleasePool alloc] init]; + if (waiting) { SELECT_TYPE fds; From c6cc78b86d48ba3d40a6bfb6d6a510554eddfde5 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Tue, 21 Aug 2012 23:41:35 +0200 Subject: [PATCH 074/212] Fixes: debbugs:11805 * cus-face.el (custom-face-attributes): Fix customize type for the :underline attribute. --- lisp/ChangeLog | 5 +++++ lisp/cus-face.el | 34 +++++++++++++++++++++++++++++----- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3eda0b626a3..c3e1ae374a0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-21 Andreas Schwab + + * cus-face.el (custom-face-attributes): Fix customize type for the + :underline attribute. (Bug#11805) + 2012-08-21 Martin Rudalics * window.el (window-point-1, set-window-point-1): Remove. diff --git a/lisp/cus-face.el b/lisp/cus-face.el index 3680a2648ce..06fd10149d3 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el @@ -136,12 +136,36 @@ :help-echo "Control text underlining." (const :tag "Off" nil) (list :tag "On" + :value (:color foreground-color :style line) (const :format "" :value :color) - (choice :tag "Color" (const :tag "Foreground Color" foreground-color) color) - (const :format "" :value :style) - (choice :tag "Style" - (const :tag "Line" line) - (const :tag "Wave" wave))))) + (choice :tag "Color" + (const :tag "Foreground Color" foreground-color) + color) + (const :format "" :value :style) + (choice :tag "Style" + (const :tag "Line" line) + (const :tag "Wave" wave)))) + ;; filter to make value suitable for customize + (lambda (real-value) + (and real-value + (let ((color + (or (and (consp real-value) (plist-get real-value :color)) + (and (stringp real-value) real-value) + 'foreground-color)) + (style + (or (and (consp real-value) (plist-get real-value :style)) + 'line))) + (list :color color :style style)))) + ;; filter to make customized-value suitable for storing + (lambda (cus-value) + (and cus-value + (let ((color (plist-get cus-value :color)) + (style (plist-get cus-value :style))) + (cond ((eq style 'line) + ;; Use simple value for default style + (if (eq color 'foreground-color) t color)) + (t + `(:color ,color :style ,style))))))) (:overline (choice :tag "Overline" From d0d2d26fba3df1121108fcf80e4a26549d7736a3 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 21 Aug 2012 16:09:01 -0700 Subject: [PATCH 075/212] Make recently-introduced setters macros. * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii) (set_fontset_base, set_fontset_frame, set_fontset_nofont_face) (set_fontset_default, set_fontset_fallback): Rename from their upper-case counterparts, and make them functions rather than macros. This is more consistent with the other recently-introduced setters. These don't need to be inline, since they're local. --- src/ChangeLog | 10 ++++++ src/fontset.c | 92 ++++++++++++++++++++++++++++++++------------------- 2 files changed, 68 insertions(+), 34 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 79406894a58..3e7b64becb1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2012-08-21 Paul Eggert + + Make recently-introduced setters macros. + * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii) + (set_fontset_base, set_fontset_frame, set_fontset_nofont_face) + (set_fontset_default, set_fontset_fallback): Rename from their + upper-case counterparts, and make them functions rather than macros. + This is more consistent with the other recently-introduced setters. + These don't need to be inline, since they're local. + 2012-08-21 Jan Djärv * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in diff --git a/src/fontset.c b/src/fontset.c index f9b6e8139ef..f5eae58a01e 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -213,45 +213,69 @@ fontset_id_valid_p (int id) /* Return the fontset with ID. No check of ID's validness. */ #define FONTSET_FROM_ID(id) AREF (Vfontset_table, id) -/* Macros to access special values of FONTSET. */ +/* Access special values of FONTSET. */ #define FONTSET_ID(fontset) XCHAR_TABLE (fontset)->extras[0] -#define SET_FONTSET_ID(fontset, id) \ - set_char_table_extras ((fontset), 0, (id)) +static void +set_fontset_id (Lisp_Object fontset, Lisp_Object id) +{ + set_char_table_extras (fontset, 0, id); +} -/* Macros to access special values of (base) FONTSET. */ +/* Access special values of (base) FONTSET. */ #define FONTSET_NAME(fontset) XCHAR_TABLE (fontset)->extras[1] -#define SET_FONTSET_NAME(fontset, name) \ - set_char_table_extras ((fontset), 1, (name)) +static void +set_fontset_name (Lisp_Object fontset, Lisp_Object name) +{ + set_char_table_extras (fontset, 1, name); +} #define FONTSET_ASCII(fontset) XCHAR_TABLE (fontset)->extras[4] -#define SET_FONTSET_ASCII(fontset, ascii) \ - set_char_table_extras ((fontset), 4, (ascii)) +static void +set_fontset_ascii (Lisp_Object fontset, Lisp_Object ascii) +{ + set_char_table_extras (fontset, 4, ascii); +} -/* Macros to access special values of (realized) FONTSET. */ +/* Access special values of (realized) FONTSET. */ #define FONTSET_BASE(fontset) XCHAR_TABLE (fontset)->extras[2] -#define SET_FONTSET_BASE(fontset, base) \ - set_char_table_extras ((fontset), 2, (base)) +static void +set_fontset_base (Lisp_Object fontset, Lisp_Object base) +{ + set_char_table_extras (fontset, 2, base); +} #define FONTSET_FRAME(fontset) XCHAR_TABLE (fontset)->extras[3] -#define SET_FONTSET_FRAME(fontset, frame) \ - set_char_table_extras ((fontset), 3, (frame)) +static void +set_fontset_frame (Lisp_Object fontset, Lisp_Object frame) +{ + set_char_table_extras (fontset, 3, frame); +} #define FONTSET_NOFONT_FACE(fontset) XCHAR_TABLE (fontset)->extras[5] -#define SET_FONTSET_NOFONT_FACE(fontset, face) \ - set_char_table_extras ((fontset), 5, (face)) +static void +set_fontset_nofont_face (Lisp_Object fontset, Lisp_Object face) +{ + set_char_table_extras (fontset, 5, face); +} #define FONTSET_DEFAULT(fontset) XCHAR_TABLE (fontset)->extras[7] -#define SET_FONTSET_DEFAULT(fontset, def) \ - set_char_table_extras ((fontset), 7, (def)) +static void +set_fontset_default (Lisp_Object fontset, Lisp_Object def) +{ + set_char_table_extras (fontset, 7, def); +} /* For both base and realized fontset. */ #define FONTSET_FALLBACK(fontset) XCHAR_TABLE (fontset)->extras[8] -#define SET_FONTSET_FALLBACK(fontset, fallback) \ - set_char_table_extras ((fontset), 8, (fallback)) +static void +set_fontset_fallback (Lisp_Object fontset, Lisp_Object fallback) +{ + set_char_table_extras (fontset, 8, fallback); +} #define BASE_FONTSET_P(fontset) (NILP (FONTSET_BASE (fontset))) @@ -330,7 +354,7 @@ fontset_ref (Lisp_Object fontset, int c) #define FONTSET_ADD(fontset, range, elt, add) \ (NILP (add) \ ? (NILP (range) \ - ? (SET_FONTSET_FALLBACK \ + ? (set_fontset_fallback \ (fontset, Fmake_vector (make_number (1), (elt)))) \ : Fset_char_table_range ((fontset), (range), \ Fmake_vector (make_number (1), (elt)))) \ @@ -362,7 +386,7 @@ fontset_add (Lisp_Object fontset, Lisp_Object range, Lisp_Object elt, Lisp_Objec else { args[idx] = FONTSET_FALLBACK (fontset); - SET_FONTSET_FALLBACK + set_fontset_fallback (fontset, NILP (args[idx]) ? args[1 - idx] : Fvconcat (2, args)); } return Qnil; @@ -506,7 +530,7 @@ fontset_get_font_group (Lisp_Object fontset, int c) if (c >= 0) char_table_set_range (fontset, from, to, font_group); else - SET_FONTSET_FALLBACK (fontset, font_group); + set_fontset_fallback (fontset, font_group); return font_group; } @@ -741,7 +765,7 @@ fontset_font (Lisp_Object fontset, int c, struct face *face, int id) if (! EQ (base_fontset, Vdefault_fontset)) { if (NILP (FONTSET_DEFAULT (fontset))) - SET_FONTSET_DEFAULT + set_fontset_default (fontset, make_fontset (FONTSET_FRAME (fontset), Qnil, Vdefault_fontset)); FONT_DEFERRED_LOG ("default fontset: font for", make_number (c), Qnil); @@ -803,14 +827,14 @@ make_fontset (Lisp_Object frame, Lisp_Object name, Lisp_Object base) fontset = Fmake_char_table (Qfontset, Qnil); - SET_FONTSET_ID (fontset, make_number (id)); + set_fontset_id (fontset, make_number (id)); if (NILP (base)) - SET_FONTSET_NAME (fontset, name); + set_fontset_name (fontset, name); else { - SET_FONTSET_NAME (fontset, Qnil); - SET_FONTSET_FRAME (fontset, frame); - SET_FONTSET_BASE (fontset, base); + set_fontset_name (fontset, Qnil); + set_fontset_frame (fontset, frame); + set_fontset_base (fontset, base); } ASET (Vfontset_table, id, fontset); @@ -978,7 +1002,7 @@ face_for_char (FRAME_PTR f, struct face *face, int c, int pos, Lisp_Object objec else { face_id = face_for_font (f, Qnil, face); - SET_FONTSET_NOFONT_FACE (fontset, make_number (face_id)); + set_fontset_nofont_face (fontset, make_number (face_id)); } } eassert (face_id >= 0); @@ -1600,7 +1624,7 @@ appended. By default, FONT-SPEC overrides the previous settings. */) Lisp_Object tail, fr, alist; int fontset_id = XINT (FONTSET_ID (fontset)); - SET_FONTSET_ASCII (fontset, fontname); + set_fontset_ascii (fontset, fontname); name = FONTSET_NAME (fontset); FOR_EACH_FRAME (tail, fr) { @@ -1678,7 +1702,7 @@ FONT-SPEC is a vector, a cons, or a string. See the documentation of len = font_unparse_xlfd (font_spec, 0, xlfd, 256); if (len < 0) error ("Invalid fontset name (perhaps too long): %s", SDATA (name)); - SET_FONTSET_ASCII (fontset, make_unibyte_string (xlfd, len)); + set_fontset_ascii (fontset, make_unibyte_string (xlfd, len)); } else { @@ -1764,7 +1788,7 @@ fontset_from_font (Lisp_Object font_object) Fset_fontset_font (name, Qnil, font_spec, Qnil, Qnil); } - SET_FONTSET_ASCII (fontset, font_name); + set_fontset_ascii (fontset, font_name); return XINT (FONTSET_ID (fontset)); } @@ -2181,8 +2205,8 @@ syms_of_fontset (void) Vdefault_fontset = Fmake_char_table (Qfontset, Qnil); staticpro (&Vdefault_fontset); - SET_FONTSET_ID (Vdefault_fontset, make_number (0)); - SET_FONTSET_NAME + set_fontset_id (Vdefault_fontset, make_number (0)); + set_fontset_name (Vdefault_fontset, build_pure_c_string ("-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default")); ASET (Vfontset_table, 0, Vdefault_fontset); From fce31d69dc4d6ff8810d499deebe568437fbf38b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 21 Aug 2012 16:39:56 -0700 Subject: [PATCH 076/212] * alloc.c: Use bool for booleans. (gc_in_progress, abort_on_gc) (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]: (dont_register_blocks) [GC_MALLOC_CHECK]: (suppress_checking) [ENABLE_CHECKING]: Now bool, not int. (check_string_bytes, make_specified_string, memory_full) (live_string_p, live_cons_p, live_symbol_p, live_float_p) (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object) (mark_stack, valid_pointer_p, make_pure_string) (Fgarbage_collect, survives_gc_p, gc_sweep): Use bool for booleans, instead of int. (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]: Remove unused local. * alloc.c (PURE_POINTER_P): * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean. * editfns.c (Fformat): * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name) (Fdo_auto_save): * fns.c (sweep_weak_table): * lisp.h (suppress_checking, push_message, survives_gc_p) (make_pure_string, gc_in_progress, abort_on_gc): * lread.c (readchar, read1): * print.c (Fprin1_to_string): * xdisp.c (push_message): Use bool for booleans affected directly or indirectly by alloc.c's changes. --- src/ChangeLog | 27 +++++++++++++++++ src/alloc.c | 80 +++++++++++++++++++++++++-------------------------- src/editfns.c | 10 +++---- src/fileio.c | 6 ++-- src/fns.c | 4 +-- src/lisp.h | 16 +++++------ src/lread.c | 8 +++--- src/print.c | 6 ++-- src/xdisp.c | 5 ++-- 9 files changed, 95 insertions(+), 67 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3e7b64becb1..27e430d7d0d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,32 @@ 2012-08-21 Paul Eggert + * alloc.c: Use bool for booleans. + (gc_in_progress, abort_on_gc) + (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]: + (dont_register_blocks) [GC_MALLOC_CHECK]: + (suppress_checking) [ENABLE_CHECKING]: Now bool, not int. + (check_string_bytes, make_specified_string, memory_full) + (live_string_p, live_cons_p, live_symbol_p, live_float_p) + (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object) + (mark_stack, valid_pointer_p, make_pure_string) + (Fgarbage_collect, survives_gc_p, gc_sweep): + Use bool for booleans, instead of int. + (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]: + Remove unused local. + * alloc.c (PURE_POINTER_P): + * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean. + * editfns.c (Fformat): + * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name) + (Fdo_auto_save): + * fns.c (sweep_weak_table): + * lisp.h (suppress_checking, push_message, survives_gc_p) + (make_pure_string, gc_in_progress, abort_on_gc): + * lread.c (readchar, read1): + * print.c (Fprin1_to_string): + * xdisp.c (push_message): + Use bool for booleans affected directly or indirectly by + alloc.c's changes. + Make recently-introduced setters macros. * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii) (set_fontset_base, set_fontset_frame, set_fontset_nofont_face) diff --git a/src/alloc.c b/src/alloc.c index 522f33f5379..f0da9416ece 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -173,15 +173,15 @@ EMACS_INT gc_relative_threshold; EMACS_INT memory_full_cons_threshold; -/* Nonzero during GC. */ +/* True during GC. */ -int gc_in_progress; +bool gc_in_progress; -/* Nonzero means abort if try to GC. +/* True means abort if try to GC. This is for code which is written on the assumption that no GC will happen, so as to verify that assumption. */ -int abort_on_gc; +bool abort_on_gc; /* Number of live and free conses etc. */ @@ -223,7 +223,7 @@ static ptrdiff_t pure_size; static ptrdiff_t pure_bytes_used_before_overflow; -/* Value is non-zero if P points into pure space. */ +/* True if P points into pure space. */ #define PURE_POINTER_P(P) \ ((uintptr_t) (P) - (uintptr_t) purebeg <= pure_size) @@ -392,13 +392,13 @@ static struct mem_node mem_z; static struct Lisp_Vector *allocate_vectorlike (ptrdiff_t); static void lisp_free (void *); static void mark_stack (void); -static int live_vector_p (struct mem_node *, void *); -static int live_buffer_p (struct mem_node *, void *); -static int live_string_p (struct mem_node *, void *); -static int live_cons_p (struct mem_node *, void *); -static int live_symbol_p (struct mem_node *, void *); -static int live_float_p (struct mem_node *, void *); -static int live_misc_p (struct mem_node *, void *); +static bool live_vector_p (struct mem_node *, void *); +static bool live_buffer_p (struct mem_node *, void *); +static bool live_string_p (struct mem_node *, void *); +static bool live_cons_p (struct mem_node *, void *); +static bool live_symbol_p (struct mem_node *, void *); +static bool live_float_p (struct mem_node *, void *); +static bool live_misc_p (struct mem_node *, void *); static void mark_maybe_object (Lisp_Object); static void mark_memory (void *, void *); #if GC_MARK_STACK || defined GC_MALLOC_CHECK @@ -1241,7 +1241,7 @@ static void (*old_free_hook) (void*, const void*); #endif #ifdef GC_MALLOC_CHECK -static int dont_register_blocks; +static bool dont_register_blocks; #endif static size_t bytes_used_when_reconsidered; @@ -1828,11 +1828,11 @@ check_sblock (struct sblock *b) /* Check validity of Lisp strings' string_bytes member. ALL_P - non-zero means check all strings, otherwise check only most + means check all strings, otherwise check only most recently allocated strings. Used for hunting a bug. */ static void -check_string_bytes (int all_p) +check_string_bytes (bool all_p) { if (all_p) { @@ -2437,9 +2437,9 @@ make_string_from_bytes (const char *contents, Lisp_Object make_specified_string (const char *contents, - ptrdiff_t nchars, ptrdiff_t nbytes, int multibyte) + ptrdiff_t nchars, ptrdiff_t nbytes, bool multibyte) { - register Lisp_Object val; + Lisp_Object val; if (nchars < 0) { @@ -3094,7 +3094,7 @@ sweep_vectors (void) for (block = vector_blocks; block; block = *bprev) { - int free_this_block = 0; + bool free_this_block = 0; for (vector = (struct Lisp_Vector *) block->data; VECTOR_IN_BLOCK (vector, block); vector = next) @@ -3753,7 +3753,7 @@ void memory_full (size_t nbytes) { /* Do not go into hysterics merely because a large request failed. */ - int enough_free_memory = 0; + bool enough_free_memory = 0; if (SPARE_MEMORY < nbytes) { void *p; @@ -4246,7 +4246,7 @@ mem_delete_fixup (struct mem_node *x) /* Value is non-zero if P is a pointer to a live Lisp string on the heap. M is a pointer to the mem_block for P. */ -static inline int +static inline bool live_string_p (struct mem_node *m, void *p) { if (m->type == MEM_TYPE_STRING) @@ -4269,7 +4269,7 @@ live_string_p (struct mem_node *m, void *p) /* Value is non-zero if P is a pointer to a live Lisp cons on the heap. M is a pointer to the mem_block for P. */ -static inline int +static inline bool live_cons_p (struct mem_node *m, void *p) { if (m->type == MEM_TYPE_CONS) @@ -4295,7 +4295,7 @@ live_cons_p (struct mem_node *m, void *p) /* Value is non-zero if P is a pointer to a live Lisp symbol on the heap. M is a pointer to the mem_block for P. */ -static inline int +static inline bool live_symbol_p (struct mem_node *m, void *p) { if (m->type == MEM_TYPE_SYMBOL) @@ -4321,7 +4321,7 @@ live_symbol_p (struct mem_node *m, void *p) /* Value is non-zero if P is a pointer to a live Lisp float on the heap. M is a pointer to the mem_block for P. */ -static inline int +static inline bool live_float_p (struct mem_node *m, void *p) { if (m->type == MEM_TYPE_FLOAT) @@ -4345,7 +4345,7 @@ live_float_p (struct mem_node *m, void *p) /* Value is non-zero if P is a pointer to a live Lisp Misc on the heap. M is a pointer to the mem_block for P. */ -static inline int +static inline bool live_misc_p (struct mem_node *m, void *p) { if (m->type == MEM_TYPE_MISC) @@ -4371,7 +4371,7 @@ live_misc_p (struct mem_node *m, void *p) /* Value is non-zero if P is a pointer to a live vector-like object. M is a pointer to the mem_block for P. */ -static inline int +static inline bool live_vector_p (struct mem_node *m, void *p) { if (m->type == MEM_TYPE_VECTOR_BLOCK) @@ -4407,7 +4407,7 @@ live_vector_p (struct mem_node *m, void *p) /* Value is non-zero if P is a pointer to a live buffer. M is a pointer to the mem_block for P. */ -static inline int +static inline bool live_buffer_p (struct mem_node *m, void *p) { /* P must point to the start of the block, and the buffer @@ -4487,7 +4487,7 @@ mark_maybe_object (Lisp_Object obj) if (m != MEM_NIL) { - int mark_p = 0; + bool mark_p = 0; switch (XTYPE (obj)) { @@ -4707,7 +4707,8 @@ mark_memory (void *start, void *end) #if !defined GC_SAVE_REGISTERS_ON_STACK && !defined GC_SETJMP_WORKS -static int setjmp_tested_p, longjmps_done; +static bool setjmp_tested_p; +static int longjmps_done; #define SETJMP_WILL_LIKELY_WORK "\ \n\ @@ -4751,7 +4752,6 @@ test_setjmp (void) char buf[10]; register int x; jmp_buf jbuf; - int result = 0; /* Arrange for X to be put in a register. */ sprintf (buf, "1"); @@ -4891,7 +4891,7 @@ mark_stack (void) Lisp_Object o; jmp_buf j; } j; - volatile int stack_grows_down_p = (char *) &j > (char *) stack_base; + volatile bool stack_grows_down_p = (char *) &j > (char *) stack_base; #endif /* This trick flushes the register windows so that all the state of the process is contained in the stack. */ @@ -4965,7 +4965,7 @@ valid_pointer_p (void *p) if (pipe (fd) == 0) { - int valid = (emacs_write (fd[1], (char *) p, 16) == 16); + bool valid = emacs_write (fd[1], (char *) p, 16) == 16; emacs_close (fd[1]); emacs_close (fd[0]); return valid; @@ -5186,7 +5186,7 @@ find_string_data_in_pure (const char *data, ptrdiff_t nbytes) /* Return a string allocated in pure space. DATA is a buffer holding NCHARS characters, and NBYTES bytes of string data. MULTIBYTE - non-zero means make the result string multibyte. + means make the result string multibyte. Must get an error if pure storage is full, since if it cannot hold a large string it may be able to hold conses that point to that @@ -5194,7 +5194,7 @@ find_string_data_in_pure (const char *data, ptrdiff_t nbytes) Lisp_Object make_pure_string (const char *data, - ptrdiff_t nchars, ptrdiff_t nbytes, int multibyte) + ptrdiff_t nchars, ptrdiff_t nbytes, bool multibyte) { Lisp_Object string; struct Lisp_String *s = pure_alloc (sizeof *s, Lisp_String); @@ -5389,11 +5389,11 @@ returns nil, because real GC can't be done. See Info node `(elisp)Garbage Collection'. */) (void) { - register struct specbinding *bind; - register struct buffer *nextb; + struct specbinding *bind; + struct buffer *nextb; char stack_top_variable; ptrdiff_t i; - int message_p; + bool message_p; ptrdiff_t count = SPECPDL_INDEX (); EMACS_TIME start; Lisp_Object retval = Qnil; @@ -6208,10 +6208,10 @@ mark_terminals (void) /* Value is non-zero if OBJ will survive the current GC because it's either marked or does not need to be marked to survive. */ -int +bool survives_gc_p (Lisp_Object obj) { - int survives_p; + bool survives_p; switch (XTYPE (obj)) { @@ -6456,7 +6456,7 @@ gc_sweep (void) /* Check if the symbol was created during loadup. In such a case it might be pointed to by pure bytecode which we don't trace, so we conservatively assume that it is live. */ - int pure_p = PURE_POINTER_P (XSTRING (sym->s.name)); + bool pure_p = PURE_POINTER_P (XSTRING (sym->s.name)); if (!sym->s.gcmarkbit && !pure_p) { @@ -6681,7 +6681,7 @@ which_symbols (Lisp_Object obj, EMACS_INT find_max) } #ifdef ENABLE_CHECKING -int suppress_checking; +bool suppress_checking; void die (const char *msg, const char *file, int line) diff --git a/src/editfns.c b/src/editfns.c index fa57edead28..0bd632d14b7 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3642,13 +3642,13 @@ usage: (format STRING &rest OBJECTS) */) ptrdiff_t max_bufsize = STRING_BYTES_BOUND + 1; char *p; Lisp_Object buf_save_value IF_LINT (= {0}); - register char *format, *end, *format_start; + char *format, *end, *format_start; ptrdiff_t formatlen, nchars; - /* Nonzero if the format is multibyte. */ - int multibyte_format = 0; - /* Nonzero if the output should be a multibyte string, + /* True if the format is multibyte. */ + bool multibyte_format = 0; + /* True if the output should be a multibyte string, which is true if any of the inputs is one. */ - int multibyte = 0; + bool multibyte = 0; /* When we make a multibyte string, we must pay attention to the byte combining problem, i.e., a byte may be combined with a multibyte character of the previous string. This flag tells if we diff --git a/src/fileio.c b/src/fileio.c index 2f4a2ad2314..6deca0bf1e1 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -766,7 +766,7 @@ filesystem tree, not (expand-file-name ".." dirname). */) #endif /* DOS_NT */ ptrdiff_t length; Lisp_Object handler, result, handled_name; - int multibyte; + bool multibyte; Lisp_Object hdir; CHECK_STRING (name); @@ -1566,7 +1566,7 @@ those `/' is discarded. */) char *target = NULL; int total = 0; int substituted = 0; - int multibyte; + bool multibyte; char *xnm; Lisp_Object handler; @@ -5306,7 +5306,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */) FILE *stream = NULL; ptrdiff_t count = SPECPDL_INDEX (); int orig_minibuffer_auto_raise = minibuffer_auto_raise; - int old_message_p = 0; + bool old_message_p = 0; struct gcpro gcpro1, gcpro2; if (max_specpdl_size < specpdl_size + 40) diff --git a/src/fns.c b/src/fns.c index 34238e4cd6a..3225fefc5e3 100644 --- a/src/fns.c +++ b/src/fns.c @@ -3967,8 +3967,8 @@ sweep_weak_table (struct Lisp_Hash_Table *h, int remove_entries_p) for (idx = HASH_INDEX (h, bucket); !NILP (idx); idx = next) { ptrdiff_t i = XFASTINT (idx); - int key_known_to_survive_p = survives_gc_p (HASH_KEY (h, i)); - int value_known_to_survive_p = survives_gc_p (HASH_VALUE (h, i)); + bool key_known_to_survive_p = survives_gc_p (HASH_KEY (h, i)); + bool value_known_to_survive_p = survives_gc_p (HASH_VALUE (h, i)); int remove_p; if (EQ (h->weak, Qkey)) diff --git a/src/lisp.h b/src/lisp.h index 30bbb65f4fa..d9a7c9d0bdc 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -124,7 +124,7 @@ extern _Noreturn void die (const char *, const char *, int); eassert macro altogether, e.g., if XSTRING (x) uses eassert to test STRINGP (x), but a particular use of XSTRING is invoked only after testing that STRINGP (x) is true, making the test redundant. */ -extern int suppress_checking EXTERNALLY_VISIBLE; +extern bool suppress_checking EXTERNALLY_VISIBLE; # define eassert(cond) \ ((cond) || suppress_checking \ @@ -702,7 +702,7 @@ struct Lisp_Cons #define CDR_SAFE(c) \ (CONSP ((c)) ? XCDR ((c)) : Qnil) -/* Nonzero if STR is a multibyte string. */ +/* True if STR is a multibyte string. */ #define STRING_MULTIBYTE(STR) \ (XSTRING (STR)->size_byte >= 0) @@ -2799,7 +2799,7 @@ extern Lisp_Object echo_area_buffer[2]; extern void add_to_log (const char *, Lisp_Object, Lisp_Object); extern void check_message_stack (void); extern void setup_echo_area_for_printing (int); -extern int push_message (void); +extern bool push_message (void); extern Lisp_Object pop_message_unwind (Lisp_Object); extern Lisp_Object restore_message_unwind (Lisp_Object); extern void restore_message (void); @@ -2842,7 +2842,7 @@ extern void uninterrupt_malloc (void); extern void malloc_warning (const char *); extern _Noreturn void memory_full (size_t); extern _Noreturn void buffer_memory_full (ptrdiff_t); -extern int survives_gc_p (Lisp_Object); +extern bool survives_gc_p (Lisp_Object); extern void mark_object (Lisp_Object); #if defined REL_ALLOC && !defined SYSTEM_MALLOC extern void refill_memory_reserve (void); @@ -2881,8 +2881,8 @@ extern Lisp_Object make_uninit_string (EMACS_INT); extern Lisp_Object make_uninit_multibyte_string (EMACS_INT, EMACS_INT); extern Lisp_Object make_string_from_bytes (const char *, ptrdiff_t, ptrdiff_t); extern Lisp_Object make_specified_string (const char *, - ptrdiff_t, ptrdiff_t, int); -extern Lisp_Object make_pure_string (const char *, ptrdiff_t, ptrdiff_t, int); + ptrdiff_t, ptrdiff_t, bool); +extern Lisp_Object make_pure_string (const char *, ptrdiff_t, ptrdiff_t, bool); extern Lisp_Object make_pure_c_string (const char *, ptrdiff_t); /* Make a string allocated in pure space, use STR as string data. */ @@ -2916,8 +2916,8 @@ extern struct window *allocate_window (void); extern struct frame *allocate_frame (void); extern struct Lisp_Process *allocate_process (void); extern struct terminal *allocate_terminal (void); -extern int gc_in_progress; -extern int abort_on_gc; +extern bool gc_in_progress; +extern bool abort_on_gc; extern Lisp_Object make_float (double); extern void display_malloc_warning (void); extern ptrdiff_t inhibit_garbage_collection (void); diff --git a/src/lread.c b/src/lread.c index f3ab1610d2c..b0413c98765 100644 --- a/src/lread.c +++ b/src/lread.c @@ -189,7 +189,7 @@ static int readbyte_from_string (int, Lisp_Object); static int unread_char; static int -readchar (Lisp_Object readcharfun, int *multibyte) +readchar (Lisp_Object readcharfun, bool *multibyte) { Lisp_Object tem; register int c; @@ -2354,9 +2354,9 @@ read_integer (Lisp_Object readcharfun, EMACS_INT radix) static Lisp_Object read1 (register Lisp_Object readcharfun, int *pch, int first_in_list) { - register int c; - unsigned uninterned_symbol = 0; - int multibyte; + int c; + bool uninterned_symbol = 0; + bool multibyte; *pch = 0; load_each_byte = 0; diff --git a/src/print.c b/src/print.c index 223a79dc552..64449aeaf2a 100644 --- a/src/print.c +++ b/src/print.c @@ -586,6 +586,7 @@ A printed representation of an object is text which describes that object. */) (Lisp_Object object, Lisp_Object noescape) { Lisp_Object printcharfun; + bool prev_abort_on_gc; /* struct gcpro gcpro1, gcpro2; */ Lisp_Object save_deactivate_mark; ptrdiff_t count = SPECPDL_INDEX (); @@ -601,7 +602,8 @@ A printed representation of an object is text which describes that object. */) No need for specbind, since errors deactivate the mark. */ save_deactivate_mark = Vdeactivate_mark; /* GCPRO2 (object, save_deactivate_mark); */ - abort_on_gc++; + prev_abort_on_gc = abort_on_gc; + abort_on_gc = 1; printcharfun = Vprin1_to_string_buffer; PRINTPREPARE; @@ -625,7 +627,7 @@ A printed representation of an object is text which describes that object. */) Vdeactivate_mark = save_deactivate_mark; /* UNGCPRO; */ - abort_on_gc--; + abort_on_gc = prev_abort_on_gc; return unbind_to (count, object); } diff --git a/src/xdisp.c b/src/xdisp.c index e41783d03c1..f5edb4b16f8 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10480,11 +10480,10 @@ current_message_1 (ptrdiff_t a1, Lisp_Object a2, ptrdiff_t a3, ptrdiff_t a4) empty. This is a relatively infrequent operation, so it's not worth optimizing. */ -int +bool push_message (void) { - Lisp_Object msg; - msg = current_message (); + Lisp_Object msg = current_message (); Vmessage_stack = Fcons (msg, Vmessage_stack); return STRINGP (msg); } From da485f5e6b5fd38d202a0f6682f6fec28963cf1e Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 21 Aug 2012 20:39:44 -0400 Subject: [PATCH 077/212] Combine two cal-tex functions * lisp/calendar/cal-tex.el (cal-tex-longday): New function, replacing... (cal-tex-leftday, cal-tex-rightday): Remove functions. (cal-tex-weekly-common, cal-tex-cursor-filofax-2week): Update for above change. --- lisp/ChangeLog | 7 ++++++ lisp/calendar/cal-tex.el | 46 +++++++++++++++++----------------------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c3e1ae374a0..748fab9dbe0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2012-08-22 Glenn Morris + + * calendar/cal-tex.el (cal-tex-longday): New function, replacing... + (cal-tex-leftday, cal-tex-rightday): Remove functions. + (cal-tex-weekly-common, cal-tex-cursor-filofax-2week): + Update for above change. + 2012-08-21 Andreas Schwab * cus-face.el (custom-face-attributes): Fix customize type for the diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index 5891693282f..d8d2a09c871 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -371,27 +371,21 @@ landscape mode with three rows of four months each." \\footskip 0.125in "))) -(defun cal-tex-leftday (height) - "Insert LaTeX code for leftday function." - (insert "\\long\\def\\leftday#1#2#3#4#5{% +(defun cal-tex-longday (funcname height) + "Insert LaTeX code for a long day function." + (insert "\\long\\def\\" funcname "#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox to " height "{% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\noindent {\\normalsize \\bf #2} \\small #1 \\hfill #5}% - \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em #4}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}\n")) - -(defun cal-tex-rightday (height &optional funcname) - "Insert LaTeX code for rightday function." - (insert "\\long\\def\\" (or funcname "rightday") "#1#2#3#4#5{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox to " height "{% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% - \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}\n")) + \\vspace*{2pt}% + \\hbox to \\textwidth{" + (if (string-equal funcname "leftday") + "\\noindent {\\normalsize \\bf #2} \\small #1 \\hfill #5}%\n" + "\\small #5 \\hfill #1 {\\normalsize \\bf #2}}%\n") + " \\hbox to \\textwidth{\\vbox {\\" + (if (string-equal funcname "leftday") "noindent" "raggedleft") + " \\footnotesize \\em #4}}% + \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}\n")) (defun cal-tex-shortday (funcname) "Insert LaTeX code for a short day function." @@ -1082,10 +1076,10 @@ shown are hard-coded to 8-12, 13-17." (cal-tex-preamble "twoside") (cal-tex-filofax-paper) (insert cal-tex-righthead) - (cal-tex-rightday "1.85in") - (cal-tex-rightday "0.8in" "weekend") + (cal-tex-longday "rightday" "1.85in") + (cal-tex-longday "weekend" "0.8in") (insert cal-tex-lefthead) - (cal-tex-leftday "1.85in")) + (cal-tex-longday "leftday" "1.85in")) (cal-tex-preamble "twoside,12pt") (insert "\\textwidth 7in \\textheight 10.5in @@ -1097,10 +1091,10 @@ shown are hard-coded to 8-12, 13-17." \\footskip .125in ") (insert cal-tex-righthead) - (cal-tex-rightday "2.75in") - (cal-tex-rightday "1.8in" "weekend") + (cal-tex-longday "rightday" "2.75in") + (cal-tex-longday "weekend" "1.8in") (insert cal-tex-lefthead) - (cal-tex-leftday "2.75in")) + (cal-tex-longday "leftday" "2.75in")) (cal-tex-b-document) (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) @@ -1241,9 +1235,9 @@ Optional EVENT indicates a buffer position to use instead of point." (cal-tex-preamble "twoside") (cal-tex-filofax-paper) (insert cal-tex-righthead) - (cal-tex-rightday "0.7in") + (cal-tex-longday "rightday" "0.7in") (insert cal-tex-lefthead) - (cal-tex-leftday "0.7in") + (cal-tex-longday "leftday" "0.7in") (cal-tex-b-document) (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) From 94e0e5592ad531a577f4249564da8688d9d9ebea Mon Sep 17 00:00:00 2001 From: Edward O'Connor Date: Tue, 21 Aug 2012 21:29:22 -0400 Subject: [PATCH 078/212] strict key encoding for json.el Ref: http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00642.html * lisp/json.el (json-key-format): Add error properties. (json-encode-key): New function. (json-encode-hash-table, json-encode-alist, json-encode-plist): Use json-encode-key. --- lisp/ChangeLog | 7 +++++++ lisp/json.el | 19 ++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 748fab9dbe0..4f8de2291db 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2012-08-22 Edward O'Connor + + * json.el (json-key-format): Add error properties. + (json-encode-key): New function. + (json-encode-hash-table, json-encode-alist, json-encode-plist): + Use json-encode-key. + 2012-08-22 Glenn Morris * calendar/cal-tex.el (cal-tex-longday): New function, replacing... diff --git a/lisp/json.el b/lisp/json.el index 468358ccd1a..f1ee3a52032 100644 --- a/lisp/json.el +++ b/lisp/json.el @@ -174,6 +174,10 @@ this around your call to `json-read' instead of `setq'ing it.") (put 'json-string-format 'error-conditions '(json-string-format json-error error)) +(put 'json-key-format 'error-message "Bad JSON object key") +(put 'json-key-format 'error-conditions + '(json-key-format json-error error)) + (put 'json-object-format 'error-message "Bad JSON object") (put 'json-object-format 'error-conditions '(json-object-format json-error error)) @@ -321,6 +325,15 @@ representation will be parsed correctly." "Return a JSON representation of STRING." (format "\"%s\"" (mapconcat 'json-encode-char string ""))) +(defun json-encode-key (object) + "Return a JSON representation of OBJECT. +If the resulting JSON object isn't a valid JSON object key, +this signals `json-key-format'." + (let ((encoded (json-encode object))) + (unless (stringp (json-read-from-string encoded)) + (signal 'json-key-format (list object))) + encoded)) + ;;; JSON Objects (defun json-new-object () @@ -395,7 +408,7 @@ Please see the documentation of `json-object-type' and `json-key-type'." (maphash (lambda (k v) (push (format "%s:%s" - (json-encode k) + (json-encode-key k) (json-encode v)) r)) hash-table) @@ -409,7 +422,7 @@ Please see the documentation of `json-object-type' and `json-key-type'." (format "{%s}" (json-join (mapcar (lambda (cons) (format "%s:%s" - (json-encode (car cons)) + (json-encode-key (car cons)) (json-encode (cdr cons)))) alist) ", "))) @@ -418,7 +431,7 @@ Please see the documentation of `json-object-type' and `json-key-type'." "Return a JSON representation of PLIST." (let (result) (while plist - (push (concat (json-encode (car plist)) + (push (concat (json-encode-key (car plist)) ":" (json-encode (cadr plist))) result) From cb7857924bcc4bc1a2c1cec1aa169d63447ac6f8 Mon Sep 17 00:00:00 2001 From: Josh Feinstein Date: Tue, 21 Aug 2012 20:45:51 -0700 Subject: [PATCH 079/212] 2012-08-21 Josh Feinstein * erc-join.el (erc-autojoin-timing): Fix defcustom type. --- lisp/erc/ChangeLog | 4 ++++ lisp/erc/erc-join.el | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 27b1fe8617a..37e755e7655 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,7 @@ +2012-08-21 Josh Feinstein + + * erc-join.el (erc-autojoin-timing): Fix defcustom type. + 2012-08-21 Julien Danjou * erc-match.el (erc-match-message): Use diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el index 85d1edf6427..ae7f90003a6 100644 --- a/lisp/erc/erc-join.el +++ b/lisp/erc/erc-join.el @@ -84,8 +84,8 @@ identification, or after `erc-autojoin-delay' seconds. Any other value means the same as `connect'." :group 'erc-autojoin :version "24.1" - :type '(choice (const :tag "On Connection" 'connect) - (const :tag "When Identified" 'ident))) + :type '(choice (const :tag "On Connection" connect) + (const :tag "When Identified" ident))) (defcustom erc-autojoin-delay 30 "Number of seconds to wait before attempting to autojoin channels. From 37219830c704441dad626b2e555e27a7f4676d87 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Wed, 22 Aug 2012 14:35:38 +0900 Subject: [PATCH 080/212] Add :safe for js indent variables. Fixes: debbugs:12257 --- lisp/ChangeLog | 6 ++++++ lisp/progmodes/js.el | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4f8de2291db..a12390cd61f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-08-22 Daiki Ueno + + * progmodes/js.el (js-indent-level, js-expr-indent-offset) + (js-paren-indent-offset, js-square-indent-offset) + (js-curly-indent-offset): Add :safe (Bug#12257). + 2012-08-22 Edward O'Connor * json.el (json-key-format): Add error properties. diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 519e5aef2bc..d954cd53e0a 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -426,18 +426,21 @@ Match group 1 is the name of the macro.") (defcustom js-indent-level 4 "Number of spaces for each indentation step in `js-mode'." :type 'integer + :safe 'integerp :group 'js) (defcustom js-expr-indent-offset 0 "Number of additional spaces for indenting continued expressions. The value must be no less than minus `js-indent-level'." :type 'integer + :safe 'integerp :group 'js) (defcustom js-paren-indent-offset 0 "Number of additional spaces for indenting expressions in parentheses. The value must be no less than minus `js-indent-level'." :type 'integer + :safe 'integerp :group 'js :version "24.1") @@ -445,6 +448,7 @@ The value must be no less than minus `js-indent-level'." "Number of additional spaces for indenting expressions in square braces. The value must be no less than minus `js-indent-level'." :type 'integer + :safe 'integerp :group 'js :version "24.1") @@ -452,6 +456,7 @@ The value must be no less than minus `js-indent-level'." "Number of additional spaces for indenting expressions in curly braces. The value must be no less than minus `js-indent-level'." :type 'integer + :safe 'integerp :group 'js :version "24.1") From 2b2c07948eb4a047b90bdab313ec7fc0ec42ab76 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 21 Aug 2012 23:47:00 -0700 Subject: [PATCH 081/212] Make bug-reference-bug-regexp customizable Ref: http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00427.html * lisp/progmodes/bug-reference.el (bug-reference): New custom group. (bug-reference-bug-regexp): Make it a defcustom. --- lisp/ChangeLog | 5 +++++ lisp/progmodes/bug-reference.el | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a12390cd61f..63a029be1f6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-22 Glenn Morris + + * progmodes/bug-reference.el (bug-reference): New custom group. + (bug-reference-bug-regexp): Make it a defcustom. + 2012-08-22 Daiki Ueno * progmodes/js.el (js-indent-level, js-expr-indent-offset) diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el index 0a7d65c1fa4..97fcb6874dd 100644 --- a/lisp/progmodes/bug-reference.el +++ b/lisp/progmodes/bug-reference.el @@ -32,6 +32,11 @@ ;;; Code: +(defgroup bug-reference nil + "Hyperlinking references to bug reports" + ;; Somewhat arbitrary, by analogy with eg goto-address. + :group 'comm) + (defvar bug-reference-map (let ((map (make-sparse-keymap))) (define-key map [mouse-2] 'bug-reference-push-button) @@ -63,9 +68,13 @@ so that it is considered safe, see `enable-local-variables'.") (and (symbolp s) (get s 'bug-reference-url-format))))) -(defconst bug-reference-bug-regexp +(defcustom bug-reference-bug-regexp "\\([Bb]ug ?#\\|[Pp]atch ?#\\|RFE ?#\\|PR [a-z-+]+/\\)\\([0-9]+\\(?:#[0-9]+\\)?\\)" - "Regular expression which matches bug references.") + "Regular expression matching bug references. +The second subexpression should match the bug reference (usually a number)." + :type 'string + :safe 'stringp + :group 'bug-reference) (defun bug-reference-set-overlay-properties () "Set properties of bug reference overlays." From 5af9cb6be0db0d830fe98e0370e4cca1a54ccfbd Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 21 Aug 2012 23:55:44 -0700 Subject: [PATCH 082/212] Add option to not create bin/emacs link to bin/emacs-VERSION * Makefile.in (install-arch-dep): If NO_BIN_LINK is non-null, do not create the bin/emacs link. * etc/NEWS: Mention this. Fixes: debbugs:12011 --- ChangeLog | 5 +++++ Makefile.in | 6 ++++-- etc/NEWS | 5 +++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4f339482a98..5657f8bb3aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-08-22 Glenn Morris + + * Makefile.in (install-arch-dep): If NO_BIN_LINK is non-null, + do not create the bin/emacs link. (Bug#12011) + 2012-08-21 Paul Eggert Merge from gnulib, incorporating: diff --git a/Makefile.in b/Makefile.in index bf4c4b853a0..122a35d4416 100644 --- a/Makefile.in +++ b/Makefile.in @@ -437,8 +437,10 @@ install-arch-dep: install-arch-indep install-doc if test "${ns_self_contained}" = "no"; then \ ${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs${EXEEXT} $(DESTDIR)${bindir}/$(EMACSFULL) || exit 1 ; \ chmod 1755 $(DESTDIR)${bindir}/$(EMACSFULL) ; \ - rm -f $(DESTDIR)${bindir}/$(EMACS) ; \ - cd $(DESTDIR)${bindir} && $(LN_S) $(EMACSFULL) $(EMACS); \ + if test "x${NO_BIN_LINK}" = x; then \ + rm -f $(DESTDIR)${bindir}/$(EMACS) ; \ + cd $(DESTDIR)${bindir} && $(LN_S) $(EMACSFULL) $(EMACS); \ + fi; \ else \ subdir=${ns_appresdir}/site-lisp; \ ${write_subdir} || exit 1; \ diff --git a/etc/NEWS b/etc/NEWS index fa8a9bd30d0..0c9ffe50093 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -38,6 +38,11 @@ may be useful. ** The configure option '--disable-maintainer-mode' has been removed, as it was confusingly-named and rarely useful. +--- +** You can use `NO_BIN_LINK=t make install' to prevent the installation +overwriting "emacs" in the installation bin/ directory with a link +to emacs-VERSION. + --- ** Emacs uses libtinfo in preference to libncurses, if available. From fbb6300b6d0058c464631da982af1a77ff798524 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Wed, 22 Aug 2012 08:59:38 +0200 Subject: [PATCH 083/212] In dired-mark-remembered don't clobber point (Bug#11795). * dired.el (dired-mark-remembered): Don't clobber point. (Bug#11795) --- lisp/ChangeLog | 5 +++++ lisp/dired.el | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 63a029be1f6..688b6a9e341 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-22 Martin Rudalics + + * dired.el (dired-mark-remembered): Don't clobber point. + (Bug#11795) + 2012-08-22 Glenn Morris * progmodes/bug-reference.el (bug-reference): New custom group. diff --git a/lisp/dired.el b/lisp/dired.el index 6684be3356c..6182e133726 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1331,16 +1331,16 @@ DIRED-FILENAME WINDOW-POINT)." "Mark all files remembered in ALIST. Each element of ALIST looks like (FILE . MARKERCHAR)." (let (elt fil chr) - (while alist - (setq elt (car alist) - alist (cdr alist) - fil (car elt) - chr (cdr elt)) - (if (dired-goto-file fil) - (save-excursion - (beginning-of-line) - (delete-char 1) - (insert chr)))))) + (save-excursion + (while alist + (setq elt (car alist) + alist (cdr alist) + fil (car elt) + chr (cdr elt)) + (when (dired-goto-file fil) + (beginning-of-line) + (delete-char 1) + (insert chr)))))) (defun dired-remember-hidden () "Return a list of names of subdirs currently hidden." From 80a51fa01ff36879aa57f82f90b796a2092e8191 Mon Sep 17 00:00:00 2001 From: Christopher Schmidt Date: Wed, 22 Aug 2012 00:02:15 -0700 Subject: [PATCH 084/212] * help-fns.el (help-fns--key-bindings): Abbreviate non-symbol remap targets. Fixes: debbugs:12174 --- lisp/ChangeLog | 5 +++++ lisp/help-fns.el | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 688b6a9e341..db15ad80927 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-22 Christopher Schmidt + + * help-fns.el (help-fns--key-bindings): + Abbreviate non-symbol remap targets. (Bug#12174) + 2012-08-22 Martin Rudalics * dired.el (dired-mark-remembered): Don't clobber point. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 4b1480444c2..5791f1225c1 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -397,9 +397,11 @@ suitable file is found, return nil." (if (member (event-modifiers (aref key 0)) '(nil (shift))) (push key non-modified-keys))) (when remapped - (princ "Its keys are remapped to `") - (princ (symbol-name remapped)) - (princ "'.\n")) + (princ "Its keys are remapped to ") + (princ (if (symbolp remapped) + (concat "`" (symbol-name remapped) "'") + "an anonymous command")) + (princ ".\n")) (when keys (princ (if remapped From ffe6eaf17d2dc721cd8daf9a88d61cb6a9731b5a Mon Sep 17 00:00:00 2001 From: Jeremy Moore Date: Wed, 22 Aug 2012 00:17:52 -0700 Subject: [PATCH 085/212] * lisp/progmodes/hideif.el (hif-compress-define-list): Fix typo. (tiny change) Fixes: debbugs:11951 --- lisp/ChangeLog | 5 +++++ lisp/progmodes/hideif.el | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d37b054e9d0..6122c0b0f8d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-22 Jeremy Moore (tiny change) + + * progmodes/hideif.el (hif-compress-define-list): + Fix typo. (Bug#11951) + 2012-08-20 Dan Nicolaescu * progmodes/hideshow.el (hs-block-end-regexp): Restore lost diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el index 3e3d7adc0b6..4b77c6dab1a 100644 --- a/lisp/progmodes/hideif.el +++ b/lisp/progmodes/hideif.el @@ -1003,7 +1003,7 @@ Return as (TOP . BOTTOM) the extent of ifdef block." "Compress the define list ENV into a list of defined symbols only." (let ((new-defs nil)) (dolist (def env new-defs) - (if (hif-lookup (car def)) (push (car env) new-defs))))) + (if (hif-lookup (car def)) (push (car def) new-defs))))) (defun hide-ifdef-set-define-alist (name) "Set the association for NAME to `hide-ifdef-env'." From d733ec6d3d0b6524df9f5f5d9132ff430dd5dc01 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 22 Aug 2012 00:20:42 -0700 Subject: [PATCH 086/212] * fontset.c (FONTSET_ADD): Return void, not Lisp_Object. Otherwise, the compiler complains about (A?B:C) where B is void and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12. (fontset_add): Return void, for FONTSET_ADD. --- src/ChangeLog | 7 +++++++ src/fontset.c | 11 +++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 27e430d7d0d..c43404fa438 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2012-08-22 Paul Eggert + + * fontset.c (FONTSET_ADD): Return void, not Lisp_Object. + Otherwise, the compiler complains about (A?B:C) where B is void + and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12. + (fontset_add): Return void, for FONTSET_ADD. + 2012-08-21 Paul Eggert * alloc.c: Use bool for booleans. diff --git a/src/fontset.c b/src/fontset.c index f5eae58a01e..01e38fe45e5 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -185,8 +185,7 @@ void (*check_window_system_func) (void); /* Prototype declarations for static functions. */ -static Lisp_Object fontset_add (Lisp_Object, Lisp_Object, Lisp_Object, - Lisp_Object); +static void fontset_add (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); static Lisp_Object fontset_find_font (Lisp_Object, int, struct face *, int, int); static void reorder_font_vector (Lisp_Object, struct font *); @@ -356,11 +355,12 @@ fontset_ref (Lisp_Object fontset, int c) ? (NILP (range) \ ? (set_fontset_fallback \ (fontset, Fmake_vector (make_number (1), (elt)))) \ - : Fset_char_table_range ((fontset), (range), \ - Fmake_vector (make_number (1), (elt)))) \ + : ((void) \ + Fset_char_table_range (fontset, range, \ + Fmake_vector (make_number (1), elt)))) \ : fontset_add ((fontset), (range), (elt), (add))) -static Lisp_Object +static void fontset_add (Lisp_Object fontset, Lisp_Object range, Lisp_Object elt, Lisp_Object add) { Lisp_Object args[2]; @@ -389,7 +389,6 @@ fontset_add (Lisp_Object fontset, Lisp_Object range, Lisp_Object elt, Lisp_Objec set_fontset_fallback (fontset, NILP (args[idx]) ? args[1 - idx] : Fvconcat (2, args)); } - return Qnil; } static int From ea95074ef693fee9fe3a4fc9a117b4b129914b64 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Wed, 22 Aug 2012 10:30:54 +0200 Subject: [PATCH 087/212] Let walk-window-tree and window-with-parameter operate on minibuffer windows too. * window.el (walk-window-tree, window-with-parameter): New optional argument MINIBUF to control whether these functions should run on the minibuffer window. (window-at-side-list): Don't operate on minibuffer window. (window-in-direction): Simplify and rewrite doc-string. --- lisp/ChangeLog | 8 ++++++++ lisp/window.el | 56 +++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 52 insertions(+), 12 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index db15ad80927..8599786bc50 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2012-08-22 Martin Rudalics + + * window.el (walk-window-tree, window-with-parameter): New + optional argument MINIBUF to control whether these functions + should run on the minibuffer window. + (window-at-side-list): Don't operate on minibuffer window. + (window-in-direction): Simplify and rewrite doc-string. + 2012-08-22 Christopher Schmidt * help-fns.el (help-fns--key-bindings): diff --git a/lisp/window.el b/lisp/window.el index f6209730a7a..c5561947a84 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -271,19 +271,32 @@ windows horizontally arranged within WINDOW." (setq walk-window-tree-window (window-right walk-window-tree-window)))))) -(defun walk-window-tree (fun &optional frame any) +(defun walk-window-tree (fun &optional frame any minibuf) "Run function FUN on each live window of FRAME. FUN must be a function with one argument - a window. FRAME must be a live frame and defaults to the selected one. ANY, if -non-nil means to run FUN on all live and internal windows of +non-nil, means to run FUN on all live and internal windows of FRAME. +Optional argument MINIBUF t means run FUN on FRAME's minibuffer +window even if it isn't active. MINIBUF nil or omitted means run +FUN on FRAME's minibuffer window only if it's active. In both +cases the minibuffer window must be part of FRAME. MINIBUF +neither nil nor t means never run FUN on the minibuffer window. + This function performs a pre-order, depth-first traversal of the window tree. If FUN changes the window tree, the result is unpredictable." - (let ((walk-window-tree-frame (window-normalize-frame frame))) - (walk-window-tree-1 - fun (frame-root-window walk-window-tree-frame) any))) + (setq frame (window-normalize-frame frame)) + (walk-window-tree-1 fun (frame-root-window frame) any) + (when (memq minibuf '(nil t)) + ;; Run FUN on FRAME's minibuffer window if requested. + (let ((minibuffer-window (minibuffer-window frame))) + (when (and (window-live-p minibuffer-window) + (eq (window-frame minibuffer-window) frame) + (or (eq minibuf t) + (minibuffer-window-active-p minibuffer-window))) + (funcall fun minibuffer-window))))) (defun walk-window-subtree (fun &optional window any) "Run function FUN on the subtree of windows rooted at WINDOW. @@ -299,13 +312,19 @@ is unpredictable." (setq window (window-normalize-window window)) (walk-window-tree-1 fun window any t)) -(defun window-with-parameter (parameter &optional value frame any) +(defun window-with-parameter (parameter &optional value frame any minibuf) "Return first window on FRAME with PARAMETER non-nil. FRAME defaults to the selected frame. Optional argument VALUE non-nil means only return a window whose window-parameter value for PARAMETER equals VALUE (comparison is done with `equal'). Optional argument ANY non-nil means consider internal windows -too." +too. + +Optional argument MINIBUF t means consider FRAME's minibuffer +window even if it isn't active. MINIBUF nil or omitted means +consider FRAME's minibuffer window only if it's active. In both +cases the minibuffer window must be part of FRAME. MINIBUF +neither nil nor t means never consider the minibuffer window." (let (this-value) (catch 'found (walk-window-tree @@ -313,7 +332,7 @@ too." (when (and (setq this-value (window-parameter window parameter)) (or (not value) (equal value this-value))) (throw 'found window))) - frame any)))) + frame any minibuf)))) ;;; Atomic windows. (defun window-atom-root (&optional window) @@ -1088,7 +1107,7 @@ SIDE can be any of the symbols `left', `top', `right' or (lambda (window) (when (window-at-side-p window side) (setq windows (cons window windows)))) - frame) + frame nil 'nomini) (nreverse windows))) (defun window--in-direction-2 (window posn &optional horizontal) @@ -1103,12 +1122,25 @@ SIDE can be any of the symbols `left', `top', `right' or (- left posn) (- posn left (window-total-width window)))))) +;; Predecessors to the below have been devised by Julian Assange in +;; change-windows-intuitively.el and Hovav Shacham in windmove.el. +;; Neither of these allow to selectively ignore specific windows +;; (windows whose `no-other-window' parameter is non-nil) as targets of +;; the movement. (defun window-in-direction (direction &optional window ignore) "Return window in DIRECTION as seen from WINDOW. +More precisely, return the nearest window in direction DIRECTION +as seen from the position of `window-point' in window WINDOW. DIRECTION must be one of `above', `below', `left' or `right'. WINDOW must be a live window and defaults to the selected one. -IGNORE non-nil means a window can be returned even if its -`no-other-window' parameter is non-nil." + +Do not return a window whose `no-other-window' parameter is +non-nil. If the nearest window's `no-other-window' parameter is +non-nil, try to find another window in the indicated direction. +If, however, the optional argument IGNORE is non-nil, return that +window even if its `no-other-window' parameter is non-nil. + +Return nil if no suitable window can be found." (setq window (window-normalize-window window t)) (unless (memq direction '(above below left right)) (error "Wrong direction %s" direction)) @@ -1195,7 +1227,7 @@ IGNORE non-nil means a window can be returned even if its (setq best-edge-2 w-top) (setq best-diff-2 best-diff-2-new) (setq best-2 w))))))) - (window-frame window)) + frame) (or best best-2))) (defun get-window-with-predicate (predicate &optional minibuf all-frames default) From 842e3a93aa3a0826cb4148376e54cd1527d10901 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Wed, 22 Aug 2012 10:42:34 +0200 Subject: [PATCH 088/212] Rename window--size-ignore to window--size-ignore-p. * window.el (window--size-ignore): Rename to window--size-ignore-p. Update callers. --- lisp/ChangeLog | 2 ++ lisp/window.el | 18 +++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8599786bc50..4296280b22e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -5,6 +5,8 @@ should run on the minibuffer window. (window-at-side-list): Don't operate on minibuffer window. (window-in-direction): Simplify and rewrite doc-string. + (window--size-ignore): Rename to window--size-ignore-p. Update + callers. 2012-08-22 Christopher Schmidt diff --git a/lisp/window.el b/lisp/window.el index c5561947a84..ab90d8a4bde 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -535,7 +535,7 @@ unless it has no other choice (like when deleting a neighboring window).") (make-variable-buffer-local 'window-size-fixed) -(defun window--size-ignore (window ignore) +(defun window--size-ignore-p (window ignore) "Return non-nil if IGNORE says to ignore size restrictions for WINDOW." (if (window-valid-p ignore) (eq window ignore) ignore)) @@ -578,7 +578,7 @@ means ignore all of the above restrictions for all windows." value) (with-current-buffer (window-buffer window) (cond - ((and (not (window--size-ignore window ignore)) + ((and (not (window--size-ignore-p window ignore)) (window-size-fixed-p window horizontal)) ;; The minimum size of a fixed size window is its size. (window-total-size window horizontal)) @@ -607,7 +607,7 @@ means ignore all of the above restrictions for all windows." (ceiling (or (frame-parameter frame 'scroll-bar-width) 14) (frame-char-width))) (t 0))) - (if (and (not (window--size-ignore window ignore)) + (if (and (not (window--size-ignore-p window ignore)) (numberp window-min-width)) window-min-width 0)))) @@ -617,7 +617,7 @@ means ignore all of the above restrictions for all windows." (max (+ window-safe-min-height (if header-line-format 1 0) (if mode-line-format 1 0)) - (if (and (not (window--size-ignore window ignore)) + (if (and (not (window--size-ignore-p window ignore)) (numberp window-min-height)) window-min-height 0)))))))) @@ -656,7 +656,7 @@ ignore all of the above restrictions for all windows." (max (- (window-min-size window horizontal ignore) (window-total-size window horizontal)) delta)) - ((window--size-ignore window ignore) + ((window--size-ignore-p window ignore) delta) ((> delta 0) (if (window-size-fixed-p window horizontal) @@ -738,7 +738,7 @@ WINDOW can be resized in the desired direction. The function ((eq sub window) (setq skip (eq trail 'before))) (skip) - ((and (not (window--size-ignore window ignore)) + ((and (not (window--size-ignore-p window ignore)) (window-size-fixed-p sub horizontal))) (t ;; We found a non-fixed-size child window. @@ -828,7 +828,7 @@ at least one other window can be enlarged appropriately." ;; child window is fixed-size. (while sub (when (and (not (eq sub window)) - (not (window--size-ignore sub ignore)) + (not (window--size-ignore-p sub ignore)) (window-size-fixed-p sub horizontal)) (throw 'fixed delta)) (setq sub (window-right sub)))) @@ -868,7 +868,7 @@ Optional argument NODOWN non-nil means do not check whether WINDOW itself (and its child windows) can be enlarged; check only whether other windows can be shrunk appropriately." (setq window (window-normalize-window window)) - (if (and (not (window--size-ignore window ignore)) + (if (and (not (window--size-ignore-p window ignore)) (not nodown) (window-size-fixed-p window horizontal)) ;; With IGNORE and NOWDON nil return zero if WINDOW has fixed ;; size. @@ -1871,7 +1871,7 @@ preferably only resize windows adjacent to EDGE." ;; Make sure this sibling is left alone when ;; resizing its siblings. (set-window-new-normal sub 'ignore)) - ((or (window--size-ignore sub ignore) + ((or (window--size-ignore-p sub ignore) (not (window-size-fixed-p sub horizontal))) ;; Set this-delta to t to signal that we found a sibling ;; of WINDOW whose size is not fixed. From caceae2529106eef4b5cc2b56c0cc6319ea7fcdf Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Wed, 22 Aug 2012 11:22:08 +0200 Subject: [PATCH 089/212] Rewrite handling of side and atomic windows. * window.el (display-buffer-in-atom-window, window--major-non-side-window) (window--major-side-window, display-buffer-in-major-side-window) (delete-side-window, display-buffer-in-side-window): New functions. (window--side-check, window-deletable-p, delete-window) (delete-other-windows, split-window): Handle side windows and atomic windows appropriately. (window--display-buffer): Call display-buffer-record-window also when the window buffer did not change. --- lisp/ChangeLog | 9 + lisp/window.el | 477 ++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 405 insertions(+), 81 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4296280b22e..f8ed5ce15fd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -7,6 +7,15 @@ (window-in-direction): Simplify and rewrite doc-string. (window--size-ignore): Rename to window--size-ignore-p. Update callers. + (display-buffer-in-atom-window, window--major-non-side-window) + (window--major-side-window, display-buffer-in-major-side-window) + (delete-side-window, display-buffer-in-side-window): New + functions. + (window--side-check, window-deletable-p, delete-window) + (delete-other-windows, split-window): Handle side windows and + atomic windows appropriately. + (window--display-buffer): Call display-buffer-record-window also + when the window buffer did not change. 2012-08-22 Christopher Schmidt diff --git a/lisp/window.el b/lisp/window.el index ab90d8a4bde..8f402f0c2b9 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -357,6 +357,45 @@ WINDOW must be an internal window. Return WINDOW." window t) window)) +(defun display-buffer-in-atom-window (buffer alist) + "Display BUFFER in an atomic window. +This function displays BUFFER in a new window that will be +combined with an existing window to form an atomic window. If +the existing window is already part of an atomic window, add the +new window to that atomic window. Operations like `split-window' +or `delete-window', when applied to a constituent of an atomic +window, are applied atomically to the root of that atomic window. + +ALIST is an association list of symbols and values. The +following symbols can be used. + +`window' specifies the existing window the new window shall be + combined with. Use `window-atom-root' to make the new window a + sibling of an atomic window's root. If an internal window is + specified here, all children of that window become part of the + atomic window too. If no window is specified, the new window + becomes a sibling of the selected window. + +`side' denotes the side of the existing window where the new + window shall be located. Valid values are `below', `right', + `above' and `left'. The default is `below'. + +The return value is the new window, nil when creating that window +failed." + (let ((ignore-window-parameters t) + (window-combination-limit t) + (window (cdr (assq 'window alist))) + (side (cdr (assq 'side alist))) + new) + (setq window (window-normalize-window window)) + ;; Split off new window + (when (setq new (split-window window nil side)) + ;; Make sure we have a valid atomic window. + (window-make-atom (window-parent window)) + ;; Display BUFFER in NEW and return NEW. + (window--display-buffer + buffer new 'window display-buffer-mark-dedicated)))) + (defun window--atom-check-1 (window) "Subroutine of `window--atom-check'." (when window @@ -446,23 +485,273 @@ number of slots on that side." (integer :tag "Number" :value 3 :size 5))) :group 'windows) +(defun window--major-non-side-window (&optional frame) + "Return the major non-side window of frame FRAME. +The optional argument FRAME must be a live frame and defaults to +the selected one. + +If FRAME has at least one side window, the major non-side window +is either an internal non-side window such that all other +non-side windows on FRAME descend from it, or the single live +non-side window of FRAME. If FRAME has no side windows, return +its root window." + (let ((frame (window-normalize-frame frame)) + major sibling) + ;; Set major to the _last_ window found by `walk-window-tree' that + ;; is not a side window but has a side window as its sibling. + (walk-window-tree + (lambda (window) + (and (not (window-parameter window 'window-side)) + (or (and (setq sibling (window-prev-sibling window)) + (window-parameter sibling 'window-side)) + (and (setq sibling (window-next-sibling window)) + (window-parameter sibling 'window-side))) + (setq major window))) + frame t) + (or major (frame-root-window frame)))) + +(defun window--major-side-window (side) + "Return major side window on SIDE. +SIDE must be one of the symbols `left', `top', `right' or +`bottom'. Return nil if no such window exists." + (let ((root (frame-root-window)) + window) + ;; (1) If a window on the opposite side exists, return that window's + ;; sibling. + ;; (2) If the new window shall span the entire side, return the + ;; frame's root window. + ;; (3) If a window on an orthogonal side exists, return that + ;; window's sibling. + ;; (4) Otherwise return the frame's root window. + (cond + ((or (and (eq side 'left) + (setq window (window-with-parameter 'window-side 'right nil t))) + (and (eq side 'top) + (setq window (window-with-parameter 'window-side 'bottom nil t)))) + (window-prev-sibling window)) + ((or (and (eq side 'right) + (setq window (window-with-parameter 'window-side 'left nil t))) + (and (eq side 'bottom) + (setq window (window-with-parameter 'window-side 'top nil t)))) + (window-next-sibling window)) + ((memq side '(left right)) + (cond + (window-sides-vertical + root) + ((setq window (window-with-parameter 'window-side 'top nil t)) + (window-next-sibling window)) + ((setq window (window-with-parameter 'window-side 'bottom nil t)) + (window-prev-sibling window)) + (t root))) + ((memq side '(top bottom)) + (cond + ((not window-sides-vertical) + root) + ((setq window (window-with-parameter 'window-side 'left nil t)) + (window-next-sibling window)) + ((setq window (window-with-parameter 'window-side 'right nil t)) + (window-prev-sibling window)) + (t root)))))) + +(defun display-buffer-in-major-side-window (buffer side slot &optional alist) + "Display BUFFER in a new window on SIDE of the selected frame. +SIDE must be one of `left', `top', `right' or `bottom'. SLOT +specifies the slot to use. ALIST is an association list of +symbols and values as passed to `display-buffer-in-side-window'. +This function may be called only if no window on SIDE exists yet. +The new window automatically becomes the \"major\" side window on +SIDE. Return the new window, nil if its creation window failed." + (let* ((root (frame-root-window)) + (left-or-right (memq side '(left right))) + (size (or (assq 'size alist) + (/ (window-total-size (frame-root-window) left-or-right) + ;; By default use a fourth of the size of the + ;; frame's root window. This has to be made + ;; customizable via ALIST. + 4))) + (major (window--major-side-window side)) + (selected-window (selected-window)) + (on-side (cond + ((eq side 'top) 'above) + ((eq side 'bottom) 'below) + (t side))) + ;; The following two bindings will tell `split-window' to take + ;; the space for the new window from `major' and not make a new + ;; parent window unless needed. + (window-combination-resize 'side) + (window-combination-limit nil) + (new (split-window major (- size) on-side)) + fun) + (when new + ;; Initialize `window-side' parameter of new window to SIDE. + (set-window-parameter new 'window-side side) + ;; Install `window-slot' parameter of new window. + (set-window-parameter new 'window-slot slot) + ;; Install `delete-window' parameter thus making sure that when + ;; the new window is deleted, a side window on the opposite side + ;; does not get resized. + (set-window-parameter new 'delete-window 'delete-side-window) + ;; Install BUFFER in new window and return NEW. + (window--display-buffer buffer new 'window 'side)))) + +(defun delete-side-window (window) + "Delete side window WINDOW." + (let ((window-combination-resize + (window-parameter (window-parent window) 'window-side)) + (ignore-window-parameters t)) + (delete-window window))) + +(defun display-buffer-in-side-window (buffer alist) + "Display BUFFER in a window on side SIDE of the selected frame. +ALIST is an association list of symbols and values. The +following symbols can be used: + +`side' denotes the side of the existing window where the new + window shall be located. Valid values are `bottom', `right', + `top' and `left'. The default is `bottom'. + +`slot' if non-nil, specifies the window slot where to display + BUFFER. A value of zero or nil means use the middle slot on + the specified side. A negative value means use a slot + preceding (that is, above or on the left of) the middle slot. + A positive value means use a slot following (that is, below or + on the right of) the middle slot. The default is zero." + (let ((side (or (cdr (assq 'side alist)) 'bottom)) + (slot (or (cdr (assq 'slot alist)) 0)) + new) + (cond + ((not (memq side '(top bottom left right))) + (error "Invalid side %s specified" side)) + ((not (numberp slot)) + (error "Invalid slot %s specified" slot))) + + (let* ((major (window-with-parameter 'window-side side nil t)) + ;; `major' is the major window on SIDE, `windows' the list of + ;; life windows on SIDE. + (windows + (when major + (let (windows) + (walk-window-tree + (lambda (window) + (when (eq (window-parameter window 'window-side) side) + (setq windows (cons window windows))))) + (nreverse windows)))) + (slots (when major (max 1 (window-child-count major)))) + (max-slots + (nth (cond + ((eq side 'left) 0) + ((eq side 'top) 1) + ((eq side 'right) 2) + ((eq side 'bottom) 3)) + window-sides-slots)) + (selected-window (selected-window)) + window this-window this-slot prev-window next-window + best-window best-slot abs-slot new-window) + + (cond + ((and (numberp max-slots) (<= max-slots 0)) + ;; No side-slots available on this side. Don't create an error, + ;; just return nil. + nil) + ((not windows) + ;; No major window exists on this side, make one. + (display-buffer-in-major-side-window buffer side slot alist)) + (t + ;; Scan windows on SIDE. + (catch 'found + (dolist (window windows) + (setq this-slot (window-parameter window 'window-slot)) + (cond + ;; The following should not happen and probably be checked + ;; by window--side-check. + ((not (numberp this-slot))) + ((= this-slot slot) + ;; A window with a matching slot has been found. + (setq this-window window) + (throw 'found t)) + (t + ;; Check if this window has a better slot value wrt the + ;; slot of the window we want. + (setq abs-slot + (if (or (and (> this-slot 0) (> slot 0)) + (and (< this-slot 0) (< slot 0))) + (abs (- slot this-slot)) + (+ (abs slot) (abs this-slot)))) + (unless (and best-slot (<= best-slot abs-slot)) + (setq best-window window) + (setq best-slot abs-slot)) + (cond + ((<= this-slot slot) + (setq prev-window window)) + ((not next-window) + (setq next-window window))))))) + + ;; `this-window' is the first window with the same SLOT. + ;; `prev-window' is the window with the largest slot < SLOT. A new + ;; window will be created after it. + ;; `next-window' is the window with the smallest slot > SLOT. A new + ;; window will be created before it. + ;; `best-window' is the window with the smallest absolute difference + ;; of its slot and SLOT. + + ;; Note: We dedicate the window used softly to its buffer to + ;; avoid that "other" (non-side) buffer display functions steal + ;; it from us. This must eventually become customizable via + ;; ALIST (or, better, avoided in the "other" functions). + (or (and this-window + ;; Reuse `this-window'. + (window--display-buffer buffer this-window 'reuse 'side)) + (and (or (not max-slots) (< slots max-slots)) + (or (and next-window + ;; Make new window before `next-window'. + (let ((next-side + (if (memq side '(left right)) 'above 'left)) + (window-combination-resize 'side)) + (setq window (split-window next-window nil next-side)) + ;; When the new window is deleted, its space + ;; is returned to other side windows. + (set-window-parameter + window 'delete-window 'delete-side-window) + window)) + (and prev-window + ;; Make new window after `prev-window'. + (let ((prev-side + (if (memq side '(left right)) 'below 'right)) + (window-combination-resize 'side)) + (setq window (split-window prev-window nil prev-side)) + ;; When the new window is deleted, its space + ;; is returned to other side windows. + (set-window-parameter + window 'delete-window 'delete-side-window) + window))) + (set-window-parameter window 'window-slot slot) + (window--display-buffer buffer window 'window 'side)) + (and best-window + ;; Reuse `best-window'. + (progn + ;; Give best-window the new slot value. + (set-window-parameter best-window 'window-slot slot) + (window--display-buffer buffer best-window 'reuse 'side))))))))) + (defun window--side-check (&optional frame) - "Check the window-side parameter of all windows on FRAME. -FRAME defaults to the selected frame. If the configuration is -invalid, reset all window-side parameters to nil. + "Check the side window configuration of FRAME. +FRAME defaults to the selected frame. -A valid configuration has to preserve the following invariant: +A valid side window configuration preserves the following two +invariants: -- If a window has a non-nil window-side parameter, it must have a - parent window and the parent window's window-side parameter - must be either nil or the same as for window. +- If there exists a window whose window-side parameter is + non-nil, there must exist at least one live window whose + window-side parameter is nil. -- If windows with non-nil window-side parameters exist, there - must be at most one window of each side and non-side with a - parent whose window-side parameter is nil and there must be no - leaf window whose window-side parameter is nil." - (let (normal none left top right bottom - side parent parent-side) +- If a window W has a non-nil window-side parameter (i) it must + have a parent window and that parent's window-side parameter + must be either nil or the same as for W, and (ii) any child + window of W must have the same window-side parameter as W. + +If the configuration is invalid, reset the window-side parameters +of all windows on FRAME to nil." + (let (left top right bottom none side parent parent-side) (when (or (catch 'reset (walk-window-tree (lambda (window) @@ -478,40 +767,34 @@ A valid configuration has to preserve the following invariant: ;; A parent whose window-side is non-nil must ;; have a child with the same window-side. (throw 'reset t))) - ;; Now check that there's more than one main window - ;; for any of none, left, top, right and bottom. - ((eq side 'none) - (if none - (throw 'reset t) + ((not side) + (when (window-buffer window) + ;; Record that we have at least one non-side, + ;; live window. (setq none t))) + ((if (memq side '(left top)) + (window-prev-sibling window) + (window-next-sibling window)) + ;; Left and top major side windows must not have a + ;; previous sibling, right and bottom major side + ;; windows must not have a next sibling. + (throw 'reset t)) + ;; Now check that there's no more than one major + ;; window for any of left, top, right and bottom. ((eq side 'left) - (if left - (throw 'reset t) - (setq left t))) + (if left (throw 'reset t) (setq left t))) ((eq side 'top) - (if top - (throw 'reset t) - (setq top t))) + (if top (throw 'reset t) (setq top t))) ((eq side 'right) - (if right - (throw 'reset t) - (setq right t))) + (if right (throw 'reset t) (setq right t))) ((eq side 'bottom) - (if bottom - (throw 'reset t) - (setq bottom t))) - ((window-buffer window) - ;; A leaf window without window-side parameter, - ;; record its existence. - (setq normal t)))) + (if bottom (throw 'reset t) (setq bottom t))) + (t + (throw 'reset t)))) frame t)) - (if none - ;; At least one non-side window exists, so there must - ;; be at least one side-window and no normal window. - (or (not (or left top right bottom)) normal) - ;; No non-side window exists, so there must be no side - ;; window either. - (or left top right bottom))) + ;; If there's a side window, there must be at least one + ;; non-side window. + (and (or left top right bottom) (not none))) (walk-window-tree (lambda (window) (set-window-parameter window 'window-side nil)) @@ -2393,8 +2676,7 @@ Return `frame' if deleting WINDOW should also delete its frame." (when (window-parameter window 'window-atom) (setq window (window-atom-root window)))) - (let ((parent (window-parent window)) - (frame (window-frame window))) + (let ((frame (window-frame window))) (cond ((frame-root-window-p window) ;; WINDOW's frame can be deleted only if there are other frames @@ -2405,10 +2687,9 @@ Return `frame' if deleting WINDOW should also delete its frame." (and minibuf (eq frame (window-frame minibuf))))) 'frame)) ((or ignore-window-parameters - (not (eq (window-parameter window 'window-side) 'none)) - (and parent (eq (window-parameter parent 'window-side) 'none))) - ;; WINDOW can be deleted unless it is the main window of its - ;; frame. + (not (eq window (window--major-non-side-window frame)))) + ;; WINDOW can be deleted unless it is the major non-side window of + ;; its frame. t)))) (defun window--in-subtree-p (window root) @@ -2459,13 +2740,13 @@ that is its frame's root window." ((and (window-parameter window 'window-atom) (setq atom-root (window-atom-root window)) (not (eq atom-root window))) - (throw 'done (delete-window atom-root))) - ((and (eq (window-parameter window 'window-side) 'none) - (or (not parent) - (not (eq (window-parameter parent 'window-side) 'none)))) - (error "Attempt to delete last non-side window")) + (if (eq atom-root (frame-root-window frame)) + (error "Root of atomic window is root window of its frame") + (throw 'done (delete-window atom-root)))) ((not parent) - (error "Attempt to delete minibuffer or sole ordinary window"))) + (error "Attempt to delete minibuffer or sole ordinary window")) + ((eq window (window--major-non-side-window frame)) + (error "Attempt to delete last non-side window"))) (let* ((horizontal (window-left-child parent)) (size (window-total-size window horizontal)) @@ -2539,13 +2820,19 @@ window signal an error." ((and (window-parameter window 'window-atom) (setq atom-root (window-atom-root window)) (not (eq atom-root window))) - (throw 'done (delete-other-windows atom-root))) - ((eq window-side 'none) - ;; Set side-main to the major non-side window. - (setq side-main (window-with-parameter 'window-side 'none frame t))) + (if (eq atom-root (frame-root-window frame)) + (error "Root of atomic window is root window of its frame") + (throw 'done (delete-other-windows atom-root)))) ((memq window-side window-sides) - (error "Cannot make side window the only window"))) - ;; If WINDOW is the main non-side window, do nothing. + (error "Cannot make side window the only window")) + ((and (window-minibuffer-p window) + (not (eq window (frame-root-window window)))) + (error "Can't expand minibuffer to full frame"))) + + ;; If WINDOW is the major non-side window, do nothing. + (if (window-with-parameter 'window-side) + (setq side-main (window--major-non-side-window frame)) + (setq side-main (frame-root-window frame))) (unless (eq window side-main) (delete-other-windows-internal window side-main) (run-window-configuration-change-hook frame) @@ -3204,14 +3491,16 @@ frame. The selected window is not changed by this function." ((not side) 'below) ((memq side '(below above right left)) side) (t 'right))) - (horizontal (not (memq side '(nil below above)))) + (horizontal (not (memq side '(below above)))) (frame (window-frame window)) (parent (window-parent window)) (function (window-parameter window 'split-window)) (window-side (window-parameter window 'window-side)) - ;; Rebind `window-combination-limit' since in some cases we may - ;; have to override its value. + ;; Rebind `window-combination-limit' and + ;; `window-combination-resize' since in some cases we may have + ;; to override their value. (window-combination-limit window-combination-limit) + (window-combination-resize window-combination-resize) atom-root) (window--check frame) @@ -3229,20 +3518,32 @@ frame. The selected window is not changed by this function." ((and (window-parameter window 'window-atom) (setq atom-root (window-atom-root window)) (not (eq atom-root window))) - (throw 'done (split-window atom-root size side)))) + (throw 'done (split-window atom-root size side))) + ;; If WINDOW is a side window or its first or last child is a + ;; side window, throw an error unless `window-combination-resize' + ;; equals 'side. + ((and (not (eq window-combination-resize 'side)) + (or (window-parameter window 'window-side) + (and (window-child window) + (or (window-parameter + (window-child window) 'window-side) + (window-parameter + (window-last-child window) 'window-side))))) + (error "Cannot split side window or parent of side window")) + ;; If `window-combination-resize' is 'side and window has a side + ;; window sibling, bind `window-combination-limit' to t. + ((and (not (eq window-combination-resize 'side)) + (or (and (window-prev-sibling window) + (window-parameter + (window-prev-sibling window) 'window-side)) + (and (window-next-sibling window) + (window-parameter + (window-next-sibling window) 'window-side)))) + (setq window-combination-limit t))) - (when (and window-side - (or (not parent) - (not (window-parameter parent 'window-side)))) - ;; WINDOW is a side root window. To make sure that a new parent - ;; window gets created set `window-combination-limit' to t. - (setq window-combination-limit t)) - - (when (and window-combination-resize size (> size 0)) - ;; If `window-combination-resize' is non-nil and SIZE is a - ;; non-negative integer, we cannot reasonably resize other - ;; windows. Rather bind `window-combination-limit' to t to make - ;; sure that subsequent window deletions are handled correctly. + ;; If `window-combination-resize' is t and SIZE is non-negative, + ;; bind `window-combination-limit' to t. + (when (and (eq window-combination-resize t) size (> size 0)) (setq window-combination-limit t)) (let* ((parent-size @@ -3252,7 +3553,10 @@ frame. The selected window is not changed by this function." ;; `resize' non-nil means we are supposed to resize other ;; windows in WINDOW's combination. (resize - (and window-combination-resize (not window-combination-limit) + (and window-combination-resize + (or (window-parameter window 'window-side) + (not (eq window-combination-resize 'side))) + (not window-combination-limit) ;; Resize makes sense in iso-combinations only. (window-combined-p window horizontal))) ;; `old-size' is the current size of WINDOW. @@ -3363,10 +3667,21 @@ frame. The selected window is not changed by this function." new-normal))) (let* ((new (split-window-internal window new-size side new-normal))) - ;; Inherit window-side parameters, if any. - (when (and window-side new-parent) - (set-window-parameter (window-parent new) 'window-side window-side) - (set-window-parameter new 'window-side window-side)) + ;; Assign window-side parameters, if any. + (when (eq window-combination-resize 'side) + (let ((window-side + (cond + (window-side window-side) + ((eq side 'above) 'top) + ((eq side 'below) 'bottom) + (t side)))) + ;; We made a new side window. + (set-window-parameter new 'window-side window-side) + (when (and new-parent (window-parameter window 'window-side)) + ;; We've been splitting a side root window. Give the + ;; new parent the same window-side parameter. + (set-window-parameter + (window-parent new) 'window-side window-side)))) (run-window-configuration-change-hook frame) (window--check frame) @@ -4621,9 +4936,9 @@ is passed unaltered to `display-buffer-record-window'. Set `window-dedicated-p' to DEDICATED if non-nil. Return WINDOW if BUFFER and WINDOW are live." (when (and (buffer-live-p buffer) (window-live-p window)) + (display-buffer-record-window type window buffer) (unless (eq buffer (window-buffer window)) (set-window-dedicated-p window nil) - (display-buffer-record-window type window buffer) (set-window-buffer window buffer) (when dedicated (set-window-dedicated-p window dedicated)) From 4ce7a13803d72d6def8943033a94656f9b02cbd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Wed, 22 Aug 2012 11:55:35 +0200 Subject: [PATCH 090/212] * nsterm.m (insertText:): Don't clear modifiers if code is space. --- src/ChangeLog | 4 ++++ src/nsterm.m | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index c43404fa438..d7595e69a65 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-08-22 Jan Djärv + + * nsterm.m (insertText:): Don't clear modifiers if code is space. + 2012-08-22 Paul Eggert * fontset.c (FONTSET_ADD): Return void, not Lisp_Object. diff --git a/src/nsterm.m b/src/nsterm.m index 12ca52684e6..c892a5486a7 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -5091,7 +5091,8 @@ - (void)insertText: (id)aString /* TODO: still need this? */ if (code == 0x2DC) code = '~'; /* 0x7E */ - emacs_event->modifiers = 0; + if (code != 32) /* Space */ + emacs_event->modifiers = 0; emacs_event->kind = code > 0xFF ? MULTIBYTE_CHAR_KEYSTROKE_EVENT : ASCII_KEYSTROKE_EVENT; emacs_event->code = code; From bfef4149cf6451bdd888dace455214c51914ec42 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 22 Aug 2012 06:17:28 -0400 Subject: [PATCH 091/212] Auto-commit of generated files. --- autogen/config.in | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/autogen/config.in b/autogen/config.in index bd10c9f4076..9b208cc513a 100644 --- a/autogen/config.in +++ b/autogen/config.in @@ -1554,20 +1554,34 @@ along with GNU Emacs. If not, see . */ #if __GNUC__ ? __GNUC_STDC_INLINE__ : 199901L <= __STDC_VERSION__ # define _GL_INLINE inline # define _GL_EXTERN_INLINE extern inline -# if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ -# define _GL_INLINE_HEADER_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") -# define _GL_INLINE_HEADER_END \ - _Pragma ("GCC diagnostic pop") +#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# if __GNUC_GNU_INLINE__ + /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ +# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) +# else +# define _GL_INLINE extern inline # endif +# define _GL_EXTERN_INLINE extern #else # define _GL_INLINE static inline # define _GL_EXTERN_INLINE static inline #endif -#ifndef _GL_INLINE_HEADER_BEGIN +#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) +# if __GNUC_STDC_INLINE__ +# define _GL_INLINE_HEADER_CONST_PRAGMA +# else +# define _GL_INLINE_HEADER_CONST_PRAGMA \ + _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") +# endif +# define _GL_INLINE_HEADER_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \ + _GL_INLINE_HEADER_CONST_PRAGMA +# define _GL_INLINE_HEADER_END \ + _Pragma ("GCC diagnostic pop") +#else # define _GL_INLINE_HEADER_BEGIN # define _GL_INLINE_HEADER_END #endif From 3b7bf1d45b5ad46222cd64071af110c5ce3bb007 Mon Sep 17 00:00:00 2001 From: Katsumi Yamaoka Date: Wed, 22 Aug 2012 10:37:55 +0000 Subject: [PATCH 092/212] [Gnus] Enable posting-style group parameter to hold non-ASCII string values --- lisp/gnus/ChangeLog | 9 +++++++++ lisp/gnus/gnus-cus.el | 24 ++++++++++++++++-------- lisp/gnus/gnus-msg.el | 7 +++++++ 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 7592c405076..2a47b049c9b 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,12 @@ +2012-08-22 Katsumi Yamaoka + + * gnus-cus.el (gnus-group-customize): Decode values posting-style holds. + (gnus-group-customize-done): Encode values posting-style holds. + + * gnus-msg.el (gnus-summary-resend-message) + (gnus-configure-posting-styles): Decode values posting-style group + parameter holds. + 2012-08-21 Katsumi Yamaoka * gnus-msg.el (gnus-summary-resend-message): Honor posting-style for diff --git a/lisp/gnus/gnus-cus.el b/lisp/gnus/gnus-cus.el index 234d0f7ae56..3440e6310af 100644 --- a/lisp/gnus/gnus-cus.el +++ b/lisp/gnus/gnus-cus.el @@ -417,6 +417,11 @@ category.")) (delq elem tmp)) (setq tmp (cdr tmp)))) + ;; Decode values posting-style holds. + (dolist (style (cdr (assq 'posting-style values))) + (when (stringp (cadr style)) + (setcdr style (list (mm-decode-coding-string (cadr style) 'utf-8))))) + (setq gnus-custom-params (apply 'widget-create 'group :value values @@ -487,14 +492,17 @@ form, but who cares?" (defun gnus-group-customize-done (&rest ignore) "Apply changes and bury the buffer." (interactive) - (if gnus-custom-topic - (gnus-topic-set-parameters gnus-custom-topic - (widget-value gnus-custom-params)) - (gnus-group-edit-group-done 'params gnus-custom-group - (widget-value gnus-custom-params)) - (gnus-group-edit-group-done 'method gnus-custom-group - (widget-value gnus-custom-method))) - (bury-buffer)) + (let ((params (widget-value gnus-custom-params))) + ;; Encode values posting-style holds. + (dolist (style (cdr (assq 'posting-style params))) + (when (stringp (cadr style)) + (setcdr style (list (mm-encode-coding-string (cadr style) 'utf-8))))) + (if gnus-custom-topic + (gnus-topic-set-parameters gnus-custom-topic params) + (gnus-group-edit-group-done 'params gnus-custom-group params) + (gnus-group-edit-group-done 'method gnus-custom-group + (widget-value gnus-custom-method))) + (bury-buffer))) ;;; Score Customization: diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index 07748bebb81..c2f79e70d1e 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -1376,6 +1376,9 @@ For the \"inline\" alternatives, also see the variable (user-full-name user-full-name) (user-mail-address user-mail-address) tem) + (dolist (style styles) + (when (stringp (cadr style)) + (setcdr style (list (mm-decode-coding-string (cadr style) 'utf-8))))) (dolist (style (if styles (append gnus-posting-styles (list (cons ".*" styles))) gnus-posting-styles)) @@ -1807,6 +1810,10 @@ this is a reply." (when gnus-newsgroup-name (let ((tmp-style (gnus-group-find-parameter group 'posting-style t))) (when tmp-style + (dolist (style tmp-style) + (when (stringp (cadr style)) + (setcdr style (list (mm-decode-coding-string (cadr style) + 'utf-8))))) (setq styles (append styles (list (cons ".*" tmp-style))))))) ;; Go through all styles and look for matches. (dolist (style styles) From fe72cdc5b294d61eddf2ed96072a64c50686a20c Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 22 Aug 2012 13:30:25 +0200 Subject: [PATCH 093/212] nt/config.nt: Sync with autogen/config.in. --- nt/ChangeLog | 4 ++++ nt/config.nt | 30 ++++++++++++++++++++++-------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/nt/ChangeLog b/nt/ChangeLog index 12273ec7853..7729f09d00f 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,7 @@ +2012-08-22 Juanma Barranquero + + * config.nt: Sync with autogen/config.in. + 2012-08-17 Juanma Barranquero * config.nt: Sync with autogen/config.in. diff --git a/nt/config.nt b/nt/config.nt index 5181e09e64e..34495928b92 100644 --- a/nt/config.nt +++ b/nt/config.nt @@ -1563,20 +1563,34 @@ along with GNU Emacs. If not, see . */ #if __GNUC__ ? __GNUC_STDC_INLINE__ : 199901L <= __STDC_VERSION__ # define _GL_INLINE inline # define _GL_EXTERN_INLINE extern inline -# if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ -# define _GL_INLINE_HEADER_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") -# define _GL_INLINE_HEADER_END \ - _Pragma ("GCC diagnostic pop") +#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# if __GNUC_GNU_INLINE__ + /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ +# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) +# else +# define _GL_INLINE extern inline # endif +# define _GL_EXTERN_INLINE extern #else # define _GL_INLINE static inline # define _GL_EXTERN_INLINE static inline #endif -#ifndef _GL_INLINE_HEADER_BEGIN +#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) +# if __GNUC_STDC_INLINE__ +# define _GL_INLINE_HEADER_CONST_PRAGMA +# else +# define _GL_INLINE_HEADER_CONST_PRAGMA \ + _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") +# endif +# define _GL_INLINE_HEADER_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \ + _GL_INLINE_HEADER_CONST_PRAGMA +# define _GL_INLINE_HEADER_END \ + _Pragma ("GCC diagnostic pop") +#else # define _GL_INLINE_HEADER_BEGIN # define _GL_INLINE_HEADER_END #endif From ff687885ea32bf7016618681724473745fb9ea40 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Wed, 22 Aug 2012 12:05:04 -0400 Subject: [PATCH 094/212] * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to compile time tests instead of run time tests on systems that do not use them. (FRAME_MAC_P): Remove leftover from deleted code. * frame.c (syms_of_frame): Remove leftover from deleted code. --- src/ChangeLog | 8 ++++++++ src/frame.c | 1 - src/frame.h | 14 ++++++++++++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index d7595e69a65..bb1e694825a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2012-08-22 Dan Nicolaescu + + * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to + compile time tests instead of run time tests on systems that do + not use them. + (FRAME_MAC_P): Remove leftover from deleted code. + * frame.c (syms_of_frame): Remove leftover from deleted code. + 2012-08-22 Jan Djärv * nsterm.m (insertText:): Don't clear modifiers if code is space. diff --git a/src/frame.c b/src/frame.c index a00f44a1e5a..4785840a95f 100644 --- a/src/frame.c +++ b/src/frame.c @@ -4247,7 +4247,6 @@ syms_of_frame (void) DEFSYM (Qx, "x"); DEFSYM (Qw32, "w32"); DEFSYM (Qpc, "pc"); - DEFSYM (Qmac, "mac"); DEFSYM (Qns, "ns"); DEFSYM (Qvisible, "visible"); DEFSYM (Qbuffer_predicate, "buffer-predicate"); diff --git a/src/frame.h b/src/frame.h index 92fbda42c70..58b957519c9 100644 --- a/src/frame.h +++ b/src/frame.h @@ -621,11 +621,21 @@ typedef struct frame *FRAME_PTR; #define FRAME_INITIAL_P(f) ((f)->output_method == output_initial) #define FRAME_TERMCAP_P(f) ((f)->output_method == output_termcap) #define FRAME_X_P(f) ((f)->output_method == output_x_window) +#ifndef WINDOWSNT +#define FRAME_W32_P(f) (0) +#else #define FRAME_W32_P(f) ((f)->output_method == output_w32) +#endif +#ifndef MSDOS +#define FRAME_MSDOS_P(f) (0) +#else #define FRAME_MSDOS_P(f) ((f)->output_method == output_msdos_raw) -#define FRAME_MAC_P(f) ((f)->output_method == output_mac) +#endif +#ifndef HAVE_NS +#define FRAME_NS_P(f) (0) +#else #define FRAME_NS_P(f) ((f)->output_method == output_ns) - +#endif /* FRAME_WINDOW_P tests whether the frame is a window, and is defined to be the predicate for the window system being used. */ From 0fcd3d9fa4cdee0a9a067f74c75b9e053502e294 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Wed, 22 Aug 2012 18:58:14 +0200 Subject: [PATCH 095/212] Set `executable-prefix' to "#!" instead of "#! ". See http://www.in-ulm.de/~mascheck/various/shebang/#details for details on why the blank space is never needed. Thanks to Leo for the patch. --- lisp/ChangeLog | 8 +++++++- lisp/progmodes/executable.el | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f8ed5ce15fd..a5464d542a2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-08-22 Bastien Guerry + + * progmodes/executable.el (executable-prefix): Set to "#!" instead + of "#! ". http://www.in-ulm.de/~mascheck/various/shebang/#details + gives details on why the space is never needed. + 2012-08-22 Martin Rudalics * window.el (walk-window-tree, window-with-parameter): New @@ -400,7 +406,7 @@ 2012-08-13 Bastien Guerry - * window.el (special-display-popup-frame): Small docstring + * window.el (special-display-popup-frame): Minor docstring enhancement. (Bug#12172) 2012-08-13 Andreas Schwab diff --git a/lisp/progmodes/executable.el b/lisp/progmodes/executable.el index e5142571972..981a075b4f0 100644 --- a/lisp/progmodes/executable.el +++ b/lisp/progmodes/executable.el @@ -84,7 +84,7 @@ When this is `function', only ask when called non-interactively." :group 'executable) -(defcustom executable-prefix "#! " +(defcustom executable-prefix "#!" "Interpreter magic number prefix inserted when there was no magic number." :type 'string :group 'executable) From add9ca2d9a056c4043c8d244fed8a5f4fcdcc4a0 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Wed, 22 Aug 2012 19:12:35 +0200 Subject: [PATCH 096/212] misc.el (forward-to-word, backward-to-word): Use (interactive "^p"). Thanks to Le Wang for the patch. --- lisp/ChangeLog | 5 ++++- lisp/misc.el | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a5464d542a2..486c12e8c5d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,4 +1,7 @@ -2012-08-22 Bastien Guerry +2012-08-22 Bastien Guerry + + * misc.el (forward-to-word, backward-to-word): Activate or extend + the region under `shift-select-mode'. * progmodes/executable.el (executable-prefix): Set to "#!" instead of "#! ". http://www.in-ulm.de/~mascheck/various/shebang/#details diff --git a/lisp/misc.el b/lisp/misc.el index cb52ecbd36e..96b739dc2b7 100644 --- a/lisp/misc.el +++ b/lisp/misc.el @@ -99,14 +99,14 @@ Ignores CHAR at point." (defun forward-to-word (arg) "Move forward until encountering the beginning of a word. With argument, do this that many times." - (interactive "p") + (interactive "^p") (or (re-search-forward (if (> arg 0) "\\W\\b" "\\b\\W") nil t arg) (goto-char (if (> arg 0) (point-max) (point-min))))) (defun backward-to-word (arg) "Move backward until encountering the end of a word. With argument, do this that many times." - (interactive "p") + (interactive "^p") (forward-to-word (- arg))) ;;;###autoload From 61a48e191ddd1e54b43f7a30f08c05528f5852af Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 22 Aug 2012 13:32:51 -0400 Subject: [PATCH 097/212] ChangeLog fix --- lisp/ChangeLog | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 486c12e8c5d..39d1e94dbf5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,9 @@ -2012-08-22 Bastien Guerry +2012-08-22 Le Wang (tiny change) * misc.el (forward-to-word, backward-to-word): Activate or extend - the region under `shift-select-mode'. + the region under `shift-select-mode'. (Bug#12231) + +2012-08-22 Bastien Guerry * progmodes/executable.el (executable-prefix): Set to "#!" instead of "#! ". http://www.in-ulm.de/~mascheck/various/shebang/#details From 1d0f71d37a0965e098075e8410c65a95011255ff Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 22 Aug 2012 13:34:50 -0400 Subject: [PATCH 098/212] Bump executable-prefix :version --- lisp/progmodes/executable.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/progmodes/executable.el b/lisp/progmodes/executable.el index 981a075b4f0..092e1a4d578 100644 --- a/lisp/progmodes/executable.el +++ b/lisp/progmodes/executable.el @@ -86,6 +86,7 @@ When this is `function', only ask when called non-interactively." (defcustom executable-prefix "#!" "Interpreter magic number prefix inserted when there was no magic number." + :version "24.3" ; "#! " -> "#!" :type 'string :group 'executable) From 141562ffa6320154c7455b99028f74d40af9ee80 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 22 Aug 2012 13:55:19 -0400 Subject: [PATCH 099/212] * lisp/calendar/cal-tex.el (cal-tex-weekly-common): Restore leading blank page. --- lisp/ChangeLog | 5 +++++ lisp/calendar/cal-tex.el | 20 +++++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 39d1e94dbf5..c45fc114e5c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-22 Glenn Morris + + * calendar/cal-tex.el (cal-tex-weekly-common): + Restore leading blank page. + 2012-08-22 Le Wang (tiny change) * misc.el (forward-to-word, backward-to-word): Activate or extend diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index d8d2a09c871..9c01ab40c0c 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -1080,8 +1080,8 @@ shown are hard-coded to 8-12, 13-17." (cal-tex-longday "weekend" "0.8in") (insert cal-tex-lefthead) (cal-tex-longday "leftday" "1.85in")) - (cal-tex-preamble "twoside,12pt") - (insert "\\textwidth 7in + (cal-tex-preamble "twoside,12pt") + (insert "\\textwidth 7in \\textheight 10.5in \\oddsidemargin 0in \\evensidemargin 0in @@ -1090,13 +1090,19 @@ shown are hard-coded to 8-12, 13-17." \\headsep 0.125in \\footskip .125in ") - (insert cal-tex-righthead) - (cal-tex-longday "rightday" "2.75in") - (cal-tex-longday "weekend" "1.8in") - (insert cal-tex-lefthead) - (cal-tex-longday "leftday" "2.75in")) + (insert cal-tex-righthead) + (cal-tex-longday "rightday" "2.75in") + (cal-tex-longday "weekend" "1.8in") + (insert cal-tex-lefthead) + (cal-tex-longday "leftday" "2.75in")) (cal-tex-b-document) (cal-tex-cmd "\\pagestyle" "empty") + ;; Let's assume this is something to with twopage documents. + ;; It has the downside that we start with a blank page. + ;; It doesn't make obvious sense when oddside and evenside margins + ;; are the same (non-filofax), but consider the left and right + ;; versions of various functions as applicable to even and odd pages. + (cal-tex-newpage) (dotimes (i n) (insert "\\lefthead") (cal-tex-arg From d1c0d176e8dc7e7e72d7e029b4c14d7dcc4eb9ec Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 23 Aug 2012 02:30:47 +0300 Subject: [PATCH 100/212] * lisp/info.el (Info-fontify-node): Hide the suffix of the Info file name in the header line. Fixes: debbugs:12187 --- lisp/ChangeLog | 5 +++++ lisp/info.el | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c45fc114e5c..c92691b64b8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-22 Juri Linkov + + * info.el (Info-fontify-node): Hide the suffix of the + Info file name in the header line. (Bug#12187) + 2012-08-22 Glenn Morris * calendar/cal-tex.el (cal-tex-weekly-common): diff --git a/lisp/info.el b/lisp/info.el index 15478f9063c..7365b0efcfd 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -4527,7 +4527,17 @@ first line or header line, and for breadcrumb links.") ((not (bobp)) ;; Hide the punctuation at the end, too. (skip-chars-backward " \t,") - (put-text-property (point) header-end 'invisible t)))))) + (put-text-property (point) header-end 'invisible t) + ;; Hide the suffix of the Info file name. + (beginning-of-line) + (if (re-search-forward + (format "File: %s\\([^,\n\t]+\\)," + (if (stringp Info-current-file) + (file-name-nondirectory Info-current-file) + Info-current-file)) + header-end t) + (put-text-property (match-beginning 1) (match-end 1) + 'invisible t))))))) ;; Fontify titles (goto-char (point-min)) From b1bb8011dbb71df0eae4d041dbf28621bc37e44c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 23 Aug 2012 01:27:08 -0700 Subject: [PATCH 101/212] * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean. * atimer.h: Include . --- src/ChangeLog | 5 +++++ src/atimer.c | 2 +- src/atimer.h | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index bb1e694825a..3f6f6a272f0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-08-23 Paul Eggert + + * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean. + * atimer.h: Include . + 2012-08-22 Dan Nicolaescu * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to diff --git a/src/atimer.c b/src/atimer.c index d67e1375f9a..eb3136ae55d 100644 --- a/src/atimer.c +++ b/src/atimer.c @@ -408,7 +408,7 @@ do_pending_atimers (void) some systems like HPUX (see process.c). */ void -turn_on_atimers (int on) +turn_on_atimers (bool on) { if (on) { diff --git a/src/atimer.h b/src/atimer.h index 4282bab49ba..6d441d71641 100644 --- a/src/atimer.h +++ b/src/atimer.h @@ -20,6 +20,7 @@ along with GNU Emacs. If not, see . */ #define EMACS_ATIMER_H #include "systime.h" /* for EMACS_TIME */ +#include /* Forward declaration. */ @@ -74,7 +75,7 @@ struct atimer *start_atimer (enum atimer_type, EMACS_TIME, void cancel_atimer (struct atimer *); void do_pending_atimers (void); void init_atimer (void); -void turn_on_atimers (int); +void turn_on_atimers (bool); void stop_other_atimers (struct atimer *); Lisp_Object unwind_stop_other_atimers (Lisp_Object); From 7db4ddf40001758a58611c819605075d34edd924 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Thu, 23 Aug 2012 10:33:56 +0200 Subject: [PATCH 102/212] In Fposn_at_x_y do not allow internal window as argument. * keyboard.c (Fposn_at_x_y): Do not allow internal window as argument. --- src/ChangeLog | 5 +++++ src/keyboard.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3f6f6a272f0..158be6d68a9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-08-23 Martin Rudalics + + * keyboard.c (Fposn_at_x_y): Do not allow internal window as + argument. + 2012-08-23 Paul Eggert * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean. diff --git a/src/keyboard.c b/src/keyboard.c index 3d4061accfc..3e0ead7e4fb 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -11251,7 +11251,7 @@ The `posn-' functions access elements of such lists. */) if (WINDOWP (frame_or_window)) { - struct window *w = decode_valid_window (frame_or_window); + struct window *w = decode_live_window (frame_or_window); XSETINT (x, (XINT (x) + WINDOW_LEFT_EDGE_X (w) From db148c21a9bc379f5147d5dfc4f53504308e60bc Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 23 Aug 2012 08:19:27 -0400 Subject: [PATCH 103/212] * lisp/files.el (safe-local-eval-forms): Fix before-save-hook entry to be buffer-local; add delete-trailing-whitespace. Fixes: debbugs:12259 --- lisp/ChangeLog | 5 +++++ lisp/files.el | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6122c0b0f8d..95d920b32ec 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-23 Stefan Monnier + + * files.el (safe-local-eval-forms): Fix before-save-hook entry to be + buffer-local; add delete-trailing-whitespace (bug#12259). + 2012-08-22 Jeremy Moore (tiny change) * progmodes/hideif.el (hif-compress-define-list): diff --git a/lisp/files.el b/lisp/files.el index 02c9e04311e..5f83639d9cf 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2842,7 +2842,8 @@ symbol and VAL is a value that is considered safe." ;; This should be here at least as long as Emacs supports write-file-hooks. '((add-hook 'write-file-hooks 'time-stamp) (add-hook 'write-file-functions 'time-stamp) - (add-hook 'before-save-hook 'time-stamp)) + (add-hook 'before-save-hook 'time-stamp nil t) + (add-hook 'before-save-hook 'delete-trailing-whitespace nil t)) "Expressions that are considered safe in an `eval:' local variable. Add expressions to this list if you want Emacs to evaluate them, when they appear in an `eval' local variable specification, without first From 2cc2116757629868401bdb2073ff44ce32c3d008 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 23 Aug 2012 13:31:52 -0700 Subject: [PATCH 104/212] * bidi.c: Use bool for boolean. This is a bit more readable, and makes the text segment of bidi.o 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15). Presumably it's faster too. (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level): Now bool. (bidi_cache_find_level_change, bidi_cache_iterator_state) (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes) (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init) (bidi_explicit_dir_char, bidi_level_of_next_char) (bidi_find_other_level_edge, bidi_move_to_visually_next): Use bool for booleans, instead of int. * dispextern.h (bidi_init_it, bidi_paragraph_init) (bidi_unshelve_cache): Adjust decls to match code. --- src/ChangeLog | 17 +++++++++++++ src/bidi.c | 63 ++++++++++++++++++++++++------------------------ src/dispextern.h | 6 ++--- 3 files changed, 51 insertions(+), 35 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 158be6d68a9..66df6a2df8f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,20 @@ +2012-08-23 Paul Eggert + + * bidi.c: Use bool for boolean. + This is a bit more readable, and makes the text segment of bidi.o + 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15). + Presumably it's faster too. + (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level): + Now bool. + (bidi_cache_find_level_change, bidi_cache_iterator_state) + (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes) + (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init) + (bidi_explicit_dir_char, bidi_level_of_next_char) + (bidi_find_other_level_edge, bidi_move_to_visually_next): + Use bool for booleans, instead of int. + * dispextern.h (bidi_init_it, bidi_paragraph_init) + (bidi_unshelve_cache): Adjust decls to match code. + 2012-08-23 Martin Rudalics * keyboard.c (Fposn_at_x_y): Do not allow internal window as diff --git a/src/bidi.c b/src/bidi.c index 4df585d4f48..6b3ac53d318 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -63,7 +63,7 @@ along with GNU Emacs. If not, see . */ #include "buffer.h" #include "dispextern.h" -static int bidi_initialized = 0; +static bool bidi_initialized = 0; static Lisp_Object bidi_type_table, bidi_mirror_table; @@ -82,10 +82,10 @@ typedef enum { /* UAX#9 says to search only for L, AL, or R types of characters, and ignore RLE, RLO, LRE, and LRO, when determining the base paragraph level. Yudit indeed ignores them. This variable is therefore set - by default to ignore them, but setting it to zero will take them - into account. */ -extern int bidi_ignore_explicit_marks_for_paragraph_level EXTERNALLY_VISIBLE; -int bidi_ignore_explicit_marks_for_paragraph_level = 1; + by default to ignore them, but clearing it will take them into + account. */ +extern bool bidi_ignore_explicit_marks_for_paragraph_level EXTERNALLY_VISIBLE; +bool bidi_ignore_explicit_marks_for_paragraph_level = 1; static Lisp_Object paragraph_start_re, paragraph_separate_re; static Lisp_Object Qparagraph_start, Qparagraph_separate; @@ -438,7 +438,7 @@ bidi_cache_search (ptrdiff_t charpos, int level, int dir) that is lower than LEVEL, and return its cache slot index. DIR is the direction to search, starting with the last used cache slot. If DIR is zero, we search backwards from the last occupied cache - slot. BEFORE, if non-zero, means return the index of the slot that + slot. BEFORE means return the index of the slot that is ``before'' the level change in the search direction. That is, given the cached levels like this: @@ -448,9 +448,9 @@ bidi_cache_search (ptrdiff_t charpos, int level, int dir) and assuming we are at the position cached at the slot marked with C, searching backwards (DIR = -1) for LEVEL = 2 will return the index of slot B or A, depending whether BEFORE is, respectively, - non-zero or zero. */ + true or false. */ static ptrdiff_t -bidi_cache_find_level_change (int level, int dir, int before) +bidi_cache_find_level_change (int level, int dir, bool before) { if (bidi_cache_idx) { @@ -512,7 +512,7 @@ bidi_cache_ensure_space (ptrdiff_t idx) } static inline void -bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved) +bidi_cache_iterator_state (struct bidi_it *bidi_it, bool resolved) { ptrdiff_t idx; @@ -690,11 +690,11 @@ bidi_shelve_cache (void) /* Restore the cache state from a copy stashed away by bidi_shelve_cache, and free the buffer used to stash that copy. - JUST_FREE non-zero means free the buffer, but don't restore the + JUST_FREE means free the buffer, but don't restore the cache; used when the corresponding iterator is discarded instead of being restored. */ void -bidi_unshelve_cache (void *databuf, int just_free) +bidi_unshelve_cache (void *databuf, bool just_free) { unsigned char *p = databuf; @@ -802,7 +802,7 @@ bidi_set_paragraph_end (struct bidi_it *bidi_it) /* Initialize the bidi iterator from buffer/string position CHARPOS. */ void -bidi_init_it (ptrdiff_t charpos, ptrdiff_t bytepos, int frame_window_p, +bidi_init_it (ptrdiff_t charpos, ptrdiff_t bytepos, bool frame_window_p, struct bidi_it *bidi_it) { if (! bidi_initialized) @@ -872,11 +872,10 @@ bidi_line_init (struct bidi_it *bidi_it) /* Count bytes in string S between BEG/BEGBYTE and END. BEG and END are zero-based character positions in S, BEGBYTE is byte position - corresponding to BEG. UNIBYTE, if non-zero, means S is a unibyte - string. */ + corresponding to BEG. UNIBYTE means S is a unibyte string. */ static inline ptrdiff_t bidi_count_bytes (const unsigned char *s, const ptrdiff_t beg, - const ptrdiff_t begbyte, const ptrdiff_t end, int unibyte) + const ptrdiff_t begbyte, const ptrdiff_t end, bool unibyte) { ptrdiff_t pos = beg; const unsigned char *p = s + begbyte, *start = p; @@ -900,10 +899,10 @@ bidi_count_bytes (const unsigned char *s, const ptrdiff_t beg, /* Fetch and returns the character at byte position BYTEPOS. If S is non-NULL, fetch the character from string S; otherwise fetch the - character from the current buffer. UNIBYTE non-zero means S is a + character from the current buffer. UNIBYTE means S is a unibyte string. */ static inline int -bidi_char_at_pos (ptrdiff_t bytepos, const unsigned char *s, int unibyte) +bidi_char_at_pos (ptrdiff_t bytepos, const unsigned char *s, bool unibyte) { if (s) { @@ -923,9 +922,9 @@ bidi_char_at_pos (ptrdiff_t bytepos, const unsigned char *s, int unibyte) specifies the character position of the next display string, or -1 if not yet computed. When the next character is at or beyond that position, the function updates DISP_POS with the position of the - next display string. DISP_PROP non-zero means that there's really + next display string. *DISP_PROP non-zero means that there's really a display string at DISP_POS, as opposed to when we searched till - DISP_POS without finding one. If DISP_PROP is 2, it means the + DISP_POS without finding one. If *DISP_PROP is 2, it means the display spec is of the form `(space ...)', which is replaced with u+2029 to handle it as a paragraph separator. STRING->s is the C string to iterate, or NULL if iterating over a buffer or a Lisp @@ -933,7 +932,7 @@ bidi_char_at_pos (ptrdiff_t bytepos, const unsigned char *s, int unibyte) static inline int bidi_fetch_char (ptrdiff_t bytepos, ptrdiff_t charpos, ptrdiff_t *disp_pos, int *disp_prop, struct bidi_string_data *string, - int frame_window_p, ptrdiff_t *ch_len, ptrdiff_t *nchars) + bool frame_window_p, ptrdiff_t *ch_len, ptrdiff_t *nchars) { int ch; ptrdiff_t endpos @@ -1134,7 +1133,7 @@ bidi_find_paragraph_start (ptrdiff_t pos, ptrdiff_t pos_byte) R2L, just use that. Otherwise, determine the paragraph direction from the first strong directional character of the paragraph. - NO_DEFAULT_P non-zero means don't default to L2R if the paragraph + NO_DEFAULT_P means don't default to L2R if the paragraph has no strong directional characters and both DIR and bidi_it->paragraph_dir are NEUTRAL_DIR. In that case, search back in the buffer until a paragraph is found with a strong character, @@ -1145,10 +1144,10 @@ bidi_find_paragraph_start (ptrdiff_t pos, ptrdiff_t pos_byte) direction as the preceding paragraph, even though Emacs generally views the separator as not belonging to any paragraph. */ void -bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it, int no_default_p) +bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it, bool no_default_p) { ptrdiff_t bytepos = bidi_it->bytepos; - int string_p = bidi_it->string.s != NULL || STRINGP (bidi_it->string.lstring); + bool string_p = bidi_it->string.s || STRINGP (bidi_it->string.lstring); ptrdiff_t pstartbyte; /* Note that begbyte is a byte position, while end is a character position. Yes, this is ugly, but we are trying to avoid costly @@ -1221,8 +1220,8 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it, int no_default_p) bidi_it->separator_limit = -1; bidi_it->new_paragraph = 0; - /* The following loop is run more than once only if NO_DEFAULT_P - is non-zero, and only if we are iterating on a buffer. */ + /* The following loop is run more than once only if NO_DEFAULT_P, + and only if we are iterating on a buffer. */ do { ptrdiff_t pos1; @@ -1320,7 +1319,7 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it, int no_default_p) The rest of this file constitutes the core of the UBA implementation. ***********************************************************************/ -static inline int +static inline bool bidi_explicit_dir_char (int ch) { bidi_type_t ch_type; @@ -1345,7 +1344,7 @@ bidi_resolve_explicit_1 (struct bidi_it *bidi_it) int current_level; int new_level; bidi_dir_t override; - int string_p = bidi_it->string.s != NULL || STRINGP (bidi_it->string.lstring); + bool string_p = bidi_it->string.s || STRINGP (bidi_it->string.lstring); /* If reseat()'ed, don't advance, so as to start iteration from the position where we were reseated. bidi_it->bytepos can be less @@ -2189,7 +2188,7 @@ bidi_level_of_next_char (struct bidi_it *bidi_it) ptrdiff_t nc = bidi_it->nchars; struct bidi_string_data bs = bidi_it->string; bidi_type_t chtype; - int fwp = bidi_it->frame_window_p; + bool fwp = bidi_it->frame_window_p; int dpp = bidi_it->disp_prop; if (bidi_it->nchars <= 0) @@ -2268,8 +2267,8 @@ bidi_level_of_next_char (struct bidi_it *bidi_it) return level; } -/* Move to the other edge of a level given by LEVEL. If END_FLAG is - non-zero, we are at the end of a level, and we need to prepare to +/* Move to the other edge of a level given by LEVEL. If END_FLAG, + we are at the end of a level, and we need to prepare to resume the scan of the lower level. If this level's other edge is cached, we simply jump to it, filling @@ -2289,7 +2288,7 @@ bidi_level_of_next_char (struct bidi_it *bidi_it) function moves to point C, whereas the UAX#9 ``level 2 run'' ends at point B. */ static void -bidi_find_other_level_edge (struct bidi_it *bidi_it, int level, int end_flag) +bidi_find_other_level_edge (struct bidi_it *bidi_it, int level, bool end_flag) { int dir = end_flag ? -bidi_it->scan_dir : bidi_it->scan_dir; ptrdiff_t idx; @@ -2363,7 +2362,7 @@ bidi_move_to_visually_next (struct bidi_it *bidi_it) scanning the text whenever we find a level change. */ if (new_level != old_level) { - int ascending = new_level > old_level; + bool ascending = new_level > old_level; int level_to_search = ascending ? old_level + 1 : old_level; int incr = ascending ? 1 : -1; int expected_next_level = old_level + incr; diff --git a/src/dispextern.h b/src/dispextern.h index a25aac96df9..6fe5e249836 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3002,14 +3002,14 @@ enum tool_bar_item_image /* Defined in bidi.c */ -extern void bidi_init_it (ptrdiff_t, ptrdiff_t, int, struct bidi_it *); +extern void bidi_init_it (ptrdiff_t, ptrdiff_t, bool, struct bidi_it *); extern void bidi_move_to_visually_next (struct bidi_it *); -extern void bidi_paragraph_init (bidi_dir_t, struct bidi_it *, int); +extern void bidi_paragraph_init (bidi_dir_t, struct bidi_it *, bool); extern int bidi_mirror_char (int); extern void bidi_push_it (struct bidi_it *); extern void bidi_pop_it (struct bidi_it *); extern void *bidi_shelve_cache (void); -extern void bidi_unshelve_cache (void *, int); +extern void bidi_unshelve_cache (void *, bool); /* Defined in xdisp.c */ From ca5256ad0a138d14329ca80a0a4fd952ca2cd092 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 23 Aug 2012 21:05:25 -0700 Subject: [PATCH 105/212] Fix file time stamp problem with bzr and CVS (Bug#12001). * vc/vc-cvs.el (vc-cvs-parse-entry): Ignore subsecond information in the file's time stamp, since the version control system loses that information. --- lisp/ChangeLog | 7 +++++++ lisp/vc/vc-cvs.el | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c92691b64b8..5236ad55903 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2012-08-24 Paul Eggert + + Fix file time stamp problem with bzr and CVS (Bug#12001). + * vc/vc-cvs.el (vc-cvs-parse-entry): Ignore subsecond information + in the file's time stamp, since the version control system loses + that information. + 2012-08-22 Juri Linkov * info.el (Info-fontify-node): Hide the suffix of the diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index 2a672623c01..c1c4b750267 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el @@ -1178,7 +1178,11 @@ is non-nil." (parse-time-string (concat time " +0000"))))) (cond ((and (not (string-match "\\+" time)) (car parsed-time) - (equal mtime (apply 'encode-time parsed-time))) + ;; Compare just the seconds part of the file time, + ;; since CVS file time stamp resolution is just 1 second. + (let ((ptime (apply 'encode-time parsed-time))) + (and (eq (car mtime) (car ptime)) + (eq (cadr mtime) (cadr ptime))))) (vc-file-setprop file 'vc-checkout-time mtime) (if set-state (vc-file-setprop file 'vc-state 'up-to-date))) (t From 37ef52bb653c99525c3ecf7cd1ca4ff15de7dec5 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 23 Aug 2012 21:37:57 -0700 Subject: [PATCH 106/212] * buffer.c, buffer.h: Use bool for boolean. * buffer.c (reset_buffer_local_variables) (buffer_lisp_local_variables, Fset_buffer_modified_p) (Frestore_buffer_modified_p, Fset_buffer_multibyte): (overlays_at, overlays_in, mouse_face_overlay_overlaps) (overlay_touches_p, overlay_strings, Foverlay_put) (report_overlay_modification, call_overlay_mod_hooks): (mmap_enlarge, mmap_set_vars): * buffer.h (buffer_has_overlays, uppercasep, lowercasep): Use bool for booleans, instead of int. * buffer.c (compact_buffer, mmap_free_1): Return void, not int, since the 1-or-0 return value is always ignored anyway. (mmap_initialized_p): * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int. * buffer.h, lisp.h: Adjust prototypes to match above changes. --- src/ChangeLog | 18 ++++++++ src/buffer.c | 118 +++++++++++++++++++++++--------------------------- src/buffer.h | 22 +++++----- src/lisp.h | 6 +-- 4 files changed, 86 insertions(+), 78 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 66df6a2df8f..feed9f8233e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,21 @@ +2012-08-24 Paul Eggert + + * buffer.c, buffer.h: Use bool for boolean. + * buffer.c (reset_buffer_local_variables) + (buffer_lisp_local_variables, Fset_buffer_modified_p) + (Frestore_buffer_modified_p, Fset_buffer_multibyte): + (overlays_at, overlays_in, mouse_face_overlay_overlaps) + (overlay_touches_p, overlay_strings, Foverlay_put) + (report_overlay_modification, call_overlay_mod_hooks): + (mmap_enlarge, mmap_set_vars): + * buffer.h (buffer_has_overlays, uppercasep, lowercasep): + Use bool for booleans, instead of int. + * buffer.c (compact_buffer, mmap_free_1): Return void, not int, + since the 1-or-0 return value is always ignored anyway. + (mmap_initialized_p): + * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int. + * buffer.h, lisp.h: Adjust prototypes to match above changes. + 2012-08-23 Paul Eggert * bidi.c: Use bool for boolean. diff --git a/src/buffer.c b/src/buffer.c index c900ef8c5a8..4d606c2105a 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -110,10 +110,10 @@ static char buffer_permanent_local_flags[MAX_PER_BUFFER_VARS]; int last_per_buffer_idx; static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, - int after, Lisp_Object arg1, + bool after, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3); static void swap_out_buffer_local_variables (struct buffer *b); -static void reset_buffer_local_variables (struct buffer *b, int permanent_too); +static void reset_buffer_local_variables (struct buffer *, bool); /* Alist of all buffer names vs the buffers. */ /* This used to be a variable, but is no longer, @@ -155,7 +155,7 @@ static void alloc_buffer_text (struct buffer *, ptrdiff_t); static void free_buffer_text (struct buffer *b); static struct Lisp_Overlay * copy_overlays (struct buffer *, struct Lisp_Overlay *); static void modify_overlay (struct buffer *, ptrdiff_t, ptrdiff_t); -static Lisp_Object buffer_lisp_local_variables (struct buffer *, int); +static Lisp_Object buffer_lisp_local_variables (struct buffer *, bool); /* These setters are used only in this file, so they can be private. */ static inline void @@ -979,15 +979,13 @@ reset_buffer (register struct buffer *b) it does not treat permanent locals consistently. Instead, use Fkill_all_local_variables. - If PERMANENT_TOO is 1, then we reset permanent - buffer-local variables. If PERMANENT_TOO is 0, - we preserve those. */ + If PERMANENT_TOO, reset permanent buffer-local variables. + If not, preserve those. */ static void -reset_buffer_local_variables (register struct buffer *b, int permanent_too) +reset_buffer_local_variables (struct buffer *b, bool permanent_too) { - register int offset; - int i; + int offset, i; /* Reset the major mode to Fundamental, together with all the things that depend on the major mode. @@ -1253,14 +1251,14 @@ buffer_local_value_1 (Lisp_Object variable, Lisp_Object buffer) /* Return an alist of the Lisp-level buffer-local bindings of buffer BUF. That is, don't include the variables maintained in special slots in the buffer object. - If CLONE is zero elements of the form (VAR . unbound) are replaced + If not CLONE, replace elements of the form (VAR . unbound) by VAR. */ static Lisp_Object -buffer_lisp_local_variables (struct buffer *buf, int clone) +buffer_lisp_local_variables (struct buffer *buf, bool clone) { Lisp_Object result = Qnil; - register Lisp_Object tail; + Lisp_Object tail; for (tail = BVAR (buf, local_var_alist); CONSP (tail); tail = XCDR (tail)) { Lisp_Object val, elt; @@ -1351,11 +1349,9 @@ DEFUN ("set-buffer-modified-p", Fset_buffer_modified_p, Sset_buffer_modified_p, 1, 1, 0, doc: /* Mark current buffer as modified or unmodified according to FLAG. A non-nil FLAG means mark the buffer modified. */) - (register Lisp_Object flag) + (Lisp_Object flag) { - register int already; - register Lisp_Object fn; - Lisp_Object buffer, window; + Lisp_Object fn, buffer, window; #ifdef CLASH_DETECTION /* If buffer becoming modified, lock the file. @@ -1365,7 +1361,7 @@ A non-nil FLAG means mark the buffer modified. */) /* Test buffer-file-name so that binding it to nil is effective. */ if (!NILP (fn) && ! NILP (BVAR (current_buffer, filename))) { - already = SAVE_MODIFF < MODIFF; + bool already = SAVE_MODIFF < MODIFF; if (!already && !NILP (flag)) lock_file (fn); else if (already && NILP (flag)) @@ -1432,7 +1428,7 @@ state of the current buffer. Use with care. */) /* Test buffer-file-name so that binding it to nil is effective. */ if (!NILP (fn) && ! NILP (BVAR (current_buffer, filename))) { - int already = SAVE_MODIFF < MODIFF; + bool already = SAVE_MODIFF < MODIFF; if (!already && !NILP (flag)) lock_file (fn); else if (already && NILP (flag)) @@ -1676,7 +1672,7 @@ No argument or nil as argument means do this for the current buffer. */) /* Truncate undo list and shrink the gap of BUFFER. */ -int +void compact_buffer (struct buffer *buffer) { /* Verify indirection counters. */ @@ -1718,9 +1714,7 @@ compact_buffer (struct buffer *buffer) } } buffer->text->compact = buffer->text->modiff; - return 1; } - return 0; } DEFUN ("kill-buffer", Fkill_buffer, Skill_buffer, 0, 1, "bKill buffer: ", @@ -2471,8 +2465,8 @@ current buffer is cleared. */) struct Lisp_Marker *tail, *markers; struct buffer *other; ptrdiff_t begv, zv; - int narrowed = (BEG != BEGV || Z != ZV); - int modified_p = !NILP (Fbuffer_modified_p (Qnil)); + bool narrowed = (BEG != BEGV || Z != ZV); + bool modified_p = !NILP (Fbuffer_modified_p (Qnil)); Lisp_Object old_undo = BVAR (current_buffer, undo_list); struct gcpro gcpro1; @@ -2821,19 +2815,19 @@ swap_out_buffer_local_variables (struct buffer *b) *VEC_PTR and *LEN_PTR should contain a valid vector and size when this function is called. - If EXTEND is non-zero, we make the vector bigger if necessary. - If EXTEND is zero, we never extend the vector, - and we store only as many overlays as will fit. - But we still return the total number of overlays. + If EXTEND, make the vector bigger if necessary. + If not, never extend the vector, + and store only as many overlays as will fit. + But still return the total number of overlays. - If CHANGE_REQ is true, then any position written into *PREV_PTR or + If CHANGE_REQ, any position written into *PREV_PTR or *NEXT_PTR is guaranteed to be not equal to POS, unless it is the default (BEGV or ZV). */ ptrdiff_t -overlays_at (EMACS_INT pos, int extend, Lisp_Object **vec_ptr, +overlays_at (EMACS_INT pos, bool extend, Lisp_Object **vec_ptr, ptrdiff_t *len_ptr, - ptrdiff_t *next_ptr, ptrdiff_t *prev_ptr, int change_req) + ptrdiff_t *next_ptr, ptrdiff_t *prev_ptr, bool change_req) { Lisp_Object overlay, start, end; struct Lisp_Overlay *tail; @@ -2842,7 +2836,7 @@ overlays_at (EMACS_INT pos, int extend, Lisp_Object **vec_ptr, Lisp_Object *vec = *vec_ptr; ptrdiff_t next = ZV; ptrdiff_t prev = BEGV; - int inhibit_storing = 0; + bool inhibit_storing = 0; for (tail = current_buffer->overlays_before; tail; tail = tail->next) { @@ -2959,13 +2953,13 @@ overlays_at (EMACS_INT pos, int extend, Lisp_Object **vec_ptr, *VEC_PTR and *LEN_PTR should contain a valid vector and size when this function is called. - If EXTEND is non-zero, we make the vector bigger if necessary. - If EXTEND is zero, we never extend the vector, - and we store only as many overlays as will fit. - But we still return the total number of overlays. */ + If EXTEND, make the vector bigger if necessary. + If not, never extend the vector, + and store only as many overlays as will fit. + But still return the total number of overlays. */ static ptrdiff_t -overlays_in (EMACS_INT beg, EMACS_INT end, int extend, +overlays_in (EMACS_INT beg, EMACS_INT end, bool extend, Lisp_Object **vec_ptr, ptrdiff_t *len_ptr, ptrdiff_t *next_ptr, ptrdiff_t *prev_ptr) { @@ -2976,8 +2970,8 @@ overlays_in (EMACS_INT beg, EMACS_INT end, int extend, Lisp_Object *vec = *vec_ptr; ptrdiff_t next = ZV; ptrdiff_t prev = BEGV; - int inhibit_storing = 0; - int end_is_Z = end == Z; + bool inhibit_storing = 0; + bool end_is_Z = end == Z; for (tail = current_buffer->overlays_before; tail; tail = tail->next) { @@ -3078,10 +3072,10 @@ overlays_in (EMACS_INT beg, EMACS_INT end, int extend, } -/* Return non-zero if there exists an overlay with a non-nil +/* Return true if there exists an overlay with a non-nil `mouse-face' property overlapping OVERLAY. */ -int +bool mouse_face_overlay_overlaps (Lisp_Object overlay) { ptrdiff_t start = OVERLAY_POSITION (OVERLAY_START (overlay)); @@ -3110,7 +3104,7 @@ mouse_face_overlay_overlaps (Lisp_Object overlay) /* Fast function to just test if we're at an overlay boundary. */ -int +bool overlay_touches_p (ptrdiff_t pos) { Lisp_Object overlay; @@ -3327,7 +3321,7 @@ overlay_strings (ptrdiff_t pos, struct window *w, unsigned char **pstr) Lisp_Object overlay, window, str; struct Lisp_Overlay *ov; ptrdiff_t startpos, endpos; - int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); + bool multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); overlay_heads.used = overlay_heads.bytes = 0; overlay_tails.used = overlay_tails.bytes = 0; @@ -4321,7 +4315,7 @@ VALUE will be returned.*/) (Lisp_Object overlay, Lisp_Object prop, Lisp_Object value) { Lisp_Object tail, buffer; - int changed; + bool changed; CHECK_OVERLAY (overlay); @@ -4396,7 +4390,7 @@ add_overlay_mod_hooklist (Lisp_Object functionlist, Lisp_Object overlay) and the insert-after-hooks of overlay ending at START. This is called both before and after the modification. - AFTER is nonzero when we call after the modification. + AFTER is true when we call after the modification. ARG1, ARG2, ARG3 are arguments to pass to the hook functions. When AFTER is nonzero, they are the start position, @@ -4404,13 +4398,13 @@ add_overlay_mod_hooklist (Lisp_Object functionlist, Lisp_Object overlay) and the length of deleted or replaced old text. */ void -report_overlay_modification (Lisp_Object start, Lisp_Object end, int after, +report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) { Lisp_Object prop, overlay; struct Lisp_Overlay *tail; - /* 1 if this change is an insertion. */ - int insertion = (after ? XFASTINT (arg3) == 0 : EQ (start, end)); + /* True if this change is an insertion. */ + bool insertion = (after ? XFASTINT (arg3) == 0 : EQ (start, end)); struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; overlay = Qnil; @@ -4530,7 +4524,7 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, int after, } static void -call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, int after, +call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, bool after, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) { struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; @@ -4689,7 +4683,7 @@ static int mmap_page_size; /* 1 means mmap has been initialized. */ -static int mmap_initialized_p; +static bool mmap_initialized_p; /* Value is X rounded up to the next multiple of N. */ @@ -4785,9 +4779,9 @@ mmap_find (void *start, void *end) /* Unmap a region. P is a pointer to the start of the user-araa of - the region. Value is non-zero if successful. */ + the region. */ -static int +static void mmap_free_1 (struct mmap_region *r) { if (r->next) @@ -4798,24 +4792,19 @@ mmap_free_1 (struct mmap_region *r) mmap_regions = r->next; if (munmap (r, r->nbytes_mapped) == -1) - { - fprintf (stderr, "munmap: %s\n", emacs_strerror (errno)); - return 0; - } - - return 1; + fprintf (stderr, "munmap: %s\n", emacs_strerror (errno)); } /* Enlarge region R by NPAGES pages. NPAGES < 0 means shrink R. - Value is non-zero if successful. */ + Value is true if successful. */ -static int +static bool mmap_enlarge (struct mmap_region *r, int npages) { char *region_end = (char *) r + r->nbytes_mapped; size_t nbytes; - int success = 0; + bool success = 0; if (npages < 0) { @@ -4865,17 +4854,16 @@ mmap_enlarge (struct mmap_region *r, int npages) } -/* Set or reset variables holding references to mapped regions. If - RESTORE_P is zero, set all variables to null. If RESTORE_P is - non-zero, set all variables to the start of the user-areas - of mapped regions. +/* Set or reset variables holding references to mapped regions. + If not RESTORE_P, set all variables to null. If RESTORE_P, set all + variables to the start of the user-areas of mapped regions. This function is called from Fdump_emacs to ensure that the dumped Emacs doesn't contain references to memory that won't be mapped when Emacs starts. */ void -mmap_set_vars (int restore_p) +mmap_set_vars (bool restore_p) { struct mmap_region *r; diff --git a/src/buffer.h b/src/buffer.h index 6c63c52dc47..c8b59ffde0b 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -471,7 +471,7 @@ struct buffer_text /* Usually 0. Temporarily set to 1 in decode_coding_gap to prevent Fgarbage_collect from shrinking the gap and losing not-yet-decoded bytes. */ - int inhibit_shrinking; + bool inhibit_shrinking; }; /* Most code should use this macro to access Lisp fields in struct buffer. */ @@ -1006,11 +1006,10 @@ extern struct buffer buffer_local_symbols; extern void delete_all_overlays (struct buffer *); extern void reset_buffer (struct buffer *); -extern int compact_buffer (struct buffer *); +extern void compact_buffer (struct buffer *); extern void evaporate_overlays (ptrdiff_t); -extern ptrdiff_t overlays_at (EMACS_INT pos, int extend, Lisp_Object **vec_ptr, - ptrdiff_t *len_ptr, ptrdiff_t *next_ptr, - ptrdiff_t *prev_ptr, int change_req); +extern ptrdiff_t overlays_at (EMACS_INT, bool, Lisp_Object **, + ptrdiff_t *, ptrdiff_t *, ptrdiff_t *, bool); extern ptrdiff_t sort_overlays (Lisp_Object *, ptrdiff_t, struct window *); extern void recenter_overlay_lists (struct buffer *, ptrdiff_t); extern ptrdiff_t overlay_strings (ptrdiff_t, struct window *, unsigned char **); @@ -1022,7 +1021,7 @@ extern Lisp_Object buffer_local_value_1 (Lisp_Object, Lisp_Object); extern void record_buffer (Lisp_Object); extern _Noreturn void buffer_slot_type_mismatch (Lisp_Object, int); extern void fix_overlays_before (struct buffer *, ptrdiff_t, ptrdiff_t); -extern void mmap_set_vars (int); +extern void mmap_set_vars (bool); /* Get overlays at POSN into array OVERLAYS with NOVERLAYS elements. If NEXTP is non-NULL, return next overlay there. @@ -1067,7 +1066,7 @@ set_buffer_intervals (struct buffer *b, INTERVAL i) /* Non-zero if current buffer has overlays. */ -BUFFER_INLINE int +BUFFER_INLINE bool buffer_has_overlays (void) { return current_buffer->overlays_before || current_buffer->overlays_after; @@ -1243,7 +1242,7 @@ downcase (int c) } /* 1 if C is upper case. */ -BUFFER_INLINE int uppercasep (int c) { return downcase (c) != c; } +BUFFER_INLINE bool uppercasep (int c) { return downcase (c) != c; } /* Upcase a character C known to be not upper case. */ BUFFER_INLINE int @@ -1255,8 +1254,11 @@ upcase1 (int c) } /* 1 if C is lower case. */ -BUFFER_INLINE int lowercasep (int c) -{ return !uppercasep (c) && upcase1 (c) != c; } +BUFFER_INLINE bool +lowercasep (int c) +{ + return !uppercasep (c) && upcase1 (c) != c; +} /* Upcase a character C, or make no change if that cannot be done. */ BUFFER_INLINE int upcase (int c) { return uppercasep (c) ? c : upcase1 (c); } diff --git a/src/lisp.h b/src/lisp.h index d9a7c9d0bdc..7847d454bc1 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3110,14 +3110,14 @@ extern void syms_of_editfns (void); extern void set_time_zone_rule (const char *); /* Defined in buffer.c. */ -extern int mouse_face_overlay_overlaps (Lisp_Object); +extern bool mouse_face_overlay_overlaps (Lisp_Object); extern _Noreturn void nsberror (Lisp_Object); extern void adjust_overlays_for_insert (ptrdiff_t, ptrdiff_t); extern void adjust_overlays_for_delete (ptrdiff_t, ptrdiff_t); extern void fix_start_end_in_overlays (ptrdiff_t, ptrdiff_t); -extern void report_overlay_modification (Lisp_Object, Lisp_Object, int, +extern void report_overlay_modification (Lisp_Object, Lisp_Object, bool, Lisp_Object, Lisp_Object, Lisp_Object); -extern int overlay_touches_p (ptrdiff_t); +extern bool overlay_touches_p (ptrdiff_t); extern Lisp_Object Vbuffer_alist; extern Lisp_Object set_buffer_if_live (Lisp_Object); extern Lisp_Object other_buffer_safely (Lisp_Object); From 36c46f8e09d5cb0cb8d2b19b9d3ad4826b5e163c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 24 Aug 2012 11:26:46 +0300 Subject: [PATCH 107/212] Fix bug #12242 with crashes in ralloc.c on OpenBSD. src/ralloc.c (free_bloc): Don't dereference a 'heap' structure if it is not one of the heaps we manage. --- src/ChangeLog | 5 +++++ src/ralloc.c | 45 ++++++++++++++++++++++++++++++++------------- 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 7da25a856e6..e5adbedd567 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-08-24 Eli Zaretskii + + * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it + is not one of the heaps we manage. (Bug#12242) + 2012-08-15 Chong Yidong * Version 24.2 released. diff --git a/src/ralloc.c b/src/ralloc.c index b1a5982574f..fdcee7c7ef4 100644 --- a/src/ralloc.c +++ b/src/ralloc.c @@ -686,6 +686,7 @@ static void free_bloc (bloc_ptr bloc) { heap_ptr heap = bloc->heap; + heap_ptr h; if (r_alloc_freeze_level) { @@ -715,20 +716,38 @@ free_bloc (bloc_ptr bloc) bloc->prev->next = bloc->next; } - /* Update the records of which blocs are in HEAP. */ - if (heap->first_bloc == bloc) + /* Sometimes, 'heap' obtained from bloc->heap above is not really a + 'heap' structure. It can even be beyond the current break point, + which will cause crashes when we dereference it below (see + bug#12242). Evidently, the reason is bloc allocations done while + use_relocatable_buffers was non-positive, because additional + memory we get then is not recorded in the heaps we manage. If + bloc->heap records such a "heap", we cannot (and don't need to) + update its records. So we validate the 'heap' value by making + sure it is one of the heaps we manage via the heaps linked list, + and don't touch a 'heap' that isn't found there. This avoids + accessing memory we know nothing about. */ + for (h = first_heap; h != NIL_HEAP; h = h->next) + if (heap == h) + break; + + if (h) { - if (bloc->next != 0 && bloc->next->heap == heap) - heap->first_bloc = bloc->next; - else - heap->first_bloc = heap->last_bloc = NIL_BLOC; - } - if (heap->last_bloc == bloc) - { - if (bloc->prev != 0 && bloc->prev->heap == heap) - heap->last_bloc = bloc->prev; - else - heap->first_bloc = heap->last_bloc = NIL_BLOC; + /* Update the records of which blocs are in HEAP. */ + if (heap->first_bloc == bloc) + { + if (bloc->next != 0 && bloc->next->heap == heap) + heap->first_bloc = bloc->next; + else + heap->first_bloc = heap->last_bloc = NIL_BLOC; + } + if (heap->last_bloc == bloc) + { + if (bloc->prev != 0 && bloc->prev->heap == heap) + heap->last_bloc = bloc->prev; + else + heap->first_bloc = heap->last_bloc = NIL_BLOC; + } } relinquish (); From 19c17fc1475500f2a6fecf1b8ebd08e64635e4ca Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Fri, 24 Aug 2012 17:53:39 +0800 Subject: [PATCH 108/212] Update release logs --- ChangeLog | 2 +- admin/ChangeLog | 2 +- doc/emacs/ChangeLog | 2 +- doc/lispintro/ChangeLog | 2 +- doc/lispref/ChangeLog | 2 +- doc/man/ChangeLog | 2 +- doc/misc/ChangeLog | 2 +- etc/ChangeLog | 2 +- leim/ChangeLog | 2 +- lib-src/ChangeLog | 2 +- lisp/ChangeLog | 12 ++++++------ lisp/erc/ChangeLog | 2 +- lisp/mh-e/ChangeLog | 2 +- lisp/org/ChangeLog | 2 +- lisp/url/ChangeLog | 2 +- lwlib/ChangeLog | 2 +- msdos/ChangeLog | 2 +- nextstep/ChangeLog | 2 +- nt/ChangeLog | 2 +- oldXMenu/ChangeLog | 2 +- src/ChangeLog | 8 ++++---- test/ChangeLog | 2 +- 22 files changed, 30 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index 31091767f93..9b2bd44bd5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2012-08-15 Chong Yidong +2012-08-24 Chong Yidong * Version 24.2 released. diff --git a/admin/ChangeLog b/admin/ChangeLog index 57b5ac0bd24..d08ed24ded5 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,4 +1,4 @@ -2012-08-15 Chong Yidong +2012-08-24 Chong Yidong * Version 24.2 released. diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index bb3863858a3..ad0b4af4af9 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,4 +1,4 @@ -2012-08-15 Chong Yidong +2012-08-24 Chong Yidong * Version 24.2 released. diff --git a/doc/lispintro/ChangeLog b/doc/lispintro/ChangeLog index 9a5f0a43fca..bc2ed8a8d82 100644 --- a/doc/lispintro/ChangeLog +++ b/doc/lispintro/ChangeLog @@ -1,4 +1,4 @@ -2012-08-15 Chong Yidong +2012-08-24 Chong Yidong * Version 24.2 released. diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 8acf76c93b0..f283a3d9363 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,4 +1,4 @@ -2012-08-15 Chong Yidong +2012-08-24 Chong Yidong * Version 24.2 released. diff --git a/doc/man/ChangeLog b/doc/man/ChangeLog index 07504ebaf6e..bdaccfe0ac5 100644 --- a/doc/man/ChangeLog +++ b/doc/man/ChangeLog @@ -1,4 +1,4 @@ -2012-08-15 Chong Yidong +2012-08-24 Chong Yidong * Version 24.2 released. diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 33118558cbb..950a379b5fb 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,4 +1,4 @@ -2012-08-15 Chong Yidong +2012-08-24 Chong Yidong * Version 24.2 released. diff --git a/etc/ChangeLog b/etc/ChangeLog index af72e050e43..38e346e4d96 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,4 +1,4 @@ -2012-08-15 Chong Yidong +2012-08-24 Chong Yidong * Version 24.2 released. diff --git a/leim/ChangeLog b/leim/ChangeLog index c30e0fc7878..320e6067e44 100644 --- a/leim/ChangeLog +++ b/leim/ChangeLog @@ -1,4 +1,4 @@ -2012-08-15 Chong Yidong +2012-08-24 Chong Yidong * Version 24.2 released. diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 6ae19d1fdf4..0bf37785f91 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,4 +1,4 @@ -2012-08-15 Chong Yidong +2012-08-24 Chong Yidong * Version 24.2 released. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 95d920b32ec..a29946a5a73 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,11 @@ +2012-08-24 Chong Yidong + + * Version 24.2 released. + 2012-08-23 Stefan Monnier - * files.el (safe-local-eval-forms): Fix before-save-hook entry to be - buffer-local; add delete-trailing-whitespace (bug#12259). + * files.el (safe-local-eval-forms): Fix before-save-hook entry to + be buffer-local; add delete-trailing-whitespace (bug#12259). 2012-08-22 Jeremy Moore (tiny change) @@ -13,10 +17,6 @@ * progmodes/hideshow.el (hs-block-end-regexp): Restore lost buffer local setting. -2012-08-15 Chong Yidong - - * Version 24.2 released. - 2012-08-15 Glenn Morris * vc/log-edit.el (log-edit-font-lock-gnu-style): Mark safe if boolean. diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 37ef37f1edc..87177148e88 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,4 +1,4 @@ -2012-08-15 Chong Yidong +2012-08-24 Chong Yidong * Version 24.2 released. diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index 6e431cb8095..faf125bb4db 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog @@ -1,4 +1,4 @@ -2012-08-15 Chong Yidong +2012-08-24 Chong Yidong * Version 24.2 released. diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog index 8c588c4d559..734a5d8ac10 100644 --- a/lisp/org/ChangeLog +++ b/lisp/org/ChangeLog @@ -1,4 +1,4 @@ -2012-08-15 Chong Yidong +2012-08-24 Chong Yidong * Version 24.2 released. diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index e71f266c544..c9050a35786 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,4 +1,4 @@ -2012-08-15 Chong Yidong +2012-08-24 Chong Yidong * Version 24.2 released. diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog index 8b8b3418c77..10e945e7821 100644 --- a/lwlib/ChangeLog +++ b/lwlib/ChangeLog @@ -1,4 +1,4 @@ -2012-08-15 Chong Yidong +2012-08-24 Chong Yidong * Version 24.2 released. diff --git a/msdos/ChangeLog b/msdos/ChangeLog index e7113ce2669..96f7762ed76 100644 --- a/msdos/ChangeLog +++ b/msdos/ChangeLog @@ -1,4 +1,4 @@ -2012-08-15 Chong Yidong +2012-08-24 Chong Yidong * Version 24.2 released. diff --git a/nextstep/ChangeLog b/nextstep/ChangeLog index 07dc3d1bb4c..0b8f0207c26 100644 --- a/nextstep/ChangeLog +++ b/nextstep/ChangeLog @@ -1,4 +1,4 @@ -2012-08-15 Chong Yidong +2012-08-24 Chong Yidong * Version 24.2 released. diff --git a/nt/ChangeLog b/nt/ChangeLog index abc71a1bb19..98dd983bfae 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,4 +1,4 @@ -2012-08-15 Chong Yidong +2012-08-24 Chong Yidong * Version 24.2 released. diff --git a/oldXMenu/ChangeLog b/oldXMenu/ChangeLog index 338f9e75429..024e9cb570f 100644 --- a/oldXMenu/ChangeLog +++ b/oldXMenu/ChangeLog @@ -1,4 +1,4 @@ -2012-08-15 Chong Yidong +2012-08-24 Chong Yidong * Version 24.2 released. diff --git a/src/ChangeLog b/src/ChangeLog index e5adbedd567..28d4b1df989 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,12 +1,12 @@ +2012-08-24 Chong Yidong + + * Version 24.2 released. + 2012-08-24 Eli Zaretskii * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it is not one of the heaps we manage. (Bug#12242) -2012-08-15 Chong Yidong - - * Version 24.2 released. - 2012-08-14 Glenn Morris * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747) diff --git a/test/ChangeLog b/test/ChangeLog index 4f707a4e74a..e25e06dd5eb 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,4 +1,4 @@ -2012-08-15 Chong Yidong +2012-08-24 Chong Yidong * Version 24.2 released. From aa0ecd9449986eacd07989f599739902dcaacc49 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 24 Aug 2012 14:55:40 +0200 Subject: [PATCH 109/212] * cmdargs.texi (General Variables): Setting $DBUS_SESSION_BUS_ADDRESS to a dummy value suppresses connections to the D-Bus session bus. (Bug#12112) --- doc/emacs/ChangeLog | 6 ++++++ doc/emacs/cmdargs.texi | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index fa78cc4c502..a4f9985ad85 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,9 @@ +2012-08-24 Michael Albinus + + * cmdargs.texi (General Variables): Setting + $DBUS_SESSION_BUS_ADDRESS to a dummy value suppresses connections + to the D-Bus session bus. (Bug#12112) + 2012-08-14 Eli Zaretskii * building.texi (Debugger Operation): Correct and improve diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index 2dea1577c04..d4573eed5a8 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi @@ -434,6 +434,11 @@ variables to be set, but it uses their values if they are set. @item CDPATH Used by the @code{cd} command to search for the directory you specify, when you specify a relative directory name. +@item DBUS_SESSION_BUS_ADDRESS +Used by D-Bus when Emacs is compiled with it. Usually, there is no +need to change it. Setting it to a dummy address, like +@samp{unix:path=/tmp/foo}, suppresses connections to the D-Bus session +bus. @item EMACSDATA Directory for the architecture-independent files that come with Emacs. This is used to initialize the variable @code{data-directory}. From 2f221583cf4a4b412c16260d148b59931b12455a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 24 Aug 2012 20:11:12 -0700 Subject: [PATCH 110/212] * bytecode.c, callint.c, callproc.c: Use bool for boolean. * bytecode.c (exec_byte_code): * callint.c (check_mark, Fcall_interactively): * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1) (getenv_internal, sync_process_alive, call_process_exited): * lisp.h (USE_SAFE_ALLOCA): Use bool for booleans, instead of int. * lisp.h, process.h: Adjust prototypes to match above changes. * callint.c (Fcall_interactively): Don't assume the mark's offset fits in 'int'. --- src/ChangeLog | 13 +++++++++++++ src/bytecode.c | 2 +- src/callint.c | 16 ++++++++-------- src/callproc.c | 36 ++++++++++++++++++------------------ src/lisp.h | 4 ++-- src/process.h | 2 +- 6 files changed, 43 insertions(+), 30 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index feed9f8233e..95b9a57f24b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2012-08-25 Paul Eggert + + * bytecode.c, callint.c, callproc.c: Use bool for boolean. + * bytecode.c (exec_byte_code): + * callint.c (check_mark, Fcall_interactively): + * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1) + (getenv_internal, sync_process_alive, call_process_exited): + * lisp.h (USE_SAFE_ALLOCA): + Use bool for booleans, instead of int. + * lisp.h, process.h: Adjust prototypes to match above changes. + * callint.c (Fcall_interactively): Don't assume the mark's + offset fits in 'int'. + 2012-08-24 Paul Eggert * buffer.c, buffer.h: Use bool for boolean. diff --git a/src/bytecode.c b/src/bytecode.c index 5ac8b4fa2bd..753f149ae01 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -553,7 +553,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, if (INTEGERP (args_template)) { ptrdiff_t at = XINT (args_template); - int rest = at & 128; + bool rest = (at & 128) != 0; int mandatory = at & 127; ptrdiff_t nonrest = at >> 8; eassert (mandatory <= nonrest); diff --git a/src/callint.c b/src/callint.c index 36a59e812f2..b11545ddea2 100644 --- a/src/callint.c +++ b/src/callint.c @@ -150,7 +150,7 @@ static const char *callint_argfuns[] = {"", "point", "mark", "region-beginning", "region-end"}; static void -check_mark (int for_region) +check_mark (bool for_region) { Lisp_Object tem; tem = Fmarker_buffer (BVAR (current_buffer, mark)); @@ -273,11 +273,11 @@ invoke it. If KEYS is omitted or nil, the return value of signed char *varies; ptrdiff_t i, nargs; - int foo; - int arg_from_tty = 0; + ptrdiff_t mark; + bool arg_from_tty = 0; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; ptrdiff_t key_count; - int record_then_fail = 0; + bool record_then_fail = 0; Lisp_Object save_this_command, save_last_command; Lisp_Object save_this_original_command, save_real_this_command; @@ -685,7 +685,7 @@ invoke it. If KEYS is omitted or nil, the return value of goto have_prefix_arg; case 'n': /* Read number from minibuffer. */ { - int first = 1; + bool first = 1; do { Lisp_Object str; @@ -726,11 +726,11 @@ invoke it. If KEYS is omitted or nil, the return value of check_mark (1); set_marker_both (point_marker, Qnil, PT, PT_BYTE); /* visargs[i+1] = Qnil; */ - foo = marker_position (BVAR (current_buffer, mark)); + mark = marker_position (BVAR (current_buffer, mark)); /* visargs[i] = Qnil; */ - args[i] = PT < foo ? point_marker : BVAR (current_buffer, mark); + args[i] = PT < mark ? point_marker : BVAR (current_buffer, mark); varies[i] = 3; - args[++i] = PT > foo ? point_marker : BVAR (current_buffer, mark); + args[++i] = PT > mark ? point_marker : BVAR (current_buffer, mark); varies[i] = 4; break; diff --git a/src/callproc.c b/src/callproc.c index 4bf1da04e1a..2e9a8950700 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -77,7 +77,7 @@ static Lisp_Object Vtemp_file_name_pattern; /* True if we are about to fork off a synchronous process or if we are waiting for it. */ -int synch_process_alive; +bool synch_process_alive; /* Nonzero => this is a string explaining death of synchronous subprocess. */ const char *synch_process_death; @@ -94,8 +94,8 @@ int synch_process_retcode; On MSDOS, delete the temporary file on any kind of termination. On Unix, kill the process and any children on termination by signal. */ -/* Nonzero if this is termination due to exit. */ -static int call_process_exited; +/* True if this is termination due to exit. */ +static bool call_process_exited; static Lisp_Object call_process_kill (Lisp_Object fdpid) @@ -190,7 +190,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) (ptrdiff_t nargs, Lisp_Object *args) { Lisp_Object infile, buffer, current_dir, path, cleanup_info_tail; - int display_p; + bool display_p; int fd[2]; int filefd; #define CALLPROC_BUFFER_SIZE_MIN (16 * 1024) @@ -217,7 +217,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) struct coding_system argument_coding; /* coding-system of arguments */ /* Set to the return value of Ffind_operation_coding_system. */ Lisp_Object coding_systems; - int output_to_buffer = 1; + bool output_to_buffer = 1; /* Qt denotes that Ffind_operation_coding_system is not yet called. */ coding_systems = Qt; @@ -241,7 +241,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) /* If arguments are supplied, we may have to encode them. */ if (nargs >= 5) { - int must_encode = 0; + bool must_encode = 0; Lisp_Object coding_attrs; for (i = 4; i < nargs; i++) @@ -610,12 +610,12 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) Lisp_Object volatile buffer_volatile = buffer; Lisp_Object volatile coding_systems_volatile = coding_systems; Lisp_Object volatile current_dir_volatile = current_dir; - int volatile display_p_volatile = display_p; + bool volatile display_p_volatile = display_p; + bool volatile output_to_buffer_volatile = output_to_buffer; + bool volatile sa_must_free_volatile = sa_must_free; int volatile fd1_volatile = fd1; int volatile fd_error_volatile = fd_error; int volatile fd_output_volatile = fd_output; - int volatile output_to_buffer_volatile = output_to_buffer; - int volatile sa_must_free_volatile = sa_must_free; ptrdiff_t volatile sa_count_volatile = sa_count; unsigned char const **volatile new_argv_volatile = new_argv; @@ -766,11 +766,11 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) if (output_to_buffer) { - register int nread; - int first = 1; + int nread; + bool first = 1; EMACS_INT total_read = 0; int carryover = 0; - int display_on_the_fly = display_p; + bool display_on_the_fly = display_p; struct coding_system saved_coding; saved_coding = process_coding; @@ -1086,7 +1086,7 @@ static char ** add_env (char **env, char **new_env, char *string) { char **ep; - int ok = 1; + bool ok = 1; if (string == NULL) return new_env; @@ -1126,8 +1126,7 @@ add_env (char **env, char **new_env, char *string) Therefore, the superior process must save and restore the value of environ around the vfork and the call to this function. - SET_PGRP is nonzero if we should put the subprocess into a separate - process group. + If SET_PGRP, put the subprocess into a separate process group. CURRENT_DIR is an elisp string giving the path of the current directory the subprocess should have. Since we can't really signal @@ -1135,7 +1134,8 @@ add_env (char **env, char **new_env, char *string) executable directory by the parent. */ int -child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, Lisp_Object current_dir) +child_setup (int in, int out, int err, char **new_argv, bool set_pgrp, + Lisp_Object current_dir) { char **env; char *pwd_var; @@ -1394,7 +1394,7 @@ relocate_fd (int fd, int minfd) } #endif /* not WINDOWSNT */ -static int +static bool getenv_internal_1 (const char *var, ptrdiff_t varlen, char **value, ptrdiff_t *valuelen, Lisp_Object env) { @@ -1429,7 +1429,7 @@ getenv_internal_1 (const char *var, ptrdiff_t varlen, char **value, return 0; } -static int +static bool getenv_internal (const char *var, ptrdiff_t varlen, char **value, ptrdiff_t *valuelen, Lisp_Object frame) { diff --git a/src/lisp.h b/src/lisp.h index 7847d454bc1..ef167ba56c0 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3330,7 +3330,7 @@ extern void setup_process_coding_systems (Lisp_Object); #ifndef DOS_NT _Noreturn #endif -extern int child_setup (int, int, int, char **, int, Lisp_Object); +extern int child_setup (int, int, int, char **, bool, Lisp_Object); extern void init_callproc_1 (void); extern void init_callproc (void); extern void set_initial_environment (void); @@ -3586,7 +3586,7 @@ extern Lisp_Object safe_alloca_unwind (Lisp_Object); extern void *record_xmalloc (size_t); #define USE_SAFE_ALLOCA \ - ptrdiff_t sa_count = SPECPDL_INDEX (); int sa_must_free = 0 + ptrdiff_t sa_count = SPECPDL_INDEX (); bool sa_must_free = 0 /* SAFE_ALLOCA allocates a simple buffer. */ diff --git a/src/process.h b/src/process.h index 55a572117c6..b963f4ca05c 100644 --- a/src/process.h +++ b/src/process.h @@ -184,7 +184,7 @@ pset_gnutls_cred_type (struct Lisp_Process *p, Lisp_Object val) /* True if we are about to fork off a synchronous process or if we are waiting for it. */ -extern int synch_process_alive; +extern bool synch_process_alive; /* Communicate exit status of sync process to from sigchld_handler to Fcall_process. */ From f4a681b077a4af9f1eb36e0a109003262e2dafd1 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 24 Aug 2012 21:04:08 -0700 Subject: [PATCH 111/212] On assertion failure, print backtrace if available. Merge from gnulib, incorporating: 2012-08-24 execinfo: port to FreeBSD 2012-08-22 execinfo: new module * admin/merge-gnulib (GNULIB_MODULES): Add execinfo. * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. * lib/execinfo.c, lib/execinfo.in.h, m4/execinfo.m4: New files. * src/alloc.c [ENABLE_CHECKING]: Include . (die) [ENABLE_CHECKING]: Print a backtrace if available. * src/Makefile.in (LIB_EXECINFO): New macro. (LIBES): Use it. --- ChangeLog | 9 +++++++++ admin/ChangeLog | 5 +++++ admin/merge-gnulib | 2 +- lib/gnulib.mk | 27 ++++++++++++++++++++++++++- m4/gnulib-comp.m4 | 5 +++++ src/ChangeLog | 6 ++++++ src/Makefile.in | 3 +++ src/alloc.c | 8 ++++++++ 8 files changed, 63 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5657f8bb3aa..8ffa630c16d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2012-08-24 Paul Eggert + + On assertion failure, print backtrace if available. + Merge from gnulib, incorporating: + 2012-08-24 execinfo: port to FreeBSD + 2012-08-22 execinfo: new module + * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. + * lib/execinfo.c, lib/execinfo.in.h, m4/execinfo.m4: New files. + 2012-08-22 Glenn Morris * Makefile.in (install-arch-dep): If NO_BIN_LINK is non-null, diff --git a/admin/ChangeLog b/admin/ChangeLog index ea977e80cfa..0c674b91ea4 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,8 @@ +2012-08-24 Paul Eggert + + On assertion failure, print backtrace if available. + * merge-gnulib (GNULIB_MODULES): Add execinfo. + 2012-08-16 Paul Eggert Use ASCII tests for character types. diff --git a/admin/merge-gnulib b/admin/merge-gnulib index 63865edf3ce..775d43e68d3 100755 --- a/admin/merge-gnulib +++ b/admin/merge-gnulib @@ -28,7 +28,7 @@ GNULIB_URL=git://git.savannah.gnu.org/gnulib.git GNULIB_MODULES=' alloca-opt c-ctype c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 - dtoastr dtotimespec dup2 environ + dtoastr dtotimespec dup2 environ execinfo filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink diff --git a/lib/gnulib.mk b/lib/gnulib.mk index a90cc59bbde..d49eb4fdf7a 100644 --- a/lib/gnulib.mk +++ b/lib/gnulib.mk @@ -21,7 +21,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings MOSTLYCLEANFILES += core *.stackdump @@ -150,6 +150,31 @@ EXTRA_libgnu_a_SOURCES += dup2.c ## end gnulib module dup2 +## begin gnulib module execinfo + +BUILT_SOURCES += $(EXECINFO_H) + +# We need the following in order to create when the system +# doesn't have one that works. +if GL_GENERATE_EXECINFO_H +execinfo.h: execinfo.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(srcdir)/execinfo.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +execinfo.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += execinfo.h execinfo.h-t + +EXTRA_DIST += execinfo.c execinfo.in.h + +EXTRA_libgnu_a_SOURCES += execinfo.c + +## end gnulib module execinfo + ## begin gnulib module filemode libgnu_a_SOURCES += filemode.c diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index 12c8ca8734b..0d73faee8d1 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -53,6 +53,7 @@ AC_DEFUN([gl_EARLY], # Code from module dtotimespec: # Code from module dup2: # Code from module environ: + # Code from module execinfo: # Code from module extensions: AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) # Code from module extern-inline: @@ -152,6 +153,7 @@ AC_DEFUN([gl_INIT], gl_UNISTD_MODULE_INDICATOR([dup2]) gl_ENVIRON gl_UNISTD_MODULE_INDICATOR([environ]) + gl_EXECINFO_H AC_REQUIRE([gl_EXTERN_INLINE]) gl_FILEMODE gl_GETLOADAVG @@ -534,6 +536,8 @@ AC_DEFUN([gl_FILE_LIST], [ lib/dtoastr.c lib/dtotimespec.c lib/dup2.c + lib/execinfo.c + lib/execinfo.in.h lib/filemode.c lib/filemode.h lib/ftoastr.c @@ -605,6 +609,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/clock_time.m4 m4/dup2.m4 m4/environ.m4 + m4/execinfo.m4 m4/extensions.m4 m4/extern-inline.m4 m4/filemode.m4 diff --git a/src/ChangeLog b/src/ChangeLog index 95b9a57f24b..fbaf555f8b2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ 2012-08-25 Paul Eggert + On assertion failure, print backtrace if available. + * alloc.c [ENABLE_CHECKING]: Include . + (die) [ENABLE_CHECKING]: Print a backtrace if available. + * Makefile.in (LIB_EXECINFO): New macro. + (LIBES): Use it. + * bytecode.c, callint.c, callproc.c: Use bool for boolean. * bytecode.c (exec_byte_code): * callint.c (check_mark, Fcall_interactively): diff --git a/src/Makefile.in b/src/Makefile.in index 1d89af31401..85645222052 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -159,6 +159,8 @@ DBUS_LIBS = @DBUS_LIBS@ ## dbusbind.o if HAVE_DBUS, else empty. DBUS_OBJ = @DBUS_OBJ@ +LIB_EXECINFO=@LIB_EXECINFO@ + SETTINGS_CFLAGS = @SETTINGS_CFLAGS@ SETTINGS_LIBS = @SETTINGS_LIBS@ @@ -383,6 +385,7 @@ otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \ ## with GCC, we might need LIB_GCC again after them. LIBES = $(LIBS) $(LIBX_BASE) $(LIBX_OTHER) $(LIBSOUND) \ $(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_CLOCK_GETTIME) $(DBUS_LIBS) \ + $(LIB_EXECINFO) \ $(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \ $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \ $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \ diff --git a/src/alloc.c b/src/alloc.c index f0da9416ece..961febb6dff 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -6681,13 +6681,21 @@ which_symbols (Lisp_Object obj, EMACS_INT find_max) } #ifdef ENABLE_CHECKING + +# include + bool suppress_checking; void die (const char *msg, const char *file, int line) { + enum { NPOINTERS_MAX = 500 }; + void *buffer[NPOINTERS_MAX]; + int npointers; fprintf (stderr, "\r\n%s:%d: Emacs fatal error: %s\r\n", file, line, msg); + npointers = backtrace (buffer, NPOINTERS_MAX); + backtrace_symbols_fd (buffer, npointers, STDERR_FILENO); abort (); } #endif From 7d896ca9f363843d687fd7a9a04b1fb917a42aae Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 24 Aug 2012 21:27:32 -0700 Subject: [PATCH 112/212] * lib/execinfo.c, lib/execinfo.in.h, m4/execinfo.m4: New files. --- lib/execinfo.c | 3 +++ lib/execinfo.in.h | 54 +++++++++++++++++++++++++++++++++++++++++++++++ m4/execinfo.m4 | 31 +++++++++++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 lib/execinfo.c create mode 100644 lib/execinfo.in.h create mode 100644 m4/execinfo.m4 diff --git a/lib/execinfo.c b/lib/execinfo.c new file mode 100644 index 00000000000..0bcd9f078ba --- /dev/null +++ b/lib/execinfo.c @@ -0,0 +1,3 @@ +#include +#define _GL_EXECINFO_INLINE _GL_EXTERN_INLINE +#include "execinfo.h" diff --git a/lib/execinfo.in.h b/lib/execinfo.in.h new file mode 100644 index 00000000000..d76b0e1b771 --- /dev/null +++ b/lib/execinfo.in.h @@ -0,0 +1,54 @@ +/* Information about executables. + + Copyright (C) 2012 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Paul Eggert. */ + +#ifndef _GL_EXECINFO_H +#define _GL_EXECINFO_H + +_GL_INLINE_HEADER_BEGIN +#ifndef _GL_EXECINFO_INLINE +# define _GL_EXECINFO_INLINE _GL_INLINE +#endif + +_GL_EXECINFO_INLINE int +backtrace (void **buffer, int size) +{ + (void) buffer; + (void) size; + return 0; +} + +_GL_EXECINFO_INLINE char ** +backtrace_symbols (void *const *buffer, int size) +{ + (void) buffer; + (void) size; + return 0; +} + +_GL_EXECINFO_INLINE void +backtrace_symbols_fd (void *const *buffer, int size, int fd) +{ + (void) buffer; + (void) size; + (void) fd; +} + +_GL_INLINE_HEADER_END + +#endif diff --git a/m4/execinfo.m4 b/m4/execinfo.m4 new file mode 100644 index 00000000000..f1f3cd91638 --- /dev/null +++ b/m4/execinfo.m4 @@ -0,0 +1,31 @@ +# Check for GNU-style execinfo.h. + +dnl Copyright 2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_EXECINFO_H], +[ + AC_CHECK_HEADERS_ONCE([execinfo.h]) + + LIB_EXECINFO='' + EXECINFO_H='execinfo.h' + + if test $ac_cv_header_execinfo_h = yes; then + gl_saved_libs=$LIBS + AC_SEARCH_LIBS([backtrace_symbols_fd], [execinfo], + [test "$ac_cv_search_backtrace_symbols_fd" = "none required" || + LIB_EXECINFO=$ac_cv_search_backtrace_symbols_fd]) + LIBS=$gl_saved_libs + test "$ac_cv_search_backtrace_symbols_fd" = no || EXECINFO_H='' + fi + + if test -n "$EXECINFO_H"; then + AC_LIBOBJ([execinfo]) + fi + + AC_SUBST([EXECINFO_H]) + AC_SUBST([LIB_EXECINFO]) + AM_CONDITIONAL([GL_GENERATE_EXECINFO_H], [test -n "$EXECINFO_H"]) +]) From 391ceac53ab07bc081eecc5a5ab82a044d06edd1 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 25 Aug 2012 08:55:32 +0300 Subject: [PATCH 113/212] MS-Windows adaptations for 2012-08-25T04:04:08Z!eggert@cs.ucla.edu and 2012-08-25T04:27:32Z!eggert@cs.ucla.edu. lib/makefile.w32-in ($(BLD)/execinfo.$(O), execinfo.h): New targets. (GNULIBOBJS): Add $(BLD)/execinfo.$(O). src/makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h. --- ChangeLog | 5 +++++ lib/makefile.w32-in | 8 ++++++++ src/ChangeLog | 4 ++++ src/makefile.w32-in | 1 + 4 files changed, 18 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8ffa630c16d..cd14d49406d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-08-25 Eli Zaretskii + + * lib/makefile.w32-in ($(BLD)/execinfo.$(O), execinfo.h): New targets. + (GNULIBOBJS): Add $(BLD)/execinfo.$(O). + 2012-08-24 Paul Eggert On assertion failure, print backtrace if available. diff --git a/lib/makefile.w32-in b/lib/makefile.w32-in index 11251d55f77..7df68fd3300 100644 --- a/lib/makefile.w32-in +++ b/lib/makefile.w32-in @@ -28,6 +28,7 @@ GNULIBOBJS = $(BLD)/c-ctype.$(O) \ $(BLD)/c-strncasecmp.$(O) \ $(BLD)/dtoastr.$(O) \ $(BLD)/dtotimespec.$(O) \ + $(BLD)/execinfo.$(O) \ $(BLD)/getopt.$(O) \ $(BLD)/getopt1.$(O) \ $(BLD)/gettime.$(O) \ @@ -129,6 +130,9 @@ $(BLD)/dtotimespec.$(O) : \ $(GNU_LIB)/timespec.h \ $(CONFIG_H) +$(BLD)/execinfo.$(O) : \ + $(GNU_LIB)/execinfo.h + $(BLD)/getopt.$(O) : \ $(GNU_LIB)/getopt.c \ $(GNU_LIB)/getopt.h \ @@ -299,3 +303,7 @@ getopt_h: < getopt.in.h > getopt_.h-t $(CP) getopt_.h-t getopt_.h - $(DEL) getopt_.h-t + +execinfo.h: execinfo.in.h + $(CP) execinfo.in.h $@ + diff --git a/src/ChangeLog b/src/ChangeLog index fbaf555f8b2..1a836543d69 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-08-25 Eli Zaretskii + + * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h. + 2012-08-25 Paul Eggert On assertion failure, print backtrace if available. diff --git a/src/makefile.w32-in b/src/makefile.w32-in index bdb292099bc..e5959e0b1a5 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in @@ -480,6 +480,7 @@ $(BLD)/alloc.$(O) : \ $(SRC)/syssignal.h \ $(SRC)/w32.h \ $(NT_INC)/unistd.h \ + $(GNU_LIB)/execinfo.h \ $(GNU_LIB)/verify.h \ $(BLOCKINPUT_H) \ $(BUFFER_H) \ From 17c05d741e131e630ad83622ae7eceee67897016 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 24 Aug 2012 23:25:00 -0700 Subject: [PATCH 114/212] * casefiddle.c, casetab.c, category.c: Use bool for boolean. * casefiddle.c (casify_object, casify_region): * casetab.c (set_case_table): * category.c, category.h (word_boundary_p): * category.h (CHAR_HAS_CATEGORY): Use bool for booleans, instead of int. --- src/ChangeLog | 9 +++++++++ src/casefiddle.c | 13 +++++++------ src/casetab.c | 4 ++-- src/category.c | 8 ++++---- src/category.h | 12 ++++++------ 5 files changed, 28 insertions(+), 18 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 1a836543d69..e509b9c315f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2012-08-25 Paul Eggert + + * casefiddle.c, casetab.c, category.c: Use bool for boolean. + * casefiddle.c (casify_object, casify_region): + * casetab.c (set_case_table): + * category.c, category.h (word_boundary_p): + * category.h (CHAR_HAS_CATEGORY): + Use bool for booleans, instead of int. + 2012-08-25 Eli Zaretskii * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h. diff --git a/src/casefiddle.c b/src/casefiddle.c index 81e84252b72..1102054b153 100644 --- a/src/casefiddle.c +++ b/src/casefiddle.c @@ -35,8 +35,8 @@ Lisp_Object Qidentity; static Lisp_Object casify_object (enum case_action flag, Lisp_Object obj) { - register int c, c1; - register int inword = flag == CASE_DOWN; + int c, c1; + bool inword = flag == CASE_DOWN; /* If the case table is flagged as modified, rescan it. */ if (NILP (XCHAR_TABLE (BVAR (current_buffer, downcase_table))->extras[1])) @@ -47,7 +47,8 @@ casify_object (enum case_action flag, Lisp_Object obj) int flagbits = (CHAR_ALT | CHAR_SUPER | CHAR_HYPER | CHAR_SHIFT | CHAR_CTL | CHAR_META); int flags = XINT (obj) & flagbits; - int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); + bool multibyte = ! NILP (BVAR (current_buffer, + enable_multibyte_characters)); /* If the character has higher bits set above the flags, return it unchanged. @@ -189,9 +190,9 @@ The argument object is not altered--the value is a copy. */) static void casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e) { - register int c; - register int inword = flag == CASE_DOWN; - register int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); + int c; + bool inword = flag == CASE_DOWN; + bool multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); ptrdiff_t start, end; ptrdiff_t start_byte; diff --git a/src/casetab.c b/src/casetab.c index a163d5204f8..3e22d0d0b77 100644 --- a/src/casetab.c +++ b/src/casetab.c @@ -79,7 +79,7 @@ This is the one used for new buffers. */) return Vascii_downcase_table; } -static Lisp_Object set_case_table (Lisp_Object table, int standard); +static Lisp_Object set_case_table (Lisp_Object, bool); DEFUN ("set-case-table", Fset_case_table, Sset_case_table, 1, 1, 0, doc: /* Select a new case table for the current buffer. @@ -113,7 +113,7 @@ See `set-case-table' for more info on case tables. */) } static Lisp_Object -set_case_table (Lisp_Object table, int standard) +set_case_table (Lisp_Object table, bool standard) { Lisp_Object up, canon, eqv; diff --git a/src/category.c b/src/category.c index 1c9085fd558..80dc6938d8b 100644 --- a/src/category.c +++ b/src/category.c @@ -406,17 +406,17 @@ then delete CATEGORY from the category set instead of adding it. */) return Qnil; } -/* Return 1 if there is a word boundary between two word-constituent - characters C1 and C2 if they appear in this order, else return 0. +/* Return true if there is a word boundary between two word-constituent + characters C1 and C2 if they appear in this order. Use the macro WORD_BOUNDARY_P instead of calling this function directly. */ -int +bool word_boundary_p (int c1, int c2) { Lisp_Object category_set1, category_set2; Lisp_Object tail; - int default_result; + bool default_result; if (EQ (CHAR_TABLE_REF (Vchar_script_table, c1), CHAR_TABLE_REF (Vchar_script_table, c2))) diff --git a/src/category.h b/src/category.h index 9fb981ed383..17cd203db45 100644 --- a/src/category.h +++ b/src/category.h @@ -77,14 +77,14 @@ INLINE_HEADER_BEGIN /* Return the category set of character C in the current category table. */ #define CATEGORY_SET(c) char_category_set (c) -/* Return 1 if CATEGORY_SET contains CATEGORY, else return 0. +/* Return true if CATEGORY_SET contains CATEGORY. The faster version of `!NILP (Faref (category_set, category))'. */ #define CATEGORY_MEMBER(category, category_set) \ ((XCATEGORY_SET (category_set)->data[(category) / 8] \ >> ((category) % 8)) & 1) -/* Return 1 if category set of CH contains CATEGORY, else return 0. */ -CATEGORY_INLINE int +/* Return true if category set of CH contains CATEGORY. */ +CATEGORY_INLINE bool CHAR_HAS_CATEGORY (int ch, int category) { Lisp_Object category_set = CATEGORY_SET (ch); @@ -108,14 +108,14 @@ CHAR_HAS_CATEGORY (int ch, int category) #define CATEGORY_TABLE_VERSION (table) \ Fchar_table_extra_slot (table, make_number (1)) -/* Return 1 if there is a word boundary between two word-constituent - characters C1 and C2 if they appear in this order, else return 0. +/* Return true if there is a word boundary between two + word-constituent characters C1 and C2 if they appear in this order. There is no word boundary between two word-constituent ASCII and Latin-1 characters. */ #define WORD_BOUNDARY_P(c1, c2) \ (!(SINGLE_BYTE_CHAR_P (c1) && SINGLE_BYTE_CHAR_P (c2)) \ && word_boundary_p (c1, c2)) -extern int word_boundary_p (int, int); +extern bool word_boundary_p (int, int); INLINE_HEADER_END From ee4c0f690d34f48608a6283fd2dc8af0024bfe9d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 24 Aug 2012 23:38:43 -0700 Subject: [PATCH 115/212] * emacs.c (fatal_error_signal_hook): Remove. All uses removed. This leftover from old code was always 0. --- src/ChangeLog | 3 +++ src/emacs.c | 8 -------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index e509b9c315f..eacb82d9814 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2012-08-25 Paul Eggert + * emacs.c (fatal_error_signal_hook): Remove. + All uses removed. This leftover from old code was always 0. + * casefiddle.c, casetab.c, category.c: Use bool for boolean. * casefiddle.c (casify_object, casify_region): * casetab.c (set_case_table): diff --git a/src/emacs.c b/src/emacs.c index 9e7efcabbf7..7ff5c43dbea 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -279,11 +279,6 @@ static int fatal_error_code; /* Nonzero if handling a fatal error already. */ int fatal_error_in_progress; -/* If non-null, call this function from fatal_error_signal before - committing suicide. */ - -static void (*fatal_error_signal_hook) (void); - #ifdef FORWARD_SIGNAL_TO_MAIN_THREAD /* When compiled with GTK and running under Gnome, multiple threads may be created. Keep track of our main @@ -331,9 +326,6 @@ fatal_error_signal (int sig) sigunblock (sigmask (fatal_error_code)); #endif - if (fatal_error_signal_hook) - fatal_error_signal_hook (); - kill (getpid (), fatal_error_code); } From f06029796a945db531c69f8764e2813d0744650d Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Sat, 25 Aug 2012 12:04:17 +0200 Subject: [PATCH 116/212] lib/makefile.w32-in ($(BLD)/execinfo.$(O)): Update dependencies. --- ChangeLog | 4 ++++ lib/makefile.w32-in | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index cd14d49406d..554103d149e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2012-08-25 Juanma Barranquero + + * lib/makefile.w32-in ($(BLD)/execinfo.$(O)): Update dependencies. + 2012-08-25 Eli Zaretskii * lib/makefile.w32-in ($(BLD)/execinfo.$(O), execinfo.h): New targets. diff --git a/lib/makefile.w32-in b/lib/makefile.w32-in index 7df68fd3300..f0cea56f829 100644 --- a/lib/makefile.w32-in +++ b/lib/makefile.w32-in @@ -131,7 +131,9 @@ $(BLD)/dtotimespec.$(O) : \ $(CONFIG_H) $(BLD)/execinfo.$(O) : \ - $(GNU_LIB)/execinfo.h + $(GNU_LIB)/execinfo.c \ + $(GNU_LIB)/execinfo.h \ + $(CONFIG_H) $(BLD)/getopt.$(O) : \ $(GNU_LIB)/getopt.c \ From 8966cbffe86e91f5eb47fdf88f0377ba10a9726c Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 25 Aug 2012 06:17:28 -0400 Subject: [PATCH 117/212] Auto-commit of generated files. --- autogen/Makefile.in | 53 ++++++++++++++-------- autogen/aclocal.m4 | 1 + autogen/config.in | 3 ++ autogen/configure | 105 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 144 insertions(+), 18 deletions(-) diff --git a/autogen/Makefile.in b/autogen/Makefile.in index ebcbed86fc7..58462459d6f 100644 --- a/autogen/Makefile.in +++ b/autogen/Makefile.in @@ -36,7 +36,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ @@ -65,7 +65,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/c-strtod.m4 \ $(top_srcdir)/m4/clock_time.m4 $(top_srcdir)/m4/dup2.m4 \ - $(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/extensions.m4 \ + $(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/execinfo.m4 \ + $(top_srcdir)/m4/extensions.m4 \ $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/filemode.m4 \ $(top_srcdir)/m4/getloadavg.m4 $(top_srcdir)/m4/getopt.m4 \ $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \ @@ -180,6 +181,7 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +EXECINFO_H = @EXECINFO_H@ EXEEXT = @EXEEXT@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ @@ -556,6 +558,7 @@ LIBXTR6 = @LIBXTR6@ LIBXT_OTHER = @LIBXT_OTHER@ LIBX_OTHER = @LIBX_OTHER@ LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIB_EXECINFO = @LIB_EXECINFO@ LIB_GCC = @LIB_GCC@ LIB_MATH = @LIB_MATH@ LIB_PTHREAD = @LIB_PTHREAD@ @@ -845,16 +848,17 @@ x_default_search_path = @x_default_search_path@ # statements but through direct file reference. Therefore this snippet must be # present in all Makefile.am that need it. This is ensured by the applicability # 'all' defined above. -BUILT_SOURCES = $(ALLOCA_H) $(GETOPT_H) inttypes.h signal.h \ - arg-nonnull.h c++defs.h warn-on-use.h $(STDALIGN_H) \ +BUILT_SOURCES = $(ALLOCA_H) $(EXECINFO_H) $(GETOPT_H) inttypes.h \ + signal.h arg-nonnull.h c++defs.h warn-on-use.h $(STDALIGN_H) \ $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) stdio.h \ stdlib.h sys/select.h sys/stat.h sys/time.h time.h unistd.h EXTRA_DIST = alloca.in.h allocator.h careadlinkat.h md5.h sha1.h \ sha256.h sha512.h dosname.h ftoastr.c ftoastr.h dup2.c \ - filemode.h getloadavg.c getopt.c getopt.in.h getopt1.c \ - getopt_int.h gettimeofday.c ignore-value.h intprops.h \ - inttypes.in.h lstat.c mktime-internal.h mktime.c pathmax.h \ - pselect.c pthread_sigmask.c readlink.c signal.in.h \ + execinfo.c execinfo.in.h filemode.h getloadavg.c getopt.c \ + getopt.in.h getopt1.c getopt_int.h gettimeofday.c \ + ignore-value.h intprops.h inttypes.in.h lstat.c \ + mktime-internal.h mktime.c pathmax.h pselect.c \ + pthread_sigmask.c readlink.c signal.in.h \ $(top_srcdir)/build-aux/snippet/_Noreturn.h \ $(top_srcdir)/build-aux/snippet/arg-nonnull.h \ $(top_srcdir)/build-aux/snippet/c++defs.h \ @@ -866,14 +870,15 @@ EXTRA_DIST = alloca.in.h allocator.h careadlinkat.h md5.h sha1.h \ sys_time.in.h time.in.h time_r.c timespec.h u64.h unistd.in.h \ utimens.h verify.h MOSTLYCLEANDIRS = sys sys -MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t getopt.h \ - getopt.h-t inttypes.h inttypes.h-t signal.h signal.h-t \ - arg-nonnull.h arg-nonnull.h-t c++defs.h c++defs.h-t \ - warn-on-use.h warn-on-use.h-t stdalign.h stdalign.h-t stdarg.h \ - stdarg.h-t stdbool.h stdbool.h-t stddef.h stddef.h-t stdint.h \ - stdint.h-t stdio.h stdio.h-t stdlib.h stdlib.h-t sys/select.h \ - sys/select.h-t sys/stat.h sys/stat.h-t sys/time.h sys/time.h-t \ - time.h time.h-t unistd.h unistd.h-t +MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t execinfo.h \ + execinfo.h-t getopt.h getopt.h-t inttypes.h inttypes.h-t \ + signal.h signal.h-t arg-nonnull.h arg-nonnull.h-t c++defs.h \ + c++defs.h-t warn-on-use.h warn-on-use.h-t stdalign.h \ + stdalign.h-t stdarg.h stdarg.h-t stdbool.h stdbool.h-t \ + stddef.h stddef.h-t stdint.h stdint.h-t stdio.h stdio.h-t \ + stdlib.h stdlib.h-t sys/select.h sys/select.h-t sys/stat.h \ + sys/stat.h-t sys/time.h sys/time.h-t time.h time.h-t unistd.h \ + unistd.h-t noinst_LIBRARIES = libgnu.a AM_CFLAGS = $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS) DEFAULT_INCLUDES = -I. -I$(top_srcdir)/lib -I../src -I$(top_srcdir)/src @@ -884,8 +889,8 @@ libgnu_a_SOURCES = allocator.c c-ctype.h c-ctype.c c-strcase.h \ timespec-add.c timespec-sub.c u64.c utimens.c libgnu_a_LIBADD = $(gl_LIBOBJS) libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) -EXTRA_libgnu_a_SOURCES = ftoastr.c dup2.c getloadavg.c getopt.c \ - getopt1.c gettimeofday.c lstat.c mktime.c pselect.c \ +EXTRA_libgnu_a_SOURCES = ftoastr.c dup2.c execinfo.c getloadavg.c \ + getopt.c getopt1.c gettimeofday.c lstat.c mktime.c pselect.c \ pthread_sigmask.c readlink.c stat.c strtoimax.c strtol.c \ strtoll.c strtol.c strtoul.c strtoull.c strtoimax.c \ strtoumax.c symlink.c time_r.c @@ -954,6 +959,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtoastr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtotimespec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execinfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filemode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftoastr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getloadavg.Po@am__quote@ @@ -1213,6 +1219,17 @@ uninstall-am: @GL_GENERATE_ALLOCA_H_FALSE@alloca.h: $(top_builddir)/config.status @GL_GENERATE_ALLOCA_H_FALSE@ rm -f $@ +# We need the following in order to create when the system +# doesn't have one that works. +@GL_GENERATE_EXECINFO_H_TRUE@execinfo.h: execinfo.in.h $(top_builddir)/config.status +@GL_GENERATE_EXECINFO_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_EXECINFO_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ +@GL_GENERATE_EXECINFO_H_TRUE@ cat $(srcdir)/execinfo.in.h; \ +@GL_GENERATE_EXECINFO_H_TRUE@ } > $@-t && \ +@GL_GENERATE_EXECINFO_H_TRUE@ mv $@-t $@ +@GL_GENERATE_EXECINFO_H_FALSE@execinfo.h: $(top_builddir)/config.status +@GL_GENERATE_EXECINFO_H_FALSE@ rm -f $@ + # We need the following in order to create when the system # doesn't have one that works with the given compiler. getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H) diff --git a/autogen/aclocal.m4 b/autogen/aclocal.m4 index f7ef80bb805..38f7863ba9d 100644 --- a/autogen/aclocal.m4 +++ b/autogen/aclocal.m4 @@ -990,6 +990,7 @@ m4_include([m4/c-strtod.m4]) m4_include([m4/clock_time.m4]) m4_include([m4/dup2.m4]) m4_include([m4/environ.m4]) +m4_include([m4/execinfo.m4]) m4_include([m4/extensions.m4]) m4_include([m4/extern-inline.m4]) m4_include([m4/filemode.m4]) diff --git a/autogen/config.in b/autogen/config.in index 9b208cc513a..8cda73e6cbe 100644 --- a/autogen/config.in +++ b/autogen/config.in @@ -358,6 +358,9 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if you have the `euidaccess' function. */ #undef HAVE_EUIDACCESS +/* Define to 1 if you have the header file. */ +#undef HAVE_EXECINFO_H + /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H diff --git a/autogen/configure b/autogen/configure index 7a94dcb7598..7c22a3fbece 100755 --- a/autogen/configure +++ b/autogen/configure @@ -971,6 +971,10 @@ GNULIB_CANONICALIZE_FILE_NAME GNULIB_CALLOC_POSIX GNULIB_ATOLL GNULIB__EXIT +GL_GENERATE_EXECINFO_H_FALSE +GL_GENERATE_EXECINFO_H_TRUE +LIB_EXECINFO +EXECINFO_H UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS UNISTD_H_HAVE_WINSOCK2_H REPLACE_WRITE @@ -3194,6 +3198,7 @@ as_fn_append ac_header_list " maillock.h" as_fn_append ac_header_list " sys/un.h" as_fn_append ac_func_list " tzset" as_fn_append ac_func_list " readlinkat" +as_fn_append ac_header_list " execinfo.h" gl_getopt_required=GNU as_fn_append ac_header_list " getopt.h" as_fn_append ac_func_list " gettimeofday" @@ -6956,6 +6961,7 @@ esac # Code from module dtotimespec: # Code from module dup2: # Code from module environ: + # Code from module execinfo: # Code from module extensions: # Code from module extern-inline: @@ -16464,6 +16470,8 @@ $as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for st_dm_mode in struct stat" >&5 $as_echo_n "checking for st_dm_mode in struct stat... " >&6; } if test "${ac_cv_struct_st_dm_mode+set}" = set; then : @@ -20100,6 +20108,99 @@ $as_echo "$gl_cv_func_dup2_works" >&6; } + LIB_EXECINFO='' + EXECINFO_H='execinfo.h' + + if test $ac_cv_header_execinfo_h = yes; then + gl_saved_libs=$LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing backtrace_symbols_fd" >&5 +$as_echo_n "checking for library containing backtrace_symbols_fd... " >&6; } +if test "${ac_cv_search_backtrace_symbols_fd+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char backtrace_symbols_fd (); +int +main () +{ +return backtrace_symbols_fd (); + ; + return 0; +} +_ACEOF +for ac_lib in '' execinfo; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_backtrace_symbols_fd=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_backtrace_symbols_fd+set}" = set; then : + break +fi +done +if test "${ac_cv_search_backtrace_symbols_fd+set}" = set; then : + +else + ac_cv_search_backtrace_symbols_fd=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_backtrace_symbols_fd" >&5 +$as_echo "$ac_cv_search_backtrace_symbols_fd" >&6; } +ac_res=$ac_cv_search_backtrace_symbols_fd +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + test "$ac_cv_search_backtrace_symbols_fd" = "none required" || + LIB_EXECINFO=$ac_cv_search_backtrace_symbols_fd +fi + + LIBS=$gl_saved_libs + test "$ac_cv_search_backtrace_symbols_fd" = no || EXECINFO_H='' + fi + + if test -n "$EXECINFO_H"; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS execinfo.$ac_objext" + + fi + + + + if test -n "$EXECINFO_H"; then + GL_GENERATE_EXECINFO_H_TRUE= + GL_GENERATE_EXECINFO_H_FALSE='#' +else + GL_GENERATE_EXECINFO_H_TRUE='#' + GL_GENERATE_EXECINFO_H_FALSE= +fi + + + + + @@ -24190,6 +24291,10 @@ if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FAL Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${GL_GENERATE_EXECINFO_H_TRUE}" && test -z "${GL_GENERATE_EXECINFO_H_FALSE}"; then + as_fn_error "conditional \"GL_GENERATE_EXECINFO_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then as_fn_error "conditional \"GL_GENERATE_STDINT_H\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 From 9aba119d72dde74a86d436f6e4f934baa37ecbe9 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sat, 25 Aug 2012 16:52:02 +0200 Subject: [PATCH 118/212] Handle evening window heights more correctly (Bug#11880) and (Bug#12091). * window.el (window--even-window-heights): Even heights when WINDOW and the selected window form a vertical combination. (display-buffer-use-some-window): Provide that window used gets sized back by quit-window. (Bug#11880) and (Bug#12091) --- lisp/ChangeLog | 7 +++++++ lisp/window.el | 35 ++++++++++++++++------------------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5236ad55903..94ad0badad0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2012-08-25 Martin Rudalics + + * window.el (window--even-window-heights): Even heights when + WINDOW and the selected window form a vertical combination. + (display-buffer-use-some-window): Provide that window used gets + sized back by quit-window. (Bug#11880) and (Bug#12091) + 2012-08-24 Paul Eggert Fix file time stamp problem with bzr and CVS (Bug#12001). diff --git a/lisp/window.el b/lisp/window.el index 8f402f0c2b9..8aee27f44e8 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4911,23 +4911,19 @@ Do this only if these windows are vertically adjacent to each other, `even-window-heights' is non-nil, and the selected window is higher than WINDOW." (when (and even-window-heights - (not (eq window (selected-window))) - ;; Don't resize minibuffer windows. - (not (window-minibuffer-p (selected-window))) - (> (window-height (selected-window)) (window-height window)) - (eq (window-frame window) (window-frame (selected-window))) - (let ((sel-edges (window-edges (selected-window))) - (win-edges (window-edges window))) - (and (= (nth 0 sel-edges) (nth 0 win-edges)) - (= (nth 2 sel-edges) (nth 2 win-edges)) - (or (= (nth 1 sel-edges) (nth 3 win-edges)) - (= (nth 3 sel-edges) (nth 1 win-edges)))))) - (let ((window-min-height 1)) - ;; Don't throw an error if we can't even window heights for - ;; whatever reason. - (condition-case nil - (enlarge-window (/ (- (window-height window) (window-height)) 2)) - (error nil))))) + ;; Even iff WINDOW forms a vertical combination with the + ;; selected window, and WINDOW's height exceeds that of the + ;; selected window, see also bug#11880. + (window-combined-p window) + (= (window-child-count (window-parent window)) 2) + (eq (window-parent) (window-parent window)) + (> (window-total-height) (window-total-height window))) + ;; Don't throw an error if we can't even window heights for + ;; whatever reason. + (condition-case nil + (enlarge-window + (/ (- (window-total-height window) (window-total-height)) 2)) + (error nil)))) (defun window--display-buffer (buffer window type &optional dedicated) "Display BUFFER in WINDOW and make its frame visible. @@ -5334,8 +5330,9 @@ that frame." window)) (get-largest-window 0 not-this-window)))) (when (window-live-p window) - (window--even-window-heights window) - (prog1 (window--display-buffer buffer window 'reuse) + (prog1 + (window--display-buffer buffer window 'reuse) + (window--even-window-heights window) (unless (cdr (assq 'inhibit-switch-frame alist)) (window--maybe-raise-frame (window-frame window))))))) From 0f46bc7515ccc835e5752b47f8752ab7aaf7ed27 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 25 Aug 2012 13:31:04 -0700 Subject: [PATCH 119/212] * xgselect.c (xg_select): Use auto storage for the GPollFD buffer as that's faster and simpler than static storage. Don't bother with the g_main_context_query overhead if g_main_context_pending says no events are pending. (gfds, gfds_size): Remove these static vars. (xgselect_initialize): Remove; no longer needed. All uses and decls removed. --- src/ChangeLog | 8 ++++++++ src/xgselect.c | 52 ++++++++++++++++++-------------------------------- src/xgselect.h | 2 -- src/xterm.c | 2 -- 4 files changed, 27 insertions(+), 37 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index eacb82d9814..5654a191ec0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,13 @@ 2012-08-25 Paul Eggert + * xgselect.c (xg_select): Use auto storage for the GPollFD buffer + as that's faster and simpler than static storage. Don't bother + with the g_main_context_query overhead if g_main_context_pending + says no events are pending. + (gfds, gfds_size): Remove these static vars. + (xgselect_initialize): Remove; no longer needed. + All uses and decls removed. + * emacs.c (fatal_error_signal_hook): Remove. All uses removed. This leftover from old code was always 0. diff --git a/src/xgselect.c b/src/xgselect.c index 04ca00274e8..0c00d815820 100644 --- a/src/xgselect.c +++ b/src/xgselect.c @@ -29,9 +29,6 @@ along with GNU Emacs. If not, see . */ #include #include "xterm.h" -static GPollFD *gfds; -static ptrdiff_t gfds_size; - int xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, EMACS_TIME *timeout, sigset_t *sigmask) @@ -41,35 +38,31 @@ xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, GMainContext *context; int have_wfds = wfds != NULL; - int n_gfds = 0, retval = 0, our_fds = 0, max_fds = fds_lim - 1; + GPollFD gfds_buf[128]; + GPollFD *gfds = gfds_buf; + int gfds_size = sizeof gfds_buf / sizeof *gfds_buf; + int n_gfds, retval = 0, our_fds = 0, max_fds = fds_lim - 1; int i, nfds, tmo_in_millisec; + USE_SAFE_ALLOCA; - if (!x_in_use) - return pselect (fds_lim, rfds, wfds, efds, tmop, sigmask); + if (! (x_in_use + && g_main_context_pending (context = g_main_context_default ()))) + return pselect (fds_lim, rfds, wfds, efds, timeout, sigmask); if (rfds) memcpy (&all_rfds, rfds, sizeof (all_rfds)); else FD_ZERO (&all_rfds); if (wfds) memcpy (&all_wfds, wfds, sizeof (all_rfds)); else FD_ZERO (&all_wfds); - /* Update event sources in GLib. */ - context = g_main_context_default (); - g_main_context_pending (context); - - do { - if (n_gfds > gfds_size) - { - xfree (gfds); - gfds = xpalloc (0, &gfds_size, n_gfds - gfds_size, INT_MAX, - sizeof *gfds); - } - - n_gfds = g_main_context_query (context, - G_PRIORITY_LOW, - &tmo_in_millisec, - gfds, - gfds_size); - } while (n_gfds > gfds_size); + n_gfds = g_main_context_query (context, G_PRIORITY_LOW, &tmo_in_millisec, + gfds, gfds_size); + if (gfds_size < n_gfds) + { + SAFE_NALLOCA (gfds, sizeof *gfds, n_gfds); + gfds_size = n_gfds; + n_gfds = g_main_context_query (context, G_PRIORITY_LOW, &tmo_in_millisec, + gfds, gfds_size); + } for (i = 0; i < n_gfds; ++i) { @@ -86,6 +79,8 @@ xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, } } + SAFE_FREE (); + if (tmo_in_millisec >= 0) { tmo = make_emacs_time (tmo_in_millisec / 1000, @@ -147,12 +142,3 @@ xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, return retval; } #endif /* USE_GTK || HAVE_GCONF || HAVE_GSETTINGS */ - -void -xgselect_initialize (void) -{ -#if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS) - gfds_size = 128; - gfds = xmalloc (gfds_size * sizeof *gfds); -#endif -} diff --git a/src/xgselect.h b/src/xgselect.h index 8e5614ea972..5509e23c5c0 100644 --- a/src/xgselect.h +++ b/src/xgselect.h @@ -31,6 +31,4 @@ extern int xg_select (int max_fds, EMACS_TIME *timeout, sigset_t *sigmask); -extern void xgselect_initialize (void); - #endif /* XGSELECT_H */ diff --git a/src/xterm.c b/src/xterm.c index 118c8767c23..7e61cc4d8ea 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10815,8 +10815,6 @@ x_initialize (void) XSetIOErrorHandler (x_io_error_quitter); signal (SIGPIPE, x_connection_signal); - - xgselect_initialize (); } From 4c47bd1ecb8032ed1be126f7d0f08014a0beafd4 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 26 Aug 2012 10:57:07 +0800 Subject: [PATCH 120/212] * faces.el (help-argument-name): Always inherit from italic. Fixes: debbugs:12213 --- lisp/ChangeLog | 5 +++++ lisp/faces.el | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 94ad0badad0..7b789ad64ed 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-26 Chong Yidong + + * faces.el (help-argument-name): Always inherit from italic + (Bug#12213). + 2012-08-25 Martin Rudalics * window.el (window--even-window-heights): Even heights when diff --git a/lisp/faces.el b/lisp/faces.el index 2e1ba7798e9..6a477e172e1 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -2444,7 +2444,7 @@ Note: Other faces cannot inherit from the cursor face." :group 'menu :group 'basic-faces) -(defface help-argument-name '((((supports :slant italic)) :inherit italic)) +(defface help-argument-name '((t :inherit italic)) "Face to highlight argument names in *Help* buffers." :group 'help) From e1f29348711cb668969139126b59a2a3b8881987 Mon Sep 17 00:00:00 2001 From: Barry O'Reilly Date: Sat, 25 Aug 2012 23:30:56 -0400 Subject: [PATCH 121/212] * src/lisp.h (functionp): New function (extracted from Ffunctionp). (FUNCTIONP): Use it. * src/eval.c (Ffunctionp): Use it. --- src/ChangeLog | 10 ++++++++-- src/eval.c | 28 ++-------------------------- src/lisp.h | 38 +++++++++++++++++++++++++++++++++----- 3 files changed, 43 insertions(+), 33 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5654a191ec0..54fff9356f3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-08-26 Barry OReilly (tiny change) + + * lisp.h (functionp): New function (extracted from Ffunctionp). + (FUNCTIONP): Use it. + * eval.c (Ffunctionp): Use it. + 2012-08-25 Paul Eggert * xgselect.c (xg_select): Use auto storage for the GPollFD buffer @@ -160,8 +166,8 @@ * w32uniscribe.c (uniscribe_shape): Fix producing gstring components for RTL text (Bug#11860). Adjust X-OFFSET of each non-base glyph for the width of the base character, according to - what x_draw_composite_glyph_string_foreground expects. Generate - WADJUST value according to composition_gstring_width's + what x_draw_composite_glyph_string_foreground expects. + Generate WADJUST value according to composition_gstring_width's expectations, to produce correct width of the composed character. Reverse the sign of the DU offset produced by ScriptPlace. diff --git a/src/eval.c b/src/eval.c index c41e3f54d4d..df44c87dc25 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2722,33 +2722,9 @@ DEFUN ("functionp", Ffunctionp, Sfunctionp, 1, 1, 0, doc: /* Non-nil if OBJECT is a function. */) (Lisp_Object object) { - if (SYMBOLP (object) && !NILP (Ffboundp (object))) - { - object = Findirect_function (object, Qt); - - if (CONSP (object) && EQ (XCAR (object), Qautoload)) - { - /* Autoloaded symbols are functions, except if they load - macros or keymaps. */ - int i; - for (i = 0; i < 4 && CONSP (object); i++) - object = XCDR (object); - - return (CONSP (object) && !NILP (XCAR (object))) ? Qnil : Qt; - } - } - - if (SUBRP (object)) - return (XSUBR (object)->max_args != UNEVALLED) ? Qt : Qnil; - else if (COMPILEDP (object)) + if (FUNCTIONP (object)) return Qt; - else if (CONSP (object)) - { - Lisp_Object car = XCAR (object); - return (EQ (car, Qlambda) || EQ (car, Qclosure)) ? Qt : Qnil; - } - else - return Qnil; + return Qnil; } DEFUN ("funcall", Ffuncall, Sfuncall, 1, MANY, 0, diff --git a/src/lisp.h b/src/lisp.h index ef167ba56c0..c44ba7be347 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1906,11 +1906,7 @@ typedef struct { Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object) /* Non-zero if OBJ is a Lisp function. */ -#define FUNCTIONP(OBJ) \ - ((CONSP (OBJ) && EQ (XCAR (OBJ), Qlambda)) \ - || (SYMBOLP (OBJ) && !NILP (Ffboundp (OBJ))) \ - || COMPILEDP (OBJ) \ - || SUBRP (OBJ)) +#define FUNCTIONP(OBJ) functionp(OBJ) /* defsubr (Sname); is how we define the symbol for function `name' at start-up time. */ @@ -3656,6 +3652,38 @@ maybe_gc (void) Fgarbage_collect (); } +LISP_INLINE int +functionp (Lisp_Object object) +{ + if (SYMBOLP (object) && !NILP (Ffboundp (object))) + { + object = Findirect_function (object, Qt); + + if (CONSP (object) && EQ (XCAR (object), Qautoload)) + { + /* Autoloaded symbols are functions, except if they load + macros or keymaps. */ + int i; + for (i = 0; i < 4 && CONSP (object); i++) + object = XCDR (object); + + return ! (CONSP (object) && !NILP (XCAR (object))); + } + } + + if (SUBRP (object)) + return XSUBR (object)->max_args != UNEVALLED; + else if (COMPILEDP (object)) + return 1; + else if (CONSP (object)) + { + Lisp_Object car = XCAR (object); + return EQ (car, Qlambda) || EQ (car, Qclosure); + } + else + return 0; +} + INLINE_HEADER_END #endif /* EMACS_LISP_H */ From dd7ffad60f9e52590f4e6e352e8f861c6a5d13f0 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 26 Aug 2012 11:57:55 +0800 Subject: [PATCH 122/212] Make ordinary isearch obey search-whitespace-regexp too. * lisp/isearch.el (search-whitespace-regexp): Make string and nil values apply to both ordinary and regexp search. Allow a cons cell value to distinguish between the two. (isearch-whitespace-regexp, isearch-search-forward) (isearch-search-backward): New functions. (isearch-occur, isearch-search-fun-default, isearch-search) (isearch-lazy-highlight-new-loop): Use them. (isearch-forward, isearch-forward-regexp): Doc fix. --- etc/NEWS | 7 +++++ lisp/ChangeLog | 11 +++++++ lisp/isearch.el | 83 ++++++++++++++++++++++++++++++++----------------- 3 files changed, 73 insertions(+), 28 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 0c9ffe50093..02bd6410255 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -179,6 +179,13 @@ end of the buffer. It defaults to t. and `M-s _' in Isearch toggles symbol search mode. `M-s c' in Isearch toggles search case-sensitivity. +*** `search-whitespace-regexp' now acts on ordinary incremental search +as well, so that each sequence of spaces in the search string matches +any combination of one or more whitespace characters. To change this +behavior, you can give `search-whitespace-regexp' a cons cell value, +where the car and cdr specify values for ordinary and regular +expression incremental search respectively. + ** M-x move-to-column, if called interactively with no prefix arg, now prompts for a column number. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7b789ad64ed..2cc41c92210 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2012-08-26 Chong Yidong + + * isearch.el (search-whitespace-regexp): Make string and nil + values apply to both ordinary and regexp search. Allow a cons + cell value to distinguish between the two. + (isearch-whitespace-regexp, isearch-search-forward) + (isearch-search-backward): New functions. + (isearch-occur, isearch-search-fun-default, isearch-search) + (isearch-lazy-highlight-new-loop): Use them. + (isearch-forward, isearch-forward-regexp): Doc fix. + 2012-08-26 Chong Yidong * faces.el (help-argument-name): Always inherit from italic diff --git a/lisp/isearch.el b/lisp/isearch.el index 9271ce32484..27d35045ade 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -111,17 +111,32 @@ string, and RET terminates editing and does a nonincremental search." (defcustom search-whitespace-regexp (purecopy "\\s-+") "If non-nil, regular expression to match a sequence of whitespace chars. -This applies to regular expression incremental search. -When you put a space or spaces in the incremental regexp, it stands for -this, unless it is inside of a regexp construct such as [...] or *, + or ?. +When you enter a space or spaces in the incremental search, it +will match any sequence matched by this regexp. As an exception, +spaces are treated normally in regexp incremental search if they +occur in a regexp construct like [...] or *, + or ?. + +If the value is a string, it applies to both ordinary and regexp +incremental search. If the value is nil, each space you type +matches literally, against one space. + +The value can also be a cons cell (REGEXP-1 . REGEXP-2). In that +case, REGEXP-1 is used as the value for ordinary incremental +search, and REGEXP-2 is used for regexp incremental search. + You might want to use something like \"[ \\t\\r\\n]+\" instead. In the Customization buffer, that is `[' followed by a space, -a tab, a carriage return (control-M), a newline, and `]+'. - -When this is nil, each space you type matches literally, against one space." - :type '(choice (const :tag "Find Spaces Literally" nil) +a tab, a carriage return (control-M), a newline, and `]+'." + :type '(choice (const :tag "Treat Spaces Literally" nil) + (cons (choice :tag "For Ordinary Isearch" + regexp + (const :tag "Treat Spaces Literally" nil)) + (choice :tag "For Regexp Isearch" + regexp + (const :tag "Treat Spaces Literally" nil))) regexp) - :group 'isearch) + :group 'isearch + :version "24.3") (defcustom search-invisible 'open "If t incremental search can match hidden text. @@ -687,6 +702,10 @@ Type \\[isearch-describe-bindings] to display all Isearch key bindings. Type \\[isearch-describe-key] to display documentation of Isearch key. Type \\[isearch-describe-mode] to display documentation of Isearch mode. +In incremental searches, a space or spaces normally matches any +whitespace; see the variable `search-whitespace-regexp'. To +search for a literal space and nothing else, enter C-q SPC. + If an input method is turned on in the current buffer, that input method is also active while you are typing characters to search. To toggle the input method, type \\[isearch-toggle-input-method]. \ @@ -710,22 +729,19 @@ the calling function until the search is done." (isearch-mode t (not (null regexp-p)) nil (not no-recursive-edit))) (defun isearch-forward-regexp (&optional not-regexp no-recursive-edit) - "\ -Do incremental search forward for regular expression. + "Do incremental search forward for regular expression. With a prefix argument, do a regular string search instead. Like ordinary incremental search except that your input is treated as a regexp. See the command `isearch-forward' for more information. -In regexp incremental searches, a space or spaces normally matches -any whitespace (the variable `search-whitespace-regexp' controls -precisely what that means). If you want to search for a literal space -and nothing else, enter C-q SPC." +In incremental searches, a space or spaces normally matches any +whitespace; see the variable `search-whitespace-regexp'. To +search for a literal space and nothing else, enter C-q SPC." (interactive "P\np") (isearch-mode t (null not-regexp) nil (not no-recursive-edit))) (defun isearch-forward-word (&optional not-word no-recursive-edit) - "\ -Do incremental search forward for a sequence of words. + "Do incremental search forward for a sequence of words. With a prefix argument, do a regular string search instead. Like ordinary incremental search except that your input is treated as a sequence of words without regard to how the words are separated. @@ -734,8 +750,7 @@ See the command `isearch-forward' for more information." (isearch-mode t nil nil (not no-recursive-edit) (null not-word))) (defun isearch-forward-symbol (&optional not-symbol no-recursive-edit) - "\ -Do incremental search forward for a symbol. + "Do incremental search forward for a symbol. The prefix argument is currently unused. Like ordinary incremental search except that your input is treated as a symbol surrounded by symbol boundary constructs \\_< and \\_>. @@ -744,16 +759,14 @@ See the command `isearch-forward' for more information." (isearch-mode t nil nil (not no-recursive-edit) 'isearch-symbol-regexp)) (defun isearch-backward (&optional regexp-p no-recursive-edit) - "\ -Do incremental search backward. + "Do incremental search backward. With a prefix argument, do a regular expression search instead. See the command `isearch-forward' for more information." (interactive "P\np") (isearch-mode nil (not (null regexp-p)) nil (not no-recursive-edit))) (defun isearch-backward-regexp (&optional not-regexp no-recursive-edit) - "\ -Do incremental search backward for regular expression. + "Do incremental search backward for regular expression. With a prefix argument, do a regular string search instead. Like ordinary incremental search except that your input is treated as a regexp. See the command `isearch-forward' for more information." @@ -895,8 +908,7 @@ The last thing it does is to run `isearch-update-post-hook'." (if (< isearch-other-end (point)) ; isearch-forward? (isearch-highlight isearch-other-end (point)) (isearch-highlight (point) isearch-other-end)) - (isearch-dehighlight)) - )) + (isearch-dehighlight)))) (setq ;; quit-flag nil not for isearch-mode isearch-adjusted nil isearch-yank-flag nil) @@ -1547,6 +1559,15 @@ See `isearch-query-replace' for more information." (list current-prefix-arg)) (isearch-query-replace delimited t)) +(defun isearch-whitespace-regexp () + "Return the value of `search-whitespace-regexp' for the current search." + (cond ((not (consp search-whitespace-regexp)) + search-whitespace-regexp) + (isearch-regexp + (cdr search-whitespace-regexp)) + (t + (car search-whitespace-regexp)))) + (defun isearch-occur (regexp &optional nlines) "Run `occur' using the last search string as the regexp. Interactively, REGEXP is constructed using the search string from the @@ -1586,7 +1607,7 @@ characters in that string." ;; Set `search-upper-case' to nil to not call ;; `isearch-no-upper-case-p' in `occur-1'. (search-upper-case nil) - (search-spaces-regexp (if isearch-regexp search-whitespace-regexp))) + (search-spaces-regexp (isearch-whitespace-regexp))) (occur regexp nlines))) (declare-function hi-lock-read-face-name "hi-lock" ()) @@ -2426,7 +2447,13 @@ Can be changed via `isearch-search-fun-function' for special needs." (isearch-regexp (if isearch-forward 're-search-forward 're-search-backward)) (t - (if isearch-forward 'search-forward 'search-backward)))) + (if isearch-forward 'isearch-search-forward 'isearch-search-backward)))) + +(defun isearch-search-forward (string &optional bound noerror count) + (re-search-forward (regexp-quote string) bound noerror count)) + +(defun isearch-search-backward (string &optional bound noerror count) + (re-search-backward (regexp-quote string) bound noerror count)) (defun isearch-search-string (string bound noerror) "Search for the first occurrence of STRING or its translation. @@ -2487,7 +2514,7 @@ update the match data, and return point." search-invisible)) (inhibit-quit nil) (case-fold-search isearch-case-fold-search) - (search-spaces-regexp search-whitespace-regexp) + (search-spaces-regexp (isearch-whitespace-regexp)) (retry t)) (setq isearch-error nil) (while retry @@ -2847,7 +2874,7 @@ by other Emacs features." isearch-lazy-highlight-last-string isearch-string isearch-lazy-highlight-case-fold-search isearch-case-fold-search isearch-lazy-highlight-regexp isearch-regexp - isearch-lazy-highlight-space-regexp search-whitespace-regexp + isearch-lazy-highlight-space-regexp (isearch-whitespace-regexp) isearch-lazy-highlight-word isearch-word isearch-lazy-highlight-forward isearch-forward) (unless (equal isearch-string "") From 2db8bdfcc89dafc7b273bcc9b5eba2233d1148b6 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 26 Aug 2012 12:08:32 +0800 Subject: [PATCH 123/212] Doc fix for last change. --- lisp/isearch.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index 27d35045ade..6ea8d86336a 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -703,8 +703,7 @@ Type \\[isearch-describe-key] to display documentation of Isearch key. Type \\[isearch-describe-mode] to display documentation of Isearch mode. In incremental searches, a space or spaces normally matches any -whitespace; see the variable `search-whitespace-regexp'. To -search for a literal space and nothing else, enter C-q SPC. +whitespace; see the variable `search-whitespace-regexp'. If an input method is turned on in the current buffer, that input method is also active while you are typing characters to search. From 6e8aca60a8a3efaf397eab15d8b0cff3720e83b1 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 25 Aug 2012 21:37:40 -0700 Subject: [PATCH 124/212] * configure.ac (CFLAGS): Prefer -g3 to -g if -g3 works and if the user has not specified CFLAGS. -g3 simplifies debugging, since it makes macros visible to the debugger. --- ChangeLog | 6 ++++++ configure.ac | 28 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/ChangeLog b/ChangeLog index 554103d149e..228cf1d74d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-08-26 Paul Eggert + + * configure.ac (CFLAGS): Prefer -g3 to -g if -g3 works + and if the user has not specified CFLAGS. -g3 simplifies + debugging, since it makes macros visible to the debugger. + 2012-08-25 Juanma Barranquero * lib/makefile.w32-in ($(BLD)/execinfo.$(O)): Update dependencies. diff --git a/configure.ac b/configure.ac index b10cb24bab6..71ec98390aa 100644 --- a/configure.ac +++ b/configure.ac @@ -577,6 +577,34 @@ fi # Initialize gnulib right after choosing the compiler. gl_EARLY +# It's helpful to have C macros available to GDB, so prefer -g3 to -g +# if -g3 works and the user does not specify CFLAGS. +# This test must follow gl_EARLY; otherwise AC_LINK_IFELSE complains. +if test "$ac_test_CFLAGS" != set; then + case $CFLAGS in + '-g') + emacs_g3_CFLAGS='-g3';; + '-g -O2') + emacs_g3_CFLAGS='-g3 -O2';; + *) + emacs_g3_CFLAGS='';; + esac + if test -n "$emacs_g3_CFLAGS"; then + emacs_save_CFLAGS=$CFLAGS + CFLAGS=$emacs_g3_CFLAGS + AC_CACHE_CHECK([whether $CC accepts $emacs_g3_CFLAGS], + [emacs_cv_prog_cc_g3], + [AC_LINK_IFELSE([AC_LANG_PROGRAM()], + [emacs_cv_prog_cc_g3=yes], + [emacs_cv_prog_cc_g3=no])]) + if test $emacs_cv_prog_cc_g3 = yes; then + CFLAGS=$emacs_g3_CFLAGS + else + CFLAGS=$emacs_save_CFLAGS + fi + fi +fi + AC_ARG_ENABLE([gcc-warnings], [AS_HELP_STRING([--enable-gcc-warnings], [turn on lots of GCC warnings. This is intended for From 6af64513413d7194cfa2d8308db2d73f6ed64bf4 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 25 Aug 2012 22:21:04 -0700 Subject: [PATCH 125/212] * lisp.h (ASET): Remove attempt to detect side effects. It was meant to be temporary and it often doesn't work, because when IDX has side effects the behavior of IDX==IDX is undefined. See Stefan Monnier in . --- src/ChangeLog | 8 ++++++++ src/lisp.h | 4 +--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 54fff9356f3..06682f4637e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2012-08-26 Paul Eggert + + * lisp.h (ASET): Remove attempt to detect side effects. + It was meant to be temporary and it often doesn't work, + because when IDX has side effects the behavior of IDX==IDX + is undefined. See Stefan Monnier in + . + 2012-08-26 Barry OReilly (tiny change) * lisp.h (functionp): New function (extracted from Ffunctionp). diff --git a/src/lisp.h b/src/lisp.h index c44ba7be347..4437fa44b6d 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -606,10 +606,8 @@ clip_to_bounds (ptrdiff_t lower, EMACS_INT num, ptrdiff_t upper) #define AREF(ARRAY, IDX) XVECTOR ((ARRAY))->contents[IDX] #define ASIZE(ARRAY) XVECTOR ((ARRAY))->header.size -/* The IDX==IDX tries to detect when the macro argument is side-effecting. */ #define ASET(ARRAY, IDX, VAL) \ - (eassert ((IDX) == (IDX)), \ - eassert ((IDX) >= 0 && (IDX) < ASIZE (ARRAY)), \ + (eassert (0 <= (IDX) && (IDX) < ASIZE (ARRAY)), \ XVECTOR (ARRAY)->contents[IDX] = (VAL)) /* Convenience macros for dealing with Lisp strings. */ From d5172d4fbc2ca871d18426fb9e84ee6bb87a0e68 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 26 Aug 2012 01:41:36 -0700 Subject: [PATCH 126/212] * character.c, charset.c, chartab.c: Use bool for booleans. * character.c (lisp_string_width, string_count_byte8) (string_escape_byte8): * charset.c (charset_map_loaded, load_charset_map, read_hex): (load_charset_map_from_file, map_charset_chars) (Fdefine_charset_internal, define_charset_internal) (Fdeclare_equiv_charset, find_charsets_in_text) (Ffind_charset_region, char_charset, Fiso_charset): * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range) (sub_char_table_set, sub_char_table_set_range) (char_table_set_range, optimize_sub_char_table) (map_sub_char_table): Use bool for boolean. * character.c (str_to_unibyte): Omit last boolean argument; it was always 0. All callers changed. * character.h, charset.h: Adjust to match previous changes. * character.h (char_printable_p): Remove decl of nonexistent function. * charset.h (struct charset): Members code_linear_p, iso_chars_96, ascii_compatible_p, supplementary_p, compact_codes_p, unified_p are all boolean, so make them single-bit bitfields. --- src/ChangeLog | 21 +++++++++++++++++++++ src/character.c | 16 ++++++---------- src/character.h | 3 +-- src/charset.c | 32 ++++++++++++++++---------------- src/charset.h | 39 ++++++++++++++++++++------------------- src/chartab.c | 19 ++++++++++--------- 6 files changed, 74 insertions(+), 56 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 06682f4637e..c94a6d7495f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,26 @@ 2012-08-26 Paul Eggert + * character.c, charset.c, chartab.c: Use bool for booleans. + * character.c (lisp_string_width, string_count_byte8) + (string_escape_byte8): + * charset.c (charset_map_loaded, load_charset_map, read_hex): + (load_charset_map_from_file, map_charset_chars) + (Fdefine_charset_internal, define_charset_internal) + (Fdeclare_equiv_charset, find_charsets_in_text) + (Ffind_charset_region, char_charset, Fiso_charset): + * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range) + (sub_char_table_set, sub_char_table_set_range) + (char_table_set_range, optimize_sub_char_table) + (map_sub_char_table): + Use bool for boolean. + * character.c (str_to_unibyte): Omit last boolean argument; it was + always 0. All callers changed. + * character.h, charset.h: Adjust to match previous changes. + * character.h (char_printable_p): Remove decl of nonexistent function. + * charset.h (struct charset): Members code_linear_p, iso_chars_96, + ascii_compatible_p, supplementary_p, compact_codes_p, unified_p + are all boolean, so make them single-bit bitfields. + * lisp.h (ASET): Remove attempt to detect side effects. It was meant to be temporary and it often doesn't work, because when IDX has side effects the behavior of IDX==IDX diff --git a/src/character.c b/src/character.c index b2acf36ec15..cfaaf8eeca9 100644 --- a/src/character.c +++ b/src/character.c @@ -427,7 +427,7 @@ lisp_string_width (Lisp_Object string, ptrdiff_t precision, /* This set multibyte to 0 even if STRING is multibyte when it contains only ascii and eight-bit-graphic, but that's intentional. */ - int multibyte = len < SBYTES (string); + bool multibyte = len < SBYTES (string); unsigned char *str = SDATA (string); ptrdiff_t i = 0, i_byte = 0; ptrdiff_t width = 0; @@ -765,13 +765,10 @@ str_as_unibyte (unsigned char *str, ptrdiff_t bytes) corresponding byte and store in DST. CHARS is the number of characters in SRC. The value is the number of bytes stored in DST. Usually, the value is the same as CHARS, but is less than it if SRC - contains a non-ASCII, non-eight-bit character. If ACCEPT_LATIN_1 - is nonzero, a Latin-1 character is accepted and converted to a byte - of that character code. - Note: Currently the arg ACCEPT_LATIN_1 is not used. */ + contains a non-ASCII, non-eight-bit character. */ ptrdiff_t -str_to_unibyte (const unsigned char *src, unsigned char *dst, ptrdiff_t chars, int accept_latin_1) +str_to_unibyte (const unsigned char *src, unsigned char *dst, ptrdiff_t chars) { ptrdiff_t i; @@ -781,8 +778,7 @@ str_to_unibyte (const unsigned char *src, unsigned char *dst, ptrdiff_t chars, i if (CHAR_BYTE8_P (c)) c = CHAR_TO_BYTE8 (c); - else if (! ASCII_CHAR_P (c) - && (! accept_latin_1 || c >= 0x100)) + else if (! ASCII_CHAR_P (c)) return i; *dst++ = c; } @@ -793,7 +789,7 @@ str_to_unibyte (const unsigned char *src, unsigned char *dst, ptrdiff_t chars, i static ptrdiff_t string_count_byte8 (Lisp_Object string) { - int multibyte = STRING_MULTIBYTE (string); + bool multibyte = STRING_MULTIBYTE (string); ptrdiff_t nbytes = SBYTES (string); unsigned char *p = SDATA (string); unsigned char *pend = p + nbytes; @@ -825,7 +821,7 @@ string_escape_byte8 (Lisp_Object string) { ptrdiff_t nchars = SCHARS (string); ptrdiff_t nbytes = SBYTES (string); - int multibyte = STRING_MULTIBYTE (string); + bool multibyte = STRING_MULTIBYTE (string); ptrdiff_t byte8_count; const unsigned char *src, *src_end; unsigned char *dst; diff --git a/src/character.h b/src/character.h index 332dfee373a..70d4e67a978 100644 --- a/src/character.h +++ b/src/character.h @@ -676,7 +676,6 @@ extern int string_char (const unsigned char *, const unsigned char **, int *); extern int translate_char (Lisp_Object, int c); -extern int char_printable_p (int c); extern void parse_str_as_multibyte (const unsigned char *, ptrdiff_t, ptrdiff_t *, ptrdiff_t *); extern ptrdiff_t count_size_as_multibyte (const unsigned char *, ptrdiff_t); @@ -685,7 +684,7 @@ extern ptrdiff_t str_as_multibyte (unsigned char *, ptrdiff_t, ptrdiff_t, extern ptrdiff_t str_to_multibyte (unsigned char *, ptrdiff_t, ptrdiff_t); extern ptrdiff_t str_as_unibyte (unsigned char *, ptrdiff_t); extern ptrdiff_t str_to_unibyte (const unsigned char *, unsigned char *, - ptrdiff_t, int); + ptrdiff_t); extern ptrdiff_t strwidth (const char *, ptrdiff_t); extern ptrdiff_t c_string_width (const unsigned char *, ptrdiff_t, int, ptrdiff_t *, ptrdiff_t *); diff --git a/src/charset.c b/src/charset.c index 3e286fa947d..0673790e91c 100644 --- a/src/charset.c +++ b/src/charset.c @@ -215,7 +215,7 @@ static struct /* Set to 1 to warn that a charset map is loaded and thus a buffer text and a string data may be relocated. */ -int charset_map_loaded; +bool charset_map_loaded; struct charset_map_entries { @@ -256,7 +256,7 @@ load_charset_map (struct charset *charset, struct charset_map_entries *entries, { Lisp_Object vec IF_LINT (= Qnil), table IF_LINT (= Qnil); unsigned max_code = CHARSET_MAX_CODE (charset); - int ascii_compatible_p = charset->ascii_compatible_p; + bool ascii_compatible_p = charset->ascii_compatible_p; int min_char, max_char, nonascii_min_char; int i; unsigned char *fast_map = charset->fast_map; @@ -423,7 +423,7 @@ load_charset_map (struct charset *charset, struct charset_map_entries *entries, paying attention to comment character '#'. */ static inline unsigned -read_hex (FILE *fp, int *eof, int *overflow) +read_hex (FILE *fp, bool *eof, bool *overflow) { int c; unsigned n; @@ -512,7 +512,7 @@ load_charset_map_from_file (struct charset *charset, Lisp_Object mapfile, int co { unsigned from, to, c; int idx; - int eof = 0, overflow = 0; + bool eof = 0, overflow = 0; from = read_hex (fp, &eof, &overflow); if (eof) @@ -717,10 +717,8 @@ map_charset_chars (void (*c_function)(Lisp_Object, Lisp_Object), Lisp_Object fun Lisp_Object arg, struct charset *charset, unsigned from, unsigned to) { Lisp_Object range; - int partial; - - partial = (from > CHARSET_MIN_CODE (charset) - || to < CHARSET_MAX_CODE (charset)); + bool partial = (from > CHARSET_MIN_CODE (charset) + || to < CHARSET_MAX_CODE (charset)); if (CHARSET_METHOD (charset) == CHARSET_METHOD_OFFSET) { @@ -855,7 +853,7 @@ usage: (define-charset-internal ...) */) struct charset charset; int id; int dimension; - int new_definition_p; + bool new_definition_p; int nchars; if (nargs != charset_arg_max) @@ -1250,7 +1248,7 @@ define_charset_internal (Lisp_Object name, const char *code_space_chars, unsigned min_code, unsigned max_code, int iso_final, int iso_revision, int emacs_mule_id, - int ascii_compatible, int supplementary, + bool ascii_compatible, bool supplementary, int code_offset) { const unsigned char *code_space = (const unsigned char *) code_space_chars; @@ -1448,7 +1446,7 @@ if CHARSET is designated instead. */) (Lisp_Object dimension, Lisp_Object chars, Lisp_Object final_char, Lisp_Object charset) { int id; - int chars_flag; + bool chars_flag; CHECK_CHARSET_GET_ID (charset, id); check_iso_charset_parameter (dimension, chars, final_char); @@ -1499,7 +1497,9 @@ string_xstring_p (Lisp_Object string) It may lookup a translation table TABLE if supplied. */ static void -find_charsets_in_text (const unsigned char *ptr, ptrdiff_t nchars, ptrdiff_t nbytes, Lisp_Object charsets, Lisp_Object table, int multibyte) +find_charsets_in_text (const unsigned char *ptr, ptrdiff_t nchars, + ptrdiff_t nbytes, Lisp_Object charsets, + Lisp_Object table, bool multibyte) { const unsigned char *pend = ptr + nbytes; @@ -1549,7 +1549,7 @@ only `ascii', `eight-bit-control', and `eight-bit-graphic'. */) ptrdiff_t from, from_byte, to, stop, stop_byte; int i; Lisp_Object val; - int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); + bool multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); validate_region (&beg, &end); from = XFASTINT (beg); @@ -1735,7 +1735,7 @@ decode_char (struct charset *charset, unsigned int code) /* Variable used temporarily by the macro ENCODE_CHAR. */ Lisp_Object charset_work; -/* Return a code-point of CHAR in CHARSET. If CHAR doesn't belong to +/* Return a code-point of C in CHARSET. If C doesn't belong to CHARSET, return CHARSET_INVALID_CODE (CHARSET). If STRICT is true, use CHARSET's strict_max_char instead of max_char. */ @@ -1978,7 +1978,7 @@ is specified. */) struct charset * char_charset (int c, Lisp_Object charset_list, unsigned int *code_return) { - int maybe_null = 0; + bool maybe_null = 0; if (NILP (charset_list)) charset_list = Vcharset_ordered_list; @@ -2106,7 +2106,7 @@ DIMENSION, CHARS, and FINAL-CHAR. */) (Lisp_Object dimension, Lisp_Object chars, Lisp_Object final_char) { int id; - int chars_flag; + bool chars_flag; check_iso_charset_parameter (dimension, chars, final_char); chars_flag = XFASTINT (chars) == 96; diff --git a/src/charset.h b/src/charset.h index 4ef8ddc2c33..6e6d0ec2701 100644 --- a/src/charset.h +++ b/src/charset.h @@ -173,12 +173,24 @@ struct charset check if a code-point is in a valid range. */ unsigned char *code_space_mask; - /* 1 if there's no gap in code-points. */ - int code_linear_p; + /* True if there's no gap in code-points. */ + unsigned code_linear_p : 1; - /* If the charset is treated as 94-chars in ISO-2022, the value is 0. - If the charset is treated as 96-chars in ISO-2022, the value is 1. */ - int iso_chars_96; + /* True if the charset is treated as 96 chars in ISO-2022 + as opposed to 94 chars. */ + unsigned iso_chars_96 : 1; + + /* True if the charset is compatible with ASCII. */ + unsigned ascii_compatible_p : 1; + + /* True if the charset is supplementary. */ + unsigned supplementary_p : 1; + + /* True if all the code points are representable by Lisp_Int. */ + unsigned compact_codes_p : 1; + + /* True if the charset is unified with Unicode. */ + unsigned unified_p : 1; /* ISO final byte of the charset: 48..127. It may be -1 if the charset doesn't conform to ISO-2022. */ @@ -192,15 +204,6 @@ struct charset version. Otherwise, -1. */ int emacs_mule_id; - /* Nonzero if the charset is compatible with ASCII. */ - int ascii_compatible_p; - - /* Nonzero if the charset is supplementary. */ - int supplementary_p; - - /* Nonzero if all the code points are representable by Lisp_Int. */ - int compact_codes_p; - /* The method for encoding/decoding characters of the charset. */ enum charset_method method; @@ -239,8 +242,6 @@ struct charset /* Offset value to calculate a character code from code-point, and visa versa. */ int code_offset; - - int unified_p; }; /* Hash table of charset symbols vs. the corresponding attribute @@ -456,7 +457,7 @@ extern Lisp_Object charset_work; /* Set to 1 when a charset map is loaded to warn that a buffer text and a string data may be relocated. */ -extern int charset_map_loaded; +extern bool charset_map_loaded; /* Set CHARSET to the charset highest priority of C, CODE to the @@ -474,10 +475,10 @@ extern int charset_map_loaded; macro ISO_CHARSET_TABLE (DIMENSION, CHARS, FINAL_CHAR). */ extern int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL]; -/* A charset of type iso2022 who has DIMENSION, CHARS, and FINAL +/* A charset of type iso2022 who has DIMENSION, CHARS_96, and FINAL (final character). */ #define ISO_CHARSET_TABLE(dimension, chars_96, final) \ - iso_charset_table[(dimension) - 1][(chars_96)][(final)] + iso_charset_table[(dimension) - 1][chars_96][final] /* Nonzero if the charset who has FAST_MAP may contain C. */ #define CHARSET_FAST_MAP_REF(c, fast_map) \ diff --git a/src/chartab.c b/src/chartab.c index 711a49ed397..c14df0ebac6 100644 --- a/src/chartab.c +++ b/src/chartab.c @@ -200,7 +200,7 @@ copy_char_table (Lisp_Object table) } static Lisp_Object -sub_char_table_ref (Lisp_Object table, int c, int is_uniprop) +sub_char_table_ref (Lisp_Object table, int c, bool is_uniprop) { struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); int depth = XINT (tbl->depth); @@ -245,7 +245,7 @@ char_table_ref (Lisp_Object table, int c) static Lisp_Object sub_char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to, - Lisp_Object defalt, int is_uniprop) + Lisp_Object defalt, bool is_uniprop) { struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); int depth = XINT (tbl->depth); @@ -320,7 +320,7 @@ char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to) struct Lisp_Char_Table *tbl = XCHAR_TABLE (table); int chartab_idx = CHARTAB_IDX (c, 0, 0), idx; Lisp_Object val; - int is_uniprop = UNIPROP_TABLE_P (table); + bool is_uniprop = UNIPROP_TABLE_P (table); val = tbl->contents[chartab_idx]; if (*from < 0) @@ -382,7 +382,7 @@ char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to) static void -sub_char_table_set (Lisp_Object table, int c, Lisp_Object val, int is_uniprop) +sub_char_table_set (Lisp_Object table, int c, Lisp_Object val, bool is_uniprop) { struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); int depth = XINT ((tbl)->depth); @@ -438,7 +438,7 @@ char_table_set (Lisp_Object table, int c, Lisp_Object val) static void sub_char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val, - int is_uniprop) + bool is_uniprop) { struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); int depth = XINT ((tbl)->depth); @@ -484,7 +484,7 @@ char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val) char_table_set (table, from, val); else { - int is_uniprop = UNIPROP_TABLE_P (table); + bool is_uniprop = UNIPROP_TABLE_P (table); int lim = CHARTAB_IDX (to, 0, 0); int i, c; @@ -683,7 +683,8 @@ optimize_sub_char_table (Lisp_Object table, Lisp_Object test) struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); int depth = XINT (tbl->depth); Lisp_Object elt, this; - int i, optimizable; + int i; + bool optimizable; elt = XSUB_CHAR_TABLE (table)->contents[0]; if (SUB_CHAR_TABLE_P (elt)) @@ -762,7 +763,7 @@ map_sub_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object), int chars_in_block; int from = XINT (XCAR (range)), to = XINT (XCDR (range)); int i, c; - int is_uniprop = UNIPROP_TABLE_P (top); + bool is_uniprop = UNIPROP_TABLE_P (top); uniprop_decoder_t decoder = UNIPROP_GET_DECODER (top); if (SUB_CHAR_TABLE_P (table)) @@ -811,7 +812,7 @@ map_sub_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object), this = XCHAR_TABLE (top)->defalt; if (!EQ (val, this)) { - int different_value = 1; + bool different_value = 1; if (NILP (val)) { From d97af5a07f045ed1de8045bab25af384c21b08dd Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 26 Aug 2012 17:16:48 +0800 Subject: [PATCH 127/212] Clean up gdb-mi's usage of display-buffer. * progmodes/gdb-mi.el (gdb-display-buffer-other-frame-action): New variable, replacing gdb-frame-parameters. (gdb-frame-io-buffer, gdb-frame-breakpoints-buffer) (gdb-frame-threads-buffer, gdb-frame-memory-buffer) (gdb-frame-disassembly-buffer, gdb-frame-stack-buffer) (gdb-frame-locals-buffer, gdb-frame-registers-buffer): Use it. (def-gdb-frame-for-buffer): Macro deleted. It is easier to define the functions directly with gdb-display-buffer-other-frame-action. (gdb-display-breakpoints-buffer, gdb-display-threads-buffer) (gdb-display-memory-buffer, gdb-display-disassembly-buffer) (gdb-display-stack-buffer, gdb-display-locals-buffer) (gdb-display-registers-buffer): Define directly. (def-gdb-display-buffer): Macro deleted. (gdb-display-buffer): Remove second and third args, callers don't use them. Defer to the default display-buffer behavior, apart from making windows dedicated. (gdb-setup-windows): Don't call display-buffer unnecessarily. * window.el (display-buffer-pop-up-frame): Handle a pop-up-frame-parameters alist entry. (display-buffer): Document it. * progmodes/gud.el (gud-display-line): Just use display-buffer. --- etc/NEWS | 3 + lisp/ChangeLog | 26 +++++ lisp/progmodes/gdb-mi.el | 239 ++++++++++++++++++--------------------- lisp/progmodes/gud.el | 6 +- lisp/window.el | 23 ++-- 5 files changed, 154 insertions(+), 143 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 02bd6410255..13355abe4c4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -619,6 +619,9 @@ now accept a third argument to avoid choosing the selected window. *** New display action alist `inhibit-switch-frame', if non-nil, tells display action functions to avoid changing which frame is selected. +*** New display action alist `pop-up-frame-parameters', if non-nil, +specifies frame parameters to give any newly-created frame. + ** Completion *** New function `completion-table-with-quoting' to handle completion diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2cc41c92210..193665f908b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,29 @@ +2012-08-26 Chong Yidong + + * progmodes/gdb-mi.el (gdb-display-buffer-other-frame-action): New + variable, replacing gdb-frame-parameters. + (gdb-frame-io-buffer, gdb-frame-breakpoints-buffer) + (gdb-frame-threads-buffer, gdb-frame-memory-buffer) + (gdb-frame-disassembly-buffer, gdb-frame-stack-buffer) + (gdb-frame-locals-buffer, gdb-frame-registers-buffer): Use it. + (def-gdb-frame-for-buffer): Macro deleted. It is easier to define + the functions directly with gdb-display-buffer-other-frame-action. + (gdb-display-breakpoints-buffer, gdb-display-threads-buffer) + (gdb-display-memory-buffer, gdb-display-disassembly-buffer) + (gdb-display-stack-buffer, gdb-display-locals-buffer) + (gdb-display-registers-buffer): Define directly. + (def-gdb-display-buffer): Macro deleted. + (gdb-display-buffer): Remove second and third args, callers don't + use them. Defer to the default display-buffer behavior, apart + from making windows dedicated. + (gdb-setup-windows): Don't call display-buffer unnecessarily. + + * progmodes/gud.el (gud-display-line): Just use display-buffer. + + * window.el (display-buffer-pop-up-frame): Handle a + pop-up-frame-parameters alist entry. + (display-buffer): Document it. + 2012-08-26 Chong Yidong * isearch.el (search-whitespace-regexp): Make string and nil diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 0a99c2f5c24..59c419abfc3 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -1413,29 +1413,6 @@ this trigger is subscribed to `gdb-buf-publisher' and called with (with-current-buffer ,buffer (apply ',expr args)))) -;; Used to define all gdb-frame-*-buffer functions except -;; `gdb-frame-io-buffer' -(defmacro def-gdb-frame-for-buffer (name buffer &optional doc) - "Define a function NAME which shows gdb BUFFER in a separate frame. - -DOC is an optional documentation string." - `(defun ,name (&optional thread) - ,(when doc doc) - (interactive) - (let ((special-display-regexps (append special-display-regexps '(".*"))) - (special-display-frame-alist gdb-frame-parameters)) - (display-buffer (gdb-get-buffer-create ,buffer thread))))) - -(defmacro def-gdb-display-buffer (name buffer &optional doc) - "Define a function NAME which shows gdb BUFFER. - -DOC is an optional documentation string." - `(defun ,name (&optional thread) - ,(when doc doc) - (interactive) - (gdb-display-buffer - (gdb-get-buffer-create ,buffer thread) t))) - ;; Used to display windows with thread-bound buffers (defmacro def-gdb-preempt-display-buffer (name buffer &optional doc split-horizontal) @@ -1511,8 +1488,7 @@ DOC is an optional documentation string." (defun gdb-display-io-buffer () "Display IO of debugged program in a separate window." (interactive) - (gdb-display-buffer - (gdb-get-buffer-create 'gdb-inferior-io) t)) + (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io))) (defun gdb-inferior-io--init-proc (proc) ;; Set up inferior I/O. Needs GDB 6.4 onwards. @@ -1540,19 +1516,24 @@ DOC is an optional documentation string." (comint-exec io-buffer "gdb-inferior" nil nil nil) (gdb-inferior-io--init-proc (get-buffer-process io-buffer)))))) -(defconst gdb-frame-parameters - '((height . 14) (width . 80) - (unsplittable . t) - (tool-bar-lines . nil) - (menu-bar-lines . nil) - (minibuffer . nil))) +(defvar gdb-display-buffer-other-frame-action + `((display-buffer-reuse-window display-buffer-pop-up-frame) + (reusable-frames . 0) + (inhibit-same-window . t) + (pop-up-frame-parameters (height . 14) + (width . 80) + (unsplittable . t) + (tool-bar-lines . nil) + (menu-bar-lines . nil) + (minibuffer . nil))) + "A `display-buffer' action for displaying GDB utility frames.") +(put 'gdb-display-buffer-other-frame-action 'risky-local-variable t) (defun gdb-frame-io-buffer () - "Display IO of debugged program in a new frame." + "Display IO of debugged program in another frame." (interactive) - (let ((special-display-regexps (append special-display-regexps '(".*"))) - (special-display-frame-alist gdb-frame-parameters)) - (display-buffer (gdb-get-buffer-create 'gdb-inferior-io)))) + (display-buffer (gdb-get-buffer-create 'gdb-inferior-io) + gdb-display-buffer-other-frame-action)) (defvar gdb-inferior-io-mode-map (let ((map (make-sparse-keymap))) @@ -1571,7 +1552,7 @@ DOC is an optional documentation string." (defun gdb-inferior-filter (proc string) (unless (string-equal string "") - (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io) t)) + (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io))) (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io) (comint-output-filter proc string))) @@ -2615,15 +2596,16 @@ If not in a source or disassembly buffer just set point." (defun gdb-breakpoints-buffer-name () (concat "*breakpoints of " (gdb-get-target-string) "*")) -(def-gdb-display-buffer - gdb-display-breakpoints-buffer - 'gdb-breakpoints-buffer - "Display status of user-settable breakpoints.") +(defun gdb-display-breakpoints-buffer (&optional thread) + "Display GDB breakpoints." + (interactive) + (gdb-display-buffer (gdb-get-buffer-create 'gdb-breakpoints-buffer thread))) -(def-gdb-frame-for-buffer - gdb-frame-breakpoints-buffer - 'gdb-breakpoints-buffer - "Display status of user-settable breakpoints in a new frame.") +(defun gdb-frame-breakpoints-buffer (&optional thread) + "Display GDB breakpoints in another frame." + (interactive) + (display-buffer (gdb-get-buffer-create 'gdb-breakpoints-buffer thread) + gdb-display-buffer-other-frame-action)) (defvar gdb-breakpoints-mode-map (let ((map (make-sparse-keymap)) @@ -2684,15 +2666,16 @@ corresponding to the mode line clicked." (defun gdb-threads-buffer-name () (concat "*threads of " (gdb-get-target-string) "*")) -(def-gdb-display-buffer - gdb-display-threads-buffer - 'gdb-threads-buffer - "Display GDB threads.") +(defun gdb-display-threads-buffer (&optional thread) + "Display GDB threads." + (interactive) + (gdb-display-buffer (gdb-get-buffer-create 'gdb-threads-buffer thread))) -(def-gdb-frame-for-buffer - gdb-frame-threads-buffer - 'gdb-threads-buffer - "Display GDB threads in a new frame.") +(defun gdb-frame-threads-buffer (&optional thread) + "Display GDB threads in another frame." + (interactive) + (display-buffer (gdb-get-buffer-create 'gdb-threads-buffer thread) + gdb-display-buffer-other-frame-action)) (def-gdb-trigger-and-handler gdb-invalidate-threads (gdb-current-context-command "-thread-info") @@ -2868,26 +2851,22 @@ on the current line." (def-gdb-thread-buffer-simple-command gdb-frame-stack-for-thread gdb-frame-stack-buffer - "Display a new frame with stack buffer for the thread at -current line.") + "Display another frame with stack buffer for thread at current line.") (def-gdb-thread-buffer-simple-command gdb-frame-locals-for-thread gdb-frame-locals-buffer - "Display a new frame with locals buffer for the thread at -current line.") + "Display another frame with locals buffer for thread at current line.") (def-gdb-thread-buffer-simple-command gdb-frame-registers-for-thread gdb-frame-registers-buffer - "Display a new frame with registers buffer for the thread at -current line.") + "Display another frame with registers buffer for the thread at current line.") (def-gdb-thread-buffer-simple-command gdb-frame-disassembly-for-thread gdb-frame-disassembly-buffer - "Display a new frame with disassembly buffer for the thread at -current line.") + "Display another frame with disassembly buffer for the thread at current line.") (defmacro def-gdb-thread-buffer-gud-command (name gud-command &optional doc) "Define a NAME which will execute GUD-COMMAND with @@ -3290,21 +3269,16 @@ DOC is an optional documentation string." (defun gdb-memory-buffer-name () (concat "*memory of " (gdb-get-target-string) "*")) -(def-gdb-display-buffer - gdb-display-memory-buffer - 'gdb-memory-buffer - "Display memory contents.") +(defun gdb-display-memory-buffer (&optional thread) + "Display GDB memory contents." + (interactive) + (gdb-display-buffer (gdb-get-buffer-create 'gdb-memory-buffer thread))) (defun gdb-frame-memory-buffer () - "Display memory contents in a new frame." + "Display memory contents in another frame." (interactive) - (let* ((special-display-regexps (append special-display-regexps '(".*"))) - (special-display-frame-alist - `((left-fringe . 0) - (right-fringe . 0) - (width . 83) - ,@gdb-frame-parameters))) - (display-buffer (gdb-get-buffer-create 'gdb-memory-buffer)))) + (display-buffer (gdb-get-buffer-create 'gdb-memory-buffer) + gdb-display-buffer-other-frame-action)) ;;; Disassembly view @@ -3313,19 +3287,20 @@ DOC is an optional documentation string." (gdb-current-context-buffer-name (concat "disassembly of " (gdb-get-target-string)))) -(def-gdb-display-buffer - gdb-display-disassembly-buffer - 'gdb-disassembly-buffer - "Display disassembly for current stack frame.") +(defun gdb-display-disassembly-buffer (&optional thread) + "Display GDB disassembly information." + (interactive) + (gdb-display-buffer (gdb-get-buffer-create 'gdb-disassembly-buffer thread))) (def-gdb-preempt-display-buffer gdb-preemptively-display-disassembly-buffer 'gdb-disassembly-buffer) -(def-gdb-frame-for-buffer - gdb-frame-disassembly-buffer - 'gdb-disassembly-buffer - "Display disassembly in a new frame.") +(defun gdb-frame-disassembly-buffer (&optional thread) + "Display GDB disassembly information in another frame." + (interactive) + (display-buffer (gdb-get-buffer-create 'gdb-disassembly-buffer thread) + gdb-display-buffer-other-frame-action)) (def-gdb-auto-update-trigger gdb-invalidate-disassembly (let* ((frame (gdb-current-buffer-frame)) @@ -3560,19 +3535,20 @@ member." (gdb-current-context-buffer-name (concat "stack frames of " (gdb-get-target-string)))) -(def-gdb-display-buffer - gdb-display-stack-buffer - 'gdb-stack-buffer - "Display backtrace of current stack.") +(defun gdb-display-stack-buffer (&optional thread) + "Display GDB backtrace for current stack." + (interactive) + (gdb-display-buffer (gdb-get-buffer-create 'gdb-stack-buffer thread))) (def-gdb-preempt-display-buffer gdb-preemptively-display-stack-buffer 'gdb-stack-buffer nil t) -(def-gdb-frame-for-buffer - gdb-frame-stack-buffer - 'gdb-stack-buffer - "Display backtrace of current stack in a new frame.") +(defun gdb-frame-stack-buffer (&optional thread) + "Display GDB backtrace for current stack in another frame." + (interactive) + (display-buffer (gdb-get-buffer-create 'gdb-stack-buffer thread) + gdb-display-buffer-other-frame-action)) (defvar gdb-frames-mode-map (let ((map (make-sparse-keymap))) @@ -3719,19 +3695,20 @@ member." (gdb-current-context-buffer-name (concat "locals of " (gdb-get-target-string)))) -(def-gdb-display-buffer - gdb-display-locals-buffer - 'gdb-locals-buffer - "Display local variables of current stack and their values.") +(defun gdb-display-locals-buffer (&optional thread) + "Display the local variables of current GDB stack." + (interactive) + (gdb-display-buffer (gdb-get-buffer-create 'gdb-locals-buffer thread))) (def-gdb-preempt-display-buffer gdb-preemptively-display-locals-buffer 'gdb-locals-buffer nil t) -(def-gdb-frame-for-buffer - gdb-frame-locals-buffer - 'gdb-locals-buffer - "Display local variables of current stack and their values in a new frame.") +(defun gdb-frame-locals-buffer (&optional thread) + "Display the local variables of the current GDB stack in another frame." + (interactive) + (display-buffer (gdb-get-buffer-create 'gdb-locals-buffer thread) + gdb-display-buffer-other-frame-action)) ;; Registers buffer. @@ -3818,19 +3795,20 @@ member." (gdb-current-context-buffer-name (concat "registers of " (gdb-get-target-string)))) -(def-gdb-display-buffer - gdb-display-registers-buffer - 'gdb-registers-buffer - "Display integer register contents.") +(defun gdb-display-registers-buffer (&optional thread) + "Display GDB register contents." + (interactive) + (gdb-display-buffer (gdb-get-buffer-create 'gdb-registers-buffer thread))) (def-gdb-preempt-display-buffer gdb-preemptively-display-registers-buffer 'gdb-registers-buffer nil t) -(def-gdb-frame-for-buffer - gdb-frame-registers-buffer - 'gdb-registers-buffer - "Display integer register contents in a new frame.") +(defun gdb-frame-registers-buffer (&optional thread) + "Display GDB register contents in another frame." + (interactive) + (display-buffer (gdb-get-buffer-create 'gdb-registers-buffer thread) + gdb-display-buffer-other-frame-action)) ;; Needs GDB 6.4 onwards (used to fail with no stack). (defun gdb-get-changed-registers () @@ -3917,26 +3895,26 @@ overlay arrow in source buffer." (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name))) ;;;; Window management -(defun gdb-display-buffer (buf dedicated &optional frame) - "Show buffer BUF. +(defun gdb-display-buffer (buf) + "Show buffer BUF, and make that window dedicated." + (let ((window (display-buffer buf))) + (set-window-dedicated-p window t) + window)) + + ;; (let ((answer (get-buffer-window buf 0))) + ;; (if answer + ;; (display-buffer buf nil 0) ;Deiconify frame if necessary. + ;; (let ((window (get-lru-window))) + ;; (if (eq (buffer-local-value 'gud-minor-mode (window-buffer window)) + ;; 'gdbmi) + ;; (let ((largest (get-largest-window))) + ;; (setq answer (split-window largest)) + ;; (set-window-buffer answer buf) + ;; (set-window-dedicated-p answer t) + ;; answer) + ;; (set-window-buffer window buf) + ;; window))))) -If BUF is already displayed in some window, show it, deiconifying -the frame if necessary. Otherwise, find least recently used -window and show BUF there, if the window is not used for GDB -already, in which case that window is split first." - (let ((answer (get-buffer-window buf (or frame 0)))) - (if answer - (display-buffer buf nil (or frame 0)) ;Deiconify frame if necessary. - (let ((window (get-lru-window))) - (if (eq (buffer-local-value 'gud-minor-mode (window-buffer window)) - 'gdbmi) - (let ((largest (get-largest-window))) - (setq answer (split-window largest)) - (set-window-buffer answer buf) - (set-window-dedicated-p answer dedicated) - answer) - (set-window-buffer window buf) - window))))) (defun gdb-preempt-existing-or-display-buffer (buf &optional split-horizontal) "Find window displaying a buffer with the same @@ -3963,7 +3941,7 @@ SPLIT-HORIZONTAL and show BUF in the new window." (if dedicated-window (set-window-buffer (split-window dedicated-window nil split-horizontal) buf) - (gdb-display-buffer buf t)))))) + (gdb-display-buffer buf)))))) (error "Null buffer"))) ;;; Shared keymap initialization: @@ -4067,7 +4045,7 @@ SPLIT-HORIZONTAL and show BUF in the new window." 'all-threads) (defun gdb-frame-gdb-buffer () - "Display GUD buffer in a new frame." + "Display GUD buffer in another frame." (interactive) (display-buffer-other-frame gud-comint-buffer)) @@ -4089,13 +4067,12 @@ window is dedicated." (defun gdb-setup-windows () "Layout the window pattern for `gdb-many-windows'." - (gdb-display-locals-buffer) - (gdb-display-stack-buffer) - (delete-other-windows) - (gdb-display-breakpoints-buffer) - (delete-other-windows) - ;; Don't dedicate. + (gdb-get-buffer-create 'gdb-locals-buffer) + (gdb-get-buffer-create 'gdb-stack-buffer) + (gdb-get-buffer-create 'gdb-breakpoints-buffer) + (set-window-dedicated-p (selected-window) nil) (switch-to-buffer gud-comint-buffer) + (delete-other-windows) (let ((win0 (selected-window)) (win1 (split-window nil ( / ( * (window-height) 3) 4))) (win2 (split-window nil ( / (window-height) 3))) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 5946e93f34d..2e3858b2cc5 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -2685,7 +2685,6 @@ Obeying it means displaying in another window the specified file and line." (declare-function global-hl-line-highlight "hl-line" ()) (declare-function hl-line-highlight "hl-line" ()) (declare-function gdb-display-source-buffer "gdb-mi" (buffer)) -(declare-function gdb-display-buffer "gdb-mi" (buf dedicated &optional size)) ;; Make sure the file named TRUE-FILE is in a buffer that appears on the screen ;; and that its line LINE is visible. @@ -2702,10 +2701,7 @@ Obeying it means displaying in another window the specified file and line." (window (and buffer (or (get-buffer-window buffer) (if (eq gud-minor-mode 'gdbmi) - (or (if (get-buffer-window buffer 'visible) - (display-buffer buffer nil 'visible)) - (unless (gdb-display-source-buffer buffer) - (gdb-display-buffer buffer nil 'visible)))) + (display-buffer buffer nil 'visible)) (display-buffer buffer)))) (pos)) (if buffer diff --git a/lisp/window.el b/lisp/window.el index 8aee27f44e8..16230003751 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4369,12 +4369,11 @@ of the window used." (function :tag "function")) :group 'windows) +;; Eventually, we want to turn this into a defvar; instead of +;; customizing this, the user should use a `pop-up-frame-parameters' +;; alist entry in `display-buffer-base-action'. (defcustom pop-up-frame-alist nil "Alist of parameters for automatically generated new frames. -You can set this in your init file; for example, - - (setq pop-up-frame-alist '((width . 80) (height . 20))) - If non-nil, the value you specify here is used by the default `pop-up-frame-function' for the creation of new frames. @@ -5108,6 +5107,10 @@ Recognized alist entries include: window that already displays the buffer. See `display-buffer-reuse-window'. + `pop-up-frame-parameters' -- Value specifies an alist of frame + parameters to give a new frame, if + one is created. + The ACTION argument to `display-buffer' can also have a non-nil and non-list value. This means to display the buffer in a window other than the selected one, even if it is already displayed in @@ -5250,9 +5253,15 @@ This works by calling `pop-up-frame-function'. If successful, return the window used; otherwise return nil. If ALIST has a non-nil `inhibit-switch-frame' entry, avoid -raising the new frame." - (let ((fun pop-up-frame-function) - frame window) +raising the new frame. + +If ALIST has a non-nil `pop-up-frame-parameters' entry, the +corresponding value is an alist of frame parameters to give the +new frame." + (let* ((params (cdr (assq 'pop-up-frame-parameters alist))) + (pop-up-frame-alist (append params pop-up-frame-alist)) + (fun pop-up-frame-function) + frame window) (when (and fun (setq frame (funcall fun)) (setq window (frame-selected-window frame))) From 67dbec33441a9594c39778f642e196e304341b4a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 26 Aug 2012 02:26:45 -0700 Subject: [PATCH 128/212] * fns.c (Fstring_to_unibyte): Adjust to str_to_unibyte change. --- src/fns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fns.c b/src/fns.c index 3225fefc5e3..91ba28504a0 100644 --- a/src/fns.c +++ b/src/fns.c @@ -1100,7 +1100,7 @@ an error is signaled. */) { ptrdiff_t chars = SCHARS (string); unsigned char *str = xmalloc (chars); - ptrdiff_t converted = str_to_unibyte (SDATA (string), str, chars, 0); + ptrdiff_t converted = str_to_unibyte (SDATA (string), str, chars); if (converted < chars) error ("Can't convert the %"pD"dth character to unibyte", converted); From b52d698579bbf035a70fb62440e154a06979b919 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 26 Aug 2012 03:04:27 -0700 Subject: [PATCH 129/212] Remove unused external symbols. * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector): * window.c (Qwindow_valid_p, decode_valid_window): Now static, not extern. * data.c (Qinterval): Remove; unused. (syms_of_data): Do not define 'interval'. * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons): * window.h (decode_valid_window): Remove decls. --- src/ChangeLog | 10 ++++++++++ src/data.c | 6 ++---- src/lisp.h | 3 +-- src/window.c | 5 +++-- src/window.h | 1 - 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c94a6d7495f..21aec9cb3c5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,15 @@ 2012-08-26 Paul Eggert + Remove unused external symbols. + * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector): + * window.c (Qwindow_valid_p, decode_valid_window): + Now static, not extern. + * data.c (Qinterval): Remove; unused. + (syms_of_data): Do not define 'interval'. + * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons): + * window.h (decode_valid_window): + Remove decls. + * character.c, charset.c, chartab.c: Use bool for booleans. * character.c (lisp_string_width, string_count_byte8) (string_escape_byte8): diff --git a/src/data.c b/src/data.c index f812c280b40..f121d8772c6 100644 --- a/src/data.c +++ b/src/data.c @@ -83,8 +83,8 @@ Lisp_Object Qoverflow_error, Qunderflow_error; Lisp_Object Qfloatp; Lisp_Object Qnumberp, Qnumber_or_marker_p; -Lisp_Object Qinteger, Qinterval, Qfloat, Qvector; -Lisp_Object Qsymbol, Qstring, Qcons, Qmisc; +Lisp_Object Qinteger, Qsymbol; +static Lisp_Object Qcons, Qfloat, Qmisc, Qstring, Qvector; Lisp_Object Qwindow; static Lisp_Object Qoverlay, Qwindow_configuration; static Lisp_Object Qprocess, Qmarker; @@ -3090,8 +3090,6 @@ syms_of_data (void) DEFSYM (Qchar_table, "char-table"); DEFSYM (Qbool_vector, "bool-vector"); DEFSYM (Qhash_table, "hash-table"); - /* Used by Fgarbage_collect. */ - DEFSYM (Qinterval, "interval"); DEFSYM (Qmisc, "misc"); DEFSYM (Qdefun, "defun"); diff --git a/src/lisp.h b/src/lisp.h index 4437fa44b6d..5b842d371a2 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2573,8 +2573,7 @@ extern Lisp_Object Qoverflow_error, Qunderflow_error; extern Lisp_Object Qfloatp; extern Lisp_Object Qnumberp, Qnumber_or_marker_p; -extern Lisp_Object Qinteger, Qinterval, Qsymbol, Qstring; -extern Lisp_Object Qmisc, Qvector, Qfloat, Qcons, Qbuffer; +extern Lisp_Object Qbuffer, Qinteger, Qsymbol; extern Lisp_Object Qfont_spec, Qfont_entity, Qfont_object; diff --git a/src/window.c b/src/window.c index 4d92566b243..4792e3bbea8 100644 --- a/src/window.c +++ b/src/window.c @@ -54,7 +54,8 @@ along with GNU Emacs. If not, see . */ #include "nsterm.h" #endif -Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_valid_p; +Lisp_Object Qwindowp, Qwindow_live_p; +static Lisp_Object Qwindow_valid_p; static Lisp_Object Qwindow_configuration_p, Qrecord_window_buffer; static Lisp_Object Qwindow_deletable_p, Qdelete_window, Qdisplay_buffer; static Lisp_Object Qreplace_buffer_in_windows, Qget_mru_window; @@ -268,7 +269,7 @@ decode_any_window (register Lisp_Object window) return w; } -struct window * +static struct window * decode_valid_window (register Lisp_Object window) { struct window *w; diff --git a/src/window.h b/src/window.h index 28b9678b667..dfb88b2cf3c 100644 --- a/src/window.h +++ b/src/window.h @@ -972,7 +972,6 @@ struct glyph *get_phys_cursor_glyph (struct window *w); extern Lisp_Object Qwindowp, Qwindow_live_p; extern Lisp_Object Vwindow_list; -extern struct window *decode_valid_window (Lisp_Object); extern struct window *decode_live_window (Lisp_Object); extern int compare_window_configurations (Lisp_Object, Lisp_Object, int); extern void mark_window_cursors_off (struct window *); From 6bd1cda51b4818304b818cbd2ad7d2c0459f246b Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 26 Aug 2012 06:19:02 -0400 Subject: [PATCH 130/212] Auto-commit of generated files. --- autogen/configure | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/autogen/configure b/autogen/configure index 7c22a3fbece..487f8de395a 100755 --- a/autogen/configure +++ b/autogen/configure @@ -7027,6 +7027,55 @@ esac # Code from module warnings: +# It's helpful to have C macros available to GDB, so prefer -g3 to -g +# if -g3 works and the user does not specify CFLAGS. +# This test must follow gl_EARLY; otherwise AC_LINK_IFELSE complains. +if test "$ac_test_CFLAGS" != set; then + case $CFLAGS in + '-g') + emacs_g3_CFLAGS='-g3';; + '-g -O2') + emacs_g3_CFLAGS='-g3 -O2';; + *) + emacs_g3_CFLAGS='';; + esac + if test -n "$emacs_g3_CFLAGS"; then + emacs_save_CFLAGS=$CFLAGS + CFLAGS=$emacs_g3_CFLAGS + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts $emacs_g3_CFLAGS" >&5 +$as_echo_n "checking whether $CC accepts $emacs_g3_CFLAGS... " >&6; } +if test "${emacs_cv_prog_cc_g3+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + emacs_cv_prog_cc_g3=yes +else + emacs_cv_prog_cc_g3=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_prog_cc_g3" >&5 +$as_echo "$emacs_cv_prog_cc_g3" >&6; } + if test $emacs_cv_prog_cc_g3 = yes; then + CFLAGS=$emacs_g3_CFLAGS + else + CFLAGS=$emacs_save_CFLAGS + fi + fi +fi + # Check whether --enable-gcc-warnings was given. if test "${enable_gcc_warnings+set}" = set; then : enableval=$enable_gcc_warnings; case $enableval in From 8b2e00a3297607e38e2be686bd2c7cab28f082d1 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 26 Aug 2012 03:29:37 -0700 Subject: [PATCH 131/212] Spelling fixes. * Makefile.in (.PHONY): versioclean -> versionclean. --- etc/NEWS | 2 +- lisp/calc/calccomp.el | 2 +- lisp/woman.el | 2 +- src/ChangeLog | 3 +++ src/Makefile.in | 2 +- src/w32.c | 4 ++-- src/xdisp.c | 2 +- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 13355abe4c4..3c2857f3a8c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -23,7 +23,7 @@ so we will look at it and add it to the manual. * Installation Changes in Emacs 24.3 -** New configure option '--without-all' to disable additonal features. +** New configure option '--without-all' to disable additional features. This disables most of the features that are normally enabled by default. ** New configure option '--enable-link-time-optimization' to utilize diff --git a/lisp/calc/calccomp.el b/lisp/calc/calccomp.el index 51ea8e7b7a3..2f1c95b7668 100644 --- a/lisp/calc/calccomp.el +++ b/lisp/calc/calccomp.el @@ -86,7 +86,7 @@ (setq sn (math-to-underscores sn))) sn))) -;;; Give multiplication precendence when composing to avoid +;;; Give multiplication precedence when composing to avoid ;;; writing a*(b c) instead of a b c (defun math-compose-expr (a prec &optional div) (let ((calc-multiplication-has-precedence t) diff --git a/lisp/woman.el b/lisp/woman.el index 5933d593aa5..c8cc7ea6766 100644 --- a/lisp/woman.el +++ b/lisp/woman.el @@ -2531,7 +2531,7 @@ REQUEST is the invoking directive without the leading dot." (cond ;; ((looking-at "[no]") (setq c t)) ; accept n(roff) and o(dd page) ;; ((looking-at "[te]") (setq c nil)) ; reject t(roff) and e(ven page) - ;; Per groff ".if v" is recognised as false (it means -Tversatec). + ;; Per groff ".if v" is recognized as false (it means -Tversatec). ((looking-at "[ntoev]") (setq c (memq (following-char) woman-if-conditions-true))) ;; Unrecognized letter so reject: diff --git a/src/ChangeLog b/src/ChangeLog index 21aec9cb3c5..550d2774ad4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2012-08-26 Paul Eggert + Spelling fixes. + * Makefile.in (.PHONY): versioclean -> versionclean. + Remove unused external symbols. * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector): * window.c (Qwindow_valid_p, decode_valid_window): diff --git a/src/Makefile.in b/src/Makefile.in index 85645222052..60df1f1c677 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -502,7 +502,7 @@ doc.o: buildobj.h @ns_frag@ .PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean -.PHONY: versioclean extraclean frc +.PHONY: versionclean extraclean frc mostlyclean: rm -f temacs$(EXEEXT) core *.core \#* *.o libXMenu11.a liblw.a diff --git a/src/w32.c b/src/w32.c index b460660cb8c..84a46e522bb 100644 --- a/src/w32.c +++ b/src/w32.c @@ -4098,7 +4098,7 @@ symlink (char const *filename, char const *linkname) dir_access = sys_access (filename, D_OK); /* Since Windows distinguishes between symlinks to directories and - to files, we provide a kludgey feature: if FILENAME doesn't + to files, we provide a kludgy feature: if FILENAME doesn't exist, but ends in a slash, we create a symlink to directory. If FILENAME exists and is a directory, we always create a symlink to directory. */ @@ -4165,7 +4165,7 @@ symlink (char const *filename, char const *linkname) whether the underlying volume actually supports symlinks, by testing the FILE_SUPPORTS_REPARSE_POINTS bit in volume's flags, and avoid the call to this function if it doesn't. That's because the - call to GetFileAttributes takes a non-negligible time, expecially + call to GetFileAttributes takes a non-negligible time, especially on non-local or removable filesystems. See stat_worker for an example of how to do that. */ static int diff --git a/src/xdisp.c b/src/xdisp.c index f5edb4b16f8..18e537e9385 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -2420,7 +2420,7 @@ remember_mouse_glyph (struct frame *f, int gx, int gy, NativeRectangle *rect) static Lisp_Object safe_eval_handler (Lisp_Object arg, ptrdiff_t nargs, Lisp_Object *args) { - add_to_log ("Error during redisplay: %S signalled %S", + add_to_log ("Error during redisplay: %S signaled %S", Flist (nargs, args), arg); return Qnil; } From 77f1f99cb0d69c1cddb0f1c5ef264fe5cd62d210 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 26 Aug 2012 21:42:18 +0800 Subject: [PATCH 132/212] Make special-display-* and display-buffer-reuse-frames obsolete. * lisp/window.el (special-display-regexps, special-display-frame-alist) (special-display-buffer-names, special-display-function) (display-buffer-reuse-frames): Mark as obsolete. * lisp/progmodes/compile.el: Don't use display-buffer-reuse-frames. * help.el (help-print-return-message): Don't treat display-buffer-reuse-frames specially. --- etc/NEWS | 10 ++++++++++ lisp/ChangeLog | 11 +++++++++++ lisp/help.el | 4 ---- lisp/progmodes/compile.el | 5 +---- lisp/window.el | 8 ++++++-- 5 files changed, 28 insertions(+), 10 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 3c2857f3a8c..fb8722ab8f8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -622,6 +622,16 @@ display action functions to avoid changing which frame is selected. *** New display action alist `pop-up-frame-parameters', if non-nil, specifies frame parameters to give any newly-created frame. +*** The following variables are obsolete, as they can be replaced by +appropriate entries in the `display-buffer-alist' function introduced +in Emacs 24.1: + +**** `display-buffer-reuse-frames' +**** `special-display-regexps' +**** `special-display-frame-alist' +**** `special-display-buffer-names' +**** `special-display-function' + ** Completion *** New function `completion-table-with-quoting' to handle completion diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 193665f908b..90df0479fac 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2012-08-26 Chong Yidong + + * window.el (special-display-regexps, special-display-frame-alist) + (special-display-buffer-names, special-display-function) + (display-buffer-reuse-frames): Mark as obsolete. + + * progmodes/compile.el: Don't use display-buffer-reuse-frames. + + * help.el (help-print-return-message): Don't treat + display-buffer-reuse-frames specially. + 2012-08-26 Chong Yidong * progmodes/gdb-mi.el (gdb-display-buffer-other-frame-action): New diff --git a/lisp/help.el b/lisp/help.el index 19cb811bcf5..19db7c255d1 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -145,10 +145,6 @@ specifies what to do when the user exits the help buffer." ;; Secondly, the buffer has not been displayed yet, ;; so we don't know whether its frame will be selected. nil) - (display-buffer-reuse-frames - (setq help-return-method (cons (selected-window) - 'quit-window)) - nil) ((not (one-window-p t)) (setq help-return-method (cons (selected-window) 'quit-window)) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 21a323d8b45..eb966e8a90d 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -2461,10 +2461,7 @@ and overlay is highlighted between MK and END-MK." ;; the error location if the two buffers are in two ;; different frames. So don't do it if it's not necessary. pre-existing - (let ((display-buffer-reuse-frames t) - (pop-up-windows t)) - ;; Pop up a window. - (display-buffer (marker-buffer msg))))) + (display-buffer (marker-buffer msg)))) (highlight-regexp (with-current-buffer (marker-buffer msg) ;; also do this while we change buffer (compilation-set-window w msg) diff --git a/lisp/window.el b/lisp/window.el index 16230003751..3599ff5527f 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4460,8 +4460,7 @@ See also `special-display-regexps'." (repeat :tag "Arguments" (sexp))))) :group 'windows :group 'frames) - -;;;###autoload +(make-obsolete-variable 'special-display-buffer-names 'display-buffer-alist "24.3") (put 'special-display-buffer-names 'risky-local-variable t) (defcustom special-display-regexps nil @@ -4528,6 +4527,8 @@ See also `special-display-buffer-names'." (repeat :tag "Arguments" (sexp))))) :group 'windows :group 'frames) +(make-obsolete-variable 'special-display-regexps 'display-buffer-alist "24.3") +(put 'special-display-regexps 'risky-local-variable t) (defun special-display-p (buffer-name) "Return non-nil if a buffer named BUFFER-NAME gets a special frame. @@ -4569,6 +4570,7 @@ These supersede the values given in `default-frame-alist'." (symbol :tag "Parameter") (sexp :tag "Value"))) :group 'frames) +(make-obsolete-variable 'special-display-frame-alist 'display-buffer-alist "24.3") (defun special-display-popup-frame (buffer &optional args) "Pop up a frame displaying BUFFER and return its window. @@ -4635,6 +4637,7 @@ with corresponding arguments to set up the quit-restore parameter of the window used." :type 'function :group 'frames) +(make-obsolete-variable 'special-display-function 'display-buffer-alist "24.3") (defcustom same-window-buffer-names nil "List of names of buffers that should appear in the \"same\" window. @@ -4707,6 +4710,7 @@ that frame." :type 'boolean :version "21.1" :group 'windows) +(make-obsolete-variable 'display-buffer-reuse-frames 'display-buffer-alist "24.3") (defcustom pop-up-windows t "Non-nil means `display-buffer' should make a new window." From 35aaa1ea263181d058228a6ea232197c7c88a7a1 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Mon, 27 Aug 2012 08:15:33 +0400 Subject: [PATCH 133/212] Special MEM_TYPE_SPARE to denote reserved memory. * alloc.c (enum mem_type): New memory type. (refill_memory_reserve): Use new type for spare memory. This prevents live_cons_p and live_string_p from incorrect detection of uninitialized objects from spare memory as live. --- src/ChangeLog | 8 ++++++++ src/alloc.c | 16 +++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 550d2774ad4..ec7267913d6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2012-08-27 Dmitry Antipov + + Special MEM_TYPE_SPARE to denote reserved memory. + * alloc.c (enum mem_type): New memory type. + (refill_memory_reserve): Use new type for spare memory. + This prevents live_cons_p and live_string_p from incorrect + detection of uninitialized objects from spare memory as live. + 2012-08-26 Paul Eggert Spelling fixes. diff --git a/src/alloc.c b/src/alloc.c index 961febb6dff..315fea25ef2 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -305,7 +305,9 @@ enum mem_type and runtime slowdown. Minor but pointless. */ MEM_TYPE_VECTORLIKE, /* Special type to denote vector blocks. */ - MEM_TYPE_VECTOR_BLOCK + MEM_TYPE_VECTOR_BLOCK, + /* Special type to denote reserved memory. */ + MEM_TYPE_SPARE }; static void *lisp_malloc (size_t, enum mem_type); @@ -3816,22 +3818,22 @@ refill_memory_reserve (void) spare_memory[0] = malloc (SPARE_MEMORY); if (spare_memory[1] == 0) spare_memory[1] = lisp_align_malloc (sizeof (struct cons_block), - MEM_TYPE_CONS); + MEM_TYPE_SPARE); if (spare_memory[2] == 0) spare_memory[2] = lisp_align_malloc (sizeof (struct cons_block), - MEM_TYPE_CONS); + MEM_TYPE_SPARE); if (spare_memory[3] == 0) spare_memory[3] = lisp_align_malloc (sizeof (struct cons_block), - MEM_TYPE_CONS); + MEM_TYPE_SPARE); if (spare_memory[4] == 0) spare_memory[4] = lisp_align_malloc (sizeof (struct cons_block), - MEM_TYPE_CONS); + MEM_TYPE_SPARE); if (spare_memory[5] == 0) spare_memory[5] = lisp_malloc (sizeof (struct string_block), - MEM_TYPE_STRING); + MEM_TYPE_SPARE); if (spare_memory[6] == 0) spare_memory[6] = lisp_malloc (sizeof (struct string_block), - MEM_TYPE_STRING); + MEM_TYPE_SPARE); if (spare_memory[0] && spare_memory[1] && spare_memory[5]) Vmemory_full = Qnil; #endif From c4b6914d3621942393a3a69d5cee3e39e13c6227 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Mon, 27 Aug 2012 10:31:19 +0200 Subject: [PATCH 134/212] Address two problems in Fset_window_configuration (Bug#8789) and (Bug#12208). * window.c (Fset_window_configuration): Record any window's old buffer if it's replaced (see Bug#8789). If the new current buffer doesn't appear in the selected window, go to its old point (Bug#12208). --- src/ChangeLog | 7 +++++++ src/window.c | 31 +++++++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index ec7267913d6..ee0aeed86f1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2012-08-27 Martin Rudalics + + * window.c (Fset_window_configuration): Record any window's old + buffer if it's replaced (see Bug#8789). If the new current + buffer doesn't appear in the selected window, go to its old + point (Bug#12208). + 2012-08-27 Dmitry Antipov Special MEM_TYPE_SPARE to denote reserved memory. diff --git a/src/window.c b/src/window.c index 4792e3bbea8..b3c5d276f97 100644 --- a/src/window.c +++ b/src/window.c @@ -1969,6 +1969,9 @@ unshow_buffer (register struct window *w) is actually stored in that buffer, and the window's pointm isn't used. So don't clobber point in that buffer. */ if (! EQ (buf, XWINDOW (selected_window)->buffer) + /* Don't clobber point in current buffer either (this could be + useful in connection with bug#12208). + && XBUFFER (buf) != current_buffer */ /* This line helps to fix Horsley's testbug.el bug. */ && !(WINDOWP (BVAR (b, last_selected_window)) && w != XWINDOW (BVAR (b, last_selected_window)) @@ -3135,7 +3138,7 @@ run_window_configuration_change_hook (struct frame *f) DEFUN ("run-window-configuration-change-hook", Frun_window_configuration_change_hook, Srun_window_configuration_change_hook, 1, 1, 0, doc: /* Run `window-configuration-change-hook' for FRAME. */) - (Lisp_Object frame) + (Lisp_Object frame) { CHECK_LIVE_FRAME (frame); run_window_configuration_change_hook (XFRAME (frame)); @@ -5613,6 +5616,24 @@ the return value is nil. Otherwise the value is t. */) int previous_frame_menu_bar_lines = FRAME_MENU_BAR_LINES (f); int previous_frame_tool_bar_lines = FRAME_TOOL_BAR_LINES (f); + /* Don't do this within the main loop below: This may call Lisp + code and is thus potentially unsafe while input is blocked. */ + for (k = 0; k < saved_windows->header.size; k++) + { + p = SAVED_WINDOW_N (saved_windows, k); + window = p->window; + w = XWINDOW (window); + + if (!NILP (p->buffer) + && ((!EQ (w->buffer, p->buffer) + && !NILP (BVAR (XBUFFER (p->buffer), name))) + || NILP (w->buffer) + || NILP (BVAR (XBUFFER (w->buffer), name)))) + /* Record old buffer of window when its buffer is going to + change. */ + call1 (Qrecord_window_buffer, window); + } + /* The mouse highlighting code could get screwed up if it runs during this. */ BLOCK_INPUT; @@ -5900,7 +5921,13 @@ the return value is nil. Otherwise the value is t. */) } if (!NILP (new_current_buffer)) - Fset_buffer (new_current_buffer); + { + Fset_buffer (new_current_buffer); + /* If the new current buffer doesn't appear in the selected + window, go to its old point (see bug#12208). */ + if (!EQ (XWINDOW (data->current_window)->buffer, new_current_buffer)) + Fgoto_char (make_number (old_point)); + } Vminibuf_scroll_window = data->minibuf_scroll_window; minibuf_selected_window = data->minibuf_selected_window; From 34f10d412a96624716e83cb5b007dec17c80ee89 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Mon, 27 Aug 2012 11:05:55 +0200 Subject: [PATCH 135/212] In dired-pop-to-buffer make window start at beginning of buffer (Bug#12281). * dired.el (dired-pop-to-buffer): Make window start at beginning of buffer (Bug#12281). --- lisp/ChangeLog | 5 +++++ lisp/dired.el | 2 ++ 2 files changed, 7 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 90df0479fac..25d0716ee5b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-27 Drew Adams + + * dired.el (dired-pop-to-buffer): Make window start at beginning + of buffer (Bug#12281). + 2012-08-26 Chong Yidong * window.el (special-display-regexps, special-display-frame-alist) diff --git a/lisp/dired.el b/lisp/dired.el index 6182e133726..b82b7781e39 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2950,6 +2950,8 @@ or \"* [3 files]\"." (split-window-sensibly window)))) pop-up-frames) (pop-to-buffer (get-buffer-create buf))) + ;; See Bug#12281. + (set-window-start nil (point-min)) ;; If dired-shrink-to-fit is t, make its window fit its contents. (when dired-shrink-to-fit ;; Try to not delete window when we want to display less than From 5474c384641da64d402e4d135dbf4697a60a70d3 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Mon, 27 Aug 2012 13:30:26 +0400 Subject: [PATCH 136/212] Fix spare memory change. * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE. (valid_lisp_object_p): Likewise. --- src/ChangeLog | 6 ++++++ src/alloc.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index ee0aeed86f1..2a5afcaa310 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-08-27 Dmitry Antipov + + Fix spare memory change. + * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE. + (valid_lisp_object_p): Likewise. + 2012-08-27 Martin Rudalics * window.c (Fset_window_configuration): Record any window's old diff --git a/src/alloc.c b/src/alloc.c index 315fea25ef2..36ba22cc535 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -4563,6 +4563,7 @@ mark_maybe_pointer (void *p) switch (m->type) { case MEM_TYPE_NON_LISP: + case MEM_TYPE_SPARE: /* Nothing to do; not a pointer to Lisp memory. */ break; @@ -5019,6 +5020,7 @@ valid_lisp_object_p (Lisp_Object obj) switch (m->type) { case MEM_TYPE_NON_LISP: + case MEM_TYPE_SPARE: return 0; case MEM_TYPE_BUFFER: From 22ab32ef882fb7aaf1c193d377194ed797e81e20 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Mon, 27 Aug 2012 18:51:17 +0800 Subject: [PATCH 137/212] Change sh-indent-comment to t See: http://debbugs.gnu.org/12267 --- lisp/ChangeLog | 4 ++++ lisp/progmodes/sh-script.el | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a29946a5a73..77c6a8d087c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-08-27 Leo Liu + + * progmodes/sh-script.el (sh-indent-comment): Change to t (bug#12267). + 2012-08-24 Chong Yidong * Version 24.2 released. diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 7d38df6aff6..90f9ce3a52f 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1190,7 +1190,7 @@ This value is used for the `+' and `-' symbols in an indentation variable." :group 'sh-indentation) (put 'sh-basic-offset 'safe-local-variable 'integerp) -(defcustom sh-indent-comment nil +(defcustom sh-indent-comment t "How a comment line is to be indented. nil means leave it as it is; t means indent it as a normal line, aligning it to previous non-blank @@ -1201,6 +1201,7 @@ a number means align to that column, e.g. 0 means first column." (const :tag "Indent as a normal line." t) (integer :menu-tag "Indent to this col (0 means first col)." :tag "Indent to column number.") ) + :version "24.3" :group 'sh-indentation) From 3bb213b9fcf46b0e1f97cf830c1a9e2b62c566e7 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Mon, 27 Aug 2012 19:02:23 +0800 Subject: [PATCH 138/212] * skeleton.el (skeleton-untabify): Change to nil. Fixes: debbugs:12223 --- lisp/ChangeLog | 2 ++ lisp/skeleton.el | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 77c6a8d087c..456eca53a82 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-08-27 Leo Liu + * skeleton.el (skeleton-untabify): Change to nil (bug#12223). + * progmodes/sh-script.el (sh-indent-comment): Change to t (bug#12267). 2012-08-24 Chong Yidong diff --git a/lisp/skeleton.el b/lisp/skeleton.el index 0f28d32293b..efc0a2da84d 100644 --- a/lisp/skeleton.el +++ b/lisp/skeleton.el @@ -77,7 +77,7 @@ The variables `v1' and `v2' are still set when calling this.") "Function for transforming a skeleton proxy's aliases' variable value.") (defvaralias 'skeleton-filter 'skeleton-filter-function) -(defvar skeleton-untabify t +(defvar skeleton-untabify nil ; bug#12223 "When non-nil untabifies when deleting backwards with element -ARG.") (defvar skeleton-newline-indent-rigidly nil From 806f0cc7302bd1dacfad8366f67a97e9bfbc8fc9 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Mon, 27 Aug 2012 20:33:05 +0800 Subject: [PATCH 139/212] Fix broken completion in sh-mode See: http://debbugs.gnu.org/12220 --- lisp/ChangeLog | 3 +++ lisp/progmodes/sh-script.el | 27 +++++++++------------------ 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 456eca53a82..4ef437213a0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-08-27 Leo Liu + * progmodes/sh-script.el (sh-dynamic-complete-functions): Adapt to + completion-at-point. (Bug#12220) + * skeleton.el (skeleton-untabify): Change to nil (bug#12223). * progmodes/sh-script.el (sh-indent-comment): Change to t (bug#12267). diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 90f9ce3a52f..2d0cdeaeeae 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -202,6 +202,11 @@ (require 'comint)) (require 'executable) +(autoload 'comint-completion-at-point "comint") +(autoload 'comint-filename-completion "comint") +(autoload 'shell-command-completion "shell") +(autoload 'shell-environment-variable-completion "shell") + (defvar font-lock-comment-face) (defvar font-lock-set-defaults) (defvar font-lock-string-face) @@ -469,7 +474,6 @@ This is buffer-local in every such buffer.") (define-key map "`" 'skeleton-pair-insert-maybe) (define-key map "\"" 'skeleton-pair-insert-maybe) - (define-key map [remap complete-tag] 'comint-dynamic-complete) (define-key map [remap delete-backward-char] 'backward-delete-char-untabify) (define-key map "\C-c:" 'sh-set-shell) @@ -556,9 +560,9 @@ This is buffer-local in every such buffer.") "Value to use for `skeleton-pair-default-alist' in Shell-Script mode.") (defcustom sh-dynamic-complete-functions - '(shell-dynamic-complete-environment-variable - shell-dynamic-complete-command - comint-dynamic-complete-filename) + '(shell-environment-variable-completion + shell-command-completion + comint-filename-completion) "Functions for doing TAB dynamic completion." :type '(repeat function) :group 'sh-script) @@ -1490,6 +1494,7 @@ with your script for an edit-interpret-debug cycle." (set (make-local-variable 'local-abbrev-table) sh-mode-abbrev-table) (set (make-local-variable 'comint-dynamic-complete-functions) sh-dynamic-complete-functions) + (add-hook 'completion-at-point-functions 'comint-completion-at-point nil t) ;; we can't look if previous line ended with `\' (set (make-local-variable 'comint-prompt-regexp) "^[ \t]*") (set (make-local-variable 'imenu-case-fold-search) nil) @@ -3682,20 +3687,6 @@ The document is bounded by `sh-here-document-word'." ;; various other commands -(autoload 'comint-dynamic-complete "comint" - "Dynamically perform completion at point." t) - -(autoload 'shell-dynamic-complete-command "shell" - "Dynamically complete the command at point." t) - -(autoload 'comint-dynamic-complete-filename "comint" - "Dynamically complete the filename at point." t) - -(autoload 'shell-dynamic-complete-environment-variable "shell" - "Dynamically complete the environment variable at point." t) - - - (defun sh-beginning-of-command () "Move point to successive beginnings of commands." (interactive) From f10fe38f772c29031a23ef7aa92d2de1b3675461 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 27 Aug 2012 09:19:34 -0700 Subject: [PATCH 140/212] * cmds.c, coding.c: Use bool for booleans. * cmds.c (move_point, Fself_insert_command): * coding.h (struct composition status, struct coding_system): * coding.c (detect_coding_utf_8, encode_coding_utf_8) (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule) (emacs_mule_char, decode_coding_emacs_mule) (encode_coding_emacs_mule, detect_coding_iso_2022) (decode_coding_iso_2022, encode_invocation_designation) (encode_designation_at_bol, encode_coding_iso_2022) (detect_coding_sjis, detect_coding_big5, decode_coding_sjis) (decode_coding_big5, encode_coding_sjis, encode_coding_big5) (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text) (encode_coding_raw_text, detect_coding_charset) (decode_coding_charset, encode_coding_charset, detect_eol) (detect_coding, get_translation_table, produce_chars) (consume_chars, reused_workbuf_in_use) (make_conversion_work_buffer, code_conversion_save) (decode_coding_object, encode_coding_object) (detect_coding_system, char_encodable_p) (Funencodable_char_position, code_convert_region) (code_convert_string, code_convert_string_norecord) (Fset_coding_system_priority): * fileio.c (Finsert_file_contents): Use bool for booleans. * coding.h, lisp.h: Reflect above API changes. * coding.c: Remove unnecessary static function decls. (detect_coding): Use unsigned, not signed, to copy an unsigned field. (decode_coding, encode_coding, decode_coding_gap): Return 'void', not a boolean 'int', since callers never look at the return value. (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'. * coding.h (decoding_buffer_size, encoding_buffer_size) (emacs_mule_string_char): Remove unused extern decls. (struct iso_2022_spec, struct coding_system): Use 'unsigned int : 1' for boolean fields, since there's more than one. (struct emacs_mule_spec): Remove unused field 'full_support'. All initializations removed. * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'. --- src/ChangeLog | 42 +++++- src/charset.h | 2 +- src/cmds.c | 8 +- src/coding.c | 368 +++++++++++++++++++------------------------------- src/coding.h | 49 +++---- src/fileio.c | 3 +- src/lisp.h | 2 +- 7 files changed, 208 insertions(+), 266 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 2a5afcaa310..7be88c568e2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,46 @@ +2012-08-27 Paul Eggert + + * cmds.c, coding.c: Use bool for booleans. + * cmds.c (move_point, Fself_insert_command): + * coding.h (struct composition status, struct coding_system): + * coding.c (detect_coding_utf_8, encode_coding_utf_8) + (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule) + (emacs_mule_char, decode_coding_emacs_mule) + (encode_coding_emacs_mule, detect_coding_iso_2022) + (decode_coding_iso_2022, encode_invocation_designation) + (encode_designation_at_bol, encode_coding_iso_2022) + (detect_coding_sjis, detect_coding_big5, decode_coding_sjis) + (decode_coding_big5, encode_coding_sjis, encode_coding_big5) + (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text) + (encode_coding_raw_text, detect_coding_charset) + (decode_coding_charset, encode_coding_charset, detect_eol) + (detect_coding, get_translation_table, produce_chars) + (consume_chars, reused_workbuf_in_use) + (make_conversion_work_buffer, code_conversion_save) + (decode_coding_object, encode_coding_object) + (detect_coding_system, char_encodable_p) + (Funencodable_char_position, code_convert_region) + (code_convert_string, code_convert_string_norecord) + (Fset_coding_system_priority): + * fileio.c (Finsert_file_contents): + Use bool for booleans. + * coding.h, lisp.h: Reflect above API changes. + * coding.c: Remove unnecessary static function decls. + (detect_coding): Use unsigned, not signed, to copy an unsigned field. + (decode_coding, encode_coding, decode_coding_gap): Return 'void', + not a boolean 'int', since callers never look at the return value. + (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'. + * coding.h (decoding_buffer_size, encoding_buffer_size) + (emacs_mule_string_char): Remove unused extern decls. + (struct iso_2022_spec, struct coding_system): + Use 'unsigned int : 1' for boolean fields, since there's more than one. + (struct emacs_mule_spec): Remove unused field 'full_support'. + All initializations removed. + * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'. + 2012-08-27 Dmitry Antipov - Fix spare memory change. + Fix spare memory change (Bug#12286). * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE. (valid_lisp_object_p): Likewise. diff --git a/src/charset.h b/src/charset.h index 6e6d0ec2701..50d230489fe 100644 --- a/src/charset.h +++ b/src/charset.h @@ -496,7 +496,7 @@ extern int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL]; -/* 1 if CHARSET may contain the character C. */ +/* True if CHARSET may contain the character C. */ #define CHAR_CHARSET_P(c, charset) \ ((ASCII_CHAR_P (c) && (charset)->ascii_compatible_p) \ || ((CHARSET_UNIFIED_P (charset) \ diff --git a/src/cmds.c b/src/cmds.c index b416135ee9e..90d3cd6dced 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -47,10 +47,10 @@ DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0, return make_number (PT + XINT (n)); } -/* Add N to point; or subtract N if FORWARD is zero. N defaults to 1. +/* Add N to point; or subtract N if FORWARD is false. N defaults to 1. Validate the new location. Return nil. */ static Lisp_Object -move_point (Lisp_Object n, int forward) +move_point (Lisp_Object n, bool forward) { /* This used to just set point to point + XINT (n), and then check to see if it was within boundaries. But now that SET_PT can @@ -277,7 +277,7 @@ After insertion, the value of `auto-fill-function' is called if the At the end, it runs `post-self-insert-hook'. */) (Lisp_Object n) { - int remove_boundary = 1; + bool remove_boundary = 1; CHECK_NATNUM (n); if (!EQ (Vthis_command, KVAR (current_kboard, Vlast_command))) @@ -438,7 +438,7 @@ internal_self_insert (int c, EMACS_INT n) : UNIBYTE_TO_CHAR (XFASTINT (Fprevious_char ()))) == Sword)) { - int modiff = MODIFF; + EMACS_INT modiff = MODIFF; Lisp_Object sym; sym = call0 (Qexpand_abbrev); diff --git a/src/coding.c b/src/coding.c index 971686dc180..5bfd42c7272 100644 --- a/src/coding.c +++ b/src/coding.c @@ -147,18 +147,18 @@ STRUCT CODING_SYSTEM CODING conforms to the format of XXX, and update the members of DETECT_INFO. - Return 1 if the byte sequence conforms to XXX, otherwise return 0. + Return true if the byte sequence conforms to XXX. Below is the template of these functions. */ #if 0 -static int +static bool detect_coding_XXX (struct coding_system *coding, struct coding_detection_info *detect_info) { const unsigned char *src = coding->source; const unsigned char *src_end = coding->source + coding->src_bytes; - int multibytep = coding->src_multibyte; + bool multibytep = coding->src_multibyte; ptrdiff_t consumed_chars = 0; int found = 0; ...; @@ -212,7 +212,7 @@ decode_coding_XXXX (struct coding_system *coding) /* A buffer to produce decoded characters. */ int *charbuf = coding->charbuf + coding->charbuf_used; int *charbuf_end = coding->charbuf + coding->charbuf_size; - int multibytep = coding->src_multibyte; + bool multibytep = coding->src_multibyte; while (1) { @@ -260,7 +260,7 @@ decode_coding_XXXX (struct coding_system *coding) static void encode_coding_XXX (struct coding_system *coding) { - int multibytep = coding->dst_multibyte; + bool multibytep = coding->dst_multibyte; int *charbuf = coding->charbuf; int *charbuf_end = charbuf->charbuf + coding->charbuf_used; unsigned char *dst = coding->destination + coding->produced; @@ -651,8 +651,8 @@ static struct coding_system coding_categories[coding_category_max]; /* Safely get one byte from the source text pointed by SRC which ends at SRC_END, and set C to that byte. If there are not enough bytes - in the source, it jumps to `no_more_source'. If multibytep is - nonzero, and a multibyte character is found at SRC, set C to the + in the source, it jumps to 'no_more_source'. If MULTIBYTEP, + and a multibyte character is found at SRC, set C to the negative value of the character code. The caller should declare and set these variables appropriately in advance: src, src_end, multibytep */ @@ -685,7 +685,7 @@ static struct coding_system coding_categories[coding_category_max]; /* Safely get two bytes from the source text pointed by SRC which ends at SRC_END, and set C1 and C2 to those bytes while skipping the heading multibyte characters. If there are not enough bytes in the - source, it jumps to `no_more_source'. If multibytep is nonzero and + source, it jumps to 'no_more_source'. If MULTIBYTEP and a multibyte character is found for C2, set C2 to the negative value of the character code. The caller should declare and set these variables appropriately in advance: @@ -746,8 +746,8 @@ static struct coding_system coding_categories[coding_category_max]; /* Store a byte C in the place pointed by DST and increment DST to the - next free point, and increment PRODUCED_CHARS. If MULTIBYTEP is - nonzero, store in an appropriate multibyte from. The caller should + next free point, and increment PRODUCED_CHARS. If MULTIBYTEP, + store in an appropriate multibyte form. The caller should declare and set the variables `dst' and `multibytep' appropriately in advance. */ @@ -806,83 +806,6 @@ static struct coding_system coding_categories[coding_category_max]; } while (0) -/* Prototypes for static functions. */ -static void record_conversion_result (struct coding_system *coding, - enum coding_result_code result); -static int detect_coding_utf_8 (struct coding_system *, - struct coding_detection_info *info); -static void decode_coding_utf_8 (struct coding_system *); -static int encode_coding_utf_8 (struct coding_system *); - -static int detect_coding_utf_16 (struct coding_system *, - struct coding_detection_info *info); -static void decode_coding_utf_16 (struct coding_system *); -static int encode_coding_utf_16 (struct coding_system *); - -static int detect_coding_iso_2022 (struct coding_system *, - struct coding_detection_info *info); -static void decode_coding_iso_2022 (struct coding_system *); -static int encode_coding_iso_2022 (struct coding_system *); - -static int detect_coding_emacs_mule (struct coding_system *, - struct coding_detection_info *info); -static void decode_coding_emacs_mule (struct coding_system *); -static int encode_coding_emacs_mule (struct coding_system *); - -static int detect_coding_sjis (struct coding_system *, - struct coding_detection_info *info); -static void decode_coding_sjis (struct coding_system *); -static int encode_coding_sjis (struct coding_system *); - -static int detect_coding_big5 (struct coding_system *, - struct coding_detection_info *info); -static void decode_coding_big5 (struct coding_system *); -static int encode_coding_big5 (struct coding_system *); - -static int detect_coding_ccl (struct coding_system *, - struct coding_detection_info *info); -static void decode_coding_ccl (struct coding_system *); -static int encode_coding_ccl (struct coding_system *); - -static void decode_coding_raw_text (struct coding_system *); -static int encode_coding_raw_text (struct coding_system *); - -static void coding_set_source (struct coding_system *); -static ptrdiff_t coding_change_source (struct coding_system *); -static void coding_set_destination (struct coding_system *); -static ptrdiff_t coding_change_destination (struct coding_system *); -static void coding_alloc_by_realloc (struct coding_system *, ptrdiff_t); -static void coding_alloc_by_making_gap (struct coding_system *, - ptrdiff_t, ptrdiff_t); -static unsigned char *alloc_destination (struct coding_system *, - ptrdiff_t, unsigned char *); -static void setup_iso_safe_charsets (Lisp_Object); -static ptrdiff_t encode_designation_at_bol (struct coding_system *, - int *, int *, unsigned char *); -static int detect_eol (const unsigned char *, - ptrdiff_t, enum coding_category); -static Lisp_Object adjust_coding_eol_type (struct coding_system *, int); -static void decode_eol (struct coding_system *); -static Lisp_Object get_translation_table (Lisp_Object, int, int *); -static Lisp_Object get_translation (Lisp_Object, int *, int *); -static int produce_chars (struct coding_system *, Lisp_Object, int); -static inline void produce_charset (struct coding_system *, int *, - ptrdiff_t); -static void produce_annotation (struct coding_system *, ptrdiff_t); -static int decode_coding (struct coding_system *); -static inline int *handle_composition_annotation (ptrdiff_t, ptrdiff_t, - struct coding_system *, - int *, ptrdiff_t *); -static inline int *handle_charset_annotation (ptrdiff_t, ptrdiff_t, - struct coding_system *, - int *, ptrdiff_t *); -static void consume_chars (struct coding_system *, Lisp_Object, int); -static int encode_coding (struct coding_system *); -static Lisp_Object make_conversion_work_buffer (int); -static Lisp_Object code_conversion_restore (Lisp_Object); -static inline int char_encodable_p (int, Lisp_Object); -static Lisp_Object make_subsidiaries (Lisp_Object); - static void record_conversion_result (struct coding_system *coding, enum coding_result_code result) @@ -1264,8 +1187,7 @@ alloc_destination (struct coding_system *coding, ptrdiff_t nbytes, /*** 3. UTF-8 ***/ /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". - Check if a text is encoded in UTF-8. If it is, return 1, else - return 0. */ + Return true if a text is encoded in UTF-8. */ #define UTF_8_1_OCTET_P(c) ((c) < 0x80) #define UTF_8_EXTRA_OCTET_P(c) (((c) & 0xC0) == 0x80) @@ -1278,16 +1200,16 @@ alloc_destination (struct coding_system *coding, ptrdiff_t nbytes, #define UTF_8_BOM_2 0xBB #define UTF_8_BOM_3 0xBF -static int +static bool detect_coding_utf_8 (struct coding_system *coding, struct coding_detection_info *detect_info) { const unsigned char *src = coding->source, *src_base; const unsigned char *src_end = coding->source + coding->src_bytes; - int multibytep = coding->src_multibyte; + bool multibytep = coding->src_multibyte; ptrdiff_t consumed_chars = 0; - int bom_found = 0; - int found = 0; + bool bom_found = 0; + bool found = 0; detect_info->checked |= CATEGORY_MASK_UTF_8; /* A coding system of this category is always ASCII compatible. */ @@ -1371,10 +1293,10 @@ decode_coding_utf_8 (struct coding_system *coding) int *charbuf = coding->charbuf + coding->charbuf_used; int *charbuf_end = coding->charbuf + coding->charbuf_size; ptrdiff_t consumed_chars = 0, consumed_chars_base = 0; - int multibytep = coding->src_multibyte; + bool multibytep = coding->src_multibyte; enum utf_bom_type bom = CODING_UTF_8_BOM (coding); - int eol_dos = - !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); + bool eol_dos + = !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); int byte_after_cr = -1; if (bom != utf_without_bom) @@ -1513,10 +1435,10 @@ decode_coding_utf_8 (struct coding_system *coding) } -static int +static bool encode_coding_utf_8 (struct coding_system *coding) { - int multibytep = coding->dst_multibyte; + bool multibytep = coding->dst_multibyte; int *charbuf = coding->charbuf; int *charbuf_end = charbuf + coding->charbuf_used; unsigned char *dst = coding->destination + coding->produced; @@ -1577,8 +1499,7 @@ encode_coding_utf_8 (struct coding_system *coding) /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". - Check if a text is encoded in one of UTF-16 based coding systems. - If it is, return 1, else return 0. */ + Return true if a text is encoded in one of UTF-16 based coding systems. */ #define UTF_16_HIGH_SURROGATE_P(val) \ (((val) & 0xFC00) == 0xD800) @@ -1587,13 +1508,13 @@ encode_coding_utf_8 (struct coding_system *coding) (((val) & 0xFC00) == 0xDC00) -static int +static bool detect_coding_utf_16 (struct coding_system *coding, struct coding_detection_info *detect_info) { const unsigned char *src = coding->source; const unsigned char *src_end = coding->source + coding->src_bytes; - int multibytep = coding->src_multibyte; + bool multibytep = coding->src_multibyte; int c1, c2; detect_info->checked |= CATEGORY_MASK_UTF_16; @@ -1680,12 +1601,12 @@ decode_coding_utf_16 (struct coding_system *coding) /* We may produces at most 3 chars in one loop. */ int *charbuf_end = coding->charbuf + coding->charbuf_size - 2; ptrdiff_t consumed_chars = 0, consumed_chars_base = 0; - int multibytep = coding->src_multibyte; + bool multibytep = coding->src_multibyte; enum utf_bom_type bom = CODING_UTF_16_BOM (coding); enum utf_16_endian_type endian = CODING_UTF_16_ENDIAN (coding); int surrogate = CODING_UTF_16_SURROGATE (coding); - int eol_dos = - !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); + bool eol_dos + = !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); int byte_after_cr1 = -1, byte_after_cr2 = -1; if (bom == utf_with_bom) @@ -1795,17 +1716,17 @@ decode_coding_utf_16 (struct coding_system *coding) coding->charbuf_used = charbuf - coding->charbuf; } -static int +static bool encode_coding_utf_16 (struct coding_system *coding) { - int multibytep = coding->dst_multibyte; + bool multibytep = coding->dst_multibyte; int *charbuf = coding->charbuf; int *charbuf_end = charbuf + coding->charbuf_used; unsigned char *dst = coding->destination + coding->produced; unsigned char *dst_end = coding->destination + coding->dst_bytes; int safe_room = 8; enum utf_bom_type bom = CODING_UTF_16_BOM (coding); - int big_endian = CODING_UTF_16_ENDIAN (coding) == utf_16_big_endian; + bool big_endian = CODING_UTF_16_ENDIAN (coding) == utf_16_big_endian; ptrdiff_t produced_chars = 0; int c; @@ -1930,16 +1851,15 @@ char emacs_mule_bytes[256]; /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". - Check if a text is encoded in `emacs-mule'. If it is, return 1, - else return 0. */ + Return true if a text is encoded in 'emacs-mule'. */ -static int +static bool detect_coding_emacs_mule (struct coding_system *coding, struct coding_detection_info *detect_info) { const unsigned char *src = coding->source, *src_base; const unsigned char *src_end = coding->source + coding->src_bytes; - int multibytep = coding->src_multibyte; + bool multibytep = coding->src_multibyte; ptrdiff_t consumed_chars = 0; int c; int found = 0; @@ -2029,12 +1949,12 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src, { const unsigned char *src_end = coding->source + coding->src_bytes; const unsigned char *src_base = src; - int multibytep = coding->src_multibyte; + bool multibytep = coding->src_multibyte; int charset_ID; unsigned code; int c; int consumed_chars = 0; - int mseq_found = 0; + bool mseq_found = 0; ONE_MORE_BYTE (c); if (c < 0) @@ -2411,12 +2331,12 @@ decode_coding_emacs_mule (struct coding_system *coding) /* We can produce up to 2 characters in a loop. */ - 1; ptrdiff_t consumed_chars = 0, consumed_chars_base; - int multibytep = coding->src_multibyte; + bool multibytep = coding->src_multibyte; ptrdiff_t char_offset = coding->produced_char; ptrdiff_t last_offset = char_offset; int last_id = charset_ascii; - int eol_dos = - !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); + bool eol_dos + = !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); int byte_after_cr = -1; struct composition_status *cmp_status = &coding->spec.emacs_mule.cmp_status; @@ -2657,10 +2577,10 @@ decode_coding_emacs_mule (struct coding_system *coding) } while (0); -static int +static bool encode_coding_emacs_mule (struct coding_system *coding) { - int multibytep = coding->dst_multibyte; + bool multibytep = coding->dst_multibyte; int *charbuf = coding->charbuf; int *charbuf_end = charbuf + coding->charbuf_used; unsigned char *dst = coding->destination + coding->produced; @@ -2722,7 +2642,7 @@ encode_coding_emacs_mule (struct coding_system *coding) if (preferred_charset_id >= 0) { - int result; + bool result; charset = CHARSET_FROM_ID (preferred_charset_id); CODING_CHAR_CHARSET_P (coding, dst, dst_end, c, charset, result); @@ -3017,17 +2937,17 @@ setup_iso_safe_charsets (Lisp_Object attrs) /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". - Check if a text is encoded in one of ISO-2022 based coding systems. - If it is, return 1, else return 0. */ + Return true if a text is encoded in one of ISO-2022 based coding + systems. */ -static int +static bool detect_coding_iso_2022 (struct coding_system *coding, struct coding_detection_info *detect_info) { const unsigned char *src = coding->source, *src_base = src; const unsigned char *src_end = coding->source + coding->src_bytes; - int multibytep = coding->src_multibyte; - int single_shifting = 0; + bool multibytep = coding->src_multibyte; + bool single_shifting = 0; int id; int c, c1; ptrdiff_t consumed_chars = 0; @@ -3390,8 +3310,6 @@ detect_coding_iso_2022 (struct coding_system *coding, /* Finish the current composition as invalid. */ -static int finish_composition (int *, struct composition_status *); - static int finish_composition (int *charbuf, struct composition_status *cmp_status) { @@ -3541,7 +3459,7 @@ decode_coding_iso_2022 (struct coding_system *coding) int *charbuf_end = coding->charbuf + coding->charbuf_size - (MAX_ANNOTATION_LENGTH * 3); ptrdiff_t consumed_chars = 0, consumed_chars_base; - int multibytep = coding->src_multibyte; + bool multibytep = coding->src_multibyte; /* Charsets invoked to graphic plane 0 and 1 respectively. */ int charset_id_0 = CODING_ISO_INVOKED_CHARSET (coding, 0); int charset_id_1 = CODING_ISO_INVOKED_CHARSET (coding, 1); @@ -3553,8 +3471,8 @@ decode_coding_iso_2022 (struct coding_system *coding) ptrdiff_t char_offset = coding->produced_char; ptrdiff_t last_offset = char_offset; int last_id = charset_ascii; - int eol_dos = - !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); + bool eol_dos + = !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); int byte_after_cr = -1; int i; @@ -4282,7 +4200,7 @@ encode_invocation_designation (struct charset *charset, struct coding_system *coding, unsigned char *dst, ptrdiff_t *p_nchars) { - int multibytep = coding->dst_multibyte; + bool multibytep = coding->dst_multibyte; ptrdiff_t produced_chars = *p_nchars; int reg; /* graphic register number */ int id = CHARSET_ID (charset); @@ -4380,7 +4298,7 @@ encode_designation_at_bol (struct coding_system *coding, int r[4]; int c, found = 0, reg; ptrdiff_t produced_chars = 0; - int multibytep = coding->dst_multibyte; + bool multibytep = coding->dst_multibyte; Lisp_Object attrs; Lisp_Object charset_list; @@ -4422,21 +4340,21 @@ encode_designation_at_bol (struct coding_system *coding, /* See the above "GENERAL NOTES on `encode_coding_XXX ()' functions". */ -static int +static bool encode_coding_iso_2022 (struct coding_system *coding) { - int multibytep = coding->dst_multibyte; + bool multibytep = coding->dst_multibyte; int *charbuf = coding->charbuf; int *charbuf_end = charbuf + coding->charbuf_used; unsigned char *dst = coding->destination + coding->produced; unsigned char *dst_end = coding->destination + coding->dst_bytes; int safe_room = 16; - int bol_designation + bool bol_designation = (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_DESIGNATE_AT_BOL && CODING_ISO_BOL (coding)); ptrdiff_t produced_chars = 0; Lisp_Object attrs, eol_type, charset_list; - int ascii_compatible; + bool ascii_compatible; int c; int preferred_charset_id = -1; @@ -4523,8 +4441,9 @@ encode_coding_iso_2022 (struct coding_system *coding) CODING_ISO_DESIGNATION (coding, i) = CODING_ISO_INITIAL (coding, i); } - bol_designation - = CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_DESIGNATE_AT_BOL; + bol_designation = ((CODING_ISO_FLAGS (coding) + & CODING_ISO_FLAG_DESIGNATE_AT_BOL) + != 0); } else if (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_RESET_AT_CNTL) ENCODE_RESET_PLANE_AND_REGISTER (); @@ -4551,7 +4470,7 @@ encode_coding_iso_2022 (struct coding_system *coding) if (preferred_charset_id >= 0) { - int result; + bool result; charset = CHARSET_FROM_ID (preferred_charset_id); CODING_CHAR_CHARSET_P (coding, dst, dst_end, c, charset, result); @@ -4631,16 +4550,15 @@ encode_coding_iso_2022 (struct coding_system *coding) */ /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". - Check if a text is encoded in SJIS. If it is, return - CATEGORY_MASK_SJIS, else return 0. */ + Return true if a text is encoded in SJIS. */ -static int +static bool detect_coding_sjis (struct coding_system *coding, struct coding_detection_info *detect_info) { const unsigned char *src = coding->source, *src_base; const unsigned char *src_end = coding->source + coding->src_bytes; - int multibytep = coding->src_multibyte; + bool multibytep = coding->src_multibyte; ptrdiff_t consumed_chars = 0; int found = 0; int c; @@ -4688,16 +4606,15 @@ detect_coding_sjis (struct coding_system *coding, } /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". - Check if a text is encoded in BIG5. If it is, return - CATEGORY_MASK_BIG5, else return 0. */ + Return true if a text is encoded in BIG5. */ -static int +static bool detect_coding_big5 (struct coding_system *coding, struct coding_detection_info *detect_info) { const unsigned char *src = coding->source, *src_base; const unsigned char *src_end = coding->source + coding->src_bytes; - int multibytep = coding->src_multibyte; + bool multibytep = coding->src_multibyte; ptrdiff_t consumed_chars = 0; int found = 0; int c; @@ -4735,8 +4652,7 @@ detect_coding_big5 (struct coding_system *coding, return 1; } -/* See the above "GENERAL NOTES on `decode_coding_XXX ()' functions". - If SJIS_P is 1, decode SJIS text, else decode BIG5 test. */ +/* See the above "GENERAL NOTES on `decode_coding_XXX ()' functions". */ static void decode_coding_sjis (struct coding_system *coding) @@ -4750,15 +4666,15 @@ decode_coding_sjis (struct coding_system *coding) int *charbuf_end = coding->charbuf + coding->charbuf_size - (MAX_ANNOTATION_LENGTH * 2); ptrdiff_t consumed_chars = 0, consumed_chars_base; - int multibytep = coding->src_multibyte; + bool multibytep = coding->src_multibyte; struct charset *charset_roman, *charset_kanji, *charset_kana; struct charset *charset_kanji2; Lisp_Object attrs, charset_list, val; ptrdiff_t char_offset = coding->produced_char; ptrdiff_t last_offset = char_offset; int last_id = charset_ascii; - int eol_dos = - !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); + bool eol_dos + = !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); int byte_after_cr = -1; CODING_GET_INFO (coding, attrs, charset_list); @@ -4868,14 +4784,14 @@ decode_coding_big5 (struct coding_system *coding) int *charbuf_end = coding->charbuf + coding->charbuf_size - (MAX_ANNOTATION_LENGTH * 2); ptrdiff_t consumed_chars = 0, consumed_chars_base; - int multibytep = coding->src_multibyte; + bool multibytep = coding->src_multibyte; struct charset *charset_roman, *charset_big5; Lisp_Object attrs, charset_list, val; ptrdiff_t char_offset = coding->produced_char; ptrdiff_t last_offset = char_offset; int last_id = charset_ascii; - int eol_dos = - !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); + bool eol_dos + = !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); int byte_after_cr = -1; CODING_GET_INFO (coding, attrs, charset_list); @@ -4957,13 +4873,12 @@ decode_coding_big5 (struct coding_system *coding) `japanese-jisx0208', `chinese-big5-1', and `chinese-big5-2'. We are sure that all these charsets are registered as official charset (i.e. do not have extended leading-codes). Characters of other - charsets are produced without any encoding. If SJIS_P is 1, encode - SJIS text, else encode BIG5 text. */ + charsets are produced without any encoding. */ -static int +static bool encode_coding_sjis (struct coding_system *coding) { - int multibytep = coding->dst_multibyte; + bool multibytep = coding->dst_multibyte; int *charbuf = coding->charbuf; int *charbuf_end = charbuf + coding->charbuf_used; unsigned char *dst = coding->destination + coding->produced; @@ -4971,7 +4886,7 @@ encode_coding_sjis (struct coding_system *coding) int safe_room = 4; ptrdiff_t produced_chars = 0; Lisp_Object attrs, charset_list, val; - int ascii_compatible; + bool ascii_compatible; struct charset *charset_kanji, *charset_kana; struct charset *charset_kanji2; int c; @@ -5054,10 +4969,10 @@ encode_coding_sjis (struct coding_system *coding) return 0; } -static int +static bool encode_coding_big5 (struct coding_system *coding) { - int multibytep = coding->dst_multibyte; + bool multibytep = coding->dst_multibyte; int *charbuf = coding->charbuf; int *charbuf_end = charbuf + coding->charbuf_used; unsigned char *dst = coding->destination + coding->produced; @@ -5065,7 +4980,7 @@ encode_coding_big5 (struct coding_system *coding) int safe_room = 4; ptrdiff_t produced_chars = 0; Lisp_Object attrs, charset_list, val; - int ascii_compatible; + bool ascii_compatible; struct charset *charset_big5; int c; @@ -5130,17 +5045,16 @@ encode_coding_big5 (struct coding_system *coding) /*** 10. CCL handlers ***/ /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". - Check if a text is encoded in a coding system of which - encoder/decoder are written in CCL program. If it is, return - CATEGORY_MASK_CCL, else return 0. */ + Return true if a text is encoded in a coding system of which + encoder/decoder are written in CCL program. */ -static int +static bool detect_coding_ccl (struct coding_system *coding, struct coding_detection_info *detect_info) { const unsigned char *src = coding->source, *src_base; const unsigned char *src_end = coding->source + coding->src_bytes; - int multibytep = coding->src_multibyte; + bool multibytep = coding->src_multibyte; ptrdiff_t consumed_chars = 0; int found = 0; unsigned char *valids; @@ -5182,7 +5096,7 @@ decode_coding_ccl (struct coding_system *coding) int *charbuf = coding->charbuf + coding->charbuf_used; int *charbuf_end = coding->charbuf + coding->charbuf_size; ptrdiff_t consumed_chars = 0; - int multibytep = coding->src_multibyte; + bool multibytep = coding->src_multibyte; struct ccl_program *ccl = &coding->spec.ccl->ccl; int source_charbuf[1024]; int source_byteidx[1025]; @@ -5243,11 +5157,11 @@ decode_coding_ccl (struct coding_system *coding) coding->charbuf_used = charbuf - coding->charbuf; } -static int +static bool encode_coding_ccl (struct coding_system *coding) { struct ccl_program *ccl = &coding->spec.ccl->ccl; - int multibytep = coding->dst_multibyte; + bool multibytep = coding->dst_multibyte; int *charbuf = coding->charbuf; int *charbuf_end = charbuf + coding->charbuf_used; unsigned char *dst = coding->destination + coding->produced; @@ -5308,7 +5222,6 @@ encode_coding_ccl (struct coding_system *coding) return 0; } - /*** 10, 11. no-conversion handlers ***/ @@ -5317,8 +5230,8 @@ encode_coding_ccl (struct coding_system *coding) static void decode_coding_raw_text (struct coding_system *coding) { - int eol_dos = - !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); + bool eol_dos + = !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); coding->chars_at_source = 1; coding->consumed_char = coding->src_chars; @@ -5333,10 +5246,10 @@ decode_coding_raw_text (struct coding_system *coding) record_conversion_result (coding, CODING_RESULT_SUCCESS); } -static int +static bool encode_coding_raw_text (struct coding_system *coding) { - int multibytep = coding->dst_multibyte; + bool multibytep = coding->dst_multibyte; int *charbuf = coding->charbuf; int *charbuf_end = coding->charbuf + coding->charbuf_used; unsigned char *dst = coding->destination + coding->produced; @@ -5414,21 +5327,20 @@ encode_coding_raw_text (struct coding_system *coding) } /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". - Check if a text is encoded in a charset-based coding system. If it - is, return 1, else return 0. */ + Return true if a text is encoded in a charset-based coding system. */ -static int +static bool detect_coding_charset (struct coding_system *coding, struct coding_detection_info *detect_info) { const unsigned char *src = coding->source, *src_base; const unsigned char *src_end = coding->source + coding->src_bytes; - int multibytep = coding->src_multibyte; + bool multibytep = coding->src_multibyte; ptrdiff_t consumed_chars = 0; Lisp_Object attrs, valids, name; int found = 0; ptrdiff_t head_ascii = coding->head_ascii; - int check_latin_extra = 0; + bool check_latin_extra = 0; detect_info->checked |= CATEGORY_MASK_CHARSET; @@ -5532,14 +5444,14 @@ decode_coding_charset (struct coding_system *coding) int *charbuf_end = coding->charbuf + coding->charbuf_size - (MAX_ANNOTATION_LENGTH * 2); ptrdiff_t consumed_chars = 0, consumed_chars_base; - int multibytep = coding->src_multibyte; + bool multibytep = coding->src_multibyte; Lisp_Object attrs = CODING_ID_ATTRS (coding->id); Lisp_Object valids; ptrdiff_t char_offset = coding->produced_char; ptrdiff_t last_offset = char_offset; int last_id = charset_ascii; - int eol_dos = - !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); + bool eol_dos + = !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); int byte_after_cr = -1; valids = AREF (attrs, coding_attr_charset_valids); @@ -5648,10 +5560,10 @@ decode_coding_charset (struct coding_system *coding) coding->charbuf_used = charbuf - coding->charbuf; } -static int +static bool encode_coding_charset (struct coding_system *coding) { - int multibytep = coding->dst_multibyte; + bool multibytep = coding->dst_multibyte; int *charbuf = coding->charbuf; int *charbuf_end = charbuf + coding->charbuf_used; unsigned char *dst = coding->destination + coding->produced; @@ -5659,7 +5571,7 @@ encode_coding_charset (struct coding_system *coding) int safe_room = MAX_MULTIBYTE_LENGTH; ptrdiff_t produced_chars = 0; Lisp_Object attrs, charset_list; - int ascii_compatible; + bool ascii_compatible; int c; CODING_GET_INFO (coding, attrs, charset_list); @@ -5865,7 +5777,6 @@ setup_coding_system (Lisp_Object coding_system, struct coding_system *coding) coding->encoder = encode_coding_emacs_mule; coding->common_flags |= (CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK); - coding->spec.emacs_mule.full_support = 1; if (! NILP (AREF (attrs, coding_attr_emacs_mule_full)) && ! EQ (CODING_ATTR_CHARSET_LIST (attrs), Vemacs_mule_charset_list)) { @@ -5883,7 +5794,6 @@ setup_coding_system (Lisp_Object coding_system, struct coding_system *coding) SSET (safe_charsets, XFASTINT (XCAR (tail)), 0); coding->max_charset_id = max_charset_id; coding->safe_charsets = SDATA (safe_charsets); - coding->spec.emacs_mule.full_support = 1; } coding->spec.emacs_mule.cmp_status.state = COMPOSING_NO; coding->spec.emacs_mule.cmp_status.method = COMPOSITION_NO; @@ -6216,11 +6126,9 @@ detect_eol (const unsigned char *source, ptrdiff_t src_bytes, if ((1 << category) & CATEGORY_MASK_UTF_16) { - int msb, lsb; - - msb = category == (coding_category_utf_16_le - | coding_category_utf_16_le_nosig); - lsb = 1 - msb; + bool msb = category == (coding_category_utf_16_le + | coding_category_utf_16_le_nosig); + bool lsb = !msb; while (src + 1 < src_end) { @@ -6335,7 +6243,7 @@ static void detect_coding (struct coding_system *coding) { const unsigned char *src, *src_end; - int saved_mode = coding->mode; + unsigned int saved_mode = coding->mode; coding->consumed = coding->consumed_char = 0; coding->produced = coding->produced_char = 0; @@ -6350,7 +6258,7 @@ detect_coding (struct coding_system *coding) { int c, i; struct coding_detection_info detect_info; - int null_byte_found = 0, eight_bit_found = 0; + bool null_byte_found = 0, eight_bit_found = 0; detect_info.checked = detect_info.found = detect_info.rejected = 0; for (src = coding->source; src < src_end; src++) @@ -6609,11 +6517,11 @@ decode_eol (struct coding_system *coding) /* Return a translation table (or list of them) from coding system - attribute vector ATTRS for encoding (ENCODEP is nonzero) or - decoding (ENCODEP is zero). */ + attribute vector ATTRS for encoding (if ENCODEP) or decoding (if + not ENCODEP). */ static Lisp_Object -get_translation_table (Lisp_Object attrs, int encodep, int *max_lookup) +get_translation_table (Lisp_Object attrs, bool encodep, int *max_lookup) { Lisp_Object standard, translation_table; Lisp_Object val; @@ -6743,7 +6651,7 @@ get_translation (Lisp_Object trans, int *buf, int *buf_end) static int produce_chars (struct coding_system *coding, Lisp_Object translation_table, - int last_block) + bool last_block) { unsigned char *dst = coding->destination + coding->produced; unsigned char *dst_end = coding->destination + coding->dst_bytes; @@ -6846,7 +6754,7 @@ produce_chars (struct coding_system *coding, Lisp_Object translation_table, { if (coding->src_multibyte) { - int multibytep = 1; + bool multibytep = 1; ptrdiff_t consumed_chars = 0; while (1) @@ -6882,7 +6790,7 @@ produce_chars (struct coding_system *coding, Lisp_Object translation_table, else while (src < src_end) { - int multibytep = 1; + bool multibytep = 1; int c = *src++; if (dst >= dst_end - 1) @@ -7018,7 +6926,7 @@ produce_charset (struct coding_system *coding, int *charbuf, ptrdiff_t pos) if (! coding->charbuf) \ { \ record_conversion_result (coding, CODING_RESULT_INSUFFICIENT_MEM); \ - return coding->result; \ + return; \ } \ coding->charbuf_size = size; \ } while (0) @@ -7079,7 +6987,7 @@ produce_annotation (struct coding_system *coding, ptrdiff_t pos) CODING->dst_object. */ -static int +static void decode_coding (struct coding_system *coding) { Lisp_Object attrs; @@ -7212,7 +7120,6 @@ decode_coding (struct coding_system *coding) bset_undo_list (current_buffer, undo_list); record_insert (coding->dst_pos, coding->produced_char); } - return coding->result; } @@ -7341,7 +7248,7 @@ consume_chars (struct coding_system *coding, Lisp_Object translation_table, const unsigned char *src_end = coding->source + coding->src_bytes; ptrdiff_t pos = coding->src_pos + coding->consumed_char; ptrdiff_t end_pos = coding->src_pos + coding->src_chars; - int multibytep = coding->src_multibyte; + bool multibytep = coding->src_multibyte; Lisp_Object eol_type; int c; ptrdiff_t stop, stop_composition, stop_charset; @@ -7488,7 +7395,7 @@ consume_chars (struct coding_system *coding, Lisp_Object translation_table, If CODING->dst_object is nil, the encoded data is placed at the memory area specified by CODING->destination. */ -static int +static void encode_coding (struct coding_system *coding) { Lisp_Object attrs; @@ -7530,8 +7437,6 @@ encode_coding (struct coding_system *coding) if (BUFFERP (coding->dst_object) && coding->produced_char > 0) insert_from_gap (coding->produced_char, coding->produced); - - return (coding->result); } @@ -7545,26 +7450,27 @@ static Lisp_Object Vcode_conversion_workbuf_name; versions of Vcode_conversion_workbuf_name. */ static Lisp_Object Vcode_conversion_reused_workbuf; -/* 1 iff Vcode_conversion_reused_workbuf is already in use. */ -static int reused_workbuf_in_use; +/* True iff Vcode_conversion_reused_workbuf is already in use. */ +static bool reused_workbuf_in_use; /* Return a working buffer of code conversion. MULTIBYTE specifies the multibyteness of returning buffer. */ static Lisp_Object -make_conversion_work_buffer (int multibyte) +make_conversion_work_buffer (bool multibyte) { Lisp_Object name, workbuf; struct buffer *current; - if (reused_workbuf_in_use++) + if (reused_workbuf_in_use) { name = Fgenerate_new_buffer_name (Vcode_conversion_workbuf_name, Qnil); workbuf = Fget_buffer_create (name); } else { + reused_workbuf_in_use = 1; if (NILP (Fbuffer_live_p (Vcode_conversion_reused_workbuf))) Vcode_conversion_reused_workbuf = Fget_buffer_create (Vcode_conversion_workbuf_name); @@ -7606,7 +7512,7 @@ code_conversion_restore (Lisp_Object arg) } Lisp_Object -code_conversion_save (int with_work_buf, int multibyte) +code_conversion_save (bool with_work_buf, bool multibyte) { Lisp_Object workbuf = Qnil; @@ -7617,7 +7523,7 @@ code_conversion_save (int with_work_buf, int multibyte) return workbuf; } -int +void decode_coding_gap (struct coding_system *coding, ptrdiff_t chars, ptrdiff_t bytes) { @@ -7660,7 +7566,6 @@ decode_coding_gap (struct coding_system *coding, } unbind_to (count, Qnil); - return coding->result; } @@ -7706,8 +7611,8 @@ decode_coding_object (struct coding_system *coding, ptrdiff_t chars = to - from; ptrdiff_t bytes = to_byte - from_byte; Lisp_Object attrs; - int saved_pt = -1, saved_pt_byte IF_LINT (= 0); - int need_marker_adjustment = 0; + ptrdiff_t saved_pt = -1, saved_pt_byte IF_LINT (= 0); + bool need_marker_adjustment = 0; Lisp_Object old_deactivate_mark; old_deactivate_mark = Vdeactivate_mark; @@ -7894,9 +7799,9 @@ encode_coding_object (struct coding_system *coding, ptrdiff_t chars = to - from; ptrdiff_t bytes = to_byte - from_byte; Lisp_Object attrs; - int saved_pt = -1, saved_pt_byte IF_LINT (= 0); - int need_marker_adjustment = 0; - int kill_src_buffer = 0; + ptrdiff_t saved_pt = -1, saved_pt_byte IF_LINT (= 0); + bool need_marker_adjustment = 0; + bool kill_src_buffer = 0; Lisp_Object old_deactivate_mark; old_deactivate_mark = Vdeactivate_mark; @@ -8172,10 +8077,10 @@ function `define-coding-system'. */) /* Detect how the bytes at SRC of length SRC_BYTES are encoded. If - HIGHEST is nonzero, return the coding system of the highest + HIGHEST, return the coding system of the highest priority among the detected coding systems. Otherwise return a list of detected coding systems sorted by their priorities. If - MULTIBYTEP is nonzero, it is assumed that the bytes are in correct + MULTIBYTEP, it is assumed that the bytes are in correct multibyte form but contains only ASCII and eight-bit chars. Otherwise, the bytes are raw bytes. @@ -8190,7 +8095,7 @@ function `define-coding-system'. */) Lisp_Object detect_coding_system (const unsigned char *src, ptrdiff_t src_chars, ptrdiff_t src_bytes, - int highest, int multibytep, + bool highest, bool multibytep, Lisp_Object coding_system) { const unsigned char *src_end = src + src_bytes; @@ -8200,7 +8105,7 @@ detect_coding_system (const unsigned char *src, ptrdiff_t id; struct coding_detection_info detect_info; enum coding_category base_category; - int null_byte_found = 0, eight_bit_found = 0; + bool null_byte_found = 0, eight_bit_found = 0; if (NILP (coding_system)) coding_system = Qundecided; @@ -8556,7 +8461,7 @@ highest priority. */) } -static inline int +static inline bool char_encodable_p (int c, Lisp_Object attrs) { Lisp_Object tail; @@ -8728,7 +8633,7 @@ to the string. */) Lisp_Object positions; ptrdiff_t from, to; const unsigned char *p, *stop, *pend; - int ascii_compatible; + bool ascii_compatible; setup_coding_system (Fcheck_coding_system (coding_system), &coding); attrs = CODING_ID_ATTRS (coding.id); @@ -8952,7 +8857,7 @@ is nil. */) static Lisp_Object code_convert_region (Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object dst_object, - int encodep, int norecord) + bool encodep, bool norecord) { struct coding_system coding; ptrdiff_t from, from_byte, to, to_byte; @@ -9040,7 +8945,8 @@ not fully specified.) */) Lisp_Object code_convert_string (Lisp_Object string, Lisp_Object coding_system, - Lisp_Object dst_object, int encodep, int nocopy, int norecord) + Lisp_Object dst_object, bool encodep, bool nocopy, + bool norecord) { struct coding_system coding; ptrdiff_t chars, bytes; @@ -9088,7 +8994,7 @@ code_convert_string (Lisp_Object string, Lisp_Object coding_system, Lisp_Object code_convert_string_norecord (Lisp_Object string, Lisp_Object coding_system, - int encodep) + bool encodep) { return code_convert_string (string, coding_system, Qt, encodep, 0, 1); } @@ -9489,7 +9395,7 @@ usage: (set-coding-system-priority &rest coding-systems) */) (ptrdiff_t nargs, Lisp_Object *args) { ptrdiff_t i, j; - int changed[coding_category_max]; + bool changed[coding_category_max]; enum coding_category priorities[coding_category_max]; memset (changed, 0, sizeof changed); diff --git a/src/coding.h b/src/coding.h index 2987f19607b..c45d2ef86e2 100644 --- a/src/coding.h +++ b/src/coding.h @@ -321,7 +321,7 @@ struct composition_status { enum composition_state state; enum composition_method method; - int old_form; /* 0:pre-21 form, 1:post-21 form */ + bool old_form; /* true if pre-21 form */ int length; /* number of elements produced in charbuf */ int nchars; /* number of characters composed */ int ncomps; /* number of composition components */ @@ -350,18 +350,18 @@ struct iso_2022_spec there was an invalid designation previously. */ int current_designation[4]; - /* Set to 1 temporarily only when graphic register 2 or 3 is invoked - by single-shift while encoding. */ - int single_shifting; - - /* Set to 1 temporarily only when processing at beginning of line. */ - int bol; - /* If positive, we are now scanning CTEXT extended segment. */ int ctext_extended_segment_len; - /* If nonzero, we are now scanning embedded UTF-8 sequence. */ - int embedded_utf_8; + /* True temporarily only when graphic register 2 or 3 is invoked by + single-shift while encoding. */ + unsigned single_shifting : 1; + + /* True temporarily only when processing at beginning of line. */ + unsigned bol : 1; + + /* If true, we are now scanning embedded UTF-8 sequence. */ + unsigned embedded_utf_8 : 1; /* The current composition. */ struct composition_status cmp_status; @@ -369,7 +369,6 @@ struct iso_2022_spec struct emacs_mule_spec { - int full_support; struct composition_status cmp_status; }; @@ -470,10 +469,6 @@ struct coding_system Lisp_Object dst_object; unsigned char *destination; - /* Set to 1 if the source of conversion is not in the member - `charbuf', but at `src_object'. */ - int chars_at_source; - /* If an element is non-negative, it is a character code. If it is in the range -128..-1, it is a 8-bit character code @@ -489,18 +484,21 @@ struct coding_system int *charbuf; int charbuf_size, charbuf_used; + /* True if the source of conversion is not in the member + `charbuf', but at `src_object'. */ + unsigned chars_at_source : 1; + /* Set to 1 if charbuf contains an annotation. */ - int annotated; + unsigned annotated : 1; unsigned char carryover[64]; int carryover_bytes; int default_char; - int (*detector) (struct coding_system *, - struct coding_detection_info *); + bool (*detector) (struct coding_system *, struct coding_detection_info *); void (*decoder) (struct coding_system *); - int (*encoder) (struct coding_system *); + bool (*encoder) (struct coding_system *); }; /* Meanings of bits in the member `common_flags' of the structure @@ -688,22 +686,20 @@ struct coding_system #define ENCODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, 1) /* Extern declarations. */ -extern Lisp_Object code_conversion_save (int, int); -extern int decoding_buffer_size (struct coding_system *, int); -extern int encoding_buffer_size (struct coding_system *, int); +extern Lisp_Object code_conversion_save (bool, bool); extern void setup_coding_system (Lisp_Object, struct coding_system *); extern Lisp_Object coding_charset_list (struct coding_system *); extern Lisp_Object coding_system_charset_list (Lisp_Object); extern Lisp_Object code_convert_string (Lisp_Object, Lisp_Object, - Lisp_Object, int, int, int); + Lisp_Object, bool, bool, bool); extern Lisp_Object code_convert_string_norecord (Lisp_Object, Lisp_Object, - int); + bool); extern Lisp_Object raw_text_coding_system (Lisp_Object); extern Lisp_Object coding_inherit_eol_type (Lisp_Object, Lisp_Object); extern Lisp_Object complement_process_encoding_system (Lisp_Object); -extern int decode_coding_gap (struct coding_system *, - ptrdiff_t, ptrdiff_t); +extern void decode_coding_gap (struct coding_system *, + ptrdiff_t, ptrdiff_t); extern void decode_coding_object (struct coding_system *, Lisp_Object, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, Lisp_Object); @@ -778,6 +774,5 @@ extern struct coding_system safe_terminal_coding; extern Lisp_Object Qcoding_system_error; extern char emacs_mule_bytes[256]; -extern int emacs_mule_string_char (unsigned char *); #endif /* EMACS_CODING_H */ diff --git a/src/fileio.c b/src/fileio.c index 6deca0bf1e1..6906af7e74f 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3760,7 +3760,8 @@ variable `last-coding-system-used' to the coding system actually used. */) ptrdiff_t temp; ptrdiff_t this = 0; ptrdiff_t this_count = SPECPDL_INDEX (); - int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); + bool multibyte + = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); Lisp_Object conversion_buffer; struct gcpro gcpro1; diff --git a/src/lisp.h b/src/lisp.h index 5b842d371a2..9ae24998aa2 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2632,7 +2632,7 @@ extern void keys_of_cmds (void); /* Defined in coding.c */ extern Lisp_Object Qcharset; extern Lisp_Object detect_coding_system (const unsigned char *, ptrdiff_t, - ptrdiff_t, int, int, Lisp_Object); + ptrdiff_t, bool, bool, Lisp_Object); extern void init_coding (void); extern void init_coding_once (void); extern void syms_of_coding (void); From de1339b0a8a5b6b8bf784c816b2b974f4610e3ac Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 27 Aug 2012 10:23:48 -0700 Subject: [PATCH 141/212] * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans. * composite.c (find_composition, composition_gstring_p) (composition_reseat_it, find_automatic_composition): * data.c (let_shadows_buffer_binding_p) (let_shadows_global_binding_p, set_internal, make_blv) (Fmake_variable_buffer_local, Fmake_local_variable) (Fmake_variable_frame_local, arithcompare, cons_to_unsigned) (cons_to_signed, arith_driver): * dbusbind.c (xd_in_read_queued_messages): * dired.c (directory_files_internal, file_name_completion): Use bool for booleans. * dired.c (file_name_completion): * process.h (fd_callback): Omit int (actually boolean) argument. It wasn't being used. All uses changed. * composite.h, lisp.h: Reflect above API changes. --- src/ChangeLog | 17 +++++++++++++++++ src/composite.c | 22 ++++++++++++---------- src/composite.h | 13 ++++++------- src/data.c | 49 ++++++++++++++++++++++++------------------------- src/dbusbind.c | 7 +++---- src/dired.c | 30 ++++++++++++++++-------------- src/lisp.h | 4 ++-- src/process.c | 16 +++++++--------- src/process.h | 2 +- src/xsmfns.c | 2 +- 10 files changed, 89 insertions(+), 73 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 7be88c568e2..15d5211efd9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,22 @@ 2012-08-27 Paul Eggert + * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans. + * composite.c (find_composition, composition_gstring_p) + (composition_reseat_it, find_automatic_composition): + * data.c (let_shadows_buffer_binding_p) + (let_shadows_global_binding_p, set_internal, make_blv) + (Fmake_variable_buffer_local, Fmake_local_variable) + (Fmake_variable_frame_local, arithcompare, cons_to_unsigned) + (cons_to_signed, arith_driver): + * dbusbind.c (xd_in_read_queued_messages): + * dired.c (directory_files_internal, file_name_completion): + Use bool for booleans. + * dired.c (file_name_completion): + * process.h (fd_callback): + Omit int (actually boolean) argument. It wasn't being used. + All uses changed. + * composite.h, lisp.h: Reflect above API changes. + * cmds.c, coding.c: Use bool for booleans. * cmds.c (move_point, Fself_insert_command): * coding.h (struct composition status, struct coding_system): diff --git a/src/composite.c b/src/composite.c index 4e90e9bb914..eddabb66d33 100644 --- a/src/composite.c +++ b/src/composite.c @@ -428,7 +428,7 @@ get_composition_id (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t nchars, This doesn't check the validity of composition. */ -int +bool find_composition (ptrdiff_t pos, ptrdiff_t limit, ptrdiff_t *start, ptrdiff_t *end, Lisp_Object *prop, Lisp_Object object) @@ -709,7 +709,7 @@ static Lisp_Object fill_gstring_header (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); -int +bool composition_gstring_p (Lisp_Object gstring) { Lisp_Object header; @@ -1212,11 +1212,13 @@ composition_compute_stop_pos (struct composition_it *cmp_it, ptrdiff_t charpos, string. In that case, FACE must not be NULL. If the character is composed, setup members of CMP_IT (id, nglyphs, - from, to, reversed_p), and return 1. Otherwise, update - CMP_IT->stop_pos, and return 0. */ + from, to, reversed_p), and return true. Otherwise, update + CMP_IT->stop_pos, and return false. */ -int -composition_reseat_it (struct composition_it *cmp_it, ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t endpos, struct window *w, struct face *face, Lisp_Object string) +bool +composition_reseat_it (struct composition_it *cmp_it, ptrdiff_t charpos, + ptrdiff_t bytepos, ptrdiff_t endpos, struct window *w, + struct face *face, Lisp_Object string) { if (endpos < 0) endpos = NILP (string) ? BEGV : 0; @@ -1482,10 +1484,10 @@ struct position_record /* This is like find_composition, but find an automatic composition instead. It is assured that POS is not within a static composition. If found, set *GSTRING to the glyph-string - representing the composition, and return 1. Otherwise, *GSTRING to - Qnil, and return 0. */ + representing the composition, and return true. Otherwise, *GSTRING to + Qnil, and return false. */ -static int +static bool find_automatic_composition (ptrdiff_t pos, ptrdiff_t limit, ptrdiff_t *start, ptrdiff_t *end, Lisp_Object *gstring, Lisp_Object string) @@ -1498,7 +1500,7 @@ find_automatic_composition (ptrdiff_t pos, ptrdiff_t limit, int c; Lisp_Object window; struct window *w; - int need_adjustment = 0; + bool need_adjustment = 0; window = Fget_buffer_window (Fcurrent_buffer (), Qnil); if (NILP (window)) diff --git a/src/composite.h b/src/composite.h index 6a7e0a5e2c7..68f5b27ee42 100644 --- a/src/composite.h +++ b/src/composite.h @@ -223,8 +223,8 @@ extern Lisp_Object Qcomposition; extern Lisp_Object composition_hash_table; extern ptrdiff_t get_composition_id (ptrdiff_t, ptrdiff_t, ptrdiff_t, Lisp_Object, Lisp_Object); -extern int find_composition (ptrdiff_t, ptrdiff_t, ptrdiff_t *, ptrdiff_t *, - Lisp_Object *, Lisp_Object); +extern bool find_composition (ptrdiff_t, ptrdiff_t, ptrdiff_t *, ptrdiff_t *, + Lisp_Object *, Lisp_Object); extern void update_compositions (ptrdiff_t, ptrdiff_t, int); extern void make_composition_value_copy (Lisp_Object); extern void compose_region (int, int, Lisp_Object, Lisp_Object, @@ -310,17 +310,16 @@ struct font_metrics; extern Lisp_Object composition_gstring_put_cache (Lisp_Object, ptrdiff_t); extern Lisp_Object composition_gstring_from_id (ptrdiff_t); -extern int composition_gstring_p (Lisp_Object); +extern bool composition_gstring_p (Lisp_Object); extern int composition_gstring_width (Lisp_Object, ptrdiff_t, ptrdiff_t, struct font_metrics *); extern void composition_compute_stop_pos (struct composition_it *, ptrdiff_t, ptrdiff_t, ptrdiff_t, Lisp_Object); -extern int composition_reseat_it (struct composition_it *, - ptrdiff_t, ptrdiff_t, ptrdiff_t, - struct window *, struct face *, - Lisp_Object); +extern bool composition_reseat_it (struct composition_it *, ptrdiff_t, + ptrdiff_t, ptrdiff_t, struct window *, + struct face *, Lisp_Object); extern int composition_update_it (struct composition_it *, ptrdiff_t, ptrdiff_t, Lisp_Object); diff --git a/src/data.c b/src/data.c index f121d8772c6..d8b7f42ea3f 100644 --- a/src/data.c +++ b/src/data.c @@ -1080,10 +1080,10 @@ DEFUN ("set", Fset, Sset, 2, 2, 0, return newval; } -/* Return 1 if SYMBOL currently has a let-binding +/* Return true if SYMBOL currently has a let-binding which was made in the buffer that is now current. */ -static int +static bool let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol) { struct specbinding *p; @@ -1102,7 +1102,7 @@ let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol) return 0; } -static int +static bool let_shadows_global_binding_p (Lisp_Object symbol) { struct specbinding *p; @@ -1118,14 +1118,15 @@ let_shadows_global_binding_p (Lisp_Object symbol) If buffer/frame-locality is an issue, WHERE specifies which context to use. (nil stands for the current buffer/frame). - If BINDFLAG is zero, then if this symbol is supposed to become + If BINDFLAG is false, then if this symbol is supposed to become local in every buffer where it is set, then we make it local. - If BINDFLAG is nonzero, we don't do that. */ + If BINDFLAG is true, we don't do that. */ void -set_internal (register Lisp_Object symbol, register Lisp_Object newval, register Lisp_Object where, int bindflag) +set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, + bool bindflag) { - int voide = EQ (newval, Qunbound); + bool voide = EQ (newval, Qunbound); struct Lisp_Symbol *sym; Lisp_Object tem1; @@ -1464,7 +1465,8 @@ union Lisp_Val_Fwd }; static struct Lisp_Buffer_Local_Value * -make_blv (struct Lisp_Symbol *sym, int forwarded, union Lisp_Val_Fwd valcontents) +make_blv (struct Lisp_Symbol *sym, bool forwarded, + union Lisp_Val_Fwd valcontents) { struct Lisp_Buffer_Local_Value *blv = xmalloc (sizeof *blv); Lisp_Object symbol; @@ -1508,7 +1510,7 @@ The function `default-value' gets the default value and `set-default' sets it. struct Lisp_Symbol *sym; struct Lisp_Buffer_Local_Value *blv = NULL; union Lisp_Val_Fwd valcontents IF_LINT (= {LISP_INITIALLY_ZERO}); - int forwarded IF_LINT (= 0); + bool forwarded IF_LINT (= 0); CHECK_SYMBOL (variable); sym = XSYMBOL (variable); @@ -1580,10 +1582,10 @@ See also `make-variable-buffer-local'. Do not use `make-local-variable' to make a hook variable buffer-local. Instead, use `add-hook' and specify t for the LOCAL argument. */) - (register Lisp_Object variable) + (Lisp_Object variable) { - register Lisp_Object tem; - int forwarded IF_LINT (= 0); + Lisp_Object tem; + bool forwarded IF_LINT (= 0); union Lisp_Val_Fwd valcontents IF_LINT (= {LISP_INITIALLY_ZERO}); struct Lisp_Symbol *sym; struct Lisp_Buffer_Local_Value *blv = NULL; @@ -1767,9 +1769,9 @@ is to set the VARIABLE frame parameter of that frame. See Note that since Emacs 23.1, variables cannot be both buffer-local and frame-local any more (buffer-local bindings used to take precedence over frame-local bindings). */) - (register Lisp_Object variable) + (Lisp_Object variable) { - int forwarded; + bool forwarded; union Lisp_Val_Fwd valcontents; struct Lisp_Symbol *sym; struct Lisp_Buffer_Local_Value *blv = NULL; @@ -2225,7 +2227,7 @@ static Lisp_Object arithcompare (Lisp_Object num1, Lisp_Object num2, enum comparison comparison) { double f1 = 0, f2 = 0; - int floatp = 0; + bool floatp = 0; CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (num1); CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (num2); @@ -2342,7 +2344,7 @@ DEFUN ("zerop", Fzerop, Szerop, 1, 1, 0, uintmax_t cons_to_unsigned (Lisp_Object c, uintmax_t max) { - int valid = 0; + bool valid = 0; uintmax_t val IF_LINT (= 0); if (INTEGERP (c)) { @@ -2395,7 +2397,7 @@ cons_to_unsigned (Lisp_Object c, uintmax_t max) intmax_t cons_to_signed (Lisp_Object c, intmax_t min, intmax_t max) { - int valid = 0; + bool valid = 0; intmax_t val IF_LINT (= 0); if (INTEGERP (c)) { @@ -2513,14 +2515,11 @@ static Lisp_Object float_arith_driver (double, ptrdiff_t, enum arithop, static Lisp_Object arith_driver (enum arithop code, ptrdiff_t nargs, Lisp_Object *args) { - register Lisp_Object val; - ptrdiff_t argnum; - register EMACS_INT accum = 0; - register EMACS_INT next; - - int overflow = 0; - ptrdiff_t ok_args; - EMACS_INT ok_accum; + Lisp_Object val; + ptrdiff_t argnum, ok_args; + EMACS_INT accum = 0; + EMACS_INT next, ok_accum; + bool overflow = 0; switch (code) { diff --git a/src/dbusbind.c b/src/dbusbind.c index f63f2948304..901820648cb 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -70,7 +70,7 @@ static Lisp_Object QCdbus_registered_signal; static Lisp_Object xd_registered_buses; /* Whether we are reading a D-Bus event. */ -static int xd_in_read_queued_messages = 0; +static bool xd_in_read_queued_messages = 0; /* We use "xd_" and "XD_" as prefix for all internal symbols, because @@ -997,8 +997,7 @@ xd_find_watch_fd (DBusWatch *watch) } /* Prototype. */ -static void -xd_read_queued_messages (int fd, void *data, int for_read); +static void xd_read_queued_messages (int fd, void *data); /* Start monitoring WATCH for possible I/O. */ static dbus_bool_t @@ -1686,7 +1685,7 @@ xd_read_message (Lisp_Object bus) /* Callback called when something is ready to read or write. */ static void -xd_read_queued_messages (int fd, void *data, int for_read) +xd_read_queued_messages (int fd, void *data) { Lisp_Object busp = xd_registered_buses; Lisp_Object bus = Qnil; diff --git a/src/dired.c b/src/dired.c index 771230717e3..206f370ed63 100644 --- a/src/dired.c +++ b/src/dired.c @@ -109,18 +109,20 @@ directory_files_internal_unwind (Lisp_Object dh) } /* Function shared by Fdirectory_files and Fdirectory_files_and_attributes. - When ATTRS is zero, return a list of directory filenames; when - non-zero, return a list of directory filenames and their attributes. + If not ATTRS, return a list of directory filenames; + if ATTRS, return a list of directory filenames and their attributes. In the latter case, ID_FORMAT is passed to Ffile_attributes. */ Lisp_Object -directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object match, Lisp_Object nosort, int attrs, Lisp_Object id_format) +directory_files_internal (Lisp_Object directory, Lisp_Object full, + Lisp_Object match, Lisp_Object nosort, bool attrs, + Lisp_Object id_format) { DIR *d; ptrdiff_t directory_nbytes; Lisp_Object list, dirfilename, encoded_directory; struct re_pattern_buffer *bufp = NULL; - int needsep = 0; + bool needsep = 0; ptrdiff_t count = SPECPDL_INDEX (); struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; DIRENTRY *dp; @@ -227,7 +229,7 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object m if (DIRENTRY_NONEMPTY (dp)) { ptrdiff_t len; - int wanted = 0; + bool wanted = 0; Lisp_Object name, finalname; struct gcpro gcpro1, gcpro2; @@ -381,9 +383,8 @@ which see. */) } -static Lisp_Object file_name_completion - (Lisp_Object file, Lisp_Object dirname, int all_flag, int ver_flag, - Lisp_Object predicate); +static Lisp_Object file_name_completion (Lisp_Object, Lisp_Object, bool, + Lisp_Object); DEFUN ("file-name-completion", Ffile_name_completion, Sfile_name_completion, 2, 3, 0, @@ -415,7 +416,7 @@ determined by the variable `completion-ignored-extensions', which see. */) if (!NILP (handler)) return call4 (handler, Qfile_name_completion, file, directory, predicate); - return file_name_completion (file, directory, 0, 0, predicate); + return file_name_completion (file, directory, 0, predicate); } DEFUN ("file-name-all-completions", Ffile_name_all_completions, @@ -439,14 +440,15 @@ These are all file names in directory DIRECTORY which begin with FILE. */) if (!NILP (handler)) return call3 (handler, Qfile_name_all_completions, file, directory); - return file_name_completion (file, directory, 1, 0, Qnil); + return file_name_completion (file, directory, 1, Qnil); } static int file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_addr); static Lisp_Object Qdefault_directory; static Lisp_Object -file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int ver_flag, Lisp_Object predicate) +file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, + Lisp_Object predicate) { DIR *d; ptrdiff_t bestmatchsize = 0; @@ -459,10 +461,10 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v Lisp_Object encoded_dir; struct stat st; int directoryp; - /* If includeall is zero, exclude files in completion-ignored-extensions as + /* If not INCLUDEALL, exclude files in completion-ignored-extensions as well as "." and "..". Until shown otherwise, assume we can't exclude anything. */ - int includeall = 1; + bool includeall = 1; ptrdiff_t count = SPECPDL_INDEX (); struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; @@ -500,7 +502,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v { DIRENTRY *dp; ptrdiff_t len; - int canexclude = 0; + bool canexclude = 0; errno = 0; dp = readdir (d); diff --git a/src/lisp.h b/src/lisp.h index 9ae24998aa2..127177e44c7 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2620,7 +2620,7 @@ extern _Noreturn void args_out_of_range_3 (Lisp_Object, Lisp_Object, Lisp_Object); extern _Noreturn Lisp_Object wrong_type_argument (Lisp_Object, Lisp_Object); extern Lisp_Object do_symval_forwarding (union Lisp_Fwd *); -extern void set_internal (Lisp_Object, Lisp_Object, Lisp_Object, int); +extern void set_internal (Lisp_Object, Lisp_Object, Lisp_Object, bool); extern void syms_of_data (void); extern void init_data (void); extern void swap_in_global_binding (struct Lisp_Symbol *); @@ -3434,7 +3434,7 @@ extern void syms_of_ccl (void); extern void syms_of_dired (void); extern Lisp_Object directory_files_internal (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, - int, Lisp_Object); + bool, Lisp_Object); /* Defined in term.c */ extern int *char_ins_del_vector; diff --git a/src/process.c b/src/process.c index 7f6f6bafbea..64c70c49590 100644 --- a/src/process.c +++ b/src/process.c @@ -4870,15 +4870,13 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, for (channel = 0; channel <= max_input_desc; ++channel) { struct fd_callback_data *d = &fd_callback_info[channel]; - if (FD_ISSET (channel, &Available) - && d->func != 0 - && (d->condition & FOR_READ) != 0) - d->func (channel, d->data, 1); - if (FD_ISSET (channel, &write_mask) - && d->func != 0 - && (d->condition & FOR_WRITE) != 0) - d->func (channel, d->data, 0); - } + if (d->func + && ((d->condition & FOR_READ + && FD_ISSET (channel, &Available)) + || (d->condition & FOR_WRITE + && FD_ISSET (channel, &write_mask)))) + d->func (channel, d->data); + } for (channel = 0; channel <= max_process_desc; channel++) { diff --git a/src/process.h b/src/process.h index b963f4ca05c..ce3d2e702cc 100644 --- a/src/process.h +++ b/src/process.h @@ -219,7 +219,7 @@ extern void hold_keyboard_input (void); extern void unhold_keyboard_input (void); extern int kbd_on_hold_p (void); -typedef void (*fd_callback)(int fd, void *data, int for_read); +typedef void (*fd_callback) (int fd, void *data); extern void add_read_fd (int fd, fd_callback func, void *data); extern void delete_read_fd (int fd); diff --git a/src/xsmfns.c b/src/xsmfns.c index 1f6eb84260e..cddbb2aae86 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c @@ -97,7 +97,7 @@ ice_connection_closed (void) open to a session manager, just return. */ static void -x_session_check_input (int fd, void *data, int for_read) +x_session_check_input (int fd, void *data) { int ret; From 0f19feff2536f40cd10c3b7201ecd89e40148626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Mon, 27 Aug 2012 20:53:10 +0200 Subject: [PATCH 142/212] * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize dialog_return. (windowShouldClose:): Use stop instead of stopModalWithCode. (clicked:): Ditto, and also set dialog_return. (timeout_handler:): Use stop instead of abortModal. Send a dummy event. (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when modal loop returns. * nsterm.h (NSPanel): New class variable dialog_return. Fixes: debbugs:12258 --- src/ChangeLog | 13 +++++++++++++ src/nsmenu.m | 29 +++++++++++++++++++++++++---- src/nsterm.h | 1 + 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 15d5211efd9..79735225542 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2012-08-27 Jan Djärv + + * nsterm.h (NSPanel): New class variable dialog_return. + + * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize + dialog_return. + (windowShouldClose:): Use stop instead of stopModalWithCode. + (clicked:): Ditto, and also set dialog_return (Bug#12258). + (timeout_handler:): Use stop instead of abortModal. Send a dummy + event. + (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when + modal loop returns. + 2012-08-27 Paul Eggert * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans. diff --git a/src/nsmenu.m b/src/nsmenu.m index e8a0b43a01b..ab285f26df2 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -1497,6 +1497,7 @@ @implementation EmacsDialogPanel FlippedView *contentView; NSImage *img; + dialog_return = Qundefined; area.origin.x = 3*SPACER; area.origin.y = 2*SPACER; area.size.width = ICONSIZE; @@ -1584,7 +1585,7 @@ @implementation EmacsDialogPanel - (BOOL)windowShouldClose: (id)sender { - [NSApp stopModalWithCode: XHASH (Qnil)]; // FIXME: BIG UGLY HACK!! + [NSApp stop:self]; return NO; } @@ -1673,7 +1674,11 @@ void process_dialog (id window, Lisp_Object list) seltag = [[sellist objectAtIndex: 0] tag]; if (seltag != XHASH (Qundefined)) // FIXME: BIG UGLY HACK!! - [NSApp stopModalWithCode: seltag]; + { + dialog_return = seltag; + [NSApp stop:self]; + } + return self; } @@ -1756,13 +1761,27 @@ void process_dialog (id window, Lisp_Object list) - (void)timeout_handler: (NSTimer *)timedEntry { + NSEvent *nxev = [NSEvent otherEventWithType: NSApplicationDefined + location: NSMakePoint (0, 0) + modifierFlags: 0 + timestamp: 0 + windowNumber: [[NSApp mainWindow] windowNumber] + context: [NSApp context] + subtype: 0 + data1: 0 + data2: 0]; + timer_fired = 1; - [NSApp abortModal]; + /* We use sto because stopModal/abortModal out of the main loop does not + seem to work in 10.6. But as we use stop we must send a real event so + the stop is seen and acted upon. */ + [NSApp stop:self]; + [NSApp postEvent: nxev atStart: NO]; } - (Lisp_Object)runDialogAt: (NSPoint)p { - NSInteger ret = 0; + Lisp_Object ret = Qundefined; while (popup_activated_flag) { @@ -1781,7 +1800,9 @@ - (Lisp_Object)runDialogAt: (NSPoint)p forMode: NSModalPanelRunLoopMode]; } timer_fired = 0; + dialog_return = Qundefined; ret = [NSApp runModalForWindow: self]; + ret = dialog_return; if (! timer_fired) { if (tmo != nil) [tmo invalidate]; /* Cancels timer */ diff --git a/src/nsterm.h b/src/nsterm.h index 54f4a4ec89e..72b8d13cc47 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -196,6 +196,7 @@ along with GNU Emacs. If not, see . */ NSMatrix *matrix; int rows, cols; int timer_fired; + Lisp_Object dialog_return; } - initFromContents: (Lisp_Object)menu isQuestion: (BOOL)isQ; - addButton: (char *)str value: (Lisp_Object)val row: (int)row; From 95072a9468d22a66a22481722bc2f46ce30863d2 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Mon, 27 Aug 2012 23:07:32 +0200 Subject: [PATCH 143/212] In Fset_window_configuration revert first part of last change. * window.c (Fset_window_configuration): Revert first part of last change. --- src/ChangeLog | 5 +++++ src/window.c | 18 ------------------ 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 79735225542..2861a2f0f89 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-08-27 Martin Rudalics + + * window.c (Fset_window_configuration): Revert first part of + last change. + 2012-08-27 Jan Djärv * nsterm.h (NSPanel): New class variable dialog_return. diff --git a/src/window.c b/src/window.c index b3c5d276f97..330636efed9 100644 --- a/src/window.c +++ b/src/window.c @@ -5616,24 +5616,6 @@ the return value is nil. Otherwise the value is t. */) int previous_frame_menu_bar_lines = FRAME_MENU_BAR_LINES (f); int previous_frame_tool_bar_lines = FRAME_TOOL_BAR_LINES (f); - /* Don't do this within the main loop below: This may call Lisp - code and is thus potentially unsafe while input is blocked. */ - for (k = 0; k < saved_windows->header.size; k++) - { - p = SAVED_WINDOW_N (saved_windows, k); - window = p->window; - w = XWINDOW (window); - - if (!NILP (p->buffer) - && ((!EQ (w->buffer, p->buffer) - && !NILP (BVAR (XBUFFER (p->buffer), name))) - || NILP (w->buffer) - || NILP (BVAR (XBUFFER (w->buffer), name)))) - /* Record old buffer of window when its buffer is going to - change. */ - call1 (Qrecord_window_buffer, window); - } - /* The mouse highlighting code could get screwed up if it runs during this. */ BLOCK_INPUT; From 59ea14cde3090fe0bef42d646682b3801859be14 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 27 Aug 2012 17:33:56 -0700 Subject: [PATCH 144/212] * dispnew.c: Use bool for boolean. (frame_garbaged, display_completed, delayed_size_change) (fonts_changed_p, add_window_display_history) (add_frame_display_history, verify_row_hash) (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p) (row_equal_p, realloc_glyph_pool) (allocate_matrices_for_frame_redisplay) (showing_window_margins_p) (adjust_frame_glyphs_for_frame_redisplay) (build_frame_matrix_from_leaf_window, make_current) (mirrored_line_dance, mirror_line_dance, update_frame) (update_window_tree, update_single_window) (check_current_matrix_flags, update_window, update_text_area) (update_window_line, set_window_update_flags, scrolling_window) (update_frame_1, scrolling, buffer_posn_from_coords) (do_pending_window_change, change_frame_size) (change_frame_size_1, sit_for): Use bool for boolean. (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows, and remove last int (actually boolean) argument, which was always 0. All callers changed. * dispextern.h, frame.h, lisp.h: Reflect above API changes. * dispextern.h (struct composition_it): Use bool for boolean. (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'. (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf. * dired.c (file_name_completion): Use bool for boolean. (This was missed in an earlier change.) --- src/ChangeLog | 30 ++++++ src/dired.c | 8 +- src/dispextern.h | 30 +++--- src/dispnew.c | 271 +++++++++++++++++++++++------------------------ src/frame.h | 2 +- src/lisp.h | 2 +- src/xdisp.c | 12 +-- 7 files changed, 189 insertions(+), 166 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 2861a2f0f89..531d20ffca0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,33 @@ +2012-08-27 Paul Eggert + + * dispnew.c: Use bool for boolean. + (frame_garbaged, display_completed, delayed_size_change) + (fonts_changed_p, add_window_display_history) + (add_frame_display_history, verify_row_hash) + (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p) + (row_equal_p, realloc_glyph_pool) + (allocate_matrices_for_frame_redisplay) + (showing_window_margins_p) + (adjust_frame_glyphs_for_frame_redisplay) + (build_frame_matrix_from_leaf_window, make_current) + (mirrored_line_dance, mirror_line_dance, update_frame) + (update_window_tree, update_single_window) + (check_current_matrix_flags, update_window, update_text_area) + (update_window_line, set_window_update_flags, scrolling_window) + (update_frame_1, scrolling, buffer_posn_from_coords) + (do_pending_window_change, change_frame_size) + (change_frame_size_1, sit_for): + Use bool for boolean. + (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows, + and remove last int (actually boolean) argument, which was always 0. + All callers changed. + * dispextern.h, frame.h, lisp.h: Reflect above API changes. + * dispextern.h (struct composition_it): Use bool for boolean. + (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'. + (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf. + * dired.c (file_name_completion): + Use bool for boolean. (This was missed in an earlier change.) + 2012-08-27 Martin Rudalics * window.c (Fset_window_configuration): Revert first part of diff --git a/src/dired.c b/src/dired.c index 206f370ed63..fa293258107 100644 --- a/src/dired.c +++ b/src/dired.c @@ -460,7 +460,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, Lisp_Object encoded_file; Lisp_Object encoded_dir; struct stat st; - int directoryp; + bool directoryp; /* If not INCLUDEALL, exclude files in completion-ignored-extensions as well as "." and "..". Until shown otherwise, assume we can't exclude anything. */ @@ -530,7 +530,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, if (file_name_completion_stat (encoded_dir, dp, &st) < 0) continue; - directoryp = S_ISDIR (st.st_mode); + directoryp = S_ISDIR (st.st_mode) != 0; tem = Qnil; /* If all_flag is set, always include all. It would not actually be helpful to the user to ignore any possible @@ -718,7 +718,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, /* This tests that the current file is an exact match but BESTMATCH is not (it is too long). */ if ((matchsize == SCHARS (name) - && matchsize + !!directoryp < SCHARS (bestmatch)) + && matchsize + directoryp < SCHARS (bestmatch)) || /* If there is no exact match ignoring case, prefer a match that does not change the case @@ -730,7 +730,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, either both or neither are exact. */ (((matchsize == SCHARS (name)) == - (matchsize + !!directoryp == SCHARS (bestmatch))) + (matchsize + directoryp == SCHARS (bestmatch))) && (cmp = Fcompare_strings (name, zero, make_number (SCHARS (file)), file, zero, diff --git a/src/dispextern.h b/src/dispextern.h index 6fe5e249836..1140d98f8a7 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -671,7 +671,7 @@ struct glyph_matrix /* Values of BEGV and ZV as of last redisplay. Set in mark_window_display_accurate_1. */ - int begv, zv; + ptrdiff_t begv, zv; }; @@ -1126,11 +1126,11 @@ struct glyph_row *matrix_row (struct glyph_matrix *, int); ((ROW)->phys_height - (ROW)->phys_ascent \ > (ROW)->height - (ROW)->ascent) -/* Non-zero means that fonts have been loaded since the last glyph +/* True means that fonts have been loaded since the last glyph matrix adjustments. The function redisplay_internal adjusts glyph - matrices when this flag is non-zero. */ + matrices when this flag is true. */ -extern int fonts_changed_p; +extern bool fonts_changed_p; /* A glyph for a space. */ @@ -1149,7 +1149,7 @@ extern int updated_area; /* Non-zero means last display completed. Zero means it was preempted. */ -extern int display_completed; +extern bool display_completed; @@ -1415,7 +1415,7 @@ struct glyph_string && !NILP (BVAR (XBUFFER (W->buffer), mode_line_format)) \ && WINDOW_TOTAL_LINES (W) > 1) -/* Value is non-zero if window W wants a header line. */ +/* Value is true if window W wants a header line. */ #define WINDOW_WANTS_HEADER_LINE_P(W) \ (!MINI_WINDOW_P ((W)) \ @@ -1856,7 +1856,6 @@ struct bidi_it { int resolved_level; /* final resolved level of this character */ int invalid_levels; /* how many PDFs to ignore */ int invalid_rl_levels; /* how many PDFs from RLE/RLO to ignore */ - int prev_was_pdf; /* if non-zero, previous char was PDF */ struct bidi_saved_info prev; /* info about previous character */ struct bidi_saved_info last_strong; /* last-seen strong directional char */ struct bidi_saved_info next_for_neutral; /* surrounding characters for... */ @@ -1879,6 +1878,7 @@ struct bidi_it { struct bidi_string_data string; /* string to reorder */ bidi_dir_t paragraph_dir; /* current paragraph direction */ ptrdiff_t separator_limit; /* where paragraph separator should end */ + unsigned prev_was_pdf : 1; /* if non-zero, previous char was PDF */ unsigned first_elt : 1; /* if non-zero, examine current char first */ unsigned new_paragraph : 1; /* if non-zero, we expect a new paragraph */ unsigned frame_window_p : 1; /* non-zero if displaying on a GUI frame */ @@ -2085,10 +2085,10 @@ struct composition_it ptrdiff_t lookback; /* If non-negative, number of glyphs of the glyph-string. */ int nglyphs; - /* Nonzero iff the composition is created while buffer is scanned in + /* True iff the composition is created while buffer is scanned in reverse order, and thus the grapheme clusters must be rendered from the last to the first. */ - int reversed_p; + bool reversed_p; /** The following members contain information about the current grapheme cluster. */ @@ -3304,7 +3304,7 @@ extern Lisp_Object marginal_area_string (struct window *, enum window_part, extern void redraw_frame (struct frame *); extern void cancel_line (int, struct frame *); extern void init_desired_glyphs (struct frame *); -extern int update_frame (struct frame *, int, int); +extern bool update_frame (struct frame *, bool, bool); extern void bitch_at_user (void); void adjust_glyphs (struct frame *); void free_glyphs (struct frame *); @@ -3320,13 +3320,13 @@ void rotate_matrix (struct glyph_matrix *, int, int, int); void increment_matrix_positions (struct glyph_matrix *, int, int, ptrdiff_t, ptrdiff_t); void blank_row (struct window *, struct glyph_row *, int); -void enable_glyph_matrix_rows (struct glyph_matrix *, int, int, int); +void clear_glyph_matrix_rows (struct glyph_matrix *, int, int); void clear_glyph_row (struct glyph_row *); void prepare_desired_row (struct glyph_row *); -void set_window_update_flags (struct window *, int); -void update_single_window (struct window *, int); -void do_pending_window_change (int); -void change_frame_size (struct frame *, int, int, int, int, int); +void set_window_update_flags (struct window *, bool); +void update_single_window (struct window *, bool); +void do_pending_window_change (bool); +void change_frame_size (struct frame *, int, int, bool, bool, bool); void init_display (void); void syms_of_display (void); extern Lisp_Object Qredisplay_dont_pause; diff --git a/src/dispnew.c b/src/dispnew.c index ce7c4ebcb4c..f37b872274a 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -88,7 +88,7 @@ static void update_frame_line (struct frame *, int); static int required_matrix_height (struct window *); static int required_matrix_width (struct window *); static void adjust_frame_glyphs (struct frame *); -static void change_frame_size_1 (struct frame *, int, int, int, int, int); +static void change_frame_size_1 (struct frame *, int, int, bool, bool, bool); static void increment_row_positions (struct glyph_row *, ptrdiff_t, ptrdiff_t); static void fill_up_frame_row_with_spaces (struct glyph_row *, int); static void build_frame_matrix_from_window_tree (struct glyph_matrix *, @@ -98,20 +98,20 @@ static void build_frame_matrix_from_leaf_window (struct glyph_matrix *, static void adjust_frame_message_buffer (struct frame *); static void adjust_decode_mode_spec_buffer (struct frame *); static void fill_up_glyph_row_with_spaces (struct glyph_row *); -static void clear_window_matrices (struct window *, int); +static void clear_window_matrices (struct window *, bool); static void fill_up_glyph_row_area_with_spaces (struct glyph_row *, int); -static int scrolling_window (struct window *, int); -static int update_window_line (struct window *, int, int *); +static int scrolling_window (struct window *, bool); +static bool update_window_line (struct window *, int, bool *); static void mirror_make_current (struct window *, int); #ifdef GLYPH_DEBUG static void check_matrix_pointers (struct glyph_matrix *, struct glyph_matrix *); #endif static void mirror_line_dance (struct window *, int, int, int *, char *); -static int update_window_tree (struct window *, int); -static int update_window (struct window *, int); -static int update_frame_1 (struct frame *, int, int); -static int scrolling (struct frame *); +static bool update_window_tree (struct window *, bool); +static bool update_window (struct window *, bool); +static bool update_frame_1 (struct frame *, bool, bool); +static bool scrolling (struct frame *); static void set_window_cursor_after_update (struct window *); static void adjust_frame_glyphs_for_window_redisplay (struct frame *); static void adjust_frame_glyphs_for_frame_redisplay (struct frame *); @@ -122,14 +122,14 @@ static void adjust_frame_glyphs_for_frame_redisplay (struct frame *); static EMACS_TIME preemption_period; static EMACS_TIME preemption_next_check; -/* Nonzero upon entry to redisplay means do not assume anything about +/* True upon entry to redisplay means do not assume anything about current contents of actual terminal frame; clear and redraw it. */ -int frame_garbaged; +bool frame_garbaged; -/* Nonzero means last display completed. Zero means it was preempted. */ +/* True means last display completed. False means it was preempted. */ -int display_completed; +bool display_completed; Lisp_Object Qdisplay_table, Qredisplay_dont_pause; @@ -146,13 +146,13 @@ Lisp_Object selected_frame; struct frame *last_nonminibuf_frame; -/* 1 means SIGWINCH happened when not safe. */ +/* True means SIGWINCH happened when not safe. */ -static int delayed_size_change; +static bool delayed_size_change; /* 1 means glyph initialization has been completed at startup. */ -static int glyphs_initialized_initially_p; +static bool glyphs_initialized_initially_p; /* Updated window if != 0. Set by update_window. */ @@ -178,15 +178,15 @@ static int glyph_pool_count; static struct frame *frame_matrix_frame; -/* Non-zero means that fonts have been loaded since the last glyph +/* True means that fonts have been loaded since the last glyph matrix adjustments. Redisplay must stop, and glyph matrices must - be adjusted when this flag becomes non-zero during display. The + be adjusted when this flag becomes true during display. The reason fonts can be loaded so late is that fonts of fontsets are loaded on demand. Another reason is that a line contains many characters displayed by zero width or very narrow glyphs of variable-width fonts. */ -int fonts_changed_p; +bool fonts_changed_p; /* Convert vpos and hpos from frame to window and vice versa. This may only be used for terminal frames. */ @@ -222,16 +222,14 @@ static int history_idx; history. */ static uprintmax_t history_tick; - -static void add_frame_display_history (struct frame *, int); /* Add to the redisplay history how window W has been displayed. MSG is a trace containing the information how W's glyph matrix - has been constructed. PAUSED_P non-zero means that the update + has been constructed. PAUSED_P means that the update has been interrupted for pending input. */ static void -add_window_display_history (struct window *w, const char *msg, int paused_p) +add_window_display_history (struct window *w, const char *msg, bool paused_p) { char *buf; @@ -254,11 +252,11 @@ add_window_display_history (struct window *w, const char *msg, int paused_p) /* Add to the redisplay history that frame F has been displayed. - PAUSED_P non-zero means that the update has been interrupted for + PAUSED_P means that the update has been interrupted for pending input. */ static void -add_frame_display_history (struct frame *f, int paused_p) +add_frame_display_history (struct frame *f, bool paused_p) { char *buf; @@ -395,10 +393,10 @@ margin_glyphs_to_reserve (struct window *w, int total_glyphs, Lisp_Object margin return n; } -/* Return non-zero if ROW's hash value is correct, zero if not. +/* Return true if ROW's hash value is correct. Optimized away if ENABLE_CHECKING is not defined. */ -static int +static bool verify_row_hash (struct glyph_row *row) { return row->hash == row_hash (row); @@ -431,9 +429,9 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y { int i; int new_rows; - int marginal_areas_changed_p = 0; - int header_line_changed_p = 0; - int header_line_p = 0; + bool marginal_areas_changed_p = 0; + bool header_line_changed_p = 0; + bool header_line_p = 0; int left = -1, right = -1; int window_width = -1, window_height = -1; @@ -736,30 +734,28 @@ increment_matrix_positions (struct glyph_matrix *matrix, int start, int end, } -/* Enable a range of rows in glyph matrix MATRIX. START and END are - the row indices of the first and last + 1 row to enable. If - ENABLED_P is non-zero, enabled_p flags in rows will be set to 1. */ +/* Clear the enable_p flags in a range of rows in glyph matrix MATRIX. + START and END are the row indices of the first and last + 1 row to clear. */ void -enable_glyph_matrix_rows (struct glyph_matrix *matrix, int start, int end, int enabled_p) +clear_glyph_matrix_rows (struct glyph_matrix *matrix, int start, int end) { eassert (start <= end); eassert (start >= 0 && start < matrix->nrows); eassert (end >= 0 && end <= matrix->nrows); for (; start < end; ++start) - matrix->rows[start].enabled_p = enabled_p != 0; + matrix->rows[start].enabled_p = 0; } /* Clear MATRIX. - This empties all rows in MATRIX by setting the enabled_p flag for - all rows of the matrix to zero. The function prepare_desired_row - will eventually really clear a row when it sees one with a zero - enabled_p flag. + Empty all rows in MATRIX by clearing their enabled_p flags. + The function prepare_desired_row will eventually really clear a row + when it sees one with a false enabled_p flag. - Resets update hints to defaults value. The only update hint + Reset update hints to default values. The only update hint currently present is the flag MATRIX->no_scrolling_p. */ void @@ -767,7 +763,7 @@ clear_glyph_matrix (struct glyph_matrix *matrix) { if (matrix) { - enable_glyph_matrix_rows (matrix, 0, matrix->nrows, 0); + clear_glyph_matrix_rows (matrix, 0, matrix->nrows); matrix->no_scrolling_p = 0; } } @@ -853,11 +849,11 @@ clear_desired_matrices (register struct frame *f) } -/* Clear matrices in window tree rooted in W. If DESIRED_P is - non-zero clear desired matrices, otherwise clear current matrices. */ +/* Clear matrices in window tree rooted in W. If DESIRED_P, + clear desired matrices, otherwise clear current matrices. */ static void -clear_window_matrices (struct window *w, int desired_p) +clear_window_matrices (struct window *w, bool desired_p) { while (w) { @@ -1109,12 +1105,12 @@ assign_row (struct glyph_row *to, struct glyph_row *from) /* Test whether the glyph memory of the glyph row WINDOW_ROW, which is a row in a window matrix, is a slice of the glyph memory of the glyph row FRAME_ROW which is a row in a frame glyph matrix. Value - is non-zero if the glyph memory of WINDOW_ROW is part of the glyph + is true if the glyph memory of WINDOW_ROW is part of the glyph memory of FRAME_ROW. */ #ifdef GLYPH_DEBUG -static int +static bool glyph_row_slice_p (struct glyph_row *window_row, struct glyph_row *frame_row) { struct glyph *window_glyph_start = window_row->glyphs[0]; @@ -1161,7 +1157,7 @@ prepare_desired_row (struct glyph_row *row) { if (!row->enabled_p) { - int rp = row->reversed_p; + bool rp = row->reversed_p; clear_glyph_row (row); row->enabled_p = 1; @@ -1260,12 +1256,11 @@ line_draw_cost (struct glyph_matrix *matrix, int vpos) } -/* Test two glyph rows A and B for equality. Value is non-zero if A - and B have equal contents. MOUSE_FACE_P non-zero means compare the - mouse_face_p flags of A and B, too. */ +/* Return true if the glyph rows A and B have equal contents. + MOUSE_FACE_P means compare the mouse_face_p flags of A and B, too. */ -static inline int -row_equal_p (struct glyph_row *a, struct glyph_row *b, int mouse_face_p) +static inline bool +row_equal_p (struct glyph_row *a, struct glyph_row *b, bool mouse_face_p) { eassert (verify_row_hash (a)); eassert (verify_row_hash (b)); @@ -1380,14 +1375,14 @@ free_glyph_pool (struct glyph_pool *pool) is changed from a large value to a smaller one. But, if someone does it once, we can expect that he will do it again. - Value is non-zero if the pool changed in a way which makes + Return true if the pool changed in a way which makes re-adjusting window glyph matrices necessary. */ -static int +static bool realloc_glyph_pool (struct glyph_pool *pool, struct dim matrix_dim) { ptrdiff_t needed; - int changed_p; + bool changed_p; changed_p = (pool->glyphs == 0 || matrix_dim.height != pool->nrows @@ -1561,7 +1556,7 @@ check_matrix_invariants (struct window *w) X and Y are column/row within the frame glyph matrix where sub-matrices for the window tree rooted at WINDOW must be - allocated. DIM_ONLY_P non-zero means that the caller of this + allocated. DIM_ONLY_P means that the caller of this function is only interested in the result matrix dimension, and matrix adjustments should not be performed. @@ -1638,7 +1633,7 @@ check_matrix_invariants (struct window *w) static struct dim allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y, - int dim_only_p, int *window_change_flags) + bool dim_only_p, int *window_change_flags) { struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (window))); int x0 = x, y0 = y; @@ -1646,7 +1641,7 @@ allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y, struct dim total; struct dim dim; struct window *w; - int in_horz_combination_p; + bool in_horz_combination_p; /* What combination is WINDOW part of? Compute this once since the result is the same for all windows in the `next' chain. The @@ -1704,7 +1699,7 @@ allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y, /* Actually change matrices, if allowed. Do not consider CHANGED_LEAF_MATRIX computed above here because the pool may have been changed which we don't now here. We trust - that we only will be called with DIM_ONLY_P != 0 when + that we only will be called with DIM_ONLY_P when necessary. */ if (!dim_only_p) { @@ -1919,9 +1914,9 @@ adjust_frame_glyphs (struct frame *f) f->glyphs_initialized_p = 1; } -/* Return 1 if any window in the tree has nonzero window margins. See +/* Return true if any window in the tree has nonzero window margins. See the hack at the end of adjust_frame_glyphs_for_frame_redisplay. */ -static int +static bool showing_window_margins_p (struct window *w) { while (w) @@ -2052,7 +2047,7 @@ static void adjust_frame_glyphs_for_frame_redisplay (struct frame *f) { struct dim matrix_dim; - int pool_changed_p; + bool pool_changed_p; int window_change_flags; int top_window_y; @@ -2468,7 +2463,7 @@ build_frame_matrix_from_window_tree (struct glyph_matrix *matrix, struct window desired frame matrix built. W is a leaf window whose desired or current matrix is to be added to FRAME_MATRIX. W's flag must_be_updated_p determines which matrix it contributes to - FRAME_MATRIX. If must_be_updated_p is non-zero, W's desired matrix + FRAME_MATRIX. If W->must_be_updated_p, W's desired matrix is added to FRAME_MATRIX, otherwise W's current matrix is added. Adding a desired matrix means setting up used counters and such in frame rows, while adding a current window matrix to FRAME_MATRIX @@ -2519,7 +2514,7 @@ build_frame_matrix_from_leaf_window (struct glyph_matrix *frame_matrix, struct w { struct glyph_row *frame_row = frame_matrix->rows + frame_y; struct glyph_row *window_row = window_matrix->rows + window_y; - int current_row_p = window_matrix == w->current_matrix; + bool current_row_p = window_matrix == w->current_matrix; /* Fill up the frame row with spaces up to the left margin of the window row. */ @@ -2692,7 +2687,7 @@ make_current (struct glyph_matrix *desired_matrix, struct glyph_matrix *current_ { struct glyph_row *current_row = MATRIX_ROW (current_matrix, row); struct glyph_row *desired_row = MATRIX_ROW (desired_matrix, row); - int mouse_face_p = current_row->mouse_face_p; + bool mouse_face_p = current_row->mouse_face_p; /* Do current_row = desired_row. This exchanges glyph pointers between both rows, and does a structure assignment otherwise. */ @@ -2789,7 +2784,7 @@ mirrored_line_dance (struct glyph_matrix *matrix, int unchanged_at_top, int nlin /* Assign new rows, maybe clear lines. */ for (i = 0; i < nlines; ++i) { - int enabled_before_p = new_rows[i].enabled_p; + bool enabled_before_p = new_rows[i].enabled_p; eassert (i + unchanged_at_top < matrix->nrows); eassert (unchanged_at_top + copy_from[i] < matrix->nrows); @@ -2897,7 +2892,8 @@ mirror_line_dance (struct window *w, int unchanged_at_top, int nlines, int *copy /* W is a leaf window, and we are working on its current matrix m. */ struct glyph_matrix *m = w->current_matrix; - int i, sync_p = 0; + int i; + bool sync_p = 0; struct glyph_row *old_rows; /* Make a copy of the original rows of matrix m. */ @@ -2919,22 +2915,19 @@ mirror_line_dance (struct window *w, int unchanged_at_top, int nlines, int *copy int window_from = frame_from - m->matrix_y; /* Is assigned line inside window? */ - int from_inside_window_p + bool from_inside_window_p = window_from >= 0 && window_from < m->matrix_h; /* Is assigned to line inside window? */ - int to_inside_window_p + bool to_inside_window_p = window_to >= 0 && window_to < m->matrix_h; if (from_inside_window_p && to_inside_window_p) { - /* Enabled setting before assignment. */ - int enabled_before_p; - /* Do the assignment. The enabled_p flag is saved over the assignment because the old redisplay did that. */ - enabled_before_p = m->rows[window_to].enabled_p; + bool enabled_before_p = m->rows[window_to].enabled_p; m->rows[window_to] = old_rows[window_from]; m->rows[window_to].enabled_p = enabled_before_p; @@ -3155,17 +3148,16 @@ DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "", /* Update frame F based on the data in desired matrices. - If FORCE_P is non-zero, don't let redisplay be stopped by detecting - pending input. If INHIBIT_HAIRY_ID_P is non-zero, don't try - scrolling. + If FORCE_P, don't let redisplay be stopped by detecting pending input. + If INHIBIT_HAIRY_ID_P, don't try scrolling. - Value is non-zero if redisplay was stopped due to pending input. */ + Value is true if redisplay was stopped due to pending input. */ -int -update_frame (struct frame *f, int force_p, int inhibit_hairy_id_p) +bool +update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p) { - /* 1 means display has been paused because of pending input. */ - int paused_p; + /* True means display has been paused because of pending input. */ + bool paused_p; struct window *root_window = XWINDOW (f->root_window); if (redisplay_dont_pause) @@ -3283,13 +3275,13 @@ update_frame (struct frame *f, int force_p, int inhibit_hairy_id_p) Window-based updates ************************************************************************/ -/* Perform updates in window tree rooted at W. FORCE_P non-zero means - don't stop updating when input is pending. */ +/* Perform updates in window tree rooted at W. + If FORCE_P, don't stop updating if input is pending. */ -static int -update_window_tree (struct window *w, int force_p) +static bool +update_window_tree (struct window *w, bool force_p) { - int paused_p = 0; + bool paused_p = 0; while (w && !paused_p) { @@ -3307,11 +3299,11 @@ update_window_tree (struct window *w, int force_p) } -/* Update window W if its flag must_be_updated_p is non-zero. If - FORCE_P is non-zero, don't stop updating if input is pending. */ +/* Update window W if its flag must_be_updated_p is set. + If FORCE_P, don't stop updating if input is pending. */ void -update_single_window (struct window *w, int force_p) +update_single_window (struct window *w, bool force_p) { if (w->must_be_updated_p) { @@ -3460,7 +3452,7 @@ redraw_overlapping_rows (struct window *w, int yb) static void check_current_matrix_flags (struct window *w) { - int last_seen_p = 0; + bool last_seen_p = 0; int i, yb = window_text_bottom_y (w); for (i = 0; i < w->current_matrix->nrows - 1; ++i) @@ -3476,14 +3468,14 @@ check_current_matrix_flags (struct window *w) #endif /* GLYPH_DEBUG */ -/* Update display of window W. FORCE_P non-zero means that we should - not stop when detecting pending input. */ +/* Update display of window W. + If FORCE_P, don't stop updating when input is pending. */ -static int -update_window (struct window *w, int force_p) +static bool +update_window (struct window *w, bool force_p) { struct glyph_matrix *desired_matrix = w->desired_matrix; - int paused_p; + bool paused_p; #if !PERIODIC_PREEMPTION_CHECKING int preempt_count = baud_rate / 2400 + 1; #endif @@ -3506,7 +3498,8 @@ update_window (struct window *w, int force_p) struct glyph_row *row, *end; struct glyph_row *mode_line_row; struct glyph_row *header_line_row; - int yb, changed_p = 0, mouse_face_overwritten_p = 0; + int yb; + bool changed_p = 0, mouse_face_overwritten_p = 0; #if ! PERIODIC_PREEMPTION_CHECKING int n_updated = 0; #endif @@ -3693,15 +3686,15 @@ update_marginal_area (struct window *w, int area, int vpos) /* Update the display of the text area of row VPOS in window W. - Value is non-zero if display has changed. */ + Value is true if display has changed. */ -static int +static bool update_text_area (struct window *w, int vpos) { struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos); struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos); struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); - int changed_p = 0; + bool changed_p = 0; /* Let functions in xterm.c know what area subsequent X positions will be relative to. */ @@ -3751,9 +3744,9 @@ update_text_area (struct window *w, int vpos) int stop, i, x; struct glyph *current_glyph = current_row->glyphs[TEXT_AREA]; struct glyph *desired_glyph = desired_row->glyphs[TEXT_AREA]; - int overlapping_glyphs_p = current_row->contains_overlapping_glyphs_p; + bool overlapping_glyphs_p = current_row->contains_overlapping_glyphs_p; int desired_stop_pos = desired_row->used[TEXT_AREA]; - int abort_skipping = 0; + bool abort_skipping = 0; /* If the desired row extends its face to the text area end, and unless the current row also does so at the same position, @@ -3773,7 +3766,7 @@ update_text_area (struct window *w, int vpos) in common. */ while (i < stop) { - int can_skip_p = !abort_skipping; + bool can_skip_p = !abort_skipping; /* Skip over glyphs that both rows have in common. These don't have to be written. We can't skip if the last @@ -3847,7 +3840,7 @@ update_text_area (struct window *w, int vpos) int start_x = x, start_hpos = i; struct glyph *start = desired_glyph; int current_x = x; - int skip_first_p = !can_skip_p; + bool skip_first_p = !can_skip_p; /* Find the next glyph that's equal again. */ while (i < stop @@ -3938,16 +3931,15 @@ update_text_area (struct window *w, int vpos) } -/* Update row VPOS in window W. Value is non-zero if display has been - changed. */ +/* Update row VPOS in window W. Value is true if display has been changed. */ -static int -update_window_line (struct window *w, int vpos, int *mouse_face_overwritten_p) +static bool +update_window_line (struct window *w, int vpos, bool *mouse_face_overwritten_p) { struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos); struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos); struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); - int changed_p = 0; + bool changed_p = 0; /* Set the row being updated. This is important to let xterm.c know what line height values are in effect. */ @@ -4095,7 +4087,7 @@ set_window_cursor_after_update (struct window *w) tree rooted at W. */ void -set_window_update_flags (struct window *w, int on_p) +set_window_update_flags (struct window *w, bool on_p) { while (w) { @@ -4198,7 +4190,7 @@ add_row_entry (struct glyph_row *row) /* Try to reuse part of the current display of W by scrolling lines. - HEADER_LINE_P non-zero means W has a header line. + HEADER_LINE_P means W has a header line. The algorithm is taken from Communications of the ACM, Apr78 "A Technique for Isolating Differences Between Files." It should take @@ -4224,7 +4216,7 @@ add_row_entry (struct glyph_row *row) 1 if we did scroll. */ static int -scrolling_window (struct window *w, int header_line_p) +scrolling_window (struct window *w, bool header_line_p) { struct glyph_matrix *desired_matrix = w->desired_matrix; struct glyph_matrix *current_matrix = w->current_matrix; @@ -4237,7 +4229,7 @@ scrolling_window (struct window *w, int header_line_p) struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); /* Skip over rows equal at the start. */ - for (i = header_line_p ? 1 : 0; i < current_matrix->nrows - 1; ++i) + for (i = header_line_p; i < current_matrix->nrows - 1; ++i) { struct glyph_row *d = MATRIX_ROW (desired_matrix, i); struct glyph_row *c = MATRIX_ROW (current_matrix, i); @@ -4496,7 +4488,7 @@ scrolling_window (struct window *w, int header_line_p) for (j = nruns - 1; j > i; --j) { struct run *p = runs[j]; - int truncated_p = 0; + bool truncated_p = 0; if (p->nrows > 0 && p->desired_y < r->desired_y + r->height @@ -4559,7 +4551,7 @@ scrolling_window (struct window *w, int header_line_p) for (j = 0; j < r->nrows; ++j) { struct glyph_row *from, *to; - int to_overlapped_p; + bool to_overlapped_p; to = MATRIX_ROW (current_matrix, r->desired_vpos + j); from = MATRIX_ROW (desired_matrix, r->desired_vpos + j); @@ -4594,20 +4586,19 @@ scrolling_window (struct window *w, int header_line_p) /* Update the desired frame matrix of frame F. - FORCE_P non-zero means that the update should not be stopped by - pending input. INHIBIT_HAIRY_ID_P non-zero means that scrolling - should not be tried. + FORCE_P means that the update should not be stopped by pending input. + INHIBIT_HAIRY_ID_P means that scrolling should not be tried. - Value is non-zero if update was stopped due to pending input. */ + Value is true if update was stopped due to pending input. */ -static int -update_frame_1 (struct frame *f, int force_p, int inhibit_id_p) +static bool +update_frame_1 (struct frame *f, bool force_p, bool inhibit_id_p) { /* Frame matrices to work on. */ struct glyph_matrix *current_matrix = f->current_matrix; struct glyph_matrix *desired_matrix = f->desired_matrix; int i; - int pause_p; + bool pause_p; int preempt_count = baud_rate / 2400 + 1; eassert (current_matrix && desired_matrix); @@ -4699,7 +4690,7 @@ update_frame_1 (struct frame *f, int force_p, int inhibit_id_p) } } - pause_p = (i < FRAME_LINES (f) - 1) ? i : 0; + pause_p = 0 < i && i < FRAME_LINES (f) - 1; /* Now just clean up termcap drivers and set cursor, etc. */ if (!pause_p) @@ -4809,7 +4800,7 @@ update_frame_1 (struct frame *f, int force_p, int inhibit_id_p) /* Do line insertions/deletions on frame F for frame-based redisplay. */ -static int +static bool scrolling (struct frame *frame) { int unchanged_at_top, unchanged_at_bottom; @@ -4952,10 +4943,10 @@ update_frame_line (struct frame *f, int vpos) struct glyph_matrix *desired_matrix = f->desired_matrix; struct glyph_row *current_row = MATRIX_ROW (current_matrix, vpos); struct glyph_row *desired_row = MATRIX_ROW (desired_matrix, vpos); - int must_write_whole_line_p; - int write_spaces_p = FRAME_MUST_WRITE_SPACES (f); - int colored_spaces_p = (FACE_FROM_ID (f, DEFAULT_FACE_ID)->background - != FACE_TTY_DEFAULT_BG_COLOR); + bool must_write_whole_line_p; + bool write_spaces_p = FRAME_MUST_WRITE_SPACES (f); + bool colored_spaces_p = (FACE_FROM_ID (f, DEFAULT_FACE_ID)->background + != FACE_TTY_DEFAULT_BG_COLOR); if (colored_spaces_p) write_spaces_p = 1; @@ -5289,7 +5280,7 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p /* start_display takes into account the header-line row, but IT's vpos still counts from the glyph row that includes the window's start position. Adjust for a possible header-line row. */ - it.vpos += WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0; + it.vpos += WINDOW_WANTS_HEADER_LINE_P (w); x0 = *x; @@ -5613,12 +5604,12 @@ window_change_signal (int signalnum) /* If we don't have an argument, */ #endif /* SIGWINCH */ -/* Do any change in frame size that was requested by a signal. SAFE - non-zero means this function is called from a place where it is - safe to change frame sizes while a redisplay is in progress. */ +/* Do any change in frame size that was requested by a signal. + SAFE means this function is called from a place where it is + safe to change frame sizes while a redisplay is in progress. */ void -do_pending_window_change (int safe) +do_pending_window_change (bool safe) { /* If window_change_signal should have run before, run it now. */ if (redisplaying_p && !safe) @@ -5645,16 +5636,17 @@ do_pending_window_change (int safe) /* Change the frame height and/or width. Values may be given as zero to indicate no change is to take place. - If DELAY is non-zero, then assume we're being called from a signal - handler, and queue the change for later - perhaps the next - redisplay. Since this tries to resize windows, we can't call it + If DELAY, assume we're being called from a signal handler, and + queue the change for later - perhaps the next redisplay. + Since this tries to resize windows, we can't call it from a signal handler. - SAFE non-zero means this function is called from a place where it's + SAFE means this function is called from a place where it's safe to change frame sizes while a redisplay is in progress. */ void -change_frame_size (register struct frame *f, int newheight, int newwidth, int pretend, int delay, int safe) +change_frame_size (struct frame *f, int newheight, int newwidth, + bool pretend, bool delay, bool safe) { Lisp_Object tail, frame; @@ -5673,7 +5665,8 @@ change_frame_size (register struct frame *f, int newheight, int newwidth, int pr } static void -change_frame_size_1 (register struct frame *f, int newheight, int newwidth, int pretend, int delay, int safe) +change_frame_size_1 (struct frame *f, int newheight, int newwidth, + bool pretend, bool delay, bool safe) { int new_frame_total_cols; ptrdiff_t count = SPECPDL_INDEX (); @@ -5929,13 +5922,13 @@ additional wait period, in milliseconds; this is for backwards compatibility. TIMEOUT is number of seconds to wait (float or integer), or t to wait forever. - READING is 1 if reading input. + READING is true if reading input. If DO_DISPLAY is >0 display process output while waiting. If DO_DISPLAY is >1 perform an initial redisplay before waiting. */ Lisp_Object -sit_for (Lisp_Object timeout, int reading, int do_display) +sit_for (Lisp_Object timeout, bool reading, int do_display) { intmax_t sec; int nsec; diff --git a/src/frame.h b/src/frame.h index 58b957519c9..9421aa45414 100644 --- a/src/frame.h +++ b/src/frame.h @@ -34,7 +34,7 @@ INLINE_HEADER_BEGIN /* Miscellanea. */ /* Nonzero means there is at least one garbaged frame. */ -extern int frame_garbaged; +extern bool frame_garbaged; /* The structure representing a frame. */ diff --git a/src/lisp.h b/src/lisp.h index 127177e44c7..49a2832d686 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2766,7 +2766,7 @@ _Noreturn void __executable_start (void); #endif extern Lisp_Object selected_frame; extern Lisp_Object Vwindow_system; -extern Lisp_Object sit_for (Lisp_Object, int, int); +extern Lisp_Object sit_for (Lisp_Object, bool, int); extern void init_display (void); extern void syms_of_display (void); diff --git a/src/xdisp.c b/src/xdisp.c index 18e537e9385..8289c003031 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -15380,7 +15380,7 @@ set_vertical_scroll_bar (struct window *w) selected_window is redisplayed. We can return without actually redisplaying the window if - fonts_changed_p is nonzero. In that case, redisplay_internal will + fonts_changed_p. In that case, redisplay_internal will retry. */ static void @@ -16224,7 +16224,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) } #endif /* HAVE_WINDOW_SYSTEM */ - /* We go to this label, with fonts_changed_p nonzero, + /* We go to this label, with fonts_changed_p set, if it is necessary to try again using larger glyph matrices. We have to redeem the scroll bar even in this case, because the loop in redisplay_internal expects that. */ @@ -17705,15 +17705,15 @@ try_window_id (struct window *w) { rotate_matrix (current_matrix, first_unchanged_at_end_vpos + dvpos, bottom_vpos, dvpos); - enable_glyph_matrix_rows (current_matrix, bottom_vpos + dvpos, - bottom_vpos, 0); + clear_glyph_matrix_rows (current_matrix, bottom_vpos + dvpos, + bottom_vpos); } else if (dvpos > 0) { rotate_matrix (current_matrix, first_unchanged_at_end_vpos, bottom_vpos, dvpos); - enable_glyph_matrix_rows (current_matrix, first_unchanged_at_end_vpos, - first_unchanged_at_end_vpos + dvpos, 0); + clear_glyph_matrix_rows (current_matrix, first_unchanged_at_end_vpos, + first_unchanged_at_end_vpos + dvpos); } /* For frame-based redisplay, make sure that current frame and window From a3d794a153425b09a0185c660926c241d13e0f2c Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Tue, 28 Aug 2012 09:49:02 +0400 Subject: [PATCH 145/212] Fix usage of set_buffer_internal. * buffer.h (set_buffer_internal): Make it BUFFER_INLINE. * buffer.c (set_buffer_if_live): Use set_buffer_internal. * coding.c (decode_coding): Omit redundant test. * fileio.c (decide_coding_unwind): Likewise. * fns.c (secure_hash): Likewise. * insdel.c (modify_region): Likewise. * keyboard.c (command_loop_1): Likewise. * print.c (PRINTFINISH): Likewise. * xdisp.c (run_window_scroll_functions): Use set_buffer_internal. --- src/ChangeLog | 13 +++++++++++++ src/buffer.c | 18 +----------------- src/buffer.h | 17 ++++++++++++++++- src/coding.c | 3 +-- src/fileio.c | 3 +-- src/fns.c | 6 ++---- src/insdel.c | 6 ++---- src/keyboard.c | 6 ++---- src/print.c | 3 +-- src/xdisp.c | 3 +-- 10 files changed, 40 insertions(+), 38 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 531d20ffca0..0806cc0ff95 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2012-08-28 Dmitry Antipov + + Fix usage of set_buffer_internal. + * buffer.h (set_buffer_internal): Make it BUFFER_INLINE. + * buffer.c (set_buffer_if_live): Use set_buffer_internal. + * coding.c (decode_coding): Omit redundant test. + * fileio.c (decide_coding_unwind): Likewise. + * fns.c (secure_hash): Likewise. + * insdel.c (modify_region): Likewise. + * keyboard.c (command_loop_1): Likewise. + * print.c (PRINTFINISH): Likewise. + * xdisp.c (run_window_scroll_functions): Use set_buffer_internal. + 2012-08-27 Paul Eggert * dispnew.c: Use bool for boolean. diff --git a/src/buffer.c b/src/buffer.c index 4d606c2105a..5185e6c89f1 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -2099,22 +2099,6 @@ DEFUN ("current-buffer", Fcurrent_buffer, Scurrent_buffer, 0, 0, 0, XSETBUFFER (buf, current_buffer); return buf; } - -/* Set the current buffer to B. - - We previously set windows_or_buffers_changed here to invalidate - global unchanged information in beg_unchanged and end_unchanged. - This is no longer necessary because we now compute unchanged - information on a buffer-basis. Every action affecting other - windows than the selected one requires a select_window at some - time, and that increments windows_or_buffers_changed. */ - -void -set_buffer_internal (register struct buffer *b) -{ - if (current_buffer != b) - set_buffer_internal_1 (b); -} /* Set the current buffer to B, and do not set windows_or_buffers_changed. This is used by redisplay. */ @@ -2226,7 +2210,7 @@ Lisp_Object set_buffer_if_live (Lisp_Object buffer) { if (! NILP (BVAR (XBUFFER (buffer), name))) - Fset_buffer (buffer); + set_buffer_internal (XBUFFER (buffer)); return Qnil; } diff --git a/src/buffer.h b/src/buffer.h index c8b59ffde0b..929da3c4791 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -1014,7 +1014,6 @@ extern ptrdiff_t sort_overlays (Lisp_Object *, ptrdiff_t, struct window *); extern void recenter_overlay_lists (struct buffer *, ptrdiff_t); extern ptrdiff_t overlay_strings (ptrdiff_t, struct window *, unsigned char **); extern void validate_region (Lisp_Object *, Lisp_Object *); -extern void set_buffer_internal (struct buffer *); extern void set_buffer_internal_1 (struct buffer *); extern void set_buffer_temp (struct buffer *); extern Lisp_Object buffer_local_value_1 (Lisp_Object, Lisp_Object); @@ -1023,6 +1022,22 @@ extern _Noreturn void buffer_slot_type_mismatch (Lisp_Object, int); extern void fix_overlays_before (struct buffer *, ptrdiff_t, ptrdiff_t); extern void mmap_set_vars (bool); +/* Set the current buffer to B. + + We previously set windows_or_buffers_changed here to invalidate + global unchanged information in beg_unchanged and end_unchanged. + This is no longer necessary because we now compute unchanged + information on a buffer-basis. Every action affecting other + windows than the selected one requires a select_window at some + time, and that increments windows_or_buffers_changed. */ + +BUFFER_INLINE void +set_buffer_internal (struct buffer *b) +{ + if (current_buffer != b) + set_buffer_internal_1 (b); +} + /* Get overlays at POSN into array OVERLAYS with NOVERLAYS elements. If NEXTP is non-NULL, return next overlay there. See overlay_at arg CHANGE_REQ for meaning of CHRQ arg. */ diff --git a/src/coding.c b/src/coding.c index 5bfd42c7272..02e7b34695e 100644 --- a/src/coding.c +++ b/src/coding.c @@ -7006,8 +7006,7 @@ decode_coding (struct coding_system *coding) undo_list = Qt; if (BUFFERP (coding->dst_object)) { - if (current_buffer != XBUFFER (coding->dst_object)) - set_buffer_internal (XBUFFER (coding->dst_object)); + set_buffer_internal (XBUFFER (coding->dst_object)); if (GPT != PT) move_gap_both (PT, PT_BYTE); diff --git a/src/fileio.c b/src/fileio.c index 6906af7e74f..44696cc8e62 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3142,8 +3142,7 @@ decide_coding_unwind (Lisp_Object unwind_data) undo_list = XCAR (unwind_data); buffer = XCDR (unwind_data); - if (current_buffer != XBUFFER (buffer)) - set_buffer_internal (XBUFFER (buffer)); + set_buffer_internal (XBUFFER (buffer)); adjust_markers_for_delete (BEG, BEG_BYTE, Z, Z_BYTE); adjust_overlays_for_delete (BEG, Z - BEG); set_buffer_intervals (current_buffer, NULL); diff --git a/src/fns.c b/src/fns.c index 91ba28504a0..b13311e26d0 100644 --- a/src/fns.c +++ b/src/fns.c @@ -4661,8 +4661,7 @@ secure_hash (Lisp_Object algorithm, Lisp_Object object, Lisp_Object start, Lisp_ CHECK_BUFFER (object); bp = XBUFFER (object); - if (bp != current_buffer) - set_buffer_internal (bp); + set_buffer_internal (bp); if (NILP (start)) b = BEGV; @@ -4749,8 +4748,7 @@ secure_hash (Lisp_Object algorithm, Lisp_Object object, Lisp_Object start, Lisp_ } object = make_buffer_string (b, e, 0); - if (prev != current_buffer) - set_buffer_internal (prev); + set_buffer_internal (prev); /* Discard the unwind protect for recovering the current buffer. */ specpdl_ptr--; diff --git a/src/insdel.c b/src/insdel.c index 1dceb67bffa..53a3a1370cd 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1779,8 +1779,7 @@ modify_region (struct buffer *buffer, ptrdiff_t start, ptrdiff_t end, { struct buffer *old_buffer = current_buffer; - if (buffer != old_buffer) - set_buffer_internal (buffer); + set_buffer_internal (buffer); prepare_to_modify_buffer (start, end, NULL); @@ -1794,8 +1793,7 @@ modify_region (struct buffer *buffer, ptrdiff_t start, ptrdiff_t end, bset_point_before_scroll (buffer, Qnil); - if (buffer != old_buffer) - set_buffer_internal (old_buffer); + set_buffer_internal (old_buffer); } /* Check that it is okay to modify the buffer between START and END, diff --git a/src/keyboard.c b/src/keyboard.c index 3e0ead7e4fb..f31480e3b88 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1434,8 +1434,7 @@ command_loop_1 (void) Fkill_emacs (Qnil); /* Make sure the current window's buffer is selected. */ - if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer) - set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer)); + set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer)); /* Display any malloc warning that just came out. Use while because displaying one warning can cause another. */ @@ -1513,8 +1512,7 @@ command_loop_1 (void) /* A filter may have run while we were reading the input. */ if (! FRAME_LIVE_P (XFRAME (selected_frame))) Fkill_emacs (Qnil); - if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer) - set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer)); + set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer)); ++num_input_keys; diff --git a/src/print.c b/src/print.c index 64449aeaf2a..36d0b5dce9d 100644 --- a/src/print.c +++ b/src/print.c @@ -197,8 +197,7 @@ int print_output_debug_flag EXTERNALLY_VISIBLE = 1; ? PT - start_point : 0), \ old_point_byte + (old_point_byte >= start_point_byte \ ? PT_BYTE - start_point_byte : 0)); \ - if (old != current_buffer) \ - set_buffer_internal (old); + set_buffer_internal (old); #define PRINTCHAR(ch) printchar (ch, printcharfun) diff --git a/src/xdisp.c b/src/xdisp.c index 8289c003031..13b03736bde 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -14551,8 +14551,7 @@ run_window_scroll_functions (Lisp_Object window, struct text_pos startp) make_number (CHARPOS (startp))); SET_TEXT_POS_FROM_MARKER (startp, w->start); /* In case the hook functions switch buffers. */ - if (current_buffer != XBUFFER (w->buffer)) - set_buffer_internal_1 (XBUFFER (w->buffer)); + set_buffer_internal (XBUFFER (w->buffer)); } return startp; From 66322887059e1f2711e07def5eff661281cee855 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Tue, 28 Aug 2012 10:20:08 +0400 Subject: [PATCH 146/212] Always use set_buffer_if_live to restore original buffer at unwind. * buffer.h (record_unwind_current_buffer): New function. * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c: * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c: * undo.c, window.c: Adjust users. * buffer.c (set_buffer_if_live): Fix comment. --- src/ChangeLog | 9 +++++++++ src/buffer.c | 2 +- src/buffer.h | 9 +++++++++ src/bytecode.c | 2 +- src/dispnew.c | 2 +- src/editfns.c | 7 ++----- src/fileio.c | 2 +- src/fns.c | 2 +- src/insdel.c | 2 +- src/keyboard.c | 2 +- src/keymap.c | 4 +--- src/minibuf.c | 2 +- src/print.c | 2 +- src/process.c | 4 ++-- src/textprop.c | 4 ++-- src/undo.c | 2 +- src/window.c | 4 ++-- 17 files changed, 37 insertions(+), 24 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 0806cc0ff95..889c8efebdb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2012-08-28 Dmitry Antipov + + Always use set_buffer_if_live to restore original buffer at unwind. + * buffer.h (record_unwind_current_buffer): New function. + * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c: + * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c: + * undo.c, window.c: Adjust users. + * buffer.c (set_buffer_if_live): Fix comment. + 2012-08-28 Dmitry Antipov Fix usage of set_buffer_internal. diff --git a/src/buffer.c b/src/buffer.c index 5185e6c89f1..61ec736ad1a 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -2204,7 +2204,7 @@ ends when the current command terminates. Use `switch-to-buffer' or return buffer; } -/* Set the current buffer to BUFFER provided it is alive. */ +/* Set the current buffer to BUFFER provided if it is alive. */ Lisp_Object set_buffer_if_live (Lisp_Object buffer) diff --git a/src/buffer.h b/src/buffer.h index 929da3c4791..3acf1423816 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -1038,6 +1038,15 @@ set_buffer_internal (struct buffer *b) set_buffer_internal_1 (b); } +/* Arrange to go back to the original buffer after the next + call to unbind_to if the original buffer is still alive. */ + +BUFFER_INLINE void +record_unwind_current_buffer (void) +{ + record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); +} + /* Get overlays at POSN into array OVERLAYS with NOVERLAYS elements. If NEXTP is non-NULL, return next overlay there. See overlay_at arg CHANGE_REQ for meaning of CHRQ arg. */ diff --git a/src/bytecode.c b/src/bytecode.c index 753f149ae01..40729cbd453 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -1051,7 +1051,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, CASE (Bsave_current_buffer): /* Obsolete since ??. */ CASE (Bsave_current_buffer_1): - record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); + record_unwind_current_buffer (); NEXT; CASE (Bsave_window_excursion): /* Obsolete since 24.1. */ diff --git a/src/dispnew.c b/src/dispnew.c index f37b872274a..4e307880111 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -5762,7 +5762,7 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth, UNBLOCK_INPUT; - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); + record_unwind_current_buffer (); run_window_configuration_change_hook (f); diff --git a/src/editfns.c b/src/editfns.c index 0bd632d14b7..7b451e4e443 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -946,13 +946,10 @@ BODY is executed just like `progn'. usage: (save-current-buffer &rest BODY) */) (Lisp_Object args) { - Lisp_Object val; ptrdiff_t count = SPECPDL_INDEX (); - record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); - - val = Fprogn (args); - return unbind_to (count, val); + record_unwind_current_buffer (); + return unbind_to (count, Fprogn (args)); } DEFUN ("buffer-size", Fbufsize, Sbufsize, 0, 1, 0, diff --git a/src/fileio.c b/src/fileio.c index 44696cc8e62..7466914af1c 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3480,7 +3480,7 @@ variable `last-coding-system-used' to the coding system actually used. */) Lisp_Object workbuf; struct buffer *buf; - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); + record_unwind_current_buffer (); workbuf = Fget_buffer_create (build_string (" *code-converting-work*")); buf = XBUFFER (workbuf); diff --git a/src/fns.c b/src/fns.c index b13311e26d0..f6acdcada3f 100644 --- a/src/fns.c +++ b/src/fns.c @@ -4656,7 +4656,7 @@ secure_hash (Lisp_Object algorithm, Lisp_Object object, Lisp_Object start, Lisp_ { struct buffer *prev = current_buffer; - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); + record_unwind_current_buffer (); CHECK_BUFFER (object); diff --git a/src/insdel.c b/src/insdel.c index 53a3a1370cd..8cb98566085 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -2117,7 +2117,7 @@ DEFUN ("combine-after-change-execute", Fcombine_after_change_execute, return Qnil; } - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); + record_unwind_current_buffer (); Fset_buffer (combine_after_change_buffer); diff --git a/src/keyboard.c b/src/keyboard.c index f31480e3b88..d9b88a8a911 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -9572,7 +9572,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, because we may get input from a subprocess which wants to change the selected window and stuff (say, emacsclient). */ - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); + record_unwind_current_buffer (); if (! FRAME_LIVE_P (XFRAME (selected_frame))) Fkill_emacs (Qnil); diff --git a/src/keymap.c b/src/keymap.c index 21f7dcb5d37..4031091501c 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -1570,9 +1570,7 @@ like in the respective argument of `key-binding'. */) would not be a problem here, but it is easier to keep things the same. */ - - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); - + record_unwind_current_buffer (); set_buffer_internal (XBUFFER (XWINDOW (window)->buffer)); } } diff --git a/src/minibuf.c b/src/minibuf.c index 2154d1654df..41cc48017eb 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -817,7 +817,7 @@ get_minibuffer (EMACS_INT depth) while the buffer doesn't know about them any more. */ delete_all_overlays (XBUFFER (buf)); reset_buffer (XBUFFER (buf)); - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); + record_unwind_current_buffer (); Fset_buffer (buf); if (!NILP (Ffboundp (intern ("minibuffer-inactive-mode")))) call0 (intern ("minibuffer-inactive-mode")); diff --git a/src/print.c b/src/print.c index 36d0b5dce9d..52c07c79122 100644 --- a/src/print.c +++ b/src/print.c @@ -487,7 +487,7 @@ temp_output_buffer_setup (const char *bufname) register struct buffer *old = current_buffer; register Lisp_Object buf; - record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); + record_unwind_current_buffer (); Fset_buffer (Fget_buffer_create (build_string (bufname))); diff --git a/src/process.c b/src/process.c index 64c70c49590..fbe56ebcb54 100644 --- a/src/process.c +++ b/src/process.c @@ -5196,7 +5196,7 @@ read_process_output (Lisp_Object proc, register int channel) /* There's no good reason to let process filters change the current buffer, and many callers of accept-process-output, sit-for, and friends don't expect current-buffer to be changed from under them. */ - record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); + record_unwind_current_buffer (); /* Read and dispose of the process output. */ outstream = p->filter; @@ -6587,7 +6587,7 @@ exec_sentinel (Lisp_Object proc, Lisp_Object reason) /* There's no good reason to let sentinels change the current buffer, and many callers of accept-process-output, sit-for, and friends don't expect current-buffer to be changed from under them. */ - record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); + record_unwind_current_buffer (); sentinel = p->sentinel; if (NILP (sentinel)) diff --git a/src/textprop.c b/src/textprop.c index 20d98b0e6f3..b6895fc426a 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -760,7 +760,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT. */) if (BUFFERP (object) && current_buffer != XBUFFER (object)) { - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); + record_unwind_current_buffer (); Fset_buffer (object); } @@ -843,7 +843,7 @@ position LIMIT; return LIMIT if nothing is found before reaching LIMIT. */) if (BUFFERP (object) && current_buffer != XBUFFER (object)) { - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); + record_unwind_current_buffer (); Fset_buffer (object); } diff --git a/src/undo.c b/src/undo.c index 777e3291806..9cd1d5f9f67 100644 --- a/src/undo.c +++ b/src/undo.c @@ -324,7 +324,7 @@ truncate_undo_list (struct buffer *b) /* Make the buffer current to get its local values of variables such as undo_limit. Also so that Vundo_outer_limit_function can tell which buffer to operate on. */ - record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); + record_unwind_current_buffer (); set_buffer_internal (b); list = BVAR (b, undo_list); diff --git a/src/window.c b/src/window.c index 330636efed9..ba1ec2544f8 100644 --- a/src/window.c +++ b/src/window.c @@ -3101,7 +3101,7 @@ run_window_configuration_change_hook (struct frame *f) /* Use the right buffer. Matters when running the local hooks. */ if (current_buffer != XBUFFER (Fwindow_buffer (Qnil))) { - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); + record_unwind_current_buffer (); Fset_buffer (Fwindow_buffer (Qnil)); } @@ -3205,7 +3205,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int because that might itself be a local variable. */ if (window_initialized) { - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); + record_unwind_current_buffer (); Fset_buffer (buffer); } From d44688e450495fd3b723c0f2cbdcd047c59e7384 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 28 Aug 2012 12:01:54 +0300 Subject: [PATCH 147/212] * lisp/info.el (Info-fontify-node): Hide empty lines at the end of the node. Fixes: debbugs:12272 --- lisp/ChangeLog | 5 +++++ lisp/info.el | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 25d0716ee5b..3dd2b7b1272 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-28 Juri Linkov + + * info.el (Info-fontify-node): Hide empty lines at the end of + the node. (Bug#12272) + 2012-08-27 Drew Adams * dired.el (dired-pop-to-buffer): Make window start at beginning diff --git a/lisp/info.el b/lisp/info.el index 7365b0efcfd..fe4afd72163 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -4825,6 +4825,12 @@ first line or header line, and for breadcrumb links.") mouse-face highlight help-echo "mouse-2: go to this URL")))) + ;; Hide empty lines at the end of the node. + (goto-char (point-max)) + (skip-chars-backward "\n") + (when (< (1+ (point)) (point-max)) + (put-text-property (1+ (point)) (point-max) 'invisible t)) + (set-buffer-modified-p nil)))) ;;; Speedbar support: From cc319c03f148c2c004ba390d85e9a09f452d69c1 Mon Sep 17 00:00:00 2001 From: Katsumi Yamaoka Date: Tue, 28 Aug 2012 09:40:11 +0000 Subject: [PATCH 148/212] gnus-sum.el (gnus-summary-enter-digest-group): Work for encoding and charset --- lisp/gnus/ChangeLog | 6 ++++++ lisp/gnus/gnus-sum.el | 24 ++++++++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 2a47b049c9b..4b56d351ac2 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,9 @@ +2012-08-28 Katsumi Yamaoka + + * gnus-sum.el (gnus-summary-enter-digest-group): Decode content + transfer encoding first; bind gnus-newsgroup-charset to the charset + that the article specifies (Bug#12209). + 2012-08-22 Katsumi Yamaoka * gnus-cus.el (gnus-group-customize): Decode values posting-style holds. diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 06f17bcf646..b44b953bec6 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -9137,7 +9137,7 @@ To control what happens when you exit the group, see the (list (cons 'save-article-group ogroup)))) (case-fold-search t) (buf (current-buffer)) - dig to-address) + dig to-address charset) (with-current-buffer gnus-original-article-buffer ;; Have the digest group inherit the main mail address of ;; the parent article. @@ -9150,16 +9150,32 @@ To control what happens when you exit the group, see the to-address)))))) (setq dig (nnheader-set-temp-buffer " *gnus digest buffer*")) (insert-buffer-substring gnus-original-article-buffer) - ;; Remove lines that may lead nndoc to misinterpret the - ;; document type. (narrow-to-region (goto-char (point-min)) (or (search-forward "\n\n" nil t) (point))) + ;; Remove lines that may lead nndoc to misinterpret the + ;; document type. (goto-char (point-min)) (delete-matching-lines "^Path:\\|^From ") + ;; Parse charset, and decode content transfer encoding. + (setq charset (mail-content-type-get + (mail-header-parse-content-type + (or (gnus-fetch-field "content-type") "")) + 'charset)) + (let ((encoding (gnus-fetch-field "content-transfer-encoding"))) + (when encoding + (message-remove-header "content-transfer-encoding") + (goto-char (point-max)) + (widen) + (narrow-to-region (point) (point-max)) + (mm-decode-content-transfer-encoding + (intern (downcase (mail-header-strip encoding)))))) (widen)) (unwind-protect - (if (let ((gnus-newsgroup-ephemeral-charset gnus-newsgroup-charset) + (if (let ((gnus-newsgroup-ephemeral-charset + (if charset + (intern (downcase (gnus-strip-whitespace charset))) + gnus-newsgroup-charset)) (gnus-newsgroup-ephemeral-ignored-charsets gnus-newsgroup-ignored-charsets)) (gnus-group-read-ephemeral-group From 4f2daf31078e2cc059710e129dffe0beed8fc7c2 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Tue, 28 Aug 2012 14:59:17 +0400 Subject: [PATCH 149/212] Do not allow to set major mode for a dead buffer. * buffer.c (Fset_buffer_major_mode): Signal an error if the buffer is dead. (Fother_buffer, other_buffer_safely): Remove redundant nested declaration. --- src/ChangeLog | 8 ++++++++ src/buffer.c | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 889c8efebdb..1040b93fe70 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2012-08-28 Dmitry Antipov + + Do not allow to set major mode for a dead buffer. + * buffer.c (Fset_buffer_major_mode): Signal an error + if the buffer is dead. + (Fother_buffer, other_buffer_safely): Remove redundant + nested declaration. + 2012-08-28 Dmitry Antipov Always use set_buffer_if_live to restore original buffer at unwind. diff --git a/src/buffer.c b/src/buffer.c index 61ec736ad1a..0e2e50d9f51 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1553,7 +1553,6 @@ list first, followed by the list of all buffers. If no other buffer exists, return the buffer `*scratch*' (creating it if necessary). */) (register Lisp_Object buffer, Lisp_Object visible_ok, Lisp_Object frame) { - Lisp_Object Fset_buffer_major_mode (Lisp_Object buffer); Lisp_Object tail, buf, pred; Lisp_Object notsogood = Qnil; @@ -1624,7 +1623,6 @@ exists, return the buffer `*scratch*' (creating it if necessary). */) Lisp_Object other_buffer_safely (Lisp_Object buffer) { - Lisp_Object Fset_buffer_major_mode (Lisp_Object buffer); Lisp_Object tail, buf; tail = Vbuffer_alist; @@ -2064,8 +2062,10 @@ the current buffer's major mode. */) CHECK_BUFFER (buffer); - if (STRINGP (BVAR (XBUFFER (buffer), name)) - && strcmp (SSDATA (BVAR (XBUFFER (buffer), name)), "*scratch*") == 0) + if (NILP (BVAR (XBUFFER (buffer), name))) + error ("Attempt to set major mode for a dead buffer"); + + if (strcmp (SSDATA (BVAR (XBUFFER (buffer), name)), "*scratch*") == 0) function = find_symbol_value (intern ("initial-major-mode")); else { From 457294dd118317db8dee40a44db33c51e73e4a80 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Tue, 28 Aug 2012 15:51:09 +0200 Subject: [PATCH 150/212] Remove handling of auto-buffer-name window parameter. * window.c (Fset_window_configuration): Remove handling of auto-buffer-name window parameter. --- src/ChangeLog | 5 +++++ src/window.c | 16 +--------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 1040b93fe70..4bde0cf1df8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-08-28 Martin Rudalics + + * window.c (Fset_window_configuration): Remove handling of + auto-buffer-name window parameter. + 2012-08-28 Dmitry Antipov Do not allow to set major mode for a dead buffer. diff --git a/src/window.c b/src/window.c index ba1ec2544f8..070cc2397e6 100644 --- a/src/window.c +++ b/src/window.c @@ -62,7 +62,7 @@ static Lisp_Object Qreplace_buffer_in_windows, Qget_mru_window; static Lisp_Object Qwindow_resize_root_window, Qwindow_resize_root_window_vertically; static Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command; static Lisp_Object Qsafe, Qabove, Qbelow; -static Lisp_Object Qauto_buffer_name, Qclone_of; +static Lisp_Object Qclone_of; static int displayed_window_lines (struct window *); static int count_windows (struct window *); @@ -5540,7 +5540,6 @@ the return value is nil. Otherwise the value is t. */) struct Lisp_Vector *saved_windows; Lisp_Object new_current_buffer; Lisp_Object frame; - Lisp_Object auto_buffer_name; FRAME_PTR f; ptrdiff_t old_point = -1; @@ -5794,18 +5793,6 @@ the return value is nil. Otherwise the value is t. */) BUF_PT_BYTE (XBUFFER (w->buffer))); w->start_at_line_beg = 1; } - else if (STRINGP (auto_buffer_name = - Fwindow_parameter (window, Qauto_buffer_name)) - && SCHARS (auto_buffer_name) != 0 - && (wset_buffer (w, Fget_buffer_create (auto_buffer_name)), - !NILP (w->buffer))) - { - set_marker_restricted (w->start, - make_number (0), w->buffer); - set_marker_restricted (w->pointm, - make_number (0), w->buffer); - w->start_at_line_beg = 1; - } else /* Window has no live buffer, get one. */ { @@ -6711,7 +6698,6 @@ syms_of_window (void) DEFSYM (Qtemp_buffer_show_hook, "temp-buffer-show-hook"); DEFSYM (Qabove, "above"); DEFSYM (Qbelow, "below"); - DEFSYM (Qauto_buffer_name, "auto-buffer-name"); DEFSYM (Qclone_of, "clone-of"); staticpro (&Vwindow_list); From 37b9743e79bac608a45fade0744248446aaa0a33 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Tue, 28 Aug 2012 16:09:43 +0200 Subject: [PATCH 151/212] In Fset_window_configuration install revison of reverted fix. * window.c (Fset_window_configuration): Install revision of reverted fix. --- src/ChangeLog | 3 ++- src/window.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 4bde0cf1df8..2521ddc4144 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,7 +1,8 @@ 2012-08-28 Martin Rudalics * window.c (Fset_window_configuration): Remove handling of - auto-buffer-name window parameter. + auto-buffer-name window parameter. Install revision of reverted + fix. 2012-08-28 Dmitry Antipov diff --git a/src/window.c b/src/window.c index 070cc2397e6..38124cb13a9 100644 --- a/src/window.c +++ b/src/window.c @@ -5615,6 +5615,21 @@ the return value is nil. Otherwise the value is t. */) int previous_frame_menu_bar_lines = FRAME_MENU_BAR_LINES (f); int previous_frame_tool_bar_lines = FRAME_TOOL_BAR_LINES (f); + /* Don't do this within the main loop below: This may call Lisp + code and is thus potentially unsafe while input is blocked. */ + for (k = 0; k < saved_windows->header.size; k++) + { + p = SAVED_WINDOW_N (saved_windows, k); + window = p->window; + w = XWINDOW (window); + if (!NILP (w->buffer) + && !EQ (w->buffer, p->buffer) + && !NILP (BVAR (XBUFFER (p->buffer), name))) + /* If a window we restore gets another buffer, record the + window's old buffer. */ + call1 (Qrecord_window_buffer, window); + } + /* The mouse highlighting code could get screwed up if it runs during this. */ BLOCK_INPUT; From 7f8941d8b26f373a3fc614edd29166a726bc9d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Tue, 28 Aug 2012 18:05:17 +0200 Subject: [PATCH 152/212] Improve NS dialogs. Add close button, remove ugly casts. * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize button_values to NULL. Call setStykeMask so dialogs get a close button. (windowShouldClose:): Set window_closed. (dealloc): New member, free button_values. (process_dialog:): Make member function. Remove window argument, replace window with self. Count buttons and allocate and store values in button_values. (addButton:value:row:): value is int with the name tag. Call setTag with tag. Remove return self, declare return value as void. (addString:row:): Remove return self, declare return value as void. (addSplit): Remove return self, declare return value as void. (clicked:): Remove return self, declare return value as void. Set dialog_return to button_values[seltag]. Code formatting change. (initFromContents:isQuestion:): Adjust call to process_dialog. Code formatting change. (timeout_handler:): Set timer_fired to YES. (runDialogAt:): Set timer_fired to NO. Handle click on close button as quit. * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL. Add window_closed and button_values. Add void as return value for add(Button|String|Split). addButton takes int instead of Lisp_Object. Add process_dialog as new member. --- src/ChangeLog | 26 ++++++++++++++++ src/nsmenu.m | 84 +++++++++++++++++++++++++++++---------------------- src/nsterm.h | 10 +++--- 3 files changed, 80 insertions(+), 40 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5bafa1a04f8..b5751d859c0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,29 @@ +2012-08-28 Jan Djärv + + * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize + button_values to NULL. Call setStykeMask so dialogs get a close button. + (windowShouldClose:): Set window_closed. + (dealloc): New member, free button_values. + (process_dialog:): Make member function. Remove window argument, + replace window with self. Count buttons and allocate and store values + in button_values. + (addButton:value:row:): value is int with the name tag. Call setTag + with tag. Remove return self, declare return value as void. + (addString:row:): Remove return self, declare return value as void. + (addSplit): Remove return self, declare return value as void. + (clicked:): Remove return self, declare return value as void. + Set dialog_return to button_values[seltag]. Code formatting change. + (initFromContents:isQuestion:): Adjust call to process_dialog. + Code formatting change. + (timeout_handler:): Set timer_fired to YES. + (runDialogAt:): Set timer_fired to NO. + Handle click on close button as quit. + + * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL. + Add window_closed and button_values. Add void as return value for + add(Button|String|Split). addButton takes int instead of Lisp_Object. + Add process_dialog as new member. + 2012-08-28 Eli Zaretskii * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it diff --git a/src/nsmenu.m b/src/nsmenu.m index ab285f26df2..9e290486213 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -1498,6 +1498,7 @@ @implementation EmacsDialogPanel NSImage *img; dialog_return = Qundefined; + button_values = NULL; area.origin.x = 3*SPACER; area.origin.y = 2*SPACER; area.size.width = ICONSIZE; @@ -1579,44 +1580,65 @@ @implementation EmacsDialogPanel [self setOneShot: YES]; [self setReleasedWhenClosed: YES]; [self setHidesOnDeactivate: YES]; + [self setStyleMask: + NSTitledWindowMask|NSClosableWindowMask|NSUtilityWindowMask]; + return self; } - (BOOL)windowShouldClose: (id)sender { + window_closed = YES; [NSApp stop:self]; return NO; } - -void process_dialog (id window, Lisp_Object list) +- (void)dealloc { - Lisp_Object item; + xfree (button_values); + [super dealloc]; +} + +- (void)process_dialog: (Lisp_Object) list +{ + Lisp_Object item, lst = list; int row = 0; + int buttons = 0, btnnr = 0; + + for (; XTYPE (lst) == Lisp_Cons; lst = XCDR (lst)) + { + item = XCAR (list); + if (XTYPE (item) == Lisp_Cons) + ++buttons; + } + + if (buttons > 0) + button_values = (Lisp_Object *) xmalloc (buttons * sizeof (*button_values)); for (; XTYPE (list) == Lisp_Cons; list = XCDR (list)) { item = XCAR (list); if (XTYPE (item) == Lisp_String) { - [window addString: SSDATA (item) row: row++]; + [self addString: SSDATA (item) row: row++]; } else if (XTYPE (item) == Lisp_Cons) { - [window addButton: SSDATA (XCAR (item)) - value: XCDR (item) row: row++]; + button_values[btnnr] = XCDR (item); + [self addButton: SSDATA (XCAR (item)) value: btnnr row: row++]; + ++btnnr; } else if (NILP (item)) { - [window addSplit]; + [self addSplit]; row = 0; } } } -- addButton: (char *)str value: (Lisp_Object)val row: (int)row +- (void)addButton: (char *)str value: (int)tag row: (int)row { id cell; @@ -1629,15 +1651,13 @@ void process_dialog (id window, Lisp_Object list) [cell setTarget: self]; [cell setAction: @selector (clicked: )]; [cell setTitle: [NSString stringWithUTF8String: str]]; - [cell setTag: XHASH (val)]; // FIXME: BIG UGLY HACK!! + [cell setTag: tag]; [cell setBordered: YES]; [cell setEnabled: YES]; - - return self; } -- addString: (char *)str row: (int)row +- (void)addString: (char *)str row: (int)row { id cell; @@ -1650,36 +1670,28 @@ void process_dialog (id window, Lisp_Object list) [cell setTitle: [NSString stringWithUTF8String: str]]; [cell setBordered: YES]; [cell setEnabled: NO]; - - return self; } -- addSplit +- (void)addSplit { [matrix addColumn]; cols++; - return self; } -- clicked: sender +- (void)clicked: sender { NSArray *sellist = nil; EMACS_INT seltag; sellist = [sender selectedCells]; - if ([sellist count]<1) - return self; + if ([sellist count] < 1) + return; seltag = [[sellist objectAtIndex: 0] tag]; - if (seltag != XHASH (Qundefined)) // FIXME: BIG UGLY HACK!! - { - dialog_return = seltag; - [NSApp stop:self]; - } - - return self; + dialog_return = button_values[seltag]; + [NSApp stop:self]; } @@ -1691,7 +1703,7 @@ void process_dialog (id window, Lisp_Object list) if (XTYPE (contents) == Lisp_Cons) { head = Fcar (contents); - process_dialog (self, Fcdr (contents)); + [self process_dialog: Fcdr (contents)]; } else head = contents; @@ -1711,7 +1723,7 @@ void process_dialog (id window, Lisp_Object list) if (cols == 1 && rows > 1) /* Never told where to split */ { [matrix addColumn]; - for (i = 0; i. */ NSTextField *title; NSMatrix *matrix; int rows, cols; - int timer_fired; + BOOL timer_fired, window_closed; Lisp_Object dialog_return; + Lisp_Object *button_values; } - initFromContents: (Lisp_Object)menu isQuestion: (BOOL)isQ; -- addButton: (char *)str value: (Lisp_Object)val row: (int)row; -- addString: (char *)str row: (int)row; -- addSplit; +- (void)process_dialog: (Lisp_Object)list; +- (void)addButton: (char *)str value: (int)tag row: (int)row; +- (void)addString: (char *)str row: (int)row; +- (void)addSplit; - (Lisp_Object)runDialogAt: (NSPoint)p; - (void)timeout_handler: (NSTimer *)timedEntry; @end From 01e0f0f5d7fd9143d561826ec54afef2a19d80d8 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Tue, 28 Aug 2012 18:08:50 +0200 Subject: [PATCH 153/212] * admin/charsets/mule-charsets.el (header): Fix typo. * etc/charsets/MULE-ethiopic.map: Fix typo in comment. * etc/charsets/MULE-ipa.map: Likewise. * etc/charsets/MULE-is13194.map: Likewise. * etc/charsets/MULE-lviscii.map: Likewise. * etc/charsets/MULE-sisheng.map: Likewise. * etc/charsets/MULE-tibetan.map: Likewise. * etc/charsets/MULE-uviscii.map: Likewise. --- admin/ChangeLog | 4 ++++ admin/charsets/mule-charsets.el | 2 +- etc/ChangeLog | 10 ++++++++++ etc/charsets/MULE-ethiopic.map | 2 +- etc/charsets/MULE-ipa.map | 2 +- etc/charsets/MULE-is13194.map | 2 +- etc/charsets/MULE-lviscii.map | 2 +- etc/charsets/MULE-sisheng.map | 2 +- etc/charsets/MULE-tibetan.map | 2 +- etc/charsets/MULE-uviscii.map | 2 +- 10 files changed, 22 insertions(+), 8 deletions(-) diff --git a/admin/ChangeLog b/admin/ChangeLog index 0c674b91ea4..1bbce2ea87a 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,7 @@ +2012-08-28 Andreas Schwab + + * charsets/mule-charsets.el (header): Fix typo. + 2012-08-24 Paul Eggert On assertion failure, print backtrace if available. diff --git a/admin/charsets/mule-charsets.el b/admin/charsets/mule-charsets.el index 9ac08bef724..4a48d994b1b 100644 --- a/admin/charsets/mule-charsets.el +++ b/admin/charsets/mule-charsets.el @@ -45,7 +45,7 @@ (defconst header (format - "# Generated by running amdin/charsets/mule-charsets.el in Emacs %d.%d.\n" + "# Generated by running admin/charsets/mule-charsets.el in Emacs %d.%d.\n" emacs-major-version emacs-minor-version)) (dolist (elt charset-alist) diff --git a/etc/ChangeLog b/etc/ChangeLog index 452a99d2d9b..11aba88c6a1 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,13 @@ +2012-08-28 Andreas Schwab + + * charsets/MULE-ethiopic.map: Fix typo in comment. + * charsets/MULE-ipa.map: Likewise. + * charsets/MULE-is13194.map: Likewise. + * charsets/MULE-lviscii.map: Likewise. + * charsets/MULE-sisheng.map: Likewise. + * charsets/MULE-tibetan.map: Likewise. + * charsets/MULE-uviscii.map: Likewise. + 2012-08-09 Chong Yidong * images/splash.svg, images/splash.png: Tweak SVG paths to improve diff --git a/etc/charsets/MULE-ethiopic.map b/etc/charsets/MULE-ethiopic.map index d2720bd10ba..30cf5736763 100644 --- a/etc/charsets/MULE-ethiopic.map +++ b/etc/charsets/MULE-ethiopic.map @@ -1,4 +1,4 @@ -# Generated by running amdin/charsets/mule-charsets.el in Emacs 22.3. +# Generated by running admin/charsets/mule-charsets.el in Emacs 22.3. 0x2121 0x1200 0x2122 0x1201 0x2123 0x1202 diff --git a/etc/charsets/MULE-ipa.map b/etc/charsets/MULE-ipa.map index 35e5d50ecec..0a6c61d5a95 100644 --- a/etc/charsets/MULE-ipa.map +++ b/etc/charsets/MULE-ipa.map @@ -1,4 +1,4 @@ -# Generated by running amdin/charsets/mule-charsets.el in Emacs 22.3. +# Generated by running admin/charsets/mule-charsets.el in Emacs 22.3. 0x20 0x0069 0x21 0x026A 0x22 0x0065 diff --git a/etc/charsets/MULE-is13194.map b/etc/charsets/MULE-is13194.map index 1fa9b21dcf8..390132cd375 100644 --- a/etc/charsets/MULE-is13194.map +++ b/etc/charsets/MULE-is13194.map @@ -1,4 +1,4 @@ -# Generated by running amdin/charsets/mule-charsets.el in Emacs 22.3. +# Generated by running admin/charsets/mule-charsets.el in Emacs 22.3. 0x21 0x0901 0x22 0x0902 0x23 0x0903 diff --git a/etc/charsets/MULE-lviscii.map b/etc/charsets/MULE-lviscii.map index 3b6a38be616..e4d2eca90ac 100644 --- a/etc/charsets/MULE-lviscii.map +++ b/etc/charsets/MULE-lviscii.map @@ -1,4 +1,4 @@ -# Generated by running amdin/charsets/mule-charsets.el in Emacs 22.3. +# Generated by running admin/charsets/mule-charsets.el in Emacs 22.3. 0x21 0x1EAF 0x22 0x1EB1 0x23 0x1EB7 diff --git a/etc/charsets/MULE-sisheng.map b/etc/charsets/MULE-sisheng.map index 405bb1ffa2c..144a3ff5134 100644 --- a/etc/charsets/MULE-sisheng.map +++ b/etc/charsets/MULE-sisheng.map @@ -1,4 +1,4 @@ -# Generated by running amdin/charsets/mule-charsets.el in Emacs 22.3. +# Generated by running admin/charsets/mule-charsets.el in Emacs 22.3. 0x21 0x0101 0x22 0x00E1 0x23 0x01CE diff --git a/etc/charsets/MULE-tibetan.map b/etc/charsets/MULE-tibetan.map index 0d6ff3a0a39..b885585c094 100644 --- a/etc/charsets/MULE-tibetan.map +++ b/etc/charsets/MULE-tibetan.map @@ -1,4 +1,4 @@ -# Generated by running amdin/charsets/mule-charsets.el in Emacs 22.3. +# Generated by running admin/charsets/mule-charsets.el in Emacs 22.3. 0x2130 0x0F00 0x2131 0x0F01 0x2132 0x0F02 diff --git a/etc/charsets/MULE-uviscii.map b/etc/charsets/MULE-uviscii.map index 65e5d2968e5..dc19583bdfe 100644 --- a/etc/charsets/MULE-uviscii.map +++ b/etc/charsets/MULE-uviscii.map @@ -1,4 +1,4 @@ -# Generated by running amdin/charsets/mule-charsets.el in Emacs 22.3. +# Generated by running admin/charsets/mule-charsets.el in Emacs 22.3. 0x21 0x1EAE 0x22 0x1EB0 0x23 0x1EB6 From a3f90bea8edc75b7543a06170e5a7521163bbf4e Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 28 Aug 2012 15:26:41 -0400 Subject: [PATCH 154/212] * admin/bzrmerge.el (bzrmerge-merges): Allow unversioned files in the tree. --- admin/ChangeLog | 4 ++++ admin/bzrmerge.el | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/admin/ChangeLog b/admin/ChangeLog index 1bbce2ea87a..145028ec815 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,7 @@ +2012-08-28 Glenn Morris + + * bzrmerge.el (bzrmerge-merges): Allow unversioned files in the tree. + 2012-08-28 Andreas Schwab * charsets/mule-charsets.el (header): Fix typo. diff --git a/admin/bzrmerge.el b/admin/bzrmerge.el index e174312143d..8d64dd9edbf 100644 --- a/admin/bzrmerge.el +++ b/admin/bzrmerge.el @@ -45,16 +45,23 @@ The list returned is sorted by oldest-first." (erase-buffer) ;; We generally want to make sure we start with a clean tree, but we also ;; want to allow restarts (i.e. with some part of FROM already merged but - ;; not yet committed). + ;; not yet committed). Unversioned (unknown) files in the tree + ;; are also ok. (call-process "bzr" nil t nil "status" "-v") (goto-char (point-min)) (when (re-search-forward "^conflicts:\n" nil t) (error "You still have unresolved conflicts")) - (let ((merges ())) + (let ((merges ()) + found) (if (not (re-search-forward "^pending merges:\n" nil t)) (when (save-excursion (goto-char (point-min)) - (re-search-forward "^[a-z ]*:\n" nil t)) + (while (and + (re-search-forward "^\\([a-z ]*\\):\n" nil t) + (not + (setq found + (not (equal "unknown" (match-string 1))))))) + found) (error "You still have uncommitted changes")) ;; This is really stupid, but it seems there's no easy way to figure ;; out which revisions have been merged already. The only info I can From 9fba804b9ecca10dc33bd5508bd4fed4ebba3cc7 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 28 Aug 2012 15:35:35 -0400 Subject: [PATCH 155/212] * lisp/emacs-lisp/cl-lib.el (buffer-string): Fix setter macro. Fixes: debbugs:12293 --- lisp/ChangeLog | 36 ++++++++++++++++++++---------------- lisp/emacs-lisp/cl-lib.el | 3 ++- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5d05f3b8f3a..72eafdca639 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-08-28 Stefan Monnier + + * emacs-lisp/cl-lib.el (buffer-string): Fix setter macro (bug#12293). + 2012-08-28 Leo Liu * progmodes/sh-script.el (sh-dynamic-complete-functions): Adapt to @@ -53,8 +57,8 @@ 2012-08-26 Chong Yidong - * progmodes/gdb-mi.el (gdb-display-buffer-other-frame-action): New - variable, replacing gdb-frame-parameters. + * progmodes/gdb-mi.el (gdb-display-buffer-other-frame-action): + New variable, replacing gdb-frame-parameters. (gdb-frame-io-buffer, gdb-frame-breakpoints-buffer) (gdb-frame-threads-buffer, gdb-frame-memory-buffer) (gdb-frame-disassembly-buffer, gdb-frame-stack-buffer) @@ -130,17 +134,17 @@ 2012-08-22 Martin Rudalics - * window.el (walk-window-tree, window-with-parameter): New - optional argument MINIBUF to control whether these functions + * window.el (walk-window-tree, window-with-parameter): + New optional argument MINIBUF to control whether these functions should run on the minibuffer window. (window-at-side-list): Don't operate on minibuffer window. (window-in-direction): Simplify and rewrite doc-string. - (window--size-ignore): Rename to window--size-ignore-p. Update - callers. + (window--size-ignore): Rename to window--size-ignore-p. + Update callers. (display-buffer-in-atom-window, window--major-non-side-window) (window--major-side-window, display-buffer-in-major-side-window) - (delete-side-window, display-buffer-in-side-window): New - functions. + (delete-side-window, display-buffer-in-side-window): + New functions. (window--side-check, window-deletable-p, delete-window) (delete-other-windows, split-window): Handle side windows and atomic windows appropriately. @@ -192,8 +196,8 @@ * window.el (window-point-1, set-window-point-1): Remove. (window-in-direction, record-window-buffer) (set-window-buffer-start-and-point, split-window-below) - (window--state-get-1, display-buffer-record-window): Replace - calls to window-point-1 and set-window-point-1 by calls to + (window--state-get-1, display-buffer-record-window): + Replace calls to window-point-1 and set-window-point-1 by calls to window-point and set-window-point respectively. 2012-08-21 Glenn Morris @@ -311,8 +315,8 @@ (yank-excluded-properties): Add font-lock-face and category. (yank): Doc fix. - * subr.el (remove-yank-excluded-properties): Obey - yank-handled-properties. The special handling of font-lock-face + * subr.el (remove-yank-excluded-properties): + Obey yank-handled-properties. The special handling of font-lock-face and category is now done this way, instead of being hard-coded. (insert-for-yank-1): Remove font-lock-face handling. (yank-handle-font-lock-face-property) @@ -326,8 +330,8 @@ 2012-08-17 Michael Albinus - * net/tramp-sh.el (tramp-sh-handle-start-file-process): Eliminate - superfluous prompt. (Bug#12203) + * net/tramp-sh.el (tramp-sh-handle-start-file-process): + Eliminate superfluous prompt. (Bug#12203) 2012-08-17 Chong Yidong @@ -354,8 +358,8 @@ (next-buffer, previous-buffer, split-window, balance-windows-2) (set-window-text-height, window-buffer-height) (fit-window-to-buffer, shrink-window-if-larger-than-buffer) - (truncated-partial-width-window-p): Minor code adjustments. In - doc-strings state whether the argument window has to denote a + (truncated-partial-width-window-p): Minor code adjustments. + In doc-strings state whether the argument window has to denote a live, valid or any window. 2012-08-16 Phil Sainty (tiny change) diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index 86497a3c73f..7239b5bd8ca 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el @@ -635,7 +635,8 @@ If ALIST is non-nil, the new pairs are prepended to it." (set-buffer-modified-p ,flag))) (gv-define-simple-setter buffer-name rename-buffer t) (gv-define-setter buffer-string (store) - `(progn (erase-buffer) (insert ,store))) + ;; Eval `store' first since it may look at the buffer. + (macroexp-let2 nil s store `(progn (erase-buffer) (insert ,s)))) (gv-define-simple-setter buffer-substring cl--set-buffer-substring) (gv-define-simple-setter current-buffer set-buffer) (gv-define-simple-setter current-case-table set-case-table) From d5e2bcd3514bbf1a4e7022efd3b6555379d690a8 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 28 Aug 2012 16:14:21 -0400 Subject: [PATCH 156/212] * cl-lib.el (buffer-string): Simplify last change. Fixes: debbugs:12293 --- lisp/emacs-lisp/cl-lib.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index 7239b5bd8ca..532c81c502c 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el @@ -635,8 +635,7 @@ If ALIST is non-nil, the new pairs are prepended to it." (set-buffer-modified-p ,flag))) (gv-define-simple-setter buffer-name rename-buffer t) (gv-define-setter buffer-string (store) - ;; Eval `store' first since it may look at the buffer. - (macroexp-let2 nil s store `(progn (erase-buffer) (insert ,s)))) + `(insert (prog1 ,store (erase-buffer)))) (gv-define-simple-setter buffer-substring cl--set-buffer-substring) (gv-define-simple-setter current-buffer set-buffer) (gv-define-simple-setter current-case-table set-case-table) From c2c43c2382db292bfe3cccbccad4386f81f9c8a4 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Wed, 29 Aug 2012 14:49:44 +0200 Subject: [PATCH 157/212] * eshell/esh-ext.el (eshell-external-command): Do not examine remote shell scripts. See . * net/tramp-sh.el (tramp-remote-path): Add "/sbin" and "/usr/local/sbin". --- lisp/ChangeLog | 9 +++++++++ lisp/eshell/esh-ext.el | 6 +++++- lisp/net/tramp-sh.el | 6 +++--- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 72eafdca639..bfca3f073f2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2012-08-29 Michael Albinus + + * eshell/esh-ext.el (eshell-external-command): Do not examine + remote shell scripts. See + . + + * net/tramp-sh.el (tramp-remote-path): Add "/sbin" and + "/usr/local/sbin". + 2012-08-28 Stefan Monnier * emacs-lisp/cl-lib.el (buffer-string): Fix setter macro (bug#12293). diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el index 52df1587d5f..f9f9b1a558f 100644 --- a/lisp/eshell/esh-ext.el +++ b/lisp/eshell/esh-ext.el @@ -209,7 +209,11 @@ causing the user to wonder if anything's really going on..." (setq args (eshell-stringify-list (eshell-flatten-list args))) ;; (if (file-remote-p default-directory) ;; (eshell-remote-command command args)) - (let ((interp (eshell-find-interpreter command))) + (let ((interp (eshell-find-interpreter + command + ;; Do not examine remote shell scripts. + (or (and (stringp command) (file-remote-p command)) + (file-remote-p default-directory))))) (cl-assert interp) (if (functionp (car interp)) (apply (car interp) (append (cdr interp) args)) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 6283188d46a..2c1af3e83fa 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -512,9 +512,9 @@ detected as prompt when being sent on echoing hosts, therefore.") ;; IRIX64: /usr/bin ;;;###tramp-autoload (defcustom tramp-remote-path - '(tramp-default-remote-path "/bin" "/usr/bin" "/usr/sbin" - "/usr/local/bin" "/local/bin" "/local/freeware/bin" "/local/gnu/bin" - "/usr/freeware/bin" "/usr/pkg/bin" "/usr/contrib/bin" + '(tramp-default-remote-path "/bin" "/usr/bin" "/sbin" "/usr/sbin" + "/usr/local/bin" "/usr/local/sbin" "/local/bin" "/local/freeware/bin" + "/local/gnu/bin" "/usr/freeware/bin" "/usr/pkg/bin" "/usr/contrib/bin" "/opt/bin" "/opt/sbin" "/opt/local/bin") "List of directories to search for executables on remote host. For every remote host, this variable will be set buffer local, From 35e62fc984b108f717c5525ffecf60586eb0737e Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 29 Aug 2012 11:11:51 -0400 Subject: [PATCH 158/212] * lisp/files.el (read-only-mode): New minor mode. (toggle-read-only): Use it and mark obsolete. (find-file--read-only): * lisp/vc/vc.el (vc-next-action, vc-checkout): * lisp/vc/vc-cvs.el (vc-cvs-checkout): * lisp/obsolete/vc-mcvs.el (vc-mcvs-update): * lisp/ffap.el (ffap--toggle-read-only): Update callers. --- etc/NEWS | 2 ++ lisp/ChangeLog | 10 ++++++++ lisp/emacs-lisp/gv.el | 5 ++-- lisp/ffap.el | 2 +- lisp/files.el | 55 +++++++++++++++------------------------- lisp/ibuffer.el | 2 +- lisp/obsolete/vc-mcvs.el | 2 +- lisp/vc/vc-cvs.el | 2 +- lisp/vc/vc.el | 4 +-- 9 files changed, 42 insertions(+), 42 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index fb8722ab8f8..1da3931813b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -588,6 +588,8 @@ are deprecated and will be removed eventually. * Lisp changes in Emacs 24.3 +** New minor mode `read-only-mode' to replace toggle-read-only (now obsolete). + ** New functions `autoloadp' and `autoload-do-load'. ** New function `posnp' to test if an object is a `posn'. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bfca3f073f2..48403c7f046 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2012-08-29 Stefan Monnier + + * files.el (read-only-mode): New minor mode. + (toggle-read-only): Use it and mark obsolete. + (find-file--read-only): + * vc/vc.el (vc-next-action, vc-checkout): + * vc/vc-cvs.el (vc-cvs-checkout): + * obsolete/vc-mcvs.el (vc-mcvs-update): + * ffap.el (ffap--toggle-read-only): Update callers. + 2012-08-29 Michael Albinus * eshell/esh-ext.el (eshell-external-command): Do not examine diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index d1f997c99c4..4caa0a73866 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -191,8 +191,9 @@ well for simple place forms. Assignments of VAL to (NAME ARGS...) are expanded by binding the argument forms (VAL ARGS...) according to ARGLIST, then executing BODY, which must return a Lisp form that does the assignment. -Actually, ARGLIST may be bound to temporary variables which are introduced -automatically to preserve proper execution order of the arguments. Example: +The first arg in ARLIST (the one that receives VAL) receives an expression +which can do arbitrary things, whereas the other arguments are all guaranteed +to be pure and copyable. Example use: (gv-define-setter aref (v a i) `(aset ,a ,i ,v))" (declare (indent 2) (debug (&define name sexp body))) `(gv-define-expander ,name diff --git a/lisp/ffap.el b/lisp/ffap.el index d0f3b639cf2..ebe8b6dee94 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1703,7 +1703,7 @@ Only intended for interactive use." buffer-or-list (list buffer-or-list))) (with-current-buffer buffer - (toggle-read-only 1)))) + (read-only-mode 1)))) (defun ffap-read-only () "Like `ffap', but mark buffer as read-only. diff --git a/lisp/files.el b/lisp/files.el index fecb02020e6..5c8e1ef396b 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1456,7 +1456,7 @@ file names with wildcards." (file-exists-p filename)) (error "%s does not exist" filename)) (let ((value (funcall fun filename wildcards))) - (mapc (lambda (b) (with-current-buffer b (toggle-read-only 1))) + (mapc (lambda (b) (with-current-buffer b (read-only-mode 1))) (if (listp value) value (list value))) value)) @@ -4818,18 +4818,11 @@ prints a message in the minibuffer. Instead, use `set-buffer-modified-p'." "Modification-flag cleared")) (set-buffer-modified-p arg)) -(defun toggle-read-only (&optional arg message) - "Toggle the read-only state of the current buffer. +(define-minor-mode read-only-mode + "Change whether the current buffer is read-only. With prefix argument ARG, make the buffer read-only if ARG is -positive; otherwise make it writable. - -When making the buffer read-only, enable View mode if -`view-read-only' is non-nil. When making the buffer writable, -disable View mode if View mode is enabled. - -If called interactively, or if called from Lisp with MESSAGE -non-nil, print a message reporting the buffer's new read-only -status. +positive, otherwise make it writable. If buffer is read-only +and `view-read-only' is non-nil, enter view mode. Do not call this from a Lisp program unless you really intend to do the same thing as the \\[toggle-read-only] command, including @@ -4839,30 +4832,24 @@ does not affect read-only regions caused by text properties. To ignore read-only status in a Lisp program (whether due to text properties or buffer state), bind `inhibit-read-only' temporarily to a non-nil value." - (interactive "P") + :variable buffer-read-only (cond - ;; Do nothing if `buffer-read-only' already matches the state - ;; specified by ARG. - ((and arg - (if (> (prefix-numeric-value arg) 0) - buffer-read-only - (not buffer-read-only)))) - ;; If View mode is enabled, exit it. - ((and buffer-read-only view-mode) + ((and (not buffer-read-only) view-mode) (View-exit-and-edit) - (set (make-local-variable 'view-read-only) t)) - ;; If `view-read-only' is non-nil, enable View mode. - ((and view-read-only - (not buffer-read-only) - (not view-mode) - (not (eq (get major-mode 'mode-class) 'special))) - (view-mode-enter)) - ;; The usual action: flip `buffer-read-only'. - (t (setq buffer-read-only (not buffer-read-only)) - (force-mode-line-update))) - (if (or message (called-interactively-p 'interactive)) - (message "Read-only %s for this buffer" - (if buffer-read-only "enabled" "disabled")))) + (make-local-variable 'view-read-only) + (setq view-read-only t)) ; Must leave view mode. + ((and buffer-read-only view-read-only + ;; If view-mode is already active, `view-mode-enter' is a nop. + (not view-mode) + (not (eq (get major-mode 'mode-class) 'special))) + (view-mode-enter)))) + +(defun toggle-read-only (&optional arg interactive) + (declare (obsolete read-only-mode "24.3")) + (interactive (list current-prefix-arg t)) + (if interactive + (call-interactively 'read-only-mode) + (read-only-mode (or arg 'toggle)))) (defun insert-file (filename) "Insert contents of file FILENAME into buffer after point. diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 648c4c3b0af..c6e799252a2 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -2401,7 +2401,7 @@ Operations on marked buffers: buffer's file as an argument. '\\[ibuffer-do-eval]' - Evaluate a form in each of the marked buffers. This is a very flexible command. For example, if you want to make all - of the marked buffers read only, try using (toggle-read-only 1) as + of the marked buffers read only, try using (read-only-mode 1) as the input form. '\\[ibuffer-do-view-and-eval]' - As above, but view each buffer while the form is evaluated. diff --git a/lisp/obsolete/vc-mcvs.el b/lisp/obsolete/vc-mcvs.el index 94db90f1d6a..78221945073 100644 --- a/lisp/obsolete/vc-mcvs.el +++ b/lisp/obsolete/vc-mcvs.el @@ -329,7 +329,7 @@ This is only possible if Meta-CVS is responsible for FILE's directory.") (if vc-mcvs-use-edit (vc-mcvs-command nil 0 file "edit") (set-file-modes file (logior (file-modes file) 128)) - (if (equal file buffer-file-name) (toggle-read-only -1)))) + (if (equal file buffer-file-name) (read-only-mode -1)))) ;; Check out a particular revision (or recreate the file). (vc-file-setprop file 'vc-working-revision nil) (apply 'vc-mcvs-command nil 0 file diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index c1c4b750267..ae1a3cf92f8 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el @@ -394,7 +394,7 @@ REV is the revision to check out." (if vc-cvs-use-edit (vc-cvs-command nil 0 file "edit") (set-file-modes file (logior (file-modes file) 128)) - (if (equal file buffer-file-name) (toggle-read-only -1)))) + (if (equal file buffer-file-name) (read-only-mode -1)))) ;; Check out a particular revision (or recreate the file). (vc-file-setprop file 'vc-working-revision nil) (apply 'vc-cvs-command nil 0 file diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index ddb9565544d..1ef4faaa008 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1133,7 +1133,7 @@ For old-style locking-based version control systems, like RCS: (let ((visited (get-file-buffer file))) (when visited (with-current-buffer visited - (toggle-read-only -1)))))) + (read-only-mode -1)))))) ;; Allow user to revert files with no changes (save-excursion (dolist (file files) @@ -1344,7 +1344,7 @@ After check-out, runs the normal hook `vc-checkout-hook'." ;; Maybe the backend is not installed ;-( (when writable (let ((buf (get-file-buffer file))) - (when buf (with-current-buffer buf (toggle-read-only -1))))) + (when buf (with-current-buffer buf (read-only-mode -1))))) (signal (car err) (cdr err)))) `((vc-state . ,(if (or (eq (vc-checkout-model backend (list file)) 'implicit) (not writable)) From af070a1c6a6373b0c854ffb94ab67aaef9582bab Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 29 Aug 2012 13:36:49 -0400 Subject: [PATCH 159/212] * lisp/simple.el (read-only-mode): Move from lisp/files.el for bootstrapping. * files.el (read-only-mode): Move to simple.el. --- lisp/ChangeLog | 3 +++ lisp/files.el | 26 -------------------------- lisp/simple.el | 26 ++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 26 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 48403c7f046..64ccde6705e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-08-29 Stefan Monnier + * simple.el (read-only-mode): Move from files.el for bootstrapping. + * files.el (read-only-mode): Move to simple.el. + * files.el (read-only-mode): New minor mode. (toggle-read-only): Use it and mark obsolete. (find-file--read-only): diff --git a/lisp/files.el b/lisp/files.el index 5c8e1ef396b..ef7f8e43a41 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4818,32 +4818,6 @@ prints a message in the minibuffer. Instead, use `set-buffer-modified-p'." "Modification-flag cleared")) (set-buffer-modified-p arg)) -(define-minor-mode read-only-mode - "Change whether the current buffer is read-only. -With prefix argument ARG, make the buffer read-only if ARG is -positive, otherwise make it writable. If buffer is read-only -and `view-read-only' is non-nil, enter view mode. - -Do not call this from a Lisp program unless you really intend to -do the same thing as the \\[toggle-read-only] command, including -possibly enabling or disabling View mode. Also, note that this -command works by setting the variable `buffer-read-only', which -does not affect read-only regions caused by text properties. To -ignore read-only status in a Lisp program (whether due to text -properties or buffer state), bind `inhibit-read-only' temporarily -to a non-nil value." - :variable buffer-read-only - (cond - ((and (not buffer-read-only) view-mode) - (View-exit-and-edit) - (make-local-variable 'view-read-only) - (setq view-read-only t)) ; Must leave view mode. - ((and buffer-read-only view-read-only - ;; If view-mode is already active, `view-mode-enter' is a nop. - (not view-mode) - (not (eq (get major-mode 'mode-class) 'special))) - (view-mode-enter)))) - (defun toggle-read-only (&optional arg interactive) (declare (obsolete read-only-mode "24.3")) (interactive (list current-prefix-arg t)) diff --git a/lisp/simple.el b/lisp/simple.el index 1080757f7d2..7673e4c5d6e 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -6961,6 +6961,32 @@ See also `normal-erase-is-backspace'." (defvar vis-mode-saved-buffer-invisibility-spec nil "Saved value of `buffer-invisibility-spec' when Visible mode is on.") +(define-minor-mode read-only-mode + "Change whether the current buffer is read-only. +With prefix argument ARG, make the buffer read-only if ARG is +positive, otherwise make it writable. If buffer is read-only +and `view-read-only' is non-nil, enter view mode. + +Do not call this from a Lisp program unless you really intend to +do the same thing as the \\[toggle-read-only] command, including +possibly enabling or disabling View mode. Also, note that this +command works by setting the variable `buffer-read-only', which +does not affect read-only regions caused by text properties. To +ignore read-only status in a Lisp program (whether due to text +properties or buffer state), bind `inhibit-read-only' temporarily +to a non-nil value." + :variable buffer-read-only + (cond + ((and (not buffer-read-only) view-mode) + (View-exit-and-edit) + (make-local-variable 'view-read-only) + (setq view-read-only t)) ; Must leave view mode. + ((and buffer-read-only view-read-only + ;; If view-mode is already active, `view-mode-enter' is a nop. + (not view-mode) + (not (eq (get major-mode 'mode-class) 'special))) + (view-mode-enter)))) + (define-minor-mode visible-mode "Toggle making all invisible text temporarily visible (Visible mode). With a prefix argument ARG, enable Visible mode if ARG is From f0019ede635edc3c5898d6297f4e25769a1ad7c1 Mon Sep 17 00:00:00 2001 From: Martin Blais Date: Wed, 29 Aug 2012 14:15:12 -0400 Subject: [PATCH 160/212] * lisp/progmodes/compile.el (compilation-always-kill): New var. (compilation-start): Use it. --- etc/NEWS | 2 ++ lisp/ChangeLog | 5 +++++ lisp/progmodes/compile.el | 8 ++++++++ 3 files changed, 15 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index 1da3931813b..e17846cc4d0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -207,6 +207,8 @@ It copies the region-rectangle as the last rectangle kill. * Changes in Specialized Modes and Packages in Emacs 24.3 +** Compilation has a new `compilation-always-kill' configuration variable. + ** Term changes The variables `term-default-fg-color' and `term-default-bg-color' are diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 64ccde6705e..0fd323a6a2c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-29 Martin Blais (tiny change) + + * progmodes/compile.el (compilation-always-kill): New var. + (compilation-start): Use it. + 2012-08-29 Stefan Monnier * simple.el (read-only-mode): Move from files.el for bootstrapping. diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index eb966e8a90d..83f31d5c8d5 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1503,6 +1503,13 @@ Otherwise, construct a buffer name from NAME-OF-MODE." (compilation-start command nil name-function highlight-regexp))) (make-obsolete 'compile-internal 'compilation-start "22.1") +(defcustom compilation-always-kill nil + "If nil, ask to kill compilation. If 't, always kill an +incomplete compilation before starting a new one." + :type 'boolean + :version "24.3" + :group 'compilation) + ;;;###autoload (defun compilation-start (command &optional mode name-function highlight-regexp) "Run compilation command COMMAND (low level interface). @@ -1537,6 +1544,7 @@ Returns the compilation buffer created." (let ((comp-proc (get-buffer-process (current-buffer)))) (if comp-proc (if (or (not (eq (process-status comp-proc) 'run)) + compilation-always-kill (yes-or-no-p (format "A %s process is running; kill it? " name-of-mode))) From 966560123e15a30174313673b00c16ce6b692aa6 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 29 Aug 2012 22:04:05 +0000 Subject: [PATCH 161/212] Add gnus-notifications.el --- lisp/gnus/ChangeLog | 6 ++ lisp/gnus/gnus-notifications.el | 157 ++++++++++++++++++++++++++++++++ 2 files changed, 163 insertions(+) create mode 100644 lisp/gnus/gnus-notifications.el diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 4b56d351ac2..4db752f13a4 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,9 @@ +2012-08-29 Julien Danjou + + * gnus-notifications.el: New file. + (gnus-notifications-notify): New function. + (gnus-notifications): Use `gnus-notifications-notify'. + 2012-08-28 Katsumi Yamaoka * gnus-sum.el (gnus-summary-enter-digest-group): Decode content diff --git a/lisp/gnus/gnus-notifications.el b/lisp/gnus/gnus-notifications.el new file mode 100644 index 00000000000..8811b47ba42 --- /dev/null +++ b/lisp/gnus/gnus-notifications.el @@ -0,0 +1,157 @@ +;; gnus-notifications.el -- Send notification on new message in Gnus + +;; Copyright (C) 2012 Free Software Foundation, Inc. + +;; Author: Julien Danjou +;; Keywords: news + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;; This implements notifications using `notifications-notify' on new +;; messages received. +;; Use (add-hook 'gnus-after-getting-new-news-hook 'gnus-notifications) +;; to get notifications just after getting the new news. + +;;; Code: + +(require 'notifications nil t) +(require 'gnus-sum) +(require 'gnus-group) +(require 'gnus-int) +(require 'gnus-art) +(require 'gnus-util) +(require 'google-contacts nil t) ; Optional + +(defgroup gnus-notifications nil + "Send notifications on new message in Gnus." + :group 'gnus) + +(defcustom gnus-notifications-use-google-contacts t + "Use Google Contacts to retrieve photo." + :type 'boolean + :group 'gnus-notifications) + +(defcustom gnus-notifications-use-gravatar t + "Use Gravatar to retrieve photo." + :type 'boolean + :group 'gnus-notifications) + +(defcustom gnus-notifications-minimum-level 1 + "Minimum group level the message should have to be notified. +Any message in a group that has a greater value than this will +not get notifications." + :type 'integer + :group 'gnus-notifications) + +(defvar gnus-notifications-sent nil + "Notifications already sent.") + +(defun gnus-notifications-notify (from subject photo-file) + "Send a notification about a new mail." + (if (fboundp 'notifications-notify) + (notifications-notify + :title from + :body subject + :app-icon (image-search-load-path "gnus/gnus.png") + :app-name "Gnus" + :category "email.arrived" + :image-path photo-file) + (message "New message from %s: %s" from subject))) + +(defun gnus-notifications-get-photo (mail-address) + "Get photo for mail address." + (let ((google-photo (when (and gnus-notifications-use-google-contacts + (fboundp 'google-contacts-get-photo)) + (ignore-errors + (google-contacts-get-photo mail-address))))) + (if google-photo + google-photo + (when gnus-notifications-use-gravatar + (let ((gravatar (ignore-errors + (gravatar-retrieve-synchronously mail-address)))) + (if (eq gravatar 'error) + nil + (plist-get (cdr gravatar) :data))))))) + +(defun gnus-notifications-get-photo-file (mail-address) + "Get a temporary file with an image for MAIL-ADDRESS. +You have to delete the temporary image yourself using +`delete-image'. + +Returns nil if no image found." + (let ((photo (gnus-notifications-get-photo mail-address))) + (when photo + (let ((photo-file (make-temp-file "gnus-notifications-photo-")) + (coding-system-for-write 'binary)) + (with-temp-file photo-file + (insert photo)) + photo-file)))) + +;;;###autoload +(defun gnus-notifications () + "Send a notification on new message. +This check for new messages that are in group with a level lower +or equal to `gnus-notifications-minimum-level' and send a +notification using `notifications-notify' for it. + +This is typically a function to add in +`gnus-after-getting-new-news-hook'" + (dolist (entry gnus-newsrc-alist) + (let ((group (car entry))) + ;; Check that the group level is less than + ;; `gnus-notifications-minimum-level' and the the group has unread + ;; messages. + (when (and (<= (gnus-group-level group) gnus-notifications-minimum-level) + (let ((unread (gnus-group-unread group))) + (and (numberp unread) + (> unread 0)))) + ;; Each group should have an entry in the `gnus-notifications-sent' + ;; alist. If not, we add one at this time. + (let ((group-notifications (or (assoc group gnus-notifications-sent) + ;; Nothing, add one and return it. + (assoc group + (add-to-list + 'gnus-notifications-sent + (cons group nil)))))) + (dolist (article (gnus-list-of-unread-articles group)) + ;; Check if the article already has been notified + (unless (memq article (cdr group-notifications)) + (with-current-buffer nntp-server-buffer + (gnus-request-head article group) + (article-decode-encoded-words) ; to decode mail addresses, subjects, etc + (let* ((address-components (mail-extract-address-components + (or (mail-fetch-field "From") ""))) + (address (cadr address-components)) + (photo-file (gnus-notifications-get-photo-file + address))) + (when (or + ;; Ignore mails from ourselves + (gnus-string-match-p gnus-ignored-from-addresses + address) + (gnus-notifications-notify + (or (car address-components) address) + (mail-fetch-field "Subject") + photo-file)) + ;; Register that we did notify this message + (setcdr group-notifications (cons article (cdr group-notifications)))) + (when photo-file + (delete-file photo-file))))))))))) + +(provide 'gnus-notifications) + +;;; gnus-notifications.el ends here From 31d024384ce7b399475651d7114b097a0309152c Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 29 Aug 2012 20:47:33 -0400 Subject: [PATCH 162/212] init_lread fix for bug#12302 * src/lread.c (init_lread): For out-of-tree builds, only add the source directory's site-lisp dir to the load-path if it exists, consistent with in-tree builds. --- src/ChangeLog | 6 ++++++ src/lread.c | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index b5751d859c0..fef02d8cbb5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-08-30 Glenn Morris + + * lread.c (init_lread): For out-of-tree builds, only add the + source directory's site-lisp dir to the load-path if it exists, + consistent with in-tree builds. (Bug#12302) + 2012-08-28 Jan Djärv * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize diff --git a/src/lread.c b/src/lread.c index b0413c98765..aa3e0cfc5b8 100644 --- a/src/lread.c +++ b/src/lread.c @@ -4253,9 +4253,12 @@ init_lread (void) { tem = Fexpand_file_name (build_string ("site-lisp"), Vsource_directory); - - if (NILP (Fmember (tem, Vload_path))) - Vload_path = Fcons (tem, Vload_path); + tem1 = Ffile_exists_p (tem); + if (!NILP (tem1)) + { + if (NILP (Fmember (tem, Vload_path))) + Vload_path = Fcons (tem, Vload_path); + } } } } /* Vinstallation_directory != Vsource_directory */ From 69ba1f04209e5ee67021ba872f6df98559bdb94a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 29 Aug 2012 21:44:11 -0400 Subject: [PATCH 163/212] * lisp/paren.el (show-paren-delay): Add a :set function. Doc fix. (Bug#12297) --- lisp/ChangeLog | 5 +++++ lisp/paren.el | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0fd323a6a2c..aa89a939f4a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-30 Glenn Morris + + * paren.el (show-paren-delay): + Add a :set function. Doc fix. (Bug#12297) + 2012-08-29 Martin Blais (tiny change) * progmodes/compile.el (compilation-always-kill): New var. diff --git a/lisp/paren.el b/lisp/paren.el index 2d6c42478e1..ab856380d3f 100644 --- a/lisp/paren.el +++ b/lisp/paren.el @@ -52,8 +52,17 @@ otherwise)." :group 'paren-showing) (defcustom show-paren-delay 0.125 - "Time in seconds to delay before showing a matching paren." + "Time in seconds to delay before showing a matching paren. +If you change this without using customize while `show-paren-mode' is +active, you must toggle the mode off and on again for this to take effect." :type '(number :tag "seconds") + :initialize 'custom-initialize-default + :set (lambda (sym val) + (if (not show-paren-mode) + (set sym val) + (show-paren-mode -1) + (set sym val) + (show-paren-mode 1))) :group 'paren-showing) (defcustom show-paren-priority 1000 From 247778328b6bd9618051504cee9f376686b2dd45 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Thu, 30 Aug 2012 11:45:51 +0800 Subject: [PATCH 164/212] Improve obsolescence message of display-buffer-reuse-frames. * lisp/window.el (display-buffer-reuse-frames): Make the obsolescence message more informative. --- lisp/ChangeLog | 5 +++++ lisp/window.el | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index aa89a939f4a..c59723a1047 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-30 Chong Yidong + + * window.el (display-buffer-reuse-frames): Make the obsolescence + message more informative. + 2012-08-30 Glenn Morris * paren.el (show-paren-delay): diff --git a/lisp/window.el b/lisp/window.el index 3599ff5527f..8f410ea3d4d 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4710,7 +4710,11 @@ that frame." :type 'boolean :version "21.1" :group 'windows) -(make-obsolete-variable 'display-buffer-reuse-frames 'display-buffer-alist "24.3") + +(make-obsolete-variable + 'display-buffer-reuse-frames + "use a `reusable-frames' alist entry in `display-buffer-alist'." + "24.3") (defcustom pop-up-windows t "Non-nil means `display-buffer' should make a new window." From f17e1d00e0513d781d2bd9a80af24bb047d32d5c Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Thu, 30 Aug 2012 10:22:24 +0200 Subject: [PATCH 165/212] * progmodes/compile.el (compilation-always-kill): Doc fix. --- lisp/ChangeLog | 4 ++++ lisp/progmodes/compile.el | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c59723a1047..5229c3332b2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-08-30 Andreas Schwab + + * progmodes/compile.el (compilation-always-kill): Doc fix. + 2012-08-30 Chong Yidong * window.el (display-buffer-reuse-frames): Make the obsolescence diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 83f31d5c8d5..fbb0c9e204a 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1504,8 +1504,8 @@ Otherwise, construct a buffer name from NAME-OF-MODE." (make-obsolete 'compile-internal 'compilation-start "22.1") (defcustom compilation-always-kill nil - "If nil, ask to kill compilation. If 't, always kill an -incomplete compilation before starting a new one." + "If t, always kill a running compilation process before starting a new one. +If nil, ask to kill it." :type 'boolean :version "24.3" :group 'compilation) From b98521dbff31c97469cd5455a48eed0e7f475cf4 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 30 Aug 2012 08:07:00 -0700 Subject: [PATCH 166/212] * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow for GCC 4.7.1 x86-64. --- src/ChangeLog | 5 +++++ src/dispnew.c | 1 + 2 files changed, 6 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index fef02d8cbb5..c8f75645585 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-08-30 Paul Eggert + + * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow + for GCC 4.7.1 x86-64. + 2012-08-30 Glenn Morris * lread.c (init_lread): For out-of-tree builds, only add the diff --git a/src/dispnew.c b/src/dispnew.c index 4e307880111..2d232d49c53 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -4690,6 +4690,7 @@ update_frame_1 (struct frame *f, bool force_p, bool inhibit_id_p) } } + lint_assume (0 <= FRAME_LINES (f)); pause_p = 0 < i && i < FRAME_LINES (f) - 1; /* Now just clean up termcap drivers and set cursor, etc. */ From b4444c8ad0d86f80263ffdaf7363dc0ad3a4f1fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 30 Aug 2012 18:07:44 +0200 Subject: [PATCH 167/212] * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it does not become zero. Fixes: debbugs:12234 --- src/ChangeLog | 5 +++++ src/gtkutil.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c8f75645585..261fa80d718 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-08-30 Jan Djärv + + * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it + does not become zero (Bug#12234). + 2012-08-30 Paul Eggert * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow diff --git a/src/gtkutil.c b/src/gtkutil.c index 2941605d448..939e472d6d2 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -1348,13 +1348,14 @@ x_wm_set_size_hint (FRAME_PTR f, long int flags, int user_position) size_hints.height_inc = FRAME_LINE_HEIGHT (f); hint_flags |= GDK_HINT_BASE_SIZE; - base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0) + FRAME_TOOLBAR_WIDTH (f); - /* Use one row here so base_height does not become zero. + /* Use one row/col here so base_height/width does not become zero. Gtk+ and/or Unity on Ubuntu 12.04 can't handle it. */ + base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 1) + FRAME_TOOLBAR_WIDTH (f); base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 1) + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f); check_frame_size (f, &min_rows, &min_cols); + if (min_cols > 0) --min_cols; /* We used one col in base_width = ... 1); */ if (min_rows > 0) --min_rows; /* We used one row in base_height = ... 1); */ size_hints.base_width = base_width; From 262a66e138cbc4beea1a6267adb0d2f2ba190b6e Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 30 Aug 2012 13:09:11 -0400 Subject: [PATCH 168/212] Delete `z' in special-mode-map. --- lisp/ChangeLog | 4 ++++ lisp/simple.el | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5229c3332b2..3034d7f6adf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-08-30 Richard Stallman + + * simple.el (special-mode-map): Delete binding for `z'. + 2012-08-30 Andreas Schwab * progmodes/compile.el (compilation-always-kill): Doc fix. diff --git a/lisp/simple.el b/lisp/simple.el index 7673e4c5d6e..51eb572dc5c 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -365,7 +365,6 @@ Other major modes are defined by comparison with this one." (define-key map ">" 'end-of-buffer) (define-key map "<" 'beginning-of-buffer) (define-key map "g" 'revert-buffer) - (define-key map "z" 'kill-this-buffer) map)) (put 'special-mode 'mode-class 'special) From b118352941c84d26d38be3ab77d4939bfd70de2f Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 30 Aug 2012 13:09:51 -0400 Subject: [PATCH 169/212] Delete z binding in special-mode-map. --- etc/NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index e17846cc4d0..14521744670 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -165,6 +165,9 @@ The PCL-CVS commands are still available via the keyboard. * Editing Changes in Emacs 24.3 +** The `z' key no longer has a binding in most special modes. +It used to kill the current buffer. + ** New option `yank-handled-properties' allows processing of text properties on yanked text, in more ways that are more general than just removing them, as done by `yank-excluded-properties'. From ba7ac1f6e5f675614953c51dafff677b7ddafa2b Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 30 Aug 2012 22:14:27 +0000 Subject: [PATCH 170/212] gnus-notifications.el: Add defcustom for timeout and actions support --- lisp/gnus/ChangeLog | 12 +++++++ lisp/gnus/gnus-notifications.el | 58 +++++++++++++++++++++++---------- 2 files changed, 53 insertions(+), 17 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 9de24402f90..c449f53d420 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,15 @@ +2012-08-30 Julien Danjou + + * gnus-notifications.el (gnus-notifications-notify): Use timeout from + `gnus-notifications-timeout'. + (gnus-notifications-timeout): Add. + (gnus-notifications-action): New function. + (gnus-notifications-notify): Add :action using + `gnus-notifications-action'. + (gnus-notifications-id-to-msg): New variable. + (gnus-notifications): Use `gnus-notifications-id-to-msg' to map + notifications id to messages. + 2012-08-30 Kenichi Handa * qp.el (quoted-printable-decode-region): Decode multiple bytes at diff --git a/lisp/gnus/gnus-notifications.el b/lisp/gnus/gnus-notifications.el index 8811b47ba42..811a90895ae 100644 --- a/lisp/gnus/gnus-notifications.el +++ b/lisp/gnus/gnus-notifications.el @@ -58,20 +58,42 @@ not get notifications." :type 'integer :group 'gnus-notifications) +(defcustom gnus-notifications-timeout nil + "Timeout used for notifications sent via `notifications-notify'." + :type 'integer + :group 'gnus-notifications) + (defvar gnus-notifications-sent nil "Notifications already sent.") +(defvar gnus-notifications-id-to-msg nil + "Map notifications ids to messages.") + +(defun gnus-notifications-action (id key) + (when (string= key "read") + (let ((group-article (assoc id gnus-notifications-id-to-msg))) + (when group-article + (let ((group (cadr group-article)) + (article (caddr group-article))) + (gnus-fetch-group group (list article))))))) + (defun gnus-notifications-notify (from subject photo-file) - "Send a notification about a new mail." + "Send a notification about a new mail. +Return a notification id if any, or t on success." (if (fboundp 'notifications-notify) (notifications-notify :title from :body subject + :actions '("read" "Read") + :on-action 'gnus-notifications-action :app-icon (image-search-load-path "gnus/gnus.png") :app-name "Gnus" :category "email.arrived" + :timeout gnus-notifications-timeout :image-path photo-file) - (message "New message from %s: %s" from subject))) + (message "New message from %s: %s" from subject) + ;; Don't return an id + t)) (defun gnus-notifications-get-photo (mail-address) "Get photo for mail address." @@ -136,21 +158,23 @@ This is typically a function to add in (article-decode-encoded-words) ; to decode mail addresses, subjects, etc (let* ((address-components (mail-extract-address-components (or (mail-fetch-field "From") ""))) - (address (cadr address-components)) - (photo-file (gnus-notifications-get-photo-file - address))) - (when (or - ;; Ignore mails from ourselves - (gnus-string-match-p gnus-ignored-from-addresses - address) - (gnus-notifications-notify - (or (car address-components) address) - (mail-fetch-field "Subject") - photo-file)) - ;; Register that we did notify this message - (setcdr group-notifications (cons article (cdr group-notifications)))) - (when photo-file - (delete-file photo-file))))))))))) + (address (cadr address-components))) + ;; Ignore mails from ourselves + (unless (gnus-string-match-p gnus-ignored-from-addresses + address) + (let* ((photo-file (gnus-notifications-get-photo-file address)) + (notification-id (gnus-notifications-notify + (or (car address-components) address) + (mail-fetch-field "Subject") + photo-file))) + (when notification-id + ;; Register that we did notify this message + (setcdr group-notifications (cons article (cdr group-notifications))) + (unless (eq notification-id t) + ;; Register the notification id for later actions + (add-to-list 'gnus-notifications-id-to-msg (list notification-id group article)))) + (when photo-file + (delete-file photo-file))))))))))))) (provide 'gnus-notifications) From e1991423c66ab95eb44721bec4415669780fee3b Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 30 Aug 2012 20:46:01 -0400 Subject: [PATCH 171/212] * lisp/gnus/gnus-notifications.el (gnus-notifications-action): Avoid CL-ism. --- lisp/gnus/ChangeLog | 4 ++++ lisp/gnus/gnus-notifications.el | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index c449f53d420..b167686b09c 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,7 @@ +2012-08-31 Stefan Monnier + + * gnus-notifications.el (gnus-notifications-action): Avoid CL-ism. + 2012-08-30 Julien Danjou * gnus-notifications.el (gnus-notifications-notify): Use timeout from diff --git a/lisp/gnus/gnus-notifications.el b/lisp/gnus/gnus-notifications.el index 811a90895ae..c5129958997 100644 --- a/lisp/gnus/gnus-notifications.el +++ b/lisp/gnus/gnus-notifications.el @@ -74,7 +74,7 @@ not get notifications." (let ((group-article (assoc id gnus-notifications-id-to-msg))) (when group-article (let ((group (cadr group-article)) - (article (caddr group-article))) + (article (nth 2 group-article))) (gnus-fetch-group group (list article))))))) (defun gnus-notifications-notify (from subject photo-file) From 8b96a52c54fe4d37e02153be8fd551b0a676d151 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Fri, 31 Aug 2012 08:14:59 +0400 Subject: [PATCH 172/212] Remove unused member of struct x_output and struct w32_output. * xterm.h (struct x_output): Remove unused field 'needs_exposure'. * w32term.h (struct w32_output): Likewise. --- src/ChangeLog | 6 ++++++ src/w32term.h | 3 --- src/xterm.h | 3 --- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 261fa80d718..7f47697da87 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-08-31 Dmitry Antipov + + Remove unused member of struct x_output and struct w32_output. + * xterm.h (struct x_output): Remove unused field 'needs_exposure'. + * w32term.h (struct w32_output): Likewise. + 2012-08-30 Jan Djärv * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it diff --git a/src/w32term.h b/src/w32term.h index ccbf3c42c0e..6fc2beeb18c 100644 --- a/src/w32term.h +++ b/src/w32term.h @@ -302,9 +302,6 @@ struct w32_output /* Non-hourglass cursor that is currently active. */ Cursor current_cursor; - /* Flag to set when the window needs to be completely repainted. */ - int needs_exposure; - DWORD dwStyle; /* This is the Emacs structure for the display this frame is on. */ diff --git a/src/xterm.h b/src/xterm.h index 86a76fd81a9..007c92b929c 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -544,9 +544,6 @@ struct x_output /* Non-zero means hourglass cursor is currently displayed. */ unsigned hourglass_p : 1; - /* Flag to set when the X window needs to be completely repainted. */ - int needs_exposure; - /* These are the current window manager hints. It seems that XSetWMHints, when presented with an unset bit in the `flags' member of the hints structure, does not leave the corresponding From 4e0f64791b6f38bfaa8d84addf7a472a15aac111 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Fri, 31 Aug 2012 08:40:52 +0400 Subject: [PATCH 173/212] Change struct frame bitfields from unsigned char to unsigned. * frame.h (struct frame): Change type of 'display_preempted', 'visible', 'iconified', 'has_minibuffer', 'wants_modeline', 'auto_raise', 'auto_lower', 'no_split', 'explicit_name', 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible' bitfields from unsigned char to unsigned. --- src/ChangeLog | 9 +++++++++ src/frame.h | 24 ++++++++++++------------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 7f47697da87..00ce2e46f04 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2012-08-31 Dmitry Antipov + + Change struct frame bitfields from unsigned char to unsigned. + * frame.h (struct frame): Change type of 'display_preempted', + 'visible', 'iconified', 'has_minibuffer', 'wants_modeline', + 'auto_raise', 'auto_lower', 'no_split', 'explicit_name', + 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible' + bitfields from unsigned char to unsigned. + 2012-08-31 Dmitry Antipov Remove unused member of struct x_output and struct w32_output. diff --git a/src/frame.h b/src/frame.h index 9421aa45414..8587f094a95 100644 --- a/src/frame.h +++ b/src/frame.h @@ -361,7 +361,7 @@ struct frame #endif /* Nonzero if last attempt at redisplay on this frame was preempted. */ - unsigned char display_preempted : 1; + unsigned display_preempted : 1; /* visible is nonzero if the frame is currently displayed; we check it to see if we should bother updating the frame's contents. @@ -391,8 +391,8 @@ struct frame These two are mutually exclusive. They might both be zero, if the frame has been made invisible without an icon. */ - unsigned char visible : 2; - unsigned char iconified : 1; + unsigned visible : 2; + unsigned iconified : 1; /* Let's not use bitfields for volatile variables. */ @@ -406,40 +406,40 @@ struct frame /* True if frame actually has a minibuffer window on it. 0 if using a minibuffer window that isn't on this frame. */ - unsigned char has_minibuffer : 1; + unsigned has_minibuffer : 1; /* 0 means, if this frame has just one window, show no modeline for that window. */ - unsigned char wants_modeline : 1; + unsigned wants_modeline : 1; /* Non-zero if the hardware device this frame is displaying on can support scroll bars. */ char can_have_scroll_bars; /* Non-0 means raise this frame to the top of the heap when selected. */ - unsigned char auto_raise : 1; + unsigned auto_raise : 1; /* Non-0 means lower this frame to the bottom of the stack when left. */ - unsigned char auto_lower : 1; + unsigned auto_lower : 1; /* True if frame's root window can't be split. */ - unsigned char no_split : 1; + unsigned no_split : 1; /* If this is set, then Emacs won't change the frame name to indicate the current buffer, etcetera. If the user explicitly sets the frame name, this gets set. If the user sets the name to Qnil, this is cleared. */ - unsigned char explicit_name : 1; + unsigned explicit_name : 1; /* Nonzero if size of some window on this frame has changed. */ - unsigned char window_sizes_changed : 1; + unsigned window_sizes_changed : 1; /* Nonzero if the mouse has moved on this display device since the last time we checked. */ - unsigned char mouse_moved :1; + unsigned mouse_moved :1; /* Nonzero means that the pointer is invisible. */ - unsigned char pointer_invisible :1; + unsigned pointer_invisible :1; /* If can_have_scroll_bars is non-zero, this is non-zero if we should actually display them on this frame. */ From c20643e2105117277d0b1d1880848e2ab31b967c Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Fri, 31 Aug 2012 04:39:30 +0000 Subject: [PATCH 174/212] [Gnus] Miscellaneous fixes by Dave Abrahams --- lisp/gnus/ChangeLog | 16 ++++++++++++++++ lisp/gnus/auth-source.el | 4 ++-- lisp/gnus/gnus-int.el | 7 ++++++- lisp/gnus/gnus-range.el | 12 +++++++----- lisp/gnus/gnus-registry.el | 7 ++++--- 5 files changed, 35 insertions(+), 11 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index b167686b09c..b3aeb96e9fe 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,19 @@ +2012-08-31 Dave Abrahams + + * auth-source.el (auth-sources): Fix macos keychain access. + + * gnus-int.el (gnus-request-head): When gnus-override-method is set, + allow the backend `request-head' function to determine the group + name on its own. + (gnus-request-expire-articles): Filter out negative article numbers + during expiry (Bug#11980). + + * gnus-range.el (gnus-set-difference): Change gnus-set-difference from + O(N^2) to O(N). This makes warping into huge groups tolerable. + + * gnus-registry.el (gnus-try-warping-via-registry): Don't act as though + you've found the article when you haven't. + 2012-08-31 Stefan Monnier * gnus-notifications.el (gnus-notifications-action): Avoid CL-ism. diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el index 262da447358..4c5e5ffadce 100644 --- a/lisp/gnus/auth-source.el +++ b/lisp/gnus/auth-source.el @@ -256,10 +256,10 @@ can get pretty complex." (const :tag "Temp Secrets API Collection" "secrets:session") (const :tag "Default internet Mac OS Keychain" - 'macos-keychain-internet) + macos-keychain-internet) (const :tag "Default generic Mac OS Keychain" - 'macos-keychain-generic) + macos-keychain-generic) (list :tag "Source definition" (const :format "" :value :source) diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el index 339e3d951c2..bc3ba187dd4 100644 --- a/lisp/gnus/gnus-int.el +++ b/lisp/gnus/gnus-int.el @@ -599,7 +599,8 @@ real group. Does nothing on a real group." clean-up t)) ;; Use `head' function. ((fboundp head) - (setq res (funcall head article (gnus-group-real-name group) + (setq res (funcall head article + (and (not gnus-override-method) (gnus-group-real-name group)) (nth 1 gnus-command-method)))) ;; Use `article' function. (t @@ -706,6 +707,10 @@ If GROUP is nil, all groups on GNUS-COMMAND-METHOD are scanned." (defun gnus-request-expire-articles (articles group &optional force) (let* ((gnus-command-method (gnus-find-method-for-group group)) + ;; Filter out any negative article numbers; they can't be + ;; expired here. + (articles + (delq nil (mapcar (lambda (n) (and (>= n 0) n)) articles))) (gnus-inhibit-demon t) (not-deleted (funcall diff --git a/lisp/gnus/gnus-range.el b/lisp/gnus/gnus-range.el index 68729da0910..091276ee4f8 100644 --- a/lisp/gnus/gnus-range.el +++ b/lisp/gnus/gnus-range.el @@ -52,11 +52,13 @@ If RANGE is a single range, return (RANGE). Otherwise, return RANGE." (defun gnus-set-difference (list1 list2) "Return a list of elements of LIST1 that do not appear in LIST2." - (let ((list1 (copy-sequence list1))) - (while list2 - (setq list1 (delq (car list2) list1)) - (setq list2 (cdr list2))) - list1)) + (let ((hash2 (make-hash-table :test 'eq)) + (result nil)) + (dolist (elt list2) (puthash elt t hash2)) + (dolist (elt list1) + (unless (gethash elt hash2) + (setq result (cons elt result)))) + (nreverse result))) (defun gnus-range-nconcat (&rest ranges) "Return a range comprising all the RANGES, which are pre-sorted. diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el index 8aecc98ee86..71e00967548 100644 --- a/lisp/gnus/gnus-registry.el +++ b/lisp/gnus/gnus-registry.el @@ -1169,9 +1169,10 @@ data stored in the registry." ;; Try to activate the group. If that fails, just move ;; along. We may have more groups to work with - (ignore-errors - (gnus-select-group-with-message-id group message-id)) - (throw 'found t))))))) + (when + (ignore-errors + (gnus-select-group-with-message-id group message-id) t) + (throw 'found t)))))))) ;; TODO: a few things From c650a5dec69902c684c5333befd35da6c518c5e0 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Fri, 31 Aug 2012 14:53:19 +0400 Subject: [PATCH 175/212] Remove mark_ttys function and fix tty_display_info initialization. * lisp.h (mark_ttys): Remove prototype. * alloc.c (Fgarbage_collect): Remove redundant (and the only) call to mark_ttys because all possible values of 'top_frame' slot are the frames which are reachable from Vframe_list. * term.c (mark_ttys): Remove. (init_tty): Safely initialize 'top_frame' slot with Qnil. --- src/ChangeLog | 10 ++++++++++ src/alloc.c | 1 - src/lisp.h | 1 - src/term.c | 17 +---------------- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 00ce2e46f04..4db48bbb969 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2012-08-31 Dmitry Antipov + + Remove mark_ttys function and fix tty_display_info initialization. + * lisp.h (mark_ttys): Remove prototype. + * alloc.c (Fgarbage_collect): Remove redundant (and the only) call + to mark_ttys because all possible values of 'top_frame' slot are + the frames which are reachable from Vframe_list. + * term.c (mark_ttys): Remove. + (init_tty): Safely initialize 'top_frame' slot with Qnil. + 2012-08-31 Dmitry Antipov Change struct frame bitfields from unsigned char to unsigned. diff --git a/src/alloc.c b/src/alloc.c index 36ba22cc535..e8637471bc7 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -5476,7 +5476,6 @@ See Info node `(elisp)Garbage Collection'. */) } mark_terminals (); mark_kboards (); - mark_ttys (); #ifdef USE_GTK { diff --git a/src/lisp.h b/src/lisp.h index 49a2832d686..80c49703f52 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3438,7 +3438,6 @@ extern Lisp_Object directory_files_internal (Lisp_Object, Lisp_Object, /* Defined in term.c */ extern int *char_ins_del_vector; -extern void mark_ttys (void); extern void syms_of_term (void); extern _Noreturn void fatal (const char *msgid, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); diff --git a/src/term.c b/src/term.c index 23e074287c1..f1a09b39cf9 100644 --- a/src/term.c +++ b/src/term.c @@ -3001,6 +3001,7 @@ init_tty (const char *name, const char *terminal_type, int must_succeed) #else tty = xzalloc (sizeof *tty); #endif + tty->top_frame = Qnil; tty->next = tty_list; tty_list = tty; @@ -3541,22 +3542,6 @@ delete_tty (struct terminal *terminal) xfree (tty); } - - -/* Mark the pointers in the tty_display_info objects. - Called by Fgarbage_collect. */ - -void -mark_ttys (void) -{ - struct tty_display_info *tty; - - for (tty = tty_list; tty; tty = tty->next) - mark_object (tty->top_frame); -} - - - void syms_of_term (void) { From 7b2fbe3b46bf422f9fb9b21d001de58a4f904abd Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 31 Aug 2012 13:11:06 +0200 Subject: [PATCH 176/212] * eshell/esh-ext.el: Explain, why we suppress the check in `eshell-external-command'. --- lisp/eshell/esh-ext.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el index f9f9b1a558f..e48213c54d6 100644 --- a/lisp/eshell/esh-ext.el +++ b/lisp/eshell/esh-ext.el @@ -207,11 +207,12 @@ causing the user to wonder if anything's really going on..." (defun eshell-external-command (command args) "Insert output from an external COMMAND, using ARGS." (setq args (eshell-stringify-list (eshell-flatten-list args))) - ;; (if (file-remote-p default-directory) - ;; (eshell-remote-command command args)) (let ((interp (eshell-find-interpreter command - ;; Do not examine remote shell scripts. + ;; `eshell-find-interpreter' does not work correctly + ;; for Tramp file name syntax. But we don't need to + ;; know the interpreter in that case, therefore the + ;; check is suppressed. (or (and (stringp command) (file-remote-p command)) (file-remote-p default-directory))))) (cl-assert interp) From 862382df3db08238c471025bfdd26ec33fd7a387 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Fri, 31 Aug 2012 18:51:49 +0200 Subject: [PATCH 177/212] Consider frame's buffer predicate in switch-to-prev-/next-buffer. * window.el (switch-to-prev-buffer, switch-to-next-buffer): Consider frame's buffer predicate when choosing the buffer. (Bug#12081) --- lisp/ChangeLog | 6 ++++++ lisp/window.el | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3034d7f6adf..ce4493d4c76 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-08-31 Alp Aker + + * window.el (switch-to-prev-buffer, switch-to-next-buffer): + Consider frame's buffer predicate when choosing the buffer. + (Bug#12081) + 2012-08-30 Richard Stallman * simple.el (special-mode-map): Delete binding for `z'. diff --git a/lisp/window.el b/lisp/window.el index 8f410ea3d4d..c72093334d8 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -2979,6 +2979,7 @@ shall not be switched to in future invocations of this command." (old-buffer (window-buffer window)) ;; Save this since it's destroyed by `set-window-buffer'. (next-buffers (window-next-buffers window)) + (pred (frame-parameter frame 'buffer-predicate)) entry buffer new-buffer killed-buffers visible) (when (window-dedicated-p window) (error "Window %s is dedicated to buffer %s" window old-buffer)) @@ -2991,6 +2992,7 @@ shall not be switched to in future invocations of this command." (or (buffer-live-p buffer) (not (setq killed-buffers (cons buffer killed-buffers)))) + (or (null pred) (funcall pred buffer)) (not (eq buffer old-buffer)) (or bury-or-kill (not (memq buffer next-buffers)))) (if (and (not switch-to-visible-buffer) @@ -3013,6 +3015,7 @@ shall not be switched to in future invocations of this command." (when (and (buffer-live-p buffer) (not (eq buffer old-buffer)) (not (eq (aref (buffer-name buffer) 0) ?\s)) + (or (null pred) (funcall pred buffer)) (or bury-or-kill (not (memq buffer next-buffers)))) (if (get-buffer-window buffer frame) ;; Try to avoid showing a buffer visible in some other window. @@ -3031,6 +3034,7 @@ shall not be switched to in future invocations of this command." (not (setq killed-buffers (cons buffer killed-buffers)))) (not (eq buffer old-buffer)) + (or (null pred) (funcall pred buffer)) (setq entry (assq buffer (window-prev-buffers window)))) (setq new-buffer buffer) (set-window-buffer-start-and-point @@ -3075,6 +3079,7 @@ found." (frame (window-frame window)) (old-buffer (window-buffer window)) (next-buffers (window-next-buffers window)) + (pred (frame-parameter frame 'buffer-predicate)) buffer new-buffer entry killed-buffers visible) (when (window-dedicated-p window) (error "Window %s is dedicated to buffer %s" window old-buffer)) @@ -3086,6 +3091,7 @@ found." (not (setq killed-buffers (cons buffer killed-buffers)))) (not (eq buffer old-buffer)) + (or (null pred) (funcall pred buffer)) (setq entry (assq buffer (window-prev-buffers window)))) (setq new-buffer buffer) (set-window-buffer-start-and-point @@ -3096,6 +3102,7 @@ found." (dolist (buffer (buffer-list frame)) (when (and (buffer-live-p buffer) (not (eq buffer old-buffer)) (not (eq (aref (buffer-name buffer) 0) ?\s)) + (or (null pred) (funcall pred buffer)) (not (assq buffer (window-prev-buffers window)))) (if (get-buffer-window buffer frame) ;; Try to avoid showing a buffer visible in some other window. @@ -3110,6 +3117,7 @@ found." (or (buffer-live-p buffer) (not (setq killed-buffers (cons buffer killed-buffers)))) + (or (null pred) (funcall pred buffer)) (not (eq buffer old-buffer))) (if (and (not switch-to-visible-buffer) (get-buffer-window buffer frame)) From 5bf647499a5f6d08ac8aa4809ebce22acf1330b3 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Fri, 31 Aug 2012 18:53:48 +0200 Subject: [PATCH 178/212] Fixes: debbugs:12306 * etags.c (consider_token): Always zero-terminate token buffer. --- lib-src/ChangeLog | 5 +++++ lib-src/etags.c | 1 + 2 files changed, 6 insertions(+) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 4e3f3424c91..35190fd2a8f 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,8 @@ +2012-08-31 Andreas Schwab + + * etags.c (consider_token): Always zero-terminate token buffer. + (Bug#12306) + 2012-08-19 Paul Eggert Rely on + to declare 'environ'. diff --git a/lib-src/etags.c b/lib-src/etags.c index 9c03735c954..e65082de534 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -2878,6 +2878,7 @@ consider_token (register char *str, register int len, register int c, int *c_ext objdef = omethodtag; linebuffer_setlen (&token_name, oldlen + len); memcpy (token_name.buffer + oldlen, str, len); + token_name.buffer[oldlen + len] = '\0'; return TRUE; } return FALSE; From 0e23ef9ddeefadcba94824c09e412c961de283e7 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 31 Aug 2012 18:04:26 -0700 Subject: [PATCH 179/212] Better seed support for (random). * doc/lispref/numbers.texi (Random Numbers): Document new behavior of the calls (random) and (random STRING). * etc/NEWS: Document new behavior of (random), (random "string"). * lisp/play/5x5.el, lisp/play/animate.el, lisp/play/cookie1.el: * lisp/play/dissociate.el, lisp/play/doctor.el, lisp/play/dunnet.el: * lisp/play/gomoku.el, lisp/play/landmark.el, lisp/play/mpuz.el: * lisp/play/tetris.el, lisp/play/zone.el: * lisp/calc/calc-comb.el (math-init-random-base): * lisp/play/blackbox.el (bb-init-board): * lisp/play/life.el (life): * lisp/server.el (server-use-tcp): * lisp/type-break.el (type-break): Remove unnecessary call to (random t). * lisp/net/sasl.el (sasl-unique-id-function): Change (random t) to (random), now that the latter is more random. * lisp/play/life.el (life-initialized): Remove no-longer-needed var. * lisp/gnus/gnus-sync.el (gnus-sync-lesync-setup): * lisp/gnus/message.el (message-canlock-generate, message-unique-id): Change (random t) to (random), now that the latter is more random. * lisp/org/org-id.el (org-id-uuid): Change (random t) to (random), now that the latter is more random. * src/emacs.c (main): Call init_random. * src/fns.c (Frandom): Set the seed from a string argument, if given. Remove long-obsolete Gentzel cruft. * src/lisp.h, src/sysdep.c (seed_random): Now takes address and size, not long. (init_random): New function. --- doc/lispref/ChangeLog | 6 ++++++ doc/lispref/numbers.texi | 30 ++++++++++++++++-------------- etc/ChangeLog | 5 +++++ etc/NEWS | 5 +++++ lisp/ChangeLog | 16 ++++++++++++++++ lisp/allout-widgets.el | 1 - lisp/calc/calc-comb.el | 15 +++++++-------- lisp/gnus/ChangeLog | 7 +++++++ lisp/gnus/gnus-sync.el | 2 +- lisp/gnus/message.el | 5 +---- lisp/net/sasl.el | 2 +- lisp/org/ChangeLog | 6 ++++++ lisp/org/org-id.el | 2 +- lisp/play/5x5.el | 2 -- lisp/play/animate.el | 2 -- lisp/play/blackbox.el | 3 +-- lisp/play/cookie1.el | 3 --- lisp/play/dissociate.el | 2 -- lisp/play/doctor.el | 2 -- lisp/play/dunnet.el | 1 - lisp/play/gomoku.el | 2 -- lisp/play/landmark.el | 2 -- lisp/play/life.el | 6 ------ lisp/play/mpuz.el | 2 -- lisp/play/tetris.el | 2 -- lisp/play/zone.el | 2 -- lisp/server.el | 1 - lisp/type-break.el | 1 - src/ChangeLog | 9 +++++++++ src/emacs.c | 1 + src/fns.c | 28 ++++++---------------------- src/lisp.h | 3 ++- src/sysdep.c | 24 +++++++++++++++++++++--- 33 files changed, 112 insertions(+), 88 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index c014c0fce45..30169d6b7a9 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,9 @@ +2012-09-01 Paul Eggert + + Better seed support for (random). + * numbers.texi (Random Numbers): Document new behavior of + the calls (random) and (random STRING). + 2012-08-21 Martin Rudalics * windows.texi (Window Point): Document recent changes in diff --git a/doc/lispref/numbers.texi b/doc/lispref/numbers.texi index ce0716f39ef..17f3ee099bd 100644 --- a/doc/lispref/numbers.texi +++ b/doc/lispref/numbers.texi @@ -1199,30 +1199,32 @@ numbers are not truly random, but they have certain properties that mimic a random series. For example, all possible values occur equally often in a pseudo-random series. -In Emacs, pseudo-random numbers are generated from a ``seed'' number. +In Emacs, pseudo-random numbers are generated from a ``seed''. Starting from any given seed, the @code{random} function always -generates the same sequence of numbers. Emacs always starts with the -same seed value, so the sequence of values of @code{random} is actually -the same in each Emacs run! For example, in one operating system, the -first call to @code{(random)} after you start Emacs always returns -@minus{}1457731, and the second one always returns @minus{}7692030. This -repeatability is helpful for debugging. +generates the same sequence of numbers. Emacs typically starts with a +different seed each time, so the sequence of values of @code{random} +typically differs in each Emacs run. -If you want random numbers that don't always come out the same, execute -@code{(random t)}. This chooses a new seed based on the current time of -day and on Emacs's process @acronym{ID} number. +Sometimes you want the random number sequence to be repeatable. For +example, when debugging a program whose behavior depends on the random +number sequence, it is helpful to get the same behavior in each +program run. To make the sequence repeat, execute @code{(random "")}. +This sets the seed to a constant value for your particular Emacs +executable (though it may differ for other Emacs builds). You can use +other strings to choose various seed values. @defun random &optional limit This function returns a pseudo-random integer. Repeated calls return a series of pseudo-random integers. If @var{limit} is a positive integer, the value is chosen to be -nonnegative and less than @var{limit}. +nonnegative and less than @var{limit}. Otherwise, the value +might be any integer representable in Lisp. If @var{limit} is @code{t}, it means to choose a new seed based on the current time of day and on Emacs's process @acronym{ID} number. -On some machines, any integer representable in Lisp may be the result -of @code{random}. On other machines, the result can never be larger -than a certain maximum or less than a certain (negative) minimum. +If @var{limit} is a string, it means to choose a new seed based on the +string's contents. + @end defun diff --git a/etc/ChangeLog b/etc/ChangeLog index 11aba88c6a1..f3f244c7e39 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,8 @@ +2012-09-01 Paul Eggert + + Better seeds for (random). + * NEWS: Document new behavior of (random), (random "string"). + 2012-08-28 Andreas Schwab * charsets/MULE-ethiopic.map: Fix typo in comment. diff --git a/etc/NEWS b/etc/NEWS index 14521744670..58298a9a437 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -527,6 +527,11 @@ inefficiency, and not namespace-clean. * Incompatible Lisp Changes in Emacs 24.3 +** (random) by default now returns a different random sequence in +every Emacs run. Use (random S), where S is a string, to set the +random seed to a value based on S, in order to get a repeatable +sequence in later calls. + ** The function `x-select-font' can return a font spec, instead of a font name as a string. Whether it returns a font spec or a font name depends on the graphical library. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ce4493d4c76..68bb8e06e87 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,19 @@ +2012-09-01 Paul Eggert + + Better seed support for (random). + * play/5x5.el, play/animate.el, play/cookie1.el, play/dissociate.el: + * play/doctor.el, play/dunnet.el, play/gomoku.el, play/landmark.el: + * play/mpuz.el, play/tetris.el, play/zone.el: + * calc/calc-comb.el (math-init-random-base): + * play/blackbox.el (bb-init-board): + * play/life.el (life): + * server.el (server-use-tcp): + * type-break.el (type-break): + Remove unnecessary call to (random t). + * net/sasl.el (sasl-unique-id-function): + Change (random t) to (random), now that the latter is more random. + * play/life.el (life-initialized): Remove no-longer-needed var. + 2012-08-31 Alp Aker * window.el (switch-to-prev-buffer, switch-to-next-buffer): diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el index 962a8fb557a..c5790603d11 100644 --- a/lisp/allout-widgets.el +++ b/lisp/allout-widgets.el @@ -1374,7 +1374,6 @@ FROM and TO must be in increasing order, as must be the pairs in RANGES." ;; (time-trial ;; '(let ((size 10000) ;; doing) -;; (random t) ;; (dotimes (count size) ;; (setq doing (random size)) ;; (funcall try doing (+ doing (random 5))) diff --git a/lisp/calc/calc-comb.el b/lisp/calc/calc-comb.el index 199bbf0ae35..431ea18f580 100644 --- a/lisp/calc/calc-comb.el +++ b/lisp/calc/calc-comb.el @@ -77,7 +77,7 @@ 4877 4889 4903 4909 4919 4931 4933 4937 4943 4951 4957 4967 4969 4973 4987 4993 4999 5003]) -;; The variable math-prime-factors-finished is set by calcFunc-prfac to +;; The variable math-prime-factors-finished is set by calcFunc-prfac to ;; indicate whether factoring is complete, and used by calcFunc-factors, ;; calcFunc-totient and calcFunc-moebius. (defvar math-prime-factors-finished) @@ -510,8 +510,8 @@ (while (<= (length math-stirling-local-cache) n) (let ((i (1- (length math-stirling-local-cache))) row) - (setq math-stirling-local-cache - (vconcat math-stirling-local-cache + (setq math-stirling-local-cache + (vconcat math-stirling-local-cache (make-vector (length math-stirling-local-cache) nil))) (aset math-stirling-cache k math-stirling-local-cache) (while (< (setq i (1+ i)) (length math-stirling-local-cache)) @@ -572,7 +572,6 @@ (let ((i 200)) (while (> (setq i (1- i)) 0) (math-random-base)))) - (random t) (setq var-RandSeed nil math-random-cache nil math-random-shift -4) ; assume RAND_MAX >= 16383 @@ -629,7 +628,7 @@ (i (/ (+ n slop) 3)) (rnum 0)) (while (> i 0) - (setq rnum + (setq rnum (math-add (math-random-three-digit-number) (math-mul rnum 1000))) @@ -823,11 +822,11 @@ (setq sum (% (+ sum - (calcFunc-mod + (calcFunc-mod q 1000000)) 111111)) - (setq q - (math-quotient + (setq q + (math-quotient q 1000000))) (cond ((= (% sum 3) 0) '(nil 3)) ((= (% sum 7) 0) '(nil 7)) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index b3aeb96e9fe..a4e3d9bde2b 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,10 @@ +2012-09-01 Paul Eggert + + Better seeds for (random). + * gnus-sync.el (gnus-sync-lesync-setup): + * message.el (message-canlock-generate, message-unique-id): + Change (random t) to (random), now that the latter is more random. + 2012-08-31 Dave Abrahams * auth-source.el (auth-sources): Fix macos keychain access. diff --git a/lisp/gnus/gnus-sync.el b/lisp/gnus/gnus-sync.el index 15d94810c3a..ca8662ff936 100644 --- a/lisp/gnus/gnus-sync.el +++ b/lisp/gnus/gnus-sync.el @@ -225,7 +225,7 @@ When SALT is nil, a random one will be generated using `random'." (security-object (concat url "/_security")) (user-record `((names . [,user]) (roles . []))) (couch-user-name (format "org.couchdb.user:%s" user)) - (salt (or salt (sha1 (format "%s" (random t))))) + (salt (or salt (sha1 (format "%s" (random))))) (couch-user-record `((_id . ,couch-user-name) (type . user) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 8fd89b1742c..18088423eb0 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -4820,9 +4820,7 @@ Do not use this for anything important, it is cryptographically weak." (require 'sha1) (let (sha1-maximum-internal-length) (sha1 (concat (message-unique-id) - (format "%x%x%x" (random) - (progn (random t) (random)) - (random)) + (format "%x%x%x" (random) (random) (random)) (prin1-to-string (recent-keys)) (prin1-to-string (garbage-collect)))))) @@ -5525,7 +5523,6 @@ In posting styles use `(\"Expires\" (make-expires-date 30))'." ;; You might for example insert a "." somewhere (not next to another dot ;; or string boundary), or modify the "fsf" string. (defun message-unique-id () - (random t) ;; Don't use microseconds from (current-time), they may be unsupported. ;; Instead we use this randomly inited counter. (setq message-unique-id-char diff --git a/lisp/net/sasl.el b/lisp/net/sasl.el index c6e95970f3d..4e759a4e6b2 100644 --- a/lisp/net/sasl.el +++ b/lisp/net/sasl.el @@ -183,7 +183,7 @@ It contain at least 64 bits of entropy." ;; Don't use microseconds from (current-time), they may be unsupported. ;; Instead we use this randomly inited counter. (setq sasl-unique-id-char - (% (1+ (or sasl-unique-id-char (logand (random t) (1- (lsh 1 20))))) + (% (1+ (or sasl-unique-id-char (logand (random) (1- (lsh 1 20))))) ;; (current-time) returns 16-bit ints, ;; and 2^16*25 just fits into 4 digits i base 36. (* 25 25))) diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog index cf9c32006ac..152af5f43ed 100644 --- a/lisp/org/ChangeLog +++ b/lisp/org/ChangeLog @@ -1,3 +1,9 @@ +2012-09-01 Paul Eggert + + Better seed support for (random). + * org-id.el (org-id-uuid): + Change (random t) to (random), now that the latter is more random. + 2012-07-29 Paul Eggert Don't use the abbreviation "win" to refer to Windows (Bug#10421). diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el index 55e826f3ae6..a93f804946f 100644 --- a/lisp/org/org-id.el +++ b/lisp/org/org-id.el @@ -318,7 +318,7 @@ So a typical ID could look like \"Org:4nd91V40HI\"." (defun org-id-uuid () "Return string with random (version 4) UUID." (let ((rnd (md5 (format "%s%s%s%s%s%s%s" - (random t) + (random) (current-time) (user-uid) (emacs-pid) diff --git a/lisp/play/5x5.el b/lisp/play/5x5.el index e6df0df8282..abc78cd495c 100644 --- a/lisp/play/5x5.el +++ b/lisp/play/5x5.el @@ -953,8 +953,6 @@ lest." (y-or-n-p prompt) t)) -(random t) - (provide '5x5) ;;; 5x5.el ends here diff --git a/lisp/play/animate.el b/lisp/play/animate.el index 9919600202f..2398a7b89c7 100644 --- a/lisp/play/animate.el +++ b/lisp/play/animate.el @@ -201,8 +201,6 @@ the buffer *Birthday-Present-for-Name*." (animate-string "my sunshine" 18 34) (animate-string "to stay!" 19 34)) -(random t) - (provide 'animate) ;;; animate.el ends here diff --git a/lisp/play/blackbox.el b/lisp/play/blackbox.el index eb2d784c8e5..db2e18188e5 100644 --- a/lisp/play/blackbox.el +++ b/lisp/play/blackbox.el @@ -93,7 +93,7 @@ (define-key map (vector 'remap oldfun) newfun)) -(defvar blackbox-mode-map +(defvar blackbox-mode-map (let ((map (make-keymap))) (suppress-keymap map t) (blackbox-redefine-key map 'backward-char 'bb-left) @@ -257,7 +257,6 @@ a reflection." (bb-goto (cons bb-x bb-y))) (defun bb-init-board (num-balls) - (random t) (let (board pos) (while (>= (setq num-balls (1- num-balls)) 0) (while diff --git a/lisp/play/cookie1.el b/lisp/play/cookie1.el index cbf29a26a71..dbd6e893473 100644 --- a/lisp/play/cookie1.el +++ b/lisp/play/cookie1.el @@ -53,9 +53,6 @@ ;;; Code: -; Randomize the seed in the random number generator. -(random t) - (defconst cookie-delimiter "\n%%\n\\|\n%\n\\|\0" "Delimiter used to separate cookie file entries.") diff --git a/lisp/play/dissociate.el b/lisp/play/dissociate.el index 8f9f8cea24f..238b2a86c17 100644 --- a/lisp/play/dissociate.el +++ b/lisp/play/dissociate.el @@ -94,8 +94,6 @@ Default is 2." (funcall search-function overlap opoint t)))))) (sit-for 0)))) -(random t) - (provide 'dissociate) ;;; dissociate.el ends here diff --git a/lisp/play/doctor.el b/lisp/play/doctor.el index fdae2ec9326..57dbb1452f3 100644 --- a/lisp/play/doctor.el +++ b/lisp/play/doctor.el @@ -1620,8 +1620,6 @@ Hack on previous word, setting global variable DOCTOR-OWNER to correct result." (defun doctor-chat () (doctor-type (doc$ doctor--chatlst))) -(random t) - (provide 'doctor) ;;; doctor.el ends here diff --git a/lisp/play/dunnet.el b/lisp/play/dunnet.el index 22a2642f751..2d62b800ef4 100644 --- a/lisp/play/dunnet.el +++ b/lisp/play/dunnet.el @@ -3010,7 +3010,6 @@ drwxr-xr-x 3 root staff 2048 Jan 1 1970 ..") (dun-uexit nil))) -(random t) (setq tloc (+ 60 (random 18))) (dun-replace dun-room-objects tloc (append (nth tloc dun-room-objects) (list 18))) diff --git a/lisp/play/gomoku.el b/lisp/play/gomoku.el index 6d73e2ccb65..3dba99d98d5 100644 --- a/lisp/play/gomoku.el +++ b/lisp/play/gomoku.el @@ -1197,8 +1197,6 @@ If the game is finished, this command requests for another game." (move-to-column (+ gomoku-x-offset (* gomoku-square-width (1- gomoku-board-width))))) -(random t) - (provide 'gomoku) ;;; gomoku.el ends here diff --git a/lisp/play/landmark.el b/lisp/play/landmark.el index e9f555093db..e103249da49 100644 --- a/lisp/play/landmark.el +++ b/lisp/play/landmark.el @@ -1683,8 +1683,6 @@ Use \\[describe-mode] for more info." ;;;allout-layout: (0 : -1 -1 0) ;;;End: -(random t) - (provide 'landmark) ;;; landmark.el ends here diff --git a/lisp/play/life.el b/lisp/play/life.el index e9133f84862..87ec0226af5 100644 --- a/lisp/play/life.el +++ b/lisp/play/life.el @@ -111,9 +111,6 @@ ;; Sadly, mode-line-format won't display numbers. (defvar life-generation-string nil) -(defvar life-initialized nil - "Non-nil if `life' has been run at least once.") - ;;;###autoload (defun life (&optional sleeptime) "Run Conway's Life simulation. @@ -121,9 +118,6 @@ The starting pattern is randomly selected. Prefix arg (optional first arg non-nil from a program) is the number of seconds to sleep between generations (this defaults to 1)." (interactive "p") - (or life-initialized - (random t)) - (setq life-initialized t) (or sleeptime (setq sleeptime 1)) (life-setup) (catch 'life-exit diff --git a/lisp/play/mpuz.el b/lisp/play/mpuz.el index c0c8803f896..e16bb2f1bde 100644 --- a/lisp/play/mpuz.el +++ b/lisp/play/mpuz.el @@ -35,8 +35,6 @@ :prefix "mpuz-" :group 'games) -(random t) ; randomize - (defcustom mpuz-silent 'error "Set this to nil if you want dings on inputs. The value t means never ding, and `error' means only ding on wrong input." diff --git a/lisp/play/tetris.el b/lisp/play/tetris.el index b811a21605b..9cc33304589 100644 --- a/lisp/play/tetris.el +++ b/lisp/play/tetris.el @@ -635,8 +635,6 @@ tetris-mode keybindings: (tetris-mode) (tetris-start-game)) -(random t) - (provide 'tetris) ;;; tetris.el ends here diff --git a/lisp/play/zone.el b/lisp/play/zone.el index 34e21193437..1cfc6c59987 100644 --- a/lisp/play/zone.el +++ b/lisp/play/zone.el @@ -675,8 +675,6 @@ If nil, `zone-pgm-random-life' chooses a value from 0-3 (inclusive).") (kill-buffer nil)))) -(random t) - ;;;;;;;;;;;;;;; (provide 'zone) diff --git a/lisp/server.el b/lisp/server.el index 6d34df351ca..4fd55bcf6d1 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -94,7 +94,6 @@ (setq val t) (unless load-in-progress (message "Local sockets unsupported, using TCP sockets"))) - (when val (random t)) (set-default sym val)) :group 'server :type 'boolean diff --git a/lisp/type-break.el b/lisp/type-break.el index f0c81125f0c..8a95508d939 100644 --- a/lisp/type-break.el +++ b/lisp/type-break.el @@ -577,7 +577,6 @@ as per the function `type-break-schedule'." (unless type-break-terse-messages (message "Press any key to resume from typing break.")) - (random t) (let* ((len (length type-break-demo-functions)) (idx (random len)) (fn (nth idx type-break-demo-functions))) diff --git a/src/ChangeLog b/src/ChangeLog index 4db48bbb969..ad96c948466 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2012-09-01 Paul Eggert + + Better seed support for (random). + * emacs.c (main): Call init_random. + * fns.c (Frandom): Set the seed from a string argument, if given. + Remove long-obsolete Gentzel cruft. + * lisp.h, sysdep.c (seed_random): Now takes address and size, not long. + (init_random): New function. + 2012-08-31 Dmitry Antipov Remove mark_ttys function and fix tty_display_info initialization. diff --git a/src/emacs.c b/src/emacs.c index 7ff5c43dbea..842546461b6 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1281,6 +1281,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem init_data (); init_atimer (); running_asynch_code = 0; + init_random (); no_loadup = argmatch (argv, argc, "-nl", "--no-loadup", 6, NULL, &skip_args); diff --git a/src/fns.c b/src/fns.c index f6acdcada3f..2dee8515799 100644 --- a/src/fns.c +++ b/src/fns.c @@ -74,32 +74,16 @@ Other values of LIMIT are ignored. */) (Lisp_Object limit) { EMACS_INT val; - Lisp_Object lispy_val; if (EQ (limit, Qt)) - { - EMACS_TIME t = current_emacs_time (); - seed_random (getpid () ^ EMACS_SECS (t) ^ EMACS_NSECS (t)); - } + init_random (); + else if (STRINGP (limit)) + seed_random (SSDATA (limit), SBYTES (limit)); + val = get_random (); if (NATNUMP (limit) && XFASTINT (limit) != 0) - { - /* Try to take our random number from the higher bits of VAL, - not the lower, since (says Gentzel) the low bits of `random' - are less random than the higher ones. We do this by using the - quotient rather than the remainder. At the high end of the RNG - it's possible to get a quotient larger than n; discarding - these values eliminates the bias that would otherwise appear - when using a large n. */ - EMACS_INT denominator = (INTMASK + 1) / XFASTINT (limit); - do - val = get_random () / denominator; - while (val >= XFASTINT (limit)); - } - else - val = get_random (); - XSETINT (lispy_val, val); - return lispy_val; + val %= XFASTINT (limit); + return make_number (val); } /* Heuristic on how many iterations of a tight loop can be safely done diff --git a/src/lisp.h b/src/lisp.h index 80c49703f52..2815a2ae325 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3405,7 +3405,8 @@ extern void child_setup_tty (int); extern void setup_pty (int); extern int set_window_size (int, int, int); extern EMACS_INT get_random (void); -extern void seed_random (long); +extern void seed_random (void *, ptrdiff_t); +extern void init_random (void); extern int emacs_open (const char *, int, int); extern int emacs_close (int); extern ptrdiff_t emacs_read (int, char *, ptrdiff_t); diff --git a/src/sysdep.c b/src/sysdep.c index 183ee005227..edd54de84d4 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -1765,19 +1765,37 @@ init_signals (void) #endif /* !RAND_BITS */ void -seed_random (long int arg) +seed_random (void *seed, ptrdiff_t seed_size) { +#if defined HAVE_RANDOM || ! defined HAV_LRAND48 + unsigned int arg = 0; +#else + long int arg = 0; +#endif + unsigned char *argp = (unsigned char *) &arg; + unsigned char *seedp = seed; + ptrdiff_t i; + for (i = 0; i < seed_size; i++) + argp[i % sizeof arg] ^= seedp[i]; #ifdef HAVE_RANDOM - srandom ((unsigned int)arg); + srandom (arg); #else # ifdef HAVE_LRAND48 srand48 (arg); # else - srand ((unsigned int)arg); + srand (arg); # endif #endif } +void +init_random (void) +{ + EMACS_TIME t = current_emacs_time (); + uintmax_t v = getpid () ^ EMACS_SECS (t) ^ EMACS_NSECS (t); + seed_random (&v, sizeof v); +} + /* * Return a nonnegative random integer out of whatever we've got. * It contains enough bits to make a random (signed) Emacs fixnum. From 3363421789fd8fdbe88ad48872e01bae957d9d4f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 31 Aug 2012 18:13:50 -0700 Subject: [PATCH 180/212] * sysdep.c (seed_random): Fix typo: HAV_LRAND48 -> HAVE_LRAND48. This fixes a bug on old systems that do not have the 'random' function. --- src/sysdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sysdep.c b/src/sysdep.c index edd54de84d4..b84e6a4ea3a 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -1767,7 +1767,7 @@ init_signals (void) void seed_random (void *seed, ptrdiff_t seed_size) { -#if defined HAVE_RANDOM || ! defined HAV_LRAND48 +#if defined HAVE_RANDOM || ! defined HAVE_LRAND48 unsigned int arg = 0; #else long int arg = 0; From 3d10e1343d65341d4d48633e0b561df86787c438 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 1 Sep 2012 00:28:24 -0400 Subject: [PATCH 181/212] * lisp/minibuffer.el (completion-at-point-functions): Complete docstring. Fixes: debbugs:12254 --- lisp/ChangeLog | 5 +++++ lisp/minibuffer.el | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 68bb8e06e87..c5b866e9d54 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-09-01 Stefan Monnier + + * minibuffer.el (completion-at-point-functions): Complete docstring + (bug#12254). + 2012-09-01 Paul Eggert Better seed support for (random). diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index cc2638d58de..a696fff7dc7 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1821,7 +1821,9 @@ Currently supported properties are all the properties that can appear in `:predicate' a predicate that completion candidates need to satisfy. `:exclusive' If `no', means that if the completion table fails to match the text at point, then instead of reporting a completion - failure, the completion should try the next completion function.") + failure, the completion should try the next completion function. +As is the case with most hooks, the functions are responsible to preserve +things like point and current buffer.") (defvar completion--capf-misbehave-funs nil "List of functions found on `completion-at-point-functions' that misbehave. From 17a2cbbd76385d0be8a4b28974e64f4debf459c1 Mon Sep 17 00:00:00 2001 From: Daniel Colascione Date: Fri, 31 Aug 2012 22:38:52 -0800 Subject: [PATCH 182/212] Refactor window-system configuration This change streamlines the window system selection code in configure.in and moves many common function declarations from window-specific headers to frame.h. It introduces a new TERM_HEADER macro in config.h: we set this macro to the right header to use for the window system for which we're compiling Emacs and have source files include it indirectly. This way, we don't have to teach every file about every window system. --- ChangeLog | 8 ++++++ configure.ac | 51 ++++++++++++++++++++++++++--------- nt/ChangeLog | 4 +++ nt/inc/ms-w32.h | 3 +++ src/ChangeLog | 71 +++++++++++++++++++++++++++++++++++++++++++++++++ src/Makefile.in | 11 +++++--- src/ccl.h | 2 ++ src/dispnew.c | 14 +++------- src/emacs.c | 12 +++------ src/font.c | 14 +++------- src/frame.c | 19 ++++--------- src/frame.h | 30 +++++++++++++++++++++ src/gtkutil.h | 1 + src/image.c | 31 +++++++++------------ src/keyboard.c | 19 ++++--------- src/keyboard.h | 2 +- src/menu.c | 17 +++--------- src/nsterm.h | 27 ++----------------- src/process.c | 7 ++--- src/w32font.h | 4 +++ src/w32term.h | 2 +- src/w32xfns.c | 2 +- src/xfaces.c | 20 ++++++-------- src/xterm.h | 26 ++++++------------ 24 files changed, 228 insertions(+), 169 deletions(-) diff --git a/ChangeLog b/ChangeLog index 228cf1d74d7..6e93b8313e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-09-01 Daniel Colascione + + * configure.ac: Introduce term_header variable, which holds the + value which will become TERM_HEADER in code. We effect our choice + of window system by setting term_header and WINDOW_SYSTEM_OBJ + instead of using ad-hoc variables and flags for each window + system. + 2012-08-26 Paul Eggert * configure.ac (CFLAGS): Prefer -g3 to -g if -g3 works diff --git a/configure.ac b/configure.ac index 71ec98390aa..d16113bf919 100644 --- a/configure.ac +++ b/configure.ac @@ -1386,10 +1386,14 @@ AC_SYS_LONG_FILE_NAMES #### Choose a window system. +## We leave window_system equal to none if +## we end up building without one. Any new window system should +## set window_system to an appropriate value and add objects to +## window-system-specific substs. + +window_system=none AC_PATH_X -if test "$no_x" = yes; then - window_system=none -else +if test "$no_x" != yes; then window_system=x11 fi @@ -1528,7 +1532,6 @@ if test "${HAVE_NS}" = yes; then fi window_system=nextstep - with_xft=no # set up packaging dirs if test "${EN_NS_SELF_CONTAINED}" = yes; then ns_self_contained=yes @@ -1548,7 +1551,6 @@ if test "${HAVE_NS}" = yes; then INSTALL_ARCH_INDEP_EXTRA= fi ns_frag=$srcdir/src/ns.mk - NS_OBJ="fontset.o fringe.o image.o" NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o" fi CFLAGS="$tmp_CFLAGS" @@ -1560,18 +1562,29 @@ AC_SUBST(NS_OBJC_OBJ) AC_SUBST(LIB_STANDARD) AC_SUBST_FILE(ns_frag) +## $window_system is now set to the window system we will +## ultimately use. + +term_header= +HAVE_X_WINDOWS=no +HAVE_X11=no +USE_X_TOOLKIT=none + case "${window_system}" in x11 ) HAVE_X_WINDOWS=yes HAVE_X11=yes + term_header=xterm.h case "${with_x_toolkit}" in athena | lucid ) USE_X_TOOLKIT=LUCID ;; motif ) USE_X_TOOLKIT=MOTIF ;; gtk ) with_gtk=yes + term_header=gtkutil.h dnl Don't set this for GTK. A lot of tests below assumes Xt when dnl USE_X_TOOLKIT is set. USE_X_TOOLKIT=none ;; gtk3 ) with_gtk3=yes + term_header=gtkutil.h USE_X_TOOLKIT=none ;; no ) USE_X_TOOLKIT=none ;; dnl If user did not say whether to use a toolkit, make this decision later: @@ -1579,13 +1592,16 @@ dnl use the toolkit if we have gtk, or X11R5 or newer. * ) USE_X_TOOLKIT=maybe ;; esac ;; - nextstep | none ) - HAVE_X_WINDOWS=no - HAVE_X11=no - USE_X_TOOLKIT=none + nextstep ) + term_header=nsterm.h ;; esac +if test -n "${term_header}"; then + AC_DEFINE_UNQUOTED(TERM_HEADER, "${term_header}", + [Define to the header for the built-in window system.]) +fi + if test "$window_system" = none && test "X$with_x" != "Xno"; then AC_CHECK_PROG(HAVE_XSERVER, X, true, false) if test "$HAVE_XSERVER" = true || @@ -1901,6 +1917,7 @@ if test "${with_gtk3}" = "yes"; then fi AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.]) GTK_OBJ=emacsgtkfixed.o + term_header=gtkutil.h fi if test "$pkg_check_gtk" != "yes"; then @@ -1979,6 +1996,8 @@ if test "${HAVE_GTK}" = "yes"; then gtk_widget_get_mapped gtk_adjustment_get_page_size \ gtk_orientable_set_orientation \ gtk_window_set_has_resize_grip) + + term_header=gtkutil.h fi dnl D-Bus has been tested under GNU/Linux only. Must be adapted for @@ -3973,6 +3992,11 @@ AC_SUBST(ns_appsrc) AC_SUBST(GNU_OBJC_CFLAGS) AC_SUBST(OTHER_FILES) +if test -n "${term_header}"; then + AC_DEFINE_UNQUOTED(TERM_HEADER, "${term_header}", + [Define to the header for the built-in window system.]) +fi + AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "${canonical}", [Define to the canonical Emacs configuration name.]) AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${ac_configure_args}", @@ -3987,7 +4011,7 @@ if test "${HAVE_X_WINDOWS}" = "yes" ; then AC_DEFINE(HAVE_X_WINDOWS, 1, [Define to 1 if you want to use the X window system.]) XMENU_OBJ=xmenu.o - XOBJ="xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o xsettings.o xgselect.o" + XOBJ="xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o xgselect.o" FONT_OBJ=xfont.o if test "$HAVE_XFT" = "yes"; then FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o" @@ -4277,13 +4301,14 @@ if test "x$GCC" = "xyes" && test "x$ORDINARY_LINK" != "xyes"; then fi dnl if $GCC AC_SUBST(LIB_GCC) - -## If we're using X11/GNUstep, define some consequences. -if test "$HAVE_X_WINDOWS" = "yes" || test "$HAVE_NS" = "yes"; then +## Common for all window systems +if test "$window_system" != "none"; then AC_DEFINE(HAVE_WINDOW_SYSTEM, 1, [Define if you have a window system.]) AC_DEFINE(HAVE_MOUSE, 1, [Define if you have mouse support.]) + WINDOW_SYSTEM_OBJ="fontset.o fringe.o image.o" fi +AC_SUBST(WINDOW_SYSTEM_OBJ) AH_TOP([/* GNU Emacs site configuration template file. diff --git a/nt/ChangeLog b/nt/ChangeLog index 7729f09d00f..1085138e3f6 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,7 @@ +2012-09-01 Daniel Colascione + + * inc/ms-w32.h (TERM_HEADER): Add for refactoring + 2012-08-22 Juanma Barranquero * config.nt: Sync with autogen/config.in. diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h index 022b168c0b8..8945fb7be4d 100644 --- a/nt/inc/ms-w32.h +++ b/nt/inc/ms-w32.h @@ -424,4 +424,7 @@ extern void _DebPrint (const char *fmt, ...); #define DebPrint(stuff) #endif +#define TERM_HEADER "w32term.h" + + /* ============================================================ */ diff --git a/src/ChangeLog b/src/ChangeLog index 4db48bbb969..0bd1d6c98a9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,74 @@ +2012-09-01 Daniel Colascione + + * xterm.h: Add header guards. Declare x_menubar_window_to_frame. + Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible, + x_make_frame_invisible, x_iconify_frame, x_free_frame_resources, + x_wm_set_size_hint, x_query_colors, x_real_positions, + x_set_menu_bar_lines, x_char_width, x_char_height, x_sync, + x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar, + all of which have been moved to common code. + + * xfaces.c: Include TERM_HEADER instead of listing all possible + window-system headers. + + * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here) + to match header. + + * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of + directly accessing frame internals. + + * w32font.h (w): Include font.h. Define syms_of_w32font and + globals_of_w32font. + + * process.c: Include TERM_HEADER instead of listing all possible + window-system headers. + + * nsterm.h: Remove declarations now in frame.h. Define + FRAME_X_SCREEN, FRAME_X_VISUAL. + + * menu.c: Include TERM_HEADER instead of listing all possible + window-system headers. + + * keyboard.h: Declare ignore_mouse_drag_p whenever we have a + window system. + + * keyboard.c: Include TERM_HEADER instead of listing all possible + window-system headers. + + * image.c: Include TERM_HEADER instead of listing all possible + window-system headers. Declare Vlibrary_cache when compiling for + Windows. + + * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed + window system declarations. + + * frame.h: Move common functions here: set_frame_menubar, + x_set_window_size, x_sync, x_get_focus_frame, + x_set_mouse_position, x_set_mouse_pixel_position, + x_make_frame_visible, x_make_frame_invisible, x_iconify_frame, + x_char_width, x_char_height, x_pixel_width, x_pixel_height, + x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines, + x_activate_menubar, x_real_positions, x_bitmap_icon, + x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources, + and x_query_colors. + + * frame.c: Include TERM_HEADER instead of listing all possible + window-system headers. + + * font.c: Include TERM_HEADER instead of listing all possible + window-system headers. + + * emacs.c: Include TERM_HEADER. + + * dispnew.c (d): Include TERM_HEADER instead of listing all + possible window-system headers. + + * ccl.h (c): Include character.h. + + * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for + the current window system; include in list of objects to link into + Emacs. + 2012-08-31 Dmitry Antipov Remove mark_ttys function and fix tty_display_info initialization. diff --git a/src/Makefile.in b/src/Makefile.in index 60df1f1c677..a809216f095 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -211,8 +211,8 @@ LIBXMENU=@LIBXMENU@ ## xmenu.o if HAVE_X_WINDOWS, else empty. XMENU_OBJ=@XMENU_OBJ@ -## xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o -## xsettings.o xgselect.o if HAVE_X_WINDOWS, else empty. +## xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o xgselect.o if +## HAVE_X_WINDOWS, else empty. XOBJ=@XOBJ@ TOOLKIT_LIBW=@TOOLKIT_LIBW@ @@ -247,6 +247,9 @@ WIDGET_OBJ=@WIDGET_OBJ@ ## sheap.o if CYGWIN, otherwise empty. CYGWIN_OBJ=@CYGWIN_OBJ@ +## fontset.o fringe.o image.o if we have any window system +WINDOW_SYSTEM_OBJ=@WINDOW_SYSTEM_OBJ@ + ## dosfns.o msdos.o w16select.o if MSDOS. MSDOS_OBJ = ## w16select.o termcap.o if MSDOS && HAVE_X_WINDOWS. @@ -255,7 +258,6 @@ MSDOS_X_OBJ = ns_appdir=@ns_appdir@ ns_appbindir=@ns_appbindir@ ns_appsrc=@ns_appsrc@ -## fontset.o fringe.o image.o if HAVE_NS, else empty. NS_OBJ=@NS_OBJ@ ## nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o if HAVE_NS. NS_OBJC_OBJ=@NS_OBJC_OBJ@ @@ -340,7 +342,8 @@ base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \ process.o gnutls.o callproc.o \ region-cache.o sound.o atimer.o \ doprnt.o intervals.o textprop.o composite.o xml.o \ - $(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) + $(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) \ + $(WINDOW_SYSTEM_OBJ) obj = $(base_obj) $(NS_OBJC_OBJ) ## Object files used on some machine or other. diff --git a/src/ccl.h b/src/ccl.h index 71139175be5..cc5daf11e1c 100644 --- a/src/ccl.h +++ b/src/ccl.h @@ -26,6 +26,8 @@ along with GNU Emacs. If not, see . */ #ifndef EMACS_CCL_H #define EMACS_CCL_H +#include "character.h" /* For MAX_MULTIBYTE_LENGTH */ + /* Macros for exit status of CCL program. */ #define CCL_STAT_SUCCESS 0 /* Terminated successfully. */ #define CCL_STAT_SUSPEND_BY_SRC 1 /* Terminated by empty input. */ diff --git a/src/dispnew.c b/src/dispnew.c index 2d232d49c53..cac4c2da4c4 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -47,17 +47,9 @@ along with GNU Emacs. If not, see . */ #include "syssignal.h" -#ifdef HAVE_X_WINDOWS -#include "xterm.h" -#endif /* HAVE_X_WINDOWS */ - -#ifdef HAVE_NTGUI -#include "w32term.h" -#endif /* HAVE_NTGUI */ - -#ifdef HAVE_NS -#include "nsterm.h" -#endif +#ifdef HAVE_WINDOW_SYSTEM +#include TERM_HEADER +#endif /* HAVE_WINDOW_SYSTEM */ /* Include systime.h after xterm.h to avoid double inclusion of time.h. */ diff --git a/src/emacs.c b/src/emacs.c index 7ff5c43dbea..d6e4887292e 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -31,6 +31,10 @@ along with GNU Emacs. If not, see . */ #include "lisp.h" +#ifdef HAVE_WINDOW_SYSTEM +#include TERM_HEADER +#endif /* HAVE_WINDOW_SYSTEM */ + #ifdef WINDOWSNT #include #include /* just for w32.h */ @@ -62,20 +66,12 @@ along with GNU Emacs. If not, see . */ #include "gnutls.h" #endif -#ifdef HAVE_NS -#include "nsterm.h" -#endif - #if (defined PROFILING \ && (defined __FreeBSD__ || defined GNU_LINUX || defined __MINGW32__)) # include extern void moncontrol (int mode); #endif -#ifdef HAVE_X_WINDOWS -#include "xterm.h" -#endif - #ifdef HAVE_SETLOCALE #include #endif diff --git a/src/font.c b/src/font.c index 5b9e4f1cfcf..cf9964f08f3 100644 --- a/src/font.c +++ b/src/font.c @@ -38,17 +38,9 @@ along with GNU Emacs. If not, see . */ #include "fontset.h" #include "font.h" -#ifdef HAVE_X_WINDOWS -#include "xterm.h" -#endif /* HAVE_X_WINDOWS */ - -#ifdef HAVE_NTGUI -#include "w32term.h" -#endif /* HAVE_NTGUI */ - -#ifdef HAVE_NS -#include "nsterm.h" -#endif /* HAVE_NS */ +#ifdef HAVE_WINDOW_SYSTEM +#include TERM_HEADER +#endif /* HAVE_WINDOW_SYSTEM */ Lisp_Object Qopentype; diff --git a/src/frame.c b/src/frame.c index 4785840a95f..968cb4905a2 100644 --- a/src/frame.c +++ b/src/frame.c @@ -30,15 +30,11 @@ along with GNU Emacs. If not, see . */ #include "lisp.h" #include "character.h" -#ifdef HAVE_X_WINDOWS -#include "xterm.h" -#endif -#ifdef WINDOWSNT -#include "w32term.h" -#endif -#ifdef HAVE_NS -#include "nsterm.h" -#endif + +#ifdef HAVE_WINDOW_SYSTEM +#include TERM_HEADER +#endif /* HAVE_WINDOW_SYSTEM */ + #include "buffer.h" /* These help us bind and responding to switch-frame events. */ #include "commands.h" @@ -58,11 +54,6 @@ along with GNU Emacs. If not, see . */ #include "dosfns.h" #endif - -#ifdef HAVE_WINDOW_SYSTEM - -#endif - #ifdef HAVE_NS Lisp_Object Qns_parse_geometry; #endif diff --git a/src/frame.h b/src/frame.h index 8587f094a95..76fde8ec96b 100644 --- a/src/frame.h +++ b/src/frame.h @@ -1251,10 +1251,40 @@ extern Lisp_Object display_x_get_resource (Display_Info *, Lisp_Object component, Lisp_Object subclass); +extern void set_frame_menubar (struct frame *f, int first_time, int deep_p); +extern void x_set_window_size (struct frame *f, int change_grav, + int cols, int rows); +extern void x_sync (struct frame *); +extern Lisp_Object x_get_focus_frame (struct frame *); +extern void x_set_mouse_position (struct frame *f, int h, int v); +extern void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y); +extern void x_make_frame_visible (struct frame *f); +extern void x_make_frame_invisible (struct frame *f); +extern void x_iconify_frame (struct frame *f); +extern int x_char_width (struct frame *f); +extern int x_char_height (struct frame *f); +extern int x_pixel_width (struct frame *f); +extern int x_pixel_height (struct frame *f); +extern void x_set_frame_alpha (struct frame *f); +extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object); +extern void x_set_tool_bar_lines (struct frame *f, + Lisp_Object value, + Lisp_Object oldval); +extern void x_activate_menubar (struct frame *); +extern void x_real_positions (struct frame *, int *, int *); +extern int x_bitmap_icon (struct frame *, Lisp_Object); +extern void x_set_menu_bar_lines (struct frame *, + Lisp_Object, + Lisp_Object); +extern void free_frame_menubar (struct frame *); +extern void x_free_frame_resources (struct frame *); + #if defined HAVE_X_WINDOWS && !defined USE_X_TOOLKIT extern char *x_get_resource_string (const char *, const char *); #endif +extern void x_query_colors (struct frame *f, XColor *, int); + /* In xmenu.c */ extern void set_frame_menubar (FRAME_PTR, int, int); diff --git a/src/gtkutil.h b/src/gtkutil.h index 462e879d3e7..c1b6634999f 100644 --- a/src/gtkutil.h +++ b/src/gtkutil.h @@ -25,6 +25,7 @@ along with GNU Emacs. If not, see . */ #include #include "frame.h" +#include "xterm.h" /* Minimum and maximum values used for GTK scroll bars */ diff --git a/src/image.c b/src/image.c index f2778165ece..c444c986a76 100644 --- a/src/image.c +++ b/src/image.c @@ -50,11 +50,19 @@ along with GNU Emacs. If not, see . */ #include "termhooks.h" #include "font.h" -#ifdef HAVE_X_WINDOWS -#include "xterm.h" -#include +#ifdef HAVE_SYS_STAT_H #include +#endif /* HAVE_SYS_STAT_H */ +#ifdef HAVE_SYS_TYPES_H +#include +#endif /* HAVE_SYS_TYPES_H */ + +#ifdef HAVE_WINDOW_SYSTEM +#include TERM_HEADER +#endif /* HAVE_WINDOW_SYSTEM */ + +#ifdef HAVE_X_WINDOWS #define COLOR_TABLE_SUPPORT 1 typedef struct x_bitmap_record Bitmap_Record; @@ -67,11 +75,7 @@ typedef struct x_bitmap_record Bitmap_Record; #define PIX_MASK_DRAW 1 #endif /* HAVE_X_WINDOWS */ - #ifdef HAVE_NTGUI -#include "w32.h" -#include "w32term.h" - /* W32_TODO : Color tables on W32. */ #undef COLOR_TABLE_SUPPORT @@ -84,15 +88,9 @@ typedef struct w32_bitmap_record Bitmap_Record; #define PIX_MASK_RETAIN 0 #define PIX_MASK_DRAW 1 -#define FRAME_X_VISUAL(f) FRAME_X_DISPLAY_INFO (f)->visual #define x_defined_color w32_defined_color #define DefaultDepthOfScreen(screen) (one_w32_display_info.n_cbits) -/* Functions from w32term.c that depend on XColor (so can't go in w32term.h - without modifying lots of files). */ -extern void x_query_colors (struct frame *f, XColor *colors, int ncolors); -extern void x_query_color (struct frame *f, XColor *color); - /* Version of libpng that we were compiled with, or -1 if no PNG support was compiled in. This is tested by w32-win.el to correctly set up the alist used to search for PNG libraries. */ @@ -100,10 +98,6 @@ Lisp_Object Qlibpng_version; #endif /* HAVE_NTGUI */ #ifdef HAVE_NS -#include "nsterm.h" -#include -#include - #undef COLOR_TABLE_SUPPORT typedef struct ns_bitmap_record Bitmap_Record; @@ -117,10 +111,8 @@ typedef struct ns_bitmap_record Bitmap_Record; #define PIX_MASK_RETAIN 0 #define PIX_MASK_DRAW 1 -#define FRAME_X_VISUAL FRAME_NS_DISPLAY_INFO (f)->visual #define x_defined_color(f, name, color_def, alloc) \ ns_defined_color (f, name, color_def, alloc, 0) -#define FRAME_X_SCREEN(f) 0 #define DefaultDepthOfScreen(screen) x_display_list->n_planes #endif /* HAVE_NS */ @@ -577,6 +569,7 @@ static void x_emboss (struct frame *, struct image *); static int x_build_heuristic_mask (struct frame *, struct image *, Lisp_Object); #ifdef HAVE_NTGUI +extern Lisp_Object Vlibrary_cache, QCloaded_from; #define CACHE_IMAGE_TYPE(type, status) \ do { Vlibrary_cache = Fcons (Fcons (type, status), Vlibrary_cache); } while (0) #else diff --git a/src/keyboard.c b/src/keyboard.c index d9b88a8a911..7b1ea341e7f 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -63,20 +63,11 @@ along with GNU Emacs. If not, see . */ #include #include -/* This is to get the definitions of the XK_ symbols. */ -#ifdef HAVE_X_WINDOWS -#include "xterm.h" -#endif +#ifdef HAVE_WINDOW_SYSTEM +#include TERM_HEADER +#endif /* HAVE_WINDOW_SYSTEM */ -#ifdef HAVE_NTGUI -#include "w32term.h" -#endif /* HAVE_NTGUI */ - -#ifdef HAVE_NS -#include "nsterm.h" -#endif - -/* Variables for blockinput.h: */ +/* Variables for blockinput.h: */ /* Non-zero if interrupt input is blocked right now. */ volatile int interrupt_input_blocked; @@ -1324,7 +1315,7 @@ usage: (track-mouse BODY...) */) If ignore_mouse_drag_p is non-zero, ignore (implicit) mouse movement after resizing the tool-bar window. */ -#if !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS +#if !defined HAVE_WINDOW_SYSTEM static #endif int ignore_mouse_drag_p; diff --git a/src/keyboard.h b/src/keyboard.h index 91484b3649b..98b1933f3f9 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -469,7 +469,7 @@ extern int waiting_for_input; happens. */ extern EMACS_TIME *input_available_clear_time; -#if defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS +#if defined HAVE_WINDOW_SYSTEM extern int ignore_mouse_drag_p; #endif diff --git a/src/menu.c b/src/menu.c index 3e466b46aa3..20770537326 100644 --- a/src/menu.c +++ b/src/menu.c @@ -36,24 +36,13 @@ along with GNU Emacs. If not, see . */ #include "../lwlib/lwlib.h" #endif -#ifdef HAVE_X_WINDOWS -#include "xterm.h" -#endif - -#ifdef HAVE_NS -#include "nsterm.h" -#endif - -#ifdef USE_GTK -#include "gtkutil.h" -#endif +#ifdef HAVE_WINDOW_SYSTEM +#include TERM_HEADER +#endif /* HAVE_WINDOW_SYSTEM */ #ifdef HAVE_NTGUI -#include "w32term.h" - extern AppendMenuW_Proc unicode_append_menu; extern HMENU current_popup_menu; - #endif /* HAVE_NTGUI */ #include "menu.h" diff --git a/src/nsterm.h b/src/nsterm.h index f9149d97571..f0cae193005 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -631,6 +631,8 @@ struct x_output /* This is the `Display *' which frame F is on. */ #define FRAME_NS_DISPLAY(f) (0) #define FRAME_X_DISPLAY(f) (0) +#define FRAME_X_SCREEN(f) (0) +#define FRAME_X_VISUAL(f) FRAME_NS_DISPLAY_INFO(f)->visual #define FRAME_FOREGROUND_COLOR(f) ((f)->output_data.ns->foreground_color) #define FRAME_BACKGROUND_COLOR(f) ((f)->output_data.ns->background_color) @@ -780,31 +782,6 @@ extern Lisp_Object find_and_return_menu_selection (FRAME_PTR f, extern Lisp_Object ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header); -/* More prototypes that should be moved to a more general include file */ -extern void set_frame_menubar (struct frame *f, int first_time, int deep_p); -extern void x_set_window_size (struct frame *f, int change_grav, - int cols, int rows); -extern void x_sync (struct frame *); -extern Lisp_Object x_get_focus_frame (struct frame *); -extern void x_set_mouse_position (struct frame *f, int h, int v); -extern void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y); -extern void x_make_frame_visible (struct frame *f); -extern void x_make_frame_invisible (struct frame *f); -extern void x_iconify_frame (struct frame *f); -extern int x_char_width (struct frame *f); -extern int x_char_height (struct frame *f); -extern int x_pixel_width (struct frame *f); -extern int x_pixel_height (struct frame *f); -extern void x_set_frame_alpha (struct frame *f); -extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object); -extern void x_set_tool_bar_lines (struct frame *f, - Lisp_Object value, - Lisp_Object oldval); -extern void x_activate_menubar (struct frame *); -extern void free_frame_menubar (struct frame *); -extern void x_free_frame_resources (struct frame *); -extern void x_destroy_window (struct frame *); - #define NSAPP_DATA2_RUNASSCRIPT 10 extern void ns_run_ascript (void); diff --git a/src/process.c b/src/process.c index fbe56ebcb54..bfac054c3c2 100644 --- a/src/process.c +++ b/src/process.c @@ -116,12 +116,13 @@ along with GNU Emacs. If not, see . */ #include "gnutls.h" #endif +#ifdef HAVE_WINDOW_SYSTEM +#include TERM_HEADER +#endif /* HAVE_WINDOW_SYSTEM */ + #if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS) #include "xgselect.h" #endif -#ifdef HAVE_NS -#include "nsterm.h" -#endif /* Work around GCC 4.7.0 bug with strict overflow checking; see . diff --git a/src/w32font.h b/src/w32font.h index b08d48a3d36..a29ddbe778c 100644 --- a/src/w32font.h +++ b/src/w32font.h @@ -19,6 +19,7 @@ along with GNU Emacs. If not, see . */ #ifndef EMACS_W32FONT_H #define EMACS_W32FONT_H +#include "font.h" /* Bit 17 of ntmFlags in NEWTEXTMETRIC is set for PostScript OpenType fonts, bit 18 for TrueType OpenType fonts, bit 20 for Type1 fonts. */ @@ -83,4 +84,7 @@ int uniscribe_check_otf (LOGFONT *font, Lisp_Object otf_spec); Lisp_Object intern_font_name (char *); +extern void syms_of_w32font (void); +extern void globals_of_w32font (void); + #endif diff --git a/src/w32term.h b/src/w32term.h index 6fc2beeb18c..5d756f435e4 100644 --- a/src/w32term.h +++ b/src/w32term.h @@ -342,7 +342,7 @@ extern struct w32_output w32term_display; /* Return the window associated with the frame F. */ #define FRAME_W32_WINDOW(f) ((f)->output_data.w32->window_desc) -#define FRAME_X_WINDOW(f) ((f)->output_data.w32->window_desc) +#define FRAME_X_WINDOW(f) FRAME_W32_WINDOW (f) #define FRAME_FONT(f) ((f)->output_data.w32->font) #define FRAME_FONTSET(f) ((f)->output_data.w32->fontset) diff --git a/src/w32xfns.c b/src/w32xfns.c index 745a5cfe3e7..62e45dd987b 100644 --- a/src/w32xfns.c +++ b/src/w32xfns.c @@ -438,6 +438,6 @@ XParseGeometry (char *string, /* x_sync is a no-op on W32. */ void -x_sync (void *f) +x_sync (struct frame *f) { } diff --git a/src/xfaces.c b/src/xfaces.c index 820d764d0a8..5554c4aa705 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -225,11 +225,10 @@ along with GNU Emacs. If not, see . */ #include "dosfns.h" #endif -#ifdef WINDOWSNT -#include "w32term.h" +#ifdef HAVE_WINDOW_SYSTEM +#include TERM_HEADER #include "fontset.h" -/* Redefine X specifics to W32 equivalents to avoid cluttering the - code with #ifdef blocks. */ +#ifdef WINDOWSNT #undef FRAME_X_DISPLAY_INFO #define FRAME_X_DISPLAY_INFO FRAME_W32_DISPLAY_INFO #define x_display_info w32_display_info @@ -238,13 +237,13 @@ along with GNU Emacs. If not, see . */ #endif /* WINDOWSNT */ #ifdef HAVE_NS -#include "nsterm.h" #undef FRAME_X_DISPLAY_INFO #define FRAME_X_DISPLAY_INFO FRAME_NS_DISPLAY_INFO #define x_display_info ns_display_info #define check_x check_ns #define GCGraphicsExposures 0 #endif /* HAVE_NS */ +#endif /* HAVE_WINDOW_SYSTEM */ #include "buffer.h" #include "dispextern.h" @@ -254,9 +253,6 @@ along with GNU Emacs. If not, see . */ #include "termchar.h" #include "font.h" -#ifdef HAVE_WINDOW_SYSTEM -#include "fontset.h" -#endif /* HAVE_WINDOW_SYSTEM */ #ifdef HAVE_X_WINDOWS @@ -2565,13 +2561,13 @@ merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to, } else if (EQ (keyword, QCstipple)) { -#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS) +#if defined (HAVE_WINDOW_SYSTEM) Lisp_Object pixmap_p = Fbitmap_spec_p (value); if (!NILP (pixmap_p)) to[LFACE_STIPPLE_INDEX] = value; else err = 1; -#endif +#endif /* HAVE_WINDOW_SYSTEM */ } else if (EQ (keyword, QCwidth)) { @@ -3125,14 +3121,14 @@ FRAME 0 means change the face on all frames, and change the default } else if (EQ (attr, QCstipple)) { -#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS) +#if defined (HAVE_WINDOW_SYSTEM) if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value) && !NILP (value) && NILP (Fbitmap_spec_p (value))) signal_error ("Invalid stipple attribute", value); old_value = LFACE_STIPPLE (lface); ASET (lface, LFACE_STIPPLE_INDEX, value); -#endif /* HAVE_X_WINDOWS || HAVE_NS */ +#endif /* HAVE_WINDOW_SYSTEM */ } else if (EQ (attr, QCwidth)) { diff --git a/src/xterm.h b/src/xterm.h index 007c92b929c..2d718f49118 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -16,6 +16,9 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ +#ifndef XTERM_H +#define XTERM_H + #include #include @@ -367,13 +370,14 @@ extern int use_xim; extern void check_x (void); extern struct frame *x_window_to_frame (struct x_display_info *, int); - extern struct frame *x_any_window_to_frame (struct x_display_info *, int); extern struct frame *x_menubar_window_to_frame (struct x_display_info *, XEvent *); - extern struct frame *x_top_window_to_frame (struct x_display_info *, int); +extern struct frame *x_menubar_window_to_frame (struct x_display_info *, + XEvent *); + #if ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK) #define x_any_window_to_frame x_window_to_frame #define x_top_window_to_frame x_window_to_frame @@ -389,7 +393,6 @@ extern struct x_display_info *x_display_list; extern Lisp_Object x_display_name_list; extern struct x_display_info *x_display_info_for_display (Display *); -extern void x_set_frame_alpha (struct frame *); extern struct x_display_info *x_term_init (Lisp_Object, char *, char *); extern int x_display_ok (const char *); @@ -941,7 +944,6 @@ XrmDatabase x_load_resources (Display *, const char *, const char *, /* Defined in xterm.c */ extern int x_text_icon (struct frame *, const char *); -extern int x_bitmap_icon (struct frame *, Lisp_Object); extern void x_catch_errors (Display *); extern void x_check_errors (Display *, const char *) ATTRIBUTE_FORMAT_PRINTF (2, 0); @@ -953,11 +955,6 @@ extern void x_set_mouse_position (struct frame *, int, int); extern void x_set_mouse_pixel_position (struct frame *, int, int); extern void xembed_request_focus (struct frame *); extern void x_ewmh_activate_frame (struct frame *); -extern void x_make_frame_visible (struct frame *); -extern void x_make_frame_invisible (struct frame *); -extern void x_iconify_frame (struct frame *); -extern void x_free_frame_resources (struct frame *); -extern void x_wm_set_size_hint (struct frame *, long, int); extern void x_delete_terminal (struct terminal *terminal); extern unsigned long x_copy_color (struct frame *, unsigned long); #ifdef USE_X_TOOLKIT @@ -970,7 +967,6 @@ extern int x_alloc_lighter_color_for_widget (Widget, Display *, Colormap, double, int); #endif extern int x_alloc_nearest_color (struct frame *, Colormap, XColor *); -extern void x_query_colors (struct frame *f, XColor *, int); extern void x_query_color (struct frame *f, XColor *); extern void x_clear_area (Display *, Window, int, int, int, int, int); #if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK @@ -1029,8 +1025,6 @@ extern int xg_set_icon (struct frame *, Lisp_Object); extern int xg_set_icon_from_xpm_data (struct frame *, const char**); #endif /* USE_GTK */ -extern void x_real_positions (struct frame *, int *, int *); -extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object); extern void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object); extern void xic_free_xfontset (struct frame *); extern void create_frame_xic (struct frame *); @@ -1040,9 +1034,6 @@ extern void xic_set_statusarea (struct frame *); extern void xic_set_xfontset (struct frame *, const char *); extern int x_pixel_width (struct frame *); extern int x_pixel_height (struct frame *); -extern int x_char_width (struct frame *); -extern int x_char_height (struct frame *); -extern void x_sync (struct frame *); extern int x_defined_color (struct frame *, const char *, XColor *, int); #ifdef HAVE_X_I18N extern void free_frame_xic (struct frame *); @@ -1050,7 +1041,6 @@ extern void free_frame_xic (struct frame *); extern char * xic_create_fontsetname (const char *base_fontname, int motif); # endif #endif -extern void x_set_tool_bar_lines (struct frame *, Lisp_Object, Lisp_Object); /* Defined in xfaces.c */ @@ -1067,10 +1057,8 @@ extern void x_menu_set_in_use (int); #ifdef USE_MOTIF extern void x_menu_wait_for_event (void *data); #endif -extern void x_activate_menubar (struct frame *); extern int popup_activated (void); extern void initialize_frame_menubar (struct frame *); -extern void free_frame_menubar (struct frame *); /* Defined in widget.c */ @@ -1112,3 +1100,5 @@ extern Lisp_Object Qx_gtk_map_stock; (nr).y = (ry), \ (nr).width = (rwidth), \ (nr).height = (rheight)) + +#endif /* XTERM_H */ From 86571ae075b3fedc4b7312738fe99af9b7991f69 Mon Sep 17 00:00:00 2001 From: Daniel Colascione Date: Sat, 1 Sep 2012 00:22:10 -0800 Subject: [PATCH 183/212] Prevent crash if w32 used before it's initialized --- src/ChangeLog | 5 +++++ src/w32fns.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3c878d5850f..cfa60cbcf66 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-09-01 Daniel Colascione + + * w32fns.c (x_display_info_for_name): Prevent crash if w32 window + system used too early. + 2012-09-01 Paul Eggert Better seed support for (random). diff --git a/src/w32fns.c b/src/w32fns.c index 9c5231f9d93..5a1b6dfabab 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -4735,7 +4735,7 @@ x_display_info_for_name (Lisp_Object name) CHECK_STRING (name); for (dpyinfo = &one_w32_display_info, names = w32_display_name_list; - dpyinfo; + dpyinfo && !NILP (w32_display_name_list); dpyinfo = dpyinfo->next, names = XCDR (names)) { Lisp_Object tem; From 4dfbd23866adef6886771b80a464decc9e95e7c5 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 1 Sep 2012 12:29:17 +0300 Subject: [PATCH 184/212] Fix last changes related to w32 and Cygwin. src/image.c: Restore mistakenly removed inclusion of w32.h. Without it, GCC doesn't see prototypes of w32_delayed_load, and complains about implicit conversions from integer to pointer. --- src/ChangeLog | 6 ++++++ src/image.c | 1 + 2 files changed, 7 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index cfa60cbcf66..56e45503ad0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-09-01 Eli Zaretskii + + * image.c: Restore mistakenly removed inclusion of w32.h. Without + it, GCC doesn't see prototypes of w32_delayed_load, and complains + about implicit conversions from integer to pointer. + 2012-09-01 Daniel Colascione * w32fns.c (x_display_info_for_name): Prevent crash if w32 window diff --git a/src/image.c b/src/image.c index c444c986a76..d4e78d41000 100644 --- a/src/image.c +++ b/src/image.c @@ -76,6 +76,7 @@ typedef struct x_bitmap_record Bitmap_Record; #endif /* HAVE_X_WINDOWS */ #ifdef HAVE_NTGUI +#include "w32.h" /* W32_TODO : Color tables on W32. */ #undef COLOR_TABLE_SUPPORT From 42dcba546d85f7812242cbadb4617f87e1eb5ed3 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 1 Sep 2012 06:17:31 -0400 Subject: [PATCH 185/212] Auto-commit of generated files. --- autogen/Makefile.in | 1 + autogen/config.in | 3 +++ autogen/configure | 58 +++++++++++++++++++++++++++++++++++---------- 3 files changed, 49 insertions(+), 13 deletions(-) diff --git a/autogen/Makefile.in b/autogen/Makefile.in index 58462459d6f..d52d1543c55 100644 --- a/autogen/Makefile.in +++ b/autogen/Makefile.in @@ -755,6 +755,7 @@ WERROR_CFLAGS = @WERROR_CFLAGS@ WIDGET_OBJ = @WIDGET_OBJ@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ +WINDOW_SYSTEM_OBJ = @WINDOW_SYSTEM_OBJ@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XFT_CFLAGS = @XFT_CFLAGS@ XFT_LIBS = @XFT_LIBS@ diff --git a/autogen/config.in b/autogen/config.in index 8cda73e6cbe..89174519488 100644 --- a/autogen/config.in +++ b/autogen/config.in @@ -1345,6 +1345,9 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if you use terminfo instead of termcap. */ #undef TERMINFO +/* Define to the header for the built-in window system. */ +#undef TERM_HEADER + /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME diff --git a/autogen/configure b/autogen/configure index 487f8de395a..90fa63c7322 100755 --- a/autogen/configure +++ b/autogen/configure @@ -604,6 +604,7 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS SUBDIR_MAKEFILES_IN +WINDOW_SYSTEM_OBJ LIB_GCC LD_FIRSTFLAG LD_SWITCH_SYSTEM_TEMACS @@ -9149,6 +9150,12 @@ fi #### Choose a window system. +## We leave window_system equal to none if +## we end up building without one. Any new window system should +## set window_system to an appropriate value and add objects to +## window-system-specific substs. + +window_system=none { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 $as_echo_n "checking for X... " >&6; } @@ -9342,9 +9349,7 @@ else $as_echo "libraries $x_libraries, headers $x_includes" >&6; } fi -if test "$no_x" = yes; then - window_system=none -else +if test "$no_x" != yes; then window_system=x11 fi @@ -9519,7 +9524,6 @@ if test "${HAVE_NS}" = yes; then fi window_system=nextstep - with_xft=no # set up packaging dirs if test "${EN_NS_SELF_CONTAINED}" = yes; then ns_self_contained=yes @@ -9536,7 +9540,6 @@ if test "${HAVE_NS}" = yes; then INSTALL_ARCH_INDEP_EXTRA= fi ns_frag=$srcdir/src/ns.mk - NS_OBJ="fontset.o fringe.o image.o" NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o" fi CFLAGS="$tmp_CFLAGS" @@ -9548,28 +9551,45 @@ CPPFLAGS="$tmp_CPPFLAGS" +## $window_system is now set to the window system we will +## ultimately use. + +term_header= +HAVE_X_WINDOWS=no +HAVE_X11=no +USE_X_TOOLKIT=none + case "${window_system}" in x11 ) HAVE_X_WINDOWS=yes HAVE_X11=yes + term_header=xterm.h case "${with_x_toolkit}" in athena | lucid ) USE_X_TOOLKIT=LUCID ;; motif ) USE_X_TOOLKIT=MOTIF ;; gtk ) with_gtk=yes + term_header=gtkutil.h USE_X_TOOLKIT=none ;; gtk3 ) with_gtk3=yes + term_header=gtkutil.h USE_X_TOOLKIT=none ;; no ) USE_X_TOOLKIT=none ;; * ) USE_X_TOOLKIT=maybe ;; esac ;; - nextstep | none ) - HAVE_X_WINDOWS=no - HAVE_X11=no - USE_X_TOOLKIT=none + nextstep ) + term_header=nsterm.h ;; esac +if test -n "${term_header}"; then + +cat >>confdefs.h <<_ACEOF +#define TERM_HEADER "${term_header}" +_ACEOF + +fi + if test "$window_system" = none && test "X$with_x" != "Xno"; then # Extract the first word of "X", so it can be a program name with args. set dummy X; ac_word=$2 @@ -10561,6 +10581,7 @@ $as_echo "no" >&6; } $as_echo "#define HAVE_GTK3 1" >>confdefs.h GTK_OBJ=emacsgtkfixed.o + term_header=gtkutil.h fi if test "$pkg_check_gtk" != "yes"; then @@ -10723,6 +10744,8 @@ _ACEOF fi done + + term_header=gtkutil.h fi HAVE_DBUS=no @@ -15643,6 +15666,14 @@ version=$PACKAGE_VERSION +if test -n "${term_header}"; then + +cat >>confdefs.h <<_ACEOF +#define TERM_HEADER "${term_header}" +_ACEOF + +fi + cat >>confdefs.h <<_ACEOF #define EMACS_CONFIGURATION "${canonical}" @@ -15663,7 +15694,7 @@ if test "${HAVE_X_WINDOWS}" = "yes" ; then $as_echo "#define HAVE_X_WINDOWS 1" >>confdefs.h XMENU_OBJ=xmenu.o - XOBJ="xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o xsettings.o xgselect.o" + XOBJ="xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o xgselect.o" FONT_OBJ=xfont.o if test "$HAVE_XFT" = "yes"; then FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o" @@ -24070,20 +24101,21 @@ if test "x$GCC" = "xyes" && test "x$ORDINARY_LINK" != "xyes"; then esac fi - -## If we're using X11/GNUstep, define some consequences. -if test "$HAVE_X_WINDOWS" = "yes" || test "$HAVE_NS" = "yes"; then +## Common for all window systems +if test "$window_system" != "none"; then $as_echo "#define HAVE_WINDOW_SYSTEM 1" >>confdefs.h $as_echo "#define HAVE_MOUSE 1" >>confdefs.h + WINDOW_SYSTEM_OBJ="fontset.o fringe.o image.o" fi + #### Report on what we decided to do. #### Report GTK as a toolkit, even if it doesn't use Xt. #### It makes printing result more understandable as using GTK sets From 25eac50084cbfda539894cedede5893656cdac2d Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 1 Sep 2012 06:20:47 -0400 Subject: [PATCH 186/212] Auto-commit of loaddefs files. --- lisp/ldefs-boot.el | 500 +++++++++++++++++++++++++-------------------- 1 file changed, 279 insertions(+), 221 deletions(-) diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 8b7a0ab3e6f..7b515a69a1c 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -5,7 +5,7 @@ ;;;### (autoloads (5x5-crack 5x5-crack-xor-mutate 5x5-crack-mutating-best ;;;;;; 5x5-crack-mutating-current 5x5-crack-randomly 5x5) "5x5" -;;;;;; "play/5x5.el" (20478 3673 653810 0)) +;;;;;; "play/5x5.el" (20545 57511 257469 0)) ;;; Generated autoloads from play/5x5.el (autoload '5x5 "5x5" "\ @@ -114,7 +114,7 @@ Completion is available. ;;;;;; add-change-log-entry-other-window add-change-log-entry find-change-log ;;;;;; prompt-for-change-log-name add-log-mailing-address add-log-full-name ;;;;;; add-log-current-defun-function) "add-log" "vc/add-log.el" -;;;;;; (20495 51111 757560 0)) +;;;;;; (20523 62082 997685 0)) ;;; Generated autoloads from vc/add-log.el (put 'change-log-default-name 'safe-local-variable 'string-or-null-p) @@ -398,7 +398,7 @@ usage: (defadvice FUNCTION (CLASS NAME [POSITION] [ARGLIST] FLAG...) ;;;### (autoloads (align-newline-and-indent align-unhighlight-rule ;;;;;; align-highlight-rule align-current align-entire align-regexp -;;;;;; align) "align" "align.el" (20355 10021 546955 0)) +;;;;;; align) "align" "align.el" (20515 36389 544939 0)) ;;; Generated autoloads from align.el (autoload 'align "align" "\ @@ -489,7 +489,7 @@ A replacement function for `newline-and-indent', aligning as it goes. ;;;### (autoloads (outlineify-sticky allout-mode allout-mode-p allout-auto-activation ;;;;;; allout-setup allout-auto-activation-helper) "allout" "allout.el" -;;;;;; (20399 35365 4050 0)) +;;;;;; (20523 62082 997685 0)) ;;; Generated autoloads from allout.el (autoload 'allout-auto-activation-helper "allout" "\ @@ -850,7 +850,7 @@ for details on preparing Emacs for automatic allout activation. ;;;### (autoloads (allout-widgets-mode allout-widgets-auto-activation ;;;;;; allout-widgets-setup allout-widgets) "allout-widgets" "allout-widgets.el" -;;;;;; (20437 50597 545250 0)) +;;;;;; (20545 57511 257469 0)) ;;; Generated autoloads from allout-widgets.el (let ((loads (get 'allout-widgets 'custom-loads))) (if (member '"allout-widgets" loads) nil (put 'allout-widgets 'custom-loads (cons '"allout-widgets" loads)))) @@ -932,7 +932,7 @@ directory, so that Emacs will know its current contents. ;;;*** ;;;### (autoloads (animate-birthday-present animate-sequence animate-string) -;;;;;; "animate" "play/animate.el" (20355 10021 546955 0)) +;;;;;; "animate" "play/animate.el" (20545 57511 257469 0)) ;;; Generated autoloads from play/animate.el (autoload 'animate-string "animate" "\ @@ -965,7 +965,7 @@ the buffer *Birthday-Present-for-Name*. ;;;*** ;;;### (autoloads (ansi-color-process-output ansi-color-for-comint-mode-on) -;;;;;; "ansi-color" "ansi-color.el" (20453 38823 158957 0)) +;;;;;; "ansi-color" "ansi-color.el" (20523 30501 603360 0)) ;;; Generated autoloads from ansi-color.el (autoload 'ansi-color-for-comint-mode-on "ansi-color" "\ @@ -1051,8 +1051,8 @@ ARG is positive, otherwise off. ;;;### (autoloads (apropos-documentation apropos-value apropos-library ;;;;;; apropos apropos-documentation-property apropos-command apropos-variable -;;;;;; apropos-read-pattern) "apropos" "apropos.el" (20497 6436 -;;;;;; 957082 0)) +;;;;;; apropos-read-pattern) "apropos" "apropos.el" (20523 62082 +;;;;;; 997685 0)) ;;; Generated autoloads from apropos.el (autoload 'apropos-read-pattern "apropos" "\ @@ -1253,8 +1253,8 @@ Entering array mode calls the function `array-mode-hook'. ;;;*** -;;;### (autoloads (artist-mode) "artist" "textmodes/artist.el" (20357 -;;;;;; 58785 834364 0)) +;;;### (autoloads (artist-mode) "artist" "textmodes/artist.el" (20513 +;;;;;; 18948 537867 0)) ;;; Generated autoloads from textmodes/artist.el (autoload 'artist-mode "artist" "\ @@ -1488,7 +1488,7 @@ Special commands: ;;;*** ;;;### (autoloads (auth-source-cache-expiry) "auth-source" "gnus/auth-source.el" -;;;;;; (20502 24369 261101 0)) +;;;;;; (20544 36659 880486 0)) ;;; Generated autoloads from gnus/auth-source.el (defvar auth-source-cache-expiry 7200 "\ @@ -1562,7 +1562,7 @@ This is similar to `autoarg-mode' but rebinds the keypad keys ;;;*** ;;;### (autoloads (autoconf-mode) "autoconf" "progmodes/autoconf.el" -;;;;;; (20505 550 96420 0)) +;;;;;; (20513 18948 537867 0)) ;;; Generated autoloads from progmodes/autoconf.el (autoload 'autoconf-mode "autoconf" "\ @@ -1613,7 +1613,7 @@ insert a template for the file depending on the mode of the buffer. ;;;### (autoloads (batch-update-autoloads update-directory-autoloads ;;;;;; update-file-autoloads) "autoload" "emacs-lisp/autoload.el" -;;;;;; (20497 6436 957082 0)) +;;;;;; (20518 12580 46478 0)) ;;; Generated autoloads from emacs-lisp/autoload.el (put 'generated-autoload-file 'safe-local-variable 'stringp) @@ -1989,8 +1989,8 @@ Binhex decode region between START and END. ;;;*** -;;;### (autoloads (blackbox) "blackbox" "play/blackbox.el" (20355 -;;;;;; 10021 546955 0)) +;;;### (autoloads (blackbox) "blackbox" "play/blackbox.el" (20545 +;;;;;; 57511 257469 0)) ;;; Generated autoloads from play/blackbox.el (autoload 'blackbox "blackbox" "\ @@ -2113,7 +2113,7 @@ a reflection. ;;;;;; bookmark-save bookmark-write bookmark-delete bookmark-insert ;;;;;; bookmark-rename bookmark-insert-location bookmark-relocate ;;;;;; bookmark-jump-other-window bookmark-jump bookmark-set) "bookmark" -;;;;;; "bookmark.el" (20476 31768 298871 0)) +;;;;;; "bookmark.el" (20514 15527 107017 0)) ;;; Generated autoloads from bookmark.el (define-key ctl-x-r-map "b" 'bookmark-jump) (define-key ctl-x-r-map "m" 'bookmark-set) @@ -2630,7 +2630,7 @@ from `browse-url-elinks-wrapper'. ;;;*** ;;;### (autoloads (bs-show bs-customize bs-cycle-previous bs-cycle-next) -;;;;;; "bs" "bs.el" (20479 62884 77836 0)) +;;;;;; "bs" "bs.el" (20520 54308 826101 0)) ;;; Generated autoloads from bs.el (autoload 'bs-cycle-next "bs" "\ @@ -2693,7 +2693,7 @@ columns on its right towards the left. ;;;*** ;;;### (autoloads (bug-reference-prog-mode bug-reference-mode) "bug-reference" -;;;;;; "progmodes/bug-reference.el" (20490 33188 850375 0)) +;;;;;; "progmodes/bug-reference.el" (20532 45476 981297 0)) ;;; Generated autoloads from progmodes/bug-reference.el (put 'bug-reference-url-format 'safe-local-variable (lambda (s) (or (stringp s) (and (symbolp s) (get s 'bug-reference-url-format))))) @@ -2717,7 +2717,7 @@ Like `bug-reference-mode', but only buttonize in comments and strings. ;;;;;; batch-byte-compile-if-not-done display-call-tree byte-compile ;;;;;; compile-defun byte-compile-file byte-recompile-directory ;;;;;; byte-force-recompile byte-compile-enable-warning byte-compile-disable-warning) -;;;;;; "bytecomp" "emacs-lisp/bytecomp.el" (20497 6436 957082 0)) +;;;;;; "bytecomp" "emacs-lisp/bytecomp.el" (20522 38631 876994 556000)) ;;; Generated autoloads from emacs-lisp/bytecomp.el (put 'byte-compile-dynamic 'safe-local-variable 'booleanp) (put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp) @@ -4129,8 +4129,8 @@ For example, the function `case' has an indent property ;;;*** -;;;### (autoloads nil "cl-lib" "emacs-lisp/cl-lib.el" (20478 3673 -;;;;;; 653810 0)) +;;;### (autoloads nil "cl-lib" "emacs-lisp/cl-lib.el" (20541 60450 +;;;;;; 834170 0)) ;;; Generated autoloads from emacs-lisp/cl-lib.el (define-obsolete-variable-alias 'custom-print-functions 'cl-custom-print-functions "24.3") @@ -4199,8 +4199,8 @@ is run). ;;;*** -;;;### (autoloads (color-name-to-rgb) "color" "color.el" (20355 10021 -;;;;;; 546955 0)) +;;;### (autoloads (color-name-to-rgb) "color" "color.el" (20522 9637 +;;;;;; 465791 0)) ;;; Generated autoloads from color.el (autoload 'color-name-to-rgb "color" "\ @@ -4222,7 +4222,7 @@ If FRAME cannot display COLOR, return nil. ;;;### (autoloads (comint-redirect-results-list-from-process comint-redirect-results-list ;;;;;; comint-redirect-send-command-to-process comint-redirect-send-command ;;;;;; comint-run make-comint make-comint-in-buffer) "comint" "comint.el" -;;;;;; (20476 31768 298871 0)) +;;;;;; (20523 62082 997685 0)) ;;; Generated autoloads from comint.el (defvar comint-output-filter-functions '(ansi-color-process-output comint-postoutput-scroll-to-bottom comint-watch-for-password-prompt) "\ @@ -4359,8 +4359,8 @@ on third call it again advances points to the next difference and so on. ;;;;;; compilation-shell-minor-mode compilation-mode compilation-start ;;;;;; compile compilation-disable-input compile-command compilation-search-path ;;;;;; compilation-ask-about-save compilation-window-height compilation-start-hook -;;;;;; compilation-mode-hook) "compile" "progmodes/compile.el" (20478 -;;;;;; 3673 653810 0)) +;;;;;; compilation-mode-hook) "compile" "progmodes/compile.el" (20543 +;;;;;; 15782 195452 0)) ;;; Generated autoloads from progmodes/compile.el (defvar compilation-mode-hook nil "\ @@ -4723,7 +4723,7 @@ For details see `conf-mode'. Example: ;;;*** ;;;### (autoloads (shuffle-vector cookie-snarf cookie-insert cookie) -;;;;;; "cookie1" "play/cookie1.el" (20364 27900 192709 741000)) +;;;;;; "cookie1" "play/cookie1.el" (20545 57511 257469 0)) ;;; Generated autoloads from play/cookie1.el (autoload 'cookie "cookie1" "\ @@ -4755,8 +4755,8 @@ Randomly permute the elements of VECTOR (all permutations equally likely). ;;;*** ;;;### (autoloads (copyright-update-directory copyright copyright-fix-years -;;;;;; copyright-update) "copyright" "emacs-lisp/copyright.el" (20387 -;;;;;; 44199 24128 0)) +;;;;;; copyright-update) "copyright" "emacs-lisp/copyright.el" (20518 +;;;;;; 12580 46478 0)) ;;; Generated autoloads from emacs-lisp/copyright.el (put 'copyright-at-end-flag 'safe-local-variable 'booleanp) (put 'copyright-names-regexp 'safe-local-variable 'stringp) @@ -4795,7 +4795,7 @@ If FIX is non-nil, run `copyright-fix-years' instead. ;;;*** ;;;### (autoloads (cperl-perldoc-at-point cperl-perldoc cperl-mode) -;;;;;; "cperl-mode" "progmodes/cperl-mode.el" (20490 33188 850375 +;;;;;; "cperl-mode" "progmodes/cperl-mode.el" (20512 60198 306109 ;;;;;; 0)) ;;; Generated autoloads from progmodes/cperl-mode.el (put 'cperl-indent-level 'safe-local-variable 'integerp) @@ -5014,7 +5014,7 @@ Edit display information for cpp conditionals. ;;;*** ;;;### (autoloads (crisp-mode crisp-mode) "crisp" "emulation/crisp.el" -;;;;;; (20476 31768 298871 0)) +;;;;;; (20523 62082 997685 0)) ;;; Generated autoloads from emulation/crisp.el (defvar crisp-mode nil "\ @@ -5147,7 +5147,7 @@ Enable CUA selection mode without the C-z/C-x/C-c/C-v bindings. ;;;;;; customize-mode customize customize-push-and-save customize-save-variable ;;;;;; customize-set-variable customize-set-value custom-menu-sort-alphabetically ;;;;;; custom-buffer-sort-alphabetically custom-browse-sort-alphabetically) -;;;;;; "cus-edit" "cus-edit.el" (20437 50597 545250 0)) +;;;;;; "cus-edit" "cus-edit.el" (20523 62082 997685 0)) ;;; Generated autoloads from cus-edit.el (defvar custom-browse-sort-alphabetically nil "\ @@ -5642,8 +5642,8 @@ Create a new data-debug buffer with NAME. ;;;*** -;;;### (autoloads (dbus-handle-event) "dbus" "net/dbus.el" (20476 -;;;;;; 31768 298871 0)) +;;;### (autoloads (dbus-handle-event) "dbus" "net/dbus.el" (20523 +;;;;;; 62082 997685 0)) ;;; Generated autoloads from net/dbus.el (autoload 'dbus-handle-event "dbus" "\ @@ -5934,8 +5934,8 @@ with no args, if that value is non-nil. ;;;*** -;;;### (autoloads (delete-selection-mode) "delsel" "delsel.el" (20355 -;;;;;; 10021 546955 0)) +;;;### (autoloads (delete-selection-mode) "delsel" "delsel.el" (20515 +;;;;;; 36389 544939 0)) ;;; Generated autoloads from delsel.el (defalias 'pending-delete-mode 'delete-selection-mode) @@ -6032,7 +6032,7 @@ the first time the mode is used. ;;;*** ;;;### (autoloads (describe-char describe-text-properties) "descr-text" -;;;;;; "descr-text.el" (20486 36135 22104 0)) +;;;;;; "descr-text.el" (20530 32114 546307 0)) ;;; Generated autoloads from descr-text.el (autoload 'describe-text-properties "descr-text" "\ @@ -6289,7 +6289,7 @@ Deuglify broken Outlook (Express) articles and redisplay. ;;;*** ;;;### (autoloads (diary-mode diary-mail-entries diary) "diary-lib" -;;;;;; "calendar/diary-lib.el" (20355 10021 546955 0)) +;;;;;; "calendar/diary-lib.el" (20530 32124 97707 678000)) ;;; Generated autoloads from calendar/diary-lib.el (autoload 'diary "diary-lib" "\ @@ -6376,7 +6376,7 @@ This requires the external program `diff' to be in your `exec-path'. ;;;*** ;;;### (autoloads (diff-minor-mode diff-mode) "diff-mode" "vc/diff-mode.el" -;;;;;; (20476 31768 298871 0)) +;;;;;; (20523 62082 997685 0)) ;;; Generated autoloads from vc/diff-mode.el (autoload 'diff-mode "diff-mode" "\ @@ -6420,8 +6420,8 @@ Optional arguments are passed to `dig-invoke'. ;;;*** ;;;### (autoloads (dired-mode dired-noselect dired-other-frame dired-other-window -;;;;;; dired dired-listing-switches) "dired" "dired.el" (20486 36135 -;;;;;; 22104 0)) +;;;;;; dired dired-listing-switches) "dired" "dired.el" (20539 18737 +;;;;;; 159373 0)) ;;; Generated autoloads from dired.el (defvar dired-listing-switches (purecopy "-al") "\ @@ -6715,7 +6715,7 @@ in `.emacs'. ;;;*** ;;;### (autoloads (dissociated-press) "dissociate" "play/dissociate.el" -;;;;;; (20355 10021 546955 0)) +;;;;;; (20545 57511 257469 0)) ;;; Generated autoloads from play/dissociate.el (autoload 'dissociated-press "dissociate" "\ @@ -6824,8 +6824,8 @@ See the command `doc-view-mode' for more information on this mode. ;;;*** -;;;### (autoloads (doctor) "doctor" "play/doctor.el" (20443 2992 -;;;;;; 177196 0)) +;;;### (autoloads (doctor) "doctor" "play/doctor.el" (20545 57511 +;;;;;; 257469 0)) ;;; Generated autoloads from play/doctor.el (autoload 'doctor "doctor" "\ @@ -6852,8 +6852,8 @@ strings when pressed twice. See `double-map' for details. ;;;*** -;;;### (autoloads (dunnet) "dunnet" "play/dunnet.el" (20355 10021 -;;;;;; 546955 0)) +;;;### (autoloads (dunnet) "dunnet" "play/dunnet.el" (20545 57511 +;;;;;; 257469 0)) ;;; Generated autoloads from play/dunnet.el (autoload 'dunnet "dunnet" "\ @@ -7574,7 +7574,7 @@ Display statistics for a class tree. ;;;*** ;;;### (autoloads (electric-buffer-list) "ebuff-menu" "ebuff-menu.el" -;;;;;; (20436 29731 313079 0)) +;;;;;; (20523 62082 997685 0)) ;;; Generated autoloads from ebuff-menu.el (autoload 'electric-buffer-list "ebuff-menu" "\ @@ -7657,7 +7657,7 @@ an EDE controlled project. ;;;### (autoloads (edebug-all-forms edebug-all-defs edebug-eval-top-level-form ;;;;;; edebug-basic-spec edebug-all-forms edebug-all-defs) "edebug" -;;;;;; "emacs-lisp/edebug.el" (20497 6436 957082 0)) +;;;;;; "emacs-lisp/edebug.el" (20523 62082 997685 0)) ;;; Generated autoloads from emacs-lisp/edebug.el (defvar edebug-all-defs nil "\ @@ -8319,7 +8319,7 @@ displayed. ;;;*** ;;;### (autoloads (emacs-lock-mode) "emacs-lock" "emacs-lock.el" -;;;;;; (20399 35365 4050 0)) +;;;;;; (20523 62082 997685 0)) ;;; Generated autoloads from emacs-lock.el (autoload 'emacs-lock-mode "emacs-lock" "\ @@ -8347,7 +8347,7 @@ Other values are interpreted as usual. ;;;*** ;;;### (autoloads (report-emacs-bug-query-existing-bugs report-emacs-bug) -;;;;;; "emacsbug" "mail/emacsbug.el" (20495 51111 757560 0)) +;;;;;; "emacsbug" "mail/emacsbug.el" (20523 62082 997685 0)) ;;; Generated autoloads from mail/emacsbug.el (autoload 'report-emacs-bug "emacsbug" "\ @@ -8800,7 +8800,7 @@ Look at CONFIG and try to expand GROUP. ;;;*** ;;;### (autoloads (erc-handle-irc-url erc-tls erc erc-select-read-args) -;;;;;; "erc" "erc/erc.el" (20444 23842 968143 0)) +;;;;;; "erc" "erc/erc.el" (20530 32114 546307 0)) ;;; Generated autoloads from erc/erc.el (autoload 'erc-select-read-args "erc" "\ @@ -8877,7 +8877,7 @@ Otherwise, connect to HOST:PORT as USER and /join CHANNEL. ;;;*** ;;;### (autoloads (erc-ctcp-query-DCC pcomplete/erc-mode/DCC erc-cmd-DCC) -;;;;;; "erc-dcc" "erc/erc-dcc.el" (20439 5925 915283 0)) +;;;;;; "erc-dcc" "erc/erc-dcc.el" (20523 62082 997685 0)) ;;; Generated autoloads from erc/erc-dcc.el (autoload 'erc-dcc-mode "erc-dcc") @@ -9018,7 +9018,7 @@ system. ;;;*** -;;;### (autoloads nil "erc-join" "erc/erc-join.el" (20356 2211 532900 +;;;### (autoloads nil "erc-join" "erc/erc-join.el" (20532 45476 981297 ;;;;;; 0)) ;;; Generated autoloads from erc/erc-join.el (autoload 'erc-autojoin-mode "erc-join" nil t) @@ -9065,7 +9065,7 @@ You can save every individual message by putting this function on ;;;### (autoloads (erc-delete-dangerous-host erc-add-dangerous-host ;;;;;; erc-delete-keyword erc-add-keyword erc-delete-fool erc-add-fool ;;;;;; erc-delete-pal erc-add-pal) "erc-match" "erc/erc-match.el" -;;;;;; (20434 17809 692608 0)) +;;;;;; (20531 24613 995935 0)) ;;; Generated autoloads from erc/erc-match.el (autoload 'erc-match-mode "erc-match") @@ -9393,8 +9393,8 @@ Kill all test buffers that are still live. ;;;*** -;;;### (autoloads (eshell-mode) "esh-mode" "eshell/esh-mode.el" (20427 -;;;;;; 14766 970343 0)) +;;;### (autoloads (eshell-mode) "esh-mode" "eshell/esh-mode.el" (20523 +;;;;;; 62082 997685 0)) ;;; Generated autoloads from eshell/esh-mode.el (autoload 'eshell-mode "esh-mode" "\ @@ -9407,7 +9407,7 @@ Emacs shell interactive mode. ;;;*** ;;;### (autoloads (eshell-command-result eshell-command eshell) "eshell" -;;;;;; "eshell/eshell.el" (20478 3673 653810 0)) +;;;;;; "eshell/eshell.el" (20523 62082 997685 0)) ;;; Generated autoloads from eshell/eshell.el (autoload 'eshell "eshell" "\ @@ -10085,7 +10085,7 @@ fourth arg NOSEP non-nil inhibits this. ;;;### (autoloads (executable-make-buffer-file-executable-if-script-p ;;;;;; executable-self-display executable-set-magic executable-interpret ;;;;;; executable-command-find-posix-p) "executable" "progmodes/executable.el" -;;;;;; (20355 10021 546955 0)) +;;;;;; (20533 6181 437016 717000)) ;;; Generated autoloads from progmodes/executable.el (autoload 'executable-command-find-posix-p "executable" "\ @@ -10464,7 +10464,7 @@ you can set `feedmail-queue-reminder-alist' to nil. ;;;### (autoloads (ffap-bindings ffap-guess-file-name-at-point dired-at-point ;;;;;; ffap-at-mouse ffap-menu find-file-at-point ffap-next) "ffap" -;;;;;; "ffap.el" (20479 62884 77836 0)) +;;;;;; "ffap.el" (20542 46798 773957 0)) ;;; Generated autoloads from ffap.el (autoload 'ffap-next "ffap" "\ @@ -11422,7 +11422,7 @@ and choose the directory as the fortune-file. ;;;*** ;;;### (autoloads (gdb gdb-enable-debug) "gdb-mi" "progmodes/gdb-mi.el" -;;;;;; (20501 3499 284800 0)) +;;;;;; (20537 63402 936234 0)) ;;; Generated autoloads from progmodes/gdb-mi.el (defvar gdb-enable-debug nil "\ @@ -11705,7 +11705,7 @@ prompt the user for the name of an NNTP server to use. ;;;;;; gnus-agent-get-undownloaded-list gnus-agent-delete-group ;;;;;; gnus-agent-rename-group gnus-agent-possibly-save-gcc gnus-agentize ;;;;;; gnus-slave-unplugged gnus-plugged gnus-unplugged) "gnus-agent" -;;;;;; "gnus/gnus-agent.el" (20458 56750 651721 0)) +;;;;;; "gnus/gnus-agent.el" (20518 12580 46478 0)) ;;; Generated autoloads from gnus/gnus-agent.el (autoload 'gnus-unplugged "gnus-agent" "\ @@ -11796,7 +11796,7 @@ If CLEAN, obsolete (ignore). ;;;*** ;;;### (autoloads (gnus-article-prepare-display) "gnus-art" "gnus/gnus-art.el" -;;;;;; (20497 6436 957082 0)) +;;;;;; (20522 9637 465791 0)) ;;; Generated autoloads from gnus/gnus-art.el (autoload 'gnus-article-prepare-display "gnus-art" "\ @@ -12191,7 +12191,7 @@ Calling (gnus-group-split-fancy nil nil \"mail.others\") returns: ;;;*** ;;;### (autoloads (gnus-button-reply gnus-button-mailto gnus-msg-mail) -;;;;;; "gnus-msg" "gnus/gnus-msg.el" (20495 51111 757560 0)) +;;;;;; "gnus-msg" "gnus/gnus-msg.el" (20533 5993 500881 0)) ;;; Generated autoloads from gnus/gnus-msg.el (autoload 'gnus-msg-mail "gnus-msg" "\ @@ -12215,11 +12215,28 @@ Like `message-reply'. (define-mail-user-agent 'gnus-user-agent 'gnus-msg-mail 'message-send-and-exit 'message-kill-buffer 'message-send-hook) +;;;*** + +;;;### (autoloads (gnus-notifications) "gnus-notifications" "gnus/gnus-notifications.el" +;;;;;; (20544 36659 880486 0)) +;;; Generated autoloads from gnus/gnus-notifications.el + +(autoload 'gnus-notifications "gnus-notifications" "\ +Send a notification on new message. +This check for new messages that are in group with a level lower +or equal to `gnus-notifications-minimum-level' and send a +notification using `notifications-notify' for it. + +This is typically a function to add in +`gnus-after-getting-new-news-hook' + +\(fn)" nil nil) + ;;;*** ;;;### (autoloads (gnus-treat-newsgroups-picon gnus-treat-mail-picon ;;;;;; gnus-treat-from-picon) "gnus-picon" "gnus/gnus-picon.el" -;;;;;; (20458 56750 651721 0)) +;;;;;; (20523 62082 997685 0)) ;;; Generated autoloads from gnus/gnus-picon.el (autoload 'gnus-treat-from-picon "gnus-picon" "\ @@ -12246,7 +12263,7 @@ If picons are already displayed, remove them. ;;;;;; gnus-sorted-nintersection gnus-sorted-range-intersection ;;;;;; gnus-sorted-intersection gnus-intersection gnus-sorted-complement ;;;;;; gnus-sorted-ndifference gnus-sorted-difference) "gnus-range" -;;;;;; "gnus/gnus-range.el" (20495 51111 757560 0)) +;;;;;; "gnus/gnus-range.el" (20544 36659 880486 0)) ;;; Generated autoloads from gnus/gnus-range.el (autoload 'gnus-sorted-difference "gnus-range" "\ @@ -12314,7 +12331,7 @@ Add NUM into sorted LIST by side effect. ;;;*** ;;;### (autoloads (gnus-registry-install-hooks gnus-registry-initialize) -;;;;;; "gnus-registry" "gnus/gnus-registry.el" (20458 56750 651721 +;;;;;; "gnus-registry" "gnus/gnus-registry.el" (20544 36659 880486 ;;;;;; 0)) ;;; Generated autoloads from gnus/gnus-registry.el @@ -12382,7 +12399,7 @@ Declare back end NAME with ABILITIES as a Gnus back end. ;;;*** ;;;### (autoloads (gnus-summary-bookmark-jump) "gnus-sum" "gnus/gnus-sum.el" -;;;;;; (20495 51111 757560 0)) +;;;;;; (20540 39589 424586 0)) ;;; Generated autoloads from gnus/gnus-sum.el (autoload 'gnus-summary-bookmark-jump "gnus-sum" "\ @@ -12394,7 +12411,7 @@ BOOKMARK is a bookmark name or a bookmark record. ;;;*** ;;;### (autoloads (gnus-sync-install-hooks gnus-sync-initialize) -;;;;;; "gnus-sync" "gnus/gnus-sync.el" (20465 29989 57840 0)) +;;;;;; "gnus-sync" "gnus/gnus-sync.el" (20545 57511 257469 0)) ;;; Generated autoloads from gnus/gnus-sync.el (autoload 'gnus-sync-initialize "gnus-sync" "\ @@ -12437,8 +12454,8 @@ A value of nil says to use the default GnuTLS value.") ;;;*** -;;;### (autoloads (gomoku) "gomoku" "play/gomoku.el" (20355 10021 -;;;;;; 546955 0)) +;;;### (autoloads (gomoku) "gomoku" "play/gomoku.el" (20545 57511 +;;;;;; 257469 0)) ;;; Generated autoloads from play/gomoku.el (autoload 'gomoku "gomoku" "\ @@ -12705,8 +12722,8 @@ the form \"WINDOW-ID PIXMAP-ID\". Value is non-nil if successful. ;;;*** ;;;### (autoloads (gud-tooltip-mode gdb-script-mode jdb pdb perldb -;;;;;; xdb dbx sdb gud-gdb) "gud" "progmodes/gud.el" (20478 3673 -;;;;;; 653810 0)) +;;;;;; xdb dbx sdb gud-gdb) "gud" "progmodes/gud.el" (20537 63402 +;;;;;; 936234 0)) ;;; Generated autoloads from progmodes/gud.el (autoload 'gud-gdb "gud" "\ @@ -12796,7 +12813,7 @@ it if ARG is omitted or nil. ;;;### (autoloads (setf gv-define-simple-setter gv-define-setter ;;;;;; gv--defun-declaration gv-define-expander gv-letplace gv-get) -;;;;;; "gv" "emacs-lisp/gv.el" (20497 6436 957082 0)) +;;;;;; "gv" "emacs-lisp/gv.el" (20542 46798 773957 0)) ;;; Generated autoloads from emacs-lisp/gv.el (autoload 'gv-get "gv" "\ @@ -12852,8 +12869,9 @@ well for simple place forms. Assignments of VAL to (NAME ARGS...) are expanded by binding the argument forms (VAL ARGS...) according to ARGLIST, then executing BODY, which must return a Lisp form that does the assignment. -Actually, ARGLIST may be bound to temporary variables which are introduced -automatically to preserve proper execution order of the arguments. Example: +The first arg in ARLIST (the one that receives VAL) receives an expression +which can do arbitrary things, whereas the other arguments are all guaranteed +to be pure and copyable. Example use: (gv-define-setter aref (v a i) `(aset ,a ,i ,v)) \(fn NAME ARGLIST &rest BODY)" nil t) @@ -13108,7 +13126,7 @@ different regions. With numeric argument ARG, behaves like ;;;### (autoloads (doc-file-to-info doc-file-to-man describe-categories ;;;;;; describe-syntax describe-variable variable-at-point describe-function-1 ;;;;;; find-lisp-object-file-name help-C-file-name describe-function) -;;;;;; "help-fns" "help-fns.el" (20497 6436 957082 0)) +;;;;;; "help-fns" "help-fns.el" (20532 45476 981297 0)) ;;; Generated autoloads from help-fns.el (autoload 'describe-function "help-fns" "\ @@ -13205,7 +13223,7 @@ gives the window that lists the options.") ;;;### (autoloads (help-bookmark-jump help-xref-on-pp help-insert-xref-button ;;;;;; help-xref-button help-make-xrefs help-buffer help-setup-xref ;;;;;; help-mode-finish help-mode-setup help-mode) "help-mode" "help-mode.el" -;;;;;; (20479 62884 77836 0)) +;;;;;; (20510 18478 782378 0)) ;;; Generated autoloads from help-mode.el (autoload 'help-mode "help-mode" "\ @@ -13321,7 +13339,7 @@ Provide help for current mode. ;;;*** ;;;### (autoloads (hexlify-buffer hexl-find-file hexl-mode) "hexl" -;;;;;; "hexl.el" (20478 3673 653810 0)) +;;;;;; "hexl.el" (20523 62082 997685 0)) ;;; Generated autoloads from hexl.el (autoload 'hexl-mode "hexl" "\ @@ -13418,7 +13436,7 @@ This discards the buffer's undo information. ;;;### (autoloads (hi-lock-write-interactive-patterns hi-lock-unface-buffer ;;;;;; hi-lock-face-phrase-buffer hi-lock-face-buffer hi-lock-line-face-buffer ;;;;;; global-hi-lock-mode hi-lock-mode) "hi-lock" "hi-lock.el" -;;;;;; (20410 5673 834266 0)) +;;;;;; (20522 9637 465791 0)) ;;; Generated autoloads from hi-lock.el (autoload 'hi-lock-mode "hi-lock" "\ @@ -13427,12 +13445,19 @@ With a prefix argument ARG, enable Hi Lock mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. -Issuing one the highlighting commands listed below will -automatically enable Hi Lock mode. To enable Hi Lock mode in all -buffers, use `global-hi-lock-mode' or add (global-hi-lock-mode 1) -to your init file. When Hi Lock mode is enabled, a \"Regexp -Highlighting\" submenu is added to the \"Edit\" menu. The -commands in the submenu, which can be called interactively, are: +Hi Lock mode is automatically enabled when you invoke any of the +highlighting commands listed below, such as \\[highlight-regexp]. +To enable Hi Lock mode in all buffers, use `global-hi-lock-mode' +or add (global-hi-lock-mode 1) to your init file. + +In buffers where Font Lock mode is enabled, patterns are +highlighted using font lock. In buffers where Font Lock mode is +disabled, patterns are applied using overlays; in this case, the +highlighting will not be updated as you type. + +When Hi Lock mode is enabled, a \"Regexp Highlighting\" submenu +is added to the \"Edit\" menu. The commands in the submenu, +which can be called interactively, are: \\[highlight-regexp] REGEXP FACE Highlight matches of pattern REGEXP in current buffer with FACE. @@ -13466,12 +13491,12 @@ When hi-lock is started and if the mode is not excluded or patterns rejected, the beginning of the buffer is searched for lines of the form: Hi-lock: FOO -where FOO is a list of patterns. These are added to the font lock -keywords already present. The patterns must start before position -\(number of characters into buffer) `hi-lock-file-patterns-range'. -Patterns will be read until - Hi-lock: end -is found. A mode is excluded if it's in the list `hi-lock-exclude-modes'. + +where FOO is a list of patterns. The patterns must start before +position (number of characters into buffer) +`hi-lock-file-patterns-range'. Patterns will be read until +Hi-lock: end is found. A mode is excluded if it's in the list +`hi-lock-exclude-modes'. \(fn &optional ARG)" t nil) @@ -13500,12 +13525,13 @@ See `hi-lock-mode' for more information on Hi-Lock mode. (autoload 'hi-lock-line-face-buffer "hi-lock" "\ Set face of all lines containing a match of REGEXP to FACE. +Interactively, prompt for REGEXP then FACE, using a buffer-local +history list for REGEXP and a global history list for FACE. -Interactively, prompt for REGEXP then FACE. Buffer-local history -list maintained for regexps, global history maintained for faces. -\\Use \\[previous-history-element] to retrieve previous history items, -and \\[next-history-element] to retrieve default values. -\(See info node `Minibuffer History'.) +If Font Lock mode is enabled in the buffer, it is used to +highlight REGEXP. If Font Lock mode is disabled, overlays are +used for highlighting; in this case, the highlighting will not be +updated as you type. \(fn REGEXP &optional FACE)" t nil) @@ -13513,12 +13539,13 @@ and \\[next-history-element] to retrieve default values. (autoload 'hi-lock-face-buffer "hi-lock" "\ Set face of each match of REGEXP to FACE. +Interactively, prompt for REGEXP then FACE, using a buffer-local +history list for REGEXP and a global history list for FACE. -Interactively, prompt for REGEXP then FACE. Buffer-local history -list maintained for regexps, global history maintained for faces. -\\Use \\[previous-history-element] to retrieve previous history items, -and \\[next-history-element] to retrieve default values. -\(See info node `Minibuffer History'.) +If Font Lock mode is enabled in the buffer, it is used to +highlight REGEXP. If Font Lock mode is disabled, overlays are +used for highlighting; in this case, the highlighting will not be +updated as you type. \(fn REGEXP &optional FACE)" t nil) @@ -13526,22 +13553,22 @@ and \\[next-history-element] to retrieve default values. (autoload 'hi-lock-face-phrase-buffer "hi-lock" "\ Set face of each match of phrase REGEXP to FACE. - Whitespace in REGEXP converted to arbitrary whitespace and initial lower-case letters made case insensitive. +If Font Lock mode is enabled in the buffer, it is used to +highlight REGEXP. If Font Lock mode is disabled, overlays are +used for highlighting; in this case, the highlighting will not be +updated as you type. + \(fn REGEXP &optional FACE)" t nil) (defalias 'unhighlight-regexp 'hi-lock-unface-buffer) (autoload 'hi-lock-unface-buffer "hi-lock" "\ Remove highlighting of each match to REGEXP set by hi-lock. - -Interactively, prompt for REGEXP. Buffer-local history of inserted -regexp's maintained. Will accept only regexps inserted by hi-lock -interactive functions. (See `hi-lock-interactive-patterns'.) -\\Use \\[minibuffer-complete] to complete a partially typed regexp. -\(See info node `Minibuffer History'.) +Interactively, prompt for REGEXP, accepting only regexps +previously inserted by hi-lock interactive functions. \(fn REGEXP)" t nil) @@ -13557,7 +13584,7 @@ be found in variable `hi-lock-interactive-patterns'. ;;;*** ;;;### (autoloads (hide-ifdef-mode) "hideif" "progmodes/hideif.el" -;;;;;; (20355 10021 546955 0)) +;;;;;; (20541 6907 775259 0)) ;;; Generated autoloads from progmodes/hideif.el (autoload 'hide-ifdef-mode "hideif" "\ @@ -13601,7 +13628,7 @@ Several variables affect how the hiding is done: ;;;*** ;;;### (autoloads (turn-off-hideshow hs-minor-mode) "hideshow" "progmodes/hideshow.el" -;;;;;; (20356 55829 180242 0)) +;;;;;; (20541 6907 775259 0)) ;;; Generated autoloads from progmodes/hideshow.el (defvar hs-special-modes-alist (mapcar 'purecopy '((c-mode "{" "}" "/[*/]" nil nil) (c++-mode "{" "}" "/[*/]" nil nil) (bibtex-mode ("@\\S(*\\(\\s(\\)" 1)) (java-mode "{" "}" "/[*/]" nil nil) (js-mode "{" "}" "/[*/]" nil))) "\ @@ -13929,7 +13956,7 @@ Global-Hl-Line mode uses the functions `global-hl-line-unhighlight' and ;;;;;; holiday-bahai-holidays holiday-islamic-holidays holiday-christian-holidays ;;;;;; holiday-hebrew-holidays holiday-other-holidays holiday-local-holidays ;;;;;; holiday-oriental-holidays holiday-general-holidays) "holidays" -;;;;;; "calendar/holidays.el" (20390 20388 254308 0)) +;;;;;; "calendar/holidays.el" (20530 32124 107724 973000)) ;;; Generated autoloads from calendar/holidays.el (define-obsolete-variable-alias 'general-holidays 'holiday-general-holidays "23.1") @@ -14212,7 +14239,7 @@ bound to the current value of the filter. ;;;*** ;;;### (autoloads (ibuffer ibuffer-other-window ibuffer-list-buffers) -;;;;;; "ibuffer" "ibuffer.el" (20479 62884 77836 0)) +;;;;;; "ibuffer" "ibuffer.el" (20542 46798 773957 0)) ;;; Generated autoloads from ibuffer.el (autoload 'ibuffer-list-buffers "ibuffer" "\ @@ -14823,7 +14850,7 @@ the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'. ;;;;;; create-image image-type-auto-detected-p image-type-available-p ;;;;;; image-type image-type-from-file-name image-type-from-file-header ;;;;;; image-type-from-buffer image-type-from-data) "image" "image.el" -;;;;;; (20437 50597 545250 0)) +;;;;;; (20523 62082 997685 0)) ;;; Generated autoloads from image.el (autoload 'image-type-from-data "image" "\ @@ -15270,7 +15297,7 @@ on these modes. ;;;*** ;;;### (autoloads (imenu imenu-add-menubar-index imenu-add-to-menubar -;;;;;; imenu-sort-function) "imenu" "imenu.el" (20476 31768 298871 +;;;;;; imenu-sort-function) "imenu" "imenu.el" (20511 39332 974340 ;;;;;; 0)) ;;; Generated autoloads from imenu.el @@ -15292,16 +15319,39 @@ element should come before the second. The arguments are cons cells; (custom-autoload 'imenu-sort-function "imenu" t) (defvar imenu-generic-expression nil "\ -The regex pattern to use for creating a buffer index. +List of definition matchers for creating an Imenu index. +Each element of this list should have the form + + (MENU-TITLE REGEXP INDEX [FUNCTION] [ARGUMENTS...]) + +MENU-TITLE should be nil (in which case the matches for this +element are put in the top level of the buffer index) or a +string (which specifies the title of a submenu into which the +matches are put). +REGEXP is a regular expression matching a definition construct +which is to be displayed in the menu. REGEXP may also be a +function, called without arguments. It is expected to search +backwards. It must return true and set `match-data' if it finds +another element. +INDEX is an integer specifying which subexpression of REGEXP +matches the definition's name; this subexpression is displayed as +the menu item. +FUNCTION, if present, specifies a function to call when the index +item is selected by the user. This function is called with +arguments consisting of the item name, the buffer position, and +the ARGUMENTS. + +The variable `imenu-case-fold-search' determines whether or not +the regexp matches are case sensitive, and `imenu-syntax-alist' +can be used to alter the syntax table for the search. If non-nil this pattern is passed to `imenu--generic-function' to -create a buffer index. Look there for the documentation of this -pattern's structure. +create a buffer index. -For example, see the value of `fortran-imenu-generic-expression' used by -`fortran-mode' with `imenu-syntax-alist' set locally to give the -characters which normally have \"symbol\" syntax \"word\" syntax -during matching.") +For example, see the value of `fortran-imenu-generic-expression' +used by `fortran-mode' with `imenu-syntax-alist' set locally to +give the characters which normally have \"symbol\" syntax +\"word\" syntax during matching.") (put 'imenu-generic-expression 'risky-local-variable t) (make-variable-buffer-local 'imenu-generic-expression) @@ -15487,7 +15537,7 @@ of `inferior-lisp-program'). Runs the hooks from ;;;;;; Info-goto-emacs-key-command-node Info-goto-emacs-command-node ;;;;;; Info-mode info-finder info-apropos Info-index Info-directory ;;;;;; Info-on-current-buffer info-standalone info-emacs-bug info-emacs-manual -;;;;;; info info-other-window) "info" "info.el" (20476 31768 298871 +;;;;;; info info-other-window) "info" "info.el" (20540 39589 424586 ;;;;;; 0)) ;;; Generated autoloads from info.el @@ -16375,7 +16425,7 @@ by `jka-compr-installed'. ;;;*** -;;;### (autoloads (js-mode) "js" "progmodes/js.el" (20478 3673 653810 +;;;### (autoloads (js-mode) "js" "progmodes/js.el" (20532 45476 981297 ;;;;;; 0)) ;;; Generated autoloads from progmodes/js.el @@ -16619,7 +16669,7 @@ The kind of Korean keyboard for Korean input method. ;;;*** ;;;### (autoloads (landmark landmark-test-run) "landmark" "play/landmark.el" -;;;;;; (20478 3673 653810 0)) +;;;;;; (20545 57511 257469 0)) ;;; Generated autoloads from play/landmark.el (defalias 'landmark-repeat 'landmark-test-run) @@ -16776,7 +16826,7 @@ A major mode to edit GNU ld script files ;;;*** -;;;### (autoloads (life) "life" "play/life.el" (20355 10021 546955 +;;;### (autoloads (life) "life" "play/life.el" (20545 57511 257469 ;;;;;; 0)) ;;; Generated autoloads from play/life.el @@ -16953,8 +17003,8 @@ done. Otherwise, it uses the current buffer. ;;;*** -;;;### (autoloads (log-view-mode) "log-view" "vc/log-view.el" (20477 -;;;;;; 21160 227853 0)) +;;;### (autoloads (log-view-mode) "log-view" "vc/log-view.el" (20515 +;;;;;; 36389 544939 0)) ;;; Generated autoloads from vc/log-view.el (autoload 'log-view-mode "log-view" "\ @@ -17618,7 +17668,7 @@ Previous contents of that buffer are killed first. ;;;*** ;;;### (autoloads (Man-bookmark-jump man-follow man) "man" "man.el" -;;;;;; (20504 6781 423358 0)) +;;;;;; (20523 62082 997685 0)) ;;; Generated autoloads from man.el (defalias 'manual-entry 'man) @@ -17729,7 +17779,7 @@ recursion depth in the minibuffer prompt. This is only useful if ;;;;;; message-forward-make-body message-forward message-recover ;;;;;; message-supersede message-cancel-news message-followup message-wide-reply ;;;;;; message-reply message-news message-mail message-mode) "message" -;;;;;; "gnus/message.el" (20501 3499 284800 0)) +;;;;;; "gnus/message.el" (20545 57511 257469 0)) ;;; Generated autoloads from gnus/message.el (define-mail-user-agent 'message-user-agent 'message-mail 'message-send-and-exit 'message-kill-buffer 'message-send-hook) @@ -18204,7 +18254,7 @@ is modified to remove the default indication. ;;;*** ;;;### (autoloads (list-dynamic-libraries butterfly) "misc" "misc.el" -;;;;;; (20356 27828 24951 0)) +;;;;;; (20533 5993 500881 0)) ;;; Generated autoloads from misc.el (autoload 'butterfly "misc" "\ @@ -18606,7 +18656,7 @@ To test this function, evaluate: ;;;*** -;;;### (autoloads (mpc) "mpc" "mpc.el" (20476 31768 298871 0)) +;;;### (autoloads (mpc) "mpc" "mpc.el" (20523 62082 997685 0)) ;;; Generated autoloads from mpc.el (autoload 'mpc "mpc" "\ @@ -18616,7 +18666,7 @@ Main entry point for MPC. ;;;*** -;;;### (autoloads (mpuz) "mpuz" "play/mpuz.el" (20434 17809 692608 +;;;### (autoloads (mpuz) "mpuz" "play/mpuz.el" (20545 57511 257469 ;;;;;; 0)) ;;; Generated autoloads from play/mpuz.el @@ -19309,7 +19359,7 @@ closing requests for requests that are used in matched pairs. ;;;*** ;;;### (autoloads (nxml-glyph-display-string) "nxml-glyph" "nxml/nxml-glyph.el" -;;;;;; (20439 5925 915283 0)) +;;;;;; (20523 62082 997685 0)) ;;; Generated autoloads from nxml/nxml-glyph.el (autoload 'nxml-glyph-display-string "nxml-glyph" "\ @@ -20901,7 +20951,7 @@ The file is stored under the name `org-combined-agenda-icalendar-file'. ;;;### (autoloads (org-id-store-link org-id-find-id-file org-id-find ;;;;;; org-id-goto org-id-get-with-outline-drilling org-id-get-with-outline-path-completion ;;;;;; org-id-get org-id-copy org-id-get-create) "org-id" "org/org-id.el" -;;;;;; (20355 10021 546955 0)) +;;;;;; (20545 57511 257469 0)) ;;; Generated autoloads from org/org-id.el (autoload 'org-id-get-create "org-id" "\ @@ -21620,8 +21670,8 @@ The list is displayed in a buffer named `*Packages*'. ;;;*** -;;;### (autoloads (show-paren-mode) "paren" "paren.el" (20355 10021 -;;;;;; 546955 0)) +;;;### (autoloads (show-paren-mode) "paren" "paren.el" (20542 50478 +;;;;;; 439878 507000)) ;;; Generated autoloads from paren.el (defvar show-paren-mode nil "\ @@ -21859,8 +21909,8 @@ Completion for GNU/Linux `mount'. ;;;*** -;;;### (autoloads (pcomplete/rpm) "pcmpl-rpm" "pcmpl-rpm.el" (20453 -;;;;;; 5408 87415 759000)) +;;;### (autoloads (pcomplete/rpm) "pcmpl-rpm" "pcmpl-rpm.el" (20523 +;;;;;; 62082 997685 0)) ;;; Generated autoloads from pcmpl-rpm.el (autoload 'pcomplete/rpm "pcmpl-rpm" "\ @@ -21930,8 +21980,8 @@ Includes files as well as host names followed by a colon. ;;;### (autoloads (pcomplete-shell-setup pcomplete-comint-setup pcomplete-list ;;;;;; pcomplete-help pcomplete-expand pcomplete-continue pcomplete-expand-and-complete -;;;;;; pcomplete-reverse pcomplete) "pcomplete" "pcomplete.el" (20476 -;;;;;; 31768 298871 0)) +;;;;;; pcomplete-reverse pcomplete) "pcomplete" "pcomplete.el" (20523 +;;;;;; 62082 997685 0)) ;;; Generated autoloads from pcomplete.el (autoload 'pcomplete "pcomplete" "\ @@ -22075,7 +22125,7 @@ Global menu used by PCL-CVS.") ;;;*** ;;;### (autoloads (perl-mode) "perl-mode" "progmodes/perl-mode.el" -;;;;;; (20478 3673 653810 0)) +;;;;;; (20523 62082 997685 0)) ;;; Generated autoloads from progmodes/perl-mode.el (put 'perl-indent-level 'safe-local-variable 'integerp) (put 'perl-continued-statement-offset 'safe-local-variable 'integerp) @@ -22931,17 +22981,20 @@ are both set to t. ;;;*** -;;;### (autoloads (proced) "proced" "proced.el" (20453 5437 764254 +;;;### (autoloads (proced) "proced" "proced.el" (20511 39332 974340 ;;;;;; 0)) ;;; Generated autoloads from proced.el (autoload 'proced "proced" "\ Generate a listing of UNIX system processes. -If invoked with optional ARG the window displaying the process -information will be displayed but not selected. -Runs the normal hook `proced-post-display-hook'. +\\ +If invoked with optional ARG, do not select the window displaying +the process information. -See `proced-mode' for a description of features available in Proced buffers. +This function runs the normal hook `proced-post-display-hook'. + +See `proced-mode' for a description of features available in +Proced buffers. \(fn &optional ARG)" t nil) @@ -23245,7 +23298,7 @@ If EXTENSION is any other symbol, it is ignored. ;;;*** ;;;### (autoloads (python-mode run-python) "python" "progmodes/python.el" -;;;;;; (20504 35072 130543 0)) +;;;;;; (20523 62082 997685 0)) ;;; Generated autoloads from progmodes/python.el (add-to-list 'auto-mode-alist (cons (purecopy "\\.py\\'") 'python-mode)) @@ -23281,7 +23334,7 @@ if that value is non-nil. ;;;*** ;;;### (autoloads (quoted-printable-decode-region) "qp" "gnus/qp.el" -;;;;;; (20355 10021 546955 0)) +;;;;;; (20544 36659 880486 0)) ;;; Generated autoloads from gnus/qp.el (autoload 'quoted-printable-decode-region "qp" "\ @@ -23304,7 +23357,7 @@ them into characters should be done separately. ;;;;;; quail-defrule quail-install-decode-map quail-install-map ;;;;;; quail-define-rules quail-show-keyboard-layout quail-set-keyboard-layout ;;;;;; quail-define-package quail-use-package quail-title) "quail" -;;;;;; "international/quail.el" (20501 3499 284800 0)) +;;;;;; "international/quail.el" (20523 62082 997685 0)) ;;; Generated autoloads from international/quail.el (autoload 'quail-title "quail" "\ @@ -23608,7 +23661,7 @@ Display `quickurl-list' as a formatted list using `quickurl-list-mode'. ;;;*** ;;;### (autoloads (rcirc-track-minor-mode rcirc-connect rcirc) "rcirc" -;;;;;; "net/rcirc.el" (20434 17809 692608 0)) +;;;;;; "net/rcirc.el" (20541 6907 775259 0)) ;;; Generated autoloads from net/rcirc.el (autoload 'rcirc "rcirc" "\ @@ -23864,8 +23917,8 @@ For true \"word wrap\" behavior, use `visual-line-mode' instead. ;;;*** ;;;### (autoloads (reftex-reset-scanning-information reftex-mode -;;;;;; turn-on-reftex) "reftex" "textmodes/reftex.el" (20499 48164 -;;;;;; 310488 0)) +;;;;;; turn-on-reftex) "reftex" "textmodes/reftex.el" (20507 42276 +;;;;;; 222255 0)) ;;; Generated autoloads from textmodes/reftex.el (autoload 'turn-on-reftex "reftex" "\ @@ -24013,8 +24066,8 @@ of master file. ;;;*** -;;;### (autoloads nil "reftex-vars" "textmodes/reftex-vars.el" (20498 -;;;;;; 27300 867875 0)) +;;;### (autoloads nil "reftex-vars" "textmodes/reftex-vars.el" (20507 +;;;;;; 42276 222255 0)) ;;; Generated autoloads from textmodes/reftex-vars.el (put 'reftex-vref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x)))) (put 'reftex-fref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x)))) @@ -24024,7 +24077,7 @@ of master file. ;;;*** ;;;### (autoloads (regexp-opt-depth regexp-opt) "regexp-opt" "emacs-lisp/regexp-opt.el" -;;;;;; (20363 61861 222722 0)) +;;;;;; (20522 38650 757441 0)) ;;; Generated autoloads from emacs-lisp/regexp-opt.el (autoload 'regexp-opt "regexp-opt" "\ @@ -24270,8 +24323,8 @@ variable. ;;;;;; rmail-secondary-file-directory rmail-primary-inbox-list rmail-highlighted-headers ;;;;;; rmail-retry-ignored-headers rmail-displayed-headers rmail-ignored-headers ;;;;;; rmail-user-mail-address-regexp rmail-movemail-variant-p rmail-spool-directory -;;;;;; rmail-file-name) "rmail" "mail/rmail.el" (20437 50597 545250 -;;;;;; 0)) +;;;;;; rmail-file-name) "rmail" "mail/rmail.el" (20526 43809 637014 +;;;;;; 858000)) ;;; Generated autoloads from mail/rmail.el (defvar rmail-file-name (purecopy "~/RMAIL") "\ @@ -24469,8 +24522,8 @@ Set PASSWORD to be used for retrieving mail from a POP or IMAP server. ;;;*** ;;;### (autoloads (rmail-output-body-to-file rmail-output-as-seen -;;;;;; rmail-output) "rmailout" "mail/rmailout.el" (20355 10021 -;;;;;; 546955 0)) +;;;;;; rmail-output) "rmailout" "mail/rmailout.el" (20530 3765 184907 +;;;;;; 0)) ;;; Generated autoloads from mail/rmailout.el (put 'rmail-output-file-alist 'risky-local-variable t) @@ -24619,7 +24672,7 @@ must be equal. ;;;*** ;;;### (autoloads (robin-use-package robin-modify-package robin-define-package) -;;;;;; "robin" "international/robin.el" (20501 3499 284800 0)) +;;;;;; "robin" "international/robin.el" (20523 62082 997685 0)) ;;; Generated autoloads from international/robin.el (autoload 'robin-define-package "robin" "\ @@ -24691,7 +24744,7 @@ Toggle the use of ROT13 encoding for the current window. ;;;*** ;;;### (autoloads (rst-minor-mode rst-mode) "rst" "textmodes/rst.el" -;;;;;; (20502 63903 34842 0)) +;;;;;; (20523 62082 997685 0)) ;;; Generated autoloads from textmodes/rst.el (add-to-list 'auto-mode-alist (purecopy '("\\.re?st\\'" . rst-mode))) @@ -24722,7 +24775,7 @@ for modes derived from Text mode, like Mail mode. ;;;*** ;;;### (autoloads (ruby-mode) "ruby-mode" "progmodes/ruby-mode.el" -;;;;;; (20490 33188 850375 0)) +;;;;;; (20522 38650 757441 0)) ;;; Generated autoloads from progmodes/ruby-mode.el (autoload 'ruby-mode "ruby-mode" "\ @@ -24761,8 +24814,8 @@ if ARG is omitted or nil. ;;;*** -;;;### (autoloads (rx rx-to-string) "rx" "emacs-lisp/rx.el" (20355 -;;;;;; 10021 546955 0)) +;;;### (autoloads (rx rx-to-string) "rx" "emacs-lisp/rx.el" (20518 +;;;;;; 12580 46478 0)) ;;; Generated autoloads from emacs-lisp/rx.el (autoload 'rx-to-string "rx" "\ @@ -25073,8 +25126,8 @@ enclosed in `(and ...)'. ;;;*** -;;;### (autoloads (savehist-mode) "savehist" "savehist.el" (20453 -;;;;;; 5437 764254 0)) +;;;### (autoloads (savehist-mode) "savehist" "savehist.el" (20523 +;;;;;; 62082 997685 0)) ;;; Generated autoloads from savehist.el (defvar savehist-mode nil "\ @@ -25549,8 +25602,8 @@ Like `mail' command, but display mail buffer in another frame. ;;;*** ;;;### (autoloads (server-save-buffers-kill-terminal server-mode -;;;;;; server-force-delete server-start) "server" "server.el" (20478 -;;;;;; 3673 653810 0)) +;;;;;; server-force-delete server-start) "server" "server.el" (20545 +;;;;;; 57511 257469 0)) ;;; Generated autoloads from server.el (put 'server-host 'risky-local-variable t) @@ -25702,7 +25755,7 @@ To work around that, do: ;;;*** ;;;### (autoloads (sh-mode) "sh-script" "progmodes/sh-script.el" -;;;;;; (20487 57003 603251 0)) +;;;;;; (20541 6907 775259 0)) ;;; Generated autoloads from progmodes/sh-script.el (put 'sh-shell 'safe-local-variable 'symbolp) @@ -26010,7 +26063,7 @@ with no arguments, if that value is non-nil. ;;;*** ;;;### (autoloads (skeleton-pair-insert-maybe skeleton-insert skeleton-proxy-new -;;;;;; define-skeleton) "skeleton" "skeleton.el" (20406 8611 875037 +;;;;;; define-skeleton) "skeleton" "skeleton.el" (20541 6907 775259 ;;;;;; 0)) ;;; Generated autoloads from skeleton.el @@ -26123,7 +26176,7 @@ symmetrical ones, and the same character twice for the others. ;;;*** ;;;### (autoloads (smerge-start-session smerge-mode smerge-ediff) -;;;;;; "smerge-mode" "vc/smerge-mode.el" (20476 31768 298871 0)) +;;;;;; "smerge-mode" "vc/smerge-mode.el" (20523 62082 997685 0)) ;;; Generated autoloads from vc/smerge-mode.el (autoload 'smerge-ediff "smerge-mode" "\ @@ -26332,7 +26385,7 @@ Pick your favorite shortcuts: ;;;### (autoloads (reverse-region sort-columns sort-regexp-fields ;;;;;; sort-fields sort-numeric-fields sort-pages sort-paragraphs -;;;;;; sort-lines sort-subr) "sort" "sort.el" (20355 10021 546955 +;;;;;; sort-lines sort-subr) "sort" "sort.el" (20507 42276 222255 ;;;;;; 0)) ;;; Generated autoloads from sort.el (put 'sort-fold-case 'safe-local-variable 'booleanp) @@ -26430,18 +26483,23 @@ the sort order. \(fn FIELD BEG END)" t nil) (autoload 'sort-regexp-fields "sort" "\ -Sort the region lexicographically as specified by RECORD-REGEXP and KEY. -RECORD-REGEXP specifies the textual units which should be sorted. - For example, to sort lines RECORD-REGEXP would be \"^.*$\" -KEY specifies the part of each record (ie each match for RECORD-REGEXP) - is to be used for sorting. - If it is \"\\\\digit\" then the digit'th \"\\\\(...\\\\)\" match field from - RECORD-REGEXP is used. - If it is \"\\\\&\" then the whole record is used. - Otherwise, it is a regular-expression for which to search within the record. -If a match for KEY is not found within a record then that record is ignored. +Sort the text in the region region lexicographically. +If called interactively, prompt for two regular expressions, +RECORD-REGEXP and KEY-REGEXP. -With a negative prefix arg sorts in reverse order. +RECORD-REGEXP specifies the textual units to be sorted. + For example, to sort lines, RECORD-REGEXP would be \"^.*$\". + +KEY-REGEXP specifies the part of each record (i.e. each match for + RECORD-REGEXP) to be used for sorting. + If it is \"\\\\digit\", use the digit'th \"\\\\(...\\\\)\" + match field specified by RECORD-REGEXP. + If it is \"\\\\&\", use the whole record. + Otherwise, KEY-REGEXP should be a regular expression with which + to search within the record. If a match for KEY-REGEXP is not + found within a record, that record is ignored. + +With a negative prefix arg, sort in reverse order. The variable `sort-fold-case' determines whether alphabetic case affects the sort order. @@ -27117,8 +27175,8 @@ GnuTLS requires a port number. ;;;;;; strokes-mode strokes-list-strokes strokes-load-user-strokes ;;;;;; strokes-help strokes-describe-stroke strokes-do-complex-stroke ;;;;;; strokes-do-stroke strokes-read-complex-stroke strokes-read-stroke -;;;;;; strokes-global-set-stroke) "strokes" "strokes.el" (20478 -;;;;;; 3673 653810 0)) +;;;;;; strokes-global-set-stroke) "strokes" "strokes.el" (20523 +;;;;;; 62082 997685 0)) ;;; Generated autoloads from strokes.el (autoload 'strokes-global-set-stroke "strokes" "\ @@ -27253,7 +27311,7 @@ Studlify-case the current buffer. ;;;*** ;;;### (autoloads (global-subword-mode subword-mode) "subword" "progmodes/subword.el" -;;;;;; (20355 10021 546955 0)) +;;;;;; (20524 51365 2559 0)) ;;; Generated autoloads from progmodes/subword.el (autoload 'subword-mode "subword" "\ @@ -28010,8 +28068,8 @@ Connect to the Emacs talk group from the current X display or tty frame. ;;;*** -;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (20478 3673 -;;;;;; 653810 0)) +;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (20522 9637 +;;;;;; 465791 0)) ;;; Generated autoloads from tar-mode.el (autoload 'tar-mode "tar-mode" "\ @@ -28200,8 +28258,8 @@ Start coverage on function under point. ;;;*** -;;;### (autoloads (tetris) "tetris" "play/tetris.el" (20478 3673 -;;;;;; 653810 0)) +;;;### (autoloads (tetris) "tetris" "play/tetris.el" (20545 57511 +;;;;;; 257469 0)) ;;; Generated autoloads from play/tetris.el (autoload 'tetris "tetris" "\ @@ -28232,7 +28290,7 @@ tetris-mode keybindings: ;;;;;; tex-start-commands tex-start-options slitex-run-command latex-run-command ;;;;;; tex-run-command tex-offer-save tex-main-file tex-first-line-header-regexp ;;;;;; tex-directory tex-shell-file-name) "tex-mode" "textmodes/tex-mode.el" -;;;;;; (20485 15269 390836 0)) +;;;;;; (20523 62082 997685 0)) ;;; Generated autoloads from textmodes/tex-mode.el (defvar tex-shell-file-name nil "\ @@ -29114,7 +29172,7 @@ With ARG, turn time stamping on if and only if arg is positive. ;;;;;; timeclock-workday-remaining-string timeclock-reread-log timeclock-query-out ;;;;;; timeclock-change timeclock-status-string timeclock-out timeclock-in ;;;;;; timeclock-mode-line-display) "timeclock" "calendar/timeclock.el" -;;;;;; (20427 14766 970343 0)) +;;;;;; (20523 62082 997685 0)) ;;; Generated autoloads from calendar/timeclock.el (autoload 'timeclock-mode-line-display "timeclock" "\ @@ -29524,7 +29582,7 @@ BUFFER defaults to `trace-buffer'. ;;;### (autoloads (tramp-unload-tramp tramp-completion-handle-file-name-completion ;;;;;; tramp-completion-handle-file-name-all-completions tramp-unload-file-name-handlers ;;;;;; tramp-file-name-handler tramp-syntax tramp-mode) "tramp" -;;;;;; "net/tramp.el" (20471 14012 248888 0)) +;;;;;; "net/tramp.el" (20530 32114 546307 0)) ;;; Generated autoloads from net/tramp.el (defvar tramp-mode t "\ @@ -29667,8 +29725,8 @@ Discard Tramp from loading remote files. ;;;*** -;;;### (autoloads (help-with-tutorial) "tutorial" "tutorial.el" (20369 -;;;;;; 14251 85829 0)) +;;;### (autoloads (help-with-tutorial) "tutorial" "tutorial.el" (20518 +;;;;;; 12580 46478 0)) ;;; Generated autoloads from tutorial.el (autoload 'help-with-tutorial "tutorial" "\ @@ -29755,7 +29813,7 @@ First column's text sSs Second column's text ;;;;;; type-break type-break-mode type-break-keystroke-threshold ;;;;;; type-break-good-break-interval type-break-good-rest-interval ;;;;;; type-break-interval type-break-mode) "type-break" "type-break.el" -;;;;;; (20355 10021 546955 0)) +;;;;;; (20545 57511 257469 0)) ;;; Generated autoloads from type-break.el (defvar type-break-mode nil "\ @@ -30320,7 +30378,7 @@ accessible. ;;;*** ;;;### (autoloads (url-http-options url-http-file-attributes url-http-file-exists-p -;;;;;; url-http) "url-http" "url/url-http.el" (20478 3673 653810 +;;;;;; url-http) "url-http" "url/url-http.el" (20522 38650 757441 ;;;;;; 0)) ;;; Generated autoloads from url/url-http.el @@ -30523,7 +30581,7 @@ Fetch a data URL (RFC 2397). ;;;*** ;;;### (autoloads (url-generic-parse-url url-recreate-url) "url-parse" -;;;;;; "url/url-parse.el" (20478 3673 653810 0)) +;;;;;; "url/url-parse.el" (20523 62082 997685 0)) ;;; Generated autoloads from url/url-parse.el (autoload 'url-recreate-url "url-parse" "\ @@ -30606,8 +30664,8 @@ The variable `url-queue-timeout' sets a timeout. ;;;;;; url-percentage url-display-percentage url-pretty-length url-strip-leading-spaces ;;;;;; url-eat-trailing-space url-get-normalized-date url-lazy-message ;;;;;; url-normalize-url url-insert-entities-in-string url-parse-args -;;;;;; url-debug url-debug) "url-util" "url/url-util.el" (20478 -;;;;;; 3673 653810 0)) +;;;;;; url-debug url-debug) "url-util" "url/url-util.el" (20520 +;;;;;; 54308 826101 0)) ;;; Generated autoloads from url/url-util.el (defvar url-debug nil "\ @@ -30867,8 +30925,8 @@ If FILE-NAME is non-nil, save the result to FILE-NAME. ;;;;;; vc-print-log vc-retrieve-tag vc-create-tag vc-merge vc-insert-headers ;;;;;; vc-revision-other-window vc-root-diff vc-ediff vc-version-ediff ;;;;;; vc-diff vc-version-diff vc-register vc-next-action vc-before-checkin-hook -;;;;;; vc-checkin-hook vc-checkout-hook) "vc" "vc/vc.el" (20501 -;;;;;; 3499 284800 0)) +;;;;;; vc-checkin-hook vc-checkout-hook) "vc" "vc/vc.el" (20542 +;;;;;; 46798 773957 0)) ;;; Generated autoloads from vc/vc.el (defvar vc-checkout-hook nil "\ @@ -31211,7 +31269,7 @@ Name of the format file in a .bzr directory.") ;;;*** -;;;### (autoloads nil "vc-cvs" "vc/vc-cvs.el" (20478 3673 653810 +;;;### (autoloads nil "vc-cvs" "vc/vc-cvs.el" (20542 46798 773957 ;;;;;; 0)) ;;; Generated autoloads from vc/vc-cvs.el (defun vc-cvs-registered (f) @@ -31223,7 +31281,7 @@ Name of the format file in a .bzr directory.") ;;;*** -;;;### (autoloads (vc-dir) "vc-dir" "vc/vc-dir.el" (20478 3673 653810 +;;;### (autoloads (vc-dir) "vc-dir" "vc/vc-dir.el" (20522 9637 465791 ;;;;;; 0)) ;;; Generated autoloads from vc/vc-dir.el @@ -31295,8 +31353,7 @@ case, and the process object in the asynchronous case. ;;;*** -;;;### (autoloads nil "vc-mtn" "vc/vc-mtn.el" (20478 3673 653810 -;;;;;; 0)) +;;;### (autoloads nil "vc-mtn" "vc/vc-mtn.el" (20524 51365 2559 0)) ;;; Generated autoloads from vc/vc-mtn.el (defconst vc-mtn-admin-dir "_MTN" "\ @@ -32468,8 +32525,8 @@ Exit View mode and make the current buffer editable. ;;;*** -;;;### (autoloads (vip-mode vip-setup) "vip" "emulation/vip.el" (20355 -;;;;;; 10021 546955 0)) +;;;### (autoloads (vip-mode vip-setup) "vip" "emulation/vip.el" (20513 +;;;;;; 18948 537867 0)) ;;; Generated autoloads from emulation/vip.el (autoload 'vip-setup "vip" "\ @@ -32592,15 +32649,16 @@ this is equivalent to `display-warning', using ;;;*** ;;;### (autoloads (wdired-change-to-wdired-mode) "wdired" "wdired.el" -;;;;;; (20478 3673 653810 0)) +;;;;;; (20510 18478 782378 0)) ;;; Generated autoloads from wdired.el (autoload 'wdired-change-to-wdired-mode "wdired" "\ -Put a dired buffer in a mode in which filenames are editable. +Put a Dired buffer in Writable Dired (WDired) mode. \\ -This mode allows the user to change the names of the files, and after -typing \\[wdired-finish-edit] Emacs renames the files and directories -in disk. +In WDired mode, you can edit the names of the files in the +buffer, the target of the links, and the permission bits of the +files. After typing \\[wdired-finish-edit], Emacs modifies the files and +directories to reflect your edits. See `wdired-mode'. @@ -32626,7 +32684,7 @@ Please submit bug reports and other feedback to the author, Neil W. Van Dyke ;;;*** ;;;### (autoloads (which-function-mode which-func-mode) "which-func" -;;;;;; "progmodes/which-func.el" (20461 32935 300400 0)) +;;;;;; "progmodes/which-func.el" (20523 62082 997685 0)) ;;; Generated autoloads from progmodes/which-func.el (put 'which-func-format 'risky-local-variable t) (put 'which-func-current 'risky-local-variable t) @@ -32662,8 +32720,8 @@ in certain major modes. ;;;### (autoloads (whitespace-report-region whitespace-report whitespace-cleanup-region ;;;;;; whitespace-cleanup global-whitespace-toggle-options whitespace-toggle-options ;;;;;; global-whitespace-newline-mode global-whitespace-mode whitespace-newline-mode -;;;;;; whitespace-mode) "whitespace" "whitespace.el" (20495 51111 -;;;;;; 757560 0)) +;;;;;; whitespace-mode) "whitespace" "whitespace.el" (20508 13724 +;;;;;; 260761 0)) ;;; Generated autoloads from whitespace.el (autoload 'whitespace-mode "whitespace" "\ @@ -33209,7 +33267,7 @@ With arg, turn Winner mode on if and only if arg is positive. ;;;*** ;;;### (autoloads (woman-bookmark-jump woman-find-file woman-dired-find-file -;;;;;; woman woman-locale) "woman" "woman.el" (20504 6781 423358 +;;;;;; woman woman-locale) "woman" "woman.el" (20539 18737 159373 ;;;;;; 0)) ;;; Generated autoloads from woman.el @@ -33392,7 +33450,7 @@ Example: ;;;*** ;;;### (autoloads (xml-parse-region xml-parse-file) "xml" "xml.el" -;;;;;; (20499 48164 310488 0)) +;;;;;; (20528 48420 241677 0)) ;;; Generated autoloads from xml.el (autoload 'xml-parse-file "xml" "\ @@ -33540,7 +33598,7 @@ Zippy goes to the analyst. ;;;*** -;;;### (autoloads (zone) "zone" "play/zone.el" (20427 14766 970343 +;;;### (autoloads (zone) "zone" "play/zone.el" (20545 57511 257469 ;;;;;; 0)) ;;; Generated autoloads from play/zone.el @@ -33752,7 +33810,7 @@ Zone out, completely. ;;;;;; "vc/ediff-ptch.el" "vc/ediff-vers.el" "vc/ediff-wind.el" ;;;;;; "vc/pcvs-info.el" "vc/pcvs-parse.el" "vc/pcvs-util.el" "vc/vc-dav.el" ;;;;;; "vcursor.el" "vt-control.el" "vt100-led.el" "w32-fns.el" -;;;;;; "w32-vars.el" "x-dnd.el") (20505 765 716386 793000)) +;;;;;; "w32-vars.el" "x-dnd.el") (20545 57718 475744 538000)) ;;;*** From f18cbb28c26c300dbe37de6950d4ef918de9c61b Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 1 Sep 2012 15:23:50 +0300 Subject: [PATCH 187/212] Remove conflict markers and fix entries for 2012-09-01T06:38:52Z!dancol@dancol.org. --- src/ChangeLog | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 56e45503ad0..5b58d77e54a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -37,7 +37,7 @@ * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of directly accessing frame internals. - * w32font.h (w): Include font.h. Define syms_of_w32font and + * w32font.h: Include font.h. Define syms_of_w32font and globals_of_w32font. * process.c: Include TERM_HEADER instead of listing all possible @@ -80,15 +80,14 @@ * emacs.c: Include TERM_HEADER. - * dispnew.c (d): Include TERM_HEADER instead of listing all - possible window-system headers. + * dispnew.c: Include TERM_HEADER instead of listing all possible + window-system headers. - * ccl.h (c): Include character.h. + * ccl.h: Include character.h. * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for the current window system; include in list of objects to link into Emacs. ->>>>>>> MERGE-SOURCE 2012-08-31 Dmitry Antipov From 7e510e2844732d53563abd45ec60df7de2129246 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 1 Sep 2012 16:54:27 +0300 Subject: [PATCH 188/212] Further fix for bug #11860 with Arabic display on Windows. src/w32uniscribe.c (uniscribe_shape): Handle correctly the case of more than one grapheme cluster passed to the shaper: compute the offset adjustment values separately for each cluster. --- src/ChangeLog | 4 ++++ src/w32uniscribe.c | 42 ++++++++++++++++++++++++++---------------- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5b58d77e54a..e186b8af87f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2012-09-01 Eli Zaretskii + * w32uniscribe.c (uniscribe_shape): Handle correctly the case of + more than one grapheme cluster passed to the shaper: compute the + offset adjustment values separately for each cluster. (Bug#11860) + * image.c: Restore mistakenly removed inclusion of w32.h. Without it, GCC doesn't see prototypes of w32_delayed_load, and complains about implicit conversions from integer to pointer. diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c index 50532acaff3..bc45e2c648c 100644 --- a/src/w32uniscribe.c +++ b/src/w32uniscribe.c @@ -322,22 +322,6 @@ uniscribe_shape (Lisp_Object lgstring) { int j, from, to, adj_offset = 0; - /* For RTL text, the Uniscribe shaper prepares the - values in ADVANCES array for layout in reverse order, - whereby "advance width" is applied to move the pen in - reverse direction and _before_ drawing the glyph. - Since we draw glyphs in their normal left-to-right - order, we need to adjust the coordinates of each - non-base glyph in a grapheme cluster via X-OFF - component of the gstring's ADJUSTMENT sub-vector. - This loop computes the initial value of the - adjustment for the base character, which is then - updated for each successive glyph in the grapheme - cluster. */ - if (items[i].a.fRTL) - for (j = 1; j < nglyphs; j++) - adj_offset += advances[j]; - from = 0; to = from; @@ -380,6 +364,32 @@ uniscribe_shape (Lisp_Object lgstring) } } } + + /* For RTL text, the Uniscribe shaper prepares + the values in ADVANCES array for layout in + reverse order, whereby "advance width" is + applied to move the pen in reverse direction + and _before_ drawing the glyph. Since we + draw glyphs in their normal left-to-right + order, we need to adjust the coordinates of + each non-base glyph in a grapheme cluster via + X-OFF component of the gstring's ADJUSTMENT + sub-vector. This loop computes, for each + grapheme cluster, the initial value of the + adjustment for the base character, which is + then updated for each successive glyph in the + grapheme cluster. */ + if (items[i].a.fRTL) + { + int j1 = j; + + adj_offset = 0; + while (j1 < nglyphs && !attributes[j1].fClusterStart) + { + adj_offset += advances[j1]; + j1++; + } + } } LGLYPH_SET_CHAR (lglyph, chars[items[i].iCharPos From 78dd6ab19818ddbd6995e58b6eccd3e19899aba1 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sat, 1 Sep 2012 18:47:09 +0200 Subject: [PATCH 189/212] Rewrite switch-to-prev-/next-buffer and quit-window; add display-buffer-below-selected. * window.el (switch-to-prev-buffer): Handle additional values of BURY-OR-KILL argument. Don't switch in minibuffer window. (switch-to-next-buffer): Don't switch in minibuffer window. (quit-restore-window): New function based on quit-window. Handle additional values of former KILL argument. (quit-window): Call quit-restore-window with appropriate interpretation of KILL argument. (display-buffer-below-selected): New buffer display action function. --- lisp/ChangeLog | 12 +++ lisp/window.el | 256 +++++++++++++++++++++++++++++++++---------------- 2 files changed, 183 insertions(+), 85 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c5b866e9d54..f43a3177af2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,15 @@ +2012-09-01 Martin Rudalics + + * window.el (switch-to-prev-buffer): Handle additional values of + BURY-OR-KILL argument. Don't switch in minibuffer window. + (switch-to-next-buffer): Don't switch in minibuffer window. + (quit-restore-window): New function based on quit-window. + Handle additional values of former KILL argument. + (quit-window): Call quit-restore-window with appropriate + interpretation of KILL argument. + (display-buffer-below-selected): New buffer display action + function. + 2012-09-01 Stefan Monnier * minibuffer.el (completion-at-point-functions): Complete docstring diff --git a/lisp/window.el b/lisp/window.el index c72093334d8..2fce874e987 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -2972,7 +2972,12 @@ found. Optional argument BURY-OR-KILL non-nil means the buffer currently shown in WINDOW is about to be buried or killed and consequently -shall not be switched to in future invocations of this command." +shall not be switched to in future invocations of this command. + +As a special case, if BURY-OR-KILL equals `append', this means to +move the buffer to the end of WINDOW's previous buffers list so a +future invocation of `switch-to-prev-buffer' less likely switches +to it." (interactive) (let* ((window (window-normalize-window window t)) (frame (window-frame window)) @@ -2980,26 +2985,34 @@ shall not be switched to in future invocations of this command." ;; Save this since it's destroyed by `set-window-buffer'. (next-buffers (window-next-buffers window)) (pred (frame-parameter frame 'buffer-predicate)) - entry buffer new-buffer killed-buffers visible) + entry new-buffer killed-buffers visible) + (when (window-minibuffer-p window) + ;; Don't switch in minibuffer window. + (unless (setq window (minibuffer-selected-window)) + (error "Window %s is a minibuffer window" window))) + (when (window-dedicated-p window) + ;; Don't switch in dedicated window. (error "Window %s is dedicated to buffer %s" window old-buffer)) (catch 'found ;; Scan WINDOW's previous buffers first, skipping entries of next ;; buffers. (dolist (entry (window-prev-buffers window)) - (when (and (setq buffer (car entry)) - (or (buffer-live-p buffer) + (when (and (setq new-buffer (car entry)) + (or (buffer-live-p new-buffer) (not (setq killed-buffers - (cons buffer killed-buffers)))) - (or (null pred) (funcall pred buffer)) - (not (eq buffer old-buffer)) - (or bury-or-kill (not (memq buffer next-buffers)))) + (cons new-buffer killed-buffers)))) + (not (eq new-buffer old-buffer)) + (or (null pred) (funcall pred new-buffer)) + ;; When BURY-OR-KILL is nil, avoid switching to a + ;; buffer in WINDOW's next buffers list. + (or bury-or-kill (not (memq new-buffer next-buffers)))) (if (and (not switch-to-visible-buffer) - (get-buffer-window buffer frame)) - ;; Try to avoid showing a buffer visible in some other window. - (setq visible buffer) - (setq new-buffer buffer) + (get-buffer-window new-buffer frame)) + ;; Try to avoid showing a buffer visible in some other + ;; window. + (setq visible new-buffer) (set-window-buffer-start-and-point window new-buffer (nth 1 entry) (nth 2 entry)) (throw 'found t)))) @@ -3014,8 +3027,8 @@ shall not be switched to in future invocations of this command." (nreverse (buffer-list frame)))) (when (and (buffer-live-p buffer) (not (eq buffer old-buffer)) - (not (eq (aref (buffer-name buffer) 0) ?\s)) (or (null pred) (funcall pred buffer)) + (not (eq (aref (buffer-name buffer) 0) ?\s)) (or bury-or-kill (not (memq buffer next-buffers)))) (if (get-buffer-window buffer frame) ;; Try to avoid showing a buffer visible in some other window. @@ -3047,12 +3060,20 @@ shall not be switched to in future invocations of this command." (set-window-buffer-start-and-point window new-buffer))) (if bury-or-kill - ;; Remove `old-buffer' from WINDOW's previous and (restored list - ;; of) next buffers. - (progn + (let ((entry (and (eq bury-or-kill 'append) + (assq old-buffer (window-prev-buffers window))))) + ;; Remove `old-buffer' from WINDOW's previous and (restored list + ;; of) next buffers. (set-window-prev-buffers window (assq-delete-all old-buffer (window-prev-buffers window))) - (set-window-next-buffers window (delq old-buffer next-buffers))) + (set-window-next-buffers window (delq old-buffer next-buffers)) + (when entry + ;; Append old-buffer's entry to list of WINDOW's previous + ;; buffers so it's less likely to get switched to soon but + ;; `display-buffer-in-previous-window' can nevertheless find + ;; it. + (set-window-prev-buffers + window (append (window-prev-buffers window) (list entry))))) ;; Move `old-buffer' to head of WINDOW's restored list of next ;; buffers. (set-window-next-buffers @@ -3080,8 +3101,14 @@ found." (old-buffer (window-buffer window)) (next-buffers (window-next-buffers window)) (pred (frame-parameter frame 'buffer-predicate)) - buffer new-buffer entry killed-buffers visible) + new-buffer entry killed-buffers visible) + (when (window-minibuffer-p window) + ;; Don't switch in minibuffer window. + (unless (setq window (minibuffer-selected-window)) + (error "Window %s is a minibuffer window" window))) + (when (window-dedicated-p window) + ;; Don't switch in dedicated window. (error "Window %s is dedicated to buffer %s" window old-buffer)) (catch 'found @@ -3100,9 +3127,10 @@ found." ;; Scan the buffer list of WINDOW's frame next, skipping previous ;; buffers entries. (dolist (buffer (buffer-list frame)) - (when (and (buffer-live-p buffer) (not (eq buffer old-buffer)) - (not (eq (aref (buffer-name buffer) 0) ?\s)) + (when (and (buffer-live-p buffer) + (not (eq buffer old-buffer)) (or (null pred) (funcall pred buffer)) + (not (eq (aref (buffer-name buffer) 0) ?\s)) (not (assq buffer (window-prev-buffers window)))) (if (get-buffer-window buffer frame) ;; Try to avoid showing a buffer visible in some other window. @@ -3113,18 +3141,17 @@ found." ;; Scan WINDOW's reverted previous buffers last (must not use ;; nreverse here!) (dolist (entry (reverse (window-prev-buffers window))) - (when (and (setq buffer (car entry)) - (or (buffer-live-p buffer) + (when (and (setq new-buffer (car entry)) + (or (buffer-live-p new-buffer) (not (setq killed-buffers - (cons buffer killed-buffers)))) - (or (null pred) (funcall pred buffer)) - (not (eq buffer old-buffer))) + (cons new-buffer killed-buffers)))) + (not (eq new-buffer old-buffer)) + (or (null pred) (funcall pred new-buffer))) (if (and (not switch-to-visible-buffer) - (get-buffer-window buffer frame)) + (get-buffer-window new-buffer frame)) ;; Try to avoid showing a buffer visible in some other window. (unless visible - (setq visible buffer)) - (setq new-buffer buffer) + (setq visible new-buffer)) (set-window-buffer-start-and-point window new-buffer (nth 1 entry) (nth 2 entry)) (throw 'found t)))) @@ -3351,6 +3378,107 @@ all window-local buffer lists." ;; Unrecord BUFFER in WINDOW. (unrecord-window-buffer window buffer))))) +(defun quit-restore-window (&optional window bury-or-kill) + "Quit WINDOW and deal with its buffer. +WINDOW must be a live window and defaults to the selected one. + +According to information stored in WINDOW's `quit-restore' window +parameter either (1) delete WINDOW and its frame, (2) delete +WINDOW, (3) restore the buffer previously displayed in WINDOW, +or (4) make WINDOW display some other buffer than the present +one. If non-nil, reset `quit-restore' parameter to nil. + +Optional second argument BURY-OR-KILL tells how to proceed with +the buffer of WINDOW. The following values are handled: + +`nil' means to not handle the buffer in a particular way. This + means that if WINDOW is not deleted by this function, invoking + `switch-to-prev-buffer' will usually show the buffer again. + +`append' means that if WINDOW is not deleted, move its buffer to + the end of WINDOW's previous buffers so it's less likely that a + future invocation of `switch-to-prev-buffer' will switch to it. + Also, move the buffer to the end of the frame's buffer list. + +`bury' means that if WINDOW is not deleted, remove its buffer + from WINDOW'S list of previous buffers. Also, move the buffer + to the end of the frame's buffer list. This value provides the + most reliable remedy to not have `switch-to-prev-buffer' switch + to this buffer again without killing the buffer. + +`kill' means to kill WINDOW's buffer." + (setq window (window-normalize-window window t)) + (let* ((buffer (window-buffer window)) + (quit-restore (window-parameter window 'quit-restore)) + (prev-buffer + (let* ((prev-buffers (window-prev-buffers window)) + (prev-buffer (caar prev-buffers))) + (and (or (not (eq prev-buffer buffer)) + (and (cdr prev-buffers) + (not (eq (setq prev-buffer (cadr prev-buffers)) + buffer)))) + prev-buffer))) + quad entry) + (cond + ((and (not prev-buffer) + (memq (nth 1 quit-restore) '(window frame)) + (eq (nth 3 quit-restore) buffer) + ;; Delete WINDOW if possible. + (window--delete window nil (eq bury-or-kill 'kill))) + ;; If the previously selected window is still alive, select it. + (when (window-live-p (nth 2 quit-restore)) + (select-window (nth 2 quit-restore)))) + ((and (listp (setq quad (nth 1 quit-restore))) + (buffer-live-p (car quad)) + (eq (nth 3 quit-restore) buffer)) + ;; Show another buffer stored in quit-restore parameter. + (when (and (integerp (nth 3 quad)) + (/= (nth 3 quad) (window-total-size window))) + ;; Try to resize WINDOW to its old height but don't signal an + ;; error. + (condition-case nil + (window-resize window (- (nth 3 quad) (window-total-size window))) + (error nil))) + (set-window-dedicated-p window nil) + ;; Restore WINDOW's previous buffer, start and point position. + (set-window-buffer-start-and-point + window (nth 0 quad) (nth 1 quad) (nth 2 quad)) + ;; Deal with the buffer we just removed from WINDOW. + (setq entry (and (eq bury-or-kill 'append) + (assq buffer (window-prev-buffers window)))) + (when bury-or-kill + ;; Remove buffer from WINDOW's previous and next buffers. + (set-window-prev-buffers + window (assq-delete-all buffer (window-prev-buffers window))) + (set-window-next-buffers + window (delq buffer (window-next-buffers window)))) + (when entry + ;; Append old buffer's entry to list of WINDOW's previous + ;; buffers so it's less likely to get switched to soon but + ;; `display-buffer-in-previous-window' can nevertheless find it. + (set-window-prev-buffers + window (append (window-prev-buffers window) (list entry)))) + ;; Reset the quit-restore parameter. + (set-window-parameter window 'quit-restore nil) + ;; Select old window. + (when (window-live-p (nth 2 quit-restore)) + (select-window (nth 2 quit-restore)))) + (t + ;; Show some other buffer in WINDOW and reset the quit-restore + ;; parameter. + (set-window-parameter window 'quit-restore nil) + ;; Make sure that WINDOW is no more dedicated. + (set-window-dedicated-p window nil) + (switch-to-prev-buffer window bury-or-kill))) + + ;; Deal with the buffer. + (cond + ((not (buffer-live-p buffer))) + ((eq bury-or-kill 'kill) + (kill-buffer buffer)) + (bury-or-kill + (bury-buffer-internal buffer))))) + (defun quit-window (&optional kill window) "Quit WINDOW and bury its buffer. WINDOW must be a live window and defaults to the selected one. @@ -3363,63 +3491,7 @@ WINDOW, (3) restore the buffer previously displayed in WINDOW, or (4) make WINDOW display some other buffer than the present one. If non-nil, reset `quit-restore' parameter to nil." (interactive "P") - (setq window (window-normalize-window window t)) - (let* ((buffer (window-buffer window)) - (quit-restore (window-parameter window 'quit-restore)) - (prev-buffer - (let* ((prev-buffers (window-prev-buffers window)) - (prev-buffer (caar prev-buffers))) - (and (or (not (eq prev-buffer buffer)) - (and (cdr prev-buffers) - (not (eq (setq prev-buffer (cadr prev-buffers)) - buffer)))) - prev-buffer))) - quad resize) - (cond - ((and (not prev-buffer) - (memq (nth 1 quit-restore) '(window frame)) - (eq (nth 3 quit-restore) buffer) - ;; Delete WINDOW if possible. - (window--delete window nil kill)) - ;; If the previously selected window is still alive, select it. - (when (window-live-p (nth 2 quit-restore)) - (select-window (nth 2 quit-restore)))) - ((and (listp (setq quad (nth 1 quit-restore))) - (buffer-live-p (car quad)) - (eq (nth 3 quit-restore) buffer)) - ;; Show another buffer stored in quit-restore parameter. - (setq resize (and (integerp (nth 3 quad)) - (/= (nth 3 quad) (window-total-size window)))) - (set-window-dedicated-p window nil) - (when resize - ;; Try to resize WINDOW to its old height but don't signal an - ;; error. - (condition-case nil - (window-resize window (- (nth 3 quad) (window-total-size window))) - (error nil))) - ;; Restore WINDOW's previous buffer, start and point position. - (set-window-buffer-start-and-point - window (nth 0 quad) (nth 1 quad) (nth 2 quad)) - ;; Unrecord WINDOW's buffer here (Bug#9937) to make sure it's not - ;; re-recorded by `set-window-buffer'. - (unrecord-window-buffer window buffer) - ;; Reset the quit-restore parameter. - (set-window-parameter window 'quit-restore nil) - ;; Select old window. - (when (window-live-p (nth 2 quit-restore)) - (select-window (nth 2 quit-restore)))) - (t - ;; Show some other buffer in WINDOW and reset the quit-restore - ;; parameter. - (set-window-parameter window 'quit-restore nil) - ;; Make sure that WINDOW is no more dedicated. - (set-window-dedicated-p window nil) - (switch-to-prev-buffer window 'bury-or-kill))) - - ;; Kill WINDOW's old-buffer if requested - (if kill - (kill-buffer buffer) - (bury-buffer-internal buffer)))) + (quit-restore-window window (if kill 'kill 'bury))) (defun quit-windows-on (&optional buffer-or-name kill frame) "Quit all windows showing BUFFER-OR-NAME. @@ -5330,6 +5402,20 @@ again with `display-buffer-pop-up-window'." (and pop-up-windows (display-buffer-pop-up-window buffer alist)))) +(defun display-buffer-below-selected (buffer _alist) + "Try displaying BUFFER in a window below the selected window. +This either splits the selected window or reuses the window below +the selected one." + (let (window) + (or (and (not (frame-parameter nil 'unsplittable)) + (setq window (window--try-to-split-window (selected-window))) + (window--display-buffer + buffer window 'window display-buffer-mark-dedicated)) + (and (setq window (window-in-direction 'below)) + (not (window-dedicated-p window)) + (window--display-buffer + buffer window 'reuse display-buffer-mark-dedicated))))) + (defun display-buffer-use-some-window (buffer alist) "Display BUFFER in an existing window. Search for a usable window, set that window to the buffer, and From 2d3800d2cf34188b0b3ee30012d09f3426b9ae01 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 1 Sep 2012 11:54:38 -0700 Subject: [PATCH 190/212] * configure.ac (_FORTIFY_SOURCE): Define only when optimizing. This ports to glibc 2.15 or later, when configured with --enable-gcc-warnings. See Eric Blake in . --- ChangeLog | 7 +++++++ configure.ac | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6e93b8313e7..cf4506f0c77 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-09-01 Paul Eggert + + * configure.ac (_FORTIFY_SOURCE): Define only when optimizing. + This ports to glibc 2.15 or later, when configured with + --enable-gcc-warnings. See Eric Blake in + . + 2012-09-01 Daniel Colascione * configure.ac: Introduce term_header variable, which holds the diff --git a/configure.ac b/configure.ac index d16113bf919..43686361d07 100644 --- a/configure.ac +++ b/configure.ac @@ -737,8 +737,13 @@ else gl_WARN_ADD([-funit-at-a-time]) AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.]) - AC_DEFINE([_FORTIFY_SOURCE], [2], - [enable compile-time and run-time bounds-checking, and some warnings]) + AH_VERBATIM([FORTIFY_SOURCE], + [/* Enable compile-time and run-time bounds-checking, and some warnings, + without upsetting glibc 2.15+. */ + #if defined __OPTIMIZE__ && __OPTIMIZE__ + # define _FORTIFY_SOURCE 2 + #endif + ]) AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks]) # We use a slightly smaller set of warning options for lib/. From 69678719ec1e25b3c102db8b78525f29fd5c1b48 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 1 Sep 2012 15:03:06 -0700 Subject: [PATCH 191/212] Tidy up term.el menu handling * lisp/term.el: (term-mode-map): Use easymenu for In/Out, Complete menus. (term-pager-break-map): Initialize in the defvar. (term-terminal-menu, term-signals-menu): Define with easymenu. (term-terminal-menu): Also show it in line-mode. (term-pager-menu): New, extracted from term-process-pager. (term-mode, term-char-mode, term-process-pager): Use easymenu-add. (term-update-mode-line): Propertize line/char and page items. (term-process-pager): Move keymap initialization elsewhere. Fixes: debbugs:11957 --- lisp/ChangeLog | 12 +++ lisp/term.el | 284 +++++++++++++++++++++---------------------------- 2 files changed, 134 insertions(+), 162 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f43a3177af2..42dda8f9e49 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,15 @@ +2012-09-01 Glenn Morris + + * term.el: Tidy up menu definitions. + (term-mode-map): Use easymenu for In/Out, Complete menus. + (term-pager-break-map): Initialize in the defvar. + (term-terminal-menu, term-signals-menu): Define with easymenu. + (term-terminal-menu): Also show it in line-mode. (Bug#11957) + (term-pager-menu): New, extracted from term-process-pager. + (term-mode, term-char-mode, term-process-pager): Use easymenu-add. + (term-update-mode-line): Propertize line/char and page items. + (term-process-pager): Move keymap initialization elsewhere. + 2012-09-01 Martin Rudalics * window.el (switch-to-prev-buffer): Handle additional values of diff --git a/lisp/term.el b/lisp/term.el index 014adb610b4..d5f35006357 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -615,28 +615,6 @@ executed once when the buffer is created." :type 'hook :group 'term) -(defvar term-signals-menu - (let ((map (make-sparse-keymap "Signals"))) - (define-key map [eof] - '(menu-item "EOF" term-send-eof - :help "Send an EOF to the current buffer's process")) - (define-key map [kill] - '(menu-item "KILL" term-kill-subjob - :help "Send kill signal to the current subjob")) - (define-key map [quit] - '(menu-item "QUIT" term-quit-subjob - :help "Send quit signal to the current subjob.")) - (define-key map [cont] - '(menu-item "CONT" term-continue-subjob - :help "Send CONT signal to process buffer's process group")) - (define-key map [stop] - '(menu-item "STOP" term-stop-subjob - :help "Stop the current subjob")) - (define-key map [brk] - '(menu-item "BREAK" term-interrupt-subjob - :help "Interrupt the current subjob")) - (cons "Signals" map))) - (defvar term-mode-map (let ((map (make-sparse-keymap))) (define-key map "\ep" 'term-previous-input) @@ -667,69 +645,61 @@ executed once when the buffer is created." (define-key map "\C-c\C-k" 'term-char-mode) (define-key map "\C-c\C-j" 'term-line-mode) (define-key map "\C-c\C-q" 'term-pager-toggle) - - ;; completion: (line mode only) - (let ((completion-menu (make-sparse-keymap "Complete"))) - (define-key map [menu-bar completion] - (cons "Complete" completion-menu)) - (define-key completion-menu [complete-expand] - '("Expand File Name" . term-replace-by-expanded-filename)) - (define-key completion-menu [complete-listing] - '("File Completion Listing" . term-dynamic-list-filename-completions)) - (define-key completion-menu [complete-file] - '("Complete File Name" . term-dynamic-complete-filename)) - (define-key completion-menu [complete] - '("Complete Before Point" . term-dynamic-complete))) - + ;; completion: (line mode only) + (easy-menu-define nil map "Complete menu for Term mode." + '("Complete" + ["Complete Before Point" term-dynamic-complete t] + ["Complete File Name" term-dynamic-complete-filename t] + ["File Completion Listing" term-dynamic-list-filename-completions t] + ["Expand File Name" term-replace-by-expanded-filename t])) ;; Input history: (line mode only) - (let ((inout-menu (make-sparse-keymap "In/Out"))) - (define-key map [menu-bar inout] - (cons "In/Out" inout-menu)) - (define-key inout-menu [kill-output] - '("Kill Current Output Group" . term-kill-output)) - (define-key inout-menu [next-prompt] - '("Forward Output Group" . term-next-prompt)) - (define-key inout-menu [previous-prompt] - '("Backward Output Group" . term-previous-prompt)) - (define-key inout-menu [show-maximum-output] - '("Show Maximum Output" . term-show-maximum-output)) - (define-key inout-menu [show-output] - '("Show Current Output Group" . term-show-output)) - (define-key inout-menu [kill-input] - '("Kill Current Input" . term-kill-input)) - (define-key inout-menu [copy-input] - '("Copy Old Input" . term-copy-old-input)) - (define-key inout-menu [forward-matching-history] - '("Forward Matching Input..." . term-forward-matching-input)) - (define-key inout-menu [backward-matching-history] - '("Backward Matching Input..." . term-backward-matching-input)) - (define-key inout-menu [next-matching-history] - '("Next Matching Input..." . term-next-matching-input)) - (define-key inout-menu [previous-matching-history] - '("Previous Matching Input..." . term-previous-matching-input)) - (define-key inout-menu [next-matching-history-from-input] - '("Next Matching Current Input" . term-next-matching-input-from-input)) - (define-key inout-menu [previous-matching-history-from-input] - '("Previous Matching Current Input" . - term-previous-matching-input-from-input)) - (define-key inout-menu [next-history] - '("Next Input" . term-next-input)) - (define-key inout-menu [previous-history] - '("Previous Input" . term-previous-input)) - (define-key inout-menu [list-history] - '("List Input History" . term-dynamic-list-input-ring)) - (define-key inout-menu [expand-history] - '("Expand History Before Point" . term-replace-by-expanded-history))) - - (define-key map [menu-bar signals] term-signals-menu) - - map)) + (easy-menu-define nil map "In/Out menu for Term mode." + '("In/Out" + ["Expand History Before Point" term-replace-by-expanded-history + term-input-autoexpand] + ["List Input History" term-dynamic-list-input-ring t] + ["Previous Input" term-previous-input t] + ["Next Input" term-next-input t] + ["Previous Matching Current Input" + term-previous-matching-input-from-input t] + ["Next Matching Current Input" term-next-matching-input-from-input t] + ["Previous Matching Input..." term-previous-matching-input t] + ["Next Matching Input..." term-next-matching-input t] + ["Backward Matching Input..." term-backward-matching-input t] + ["Forward Matching Input..." term-forward-matching-input t] + ["Copy Old Input" term-copy-old-input t] + ["Kill Current Input" term-kill-input t] + ["Show Current Output Group" term-show-output t] + ["Show Maximum Output" term-show-maximum-output t] + ["Backward Output Group" term-previous-prompt t] + ["Forward Output Group" term-next-prompt t] + ["Kill Current Output Group" term-kill-output t])) + map) + "Keymap for Term mode.") (defvar term-escape-char nil "Escape character for char sub-mode of term mode. Do not change it directly; use `term-set-escape-char' instead.") -(defvar term-pager-break-map nil) +(defvar term-pager-break-map + (let ((map (make-keymap))) + ;; (dotimes (i 128) + ;; (define-key map (make-string 1 i) 'term-send-raw)) + (define-key map "\e" (lookup-key (current-global-map) "\e")) + (define-key map "\C-x" (lookup-key (current-global-map) "\C-x")) + (define-key map "\C-u" (lookup-key (current-global-map) "\C-u")) + (define-key map " " 'term-pager-page) + (define-key map "\r" 'term-pager-line) + (define-key map "?" 'term-pager-help) + (define-key map "h" 'term-pager-help) + (define-key map "b" 'term-pager-back-page) + (define-key map "\177" 'term-pager-back-line) + (define-key map "q" 'term-pager-discard) + (define-key map "D" 'term-pager-disable) + (define-key map "<" 'term-pager-bob) + (define-key map ">" 'term-pager-eob) + map) + "Keymap used in Term pager mode.") (defvar term-ptyp t "True if communications via pty; false if by pipe. Buffer local. @@ -750,7 +720,6 @@ Buffer local variable.") ; assuming this is Emacs 19.20 or newer. (defvar term-pager-filter t) -(put 'term-replace-by-expanded-history 'menu-enable 'term-input-autoexpand) (put 'term-input-ring 'permanent-local t) (put 'term-input-ring-index 'permanent-local t) (put 'term-input-autoexpand 'permanent-local t) @@ -879,28 +848,6 @@ is buffer-local." :group 'term :type 'integer) -(defvar term-terminal-menu - (if (featurep 'xemacs) - '("Terminal" - [ "Character mode" term-char-mode (term-in-line-mode)] - [ "Line mode" term-line-mode (term-in-char-mode)] - [ "Enable paging" term-pager-toggle (not term-pager-count)] - [ "Disable paging" term-pager-toggle term-pager-count]) - (let ((map (make-sparse-keymap "Terminal"))) - (define-key map [terminal-pager-enable] - '(menu-item "Enable paging" term-fake-pager-enable - :help "Enable paging feature")) - (define-key map [terminal-pager-disable] - '(menu-item "Disable paging" term-fake-pager-disable - :help "Disable paging feature")) - (define-key map [terminal-char-mode] - '(menu-item "Character mode" term-char-mode - :help "Switch to char (raw) sub-mode of term mode")) - (define-key map [terminal-line-mode] - '(menu-item "Line mode" term-line-mode - :help "Switch to line (cooked) sub-mode of term mode")) - (cons "Terminal" map)))) - ;; Set up term-raw-map, etc. (defvar term-raw-map @@ -920,9 +867,7 @@ is buffer-local." (if (featurep 'xemacs) (define-key map [button2] 'term-mouse-paste) - (define-key map [mouse-2] 'term-mouse-paste) - (define-key map [menu-bar terminal] term-terminal-menu) - (define-key map [menu-bar signals] term-signals-menu)) + (define-key map [mouse-2] 'term-mouse-paste)) (define-key map [up] 'term-send-up) (define-key map [down] 'term-send-down) (define-key map [right] 'term-send-right) @@ -941,6 +886,46 @@ is buffer-local." map) "Keyboard map for sending characters directly to the inferior process.") +(easy-menu-define term-terminal-menu + (list term-mode-map term-raw-map term-pager-break-map) + "Terminal menu for Term mode." + '("Terminal" + ["Line mode" term-line-mode :active (term-in-char-mode) + :help "Switch to line (cooked) sub-mode of term mode"] + ["Character mode" term-char-mode :active (term-in-line-mode) + :help "Switch to char (raw) sub-mode of term mode"] + ["Paging" term-pager-toggle :style toggle :selected term-pager-count + :help "Toggle paging feature"])) + +(easy-menu-define term-signals-menu + (list term-mode-map term-raw-map term-pager-break-map) + "Signals menu for Term mode." + '("Signals" + ["BREAK" term-interrupt-subjob :active t + :help "Interrupt the current subjob"] + ["STOP" term-stop-subjob :active t :help "Stop the current subjob"] + ["CONT" term-continue-subjob :active t + :help "Send CONT signal to process buffer's process group"] + ["QUIT" term-quit-subjob :active t + :help "Send quit signal to the current subjob"] + ["KILL" term-kill-subjob :active t + :help "Send kill signal to the current subjob"] + ["EOF" term-send-eof :active t + :help "Send an EOF to the current buffer's process"])) + +(easy-menu-define term-pager-menu term-pager-break-map + "Menu for Term pager mode." + '("More pages?" + ["1 page forwards" term-pager-page t] + ["1 page backwards" term-pager-back-page t] + ["1 line backwards" term-pager-back-line t] + ["1 line forwards" term-pager-line t] + ["Goto to beginning" term-pager-bob t] + ["Goto to end" term-pager-eob t] + ["Discard remaining output" term-pager-discard t] + ["Disable paging" term-pager-toggle t] + ["Help" term-pager-help t])) + (defvar term-raw-escape-map (let ((map (make-sparse-keymap))) (set-keymap-parent map 'Control-X-prefix) @@ -1151,9 +1136,8 @@ Entry to this mode runs the hooks on `term-mode-hook'." (set (make-local-variable 'font-lock-defaults) '(nil t)) - (when (featurep 'xemacs) - (set-buffer-menubar - (append current-menubar (list term-terminal-menu)))) + (easy-menu-add term-terminal-menu) + (easy-menu-add term-signals-menu) (or term-input-ring (setq term-input-ring (make-ring term-input-ring-size))) (term-update-mode-line)) @@ -1291,6 +1275,8 @@ intervention from Emacs, except for the escape character (usually C-c)." (when (term-in-line-mode) (setq term-old-mode-map (current-local-map)) (use-local-map term-raw-map) + (easy-menu-add term-terminal-menu) + (easy-menu-add term-signals-menu) ;; Send existing partial line to inferior (without newline). (let ((pmark (process-mark (get-buffer-process (current-buffer)))) @@ -1315,8 +1301,31 @@ you type \\[term-send-input] which sends the current line to the inferior." (term-update-mode-line))) (defun term-update-mode-line () - (let ((term-mode (if (term-in-char-mode) "char" "line")) - (term-page (when (term-pager-enabled) " page")) + (let ((term-mode + (if (term-in-char-mode) + (propertize "char" + 'help-echo "mouse-1: Switch to line mode" + 'mouse-face 'mode-line-highlight + 'local-map + '(keymap + (mode-line keymap (down-mouse-1 . term-line-mode)))) + (propertize "line" + 'help-echo "mouse-1: Switch to char mode" + 'mouse-face 'mode-line-highlight + 'local-map + '(keymap + (mode-line keymap (down-mouse-1 . term-char-mode)))))) + (term-page + (when (term-pager-enabled) + (concat " " + (propertize + "page" + 'help-echo "mouse-1: Disable paging" + 'mouse-face 'mode-line-highlight + 'local-map + '(keymap + (mode-line keymap (down-mouse-1 . + term-pager-toggle))))))) (serial-item-speed) (serial-item-config) (proc (get-buffer-process (current-buffer)))) @@ -3463,54 +3472,13 @@ The top-most line is line 0." ;; The page is full, so enter "pager" mode, and wait for input. (defun term-process-pager () - (when (not term-pager-break-map) - (let* ((map (make-keymap)) - ;; (i 0) - tmp) - ;; (while (< i 128) - ;; (define-key map (make-string 1 i) 'term-send-raw) - ;; (setq i (1+ i))) - (define-key map "\e" - (lookup-key (current-global-map) "\e")) - (define-key map "\C-x" - (lookup-key (current-global-map) "\C-x")) - (define-key map "\C-u" - (lookup-key (current-global-map) "\C-u")) - (define-key map " " 'term-pager-page) - (define-key map "\r" 'term-pager-line) - (define-key map "?" 'term-pager-help) - (define-key map "h" 'term-pager-help) - (define-key map "b" 'term-pager-back-page) - (define-key map "\177" 'term-pager-back-line) - (define-key map "q" 'term-pager-discard) - (define-key map "D" 'term-pager-disable) - (define-key map "<" 'term-pager-bob) - (define-key map ">" 'term-pager-eob) - - ;; Add menu bar. - (unless (featurep 'xemacs) - (define-key map [menu-bar terminal] term-terminal-menu) - (define-key map [menu-bar signals] term-signals-menu) - (setq tmp (make-sparse-keymap "More pages?")) - (define-key tmp [help] '("Help" . term-pager-help)) - (define-key tmp [disable] - '("Disable paging" . term-fake-pager-disable)) - (define-key tmp [discard] - '("Discard remaining output" . term-pager-discard)) - (define-key tmp [eob] '("Goto to end" . term-pager-eob)) - (define-key tmp [bob] '("Goto to beginning" . term-pager-bob)) - (define-key tmp [line] '("1 line forwards" . term-pager-line)) - (define-key tmp [bline] '("1 line backwards" . term-pager-back-line)) - (define-key tmp [back] '("1 page backwards" . term-pager-back-page)) - (define-key tmp [page] '("1 page forwards" . term-pager-page)) - (define-key map [menu-bar page] (cons "More pages?" tmp)) - ) - - (setq term-pager-break-map map))) ;; (let ((process (get-buffer-process (current-buffer)))) ;; (stop-process process)) (setq term-pager-old-local-map (current-local-map)) (use-local-map term-pager-break-map) + (easy-menu-add term-terminal-menu) + (easy-menu-add term-signals-menu) + (easy-menu-add term-pager-menu) (make-local-variable 'term-old-mode-line-format) (setq term-old-mode-line-format mode-line-format) (setq mode-line-format @@ -3591,14 +3559,6 @@ The top-most line is line 0." (interactive) (if (term-pager-enabled) (term-pager-disable) (term-pager-enable))) -(unless (featurep 'xemacs) - (defalias 'term-fake-pager-enable 'term-pager-toggle) - (defalias 'term-fake-pager-disable 'term-pager-toggle) - (put 'term-char-mode 'menu-enable '(term-in-line-mode)) - (put 'term-line-mode 'menu-enable '(term-in-char-mode)) - (put 'term-fake-pager-enable 'menu-enable '(not term-pager-count)) - (put 'term-fake-pager-disable 'menu-enable 'term-pager-count)) - (defun term-pager-help () "Provide help on commands available in a terminal-emulator **MORE** break." (interactive) From d67d3afd3a4ebe1c879ac7f3f8287b274b18d3ad Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 1 Sep 2012 17:56:03 -0700 Subject: [PATCH 192/212] * lisp/simple.el (undo): Tweak message in undo-only case. Fixes: debbugs:12283 --- lisp/ChangeLog | 4 ++++ lisp/simple.el | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 42dda8f9e49..e849b7c02a8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-09-02 Glenn Morris + + * simple.el (undo): Tweak message in undo-only case. (Bug#12283) + 2012-09-01 Glenn Morris * term.el: Tidy up menu definitions. diff --git a/lisp/simple.el b/lisp/simple.el index 51eb572dc5c..b7a24f4f970 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1886,9 +1886,10 @@ as an argument limits undo to changes within the current region." ;; so, ask the user whether she wants to skip the redo/undo pair. (let ((equiv (gethash pending-undo-list undo-equiv-table))) (or (eq (selected-window) (minibuffer-window)) - (setq message (if undo-in-region - (if equiv "Redo in region!" "Undo in region!") - (if equiv "Redo!" "Undo!")))) + (setq message (format "%s%s!" + (if (or undo-no-redo (not equiv)) + "Undo" "Redo") + (if undo-in-region " in region" "")))) (when (and (consp equiv) undo-no-redo) ;; The equiv entry might point to another redo record if we have done ;; undo-redo-undo-redo-... so skip to the very last equiv. From 137e08a46c4d9d042e260e3e9f44f572773aea37 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Sun, 2 Sep 2012 04:00:47 +0200 Subject: [PATCH 193/212] nt/config.nt: Sync with autogen/config.in. (HAVE_EXECINFO_H, TERM_HEADER): New macros. --- nt/ChangeLog | 5 +++++ nt/config.nt | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/nt/ChangeLog b/nt/ChangeLog index 1085138e3f6..4ceb74ed0b5 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,8 @@ +2012-09-02 Juanma Barranquero + + * config.nt: Sync with autogen/config.in. + (HAVE_EXECINFO_H, TERM_HEADER): New macros. + 2012-09-01 Daniel Colascione * inc/ms-w32.h (TERM_HEADER): Add for refactoring diff --git a/nt/config.nt b/nt/config.nt index 34495928b92..7658275f2d6 100644 --- a/nt/config.nt +++ b/nt/config.nt @@ -364,6 +364,9 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if you have the `euidaccess' function. */ #undef HAVE_EUIDACCESS +/* Define to 1 if you have the header file. */ +#define HAVE_EXECINFO_H 1 + /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H @@ -1352,6 +1355,9 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if you use terminfo instead of termcap. */ #undef TERMINFO +/* Define to the header for the built-in window system. */ +#undef TERM_HEADER + /* Define to 1 if you can safely include both and . */ #define TIME_WITH_SYS_TIME 1 From 6c49a40bbad123ce3c7e07b097174abadd95e750 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Sun, 2 Sep 2012 04:22:33 +0200 Subject: [PATCH 194/212] src/makefile.w32-in: Update dependencies. (CCL_H, W32FONT_H): New macros. (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O)) ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O)) ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O)) ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O)) ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O)) ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update. --- src/ChangeLog | 10 ++++++++++ src/makefile.w32-in | 32 +++++++++++++++++++------------- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index e186b8af87f..095effcf3bd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2012-09-02 Juanma Barranquero + + * makefile.w32-in (CCL_H, W32FONT_H): New macros. + (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O)) + ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O)) + ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O)) + ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O)) + ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O)) + ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies. + 2012-09-01 Eli Zaretskii * w32uniscribe.c (uniscribe_shape): Handle correctly the case of diff --git a/src/makefile.w32-in b/src/makefile.w32-in index e5959e0b1a5..a8dcf5f2ae8 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in @@ -390,6 +390,7 @@ SYSTIME_H = $(SRC)/systime.h \ $(NT_INC)/sys/time.h \ $(GNU_LIB)/timespec.h ATIMER_H = $(SRC)/atimer.h \ + $(NT_INC)/stdbool.h \ $(SYSTIME_H) BLOCKINPUT_H = $(SRC)/blockinput.h \ $(ATIMER_H) @@ -401,6 +402,8 @@ CAREADLINKAT_H = $(GNU_LIB)/careadlinkat.h \ $(NT_INC)/unistd.h CHARACTER_H = $(SRC)/character.h \ $(GNU_LIB)/verify.h +CCL_H = $(SRC)/ccl.h \ + $(CHARACTER_H) CHARSET_H = $(SRC)/charset.h \ $(GNU_LIB)/verify.h CODING_H = $(SRC)/coding.h \ @@ -422,7 +425,7 @@ DISPEXTERN_H = $(SRC)/dispextern.h \ FILEMODE_H = $(GNU_LIB)/filemode.h \ $(NT_INC)/sys/stat.h FONT_H = $(SRC)/font.h \ - $(SRC)/ccl.h + $(CCL_H) FRAME_H = $(SRC)/frame.h \ $(DISPEXTERN_H) FTOASTR_H = $(GNU_LIB)/ftoastr.h \ @@ -469,6 +472,8 @@ SYSTTY_H = $(SRC)/systty.h \ $(NT_INC)/unistd.h TERMHOOKS_H = $(SRC)/termhooks.h \ $(SYSTIME_H) +W32FONT_H = $(SRC)/w32font.h \ + $(FONT_H) W32TERM_H = $(SRC)/w32term.h \ $(W32GUI_H) WINDOW_H = $(SRC)/window.h \ @@ -480,7 +485,6 @@ $(BLD)/alloc.$(O) : \ $(SRC)/syssignal.h \ $(SRC)/w32.h \ $(NT_INC)/unistd.h \ - $(GNU_LIB)/execinfo.h \ $(GNU_LIB)/verify.h \ $(BLOCKINPUT_H) \ $(BUFFER_H) \ @@ -554,7 +558,6 @@ $(BLD)/callint.$(O) : \ $(BLD)/callproc.$(O) : \ $(SRC)/callproc.c \ - $(SRC)/ccl.h \ $(SRC)/commands.h \ $(SRC)/composite.h \ $(SRC)/epaths.h \ @@ -564,6 +567,7 @@ $(BLD)/callproc.$(O) : \ $(NT_INC)/unistd.h \ $(BLOCKINPUT_H) \ $(BUFFER_H) \ + $(CCL_H) \ $(CHARACTER_H) \ $(CODING_H) \ $(CONFIG_H) \ @@ -603,7 +607,7 @@ $(BLD)/category.$(O) : \ $(BLD)/ccl.$(O) : \ $(SRC)/ccl.c \ - $(SRC)/ccl.h \ + $(CCL_H) \ $(CHARACTER_H) \ $(CHARSET_H) \ $(CODING_H) \ @@ -635,7 +639,7 @@ $(BLD)/charset.$(O) : \ $(BLD)/chartab.$(O) : \ $(SRC)/chartab.c \ - $(SRC)/ccl.h \ + $(CCL_H) \ $(CHARACTER_H) \ $(CHARSET_H) \ $(CONFIG_H) \ @@ -657,9 +661,9 @@ $(BLD)/cmds.$(O) : \ $(BLD)/coding.$(O) : \ $(SRC)/coding.c \ - $(SRC)/ccl.h \ $(SRC)/composite.h \ $(BUFFER_H) \ + $(CCL_H) \ $(CHARACTER_H) \ $(CHARSET_H) \ $(CODING_H) \ @@ -803,6 +807,7 @@ $(BLD)/emacs.$(O) : \ $(PROCESS_H) \ $(SYSTTY_H) \ $(TERMHOOKS_H) \ + $(W32TERM_H) \ $(WINDOW_H) $(BLD)/eval.$(O) : \ @@ -898,10 +903,10 @@ $(BLD)/font.$(O) : \ $(BLD)/fontset.$(O) : \ $(SRC)/fontset.c \ - $(SRC)/ccl.h \ $(SRC)/fontset.h \ $(BLOCKINPUT_H) \ $(BUFFER_H) \ + $(CCL_H) \ $(CHARACTER_H) \ $(CHARSET_H) \ $(CONFIG_H) \ @@ -1269,6 +1274,7 @@ $(BLD)/process.$(O) : \ $(SYSTIME_H) \ $(SYSTTY_H) \ $(TERMHOOKS_H) \ + $(W32TERM_H) \ $(WINDOW_H) $(BLD)/ralloc.$(O) : \ @@ -1524,14 +1530,13 @@ $(BLD)/xfaces.$(O) : \ $(BLD)/w32fns.$(O) : \ $(SRC)/w32fns.c \ - $(SRC)/ccl.h \ $(SRC)/epaths.h \ $(SRC)/fontset.h \ $(SRC)/w32.h \ - $(SRC)/w32font.h \ $(SRC)/w32heap.h \ $(BLOCKINPUT_H) \ $(BUFFER_H) \ + $(CCL_H) \ $(CHARACTER_H) \ $(CHARSET_H) \ $(CODING_H) \ @@ -1544,6 +1549,7 @@ $(BLD)/w32fns.$(O) : \ $(LISP_H) \ $(SYSTIME_H) \ $(TERMHOOKS_H) \ + $(W32FONT_H) \ $(W32TERM_H) \ $(WINDOW_H) @@ -1568,18 +1574,17 @@ $(BLD)/w32menu.$(O) : \ $(BLD)/w32term.$(O) : \ $(SRC)/w32term.c \ - $(SRC)/ccl.h \ $(SRC)/disptab.h \ $(SRC)/fontset.h \ $(SRC)/keymap.h \ $(SRC)/termchar.h \ $(SRC)/termopts.h \ - $(SRC)/w32font.h \ $(SRC)/w32heap.h \ $(NT_INC)/sys/stat.h \ $(ATIMER_H) \ $(BLOCKINPUT_H) \ $(BUFFER_H) \ + $(CCL_H) \ $(CHARACTER_H) \ $(CHARSET_H) \ $(CODING_H) \ @@ -1594,6 +1599,7 @@ $(BLD)/w32term.$(O) : \ $(SYSTIME_H) \ $(SYSTTY_H) \ $(TERMHOOKS_H) \ + $(W32FONT_H) \ $(W32TERM_H) \ $(WINDOW_H) @@ -1629,7 +1635,6 @@ $(BLD)/w32xfns.$(O) : \ $(BLD)/w32font.$(O) : \ $(SRC)/w32font.c \ $(SRC)/fontset.h \ - $(SRC)/w32font.h \ $(CHARACTER_H) \ $(CHARSET_H) \ $(CODING_H) \ @@ -1638,13 +1643,13 @@ $(BLD)/w32font.$(O) : \ $(FONT_H) \ $(FRAME_H) \ $(LISP_H) \ + $(W32FONT_H) \ $(W32TERM_H) $(BLD)/w32uniscribe.$(O) : \ $(SRC)/w32uniscribe.c \ $(SRC)/composite.h \ $(SRC)/fontset.h \ - $(SRC)/w32font.h \ $(CHARACTER_H) \ $(CHARSET_H) \ $(CONFIG_H) \ @@ -1652,6 +1657,7 @@ $(BLD)/w32uniscribe.$(O) : \ $(FONT_H) \ $(FRAME_H) \ $(LISP_H) \ + $(W32FONT_H) \ $(W32TERM_H) # Each object file depends on stamp_BLD, because in parallel builds we must From a828f05faf344574718d081e54a519a602e3ab30 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 2 Sep 2012 10:30:06 +0800 Subject: [PATCH 195/212] Expand on NEWS entry about deletion of `z' from special-mode-map. --- etc/NEWS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index 58298a9a437..1dc8db5fa04 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -166,7 +166,8 @@ The PCL-CVS commands are still available via the keyboard. * Editing Changes in Emacs 24.3 ** The `z' key no longer has a binding in most special modes. -It used to kill the current buffer. +It used to be bound to `kill-this-buffer', but `z' is too easy to +accidentally type. ** New option `yank-handled-properties' allows processing of text properties on yanked text, in more ways that are more general than From af7dda05cc3be33dd2039a116386a638898ef220 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 2 Sep 2012 10:47:02 +0800 Subject: [PATCH 196/212] * dired.el (dired-mode-map): Menu string fixes. Fixes: debbugs:11616 --- lisp/ChangeLog | 4 ++++ lisp/dired.el | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e849b7c02a8..d018e455357 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-09-02 Chong Yidong + + * dired.el (dired-mode-map): Menu string fixes (Bug#11616). + 2012-09-02 Glenn Morris * simple.el (undo): Tweak message in undo-only case. (Bug#12283) diff --git a/lisp/dired.el b/lisp/dired.el index b82b7781e39..5ae0e026172 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1739,7 +1739,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST." (define-key map [menu-bar operate epa-dired-do-decrypt] - '(menu-item "Decrypt" epa-dired-do-decrypt + '(menu-item "Decrypt..." epa-dired-do-decrypt :help "Decrypt file at cursor")) (define-key map @@ -1749,12 +1749,12 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST." (define-key map [menu-bar operate epa-dired-do-sign] - '(menu-item "Sign" epa-dired-do-sign + '(menu-item "Sign..." epa-dired-do-sign :help "Create digital signature of file at cursor")) (define-key map [menu-bar operate epa-dired-do-encrypt] - '(menu-item "Encrypt" epa-dired-do-encrypt + '(menu-item "Encrypt..." epa-dired-do-encrypt :help "Encrypt file at cursor")) (define-key map [menu-bar operate dashes-3] From 48c948de78cfa6290ca79ab34b7a4d0cb0edfb69 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 2 Sep 2012 11:50:29 +0800 Subject: [PATCH 197/212] * keymap.c (push_key_description): Print M-TAB as C-M-i. Fixes: debbugs:11758 --- src/ChangeLog | 5 +++++ src/keymap.c | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 095effcf3bd..cb1ef00a542 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-09-02 Chong Yidong + + * keymap.c (push_key_description): Print M-TAB as C-M-i + (Bug#11758). + 2012-09-02 Juanma Barranquero * makefile.w32-in (CCL_H, W32FONT_H): New macros. diff --git a/src/keymap.c b/src/keymap.c index 4031091501c..85c384b8180 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -2157,7 +2157,7 @@ The `kbd' macro is an approximate inverse of this. */) char * push_key_description (EMACS_INT ch, char *p, int force_multibyte) { - int c, c2; + int c, c2, tab_as_ci; /* Clear all the meaningless bits above the meta bit. */ c = ch & (meta_modifier | ~ - meta_modifier); @@ -2171,6 +2171,8 @@ push_key_description (EMACS_INT ch, char *p, int force_multibyte) return p; } + tab_as_ci = (c2 == '\t' && (c & meta_modifier)); + if (c & alt_modifier) { *p++ = 'A'; @@ -2178,7 +2180,8 @@ push_key_description (EMACS_INT ch, char *p, int force_multibyte) c -= alt_modifier; } if ((c & ctrl_modifier) != 0 - || (c2 < ' ' && c2 != 27 && c2 != '\t' && c2 != Ctl ('M'))) + || (c2 < ' ' && c2 != 27 && c2 != '\t' && c2 != Ctl ('M')) + || tab_as_ci) { *p++ = 'C'; *p++ = '-'; @@ -2216,6 +2219,10 @@ push_key_description (EMACS_INT ch, char *p, int force_multibyte) *p++ = 'S'; *p++ = 'C'; } + else if (tab_as_ci) + { + *p++ = 'i'; + } else if (c == '\t') { *p++ = 'T'; From 6a787d9a30720e20053909e71d8b7bc313d37a94 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 2 Sep 2012 12:47:28 +0800 Subject: [PATCH 198/212] Recommand against save-window-excursion in Lisp manual. * windows.texi (Window Configurations): Recommend against using save-window-excursion. * control.texi (Catch and Throw): * positions.texi (Excursions): Don't mention it. Fixes: debbugs:12075 --- doc/lispref/ChangeLog | 8 ++++++ doc/lispref/control.texi | 14 ++++------ doc/lispref/positions.texi | 3 -- doc/lispref/windows.texi | 57 ++++++++++++-------------------------- 4 files changed, 32 insertions(+), 50 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 30169d6b7a9..b0156e5ac7e 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,11 @@ +2012-09-02 Chong Yidong + + * windows.texi (Window Configurations): Recommend against using + save-window-excursion (Bug#12075). + + * control.texi (Catch and Throw): + * positions.texi (Excursions): Don't mention it. + 2012-09-01 Paul Eggert Better seed support for (random). diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index 07d2d0d993c..25a7655b7b8 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi @@ -556,16 +556,14 @@ the @code{catch} in @code{foo-outer} specifies the same symbol, so that @code{catch} in between). Executing @code{throw} exits all Lisp constructs up to the matching -@code{catch}, including function calls. When binding constructs such as -@code{let} or function calls are exited in this way, the bindings are -unbound, just as they are when these constructs exit normally +@code{catch}, including function calls. When binding constructs such +as @code{let} or function calls are exited in this way, the bindings +are unbound, just as they are when these constructs exit normally (@pxref{Local Variables}). Likewise, @code{throw} restores the buffer and position saved by @code{save-excursion} (@pxref{Excursions}), and -the narrowing status saved by @code{save-restriction} and the window -selection saved by @code{save-window-excursion} (@pxref{Window -Configurations}). It also runs any cleanups established with the -@code{unwind-protect} special form when it exits that form -(@pxref{Cleanups}). +the narrowing status saved by @code{save-restriction}. It also runs +any cleanups established with the @code{unwind-protect} special form +when it exits that form (@pxref{Cleanups}). The @code{throw} need not appear lexically within the @code{catch} that it jumps to. It can equally well be called from another function diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi index a59a99d124c..a0c65319850 100644 --- a/doc/lispref/positions.texi +++ b/doc/lispref/positions.texi @@ -850,9 +850,6 @@ after setting the desired current buffer, as in the following example: @cindex window excursions Likewise, @code{save-excursion} does not restore window-buffer correspondences altered by functions such as @code{switch-to-buffer}. -One way to restore these correspondences, and the selected window, is to -use @code{save-window-excursion} inside @code{save-excursion} -(@pxref{Window Configurations}). @strong{Warning:} Ordinary insertion of text adjacent to the saved point value relocates the saved value, just as it relocates all diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index ba2a944215d..5fe007ba02d 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -3153,42 +3153,21 @@ as @code{save-window-excursion}: @end defun @defmac save-window-excursion forms@dots{} -This special form records the window configuration, executes @var{forms} -in sequence, then restores the earlier window configuration. The window -configuration includes, for each window, the value of point and the -portion of the buffer that is visible. It also includes the choice of -selected window. However, it does not include the value of point in -the current buffer; use @code{save-excursion} also, if you wish to -preserve that. +This macro records the window configuration of the selected frame, +executes @var{forms} in sequence, then restores the earlier window +configuration. The return value is the value of the final form in +@var{forms}. -Don't use this construct when @code{save-selected-window} is sufficient. +Most Lisp code should not use this macro; @code{save-selected-window} +is typically sufficient. In particular, this macro cannot reliably +prevent the code in @var{forms} from opening new windows, because new +windows might be opened in other frames (@pxref{Choosing Window}), and +@code{save-window-excursion} only saves and restores the window +configuration on the current frame. -Exit from @code{save-window-excursion} always triggers execution of -@code{window-size-change-functions}. (It doesn't know how to tell -whether the restored configuration actually differs from the one in -effect at the end of the @var{forms}.) - -The return value is the value of the final form in @var{forms}. -For example: - -@example -@group -(split-window) - @result{} # -@end group -@group -(setq w (selected-window)) - @result{} # -@end group -@group -(save-window-excursion - (delete-other-windows w) - (switch-to-buffer "foo") - 'do-something) - @result{} do-something - ;; @r{The screen is now split again.} -@end group -@end example +Do not use this macro in @code{window-size-change-functions}; exiting +the macro triggers execution of @code{window-size-change-functions}, +leading to an endless loop. @end defmac @defun window-configuration-p object @@ -3424,11 +3403,11 @@ Creating or deleting windows counts as a size change, and therefore causes these functions to be called. Changing the frame size also counts, because it changes the sizes of the existing windows. -It is not a good idea to use @code{save-window-excursion} (@pxref{Window -Configurations}) in these functions, because that always counts as a -size change, and it would cause these functions to be called over and -over. In most cases, @code{save-selected-window} (@pxref{Selecting -Windows}) is what you need here. +You may use @code{save-selected-window} in these functions +(@pxref{Selecting Windows}). However, do not use +@code{save-window-excursion} (@pxref{Window Configurations}); exiting +that macro counts as a size change, which would cause these functions +to be called over and over. @end defvar @defvar window-configuration-change-hook From a08d4ba773a70961d153bf213db68dfcc5a50b01 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 2 Sep 2012 00:10:10 -0700 Subject: [PATCH 199/212] * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean. * doc.c (read_bytecode_char, get_doc_string, reread_doc_file) (Fdocumentation, Fdocumentation_property, Fsnarf_documentation) (Fsubstitute_command_keys): * editfns.c (region_limit, find_field, Fconstrain_to_field) (save_excursion_save, save_excursion_restore) (disassemble_lisp_time, decode_time_components, emacs_nmemftime) (format_time_string, general_insert_function) (make_buffer_string, make_buffer_string_both) (Fsubst_char_in_region, Ftranslate_region_internal, Fformat): * insdel.c (check_markers, gap_left, adjust_markers_for_insert) (copy_text, insert_1, insert_1_both, insert_from_string) (insert_from_string_before_markers, insert_from_string_1) (insert_from_buffer, insert_from_buffer_1, replace_range) (replace_range_2, del_range_1, del_range_byte, del_range_both) (del_range_2, modify_region): * intervals.c (intervals_equal, balance_possible_root_interval) (adjust_intervals_for_insertion, merge_properties_sticky) (graft_intervals_into_buffer, lookup_char_property) (adjust_for_invis_intang, set_point_both) (get_property_and_range, compare_string_intervals) (set_intervals_multibyte_1, set_intervals_multibyte): * keyboard.c (decode_timer): Use bool for boolean. * intervals.h, lisp.h, systime.h: Reflect above API changes. * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans. --- src/ChangeLog | 29 ++++++++++++++++ src/doc.c | 39 ++++++++++----------- src/editfns.c | 91 +++++++++++++++++++++++++------------------------ src/insdel.c | 72 ++++++++++++++++++-------------------- src/intervals.c | 58 +++++++++++++++---------------- src/intervals.h | 14 ++++---- src/keyboard.c | 7 ++-- src/lisp.h | 34 +++++++++--------- src/systime.h | 4 +-- 9 files changed, 184 insertions(+), 164 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index cb1ef00a542..0bcfa6c85f6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,32 @@ +2012-09-02 Paul Eggert + + * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean. + * doc.c (read_bytecode_char, get_doc_string, reread_doc_file) + (Fdocumentation, Fdocumentation_property, Fsnarf_documentation) + (Fsubstitute_command_keys): + * editfns.c (region_limit, find_field, Fconstrain_to_field) + (save_excursion_save, save_excursion_restore) + (disassemble_lisp_time, decode_time_components, emacs_nmemftime) + (format_time_string, general_insert_function) + (make_buffer_string, make_buffer_string_both) + (Fsubst_char_in_region, Ftranslate_region_internal, Fformat): + * insdel.c (check_markers, gap_left, adjust_markers_for_insert) + (copy_text, insert_1, insert_1_both, insert_from_string) + (insert_from_string_before_markers, insert_from_string_1) + (insert_from_buffer, insert_from_buffer_1, replace_range) + (replace_range_2, del_range_1, del_range_byte, del_range_both) + (del_range_2, modify_region): + * intervals.c (intervals_equal, balance_possible_root_interval) + (adjust_intervals_for_insertion, merge_properties_sticky) + (graft_intervals_into_buffer, lookup_char_property) + (adjust_for_invis_intang, set_point_both) + (get_property_and_range, compare_string_intervals) + (set_intervals_multibyte_1, set_intervals_multibyte): + * keyboard.c (decode_timer): + Use bool for boolean. + * intervals.h, lisp.h, systime.h: Reflect above API changes. + * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans. + 2012-09-02 Chong Yidong * keymap.c (push_key_description): Print M-TAB as C-M-i diff --git a/src/doc.c b/src/doc.c index ed311d918d7..b4eadfff875 100644 --- a/src/doc.c +++ b/src/doc.c @@ -48,7 +48,7 @@ static unsigned char *read_bytecode_pointer; If UNREADFLAG is 1, we unread a byte. */ int -read_bytecode_char (int unreadflag) +read_bytecode_char (bool unreadflag) { if (unreadflag) { @@ -70,20 +70,18 @@ read_bytecode_char (int unreadflag) (e.g. because the file has been modified and the location is stale), return nil. - If UNIBYTE is nonzero, always make a unibyte string. + If UNIBYTE, always make a unibyte string. - If DEFINITION is nonzero, assume this is for reading + If DEFINITION, assume this is for reading a dynamic function definition; convert the bytestring and the constants vector with appropriate byte handling, and return a cons cell. */ Lisp_Object -get_doc_string (Lisp_Object filepos, int unibyte, int definition) +get_doc_string (Lisp_Object filepos, bool unibyte, bool definition) { - char *from, *to; - register int fd; - register char *name; - register char *p, *p1; + char *from, *to, *name, *p, *p1; + int fd; ptrdiff_t minsize; int offset; EMACS_INT position; @@ -302,7 +300,7 @@ read_doc_string (Lisp_Object filepos) return get_doc_string (filepos, 0, 1); } -static int +static bool reread_doc_file (Lisp_Object file) { #if 0 @@ -335,7 +333,7 @@ string is passed through `substitute-command-keys'. */) Lisp_Object fun; Lisp_Object funcar; Lisp_Object doc; - int try_reload = 1; + bool try_reload = 1; documentation: @@ -467,7 +465,7 @@ This differs from `get' in that it can refer to strings stored in the aren't strings. */) (Lisp_Object symbol, Lisp_Object prop, Lisp_Object raw) { - int try_reload = 1; + bool try_reload = 1; Lisp_Object tem; documentation_property: @@ -562,12 +560,11 @@ the same file name is found in the `doc-directory'. */) { int fd; char buf[1024 + 1]; - register int filled; - register EMACS_INT pos; - register char *p; + int filled; + EMACS_INT pos; Lisp_Object sym; - char *name; - int skip_file = 0; + char *p, *name; + bool skip_file = 0; CHECK_STRING (filename); @@ -722,9 +719,9 @@ Otherwise, return a new string, without any text properties. */) (Lisp_Object string) { char *buf; - int changed = 0; - register unsigned char *strp; - register char *bufp; + bool changed = 0; + unsigned char *strp; + char *bufp; ptrdiff_t idx; ptrdiff_t bsize; Lisp_Object tem; @@ -733,7 +730,7 @@ Otherwise, return a new string, without any text properties. */) ptrdiff_t length, length_byte; Lisp_Object name; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; - int multibyte; + bool multibyte; ptrdiff_t nchars; if (NILP (string)) @@ -787,7 +784,7 @@ Otherwise, return a new string, without any text properties. */) else if (strp[0] == '\\' && strp[1] == '[') { ptrdiff_t start_idx; - int follow_remap = 1; + bool follow_remap = 1; changed = 1; strp += 2; /* skip \[ */ diff --git a/src/editfns.c b/src/editfns.c index 7b451e4e443..a14e043c1bf 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -65,7 +65,7 @@ extern Lisp_Object w32_get_internal_run_time (void); #endif static Lisp_Object format_time_string (char const *, ptrdiff_t, EMACS_TIME, - int, struct tm *); + bool, struct tm *); static int tm_diff (struct tm *, struct tm *); static void update_buffer_properties (ptrdiff_t, ptrdiff_t); @@ -246,11 +246,11 @@ The return value is POSITION. */) /* Return the start or end position of the region. - BEGINNINGP non-zero means return the start. + BEGINNINGP means return the start. If there is no region active, signal an error. */ static Lisp_Object -region_limit (int beginningp) +region_limit (bool beginningp) { Lisp_Object m; @@ -264,7 +264,7 @@ region_limit (int beginningp) error ("The mark is not set now, so there is no region"); /* Clip to the current narrowing (bug#11770). */ - return make_number ((PT < XFASTINT (m)) == (beginningp != 0) + return make_number ((PT < XFASTINT (m)) == beginningp ? PT : clip_to_bounds (BEGV, XFASTINT (m), ZV)); } @@ -435,12 +435,12 @@ get_pos_property (Lisp_Object position, register Lisp_Object prop, Lisp_Object o BEG_LIMIT and END_LIMIT serve to limit the ranged of the returned results; they do not effect boundary behavior. - If MERGE_AT_BOUNDARY is nonzero, then if POS is at the very first + If MERGE_AT_BOUNDARY is non-nil, then if POS is at the very first position of a field, then the beginning of the previous field is returned instead of the beginning of POS's field (since the end of a field is actually also the beginning of the next input field, this behavior is sometimes useful). Additionally in the MERGE_AT_BOUNDARY - true case, if two fields are separated by a field with the special + non-nil case, if two fields are separated by a field with the special value `boundary', and POS lies within it, then the two separated fields are considered to be adjacent, and POS between them, when finding the beginning and ending of the "merged" field. @@ -455,10 +455,10 @@ find_field (Lisp_Object pos, Lisp_Object merge_at_boundary, { /* Fields right before and after the point. */ Lisp_Object before_field, after_field; - /* 1 if POS counts as the start of a field. */ - int at_field_start = 0; - /* 1 if POS counts as the end of a field. */ - int at_field_end = 0; + /* True if POS counts as the start of a field. */ + bool at_field_start = 0; + /* True if POS counts as the end of a field. */ + bool at_field_end = 0; if (NILP (pos)) XSETFASTINT (pos, PT); @@ -502,19 +502,19 @@ find_field (Lisp_Object pos, Lisp_Object merge_at_boundary, xxxx.yyyy - In this situation, if merge_at_boundary is true, we consider the + In this situation, if merge_at_boundary is non-nil, consider the `x' and `y' fields as forming one big merged field, and so the end of the field is the end of `y'. However, if `x' and `y' are separated by a special `boundary' field - (a field with a `field' char-property of 'boundary), then we ignore + (a field with a `field' char-property of 'boundary), then ignore this special field when merging adjacent fields. Here's the same situation, but with a `boundary' field between the `x' and `y' fields: xxx.BBBByyyy Here, if point is at the end of `x', the beginning of `y', or - anywhere in-between (within the `boundary' field), we merge all + anywhere in-between (within the `boundary' field), merge all three fields and consider the beginning as being the beginning of the `x' field, and the end as being the end of the `y' field. */ @@ -658,7 +658,7 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */) { /* If non-zero, then the original point, before re-positioning. */ ptrdiff_t orig_point = 0; - int fwd; + bool fwd; Lisp_Object prev_old, prev_new; if (NILP (new_pos)) @@ -816,8 +816,8 @@ This function does not move point. */) Lisp_Object save_excursion_save (void) { - int visible = (XBUFFER (XWINDOW (selected_window)->buffer) - == current_buffer); + bool visible = (XBUFFER (XWINDOW (selected_window)->buffer) + == current_buffer); return Fcons (Fpoint_marker (), Fcons (Fcopy_marker (BVAR (current_buffer, mark), Qnil), @@ -831,7 +831,7 @@ save_excursion_restore (Lisp_Object info) { Lisp_Object tem, tem1, omark, nmark; struct gcpro gcpro1, gcpro2, gcpro3; - int visible_p; + bool visible_p; tem = Fmarker_buffer (XCAR (info)); /* If buffer being returned to is now deleted, avoid error */ @@ -1467,8 +1467,8 @@ make_lisp_time (EMACS_TIME t) /* Decode a Lisp list SPECIFIED_TIME that represents a time. Set *PHIGH, *PLOW, *PUSEC, *PPSEC to its parts; do not check their values. - Return nonzero if successful. */ -static int + Return true if successful. */ +static bool disassemble_lisp_time (Lisp_Object specified_time, Lisp_Object *phigh, Lisp_Object *plow, Lisp_Object *pusec, Lisp_Object *ppsec) @@ -1511,8 +1511,8 @@ disassemble_lisp_time (Lisp_Object specified_time, Lisp_Object *phigh, If *DRESULT is not null, store into *DRESULT the number of seconds since the start of the POSIX Epoch. - Return nonzero if successful. */ -int + Return true if successful. */ +bool decode_time_components (Lisp_Object high, Lisp_Object low, Lisp_Object usec, Lisp_Object psec, EMACS_TIME *result, double *dresult) @@ -1632,7 +1632,7 @@ or (if you need time as a string) `format-time-string'. */) /* Write information into buffer S of size MAXSIZE, according to the FORMAT of length FORMAT_LEN, using time information taken from *TP. - Default to Universal Time if UT is nonzero, local time otherwise. + Default to Universal Time if UT, local time otherwise. Use NS as the number of nanoseconds in the %N directive. Return the number of bytes written, not including the terminating '\0'. If S is NULL, nothing will be written anywhere; so to @@ -1643,7 +1643,7 @@ or (if you need time as a string) `format-time-string'. */) bytes in FORMAT and it does not support nanoseconds. */ static size_t emacs_nmemftime (char *s, size_t maxsize, const char *format, - size_t format_len, const struct tm *tp, int ut, int ns) + size_t format_len, const struct tm *tp, bool ut, int ns) { size_t total = 0; @@ -1748,7 +1748,7 @@ usage: (format-time-string FORMAT-STRING &optional TIME UNIVERSAL) */) static Lisp_Object format_time_string (char const *format, ptrdiff_t formatlen, - EMACS_TIME t, int ut, struct tm *tmp) + EMACS_TIME t, bool ut, struct tm *tmp) { char buffer[4000]; char *buf = buffer; @@ -2228,11 +2228,11 @@ general_insert_function (void (*insert_func) (const char *, ptrdiff_t), void (*insert_from_string_func) (Lisp_Object, ptrdiff_t, ptrdiff_t, - ptrdiff_t, ptrdiff_t, int), - int inherit, ptrdiff_t nargs, Lisp_Object *args) + ptrdiff_t, ptrdiff_t, bool), + bool inherit, ptrdiff_t nargs, Lisp_Object *args) { ptrdiff_t argnum; - register Lisp_Object val; + Lisp_Object val; for (argnum = 0; argnum < nargs; argnum++) { @@ -2455,7 +2455,7 @@ from adjoining text, if those properties are sticky. */) /* Return a Lisp_String containing the text of the current buffer from START to END. If text properties are in use and the current buffer has properties in the range specified, the resulting string will also - have them, if PROPS is nonzero. + have them, if PROPS is true. We don't want to use plain old make_string here, because it calls make_uninit_string, which can cause the buffer arena to be @@ -2466,7 +2466,7 @@ from adjoining text, if those properties are sticky. */) buffer substrings. */ Lisp_Object -make_buffer_string (ptrdiff_t start, ptrdiff_t end, int props) +make_buffer_string (ptrdiff_t start, ptrdiff_t end, bool props) { ptrdiff_t start_byte = CHAR_TO_BYTE (start); ptrdiff_t end_byte = CHAR_TO_BYTE (end); @@ -2479,7 +2479,7 @@ make_buffer_string (ptrdiff_t start, ptrdiff_t end, int props) If text properties are in use and the current buffer has properties in the range specified, the resulting string will also - have them, if PROPS is nonzero. + have them, if PROPS is true. We don't want to use plain old make_string here, because it calls make_uninit_string, which can cause the buffer arena to be @@ -2491,7 +2491,7 @@ make_buffer_string (ptrdiff_t start, ptrdiff_t end, int props) Lisp_Object make_buffer_string_both (ptrdiff_t start, ptrdiff_t start_byte, - ptrdiff_t end, ptrdiff_t end_byte, int props) + ptrdiff_t end, ptrdiff_t end_byte, bool props) { Lisp_Object result, tem, tem1; @@ -2842,7 +2842,8 @@ Both characters must have the same length of multi-byte form. */) #define COMBINING_BOTH (COMBINING_BEFORE | COMBINING_AFTER) int maybe_byte_combining = COMBINING_NO; ptrdiff_t last_changed = 0; - int multibyte_p = !NILP (BVAR (current_buffer, enable_multibyte_characters)); + bool multibyte_p + = !NILP (BVAR (current_buffer, enable_multibyte_characters)); int fromc, toc; restart: @@ -3078,8 +3079,8 @@ It returns the number of characters changed. */) int cnt; /* Number of changes made. */ ptrdiff_t size; /* Size of translate table. */ ptrdiff_t pos, pos_byte, end_pos; - int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); - int string_multibyte IF_LINT (= 0); + bool multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); + bool string_multibyte IF_LINT (= 0); validate_region (&start, &end); if (CHAR_TABLE_P (table)) @@ -3650,9 +3651,9 @@ usage: (format STRING &rest OBJECTS) */) byte combining problem, i.e., a byte may be combined with a multibyte character of the previous string. This flag tells if we must consider such a situation or not. */ - int maybe_combine_byte; + bool maybe_combine_byte; Lisp_Object val; - int arg_intervals = 0; + bool arg_intervals = 0; USE_SAFE_ALLOCA; /* discarded[I] is 1 if byte I of the format @@ -3668,8 +3669,8 @@ usage: (format STRING &rest OBJECTS) */) struct info { ptrdiff_t start, end; - int converted_to_string; - int intervals; + unsigned converted_to_string : 1; + unsigned intervals : 1; } *info = 0; /* It should not be necessary to GCPRO ARGS, because @@ -3746,13 +3747,13 @@ usage: (format STRING &rest OBJECTS) */) digits to print after the '.' for floats, or the max. number of chars to print from a string. */ - int minus_flag = 0; - int plus_flag = 0; - int space_flag = 0; - int sharp_flag = 0; - int zero_flag = 0; + bool minus_flag = 0; + bool plus_flag = 0; + bool space_flag = 0; + bool sharp_flag = 0; + bool zero_flag = 0; ptrdiff_t field_width; - int precision_given; + bool precision_given; uintmax_t precision = UINTMAX_MAX; char *num_end; char conversion; @@ -4132,7 +4133,7 @@ usage: (format STRING &rest OBJECTS) */) char *src = sprintf_buf; char src0 = src[0]; int exponent_bytes = 0; - int signedp = src0 == '-' || src0 == '+' || src0 == ' '; + bool signedp = src0 == '-' || src0 == '+' || src0 == ' '; int significand_bytes; if (zero_flag && ((src[signedp] >= '0' && src[signedp] <= '9') diff --git a/src/insdel.c b/src/insdel.c index 8cb98566085..da258c19a1e 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -31,19 +31,15 @@ along with GNU Emacs. If not, see . */ #include "blockinput.h" #include "region-cache.h" -static void insert_from_string_1 (Lisp_Object string, - ptrdiff_t pos, ptrdiff_t pos_byte, - ptrdiff_t nchars, ptrdiff_t nbytes, - int inherit, int before_markers); -static void insert_from_buffer_1 (struct buffer *buf, - ptrdiff_t from, ptrdiff_t nchars, - int inherit); -static void gap_left (ptrdiff_t charpos, ptrdiff_t bytepos, int newgap); -static void gap_right (ptrdiff_t charpos, ptrdiff_t bytepos); +static void insert_from_string_1 (Lisp_Object, ptrdiff_t, ptrdiff_t, ptrdiff_t, + ptrdiff_t, bool, bool); +static void insert_from_buffer_1 (struct buffer *, ptrdiff_t, ptrdiff_t, bool); +static void gap_left (ptrdiff_t, ptrdiff_t, bool); +static void gap_right (ptrdiff_t, ptrdiff_t); /* List of elements of the form (BEG-UNCHANGED END-UNCHANGED CHANGE-AMOUNT) describing changes which happened while combine_after_change_calls - was nonzero. We use this to decide how to call them + was non-nil. We use this to decide how to call them once the deferral ends. In each element. @@ -67,8 +63,8 @@ static void signal_before_change (ptrdiff_t, ptrdiff_t, ptrdiff_t *); static void check_markers (void) { - register struct Lisp_Marker *tail; - int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); + struct Lisp_Marker *tail; + bool multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); for (tail = BUF_MARKERS (current_buffer); tail; tail = tail->next) { @@ -113,13 +109,13 @@ move_gap_both (ptrdiff_t charpos, ptrdiff_t bytepos) /* Move the gap to a position less than the current GPT. BYTEPOS describes the new position as a byte position, and CHARPOS is the corresponding char position. - If NEWGAP is nonzero, then don't update beg_unchanged and end_unchanged. */ + If NEWGAP, then don't update beg_unchanged and end_unchanged. */ static void -gap_left (ptrdiff_t charpos, ptrdiff_t bytepos, int newgap) +gap_left (ptrdiff_t charpos, ptrdiff_t bytepos, bool newgap) { - register unsigned char *to, *from; - register ptrdiff_t i; + unsigned char *to, *from; + ptrdiff_t i; ptrdiff_t new_s1; if (!newgap) @@ -287,10 +283,10 @@ adjust_markers_for_delete (ptrdiff_t from, ptrdiff_t from_byte, static void adjust_markers_for_insert (ptrdiff_t from, ptrdiff_t from_byte, - ptrdiff_t to, ptrdiff_t to_byte, int before_markers) + ptrdiff_t to, ptrdiff_t to_byte, bool before_markers) { struct Lisp_Marker *m; - int adjusted = 0; + bool adjusted = 0; ptrdiff_t nchars = to - from; ptrdiff_t nbytes = to_byte - from_byte; @@ -515,7 +511,7 @@ make_gap (ptrdiff_t nbytes_added) ptrdiff_t copy_text (const unsigned char *from_addr, unsigned char *to_addr, - ptrdiff_t nbytes, int from_multibyte, int to_multibyte) + ptrdiff_t nbytes, bool from_multibyte, bool to_multibyte) { if (from_multibyte == to_multibyte) { @@ -664,7 +660,7 @@ insert_before_markers_and_inherit (const char *string, void insert_1 (const char *string, ptrdiff_t nbytes, - int inherit, int prepare, int before_markers) + bool inherit, bool prepare, bool before_markers) { insert_1_both (string, chars_in_text ((unsigned char *) string, nbytes), nbytes, inherit, prepare, before_markers); @@ -790,7 +786,7 @@ count_combining_after (const unsigned char *string, void insert_1_both (const char *string, ptrdiff_t nchars, ptrdiff_t nbytes, - int inherit, int prepare, int before_markers) + bool inherit, bool prepare, bool before_markers) { if (nchars == 0) return; @@ -867,7 +863,7 @@ insert_1_both (const char *string, void insert_from_string (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte, - ptrdiff_t length, ptrdiff_t length_byte, int inherit) + ptrdiff_t length, ptrdiff_t length_byte, bool inherit) { ptrdiff_t opoint = PT; @@ -887,7 +883,7 @@ void insert_from_string_before_markers (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte, ptrdiff_t length, ptrdiff_t length_byte, - int inherit) + bool inherit) { ptrdiff_t opoint = PT; @@ -905,7 +901,7 @@ insert_from_string_before_markers (Lisp_Object string, static void insert_from_string_1 (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte, ptrdiff_t nchars, ptrdiff_t nbytes, - int inherit, int before_markers) + bool inherit, bool before_markers) { struct gcpro gcpro1; ptrdiff_t outgoing_nbytes = nbytes; @@ -1039,7 +1035,7 @@ insert_from_gap (ptrdiff_t nchars, ptrdiff_t nbytes) void insert_from_buffer (struct buffer *buf, - ptrdiff_t charpos, ptrdiff_t nchars, int inherit) + ptrdiff_t charpos, ptrdiff_t nchars, bool inherit) { ptrdiff_t opoint = PT; @@ -1050,7 +1046,7 @@ insert_from_buffer (struct buffer *buf, static void insert_from_buffer_1 (struct buffer *buf, - ptrdiff_t from, ptrdiff_t nchars, int inherit) + ptrdiff_t from, ptrdiff_t nchars, bool inherit) { ptrdiff_t chunk, chunk_expanded; ptrdiff_t from_byte = buf_charpos_to_bytepos (buf, from); @@ -1265,7 +1261,7 @@ adjust_after_insert (ptrdiff_t from, ptrdiff_t from_byte, } /* Replace the text from character positions FROM to TO with NEW, - If PREPARE is nonzero, call prepare_to_modify_buffer. + If PREPARE, call prepare_to_modify_buffer. If INHERIT, the newly inserted text should inherit text properties from the surrounding non-deleted text. */ @@ -1278,7 +1274,7 @@ adjust_after_insert (ptrdiff_t from, ptrdiff_t from_byte, void replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new, - int prepare, int inherit, int markers) + bool prepare, bool inherit, bool markers) { ptrdiff_t inschars = SCHARS (new); ptrdiff_t insbytes = SBYTES (new); @@ -1443,7 +1439,7 @@ replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new, Note that this does not yet handle markers quite right. - If MARKERS is nonzero, relocate markers. + If MARKERS, relocate markers. Unlike most functions at this level, never call prepare_to_modify_buffer and never call signal_after_change. */ @@ -1452,7 +1448,7 @@ void replace_range_2 (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t to, ptrdiff_t to_byte, const char *ins, ptrdiff_t inschars, ptrdiff_t insbytes, - int markers) + bool markers) { ptrdiff_t nbytes_del, nchars_del; @@ -1563,7 +1559,7 @@ del_range (ptrdiff_t from, ptrdiff_t to) RET_STRING says to return the deleted text. */ Lisp_Object -del_range_1 (ptrdiff_t from, ptrdiff_t to, int prepare, int ret_string) +del_range_1 (ptrdiff_t from, ptrdiff_t to, bool prepare, bool ret_string) { ptrdiff_t from_byte, to_byte; Lisp_Object deletion; @@ -1599,7 +1595,7 @@ del_range_1 (ptrdiff_t from, ptrdiff_t to, int prepare, int ret_string) /* Like del_range_1 but args are byte positions, not char positions. */ void -del_range_byte (ptrdiff_t from_byte, ptrdiff_t to_byte, int prepare) +del_range_byte (ptrdiff_t from_byte, ptrdiff_t to_byte, bool prepare) { ptrdiff_t from, to; @@ -1643,7 +1639,7 @@ del_range_byte (ptrdiff_t from_byte, ptrdiff_t to_byte, int prepare) void del_range_both (ptrdiff_t from, ptrdiff_t from_byte, - ptrdiff_t to, ptrdiff_t to_byte, int prepare) + ptrdiff_t to, ptrdiff_t to_byte, bool prepare) { /* Make args be valid */ if (from_byte < BEGV_BYTE) @@ -1685,13 +1681,13 @@ del_range_both (ptrdiff_t from, ptrdiff_t from_byte, /* Delete a range of text, specified both as character positions and byte positions. FROM and TO are character positions, while FROM_BYTE and TO_BYTE are byte positions. - If RET_STRING is true, the deleted area is returned as a string. */ + If RET_STRING, the deleted area is returned as a string. */ Lisp_Object del_range_2 (ptrdiff_t from, ptrdiff_t from_byte, - ptrdiff_t to, ptrdiff_t to_byte, int ret_string) + ptrdiff_t to, ptrdiff_t to_byte, bool ret_string) { - register ptrdiff_t nbytes_del, nchars_del; + ptrdiff_t nbytes_del, nchars_del; Lisp_Object deletion; check_markers (); @@ -1770,12 +1766,12 @@ del_range_2 (ptrdiff_t from, ptrdiff_t from_byte, and warns the next redisplay that it should pay attention to that area. - If PRESERVE_CHARS_MODIFF is non-zero, do not update CHARS_MODIFF. + If PRESERVE_CHARS_MODIFF, do not update CHARS_MODIFF. Otherwise set CHARS_MODIFF to the new value of MODIFF. */ void modify_region (struct buffer *buffer, ptrdiff_t start, ptrdiff_t end, - int preserve_chars_modiff) + bool preserve_chars_modiff) { struct buffer *old_buffer = current_buffer; diff --git a/src/intervals.c b/src/intervals.c index 0a85e20e5d9..49d61b2f9b0 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -178,14 +178,13 @@ merge_properties (register INTERVAL source, register INTERVAL target) } } -/* Return 1 if the two intervals have the same properties, - 0 otherwise. */ +/* Return true if the two intervals have the same properties. */ -int +bool intervals_equal (INTERVAL i0, INTERVAL i1) { - register Lisp_Object i0_cdr, i0_sym; - register Lisp_Object i1_cdr, i1_val; + Lisp_Object i0_cdr, i0_sym; + Lisp_Object i1_cdr, i1_val; if (DEFAULT_INTERVAL_P (i0) && DEFAULT_INTERVAL_P (i1)) return 1; @@ -469,10 +468,10 @@ balance_an_interval (INTERVAL i) Lisp Object. */ static inline INTERVAL -balance_possible_root_interval (register INTERVAL interval) +balance_possible_root_interval (INTERVAL interval) { Lisp_Object parent; - int have_parent = 0; + bool have_parent = 0; if (!INTERVAL_HAS_OBJECT (interval) && !INTERVAL_HAS_PARENT (interval)) return interval; @@ -845,9 +844,9 @@ static INTERVAL adjust_intervals_for_insertion (INTERVAL tree, ptrdiff_t position, ptrdiff_t length) { - register INTERVAL i; - register INTERVAL temp; - int eobp = 0; + INTERVAL i; + INTERVAL temp; + bool eobp = 0; Lisp_Object parent; ptrdiff_t offset; @@ -1068,11 +1067,10 @@ FR 8 9 A B static Lisp_Object merge_properties_sticky (Lisp_Object pleft, Lisp_Object pright) { - register Lisp_Object props, front, rear; + Lisp_Object props, front, rear; Lisp_Object lfront, lrear, rfront, rrear; - register Lisp_Object tail1, tail2, sym, lval, rval, cat; - int use_left, use_right; - int lpresent; + Lisp_Object tail1, tail2, sym, lval, rval, cat; + bool use_left, use_right, lpresent; props = Qnil; front = Qnil; @@ -1610,7 +1608,7 @@ reproduce_tree_obj (INTERVAL source, Lisp_Object parent) void graft_intervals_into_buffer (INTERVAL source, ptrdiff_t position, ptrdiff_t length, struct buffer *buffer, - int inherit) + bool inherit) { INTERVAL tree = buffer_intervals (buffer); INTERVAL under, over, this; @@ -1753,9 +1751,9 @@ textget (Lisp_Object plist, register Lisp_Object prop) } Lisp_Object -lookup_char_property (Lisp_Object plist, register Lisp_Object prop, int textprop) +lookup_char_property (Lisp_Object plist, Lisp_Object prop, bool textprop) { - register Lisp_Object tail, fallback = Qnil; + Lisp_Object tail, fallback = Qnil; for (tail = plist; CONSP (tail); tail = Fcdr (XCDR (tail))) { @@ -1826,8 +1824,8 @@ set_point (ptrdiff_t charpos) /* If there's an invisible character at position POS + TEST_OFFS in the current buffer, and the invisible property has a `stickiness' such that inserting a character at position POS would inherit the property it, - return POS + ADJ, otherwise return POS. If TEST_INTANG is non-zero, - then intangibility is required as well as invisibility. + return POS + ADJ, otherwise return POS. If TEST_INTANG, intangibility + is required as well as invisibility. TEST_OFFS should be either 0 or -1, and ADJ should be either 1 or -1. @@ -1836,7 +1834,7 @@ set_point (ptrdiff_t charpos) static ptrdiff_t adjust_for_invis_intang (ptrdiff_t pos, ptrdiff_t test_offs, ptrdiff_t adj, - int test_intang) + bool test_intang) { Lisp_Object invis_propval, invis_overlay; Lisp_Object test_pos; @@ -1883,8 +1881,8 @@ set_point_both (ptrdiff_t charpos, ptrdiff_t bytepos) initial position is the same as the destination, in the rare instances where this is important, e.g. in line-move-finish (simple.el). */ - int backwards = (charpos < old_position ? 1 : 0); - int have_overlays; + bool backwards = charpos < old_position; + bool have_overlays; ptrdiff_t original_position; bset_point_before_scroll (current_buffer, Qnil); @@ -2154,12 +2152,12 @@ move_if_not_intangible (ptrdiff_t position) /* If text at position POS has property PROP, set *VAL to the property value, *START and *END to the beginning and end of a region that - has the same property, and return 1. Otherwise return 0. + has the same property, and return true. Otherwise return false. OBJECT is the string or buffer to look for the property in; nil means the current buffer. */ -int +bool get_property_and_range (ptrdiff_t pos, Lisp_Object prop, Lisp_Object *val, ptrdiff_t *start, ptrdiff_t *end, Lisp_Object object) { @@ -2306,10 +2304,10 @@ copy_intervals_to_string (Lisp_Object string, struct buffer *buffer, set_string_intervals (string, interval_copy); } -/* Return 1 if strings S1 and S2 have identical properties; 0 otherwise. +/* Return true if strings S1 and S2 have identical properties. Assume they have identical characters. */ -int +bool compare_string_intervals (Lisp_Object s1, Lisp_Object s2) { INTERVAL i1, i2; @@ -2348,7 +2346,7 @@ compare_string_intervals (Lisp_Object s1, Lisp_Object s2) START_BYTE ... END_BYTE in bytes. */ static void -set_intervals_multibyte_1 (INTERVAL i, int multi_flag, +set_intervals_multibyte_1 (INTERVAL i, bool multi_flag, ptrdiff_t start, ptrdiff_t start_byte, ptrdiff_t end, ptrdiff_t end_byte) { @@ -2456,11 +2454,11 @@ set_intervals_multibyte_1 (INTERVAL i, int multi_flag, } /* Update the intervals of the current buffer - to fit the contents as multibyte (if MULTI_FLAG is 1) - or to fit them as non-multibyte (if MULTI_FLAG is 0). */ + to fit the contents as multibyte (if MULTI_FLAG) + or to fit them as non-multibyte (if not MULTI_FLAG). */ void -set_intervals_multibyte (int multi_flag) +set_intervals_multibyte (bool multi_flag) { INTERVAL i = buffer_intervals (current_buffer); diff --git a/src/intervals.h b/src/intervals.h index 01e72d7c9db..2b30101d0fa 100644 --- a/src/intervals.h +++ b/src/intervals.h @@ -227,7 +227,7 @@ extern INTERVAL make_interval (void); extern INTERVAL create_root_interval (Lisp_Object); extern void copy_properties (INTERVAL, INTERVAL); -extern int intervals_equal (INTERVAL, INTERVAL); +extern bool intervals_equal (INTERVAL, INTERVAL); extern void traverse_intervals (INTERVAL, ptrdiff_t, void (*) (INTERVAL, Lisp_Object), Lisp_Object); @@ -242,22 +242,22 @@ extern INTERVAL previous_interval (INTERVAL); extern INTERVAL merge_interval_left (INTERVAL); extern void offset_intervals (struct buffer *, ptrdiff_t, ptrdiff_t); extern void graft_intervals_into_buffer (INTERVAL, ptrdiff_t, ptrdiff_t, - struct buffer *, int); + struct buffer *, bool); extern void verify_interval_modification (struct buffer *, ptrdiff_t, ptrdiff_t); extern INTERVAL balance_intervals (INTERVAL); extern void copy_intervals_to_string (Lisp_Object, struct buffer *, ptrdiff_t, ptrdiff_t); extern INTERVAL copy_intervals (INTERVAL, ptrdiff_t, ptrdiff_t); -extern int compare_string_intervals (Lisp_Object, Lisp_Object); +extern bool compare_string_intervals (Lisp_Object, Lisp_Object); extern Lisp_Object textget (Lisp_Object, Lisp_Object); -extern Lisp_Object lookup_char_property (Lisp_Object, Lisp_Object, int); +extern Lisp_Object lookup_char_property (Lisp_Object, Lisp_Object, bool); extern void move_if_not_intangible (ptrdiff_t); -extern int get_property_and_range (ptrdiff_t, Lisp_Object, Lisp_Object *, - ptrdiff_t *, ptrdiff_t *, Lisp_Object); +extern bool get_property_and_range (ptrdiff_t, Lisp_Object, Lisp_Object *, + ptrdiff_t *, ptrdiff_t *, Lisp_Object); extern Lisp_Object get_local_map (ptrdiff_t, struct buffer *, Lisp_Object); extern INTERVAL update_interval (INTERVAL, ptrdiff_t); -extern void set_intervals_multibyte (int); +extern void set_intervals_multibyte (bool); extern INTERVAL validate_interval_range (Lisp_Object, Lisp_Object *, Lisp_Object *, int); extern INTERVAL interval_of (ptrdiff_t, Lisp_Object); diff --git a/src/keyboard.c b/src/keyboard.c index 7b1ea341e7f..ff2b75e351c 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -4339,9 +4339,8 @@ struct input_event last_timer_event EXTERNALLY_VISIBLE; ...). Each element has the form (FUN . ARGS). */ Lisp_Object pending_funcalls; -/* If TIMER is a valid timer, return nonzero and place its value into - *RESULT. Otherwise return zero. */ -static int +/* Return true if TIMER is a valid timer, placing its value into *RESULT. */ +static bool decode_timer (Lisp_Object timer, EMACS_TIME *result) { Lisp_Object *vector; @@ -8445,7 +8444,7 @@ append_tool_bar_item (void) /* Append entries from tool_bar_item_properties to the end of tool_bar_items_vector. */ - vcopy (tool_bar_items_vector, ntool_bar_items, + vcopy (tool_bar_items_vector, ntool_bar_items, XVECTOR (tool_bar_item_properties)->contents, TOOL_BAR_ITEM_NSLOTS); ntool_bar_items += TOOL_BAR_ITEM_NSLOTS; } diff --git a/src/lisp.h b/src/lisp.h index 2815a2ae325..b906e4a1dfd 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2720,43 +2720,43 @@ extern void move_gap_both (ptrdiff_t, ptrdiff_t); extern _Noreturn void buffer_overflow (void); extern void make_gap (ptrdiff_t); extern ptrdiff_t copy_text (const unsigned char *, unsigned char *, - ptrdiff_t, int, int); + ptrdiff_t, bool, bool); extern int count_combining_before (const unsigned char *, ptrdiff_t, ptrdiff_t, ptrdiff_t); extern int count_combining_after (const unsigned char *, ptrdiff_t, ptrdiff_t, ptrdiff_t); extern void insert (const char *, ptrdiff_t); extern void insert_and_inherit (const char *, ptrdiff_t); -extern void insert_1 (const char *, ptrdiff_t, int, int, int); +extern void insert_1 (const char *, ptrdiff_t, bool, bool, bool); extern void insert_1_both (const char *, ptrdiff_t, ptrdiff_t, - int, int, int); + bool, bool, bool); extern void insert_from_gap (ptrdiff_t, ptrdiff_t); extern void insert_from_string (Lisp_Object, ptrdiff_t, ptrdiff_t, - ptrdiff_t, ptrdiff_t, int); -extern void insert_from_buffer (struct buffer *, ptrdiff_t, ptrdiff_t, int); + ptrdiff_t, ptrdiff_t, bool); +extern void insert_from_buffer (struct buffer *, ptrdiff_t, ptrdiff_t, bool); extern void insert_char (int); extern void insert_string (const char *); extern void insert_before_markers (const char *, ptrdiff_t); extern void insert_before_markers_and_inherit (const char *, ptrdiff_t); extern void insert_from_string_before_markers (Lisp_Object, ptrdiff_t, ptrdiff_t, ptrdiff_t, - ptrdiff_t, int); + ptrdiff_t, bool); extern void del_range (ptrdiff_t, ptrdiff_t); -extern Lisp_Object del_range_1 (ptrdiff_t, ptrdiff_t, int, int); -extern void del_range_byte (ptrdiff_t, ptrdiff_t, int); -extern void del_range_both (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, int); +extern Lisp_Object del_range_1 (ptrdiff_t, ptrdiff_t, bool, bool); +extern void del_range_byte (ptrdiff_t, ptrdiff_t, bool); +extern void del_range_both (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, bool); extern Lisp_Object del_range_2 (ptrdiff_t, ptrdiff_t, - ptrdiff_t, ptrdiff_t, int); -extern void modify_region (struct buffer *, ptrdiff_t, ptrdiff_t, int); + ptrdiff_t, ptrdiff_t, bool); +extern void modify_region (struct buffer *, ptrdiff_t, ptrdiff_t, bool); extern void prepare_to_modify_buffer (ptrdiff_t, ptrdiff_t, ptrdiff_t *); extern void signal_after_change (ptrdiff_t, ptrdiff_t, ptrdiff_t); extern void adjust_after_insert (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t); extern void adjust_markers_for_delete (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t); -extern void replace_range (ptrdiff_t, ptrdiff_t, Lisp_Object, int, int, int); +extern void replace_range (ptrdiff_t, ptrdiff_t, Lisp_Object, bool, bool, bool); extern void replace_range_2 (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, - const char *, ptrdiff_t, ptrdiff_t, int); + const char *, ptrdiff_t, ptrdiff_t, bool); extern void syms_of_insdel (void); /* Defined in dispnew.c */ @@ -3094,9 +3094,9 @@ extern Lisp_Object save_restriction_save (void); extern Lisp_Object save_excursion_restore (Lisp_Object); extern Lisp_Object save_restriction_restore (Lisp_Object); extern _Noreturn void time_overflow (void); -extern Lisp_Object make_buffer_string (ptrdiff_t, ptrdiff_t, int); +extern Lisp_Object make_buffer_string (ptrdiff_t, ptrdiff_t, bool); extern Lisp_Object make_buffer_string_both (ptrdiff_t, ptrdiff_t, ptrdiff_t, - ptrdiff_t, int); + ptrdiff_t, bool); extern void init_editfns (void); const char *get_system_name (void); extern void syms_of_editfns (void); @@ -3332,9 +3332,9 @@ extern void syms_of_callproc (void); /* Defined in doc.c */ extern Lisp_Object Qfunction_documentation; extern Lisp_Object read_doc_string (Lisp_Object); -extern Lisp_Object get_doc_string (Lisp_Object, int, int); +extern Lisp_Object get_doc_string (Lisp_Object, bool, bool); extern void syms_of_doc (void); -extern int read_bytecode_char (int); +extern int read_bytecode_char (bool); /* Defined in bytecode.c */ extern Lisp_Object Qbytecode; diff --git a/src/systime.h b/src/systime.h index d3bdeb83019..9ce7ce646fb 100644 --- a/src/systime.h +++ b/src/systime.h @@ -154,8 +154,8 @@ extern void set_waiting_for_input (EMACS_TIME *); #ifdef GCPRO1 /* defined in editfns.c */ extern Lisp_Object make_lisp_time (EMACS_TIME); -extern int decode_time_components (Lisp_Object, Lisp_Object, Lisp_Object, - Lisp_Object, EMACS_TIME *, double *); +extern bool decode_time_components (Lisp_Object, Lisp_Object, Lisp_Object, + Lisp_Object, EMACS_TIME *, double *); extern EMACS_TIME lisp_time_argument (Lisp_Object); #endif From 63dd1c6fa45357d312e1d3076e15adacf5ed6291 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Sun, 2 Sep 2012 12:31:45 +0300 Subject: [PATCH 200/212] Toggle whitespace matching mode with M-s SPC. http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00008.html * lisp/isearch.el (search-whitespace-regexp): Doc fix. Remove cons cell customization. (isearch-mode-map): Bind "\M-s " to isearch-toggle-lax-whitespace. (isearch-lax-whitespace, isearch-regexp-lax-whitespace): New variables. (isearch-forward, isearch-forward-regexp): Doc fix. (isearch-toggle-lax-whitespace): New command. (search-forward-lax-whitespace, search-backward-lax-whitespace) (re-search-forward-lax-whitespace) (re-search-backward-lax-whitespace): New functions. (isearch-whitespace-regexp): Remove function. (isearch-query-replace): Let-bind replace-search-function and replace-re-search-function. (isearch-occur): Let-bind search-spaces-regexp according to the value of isearch-lax-whitespace and isearch-regexp-lax-whitespace. (isearch-quote-char): Check isearch-regexp-lax-whitespace in the condition for C-q SPC. (isearch-search-fun-default): Use new functions mentioned above. (isearch-search-forward, isearch-search-backward): Remove functions. (isearch-search): Don't let-bind search-spaces-regexp. (isearch-lazy-highlight-space-regexp): Remove variable. (isearch-lazy-highlight-lax-whitespace) (isearch-lazy-highlight-regexp-lax-whitespace): New variables. (isearch-lazy-highlight-new-loop): Use them. (isearch-lazy-highlight-search): Don't let-bind search-spaces-regexp. --- etc/NEWS | 14 +++-- lisp/ChangeLog | 31 ++++++++++ lisp/isearch.el | 149 +++++++++++++++++++++++++++++++++++------------- 3 files changed, 147 insertions(+), 47 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 1dc8db5fa04..45966e53882 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -183,12 +183,14 @@ end of the buffer. It defaults to t. and `M-s _' in Isearch toggles symbol search mode. `M-s c' in Isearch toggles search case-sensitivity. -*** `search-whitespace-regexp' now acts on ordinary incremental search -as well, so that each sequence of spaces in the search string matches -any combination of one or more whitespace characters. To change this -behavior, you can give `search-whitespace-regexp' a cons cell value, -where the car and cdr specify values for ordinary and regular -expression incremental search respectively. +*** `M-s SPC' in Isearch toggles whitespace matching mode +in both ordinary and regexp incremental search, so that each +sequence of spaces in the search string matches any combination +of one or more whitespace characters defined by the variable +`search-whitespace-regexp'. In ordinary incremental search, +`isearch-toggle-lax-whitespace' toggles the value of the variable +`isearch-lax-whitespace'. In regexp incremental search, it toggles +the value of the variable `isearch-regexp-lax-whitespace'. ** M-x move-to-column, if called interactively with no prefix arg, now prompts for a column number. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d018e455357..b56672ac84f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,34 @@ +2012-09-02 Juri Linkov + + Toggle whitespace matching mode with M-s SPC. + http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00008.html + + * isearch.el (search-whitespace-regexp): Doc fix. + Remove cons cell customization. + (isearch-mode-map): Bind "\M-s " to isearch-toggle-lax-whitespace. + (isearch-lax-whitespace, isearch-regexp-lax-whitespace): + New variables. + (isearch-forward, isearch-forward-regexp): Doc fix. + (isearch-toggle-lax-whitespace): New command. + (search-forward-lax-whitespace, search-backward-lax-whitespace) + (re-search-forward-lax-whitespace) + (re-search-backward-lax-whitespace): New functions. + (isearch-whitespace-regexp): Remove function. + (isearch-query-replace): Let-bind replace-search-function and + replace-re-search-function. + (isearch-occur): Let-bind search-spaces-regexp according to the + value of isearch-lax-whitespace and isearch-regexp-lax-whitespace. + (isearch-quote-char): Check isearch-regexp-lax-whitespace in the + condition for C-q SPC. + (isearch-search-fun-default): Use new functions mentioned above. + (isearch-search-forward, isearch-search-backward): Remove functions. + (isearch-search): Don't let-bind search-spaces-regexp. + (isearch-lazy-highlight-space-regexp): Remove variable. + (isearch-lazy-highlight-lax-whitespace) + (isearch-lazy-highlight-regexp-lax-whitespace): New variables. + (isearch-lazy-highlight-new-loop): Use them. + (isearch-lazy-highlight-search): Don't let-bind search-spaces-regexp. + 2012-09-02 Chong Yidong * dired.el (dired-mode-map): Menu string fixes (Bug#11616). diff --git a/lisp/isearch.el b/lisp/isearch.el index 6ea8d86336a..e6e0a01566a 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -116,24 +116,16 @@ will match any sequence matched by this regexp. As an exception, spaces are treated normally in regexp incremental search if they occur in a regexp construct like [...] or *, + or ?. -If the value is a string, it applies to both ordinary and regexp -incremental search. If the value is nil, each space you type -matches literally, against one space. - -The value can also be a cons cell (REGEXP-1 . REGEXP-2). In that -case, REGEXP-1 is used as the value for ordinary incremental -search, and REGEXP-2 is used for regexp incremental search. +If the value is a string, it applies to both ordinary and +regexp incremental search. If the value is nil, or +`isearch-lax-whitespace' is nil for ordinary incremental search, or +`isearch-regexp-lax-whitespace' is nil for regexp incremental search, +then each space you type matches literally, against one space. You might want to use something like \"[ \\t\\r\\n]+\" instead. In the Customization buffer, that is `[' followed by a space, a tab, a carriage return (control-M), a newline, and `]+'." - :type '(choice (const :tag "Treat Spaces Literally" nil) - (cons (choice :tag "For Ordinary Isearch" - regexp - (const :tag "Treat Spaces Literally" nil)) - (choice :tag "For Regexp Isearch" - regexp - (const :tag "Treat Spaces Literally" nil))) + :type '(choice (const :tag "Match Spaces Literally" nil) regexp) :group 'isearch :version "24.3") @@ -514,6 +506,7 @@ This is like `describe-bindings', but displays only Isearch keys." (define-key map "\M-sr" 'isearch-toggle-regexp) (define-key map "\M-sw" 'isearch-toggle-word) (define-key map "\M-s_" 'isearch-toggle-symbol) + (define-key map "\M-s " 'isearch-toggle-lax-whitespace) (define-key map [?\M-%] 'isearch-query-replace) (define-key map [?\C-\M-%] 'isearch-query-replace-regexp) @@ -556,6 +549,22 @@ convert the search string to a regexp used by regexp search functions. The property `isearch-message-prefix' put on this function specifies the prefix string displayed in the search message.") +(defvar isearch-lax-whitespace t + "If non-nil, a space will match a sequence of whitespace chars. +When you enter a space or spaces in ordinary incremental search, it +will match any sequence matched by the regexp defined by the variable +`search-whitespace-regexp'. If the value is nil, each space you type +matches literally, against one space. You can toggle the value of this +variable by the command `isearch-toggle-lax-whitespace'.") + +(defvar isearch-regexp-lax-whitespace nil + "If non-nil, a space will match a sequence of whitespace chars. +When you enter a space or spaces in regexp incremental search, it +will match any sequence matched by the regexp defined by the variable +`search-whitespace-regexp'. If the value is nil, each space you type +matches literally, against one space. You can toggle the value of this +variable by the command `isearch-toggle-lax-whitespace'.") + (defvar isearch-cmds nil "Stack of search status sets. Each set is a vector of the form: @@ -681,6 +690,12 @@ Type \\[isearch-toggle-case-fold] to toggle search case-sensitivity. Type \\[isearch-toggle-regexp] to toggle regular-expression mode. Type \\[isearch-toggle-word] to toggle word mode. Type \\[isearch-toggle-symbol] to toggle symbol mode. + +Type \\[isearch-toggle-lax-whitespace] to toggle whitespace matching. +In incremental searches, a space or spaces normally matches any whitespace +defined by the variable `search-whitespace-regexp'; see also the variables +`isearch-lax-whitespace' and `isearch-regexp-lax-whitespace'. + Type \\[isearch-edit-string] to edit the search string in the minibuffer. Also supported is a search ring of the previous 16 search strings. @@ -702,9 +717,6 @@ Type \\[isearch-describe-bindings] to display all Isearch key bindings. Type \\[isearch-describe-key] to display documentation of Isearch key. Type \\[isearch-describe-mode] to display documentation of Isearch mode. -In incremental searches, a space or spaces normally matches any -whitespace; see the variable `search-whitespace-regexp'. - If an input method is turned on in the current buffer, that input method is also active while you are typing characters to search. To toggle the input method, type \\[isearch-toggle-input-method]. \ @@ -734,8 +746,9 @@ Like ordinary incremental search except that your input is treated as a regexp. See the command `isearch-forward' for more information. In incremental searches, a space or spaces normally matches any -whitespace; see the variable `search-whitespace-regexp'. To -search for a literal space and nothing else, enter C-q SPC." +whitespace defined by the variable `search-whitespace-regexp'. +To search for a literal space and nothing else, enter C-q SPC. +To toggle whitespace matching, use `isearch-toggle-lax-whitespace'." (interactive "P\np") (isearch-mode t (null not-regexp) nil (not no-recursive-edit))) @@ -1395,6 +1408,28 @@ Use `isearch-exit' to quit without signaling." (setq isearch-success t isearch-adjusted t) (isearch-update)) +(defun isearch-toggle-lax-whitespace () + "Toggle whitespace matching in searching on or off. +In ordinary search, toggles the value of the variable +`isearch-lax-whitespace'. In regexp search, toggles the +value of the variable `isearch-regexp-lax-whitespace'." + (interactive) + (if isearch-regexp + (setq isearch-regexp-lax-whitespace (not isearch-regexp-lax-whitespace)) + (setq isearch-lax-whitespace (not isearch-lax-whitespace))) + (let ((message-log-max nil)) + (message "%s%s [%s]" + (isearch-message-prefix nil isearch-nonincremental) + isearch-message + (if (if isearch-regexp + isearch-regexp-lax-whitespace + isearch-lax-whitespace) + "match spaces loosely" + "match spaces literally"))) + (setq isearch-success t isearch-adjusted t) + (sit-for 1) + (isearch-update)) + (defun isearch-toggle-case-fold () "Toggle case folding in searching on or off." (interactive) @@ -1506,6 +1541,28 @@ If LAX is non-nil, the end of the string need not match a symbol boundary." (put 'isearch-symbol-regexp 'isearch-message-prefix "symbol ") +;; Search with lax whitespace + +(defun search-forward-lax-whitespace (string &optional bound noerror count) + "Search forward for STRING, matching a sequence of whitespace chars." + (let ((search-spaces-regexp search-whitespace-regexp)) + (re-search-forward (regexp-quote string) bound noerror count))) + +(defun search-backward-lax-whitespace (string &optional bound noerror count) + "Search backward for STRING, matching a sequence of whitespace chars." + (let ((search-spaces-regexp search-whitespace-regexp)) + (re-search-backward (regexp-quote string) bound noerror count))) + +(defun re-search-forward-lax-whitespace (regexp &optional bound noerror count) + "Search forward for REGEXP, matching a sequence of whitespace chars." + (let ((search-spaces-regexp search-whitespace-regexp)) + (re-search-forward regexp bound noerror count))) + +(defun re-search-backward-lax-whitespace (regexp &optional bound noerror count) + "Search backward for REGEXP, matching a sequence of whitespace chars." + (let ((search-spaces-regexp search-whitespace-regexp)) + (re-search-backward regexp bound noerror count))) + (defun isearch-query-replace (&optional delimited regexp-flag) "Start `query-replace' with string to replace from last search string. @@ -1522,6 +1579,14 @@ way to run word replacements from Isearch is `M-s w ... M-%'." ;; set `search-upper-case' to nil to not call ;; `isearch-no-upper-case-p' in `perform-replace' (search-upper-case nil) + (replace-search-function + (if (and isearch-lax-whitespace (not regexp-flag)) + #'search-forward-lax-whitespace + replace-search-function)) + (replace-re-search-function + (if (and isearch-regexp-lax-whitespace regexp-flag) + #'re-search-forward-lax-whitespace + replace-re-search-function)) ;; Set `isearch-recursive-edit' to nil to prevent calling ;; `exit-recursive-edit' in `isearch-done' that terminates ;; the execution of this command when it is non-nil. @@ -1558,15 +1623,6 @@ See `isearch-query-replace' for more information." (list current-prefix-arg)) (isearch-query-replace delimited t)) -(defun isearch-whitespace-regexp () - "Return the value of `search-whitespace-regexp' for the current search." - (cond ((not (consp search-whitespace-regexp)) - search-whitespace-regexp) - (isearch-regexp - (cdr search-whitespace-regexp)) - (t - (car search-whitespace-regexp)))) - (defun isearch-occur (regexp &optional nlines) "Run `occur' using the last search string as the regexp. Interactively, REGEXP is constructed using the search string from the @@ -1606,7 +1662,11 @@ characters in that string." ;; Set `search-upper-case' to nil to not call ;; `isearch-no-upper-case-p' in `occur-1'. (search-upper-case nil) - (search-spaces-regexp (isearch-whitespace-regexp))) + (search-spaces-regexp + (if (if isearch-regexp + isearch-regexp-lax-whitespace + isearch-lax-whitespace) + search-whitespace-regexp))) (occur regexp nlines))) (declare-function hi-lock-read-face-name "hi-lock" ()) @@ -2203,7 +2263,7 @@ Isearch mode." ;; Assume character codes 0200 - 0377 stand for characters in some ;; single-byte character set, and convert them to Emacs ;; characters. - (if (and isearch-regexp (= char ?\s)) + (if (and isearch-regexp isearch-regexp-lax-whitespace (= char ?\s)) (if (subregexp-context-p isearch-string (length isearch-string)) (isearch-process-search-string "[ ]" " ") (isearch-process-search-char char)) @@ -2443,16 +2503,19 @@ Can be changed via `isearch-search-fun-function' for special needs." (funcall isearch-word string lax) (word-search-regexp string lax)) bound noerror count)))) + ((and isearch-regexp isearch-regexp-lax-whitespace + search-whitespace-regexp) + (if isearch-forward + 're-search-forward-lax-whitespace + 're-search-backward-lax-whitespace)) (isearch-regexp (if isearch-forward 're-search-forward 're-search-backward)) + ((and isearch-lax-whitespace search-whitespace-regexp) + (if isearch-forward + 'search-forward-lax-whitespace + 'search-backward-lax-whitespace)) (t - (if isearch-forward 'isearch-search-forward 'isearch-search-backward)))) - -(defun isearch-search-forward (string &optional bound noerror count) - (re-search-forward (regexp-quote string) bound noerror count)) - -(defun isearch-search-backward (string &optional bound noerror count) - (re-search-backward (regexp-quote string) bound noerror count)) + (if isearch-forward 'search-forward 'search-backward)))) (defun isearch-search-string (string bound noerror) "Search for the first occurrence of STRING or its translation. @@ -2513,7 +2576,6 @@ update the match data, and return point." search-invisible)) (inhibit-quit nil) (case-fold-search isearch-case-fold-search) - (search-spaces-regexp (isearch-whitespace-regexp)) (retry t)) (setq isearch-error nil) (while retry @@ -2805,7 +2867,8 @@ since they have special meaning in a regexp." (defvar isearch-lazy-highlight-window-end nil) (defvar isearch-lazy-highlight-case-fold-search nil) (defvar isearch-lazy-highlight-regexp nil) -(defvar isearch-lazy-highlight-space-regexp nil) +(defvar isearch-lazy-highlight-lax-whitespace nil) +(defvar isearch-lazy-highlight-regexp-lax-whitespace nil) (defvar isearch-lazy-highlight-word nil) (defvar isearch-lazy-highlight-forward nil) (defvar isearch-lazy-highlight-error nil) @@ -2847,6 +2910,10 @@ by other Emacs features." isearch-regexp)) (not (eq isearch-lazy-highlight-word isearch-word)) + (not (eq isearch-lazy-highlight-lax-whitespace + isearch-lax-whitespace)) + (not (eq isearch-lazy-highlight-regexp-lax-whitespace + isearch-regexp-lax-whitespace)) (not (= (window-start) isearch-lazy-highlight-window-start)) (not (= (window-end) ; Window may have been split/joined. @@ -2873,7 +2940,8 @@ by other Emacs features." isearch-lazy-highlight-last-string isearch-string isearch-lazy-highlight-case-fold-search isearch-case-fold-search isearch-lazy-highlight-regexp isearch-regexp - isearch-lazy-highlight-space-regexp (isearch-whitespace-regexp) + isearch-lazy-highlight-lax-whitespace isearch-lax-whitespace + isearch-lazy-highlight-regexp-lax-whitespace isearch-regexp-lax-whitespace isearch-lazy-highlight-word isearch-word isearch-lazy-highlight-forward isearch-forward) (unless (equal isearch-string "") @@ -2887,7 +2955,6 @@ Attempt to do the search exactly the way the pending Isearch would." (condition-case nil (let ((case-fold-search isearch-lazy-highlight-case-fold-search) (isearch-regexp isearch-lazy-highlight-regexp) - (search-spaces-regexp isearch-lazy-highlight-space-regexp) (isearch-word isearch-lazy-highlight-word) (search-invisible nil) ; don't match invisible text (retry t) From 73406194024fcb6877db0618300b63916ebf466d Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 2 Sep 2012 11:57:19 +0200 Subject: [PATCH 201/212] * eshell/em-unix.el (eshell/sudo): When we have an ad-hoc remote definition of `default-directory', ensure we can connect. --- lisp/ChangeLog | 5 +++++ lisp/eshell/em-unix.el | 2 ++ 2 files changed, 7 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b56672ac84f..62d3097ccaa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-09-02 Michael Albinus + + * eshell/em-unix.el (eshell/sudo): When we have an ad-hoc + remote definition of `default-directory', ensure we can connect. + 2012-09-02 Juri Linkov Toggle whitespace matching mode with M-s SPC. diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index 35f7a0a9e3d..58402e37508 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -1110,6 +1110,8 @@ Execute a COMMAND as the superuser or another USER.") (format "%s|sudo:%s@%s:%s" (substring prefix 0 -1) user host dir) (format "/sudo:%s@%s:%s" user host dir)))) + ;; Ensure, that Tramp has connected to that construct already. + (file-exists-p default-directory) (eshell-named-command (car orig-args) (cdr orig-args)))))))) (put 'eshell/sudo 'eshell-no-numeric-conversions t) From 403e17698e49a7a336d0aeca5d1eb59ec37c85a5 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 2 Sep 2012 06:19:02 -0400 Subject: [PATCH 202/212] Auto-commit of generated files. --- autogen/config.in | 10 +++++++--- autogen/configure | 2 -- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/autogen/config.in b/autogen/config.in index 89174519488..c39453938be 100644 --- a/autogen/config.in +++ b/autogen/config.in @@ -161,6 +161,13 @@ along with GNU Emacs. If not, see . */ or signaling SIGFPE/SIGILL. */ #undef FLOAT_CHECK_DOMAIN +/* Enable compile-time and run-time bounds-checking, and some warnings, + without upsetting glibc 2.15+. */ + #if defined __OPTIMIZE__ && __OPTIMIZE__ + # define _FORTIFY_SOURCE 2 + #endif + + /* Define to 1 if futimesat mishandles a NULL file name. */ #undef FUTIMESAT_NULL_BUG @@ -1458,9 +1465,6 @@ along with GNU Emacs. If not, see . */ /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS -/* enable compile-time and run-time bounds-checking, and some warnings */ -#undef _FORTIFY_SOURCE - /* Define to 1 if Gnulib overrides 'struct stat' on Windows so that struct stat.st_size becomes 64-bit. */ #undef _GL_WINDOWS_64_BIT_ST_SIZE diff --git a/autogen/configure b/autogen/configure index 90fa63c7322..11bca94ea05 100755 --- a/autogen/configure +++ b/autogen/configure @@ -7784,8 +7784,6 @@ fi $as_echo "#define lint 1" >>confdefs.h -$as_echo "#define _FORTIFY_SOURCE 2" >>confdefs.h - $as_echo "#define GNULIB_PORTCHECK 1" >>confdefs.h From 8b33967313f09a736a833816d32fd52e10640969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Sun, 2 Sep 2012 12:53:46 +0200 Subject: [PATCH 203/212] Prototype for x_wm_set_size_hint restored. * frame.h: Add missing prototype for x_wm_set_size_hint. * gtkutil.h: Remove prototype for x_wm_set_size_hint. --- src/ChangeLog | 6 ++++++ src/frame.h | 1 + src/gtkutil.h | 3 --- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 0bcfa6c85f6..2ea13df1261 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-09-02 Jan Djärv + + * gtkutil.h: Remove prototype for x_wm_set_size_hint. + + * frame.h: Add missing prototype for x_wm_set_size_hint. + 2012-09-02 Paul Eggert * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean. diff --git a/src/frame.h b/src/frame.h index 76fde8ec96b..1fe3ebd9182 100644 --- a/src/frame.h +++ b/src/frame.h @@ -1206,6 +1206,7 @@ extern Lisp_Object Qrun_hook_with_args; extern void x_set_scroll_bar_default_width (struct frame *); extern void x_set_offset (struct frame *, int, int, int); extern void x_wm_set_icon_position (struct frame *, int, int); +extern void x_wm_set_size_hint (FRAME_PTR f, long flags, int user_position); extern Lisp_Object x_new_font (struct frame *, Lisp_Object, int); diff --git a/src/gtkutil.h b/src/gtkutil.h index c1b6634999f..926478dd728 100644 --- a/src/gtkutil.h +++ b/src/gtkutil.h @@ -150,9 +150,6 @@ extern GdkCursor * xg_create_default_cursor (Display *dpy); extern int xg_create_frame_widgets (FRAME_PTR f); extern void xg_free_frame_widgets (FRAME_PTR f); -extern void x_wm_set_size_hint (FRAME_PTR f, - long flags, - int user_position); extern void xg_set_background_color (FRAME_PTR f, unsigned long bg); extern int xg_check_special_colors (struct frame *f, const char *color_name, From f278d339c9aea397620179bda2c396aaae073be1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Sun, 2 Sep 2012 13:13:24 +0200 Subject: [PATCH 204/212] * configure.ac (HAVE_GOBJECT): Check for gobject-2.0. Fixes: debbugs:12332 --- ChangeLog | 4 ++++ configure.ac | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index cf4506f0c77..62e64622d1f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2012-09-02 Jan Djärv + + * configure.ac (HAVE_GOBJECT): Check for gobject-2.0 (Bug#12332). + 2012-09-01 Paul Eggert * configure.ac (_FORTIFY_SOURCE): Define only when optimizing. diff --git a/configure.ac b/configure.ac index 43686361d07..0e2154aab6e 100644 --- a/configure.ac +++ b/configure.ac @@ -2053,6 +2053,11 @@ if test "${HAVE_X11}" = "yes" && test "${with_gconf}" = "yes"; then fi if test "$HAVE_GSETTINGS" = "yes" || test "$HAVE_GCONF" = "yes"; then + PKG_CHECK_MODULES(GOBJECT, gobject-2.0 >= 2.0, HAVE_GOBJECT=yes, HAVE_GOBJECT=no) + if test "$HAVE_GOBJECT" = "yes"; then + SETTINGS_CFLAGS="$SETTINGS_CFLAGS $GOBJECT_CFLAGS" + SETTINGS_LIBS="$SETTINGS_LIBS $GOBJECT_LIBS" + fi SAVE_CFLAGS="$CFLAGS" SAVE_LIBS="$LIBS" CFLAGS="$SETTINGS_CFLAGS $CFLAGS" From c04889f8e34e69ed496fcaaab285eac34e96acc1 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 2 Sep 2012 07:26:47 -0700 Subject: [PATCH 205/212] * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS) when building globals.h, as the objects that are not built on this host are not needed to compile C files on this host. --- src/ChangeLog | 6 ++++++ src/Makefile.in | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 2ea13df1261..4986726d7c8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-09-02 Paul Eggert + + * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS) + when building globals.h, as the objects that are not built on + this host are not needed to compile C files on this host. + 2012-09-02 Jan Djärv * gtkutil.h: Remove prototype for x_wm_set_size_hint. diff --git a/src/Makefile.in b/src/Makefile.in index a809216f095..fe4cff5d8cc 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -448,7 +448,7 @@ GLOBAL_SOURCES = $(base_obj:.o=.c) $(NS_OBJC_OBJ:.o=.m) gl-stamp: $(libsrc)/make-docfile$(EXEEXT) $(GLOBAL_SOURCES) @rm -f gl-tmp - $(libsrc)/make-docfile -d $(srcdir) -g $(SOME_MACHINE_OBJECTS) $(obj) > gl-tmp + $(libsrc)/make-docfile -d $(srcdir) -g $(obj) > gl-tmp $(srcdir)/../build-aux/move-if-change gl-tmp globals.h echo timestamp > $@ From a411ac43d3667d042fa36361275eccbe9aca80af Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 2 Sep 2012 09:56:31 -0700 Subject: [PATCH 206/212] Clean up some extern decls. Mostly, this hoists extern decls out of .c files and into .h files. That way, we're more likely to catch errors if the interfaces change. * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not declare xg_mark_data. * dispextern.h (x_frame_parm_handlers): * font.h (Qxft): * lisp.h (Qlexical_binding, Qinternal_interpreter_environment) (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold) (Qultra_bold, Qoblique, Qitalic): Move extern decl here from .c file. * alloc.c (xg_mark_data) [USE_GTK]: * doc.c (Qclosure): * eval.c (Qlexical_binding): * fns.c (time) [!HAVE_UNISTD_H]: * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light) (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic): * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]: * lread.c (Qinternal_interpreter_environment): * minibuf.c (Qbuffer): * process.c (QCfamily, QCfilter): * widget.c (free_frame_faces): * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]: * xfont.c (x_clear_errors): * xterm.c (x_frame_parm_handlers): Remove now-redundant extern decls. * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]: * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic): Now static. * xfaces.c: Remove unnecessary static decls. * xterm.c (updating_frame): Remove decl of nonexistent object. --- src/ChangeLog | 32 ++++++++++++++++++++++++++++++++ src/alloc.c | 8 ++++---- src/dispextern.h | 3 +++ src/doc.c | 1 - src/eval.c | 1 - src/fns.c | 4 ---- src/font.h | 1 + src/gtkutil.c | 5 ----- src/image.c | 1 - src/keyboard.c | 2 +- src/keyboard.h | 2 +- src/lisp.h | 6 +++++- src/lread.c | 2 -- src/minibuf.c | 1 - src/process.c | 10 ---------- src/widget.c | 2 -- src/xfaces.c | 43 +++---------------------------------------- src/xfont.c | 1 - src/xterm.c | 9 --------- 19 files changed, 50 insertions(+), 84 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 4986726d7c8..a5978e6456b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,37 @@ 2012-09-02 Paul Eggert + Clean up some extern decls. + Mostly, this hoists extern decls out of .c files and into .h files. + That way, we're more likely to catch errors if the interfaces change. + * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not + declare xg_mark_data. + * dispextern.h (x_frame_parm_handlers): + * font.h (Qxft): + * lisp.h (Qlexical_binding, Qinternal_interpreter_environment) + (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold) + (Qultra_bold, Qoblique, Qitalic): + Move extern decl here from .c file. + * alloc.c (xg_mark_data) [USE_GTK]: + * doc.c (Qclosure): + * eval.c (Qlexical_binding): + * fns.c (time) [!HAVE_UNISTD_H]: + * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light) + (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic): + * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]: + * lread.c (Qinternal_interpreter_environment): + * minibuf.c (Qbuffer): + * process.c (QCfamily, QCfilter): + * widget.c (free_frame_faces): + * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]: + * xfont.c (x_clear_errors): + * xterm.c (x_frame_parm_handlers): + Remove now-redundant extern decls. + * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]: + * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic): + Now static. + * xfaces.c: Remove unnecessary static decls. + * xterm.c (updating_frame): Remove decl of nonexistent object. + * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS) when building globals.h, as the objects that are not built on this host are not needed to compile C files on this host. diff --git a/src/alloc.c b/src/alloc.c index e8637471bc7..188a514376d 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -69,6 +69,9 @@ extern void *sbrk (); #include +#ifdef USE_GTK +# include "gtkutil.h" +#endif #ifdef WINDOWSNT #include "w32.h" #endif @@ -5478,10 +5481,7 @@ See Info node `(elisp)Garbage Collection'. */) mark_kboards (); #ifdef USE_GTK - { - extern void xg_mark_data (void); - xg_mark_data (); - } + xg_mark_data (); #endif #if (GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS \ diff --git a/src/dispextern.h b/src/dispextern.h index 1140d98f8a7..e74e7deb591 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3251,9 +3251,12 @@ void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object); extern Lisp_Object tip_frame; extern Window tip_window; +extern frame_parm_handler x_frame_parm_handlers[]; + extern void start_hourglass (void); extern void cancel_hourglass (void); extern int hourglass_shown_p; + struct atimer; /* Defined in atimer.h. */ /* If non-null, an asynchronous timer that, when it expires, displays an hourglass cursor on all frames. */ diff --git a/src/doc.c b/src/doc.c index b4eadfff875..02a5b4b8143 100644 --- a/src/doc.c +++ b/src/doc.c @@ -37,7 +37,6 @@ along with GNU Emacs. If not, see . */ Lisp_Object Qfunction_documentation; -extern Lisp_Object Qclosure; /* Buffer used for reading from documentation file. */ static char *get_doc_string_buffer; static ptrdiff_t get_doc_string_buffer_size; diff --git a/src/eval.c b/src/eval.c index c56be10c5a0..ad1daf721b8 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2232,7 +2232,6 @@ eval_sub (Lisp_Object form) if (EQ (funcar, Qmacro)) { ptrdiff_t count = SPECPDL_INDEX (); - extern Lisp_Object Qlexical_binding; Lisp_Object exp; /* Bind lexical-binding during expansion of the macro, so the macro can know reliably if the code it outputs will be diff --git a/src/fns.c b/src/fns.c index 2dee8515799..4d82e4e6e1d 100644 --- a/src/fns.c +++ b/src/fns.c @@ -52,10 +52,6 @@ static Lisp_Object Qcodeset, Qdays, Qmonths, Qpaper; static Lisp_Object Qmd5, Qsha1, Qsha224, Qsha256, Qsha384, Qsha512; static int internal_equal (Lisp_Object , Lisp_Object, int, int); - -#ifndef HAVE_UNISTD_H -extern long time (); -#endif DEFUN ("identity", Fidentity, Sidentity, 1, 1, 0, doc: /* Return the argument unchanged. */) diff --git a/src/font.h b/src/font.h index 6e9387f7632..3b90bc2ab8a 100644 --- a/src/font.h +++ b/src/font.h @@ -817,6 +817,7 @@ extern struct font_driver xfont_driver; extern void syms_of_xfont (void); extern void syms_of_ftxfont (void); #ifdef HAVE_XFT +extern Lisp_Object Qxft; extern struct font_driver xftfont_driver; extern void syms_of_xftfont (void); #elif defined HAVE_FREETYPE diff --git a/src/gtkutil.c b/src/gtkutil.c index 939e472d6d2..48a83725fd9 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -2019,11 +2019,6 @@ xg_get_file_name (FRAME_PTR f, #if USE_NEW_GTK_FONT_CHOOSER -extern Lisp_Object Qxft, Qnormal; -extern Lisp_Object Qextra_light, Qlight, Qsemi_light, Qsemi_bold; -extern Lisp_Object Qbold, Qextra_bold, Qultra_bold; -extern Lisp_Object Qoblique, Qitalic; - #define XG_WEIGHT_TO_SYMBOL(w) \ (w <= PANGO_WEIGHT_THIN ? Qextra_light \ : w <= PANGO_WEIGHT_ULTRALIGHT ? Qlight \ diff --git a/src/image.c b/src/image.c index d4e78d41000..a067dae7737 100644 --- a/src/image.c +++ b/src/image.c @@ -570,7 +570,6 @@ static void x_emboss (struct frame *, struct image *); static int x_build_heuristic_mask (struct frame *, struct image *, Lisp_Object); #ifdef HAVE_NTGUI -extern Lisp_Object Vlibrary_cache, QCloaded_from; #define CACHE_IMAGE_TYPE(type, status) \ do { Vlibrary_cache = Fcons (Fcons (type, status), Vlibrary_cache); } while (0) #else diff --git a/src/keyboard.c b/src/keyboard.c index ff2b75e351c..464c3ae0d66 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1315,7 +1315,7 @@ usage: (track-mouse BODY...) */) If ignore_mouse_drag_p is non-zero, ignore (implicit) mouse movement after resizing the tool-bar window. */ -#if !defined HAVE_WINDOW_SYSTEM +#if !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS static #endif int ignore_mouse_drag_p; diff --git a/src/keyboard.h b/src/keyboard.h index 98b1933f3f9..91484b3649b 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -469,7 +469,7 @@ extern int waiting_for_input; happens. */ extern EMACS_TIME *input_available_clear_time; -#if defined HAVE_WINDOW_SYSTEM +#if defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS extern int ignore_mouse_drag_p; #endif diff --git a/src/lisp.h b/src/lisp.h index b906e4a1dfd..75f1b5e802d 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2988,6 +2988,7 @@ extern ptrdiff_t evxprintf (char **, ptrdiff_t *, char const *, ptrdiff_t, /* Defined in lread.c. */ extern Lisp_Object Qvariable_documentation, Qstandard_input; extern Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction; +extern Lisp_Object Qlexical_binding; extern Lisp_Object check_obarray (Lisp_Object); extern Lisp_Object intern_1 (const char *, ptrdiff_t); extern Lisp_Object intern_c_string_1 (const char *, ptrdiff_t); @@ -3021,7 +3022,7 @@ intern_c_string (const char *str) /* Defined in eval.c. */ extern Lisp_Object Qautoload, Qexit, Qinteractive, Qcommandp, Qmacro; -extern Lisp_Object Qinhibit_quit, Qclosure; +extern Lisp_Object Qinhibit_quit, Qinternal_interpreter_environment, Qclosure; extern Lisp_Object Qand_rest; extern Lisp_Object Vautoload_queue; extern Lisp_Object Vsignaling_function; @@ -3466,6 +3467,9 @@ extern Lisp_Object Qface; extern Lisp_Object Qnormal; extern Lisp_Object QCfamily, QCweight, QCslant; extern Lisp_Object QCheight, QCname, QCwidth, QCforeground, QCbackground; +extern Lisp_Object Qextra_light, Qlight, Qsemi_light, Qsemi_bold; +extern Lisp_Object Qbold, Qextra_bold, Qultra_bold; +extern Lisp_Object Qoblique, Qitalic; extern Lisp_Object Vface_alternative_font_family_alist; extern Lisp_Object Vface_alternative_font_registry_alist; extern void syms_of_xfaces (void); diff --git a/src/lread.c b/src/lread.c index aa3e0cfc5b8..1dd6275684b 100644 --- a/src/lread.c +++ b/src/lread.c @@ -89,8 +89,6 @@ static Lisp_Object Qget_emacs_mule_file_char; static Lisp_Object Qload_force_doc_strings; -extern Lisp_Object Qinternal_interpreter_environment; - static Lisp_Object Qload_in_progress; /* The association list of objects read with the #n=object form. diff --git a/src/minibuf.c b/src/minibuf.c index 41cc48017eb..2035a3e3985 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1860,7 +1860,6 @@ the values STRING, PREDICATE and `lambda'. */) } static Lisp_Object Qmetadata; -extern Lisp_Object Qbuffer; DEFUN ("internal-complete-buffer", Finternal_complete_buffer, Sinternal_complete_buffer, 3, 3, 0, doc: /* Perform completion on buffer names. diff --git a/src/process.c b/src/process.c index bfac054c3c2..81fa98a028d 100644 --- a/src/process.c +++ b/src/process.c @@ -165,16 +165,6 @@ static Lisp_Object QClocal, QCremote, QCcoding; static Lisp_Object QCserver, QCnowait, QCnoquery, QCstop; static Lisp_Object QCsentinel, QClog, QCoptions, QCplist; static Lisp_Object Qlast_nonmenu_event; -/* QCfamily is declared and initialized in xfaces.c, - QCfilter in keyboard.c. */ -extern Lisp_Object QCfamily, QCfilter; - -/* Qexit is declared and initialized in eval.c. */ - -/* QCfamily is defined in xfaces.c. */ -extern Lisp_Object QCfamily; -/* QCfilter is defined in keyboard.c. */ -extern Lisp_Object QCfilter; #define NETCONN_P(p) (EQ (XPROCESS (p)->type, Qnetwork)) #define NETCONN1_P(p) (EQ (p->type, Qnetwork)) diff --git a/src/widget.c b/src/widget.c index b94c30f4e9c..ea9bdb61b13 100644 --- a/src/widget.c +++ b/src/widget.c @@ -671,8 +671,6 @@ EmacsFrameRealize (Widget widget, XtValueMask *mask, XSetWindowAttributes *attrs update_wm_hints (ew); } -extern void free_frame_faces (struct frame *); - static void EmacsFrameDestroy (Widget widget) { diff --git a/src/xfaces.c b/src/xfaces.c index 5554c4aa705..4df5caf6f2a 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -315,9 +315,10 @@ static Lisp_Object QCfontset; Lisp_Object Qnormal; Lisp_Object Qbold; static Lisp_Object Qline, Qwave; -Lisp_Object Qultra_light, Qextra_light, Qlight; +static Lisp_Object Qultra_light, Qreverse_oblique, Qreverse_italic; +Lisp_Object Qextra_light, Qlight; Lisp_Object Qsemi_light, Qsemi_bold, Qextra_bold, Qultra_bold; -Lisp_Object Qoblique, Qreverse_oblique, Qreverse_italic; +Lisp_Object Qoblique; Lisp_Object Qitalic; static Lisp_Object Qultra_condensed, Qextra_condensed; Lisp_Object Qcondensed; @@ -452,18 +453,7 @@ static int menu_face_changed_default; struct table_entry; struct named_merge_point; -static void map_tty_color (struct frame *, struct face *, - enum lface_attribute_index, int *); -static Lisp_Object resolve_face_name (Lisp_Object, int); static void set_font_frame_param (Lisp_Object, Lisp_Object); -static int get_lface_attributes (struct frame *, Lisp_Object, Lisp_Object *, - int, struct named_merge_point *); -static ptrdiff_t load_pixmap (struct frame *, Lisp_Object, - unsigned *, unsigned *); -static struct frame *frame_or_selected_frame (Lisp_Object, int); -static void load_face_colors (struct frame *, struct face *, Lisp_Object *); -static void free_face_colors (struct frame *, struct face *); -static int face_color_gray_p (struct frame *, const char *); static struct face *realize_face (struct face_cache *, Lisp_Object *, int); static struct face *realize_non_ascii_face (struct frame *, Lisp_Object, @@ -473,38 +463,11 @@ static struct face *realize_tty_face (struct face_cache *, Lisp_Object *); static int realize_basic_faces (struct frame *); static int realize_default_face (struct frame *); static void realize_named_face (struct frame *, Lisp_Object, int); -static int lface_fully_specified_p (Lisp_Object *); -static int lface_equal_p (Lisp_Object *, Lisp_Object *); -static unsigned hash_string_case_insensitive (Lisp_Object); -static unsigned lface_hash (Lisp_Object *); -static int lface_same_font_attributes_p (Lisp_Object *, Lisp_Object *); static struct face_cache *make_face_cache (struct frame *); static void clear_face_gcs (struct face_cache *); static void free_face_cache (struct face_cache *); -static int face_fontset (Lisp_Object *); -static void merge_face_vectors (struct frame *, Lisp_Object *, Lisp_Object*, - struct named_merge_point *); static int merge_face_ref (struct frame *, Lisp_Object, Lisp_Object *, int, struct named_merge_point *); -static int set_lface_from_font (struct frame *, Lisp_Object, Lisp_Object, - int); -static Lisp_Object lface_from_face_name (struct frame *, Lisp_Object, int); -static struct face *make_realized_face (Lisp_Object *); -static void cache_face (struct face_cache *, struct face *, unsigned); -static void uncache_face (struct face_cache *, struct face *); - -#ifdef HAVE_WINDOW_SYSTEM - -static GC x_create_gc (struct frame *, unsigned long, XGCValues *); -static void x_free_gc (struct frame *, GC); - -#ifdef USE_X_TOOLKIT -static void x_update_menu_appearance (struct frame *); - -extern void free_frame_menubar (struct frame *); -#endif /* USE_X_TOOLKIT */ - -#endif /* HAVE_WINDOW_SYSTEM */ /*********************************************************************** diff --git a/src/xfont.c b/src/xfont.c index cbb24622ae9..be9556d585a 100644 --- a/src/xfont.c +++ b/src/xfont.c @@ -46,7 +46,6 @@ struct xfont_info }; /* Prototypes of support functions. */ -extern void x_clear_errors (Display *); static XCharStruct *xfont_get_pcm (XFontStruct *, XChar2b *); diff --git a/src/xterm.c b/src/xterm.c index 7e61cc4d8ea..052db0f3e63 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -165,13 +165,6 @@ struct x_display_info *x_display_list; Lisp_Object x_display_name_list; -/* Frame being updated by update_frame. This is declared in term.c. - This is set by update_begin and looked at by all the XT functions. - It is zero while not inside an update. In that case, the XT - functions assume that `selected_frame' is the frame to apply to. */ - -extern struct frame *updating_frame; - /* This is a frame waiting to be auto-raised, within XTread_socket. */ static struct frame *pending_autoraise_frame; @@ -10609,8 +10602,6 @@ x_activate_timeout_atimer (void) /* Set up use of X before we make the first connection. */ -extern frame_parm_handler x_frame_parm_handlers[]; - static struct redisplay_interface x_redisplay_interface = { x_frame_parm_handlers, From 1882aa387874f0ac0965fa7bec1c5760dc37e48f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 2 Sep 2012 10:10:35 -0700 Subject: [PATCH 207/212] * emacs.c, eval.c: Use bool for boolean. * emacs.c (initialized, inhibit_window_system, running_asynch_code): (malloc_using_checking) [DOUG_LEA_MALLOC]: (display_arg) [HAVE_X_WINDOWS || HAVE_NS]: (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch) (main, decode_env_path, Fdaemon_initialized): * eval.c (call_debugger, Finteractive_p, interactive_p): (unwind_to_catch, Fsignal, wants_debugger, skip_debugger) (maybe_call_debugger, Fbacktrace): * process.c (read_process_output, exec_sentinel): Use bool for booleans. * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X. All callers changed. * eval.c (interactive_p): Omit always-true boolean argument EXCLUDE_SUBRS_P. All callers changed. * dispextern.h, lisp.h: Reflect above API changes. * firstfile.c (dummy): Use the address of 'main', whose signature won't change, instead of the address of 'initialize', whose signature just changed from int to bool. * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ... * msdos.c (fatal_error_in_progress): ... from here. * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead of incrementing it. (redisplay_internal, unwind_redisplay): Simply clear REDISPLAYING_P when unwinding, instead of saving its previous, always-false value and then restoring it. --- src/ChangeLog | 27 +++++++++++++++++++++ src/dispextern.h | 2 +- src/emacs.c | 63 ++++++++++++++++++++---------------------------- src/eval.c | 58 +++++++++++++++++++++----------------------- src/firstfile.c | 5 ++-- src/lisp.h | 28 ++++++++++++--------- src/msdos.c | 1 - src/process.c | 6 ++--- src/w32.c | 2 +- src/xdisp.c | 25 +++++++------------ src/xterm.c | 2 +- 11 files changed, 114 insertions(+), 105 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index a5978e6456b..2053c258df4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,32 @@ 2012-09-02 Paul Eggert + * emacs.c, eval.c: Use bool for boolean. + * emacs.c (initialized, inhibit_window_system, running_asynch_code): + (malloc_using_checking) [DOUG_LEA_MALLOC]: + (display_arg) [HAVE_X_WINDOWS || HAVE_NS]: + (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch) + (main, decode_env_path, Fdaemon_initialized): + * eval.c (call_debugger, Finteractive_p, interactive_p): + (unwind_to_catch, Fsignal, wants_debugger, skip_debugger) + (maybe_call_debugger, Fbacktrace): + * process.c (read_process_output, exec_sentinel): + Use bool for booleans. + * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X. + All callers changed. + * eval.c (interactive_p): Omit always-true boolean argument + EXCLUDE_SUBRS_P. All callers changed. + * dispextern.h, lisp.h: Reflect above API changes. + * firstfile.c (dummy): Use the address of 'main', whose signature + won't change, instead of the address of 'initialize', whose + signature just changed from int to bool. + * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ... + * msdos.c (fatal_error_in_progress): ... from here. + * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead + of incrementing it. + (redisplay_internal, unwind_redisplay): Simply clear + REDISPLAYING_P when unwinding, instead of saving its previous, + always-false value and then restoring it. + Clean up some extern decls. Mostly, this hoists extern decls out of .c files and into .h files. That way, we're more likely to catch errors if the interfaces change. diff --git a/src/dispextern.h b/src/dispextern.h index e74e7deb591..73f3350713f 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3055,7 +3055,7 @@ void move_it_in_display_line (struct it *it, int in_display_vector_p (struct it *); int frame_mode_line_height (struct frame *); extern Lisp_Object Qtool_bar; -extern int redisplaying_p; +extern bool redisplaying_p; extern int help_echo_showing_p; extern int current_mode_line_height, current_header_line_height; extern Lisp_Object help_echo_string, help_echo_window; diff --git a/src/emacs.c b/src/emacs.c index adfff6ff3ed..dac5edd544f 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -95,10 +95,10 @@ static const char emacs_copyright[] = "Copyright (C) 2012 Free Software Foundati /* Empty lisp strings. To avoid having to build any others. */ Lisp_Object empty_unibyte_string, empty_multibyte_string; -/* Set nonzero after Emacs has started up the first time. - Prevents reinitialization of the Lisp world and keymaps - on subsequent starts. */ -int initialized; +/* Set after Emacs has started up the first time. + Prevents reinitialization of the Lisp world and keymaps + on subsequent starts. */ +bool initialized; #ifdef DARWIN_OS extern void unexec_init_emacs_zone (void); @@ -112,9 +112,9 @@ static void *malloc_state_ptr; extern void *malloc_get_state (void); /* From glibc, a routine that overwrites the malloc internal state. */ extern int malloc_set_state (void*); -/* Non-zero if the MALLOC_CHECK_ environment variable was set while +/* True if the MALLOC_CHECK_ environment variable was set while dumping. Used to work around a bug in glibc's malloc. */ -static int malloc_using_checking; +static bool malloc_using_checking; #endif Lisp_Object Qfile_name_handler_alist; @@ -123,17 +123,17 @@ Lisp_Object Qrisky_local_variable; Lisp_Object Qkill_emacs; -/* If non-zero, Emacs should not attempt to use a window-specific code, +/* If true, Emacs should not attempt to use a window-specific code, but instead should use the virtual terminal under which it was started. */ -int inhibit_window_system; +bool inhibit_window_system; -/* If non-zero, a filter or a sentinel is running. Tested to save the match +/* If true, a filter or a sentinel is running. Tested to save the match data on the first attempt to change it inside asynchronous code. */ -int running_asynch_code; +bool running_asynch_code; #if defined (HAVE_X_WINDOWS) || defined (HAVE_NS) -/* If non-zero, -d was specified, meaning we're using some window system. */ -int display_arg; +/* If true, -d was specified, meaning we're using some window system. */ +bool display_arg; #endif /* An address near the bottom of the stack. @@ -150,11 +150,11 @@ static void *my_heap_start; static uprintmax_t heap_bss_diff; #endif -/* Nonzero means running Emacs without interactive terminal. */ -int noninteractive; +/* True means running Emacs without interactive terminal. */ +bool noninteractive; -/* Nonzero means remove site-lisp directories from load-path. */ -int no_site_lisp; +/* True means remove site-lisp directories from load-path. */ +bool no_site_lisp; /* Name for the server started by the daemon.*/ static char *daemon_name; @@ -272,8 +272,8 @@ section of the Emacs manual or the file BUGS.\n" /* Signal code for the fatal signal that was received. */ static int fatal_error_code; -/* Nonzero if handling a fatal error already. */ -int fatal_error_in_progress; +/* True if handling a fatal error already. */ +bool fatal_error_in_progress; #ifdef FORWARD_SIGNAL_TO_MAIN_THREAD /* When compiled with GTK and running under Gnome, @@ -311,7 +311,7 @@ fatal_error_signal (int sig) if (sig == SIGTERM || sig == SIGHUP || sig == SIGINT) Fkill_emacs (make_number (sig)); - shut_down_emacs (sig, 0, Qnil); + shut_down_emacs (sig, Qnil); } /* Signal the same code; this time it will really be fatal. @@ -568,7 +568,7 @@ DEFINE_DUMMY_FUNCTION (__main) Too bad we can't just use getopt for all of this, but we don't have enough information to do it right. */ -static int +static bool argmatch (char **argv, int argc, const char *sstr, const char *lstr, int minlen, char **valptr, int *skipptr) { @@ -675,12 +675,12 @@ main (int argc, char **argv) Lisp_Object dummy; #endif char stack_bottom_variable; - int do_initial_setlocale; + bool do_initial_setlocale; int skip_args = 0; #ifdef HAVE_SETRLIMIT struct rlimit rlim; #endif - int no_loadup = 0; + bool no_loadup = 0; char *junk = 0; char *dname_arg = 0; #ifdef NS_IMPL_COCOA @@ -1955,7 +1955,7 @@ all of which are called before Emacs is actually killed. */) x_clipboard_manager_save_all (); #endif - shut_down_emacs (0, 0, STRINGP (arg) ? arg : Qnil); + shut_down_emacs (0, STRINGP (arg) ? arg : Qnil); #ifdef HAVE_NS ns_release_autorelease_pool (ns_pool); @@ -1991,7 +1991,7 @@ all of which are called before Emacs is actually killed. */) and Fkill_emacs. */ void -shut_down_emacs (int sig, int no_x, Lisp_Object stuff) +shut_down_emacs (int sig, Lisp_Object stuff) { /* Prevent running of hooks from now on. */ Vrun_hooks = Qnil; @@ -2026,17 +2026,6 @@ shut_down_emacs (int sig, int no_x, Lisp_Object stuff) unlock_all_files (); #endif -#if 0 /* This triggers a bug in XCloseDisplay and is not needed. */ -#ifdef HAVE_X_WINDOWS - /* It's not safe to call intern here. Maybe we are crashing. */ - if (!noninteractive && SYMBOLP (Vinitial_window_system) - && SCHARS (SYMBOL_NAME (Vinitial_window_system)) == 1 - && SREF (SYMBOL_NAME (Vinitial_window_system), 0) == 'x' - && ! no_x) - Fx_close_current_connection (); -#endif /* HAVE_X_WINDOWS */ -#endif - #ifdef SIGIO /* There is a tendency for a SIGIO signal to arrive within exit, and cause a SIGHUP because the input descriptor is already closed. */ @@ -2228,7 +2217,7 @@ decode_env_path (const char *evarname, const char *defalt) const char *path, *p; Lisp_Object lpath, element, tem; #ifdef WINDOWSNT - int defaulted = 0; + bool defaulted = 0; const char *emacs_dir = egetenv ("emacs_dir"); static const char *emacs_dir_env = "%emacs_dir%/"; const size_t emacs_dir_len = strlen (emacs_dir_env); @@ -2324,7 +2313,7 @@ from the parent process and its tty file descriptors. */) (void) { int nfd; - int err = 0; + bool err = 0; if (!IS_DAEMON) error ("This function can only be called if emacs is run as a daemon"); diff --git a/src/eval.c b/src/eval.c index ad1daf721b8..3a4953665e3 100644 --- a/src/eval.c +++ b/src/eval.c @@ -131,7 +131,7 @@ int handling_signal; Lisp_Object inhibit_lisp_code; static Lisp_Object funcall_lambda (Lisp_Object, ptrdiff_t, Lisp_Object *); -static int interactive_p (int); +static bool interactive_p (void); static Lisp_Object apply_lambda (Lisp_Object fun, Lisp_Object args); /* Functions to set Lisp_Object slots of struct specbinding. */ @@ -194,7 +194,7 @@ restore_stack_limits (Lisp_Object data) static Lisp_Object call_debugger (Lisp_Object arg) { - int debug_while_redisplaying; + bool debug_while_redisplaying; ptrdiff_t count = SPECPDL_INDEX (); Lisp_Object val; EMACS_INT old_max = max_specpdl_size; @@ -525,7 +525,7 @@ spec that specifies non-nil unconditionally (such as \"p\"); or (ii) use `called-interactively-p'. */) (void) { - return interactive_p (1) ? Qt : Qnil; + return interactive_p () ? Qt : Qnil; } @@ -550,19 +550,17 @@ non-nil unconditionally (\"p\" is a good way to do this), or via \(not (or executing-kbd-macro noninteractive)). */) (Lisp_Object kind) { - return ((INTERACTIVE || !EQ (kind, intern ("interactive"))) - && interactive_p (1)) ? Qt : Qnil; + return (((INTERACTIVE || !EQ (kind, intern ("interactive"))) + && interactive_p ()) + ? Qt : Qnil); } -/* Return 1 if function in which this appears was called using - call-interactively. +/* Return true if function in which this appears was called using + call-interactively and is not a built-in. */ - EXCLUDE_SUBRS_P non-zero means always return 0 if the function - called is a built-in. */ - -static int -interactive_p (int exclude_subrs_p) +static bool +interactive_p (void) { struct backtrace *btp; Lisp_Object fun; @@ -591,9 +589,9 @@ interactive_p (int exclude_subrs_p) /* `btp' now points at the frame of the innermost function that isn't a special form, ignoring frames for Finteractive_p and/or Fbytecode at the top. If this frame is for a built-in function - (such as load or eval-region) return nil. */ + (such as load or eval-region) return false. */ fun = Findirect_function (*btp->function, Qnil); - if (exclude_subrs_p && SUBRP (fun)) + if (SUBRP (fun)) return 0; /* `btp' points to the frame of a Lisp function that called interactive-p. @@ -1101,7 +1099,7 @@ internal_catch (Lisp_Object tag, Lisp_Object (*func) (Lisp_Object), Lisp_Object static _Noreturn void unwind_to_catch (struct catchtag *catch, Lisp_Object value) { - int last_time; + bool last_time; /* Save the value in the tag. */ catch->val = value; @@ -1450,8 +1448,8 @@ internal_condition_case_n (Lisp_Object (*bfun) (ptrdiff_t, Lisp_Object *), static Lisp_Object find_handler_clause (Lisp_Object, Lisp_Object); -static int maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig, - Lisp_Object data); +static bool maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig, + Lisp_Object data); void process_quit_flag (void) @@ -1556,7 +1554,7 @@ See also the function `condition-case'. */) if requested". */ || EQ (h->handler, Qerror))) { - int debugger_called + bool debugger_called = maybe_call_debugger (conditions, error_symbol, data); /* We can't return values to code which signaled an error, but we can continue code which has signaled a quit. */ @@ -1650,10 +1648,10 @@ signal_error (const char *s, Lisp_Object arg) } -/* Return nonzero if LIST is a non-nil atom or +/* Return true if LIST is a non-nil atom or a list containing one of CONDITIONS. */ -static int +static bool wants_debugger (Lisp_Object list, Lisp_Object conditions) { if (NILP (list)) @@ -1673,15 +1671,15 @@ wants_debugger (Lisp_Object list, Lisp_Object conditions) return 0; } -/* Return 1 if an error with condition-symbols CONDITIONS, +/* Return true if an error with condition-symbols CONDITIONS, and described by SIGNAL-DATA, should skip the debugger according to debugger-ignored-errors. */ -static int +static bool skip_debugger (Lisp_Object conditions, Lisp_Object data) { Lisp_Object tail; - int first_string = 1; + bool first_string = 1; Lisp_Object error_message; error_message = Qnil; @@ -1716,7 +1714,7 @@ skip_debugger (Lisp_Object conditions, Lisp_Object data) = SIG is the error symbol, and DATA is the rest of the data. = SIG is nil, and DATA is (SYMBOL . REST-OF-DATA). This is for memory-full errors only. */ -static int +static bool maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig, Lisp_Object data) { Lisp_Object combined_data; @@ -2939,7 +2937,7 @@ funcall_lambda (Lisp_Object fun, ptrdiff_t nargs, Lisp_Object val, syms_left, next, lexenv; ptrdiff_t count = SPECPDL_INDEX (); ptrdiff_t i; - int optional, rest; + bool optional, rest; if (CONSP (fun)) { @@ -3342,13 +3340,13 @@ Output stream used is value of `standard-output'. */) write_string ("(", -1); if (backlist->nargs == MANY) { /* FIXME: Can this happen? */ - int i; - for (tail = *backlist->args, i = 0; - !NILP (tail); - tail = Fcdr (tail), i = 1) + bool later_arg = 0; + for (tail = *backlist->args; !NILP (tail); tail = Fcdr (tail)) { - if (i) write_string (" ", -1); + if (later_arg) + write_string (" ", -1); Fprin1 (Fcar (tail), Qnil); + later_arg = 1; } } else diff --git a/src/firstfile.c b/src/firstfile.c index 84511cfe0ad..444fb71b55d 100644 --- a/src/firstfile.c +++ b/src/firstfile.c @@ -27,7 +27,6 @@ static char _my_begbss[1]; char * my_begbss_static = _my_begbss; /* Add a dummy reference to ensure emacs.obj is linked in. */ -extern int initialized; -static int * dummy = &initialized; +extern int main (int, char **); +static int (*dummy) (int, char **) = main; #endif - diff --git a/src/lisp.h b/src/lisp.h index 75f1b5e802d..35a07c838fb 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3258,7 +3258,7 @@ extern void syms_of_frame (void); extern char **initial_argv; extern int initial_argc; #if defined (HAVE_X_WINDOWS) || defined (HAVE_NS) -extern int display_arg; +extern bool display_arg; #endif extern Lisp_Object decode_env_path (const char *, const char *); extern Lisp_Object empty_unibyte_string, empty_multibyte_string; @@ -3277,22 +3277,26 @@ void synchronize_system_time_locale (void); #define synchronize_system_messages_locale() #define synchronize_system_time_locale() #endif -void shut_down_emacs (int, int, Lisp_Object); -/* Nonzero means don't do interactive redisplay and don't change tty modes. */ -extern int noninteractive; +extern void shut_down_emacs (int, Lisp_Object); -/* Nonzero means remove site-lisp directories from load-path. */ -extern int no_site_lisp; +/* True means don't do interactive redisplay and don't change tty modes. */ +extern bool noninteractive; + +/* True means remove site-lisp directories from load-path. */ +extern bool no_site_lisp; /* Pipe used to send exit notification to the daemon parent at startup. */ extern int daemon_pipe[2]; #define IS_DAEMON (daemon_pipe[1] != 0) -/* Nonzero means don't do use window-system-specific display code. */ -extern int inhibit_window_system; -/* Nonzero means that a filter or a sentinel is running. */ -extern int running_asynch_code; +/* True if handling a fatal error already. */ +extern bool fatal_error_in_progress; + +/* True means don't do use window-system-specific display code. */ +extern bool inhibit_window_system; +/* True means that a filter or a sentinel is running. */ +extern bool running_asynch_code; /* Defined in process.c. */ extern Lisp_Object QCtype, Qlocal; @@ -3514,9 +3518,9 @@ void syms_of_dbusbind (void); extern char *emacs_root_dir (void); #endif /* DOS_NT */ -/* Nonzero means Emacs has already been initialized. +/* True means Emacs has already been initialized. Used during startup to detect startup of dumped Emacs. */ -extern int initialized; +extern bool initialized; extern int immediate_quit; /* Nonzero means ^G can quit instantly */ diff --git a/src/msdos.c b/src/msdos.c index a214456d104..ac348e94375 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -1029,7 +1029,6 @@ IT_clear_end_of_line (struct frame *f, int first_unused) { char *spaces, *sp; int i, j, offset = 2 * (new_pos_X + screen_size_X * new_pos_Y); - extern int fatal_error_in_progress; struct tty_display_info *tty = FRAME_TTY (f); if (new_pos_X >= first_unused || fatal_error_in_progress) diff --git a/src/process.c b/src/process.c index 81fa98a028d..04b6abe50a7 100644 --- a/src/process.c +++ b/src/process.c @@ -5194,7 +5194,7 @@ read_process_output (Lisp_Object proc, register int channel) if (!NILP (outstream)) { Lisp_Object text; - int outer_running_asynch_code = running_asynch_code; + bool outer_running_asynch_code = running_asynch_code; int waiting = waiting_for_user_input_p; /* No need to gcpro these, because all we do with them later @@ -6558,9 +6558,9 @@ static void exec_sentinel (Lisp_Object proc, Lisp_Object reason) { Lisp_Object sentinel, odeactivate; - register struct Lisp_Process *p = XPROCESS (proc); + struct Lisp_Process *p = XPROCESS (proc); ptrdiff_t count = SPECPDL_INDEX (); - int outer_running_asynch_code = running_asynch_code; + bool outer_running_asynch_code = running_asynch_code; int waiting = waiting_for_user_input_p; if (inhibit_sentinels) diff --git a/src/w32.c b/src/w32.c index 84a46e522bb..fe612687f48 100644 --- a/src/w32.c +++ b/src/w32.c @@ -6773,7 +6773,7 @@ shutdown_handler (DWORD type) || type == CTRL_SHUTDOWN_EVENT) /* User shutsdown. */ { /* Shut down cleanly, making sure autosave files are up to date. */ - shut_down_emacs (0, 0, Qnil); + shut_down_emacs (0, Qnil); } /* Allow other handlers to handle this signal. */ diff --git a/src/xdisp.c b/src/xdisp.c index 13b03736bde..86f041dea4d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -768,9 +768,9 @@ static int clear_image_cache_count; static struct glyph_slice null_glyph_slice = { 0, 0, 0, 0 }; #endif -/* Non-zero while redisplay_internal is in progress. */ +/* True while redisplay_internal is in progress. */ -int redisplaying_p; +bool redisplaying_p; static Lisp_Object Qinhibit_free_realized_faces; static Lisp_Object Qmode_line_default_help_echo; @@ -12966,12 +12966,11 @@ redisplay_internal (void) if (redisplaying_p) return; - /* Record a function that resets redisplaying_p to its old value + /* Record a function that clears redisplaying_p when we leave this function. */ count = SPECPDL_INDEX (); - record_unwind_protect (unwind_redisplay, - Fcons (make_number (redisplaying_p), selected_frame)); - ++redisplaying_p; + record_unwind_protect (unwind_redisplay, selected_frame); + redisplaying_p = 1; specbind (Qinhibit_free_realized_faces, Qnil); { @@ -13709,21 +13708,15 @@ redisplay_preserve_echo_area (int from_where) } -/* Function registered with record_unwind_protect in - redisplay_internal. Reset redisplaying_p to the value it had - before redisplay_internal was called, and clear - prevent_freeing_realized_faces_p. It also selects the previously +/* Function registered with record_unwind_protect in redisplay_internal. + Clear redisplaying_p. Also, select the previously selected frame, unless it has been deleted (by an X connection failure during redisplay, for example). */ static Lisp_Object -unwind_redisplay (Lisp_Object val) +unwind_redisplay (Lisp_Object old_frame) { - Lisp_Object old_redisplaying_p, old_frame; - - old_redisplaying_p = XCAR (val); - redisplaying_p = XFASTINT (old_redisplaying_p); - old_frame = XCDR (val); + redisplaying_p = 0; if (! EQ (old_frame, selected_frame) && FRAME_LIVE_P (XFRAME (old_frame))) select_frame_for_redisplay (old_frame); diff --git a/src/xterm.c b/src/xterm.c index 052db0f3e63..f497b5322bf 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -7843,7 +7843,7 @@ x_connection_closed (Display *dpy, const char *error_message) (https://bugzilla.gnome.org/show_bug.cgi?id=85715). Once, the resulting Glib error message loop filled a user's disk. To avoid this, kill Emacs unconditionally on disconnect. */ - shut_down_emacs (0, 0, Qnil); + shut_down_emacs (0, Qnil); fprintf (stderr, "%s\n\ When compiled with GTK, Emacs cannot recover from X disconnects.\n\ This is a GTK bug: https://bugzilla.gnome.org/show_bug.cgi?id=85715\n\ From 3eab3ca987b74c54788052bbace0fc5c8e93363c Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 3 Sep 2012 16:13:33 +0800 Subject: [PATCH 208/212] * gtkutil.c: Add extern decl for Qxft. --- src/ChangeLog | 4 ++++ src/gtkutil.c | 1 + 2 files changed, 5 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 2053c258df4..c781204e679 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-09-03 Chong Yidong + + * gtkutil.c: Add extern decl for Qxft. + 2012-09-02 Paul Eggert * emacs.c, eval.c: Use bool for boolean. diff --git a/src/gtkutil.c b/src/gtkutil.c index 48a83725fd9..f0d2c022f0c 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -2038,6 +2038,7 @@ xg_get_file_name (FRAME_PTR f, static char *x_last_font_name; +extern Lisp_Object Qxft; /* Pop up a GTK font selector and return the name of the font the user selects, as a C string. The returned font name follows GTK's own From c5e28e39275c4a5a63adbe3e1e3b23a58c4a4bb8 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Mon, 3 Sep 2012 10:54:25 +0200 Subject: [PATCH 209/212] New macro with-temp-buffer-window and related fixes. * buffer.c (Fdelete_all_overlays): New function. * window.el (temp-buffer-window-setup-hook) (temp-buffer-window-show-hook): New hooks. (temp-buffer-window-setup, temp-buffer-window-show) (with-temp-buffer-window): New functions. (fit-window-to-buffer): Remove unused optional argument OVERRIDE. (special-display-popup-frame): Make sure the window used shows BUFFER. * help.el (temp-buffer-resize-mode): Fix doc-string. (resize-temp-buffer-window): New optional argument WINDOW. * files.el (recover-file, save-buffers-kill-emacs): * dired.el (dired-mark-pop-up): Use with-temp-buffer-window. --- etc/NEWS | 4 ++ lisp/ChangeLog | 17 ++++++ lisp/dired.el | 49 +++++++++-------- lisp/files.el | 48 ++++++++++------- lisp/help.el | 40 +++++++------- lisp/window.el | 141 +++++++++++++++++++++++++++++++++++++++++-------- src/ChangeLog | 4 ++ src/buffer.c | 20 +++++++ 8 files changed, 244 insertions(+), 79 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 45966e53882..a2d0ffe232c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -631,6 +631,10 @@ The interpretation of the DECLS is determined by `defun-declarations-alist'. *** The functions get-lru-window, get-mru-window and get-largest-window now accept a third argument to avoid choosing the selected window. +*** New macro with-temp-buffer-window. + +*** New display action function display-buffer-below-selected. + *** New display action alist `inhibit-switch-frame', if non-nil, tells display action functions to avoid changing which frame is selected. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 62d3097ccaa..87904b8313b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,20 @@ +2012-09-03 Martin Rudalics + + * window.el (temp-buffer-window-setup-hook) + (temp-buffer-window-show-hook): New hooks. + (temp-buffer-window-setup, temp-buffer-window-show) + (with-temp-buffer-window): New functions. + (fit-window-to-buffer): Remove unused optional argument + OVERRIDE. + (special-display-popup-frame): Make sure the window used shows + BUFFER. + + * help.el (temp-buffer-resize-mode): Fix doc-string. + (resize-temp-buffer-window): New optional argument WINDOW. + + * files.el (recover-file, save-buffers-kill-emacs): + * dired.el (dired-mark-pop-up): Use with-temp-buffer-window. + 2012-09-02 Michael Albinus * eshell/em-unix.el (eshell/sudo): When we have an ad-hoc diff --git a/lisp/dired.el b/lisp/dired.el index 5ae0e026172..cd27b6b6404 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2973,36 +2973,43 @@ If t, confirmation is never needed." (const shell) (const symlink) (const touch) (const uncompress)))) -(defun dired-mark-pop-up (bufname op-symbol files function &rest args) +(defun dired-mark-pop-up (buffer-or-name op-symbol files function &rest args) "Return FUNCTION's result on ARGS after showing which files are marked. -Displays the file names in a buffer named BUFNAME; - nil gives \" *Marked Files*\". -This uses function `dired-pop-to-buffer' to do that. +Displays the file names in a window showing a buffer named +BUFFER-OR-NAME; the default name being \" *Marked Files*\". The +window is not shown if there is just one file, `dired-no-confirm' +is t, or OP-SYMBOL is a member of the list in `dired-no-confirm'. -FUNCTION should not manipulate files, just read input - (an argument or confirmation). -The window is not shown if there is just one file or - OP-SYMBOL is a member of the list in `dired-no-confirm'. FILES is the list of marked files. It can also be (t FILENAME) in the case of one marked file, to distinguish that from using -just the current file." - (or bufname (setq bufname " *Marked Files*")) +just the current file. + +FUNCTION should not manipulate files, just read input \(an +argument or confirmation)." (if (or (eq dired-no-confirm t) (memq op-symbol dired-no-confirm) ;; If FILES defaulted to the current line's file. (= (length files) 1)) (apply function args) - (with-current-buffer (get-buffer-create bufname) - (erase-buffer) - ;; Handle (t FILE) just like (FILE), here. - ;; That value is used (only in some cases), to mean - ;; just one file that was marked, rather than the current line file. - (dired-format-columns-of-files (if (eq (car files) t) (cdr files) files)) - (remove-text-properties (point-min) (point-max) - '(mouse-face nil help-echo nil))) - (save-window-excursion - (dired-pop-to-buffer bufname) - (apply function args)))) + (let ((buffer (get-buffer-create (or buffer-or-name " *Marked Files*")))) + (with-current-buffer buffer + (let ((split-height-threshold 0)) + (with-temp-buffer-window + buffer + (cons 'display-buffer-below-selected nil) + #'(lambda (window _value) + (with-selected-window window + (unwind-protect + (apply function args) + (when (window-live-p window) + (quit-restore-window window 'kill))))) + ;; Handle (t FILE) just like (FILE), here. That value is + ;; used (only in some cases), to mean just one file that was + ;; marked, rather than the current line file. + (dired-format-columns-of-files + (if (eq (car files) t) (cdr files) files)) + (remove-text-properties (point-min) (point-max) + '(mouse-face nil help-echo nil)))))))) (defun dired-format-columns-of-files (files) (let ((beg (point))) diff --git a/lisp/files.el b/lisp/files.el index ef7f8e43a41..6528632c841 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -5350,23 +5350,26 @@ non-nil, it is called instead of rereading visited file contents." (not (file-exists-p file-name))) (error "Auto-save file %s not current" (abbreviate-file-name file-name))) - ((save-window-excursion - (with-output-to-temp-buffer "*Directory*" - (buffer-disable-undo standard-output) - (save-excursion - (let ((switches dired-listing-switches)) - (if (file-symlink-p file) - (setq switches (concat switches " -L"))) - (set-buffer standard-output) - ;; Use insert-directory-safely, not insert-directory, - ;; because these files might not exist. In particular, - ;; FILE might not exist if the auto-save file was for - ;; a buffer that didn't visit a file, such as "*mail*". - ;; The code in v20.x called `ls' directly, so we need - ;; to emulate what `ls' did in that case. - (insert-directory-safely file switches) - (insert-directory-safely file-name switches)))) - (yes-or-no-p (format "Recover auto save file %s? " file-name))) + ((with-temp-buffer-window + "*Directory*" nil + #'(lambda (window _value) + (with-selected-window window + (unwind-protect + (yes-or-no-p (format "Recover auto save file %s? " file-name)) + (when (window-live-p window) + (quit-restore-window window 'kill))))) + (with-current-buffer standard-output + (let ((switches dired-listing-switches)) + (if (file-symlink-p file) + (setq switches (concat switches " -L"))) + ;; Use insert-directory-safely, not insert-directory, + ;; because these files might not exist. In particular, + ;; FILE might not exist if the auto-save file was for + ;; a buffer that didn't visit a file, such as "*mail*". + ;; The code in v20.x called `ls' directly, so we need + ;; to emulate what `ls' did in that case. + (insert-directory-safely file switches) + (insert-directory-safely file-name switches)))) (switch-to-buffer (find-file-noselect file t)) (let ((inhibit-read-only t) ;; Keep the current buffer-file-coding-system. @@ -6327,8 +6330,15 @@ if any returns nil. If `confirm-kill-emacs' is non-nil, calls it." (setq active t)) (setq processes (cdr processes))) (or (not active) - (progn (list-processes t) - (yes-or-no-p "Active processes exist; kill them and exit anyway? "))))) + (with-temp-buffer-window + (get-buffer-create "*Process List*") nil + #'(lambda (window _value) + (with-selected-window window + (unwind-protect + (yes-or-no-p "Active processes exist; kill them and exit anyway? ") + (when (window-live-p window) + (quit-restore-window window 'kill))))) + (list-processes t))))) ;; Query the user for other things, perhaps. (run-hook-with-args-until-failure 'kill-emacs-query-functions) (or (null confirm-kill-emacs) diff --git a/lisp/help.el b/lisp/help.el index 19db7c255d1..9740f8996c1 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -39,9 +39,10 @@ ;; `help-window-point-marker' is a marker you can move to a valid ;; position of the buffer shown in the help window in order to override ;; the standard positioning mechanism (`point-min') chosen by -;; `with-output-to-temp-buffer'. `with-help-window' has this point -;; nowhere before exiting. Currently used by `view-lossage' to assert -;; that the last keystrokes are always visible. +;; `with-output-to-temp-buffer' and `with-temp-buffer-window'. +;; `with-help-window' has this point nowhere before exiting. Currently +;; used by `view-lossage' to assert that the last keystrokes are always +;; visible. (defvar help-window-point-marker (make-marker) "Marker to override default `window-point' in help windows.") @@ -975,13 +976,13 @@ function is called, the window to be resized is selected." :version "20.4") (define-minor-mode temp-buffer-resize-mode - "Toggle auto-shrinking temp buffer windows (Temp Buffer Resize mode). + "Toggle auto-resizing temporary buffer windows (Temp Buffer Resize Mode). With a prefix argument ARG, enable Temp Buffer Resize mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. When Temp Buffer Resize mode is enabled, the windows in which we -show a temporary buffer are automatically reduced in height to +show a temporary buffer are automatically resized in height to fit the buffer's contents, but never more than `temp-buffer-max-height' nor less than `window-min-height'. @@ -994,19 +995,22 @@ and some others." (add-hook 'temp-buffer-show-hook 'resize-temp-buffer-window 'append) (remove-hook 'temp-buffer-show-hook 'resize-temp-buffer-window))) -(defun resize-temp-buffer-window () - "Resize the selected window to fit its contents. -Will not make it higher than `temp-buffer-max-height' nor smaller -than `window-min-height'. Do nothing if the selected window is -not vertically combined or some of its contents are scrolled out -of view." - (when (and (pos-visible-in-window-p (point-min)) - (window-combined-p)) - (fit-window-to-buffer - nil - (if (functionp temp-buffer-max-height) - (funcall temp-buffer-max-height (window-buffer)) - temp-buffer-max-height)))) +(defun resize-temp-buffer-window (&optional window) + "Resize WINDOW to fit its contents. +WINDOW can be any live window and defaults to the selected one. + +Do not make WINDOW higher than `temp-buffer-max-height' nor +smaller than `window-min-height'. Do nothing if WINDOW is not +vertically combined or some of its contents are scrolled out of +view." + (setq window (window-normalize-window window t)) + (let ((height (if (functionp temp-buffer-max-height) + (with-selected-window window + (funcall temp-buffer-max-height (window-buffer))) + temp-buffer-max-height))) + (when (and (pos-visible-in-window-p (point-min) window) + (window-combined-p window)) + (fit-window-to-buffer window height)))) ;;; Help windows. (defcustom help-window-select 'other diff --git a/lisp/window.el b/lisp/window.el index 2fce874e987..f73c85e991b 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -73,6 +73,108 @@ are not altered by this macro (unless they are altered in BODY)." (when (window-live-p save-selected-window-window) (select-window save-selected-window-window 'norecord)))))) +(defvar temp-buffer-window-setup-hook nil + "Normal hook run by `with-temp-buffer-window' before buffer display. +This hook is run by `with-temp-buffer-window' with the buffer to be +displayed current.") + +(defvar temp-buffer-window-show-hook nil + "Normal hook run by `with-temp-buffer-window' after buffer display. +This hook is run by `with-temp-buffer-window' with the buffer +displayed and current and its window selected.") + +(defun temp-buffer-window-setup (buffer-or-name) + "Set up temporary buffer specified by BUFFER-OR-NAME +Return the buffer." + (let ((old-dir default-directory) + (buffer (get-buffer-create buffer-or-name))) + (with-current-buffer buffer + (kill-all-local-variables) + (setq default-directory old-dir) + (delete-all-overlays) + (setq buffer-read-only nil) + (setq buffer-file-name nil) + (setq buffer-undo-list t) + (let ((inhibit-read-only t) + (inhibit-modification-hooks t)) + (erase-buffer) + (run-hooks 'temp-buffer-window-setup-hook)) + ;; Return the buffer. + buffer))) + +(defun temp-buffer-window-show (&optional buffer action) + "Show temporary buffer BUFFER in a window. +Return the window showing BUFFER. Pass ACTION as action argument +to `display-buffer'." + (let (window frame) + (with-current-buffer buffer + (set-buffer-modified-p nil) + (setq buffer-read-only t) + (goto-char (point-min)) + (when (setq window (display-buffer buffer action)) + (setq frame (window-frame window)) + (unless (eq frame (selected-frame)) + (raise-frame frame)) + (setq minibuffer-scroll-window window) + (set-window-hscroll window 0) + (with-selected-window window + (run-hooks 'temp-buffer-window-show-hook) + (when temp-buffer-resize-mode + (resize-temp-buffer-window window))) + ;; Return the window. + window)))) + +(defmacro with-temp-buffer-window (buffer-or-name action quit-function &rest body) + "Evaluate BODY and display buffer specified by BUFFER-OR-NAME. +BUFFER-OR-NAME must specify either a live buffer or the name of a +buffer. If no buffer with such a name exists, create one. + +Make sure the specified buffer is empty before evaluating BODY. +Do not make that buffer current for BODY. Instead, bind +`standard-output' to that buffer, so that output generated with +`prin1' and similar functions in BODY goes into that buffer. + +After evaluating BODY, mark the specified buffer unmodified and +read-only, and display it in a window via `display-buffer'. Pass +ACTION as action argument to `display-buffer'. Automatically +shrink the window used if `temp-buffer-resize-mode' is enabled. + +Return the value returned by BODY unless QUIT-FUNCTION specifies +a function. In that case, run the function with two arguments - +the window showing the specified buffer and the value returned by +BODY - and return the value returned by that function. + +If the buffer is displayed on a new frame, the window manager may +decide to select that frame. In that case, it's usually a good +strategy if the function specified by QUIT-FUNCTION selects the +window showing the buffer before reading a value from the +minibuffer, for example, when asking a `yes-or-no-p' question. + +This construct is similar to `with-output-to-temp-buffer' but +does neither put the buffer in help mode nor does it call +`temp-buffer-show-function'. It also runs different hooks, +namely `temp-buffer-window-setup-hook' (with the specified buffer +current) and `temp-buffer-window-show-hook' (with the specified +buffer current and the window showing it selected). + +Since this macro calls `display-buffer', the window displaying +the buffer is usually not selected and the specified buffer +usually not made current. QUIT-FUNCTION can override that." + (declare (debug t)) + (let ((buffer (make-symbol "buffer")) + (window (make-symbol "window")) + (value (make-symbol "value"))) + `(let* ((,buffer (temp-buffer-window-setup ,buffer-or-name)) + (standard-output ,buffer) + ,window ,value) + (with-current-buffer ,buffer + (setq ,value (progn ,@body)) + (setq ,window (temp-buffer-window-show ,buffer ,action))) + + (if (functionp ,quit-function) + (funcall ,quit-function ,window ,value) + ,value)))) + ;; The following two functions are like `window-next-sibling' and ;; `window-prev-sibling' but the WINDOW argument is _not_ optional (so ;; they don't substitute the selected window for nil), and they return @@ -4696,6 +4798,9 @@ and (cdr ARGS) as second." (make-frame (append args special-display-frame-alist)))) (window (frame-selected-window frame))) (display-buffer-record-window 'frame window buffer) + (unless (eq buffer (window-buffer window)) + (set-window-buffer window buffer) + (set-window-prev-buffers window nil)) (set-window-dedicated-p window t) window))))) @@ -5710,7 +5815,7 @@ WINDOW must be a live window and defaults to the selected one." window)))) ;;; Resizing buffers to fit their contents exactly. -(defun fit-window-to-buffer (&optional window max-height min-height override) +(defun fit-window-to-buffer (&optional window max-height min-height) "Adjust height of WINDOW to display its buffer's contents exactly. WINDOW must be a live window and defaults to the selected one. @@ -5721,10 +5826,6 @@ defaults to `window-min-height'. Both MAX-HEIGHT and MIN-HEIGHT are specified in lines and include the mode line and header line, if any. -Optional argument OVERRIDE non-nil means override restrictions -imposed by `window-min-height' and `window-min-width' on the size -of WINDOW. - Return the number of lines by which WINDOW was enlarged or shrunk. If an error occurs during resizing, return nil but don't signal an error. @@ -5733,28 +5834,27 @@ Note that even if this function makes WINDOW large enough to show _all_ lines of its buffer you might not see the first lines when WINDOW was scrolled." (interactive) - ;; Do all the work in WINDOW and its buffer and restore the selected - ;; window and the current buffer when we're done. (setq window (window-normalize-window window t)) ;; Can't resize a full height or fixed-size window. (unless (or (window-size-fixed-p window) (window-full-height-p window)) - ;; `with-selected-window' should orderly restore the current buffer. (with-selected-window window - ;; We are in WINDOW's buffer now. - (let* (;; Adjust MIN-HEIGHT. + (let* ((height (window-total-size)) (min-height - (if override - (window-min-size window nil window) - (max (or min-height window-min-height) - window-safe-min-height))) - (max-window-height - (window-total-size (frame-root-window window))) - ;; Adjust MAX-HEIGHT. + ;; Adjust MIN-HEIGHT. + (if (numberp min-height) + ;; Can't get smaller than `window-safe-min-height'. + (max min-height window-safe-min-height) + ;; Preserve header and mode line if present. + (window-min-size nil nil t))) (max-height - (if (or override (not max-height)) - max-window-height - (min max-height max-window-height))) + ;; Adjust MAX-HEIGHT. + (if (numberp max-height) + ;; Can't get larger than height of frame. + (min max-height + (window-total-size (frame-root-window window))) + ;, Don't delete other windows. + (+ height (window-max-delta nil nil window)))) ;; Make `desired-height' the height necessary to show ;; all of WINDOW's buffer, constrained by MIN-HEIGHT ;; and MAX-HEIGHT. @@ -5779,7 +5879,6 @@ WINDOW was scrolled." (window-max-delta window nil window)) (max desired-delta (- (window-min-delta window nil window)))))) - ;; This `condition-case' shouldn't be necessary, but who knows? (condition-case nil (if (zerop delta) ;; Return zero if DELTA became zero in the process. diff --git a/src/ChangeLog b/src/ChangeLog index c781204e679..203e5dca018 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-09-03 Martin Rudalics + + * buffer.c (Fdelete_all_overlays): New function. + 2012-09-03 Chong Yidong * gtkutil.c: Add extern decl for Qxft. diff --git a/src/buffer.c b/src/buffer.c index 0e2e50d9f51..ce6f42f136f 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -4073,6 +4073,25 @@ DEFUN ("delete-overlay", Fdelete_overlay, Sdelete_overlay, 1, 1, 0, return unbind_to (count, Qnil); } + +DEFUN ("delete-all-overlays", Fdelete_all_overlays, Sdelete_all_overlays, 0, 1, 0, + doc: /* Delete all overlays of BUFFER. +BUFFER omitted or nil means delete all overlays of the current +buffer. */) + (Lisp_Object buffer) +{ + register struct buffer *buf; + + if (NILP (buffer)) + buf = current_buffer; + else + { + CHECK_BUFFER (buffer); + buf = XBUFFER (buffer); + } + + delete_all_overlays (buf); +} /* Overlay dissection functions. */ @@ -6286,6 +6305,7 @@ and `bury-buffer-internal'. */); defsubr (&Soverlayp); defsubr (&Smake_overlay); defsubr (&Sdelete_overlay); + defsubr (&Sdelete_all_overlays); defsubr (&Smove_overlay); defsubr (&Soverlay_start); defsubr (&Soverlay_end); From 26d4541d4c0c9a71453143c17d392291c41856ff Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 3 Sep 2012 02:22:43 -0700 Subject: [PATCH 210/212] Fix minor problems found by static checking. * buffer.c (Fdelete_all_overlays): Return nil. * doc.c (Fsubstitute_command_keys): * regex.c (WEAK_ALIAS): * xdisp.c (redisplay_internal): Move initialization down, to pacify GCC 4.7.1 -Wjump-misses-init. --- src/ChangeLog | 9 +++++++++ src/buffer.c | 1 + src/doc.c | 3 ++- src/regex.c | 6 ++++-- src/xdisp.c | 3 ++- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 203e5dca018..43e629eb5f6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2012-09-03 Paul Eggert + + Fix minor problems found by static checking. + * buffer.c (Fdelete_all_overlays): Return nil. + * doc.c (Fsubstitute_command_keys): + * regex.c (WEAK_ALIAS): + * xdisp.c (redisplay_internal): + Move initialization down, to pacify GCC 4.7.1 -Wjump-misses-init. + 2012-09-03 Martin Rudalics * buffer.c (Fdelete_all_overlays): New function. diff --git a/src/buffer.c b/src/buffer.c index ce6f42f136f..f4d38e50a47 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -4091,6 +4091,7 @@ buffer. */) } delete_all_overlays (buf); + return Qnil; } /* Overlay dissection functions. */ diff --git a/src/doc.c b/src/doc.c index 02a5b4b8143..c21935577f2 100644 --- a/src/doc.c +++ b/src/doc.c @@ -848,9 +848,10 @@ Otherwise, return a new string, without any text properties. */) struct buffer *oldbuf; ptrdiff_t start_idx; /* This is for computing the SHADOWS arg for describe_map_tree. */ - Lisp_Object active_maps = Fcurrent_active_maps (Qnil, Qnil); + Lisp_Object active_maps; Lisp_Object earlier_maps; + active_maps = Fcurrent_active_maps (Qnil, Qnil); changed = 1; strp += 2; /* skip \{ or \< */ start = strp; diff --git a/src/regex.c b/src/regex.c index 472ef727979..28813304c8a 100644 --- a/src/regex.c +++ b/src/regex.c @@ -5160,11 +5160,13 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const re_char *string1, { /* 1 if this match ends in the same string (string1 or string2) as the best previous match. */ - boolean same_str_p = (FIRST_STRING_P (match_end) - == FIRST_STRING_P (d)); + boolean same_str_p; /* 1 if this match is the best seen so far. */ boolean best_match_p; + same_str_p = (FIRST_STRING_P (match_end) + == FIRST_STRING_P (d)); + /* AIX compiler got confused when this was combined with the previous declaration. */ if (same_str_p) diff --git a/src/xdisp.c b/src/xdisp.c index 86f041dea4d..81322f498ef 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13511,9 +13511,10 @@ redisplay_internal (void) } else if (FRAME_VISIBLE_P (sf) && !FRAME_OBSCURED_P (sf)) { - Lisp_Object mini_window = FRAME_MINIBUF_WINDOW (sf); + Lisp_Object mini_window; struct frame *mini_frame; + mini_window = FRAME_MINIBUF_WINDOW (sf); displayed_buffer = XBUFFER (XWINDOW (selected_window)->buffer); /* Use list_of_error, not Qerror, so that we catch only errors and don't run the debugger. */ From 7f50777729a9c25893826b45ab941d987e36971e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 3 Sep 2012 02:26:56 -0700 Subject: [PATCH 211/212] Merge from gnulib. This incorporates: 2012-08-29 stdbool: be more compatible with mixed C/C++ compiles 2011-11-30 manywarnings: update the list of "all" warnings --- ChangeLog | 6 ++ lib/stdbool.in.h | 51 +++++++++------ m4/manywarnings.m4 | 157 ++++++++++++++++++++++++++------------------- 3 files changed, 127 insertions(+), 87 deletions(-) diff --git a/ChangeLog b/ChangeLog index 62e64622d1f..8af393d4393 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-09-03 Paul Eggert + + Merge from gnulib, incorporating: + 2012-08-29 stdbool: be more compatible with mixed C/C++ compiles + 2011-11-30 manywarnings: update the list of "all" warnings + 2012-09-02 Jan Djärv * configure.ac (HAVE_GOBJECT): Check for gobject-2.0 (Bug#12332). diff --git a/lib/stdbool.in.h b/lib/stdbool.in.h index ed1f9aa488b..1f8caee4f2d 100644 --- a/lib/stdbool.in.h +++ b/lib/stdbool.in.h @@ -66,24 +66,19 @@ # undef true #endif -/* For the sake of symbolic names in gdb, we define true and false as - enum constants, not only as macros. - It is tempting to write - typedef enum { false = 0, true = 1 } _Bool; - so that gdb prints values of type 'bool' symbolically. But if we do - this, values of type '_Bool' may promote to 'int' or 'unsigned int' - (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int' - (see ISO C 99 6.3.1.1.(2)). So we add a negative value to the - enum; this ensures that '_Bool' promotes to 'int'. */ -#if defined __cplusplus || (defined __BEOS__ && !defined __HAIKU__) +#ifdef __cplusplus +# define _Bool bool +# define bool bool +#else +# if defined __BEOS__ && !defined __HAIKU__ /* A compiler known to have 'bool'. */ /* If the compiler already has both 'bool' and '_Bool', we can assume they are the same types. */ -# if !@HAVE__BOOL@ +# if !@HAVE__BOOL@ typedef bool _Bool; -# endif -#else -# if !defined __GNUC__ +# endif +# else +# if !defined __GNUC__ /* If @HAVE__BOOL@: Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when the built-in _Bool type is used. See @@ -103,19 +98,35 @@ typedef bool _Bool; "Invalid enumerator. (badenum)" with HP-UX cc on Tru64. The only benefit of the enum, debuggability, is not important with these compilers. So use 'signed char' and no enum. */ -# define _Bool signed char -# else +# define _Bool signed char +# else /* With this compiler, trust the _Bool type if the compiler has it. */ -# if !@HAVE__BOOL@ +# if !@HAVE__BOOL@ + /* For the sake of symbolic names in gdb, define true and false as + enum constants, not only as macros. + It is tempting to write + typedef enum { false = 0, true = 1 } _Bool; + so that gdb prints values of type 'bool' symbolically. But then + values of type '_Bool' might promote to 'int' or 'unsigned int' + (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int' + (see ISO C 99 6.3.1.1.(2)). So add a negative value to the + enum; this ensures that '_Bool' promotes to 'int'. */ typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool; +# endif # endif # endif +# define bool _Bool #endif -#define bool _Bool /* The other macros must be usable in preprocessor directives. */ -#define false 0 -#define true 1 +#ifdef __cplusplus +# define false false +# define true true +#else +# define false 0 +# define true 1 +#endif + #define __bool_true_false_are_defined 1 #endif /* _GL_STDBOOL_H */ diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4 index 864fc851982..2760efb3f27 100644 --- a/m4/manywarnings.m4 +++ b/m4/manywarnings.m4 @@ -81,95 +81,118 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], gl_manywarn_set= for gl_manywarn_item in \ - -Wall \ -W \ - -Wformat-y2k \ - -Wformat-nonliteral \ - -Wformat-security \ - -Winit-self \ - -Wmissing-include-dirs \ - -Wswitch-default \ - -Wswitch-enum \ - -Wunused \ - -Wunknown-pragmas \ - -Wstrict-aliasing \ - -Wstrict-overflow \ - -Wsystem-headers \ - -Wfloat-equal \ - -Wtraditional \ - -Wtraditional-conversion \ - -Wdeclaration-after-statement \ - -Wundef \ - -Wshadow \ - -Wunsafe-loop-optimizations \ - -Wpointer-arith \ - -Wbad-function-cast \ - -Wc++-compat \ - -Wcast-qual \ - -Wcast-align \ - -Wwrite-strings \ - -Wconversion \ - -Wsign-conversion \ - -Wlogical-op \ - -Waggregate-return \ - -Wstrict-prototypes \ - -Wold-style-definition \ - -Wmissing-prototypes \ - -Wmissing-declarations \ - -Wmissing-noreturn \ - -Wmissing-format-attribute \ - -Wpacked \ - -Wpadded \ - -Wredundant-decls \ - -Wnested-externs \ - -Wunreachable-code \ - -Winline \ - -Winvalid-pch \ - -Wlong-long \ - -Wvla \ - -Wvolatile-register-var \ - -Wdisabled-optimization \ - -Wstack-protector \ - -Woverlength-strings \ - -Wbuiltin-macro-redefined \ - -Wmudflap \ - -Wpacked-bitfield-compat \ - -Wsync-nand \ - ; do - gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" - done - # The following are not documented in the manual but are included in - # output from gcc --help=warnings. - for gl_manywarn_item in \ - -Wattributes \ - -Wcoverage-mismatch \ - -Wunused-macros \ - ; do - gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" - done - # More warnings from gcc 4.6.2 --help=warnings. - for gl_manywarn_item in \ -Wabi \ + -Waddress \ + -Wall \ + -Warray-bounds \ + -Wattributes \ + -Wbad-function-cast \ + -Wbuiltin-macro-redefined \ + -Wcast-align \ + -Wchar-subscripts \ + -Wclobbered \ + -Wcomment \ + -Wcomments \ + -Wcoverage-mismatch \ -Wcpp \ -Wdeprecated \ -Wdeprecated-declarations \ + -Wdisabled-optimization \ -Wdiv-by-zero \ -Wdouble-promotion \ + -Wempty-body \ -Wendif-labels \ + -Wenum-compare \ -Wextra \ -Wformat-contains-nul \ -Wformat-extra-args \ + -Wformat-nonliteral \ + -Wformat-security \ + -Wformat-y2k \ -Wformat-zero-length \ -Wformat=2 \ + -Wfree-nonheap-object \ + -Wignored-qualifiers \ + -Wimplicit \ + -Wimplicit-function-declaration \ + -Wimplicit-int \ + -Winit-self \ + -Winline \ + -Wint-to-pointer-cast \ + -Winvalid-memory-model \ + -Winvalid-pch \ + -Wjump-misses-init \ + -Wlogical-op \ + -Wmain \ + -Wmaybe-uninitialized \ + -Wmissing-braces \ + -Wmissing-declarations \ + -Wmissing-field-initializers \ + -Wmissing-format-attribute \ + -Wmissing-include-dirs \ + -Wmissing-noreturn \ + -Wmissing-parameter-type \ + -Wmissing-prototypes \ + -Wmudflap \ -Wmultichar \ + -Wnarrowing \ + -Wnested-externs \ + -Wnonnull \ -Wnormalized=nfc \ + -Wold-style-declaration \ + -Wold-style-definition \ -Woverflow \ + -Woverlength-strings \ + -Woverride-init \ + -Wpacked \ + -Wpacked-bitfield-compat \ + -Wparentheses \ + -Wpointer-arith \ + -Wpointer-sign \ -Wpointer-to-int-cast \ -Wpragmas \ + -Wreturn-type \ + -Wsequence-point \ + -Wshadow \ + -Wsizeof-pointer-memaccess \ + -Wstack-protector \ + -Wstrict-aliasing \ + -Wstrict-overflow \ + -Wstrict-prototypes \ -Wsuggest-attribute=const \ + -Wsuggest-attribute=format \ -Wsuggest-attribute=noreturn \ -Wsuggest-attribute=pure \ + -Wswitch \ + -Wswitch-default \ + -Wsync-nand \ + -Wsystem-headers \ -Wtrampolines \ + -Wtrigraphs \ + -Wtype-limits \ + -Wuninitialized \ + -Wunknown-pragmas \ + -Wunreachable-code \ + -Wunsafe-loop-optimizations \ + -Wunused \ + -Wunused-but-set-parameter \ + -Wunused-but-set-variable \ + -Wunused-function \ + -Wunused-label \ + -Wunused-local-typedefs \ + -Wunused-macros \ + -Wunused-parameter \ + -Wunused-result \ + -Wunused-value \ + -Wunused-variable \ + -Wvarargs \ + -Wvariadic-macros \ + -Wvector-operation-performance \ + -Wvla \ + -Wvolatile-register-var \ + -Wwrite-strings \ + \ ; do gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" done From dcde497f27945c3ca4ce8c21f655ef6f627acdd2 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 3 Sep 2012 06:17:43 -0400 Subject: [PATCH 212/212] Auto-commit of generated files. --- autogen/Makefile.in | 2 + autogen/configure | 213 ++++++++++++++++++++++++++++++-------------- 2 files changed, 148 insertions(+), 67 deletions(-) diff --git a/autogen/Makefile.in b/autogen/Makefile.in index d52d1543c55..dbedb5d12e5 100644 --- a/autogen/Makefile.in +++ b/autogen/Makefile.in @@ -359,6 +359,8 @@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ GNUSTEP_CFLAGS = @GNUSTEP_CFLAGS@ GNU_OBJC_CFLAGS = @GNU_OBJC_CFLAGS@ +GOBJECT_CFLAGS = @GOBJECT_CFLAGS@ +GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GSETTINGS_CFLAGS = @GSETTINGS_CFLAGS@ GSETTINGS_LIBS = @GSETTINGS_LIBS@ diff --git a/autogen/configure b/autogen/configure index 11bca94ea05..12239818695 100755 --- a/autogen/configure +++ b/autogen/configure @@ -1181,6 +1181,8 @@ LIBGNUTLS_CFLAGS LIBSELINUX_LIBS SETTINGS_LIBS SETTINGS_CFLAGS +GOBJECT_LIBS +GOBJECT_CFLAGS GCONF_LIBS GCONF_CFLAGS GSETTINGS_LIBS @@ -7305,95 +7307,118 @@ $as_echo "$gl_cv_cc_nomfi_needed" >&6; } gl_manywarn_set= for gl_manywarn_item in \ - -Wall \ -W \ - -Wformat-y2k \ - -Wformat-nonliteral \ - -Wformat-security \ - -Winit-self \ - -Wmissing-include-dirs \ - -Wswitch-default \ - -Wswitch-enum \ - -Wunused \ - -Wunknown-pragmas \ - -Wstrict-aliasing \ - -Wstrict-overflow \ - -Wsystem-headers \ - -Wfloat-equal \ - -Wtraditional \ - -Wtraditional-conversion \ - -Wdeclaration-after-statement \ - -Wundef \ - -Wshadow \ - -Wunsafe-loop-optimizations \ - -Wpointer-arith \ - -Wbad-function-cast \ - -Wc++-compat \ - -Wcast-qual \ - -Wcast-align \ - -Wwrite-strings \ - -Wconversion \ - -Wsign-conversion \ - -Wlogical-op \ - -Waggregate-return \ - -Wstrict-prototypes \ - -Wold-style-definition \ - -Wmissing-prototypes \ - -Wmissing-declarations \ - -Wmissing-noreturn \ - -Wmissing-format-attribute \ - -Wpacked \ - -Wpadded \ - -Wredundant-decls \ - -Wnested-externs \ - -Wunreachable-code \ - -Winline \ - -Winvalid-pch \ - -Wlong-long \ - -Wvla \ - -Wvolatile-register-var \ - -Wdisabled-optimization \ - -Wstack-protector \ - -Woverlength-strings \ - -Wbuiltin-macro-redefined \ - -Wmudflap \ - -Wpacked-bitfield-compat \ - -Wsync-nand \ - ; do - gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" - done - # The following are not documented in the manual but are included in - # output from gcc --help=warnings. - for gl_manywarn_item in \ - -Wattributes \ - -Wcoverage-mismatch \ - -Wunused-macros \ - ; do - gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" - done - # More warnings from gcc 4.6.2 --help=warnings. - for gl_manywarn_item in \ -Wabi \ + -Waddress \ + -Wall \ + -Warray-bounds \ + -Wattributes \ + -Wbad-function-cast \ + -Wbuiltin-macro-redefined \ + -Wcast-align \ + -Wchar-subscripts \ + -Wclobbered \ + -Wcomment \ + -Wcomments \ + -Wcoverage-mismatch \ -Wcpp \ -Wdeprecated \ -Wdeprecated-declarations \ + -Wdisabled-optimization \ -Wdiv-by-zero \ -Wdouble-promotion \ + -Wempty-body \ -Wendif-labels \ + -Wenum-compare \ -Wextra \ -Wformat-contains-nul \ -Wformat-extra-args \ + -Wformat-nonliteral \ + -Wformat-security \ + -Wformat-y2k \ -Wformat-zero-length \ -Wformat=2 \ + -Wfree-nonheap-object \ + -Wignored-qualifiers \ + -Wimplicit \ + -Wimplicit-function-declaration \ + -Wimplicit-int \ + -Winit-self \ + -Winline \ + -Wint-to-pointer-cast \ + -Winvalid-memory-model \ + -Winvalid-pch \ + -Wjump-misses-init \ + -Wlogical-op \ + -Wmain \ + -Wmaybe-uninitialized \ + -Wmissing-braces \ + -Wmissing-declarations \ + -Wmissing-field-initializers \ + -Wmissing-format-attribute \ + -Wmissing-include-dirs \ + -Wmissing-noreturn \ + -Wmissing-parameter-type \ + -Wmissing-prototypes \ + -Wmudflap \ -Wmultichar \ + -Wnarrowing \ + -Wnested-externs \ + -Wnonnull \ -Wnormalized=nfc \ + -Wold-style-declaration \ + -Wold-style-definition \ -Woverflow \ + -Woverlength-strings \ + -Woverride-init \ + -Wpacked \ + -Wpacked-bitfield-compat \ + -Wparentheses \ + -Wpointer-arith \ + -Wpointer-sign \ -Wpointer-to-int-cast \ -Wpragmas \ + -Wreturn-type \ + -Wsequence-point \ + -Wshadow \ + -Wsizeof-pointer-memaccess \ + -Wstack-protector \ + -Wstrict-aliasing \ + -Wstrict-overflow \ + -Wstrict-prototypes \ -Wsuggest-attribute=const \ + -Wsuggest-attribute=format \ -Wsuggest-attribute=noreturn \ -Wsuggest-attribute=pure \ + -Wswitch \ + -Wswitch-default \ + -Wsync-nand \ + -Wsystem-headers \ -Wtrampolines \ + -Wtrigraphs \ + -Wtype-limits \ + -Wuninitialized \ + -Wunknown-pragmas \ + -Wunreachable-code \ + -Wunsafe-loop-optimizations \ + -Wunused \ + -Wunused-but-set-parameter \ + -Wunused-but-set-variable \ + -Wunused-function \ + -Wunused-label \ + -Wunused-local-typedefs \ + -Wunused-macros \ + -Wunused-parameter \ + -Wunused-result \ + -Wunused-value \ + -Wunused-variable \ + -Wvarargs \ + -Wvariadic-macros \ + -Wvector-operation-performance \ + -Wvla \ + -Wvolatile-register-var \ + -Wwrite-strings \ + \ ; do gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" done @@ -10950,6 +10975,60 @@ $as_echo "#define HAVE_GCONF 1" >>confdefs.h fi if test "$HAVE_GSETTINGS" = "yes" || test "$HAVE_GCONF" = "yes"; then + + succeeded=no + + if test "$PKG_CONFIG" = "no" ; then + HAVE_GOBJECT=no + else + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gobject-2.0 >= 2.0" >&5 +$as_echo_n "checking for gobject-2.0 >= 2.0... " >&6; } + + if $PKG_CONFIG --exists "gobject-2.0 >= 2.0" 2>&5 && + GOBJECT_CFLAGS=`$PKG_CONFIG --cflags "gobject-2.0 >= 2.0" 2>&5` && + GOBJECT_LIBS=`$PKG_CONFIG --libs "gobject-2.0 >= 2.0" 2>&5`; then + edit_cflags=" + s,///*,/,g + s/^/ / + s/ -I/ $isystem/g + s/^ // + " + GOBJECT_CFLAGS=`$as_echo "$GOBJECT_CFLAGS" | sed -e "$edit_cflags"` + GOBJECT_LIBS=`$as_echo "$GOBJECT_LIBS" | sed -e 's,///*,/,g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes CFLAGS='$GOBJECT_CFLAGS' LIBS='$GOBJECT_LIBS'" >&5 +$as_echo "yes CFLAGS='$GOBJECT_CFLAGS' LIBS='$GOBJECT_LIBS'" >&6; } + succeeded=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + GOBJECT_CFLAGS="" + GOBJECT_LIBS="" + ## If we have a custom action on failure, don't print errors, but + ## do set a variable so people can do so. + GOBJECT_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gobject-2.0 >= 2.0"` + + fi + + + + else + echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." + echo "*** See http://www.freedesktop.org/software/pkgconfig" + fi + fi + + if test $succeeded = yes; then + HAVE_GOBJECT=yes + else + HAVE_GOBJECT=no + fi + + if test "$HAVE_GOBJECT" = "yes"; then + SETTINGS_CFLAGS="$SETTINGS_CFLAGS $GOBJECT_CFLAGS" + SETTINGS_LIBS="$SETTINGS_LIBS $GOBJECT_LIBS" + fi SAVE_CFLAGS="$CFLAGS" SAVE_LIBS="$LIBS" CFLAGS="$SETTINGS_CFLAGS $CFLAGS"