summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-01-05 19:36:45 -0700
committerTom Tromey <tromey@redhat.com>2013-01-05 19:36:45 -0700
commite078a23febca14bc919c5806670479c395e3253e (patch)
treee9e4ed91feef744d525264c31974c3ed00146bcd /src
parent63d535c829a930207b64fe733228f15a554644b1 (diff)
parent7a2657fa3bedbd977f4e11fe030cb4a210c04ab4 (diff)
downloademacs-e078a23febca14bc919c5806670479c395e3253e.tar.gz
merge from trunk
Diffstat (limited to 'src')
-rw-r--r--src/.gdbinit6
-rw-r--r--src/ChangeLog385
-rw-r--r--src/ChangeLog.12
-rw-r--r--src/ChangeLog.102
-rw-r--r--src/ChangeLog.112
-rw-r--r--src/ChangeLog.22
-rw-r--r--src/ChangeLog.32
-rw-r--r--src/ChangeLog.42
-rw-r--r--src/ChangeLog.52
-rw-r--r--src/ChangeLog.62
-rw-r--r--src/ChangeLog.72
-rw-r--r--src/ChangeLog.82
-rw-r--r--src/ChangeLog.92
-rw-r--r--src/Makefile.in14
-rw-r--r--src/README2
-rw-r--r--src/alloc.c16
-rw-r--r--src/atimer.c2
-rw-r--r--src/atimer.h2
-rw-r--r--src/bidi.c4
-rw-r--r--src/blockinput.h2
-rw-r--r--src/buffer.c16
-rw-r--r--src/buffer.h7
-rw-r--r--src/bytecode.c3
-rw-r--r--src/callint.c4
-rw-r--r--src/casefiddle.c3
-rw-r--r--src/casetab.c2
-rw-r--r--src/category.c2
-rw-r--r--src/ccl.c2
-rw-r--r--src/character.c2
-rw-r--r--src/charset.c2
-rw-r--r--src/charset.h2
-rw-r--r--src/cm.c2
-rw-r--r--src/cm.h2
-rw-r--r--src/cmds.c2
-rw-r--r--src/coding.c9
-rw-r--r--src/coding.h4
-rw-r--r--src/commands.h2
-rw-r--r--src/composite.c2
-rw-r--r--src/composite.h2
-rw-r--r--src/conf_post.h12
-rw-r--r--src/cygw32.c20
-rw-r--r--src/cygw32.h2
-rw-r--r--src/data.c6
-rw-r--r--src/dbusbind.c2
-rw-r--r--src/deps.mk4
-rw-r--r--src/dired.c8
-rw-r--r--src/dispextern.h15
-rw-r--r--src/dispnew.c3
-rw-r--r--src/disptab.h2
-rw-r--r--src/doc.c12
-rw-r--r--src/doprnt.c2
-rw-r--r--src/dosfns.c3
-rw-r--r--src/dosfns.h4
-rw-r--r--src/editfns.c13
-rw-r--r--src/emacs-icon.h2
-rw-r--r--src/emacs.c4
-rw-r--r--src/emacsgtkfixed.c2
-rw-r--r--src/emacsgtkfixed.h2
-rw-r--r--src/epaths.in4
-rw-r--r--src/eval.c3
-rw-r--r--src/fileio.c212
-rw-r--r--src/filelock.c4
-rw-r--r--src/firstfile.c2
-rw-r--r--src/floatfns.c8
-rw-r--r--src/fns.c24
-rw-r--r--src/font.c15
-rw-r--r--src/font.h2
-rw-r--r--src/fontset.c2
-rw-r--r--src/fontset.h2
-rw-r--r--src/frame.c6
-rw-r--r--src/frame.h5
-rw-r--r--src/fringe.c7
-rw-r--r--src/ftfont.c2
-rw-r--r--src/ftxfont.c2
-rw-r--r--src/getpagesize.h3
-rw-r--r--src/gmalloc.c40
-rw-r--r--src/gnutls.c2
-rw-r--r--src/gnutls.h2
-rw-r--r--src/gtkutil.c105
-rw-r--r--src/gtkutil.h2
-rw-r--r--src/image.c2
-rw-r--r--src/indent.c7
-rw-r--r--src/indent.h2
-rw-r--r--src/inotify.c3
-rw-r--r--src/insdel.c6
-rw-r--r--src/intervals.c6
-rw-r--r--src/intervals.h2
-rw-r--r--src/keyboard.c41
-rw-r--r--src/keyboard.h3
-rw-r--r--src/keymap.c5
-rw-r--r--src/keymap.h2
-rw-r--r--src/lastfile.c2
-rw-r--r--src/lisp.h12
-rw-r--r--src/lisp.mk4
-rw-r--r--src/lread.c6
-rw-r--r--src/macros.c2
-rw-r--r--src/macros.h2
-rw-r--r--src/makefile.w32-in6
-rw-r--r--src/marker.c24
-rw-r--r--src/mem-limits.h3
-rw-r--r--src/menu.c4
-rw-r--r--src/menu.h2
-rw-r--r--src/minibuf.c9
-rw-r--r--src/msdos.c2
-rw-r--r--src/msdos.h2
-rw-r--r--src/nsfns.m15
-rw-r--r--src/nsfont.m2
-rw-r--r--src/nsgui.h2
-rw-r--r--src/nsimage.m4
-rw-r--r--src/nsmenu.m2
-rw-r--r--src/nsselect.m4
-rw-r--r--src/nsterm.h3
-rw-r--r--src/nsterm.m17
-rw-r--r--src/print.c46
-rw-r--r--src/process.c28
-rw-r--r--src/process.h2
-rw-r--r--src/profiler.c2
-rw-r--r--src/puresize.h2
-rw-r--r--src/ralloc.c2
-rw-r--r--src/regex.c6
-rw-r--r--src/regex.h8
-rw-r--r--src/region-cache.c4
-rw-r--r--src/region-cache.h4
-rw-r--r--src/scroll.c4
-rw-r--r--src/search.c13
-rw-r--r--src/sheap.c2
-rw-r--r--src/sound.c2
-rw-r--r--src/syntax.c4
-rw-r--r--src/syntax.h4
-rw-r--r--src/sysdep.c6
-rw-r--r--src/sysselect.h2
-rw-r--r--src/syssignal.h2
-rw-r--r--src/systime.h2
-rw-r--r--src/systty.h2
-rw-r--r--src/syswait.h2
-rw-r--r--src/term.c8
-rw-r--r--src/termcap.c8
-rw-r--r--src/termchar.h2
-rw-r--r--src/termhooks.h3
-rw-r--r--src/terminal.c4
-rw-r--r--src/terminfo.c2
-rw-r--r--src/termopts.h3
-rw-r--r--src/textprop.c21
-rw-r--r--src/tparam.c8
-rw-r--r--src/tparam.h2
-rw-r--r--src/undo.c3
-rw-r--r--src/unexaix.c3
-rw-r--r--src/unexcoff.c3
-rw-r--r--src/unexcw.c2
-rw-r--r--src/unexelf.c4
-rw-r--r--src/unexmacosx.c2
-rw-r--r--src/unexw32.c2
-rw-r--r--src/vm-limit.c2
-rw-r--r--src/w16select.c2
-rw-r--r--src/w32.c515
-rw-r--r--src/w32.h2
-rw-r--r--src/w32common.h2
-rw-r--r--src/w32console.c2
-rw-r--r--src/w32fns.c2
-rw-r--r--src/w32font.c2
-rw-r--r--src/w32font.h2
-rw-r--r--src/w32gui.h2
-rw-r--r--src/w32heap.c2
-rw-r--r--src/w32heap.h2
-rw-r--r--src/w32inevt.c3
-rw-r--r--src/w32inevt.h2
-rw-r--r--src/w32menu.c4
-rw-r--r--src/w32notify.c2
-rw-r--r--src/w32proc.c38
-rw-r--r--src/w32reg.c3
-rw-r--r--src/w32select.c2
-rw-r--r--src/w32select.h2
-rw-r--r--src/w32term.c82
-rw-r--r--src/w32term.h2
-rw-r--r--src/w32uniscribe.c2
-rw-r--r--src/w32xfns.c3
-rw-r--r--src/widget.c2
-rw-r--r--src/widget.h2
-rw-r--r--src/widgetprv.h2
-rw-r--r--src/window.c47
-rw-r--r--src/window.h12
-rw-r--r--src/xdisp.c156
-rw-r--r--src/xfaces.c2
-rw-r--r--src/xfns.c2
-rw-r--r--src/xfont.c2
-rw-r--r--src/xftfont.c2
-rw-r--r--src/xgselect.c2
-rw-r--r--src/xgselect.h2
-rw-r--r--src/xmenu.c4
-rw-r--r--src/xml.c2
-rw-r--r--src/xrdb.c3
-rw-r--r--src/xselect.c2
-rw-r--r--src/xsettings.c2
-rw-r--r--src/xsettings.h2
-rw-r--r--src/xsmfns.c2
-rw-r--r--src/xterm.c15
-rw-r--r--src/xterm.h12
197 files changed, 1767 insertions, 726 deletions
diff --git a/src/.gdbinit b/src/.gdbinit
index e1ee81e66b5..4688b0a4421 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -1,4 +1,4 @@
-# Copyright (C) 1992-1998, 2000-2012 Free Software Foundation, Inc.
+# Copyright (C) 1992-1998, 2000-2013 Free Software Foundation, Inc.
#
# This file is part of GNU Emacs.
#
@@ -13,9 +13,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with GNU Emacs; see the file COPYING. If not, write to the
-# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301, USA.
+# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
# Force loading of symbols, enough to give us VALBITS etc.
set $dummy = main + 8
diff --git a/src/ChangeLog b/src/ChangeLog
index 3cf105c8003..c0c85c15ee9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,9 +1,369 @@
+2013-01-05 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
+ of a non-portable "t" to print ptrdiff_t values. Allow up to 9
+ digits for buffer positions, before misalignment starts. Display
+ "0" for integer "object" field.
+ (dump_glyph_row): Adapt the header line to changes in dump_glyph.
+ Display the newline glyph more unambiguously.
+
+2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * nsterm.m (ns_draw_underwave):
+ * w32term.c (w32_draw_underwave):
+ * xterm.c (x_draw_underwave): Make underwave look more triangular
+ and also degrade gracefully for small fonts. (Bug#13000)
+
+ * nsterm.m (ns_draw_text_decoration):
+ * w32term.c (x_draw_glyph_string):
+ * xterm.c (x_draw_glyph_string): Don't use previous underline
+ thickness and position if previous underline type is underwave.
+
+2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * fileio.c (Ffile_acl): Undocument return format.
+
+2013-01-02 Glenn Morris <rgm@gnu.org>
+
+ * keymap.c (Fkey_description): Doc fix. (Bug#13323)
+
+2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
+
+ Simplify via eabs.
+ * dired.c (file_name_completion):
+ * doc.c (get_doc_string):
+ * floatfns.c (round2):
+ * font.c (font_score, font_delete_unmatched):
+ * fringe.c (compute_fringe_widths):
+ * lread.c (read_list):
+ * minibuf.c (Ftry_completion):
+ * term.c (tty_ins_del_lines):
+ * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
+ Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
+
+2012-12-31 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (unsetenv): Set up the string passed to _putenv
+ correctly. See
+ http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
+ for the bug this caused.
+
+2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
+
+ * coding.c (Qmac): Now static.
+
+2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
+
+ * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
+ (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
+ handlebox_widget. Set toolbar_in_hbox to false/true, set
+ toolbar_is_packed to true.
+ (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
+ (update_frame_tool_bar): Check toolbar_is_packed for packing.
+ Show all on TOOLBAR_TOP_WIDGET.
+ (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
+ by TOOLBAR_TOP_WIDGET.
+ (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
+ Check toolbar_is_packed.
+ (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
+ HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
+ (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
+ false.
+ (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
+ (xg_update_menubar): Update title only if
+ HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
+ (xg_update_submenu): Skip tearoff only if
+ HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
+ (xg_initialize): Initialize xg_detached_menus only if
+ HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
+
+ * xterm.h (struct x_output): Surround handlebox_widget with
+ #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
+ toolbar_in_hbox is bool.
+
+2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
+
+ * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
+ (LIBS_GNUSTEP): Define.
+ (LIBES): Add $(LIBS_GNUSTEP).
+ (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
+
+2012-12-30 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
+ continuation glyph on a TTY with an indication of an empty line.
+ (Bug#13277)
+
+2012-12-29 Eli Zaretskii <eliz@gnu.org>
+
+ * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
+ file's SELinux context or ACLs successfully set, nil otherwise.
+ (Bug#13298)
+ (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
+
+ * w32proc.c (reader_thread): Avoid passing NULL handles to
+ SetEvent and WaitForSingleObject.
+
+2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
+
+ Port EXTERNALLY_VISIBLE to Clang 3.2.
+ * conf_post.h (__has_attribute): New macro.
+ (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
+
+2012-12-27 Glenn Morris <rgm@gnu.org>
+
+ * cygw32.c (Fcygwin_convert_file_name_to_windows)
+ (Fcygwin_convert_file_name_from_windows): Doc fixes.
+
+2012-12-27 Eli Zaretskii <eliz@gnu.org>
+
+ * fileio.c (file_name_as_directory, directory_file_name): Accept
+ an additional argument MULTIBYTE to indicate whether the input C
+ came from a multibyte or a unibyte Lisp string; all callers
+ adjusted. Don't assume the input string is always multibyte.
+ (Bug#13262)
+ (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
+ don't ENCODE_FILE them, and return a unibyte string if the input
+ was unibyte.
+ (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
+ don't assume the input strings will always be multibyte. If the
+ input strings are multibyte, decode strings obtained from C
+ library functions.
+
+2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * lisp.h (toplevel): Add two notices to the comment about
+ defining a new Lisp data type.
+ * print.c (print_object): If Lisp_Save_Value object's pointer
+ is the address of a memory area containing Lisp_Objects, try
+ to print them.
+ * alloc.c (valid_lisp_object_p): Adjust comment.
+
+2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * keyboard.c (record_asynch_buffer_change): Initialize an event
+ only if it's really needed.
+ * frame.h (enum output_method): Remove output_mac member since
+ it's a leftover from the deleted code.
+ * frame.c (Fframep): Adjust user here ...
+ * terminal.c (Fterminal_live_p): ... and here.
+ * coding.c (Qmac): Now here because it's only used to denote
+ end-of-line encoding type.
+ (syms_of_coding): DEFSYM it.
+ * frame.h (Qmac): Remove duplicated declaration.
+
+2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ * window.c (select_window_1): Now static, since it's used only here.
+
+2012-12-25 Eli Zaretskii <eliz@gnu.org>
+
+ * window.c (window_body_cols): Subtract display margins from the
+ window body width on TTYs as well. See
+ http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
+ for the original report.
+
+2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * xdisp.c (redisplay_window): Remove inner local variable
+ because the outer shadowed one has the same meaning.
+ * xterm.h (struct x_output): Remove toolbar_detached member since it's
+ set but never used.
+ * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
+ (xg_create_tool_bar): Adjust users.
+
+2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * buffer.h (BUF_COMPACT): New macro to follow the common style.
+ * buffer.c (Fget_buffer_create): Use it to set compact field of
+ struct buffer_text to avoid accessing an uninitialized value
+ when compact_buffer is called for the first time.
+ (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
+ (Fset_buffer_modified_p): Use buffer_window_count to check
+ whether the buffer is displayed in some window.
+ * xdisp.c (message_dolog): Likewise.
+
+2012-12-23 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (acl_set_file): If setting the file security descriptor
+ fails, and the new DACL is identical to the existing one, silently
+ return success. This fixes problems for users backing up their
+ own files without having the necessary privileges for setting
+ security descriptors.
+
+ * w32proc.c (reader_thread): Do not index fd_info[] with negative
+ values.
+ (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
+ after WaitForSingleObject returns normally. This expedites reader
+ thread shutdown when delete_child triggers it.
+ (reap_subprocess): More accurate commentary for why we call
+ delete_child only when cp->fd is negative.
+
+ * w32.c (sys_close): Do not call delete_child on a subprocess
+ whose handle is not yet closed. Instead, set its file descriptor
+ to a negative value, so that reap_subprocess will call
+ delete_child on that subprocess when its SIGCHLD arrives. This
+ avoids closing handles used for communications between sys_select
+ and reader_thread, which doesn't give sys_select a chance to
+ notice that the process exited and invoke the SIGCHLD handler for
+ it.
+
+2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsfns.m (Fns_do_applescript): Run event loop until script has
+ been executed (Bug#12969).
+ (ns_run_ascript): Chech as_script for nil, set to nil after
+ executing script.
+
+2012-12-22 Martin Rudalics <rudalics@gmx.at>
+
+ * window.c (Fselect_window): Reword doc-string (Bug#13248).
+
+2012-12-22 Eli Zaretskii <eliz@gnu.org>
+
+ * w32term.c (w32fullscreen_hook): New function.
+ (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
+
+2012-12-21 Eli Zaretskii <eliz@gnu.org>
+
+ * fileio.c (Finsert_file_contents): Doc fix.
+
+ * w32proc.c (new_child, delete_child, find_child_pid): For a
+ subprocess, consider its slot being in use as long as its process
+ handle (procinfo.hProcess) is not NULL. This avoids reusing the
+ slot when a new process is started immediately after killing
+ another one, without waiting enough time for the first process to
+ be reaped and resources allocated for it be orderly freed.
+ (Bug#13086)
+ Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
+
+2012-12-21 Chong Yidong <cyd@gnu.org>
+
+ * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
+
+ * fns.c (Fcompare_strings): Doc fix (Bug#13081).
+
+2012-12-21 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (get_name_and_id): Always pass NULL as the first argument
+ of lookup_account_sid. Avoids crashes with UNC file names that
+ refer to DFS domains, not to specific machine names. (Bug#12621)
+ Remove now unused argument FNAME; all callers changed.
+ (get_file_owner_and_group): Remove now unused argument FNAME; all
+ callers changed.
+
+2012-12-21 Chong Yidong <cyd@gnu.org>
+
+ * editfns.c (Finsert_char): Since read-char-by-name now signals an
+ error for invalid chars, don't check for a nil return value.
+
+2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Avoid calls to CHAR_TO_BYTE if byte position is known.
+ * editfns.c (make_buffer_string_both): Use move_gap_both.
+ (Fbuffer_string): Use make_buffer_string_both.
+ * marker.c (buf_charpos_to_bytepos): Convert to eassert.
+ Adjust comment.
+ (buf_bytepos_to_charpos): Likewise.
+ (charpos_to_bytepos): Remove.
+ * fileio.c (Finsert_file_contents): Use move_gap_both.
+ * search.c (Freplace_match): Likewise.
+ * process.c (process_send_region): Likewise. Use convenient
+ names for byte positions.
+ * lisp.h (charpos_to_bytepos): Remove prototype.
+ * indent.c (scan_for_column): Use CHAR_TO_BYTE.
+ * insdel.c (move_gap): Likewise.
+
+2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
+
+ * xdisp.c (redisplay_internal): Remove now-unused local.
+
+2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
+ (redisplay_internal): Don't bother selecting the frame to get the
+ proper value of frame-local variables (bug#13225).
+
+2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * textprop.c (set_text_properties_1): Do not allow NULL interval.
+ Rename 4th argument since it may be buffer or string. Adjust comment.
+ * intervals.c (graft_intervals_info_buffer): Find an interval here.
+
+2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * coding.c (Fdetect_coding_region): Do not check start and end with
+ CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
+ (code_convert_region): Likewise.
+
+2012-12-18 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (acl_get_file, acl_set_file): Run the file name through
+ map_w32_filename, and resolve any symlinks in the file name, like
+ Posix platforms do.
+ (acl_set_file): Call revert_to_self, if any privileges were
+ enabled.
+
+2012-12-17 Juanma Barranquero <lekktu@gmail.com>
+
+ * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
+ ($(BLD)/w32.$(O)): Update dependencies.
+
+2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
+ propagate redisplay's scrolling (if any) to the right window.
+ (redisplay_internal): Use ensure_selected_frame.
+ (display_mode_lines): Complete last fix.
+ * window.c (select_window_1): New func, extracted from select_window.
+ (select_window): Use it.
+ * window.h (select_window_1): Declare.
+
+2012-12-17 Eli Zaretskii <eliz@gnu.org>
+
+ Emulate Posix ACL APIs on MS-Windows.
+ * w32.c: Include sddl.h and sys/acl.h.
+ (SDDL_REVISION_1): Define if not already defined.
+ (g_b_init_get_security_descriptor_dacl)
+ (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
+ (g_b_init_is_valid_security_descriptor)
+ (g_b_init_set_file_security): New static flags.
+ (globals_of_w32): Initialize them to zero.
+ (SetFileSecurity_Name): New string constant.
+ (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
+ (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
+ (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
+ (IsValidSecurityDescriptor_Proc): New typedefs.
+ (get_file_security, get_security_descriptor_owner)
+ (get_security_descriptor_group): Set errno to ENOTSUP.
+ (set_file_security, get_security_descriptor_dacl)
+ (is_valid_security_descriptor, convert_sd_to_sddl)
+ (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
+ (acl_free, acl_get_file, acl_set_file): New functions.
+
+ * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
+
+2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ Don't reraise SIGCHLD, as that can now lose (Bug#13192).
+ With the 2012-12-03 fix for Bug#12980 in place, an old workaround
+ for some of that bug's symptoms can now cause Emacs to abort.
+ Remove the workaround.
+ * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
+ The bug that caused SIGCHLD to get lost has been fixed, and the
+ workaround for it can now cause Emacs to abort.
+
+2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ * sysdep.c (emacs_abort): Bump backtrace size to 40.
+ Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
+ <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
+
2012-12-16 Romain Francoise <romain@orebokech.com>
* fileio.c (Ffile_acl, Fset_file_acl): New functions.
(Fcopy_file): Change last arg to `preserve_extended_attributes'
- and copy ACL entries of file in addition to SELinux context if
- set.
+ and copy ACL entries of file in addition to SELinux context if set.
(syms_of_fileio): Add `file-acl' and `set-file-acl'.
* Makefile.in (LIBACL_LIBS): New macro.
@@ -126,7 +486,7 @@
2012-12-12 Daniel Colascione <dancol@dancol.org>
- * unexcw.c (fixup_executable): use posix_fallocate to ensure that
+ * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
the dumped Emacs is not a sparse file, greatly improving Cygwin
"make bootstrap" performance.
@@ -195,8 +555,7 @@
* w32fns.c (cache_system_info): Initialize the global hinst
variable here so various initialization calls DTRT.
- * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused
- variables.
+ * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
(hinst): Remove unneeded extern declaration.
(_start): Remove initialization of above variables; remove
initialization of hinst, as cache_system_info now does that.
@@ -268,8 +627,7 @@
* w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
by posting it to the w32_read_socket queue.
- * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support
- FILE_NOTIFY_EVENT.
+ * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
* makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
(GLOBAL_SOURCES): Add w32notify.c
@@ -277,8 +635,8 @@
* lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
- * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]: Handle
- FILE_NOTIFY_EVENT.
+ * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
+ Handle FILE_NOTIFY_EVENT.
(syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
(keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
w32notify-handle-event by default.
@@ -289,8 +647,7 @@
2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
Support for filesystem notifications on GNU/Linux via inotify.
- * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add
- FILE_NOTIFY_EVENT.
+ * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
* lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
@@ -607,9 +964,9 @@
2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
* w32fns.c: Remove prototype of atof.
- (syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
+ (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
builds.
- (file_dialog_callback): Declared UINT_PTR.
+ (file_dialog_callback): Make it UINT_PTR.
* w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
with 64-bit builds.
@@ -20977,7 +21334,7 @@ See ChangeLog.11 for earlier changes.
;; coding: utf-8
;; End:
- Copyright (C) 2011-2012 Free Software Foundation, Inc.
+ Copyright (C) 2011-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/ChangeLog.1 b/src/ChangeLog.1
index 5265d6fdf59..0d926760017 100644
--- a/src/ChangeLog.1
+++ b/src/ChangeLog.1
@@ -3521,7 +3521,7 @@
* minibuf.c: Don't allow entry to minibuffer
while minibuffer is selected.
- Copyright (C) 1985-1986, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1985-1986, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/ChangeLog.10 b/src/ChangeLog.10
index 6eda101c815..c878c48a4f4 100644
--- a/src/ChangeLog.10
+++ b/src/ChangeLog.10
@@ -27912,7 +27912,7 @@ See ChangeLog.9 for earlier changes.
;; add-log-time-zone-rule: t
;; End:
- Copyright (C) 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/ChangeLog.11 b/src/ChangeLog.11
index 1f444b9292c..1195a8f9592 100644
--- a/src/ChangeLog.11
+++ b/src/ChangeLog.11
@@ -31383,7 +31383,7 @@ See ChangeLog.10 for earlier changes.
;; coding: utf-8
;; End:
- Copyright (C) 2007-2012 Free Software Foundation, Inc.
+ Copyright (C) 2007-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/ChangeLog.2 b/src/ChangeLog.2
index 0806106836e..64e793c763c 100644
--- a/src/ChangeLog.2
+++ b/src/ChangeLog.2
@@ -4771,7 +4771,7 @@
See ChangeLog.1 for earlier changes.
- Copyright (C) 1986-1988, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1986-1988, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/ChangeLog.3 b/src/ChangeLog.3
index 4f6e02ff8d3..2f798e1f0bc 100644
--- a/src/ChangeLog.3
+++ b/src/ChangeLog.3
@@ -16507,7 +16507,7 @@ See ChangeLog.2 for earlier changes.
;; coding: utf-8
;; End:
- Copyright (C) 1993, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1993, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/ChangeLog.4 b/src/ChangeLog.4
index d7ef7d8779a..54ce63556ea 100644
--- a/src/ChangeLog.4
+++ b/src/ChangeLog.4
@@ -6906,7 +6906,7 @@ See ChangeLog.3 for earlier changes.
;; coding: utf-8
;; End:
- Copyright (C) 1993-1994, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1993-1994, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/ChangeLog.5 b/src/ChangeLog.5
index c6dfde7496b..6fefabc5cd0 100644
--- a/src/ChangeLog.5
+++ b/src/ChangeLog.5
@@ -7148,7 +7148,7 @@ See ChangeLog.4 for earlier changes.
;; coding: utf-8
;; End:
- Copyright (C) 1994-1995, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1994-1995, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/ChangeLog.6 b/src/ChangeLog.6
index 64f8b3a8314..77aadf4cf10 100644
--- a/src/ChangeLog.6
+++ b/src/ChangeLog.6
@@ -5354,7 +5354,7 @@
See ChangeLog.5 for earlier changes.
- Copyright (C) 1995-1996, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1995-1996, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/ChangeLog.7 b/src/ChangeLog.7
index ce240ab2928..bb12627b698 100644
--- a/src/ChangeLog.7
+++ b/src/ChangeLog.7
@@ -11091,7 +11091,7 @@ See ChangeLog.6 for earlier changes.
;; coding: utf-8
;; End:
- Copyright (C) 1997-1998, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1997-1998, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/ChangeLog.8 b/src/ChangeLog.8
index e68966b16a2..e89e6b006b7 100644
--- a/src/ChangeLog.8
+++ b/src/ChangeLog.8
@@ -13979,7 +13979,7 @@
See ChangeLog.7 for earlier changes.
- Copyright (C) 1999, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/ChangeLog.9 b/src/ChangeLog.9
index d6d772c5f95..b451b78944f 100644
--- a/src/ChangeLog.9
+++ b/src/ChangeLog.9
@@ -13294,7 +13294,7 @@ See ChangeLog.8 for earlier changes.
;; coding: utf-8
;; End:
- Copyright (C) 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/Makefile.in b/src/Makefile.in
index b920600c4c0..7a17f823df5 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,7 +1,7 @@
# src/Makefile for GNU Emacs.
-# Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2012
-# Free Software Foundation, Inc.
+# Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2013 Free Software
+# Foundation, Inc.
# This file is part of GNU Emacs.
@@ -111,9 +111,6 @@ LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@
## Flags to pass to ld only for temacs.
TEMACS_LDFLAGS = $(LD_SWITCH_SYSTEM) $(LD_SWITCH_SYSTEM_TEMACS)
-## $LDFLAGS or empty if NS_IMPL_GNUSTEP (for some reason).
-TEMACS_LDFLAGS2 = @TEMACS_LDFLAGS2@
-
## If available, the full path to the paxctl program.
## On grsecurity/PaX systems, unexec will fail due to a gap between
## the bss section and the heap. This can be prevented by disabling
@@ -230,6 +227,9 @@ LIBX_OTHER=@LIBX_OTHER@
## configure, which should set it to nil in non-X builds.
LIBX_BASE=$(LIBXMENU) $(LD_SWITCH_X_SITE)
+## Only used for GNUstep
+LIBS_GNUSTEP=@LIBS_GNUSTEP@
+
LIBSOUND= @LIBSOUND@
CFLAGS_SOUND= @CFLAGS_SOUND@
@@ -401,7 +401,7 @@ otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \
## Note that SunOS needs -lm to come before -lc; otherwise, you get
## duplicated symbols. If the standard libraries were compiled
## with GCC, we might need LIB_GCC again after them.
-LIBES = $(LIBS) $(W32_LIBS) $(LIBX_BASE) $(LIBIMAGE) \
+LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \
$(LIBX_OTHER) $(LIBSOUND) \
$(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_CLOCK_GETTIME) \
$(LIB_EACCESS) $(LIB_TIMER_TIME) $(DBUS_LIBS) \
@@ -476,7 +476,7 @@ $(lib)/libgnu.a: $(config_h)
temacs$(EXEEXT): $(START_FILES) stamp-oldxmenu $(obj) $(otherobj) \
$(lib)/libgnu.a $(W32_RES)
- $(CC) $(LD_FIRSTFLAG) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(TEMACS_LDFLAGS2) \
+ $(CC) $(LD_FIRSTFLAG) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
-o temacs $(START_FILES) $(obj) $(otherobj) $(lib)/libgnu.a $(LIBES) \
$(W32_RES_LINK)
test "$(CANNOT_DUMP)" = "yes" || \
diff --git a/src/README b/src/README
index 558710627a7..0508137cbea 100644
--- a/src/README
+++ b/src/README
@@ -1,4 +1,4 @@
-Copyright (C) 2001-2012 Free Software Foundation, Inc.
+Copyright (C) 2001-2013 Free Software Foundation, Inc.
See the end of the file for license conditions.
diff --git a/src/alloc.c b/src/alloc.c
index d091a9cdf55..c2b2a4c1ed7 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1,7 +1,7 @@
/* Storage allocation and gc for GNU Emacs Lisp interpreter.
-Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2012
- Free Software Foundation, Inc.
+Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2013 Free Software
+Foundation, Inc.
This file is part of GNU Emacs.
@@ -4726,12 +4726,12 @@ valid_pointer_p (void *p)
#endif
}
-/* Return 2 if OBJ is a killed or special buffer object.
- Return 1 if OBJ is a valid lisp object.
- Return 0 if OBJ is NOT a valid lisp object.
- Return -1 if we cannot validate OBJ.
- This function can be quite slow,
- so it should only be used in code for manual debugging. */
+/* Return 2 if OBJ is a killed or special buffer object, 1 if OBJ is a
+ valid lisp object, 0 if OBJ is NOT a valid lisp object, or -1 if we
+ cannot validate OBJ. This function can be quite slow, so its primary
+ use is the manual debugging. The only exception is print_object, where
+ we use it to check whether the memory referenced by the pointer of
+ Lisp_Save_Value object contains valid objects. */
int
valid_lisp_object_p (Lisp_Object obj)
diff --git a/src/atimer.c b/src/atimer.c
index 5752192be76..73c7aa5686b 100644
--- a/src/atimer.c
+++ b/src/atimer.c
@@ -1,5 +1,5 @@
/* Asynchronous timers.
- Copyright (C) 2000-2012 Free Software Foundation, Inc.
+ Copyright (C) 2000-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/atimer.h b/src/atimer.h
index 6d441d71641..2a92f1bebea 100644
--- a/src/atimer.h
+++ b/src/atimer.h
@@ -1,5 +1,5 @@
/* Asynchronous timers.
- Copyright (C) 2000-2012 Free Software Foundation, Inc.
+ Copyright (C) 2000-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/bidi.c b/src/bidi.c
index 6f3d749ef22..b067c8134e3 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -1,6 +1,6 @@
/* Low-level bidirectional buffer/string-scanning functions for GNU Emacs.
- Copyright (C) 2000-2001, 2004-2005, 2009-2012
- Free Software Foundation, Inc.
+ Copyright (C) 2000-2001, 2004-2005, 2009-2013 Free Software
+ Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/blockinput.h b/src/blockinput.h
index 70822e29be7..192c813073d 100644
--- a/src/blockinput.h
+++ b/src/blockinput.h
@@ -1,5 +1,5 @@
/* blockinput.h - interface to blocking complicated interrupt-driven input.
- Copyright (C) 1989, 1993, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1989, 1993, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/buffer.c b/src/buffer.c
index c8864419076..61b457e4558 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1,6 +1,7 @@
/* Buffer manipulation primitives for GNU Emacs.
-Copyright (C) 1985-1989, 1993-1995, 1997-2012 Free Software Foundation, Inc.
+Copyright (C) 1985-1989, 1993-1995, 1997-2013 Free Software Foundation,
+Inc.
This file is part of GNU Emacs.
@@ -573,6 +574,7 @@ even if it is dead. The return value is never nil. */)
BUF_CHARS_MODIFF (b) = 1;
BUF_OVERLAY_MODIFF (b) = 1;
BUF_SAVE_MODIFF (b) = 1;
+ BUF_COMPACT (b) = 1;
set_buffer_intervals (b, NULL);
BUF_UNCHANGED_MODIFIED (b) = 1;
BUF_OVERLAY_UNCHANGED_MODIFIED (b) = 1;
@@ -1338,7 +1340,7 @@ DEFUN ("set-buffer-modified-p", Fset_buffer_modified_p, Sset_buffer_modified_p,
A non-nil FLAG means mark the buffer modified. */)
(Lisp_Object flag)
{
- Lisp_Object fn, buffer, window;
+ Lisp_Object fn;
#ifdef CLASH_DETECTION
/* If buffer becoming modified, lock the file.
@@ -1391,9 +1393,7 @@ A non-nil FLAG means mark the buffer modified. */)
Ideally, I think there should be another mechanism for fontifying
buffers without "modifying" buffers, or redisplay should be
smarter about updating the `*' in mode lines. --gerd */
- XSETBUFFER (buffer, current_buffer);
- window = Fget_buffer_window (buffer, Qt);
- if (WINDOWP (window))
+ if (buffer_window_count (current_buffer))
{
++update_mode_lines;
current_buffer->prevent_redisplay_optimizations_p = 1;
@@ -1667,7 +1667,7 @@ compact_buffer (struct buffer *buffer)
which aren't changed since last compaction. */
if (BUFFER_LIVE_P (buffer)
&& (buffer->base_buffer == NULL)
- && (buffer->text->compact != buffer->text->modiff))
+ && (BUF_COMPACT (buffer) != BUF_MODIFF (buffer)))
{
/* If a buffer's undo list is Qt, that means that undo is
turned off in that buffer. Calling truncate_undo_list on
@@ -1692,7 +1692,7 @@ compact_buffer (struct buffer *buffer)
current_buffer = save_current;
}
}
- buffer->text->compact = buffer->text->modiff;
+ BUF_COMPACT (buffer) = BUF_MODIFF (buffer);
}
}
@@ -2047,7 +2047,7 @@ DEFUN ("bury-buffer-internal", Fbury_buffer_internal, Sbury_buffer_internal,
DEFUN ("set-buffer-major-mode", Fset_buffer_major_mode, Sset_buffer_major_mode, 1, 1, 0,
doc: /* Set an appropriate major mode for BUFFER.
For the *scratch* buffer, use `initial-major-mode', otherwise choose a mode
-according to `default-major-mode'.
+according to the default value of `major-mode'.
Use this function before selecting the buffer, since it may need to inspect
the current buffer's major mode. */)
(Lisp_Object buffer)
diff --git a/src/buffer.h b/src/buffer.h
index a65b769469f..4bf2b4c2a0b 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -1,7 +1,7 @@
/* Header file for the buffer manipulation primitives.
-Copyright (C) 1985-1986, 1993-1995, 1997-2012
- Free Software Foundation, Inc.
+Copyright (C) 1985-1986, 1993-1995, 1997-2013 Free Software Foundation,
+Inc.
This file is part of GNU Emacs.
@@ -193,6 +193,9 @@ INLINE_HEADER_BEGIN
/* FIXME: should we move this into ->text->auto_save_modiff? */
#define BUF_AUTOSAVE_MODIFF(buf) ((buf)->auto_save_modified)
+/* Compaction count. */
+#define BUF_COMPACT(buf) ((buf)->text->compact)
+
/* Marker chain of buffer. */
#define BUF_MARKERS(buf) ((buf)->text->markers)
diff --git a/src/bytecode.c b/src/bytecode.c
index a0b257347c2..010477904be 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -1,5 +1,6 @@
/* Execution of byte code produced by bytecomp.el.
- Copyright (C) 1985-1988, 1993, 2000-2012 Free Software Foundation, Inc.
+ Copyright (C) 1985-1988, 1993, 2000-2013 Free Software Foundation,
+ Inc.
This file is part of GNU Emacs.
diff --git a/src/callint.c b/src/callint.c
index c4c087e83d7..cd303908f69 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -1,6 +1,6 @@
/* Call a Lisp function interactively.
- Copyright (C) 1985-1986, 1993-1995, 1997, 2000-2012
- Free Software Foundation, Inc.
+ Copyright (C) 1985-1986, 1993-1995, 1997, 2000-2013 Free Software
+ Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/casefiddle.c b/src/casefiddle.c
index d9c6a078973..7f5b99752fa 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -1,6 +1,7 @@
/* GNU Emacs case conversion functions.
-Copyright (C) 1985, 1994, 1997-1999, 2001-2012 Free Software Foundation, Inc.
+Copyright (C) 1985, 1994, 1997-1999, 2001-2013 Free Software Foundation,
+Inc.
This file is part of GNU Emacs.
diff --git a/src/casetab.c b/src/casetab.c
index a84bc9202d0..76f72b26db3 100644
--- a/src/casetab.c
+++ b/src/casetab.c
@@ -1,5 +1,5 @@
/* GNU Emacs routines to deal with case tables.
- Copyright (C) 1993-1994, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1993-1994, 2001-2013 Free Software Foundation, Inc.
Author: Howard Gayle
diff --git a/src/category.c b/src/category.c
index 31cc90bca68..30ffbd0890f 100644
--- a/src/category.c
+++ b/src/category.c
@@ -1,6 +1,6 @@
/* GNU Emacs routines to deal with category tables.
-Copyright (C) 1998, 2001-2012 Free Software Foundation, Inc.
+Copyright (C) 1998, 2001-2013 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007, 2008, 2009, 2010, 2011
National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/src/ccl.c b/src/ccl.c
index 34cc1c98eea..9bfd437d885 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -1,5 +1,5 @@
/* CCL (Code Conversion Language) interpreter.
- Copyright (C) 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 2001-2013 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007, 2008, 2009, 2010, 2011
National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/src/character.c b/src/character.c
index 5808d48a235..b2caaa290af 100644
--- a/src/character.c
+++ b/src/character.c
@@ -1,6 +1,6 @@
/* Basic character support.
-Copyright (C) 2001-2012 Free Software Foundation, Inc.
+Copyright (C) 2001-2013 Free Software Foundation, Inc.
Copyright (C) 1995, 1997, 1998, 2001 Electrotechnical Laboratory, JAPAN.
Licensed to the Free Software Foundation.
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
diff --git a/src/charset.c b/src/charset.c
index 43be0e9c780..c3a4538f223 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1,5 +1,5 @@
/* Basic character set support.
- Copyright (C) 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 2001-2013 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007, 2008, 2009, 2010, 2011
National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/src/charset.h b/src/charset.h
index b5fa36290c8..d9a5662e520 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -1,5 +1,5 @@
/* Header for charset handler.
- Copyright (C) 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 2001-2013 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007, 2008, 2009, 2010, 2011
National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/src/cm.c b/src/cm.c
index eda6430bafa..842633aceec 100644
--- a/src/cm.c
+++ b/src/cm.c
@@ -1,5 +1,5 @@
/* Cursor motion subroutines for GNU Emacs.
- Copyright (C) 1985, 1995, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1995, 2001-2013 Free Software Foundation, Inc.
based primarily on public domain code written by Chris Torek
This file is part of GNU Emacs.
diff --git a/src/cm.h b/src/cm.h
index e3e2b71dba6..6d49dda9419 100644
--- a/src/cm.h
+++ b/src/cm.h
@@ -1,5 +1,5 @@
/* Cursor motion calculation definitions for GNU Emacs
- Copyright (C) 1985, 1989, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1989, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/cmds.c b/src/cmds.c
index 453a4b67e57..3ebad50184a 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -1,6 +1,6 @@
/* Simple built-in editing commands.
-Copyright (C) 1985, 1993-1998, 2001-2012 Free Software Foundation, Inc.
+Copyright (C) 1985, 1993-1998, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/coding.c b/src/coding.c
index 56202e4861d..5285a906823 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1,5 +1,5 @@
/* Coding system handler (conversion, detection, etc).
- Copyright (C) 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 2001-2013 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007, 2008, 2009, 2010, 2011
National Institute of Advanced Industrial Science and Technology (AIST)
@@ -302,6 +302,7 @@ Lisp_Object Vcoding_system_hash_table;
static Lisp_Object Qcoding_system, Qeol_type;
static Lisp_Object Qcoding_aliases;
Lisp_Object Qunix, Qdos;
+static Lisp_Object Qmac;
Lisp_Object Qbuffer_file_coding_system;
static Lisp_Object Qpost_read_conversion, Qpre_write_conversion;
static Lisp_Object Qdefault_char;
@@ -8426,9 +8427,6 @@ highest priority. */)
ptrdiff_t from, to;
ptrdiff_t from_byte, to_byte;
- CHECK_NUMBER_COERCE_MARKER (start);
- CHECK_NUMBER_COERCE_MARKER (end);
-
validate_region (&start, &end);
from = XINT (start), to = XINT (end);
from_byte = CHAR_TO_BYTE (from);
@@ -8872,8 +8870,6 @@ code_convert_region (Lisp_Object start, Lisp_Object end,
ptrdiff_t from, from_byte, to, to_byte;
Lisp_Object src_object;
- CHECK_NUMBER_COERCE_MARKER (start);
- CHECK_NUMBER_COERCE_MARKER (end);
if (NILP (coding_system))
coding_system = Qno_conversion;
else
@@ -10308,6 +10304,7 @@ syms_of_coding (void)
DEFSYM (Qeol_type, "eol-type");
DEFSYM (Qunix, "unix");
DEFSYM (Qdos, "dos");
+ DEFSYM (Qmac, "mac");
DEFSYM (Qbuffer_file_coding_system, "buffer-file-coding-system");
DEFSYM (Qpost_read_conversion, "post-read-conversion");
diff --git a/src/coding.h b/src/coding.h
index 192be58f083..eb95fa13ddb 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -1,5 +1,5 @@
/* Header for coding system handler.
- Copyright (C) 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 2001-2013 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007, 2008, 2009, 2010, 2011
National Institute of Advanced Industrial Science and Technology (AIST)
@@ -767,7 +767,7 @@ extern Lisp_Object Qcoding_system_p;
extern Lisp_Object Qraw_text, Qemacs_mule, Qno_conversion, Qundecided;
extern Lisp_Object Qbuffer_file_coding_system;
-extern Lisp_Object Qunix, Qdos, Qmac;
+extern Lisp_Object Qunix, Qdos;
extern Lisp_Object Qtranslation_table;
extern Lisp_Object Qtranslation_table_id;
diff --git a/src/commands.h b/src/commands.h
index 510fce0e182..35c2c05fe72 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -1,5 +1,5 @@
/* Definitions needed by most editing commands.
- Copyright (C) 1985, 1994, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1994, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/composite.c b/src/composite.c
index bcde0a4c9e6..ddd92389725 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -1,5 +1,5 @@
/* Composite sequence support.
- Copyright (C) 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 2001-2013 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
diff --git a/src/composite.h b/src/composite.h
index 9462b932c66..603291044bc 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -1,5 +1,5 @@
/* Header for composite sequence handler.
- Copyright (C) 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 2001-2013 Free Software Foundation, Inc.
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
diff --git a/src/conf_post.h b/src/conf_post.h
index b1997e79081..cd1e35bea7a 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -1,7 +1,7 @@
/* conf_post.h --- configure.ac includes this via AH_BOTTOM
-Copyright (C) 1988, 1993-1994, 1999-2002, 2004-2012
- Free Software Foundation, Inc.
+Copyright (C) 1988, 1993-1994, 1999-2002, 2004-2013 Free Software
+Foundation, Inc.
This file is part of GNU Emacs.
@@ -40,6 +40,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#endif
#endif
+#ifndef __has_attribute
+# define __has_attribute(a) 0 /* non-clang */
+#endif
+
/* This silences a few compilation warnings on FreeBSD. */
#ifdef BSD_SYSTEM_AHB
#undef BSD_SYSTEM_AHB
@@ -191,7 +195,9 @@ extern void _DebPrint (const char *fmt, ...);
#define NO_INLINE
#endif
-#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
+#if (__clang__ \
+ ? __has_attribute (externally_visible) \
+ : (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)))
#define EXTERNALLY_VISIBLE __attribute__((externally_visible))
#else
#define EXTERNALLY_VISIBLE
diff --git a/src/cygw32.c b/src/cygw32.c
index d9777d5e22e..a7dbdaed615 100644
--- a/src/cygw32.c
+++ b/src/cygw32.c
@@ -1,5 +1,5 @@
/* Cygwin support routines.
- Copyright (C) 2011-2012 Free Software Foundation, Inc.
+ Copyright (C) 2011-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -110,23 +110,25 @@ DEFUN ("cygwin-convert-file-name-to-windows",
Fcygwin_convert_file_name_to_windows,
Scygwin_convert_file_name_to_windows,
1, 2, 0,
- doc: /* Convert PATH to a Windows path. If ABSOLUTE-P is
-non-nil, return an absolute path.*/)
- (Lisp_Object path, Lisp_Object absolute_p)
+ doc: /* Convert a Cygwin file name FILE to a Windows-style file name.
+If ABSOLUTE-P is non-nil, return an absolute file name.
+For the reverse operation, see `cygwin-convert-file-name-from-windows'. */)
+ (Lisp_Object file, Lisp_Object absolute_p)
{
return from_unicode (
- conv_filename_to_w32_unicode (path, EQ (absolute_p, Qnil) ? 0 : 1));
+ conv_filename_to_w32_unicode (file, EQ (absolute_p, Qnil) ? 0 : 1));
}
DEFUN ("cygwin-convert-file-name-from-windows",
Fcygwin_convert_file_name_from_windows,
Scygwin_convert_file_name_from_windows,
1, 2, 0,
- doc: /* Convert a Windows path to a Cygwin path. If ABSOLUTE-P
-is non-nil, return an absolute path.*/)
- (Lisp_Object path, Lisp_Object absolute_p)
+ doc: /* Convert a Windows-style file name FILE to a Cygwin file name.
+If ABSOLUTE-P is non-nil, return an absolute file name.
+For the reverse operation, see `cygwin-convert-file-name-to-windows'. */)
+ (Lisp_Object file, Lisp_Object absolute_p)
{
- return conv_filename_from_w32_unicode (to_unicode (path, &path),
+ return conv_filename_from_w32_unicode (to_unicode (file, &file),
EQ (absolute_p, Qnil) ? 0 : 1);
}
diff --git a/src/cygw32.h b/src/cygw32.h
index 51571913fd1..5c7066f26d1 100644
--- a/src/cygw32.h
+++ b/src/cygw32.h
@@ -1,5 +1,5 @@
/* Header for Cygwin support routines.
- Copyright (C) 2011-2012 Free Software Foundation, Inc.
+ Copyright (C) 2011-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/data.c b/src/data.c
index 540c91bd4a5..e9f3a2cff3f 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1,6 +1,6 @@
/* Primitive operations on Lisp data types for GNU Emacs Lisp interpreter.
- Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2012
- Free Software Foundation, Inc.
+ Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2013 Free Software
+ Foundation, Inc.
This file is part of GNU Emacs.
@@ -620,7 +620,7 @@ DEFUN ("symbol-function", Fsymbol_function, Ssymbol_function, 1, 1, 0,
(register Lisp_Object symbol)
{
CHECK_SYMBOL (symbol);
- return XSYMBOL (symbol)->function;
+ return XSYMBOL (symbol)->function;
}
DEFUN ("symbol-plist", Fsymbol_plist, Ssymbol_plist, 1, 1, 0,
diff --git a/src/dbusbind.c b/src/dbusbind.c
index da8bbb1e5d7..863f7634eb5 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -1,5 +1,5 @@
/* Elisp bindings for D-Bus.
- Copyright (C) 2007-2012 Free Software Foundation, Inc.
+ Copyright (C) 2007-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/deps.mk b/src/deps.mk
index beca5f7c6bc..47185c9262c 100644
--- a/src/deps.mk
+++ b/src/deps.mk
@@ -1,7 +1,7 @@
### deps.mk --- src/Makefile fragment for GNU Emacs
-## Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2012
-## Free Software Foundation, Inc.
+## Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2013 Free Software
+## Foundation, Inc.
## This file is part of GNU Emacs.
diff --git a/src/dired.c b/src/dired.c
index 1fda9e8b371..b4dc702112e 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -1,5 +1,6 @@
/* Lisp functions for making directory listings.
- Copyright (C) 1985-1986, 1993-1994, 1999-2012 Free Software Foundation, Inc.
+ Copyright (C) 1985-1986, 1993-1994, 1999-2013 Free Software
+ Foundation, Inc.
This file is part of GNU Emacs.
@@ -671,10 +672,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag,
name, zero,
make_number (compare),
completion_ignore_case ? Qt : Qnil);
- ptrdiff_t matchsize
- = (EQ (cmp, Qt) ? compare
- : XINT (cmp) < 0 ? - XINT (cmp) - 1
- : XINT (cmp) - 1);
+ ptrdiff_t matchsize = EQ (cmp, Qt) ? compare : eabs (XINT (cmp)) - 1;
if (completion_ignore_case)
{
diff --git a/src/dispextern.h b/src/dispextern.h
index aa40f019fbe..46878745c07 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1,6 +1,6 @@
/* Interface definitions for display code.
-Copyright (C) 1985, 1993-1994, 1997-2012 Free Software Foundation, Inc.
+Copyright (C) 1985, 1993-1994, 1997-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -317,13 +317,18 @@ struct glyph
Lisp string, this is a position in that string. If it is a
buffer, this is a position in that buffer. A value of -1
together with a null object means glyph is a truncation glyph at
- the start of a row. */
+ the start of a row. Right truncation and continuation glyphs at
+ the right edge of a row have their position set to the next
+ buffer position that is not shown on this row. Glyphs inserted
+ by redisplay, such as the empty space after the end of a line on
+ TTYs, or the overlay-arrow on a TTY, have this set to -1. */
ptrdiff_t charpos;
- /* Lisp object source of this glyph. Currently either a buffer or
- a string, if the glyph was produced from characters which came from
+ /* Lisp object source of this glyph. Currently either a buffer or a
+ string, if the glyph was produced from characters which came from
a buffer or a string; or 0 if the glyph was inserted by redisplay
- for its own purposes such as padding. */
+ for its own purposes, such as padding or truncation/continuation
+ glyphs, or the overlay-arrow glyphs on TTYs. */
Lisp_Object object;
/* Width in pixels. */
diff --git a/src/dispnew.c b/src/dispnew.c
index 02b2f9c84e4..1e9d94f3789 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -1,6 +1,7 @@
/* Updating of data structures for redisplay.
-Copyright (C) 1985-1988, 1993-1995, 1997-2012 Free Software Foundation, Inc.
+Copyright (C) 1985-1988, 1993-1995, 1997-2013 Free Software Foundation,
+Inc.
This file is part of GNU Emacs.
diff --git a/src/disptab.h b/src/disptab.h
index 2e041707eea..e02bab04bbc 100644
--- a/src/disptab.h
+++ b/src/disptab.h
@@ -1,5 +1,5 @@
/* Things for GLYPHS and glyph tables.
- Copyright (C) 1993, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1993, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/doc.c b/src/doc.c
index 76008295add..16c0d4090a0 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -1,6 +1,7 @@
/* Record indices of function doc strings stored in a file.
-Copyright (C) 1985-1986, 1993-1995, 1997-2012 Free Software Foundation, Inc.
+Copyright (C) 1985-1986, 1993-1995, 1997-2013 Free Software Foundation,
+Inc.
This file is part of GNU Emacs.
@@ -83,24 +84,23 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool definition)
ptrdiff_t minsize;
int offset;
EMACS_INT position;
- Lisp_Object file, tem;
+ Lisp_Object file, tem, pos;
USE_SAFE_ALLOCA;
if (INTEGERP (filepos))
{
file = Vdoc_file_name;
- position = XINT (filepos);
+ pos = filepos;
}
else if (CONSP (filepos))
{
file = XCAR (filepos);
- position = XINT (XCDR (filepos));
+ pos = XCDR (filepos);
}
else
return Qnil;
- if (position < 0)
- position = - position;
+ position = eabs (XINT (pos));
if (!STRINGP (Vdoc_directory))
return Qnil;
diff --git a/src/doprnt.c b/src/doprnt.c
index 8cab219aafa..b8e1b547268 100644
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -1,7 +1,7 @@
/* Output like sprintf to a buffer of specified size.
Also takes args differently: pass one pointer to the end
of the format string in addition to the format string itself.
- Copyright (C) 1985, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1985, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/dosfns.c b/src/dosfns.c
index ce1ec4a4f93..37d3998b5ee 100644
--- a/src/dosfns.c
+++ b/src/dosfns.c
@@ -1,6 +1,7 @@
/* MS-DOS specific Lisp utilities. Coded by Manabu Higashida, 1991.
Major changes May-July 1993 Morten Welinder (only 10% original code left)
- Copyright (C) 1991, 1993, 1996-1998, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1993, 1996-1998, 2001-2013 Free Software
+ Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/dosfns.h b/src/dosfns.h
index 9747c364d71..0bf0ae1f19b 100644
--- a/src/dosfns.h
+++ b/src/dosfns.h
@@ -2,8 +2,8 @@
Coded by Manabu Higashida, 1991.
Modified by Morten Welinder, 1993-1994.
-Copyright (C) 1991, 1994-1995, 1997, 1999, 2001-2012
- Free Software Foundation, Inc.
+Copyright (C) 1991, 1994-1995, 1997, 1999, 2001-2013 Free Software
+Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/editfns.c b/src/editfns.c
index 911cd416e80..df0dad0669d 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1,6 +1,6 @@
/* Lisp functions pertaining to editing.
-Copyright (C) 1985-1987, 1989, 1993-2012 Free Software Foundation, Inc.
+Copyright (C) 1985-1987, 1989, 1993-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -2361,10 +2361,9 @@ usage: (insert-before-markers-and-inherit &rest ARGS) */)
}
DEFUN ("insert-char", Finsert_char, Sinsert_char, 1, 3,
- "(list (or (read-char-by-name \"Insert character (Unicode name or hex): \")\
- (error \"You did not specify a valid character\"))\
- (prefix-numeric-value current-prefix-arg)\
- t))",
+ "(list (read-char-by-name \"Insert character (Unicode name or hex): \")\
+ (prefix-numeric-value current-prefix-arg)\
+ t))",
doc: /* Insert COUNT copies of CHARACTER.
Interactively, prompt for CHARACTER. You can specify CHARACTER in one
of these ways:
@@ -2501,7 +2500,7 @@ make_buffer_string_both (ptrdiff_t start, ptrdiff_t start_byte,
Lisp_Object result, tem, tem1;
if (start < GPT && GPT < end)
- move_gap (start);
+ move_gap_both (start, start_byte);
if (! NILP (BVAR (current_buffer, enable_multibyte_characters)))
result = make_uninit_multibyte_string (end - start, end_byte - start_byte);
@@ -2599,7 +2598,7 @@ If narrowing is in effect, this function returns only the visible part
of the buffer. */)
(void)
{
- return make_buffer_string (BEGV, ZV, 1);
+ return make_buffer_string_both (BEGV, BEGV_BYTE, ZV, ZV_BYTE, 1);
}
DEFUN ("insert-buffer-substring", Finsert_buffer_substring, Sinsert_buffer_substring,
diff --git a/src/emacs-icon.h b/src/emacs-icon.h
index 590d874ca82..8869f6d7d76 100644
--- a/src/emacs-icon.h
+++ b/src/emacs-icon.h
@@ -1,7 +1,7 @@
/* XPM */
/* Emacs icon
-Copyright (C) 2008-2012 Free Software Foundation, Inc.
+Copyright (C) 2008-2013 Free Software Foundation, Inc.
Author: Kentaro Ohkouchi <nanasess@fsm.ne.jp>
diff --git a/src/emacs.c b/src/emacs.c
index 8787e4bca9f..57de81f05b0 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1,7 +1,7 @@
/* Fully extensible Emacs, running on Unix, intended for GNU.
-Copyright (C) 1985-1987, 1993-1995, 1997-1999, 2001-2012
- Free Software Foundation, Inc.
+Copyright (C) 1985-1987, 1993-1995, 1997-1999, 2001-2013 Free Software
+Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c
index d10185072cc..6a8c751e306 100644
--- a/src/emacsgtkfixed.c
+++ b/src/emacsgtkfixed.c
@@ -1,7 +1,7 @@
/* A Gtk Widget that inherits GtkFixed, but can be shrunk.
This file is only use when compiling with Gtk+ 3.
-Copyright (C) 2011-2012 Free Software Foundation, Inc.
+Copyright (C) 2011-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/emacsgtkfixed.h b/src/emacsgtkfixed.h
index 3fa294aa41e..d987797a934 100644
--- a/src/emacsgtkfixed.h
+++ b/src/emacsgtkfixed.h
@@ -1,7 +1,7 @@
/* A Gtk Widget that inherits GtkFixed, but can be shrunk.
This file is only use when compiling with Gtk+ 3.
-Copyright (C) 2011-2012 Free Software Foundation, Inc.
+Copyright (C) 2011-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/epaths.in b/src/epaths.in
index 705fe3aab1b..0cf8cc9ce5b 100644
--- a/src/epaths.in
+++ b/src/epaths.in
@@ -1,7 +1,7 @@
/* Hey Emacs, this is -*- C -*- code! */
/*
-Copyright (C) 1993, 1995, 1997, 1999, 2001-2012
- Free Software Foundation, Inc.
+Copyright (C) 1993, 1995, 1997, 1999, 2001-2013 Free Software
+Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/eval.c b/src/eval.c
index 0932564b36f..f88567f14cb 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1,5 +1,6 @@
/* Evaluator for GNU Emacs Lisp interpreter.
- Copyright (C) 1985-1987, 1993-1995, 1999-2012 Free Software Foundation, Inc.
+ Copyright (C) 1985-1987, 1993-1995, 1999-2013 Free Software
+ Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/fileio.c b/src/fileio.c
index f1cfe0eb625..5e9b36ee44a 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1,6 +1,6 @@
/* File IO for GNU Emacs.
-Copyright (C) 1985-1988, 1993-2012 Free Software Foundation, Inc.
+Copyright (C) 1985-1988, 1993-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -379,12 +379,26 @@ Given a Unix syntax file name, returns a string ending in slash. */)
strcat (res, "/");
beg = res;
p = beg + strlen (beg);
+ dostounix_filename (beg);
+ tem_fn = make_specified_string (beg, -1, p - beg,
+ STRING_MULTIBYTE (filename));
}
+ else
+ tem_fn = make_specified_string (beg - 2, -1, p - beg + 2,
+ STRING_MULTIBYTE (filename));
+ }
+ else if (STRING_MULTIBYTE (filename))
+ {
+ tem_fn = ENCODE_FILE (make_specified_string (beg, -1, p - beg, 1));
+ dostounix_filename (SSDATA (tem_fn));
+ tem_fn = DECODE_FILE (tem_fn);
+ }
+ else
+ {
+ dostounix_filename (beg);
+ tem_fn = make_specified_string (beg, -1, p - beg, 0);
}
- tem_fn = ENCODE_FILE (make_specified_string (beg, -1, p - beg,
- STRING_MULTIBYTE (filename)));
- dostounix_filename (SSDATA (tem_fn));
- return DECODE_FILE (tem_fn);
+ return tem_fn;
#else /* DOS_NT */
return make_specified_string (beg, -1, p - beg, STRING_MULTIBYTE (filename));
#endif /* DOS_NT */
@@ -459,12 +473,14 @@ get a current directory to run processes in. */)
return Ffile_name_directory (filename);
}
-/* Convert from file name SRC of length SRCLEN to directory name
- in DST. On UNIX, just make sure there is a terminating /.
- Return the length of DST in bytes. */
+/* Convert from file name SRC of length SRCLEN to directory name in
+ DST. MULTIBYTE non-zero means the file name in SRC is a multibyte
+ string. On UNIX, just make sure there is a terminating /. Return
+ the length of DST in bytes. */
static ptrdiff_t
-file_name_as_directory (char *dst, const char *src, ptrdiff_t srclen)
+file_name_as_directory (char *dst, const char *src, ptrdiff_t srclen,
+ bool multibyte)
{
if (srclen == 0)
{
@@ -483,14 +499,17 @@ file_name_as_directory (char *dst, const char *src, ptrdiff_t srclen)
srclen++;
}
#ifdef DOS_NT
- {
- Lisp_Object tem_fn = make_specified_string (dst, -1, srclen, 1);
+ if (multibyte)
+ {
+ Lisp_Object tem_fn = make_specified_string (dst, -1, srclen, 1);
- tem_fn = ENCODE_FILE (tem_fn);
- dostounix_filename (SSDATA (tem_fn));
- tem_fn = DECODE_FILE (tem_fn);
- memcpy (dst, SSDATA (tem_fn), (srclen = SBYTES (tem_fn)) + 1);
- }
+ tem_fn = ENCODE_FILE (tem_fn);
+ dostounix_filename (SSDATA (tem_fn));
+ tem_fn = DECODE_FILE (tem_fn);
+ memcpy (dst, SSDATA (tem_fn), (srclen = SBYTES (tem_fn)) + 1);
+ }
+ else
+ dostounix_filename (dst);
#endif
return srclen;
}
@@ -526,16 +545,18 @@ For a Unix-syntax file name, just appends a slash. */)
}
buf = alloca (SBYTES (file) + 10);
- length = file_name_as_directory (buf, SSDATA (file), SBYTES (file));
+ length = file_name_as_directory (buf, SSDATA (file), SBYTES (file),
+ STRING_MULTIBYTE (file));
return make_specified_string (buf, -1, length, STRING_MULTIBYTE (file));
}
-/* Convert from directory name SRC of length SRCLEN to
- file name in DST. On UNIX, just make sure there isn't
- a terminating /. Return the length of DST in bytes. */
+/* Convert from directory name SRC of length SRCLEN to file name in
+ DST. MULTIBYTE non-zero means the file name in SRC is a multibyte
+ string. On UNIX, just make sure there isn't a terminating /.
+ Return the length of DST in bytes. */
static ptrdiff_t
-directory_file_name (char *dst, char *src, ptrdiff_t srclen)
+directory_file_name (char *dst, char *src, ptrdiff_t srclen, bool multibyte)
{
/* Process as Unix format: just remove any final slash.
But leave "/" unchanged; do not change it to "". */
@@ -551,14 +572,17 @@ directory_file_name (char *dst, char *src, ptrdiff_t srclen)
srclen--;
}
#ifdef DOS_NT
- {
- Lisp_Object tem_fn = make_specified_string (dst, -1, srclen, 1);
+ if (multibyte)
+ {
+ Lisp_Object tem_fn = make_specified_string (dst, -1, srclen, 1);
- tem_fn = ENCODE_FILE (tem_fn);
- dostounix_filename (SSDATA (tem_fn));
- tem_fn = DECODE_FILE (tem_fn);
- memcpy (dst, SSDATA (tem_fn), (srclen = SBYTES (tem_fn)) + 1);
- }
+ tem_fn = ENCODE_FILE (tem_fn);
+ dostounix_filename (SSDATA (tem_fn));
+ tem_fn = DECODE_FILE (tem_fn);
+ memcpy (dst, SSDATA (tem_fn), (srclen = SBYTES (tem_fn)) + 1);
+ }
+ else
+ dostounix_filename (dst);
#endif
return srclen;
}
@@ -594,7 +618,8 @@ In Unix-syntax, this function just removes the final slash. */)
}
buf = alloca (SBYTES (directory) + 20);
- length = directory_file_name (buf, SSDATA (directory), SBYTES (directory));
+ length = directory_file_name (buf, SSDATA (directory), SBYTES (directory),
+ STRING_MULTIBYTE (directory));
return make_specified_string (buf, -1, length, STRING_MULTIBYTE (directory));
}
@@ -1044,7 +1069,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
/* `egetenv' may return a unibyte string, which will bite us since
we expect the directory to be multibyte. */
tem = build_string (newdir);
- if (!STRING_MULTIBYTE (tem))
+ if (multibyte && !STRING_MULTIBYTE (tem))
{
hdir = DECODE_FILE (tem);
newdir = SSDATA (hdir);
@@ -1066,7 +1091,18 @@ filesystem tree, not (expand-file-name ".." dirname). */)
unblock_input ();
if (pw)
{
+ Lisp_Object tem;
+
newdir = pw->pw_dir;
+ /* `getpwnam' may return a unibyte string, which will
+ bite us since we expect the directory to be
+ multibyte. */
+ tem = build_string (newdir);
+ if (multibyte && !STRING_MULTIBYTE (tem))
+ {
+ hdir = DECODE_FILE (tem);
+ newdir = SSDATA (hdir);
+ }
nm = p;
#ifdef DOS_NT
collapse_newdir = 0;
@@ -1090,6 +1126,13 @@ filesystem tree, not (expand-file-name ".." dirname). */)
adir = alloca (MAXPATHLEN + 1);
if (!getdefdir (c_toupper (drive) - 'A' + 1, adir))
adir = NULL;
+ else if (multibyte)
+ {
+ Lisp_Object tem = build_string (adir);
+
+ tem = DECODE_FILE (tem);
+ memcpy (adir, SSDATA (tem), SBYTES (tem) + 1);
+ }
}
if (!adir)
{
@@ -1148,6 +1191,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
indirectly by prepending newdir to nm if necessary, and using
cwd (or the wd of newdir's drive) as the new newdir. */
char *adir;
+
if (IS_DRIVE (newdir[0]) && IS_DEVICE_SEP (newdir[1]))
{
drive = (unsigned char) newdir[0];
@@ -1157,7 +1201,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
{
ptrdiff_t newlen = strlen (newdir);
char *tmp = alloca (newlen + strlen (nm) + 2);
- file_name_as_directory (tmp, newdir, newlen);
+ file_name_as_directory (tmp, newdir, newlen, multibyte);
strcat (tmp, nm);
nm = tmp;
}
@@ -1165,10 +1209,17 @@ filesystem tree, not (expand-file-name ".." dirname). */)
if (drive)
{
if (!getdefdir (c_toupper (drive) - 'A' + 1, adir))
- newdir = "/";
+ strcpy (adir, "/");
}
else
getcwd (adir, MAXPATHLEN + 1);
+ if (multibyte)
+ {
+ Lisp_Object tem = build_string (adir);
+
+ tem = DECODE_FILE (tem);
+ memcpy (adir, SSDATA (tem), SBYTES (tem) + 1);
+ }
newdir = adir;
}
@@ -1255,7 +1306,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
strcpy (target, newdir);
}
else
- file_name_as_directory (target, newdir, length);
+ file_name_as_directory (target, newdir, length, multibyte);
}
strcat (target, nm);
@@ -1341,9 +1392,14 @@ filesystem tree, not (expand-file-name ".." dirname). */)
target[1] = ':';
}
result = make_specified_string (target, -1, o - target, multibyte);
- result = ENCODE_FILE (result);
- dostounix_filename (SSDATA (result));
- result = DECODE_FILE (result);
+ if (multibyte)
+ {
+ result = ENCODE_FILE (result);
+ dostounix_filename (SSDATA (result));
+ result = DECODE_FILE (result);
+ }
+ else
+ dostounix_filename (SSDATA (result));
#else /* !DOS_NT */
result = make_specified_string (target, -1, o - target, multibyte);
#endif /* !DOS_NT */
@@ -1625,18 +1681,24 @@ those `/' is discarded. */)
memcpy (nm, SDATA (filename), SBYTES (filename) + 1);
#ifdef DOS_NT
- {
- Lisp_Object encoded_filename = ENCODE_FILE (filename);
- Lisp_Object tem_fn;
-
- dostounix_filename (SDATA (encoded_filename));
- tem_fn = DECODE_FILE (encoded_filename);
- nm = alloca (SBYTES (tem_fn) + 1);
- memcpy (nm, SDATA (tem_fn), SBYTES (tem_fn) + 1);
- substituted = (memcmp (nm, SDATA (filename), SBYTES (filename)) != 0);
- if (substituted)
- filename = tem_fn;
- }
+ if (multibyte)
+ {
+ Lisp_Object encoded_filename = ENCODE_FILE (filename);
+ Lisp_Object tem_fn;
+
+ dostounix_filename (SDATA (encoded_filename));
+ tem_fn = DECODE_FILE (encoded_filename);
+ nm = alloca (SBYTES (tem_fn) + 1);
+ memcpy (nm, SDATA (tem_fn), SBYTES (tem_fn) + 1);
+ substituted = (memcmp (nm, SDATA (filename), SBYTES (filename)) != 0);
+ if (substituted)
+ filename = tem_fn;
+ }
+ else
+ {
+ dostounix_filename (nm);
+ substituted = (memcmp (nm, SDATA (filename), SBYTES (filename)) != 0);
+ }
#endif
endp = nm + SBYTES (filename);
@@ -1956,10 +2018,26 @@ entries (depending on how Emacs was built). */)
out_st.st_mode = 0;
#ifdef WINDOWSNT
+ if (!NILP (preserve_extended_attributes))
+ {
+#ifdef HAVE_POSIX_ACL
+ acl = acl_get_file (SDATA (encoded_file), ACL_TYPE_ACCESS);
+ if (acl == NULL && errno != ENOTSUP)
+ report_file_error ("Getting ACL", Fcons (file, Qnil));
+#endif
+ }
if (!CopyFile (SDATA (encoded_file),
SDATA (encoded_newname),
FALSE))
- report_file_error ("Copying file", Fcons (file, Fcons (newname, Qnil)));
+ {
+ /* CopyFile doesn't set errno when it fails. By far the most
+ "popular" reason is that the target is read-only. */
+ if (GetLastError () == 5)
+ errno = EACCES;
+ else
+ errno = EPERM;
+ report_file_error ("Copying file", Fcons (file, Fcons (newname, Qnil)));
+ }
/* CopyFile retains the timestamp by default. */
else if (NILP (keep_time))
{
@@ -1983,6 +2061,17 @@ entries (depending on how Emacs was built). */)
/* Restore original attributes. */
SetFileAttributes (filename, attributes);
}
+#ifdef HAVE_POSIX_ACL
+ if (acl != NULL)
+ {
+ bool fail =
+ acl_set_file (SDATA (encoded_newname), ACL_TYPE_ACCESS, acl) != 0;
+ if (fail && errno != ENOTSUP)
+ report_file_error ("Setting ACL", Fcons (newname, Qnil));
+
+ acl_free (acl);
+ }
+#endif
#else /* not WINDOWSNT */
immediate_quit = 1;
ifd = emacs_open (SSDATA (encoded_file), O_RDONLY, 0);
@@ -2915,8 +3004,10 @@ DEFUN ("set-file-selinux-context", Fset_file_selinux_context,
CONTEXT should be a list (USER ROLE TYPE RANGE), where the list
elements are strings naming the components of a SELinux context.
-This function does nothing if SELinux is disabled, or if Emacs was not
-compiled with SELinux support. */)
+Value is t if setting of SELinux context was successful, nil otherwise.
+
+This function does nothing and returns nil if SELinux is disabled,
+or if Emacs was not compiled with SELinux support. */)
(Lisp_Object filename, Lisp_Object context)
{
Lisp_Object absname;
@@ -2982,6 +3073,7 @@ compiled with SELinux support. */)
context_free (parsed_con);
freecon (con);
+ return fail ? Qnil : Qt;
}
else
report_file_error ("Doing lgetfilecon", Fcons (absname, Qnil));
@@ -2992,11 +3084,11 @@ compiled with SELinux support. */)
}
DEFUN ("file-acl", Ffile_acl, Sfile_acl, 1, 1, 0,
- doc: /* Return ACL entries of file named FILENAME, as a string.
+ doc: /* Return ACL entries of file named FILENAME.
+The entries are returned in a format suitable for use in `set-file-acl'
+but is otherwise undocumented and subject to change.
Return nil if file does not exist or is not accessible, or if Emacs
-was unable to determine the ACL entries. The latter can happen for
-local files if Emacs was not compiled with ACL support, or for remote
-files if the file handler returns nil for the file's ACL entries. */)
+was unable to determine the ACL entries. */)
(Lisp_Object filename)
{
Lisp_Object absname;
@@ -3046,6 +3138,8 @@ DEFUN ("set-file-acl", Fset_file_acl, Sset_file_acl,
ACL-STRING should contain the textual representation of the ACL
entries in a format suitable for the platform.
+Value is t if setting of ACL was successful, nil otherwise.
+
Setting ACL for local files requires Emacs to be built with ACL
support. */)
(Lisp_Object filename, Lisp_Object acl_string)
@@ -3085,6 +3179,7 @@ support. */)
report_file_error ("Setting ACL", Fcons (absname, Qnil));
acl_free (acl);
+ return fail ? Qnil : Qt;
}
#endif
@@ -3398,7 +3493,10 @@ the number of characters that replace previous buffer contents.
This function does code conversion according to the value of
`coding-system-for-read' or `file-coding-system-alist', and sets the
-variable `last-coding-system-used' to the coding system actually used. */)
+variable `last-coding-system-used' to the coding system actually used.
+
+In addition, this function decodes the inserted text from known formats
+by calling `format-decode', which see. */)
(Lisp_Object filename, Lisp_Object visit, Lisp_Object beg, Lisp_Object end, Lisp_Object replace)
{
struct stat st;
@@ -4112,7 +4210,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
prepare_to_modify_buffer (GPT, GPT, NULL);
}
- move_gap (PT);
+ move_gap_both (PT, PT_BYTE);
if (GAP_SIZE < total)
make_gap (total - GAP_SIZE);
diff --git a/src/filelock.c b/src/filelock.c
index 17f3f253249..f21240f8340 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -1,6 +1,6 @@
/* Lock files for editing.
- Copyright (C) 1985-1987, 1993-1994, 1996, 1998-2012
- Free Software Foundation, Inc.
+ Copyright (C) 1985-1987, 1993-1994, 1996, 1998-2013 Free Software
+ Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/firstfile.c b/src/firstfile.c
index 444fb71b55d..80c936719d6 100644
--- a/src/firstfile.c
+++ b/src/firstfile.c
@@ -1,5 +1,5 @@
/* Mark beginning of data space to dump as pure, for GNU Emacs.
- Copyright (C) 1997, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/floatfns.c b/src/floatfns.c
index 645a5957609..43576a16248 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -1,7 +1,7 @@
/* Primitive operations on floating point for GNU Emacs Lisp interpreter.
-Copyright (C) 1988, 1993-1994, 1999, 2001-2012
- Free Software Foundation, Inc.
+Copyright (C) 1988, 1993-1994, 1999, 2001-2013 Free Software Foundation,
+Inc.
Author: Wolfgang Rupprecht
(according to ack.texi)
@@ -399,8 +399,8 @@ round2 (EMACS_INT i1, EMACS_INT i2)
odd. */
EMACS_INT q = i1 / i2;
EMACS_INT r = i1 % i2;
- EMACS_INT abs_r = r < 0 ? -r : r;
- EMACS_INT abs_r1 = (i2 < 0 ? -i2 : i2) - abs_r;
+ EMACS_INT abs_r = eabs (r);
+ EMACS_INT abs_r1 = eabs (i2) - abs_r;
return q + (abs_r + (q & 1) <= abs_r1 ? 0 : (i2 ^ r) < 0 ? -1 : 1);
}
diff --git a/src/fns.c b/src/fns.c
index 7c2222e9805..687c3f6ff39 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1,6 +1,6 @@
/* Random utility Lisp functions.
- Copyright (C) 1985-1987, 1993-1995, 1997-2012
- Free Software Foundation, Inc.
+
+Copyright (C) 1985-1987, 1993-1995, 1997-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -86,7 +86,7 @@ Other values of LIMIT are ignored. */)
before it's time to do a QUIT. This must be a power of 2. */
enum { QUIT_COUNT_HEURISTIC = 1 << 16 };
-/* Random data-structure functions */
+/* Random data-structure functions. */
DEFUN ("length", Flength, Slength, 1, 1, 0,
doc: /* Return the length of vector, list or string SEQUENCE.
@@ -211,12 +211,18 @@ Symbols are also allowed; their print names are used instead. */)
DEFUN ("compare-strings", Fcompare_strings, Scompare_strings, 6, 7, 0,
doc: /* Compare the contents of two strings, converting to multibyte if needed.
-In string STR1, skip the first START1 characters and stop at END1.
-In string STR2, skip the first START2 characters and stop at END2.
-END1 and END2 default to the full lengths of the respective strings.
-
-Case is significant in this comparison if IGNORE-CASE is nil.
-Unibyte strings are converted to multibyte for comparison.
+The arguments START1, END1, START2, and END2, if non-nil, are
+positions specifying which parts of STR1 or STR2 to compare. In
+string STR1, compare the part between START1 (inclusive) and END1
+\(exclusive). If START1 is nil, it defaults to 0, the beginning of
+the string; if END1 is nil, it defaults to the length of the string.
+Likewise, in string STR2, compare the part between START2 and END2.
+
+The strings are compared by the numeric values of their characters.
+For instance, STR1 is "less than" STR2 if its first differing
+character has a smaller numeric value. If IGNORE-CASE is non-nil,
+characters are converted to lower-case before comparing them. Unibyte
+strings are converted to multibyte for comparison.
The value is t if the strings (or specified portions) match.
If string STR1 is less, the value is a negative number N;
diff --git a/src/font.c b/src/font.c
index f6b6fa026c0..a3a41006f9b 100644
--- a/src/font.c
+++ b/src/font.c
@@ -1,6 +1,6 @@
/* font.c -- "Font" primitives.
-Copyright (C) 2006-2012 Free Software Foundation, Inc.
+Copyright (C) 2006-2013 Free Software Foundation, Inc.
Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H13PRO009
@@ -2101,9 +2101,7 @@ font_score (Lisp_Object entity, Lisp_Object *spec_prop)
{
EMACS_INT diff = ((XINT (AREF (entity, i)) >> 8)
- (XINT (spec_prop[i]) >> 8));
- if (diff < 0)
- diff = - diff;
- score |= min (diff, 127) << sort_shift_bits[i];
+ score |= min (eabs (diff), 127) << sort_shift_bits[i];
}
/* Score the size. Maximum difference is 127. */
@@ -2118,10 +2116,7 @@ font_score (Lisp_Object entity, Lisp_Object *spec_prop)
if (CONSP (Vface_font_rescale_alist))
pixel_size *= font_rescale_ratio (entity);
- diff = pixel_size - XINT (AREF (entity, FONT_SIZE_INDEX));
- if (diff < 0)
- diff = - diff;
- diff <<= 1;
+ diff = eabs (pixel_size - XINT (AREF (entity, FONT_SIZE_INDEX))) << 1;
if (! NILP (spec_prop[FONT_DPI_INDEX])
&& ! EQ (spec_prop[FONT_DPI_INDEX], AREF (entity, FONT_DPI_INDEX)))
diff |= 1;
@@ -2671,9 +2666,7 @@ font_delete_unmatched (Lisp_Object vec, Lisp_Object spec, int size)
{
int diff = XINT (AREF (entity, FONT_SIZE_INDEX)) - size;
- if (diff != 0
- && (diff < 0 ? -diff > FONT_PIXEL_SIZE_QUANTUM
- : diff > FONT_PIXEL_SIZE_QUANTUM))
+ if (eabs (diff) > FONT_PIXEL_SIZE_QUANTUM)
prop = FONT_SPEC_MAX;
}
if (prop < FONT_SPEC_MAX
diff --git a/src/font.h b/src/font.h
index 3035a909efc..b565fb4b01b 100644
--- a/src/font.h
+++ b/src/font.h
@@ -1,5 +1,5 @@
/* font.h -- Interface definition for font handling.
- Copyright (C) 2006-2012 Free Software Foundation, Inc.
+ Copyright (C) 2006-2013 Free Software Foundation, Inc.
Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H13PRO009
diff --git a/src/fontset.c b/src/fontset.c
index 660ca432fad..b7f3e46d69c 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1,6 +1,6 @@
/* Fontset handler.
-Copyright (C) 2001-2012 Free Software Foundation, Inc.
+Copyright (C) 2001-2013 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007, 2008, 2009, 2010, 2011
National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/src/fontset.h b/src/fontset.h
index 3eb8d633b6c..07ee5d65c25 100644
--- a/src/fontset.h
+++ b/src/fontset.h
@@ -1,5 +1,5 @@
/* Header for fontset handler.
- Copyright (C) 1998, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001-2013 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007, 2008, 2009, 2010, 2011
National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/src/frame.c b/src/frame.c
index 5cefad6ca46..514b338df5b 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1,6 +1,6 @@
/* Generic frame functions.
-Copyright (C) 1993-1995, 1997, 1999-2012 Free Software Foundation, Inc.
+Copyright (C) 1993-1995, 1997, 1999-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -60,7 +60,7 @@ Lisp_Object Qns_parse_geometry;
Lisp_Object Qframep, Qframe_live_p;
Lisp_Object Qicon, Qmodeline;
Lisp_Object Qonly, Qnone;
-Lisp_Object Qx, Qw32, Qmac, Qpc, Qns;
+Lisp_Object Qx, Qw32, Qpc, Qns;
Lisp_Object Qvisible;
Lisp_Object Qdisplay_type;
static Lisp_Object Qbackground_mode;
@@ -225,8 +225,6 @@ See also `frame-live-p'. */)
return Qw32;
case output_msdos_raw:
return Qpc;
- case output_mac:
- return Qmac;
case output_ns:
return Qns;
default:
diff --git a/src/frame.h b/src/frame.h
index 589b45fc0ff..ec535d4448f 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1,5 +1,5 @@
/* Define frame-object for GNU Emacs.
- Copyright (C) 1993-1994, 1999-2012 Free Software Foundation, Inc.
+ Copyright (C) 1993-1994, 1999-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -46,7 +46,6 @@ enum output_method
output_x_window,
output_msdos_raw,
output_w32,
- output_mac,
output_ns
};
@@ -1178,7 +1177,7 @@ extern Lisp_Object Qalpha;
extern Lisp_Object Qleft_fringe, Qright_fringe;
extern Lisp_Object Qheight, Qwidth;
extern Lisp_Object Qminibuffer, Qmodeline;
-extern Lisp_Object Qx, Qw32, Qmac, Qpc, Qns;
+extern Lisp_Object Qx, Qw32, Qpc, Qns;
extern Lisp_Object Qvisible;
extern Lisp_Object Qdisplay_type;
diff --git a/src/fringe.c b/src/fringe.c
index ce31fd01763..fa6f889ba69 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -1,5 +1,6 @@
/* Fringe handling (split from xdisp.c).
- Copyright (C) 1985-1988, 1993-1995, 1997-2012 Free Software Foundation, Inc.
+ Copyright (C) 1985-1988, 1993-1995, 1997-2013 Free Software
+ Foundation, Inc.
This file is part of GNU Emacs.
@@ -1360,8 +1361,8 @@ compute_fringe_widths (struct frame *f, int redraw)
if (left_fringe_width || right_fringe_width)
{
- int left_wid = left_fringe_width >= 0 ? left_fringe_width : -left_fringe_width;
- int right_wid = right_fringe_width >= 0 ? right_fringe_width : -right_fringe_width;
+ int left_wid = eabs (left_fringe_width);
+ int right_wid = eabs (right_fringe_width);
int conf_wid = left_wid + right_wid;
int font_wid = FRAME_COLUMN_WIDTH (f);
int cols = (left_wid + right_wid + font_wid-1) / font_wid;
diff --git a/src/ftfont.c b/src/ftfont.c
index f07ad6f33c7..1ada95d377c 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -1,5 +1,5 @@
/* ftfont.c -- FreeType font driver.
- Copyright (C) 2006-2012 Free Software Foundation, Inc.
+ Copyright (C) 2006-2013 Free Software Foundation, Inc.
Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H13PRO009
diff --git a/src/ftxfont.c b/src/ftxfont.c
index 5effe6e9104..8c56ee05adc 100644
--- a/src/ftxfont.c
+++ b/src/ftxfont.c
@@ -1,5 +1,5 @@
/* ftxfont.c -- FreeType font driver on X (without using XFT).
- Copyright (C) 2006-2012 Free Software Foundation, Inc.
+ Copyright (C) 2006-2013 Free Software Foundation, Inc.
Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H13PRO009
diff --git a/src/getpagesize.h b/src/getpagesize.h
index 545082b2e78..6d0932abf1b 100644
--- a/src/getpagesize.h
+++ b/src/getpagesize.h
@@ -1,5 +1,6 @@
/* Emulate getpagesize on systems that lack it.
- Copyright (C) 1986, 1992, 1995, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1986, 1992, 1995, 2001-2013 Free Software Foundation,
+ Inc.
This file is part of GNU Emacs.
diff --git a/src/gmalloc.c b/src/gmalloc.c
index c325ca79910..bc1d85ac5fb 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -1,6 +1,6 @@
/* Declarations for `malloc' and friends.
- Copyright (C) 1990, 1991, 1992, 1993, 1995, 1996, 1999, 2002, 2003, 2004,
- 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1990-1993, 1995-1996, 1999, 2002-2007, 2013 Free
+ Software Foundation, Inc.
Written May 1989 by Mike Haertel.
This library is free software; you can redistribute it and/or
@@ -14,9 +14,7 @@ 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 library; see the file COPYING. If
-not, write to the Free Software Foundation, Inc., 51 Franklin Street,
-Fifth Floor, Boston, MA 02110-1301, USA.
+License along with this library. If not, see <http://www.gnu.org/licenses/>.
The author may be reached (Email) at the address mike@ai.mit.edu,
or (US mail) as Mike Haertel c/o Free Software Foundation. */
@@ -292,9 +290,7 @@ 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 library; see the file COPYING. If
-not, write to the Free Software Foundation, Inc., 51 Franklin Street,
-Fifth Floor, Boston, MA 02110-1301, USA.
+License along with this library. If not, see <http://www.gnu.org/licenses/>.
The author may be reached (Email) at the address mike@ai.mit.edu,
or (US mail) as Mike Haertel c/o Free Software Foundation. */
@@ -972,9 +968,7 @@ 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 library; see the file COPYING. If
-not, write to the Free Software Foundation, Inc., 51 Franklin Street,
-Fifth Floor, Boston, MA 02110-1301, USA.
+License along with this library. If not, see <http://www.gnu.org/licenses/>.
The author may be reached (Email) at the address mike@ai.mit.edu,
or (US mail) as Mike Haertel c/o Free Software Foundation. */
@@ -1286,9 +1280,7 @@ 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 library; see the file COPYING. If
-not, write to the Free Software Foundation, Inc., 51 Franklin Street,
-Fifth Floor, Boston, MA 02110-1301, USA.
+License along with this library. If not, see <http://www.gnu.org/licenses/>.
The author may be reached (Email) at the address mike@ai.mit.edu,
or (US mail) as Mike Haertel c/o Free Software Foundation. */
@@ -1487,9 +1479,7 @@ 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 library; see the file COPYING. If
-not, write to the Free Software Foundation, Inc., 51 Franklin Street,
-Fifth Floor, Boston, MA 02110-1301, USA.
+License along with this library. If not, see <http://www.gnu.org/licenses/>.
The author may be reached (Email) at the address mike@ai.mit.edu,
or (US mail) as Mike Haertel c/o Free Software Foundation. */
@@ -1520,9 +1510,7 @@ 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 the GNU C Library; see the file COPYING. If not, write to
-the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
-MA 02110-1301, USA. */
+along with the GNU C Library. If not, see <http://www.gnu.org/licenses/>. */
/* uClibc defines __GNU_LIBRARY__, but it is not completely
compatible. */
@@ -1566,9 +1554,7 @@ 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 library; see the file COPYING. If
-not, write to the Free Software Foundation, Inc., 51 Franklin Street,
-Fifth Floor, Boston, MA 02110-1301, USA. */
+License along with this library. If not, see <http://www.gnu.org/licenses/>. */
void *(*__memalign_hook) (size_t size, size_t alignment);
@@ -1678,9 +1664,7 @@ 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 library; see the file COPYING. If
-not, write to the Free Software Foundation, Inc., 51 Franklin Street,
-Fifth Floor, Boston, MA 02110-1301, USA.
+License along with this library. If not, see <http://www.gnu.org/licenses/>.
The author may be reached (Email) at the address mike@ai.mit.edu,
or (US mail) as Mike Haertel c/o Free Software Foundation. */
@@ -1722,9 +1706,7 @@ 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 library; see the file COPYING. If
-not, write to the Free Software Foundation, Inc., 51 Franklin Street,
-Fifth Floor, Boston, MA 02110-1301, USA.
+License along with this library. If not, see <http://www.gnu.org/licenses/>.
The author may be reached (Email) at the address mike@ai.mit.edu,
or (US mail) as Mike Haertel c/o Free Software Foundation. */
diff --git a/src/gnutls.c b/src/gnutls.c
index 03f753fa8cc..db0a6dac01c 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -1,5 +1,5 @@
/* GnuTLS glue for GNU Emacs.
- Copyright (C) 2010-2012 Free Software Foundation, Inc.
+ Copyright (C) 2010-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/gnutls.h b/src/gnutls.h
index 2b13908a748..f1a337e7b3e 100644
--- a/src/gnutls.h
+++ b/src/gnutls.h
@@ -1,5 +1,5 @@
/* GnuTLS glue for GNU Emacs.
- Copyright (C) 2010-2012 Free Software Foundation, Inc.
+ Copyright (C) 2010-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 9f2b652525f..95ac04b8ff0 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -1,6 +1,6 @@
/* Functions for creating and updating GTK widgets.
-Copyright (C) 2003-2012 Free Software Foundation, Inc.
+Copyright (C) 2003-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -2416,6 +2416,8 @@ make_menu_item (const char *utf8_label,
return w;
}
+#ifdef HAVE_GTK_TEAROFF_MENU_ITEM_NEW
+
static int xg_detached_menus;
/* Return true if there are detached menus. */
@@ -2454,7 +2456,13 @@ tearoff_activate (GtkWidget *widget, gpointer client_data)
G_CALLBACK (tearoff_remove), 0);
}
}
-
+#else /* ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW */
+bool
+xg_have_tear_offs (void)
+{
+ return false;
+}
+#endif /* ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW */
/* Create a menu item widget, and connect the callbacks.
ITEM describes the menu item.
@@ -2526,7 +2534,8 @@ xg_create_one_menuitem (widget_value *item,
HIGHLIGHT_CB is the callback to call when entering/leaving menu items.
If POP_UP_P, create a popup menu.
If MENU_BAR_P, create a menu bar.
- If ADD_TEAROFF_P, add a tearoff menu item. Ignored if MENU_BAR_P.
+ If ADD_TEAROFF_P, add a tearoff menu item. Ignored if MENU_BAR_P or
+ the Gtk+ version used does not have tearoffs.
TOPMENU is the topmost GtkWidget that others shall be placed under.
It may be NULL, in that case we create the appropriate widget
(menu bar or menu item depending on POP_UP_P and MENU_BAR_P)
@@ -2599,6 +2608,7 @@ create_menus (widget_value *data,
"selection-done", deactivate_cb, 0);
}
+#ifdef HAVE_GTK_TEAROFF_MENU_ITEM_NEW
if (! menu_bar_p && add_tearoff_p)
{
GtkWidget *tearoff = gtk_tearoff_menu_item_new ();
@@ -2607,6 +2617,7 @@ create_menus (widget_value *data,
g_signal_connect (G_OBJECT (tearoff), "activate",
G_CALLBACK (tearoff_activate), 0);
}
+#endif
for (item = data; item; item = item->next)
{
@@ -2897,11 +2908,13 @@ xg_update_menubar (GtkWidget *menubar,
gtk_label_set_text (wlabel, utf8_label);
+#ifdef HAVE_GTK_TEAROFF_MENU_ITEM_NEW
/* If this item has a submenu that has been detached, change
the title in the WM decorations also. */
if (submenu && gtk_menu_get_tearoff_state (GTK_MENU (submenu)))
/* Set the title of the detached window. */
gtk_menu_set_title (GTK_MENU (submenu), utf8_label);
+#endif
if (utf8_label) g_free (utf8_label);
iter = g_list_next (iter);
@@ -3129,7 +3142,8 @@ xg_update_submenu (GtkWidget *submenu,
{
GtkWidget *w = GTK_WIDGET (iter->data);
- /* Skip tearoff items, they have no counterpart in val. */
+#ifdef HAVE_GTK_TEAROFF_MENU_ITEM_NEW
+ /* Skip tearoff items, they have no counterpart in val. */
if (GTK_IS_TEAROFF_MENU_ITEM (w))
{
has_tearoff_p = 1;
@@ -3137,6 +3151,7 @@ xg_update_submenu (GtkWidget *submenu,
if (iter) w = GTK_WIDGET (iter->data);
else break;
}
+#endif
/* Remember first radio button in a group. If we get a mismatch in
a radio group we must rebuild the whole group so that the connections
@@ -4138,7 +4153,7 @@ xg_tool_bar_detach_callback (GtkHandleBox *wbox,
if (f)
{
GtkRequisition req, req2;
- FRAME_X_OUTPUT (f)->toolbar_detached = 1;
+
gtk_widget_get_preferred_size (GTK_WIDGET (wbox), NULL, &req);
gtk_widget_get_preferred_size (w, NULL, &req2);
req.width -= req2.width;
@@ -4173,7 +4188,7 @@ xg_tool_bar_attach_callback (GtkHandleBox *wbox,
if (f)
{
GtkRequisition req, req2;
- FRAME_X_OUTPUT (f)->toolbar_detached = 0;
+
gtk_widget_get_preferred_size (GTK_WIDGET (wbox), NULL, &req);
gtk_widget_get_preferred_size (w, NULL, &req2);
req.width += req2.width;
@@ -4269,6 +4284,12 @@ xg_tool_bar_item_expose_callback (GtkWidget *w,
gtk_toolbar_set_orientation (GTK_TOOLBAR (w), o)
#endif
+#ifdef HAVE_GTK_HANDLE_BOX_NEW
+#define TOOLBAR_TOP_WIDGET(x) ((x)->handlebox_widget)
+#else
+#define TOOLBAR_TOP_WIDGET(x) ((x)->toolbar_widget)
+#endif
+
/* Attach a tool bar to frame F. */
static void
@@ -4276,14 +4297,16 @@ xg_pack_tool_bar (FRAME_PTR f, Lisp_Object pos)
{
struct x_output *x = f->output_data.x;
bool into_hbox = EQ (pos, Qleft) || EQ (pos, Qright);
+ GtkWidget *top_widget = TOOLBAR_TOP_WIDGET (x);
toolbar_set_orientation (x->toolbar_widget,
into_hbox
? GTK_ORIENTATION_VERTICAL
: GTK_ORIENTATION_HORIZONTAL);
+#ifdef HAVE_GTK_HANDLE_BOX_NEW
if (!x->handlebox_widget)
{
- x->handlebox_widget = gtk_handle_box_new ();
+ top_widget = x->handlebox_widget = gtk_handle_box_new ();
g_signal_connect (G_OBJECT (x->handlebox_widget), "child-detached",
G_CALLBACK (xg_tool_bar_detach_callback), f);
g_signal_connect (G_OBJECT (x->handlebox_widget), "child-attached",
@@ -4291,34 +4314,40 @@ xg_pack_tool_bar (FRAME_PTR f, Lisp_Object pos)
gtk_container_add (GTK_CONTAINER (x->handlebox_widget),
x->toolbar_widget);
}
+#endif
if (into_hbox)
{
+#ifdef HAVE_GTK_HANDLE_BOX_NEW
gtk_handle_box_set_handle_position (GTK_HANDLE_BOX (x->handlebox_widget),
GTK_POS_TOP);
- gtk_box_pack_start (GTK_BOX (x->hbox_widget), x->handlebox_widget,
+#endif
+ gtk_box_pack_start (GTK_BOX (x->hbox_widget), top_widget,
FALSE, FALSE, 0);
if (EQ (pos, Qleft))
gtk_box_reorder_child (GTK_BOX (x->hbox_widget),
- x->handlebox_widget,
+ top_widget,
0);
- x->toolbar_in_hbox = 1;
+ x->toolbar_in_hbox = true;
}
else
{
bool vbox_pos = x->menubar_widget != 0;
+#ifdef HAVE_GTK_HANDLE_BOX_NEW
gtk_handle_box_set_handle_position (GTK_HANDLE_BOX (x->handlebox_widget),
GTK_POS_LEFT);
- gtk_box_pack_start (GTK_BOX (x->vbox_widget), x->handlebox_widget,
+#endif
+ gtk_box_pack_start (GTK_BOX (x->vbox_widget), top_widget,
FALSE, FALSE, 0);
if (EQ (pos, Qtop))
gtk_box_reorder_child (GTK_BOX (x->vbox_widget),
- x->handlebox_widget,
+ top_widget,
vbox_pos);
- x->toolbar_in_hbox = 0;
+ x->toolbar_in_hbox = false;
}
+ x->toolbar_is_packed = true;
}
/* Create a tool bar for frame F. */
@@ -4347,7 +4376,6 @@ xg_create_tool_bar (FRAME_PTR f)
}
x->toolbar_widget = gtk_toolbar_new ();
- x->toolbar_detached = 0;
gtk_widget_set_name (x->toolbar_widget, "emacs-toolbar");
@@ -4562,13 +4590,14 @@ xg_update_tool_bar_sizes (FRAME_PTR f)
struct x_output *x = f->output_data.x;
GtkRequisition req;
int nl = 0, nr = 0, nt = 0, nb = 0;
+ GtkWidget *top_widget = TOOLBAR_TOP_WIDGET (x);
- gtk_widget_get_preferred_size (GTK_WIDGET (x->handlebox_widget), NULL, &req);
+ gtk_widget_get_preferred_size (GTK_WIDGET (top_widget), NULL, &req);
if (x->toolbar_in_hbox)
{
int pos;
gtk_container_child_get (GTK_CONTAINER (x->hbox_widget),
- x->handlebox_widget,
+ top_widget,
"position", &pos, NULL);
if (pos == 0) nl = req.width;
else nr = req.width;
@@ -4577,7 +4606,7 @@ xg_update_tool_bar_sizes (FRAME_PTR f)
{
int pos;
gtk_container_child_get (GTK_CONTAINER (x->vbox_widget),
- x->handlebox_widget,
+ top_widget,
"position", &pos, NULL);
if (pos == 0 || (pos == 1 && x->menubar_widget)) nt = req.height;
else nb = req.height;
@@ -4612,7 +4641,6 @@ update_frame_tool_bar (FRAME_PTR f)
GtkToolbar *wtoolbar;
GtkToolItem *ti;
GtkTextDirection dir;
- bool pack_tool_bar = x->handlebox_widget == NULL;
Lisp_Object style;
bool text_image, horiz;
struct xg_frame_tb_info *tbinfo;
@@ -4866,9 +4894,9 @@ update_frame_tool_bar (FRAME_PTR f)
if (f->n_tool_bar_items != 0)
{
- if (pack_tool_bar)
+ if (! x->toolbar_is_packed)
xg_pack_tool_bar (f, f->tool_bar_position);
- gtk_widget_show_all (GTK_WIDGET (x->handlebox_widget));
+ gtk_widget_show_all (TOOLBAR_TOP_WIDGET (x));
if (xg_update_tool_bar_sizes (f))
xg_height_or_width_changed (f);
}
@@ -4887,24 +4915,26 @@ free_frame_tool_bar (FRAME_PTR f)
if (x->toolbar_widget)
{
struct xg_frame_tb_info *tbinfo;
- bool is_packed = x->handlebox_widget != 0;
+ GtkWidget *top_widget = TOOLBAR_TOP_WIDGET (x);
+
block_input ();
/* We may have created the toolbar_widget in xg_create_tool_bar, but
not the x->handlebox_widget which is created in xg_pack_tool_bar. */
- if (is_packed)
+ if (x->toolbar_is_packed)
{
if (x->toolbar_in_hbox)
gtk_container_remove (GTK_CONTAINER (x->hbox_widget),
- x->handlebox_widget);
+ top_widget);
else
gtk_container_remove (GTK_CONTAINER (x->vbox_widget),
- x->handlebox_widget);
+ top_widget);
}
else
gtk_widget_destroy (x->toolbar_widget);
x->toolbar_widget = 0;
- x->handlebox_widget = 0;
+ TOOLBAR_TOP_WIDGET (x) = 0;
+ x->toolbar_is_packed = false;
FRAME_TOOLBAR_TOP_HEIGHT (f) = FRAME_TOOLBAR_BOTTOM_HEIGHT (f) = 0;
FRAME_TOOLBAR_LEFT_WIDTH (f) = FRAME_TOOLBAR_RIGHT_WIDTH (f) = 0;
@@ -4928,20 +4958,25 @@ void
xg_change_toolbar_position (FRAME_PTR f, Lisp_Object pos)
{
struct x_output *x = f->output_data.x;
+ GtkWidget *top_widget = TOOLBAR_TOP_WIDGET (x);
- if (! x->toolbar_widget || ! x->handlebox_widget)
+ if (! x->toolbar_widget || ! top_widget)
return;
block_input ();
- g_object_ref (x->handlebox_widget);
- if (x->toolbar_in_hbox)
- gtk_container_remove (GTK_CONTAINER (x->hbox_widget),
- x->handlebox_widget);
- else
- gtk_container_remove (GTK_CONTAINER (x->vbox_widget),
- x->handlebox_widget);
+ g_object_ref (top_widget);
+ if (x->toolbar_is_packed)
+ {
+ if (x->toolbar_in_hbox)
+ gtk_container_remove (GTK_CONTAINER (x->hbox_widget),
+ top_widget);
+ else
+ gtk_container_remove (GTK_CONTAINER (x->vbox_widget),
+ top_widget);
+ }
+
xg_pack_tool_bar (f, pos);
- g_object_unref (x->handlebox_widget);
+ g_object_unref (top_widget);
if (xg_update_tool_bar_sizes (f))
xg_height_or_width_changed (f);
@@ -4967,7 +5002,9 @@ xg_initialize (void)
gdpy_def = NULL;
xg_ignore_gtk_scrollbar = 0;
+#ifdef HAVE_GTK_TEAROFF_MENU_ITEM_NEW
xg_detached_menus = 0;
+#endif
xg_menu_cb_list.prev = xg_menu_cb_list.next =
xg_menu_item_cb_list.prev = xg_menu_item_cb_list.next = 0;
diff --git a/src/gtkutil.h b/src/gtkutil.h
index 43f2b237a68..288b3e99299 100644
--- a/src/gtkutil.h
+++ b/src/gtkutil.h
@@ -1,6 +1,6 @@
/* Definitions and headers for GTK widgets.
-Copyright (C) 2003-2012 Free Software Foundation, Inc.
+Copyright (C) 2003-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/image.c b/src/image.c
index 07db6cece1f..726b65d7338 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1,6 +1,6 @@
/* Functions for image support on window system.
-Copyright (C) 1989, 1992-2012 Free Software Foundation, Inc.
+Copyright (C) 1989, 1992-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/indent.c b/src/indent.c
index 3dbf372cf17..4a30c00dd27 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1,6 +1,6 @@
/* Indentation functions.
- Copyright (C) 1985-1988, 1993-1995, 1998, 2000-2012
- Free Software Foundation, Inc.
+ Copyright (C) 1985-1988, 1993-1995, 1998, 2000-2013 Free Software
+ Foundation, Inc.
This file is part of GNU Emacs.
@@ -571,7 +571,8 @@ scan_for_column (ptrdiff_t *endpos, EMACS_INT *goalcol, ptrdiff_t *prevcol)
col += width;
if (endp > scan) /* Avoid infinite loops with 0-width overlays. */
{
- scan = endp; scan_byte = charpos_to_bytepos (scan);
+ scan = endp;
+ scan_byte = CHAR_TO_BYTE (scan);
continue;
}
}
diff --git a/src/indent.h b/src/indent.h
index abcd06036d1..acfd952754e 100644
--- a/src/indent.h
+++ b/src/indent.h
@@ -1,5 +1,5 @@
/* Definitions for interface to indent.c
- Copyright (C) 1985-1986, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1985-1986, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/inotify.c b/src/inotify.c
index 8a52c27985c..4efef9e55b7 100644
--- a/src/inotify.c
+++ b/src/inotify.c
@@ -1,7 +1,6 @@
/* Inotify support for Emacs
-Copyright (C) 2012
- Free Software Foundation, Inc.
+Copyright (C) 2012-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/insdel.c b/src/insdel.c
index 74e938c4b8c..52a017a62a2 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -1,6 +1,6 @@
/* Buffer insertion/deletion and gap motion for GNU Emacs.
- Copyright (C) 1985-1986, 1993-1995, 1997-2012
- Free Software Foundation, Inc.
+ Copyright (C) 1985-1986, 1993-1995, 1997-2013 Free Software
+ Foundation, Inc.
This file is part of GNU Emacs.
@@ -90,7 +90,7 @@ check_markers (void)
void
move_gap (ptrdiff_t charpos)
{
- move_gap_both (charpos, charpos_to_bytepos (charpos));
+ move_gap_both (charpos, CHAR_TO_BYTE (charpos));
}
/* Move gap to byte position BYTEPOS, which is also char position CHARPOS.
diff --git a/src/intervals.c b/src/intervals.c
index 1ed93e1302d..db38c86c00b 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -1,5 +1,6 @@
/* Code for doing intervals.
- Copyright (C) 1993-1995, 1997-1998, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1993-1995, 1997-1998, 2001-2013 Free Software
+ Foundation, Inc.
This file is part of GNU Emacs.
@@ -1624,7 +1625,8 @@ graft_intervals_into_buffer (INTERVAL source, ptrdiff_t position,
XSETBUFFER (buf, buffer);
set_text_properties_1 (make_number (position),
make_number (position + length),
- Qnil, buf, 0);
+ Qnil, buf,
+ find_interval (tree, position));
}
/* Shouldn't be necessary. --Stef */
buffer_balance_intervals (buffer);
diff --git a/src/intervals.h b/src/intervals.h
index 2b30101d0fa..cded8c0abb2 100644
--- a/src/intervals.h
+++ b/src/intervals.h
@@ -1,5 +1,5 @@
/* Definitions and global variables for intervals.
- Copyright (C) 1993-1994, 2000-2012 Free Software Foundation, Inc.
+ Copyright (C) 1993-1994, 2000-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/keyboard.c b/src/keyboard.c
index e2a0e23dd4a..8edd705135f 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1,6 +1,7 @@
/* Keyboard and mouse input; editor command loop.
-Copyright (C) 1985-1989, 1993-1997, 1999-2012 Free Software Foundation, Inc.
+Copyright (C) 1985-1989, 1993-1997, 1999-2013 Free Software Foundation,
+Inc.
This file is part of GNU Emacs.
@@ -6700,37 +6701,35 @@ get_input_pending (int flags)
void
record_asynch_buffer_change (void)
{
- struct input_event event;
- Lisp_Object tem;
- EVENT_INIT (event);
-
- event.kind = BUFFER_SWITCH_EVENT;
- event.frame_or_window = Qnil;
- event.arg = Qnil;
-
/* We don't need a buffer-switch event unless Emacs is waiting for input.
The purpose of the event is to make read_key_sequence look up the
keymaps again. If we aren't in read_key_sequence, we don't need one,
and the event could cause trouble by messing up (input-pending-p).
Note: Fwaiting_for_user_input_p always returns nil when async
subprocesses aren't supported. */
- tem = Fwaiting_for_user_input_p ();
- if (NILP (tem))
- return;
+ if (!NILP (Fwaiting_for_user_input_p ()))
+ {
+ struct input_event event;
+
+ EVENT_INIT (event);
+ event.kind = BUFFER_SWITCH_EVENT;
+ event.frame_or_window = Qnil;
+ event.arg = Qnil;
- /* Make sure no interrupt happens while storing the event. */
+ /* Make sure no interrupt happens while storing the event. */
#ifdef USABLE_SIGIO
- if (interrupt_input)
- kbd_buffer_store_event (&event);
- else
+ if (interrupt_input)
+ kbd_buffer_store_event (&event);
+ else
#endif
- {
- stop_polling ();
- kbd_buffer_store_event (&event);
- start_polling ();
+ {
+ stop_polling ();
+ kbd_buffer_store_event (&event);
+ start_polling ();
+ }
}
}
-
+
/* Read any terminal input already buffered up by the system
into the kbd_buffer, but do not wait.
diff --git a/src/keyboard.h b/src/keyboard.h
index e57c8cc7193..7ffb436754b 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -1,5 +1,6 @@
/* Declarations useful when processing input.
- Copyright (C) 1985-1987, 1993, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1985-1987, 1993, 2001-2013 Free Software Foundation,
+ Inc.
This file is part of GNU Emacs.
diff --git a/src/keymap.c b/src/keymap.c
index fbdd31e0de3..d1ddd55a358 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1,5 +1,6 @@
/* Manipulation of keymaps
- Copyright (C) 1985-1988, 1993-1995, 1998-2012 Free Software Foundation, Inc.
+ Copyright (C) 1985-1988, 1993-1995, 1998-2013 Free Software
+ Foundation, Inc.
This file is part of GNU Emacs.
@@ -2047,7 +2048,7 @@ DEFUN ("key-description", Fkey_description, Skey_description, 1, 2, 0,
Optional arg PREFIX is the sequence of keys leading up to KEYS.
For example, [?\C-x ?l] is converted into the string \"C-x l\".
-The `kbd' macro is an approximate inverse of this. */)
+For an approximate inverse of this, see `kbd'. */)
(Lisp_Object keys, Lisp_Object prefix)
{
ptrdiff_t len = 0;
diff --git a/src/keymap.h b/src/keymap.h
index c704ee0b050..eca0f1b4108 100644
--- a/src/keymap.h
+++ b/src/keymap.h
@@ -1,5 +1,5 @@
/* Functions to manipulate keymaps.
- Copyright (C) 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/lastfile.c b/src/lastfile.c
index f8a64797362..019a6a99763 100644
--- a/src/lastfile.c
+++ b/src/lastfile.c
@@ -1,5 +1,5 @@
/* Mark end of data space to dump as pure, for GNU Emacs.
- Copyright (C) 1985, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1985, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/lisp.h b/src/lisp.h
index 82bf621b62f..e96c9664743 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1,6 +1,7 @@
/* Fundamental definitions for GNU Emacs Lisp interpreter.
-Copyright (C) 1985-1987, 1993-1995, 1997-2012 Free Software Foundation, Inc.
+Copyright (C) 1985-1987, 1993-1995, 1997-2013 Free Software Foundation,
+Inc.
This file is part of GNU Emacs.
@@ -327,6 +328,10 @@ enum Lisp_Fwd_Type
members that are accessible only from C. A Lisp_Misc object is a
wrapper for a C struct that can contain anything you like.
+ Explicit freeing is discouraged for Lisp objects in general. But if
+ you really need to exploit this, use Lisp_Misc (check free_misc in
+ alloc.c to see why). There is no way to free a vectorlike object.
+
To add a new pseudovector type, extend the pvec_type enumeration;
to add a new Lisp_Misc, extend the Lisp_Misc_Type enumeration.
@@ -336,6 +341,10 @@ enum Lisp_Fwd_Type
enumeration and a 1-bit GC markbit) and make sure the overall size
of the union is not increased by your addition.
+ For a new pseudovector, it's highly desirable to limit the size
+ of your data type by VBLOCK_BYTES_MAX bytes (defined in alloc.c).
+ Otherwise you will need to change sweep_vectors (also in alloc.c).
+
Then you will need to add switch branches in print.c (in
print_object, to print your object, and possibly also in
print_preprocess) and to alloc.c, to mark your object (in
@@ -3196,7 +3205,6 @@ extern void keys_of_buffer (void);
extern ptrdiff_t marker_position (Lisp_Object);
extern ptrdiff_t marker_byte_position (Lisp_Object);
extern void clear_charpos_cache (struct buffer *);
-extern ptrdiff_t charpos_to_bytepos (ptrdiff_t);
extern ptrdiff_t buf_charpos_to_bytepos (struct buffer *, ptrdiff_t);
extern ptrdiff_t buf_bytepos_to_charpos (struct buffer *, ptrdiff_t);
extern void unchain_marker (struct Lisp_Marker *marker);
diff --git a/src/lisp.mk b/src/lisp.mk
index 8c2710110e3..174e53ed561 100644
--- a/src/lisp.mk
+++ b/src/lisp.mk
@@ -1,7 +1,7 @@
### lisp.mk --- src/Makefile fragment for GNU Emacs
-## Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2012
-## Free Software Foundation, Inc.
+## Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2013 Free Software
+## Foundation, Inc.
## This file is part of GNU Emacs.
diff --git a/src/lread.c b/src/lread.c
index 2f385797ca0..2b96dc16359 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1,6 +1,7 @@
/* Lisp parsing and input streams.
-Copyright (C) 1985-1989, 1993-1995, 1997-2012 Free Software Foundation, Inc.
+Copyright (C) 1985-1989, 1993-1995, 1997-2013 Free Software Foundation,
+Inc.
This file is part of GNU Emacs.
@@ -3569,9 +3570,8 @@ read_list (bool flag, Lisp_Object readcharfun)
doc string, caller must make it
multibyte. */
- EMACS_INT pos = XINT (XCDR (val));
/* Position is negative for user variables. */
- if (pos < 0) pos = -pos;
+ EMACS_INT pos = eabs (XINT (XCDR (val)));
if (pos >= saved_doc_string_position
&& pos < (saved_doc_string_position
+ saved_doc_string_length))
diff --git a/src/macros.c b/src/macros.c
index 632c851ee8c..1eef9b678f4 100644
--- a/src/macros.c
+++ b/src/macros.c
@@ -1,6 +1,6 @@
/* Keyboard macros.
-Copyright (C) 1985-1986, 1993, 2000-2012 Free Software Foundation, Inc.
+Copyright (C) 1985-1986, 1993, 2000-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/macros.h b/src/macros.h
index d66784a0246..57cd1c4f2fd 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -1,5 +1,5 @@
/* Definitions for keyboard macro interpretation in GNU Emacs.
- Copyright (C) 1985, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1985, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/makefile.w32-in b/src/makefile.w32-in
index b595defdf6b..bbd9fd907b6 100644
--- a/src/makefile.w32-in
+++ b/src/makefile.w32-in
@@ -1,5 +1,5 @@
# -*- Makefile -*- for GNU Emacs on the Microsoft Windows API.
-# Copyright (C) 2000-2012 Free Software Foundation, Inc.
+# Copyright (C) 2000-2013 Free Software Foundation, Inc.
# This file is part of GNU Emacs.
@@ -781,7 +781,6 @@ $(BLD)/editfns.$(O) : \
$(SRC)/editfns.c \
$(SRC)/blockinput.h \
$(NT_INC)/pwd.h \
- $(NT_INC)/grp.h \
$(NT_INC)/unistd.h \
$(GNU_LIB)/intprops.h \
$(GNU_LIB)/strftime.h \
@@ -791,6 +790,7 @@ $(BLD)/editfns.$(O) : \
$(CODING_H) \
$(CONFIG_H) \
$(FRAME_H) \
+ $(GRP_H) \
$(INTERVALS_H) \
$(LISP_H) \
$(SYSTIME_H) \
@@ -843,6 +843,7 @@ $(BLD)/fileio.$(O) : \
$(SRC)/commands.h \
$(SRC)/w32.h \
$(NT_INC)/pwd.h \
+ $(NT_INC)/sys/acl.h \
$(NT_INC)/sys/file.h \
$(NT_INC)/sys/stat.h \
$(NT_INC)/unistd.h \
@@ -1185,6 +1186,7 @@ $(BLD)/w32.$(O) : \
$(SRC)/w32select.h \
$(NT_INC)/dirent.h \
$(NT_INC)/pwd.h \
+ $(NT_INC)/sys/acl.h \
$(NT_INC)/sys/file.h \
$(NT_INC)/sys/time.h \
$(GNU_LIB)/allocator.h \
diff --git a/src/marker.c b/src/marker.c
index 69be4faec3a..a03a0b104ca 100644
--- a/src/marker.c
+++ b/src/marker.c
@@ -1,5 +1,6 @@
/* Markers: examining, setting and deleting.
- Copyright (C) 1985, 1997-1998, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1997-1998, 2001-2013 Free Software Foundation,
+ Inc.
This file is part of GNU Emacs.
@@ -82,9 +83,7 @@ clear_charpos_cache (struct buffer *b)
and everywhere there is a marker. So we find the one of these places
that is closest to the specified position, and scan from there. */
-/* charpos_to_bytepos returns the byte position corresponding to CHARPOS. */
-
-/* This macro is a subroutine of charpos_to_bytepos.
+/* This macro is a subroutine of buf_charpos_to_bytepos.
Note that it is desirable that BYTEPOS is not evaluated
except when we really want its value. */
@@ -128,11 +127,7 @@ clear_charpos_cache (struct buffer *b)
} \
}
-ptrdiff_t
-charpos_to_bytepos (ptrdiff_t charpos)
-{
- return buf_charpos_to_bytepos (current_buffer, charpos);
-}
+/* Return the byte position corresponding to CHARPOS in B. */
ptrdiff_t
buf_charpos_to_bytepos (struct buffer *b, ptrdiff_t charpos)
@@ -141,8 +136,7 @@ buf_charpos_to_bytepos (struct buffer *b, ptrdiff_t charpos)
ptrdiff_t best_above, best_above_byte;
ptrdiff_t best_below, best_below_byte;
- if (charpos < BUF_BEG (b) || charpos > BUF_Z (b))
- emacs_abort ();
+ eassert (BUF_BEG (b) <= charpos && charpos <= BUF_Z (b));
best_above = BUF_Z (b);
best_above_byte = BUF_Z_BYTE (b);
@@ -242,9 +236,6 @@ buf_charpos_to_bytepos (struct buffer *b, ptrdiff_t charpos)
#undef CONSIDER
-/* buf_bytepos_to_charpos returns the char position corresponding to
- BYTEPOS. */
-
/* This macro is a subroutine of buf_bytepos_to_charpos.
It is used when BYTEPOS is actually the byte position. */
@@ -288,6 +279,8 @@ buf_charpos_to_bytepos (struct buffer *b, ptrdiff_t charpos)
} \
}
+/* Return the character position corresponding to BYTEPOS in B. */
+
ptrdiff_t
buf_bytepos_to_charpos (struct buffer *b, ptrdiff_t bytepos)
{
@@ -295,8 +288,7 @@ buf_bytepos_to_charpos (struct buffer *b, ptrdiff_t bytepos)
ptrdiff_t best_above, best_above_byte;
ptrdiff_t best_below, best_below_byte;
- if (bytepos < BUF_BEG_BYTE (b) || bytepos > BUF_Z_BYTE (b))
- emacs_abort ();
+ eassert (BUF_BEG_BYTE (b) <= bytepos && bytepos <= BUF_Z_BYTE (b));
best_above = BUF_Z (b);
best_above_byte = BUF_Z_BYTE (b);
diff --git a/src/mem-limits.h b/src/mem-limits.h
index 57a0ca6fefd..941ccf5f121 100644
--- a/src/mem-limits.h
+++ b/src/mem-limits.h
@@ -1,5 +1,6 @@
/* Includes for memory limit warnings.
- Copyright (C) 1990, 1993-1996, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1990, 1993-1996, 2001-2013 Free Software Foundation,
+ Inc.
This file is part of GNU Emacs.
diff --git a/src/menu.c b/src/menu.c
index 7cc110ce7e2..fdef54dd657 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1,7 +1,7 @@
/* Platform-independent code for terminal communications.
-Copyright (C) 1986, 1988, 1993-1994, 1996, 1999-2012
- Free Software Foundation, Inc.
+Copyright (C) 1986, 1988, 1993-1994, 1996, 1999-2013 Free Software
+Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/menu.h b/src/menu.h
index 67934c42d76..f60873eadb3 100644
--- a/src/menu.h
+++ b/src/menu.h
@@ -1,5 +1,5 @@
/* Functions to manipulate menus.
- Copyright (C) 2008-2012 Free Software Foundation, Inc.
+ Copyright (C) 2008-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/minibuf.c b/src/minibuf.c
index dcc4af37c13..25425cb97dc 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1,6 +1,6 @@
/* Minibuffer input and completion.
-Copyright (C) 1985-1986, 1993-2012 Free Software Foundation, Inc.
+Copyright (C) 1985-1986, 1993-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -1398,12 +1398,7 @@ is used to further constrain the set of candidates. */)
eltstring, zero,
make_number (compare),
completion_ignore_case ? Qt : Qnil);
- if (EQ (tem, Qt))
- matchsize = compare;
- else if (XINT (tem) < 0)
- matchsize = - XINT (tem) - 1;
- else
- matchsize = XINT (tem) - 1;
+ matchsize = EQ (tem, Qt) ? compare : eabs (XINT (tem)) - 1;
if (completion_ignore_case)
{
diff --git a/src/msdos.c b/src/msdos.c
index 433bf1074d8..5174bc4dfcd 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -1,6 +1,6 @@
/* MS-DOS specific C utilities. -*- coding: raw-text -*-
-Copyright (C) 1993-1997, 1999-2012 Free Software Foundation, Inc.
+Copyright (C) 1993-1997, 1999-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/msdos.h b/src/msdos.h
index a73c1f2901f..57609d62218 100644
--- a/src/msdos.h
+++ b/src/msdos.h
@@ -1,5 +1,5 @@
/* MS-DOS specific C utilities, interface.
- Copyright (C) 1993, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1993, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/nsfns.m b/src/nsfns.m
index 428cfcb9a10..1750eb62cdf 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -1,7 +1,7 @@
/* Functions for the NeXT/Open/GNUstep and MacOSX window system.
-Copyright (C) 1989, 1992-1994, 2005-2006, 2008-2012
- Free Software Foundation, Inc.
+Copyright (C) 1989, 1992-1994, 2005-2006, 2008-2013 Free Software
+Foundation, Inc.
This file is part of GNU Emacs.
@@ -2106,7 +2106,9 @@ ns_do_applescript (Lisp_Object script, Lisp_Object *result)
void
ns_run_ascript (void)
{
- as_status = ns_do_applescript (as_script, as_result);
+ if (! NILP (as_script))
+ as_status = ns_do_applescript (as_script, as_result);
+ as_script = Qnil;
}
DEFUN ("ns-do-applescript", Fns_do_applescript, Sns_do_applescript, 1, 1, 0,
@@ -2143,11 +2145,14 @@ In case the execution fails, an error is signaled. */)
data2: NSAPP_DATA2_RUNASSCRIPT];
[NSApp postEvent: nxev atStart: NO];
- [NSApp run];
+
+ // If there are other events, the event loop may exit. Keep running
+ // until the script has been handeled. */
+ while (! NILP (as_script))
+ [NSApp run];
status = as_status;
as_status = 0;
- as_script = Qnil;
as_result = 0;
unblock_input ();
if (status == 0)
diff --git a/src/nsfont.m b/src/nsfont.m
index 2ba38b7570e..c0bea2e225c 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -1,6 +1,6 @@
/* Font back-end driver for the NeXT/Open/GNUstep and MacOSX window system.
See font.h
- Copyright (C) 2006-2012 Free Software Foundation, Inc.
+ Copyright (C) 2006-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/nsgui.h b/src/nsgui.h
index 60c38b221fb..53d0c8b7c8d 100644
--- a/src/nsgui.h
+++ b/src/nsgui.h
@@ -1,5 +1,5 @@
/* Definitions and headers for communication on the NeXT/Open/GNUstep API.
- Copyright (C) 1995, 2005, 2008-2012 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2005, 2008-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/nsimage.m b/src/nsimage.m
index 884c0763fd4..9d21ba8afca 100644
--- a/src/nsimage.m
+++ b/src/nsimage.m
@@ -1,6 +1,6 @@
/* Image support for the NeXT/Open/GNUstep and MacOSX window system.
- Copyright (C) 1989, 1992-1994, 2005-2006, 2008-2012
- Free Software Foundation, Inc.
+ Copyright (C) 1989, 1992-1994, 2005-2006, 2008-2013 Free Software
+ Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/nsmenu.m b/src/nsmenu.m
index d0ea8f5a47a..39797d414f0 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -1,5 +1,5 @@
/* NeXT/Open/GNUstep and MacOSX Cocoa menu and toolbar module.
- Copyright (C) 2007-2012 Free Software Foundation, Inc.
+ Copyright (C) 2007-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/nsselect.m b/src/nsselect.m
index c0c412c6fb2..903448ce0a5 100644
--- a/src/nsselect.m
+++ b/src/nsselect.m
@@ -1,6 +1,6 @@
/* NeXT/Open/GNUstep / MacOSX Cocoa selection processing for emacs.
- Copyright (C) 1993-1994, 2005-2006, 2008-2012
- Free Software Foundation, Inc.
+ Copyright (C) 1993-1994, 2005-2006, 2008-2013 Free Software
+ Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/nsterm.h b/src/nsterm.h
index 005701ed415..e58b8493c94 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -1,5 +1,6 @@
/* Definitions and headers for communication with NeXT/Open/GNUstep API.
- Copyright (C) 1989, 1993, 2005, 2008-2012 Free Software Foundation, Inc.
+ Copyright (C) 1989, 1993, 2005, 2008-2013 Free Software Foundation,
+ Inc.
This file is part of GNU Emacs.
diff --git a/src/nsterm.m b/src/nsterm.m
index 80dc0ba6fc3..0fd062b7f17 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1,7 +1,7 @@
/* NeXT/Open/GNUstep / MacOSX communication module.
-Copyright (C) 1989, 1993-1994, 2005-2006, 2008-2012
- Free Software Foundation, Inc.
+Copyright (C) 1989, 1993-1994, 2005-2006, 2008-2013 Free Software
+Foundation, Inc.
This file is part of GNU Emacs.
@@ -2566,7 +2566,7 @@ ns_get_glyph_string_clip_rect (struct glyph_string *s, NativeRectangle *nr)
Draw a wavy line under glyph string s. The wave fills wave_height
pixels from y.
- x wave_length = 3
+ x wave_length = 2
--
y * * * * *
|* * * * * * * * *
@@ -2576,14 +2576,14 @@ ns_get_glyph_string_clip_rect (struct glyph_string *s, NativeRectangle *nr)
static void
ns_draw_underwave (struct glyph_string *s, CGFloat width, CGFloat x)
{
- int wave_height = 3, wave_length = 3;
+ int wave_height = 3, wave_length = 2;
int y, dx, dy, odd, xmax;
NSPoint a, b;
NSRect waveClip;
dx = wave_length;
dy = wave_height - 1;
- y = s->ybase + 1;
+ y = s->ybase - wave_height + 3;
xmax = x + width;
/* Find and set clipping rectangle */
@@ -2592,10 +2592,10 @@ ns_draw_underwave (struct glyph_string *s, CGFloat width, CGFloat x)
NSRectClip (waveClip);
/* Draw the waves */
- a.x = x - ((int)(x) % dx);
+ a.x = x - ((int)(x) % dx) + 0.5;
b.x = a.x + dx;
odd = (int)(a.x/dx) % 2;
- a.y = b.y = y;
+ a.y = b.y = y + 0.5;
if (odd)
a.y += dy;
@@ -2606,7 +2606,7 @@ ns_draw_underwave (struct glyph_string *s, CGFloat width, CGFloat x)
{
[NSBezierPath strokeLineFromPoint:a toPoint:b];
a.x = b.x, a.y = b.y;
- b.x += dx, b.y = y + odd*dy;
+ b.x += dx, b.y = y + 0.5 + odd*dy;
odd = !odd;
}
@@ -2646,6 +2646,7 @@ ns_draw_text_decoration (struct glyph_string *s, struct face *face,
/* If the prev was underlined, match its appearance. */
if (s->prev && s->prev->face->underline_p
+ && s->prev->face->underline_type == FACE_UNDER_LINE
&& s->prev->underline_thickness > 0)
{
thickness = s->prev->underline_thickness;
diff --git a/src/print.c b/src/print.c
index 71efb61e732..2ffe7def396 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1,7 +1,7 @@
/* Lisp object printing and output streams.
-Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2012
- Free Software Foundation, Inc.
+Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2013 Free Software
+Foundation, Inc.
This file is part of GNU Emacs.
@@ -2070,14 +2070,44 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
break;
case Lisp_Misc_Save_Value:
- strout ("#<save_value ", -1, -1, printcharfun);
{
- int len = sprintf (buf, "ptr=%p int=%"pD"d",
- XSAVE_VALUE (obj)->pointer,
- XSAVE_VALUE (obj)->integer);
- strout (buf, len, len, printcharfun);
+ int i;
+ struct Lisp_Save_Value *v = XSAVE_VALUE (obj);
+
+ strout ("#<save-value ", -1, -1, printcharfun);
+ if (v->dogc)
+ {
+ int lim = min (v->integer, 8);
+
+ /* Try to print up to 8 objects we have saved. Although
+ valid_lisp_object_p is slow, this shouldn't be a real
+ bottleneck because such a saved values are quite rare. */
+
+ i = sprintf (buf, "with %"pD"d objects", v->integer);
+ strout (buf, i, i, printcharfun);
+
+ for (i = 0; i < lim; i++)
+ {
+ Lisp_Object maybe = ((Lisp_Object *) v->pointer)[i];
+
+ if (valid_lisp_object_p (maybe) > 0)
+ {
+ PRINTCHAR (' ');
+ print_object (maybe, printcharfun, escapeflag);
+ }
+ else
+ strout (" <invalid>", -1, -1, printcharfun);
+ }
+ if (i == lim && i < v->integer)
+ strout (" ...", 4, 4, printcharfun);
+ }
+ else
+ {
+ i = sprintf (buf, "ptr=%p int=%"pD"d", v->pointer, v->integer);
+ strout (buf, i, i, printcharfun);
+ }
+ PRINTCHAR ('>');
}
- PRINTCHAR ('>');
break;
default:
diff --git a/src/process.c b/src/process.c
index 788c9176349..d56819da67a 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1,7 +1,7 @@
/* Asynchronous subprocess control for GNU Emacs.
-Copyright (C) 1985-1988, 1993-1996, 1998-1999, 2001-2012
- Free Software Foundation, Inc.
+Copyright (C) 1985-1988, 1993-1996, 1998-1999, 2001-2013 Free Software
+Foundation, Inc.
This file is part of GNU Emacs.
@@ -4941,11 +4941,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
Therefore, if we get an error reading and errno =
EIO, just continue, because the child process has
exited and should clean itself up soon (e.g. when we
- get a SIGCHLD).
-
- However, it has been known to happen that the SIGCHLD
- got lost. So raise the signal again just in case.
- It can't hurt. */
+ get a SIGCHLD). */
else if (nread == -1 && errno == EIO)
{
struct Lisp_Process *p = XPROCESS (proc);
@@ -4962,8 +4958,6 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
p->tick = ++process_tick;
pset_status (p, Qfailed);
}
- else
- handle_child_signal (SIGCHLD);
}
#endif /* HAVE_PTYS */
/* If we can detect process termination, don't consider the
@@ -5724,19 +5718,19 @@ it is sent in several bunches. This may happen even for shorter regions.
Output from processes can arrive in between bunches. */)
(Lisp_Object process, Lisp_Object start, Lisp_Object end)
{
- Lisp_Object proc;
- ptrdiff_t start1, end1;
+ Lisp_Object proc = get_process (process);
+ ptrdiff_t start_byte, end_byte;
- proc = get_process (process);
validate_region (&start, &end);
+ start_byte = CHAR_TO_BYTE (XINT (start));
+ end_byte = CHAR_TO_BYTE (XINT (end));
+
if (XINT (start) < GPT && XINT (end) > GPT)
- move_gap (XINT (start));
+ move_gap_both (XINT (start), start_byte);
- start1 = CHAR_TO_BYTE (XINT (start));
- end1 = CHAR_TO_BYTE (XINT (end));
- send_process (proc, (char *) BYTE_POS_ADDR (start1), end1 - start1,
- Fcurrent_buffer ());
+ send_process (proc, (char *) BYTE_POS_ADDR (start_byte),
+ end_byte - start_byte, Fcurrent_buffer ());
return Qnil;
}
diff --git a/src/process.h b/src/process.h
index 01f7fd50ffa..0dc35f42993 100644
--- a/src/process.h
+++ b/src/process.h
@@ -1,5 +1,5 @@
/* Definitions for asynchronous process control in GNU Emacs.
- Copyright (C) 1985, 1994, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1994, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/profiler.c b/src/profiler.c
index 3d8f7243d2f..f6503cf182e 100644
--- a/src/profiler.c
+++ b/src/profiler.c
@@ -1,6 +1,6 @@
/* Profiler implementation.
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2012-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/puresize.h b/src/puresize.h
index 26395a5729d..2f717571c7c 100644
--- a/src/puresize.h
+++ b/src/puresize.h
@@ -1,5 +1,5 @@
/* How much read-only Lisp storage a dumped Emacs needs.
- Copyright (C) 1993, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1993, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/ralloc.c b/src/ralloc.c
index e5bf76b0e6d..ec1ac40414c 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -1,5 +1,5 @@
/* Block-relocating memory allocator.
- Copyright (C) 1993, 1995, 2000-2012 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1995, 2000-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/regex.c b/src/regex.c
index 878b629fbbf..b5522f19079 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -2,7 +2,7 @@
0.12. (Implements POSIX draft P1003.2/D11.2, except for some of the
internationalization features.)
- Copyright (C) 1993-2012 Free Software Foundation, Inc.
+ Copyright (C) 1993-2013 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
@@ -15,9 +15,7 @@
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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* TODO:
- structure the opcode space into opcode+flag.
diff --git a/src/regex.h b/src/regex.h
index 91886a80549..36fb4321027 100644
--- a/src/regex.h
+++ b/src/regex.h
@@ -1,8 +1,8 @@
/* Definitions for data structures and routines for the regular
expression library, version 0.12.
- Copyright (C) 1985, 1989-1993, 1995, 2000-2012
- Free Software Foundation, Inc.
+ Copyright (C) 1985, 1989-1993, 1995, 2000-2013 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
@@ -15,9 +15,7 @@
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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef _REGEX_H
#define _REGEX_H 1
diff --git a/src/region-cache.c b/src/region-cache.c
index 832f4bfd214..14e6982cd9a 100644
--- a/src/region-cache.c
+++ b/src/region-cache.c
@@ -1,7 +1,7 @@
/* Caching facts about regions of the buffer, for optimization.
-Copyright (C) 1985-1989, 1993, 1995, 2001-2012
- Free Software Foundation, Inc.
+Copyright (C) 1985-1989, 1993, 1995, 2001-2013 Free Software Foundation,
+Inc.
This file is part of GNU Emacs.
diff --git a/src/region-cache.h b/src/region-cache.h
index 7aebdbec262..697ae1c791f 100644
--- a/src/region-cache.h
+++ b/src/region-cache.h
@@ -1,7 +1,7 @@
/* Header file: Caching facts about regions of the buffer, for optimization.
-Copyright (C) 1985-1986, 1993, 1995, 2001-2012
- Free Software Foundation, Inc.
+Copyright (C) 1985-1986, 1993, 1995, 2001-2013 Free Software Foundation,
+Inc.
This file is part of GNU Emacs.
diff --git a/src/scroll.c b/src/scroll.c
index 71ce43b2e48..9e11feb64d4 100644
--- a/src/scroll.c
+++ b/src/scroll.c
@@ -1,7 +1,7 @@
/* Calculate what line insertion or deletion to do, and do it
-Copyright (C) 1985-1986, 1990, 1993-1994, 2001-2012
- Free Software Foundation, Inc.
+Copyright (C) 1985-1986, 1990, 1993-1994, 2001-2013 Free Software
+Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/search.c b/src/search.c
index ae038a45f9c..a7fabf19399 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1,7 +1,7 @@
/* String search routines for GNU Emacs.
-Copyright (C) 1985-1987, 1993-1994, 1997-1999, 2001-2012
- Free Software Foundation, Inc.
+Copyright (C) 1985-1987, 1993-1994, 1997-1999, 2001-2013 Free Software
+Foundation, Inc.
This file is part of GNU Emacs.
@@ -1313,8 +1313,11 @@ search_buffer (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte,
non-nil, we can use boyer-moore search only if TRT can be
represented by the byte array of 256 elements. For that,
all non-ASCII case-equivalents of all case-sensitive
- characters in STRING must belong to the same charset and
- row. */
+ characters in STRING must belong to the same character
+ group (two characters belong to the same group iff their
+ multibyte forms are the same except for the last byte;
+ i.e. every 64 characters form a group; U+0000..U+003F,
+ U+0040..U+007F, U+0080..U+00BF, ...). */
while (--len >= 0)
{
@@ -2599,7 +2602,7 @@ since only regular expressions have distinguished subexpressions. */)
ptrdiff_t begbyte = CHAR_TO_BYTE (search_regs.start[idx]);
add_len = CHAR_TO_BYTE (search_regs.end[idx]) - begbyte;
if (search_regs.start[idx] < GPT && GPT < search_regs.end[idx])
- move_gap (search_regs.start[idx]);
+ move_gap_both (search_regs.start[idx], begbyte);
add_stuff = BYTE_POS_ADDR (begbyte);
}
diff --git a/src/sheap.c b/src/sheap.c
index f6022ea3ce7..972c04c9552 100644
--- a/src/sheap.c
+++ b/src/sheap.c
@@ -1,7 +1,7 @@
/* simulate `sbrk' with an array in .bss, for `unexec' support for Cygwin;
complete rewrite of xemacs Cygwin `unexec' code
- Copyright (C) 2004-2012 Free Software Foundation, Inc.
+ Copyright (C) 2004-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/sound.c b/src/sound.c
index 0ee85312fd3..802f1ce740d 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -1,6 +1,6 @@
/* sound.c -- sound support.
-Copyright (C) 1998-1999, 2001-2012 Free Software Foundation, Inc.
+Copyright (C) 1998-1999, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/syntax.c b/src/syntax.c
index d3cafcc472e..72d904914ec 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1,6 +1,6 @@
/* GNU Emacs routines to deal with syntax tables; also word and list parsing.
- Copyright (C) 1985, 1987, 1993-1995, 1997-1999, 2001-2012
- Free Software Foundation, Inc.
+ Copyright (C) 1985, 1987, 1993-1995, 1997-1999, 2001-2013 Free
+ Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/syntax.h b/src/syntax.h
index 6edb1585795..c9af240df0c 100644
--- a/src/syntax.h
+++ b/src/syntax.h
@@ -1,7 +1,7 @@
/* Declarations having to do with GNU Emacs syntax tables.
-Copyright (C) 1985, 1993-1994, 1997-1998, 2001-2012
- Free Software Foundation, Inc.
+Copyright (C) 1985, 1993-1994, 1997-1998, 2001-2013 Free Software
+Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/sysdep.c b/src/sysdep.c
index 5291c5d59aa..049eb85afe5 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1,6 +1,6 @@
/* Interfaces to system-dependent kernel and library entries.
- Copyright (C) 1985-1988, 1993-1995, 1999-2012
- Free Software Foundation, Inc.
+ Copyright (C) 1985-1988, 1993-1995, 1999-2013 Free Software
+ Foundation, Inc.
This file is part of GNU Emacs.
@@ -2110,7 +2110,7 @@ emacs_backtrace (int backtrace_limit)
void
emacs_abort (void)
{
- terminate_due_to_signal (SIGABRT, 10);
+ terminate_due_to_signal (SIGABRT, 40);
}
#endif
diff --git a/src/sysselect.h b/src/sysselect.h
index 24bdf469ced..0a4f7e3ad96 100644
--- a/src/sysselect.h
+++ b/src/sysselect.h
@@ -1,5 +1,5 @@
/* sysselect.h - System-dependent definitions for the select function.
- Copyright (C) 1995, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/syssignal.h b/src/syssignal.h
index 8f9b5f0546a..d7399c6cb8c 100644
--- a/src/syssignal.h
+++ b/src/syssignal.h
@@ -1,6 +1,6 @@
/* syssignal.h - System-dependent definitions for signals.
-Copyright (C) 1993, 1999, 2001-2012 Free Software Foundation, Inc.
+Copyright (C) 1993, 1999, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/systime.h b/src/systime.h
index 9ce7ce646fb..fa5e7270cb5 100644
--- a/src/systime.h
+++ b/src/systime.h
@@ -1,5 +1,5 @@
/* systime.h - System-dependent definitions for time manipulations.
- Copyright (C) 1993-1994, 2002-2012 Free Software Foundation, Inc.
+ Copyright (C) 1993-1994, 2002-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/systty.h b/src/systty.h
index 80bcaedf740..6d38c980725 100644
--- a/src/systty.h
+++ b/src/systty.h
@@ -1,5 +1,5 @@
/* systty.h - System-dependent definitions for terminals.
- Copyright (C) 1993-1994, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1993-1994, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/syswait.h b/src/syswait.h
index 360407d558e..03e5cb5fe2e 100644
--- a/src/syswait.h
+++ b/src/syswait.h
@@ -1,5 +1,5 @@
/* Define wait system call interface for Emacs.
- Copyright (C) 1993-1995, 2000-2012 Free Software Foundation, Inc.
+ Copyright (C) 1993-1995, 2000-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/term.c b/src/term.c
index 241875de52f..d76562bb4db 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1,6 +1,6 @@
/* Terminal control module for terminals described by TERMCAP
- Copyright (C) 1985-1987, 1993-1995, 1998, 2000-2012
- Free Software Foundation, Inc.
+ Copyright (C) 1985-1987, 1993-1995, 1998, 2000-2013 Free Software
+ Foundation, Inc.
This file is part of GNU Emacs.
@@ -953,8 +953,8 @@ tty_ins_del_lines (struct frame *f, int vpos, int n)
const char *single = n > 0 ? tty->TS_ins_line : tty->TS_del_line;
const char *scroll = n > 0 ? tty->TS_rev_scroll : tty->TS_fwd_scroll;
- register int i = n > 0 ? n : -n;
- register char *buf;
+ int i = eabs (n);
+ char *buf;
/* If the lines below the insertion are being pushed
into the end of the window, this is the same as clearing;
diff --git a/src/termcap.c b/src/termcap.c
index e494cd113d9..82c2b1fda07 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -1,6 +1,6 @@
/* Work-alike for termcap, plus extra features.
- Copyright (C) 1985, 1986, 1993, 1994, 1995, 2000, 2001, 2002, 2003,
- 2004, 2005, 2006, 2007, 2008, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1985-1986, 1993-1995, 2000-2008, 2011, 2013 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
@@ -13,9 +13,7 @@ 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; see the file COPYING. If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA. */
+along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Emacs config.h may rename various library functions such as malloc. */
#include <config.h>
diff --git a/src/termchar.h b/src/termchar.h
index 8bffd3e546b..1c8e8646d4e 100644
--- a/src/termchar.h
+++ b/src/termchar.h
@@ -1,5 +1,5 @@
/* Flags and parameters describing terminal's characteristics.
- Copyright (C) 1985-1986, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1985-1986, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/termhooks.h b/src/termhooks.h
index 1a261bacdc5..7385298d3d4 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -1,6 +1,7 @@
/* Parameters and display hooks for terminal devices.
-Copyright (C) 1985-1986, 1993-1994, 2001-2012 Free Software Foundation, Inc.
+Copyright (C) 1985-1986, 1993-1994, 2001-2013 Free Software Foundation,
+Inc.
This file is part of GNU Emacs.
diff --git a/src/terminal.c b/src/terminal.c
index 854ca61f19c..5e1f1ff77f7 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -1,5 +1,5 @@
/* Functions related to terminal devices.
- Copyright (C) 2005-2012 Free Software Foundation, Inc.
+ Copyright (C) 2005-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -398,8 +398,6 @@ possible return values. */)
return Qw32;
case output_msdos_raw:
return Qpc;
- case output_mac:
- return Qmac;
case output_ns:
return Qns;
default:
diff --git a/src/terminfo.c b/src/terminfo.c
index 124c452a4a9..0e5e1985461 100644
--- a/src/terminfo.c
+++ b/src/terminfo.c
@@ -1,5 +1,5 @@
/* Interface from Emacs to terminfo.
- Copyright (C) 1985-1986, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1985-1986, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/termopts.h b/src/termopts.h
index 05fa0a52eee..8b702b9bf6d 100644
--- a/src/termopts.h
+++ b/src/termopts.h
@@ -1,5 +1,6 @@
/* Flags and parameters describing user options for handling the terminal.
- Copyright (C) 1985-1986, 1990, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1985-1986, 1990, 2001-2013 Free Software Foundation,
+ Inc.
This file is part of GNU Emacs.
diff --git a/src/textprop.c b/src/textprop.c
index 1ce44ad60ac..c1f6e59bf2e 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -1,5 +1,6 @@
/* Interface code for dealing with text properties.
- Copyright (C) 1993-1995, 1997, 1999-2012 Free Software Foundation, Inc.
+ Copyright (C) 1993-1995, 1997, 1999-2013 Free Software Foundation,
+ Inc.
This file is part of GNU Emacs.
@@ -1323,14 +1324,13 @@ set_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object properties,
}
/* Replace properties of text from START to END with new list of
- properties PROPERTIES. BUFFER is the buffer containing
+ properties PROPERTIES. OBJECT is the buffer or string containing
the text. This does not obey any hooks.
- You can provide the interval that START is located in as I,
- or pass NULL for I and this function will find it.
+ You should provide the interval that START is located in as I.
START and END can be in any order. */
void
-set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object buffer, INTERVAL i)
+set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object, INTERVAL i)
{
register INTERVAL prev_changed = NULL;
register ptrdiff_t s, len;
@@ -1349,8 +1349,7 @@ set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object propertie
else
return;
- if (i == NULL)
- i = find_interval (buffer_intervals (XBUFFER (buffer)), s);
+ eassert (i);
if (i->position != s)
{
@@ -1361,11 +1360,11 @@ set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object propertie
{
copy_properties (unchanged, i);
i = split_interval_left (i, len);
- set_properties (properties, i, buffer);
+ set_properties (properties, i, object);
return;
}
- set_properties (properties, i, buffer);
+ set_properties (properties, i, object);
if (LENGTH (i) == len)
return;
@@ -1388,7 +1387,7 @@ set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object propertie
/* We have to call set_properties even if we are going to
merge the intervals, so as to make the undo records
and cause redisplay to happen. */
- set_properties (properties, i, buffer);
+ set_properties (properties, i, object);
if (prev_changed)
merge_interval_left (i);
return;
@@ -1399,7 +1398,7 @@ set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object propertie
/* We have to call set_properties even if we are going to
merge the intervals, so as to make the undo records
and cause redisplay to happen. */
- set_properties (properties, i, buffer);
+ set_properties (properties, i, object);
if (!prev_changed)
prev_changed = i;
else
diff --git a/src/tparam.c b/src/tparam.c
index 164f61d471b..c3ecfb9e3a3 100644
--- a/src/tparam.c
+++ b/src/tparam.c
@@ -1,6 +1,6 @@
/* Merge parameters into a termcap entry string.
- Copyright (C) 1985, 1987, 1993, 1995, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1987, 1993, 1995, 2000-2008, 2013 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
@@ -13,9 +13,7 @@ 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; see the file COPYING. If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA. */
+along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Emacs config.h may rename various library functions such as malloc. */
#include <config.h>
diff --git a/src/tparam.h b/src/tparam.h
index e845f3e8202..94f226d7d6a 100644
--- a/src/tparam.h
+++ b/src/tparam.h
@@ -1,6 +1,6 @@
/* Interface definitions for termcap entries.
-Copyright (C) 2011-2012 Free Software Foundation, Inc.
+Copyright (C) 2011-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/undo.c b/src/undo.c
index e878ef4dcf9..2626fd4ccfe 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -1,5 +1,6 @@
/* undo handling for GNU Emacs.
- Copyright (C) 1990, 1993-1994, 2000-2012 Free Software Foundation, Inc.
+ Copyright (C) 1990, 1993-1994, 2000-2013 Free Software Foundation,
+ Inc.
This file is part of GNU Emacs.
diff --git a/src/unexaix.c b/src/unexaix.c
index c01a22a79f6..92ebd2e3ceb 100644
--- a/src/unexaix.c
+++ b/src/unexaix.c
@@ -1,5 +1,6 @@
/* Dump an executable image.
- Copyright (C) 1985-1988, 1999, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1985-1988, 1999, 2001-2013 Free Software Foundation,
+ Inc.
This file is part of GNU Emacs.
diff --git a/src/unexcoff.c b/src/unexcoff.c
index 6e29951a962..466a5c0e491 100644
--- a/src/unexcoff.c
+++ b/src/unexcoff.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1985-1988, 1992-1994, 2001-2012 Free Software Foundation, Inc.
+/* Copyright (C) 1985-1988, 1992-1994, 2001-2013 Free Software
+ * Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/unexcw.c b/src/unexcw.c
index 7d1a72e0009..af93e158e14 100644
--- a/src/unexcw.c
+++ b/src/unexcw.c
@@ -1,7 +1,7 @@
/* unexec() support for Cygwin;
complete rewrite of xemacs Cygwin unexec() code
- Copyright (C) 2004-2012 Free Software Foundation, Inc.
+ Copyright (C) 2004-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/unexelf.c b/src/unexelf.c
index b9f8e05e959..d3659404f9c 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -1,5 +1,5 @@
-/* Copyright (C) 1985-1988, 1990, 1992, 1999-2012
- Free Software Foundation, Inc.
+/* Copyright (C) 1985-1988, 1990, 1992, 1999-2013 Free Software
+ Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index d304e85d490..8d4e636fa5c 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -1,5 +1,5 @@
/* Dump Emacs in Mach-O format for use on Mac OS X.
- Copyright (C) 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/unexw32.c b/src/unexw32.c
index ee1deb5f92e..66071295727 100644
--- a/src/unexw32.c
+++ b/src/unexw32.c
@@ -1,5 +1,5 @@
/* unexec for GNU Emacs on Windows NT.
- Copyright (C) 1994, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1994, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/vm-limit.c b/src/vm-limit.c
index befc01d400f..9dbb1b884b7 100644
--- a/src/vm-limit.c
+++ b/src/vm-limit.c
@@ -1,5 +1,5 @@
/* Functions for memory limit warnings.
- Copyright (C) 1990, 1992, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1990, 1992, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/w16select.c b/src/w16select.c
index b8aaa3619ba..c92276b1d29 100644
--- a/src/w16select.c
+++ b/src/w16select.c
@@ -1,6 +1,6 @@
/* 16-bit Windows Selection processing for emacs on MS-Windows
-Copyright (C) 1996-1997, 2001-2012 Free Software Foundation, Inc.
+Copyright (C) 1996-1997, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/w32.c b/src/w32.c
index 50c81f88c72..55581a17de5 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -1,5 +1,5 @@
/* Utility and Unix shadow routines for GNU Emacs on the Microsoft Windows API.
- Copyright (C) 1994-1995, 2000-2012 Free Software Foundation, Inc.
+ Copyright (C) 1994-1995, 2000-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -117,6 +117,15 @@ typedef struct _PROCESS_MEMORY_COUNTERS_EX {
#include <winioctl.h>
#include <aclapi.h>
+#include <sddl.h>
+
+#include <sys/acl.h>
+
+/* This is not in MinGW's sddl.h (but they are in MSVC headers), so we
+ define them by hand if not already defined. */
+#ifndef SDDL_REVISION_1
+#define SDDL_REVISION_1 1
+#endif /* SDDL_REVISION_1 */
#ifdef _MSC_VER
/* MSVC doesn't provide the definition of REPARSE_DATA_BUFFER and the
@@ -257,6 +266,11 @@ static BOOL g_b_init_copy_sid;
static BOOL g_b_init_get_native_system_info;
static BOOL g_b_init_get_system_times;
static BOOL g_b_init_create_symbolic_link;
+static BOOL g_b_init_get_security_descriptor_dacl;
+static BOOL g_b_init_convert_sd_to_sddl;
+static BOOL g_b_init_convert_sddl_to_sd;
+static BOOL g_b_init_is_valid_security_descriptor;
+static BOOL g_b_init_set_file_security;
/*
BEGIN: Wrapper functions around OpenProcessToken
@@ -286,9 +300,11 @@ GetProcessTimes_Proc get_process_times_fn = NULL;
#ifdef _UNICODE
const char * const LookupAccountSid_Name = "LookupAccountSidW";
const char * const GetFileSecurity_Name = "GetFileSecurityW";
+const char * const SetFileSecurity_Name = "SetFileSecurityW";
#else
const char * const LookupAccountSid_Name = "LookupAccountSidA";
const char * const GetFileSecurity_Name = "GetFileSecurityA";
+const char * const SetFileSecurity_Name = "SetFileSecurityA";
#endif
typedef BOOL (WINAPI * LookupAccountSid_Proc) (
LPCTSTR lpSystemName,
@@ -318,6 +334,10 @@ typedef BOOL (WINAPI * GetFileSecurity_Proc) (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
DWORD nLength,
LPDWORD lpnLengthNeeded);
+typedef BOOL (WINAPI *SetFileSecurity_Proc) (
+ LPCTSTR lpFileName,
+ SECURITY_INFORMATION SecurityInformation,
+ PSECURITY_DESCRIPTOR pSecurityDescriptor);
typedef BOOL (WINAPI * GetSecurityDescriptorOwner_Proc) (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
PSID *pOwner,
@@ -326,6 +346,11 @@ typedef BOOL (WINAPI * GetSecurityDescriptorGroup_Proc) (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
PSID *pGroup,
LPBOOL lpbGroupDefaulted);
+typedef BOOL (WINAPI *GetSecurityDescriptorDacl_Proc) (
+ PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ LPBOOL lpbDaclPresent,
+ PACL *pDacl,
+ LPBOOL lpbDaclDefaulted);
typedef BOOL (WINAPI * IsValidSid_Proc) (
PSID sid);
typedef HANDLE (WINAPI * CreateToolhelp32Snapshot_Proc) (
@@ -376,6 +401,18 @@ typedef BOOLEAN (WINAPI *CreateSymbolicLink_Proc) (
LPTSTR lpSymlinkFileName,
LPTSTR lpTargetFileName,
DWORD dwFlags);
+typedef BOOL (WINAPI *ConvertStringSecurityDescriptorToSecurityDescriptor_Proc) (
+ LPCTSTR StringSecurityDescriptor,
+ DWORD StringSDRevision,
+ PSECURITY_DESCRIPTOR *SecurityDescriptor,
+ PULONG SecurityDescriptorSize);
+typedef BOOL (WINAPI *ConvertSecurityDescriptorToStringSecurityDescriptor_Proc) (
+ PSECURITY_DESCRIPTOR SecurityDescriptor,
+ DWORD RequestedStringSDRevision,
+ SECURITY_INFORMATION SecurityInformation,
+ LPTSTR *StringSecurityDescriptor,
+ PULONG StringSecurityDescriptorLen);
+typedef BOOL (WINAPI *IsValidSecurityDescriptor_Proc) (PSECURITY_DESCRIPTOR);
/* ** A utility function ** */
static BOOL
@@ -621,6 +658,7 @@ get_file_security (LPCTSTR lpFileName,
HMODULE hm_advapi32 = NULL;
if (is_windows_9x () == TRUE)
{
+ errno = ENOTSUP;
return FALSE;
}
if (g_b_init_get_file_security == 0)
@@ -633,6 +671,7 @@ get_file_security (LPCTSTR lpFileName,
}
if (s_pfn_Get_File_Security == NULL)
{
+ errno = ENOTSUP;
return FALSE;
}
return (s_pfn_Get_File_Security (lpFileName, RequestedInformation,
@@ -641,6 +680,35 @@ get_file_security (LPCTSTR lpFileName,
}
static BOOL WINAPI
+set_file_security (LPCTSTR lpFileName,
+ SECURITY_INFORMATION SecurityInformation,
+ PSECURITY_DESCRIPTOR pSecurityDescriptor)
+{
+ static SetFileSecurity_Proc s_pfn_Set_File_Security = NULL;
+ HMODULE hm_advapi32 = NULL;
+ if (is_windows_9x () == TRUE)
+ {
+ errno = ENOTSUP;
+ return FALSE;
+ }
+ if (g_b_init_set_file_security == 0)
+ {
+ g_b_init_set_file_security = 1;
+ hm_advapi32 = LoadLibrary ("Advapi32.dll");
+ s_pfn_Set_File_Security =
+ (SetFileSecurity_Proc) GetProcAddress (
+ hm_advapi32, SetFileSecurity_Name);
+ }
+ if (s_pfn_Set_File_Security == NULL)
+ {
+ errno = ENOTSUP;
+ return FALSE;
+ }
+ return (s_pfn_Set_File_Security (lpFileName, SecurityInformation,
+ pSecurityDescriptor));
+}
+
+static BOOL WINAPI
get_security_descriptor_owner (PSECURITY_DESCRIPTOR pSecurityDescriptor,
PSID *pOwner,
LPBOOL lpbOwnerDefaulted)
@@ -649,6 +717,7 @@ get_security_descriptor_owner (PSECURITY_DESCRIPTOR pSecurityDescriptor,
HMODULE hm_advapi32 = NULL;
if (is_windows_9x () == TRUE)
{
+ errno = ENOTSUP;
return FALSE;
}
if (g_b_init_get_security_descriptor_owner == 0)
@@ -661,6 +730,7 @@ get_security_descriptor_owner (PSECURITY_DESCRIPTOR pSecurityDescriptor,
}
if (s_pfn_Get_Security_Descriptor_Owner == NULL)
{
+ errno = ENOTSUP;
return FALSE;
}
return (s_pfn_Get_Security_Descriptor_Owner (pSecurityDescriptor, pOwner,
@@ -676,6 +746,7 @@ get_security_descriptor_group (PSECURITY_DESCRIPTOR pSecurityDescriptor,
HMODULE hm_advapi32 = NULL;
if (is_windows_9x () == TRUE)
{
+ errno = ENOTSUP;
return FALSE;
}
if (g_b_init_get_security_descriptor_group == 0)
@@ -688,6 +759,7 @@ get_security_descriptor_group (PSECURITY_DESCRIPTOR pSecurityDescriptor,
}
if (s_pfn_Get_Security_Descriptor_Group == NULL)
{
+ errno = ENOTSUP;
return FALSE;
}
return (s_pfn_Get_Security_Descriptor_Group (pSecurityDescriptor, pGroup,
@@ -695,6 +767,37 @@ get_security_descriptor_group (PSECURITY_DESCRIPTOR pSecurityDescriptor,
}
static BOOL WINAPI
+get_security_descriptor_dacl (PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ LPBOOL lpbDaclPresent,
+ PACL *pDacl,
+ LPBOOL lpbDaclDefaulted)
+{
+ static GetSecurityDescriptorDacl_Proc s_pfn_Get_Security_Descriptor_Dacl = NULL;
+ HMODULE hm_advapi32 = NULL;
+ if (is_windows_9x () == TRUE)
+ {
+ errno = ENOTSUP;
+ return FALSE;
+ }
+ if (g_b_init_get_security_descriptor_dacl == 0)
+ {
+ g_b_init_get_security_descriptor_dacl = 1;
+ hm_advapi32 = LoadLibrary ("Advapi32.dll");
+ s_pfn_Get_Security_Descriptor_Dacl =
+ (GetSecurityDescriptorDacl_Proc) GetProcAddress (
+ hm_advapi32, "GetSecurityDescriptorDacl");
+ }
+ if (s_pfn_Get_Security_Descriptor_Dacl == NULL)
+ {
+ errno = ENOTSUP;
+ return FALSE;
+ }
+ return (s_pfn_Get_Security_Descriptor_Dacl (pSecurityDescriptor,
+ lpbDaclPresent, pDacl,
+ lpbDaclDefaulted));
+}
+
+static BOOL WINAPI
is_valid_sid (PSID sid)
{
static IsValidSid_Proc s_pfn_Is_Valid_Sid = NULL;
@@ -888,6 +991,120 @@ create_symbolic_link (LPTSTR lpSymlinkFilename,
}
return retval;
}
+
+static BOOL WINAPI
+is_valid_security_descriptor (PSECURITY_DESCRIPTOR pSecurityDescriptor)
+{
+ static IsValidSecurityDescriptor_Proc s_pfn_Is_Valid_Security_Descriptor_Proc = NULL;
+
+ if (is_windows_9x () == TRUE)
+ {
+ errno = ENOTSUP;
+ return FALSE;
+ }
+
+ if (g_b_init_is_valid_security_descriptor == 0)
+ {
+ g_b_init_is_valid_security_descriptor = 1;
+ s_pfn_Is_Valid_Security_Descriptor_Proc =
+ (IsValidSecurityDescriptor_Proc)GetProcAddress (GetModuleHandle ("Advapi32.dll"),
+ "IsValidSecurityDescriptor");
+ }
+ if (s_pfn_Is_Valid_Security_Descriptor_Proc == NULL)
+ {
+ errno = ENOTSUP;
+ return FALSE;
+ }
+
+ return s_pfn_Is_Valid_Security_Descriptor_Proc (pSecurityDescriptor);
+}
+
+static BOOL WINAPI
+convert_sd_to_sddl (PSECURITY_DESCRIPTOR SecurityDescriptor,
+ DWORD RequestedStringSDRevision,
+ SECURITY_INFORMATION SecurityInformation,
+ LPTSTR *StringSecurityDescriptor,
+ PULONG StringSecurityDescriptorLen)
+{
+ static ConvertSecurityDescriptorToStringSecurityDescriptor_Proc s_pfn_Convert_SD_To_SDDL = NULL;
+ BOOL retval;
+
+ if (is_windows_9x () == TRUE)
+ {
+ errno = ENOTSUP;
+ return FALSE;
+ }
+
+ if (g_b_init_convert_sd_to_sddl == 0)
+ {
+ g_b_init_convert_sd_to_sddl = 1;
+#ifdef _UNICODE
+ s_pfn_Convert_SD_To_SDDL =
+ (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)GetProcAddress (GetModuleHandle ("Advapi32.dll"),
+ "ConvertSecurityDescriptorToStringSecurityDescriptorW");
+#else
+ s_pfn_Convert_SD_To_SDDL =
+ (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)GetProcAddress (GetModuleHandle ("Advapi32.dll"),
+ "ConvertSecurityDescriptorToStringSecurityDescriptorA");
+#endif
+ }
+ if (s_pfn_Convert_SD_To_SDDL == NULL)
+ {
+ errno = ENOTSUP;
+ return FALSE;
+ }
+
+ retval = s_pfn_Convert_SD_To_SDDL (SecurityDescriptor,
+ RequestedStringSDRevision,
+ SecurityInformation,
+ StringSecurityDescriptor,
+ StringSecurityDescriptorLen);
+
+ return retval;
+}
+
+static BOOL WINAPI
+convert_sddl_to_sd (LPCTSTR StringSecurityDescriptor,
+ DWORD StringSDRevision,
+ PSECURITY_DESCRIPTOR *SecurityDescriptor,
+ PULONG SecurityDescriptorSize)
+{
+ static ConvertStringSecurityDescriptorToSecurityDescriptor_Proc s_pfn_Convert_SDDL_To_SD = NULL;
+ BOOL retval;
+
+ if (is_windows_9x () == TRUE)
+ {
+ errno = ENOTSUP;
+ return FALSE;
+ }
+
+ if (g_b_init_convert_sddl_to_sd == 0)
+ {
+ g_b_init_convert_sddl_to_sd = 1;
+#ifdef _UNICODE
+ s_pfn_Convert_SDDL_To_SD =
+ (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)GetProcAddress (GetModuleHandle ("Advapi32.dll"),
+ "ConvertStringSecurityDescriptorToSecurityDescriptorW");
+#else
+ s_pfn_Convert_SDDL_To_SD =
+ (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)GetProcAddress (GetModuleHandle ("Advapi32.dll"),
+ "ConvertStringSecurityDescriptorToSecurityDescriptorA");
+#endif
+ }
+ if (s_pfn_Convert_SDDL_To_SD == NULL)
+ {
+ errno = ENOTSUP;
+ return FALSE;
+ }
+
+ retval = s_pfn_Convert_SDDL_To_SD (StringSecurityDescriptor,
+ StringSDRevision,
+ SecurityDescriptor,
+ SecurityDescriptorSize);
+
+ return retval;
+}
+
/* Return 1 if P is a valid pointer to an object of size SIZE. Return
@@ -1567,6 +1784,7 @@ unsetenv (const char *name)
/* It is safe to use 'alloca' with 32K size, since the stack is at
least 2MB, and we set it to 8MB in the link command line. */
var = alloca (name_len + 2);
+ strncpy (var, name, name_len);
var[name_len++] = '=';
var[name_len] = '\0';
return _putenv (var);
@@ -3427,8 +3645,7 @@ w32_add_to_cache (PSID sid, unsigned id, char *name)
#define GID 2
static int
-get_name_and_id (PSECURITY_DESCRIPTOR psd, const char *fname,
- unsigned *id, char *nm, int what)
+get_name_and_id (PSECURITY_DESCRIPTOR psd, unsigned *id, char *nm, int what)
{
PSID sid = NULL;
char machine[MAX_COMPUTERNAME_LENGTH+1];
@@ -3438,7 +3655,6 @@ get_name_and_id (PSECURITY_DESCRIPTOR psd, const char *fname,
DWORD name_len = sizeof (name);
char domain[1024];
DWORD domain_len = sizeof (domain);
- char *mp = NULL;
int use_dflt = 0;
int result;
@@ -3453,22 +3669,7 @@ get_name_and_id (PSECURITY_DESCRIPTOR psd, const char *fname,
use_dflt = 1;
else if (!w32_cached_id (sid, id, nm))
{
- /* If FNAME is a UNC, we need to lookup account on the
- specified machine. */
- if (IS_DIRECTORY_SEP (fname[0]) && IS_DIRECTORY_SEP (fname[1])
- && fname[2] != '\0')
- {
- const char *s;
- char *p;
-
- for (s = fname + 2, p = machine;
- *s && !IS_DIRECTORY_SEP (*s); s++, p++)
- *p = *s;
- *p = '\0';
- mp = machine;
- }
-
- if (!lookup_account_sid (mp, sid, name, &name_len,
+ if (!lookup_account_sid (NULL, sid, name, &name_len,
domain, &domain_len, &ignore)
|| name_len > UNLEN+1)
use_dflt = 1;
@@ -3483,9 +3684,7 @@ get_name_and_id (PSECURITY_DESCRIPTOR psd, const char *fname,
}
static void
-get_file_owner_and_group (PSECURITY_DESCRIPTOR psd,
- const char *fname,
- struct stat *st)
+get_file_owner_and_group (PSECURITY_DESCRIPTOR psd, struct stat *st)
{
int dflt_usr = 0, dflt_grp = 0;
@@ -3496,9 +3695,9 @@ get_file_owner_and_group (PSECURITY_DESCRIPTOR psd,
}
else
{
- if (get_name_and_id (psd, fname, &st->st_uid, st->st_uname, UID))
+ if (get_name_and_id (psd, &st->st_uid, st->st_uname, UID))
dflt_usr = 1;
- if (get_name_and_id (psd, fname, &st->st_gid, st->st_gname, GID))
+ if (get_name_and_id (psd, &st->st_gid, st->st_gname, GID))
dflt_grp = 1;
}
/* Consider files to belong to current user/group, if we cannot get
@@ -3722,23 +3921,23 @@ stat_worker (const char * path, struct stat * buf, int follow_symlinks)
If getting security by handle fails, and we don't need to
resolve symlinks, we try getting security by name. */
if (!w32_stat_get_owner_group || is_windows_9x () == TRUE)
- get_file_owner_and_group (NULL, name, buf);
+ get_file_owner_and_group (NULL, buf);
else
{
psd = get_file_security_desc_by_handle (fh);
if (psd)
{
- get_file_owner_and_group (psd, name, buf);
+ get_file_owner_and_group (psd, buf);
LocalFree (psd);
}
else if (!(is_a_symlink && follow_symlinks))
{
psd = get_file_security_desc_by_name (name);
- get_file_owner_and_group (psd, name, buf);
+ get_file_owner_and_group (psd, buf);
xfree (psd);
}
else
- get_file_owner_and_group (NULL, name, buf);
+ get_file_owner_and_group (NULL, buf);
}
CloseHandle (fh);
}
@@ -3847,7 +4046,7 @@ stat_worker (const char * path, struct stat * buf, int follow_symlinks)
else
buf->st_mode = S_IFREG;
- get_file_owner_and_group (NULL, name, buf);
+ get_file_owner_and_group (NULL, buf);
}
#if 0
@@ -4301,7 +4500,7 @@ readlink (const char *name, char *buf, size_t buf_size)
errno = EINVAL;
else
{
- /* Copy the link target name, in wide characters, fro
+ /* Copy the link target name, in wide characters, from
reparse_data, then convert it to multibyte encoding in
the current locale's codepage. */
WCHAR *lwname;
@@ -4477,6 +4676,239 @@ chase_symlinks (const char *file)
return target;
}
+
+/* Posix ACL emulation. */
+
+int
+acl_valid (acl_t acl)
+{
+ return is_valid_security_descriptor ((PSECURITY_DESCRIPTOR)acl) ? 0 : -1;
+}
+
+char *
+acl_to_text (acl_t acl, ssize_t *size)
+{
+ LPTSTR str_acl;
+ SECURITY_INFORMATION flags =
+ OWNER_SECURITY_INFORMATION |
+ GROUP_SECURITY_INFORMATION |
+ DACL_SECURITY_INFORMATION;
+ char *retval = NULL;
+ ULONG local_size;
+ int e = errno;
+
+ errno = 0;
+
+ if (convert_sd_to_sddl ((PSECURITY_DESCRIPTOR)acl, SDDL_REVISION_1, flags, &str_acl, &local_size))
+ {
+ errno = e;
+ /* We don't want to mix heaps, so we duplicate the string in our
+ heap and free the one allocated by the API. */
+ retval = xstrdup (str_acl);
+ if (size)
+ *size = local_size;
+ LocalFree (str_acl);
+ }
+ else if (errno != ENOTSUP)
+ errno = EINVAL;
+
+ return retval;
+}
+
+acl_t
+acl_from_text (const char *acl_str)
+{
+ PSECURITY_DESCRIPTOR psd, retval = NULL;
+ ULONG sd_size;
+ int e = errno;
+
+ errno = 0;
+
+ if (convert_sddl_to_sd (acl_str, SDDL_REVISION_1, &psd, &sd_size))
+ {
+ errno = e;
+ retval = xmalloc (sd_size);
+ memcpy (retval, psd, sd_size);
+ LocalFree (psd);
+ }
+ else if (errno != ENOTSUP)
+ errno = EINVAL;
+
+ return retval;
+}
+
+int
+acl_free (void *ptr)
+{
+ xfree (ptr);
+ return 0;
+}
+
+acl_t
+acl_get_file (const char *fname, acl_type_t type)
+{
+ PSECURITY_DESCRIPTOR psd = NULL;
+ const char *filename;
+
+ if (type == ACL_TYPE_ACCESS)
+ {
+ DWORD sd_len, err;
+ SECURITY_INFORMATION si =
+ OWNER_SECURITY_INFORMATION |
+ GROUP_SECURITY_INFORMATION |
+ DACL_SECURITY_INFORMATION ;
+ int e = errno;
+
+ filename = map_w32_filename (fname, NULL);
+ if ((volume_info.flags & FILE_SUPPORTS_REPARSE_POINTS) != 0)
+ fname = chase_symlinks (filename);
+ else
+ fname = filename;
+
+ errno = 0;
+ if (!get_file_security (fname, si, psd, 0, &sd_len)
+ && errno != ENOTSUP)
+ {
+ err = GetLastError ();
+ if (err == ERROR_INSUFFICIENT_BUFFER)
+ {
+ psd = xmalloc (sd_len);
+ if (!get_file_security (fname, si, psd, sd_len, &sd_len))
+ {
+ xfree (psd);
+ errno = EIO;
+ psd = NULL;
+ }
+ }
+ else if (err == ERROR_FILE_NOT_FOUND
+ || err == ERROR_PATH_NOT_FOUND)
+ errno = ENOENT;
+ else
+ errno = EIO;
+ }
+ else if (!errno)
+ errno = e;
+ }
+ else if (type != ACL_TYPE_DEFAULT)
+ errno = EINVAL;
+
+ return psd;
+}
+
+int
+acl_set_file (const char *fname, acl_type_t type, acl_t acl)
+{
+ TOKEN_PRIVILEGES old1, old2;
+ DWORD err;
+ BOOL res;
+ int st = 0, retval = -1;
+ SECURITY_INFORMATION flags = 0;
+ PSID psid;
+ PACL pacl;
+ BOOL dflt;
+ BOOL dacl_present;
+ int e;
+ const char *filename;
+
+ if (acl_valid (acl) != 0
+ || (type != ACL_TYPE_DEFAULT && type != ACL_TYPE_ACCESS))
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
+ if (type == ACL_TYPE_DEFAULT)
+ {
+ errno = ENOSYS;
+ return -1;
+ }
+
+ filename = map_w32_filename (fname, NULL);
+ if ((volume_info.flags & FILE_SUPPORTS_REPARSE_POINTS) != 0)
+ fname = chase_symlinks (filename);
+ else
+ fname = filename;
+
+ if (get_security_descriptor_owner ((PSECURITY_DESCRIPTOR)acl, &psid, &dflt)
+ && psid)
+ flags |= OWNER_SECURITY_INFORMATION;
+ if (get_security_descriptor_group ((PSECURITY_DESCRIPTOR)acl, &psid, &dflt)
+ && psid)
+ flags |= GROUP_SECURITY_INFORMATION;
+ if (get_security_descriptor_dacl ((PSECURITY_DESCRIPTOR)acl, &dacl_present,
+ &pacl, &dflt)
+ && dacl_present)
+ flags |= DACL_SECURITY_INFORMATION;
+ if (!flags)
+ return 0;
+
+ /* According to KB-245153, setting the owner will succeed if either:
+ (1) the caller is the user who will be the new owner, and has the
+ SE_TAKE_OWNERSHIP privilege, or
+ (2) the caller has the SE_RESTORE privilege, in which case she can
+ set any valid user or group as the owner
+
+ We request below both SE_TAKE_OWNERSHIP and SE_RESTORE
+ privileges, and disregard any failures in obtaining them. If
+ these privileges cannot be obtained, and do not already exist in
+ the calling thread's security token, this function could fail
+ with EPERM. */
+ if (enable_privilege (SE_TAKE_OWNERSHIP_NAME, TRUE, &old1))
+ st++;
+ if (enable_privilege (SE_RESTORE_NAME, TRUE, &old2))
+ st++;
+
+ e = errno;
+ errno = 0;
+ set_file_security ((char *)fname, flags, (PSECURITY_DESCRIPTOR)acl);
+ err = GetLastError ();
+ if (st)
+ {
+ if (st >= 2)
+ restore_privilege (&old2);
+ restore_privilege (&old1);
+ revert_to_self ();
+ }
+
+ if (errno == ENOTSUP)
+ ;
+ else if (err == ERROR_SUCCESS)
+ {
+ retval = 0;
+ errno = e;
+ }
+ else if (err == ERROR_INVALID_OWNER || err == ERROR_NOT_ALL_ASSIGNED)
+ {
+ /* Maybe the requested ACL and the one the file already has are
+ identical, in which case we can silently ignore the
+ failure. (And no, Windows doesn't.) */
+ acl_t current_acl = acl_get_file (fname, ACL_TYPE_ACCESS);
+
+ errno = EPERM;
+ if (current_acl)
+ {
+ char *acl_from = acl_to_text (current_acl, NULL);
+ char *acl_to = acl_to_text (acl, NULL);
+
+ if (acl_from && acl_to && xstrcasecmp (acl_from, acl_to) == 0)
+ {
+ retval = 0;
+ errno = e;
+ }
+ if (acl_from)
+ acl_free (acl_from);
+ if (acl_to)
+ acl_free (acl_to);
+ acl_free (current_acl);
+ }
+ }
+ else if (err == ERROR_FILE_NOT_FOUND || err == ERROR_PATH_NOT_FOUND)
+ errno = ENOENT;
+
+ return retval;
+}
+
+
/* MS-Windows version of careadlinkat (cf. ../lib/careadlinkat.c). We
have a fixed max size for file names, so we don't need the kind of
alloc/malloc/realloc dance the gnulib version does. We also don't
@@ -5993,7 +6425,21 @@ sys_close (int fd)
winsock_inuse--; /* count open sockets */
}
- delete_child (cp);
+ /* If the process handle is NULL, it's either a socket
+ or serial connection, or a subprocess that was
+ already reaped by reap_subprocess, but whose
+ resources were not yet freed, because its output was
+ not fully read yet by the time it was reaped. (This
+ usually happens with async subprocesses whose output
+ is being read by Emacs.) Otherwise, this process was
+ not reaped yet, so we set its FD to a negative value
+ to make sure sys_select will eventually get to
+ calling the SIGCHLD handler for it, which will then
+ invoke waitpid and reap_subprocess. */
+ if (cp->procinfo.hProcess == NULL)
+ delete_child (cp);
+ else
+ cp->fd = -1;
}
}
}
@@ -6848,6 +7294,11 @@ globals_of_w32 (void)
g_b_init_get_native_system_info = 0;
g_b_init_get_system_times = 0;
g_b_init_create_symbolic_link = 0;
+ g_b_init_get_security_descriptor_dacl = 0;
+ g_b_init_convert_sd_to_sddl = 0;
+ g_b_init_convert_sddl_to_sd = 0;
+ g_b_init_is_valid_security_descriptor = 0;
+ g_b_init_set_file_security = 0;
num_of_processors = 0;
/* The following sets a handler for shutdown notifications for
console apps. This actually applies to Emacs in both console and
diff --git a/src/w32.h b/src/w32.h
index a43a5133eb4..895e7f31d63 100644
--- a/src/w32.h
+++ b/src/w32.h
@@ -2,7 +2,7 @@
#define EMACS_W32_H
/* Support routines for the NT version of Emacs.
- Copyright (C) 1994, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1994, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/w32common.h b/src/w32common.h
index 5e9b61824ae..79fe5cc367c 100644
--- a/src/w32common.h
+++ b/src/w32common.h
@@ -1,5 +1,5 @@
/* Common functions for Microsoft Windows builds of Emacs
- Copyright (C) 2012 Free Software Foundation, Inc.
+ Copyright (C) 2012-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/w32console.c b/src/w32console.c
index f201ff190c2..06b2c7aa24e 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -1,5 +1,5 @@
/* Terminal hooks for GNU Emacs on the Microsoft Windows API.
- Copyright (C) 1992, 1999, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1999, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/w32fns.c b/src/w32fns.c
index f69fbe05a6d..355ee96b9f3 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -1,6 +1,6 @@
/* Graphical user interface functions for the Microsoft Windows API.
-Copyright (C) 1989, 1992-2012 Free Software Foundation, Inc.
+Copyright (C) 1989, 1992-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/w32font.c b/src/w32font.c
index d7d25d89939..5c5a15cc340 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -1,5 +1,5 @@
/* Font backend for the Microsoft Windows API.
- Copyright (C) 2007-2012 Free Software Foundation, Inc.
+ Copyright (C) 2007-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/w32font.h b/src/w32font.h
index 8fa00a9b524..b4345478a22 100644
--- a/src/w32font.h
+++ b/src/w32font.h
@@ -1,5 +1,5 @@
/* Shared GDI and Uniscribe Font backend declarations for the Windows API.
- Copyright (C) 2007-2012 Free Software Foundation, Inc.
+ Copyright (C) 2007-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/w32gui.h b/src/w32gui.h
index fe2bb2334b5..739ff3c92e9 100644
--- a/src/w32gui.h
+++ b/src/w32gui.h
@@ -1,5 +1,5 @@
/* Definitions and headers for communication on the Microsoft Windows API.
- Copyright (C) 1995, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/w32heap.c b/src/w32heap.c
index 311e1064434..9c189dbda6d 100644
--- a/src/w32heap.c
+++ b/src/w32heap.c
@@ -1,5 +1,5 @@
/* Heap management routines for GNU Emacs on the Microsoft Windows API.
- Copyright (C) 1994, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1994, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/w32heap.h b/src/w32heap.h
index 1630864875f..82b59dd027f 100644
--- a/src/w32heap.h
+++ b/src/w32heap.h
@@ -1,5 +1,5 @@
/* Heap management routines (including unexec) for GNU Emacs on Windows NT.
- Copyright (C) 1994, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1994, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/w32inevt.c b/src/w32inevt.c
index 2cbf31efda3..3c38cf806e8 100644
--- a/src/w32inevt.c
+++ b/src/w32inevt.c
@@ -1,5 +1,6 @@
/* Input event support for Emacs on the Microsoft Windows API.
- Copyright (C) 1992-1993, 1995, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1992-1993, 1995, 2001-2013 Free Software Foundation,
+ Inc.
This file is part of GNU Emacs.
diff --git a/src/w32inevt.h b/src/w32inevt.h
index 319688b877b..8a7e4fed06a 100644
--- a/src/w32inevt.h
+++ b/src/w32inevt.h
@@ -1,5 +1,5 @@
/* Input routines for GNU Emacs on the Microsoft Windows API.
- Copyright (C) 1995, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/w32menu.c b/src/w32menu.c
index 84fb1bdc71e..03904cf20b8 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -1,6 +1,6 @@
/* Menu support for GNU Emacs on the Microsoft Windows API.
- Copyright (C) 1986, 1988, 1993-1994, 1996, 1998-1999, 2001-2012
- Free Software Foundation, Inc.
+ Copyright (C) 1986, 1988, 1993-1994, 1996, 1998-1999, 2001-2013 Free
+ Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/w32notify.c b/src/w32notify.c
index 0b7dc9a1110..d78e55f43ed 100644
--- a/src/w32notify.c
+++ b/src/w32notify.c
@@ -1,5 +1,5 @@
/* Filesystem notifications support for GNU Emacs on the Microsoft Windows API.
- Copyright (C) 2012 Free Software Foundation, Inc.
+ Copyright (C) 2012-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/w32proc.c b/src/w32proc.c
index 43ecf4d68f3..0fcb2993020 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -1,5 +1,5 @@
/* Process support for GNU Emacs on the Microsoft Windows API.
- Copyright (C) 1992, 1995, 1999-2012 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1995, 1999-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -800,7 +800,7 @@ new_child (void)
DWORD id;
for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--)
- if (!CHILD_ACTIVE (cp))
+ if (!CHILD_ACTIVE (cp) && cp->procinfo.hProcess == NULL)
goto Initialize;
if (child_proc_count == MAX_CHILDREN)
return NULL;
@@ -859,7 +859,7 @@ delete_child (child_process *cp)
if (fd_info[i].cp == cp)
emacs_abort ();
- if (!CHILD_ACTIVE (cp))
+ if (!CHILD_ACTIVE (cp) && cp->procinfo.hProcess == NULL)
return;
/* Delete the child's temporary input file, if any, that is pending
@@ -918,7 +918,8 @@ delete_child (child_process *cp)
if (cp == child_procs + child_proc_count - 1)
{
for (i = child_proc_count-1; i >= 0; i--)
- if (CHILD_ACTIVE (&child_procs[i]))
+ if (CHILD_ACTIVE (&child_procs[i])
+ || child_procs[i].procinfo.hProcess != NULL)
{
child_proc_count = i + 1;
break;
@@ -935,7 +936,8 @@ find_child_pid (DWORD pid)
child_process *cp;
for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--)
- if (CHILD_ACTIVE (cp) && pid == cp->pid)
+ if ((CHILD_ACTIVE (cp) || cp->procinfo.hProcess != NULL)
+ && pid == cp->pid)
return cp;
return NULL;
}
@@ -963,11 +965,16 @@ reader_thread (void *arg)
{
int rc;
- if (fd_info[cp->fd].flags & FILE_LISTEN)
+ if (cp->fd >= 0 && fd_info[cp->fd].flags & FILE_LISTEN)
rc = _sys_wait_accept (cp->fd);
else
rc = _sys_read_ahead (cp->fd);
+ /* Don't bother waiting for the event if we already have been
+ told to exit by delete_child. */
+ if (cp->status == STATUS_READ_ERROR || !cp->char_avail)
+ break;
+
/* The name char_avail is a misnomer - it really just means the
read-ahead has completed, whether successfully or not. */
if (!SetEvent (cp->char_avail))
@@ -984,6 +991,11 @@ reader_thread (void *arg)
if (rc == STATUS_READ_FAILED)
break;
+ /* Don't bother waiting for the acknowledge if we already have
+ been told to exit by delete_child. */
+ if (cp->status == STATUS_READ_ERROR || !cp->char_consumed)
+ break;
+
/* Wait until our input is acknowledged before reading again */
if (WaitForSingleObject (cp->char_consumed, INFINITE) != WAIT_OBJECT_0)
{
@@ -991,6 +1003,10 @@ reader_thread (void *arg)
"%lu for fd %ld\n", GetLastError (), cp->fd));
break;
}
+ /* delete_child sets status to STATUS_READ_ERROR when it wants
+ us to exit. */
+ if (cp->status == STATUS_READ_ERROR)
+ break;
}
return 0;
}
@@ -1161,11 +1177,11 @@ reap_subprocess (child_process *cp)
cp->procinfo.hThread = NULL;
}
- /* For asynchronous children, the child_proc resources will be freed
- when the last pipe read descriptor is closed; for synchronous
- children, we must explicitly free the resources now because
- register_child has not been called. */
- if (cp->fd == -1)
+ /* If cp->fd was not closed yet, we might be still reading the
+ process output, so don't free its resources just yet. The call
+ to delete_child on behalf of this subprocess will be made by
+ sys_read when the subprocess output is fully read. */
+ if (cp->fd < 0)
delete_child (cp);
}
diff --git a/src/w32reg.c b/src/w32reg.c
index 8b6c76503a6..e7c4e9ea351 100644
--- a/src/w32reg.c
+++ b/src/w32reg.c
@@ -1,5 +1,6 @@
/* Emulate the X Resource Manager through the registry.
- Copyright (C) 1990, 1993-1994, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1990, 1993-1994, 2001-2013 Free Software Foundation,
+ Inc.
This file is part of GNU Emacs.
diff --git a/src/w32select.c b/src/w32select.c
index 6a2a840f914..3c966595d6d 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -1,6 +1,6 @@
/* Selection processing for Emacs on the Microsoft Windows API.
-Copyright (C) 1993-1994, 2001-2012 Free Software Foundation, Inc.
+Copyright (C) 1993-1994, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/w32select.h b/src/w32select.h
index 4f4de59f7fe..f6223b881d2 100644
--- a/src/w32select.h
+++ b/src/w32select.h
@@ -1,6 +1,6 @@
/* Selection processing for Emacs on the Microsoft W32 API.
-Copyright (C) 1993-1994, 2001-2012 Free Software Foundation, Inc.
+Copyright (C) 1993-1994, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/w32term.c b/src/w32term.c
index 7c53097e313..36ae4d7797f 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -1,6 +1,6 @@
/* Implementation of GUI terminal on the Microsoft Windows API.
-Copyright (C) 1989, 1993-2012 Free Software Foundation, Inc.
+Copyright (C) 1989, 1993-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -358,7 +358,7 @@ w32_restore_glyph_string_clip (struct glyph_string *s)
void
w32_draw_underwave (struct glyph_string *s, COLORREF color)
{
- int wave_height = 2, wave_length = 3;
+ int wave_height = 3, wave_length = 2;
int dx, dy, x0, y0, width, x1, y1, x2, y2, odd, xmax;
XRectangle wave_clip, string_clip, final_clip;
RECT w32_final_clip, w32_string_clip;
@@ -367,7 +367,7 @@ w32_draw_underwave (struct glyph_string *s, COLORREF color)
dx = wave_length;
dy = wave_height - 1;
x0 = s->x;
- y0 = s->ybase + 1;
+ y0 = s->ybase - wave_height + 3;
width = s->width;
xmax = x0 + width;
@@ -2456,7 +2456,8 @@ x_draw_glyph_string (struct glyph_string *s)
unsigned long thickness, position;
int y;
- if (s->prev && s->prev->face->underline_p)
+ if (s->prev && s->prev->face->underline_p
+ && s->prev->face->underline_type == FACE_UNDER_LINE)
{
/* We use the same underline style as the previous one. */
thickness = s->prev->underline_thickness;
@@ -5648,6 +5649,77 @@ x_check_fullscreen (struct frame *f)
}
}
+static void
+w32fullscreen_hook (FRAME_PTR f)
+{
+ static int normal_width, normal_height, normal_top, normal_left;
+
+ if (f->async_visible)
+ {
+ int width, height, top_pos, left_pos, pixel_height, pixel_width;
+ int cur_w = FRAME_COLS (f), cur_h = FRAME_LINES (f);
+ RECT workarea_rect;
+
+ block_input ();
+ if (normal_height <= 0)
+ normal_height = cur_h;
+ if (normal_width <= 0)
+ normal_width = cur_w;
+ x_real_positions (f, &f->left_pos, &f->top_pos);
+ x_fullscreen_adjust (f, &width, &height, &top_pos, &left_pos);
+
+ SystemParametersInfo (SPI_GETWORKAREA, 0, &workarea_rect, 0);
+ pixel_height = workarea_rect.bottom - workarea_rect.top;
+ pixel_width = workarea_rect.right - workarea_rect.left;
+
+ switch (f->want_fullscreen)
+ {
+ /* No difference between these two when there is no WM */
+ case FULLSCREEN_MAXIMIZED:
+ PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, 0xf030, 0);
+ break;
+ case FULLSCREEN_BOTH:
+ height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixel_height) - 2;
+ width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixel_width);
+ left_pos = workarea_rect.left;
+ top_pos = workarea_rect.top;
+ break;
+ case FULLSCREEN_WIDTH:
+ width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixel_width);
+ if (normal_height > 0)
+ height = normal_height;
+ left_pos = workarea_rect.left;
+ break;
+ case FULLSCREEN_HEIGHT:
+ height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixel_height) - 2;
+ if (normal_width > 0)
+ width = normal_width;
+ top_pos = workarea_rect.top;
+ break;
+ case FULLSCREEN_NONE:
+ if (normal_height > 0)
+ height = normal_height;
+ else
+ normal_height = height;
+ if (normal_width > 0)
+ width = normal_width;
+ else
+ normal_width = width;
+ /* FIXME: Should restore the original position of the frame. */
+ top_pos = left_pos = 0;
+ break;
+ }
+
+ if (cur_w != width || cur_h != height)
+ {
+ x_set_offset (f, left_pos, top_pos, 1);
+ x_set_window_size (f, 1, width, height);
+ do_pending_window_change (0);
+ }
+ unblock_input ();
+ }
+}
+
/* Call this to change the size of frame F's x-window.
If CHANGE_GRAVITY is 1, we change to top-left-corner window gravity
for this size change and subsequent size changes.
@@ -6338,7 +6410,7 @@ w32_create_terminal (struct w32_display_info *dpyinfo)
terminal->mouse_position_hook = w32_mouse_position;
terminal->frame_rehighlight_hook = w32_frame_rehighlight;
terminal->frame_raise_lower_hook = w32_frame_raise_lower;
- /* terminal->fullscreen_hook = XTfullscreen_hook; */
+ terminal->fullscreen_hook = w32fullscreen_hook;
terminal->set_vertical_scroll_bar_hook = w32_set_vertical_scroll_bar;
terminal->condemn_scroll_bars_hook = w32_condemn_scroll_bars;
terminal->redeem_scroll_bar_hook = w32_redeem_scroll_bar;
diff --git a/src/w32term.h b/src/w32term.h
index 35842e60c16..7154d549f21 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -1,5 +1,5 @@
/* Definitions and headers for communication on the Microsoft Windows API.
- Copyright (C) 1995, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c
index 5d160b9d42f..88227487d35 100644
--- a/src/w32uniscribe.c
+++ b/src/w32uniscribe.c
@@ -1,5 +1,5 @@
/* Font backend for the Microsoft W32 Uniscribe API.
- Copyright (C) 2008-2012 Free Software Foundation, Inc.
+ Copyright (C) 2008-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/w32xfns.c b/src/w32xfns.c
index 8820edda6c2..03611e19768 100644
--- a/src/w32xfns.c
+++ b/src/w32xfns.c
@@ -1,5 +1,6 @@
/* Functions taken directly from X sources for use with the Microsoft Windows API.
- Copyright (C) 1989, 1992-1995, 1999, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1989, 1992-1995, 1999, 2001-2013 Free Software
+ Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/widget.c b/src/widget.c
index b4f7335c652..28e9fc29a91 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -1,5 +1,5 @@
/* The emacs frame widget.
- Copyright (C) 1992-1993, 2000-2012 Free Software Foundation, Inc.
+ Copyright (C) 1992-1993, 2000-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/widget.h b/src/widget.h
index 03838a01415..e04c31c259b 100644
--- a/src/widget.h
+++ b/src/widget.h
@@ -1,5 +1,5 @@
/* The emacs frame widget public header file.
- Copyright (C) 1993, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1993, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/widgetprv.h b/src/widgetprv.h
index 00e3eeb1ee1..b617654e7f2 100644
--- a/src/widgetprv.h
+++ b/src/widgetprv.h
@@ -1,5 +1,5 @@
/* The emacs frame widget private header file.
- Copyright (C) 1993, 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 1993, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/window.c b/src/window.c
index 7fa55df3c5e..71d8eb7f778 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1,7 +1,7 @@
/* Window creation, deletion and examination for GNU Emacs.
Does not include redisplay.
- Copyright (C) 1985-1987, 1993-1998, 2000-2012
- Free Software Foundation, Inc.
+ Copyright (C) 1985-1987, 1993-1998, 2000-2013 Free Software
+ Foundation, Inc.
This file is part of GNU Emacs.
@@ -87,6 +87,7 @@ static Lisp_Object window_list_1 (Lisp_Object, Lisp_Object, Lisp_Object);
static int window_resize_check (struct window *, int);
static void window_resize_apply (struct window *, int);
static Lisp_Object select_window (Lisp_Object, Lisp_Object, int);
+static void select_window_1 (Lisp_Object, bool);
/* This is the window in which the terminal's cursor should
be left when nothing is being done with it. This must
@@ -280,7 +281,7 @@ adjust_window_count (struct window *w, int arg)
if (BUFFERP (w->buffer))
{
struct buffer *b = XBUFFER (w->buffer);
-
+
if (b->base_buffer)
b = b->base_buffer;
b->window_count += arg;
@@ -487,7 +488,6 @@ static Lisp_Object
select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
{
register struct window *w;
- register struct window *ow;
struct frame *sf;
CHECK_LIVE_WINDOW (window);
@@ -523,12 +523,25 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
else
fset_selected_window (sf, window);
+ select_window_1 (window, inhibit_point_swap);
+
+ bset_last_selected_window (XBUFFER (w->buffer), window);
+ windows_or_buffers_changed++;
+ return window;
+}
+
+/* Select window with a minimum of fuss, i.e. don't record the change anywhere
+ (not even for redisplay's benefit), and assume that the window's frame is
+ already selected. */
+static void
+select_window_1 (Lisp_Object window, bool inhibit_point_swap)
+{
/* 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);
+ struct window *ow = XWINDOW (selected_window);
if (! NILP (ow->buffer))
set_marker_both (ow->pointm, ow->buffer,
BUF_PT (XBUFFER (ow->buffer)),
@@ -536,7 +549,6 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
}
selected_window = window;
- bset_last_selected_window (XBUFFER (w->buffer), window);
/* Go to the point recorded in the window.
This is important when the buffer is in more
@@ -544,7 +556,7 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
redisplay_window has altered point after scrolling,
because it makes the change only in the window. */
{
- register ptrdiff_t new_point = marker_position (w->pointm);
+ register ptrdiff_t new_point = marker_position (XWINDOW (window)->pointm);
if (new_point < BEGV)
SET_PT (BEGV);
else if (new_point > ZV)
@@ -552,15 +564,14 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
else
SET_PT (new_point);
}
-
- windows_or_buffers_changed++;
- return window;
}
DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0,
- doc: /* Select WINDOW. Most editing will apply to WINDOW's buffer.
-Also make WINDOW's buffer current and make WINDOW the frame's selected
-window. Return WINDOW.
+ doc: /* Select WINDOW which must be a live window.
+Also make WINDOW's frame the selected frame and WINDOW that frame's
+selected window. In addition, make WINDOW's buffer current and set that
+buffer's value of `point' to the value of WINDOW's `window-point'.
+Return WINDOW.
Optional second arg NORECORD non-nil means do not put this buffer at the
front of the buffer list and do not make this window the most recently
@@ -791,12 +802,12 @@ window_body_cols (struct window *w)
occupies one column only. */
width -= 1;
+ /* Display margins cannot be used for normal text. */
+ width -= WINDOW_LEFT_MARGIN_COLS (w) + WINDOW_RIGHT_MARGIN_COLS (w);
+
if (FRAME_WINDOW_P (f))
- /* On window-systems, fringes and display margins cannot be
- used for normal text. */
- width -= (WINDOW_FRINGE_COLS (w)
- + WINDOW_LEFT_MARGIN_COLS (w)
- + WINDOW_RIGHT_MARGIN_COLS (w));
+ /* On window-systems, fringes cannot be used for normal text. */
+ width -= WINDOW_FRINGE_COLS (w);
return width;
}
diff --git a/src/window.h b/src/window.h
index f4f42a25af4..1ebd35a7c64 100644
--- a/src/window.h
+++ b/src/window.h
@@ -1,6 +1,6 @@
/* Window definitions for GNU Emacs.
- Copyright (C) 1985-1986, 1993, 1995, 1997-2012
- Free Software Foundation, Inc.
+ Copyright (C) 1985-1986, 1993, 1995, 1997-2013 Free Software
+ Foundation, Inc.
This file is part of GNU Emacs.
@@ -261,7 +261,7 @@ struct window
EMACS_INT last_overlay_modified;
/* Value of point at that time. Since this is a position in a buffer,
- it should be positive. */
+ it should be positive. */
ptrdiff_t last_point;
/* Scaling factor for the glyph_matrix size calculation in this window.
@@ -290,7 +290,7 @@ struct window
/* Non-zero if this window is a minibuffer window. */
unsigned mini : 1;
- /* Non-zero means must regenerate mode line of this window */
+ /* Non-zero means must regenerate mode line of this window. */
unsigned update_mode_line : 1;
/* Non-nil if the buffer was "modified" when the window
@@ -343,7 +343,7 @@ struct window
y-direction (smooth scrolling). */
int vscroll;
- /* Z_BYTE - the buffer position of the last glyph in the current matrix of W.
+ /* Z_BYTE - Buffer position of the last glyph in the current matrix of W.
Should be nonnegative, and only valid if window_end_valid is not nil. */
ptrdiff_t window_end_bytepos;
};
@@ -934,7 +934,7 @@ extern EMACS_INT minibuf_level;
extern int update_mode_lines;
/* Nonzero if window sizes or contents have changed since last
- redisplay that finished */
+ redisplay that finished. */
extern int windows_or_buffers_changed;
diff --git a/src/xdisp.c b/src/xdisp.c
index f7fc75f8c25..b75362b1446 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1,6 +1,7 @@
/* Display generation from window structure and buffer text.
-Copyright (C) 1985-1988, 1993-1995, 1997-2012 Free Software Foundation, Inc.
+Copyright (C) 1985-1988, 1993-1995, 1997-2013 Free Software Foundation,
+Inc.
This file is part of GNU Emacs.
@@ -869,7 +870,6 @@ static void push_it (struct it *, struct text_pos *);
static void iterate_out_of_display_property (struct it *);
static void pop_it (struct it *);
static void sync_frame_with_window_matrix_rows (struct window *);
-static void select_frame_for_redisplay (Lisp_Object);
static void redisplay_internal (void);
static int echo_area_display (int);
static void redisplay_windows (Lisp_Object);
@@ -1330,7 +1330,7 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
BVAR (current_buffer, header_line_format));
start_display (&it, w, top);
- move_it_to (&it, charpos, -1, it.last_visible_y-1, -1,
+ move_it_to (&it, charpos, -1, it.last_visible_y - 1, -1,
(charpos >= 0 ? MOVE_TO_POS : 0) | MOVE_TO_Y);
if (charpos >= 0
@@ -1338,7 +1338,7 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
&& IT_CHARPOS (it) >= charpos)
/* When scanning backwards under bidi iteration, move_it_to
stops at or _before_ CHARPOS, because it stops at or to
- the _right_ of the character at CHARPOS. */
+ the _right_ of the character at CHARPOS. */
|| (it.bidi_p && it.bidi_it.scan_dir == -1
&& IT_CHARPOS (it) <= charpos)))
{
@@ -9398,7 +9398,8 @@ message_dolog (const char *m, ptrdiff_t nbytes, int nlflag, int multibyte)
int old_windows_or_buffers_changed = windows_or_buffers_changed;
ptrdiff_t point_at_end = 0;
ptrdiff_t zv_at_end = 0;
- Lisp_Object old_deactivate_mark, tem;
+ Lisp_Object old_deactivate_mark;
+ bool shown;
struct gcpro gcpro1;
old_deactivate_mark = Vdeactivate_mark;
@@ -9540,9 +9541,9 @@ message_dolog (const char *m, ptrdiff_t nbytes, int nlflag, int multibyte)
unchain_marker (XMARKER (oldbegv));
unchain_marker (XMARKER (oldzv));
- tem = Fget_buffer_window (Fcurrent_buffer (), Qt);
+ shown = buffer_window_count (current_buffer) > 0;
set_buffer_internal (oldbuf);
- if (NILP (tem))
+ if (!shown)
windows_or_buffers_changed = old_windows_or_buffers_changed;
message_log_need_newline = !nlflag;
Vdeactivate_mark = old_deactivate_mark;
@@ -12952,47 +12953,6 @@ reconsider_clip_changes (struct window *w, struct buffer *b)
}
-/* Select FRAME to forward the values of frame-local variables into C
- variables so that the redisplay routines can access those values
- directly. */
-
-static void
-select_frame_for_redisplay (Lisp_Object frame)
-{
- Lisp_Object tail, tem;
- Lisp_Object old = selected_frame;
- struct Lisp_Symbol *sym;
-
- eassert (FRAMEP (frame) && FRAME_LIVE_P (XFRAME (frame)));
-
- selected_frame = frame;
- selected_window = XFRAME (frame)->selected_window;
-
- do {
- for (tail = XFRAME (frame)->param_alist;
- CONSP (tail); tail = XCDR (tail))
- if (CONSP (XCAR (tail))
- && (tem = XCAR (XCAR (tail)),
- SYMBOLP (tem))
- && (sym = indirect_variable (XSYMBOL (tem)),
- sym->redirect == SYMBOL_LOCALIZED)
- && sym->val.blv->frame_local)
- /* Use find_symbol_value rather than Fsymbol_value
- to avoid an error if it is void. */
- find_symbol_value (tem);
- } while (!EQ (frame, old) && (frame = old, 1));
-}
-
-/* Make sure that previously selected OLD_FRAME is selected unless it has been
- deleted (by an X connection failure during redisplay, for example). */
-
-static void
-ensure_selected_frame (Lisp_Object frame)
-{
- if (!EQ (frame, selected_frame) && FRAME_LIVE_P (XFRAME (frame)))
- select_frame_for_redisplay (frame);
-}
-
#define STOP_POLLING \
do { if (! polling_stopped_here) stop_polling (); \
polling_stopped_here = 1; } while (0)
@@ -13018,7 +12978,7 @@ redisplay_internal (void)
ptrdiff_t count, count1;
struct frame *sf;
int polling_stopped_here = 0;
- Lisp_Object tail, frame, old_frame = selected_frame;
+ Lisp_Object tail, frame;
struct backtrace backtrace;
/* Non-zero means redisplay has to consider all windows on all
@@ -13077,12 +13037,6 @@ redisplay_internal (void)
/* Remember the currently selected window. */
sw = w;
- /* When running redisplay, we play a bit fast-and-loose and allow e.g.
- selected_frame and selected_window to be temporarily out-of-sync so
- when we come back here via `goto retry', we need to resync because we
- may need to run Elisp code (via prepare_menu_bars). */
- ensure_selected_frame (old_frame);
-
pending = 0;
reconsider_clip_changes (w, current_buffer);
last_escape_glyph_frame = NULL;
@@ -13490,11 +13444,6 @@ redisplay_internal (void)
if (FRAME_WINDOW_P (f) || FRAME_TERMCAP_P (f) || f == sf)
{
- if (! EQ (frame, selected_frame))
- /* Select the frame, for the sake of frame-local
- variables. */
- select_frame_for_redisplay (frame);
-
/* Mark all the scroll bars to be removed; we'll redeem
the ones we want when we redisplay their windows. */
if (FRAME_TERMINAL (f)->condemn_scroll_bars_hook)
@@ -13544,10 +13493,6 @@ redisplay_internal (void)
}
}
- /* We played a bit fast-and-loose above and allowed selected_frame
- and selected_window to be temporarily out-of-sync but let's make
- sure this stays contained. */
- ensure_selected_frame (old_frame);
eassert (EQ (XFRAME (selected_frame)->selected_window, selected_window));
if (!pending)
@@ -13773,7 +13718,6 @@ static Lisp_Object
unwind_redisplay (Lisp_Object old_frame)
{
redisplaying_p = 0;
- ensure_selected_frame (old_frame);
return Qnil;
}
@@ -13790,8 +13734,8 @@ mark_window_display_accurate_1 (struct window *w, int accurate_p)
{
struct buffer *b = XBUFFER (w->buffer);
- w->last_modified = accurate_p ? BUF_MODIFF(b) : 0;
- w->last_overlay_modified = accurate_p ? BUF_OVERLAY_MODIFF(b) : 0;
+ w->last_modified = accurate_p ? BUF_MODIFF (b) : 0;
+ w->last_overlay_modified = accurate_p ? BUF_OVERLAY_MODIFF (b) : 0;
w->last_had_star
= BUF_MODIFF (b) > BUF_SAVE_MODIFF (b);
@@ -14246,7 +14190,12 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
CHARPOS is zero or negative. */
int empty_line_p =
(row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end)
- && INTEGERP (glyph->object) && glyph->charpos > 0;
+ && INTEGERP (glyph->object) && glyph->charpos > 0
+ /* On a TTY, continued and truncated rows also have a glyph at
+ their end whose OBJECT is zero and whose CHARPOS is
+ positive (the continuation and truncation glyphs), but such
+ rows are obviously not "empty". */
+ && !(row->continued_p || row->truncated_on_right_p);
if (row->ends_in_ellipsis_p && pos_after == last_pos)
{
@@ -15706,7 +15655,6 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
/* Some people insist on not letting point enter the scroll
margin, even though this part handles windows that didn't
scroll at all. */
- struct frame *f = XFRAME (w->frame);
int margin = min (scroll_margin, WINDOW_TOTAL_LINES (w) / 4);
int pixel_margin = margin * FRAME_LINE_HEIGHT (f);
bool header_line = WINDOW_WANTS_HEADER_LINE_P (w);
@@ -17977,18 +17925,23 @@ dump_glyph_matrix (struct glyph_matrix *matrix, int glyphs)
void
dump_glyph (struct glyph_row *row, struct glyph *glyph, int area)
{
- if (glyph->type == CHAR_GLYPH)
+ if (glyph->type == CHAR_GLYPH
+ || glyph->type == GLYPHLESS_GLYPH)
{
fprintf (stderr,
- " %5td %4c %6"pI"d %c %3d 0x%05x %c %4d %1.1d%1.1d\n",
+ " %5"pD"d %c %9"pI"d %c %3d 0x%06x %c %4d %1.1d%1.1d\n",
glyph - row->glyphs[TEXT_AREA],
- 'C',
+ (glyph->type == CHAR_GLYPH
+ ? 'C'
+ : 'G'),
glyph->charpos,
(BUFFERP (glyph->object)
? 'B'
: (STRINGP (glyph->object)
? 'S'
- : '-')),
+ : (INTEGERP (glyph->object)
+ ? '0'
+ : '-'))),
glyph->pixel_width,
glyph->u.ch,
(glyph->u.ch < 0x80 && glyph->u.ch >= ' '
@@ -18001,7 +17954,7 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area)
else if (glyph->type == STRETCH_GLYPH)
{
fprintf (stderr,
- " %5td %4c %6"pI"d %c %3d 0x%05x %c %4d %1.1d%1.1d\n",
+ " %5"pD"d %c %9"pI"d %c %3d 0x%06x %c %4d %1.1d%1.1d\n",
glyph - row->glyphs[TEXT_AREA],
'S',
glyph->charpos,
@@ -18009,10 +17962,12 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area)
? 'B'
: (STRINGP (glyph->object)
? 'S'
- : '-')),
+ : (INTEGERP (glyph->object)
+ ? '0'
+ : '-'))),
glyph->pixel_width,
0,
- '.',
+ ' ',
glyph->face_id,
glyph->left_box_line_p,
glyph->right_box_line_p);
@@ -18020,7 +17975,7 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area)
else if (glyph->type == IMAGE_GLYPH)
{
fprintf (stderr,
- " %5td %4c %6"pI"d %c %3d 0x%05x %c %4d %1.1d%1.1d\n",
+ " %5"pD"d %c %9"pI"d %c %3d 0x%06x %c %4d %1.1d%1.1d\n",
glyph - row->glyphs[TEXT_AREA],
'I',
glyph->charpos,
@@ -18028,7 +17983,9 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area)
? 'B'
: (STRINGP (glyph->object)
? 'S'
- : '-')),
+ : (INTEGERP (glyph->object)
+ ? '0'
+ : '-'))),
glyph->pixel_width,
glyph->u.img_id,
'.',
@@ -18039,7 +17996,7 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area)
else if (glyph->type == COMPOSITE_GLYPH)
{
fprintf (stderr,
- " %5td %4c %6"pI"d %c %3d 0x%05x",
+ " %5"pD"d %c %9"pI"d %c %3d 0x%06x",
glyph - row->glyphs[TEXT_AREA],
'+',
glyph->charpos,
@@ -18047,7 +18004,9 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area)
? 'B'
: (STRINGP (glyph->object)
? 'S'
- : '-')),
+ : (INTEGERP (glyph->object)
+ ? '0'
+ : '-'))),
glyph->pixel_width,
glyph->u.cmp.id);
if (glyph->u.cmp.automatic)
@@ -18072,10 +18031,10 @@ dump_glyph_row (struct glyph_row *row, int vpos, int glyphs)
{
if (glyphs != 1)
{
- fprintf (stderr, "Row Start End Used oE><\\CTZFesm X Y W H V A P\n");
- fprintf (stderr, "======================================================================\n");
+ fprintf (stderr, "Row Start End Used oE><\\CTZFesm X Y W H V A P\n");
+ fprintf (stderr, "==============================================================================\n");
- fprintf (stderr, "%3d %5"pI"d %5"pI"d %4d %1.1d%1.1d%1.1d%1.1d\
+ fprintf (stderr, "%3d %9"pI"d %9"pI"d %4d %1.1d%1.1d%1.1d%1.1d\
%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d %4d %4d %4d %4d %4d %4d %4d\n",
vpos,
MATRIX_ROW_START_CHARPOS (row),
@@ -18100,13 +18059,14 @@ dump_glyph_row (struct glyph_row *row, int vpos, int glyphs)
row->visible_height,
row->ascent,
row->phys_ascent);
- fprintf (stderr, "%9"pD"d %5"pD"d\t%5d\n", row->start.overlay_string_index,
+ /* The next 3 lines should align to "Start" in the header. */
+ fprintf (stderr, " %9"pD"d %9"pD"d\t%5d\n", row->start.overlay_string_index,
row->end.overlay_string_index,
row->continuation_lines_width);
- fprintf (stderr, "%9"pI"d %5"pI"d\n",
+ fprintf (stderr, " %9"pI"d %9"pI"d\n",
CHARPOS (row->start.string_pos),
CHARPOS (row->end.string_pos));
- fprintf (stderr, "%9d %5d\n", row->start.dpvec_index,
+ fprintf (stderr, " %9d %9d\n", row->start.dpvec_index,
row->end.dpvec_index);
}
@@ -18124,7 +18084,7 @@ dump_glyph_row (struct glyph_row *row, int vpos, int glyphs)
++glyph_end;
if (glyph < glyph_end)
- fprintf (stderr, " Glyph Type Pos O W Code C Face LR\n");
+ fprintf (stderr, " Glyph# Type Pos O W Code C Face LR\n");
for (; glyph < glyph_end; ++glyph)
dump_glyph (row, glyph, area);
@@ -18136,15 +18096,24 @@ dump_glyph_row (struct glyph_row *row, int vpos, int glyphs)
for (area = LEFT_MARGIN_AREA; area < LAST_AREA; ++area)
{
- char *s = alloca (row->used[area] + 1);
+ char *s = alloca (row->used[area] + 4);
int i;
for (i = 0; i < row->used[area]; ++i)
{
struct glyph *glyph = row->glyphs[area] + i;
- if (glyph->type == CHAR_GLYPH
- && glyph->u.ch < 0x80
- && glyph->u.ch >= ' ')
+ if (i == row->used[area] - 1
+ && area == TEXT_AREA
+ && INTEGERP (glyph->object)
+ && glyph->type == CHAR_GLYPH
+ && glyph->u.ch == ' ')
+ {
+ strcpy (&s[i], "[\\n]");
+ i += 4;
+ }
+ else if (glyph->type == CHAR_GLYPH
+ && glyph->u.ch < 0x80
+ && glyph->u.ch >= ' ')
s[i] = glyph->u.ch;
else
s[i] = '.';
@@ -20360,8 +20329,11 @@ display_mode_lines (struct window *w)
Lisp_Object old_frame_selected_window = XFRAME (new_frame)->selected_window;
int n = 0;
- selected_frame = w->frame;
+ selected_frame = new_frame;
+ /* FIXME: If we were to allow the mode-line's computation changing the buffer
+ or window's point, then we'd need select_window_1 here as well. */
XSETWINDOW (selected_window, w);
+ XFRAME (new_frame)->selected_window = selected_window;
/* These will be set while the mode line specs are processed. */
line_number_displayed = 0;
diff --git a/src/xfaces.c b/src/xfaces.c
index 1e27d5cc043..ed2895c014c 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -1,6 +1,6 @@
/* xfaces.c -- "Face" primitives.
-Copyright (C) 1993-1994, 1998-2012 Free Software Foundation, Inc.
+Copyright (C) 1993-1994, 1998-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/xfns.c b/src/xfns.c
index 7e832c3a95f..315d5093716 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1,6 +1,6 @@
/* Functions for the X window system.
-Copyright (C) 1989, 1992-2012 Free Software Foundation, Inc.
+Copyright (C) 1989, 1992-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/xfont.c b/src/xfont.c
index 2d493088b0b..9978aba76de 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -1,5 +1,5 @@
/* xfont.c -- X core font driver.
- Copyright (C) 2006-2012 Free Software Foundation, Inc.
+ Copyright (C) 2006-2013 Free Software Foundation, Inc.
Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H13PRO009
diff --git a/src/xftfont.c b/src/xftfont.c
index 181a1da9b38..166a70acd85 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -1,5 +1,5 @@
/* xftfont.c -- XFT font driver.
- Copyright (C) 2006-2012 Free Software Foundation, Inc.
+ Copyright (C) 2006-2013 Free Software Foundation, Inc.
Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H13PRO009
diff --git a/src/xgselect.c b/src/xgselect.c
index c161564a322..db7dce10ad0 100644
--- a/src/xgselect.c
+++ b/src/xgselect.c
@@ -1,6 +1,6 @@
/* Function for handling the GLib event loop.
-Copyright (C) 2009-2012 Free Software Foundation, Inc.
+Copyright (C) 2009-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/xgselect.h b/src/xgselect.h
index 5509e23c5c0..f142e85d877 100644
--- a/src/xgselect.h
+++ b/src/xgselect.h
@@ -1,6 +1,6 @@
/* Header for xg_select.
-Copyright (C) 2009-2012 Free Software Foundation, Inc.
+Copyright (C) 2009-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/xmenu.c b/src/xmenu.c
index b585df2125b..3d76070c336 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1,7 +1,7 @@
/* X Communication module for terminals which understand the X protocol.
-Copyright (C) 1986, 1988, 1993-1994, 1996, 1999-2012
- Free Software Foundation, Inc.
+Copyright (C) 1986, 1988, 1993-1994, 1996, 1999-2013 Free Software
+Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/xml.c b/src/xml.c
index a0c4fe17fc4..5939c58a564 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -1,5 +1,5 @@
/* Interface to libxml2.
- Copyright (C) 2010-2012 Free Software Foundation, Inc.
+ Copyright (C) 2010-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/xrdb.c b/src/xrdb.c
index 59b0876ebf8..c25c25d6f33 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -1,5 +1,6 @@
/* Deal with the X Resource Manager.
- Copyright (C) 1990, 1993-1994, 2000-2012 Free Software Foundation, Inc.
+ Copyright (C) 1990, 1993-1994, 2000-2013 Free Software Foundation,
+ Inc.
Author: Joseph Arceneaux
Created: 4/90
diff --git a/src/xselect.c b/src/xselect.c
index 64c64fa0c76..f43efab827b 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1,5 +1,5 @@
/* X Selection processing for Emacs.
- Copyright (C) 1993-1997, 2000-2012 Free Software Foundation, Inc.
+ Copyright (C) 1993-1997, 2000-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/xsettings.c b/src/xsettings.c
index d23070791d8..576a5032eac 100644
--- a/src/xsettings.c
+++ b/src/xsettings.c
@@ -1,6 +1,6 @@
/* Functions for handling font and other changes dynamically.
-Copyright (C) 2009-2012 Free Software Foundation, Inc.
+Copyright (C) 2009-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/xsettings.h b/src/xsettings.h
index 10dc7ef926a..e3738c593bd 100644
--- a/src/xsettings.h
+++ b/src/xsettings.h
@@ -1,6 +1,6 @@
/* Functions for handle font changes dynamically.
-Copyright (C) 2009-2012 Free Software Foundation, Inc.
+Copyright (C) 2009-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 289aac8492b..fe2dfbaf83e 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -1,7 +1,7 @@
/* Session management module for systems which understand the X Session
management protocol.
-Copyright (C) 2002-2012 Free Software Foundation, Inc.
+Copyright (C) 2002-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/xterm.c b/src/xterm.c
index 374b6287458..f63f10566f6 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1,6 +1,6 @@
/* X Communication module for terminals which understand the X protocol.
-Copyright (C) 1989, 1993-2012 Free Software Foundation, Inc.
+Copyright (C) 1989, 1993-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -2236,8 +2236,7 @@ x_draw_image_foreground (struct glyph_string *s)
nothing here for mouse-face. */
if (s->hl == DRAW_CURSOR)
{
- int relief = s->img->relief;
- if (relief < 0) relief = -relief;
+ int relief = eabs (s->img->relief);
XDrawRectangle (s->display, s->window, s->gc,
x - relief, y - relief,
s->slice.width + relief*2 - 1,
@@ -2368,8 +2367,7 @@ x_draw_image_foreground_1 (struct glyph_string *s, Pixmap pixmap)
nothing here for mouse-face. */
if (s->hl == DRAW_CURSOR)
{
- int r = s->img->relief;
- if (r < 0) r = -r;
+ int r = eabs (s->img->relief);
XDrawRectangle (s->display, s->window, s->gc, x - r, y - r,
s->slice.width + r*2 - 1,
s->slice.height + r*2 - 1);
@@ -2633,14 +2631,14 @@ x_draw_stretch_glyph_string (struct glyph_string *s)
static void
x_draw_underwave (struct glyph_string *s)
{
- int wave_height = 2, wave_length = 3;
+ int wave_height = 3, wave_length = 2;
int dx, dy, x0, y0, width, x1, y1, x2, y2, odd, xmax;
XRectangle wave_clip, string_clip, final_clip;
dx = wave_length;
dy = wave_height - 1;
x0 = s->x;
- y0 = s->ybase + 1;
+ y0 = s->ybase - wave_height + 3;
width = s->width;
xmax = x0 + width;
@@ -2802,7 +2800,8 @@ x_draw_glyph_string (struct glyph_string *s)
unsigned long thickness, position;
int y;
- if (s->prev && s->prev->face->underline_p)
+ if (s->prev && s->prev->face->underline_p
+ && s->prev->face->underline_type == FACE_UNDER_LINE)
{
/* We use the same underline style as the previous one. */
thickness = s->prev->underline_thickness;
diff --git a/src/xterm.h b/src/xterm.h
index d63ed1c4583..b241ff23559 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -1,5 +1,6 @@
/* Definitions and headers for communication with X protocol.
- Copyright (C) 1989, 1993-1994, 1998-2012 Free Software Foundation, Inc.
+ Copyright (C) 1989, 1993-1994, 1998-2013 Free Software Foundation,
+ Inc.
This file is part of GNU Emacs.
@@ -473,12 +474,13 @@ struct x_output
GtkWidget *menubar_widget;
/* The tool bar in this frame */
GtkWidget *toolbar_widget;
- /* The handle box that makes the tool bar detachable. */
+#ifdef HAVE_GTK_HANDLE_BOX_NEW
+/* The handle box that makes the tool bar detachable. */
GtkWidget *handlebox_widget;
- /* Non-zero if the tool bar is detached. */
- int toolbar_detached;
+#endif
/* Non-zero if tool bar is packed into the hbox widget (i.e. vertical). */
- int toolbar_in_hbox;
+ bool toolbar_in_hbox;
+ bool toolbar_is_packed;
/* The last size hints set. */
GdkGeometry size_hints;