1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-01 08:17:38 +00:00
Commit Graph

117231 Commits

Author SHA1 Message Date
Dmitry Antipov
a4a30aa0ec * fileio.c (CHECK_LENGTH): New macro.
(Fexpand_file_name): Use it and get rid of a few more calls
to strlen and strcat.
2014-09-02 09:44:38 +04:00
Dmitry Antipov
068c8b7d6a * fileio.c (Fexpand_file_name): Fix MS-Windows build failure. 2014-09-02 07:47:54 +04:00
Dmitry Antipov
50e9e58007 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.
2014-09-01 20:05:43 +04:00
Eli Zaretskii
203fb3639a nt/gnulib.mk: Synchronize with lib/gnulib.mk. 2014-09-01 18:11:25 +03:00
Eli Zaretskii
4ef0411746 src/w32proc.c (w32_compare_strings): Support "C" and "POSIX" locales. 2014-09-01 18:07:17 +03:00
Eli Zaretskii
cd6f709c4b 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
2014-09-01 18:03:45 +03:00
Eli Zaretskii
0360ec583a 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
2014-09-01 17:57:21 +03:00
Eli Zaretskii
8d033ecb9d src/lastfile.c: Fix last change. 2014-09-01 17:44:33 +03:00
Glenn Morris
acb6f20c3a Auto-commit of loaddefs files. 2014-09-01 06:21:26 -04:00
Paul Eggert
177030baaa Fix typo in previous change's ChangeLog. 2014-09-01 02:54:12 -07:00
Paul Eggert
bc12381e60 --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.
2014-09-01 02:49:51 -07:00
Paul Eggert
1564080f0b 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.
2014-08-31 19:37:22 -07:00
Paul Eggert
56f9f0ab54 * etags.c (emacs_strchr, emacs_strrchr): Remove.
All uses replaced by strchr and strrchr, which are on all
target platforms now.
2014-08-31 17:06:11 -07:00
Christoph Scholtes
60aa41b935 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.
2014-08-31 14:44:36 -06:00
Eli Zaretskii
4457cc825b 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.
2014-08-31 18:46:47 +03:00
Paul Eggert
53d815b09f * configure.ac (__restrict_arr): Remove; no longer used. 2014-08-30 19:50:10 -07:00
Ken Brown
f356dedfe3 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)
2014-08-30 22:40:00 -04:00
Paul Eggert
ced5a8f219 * configure.ac (MAKE): Export it, for config.status.
Needed on AIX when 'configure' infers MAKE=gmake.
2014-08-30 19:34:31 -07:00
Paul Eggert
0ac6761dfb * fns.c (sort_vector): Fix GC bug in previous change. 2014-08-30 16:29:23 -07:00
Paul Eggert
f9caea8233 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
2014-08-30 15:59:39 -07:00
Paul Eggert
88366fcf88 * 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.
2014-08-30 09:47:19 -07:00
Eli Zaretskii
4051f5379c admin/authors.el (authors): Fix last change so it works for MS-Windows as well. 2014-08-30 12:22:53 +03:00
Eli Zaretskii
670e4e486e Minor ChangeLog fixes. 2014-08-30 12:21:16 +03:00
Eli Zaretskii
e7027eab55 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.
2014-08-30 11:19:24 +03:00
Leo Liu
e1a9bbbd4f * NEWS: Mention (:append FUN) to minibuffer-with-setup-hook. 2014-08-30 07:30:50 +08:00
Michael Albinus
fb6cdfc0f0 * sysdep.c (str_collate) [__STDC_ISO_10646__]: Move up setting errno. 2014-08-29 23:19:45 +02:00
Michael Heerdegen
e6a4c15ff1 * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Use mode function
name instead of variable name in hook docstring.  (Bug#18349)
2014-08-29 22:28:19 +02:00
Paul Eggert
7421589fc8 * 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.
2014-08-29 13:16:40 -07:00
Eli Zaretskii
21ba51de76 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
2014-08-29 22:18:06 +03:00
Eli Zaretskii
2ae366c73e Revert a change inadvertently committed in last commit. 2014-08-29 21:30:24 +03:00
Eli Zaretskii
a17b628624 src/sysdep.c (str_collate) [WINDOWSNT]: Fix a typo in 2014-08-29T17:57:36Z!michael.albinus@gmx.de. 2014-08-29 21:29:30 +03:00
Michael Albinus
f894b23d7f * authors.el (authors): Use LOCALE argument of `string-collate-lessp'. 2014-08-29 20:10:15 +02:00
Michael Albinus
b579ae53e4 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.
2014-08-29 19:57:36 +02:00
Dmitry Antipov
55412cd901 Fix ChangeLog entry. 2014-08-29 20:28:53 +04:00
Dmitry Antipov
42d819e9de 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.
2014-08-29 20:21:30 +04:00
Dmitry Antipov
69149b6cc3 * NEWS: Mention that `sort' can handle vectors. 2014-08-29 16:23:30 +04:00
Dmitry Antipov
dd958fb246 * 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.
2014-08-29 15:02:56 +04:00
Martin Rudalics
f0e709846e 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).
2014-08-29 12:39:17 +02:00
Dmitry Antipov
1764ec4414 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.
2014-08-29 11:29:47 +04:00
Michael Albinus
483dc86ad0 Move an entry where it belongs to. 2014-08-29 09:05:23 +02:00
Leo Liu
fd53ccaafc * files.el (minibuffer-with-setup-hook): Allow (:append FUN) to
append to minibuffer-setup-hook.

Fixes: debbugs:18341
2014-08-29 10:48:17 +08:00
Stefan Monnier
562d55be2c Misc accumulated ChangeLog convention fixes 2014-08-28 18:18:39 -04:00
Stefan Monnier
16f1e25b9c * 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'.
2014-08-28 16:37:13 -04:00
Michael Albinus
0f8fb0b98a * net/tramp.el (tramp-handle-shell-command): Use `display-buffer'.
Fixes: debbugs:18326
2014-08-28 21:31:11 +02:00
Martin Rudalics
cd19ba4c00 Revert x_scroll_bar_handle_click "typo fix". 2014-08-28 20:33:18 +02:00
Ken Brown
ea65250077 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.
2014-08-28 10:48:02 -04:00
Martin Rudalics
a7ef7a0e53 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'.
2014-08-28 08:46:58 +02:00
Glenn Morris
f1fdf67b4e Add install/uninstall rules for etc/emacs.appdata.xml
* Makefile.in (appdatadir): New variable.
(install-etc, uninstall, clean): Handle etc/emacs.appdata.xml.
2014-08-27 19:02:18 -07:00
Glenn Morris
6d26235315 Merge from emacs-24; up to 2014-07-02T00:57:53Z!juri@jurta.org 2014-08-27 18:59:29 -07:00
Glenn Morris
93b31b5728 * 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.
2014-08-27 18:55:45 -07:00