Eli Zaretskii [Fri, 8 Nov 2013 10:21:35 +0000 (12:21 +0200)]
Switch cache-long-scans to t by default.
src/xdisp.c (message_dolog): Make sure the *Messages* buffer has its
cache-long-scans disabled, since we don't want to call
prepare_to_modify_buffer (in insert_1_both) for each message we
display.
src/buffer.h (bset_cache_long_scans): New INLINE function, moved
from buffer.c. Improve commentary to the buffer field setter
functions.
src/buffer.c (bset_cache_long_scans): Static function deleted.
Improve commentary to the buffer field setter functions.
(init_buffer_once): Default for cache-long-scans changed to t.
(Bug#15797)
Michael Albinus [Fri, 8 Nov 2013 09:31:15 +0000 (10:31 +0100)]
* automated/file-notify-tests.el:
* automated/tramp-tests.el: Add `tramp-own-remote-path' to
`tramp-remote-path' when running on hydra.
(tramp-test07-file-exists-p): Remove instrumentation code.
(tramp-test26-process-file): Don't use "/bin/true" and
"/bin/false", these paths do not exist on hydra.
Paul Eggert [Fri, 8 Nov 2013 07:28:21 +0000 (23:28 -0800)]
* chartab.c (make_sub_char_table): Fix size typo.
This bug was introduced in my 2013-06-21 change, and caused
struct Lisp_Sub_Char_Table objects to be given too many slots,
which broke 'make -C admin/unidata'.
Darren Hoo [Fri, 8 Nov 2013 04:09:56 +0000 (23:09 -0500)]
* lisp/man.el (Man-start-calling): New macro, extracted from
Man-getpage-in-background.
(Man-getpage-in-background): Use it.
(Man-update-manpage): New command.
(Man-mode-map): Bind it.
Dmitry Gutov [Fri, 8 Nov 2013 02:31:51 +0000 (04:31 +0200)]
* lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Improve precedences
of "and", "or", "&&" and "||".
(ruby-smie--args-separator-p): Prohibit keyword "do" as the first
argument. Prohibit opening curly brace because it could only be a
block opener in that position.
(ruby-smie--forward-token, ruby-smie--backward-token): Separate
"|" from "&" or "*" going after it. That can happen in block
arguments.
(ruby-smie--indent-to-stmt): New function, seeks the end of
previous statement or beginning of buffer.
(ruby-smie-rules): Use it.
(ruby-smie-rules): Check if there's a ":" before a curly block
opener candidate; if there is, it's a hash.
Paul Eggert [Thu, 7 Nov 2013 05:31:04 +0000 (21:31 -0800)]
Port to C11 aligned_alloc, and fix some integer overflows.
* configure.ac (GMALLOC_OBJ): Initialize to empty if !system_malloc
and doug_lea_malloc.
(aligned_alloc): Test for existence if !GMALLOC_OBJ and not darwin.
(posix_memalign): Test for existence only if !GMALLOC_OBJ and
not darwin and !aligned_alloc.
* src/alloc.c (USE_ALIGNED_ALLOC): New symbol.
(USE_POSIX_MEMALIGN): Remove. All uses replaced with USE_ALIGNED_ALLOC,
and use of posix_memalign replaced with aligned_alloc.
(aligned_alloc): New function, defined or declared as needed.
* src/conf_post.h (HAVE_POSIX_MEMALIGN) [DARWIN_OS]:
Don't undef; configure.ac now does this.
* src/gmalloc.c (aligned_alloc) [MSDOS]: New decl.
(calloc, aligned_alloc): Check for integer overflow.
(aligned_alloc): Rename from memalign. All uses changed.
(memalign): New function, an alias for aligned_alloc.
Dmitry Gutov [Thu, 7 Nov 2013 03:02:01 +0000 (05:02 +0200)]
* lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p):
No implicit semi after "^", "and" or "or".
(ruby-smie-grammar): New tokens: "and" and "or".
(ruby-smie--args-separator-p): Fix the check for tokens at POS.
Exclude "and" and "or". Remove "do" in order to work around token
priorities.
(ruby-smie-rules): Add all infix tokens. Handle the case of
beginning-of-buffer.
Stefan Monnier [Wed, 6 Nov 2013 18:41:31 +0000 (13:41 -0500)]
* src/xdisp.c (syms_of_xdisp): New vars redisplay--all-windows-cause and
redisplay--mode-lines-cause.
(redisplay_internal): Keep them uptodate. Remove redundant check of
buffer_shared_and_changed.
* *.[chm]: Number every assignment to update_mode_lines so we
can track why it is set.
Glenn Morris [Wed, 6 Nov 2013 08:37:01 +0000 (00:37 -0800)]
Remove some directory-changing in lisp/Makefile
* lisp/Makefile.in (setwins, setwins_almost, setwins_for_subdirs): Simplify.
(setwins_almost, setwins_for_subdirs): Don't assume called from srcdir.
(custom-deps, finder-data, autoloads, update-subdirs): No need to cd.
Stefan Monnier [Wed, 6 Nov 2013 02:10:18 +0000 (21:10 -0500)]
* lisp/electric.el (electric-indent-local-mode): New minor mode.
(electric-indent-functions-without-reindent): New var.
(electric-indent-post-self-insert-function): Use it.
* lisp/emacs-lisp/gv.el (buffer-local-value): Add setter.
Paul Eggert [Wed, 6 Nov 2013 00:14:56 +0000 (16:14 -0800)]
Integer-related fixes for term.c etc.
* dispextern.h (face_tty_specified_color): New function.
* term.c (turn_on_face): Don't rely on undefined behavior when
assigning an out-of-range value to 'long'. Simplify
test for toggling highlight.
(tty_capable_p): Omit last two (unused) args. All callers changed.
* term.c (tty_capable_p, tty_menu_display, tty_menu_add_selection)
(read_menu_input, tty_menu_activate, tty_menu_show):
* xfaces.c (x_supports_face_attributes_p)
(tty_supports_face_attributes_p):
Use bool for boolean. All callers changed.
(tty_supports_face_attributes_p): Omit defaults for color indices;
no longer needed. Simplify tail call.
Stefan Monnier [Tue, 5 Nov 2013 16:29:58 +0000 (11:29 -0500)]
* src/eval.c (handlerlist_sentinel): New variable.
(init_eval): Use it to ensure handlerlist is non-NULL.
(unwind_to_catch): Make sure we never set handlerlist to NULL.
(Fsignal): Adjust NULLness test of handlerlist.
* src/lisp.h (PUSH_HANDLER): Assume handlerlist is non-NULL.
Eli Zaretskii [Tue, 5 Nov 2013 16:26:11 +0000 (18:26 +0200)]
Fix bug #15148 with garbled display in Dired when cache-long-scans is ON.
src/callproc.c (call_process): Call prepare_to_modify_buffer before
decoding text read from the sub-process, as the decoded stuff will
be inserted into the buffer. This will invalidate the various
caches maintained for the buffer.
Bozhidar Batsov [Tue, 5 Nov 2013 09:47:47 +0000 (11:47 +0200)]
* lisp/progmodes/python.el (python-mode): Remove incorrect text from docstring.
* lisp/progmodes/scheme.el (scheme-mode): Remove incorrect text from docstring.
* lisp/progmodes/prolog.el (prolog-mode): Remove incorrect text from docstring.
* lisp/emacs-lisp/lisp-mode.el (lisp-mode, lisp-interaction-mode, emacs-lisp-mode):
Remove incorrect text from docstring.
* autogen: Remove directory. Move update_autogen to admin/.
* autogen.sh: Remove reference to copy_autogen.
* GNUmakefile (configure):
* Makefile.in (bootstrap): Do not try to run copy_autogen.
* config.bat: Use msdos/autogen rather than autogen.
* admin/update_autogen: Move here from ../autogen.
(usage): Update. Remove -l, add -A.
(autogendir): New variable.
(ldefs_flag): Default to set.
(genfiles): Reduce to only ms-dos relevant files.
(main): Make checking autogen sources optional.
Make copying of autogen files optional.
* msdos/autogen/config.in:
* msdos/autogen/Makefile.in: Move here from ../autogen.
Jan Djärv [Tue, 5 Nov 2013 07:51:55 +0000 (08:51 +0100)]
* nsfns.m (ns_get_name_from_ioreg): New function.
(ns_screen_name): Don't use deprecated CGDisplayIOServicePort on
OSX >= 10.9. Use ns_get_name_from_ioreg.
Paul Eggert [Tue, 5 Nov 2013 07:11:24 +0000 (23:11 -0800)]
Simplify and port recent bool vector changes.
* configure.ac (BITSIZEOF_SIZE_T, SIZEOF_SIZE_T):
New symbols to configure.
* src/alloc.c (ROUNDUP): Move here from lisp.h, since it's now used
only in this file. Use a more-efficient implementation if the
second argument is a power of 2.
(ALIGN): Rewrite in terms of ROUNDUP. Make it a function.
Remove no-longer-necessary compile-time checks.
(bool_vector_exact_payload_bytes): New function.
(bool_vector_payload_bytes): Remove 2nd arg; callers that need
exact payload changed to call the new function. Do not assume
that the arg or result fits in ptrdiff_t.
(bool_vector_fill): New function.
(Fmake_bool_vector): Use it. Don't assume bit counts fit
in ptrdiff_t.
(vroundup_ct): Don't assume arg fits in size_t.
* src/category.c (SET_CATEGORY_SET): Remove. All callers now just
invoke set_category_set.
(set_category_set): 2nd arg is now EMACS_INT and 3rd is now bool.
All callers changed. Use bool_vector_set.
* src/category.h (XCATEGORY_SET): Remove; no longer needed.
(CATEGORY_MEMBER): Now a function. Rewrite in terms of
bool_vector_bitref.
* src/data.c (Faref): Use bool_vector_ref.
(Faset): Use bool_vector_set.
(bits_word_to_host_endian): Don't assume you can shift by CHAR_BIT.
(Fbool_vector_not, Fbool_vector_count_matches)
(Fbool_vector_count_matches_at): Don't assume CHAR_BIT == 8.
* src/fns.c (concat): Use bool_vector_ref.
(Ffillarray): Use bool_vector_fill.
(mapcar1): Use bool_vector_ref.
(sxhash_bool_vector): Hash words, not bytes.
* src/lisp.h (BOOL_VECTOR_BITS_PER_CHAR): Now a macro as well as
a constant, since it's now used in #if.
(bits_word, BITS_WORD_MAX, BITS_PER_BITS_WORD): Fall back on
unsigned char on unusual architectures, so that we no longer
assume that the number of bits per bits_word is a power of two or
is a multiple of 8 or of CHAR_BIT.
(Qt): Add forward decl.
(struct Lisp_Bool_Vector): Don't assume EMACS_INT is aligned
at least as strictly as bits_word.
(bool_vector_data, bool_vector_uchar_data): New accessors.
All data structure accesses changed to use them.
(bool_vector_words, bool_vector_bitref, bool_vector_ref)
(bool_vector_set): New functions.
(bool_vector_fill): New decl.
(ROUNDUP): Move to alloc.c as described above.
Glenn Morris [Tue, 5 Nov 2013 02:58:40 +0000 (21:58 -0500)]
Get rid of --chdir usage in test/automated
* test/automated/Makefile.in (EMACSOPT): Move -L here.
(emacs): Set EMACS_TEST_DIRECTORY in the environment.
(setwins): Don't assume called from srcdir. Remove legacy stuff.
(.el.elc): No more need to pass -L here.
(compile-main): Get rid of sub-shell and cd.
(compile-clean, check): Get rid of cd.
Glenn Morris [Tue, 5 Nov 2013 02:22:00 +0000 (21:22 -0500)]
* test/automated/eieio-tests.el (eieio-test-37-persistent-classes):
Remove test that makes no sense.
It simply loads a file that contains some tests.
Loading the file does not run the tests, and the test are already
being run independently (which obviously involves loading the file),
since every .el file in this directory is automatically used in that way.
Stefan Monnier [Mon, 4 Nov 2013 19:14:58 +0000 (14:14 -0500)]
* lisp/progmodes/python.el: Fix up last change.
(python-shell--save-temp-file): New function.
(python-shell-send-string): Use it. Remove `msg' arg. Don't assume
`string' comes from the current buffer.
(python-shell-send-string-no-output): Remove `msg' arg.
(python--use-fake-loc): New var.
(python-shell-buffer-substring): Obey it. Try to compensate for the
extra coding line added by python-shell--save-temp-file.
(python-shell-send-region): Use python-shell--save-temp-file and
python-shell-send-file directly. Add `nomain' argument.
(python-shell-send-buffer): Use python-shell-send-region.
(python-electric-pair-string-delimiter): New function.
(python-mode): Use it.
Eli Zaretskii [Mon, 4 Nov 2013 17:30:33 +0000 (19:30 +0200)]
Fix bug #15260 with building and installing Emacs in non-ASCII directories.
src/xdisp.c (message3_nolog, message_with_string): Encode the string
before writing it to the terminal in a non-interactive session.
src/lread.c (openp): If both FILENAME and SUFFIX are unibyte, make
sure we concatenate them into a unibyte string.
src/fileio.c (make_temp_name): Encode PREFIX, and decode the
resulting temporary name before returning it to the caller.
(Fexpand_file_name): If NAME is pure-ASCII and DEFAULT_DIRECTORY
is a unibyte string, convert NAME to a unibyte string to ensure
that the result is also a unibyte string.
src/emacs.c (init_cmdargs): Use build_unibyte_string to make sure we
create unibyte strings from default paths and directory/file
names.
src/coding.h (ENCODE_FILE): Do not attempt to encode a unibyte
string.
src/callproc.c (init_callproc): Use build_unibyte_string to make
sure we create unibyte strings from default paths and
directory/file names.
src/buffer.c (init_buffer): Don't store default-directory of
*scratch* in multibyte form. The original problem which led to
that is described in
http://lists.gnu.org/archive/html/emacs-pretest-bug/2004-11/msg00532.html,
but it was solved long ago.
lisp/startup.el (normal-top-level): Move setting eol-mnemonic-unix,
eol-mnemonic-mac, eol-mnemonic-dos, and also setup of the locale
environment and decoding all of the default-directory's to here
from command-line.
(command-line): Decode also argv[0].
lisp/loadup.el: Error out if default-directory is a multibyte string
when we are dumping.
lisp/Makefile.in (emacs): Don't set LC_ALL=C.
leim/Makefile.in (RUN_EMACS): Don't set LC_ALL=C.
configure.ac: Don't disallow builds in non-ASCII directories.
Michael Albinus [Mon, 4 Nov 2013 14:32:40 +0000 (15:32 +0100)]
Fix problems found while writing a test suite.
* net/tramp.el (tramp-file-name-regexp-unified): Simplify.
(tramp-file-name-for-operation): Use `tramp-tramp-file-p'.
(tramp-handle-substitute-in-file-name): Let-bind `process-environment'
to nil when running original file name handler. Otherwise,
there are problems with constructs like "$$FOO".
* net/tramp-sh.el (tramp-do-copy-or-rename-file): Use correct prefix
for `localname'.
Bozhidar Batsov [Mon, 4 Nov 2013 13:10:49 +0000 (15:10 +0200)]
* lisp/helpers.el: New library for misc helper functions.
(hash-table-keys): New function returning a list of hash keys.
(hash-table-values): New function returning a list of hash values.
Paul Eggert [Mon, 4 Nov 2013 06:09:03 +0000 (22:09 -0800)]
Port to stricter C99 platforms.
Especially, C99 prohibits nesting a struct X inside struct Y if
struct X has a flexible array member.
Also, merge from gnulib, incorporating:
2013-11-03 intprops: port to Oracle Studio c99
* lib/intprops.h: Update from gnulib.
* src/alloc.c (struct sdata): New type.
(sdata): Implement in terms of struct sdata.
Remove u member; all uses replaced by next_vector, set_next_vector.
(SDATA_SELECTOR, SDATA_DATA, SDATA_DATA_OFFSET): Adjust to sdata change.
(SDATA_DATA_OFFSET): Now a constant, not a macro.
(struct sblock): Rename first_data member to data, which is now
a flexible array member. All uses changed.
(next_vector, set_next_vector, large_vector_vec): New functions.
(vector_alignment): New constant.
(roundup_size): Make it a multiple of ALIGNOF_STRUCT_LISP_VECTOR, too.
(struct large-vector): Now merely a NEXT member, since the old approach
ran afoul of stricter C99. All uses changed to use
large_vector_vec or large_vector_offset.
(large_vector_offset): New constant.
* src/dispnew.c: Include tparam.h, for tgetent.
Do not include term.h; no longer needed.
* src/gnutls.c (Fgnutls_boot): Don't continue after calling a _Noreturn.
* src/lisp.h (ENUM_BF) [__SUNPRO_C && __STDC__]: Use unsigned int.
(struct Lisp_Vector): Use a flexible array member for contents,
instead of a union with a member that is an array of size 1.
All uses changed.
(ALIGNOF_STRUCT_LISP_VECTOR): New constant, to make up for the
fact that the struct no longer contains a union.
(struct Lisp_Misc_Any, struct Lisp_Marker, struct Lisp_Overlay)
(struct Lisp_Save_Value, struct Lisp_Free):
Use unsigned, not int, for spacers, to avoid c99 warning.
(union specbinding): Use unsigned, not bool, for bitfield, as
bool is not portable to pre-C99 hosts.