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.
* lisp/progmodes/cperl-mode.el (cperl-font-lock-fontify-region-function):
Don't infloop when expanding region over `multiline' syntax-type that
begins a line.
Stefan Monnier [Mon, 4 Nov 2013 03:06:54 +0000 (22:06 -0500)]
* lisp/rect.el (rectangle-mark-mode): Rename from rectangle-mark.
Make it into a proper minor mode.
(rectangle--region): (implicitly) rename to rectangle-mark-mode.
(rectangle-mark-mode-map): New keymap.
(rectangle--highlight-for-redisplay): Fix some corner cases.
Stefan Monnier [Sun, 3 Nov 2013 22:56:03 +0000 (17:56 -0500)]
* lisp/emacs-lisp/smie.el (smie-rule-parent): Always call
smie-indent-virtual rather than only for hanging tokens.
(smie--next-indent-change): New helper command.
* lisp/progmodes/ruby-mode.el (ruby-smie--rule-parent-skip-assign): Remove.
(ruby-smie-rules): Use smie-rule-parent instead.
Glenn Morris [Sat, 2 Nov 2013 20:54:08 +0000 (13:54 -0700)]
test/automated: Use relative filename for emacs executable
* Makefile.in (check): Depend on all.
* test/automated/Makefile.in (abs_top_builddir): Remove variable.
(EMACS): Use a relative file name.
(lisp-compile): Remove (assume it's up-to-date).
(compile-main): Do not run lisp-compile.
(check): Use --chdir.
Glenn Morris [Sat, 2 Nov 2013 19:56:54 +0000 (12:56 -0700)]
* automated/Makefile.in (test): Remove variable.
(compile-main, compile-clean, compile-always, bootstrap-clean)
(check): Use srcdir rather than $test. Check cd return value.
(compile-always): Depend on bootstrap-clean.
Glenn Morris [Sat, 2 Nov 2013 19:50:41 +0000 (12:50 -0700)]
Minor simplifications for test/automated/Makefile
* test/automated/Makefile.in (top_builddir, abs_test, abs_lispsrc, lisp):
Remove variables.
(emacs): Use abs_top_srcdir, abs_srcdir rather than abs_lispsrc, abs_test.
(lisp-compile): Use ../../lisp rather than $lisp.
Glenn Morris [Sat, 2 Nov 2013 19:41:33 +0000 (12:41 -0700)]
Use relative filenames in TAGS files.
* src/Makefile.in (abs_srcdir): Remove it again.
(.PHONY): Remove frc.
(maintainer-clean): No more TAGS-LISP file.
(TAGS): Pass relative file names to etags.
(../lisp/TAGS): Rename from TAGS-LISP. Work in ../lisp.
* lisp/Makefile.in (lisptagsfiles1, lisptagsfiles2, lisptagsfiles3)
(lisptagsfiles4, TAGS): Use relative file names.
(TAGS-LISP): Remove.
(maintainer-clean): No more TAGS-LISP file.
* lwlib/Makefile.in (abs_srcdir): Remove it again.
(ctagsfiles, TAGS): Use relative filenames.
Glenn Morris [Sat, 2 Nov 2013 19:18:50 +0000 (12:18 -0700)]
Small Makefile cleanup mainly related to tags file generation
* src/Makefile.in (abs_srcdir): New, set by configure.
(maintainer-clean): Remove pointless echo. That should be in the
top-level Makefile, if anywhere. Delete TAGS-LISP.
(extraclean): No s/ and m/ directories for some time.
(TAGS): Remove no-longer-defined S_FILE.
Pass absolute filenames to etags once more.
(TAGS-LISP, $(lwlibdir)/TAGS): Correctly pass ETAGS to sub-makes.
($(lwlibdir)/TAGS): Remove useless subshell, check cd return value.
* lisp/Makefile.in (lisptagsfiles1, lisptagsfiles2, lisptagsfiles3)
(lisptagsfiles4): Use absolute filenames again.
(TAGS, TAGS-LISP): Not everything needs to run in one line.
Remove all *loaddefs files, not just the first. Remove esh-groups.
(maintainer-clean): Delete TAGS, TAGS-LISP.
* lwlib/Makefile.in (abs_srcdir): New, set by configure.
(ETAGS, ctagsfiles): New variables.
(TAGS): Use ETAGS, ctagsfiles. Use absolute filenames again.
Dmitry Gutov [Sat, 2 Nov 2013 05:18:11 +0000 (09:18 +0400)]
* lisp/progmodes/ruby-mode.el (ruby-smie--rule-parent-skip-assign): New
function, replacement for `smie-rule-parent' for when we want to
skip over our direct parent if it's an assignment token..
(ruby-smie-rules): Use it.
* src/xfaces.c: Declare color_distance.
(QCdistant_foreground): New variable.
(NEAR_SAME_COLOR_THRESHOLD): New define.
(load_color2): New function.
(load_color): Call load_color2.
(load_face_colors): Call load_color2 and if distant-color is specified
calculate distant and use distant-color if colors are near.
(LFACE_DISTANT_FOREGROUND): New define.
(merge_face_ref, Finternal_set_lisp_face_attribute)
(Finternal_get_lisp_face_attribute)
(x_supports_face_attributes_p): Handle distant-foreground similar to
foreground.
(syms_of_xfaces): DEFSYM QCdistant_foreground.
Tassilo Horn [Fri, 1 Nov 2013 10:27:21 +0000 (11:27 +0100)]
Allow multiple bibliographies when BibLaTeX is used rathen than
BibTeX.
* textmodes/reftex-parse.el (reftex-using-biblatex-p): New function.
(reftex-locate-bibliography-files): Us it.
Claudio Bley [Fri, 1 Nov 2013 08:52:22 +0000 (10:52 +0200)]
Support newer versions of libjpeg on MS-Windows.
src/image.c (Qlibjpeg_version): New variable.
(syms_of_image): DEFSYM and initialize it.
lisp/term/w32-win.el (dynamic-library-alist): Support newer versions
of libjpeg starting with v7: look only for the DLL from the
version against which Emacs was built.
Glenn Morris [Thu, 31 Oct 2013 07:18:42 +0000 (00:18 -0700)]
Fix setting of invocation-directory with --chdir and relative argv[0]
* src/emacs.c (original_pwd): New char.
(main): If using --chdir, store original_pwd.
(init_cmdargs): When setting Vinvocation_directory based on a
relative argv[0], use original_pwd if set.
Barry O'Reilly [Thu, 31 Oct 2013 01:50:24 +0000 (21:50 -0400)]
* semantic/idle.el (semantic-idle-symbol-highlight)
(semantic-idle-symbol-highlight-face): Define face with defface
and obsolete the replaced one defined with defvar. (Bug#15745)
* pulse.el (pulse-momentary-highlight-overlay)
(pulse-momentary-highlight-region): Fix typo in doc
Alp Aker [Wed, 30 Oct 2013 18:35:19 +0000 (14:35 -0400)]
Ensure unmarking in buffer menu clears 'S' marks. (Bug#15761)
* buff-menu.el (Buffer-menu--unmark): New function.
(Buffer-menu-unmark, Buffer-menu-backup-unmark): Use it.
Glenn Morris [Wed, 30 Oct 2013 07:15:23 +0000 (00:15 -0700)]
Simplify admin/unidata Makefile rules
* admin/unidata/unidata-gen.el (unidata-gen-files): Use pop.
Also take the output directory as an argument.
* admin/unidata/Makefile.in: Simplify now that unidata-gen-files takes
the output directory as an argument (no need to cd, etc).
(abs_srcdir, abs_builddir): Remove.
(abs_top_builddir): Replace by top_builddir.
(${DSTDIR}/charprop.el): No need to cd. Pass dest as argument.
(${DSTDIR}/charprop.el, charprop.el):
No need to pass unidata.txt as argument.
Glenn Morris [Wed, 30 Oct 2013 06:25:44 +0000 (23:25 -0700)]
* admin/unidata/unidata-gen.el (unidata--ensure-compiled): New function.
(unidata-gen-table-name, unidata-gen-table-decomposition)
(unidata-gen-files): Use unidata--ensure-compiled.
Add FSF copyright years based on when this file first appeared in
Emacs trunk.
Glenn Morris [Wed, 30 Oct 2013 06:24:16 +0000 (23:24 -0700)]
* admin/unidata/Makefile.in (abs_srcdir): New, set by configure.
(${DSTDIR}/charprop.el, charprop.el): Update for srcdir not absolute.
(clean): Delete all .elc files.
Stefan Monnier [Wed, 30 Oct 2013 01:28:36 +0000 (21:28 -0400)]
* lisp/progmodes/python.el (python-shell-get-buffer): New function.
(python-shell-get-process): Use it.
(python-shell-send-string): Always use utf-8 and add a cookie to tell
Python which encoding was used. Don't split-string since we only care
about the first line. Return the temp-file, if applicable.
(python-shell-send-region): Tell compile.el how to turn locations in
the temp-file into locations in the source buffer.
Stefan Monnier [Tue, 29 Oct 2013 21:05:35 +0000 (17:05 -0400)]
* src/keyboard.c (command_loop_1): If command is nil, call `undefined'.
* lisp/subr.el (undefined): Add missing behavior from the C code for
unbound keys.
Stefan Monnier [Tue, 29 Oct 2013 16:11:50 +0000 (12:11 -0400)]
Add pre-redisplay-function and rectangular region
* lisp/rect.el: Use lexical-binding. Add new rectangular region support.
(rectangle-mark): New command.
(rectangle--region): New var.
(deactivate-mark-hook): Reset rectangle--region.
(rectangle--extract-region, rectangle--insert-for-yank)
(rectangle--highlight-for-redisplay)
(rectangle--unhighlight-for-redisplay): New functions.
(region-extract-function, redisplay-unhighlight-region-function)
(redisplay-highlight-region-function): Use them to handle
rectangular region.
* lisp/simple.el (region-extract-function): New var.
(delete-backward-char, delete-forward-char, deactivate-mark): Use it.
(kill-new, kill-append): Remove obsolete `yank-handler' argument.
(kill-region): Replace obsolete `yank-handler' arg with `region'.
(copy-region-as-kill, kill-ring-save): Add `region' argument.
(redisplay-unhighlight-region-function)
(redisplay-highlight-region-function): New vars.
(redisplay--update-region-highlight): New function.
(pre-redisplay-function): Use it.
(exchange-point-and-mark): Don't deactivate the mark before
reactivate-it anyway.
* lisp/comint.el (comint-kill-region): Remove yank-handler argument.
* lisp/delsel.el (delete-backward-char, backward-delete-char-untabify)
(delete-char): Remove property, since it's now part of their
default behavior.
(self-insert-iso): Remove property since this command doesn't exist.
* src/xdisp.c (prepare_menu_bars): Call Vpre_redisplay_function.
(syms_of_xdisp): Declare pre-redisplay-function.
(markpos_of_region): Remove function.
(init_iterator, compute_stop_pos, handle_face_prop)
(face_before_or_after_it_pos, reseat_to_string)
(get_next_display_element, window_buffer_changed)
(redisplay_internal, try_cursor_movement, redisplay_window)
(try_window_reusing_current_matrix, try_window_id, display_line)
(note_mode_line_or_margin_highlight, note_mouse_highlight)
(display_string, mouse_face_from_buffer_pos): Remove region handling.
* src/window.h (struct window): Remove field `region_showing'.
* src/dispextern.h (struct it): Remove region_beg/end_charpos.
(face_at_buffer_position, face_for_overlay_string)
(face_at_string_position): Update prototypes.
* src/xfaces.c (face_at_buffer_position, face_for_overlay_string)
(face_at_string_position): Remove `region_beg' and `region_end' args.
* src/fontset.c (Finternal_char_font):
* src/font.c (font_at, font_range): Adjust calls accordingly.
* src/insdel.c (Qregion_extract_function): New var.
(syms_of_insdel): Initialize it.
(prepare_to_modify_buffer_1): Use it.
Stefan Monnier [Tue, 29 Oct 2013 14:46:23 +0000 (10:46 -0400)]
* src/eval.c (run_hook_with_args): Use FUNCTIONP.
* test/indent/css-mode.css (.x2): Test alignement inside braces.
* test/indent/prolog.prolog: Test alignment of ->; with operator at bol.