Paul Eggert [Sat, 20 Oct 2012 21:30:51 +0000 (14:30 -0700)]
Port to OpenBSD 5.1.
* frame.c (Fmouse_position, Fmouse_pixel_position):
* xdisp.c (produce_stretch_glyph):
Declare local vars only when they're needed.
This is clearer and avoids a warning on OpenBSD about unused vars.
* frame.h (FRAME_WINDOW_P): Always evaluate its argument.
This is safer, and avoids OpenBSD warnings about unused vars.
* keyboard.c (record_menu_key): Remove unnecessary decl.
(poll_timer): Define only if POLL_FOR_INPUT is defined.
* unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
as our definition clashes with OpenBSD's.
* xfaces.c (load_face_colors, check_lface_attrs)
(get_lface_attributes_no_remap, get_lface_attributes)
(lface_fully_specified_p, x_supports_face_attributes_p)
(tty_supports_face_attributes_p, face_fontset, realize_face)
(realize_x_face, realize_tty_face):
Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
merely Lisp_Object *. This is more informative and avoids
a warning on OpenBSD about accessing beyond an object's size.
Eli Zaretskii [Sat, 20 Oct 2012 15:26:10 +0000 (17:26 +0200)]
Fix last changes in make-docfile.c.
lib-src/make-docfile.c (IS_SLASH, DEF_ELISP_FILE): New macros.
(scan_lisp_file): Only pass a .el file if its basename matches a
known file in its entirety. Use IS_SLASH and DEF_ELISP_FILE.
Eli Zaretskii [Sat, 20 Oct 2012 10:01:19 +0000 (12:01 +0200)]
Fix bug #12395 with doc strings silently omitted from DOC on MS-Windows.
lib-src/make-docfile.c (scan_lisp_file): Barf if called with a .el file
other than one of a small list of supported un-compiled files.
lib-src/makefile.w32-in (lisp1, lisp2): Name .elc files wherever they
exist.
lisp/loadup.el: Update comment about uncompiled Lisp files.
Paul Eggert [Fri, 19 Oct 2012 16:52:02 +0000 (09:52 -0700)]
Use faccessat, not access, when checking file permissions.
* .bzrignore: Add lib/fcntl.h.
* configure.ac (euidaccess): Remove check; gnulib does this for us now.
(gl_FCNTL_O_FLAGS): Define a dummy version.
* lib/at-func.c, lib/euidaccess.c, lib/faccessat.c, lib/fcntl.in.h:
* lib/getgroups.c, lib/group-member.c, lib/root-uid.h:
* lib/xalloc-oversized.h, m4/euidaccess.m4, m4/faccessat.m4:
* m4/fcntl_h.m4, m4/getgroups.m4, m4/group-member.m4:
New files, from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* admin/merge-gnulib (GNULIB_MODULES): Add faccessat.
(GNULIB_TOOL_FLAGS): Avoid at-internal, fchdir, malloc-posix,
openat-die, openat-h, save-cwd. Do not avoid fcntl-h.
Omit gnulib's m4/fcntl-o.m4.
* nt/inc/ms-w32.h (AT_FDCWD, AT_EACCESS): New symbols.
(access): Remove.
(faccessat): New macro.
* src/Makefile.in (LIB_EACCESS): New macro.
(LIBES): Use it.
* src/callproc.c (init_callproc):
* src/charset.c (init_charset):
* src/fileio.c (check_existing, check_executable):
* src/lread.c (openp, load_path_check):
* src/process.c (allocate_pty):
* src/xrdb.c (file_p):
Use faccessat, not access or euidaccess. Use symbolic names
instead of integers for the flags, as they're portable now.
* src/charset.c, src/xrdb.c: Include <fcntl.h>, for the new flags used.
* src/fileio.c (Ffile_readable_p):
Use faccessat, not stat + open + close.
(file_directory_p): New function, which uses 'stat' on most places
but 'access' (for efficiency) if WINDOWSNT.
* src/fileio.c (Ffile_directory_p, Fset_file_times):
* src/xrdb.c (file_p): Use file_directory_p.
* src/lisp.h (file_directory_p): New decl.
* src/lread.c (openp): When opening a file, use fstat rather than
stat, as that avoids a permissions race. When not opening a file,
use file_directory_p rather than stat.
* src/process.c, src/sysdep.c, src/term.c: All uses of '#ifdef O_NONBLOCK'
changed to '#if O_NONBLOCK', to accommodate gnulib O_* tyle.
* src/w32.c (sys_faccessat): Rename from sys_access and switch to
faccessat's API. All uses changed.
Eli Zaretskii [Fri, 19 Oct 2012 10:05:09 +0000 (12:05 +0200)]
Increase the value of BASE_PURESIZE to avoid pure space overflow.
src/puresize.h (BASE_PURESIZE): Bump the base value to 1700000. See
http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
for the reasons.
Stefan Monnier [Thu, 18 Oct 2012 15:37:57 +0000 (11:37 -0400)]
* lisp/emacs-lisp/advice.el: Clean up commentary a bit.
(ad-do-advised-functions, ad-with-originals): Use `declare'.
(byte-code-function-p): Never redefine.
Kenichi Handa [Wed, 17 Oct 2012 23:59:24 +0000 (08:59 +0900)]
international/mule.el (set-keyboard-coding-system): Recover input meta mode when the new coding system doesn not use 8-bit. Supply TERMINAL arg to set-input-meta-mode.
Eli Zaretskii [Wed, 17 Oct 2012 15:37:55 +0000 (17:37 +0200)]
Fix bug #12661 with w32 and cygw32 builds under --enable-check-lisp-object-type.
src/cygw32.c (Fcygwin_convert_path_to_windows)
(Fcygwin_convert_path_from_windows): Use EQ to compare 2
Lisp_Object values.
src/w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
to Lisp_Object.
When renaming a file with wdired move point with file and don't lose mark status (Bug#11795).
* wdired.el (wdired-old-marks): New variable.
(wdired-change-to-wdired-mode): Locally set wdired-old-marks.
(wdired-do-renames): Move point with renamed file and don't lose
mark status (Bug#11795).
Dmitry Antipov [Wed, 17 Oct 2012 04:58:15 +0000 (08:58 +0400)]
Do not verify indirection counters of killed buffers (Bug#12579).
* buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
* buffer.c (compact_buffer, set_buffer_internal_1): Use it.
Dmitry Antipov [Tue, 16 Oct 2012 07:56:44 +0000 (11:56 +0400)]
* alloc.c (Fmake_byte_code): Fix typo in comment.
* print.c (print_interval): Define as static to match prototype.
* indent.c (disptab_matches_widthtab, recompute_width_table):
Convert to eassert.
Stefan Monnier [Mon, 15 Oct 2012 16:49:57 +0000 (12:49 -0400)]
* lisp/erc/erc.el (erc-log): Make it into a defsubst.
(erc-with-server-buffer, define-erc-module, erc-with-buffer)
(erc-with-all-buffers-of-server): Use `declare'.
* lisp/erc/erc-backend.el (erc-log): Adjust autoload accordingly.
Martin Rudalics [Mon, 15 Oct 2012 09:03:56 +0000 (11:03 +0200)]
Fix Fwindow_end's handling of cached position (Bug#12600).
* window.c (Fwindow_end): Rewrite check whether cached position
can be used (Bug#12600).
(resize_frame_windows, grow_mini_window, shrink_mini_window):
Set windows_or_buffers_changed.
Chong Yidong [Mon, 15 Oct 2012 04:03:04 +0000 (12:03 +0800)]
More documentation fixes for changes to defun, defmacro, etc.
* doc/lispref/functions.texi (Anonymous Functions): Explicitly list the
docstring, declare, and interactive arguments to lambda.
(Defining Functions): Likewise for defun.
(Inline Functions): Likewise for defsubst.
(Declare Form): Tweak description.
* doc/lispref/macros.texi (Defining Macros): defmacro is now a macro.
Explicitly list the docstring and declare arguments.
* image.c (init_tiff_functions, init_imagemagick_functions)
(init_svg_functions): Fix cygw32 build break by using these
functions only when WINDOWSNT _and_ HAVE_NTGUI.
David Engster [Sun, 14 Oct 2012 19:20:28 +0000 (21:20 +0200)]
Merge changes from CEDET upstream.
* semantic.el (semantic-error-if-unparsed): New function. Raise
error if buffer was not parsed by Semantic (bug #12045).
(navigate-menu, edit-menu, cedet-menu-map): Enable Semantic items
only if buffer was parsed. Also, replace ':active' with ':enable'
where necessary.
* semantic/wisent/python.el
(semantic-python-get-system-include-path): Use
`python-shell-internal-send-string' if available to query Python
for system paths.
* semantic/senator.el (senator-next-tag):
(senator-previous-tag):
(senator-go-to-up-reference): Use `semantic-error-if-unparsed'.
* semantic/analyze/complete.el
(semantic-analyze-possible-completions): Check if buffer was
parsed. Only raise an error if function was called interactively,
otherwise silently return nil.
* cedet.el (cedet-menu-map): Fix copy&paste typo in menu creation.
Eli Zaretskii [Sun, 14 Oct 2012 07:40:05 +0000 (09:40 +0200)]
Adapt compile.el to changes in MSVC diagnostics format.
lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Adjust the msft regexp to the output of Studio 2010, and move msft
before edg-1. See the discussion on emacs-devel,
http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00579.html,
for the details.
etc/compilation.txt (msft): Add error messages in new Studio 2010
format.
test/automated/compile-tests.el (compile-tests--test-regexps-data):
Add data for msft's new format.
Paul Eggert [Sat, 13 Oct 2012 00:52:01 +0000 (17:52 -0700)]
Fix some stat-related races.
* fileio.c (Fwrite_region): Avoid race condition if a file is
removed or renamed by some other process immediately after Emacs
writes it but before Emacs stats it. Do not assume that stat (or
fstat) succeeds.
* image.c (slurp_file): Resolve the file name with fopen + fstat
rather than stat + fopen.
(pbm_read_file) [0]: Remove unused code with stat race.
* process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
Remove ineffective code with stat race.
Stefan Monnier [Fri, 12 Oct 2012 20:11:50 +0000 (16:11 -0400)]
* src/doc.c (get_doc_string): Don't signal an error if the file is missing.
* lisp/help-fns.el (describe-variable, describe-function-1):
* lisp/help-mode.el (help-make-xrefs): Remove error handler, made unneeded.
Jan Djärv [Fri, 12 Oct 2012 17:50:39 +0000 (19:50 +0200)]
* nsterm.m (hold_event_q): New static variable.
(EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
! q_event_ptr.
(hold_event): New function.
(ns_read_socket): If hold_event_q have events, store them and
return.
(setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
is zero (Bug#12384).
Eli Zaretskii [Fri, 12 Oct 2012 15:19:54 +0000 (17:19 +0200)]
Fix bug #12587 with slow startup on MS-Windows with Netlogon service.
src/fileio.c (check_existing): New function.
(make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
instead of calling 'stat', when what's needed is to check whether
a file exists. This avoids expensive system calls on MS-Windows.
src/w32.c (init_environment): Call 'check_existing' instead of 'stat'.
src/lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
determine whether a file exists and is not a directory.
src/lisp.h (check_existing): Add prototype.