Jan Djärv [Sun, 7 Sep 2014 17:31:39 +0000 (19:31 +0200)]
* xselect.c (x_fill_property_data): Handle negative XCDR when data
is CONSP.
Fixes: debbugs:18303
Eli Zaretskii [Sun, 7 Sep 2014 17:04:19 +0000 (20:04 +0300)]
Fix the MS-Windows build broken by SAFE_ALLOCA changes.
src/callproc.c (child_setup) [WINDOWSNT]: Don't call exec_failed if
'alloca' gets passed arguments larger than MAX_ALLOCA.
src/font.c (MAX): Define if not defined elsewhere.
Paul Eggert [Sun, 7 Sep 2014 13:27:33 +0000 (06:27 -0700)]
* keyboard.c (read_decoded_event_from_main_queue): Reinstitute alloca
here for destination buffer, to work around what appears to be a
bug in decode_coding_c_string when the source and destination are
both C strings.
* keyboard.c (echo_add_key, menu_bar_items, tool_bar_items)
Michael Albinus [Sun, 7 Sep 2014 11:02:33 +0000 (13:02 +0200)]
* strings.texi (Text Comparison): Describe `string-collate-equalp'
and `string-collate-lessp'.
Paul Eggert [Sun, 7 Sep 2014 08:46:42 +0000 (01:46 -0700)]
Expand @AM_DEFAULT_VERBOSITY@ even if Automake is old.
* configure.ac: Assume verbose output for older Automake.
Fixes: debbugs:18415
Michael Albinus [Sun, 7 Sep 2014 08:24:44 +0000 (10:24 +0200)]
* automated/fns-tests.el (fns-tests--collate-enabled-p): New function.
(fns-tests-collate-strings, fns-tests-collate-sort): Use it.
Paul Eggert [Sun, 7 Sep 2014 07:04:01 +0000 (00:04 -0700)]
Use SAFE_ALLOCA etc. to avoid unbounded stack allocation.
This follows up on the recent thread in emacs-devel on alloca; see:
http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00042.html
This patch also cleans up alloca-related glitches noted while
examining the code looking for unbounded alloca.
* alloc.c (listn):
* callproc.c (init_callproc):
Rewrite to avoid need for alloca.
* buffer.c (mouse_face_overlay_overlaps)
(report_overlay_modification):
* buffer.h (GET_OVERLAYS_AT):
* coding.c (make_subsidiaries):
* doc.c (Fsnarf_documentation):
* editfns.c (Fuser_full_name):
* fileio.c (Ffile_name_directory, Fexpand_file_name)
(search_embedded_absfilename, Fsubstitute_in_file_name):
* fns.c (Fmake_hash_table):
* font.c (font_vconcat_entity_vectors, font_update_drivers):
* fontset.c (fontset_pattern_regexp, Ffontset_info):
* frame.c (Fmake_terminal_frame, x_set_frame_parameters)
(xrdb_get_resource, x_get_resource_string):
* ftfont.c (ftfont_get_charset, ftfont_check_otf, ftfont_drive_otf):
* ftxfont.c (ftxfont_draw):
* image.c (xbm_load, xpm_load, jpeg_load_body):
* keyboard.c (echo_add_key, menu_bar_items, tool_bar_items):
* keymap.c (Fdescribe_buffer_bindings, describe_map):
* lread.c (openp):
* menu.c (digest_single_submenu, find_and_call_menu_selection)
(find_and_return_menu_selection):
* print.c (PRINTFINISH):
* process.c (Fformat_network_address):
* scroll.c (do_scrolling, do_direct_scrolling, scrolling_1):
* search.c (search_buffer, Fmatch_data, Fregexp_quote):
* sound.c (wav_play, au_play):
* syntax.c (skip_chars):
* term.c (tty_menu_activate, tty_menu_show):
* textprop.c (get_char_property_and_overlay):
* window.c (Fset_window_configuration):
* xdisp.c (safe__call, next_overlay_change, vmessage)
(compute_overhangs_and_x, draw_glyphs, note_mouse_highlight):
* xfaces.c (face_at_buffer_position):
* xmenu.c (x_menu_show):
Use SAFE_ALLOCA etc. instead of plain alloca, since the
allocation size isn't bounded.
* callint.c (Fcall_interactively): Redo memory_full check
so that it can be done at compile-time on some platforms.
* coding.c (MAX_LOOKUP_MAX): New constant.
(get_translation_table): Use it.
* callproc.c (call_process): Use SAFE_NALLOCA instead of
SAFE_ALLOCA, to catch integer overflows on size calculation.
(exec_failed) [!DOS_NT]: New function.
(child_setup) [!DOS_NT]: Use it.
* editfns.c (Ftranspose_regions):
Hoist USE_SAFE_ALLOC + SAFE_FREE out of 'if'.
* editfns.c (check_translation):
Allocate larger buffers on the heap.
* eval.c (internal_lisp_condition_case):
Check for MAX_ALLOCA overflow.
* fns.c (sort_vector): Use SAFE_ALLOCA_LISP rather than Fmake_vector.
(Fbase64_encode_region, Fbase64_decode_region):
Avoid unnecessary calls to SAFE_FREE before 'error'.
* buffer.c (mouse_face_overlay_overlaps):
* editfns.c (Fget_pos_property, check_translation):
* eval.c (Ffuncall):
* font.c (font_unparse_xlfd, font_find_for_lface):
* ftfont.c (ftfont_drive_otf):
* keyboard.c (echo_add_key, read_decoded_event_from_main_queue)
(menu_bar_items, tool_bar_items):
* sound.c (Fplay_sound_internal):
* xdisp.c (load_overlay_strings, dump_glyph_row):
Use an ordinary auto buffer rather than alloca, since the
allocation size is fixed and small.
* ftfont.c: Include <c-strcase.h>.
(matching_prefix): New function.
(get_adstyle_property): Use it, to avoid need for alloca.
* keyboard.c (echo_add_key):
* keymap.c (describe_map): Use ptrdiff_t, not int.
* keyboard.c (echo_add_key): Prefer sizeof to strlen.
* keymap.c (Fdescribe_buffer_bindings): Use SBYTES, not SCHARS,
when counting bytes.
* lisp.h (xlispstrdupa): Remove, replacing with ...
(SAFE_ALLOCA_STRING): ... new macro with different API.
This fixes a portability problem, namely, alloca result
passed to another function. All uses changed.
(SAFE_ALLOCA, SAFE_ALLOCA_LISP): Check for MAX_ALLOCA,
not MAX_ALLOCA - 1.
* regex.c (REGEX_USE_SAFE_ALLOCA, REGEX_SAFE_FREE)
(REGEX_ALLOCATE): New macros.
(REGEX_REALLOCATE, REGEX_ALLOCATE_STACK, REGEX_REALLOCATE_STACK)
(REGEX_FREE_STACK, FREE_VARIABLES, re_match_2_internal):
Use them.
* xdisp.c (message3): Use SAFE_ALLOCA_STRING rather than doing it
by hand.
(decode_mode_spec_coding): Store directly into buf rather than
into an alloca temporary and copying the temporary to the buf.
Fixes: debbugs:18410
Eli Zaretskii [Sat, 6 Sep 2014 07:40:43 +0000 (10:40 +0300)]
Remove unused variable EMACS_HEAPSIZE from src/Makefile.in.
src/Makefile.in (EMACS_HEAPSIZE): Remove, no longer used. (Bug#18416)
ChangeLog: Mention explicitly the removal of EMACS_HEAPSIZE.
Leo Liu [Sat, 6 Sep 2014 00:59:00 +0000 (08:59 +0800)]
Add vector qpattern to pcase
* doc/lispref/control.texi (Pattern matching case statement): Document vector
qpattern.
* etc/NEWS: Mention vector qpattern for pcase. (Bug#18327).
* lisp/emacs-lisp/pcase.el (pcase): Doc fix.
(pcase--split-vector): New function.
(pcase--q1): Support vector qpattern. (Bug#18327)
Sam Steingold [Fri, 5 Sep 2014 19:07:52 +0000 (15:07 -0400)]
New custom variable `tex-print-file-extension' to help users who use PDF instead of DVI.
* lisp/textmodes/tex-mode.el (tex-print-file-extension): New user
option.
(tex-print): Use it instead of the hard-coded string.
Michael Albinus [Fri, 5 Sep 2014 14:12:48 +0000 (16:12 +0200)]
* net/tramp-sh.el (tramp-sh-handle-start-file-process): Expand `default-directory'.
Michael Albinus [Fri, 5 Sep 2014 13:32:55 +0000 (15:32 +0200)]
New string collation tests.
* automated/fns-tests.el (fns-tests-compare-strings): In case
`compare-strings' shall return t, check for this.
(fns-tests-collate-strings, fns-tests-collate-sort): New tests.
Martin Rudalics [Fri, 5 Sep 2014 10:29:34 +0000 (12:29 +0200)]
Add and use function horizontal-scroll-bars-available-p.
* scroll-bar.el (horizontal-scroll-bars-available-p): New
function.
(horizontal-scroll-bar-mode): Rewrite using
horizontal-scroll-bars-available-p.
* menu-bar.el (menu-bar-showhide-scroll-bar-menu): Rewrite using
horizontal-scroll-bars-available-p.
Stefan Monnier [Fri, 5 Sep 2014 01:20:51 +0000 (21:20 -0400)]
* lisp/subr.el (call-process-shell-command, process-file-shell-command):
Make the `args' obsolete.
(start-process-shell-command, start-file-process-shell-command):
Use `declare'.
Fixes: debbugs:18409
Jay Belanger [Fri, 5 Sep 2014 01:04:47 +0000 (20:04 -0500)]
calc/calc-forms.el (math-normalize-hms): Do a better check for
"negative" hms forms.
Rasmus Pank Roulund [Thu, 4 Sep 2014 16:34:45 +0000 (12:34 -0400)]
* lisp/vc/vc-git.el (vc-git-conflicted-files): Fix bug when git status
returns nil.
Fixes: debbugs:18391
Paul Eggert [Thu, 4 Sep 2014 16:14:05 +0000 (09:14 -0700)]
Remove stray semicolons.
Stefan Monnier [Thu, 4 Sep 2014 15:23:37 +0000 (11:23 -0400)]
* lisp/emacs-lisp/eldoc.el (eldoc-function-argstring): Don't strip
terminating paren.
(eldoc-last-data-store): Return cached data.
(eldoc-get-var-docstring): Avoid setq.
(eldoc-get-fnsym-args-string): Clarify data flow.
Fixes: debbugs:18352
Thierry Volpiatto [Thu, 4 Sep 2014 14:49:56 +0000 (10:49 -0400)]
* lisp/emacs-lisp/eldoc.el (eldoc-highlight-function-argument): Handle the
case where we're currently providing part of the &rest arg after some
&key args, as in define-ibuffer-op.
Fixes: debbugs:18048
Jan Djärv [Thu, 4 Sep 2014 05:38:37 +0000 (07:38 +0200)]
* xsmfns.c: Initialize ice_fd.
* xterm.c (x_term_init): Don't call x_session_initialize if running
as a daemon.
Fixes: debbugs:18375
Paul Eggert [Thu, 4 Sep 2014 02:15:56 +0000 (19:15 -0700)]
Less chatter in 'make' output.
* doc/Makefile.in (clean):
* oldXMenu/Makefile.in (clean mostlyclean):
Simplify, for shorter command line.
* src/Makefile.in (AM_V_GEN, am__v_GEN_, am__v_GEN_0, am__v_GEN_1, AM_V_at)
(am__v_at_, am__v_at_0, am__v_at_1): New macros, taken from Automake.
($(etc)/DOC, buildobj.h, gl-stamp): Use them.
Paul Eggert [Thu, 4 Sep 2014 02:02:46 +0000 (19:02 -0700)]
* configure.ac (MAKEINFO): Clean up some configuration bitrot.
MAKEINFO is already set before we get here, so no need to call AC_PATH_PROG.
Bypass $am_missing_run. Simplify version-number checking.
Glenn Morris [Thu, 4 Sep 2014 00:40:03 +0000 (20:40 -0400)]
* admin/notes/bzr: Some bisect tips.
Stefan Monnier [Wed, 3 Sep 2014 19:10:15 +0000 (15:10 -0400)]
* lisp/progmodes/which-func.el (which-func-ff-hook): Obey pre-existing
buffer-local setting of which-func-mode.
(which-func-mode): Use defvar-local.
(which-function-mode): Don't reset which-func-mode in each buffer since
it might have been set by someone else.
(which-func-update-ediff-windows): Check which-function-mode.
Martin Rudalics [Wed, 3 Sep 2014 16:13:17 +0000 (18:13 +0200)]
NEWS and TODO changes.
Martin Rudalics [Wed, 3 Sep 2014 15:10:29 +0000 (17:10 +0200)]
Clean up initialization and customization of horizontal scroll bars.
* frame.el (frame-initialize): Remove horizontal-scroll-bars
from frame-initial-frame-alist.
* scroll-bar.el (previous-horizontal-scroll-bar-mode)
(horizontal-scroll-bar-mode-explicit)
(set-horizontal-scroll-bar-mode, get-horizontal-scroll-bar-mode)
(toggle-horizontal-scroll-bar): Remove.
(horizontal-scroll-bar-mode): Remove defcustom.
(horizontal-scroll-bar-mode): Fix doc-string.
(scroll-bar-toolkit-scroll)
(scroll-bar-toolkit-horizontal-scroll): Add doc-strings stubs.
* buffer.c (scroll-bar-height): Fix typo in doc-string.
* frame.c (Vdefault_frame_horizontal_scroll_bars): Remove
variable.
* nsfns.m (Fx_create_frame):
* w32fns.c (Fx_create_frame):
* xfns.c (Fx_create_frame): Default horizontal scroll bars to
nil.
Glenn Morris [Wed, 3 Sep 2014 04:21:40 +0000 (21:21 -0700)]
Merge from emacs-24; up to 2014-07-04T02:28:54Z!dmantipov@yandex.ru
Stefan Monnier [Wed, 3 Sep 2014 00:38:49 +0000 (20:38 -0400)]
* lisp/progmodes/sh-script.el (sh-font-lock-quoted-subshell): Try to better
handle multiline elements.
Fixes: debbugs:18380
Stefan Monnier [Tue, 2 Sep 2014 20:47:44 +0000 (16:47 -0400)]
test/indent/scheme.scm: New file.
Stefan Monnier [Tue, 2 Sep 2014 19:51:25 +0000 (15:51 -0400)]
* lisp/emacs-lisp/package.el (package-generate-description-file):
Properly quote the arguments. Change second arg.
(package--alist-to-plist-args): Rename from package--alist-to-plist and
quote the elements.
(package--make-autoloads-and-stuff): Fix the test for pre-existence of
the *-pkg.el file. Adjust to new calling convention of
package-generate-description-file.
Fixes: debbugs:18332
Paul Eggert [Tue, 2 Sep 2014 19:17:23 +0000 (12:17 -0700)]
Merge from gnulib, incorporating:
2014-09-02 gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
2014-09-01 manywarnings: add GCC 4.9 warnings
* m4/gnulib-common.m4, m4/manywarnings.m4: Update from gnulib.
Stefan Monnier [Tue, 2 Sep 2014 18:16:32 +0000 (14:16 -0400)]
* lisp/progmodes/gud.el (gud-gdb-completion-at-point): Add hack.
(gud-gdb-completions): Remove obsolete workaround.
Fixes: debbugs:18282
Paul Eggert [Tue, 2 Sep 2014 18:05:00 +0000 (11:05 -0700)]
Minor cleanup of recent strlen-avoiding patch.
* src/fileio.c (CHECK_LENGTH): Remove.
Rewrite callers so that they don't need it.
(Fexpand_file_name) [DOS_NT]: Fix a case where directory length
variable wasn't set.
Eli Zaretskii [Tue, 2 Sep 2014 15:16:42 +0000 (18:16 +0300)]
Fix bug #18384 with incorrect reporting of row number by posn-col-row.
lisp/subr.el (posn-col-row): Revert the change from commit
2010-11-13T21:07:58Z!eliz@gnu.org, which
was inadvertently merged from emacs-23 release branch in
2010-11-18T03:54:14Z!monnier@iro.umontreal.ca, and
introduced an off-by-one error in the reported row when there is a
header line.
src/dispnew.c (buffer_posn_from_coords): Fix an off-by-one error in
the reported row in the case of a window with a header line, by
improving on the fix committed in 2011-10-08T10:58:50Z!eliz@gnu.org
eliz@gnu.org-
20111008105850-ht4tvsayohvr1kjc.
Dmitry Antipov [Tue, 2 Sep 2014 11:41:22 +0000 (15:41 +0400)]
* buffer.h (decode_buffer): New function.
* buffer.c (Fbuffer_name, Fbuffer_file_name, Fbuffer_base_buffer)
(Fbuffer_local_variables, Fbuffer_modified_p, Fbuffer_modified_tick)
(Fbuffer_chars_modified_tick, Fdelete_all_overlays):
* data.c (Flocal_variables_p):
* fileio.c (Fverify_visited_file_modtime):
* marker.c (live_buffer): Use it.
Dmitry Antipov [Tue, 2 Sep 2014 06:49:40 +0000 (10:49 +0400)]
* callproc.c (egetenv_internal): Add arg and rename from egetenv ...
* lisp.h (egetenv): ... because of a new inline function used to
avoid calls to strlen for a compile-time constants.
Glenn Morris [Tue, 2 Sep 2014 06:48:20 +0000 (23:48 -0700)]
* lisp/tutorial.el: Restore comment lost 2006-12-21.
Paul Eggert [Tue, 2 Sep 2014 06:29:01 +0000 (23:29 -0700)]
* eval.c (internal_lisp_condition_case): Don't overrun the stack
when configured --with-wide-int on typical 32-bit platforms.
Dmitry Antipov [Tue, 2 Sep 2014 05:44:38 +0000 (09:44 +0400)]
* fileio.c (CHECK_LENGTH): New macro.
(Fexpand_file_name): Use it and get rid of a few more calls
to strlen and strcat.
Dmitry Antipov [Tue, 2 Sep 2014 03:47:54 +0000 (07:47 +0400)]
* fileio.c (Fexpand_file_name): Fix MS-Windows build failure.
Fabián Ezequiel Gallina [Mon, 1 Sep 2014 22:51:46 +0000 (19:51 -0300)]
* lisp/progmodes/python.el (python-indent-post-self-insert-function):
Avoid electric colon at beginning-of-defun.
* test/automated/python-tests.el:
(python-indent-electric-colon-1): New test. (Bug#18228)
Glenn Morris [Mon, 1 Sep 2014 16:44:06 +0000 (09:44 -0700)]
* lisp/tutorial.el (tutorial--display-changes): Fix 2014-07-29 change.
Fixes: debbugs:18382
Dmitry Antipov [Mon, 1 Sep 2014 16:05:43 +0000 (20:05 +0400)]
Avoid extra calls to strlen in filesystem I/O routines.
* fileio.c (Fexpand_file_name): Avoid calls to strlen if
the length of 'newdir' is known or may be precalculated.
(file_accessible_directory_p): Prefer to pass Lisp_Object,
not 'char *', and so use precalculated length.
(Ffile_accessible_directory_p):
* callproc.c (encode_current_directory, init_callproc):
* charset.c (init_charset):
* lread.c (load_path_check, load_path_default): Adjust users.
* lisp.h (file_accessible_directory_p): Tweak prototype.
Eli Zaretskii [Mon, 1 Sep 2014 15:11:25 +0000 (18:11 +0300)]
nt/gnulib.mk: Synchronize with lib/gnulib.mk.
Eli Zaretskii [Mon, 1 Sep 2014 15:07:17 +0000 (18:07 +0300)]
src/w32proc.c (w32_compare_strings): Support "C" and "POSIX" locales.
Eli Zaretskii [Mon, 1 Sep 2014 15:03:45 +0000 (18:03 +0300)]
Implement the GNU ls -v switch in ls-lisp.el.
lisp/ls-lisp.el (ls-lisp-version-lessp): New function.
(ls-lisp-handle-switches): Use it to implement the -v switch of GNU ls.
(ls-lisp--insert-directory): Mention the -v switch in the doc string.
Fixes: debbugs:18051
Eli Zaretskii [Mon, 1 Sep 2014 14:57:21 +0000 (17:57 +0300)]
Use the new string-collate-lessp function in ls-lisp.el.
lisp/ls-lisp.el (ls-lisp-use-string-collate)
(ls-lisp-UCA-like-collation): New defcustoms.
(ls-lisp-string-lessp): Use them to control sorting by file
names.
etc/NEWS: Mention that ls-lisp uses string-collate-lessp.
Fixes: debbugs:18051
Eli Zaretskii [Mon, 1 Sep 2014 14:44:33 +0000 (17:44 +0300)]
src/lastfile.c: Fix last change.
Glenn Morris [Mon, 1 Sep 2014 10:21:26 +0000 (06:21 -0400)]
Auto-commit of loaddefs files.
Paul Eggert [Mon, 1 Sep 2014 09:54:12 +0000 (02:54 -0700)]
Fix typo in previous change's ChangeLog.
Paul Eggert [Mon, 1 Sep 2014 09:49:51 +0000 (02:49 -0700)]
--enable-silent-warnings now suppresses more chatter.
* INSTALL, etc/NEWS: Document this.
* lib-src/Makefile.in (AM_DEFAULT_VERBOSITY, AM_V_CC, am__v_CC_)
(am__v_CC_0, am__v_CC_1, AM_V_CCLD, am__v_CCLD_, am__v_CCLD_0)
(am__v_CCLD_1): New macros, taken from Automake.
(regex.o, etags${EXEEXT}, ctags${EXEEXT}, ebrowse${EXEEXT})
(profile${EXEEXT}, make-docfile${EXEEXT}, movemail${EXEEXT})
(pop.o, emacsclient${EXEEXT}, emacsclientw${EXEEXT})
(emacsclientw${EXEEXT}, ntlib.o, hexl${EXEEXT})
(update-game-score${EXEEXT}): Use them.
* lwlib/Makefile.in (AM_DEFAULT_VERBOSITY, AM_V_CC, am__v_CC_)
(am__v_CC_0, am__v_CC_1): New macros, taken from Automake.
(.c.o): Use them.
* oldXMenu/Makefile.in (AM_DEFAULT_VERBOSITY, AM_V_CC, am__v_CC_)
(am__v_CC_0, am__v_CC_1): New macros, taken from Automake.
(.c.o): Use them.
* src/Makefile.in (AM_DEFAULT_VERBOSITY, AM_V_CC, am__v_CC_)
(am__v_CC_0, am__v_CC_1, AM_V_CCLD, am__v_CCLD_, am__v_CCLD_0)
(am__v_CCLD_1): New macros, taken from Automake.
(.c.o, .m.o, temacs$(EXEEXT)): Use them.
Paul Eggert [Mon, 1 Sep 2014 02:37:22 +0000 (19:37 -0700)]
Clean up extern decls a bit.
* configure.ac (WERROR_CFLAGS): Don't disable -Wnested-externs.
While we're at it, don't disable -Wlogical-op either.
* src/bytecode.c: Include blockinput.h and keyboard.h rather
than rolling their APIs by hand.
* src/emacs.c: Include regex.h and rely on its and lisp.h's API
rather than rolling them by hand.
* src/lastfile.c: Include lisp.h, to check this file's API.
* src/lisp.h (lisp_eval_depth, my_edata, my_endbss, my_endbss_static):
New decls.
* src/regex.h (re_max_failures): New decl.
* src/unexcw.c, src/unexmacosx.c, src/unexw32.c:
Rely on lisp.h's API rather than rolling it by hand.
* src/vm-limit.c (__after_morecore_hook, __morecore, real_morecore):
Declare at top level, to pacify GCC -Wnested-externs.
Paul Eggert [Mon, 1 Sep 2014 00:06:11 +0000 (17:06 -0700)]
* etags.c (emacs_strchr, emacs_strrchr): Remove.
All uses replaced by strchr and strrchr, which are on all
target platforms now.
Christoph Scholtes [Sun, 31 Aug 2014 20:44:36 +0000 (14:44 -0600)]
Replace mode-specific quit function in ibuffer.el
* lisp/ibuffer.el: Replace mode-specific quit function with
`quit-window' via `special-mode'.
(ibuffer-mode-map): Use keybindings from special-mode-map instead
of local overrides.
(ibuffer): Don't store previous windows configuration. Let
`quit-window' handle restoring.
(ibuffer-quit): Remove function. Use `quit-window' instead.
(ibuffer-restore-window-config-on-quit): Remove variable.
(ibuffer-prev-window-config): Remove variable.
Eli Zaretskii [Sun, 31 Aug 2014 15:53:27 +0000 (18:53 +0300)]
Fix cursor display on the fringe of R2L screen lines.
src/xdisp.c (display_and_set_cursor): Call erase_phys_cursor also
when HPOS is negative, for the benefit of R2L glyph rows whose
newline overflows into the fringe.
Eli Zaretskii [Sun, 31 Aug 2014 15:46:47 +0000 (18:46 +0300)]
Fix cursor drawing in hscrolled R2L screen lines.
src/xdisp.c (get_glyph_string_clip_rects): Don't let the width of a
clipping rectangle become negative (i.e. large positive, since
it's an unsigned data type). This can happen in R2L hscrolled
glyph rows, and caused us to draw the cursor glyph on the fringe.
For the details, see
http://lists.gnu.org/archive/html/emacs-devel/2014-08/msg00543.html.
Paul Eggert [Sun, 31 Aug 2014 02:50:10 +0000 (19:50 -0700)]
* configure.ac (__restrict_arr): Remove; no longer used.
Ken Brown [Sun, 31 Aug 2014 02:40:00 +0000 (22:40 -0400)]
Fix bug#18368 with broken build on AIX due to HYBRID_MALLOC changes.
* src/gmalloc.c: Don't include <stdlib.h>. Declare system malloc and
friends before defining hybrid_malloc and friends if HYBRID_MALLOC
is defined. (Bug#18368)
Paul Eggert [Sun, 31 Aug 2014 02:34:31 +0000 (19:34 -0700)]
* configure.ac (MAKE): Export it, for config.status.
Needed on AIX when 'configure' infers MAKE=gmake.
Paul Eggert [Sat, 30 Aug 2014 23:29:23 +0000 (16:29 -0700)]
* fns.c (sort_vector): Fix GC bug in previous change.
Paul Eggert [Sat, 30 Aug 2014 22:59:39 +0000 (15:59 -0700)]
Vector-sorting fixes.
It's not safe to call qsort or qsort_r, since they have undefined
behavior if the user-specified predicate is not a total order.
Also, watch out for garbage-collection while sorting vectors.
* admin/merge-gnulib (GNULIB_MODULES): Add vla.
* configure.ac (qsort_r): Remove, as we no longer use qsort-like
functions.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* lib/vla.h, m4/vararrays.m4: New files, copied from gnulib.
* lib/stdlib.in.h, m4/stdlib_h.m4: Sync from gnulib, incorporating:
2014-08-29 qsort_r: new module, for GNU-style qsort_r
The previous two files' changes are boilerplate generated by
admin/merge-gnulib, and should not affect Emacs.
* src/fns.c: Include <vla.h>.
(sort_vector_predicate) [!HAVE_QSORT_R]: Remove.
(sort_vector_compare): Remove, replacing with ....
(inorder, merge_vectors, sort_vector_inplace, sort_vector_copy):
... these new functions.
(sort_vector): Rewrite to use the new functions.
GCPRO locals, since the predicate can invoke the GC.
Since it's in-place return void; caller changed.
(merge): Use 'inorder', for clarity.
Fixes: debbugs:18361
Ken Brown [Sat, 30 Aug 2014 19:47:56 +0000 (15:47 -0400)]
* src/conf_post.h (strnicmp) [CYGWIN && HAVE_NTGUI]: Define. (Bug#18366)
Paul Eggert [Sat, 30 Aug 2014 16:47:19 +0000 (09:47 -0700)]
* sysdep.c (str_collate): Clear errno just before wcscoll(_l).
One can't hoist this out of the 'if', because intervening calls to
newlocale, twolower, etc. can change errno.
Eli Zaretskii [Sat, 30 Aug 2014 09:29:13 +0000 (12:29 +0300)]
Minor ChangeLog fix.
Eli Zaretskii [Sat, 30 Aug 2014 09:22:53 +0000 (12:22 +0300)]
admin/authors.el (authors): Fix last change so it works for MS-Windows as well.
Eli Zaretskii [Sat, 30 Aug 2014 09:21:16 +0000 (12:21 +0300)]
Minor ChangeLog fixes.
Eli Zaretskii [Sat, 30 Aug 2014 08:19:24 +0000 (11:19 +0300)]
Improve error checking and error messages in string-collation functions.
src/sysdep.c (str_collate) [__STDC_ISO_10646__]: Improve the
wording of the error messages.
(str_collate) [WINDOWSNT]: Signal an error if w32_compare_strings
sets errno.
src/w32proc.c (get_lcid_callback): Accept locale specifications
without the country part, as in "enu" vs "enu_USA".
(w32_compare_strings): Signal an error if a locale was specified,
but couldn't be translated into a valid LCID.
Leo Liu [Fri, 29 Aug 2014 23:30:50 +0000 (07:30 +0800)]
* NEWS: Mention (:append FUN) to minibuffer-with-setup-hook.
Ken Brown [Fri, 29 Aug 2014 22:13:43 +0000 (18:13 -0400)]
* lisp/startup.el (fancy-splash-frame): Extend the fix for Bug#16014 to the Cygwin-w32 build. (Bug#18347)
Michael Albinus [Fri, 29 Aug 2014 21:19:45 +0000 (23:19 +0200)]
* sysdep.c (str_collate) [__STDC_ISO_10646__]: Move up setting errno.
Michael Heerdegen [Fri, 29 Aug 2014 20:28:19 +0000 (22:28 +0200)]
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Use mode function
name instead of variable name in hook docstring. (Bug#18349)
Paul Eggert [Fri, 29 Aug 2014 20:16:40 +0000 (13:16 -0700)]
* sysdep.c (str_collate): Do not look at errno after towlower_l.
errno's value is not specified after towlower_l. Instead, assume
that towlower_l returns its argument on failure, which is portable
in practice.
Eli Zaretskii [Fri, 29 Aug 2014 19:18:06 +0000 (22:18 +0300)]
Implement case-insensitive and Unicode-compliant collation on MS-Windows.
src/fns.c (Fstring_collate_lessp, Fstring_collate_equalp): Doc fix.
src/w32proc.c (w32_compare_strings): Accept additional argument
IGNORE_CASE. Set up the flags for CompareStringW to ignore case
if requested. If w32-collate-ignore-punctuation is non-nil, add
NORM_IGNORESYMBOLS to the flags.
(LINGUISTIC_IGNORECASE): Define if not already defined.
(syms_of_ntproc) <Vw32_collate_ignore_punctuation>: New variable.
src/sysdep.c (str_collate) [WINDOWSNT]: Adapt to the interface
change.
src/w32.h: Adjust prototype of w32_compare_strings.
etc/NEWS: Mention w32-collate-ignore-punctuation.
Fixes: debbugs:18051
Eli Zaretskii [Fri, 29 Aug 2014 18:30:24 +0000 (21:30 +0300)]
Revert a change inadvertently committed in last commit.
Eli Zaretskii [Fri, 29 Aug 2014 18:29:30 +0000 (21:29 +0300)]
src/sysdep.c (str_collate) [WINDOWSNT]: Fix a typo in 2014-08-29T17:57:36Z!michael.albinus@gmx.de.
Michael Albinus [Fri, 29 Aug 2014 18:10:15 +0000 (20:10 +0200)]
* authors.el (authors): Use LOCALE argument of `string-collate-lessp'.
Michael Albinus [Fri, 29 Aug 2014 17:57:36 +0000 (19:57 +0200)]
Add optional arguments LOCALE and IGNORE-CASE to collation functions.
* fns.c (Fstring_collate_lessp, Fstring_collate_equalp):
Add optional arguments LOCALE and IGNORE-CASE.
* lisp.h (str_collate): Adapt argument list.
* sysdep.c (LC_CTYPE, LC_CTYPE_MASK, towlower_l):
Define substitutes for platforms that lack them.
(str_collate): Add arguments locale and ignore_case.
Dmitry Antipov [Fri, 29 Aug 2014 16:28:53 +0000 (20:28 +0400)]
Fix ChangeLog entry.
Dmitry Antipov [Fri, 29 Aug 2014 16:21:30 +0000 (20:21 +0400)]
Fix last change to support Darwin/OSX (Bug#18354).
* sysdep.c (sort_vector_compare) [DARWIN_OS || __FreeBSD__]:
Conditionally define to match system's qsort_r signature.
(sort_vector) [DARWIN_OS || __FreeBSD__]: Likewise in call to qsort_r.
Dmitry Antipov [Fri, 29 Aug 2014 12:23:30 +0000 (16:23 +0400)]
* NEWS: Mention that `sort' can handle vectors.
Dmitry Antipov [Fri, 29 Aug 2014 11:02:56 +0000 (15:02 +0400)]
* doc/lispref/lists.texi (Functions that Rearrange Lists): Remove
description of sort ...
* doc/lispref/sequences.texi (Sequence Functions): ... and generalize
it for sequences. Add an example.
* src/fns.c (Fsort): Use more natural Qsequencep error.
* test/automated/fns-tests.el (fns-tests-sort): Minor style rewrite.
Martin Rudalics [Fri, 29 Aug 2014 10:39:17 +0000 (12:39 +0200)]
Adjust display-buffer-at-bottom.
* window.el (display-buffer-at-bottom): Prefer bottom-left
window to other bottom windows. Reuse a bottom window if it
shows the buffer already. Suggested by Juri Linkov
<juri@jurta.org> in discussion of (Bug#18181).
Dmitry Antipov [Fri, 29 Aug 2014 07:29:47 +0000 (11:29 +0400)]
Add vectors support to Fsort.
* configure.ac (AC_CHECK_FUNCS): Check for qsort_r.
* src/fns.c (sort_vector, sort_vector_compare): New functions.
(sort_list): Likewise, refactored out of ...
(Fsort): ... adjusted user. Mention vectors in docstring.
(sort_vector_predicate) [!HAVE_QSORT_R]: New variable.
* src/alloc.c (make_save_int_obj): New function.
* src/lisp.h (enum Lisp_Save_Type): New member SAVE_TYPE_INT_OBJ.
(make_save_int_obj): Add prototype.
* test/automated/fns-tests.el (fns-tests-sort): New test.
Michael Albinus [Fri, 29 Aug 2014 07:05:23 +0000 (09:05 +0200)]
Move an entry where it belongs to.
Leo Liu [Fri, 29 Aug 2014 02:48:17 +0000 (10:48 +0800)]
* files.el (minibuffer-with-setup-hook): Allow (:append FUN) to
append to minibuffer-setup-hook.
Fixes: debbugs:18341
Stefan Monnier [Thu, 28 Aug 2014 22:18:39 +0000 (18:18 -0400)]
Misc accumulated ChangeLog convention fixes
Stefan Monnier [Thu, 28 Aug 2014 20:37:13 +0000 (16:37 -0400)]
* lisp/progmodes/cc-defs.el: Expose c-lanf-defconst's expressions to the
byte-compiler.
(lookup-syntax-properties): Silence byte-compiler.
(c-lang-defconst): Quote the code with `lambda' rather than with
`quote'.
(c-lang-const): Avoid unneeded setq.
(c-lang-constants-under-evaluation): Add docstring.
(c-lang--novalue): New constant.
(c-find-assignment-for-mode): Use it instead of c-lang-constants.
(c-get-lang-constant): Same here.
Get the mode's value using `funcall' now that the code is quoted
with `lambda'.
Michael Albinus [Thu, 28 Aug 2014 19:31:11 +0000 (21:31 +0200)]
* net/tramp.el (tramp-handle-shell-command): Use `display-buffer'.
Fixes: debbugs:18326
Glenn Morris [Thu, 28 Aug 2014 19:18:24 +0000 (15:18 -0400)]
* lisp/tar-mode.el (tar--extract, tar-extract): Avoid disabling undo
in extracted buffers.
Fixes: debbugs:18344
Martin Rudalics [Thu, 28 Aug 2014 18:33:18 +0000 (20:33 +0200)]
Revert x_scroll_bar_handle_click "typo fix".
Eli Zaretskii [Thu, 28 Aug 2014 16:26:39 +0000 (19:26 +0300)]
Fix bug #18339 with segfault when $ is typed into empty LaTeX buffer.
Back-ported from trunk revision-id: 2014-08-27T19:40:54Z!eliz@gnu.org
src/syntax.c (scan_lists): Don't examine positions before BEGV.
Ken Brown [Thu, 28 Aug 2014 14:48:02 +0000 (10:48 -0400)]
Add support for HYBRID_MALLOC, allowing the use of gmalloc before
dumping and the system malloc after dumping. (Bug#18222)
* configure.ac (HYBRID_MALLOC): New macro; define to use gmalloc
before dumping and the system malloc after dumping. Define on Cygwin.
* src/conf_post.h (malloc, realloc, calloc, free) [HYBRID_MALLOC]:
Define as macros, expanding to hybrid_malloc, etc.
(HYBRID_GET_CURRENT_DIR_NAME): New macro.
(get_current_dir_name) [HYBRID_GET_CURRENT_DIR_NAME]: Define as
macro.
* src/gmalloc.c: Set up the infrastructure for HYBRID_MALLOC, with a
full implementation on Cygwin. Remove Cygwin-specific code that
is no longer needed.
(malloc, realloc, calloc, free, aligned_alloc) [HYBRID_MALLOC]:
Redefine as macros expanding to gmalloc, grealloc, etc.
(DUMPED, ALLOCATED_BEFORE_DUMPING) [CYGWIN]: New macros.
(get_current_dir_name) [HYBRID_GET_CURRENT_DIR_NAME]: Undefine.
(USE_PTHREAD, posix_memalign) [HYBRID_MALLOC]: Don't define.
(hybrid_malloc, hybrid_calloc, hybrid_free, hybrid_realloc)
[HYBRID_MALLOC]:
(hybrid_get_current_dir_name) [HYBRID_GET_CURRENT_DIR_NAME]:
(hybrid_aligned_alloc) [HYBRID_MALLOC && (HAVE_ALIGNED_ALLOC ||
HAVE_POSIX_MEMALIGN)]: New functions.
* src/alloc.c (aligned_alloc) [HYBRID_MALLOC && (ALIGNED_ALLOC ||
HAVE_POSIX_MEMALIGN)]: Define as macro expanding to
hybrid_aligned_alloc; declare.
(USE_ALIGNED_ALLOC) [HYBRID_MALLOC && (ALIGNED_ALLOC ||
HAVE_POSIX_MEMALIGN)]: Define.
(refill_memory_reserve) [HYBRID_MALLOC]: Do nothing.
* src/sysdep.c (get_current_dir_name) [HYBRID_GET_CURRENT_DIR_NAME]:
Define as macro, expanding to gget_current_dir_name, and define
the latter.
* src/emacs.c (main) [HYBRID_MALLOC]: Don't call memory_warnings() or
malloc_enable_thread(). Don't initialize malloc.
* src/lisp.h (NONPOINTER_BITS) [CYGWIN]: Define (because GNU_MALLOC is
no longer defined on Cygwin).
(refill_memory_reserve) [HYBRID_MALLOC]: Don't declare.
* src/sheap.c (bss_sbrk_buffer_end): New variable.
* src/unexcw.c (__malloc_initialized): Remove variable.
* src/ralloc.c: Throughout, treat HYBRID_MALLOC the same as
SYSTEM_MALLOC.
* src/xdisp.c (decode_mode_spec) [HYBRID_MALLOC]: Don't check
Vmemory_full.
Martin Rudalics [Thu, 28 Aug 2014 06:46:58 +0000 (08:46 +0200)]
Some fixes for scroll bar code.
* w32term.c (w32_horizontal_scroll_bar_handle_click): In
`event->y' return entire range (the size of the scroll bar minus
that of the thumb).
* xterm.c (xm_scroll_callback, xaw_jump_callback): In `whole'
return entire range (the scaled size of the scroll bar minus
that of the slider). In `portion' return the scaled position of
the slider.
(xaw_jump_callback): Restore part of code for vertical scroll
bar broken in change from 2014-07-27.
(xaw_scroll_callback): Provide incremental scrolling with
horizontal scroll bars.
(x_scroll_bar_handle_click): Fix typo introduced in change from
2014-07-27.
* scroll-bar.el (scroll-bar-horizontal-drag-1): Handle new
interpretation of `portion-whole'.
Glenn Morris [Thu, 28 Aug 2014 02:02:18 +0000 (19:02 -0700)]
Add install/uninstall rules for etc/emacs.appdata.xml
* Makefile.in (appdatadir): New variable.
(install-etc, uninstall, clean): Handle etc/emacs.appdata.xml.
Glenn Morris [Thu, 28 Aug 2014 01:59:29 +0000 (18:59 -0700)]
Merge from emacs-24; up to 2014-07-02T00:57:53Z!juri@jurta.org
Glenn Morris [Thu, 28 Aug 2014 01:55:45 +0000 (18:55 -0700)]
* lisp/subr.el (remq): Revert 2014-08-25 doc change (not always true).
See the interminable bug discussion if you have nothing better to do.
Glenn Morris [Thu, 28 Aug 2014 01:53:26 +0000 (18:53 -0700)]
* etc/emacs.appdata.xml: New file
Ref: http://people.freedesktop.org/~hughsient/appdata/
The description is adapted from the Emacs homepage.
Paul Eggert [Thu, 28 Aug 2014 00:50:36 +0000 (17:50 -0700)]
* sysdep.c (LC_COLLATE, LC_COLLATE_MASK): Give individual defaults.
Fixes: debbugs:18051
Eli Zaretskii [Wed, 27 Aug 2014 19:40:54 +0000 (22:40 +0300)]
Fix bug #18339 with segfault when $ is typed into empty LaTeX buffer.
src/syntax.c (scan_lists): Don't examine positions before BEGV.
Paul Eggert [Wed, 27 Aug 2014 18:56:47 +0000 (11:56 -0700)]
Improve robustness of new string-collation code.
* configure.ac (newlocale): Check for this, not for uselocale.
* src/sysdep.c (LC_COLLATE, LC_COLLATE_MASK, freelocale, locale_t)
(newlocale, wcscoll_l): Define substitutes for platforms that
lack them, so as to simplify the mainline code.
(str_collate): Simplify the code by assuming the above definitions.
Use wcscoll_l, not uselocale, as uselocale is too fragile. For
example, the old version left the Emacs in the wrong locale if
wcscoll reported an error. Use 'int', not ptrdiff_t, for the int
result. Report an error if newlocale fails.
Fixes: debbugs:18051