Paul Eggert [Wed, 30 May 2012 19:23:37 +0000 (12:23 -0700)]
Clean up __executable_start, monstartup when --enable-profiling.
The following changes affect the code only when profiling.
* dispnew.c (__executable_start): Rename from safe_bcopy.
Define only on platforms that need it.
* emacs.c: Include <sys/gmon.h> when profiling.
(_mcleanup): Remove decl, since <sys/gmon.h> does it now.
(__executable_start): Remove decl, since lisp.h does it now.
(safe_bcopy): Remove decl; no longer has that name.
(main): Coalesce #if into single bit of code, for simplicity.
Cast pointers to uintptr_t, since standard libraries want integers
and not pointers.
* lisp.h (__executable_start): New decl.
Troels Nielsen [Tue, 29 May 2012 16:13:38 +0000 (09:13 -0700)]
Do not avoid creating empty evaporating overlays (Bug#9642).
* buffer.c (Fmove_overlay): Reinstate the earlier fix for
Bug#9642, but explicitly check that the buffer the overlay would
be moved to is live and rearrange lines to make sure that errors
will not put the overlay in an inconsistent state.
(Fdelete_overlay): Cosmetics.
Stefan Monnier [Tue, 29 May 2012 14:28:02 +0000 (10:28 -0400)]
Fix minor corner case bugs in byte compilation and pcase.
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand): Don't re-preprocess
functions from byte-compile-function-environment.
* lisp/emacs-lisp/bytecomp.el (byte-compile-constp): Treat #'v as a constant.
(byte-compile-close-variables): Bind byte-compile--outbuffer here...
(byte-compile-from-buffer): ...rather than here.
* lisp/emacs-lisp/pcase.el (pcase--expand): Accept different sets of vars in
different alternative patterns.
(pcase-codegen): Be more careful to preserve identity.
(pcase--u1): Don't forget to mark vars as used.
Juri Linkov [Tue, 29 May 2012 09:46:06 +0000 (12:46 +0300)]
* lisp/isearch.el (isearch-mode-map): Bind `M-s _' to `isearch-toggle-symbol'.
Bind `M-s c' to `isearch-toggle-case-fold'.
(search-map): Bind `M-s _' to `isearch-forward-symbol'.
(isearch-forward): Add `M-s _' to the docstring.
(isearch-forward-symbol, isearch-toggle-case-fold)
(isearch-symbol-regexp): New functions.
Juri Linkov [Tue, 29 May 2012 09:27:39 +0000 (12:27 +0300)]
* lisp/isearch.el (isearch-word): Add docstring.
(isearch-occur, isearch-search-and-update): If `isearch-word' is
a function, call it to get the regexp.
(isearch-message-prefix): If `isearch-word' holds a symbol, use its
property `isearch-message-prefix' instead of the string "word ".
(isearch-search-fun-default): For the case of `isearch-word',
return a lambda that calls re-search-forward/re-search-backward
with a regexp returned by `word-search-regexp' or by the function
in `isearch-word'.
Juri Linkov [Tue, 29 May 2012 09:09:38 +0000 (12:09 +0300)]
* lisp/isearch.el (isearch-search-fun-default): New function.
(isearch-search-fun): Move default part to the new function
`isearch-search-fun-default'.
(isearch-search-fun-function): Set the default value to
`isearch-search-fun-default'.
* lisp/comint.el (comint-history-isearch-end):
Use `isearch-search-fun-default'.
(comint-history-isearch-search): Use `isearch-search-fun-default'
and remove spacial case for `isearch-word'.
(comint-history-isearch-wrap): Remove spacial case for
`isearch-word'.
* lisp/hexl.el (hexl-isearch-search-function):
Use `isearch-search-fun-default'.
* lisp/info.el (Info-isearch-search): Use `isearch-search-fun-default'.
Use `word-search-regexp' for `isearch-word'.
* lisp/misearch.el (multi-isearch-search-fun):
Use `isearch-search-fun-default'.
* lisp/simple.el (minibuffer-history-isearch-search):
Use `isearch-search-fun-default' and remove spacial case for
`isearch-word'.
(minibuffer-history-isearch-wrap): Remove spacial case for
`isearch-word'.
* lisp/textmodes/reftex-global.el (reftex-isearch-wrap-function):
Remove spacial case for `isearch-word'.
(reftex-isearch-isearch-search): Use `isearch-search-fun-default'.
Eli Zaretskii [Mon, 28 May 2012 17:22:40 +0000 (20:22 +0300)]
Fix bug #11513 with raise-frame on MS-Windows.
src/w32term.c (my_bring_window_to_top): New function.
(x_raise_frame): Use handle returned by DeferWindowPos, which
could be different from the original one. Call
my_bring_window_to_top instead of my_set_foreground_window.
src/w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
by calling BringWindowToTop.
src/w32term.h (WM_EMACS_BRINGTOTOP): New message.
(WM_EMACS_END): Increase by one.
* flyspell.el:
(flyspell-check-pre-word-p): Use `string-match'.
(flyspell-delete-region-overlays): Use alternative definition for XEmacs.
(flyspell-delete-all-overlays): Use `flyspell-delete-region-overlays'.
(flyspell-word): Use `process-kill-without-query' if XEmacs.
(flyspell-mode-on): Use `interactive-p' if XEmacs.
(flyspell-incorrect-face, flyspell-duplicate-face):
Do not use `define-obsolete-face-alias' under XEmacs, but old method.
* ispell.el:
(ispell-with-no-warnings): XEmacs alternative `with-no-warnings'
definition or Emacs alias.
(ispell-command-loop, ispell-message): Use `ispell-with-no-warnings'.
(ispell-word): Do not use `region-p' if XEmacs.
Agustín Martín [Mon, 28 May 2012 14:36:27 +0000 (16:36 +0200)]
textmodes/ispell.el: Fix variable name. Show spellchecker on process start.
* (ispell-find-aspell-dictionaries): Check for
`ispell-dictionary-base-alist' instead of full `ispell-dictionary-alist'.
* (ispell-init-process): Show spellchecker when starting new Ispell process.
Paul Eggert [Mon, 28 May 2012 00:46:33 +0000 (17:46 -0700)]
Make 'configure' a bit smaller and faster.
* configure.in (INSTALL_INFO): Set it with one call to
AC_PATH_PROG, not three.
(PKG_CONFIG): Hoist this out of PKG_CHECK_MODULES, since it's
so likely that it'll be needed.
(AC_CHECK_HEADERS_ONCE): Prefer to AC_CHECK_HEADERS where either works.
(AC_PROG_MAKE_SET): Remove; Automake does this.
(sysinfo): Do not check for this function, as it's never used.
(tzset): Check for this function just once.
* admin/CPP-DEFINES: Remove HAVE_SYSINFO.
* m4/manywarnings.m4: Sync from gnulib, incorporating the following:
2012-05-27 manywarnings: remove duplicate -Wmultichar entry
Eli Zaretskii [Sun, 27 May 2012 12:11:23 +0000 (15:11 +0300)]
Fix the MS-Windows build broken by 1995-02-25T20:57:45Z!rms@gnu.org.
lib/makefile.w32-in ($(BLD)/md5.$(O)):
($(BLD)/sha1.$(O)):
($(BLD)/sha256.$(O)):
($(BLD)/sha512.$(O)): Depend on $(EMACS_ROOT)/nt/inc/stdalign.h.
Suggested by Christoph Scholtes <cschol2112@googlemail.com>.
lib/getopt_.h: Regenerate.
nt/inc/stdalign.h: New file.
Paul Eggert [Sat, 26 May 2012 22:27:21 +0000 (15:27 -0700)]
Fix coding-related core dumps with gcc -ftrapv.
The code was computing A - B, where A and B are pointers, and B is
random garbage. This can lead to core dumps on platforms that
have special pointer registers, and it also leads to core dumps on
x86-64 when compiled with gcc -ftrapv. The fix is to compute
A - B only when B is initialized properly.
* coding.c (coding_set_source, coding_set_destination): Return void.
(coding_change_source, coding_change_destinations): New functions,
with the old behaviors of coding_set_source and coding_set_destination.
All callers that need an offset changed to use these new functions.
Glenn Morris [Sat, 26 May 2012 21:23:28 +0000 (14:23 -0700)]
Don't mess with INFOPATH in ns builds
It's not necessary, and would break if INFOPATH was already set (bug#2791).
Ref also
http://lists.gnu.org/archive/html/emacs-devel/2009-05/msg00035.html
http://lists.gnu.org/archive/html/emacs-devel/2005-06/msg00064.html
* lisp/paths.el (Info-default-directory-list):
* lisp/info.el (info-initialize): For self-contained NS builds, put the
included info/ directory at the front.
* src/nsterm.m (ns_init_paths): Don't mess with INFOPATH.
Stefan Monnier [Sat, 26 May 2012 15:52:27 +0000 (11:52 -0400)]
Use `declare' in `lambda' and mis minor changes.
* lisp/subr.el (lambda): Use declare.
* lisp/emacs-lisp/lisp-mode.el (lambda):
* lisp/emacs-lisp/edebug.el (lambda): Move properties to its definition.
* lisp/gnus/legacy-gnus-agent.el (gnus-agent-unhook-expire-days):
* lisp/gnus/gnus-demon.el (gnus-demon-init): Don't bother with type-of.
Eli Zaretskii [Sat, 26 May 2012 12:14:56 +0000 (15:14 +0300)]
Extend mouse support on W32 text-mode console.
src/xdisp.c (draw_row_with_mouse_face): Call
tty_draw_row_with_mouse_face for WINDOWSNT as well.
src/w32console.c: Include window.h.
(w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face): New
functions.
(initialize_w32_display): Initialize mouse-highlight data.
src/w32inevt.c: Include termchar.h and window.h.
(do_mouse_event): Support mouse-autoselect-window. When the mouse
moves, call note_mouse_highlight. If help_echo changed, call
gen_help_event to produce help-echo message in the echo area.
Call clear_mouse_face if mouse_face_hidden is set in the mouse
highlight info.
Eli Zaretskii [Sat, 26 May 2012 09:56:31 +0000 (12:56 +0300)]
Refactor mouse highlight invocation for w32 console.
src/w32inevt.c: Include termchar.h.
(mouse_moved_to): Move the call to note_mouse_highlight from here...
(do_mouse_event): ...to here.
Call clear_mouse_face if mouse_face_hidden is set in the mouse
highlight info.
Eli Zaretskii [Sat, 26 May 2012 09:31:59 +0000 (12:31 +0300)]
Support mouse highlight on w32 text-mode frames.
src/xdisp.c (draw_row_with_mouse_face): Call
tty_draw_row_with_mouse_face for WINDOWSNT as well.
src/w32inevt.c (mouse_moved_to): When the mouse moves, call
note_mouse_highlight.
src/w32console.c: Include window.h.
(w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face): New
functions.
(initialize_w32_display): Initialize mouse-highlight data.
Glenn Morris [Fri, 25 May 2012 18:57:51 +0000 (14:57 -0400)]
There's no reason not to compile version.el
AFAICS, this is ancient code dating from when there was an "inc-vers.el",
that was used to bump the build number on version.el. Nowadays that
happens in loadup.el.
* lisp/version.el: Remove no-byte-compile and associated formatting.
* lisp/loadup.el: No need to load lisp/version.el uncompiled.
Stefan Monnier [Fri, 25 May 2012 18:06:13 +0000 (14:06 -0400)]
* src/lread.c: Remove `read_pure' which makes no difference.
(read_pure): Remove var.
(unreadpure): Remove function.
(readevalloop): Don't call read_list with -1 flag.
(read1, read_vector): Don't test read_pure any more.
(read_list): Simplify.
Stefan Monnier [Fri, 25 May 2012 14:58:17 +0000 (10:58 -0400)]
* lisp/gnus/gnus-win.el (gnus-configure-frame): Don't signal an error when
jumping to *Server* from a dedicated *Group* window.
(gnus-configure-frame): CSE.
* lisp/gnus/gnus-registry.el: Minor style cleanup.
(gnus-registry--set/remove-mark): New function, extracted from
gnus-registry-install-shortcuts.
(gnus-registry-install-shortcuts): Use it.
Eli Zaretskii [Fri, 25 May 2012 10:35:13 +0000 (13:35 +0300)]
Minor fixes for MSDOS build to track latest changes.
msdos/sed6.inp (INFO_EXT): Edit to .info.
(INFO_OPTS): Edit to --no-split.
lisp/cus-start.el <vertical-centering-font-regexp>: Avoid warning on
platforms that don't link in fontset.c.
Juri Linkov [Fri, 25 May 2012 00:55:40 +0000 (03:55 +0300)]
Use the same diff color scheme as in modern VCSes (bug#10181).
* lisp/vc/diff-mode.el (diff-header, diff-file-header): Remove "green"
to avoid confusion with `diff-added' that now uses green colors.
(diff-removed): Use shades of red.
(diff-added): Use shades of green.
(diff-changed): Leave just the yellow color.
(diff-use-changed-face): New variable.
(diff-font-lock-keywords): Use `diff-use-changed-face' to decide
how to highlight context diff changes.
(diff-refine-change): Use shades of yellow.
(diff-refine-removed): New face that uses shades of red.
(diff-refine-added): New face that uses shades of green.
(diff-refine-hunk): Use `diff-refine-change', `diff-refine-added',
`diff-refine-removed' in the call to `smerge-refine-subst'
depending on the value of `diff-use-changed-face'.
* lisp/vc/ediff-init.el (ediff-current-diff-A, ediff-fine-diff-A):
Add face condition `min-colors 88' with shades of red.
(ediff-current-diff-B, ediff-fine-diff-B): Add face condition
`min-colors 88' with shades of green.
(ediff-current-diff-C, ediff-fine-diff-C): Add face condition
`min-colors 88' with shades of yellow.
* lisp/vc/smerge-mode.el (smerge-mine): Use shades of red.
(smerge-other): Use shades of green.
(smerge-base): Use shades of yellow.
(smerge-refined-change): Empty face.
(smerge-refined-removed): New face that uses shades of red.
(smerge-refined-added): New face that uses shades of green.
(smerge-refine-subst): Rename arg `props' to `props-c'. Add new
args `props-r' and `props-a', and use them. Doc fix.
(smerge-refine): Evaluate `smerge-use-changed-face' and depending
on its value use different faces `smerge-refined-change',
`smerge-refined-removed', `smerge-refined-added' in the call to
`smerge-refine-subst'.
Glenn Morris [Thu, 24 May 2012 07:31:45 +0000 (00:31 -0700)]
* paths.el (news-inews-program): Move to gnus/nnspool.el.
* gnus/nnspool.el (news-inews-program): Move here from paths.el.
Don't see a need for this to be autoloaded. (Or even to exist; it is
only used to init another variable.)
Glenn Morris [Thu, 24 May 2012 07:27:24 +0000 (00:27 -0700)]
* paths.el (news-directory, news-path): Move to gnus/nnspool.el.
* gnus/nnspool.el (news-directory, news-path): Move here from paths.el.
Don't see a need for these to be autoloaded. This file is the only
place that uses them, to init another variable.
* paths.el (rmail-file-name, rmail-spool-directory): Move from here...
* mail/rmail.el (rmail-file-name, rmail-spool-directory): ... to here.
Make the latter a defcustom, with a delayed initialization.