summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa <handa@gnu.org>2012-10-17 22:33:48 +0900
committerKenichi Handa <handa@gnu.org>2012-10-17 22:33:48 +0900
commit596846525bf5f515541ab1ca9a459f4842d55d1d (patch)
treee1e4f64ebb40daf0d9ee16b84ef824da30cfbffc /src
parentfe0b1ec40988638025db569a936b09f0295749a1 (diff)
parent1f9f395d8063fd633ba73f6cc025ded953bab502 (diff)
downloademacs-596846525bf5f515541ab1ca9a459f4842d55d1d.tar.gz
merge trunk
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog91
-rw-r--r--src/alloc.c2
-rw-r--r--src/buffer.c38
-rw-r--r--src/buffer.h16
-rw-r--r--src/dbusbind.c8
-rw-r--r--src/editfns.c9
-rw-r--r--src/image.c6
-rw-r--r--src/indent.c6
-rw-r--r--src/lisp.h1
-rw-r--r--src/nsterm.m5
-rw-r--r--src/print.c2
-rw-r--r--src/window.c8
-rw-r--r--src/xrdb.c12
13 files changed, 132 insertions, 72 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 21d13a04e77..b845eeb3ceb 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -3,6 +3,58 @@
* xdisp.c (reseat_1): Make the information stored in it->cmp_it
invalidate.
+2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * buffer.c (Fkill_buffer): When unchaining the marker,
+ reset its buffer pointer to NULL (Bug#12652).
+
+2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Do not verify indirection counters of killed buffers (Bug#12579).
+ * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
+ * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
+
+2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * alloc.c (Fmake_byte_code): Fix typo in comment.
+ * print.c (print_interval): Define as static to match prototype.
+ * indent.c (disptab_matches_widthtab, recompute_width_table):
+ Convert to eassert.
+
+2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * editfns.c (get_system_name): Remove.
+ * lisp.h (get_system_name): Remove prototype.
+ * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
+ (get_environ_db): Use Vsystem_name. Avoid call to strlen.
+
+2012-10-15 Daniel Colascione <dancol@dancol.org>
+
+ * dbusbind.c: Add comment explaining reason for previous change.
+
+2012-10-15 Martin Rudalics <rudalics@gmx.at>
+
+ * window.c (Fwindow_end): Rewrite check whether cached position
+ can be used (Bug#12600).
+ (resize_frame_windows, grow_mini_window, shrink_mini_window):
+ Set windows_or_buffers_changed.
+
+2012-10-15 Daniel Colascione <dancol@dancol.org>
+
+ * dbusbind.c: Fix cygw32 build break when compiling with dbus
+ enabled by undefining the symbol "interface", which the platform
+ headers define to something incompatible.
+
+2012-10-14 Daniel Colascione <dancol@dancol.org>
+
+ * image.c (init_tiff_functions, init_imagemagick_functions)
+ (init_svg_functions): Fix cygw32 build break by using these
+ functions only when WINDOWSNT _and_ HAVE_NTGUI.
+
+2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
+
2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
* gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
@@ -58,8 +110,7 @@
a file exists. This avoids expensive system calls on MS-Windows.
(Bug#12587)
- * w32.c (init_environment): Call 'check_existing' instead of
- 'stat'.
+ * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
* lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
determine whether a file exists and is not a directory.
@@ -199,7 +250,7 @@
* nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
caching.
(nsfont_open): Remove setting of Vfonts_in_cache.
- (syms_of_nsfont): Remove initialization of Vfonts_in_cache
+ (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
2012-10-09 Eli Zaretskii <eliz@gnu.org>
@@ -266,7 +317,7 @@
* w32select.h (HAVE_W32SELECT): Remove.
* w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
- w32common.h instead of w32heap.h
+ w32common.h instead of w32heap.h.
* w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
(get_allocation_unit, get_processor_type, get_w32_major_version)
@@ -277,8 +328,8 @@
* w32heap.c: Include w32common.h.
(sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
- (w32_minor_version, w32_build_number, w32_subtype): Remove
- duplicate definitions.
+ (w32_minor_version, w32_build_number, w32_subtype):
+ Remove duplicate definitions.
* w32fns.c: Include w32common.h; include w32heap.h only in
WINDOWSNT.
@@ -389,7 +440,7 @@
Cygwin builds. Remove w32select declarations.
* w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
- w32fns.c. w32console.c is WINDOWSNT-only.
+ w32fns.c. w32console.c is WINDOWSNT-only.
* w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
@@ -490,12 +541,12 @@
* nsterm.m (ns_in_resize): Remove (Bug#12479).
(ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
- (ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove
- ns_in_resize check.
+ (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
+ Remove ns_in_resize check.
(ns_clear_frame_area): Remove resize handle code.
* nsfns.m (ns_in_resize): Remove.
- (x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove
+ (x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove
ns_in_resize check.
2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
@@ -524,7 +575,7 @@
(initFrameFromEmacs:): tbar_height renamed tibar_height.
(windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
error in drawing background.
- (toggleFullScreen:): Remove comment. Rearrange calls.
+ (toggleFullScreen:): Remove comment. Rearrange calls.
Set toolbar values to zero, save old height in tobar_height.
Restore tool bar height when leaving fullscreen.
(canBecomeMainWindow): New function.
@@ -538,8 +589,8 @@
* w32proc.c (stop_timer_thread): Fix declaration of 'err'.
* w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
- that time stamps of directories could also be changed. Don't
- request the too broad GENERIC_WRITE, only the more restrictive
+ that time stamps of directories could also be changed.
+ Don't request the too broad GENERIC_WRITE, only the more restrictive
FILE_WRITE_ATTRIBUTES access rights.
* fileio.c (Fset_file_times): Special-case ignoring errors for
@@ -947,7 +998,7 @@
Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
tbar_height.
(windowWillUseStandardFrame:defaultFrame:): Update frame parameter
- fullscreen. Set maximized_width/height. Act on next_maximized.
+ fullscreen. Set maximized_width/height. Act on next_maximized.
* nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
(EmacsView): Add variables for fullscreen.
@@ -1603,7 +1654,7 @@
2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
* w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
- Ignore 'expected'. See Eli Zaretskii in
+ Ignore 'expected'. See Eli Zaretskii in
<http://bugs.gnu.org/12471#8> (last line).
* frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
@@ -1670,7 +1721,7 @@
(bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
(emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
[!SYSTEM_MALLOC && !SYNC_INPUT]:
- Remove. All uses removed.
+ Remove. All uses removed.
(MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
implementation, one that depends on whether the new macro
XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
@@ -1960,7 +2011,7 @@
* alloc.c (discard_killed_buffers): New function.
(mark_object): Use it for deleted windows and frames.
(mark_object): If symbol's value is set up for a killed buffer
- or deleted frame, restore it's global binding.
+ or deleted frame, restore its global binding.
* data.c (swap_in_global_binding): Add GC notice.
(swap_in_symval_forwarding): Use convenient set_blv_where.
* window.c (wset_next_buffers, wset_prev_buffers): Move ...
@@ -4267,7 +4318,7 @@
* nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
(EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
- (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
+ (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
* nsfns.m (ns_set_name_as_filename): Likewise.
* nsmenu.m (ns_update_menubar): Likewise.
* nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
@@ -6363,7 +6414,7 @@
Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
values which aren't power of 2.
* alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
- Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
+ Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
accordingly.
2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
@@ -7532,7 +7583,7 @@
bitfields where appropriate, remove unused fields.
* window.h (struct window): Remove unused 'last_mark_x' and
'last_mark_y' fields. Rename 'mini_p' field to 'mini',
- change it's type from Lisp_Object to bitfield.
+ change its type from Lisp_Object to bitfield.
Change type of 'force_start', 'optional_new_start',
'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fields from Lisp_Object to bitfield. Adjust users accordingly.
diff --git a/src/alloc.c b/src/alloc.c
index 95be8db1614..0afe446d269 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3100,7 +3100,7 @@ usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INT
ptrdiff_t i;
register struct Lisp_Vector *p;
- /* We used to purecopy everything here, if purify-flga was set. This worked
+ /* We used to purecopy everything here, if purify-flag was set. This worked
OK for Emacs-23, but with Emacs-24's lexical binding code, it can be
dangerous, since make-byte-code is used during execution to build
closures, so any closure built during the preload phase would end up
diff --git a/src/buffer.c b/src/buffer.c
index 861a89b5a0f..0b3dde27968 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1663,18 +1663,11 @@ No argument or nil as argument means do this for the current buffer. */)
void
compact_buffer (struct buffer *buffer)
{
- /* Verify indirection counters. */
- if (buffer->base_buffer)
- {
- eassert (buffer->indirections == -1);
- eassert (buffer->base_buffer->indirections > 0);
- }
- else
- eassert (buffer->indirections >= 0);
+ BUFFER_CHECK_INDIRECTION (buffer);
/* Skip dead buffers, indirect buffers and buffers
which aren't changed since last compaction. */
- if (!NILP (buffer->INTERNAL_FIELD (name))
+ if (BUFFER_LIVE_P (buffer)
&& (buffer->base_buffer == NULL)
&& (buffer->text->compact != buffer->text->modiff))
{
@@ -1888,19 +1881,20 @@ cleaning up all windows currently displaying the buffer to be killed. */)
if (b->base_buffer)
{
- { /* Unchain all markers that belong to this indirect buffer.
- Don't unchain the markers that belong to the base buffer
- or its other indirect buffers. */
- struct Lisp_Marker **mp;
- for (mp = &BUF_MARKERS (b); *mp; )
- {
- struct Lisp_Marker *m = *mp;
- if (m->buffer == b)
+ /* Unchain all markers that belong to this indirect buffer.
+ Don't unchain the markers that belong to the base buffer
+ or its other indirect buffers. */
+ struct Lisp_Marker **mp = &BUF_MARKERS (b);
+ while ((m = *mp))
+ {
+ if (m->buffer == b)
+ {
+ m->buffer = NULL;
*mp = m->next;
- else
- mp = &m->next;
- }
- }
+ }
+ else
+ mp = &m->next;
+ }
}
else
{
@@ -2114,6 +2108,8 @@ set_buffer_internal_1 (register struct buffer *b)
if (current_buffer == b)
return;
+ BUFFER_CHECK_INDIRECTION (b);
+
old_buf = current_buffer;
current_buffer = b;
last_known_column_point = -1; /* invalidate indentation cache */
diff --git a/src/buffer.h b/src/buffer.h
index d18ef30ea38..9e0e9eef0b1 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -963,6 +963,22 @@ bset_width_table (struct buffer *b, Lisp_Object val)
#define BUFFER_LIVE_P(b) (!NILP (BVAR (b, name)))
+/* Verify indirection counters. */
+
+#define BUFFER_CHECK_INDIRECTION(b) \
+ do { \
+ if (BUFFER_LIVE_P (b)) \
+ { \
+ if (b->base_buffer) \
+ { \
+ eassert (b->indirections == -1); \
+ eassert (b->base_buffer->indirections > 0); \
+ } \
+ else \
+ eassert (b->indirections >= 0); \
+ } \
+ } while (0)
+
/* Chain of all buffers, including killed ones. */
extern struct buffer *all_buffers;
diff --git a/src/dbusbind.c b/src/dbusbind.c
index c2eefd605bb..08f34f47042 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -32,6 +32,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define DBUS_NUM_MESSAGE_TYPES 5
#endif
+
+/* Some platforms define the symbol "interface", but we want to use it
+ * as a variable name below. */
+
+#ifdef interface
+#undef interface
+#endif
+
/* Subroutines. */
static Lisp_Object Qdbus_init_bus;
diff --git a/src/editfns.c b/src/editfns.c
index 19fad7130a7..c5d4ed295ab 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1339,15 +1339,6 @@ DEFUN ("system-name", Fsystem_name, Ssystem_name, 0, 0, 0,
return Vsystem_name;
}
-const char *
-get_system_name (void)
-{
- if (STRINGP (Vsystem_name))
- return SSDATA (Vsystem_name);
- else
- return "";
-}
-
DEFUN ("emacs-pid", Femacs_pid, Semacs_pid, 0, 0, 0,
doc: /* Return the process ID of Emacs, as a number. */)
(void)
diff --git a/src/image.c b/src/image.c
index d52c3a29a27..538ae2b7772 100644
--- a/src/image.c
+++ b/src/image.c
@@ -6577,7 +6577,7 @@ static const struct image_keyword tiff_format[TIFF_LAST] =
{":index", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0}
};
-#ifdef HAVE_NTGUI
+#if defined HAVE_NTGUI && defined WINDOWSNT
static bool init_tiff_functions (void);
#else
#define init_tiff_functions NULL
@@ -7529,7 +7529,7 @@ static struct image_keyword imagemagick_format[IMAGEMAGICK_LAST] =
{":crop", IMAGE_DONT_CHECK_VALUE_TYPE, 0}
};
-#ifdef HAVE_NTGUI
+#if defined HAVE_NTGUI && defined WINDOWSNT
static bool init_imagemagick_functions (void);
#else
#define init_imagemagick_functions NULL
@@ -8083,7 +8083,7 @@ static const struct image_keyword svg_format[SVG_LAST] =
{":background", IMAGE_STRING_OR_NIL_VALUE, 0}
};
-#ifdef HAVE_NTGUI
+#if defined HAVE_NTGUI && defined WINDOWSNT
static bool init_svg_functions (void);
#else
#define init_svg_functions NULL
diff --git a/src/indent.c b/src/indent.c
index 81a63455ecb..bbc944d2518 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -119,8 +119,7 @@ disptab_matches_widthtab (struct Lisp_Char_Table *disptab, struct Lisp_Vector *w
{
int i;
- if (widthtab->header.size != 256)
- emacs_abort ();
+ eassert (widthtab->header.size == 256);
for (i = 0; i < 256; i++)
if (character_width (i, disptab)
@@ -141,8 +140,7 @@ recompute_width_table (struct buffer *buf, struct Lisp_Char_Table *disptab)
if (!VECTORP (BVAR (buf, width_table)))
bset_width_table (buf, Fmake_vector (make_number (256), make_number (0)));
widthtab = XVECTOR (BVAR (buf, width_table));
- if (widthtab->header.size != 256)
- emacs_abort ();
+ eassert (widthtab->header.size == 256);
for (i = 0; i < 256; i++)
XSETFASTINT (widthtab->contents[i], character_width (i, disptab));
diff --git a/src/lisp.h b/src/lisp.h
index 7afe7b373fe..01f6ca5e57c 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3127,7 +3127,6 @@ 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, bool);
extern void init_editfns (void);
-const char *get_system_name (void);
extern void syms_of_editfns (void);
extern void set_time_zone_rule (const char *);
diff --git a/src/nsterm.m b/src/nsterm.m
index 98dd0a8aab1..dfc84db50f7 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3444,7 +3444,10 @@ ns_select (int nfds, fd_set *readfds, fd_set *writefds,
/* NSTRACE (ns_select); */
for (k = 0; readfds && k < nfds+1; k++)
- if (FD_ISSET(k, readfds)) ++nr;
+ {
+ if (FD_ISSET(k, readfds)) ++nr;
+ if (FD_ISSET(k, writefds)) ++nr;
+ }
if (NSApp == nil
|| (timeout && timeout->tv_sec == 0 && timeout->tv_nsec == 0))
diff --git a/src/print.c b/src/print.c
index 49b491faec8..ccf0e8ed7cc 100644
--- a/src/print.c
+++ b/src/print.c
@@ -2075,7 +2075,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
/* Print a description of INTERVAL using PRINTCHARFUN.
This is part of printing a string that has text properties. */
-void
+static void
print_interval (INTERVAL interval, Lisp_Object printcharfun)
{
if (NILP (interval->plist))
diff --git a/src/window.c b/src/window.c
index 61d2a8b073f..b4fee61cac8 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1464,9 +1464,7 @@ if it isn't already recorded. */)
#endif
if (! NILP (update)
- && ! (! NILP (w->window_end_valid)
- && w->last_modified >= BUF_MODIFF (b)
- && w->last_overlay_modified >= BUF_OVERLAY_MODIFF (b))
+ && (windows_or_buffers_changed || NILP (w->window_end_valid))
&& !noninteractive)
{
struct text_pos startp;
@@ -3795,6 +3793,8 @@ resize_frame_windows (struct frame *f, int size, int horflag)
(m, make_number (XINT (r->top_line) + XINT (r->total_lines)));
}
}
+
+ windows_or_buffers_changed++;
}
@@ -4208,6 +4208,7 @@ grow_mini_window (struct window *w, int delta)
w->last_modified = 0;
w->last_overlay_modified = 0;
+ windows_or_buffers_changed++;
adjust_glyphs (f);
unblock_input ();
}
@@ -4245,6 +4246,7 @@ shrink_mini_window (struct window *w)
w->last_modified = 0;
w->last_overlay_modified = 0;
+ windows_or_buffers_changed++;
adjust_glyphs (f);
unblock_input ();
}
diff --git a/src/xrdb.c b/src/xrdb.c
index 73672c9617c..9d056a607e4 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -24,7 +24,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <unistd.h>
#include <errno.h>
#include <epaths.h>
-
+#include <stdlib.h>
#include <stdio.h>
#include "lisp.h"
@@ -48,11 +48,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "keyboard.h"
#endif
-extern char *getenv (const char *);
-
-extern struct passwd *getpwuid (uid_t);
-extern struct passwd *getpwnam (const char *);
-
char *x_get_string_resource (XrmDatabase rdb, const char *name,
const char *class);
static int file_p (const char *filename);
@@ -429,8 +424,9 @@ get_environ_db (void)
{
static char const xdefaults[] = ".Xdefaults-";
char *home = gethomedir ();
- char const *host = get_system_name ();
- ptrdiff_t pathsize = strlen (home) + sizeof xdefaults + strlen (host);
+ char const *host = SSDATA (Vsystem_name);
+ ptrdiff_t pathsize = (strlen (home) + sizeof xdefaults
+ + SBYTES (Vsystem_name));
path = xrealloc (home, pathsize);
strcat (strcat (path, xdefaults), host);
p = path;