Paul Eggert [Wed, 11 Jun 2014 17:51:27 +0000 (10:51 -0700)]
Use a shell function in configure.ac to cut down on code duplication.
* configure.ac (emacs_check_gnu_make): New shell function.
Use it to avoid duplication when checking for GNU Make.
It's OK for 'configure' to use shell functions these days,
as long as we follow the advice in the 'Shell Functions'
section of the Autoconf manual.
Eli Zaretskii [Wed, 11 Jun 2014 16:11:32 +0000 (19:11 +0300)]
Fix bug #17744 with cursor motion near overlay string with 'cursor' prop.
src/xdisp.c (set_cursor_from_row): Fix an off-by-one error when
matching overlay strings with 'cursor' property against buffer
positions traversed in the glyph row.
Paul Eggert [Tue, 10 Jun 2014 19:43:13 +0000 (12:43 -0700)]
Rely on AC_CANONICAL_HOST to detect whether we're using mingw.
See the thread containing:
http://lists.gnu.org/archive/html/emacs-devel/2014-06/msg00206.html
* configure.ac (AC_CANONICAL_HOST): Invoke this as early as we
can, which is just after AM_INIT_AUTOMAKE. Then check for mingw
just after that.
Dmitry Antipov [Tue, 10 Jun 2014 03:13:41 +0000 (07:13 +0400)]
* dispextern.h (PREPARE_FACE_FOR_DISPLAY): Remove as a duplicate of ...
* xfaces.c (prepare_face_for_display) [HAVE_WINDOW_SYSTEM]: ... this
function. Also adjust comment.
* fringe.c, w32term.c, xdisp.c, xterm.c: All users changed.
Glenn Morris [Tue, 10 Jun 2014 02:20:31 +0000 (22:20 -0400)]
Add .info extension to @setfilename commands in doc/
This makes no difference to anything, since we always use makeinfo -o,
but it makes automake happier, if we ever decide to use that.
Paul Eggert [Mon, 9 Jun 2014 20:31:06 +0000 (13:31 -0700)]
Say (accept-process-output P)'s result pertains to P if P is non-nil.
* doc/lispref/processes.texi (Accepting Output):
* src/process.c (Faccept_process_output)
(wait_reading_process_output): Mention that if PROCESS is non-nil,
the return value is about PROCESS, not about other processes.
Dmitry Antipov [Mon, 9 Jun 2014 15:03:49 +0000 (19:03 +0400)]
Further adjustments to mark_object and friends.
Now the mark_object's stack is just 32 bytes on a 64-bit
system, which means extra 20% off the stack usage.
* alloc.c (mark_save_value): As before, refactored out from ...
(mark_object): ... adjusted user. Also add comment.
Karl Berry [Sun, 8 Jun 2014 19:30:13 +0000 (22:30 +0300)]
Simplify info.info for the stand-alone reader
doc/misc/info.texi (Help-^L): "mode line", "screenful",
stand-alone and Emacs Info both use the mode line.
Use x instead of weird C-x 0 to get rid of help msg
in standalone Info.
Dmitry Antipov [Sun, 8 Jun 2014 15:06:03 +0000 (19:06 +0400)]
Change object marking routines to minimize stack usage.
This change moves a few cold paths from mark_object to NO_INLINE
functions and adjusts symbol marking loop. According to GCC 4.8.2
-Wstack-usage, this reduces mark_object's stack usage from 80 to
48 bytes on a 64-bit system. For a long byte-force-recompile runs,
stack usage at the mark phase is reduced up to 28%. Surprisingly,
it also gains up to 3% in speed (with default '-O2 -g3' flags).
* alloc.c (mark_compiled, mark_localized_symbol): New functions,
refactored out from ...
(mark_object): ... adjusted user. Also mark symbols in a tight
inner loop.
(mark_face_cache): Add NO_INLINE.
Glenn Morris [Sun, 8 Jun 2014 07:00:20 +0000 (00:00 -0700)]
info.texi tweaks re S-SPC
* doc/misc/info.texi (Help-Small-Screen): Clarify details of S-SPC.
(Help-Small-Screen, Help-]): Do not mention S-SPC.
(Emacs Info Variables): Markup fix.
Eli Zaretskii [Sat, 7 Jun 2014 07:25:49 +0000 (10:25 +0300)]
Fix last commit.
src/term.c (tty_menu_show) [WINDOWSNT]: Make tty_menu_show extern
only for WINDOWSNT.
src/menu.h (tty_menu_show) [WINDOWSNT]: Declare extern only for WINDOWSNT.
Paul Eggert [Sat, 7 Jun 2014 06:10:39 +0000 (23:10 -0700)]
Port better to AIX.
* configure.ac (with_xpm_set): New shell var.
(_THREAD_SAFE): Define on AIX if HAVE_PTHREAD.
(with_xpm): Default to 'no' on AIX.
(LIBXPM): Append -lXpm if -lXaw is also used, as the latter
requires the former on AIX.
Juri Linkov [Fri, 6 Jun 2014 23:38:40 +0000 (02:38 +0300)]
* lisp/desktop.el: Activate auto-saving on window configuration changes.
(desktop-save-mode, desktop-auto-save-timeout): Add/remove
`desktop-auto-save-set-timer' to/from `window-configuration-change-hook'.
(desktop-auto-save-set-timer): Change REPEAT arg of
`run-with-idle-timer' from t to nil.
http://lists.gnu.org/archive/html/emacs-devel/2014-06/msg00147.html
* lisp/vc/vc-hg.el (vc-hg-log-graph): New var.
(vc-hg-print-log): Use it.
(vc-hg-root-log-format): Include branch name and bookmarks; ignore
graph output.
Stefan Monnier [Fri, 6 Jun 2014 02:35:17 +0000 (22:35 -0400)]
* lisp/mouse.el (mouse-posn-property): Ignore buffer position info when the
even happened elsewhere.
* src/keyboard.c (make_lispy_position): Don't include a buffer position in
mode/header-line mouse events.
tildify.el: Rewrite `tildify-region' and co., add foreach function.
* lisp/textmodes/tildify.el (tildify-foreach-region-outside-env): New
function which calls a callback on portions of the buffer that are
outside of ignored environments.
(tildify-build-regexp): Remove function since it is now
incorporated in `tildify-foreach-region-outside-env' where it is
optimised and simplified by the use of `mapconcat'.
(tildify-tildify): Return number of substitutions made so that…
(tildify-count): …can be removed.
(tildify-find-env): Accept a new PAIRS argument which was
previously looked up in `tildify-ignored-environments-alist' each
time the function was called. With this change, the lookup is
performed only once in `tildify-foreach-region-outside-env'.
(tildify-region): Greatly simplify the function since now most of
the work is done by `tildify-foreach-region-outside-env'.
(tildify-mode-alist): Simplify slightly by avoiding if and setq
and instead using or.
* tests/automated/tildify-tests.el (tildify-test-find-env-end-re-bug)
(tildify-test-find-env-group-index-bug): Update to support new
signature of the `tildify-foreach-region-outside-env' function.
Namely, it now takes pairs as an argument instead of looking it up in
`tildify-ignored-environments-alist'.
* lisp/textmodes/tildify.el (tildify-ignored-environments-alist):
Each time beginning of an environment to ignore is found,
`tildify-find-env' needs to identify regexp for the ending
of the environment. This is done by trying all the opening
regexes on matched text in a loop, so to speed that up, this
loop should have fewer things to match, which can be done by
using alternatives in the opening regexes.
Coincidentally, this should make matching of the opening
regexp faster as well thanks to the use of `regexp-opt' and
having common prefix pulled from many regexes.
* lisp/textmodes/tildify.el (tildify-string-alist)
(tildify-ignored-environments-alist): Add `nxml-mode' to the list of
supported modes since `xml-mode' is no longer a thing but just an
alias to the former. Also include comments and insides of tags in
`tildify-ignored-environments-alist' for XML modes. Finally, since
XML does not define “ ”[1], use a numeric reference for
a no-break space (namely “ ”)
[1] XML specification defines only a handful of predefined entities.
The list is at <http://www.w3.org/TR/REC-xml/#sec-predefined-ent>
and includes only <, >, &, ' and " (meaning <,
>, &, ' and " respectively). This is in contrast to HTML and even
XHTML which defined a whole bunch of entities including “ ”.
* automated/tildify-tests.el (tildify-test--example-html): Add support
for generating XML code, so that…
(tildify-test-xml) …test can be added to check handling of XML
documents.
* lisp/textmodes/tildify.el (tildify-pattern-alist)
(tildify-string-alist, tildify-ignored-environments-alist):
Add more tags explaining what each value means and replace
“sexp” used in `tildify-ignored-environments-alist' with
a full type declaration.
tildify.el: Fix matched group indexes in end-regex building
* lisp/textmodes/tildifi.el (tildify-find-env): When looking for
a start of an ignore-environment, the regex is built by
concatenating regexes of all the environments configured in
`tildify-ignored-environments-alist'. So for example, the following
list could be used to match TeX's \verb and \verb* commands:
This would result in the following regex being used to find the start
of any of the variants of the \verb command:
\\\\verb\\(.\\)\\|\\\\verb\\*\\(.\\)
But now, if “\\\\verb\\*\\(.\\)” matches, the first capture group
won't match anything, and thus (match-string 1) will be nil, which
will cause building of the end-matching regex to fail.
Fix this by using capture groups from the time when the opening
regexes are matched individually.
* tests/automated/tildify-tests.el (tildify-test-find-env-group-index-bug):
New test validating fix to the above bug.
tildify.el: Fix end-regex building in `tildify-find-env'
* lisp/textmodes/tildify.el (tildify-find-env): The
`tildify-ignored-environments-alist' allows the end-regex
to be provided not as a static string but mix of strings and
indexes of groups matched the begin-regex. For example, the
“\verb!…!” TeX-command (where “!” is an arbitrary character)
is handled using:
("\\\\verb\\*?\\(.\\)" . (1))
In the same way, the following should be supported as well:
("open-\\(.\\)" . ("end-" 1))
However the tildify-find-env function fails at
(concat result
(if (stringp (setq aux (car expression)))
expression ; BUG: expression is a list
(regexp-quote (match-string aux))))
where the string part is handled incorrectly.
The most trivial fix would be to replace `expression'
in the true-part of the if-statement with `aux', but
instead, this commit optimises `tildify-find-env' by
changing it to use `mapconcat' rather than open-coded
while-loop.
* tests/automated/tildify-tests.el (tildify-test-find-env-end-re-bug):
New test validating fix to the above bug.
Paul Eggert [Thu, 5 Jun 2014 08:03:22 +0000 (01:03 -0700)]
Try harder to find GNU Make when configuring.
* configure.ac (AC_PROG_MAKE_SET): Define a dummy.
(MAKE): Set it to GNU Make, if one can be found.
Search PATH for 'make', 'gmake', 'gnumake'.
This works better on platforms like AIX, where GNU Make
might be in /opt/freeware/bin/make, and reside
behind /usr/bin/make in the PATH.
Dmitry Antipov [Thu, 5 Jun 2014 06:24:54 +0000 (10:24 +0400)]
* configure.ac (POLL_FOR_INPUT): Define with HAVE_WINDOW_SYSTEM.
* nt/inc/ms-w32.h (POLL_FOR_INPUT): Likewise.
* src/keyboard.c, src/process.c: Do not define POLL_FOR_INPUT here
because it will be defined in generated config.h if needed.
Katsumi Yamaoka [Thu, 5 Jun 2014 04:31:36 +0000 (04:31 +0000)]
Gnus: fix last change
* gnus-art.el (gnus-article-edit-part): Don't modifiy markers.
(gnus-article-read-summary-keys):
Don't bug out when there is no article in the summary buffer.
Katsumi Yamaoka [Thu, 5 Jun 2014 01:38:42 +0000 (01:38 +0000)]
Gnus: bugfixes to make `gnus-mime-save-part-and-strip' work again
* gnus-art.el (gnus-mm-display-part):
* mm-decode.el (mm-shr):
* mm-view.el (mm-inline-text-html-render-with-w3m, mm-inline-text)
(mm-insert-inline): Set insertion type of end-marker, not only
start-marker, of undisplayer so as to stay after inserted text.
Eli Zaretskii [Wed, 4 Jun 2014 09:16:46 +0000 (12:16 +0300)]
Attempt to solve bug #17497 by minimizing cursor motion during TTY menu updates.
src/term.c (tty_menu_display): Don't position cursor here. Instead,
pass the cursor coordinates to update_frame_with_menu.
(tty_menu_activate): Send the hide cursor command only once in an
iteration through the outer 'while' loop.
src/dispnew.c (update_frame_1): Accept an additional argument
SET_CURSOR_P, and position the cursor at the end of the frame
update only if that argument is non-zero. All callers changed to
provide the additional argument as non-zero, except for
update_frame_with_menu.
(update_frame_with_menu): Accept 2 additional arguments ROW and
COL; if they are non-negative, instruct update_frame_1 not to
position the cursor, and instead position it according to ROW and
COL.
src/dispextern.h (update_frame_with_menu): Update prototype.
Dmitry Antipov [Wed, 4 Jun 2014 04:58:31 +0000 (08:58 +0400)]
Use terminal-specific hooks to display menus.
* termhooks.h (struct terminal): New field menu_show_hook.
* menu.h (<anonymous enum>): Bit flags for menu hooks.
(x_menu_show, w32_menu_show, ns_menu_show, tty_menu_show):
Adjust prototypes.
* menu.c (Fx_popup_menu): Use bit flags and menu_show_hook.
* nsmenu.m (ns_menu_show):
* w32menu.c (w32_menu_show):
* xmenu.c (x_menu_show):
* term.c (tty_menu_show): Adjust to use bit flags.
(set_tty_hooks): Set menu_show_hook.
* xterm.c (x_create_terminal):
* nsterm.m (ns_create_terminal):
* msdos.c (initialize_msdos_display):
* w32term.c (w32_create_terminal): Likewise.
Paul Eggert [Tue, 3 Jun 2014 19:59:55 +0000 (12:59 -0700)]
Do not require libXt-devel when building with gtk.
* lwlib/lwlib-widget.h: New file, with contents taken from lwlib.h.
(widget_value) [HAVE_NTGUI]: New member 'title'.
* lwlib/lwlib.h: Include lwlib-widget.h.
(change_type, enum button_type, widget_value):
Move to lwlib-widget.h.
* src/gtkutil.h, src/menu.h: Include lwlib-widget.h, not lwlib-h, to avoid
dependency on libXt-devel.
* src/menu.h [HAVE_NTGUI]: Include lwlib-widget.h in this case too.
(enum button_type, widget_value) [HAVE_NTGUI]: Remove, as
lwlib-widget.h now does this.
* src/nsmenu.m (ns_menu_show): "enabled" -> "enable" to fix typo.
Eli Zaretskii [Tue, 3 Jun 2014 07:28:07 +0000 (10:28 +0300)]
Define the size of dumped data for MS-Windows locally on w32heap.c.
configure.ac (C_HEAP_SWITCH): Remove.
src/w32heap.c (DUMPED_HEAP_SIZE): Move from w32heap.h. Don't use
HEAPSIZE; instead, define separate values for the 32- and 64-bit
builds.
src/Makefile.in (C_HEAP_SWITCH): Remove.
(ALL_CFLAGS): Don't use $(C_HEAP_SWITCH).
Eli Zaretskii [Tue, 3 Jun 2014 06:51:18 +0000 (09:51 +0300)]
Fix MS-Windows build broken by menu changes on 2014-06-02.
src/w32menu.c (w32_menu_show): Fix a typo that broke compilation.
src/menu.h (enum button_type, struct _widget_value) [HAVE_NTGUI]:
Define instead of including ../lwlib/lwlib.h, which causes
compilation errors due to missing X11 headers.