Chong Yidong [Sun, 3 Jun 2012 09:03:23 +0000 (17:03 +0800)]
Implement default help-echo for mode line.
* lisp/bindings.el: Remove explicit help-echo from format-mode-line.
(mode-line-front-space, mode-line-end-spaces)
(mode-line-misc-info): New variables.
(mode-line-modes, mode-line-position): Move the default value to
the variable definition.
(mode-line-default-help-echo): New defcustom.
* src/buffer.c (buffer_local_value_1): New function, split from
Fbuffer_local_value; can return Qunbound.
(Fbuffer_local_value): Use it.
(Vmode_line_format): Docstring tweaks.
* src/xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
(note_mode_line_or_margin_highlight): If there is no help echo,
use mode-line-default-help-echo. Handle the case where the mouse
position is past the end of the mode line string.
* doc/lispref/modes.texi (Mode Line Data): Use "mode line construct"
terminology for consistency.
Stefan Monnier [Sat, 2 Jun 2012 19:21:34 +0000 (15:21 -0400)]
* lisp/simple.el (execute-extended-command): Set real-this-command.
* src/keyboard.c: Export real-this-command to Elisp.
(syms_of_keyboard): Rename real_this_command to Vreal_this_command
and DEFVAR it. Update all users.
* dired.el (dired-sort-set-mode-line): Rename from
dired-sort-set-modeline. All callers changed.
* foldout.el (foldout-mode-line-string): Rename from
foldout-modeline-string. All callers changed.
(foldout-update-mode-line): Rename from foldout-update-modeline.
* strokes.el (strokes-lighter): Rename from
strokes-modeline-string.
* subr.el (redraw-modeline): Make into obsolete alias.
* calendar/timeclock.el (timeclock-mode-line-display): Rename from
timeclock-modeline-display. Make old name an alias.
(timeclock-update-mode-line): Likewise. All callers changed.
(timeclock-mode-line-display): No need to check before using
add-hook.
(timeclock-relative, timeclock-day-over-hook)
(timeclock-use-elapsed, timeclock-mode-string)
(timeclock-mode-line-display): Doc fix, "modeline" -> "mode line".
* emulation/crisp.el (crisp-mode-mode-line-string): Rename from
crisp-mode-modeline-string.
* erc-track.el (erc-track, erc-track-faces-priority-list)
(erc-track-faces-normal-list, erc-track-find-face)
(erc-track-modified-channels): Fix modeline -> mode line in docs.
* eshell/esh-mode.el (eshell-status-in-mode-line): Rename from
eshell-status-in-modeline.
Chong Yidong [Sat, 2 Jun 2012 07:30:07 +0000 (15:30 +0800)]
Add more enabled ImageMagick types.
* lisp/image.el (imagemagick-enabled-types): Rename from
imagemagick-types-enable. Add many more types.
(imagemagick-types-inhibit): Change default to nil.
(imagemagick-filter-types): Caller changed.
Stefan Monnier [Fri, 1 Jun 2012 20:36:00 +0000 (16:36 -0400)]
* lisp/emacs-lisp/cl-macs.el: Use backquotes.
(cl-transform-function-property): Use eval-and-compile rather than
abusing `require'.
(defstruct): Use declare-function instead of with-no-warnings.
Stefan Monnier [Fri, 1 Jun 2012 20:24:17 +0000 (16:24 -0400)]
* lisp/gnus/nntp.el: Stop the `letf' madness.
(nntp--report-1): New var.
(nntp-report): Merge nntp-report-1 into it.
(nntp-with-open-group-function): Set nntp--report-1 instead of modifying
the nntp-report function.
Stefan Monnier [Fri, 1 Jun 2012 19:47:54 +0000 (15:47 -0400)]
* lisp/emacs-lisp/bytecomp.el: Fix last change.
(byte-compile-output-docform): Re-add the print-circle bindings.
(byte-compile-fix-header): Use #$ just because it's shorter.
(byte-compile-output-file-form): Remove defun/defmacro.
Paul Eggert [Fri, 1 Jun 2012 18:26:21 +0000 (11:26 -0700)]
Remove --disable-maintainer-mode option from 'configure'. (Bug#11555)
It is confusingly named and rarely useful. See, for example,
<http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00089.html>.
* INSTALL.BZR: Don't mention --disable-maintainer-mode.
* Makefile.in (MAINTAINER_MODE_FLAG): Remove; all uses removed.
* configure.in: Remove --disable-maintainer-mode.
(USE_MAINTAINER_MODE, MAINT): Remove.
* admin/make-tarball.txt: Don't worry about maintainer mode.
* etc/NEWS: Mention this.
Dmitry Antipov [Fri, 1 Jun 2012 03:41:03 +0000 (07:41 +0400)]
For a 'struct window', replace some Lisp_Object fields to
bitfields where appropriate, remove unused fields.
* window.h (struct window): Remove unused 'last_mark_x' and
'last_mark_y' fields. Rename 'mini_p' field to 'mini',
change it's type from Lisp_Object to bitfield.
Change type of 'force_start', 'optional_new_start',
'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fields from Lisp_Object to bitfield. Adjust users accordingly.
Glenn Morris [Thu, 31 May 2012 07:22:33 +0000 (00:22 -0700)]
Add option imagemagick-types-enable
* lisp/image.el: For clarity, call imagemagick-register-types at
top-level, rather than relying on a custom :initialize.
(imagemagick-types-enable): New option.
(imagemagick-register-types): Respect imagemagick-types-inhibit.
If disabling support, remove elements altogether rather
than using an impossible regexp.
(imagemagick-types-inhibit): Give it the default init function.
Paul Eggert [Thu, 31 May 2012 06:51:43 +0000 (23:51 -0700)]
Pacify gcc -Wdouble-precision when using Xaw.
* xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
[HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
Use 'float' consistently, rather than 'float' in most places
and 'double' in a couple of places.
Paul Eggert [Thu, 31 May 2012 05:08:37 +0000 (22:08 -0700)]
Remove obsolete '#define static' cruft.
* etc/PROBLEMS: Remove obsolete '#define static' cruft.
* lwlib/xlwmenu.c [emacs]: Include "bitmaps/gray.xbm".
(gray_bitmap_width, gray_bitmap_height, gray_bitmap_bits) [!emacs]:
Remove; all uses replaced with definiens.
* src/s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
This #undef was "temporary" in 2000; it is no longer needed
now that '#define static' has gone away.
* src/xfns.c, src/xterm.h (gray_bitmap_width, gray_bitmap_height)
(gray_bitmap_bits): Remove; no longer needed.
All uses replaced with definiens.
* src/xterm.c: Include "bitmaps/gray.xbm".
Stefan Monnier [Thu, 31 May 2012 01:41:17 +0000 (21:41 -0400)]
Add `declare' for `defun'. Align `defmacro's with it.
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode)
(define-globalized-minor-mode): Don't autoload the var definitions.
* lisp/emacs-lisp/byte-run.el: Use lexical-binding.
(defun-declarations-alist, macro-declarations-alist): New vars.
(defmacro, defun): Use them.
(make-obsolete, define-obsolete-function-alias)
(make-obsolete-variable, define-obsolete-variable-alias):
Use `declare'.
(macro-declaration-function): Mark obsolete.
* lisp/emacs-lisp/autoload.el: Use lexical-binding.
(make-autoload): Add `expansion' arg. Rely more on macro expansion.
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.
Eli Zaretskii [Wed, 30 May 2012 18:09:17 +0000 (21:09 +0300)]
Fix bug #11587 with a crash in an Info buffer under linum-mode.
src/xdisp.c (handle_stop): Detect whether we have overlay strings
loaded by testing it->current.overlay_string_index to be
non-negative, instead of checking whether n_overlay_strings is
positive.
Eli Zaretskii [Tue, 29 May 2012 16:15:12 +0000 (19:15 +0300)]
Fix bug #11405 with MSVC build of emacsclientw.
lib-src/makefile.w32-in ($(BLD)/emacsclientw.exe): Use $(MWINDOWS)
instead of a literal -mwindows, which is not supported by MSVC.
nt/nmake.defs (MWINDOWS): Define as "-subsystem:windows -entry:mainCRTStartup".
Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
nt/gmake.defs (MWINDOWS): Define as "-mwindows".
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.
Eli Zaretskii [Tue, 29 May 2012 16:01:05 +0000 (19:01 +0300)]
Don't call r_alloc_inhibit_buffer_relocation from search.c.
src/search.c (search_buffer): Remove calls to
r_alloc_inhibit_buffer_relocation, as it is now called by
maybe_unify_char, which was the cause of relocation of buffer text
in bug#11519.
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.
Eli Zaretskii [Mon, 28 May 2012 16:50:10 +0000 (19:50 +0300)]
Avoid buffer text relocations in calls to STRING_CHAR_* macros.
src/charset.c (maybe_unify_char): Inhibit relocation of buffer text
for the duration of call to load_charset, to avoid problems with
callers of maybe_unify_char that access buffer text through C
pointers.
src/ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
decrement the inhibition flag, instead of just setting or
resetting it.
Eli Zaretskii [Mon, 28 May 2012 16:17:35 +0000 (19:17 +0300)]
Fix subtle problem with redirection in nt/configure.bat.
nt/configure.bat (genmakefiles): Move the redirection away from the
end of the command, to avoid excess whitespace at the end of Make
variables created at configure time, and also avoid things like
"FOO1>>config.settings", where "1" gets interpreted as the file
descriptor and eaten up. This fixes breakage introduced by the
last change, without reintroducing the bug fixed by that change.
* 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.