Paul Eggert [Wed, 23 Oct 2013 04:01:46 +0000 (21:01 -0700)]
Merge from gnulib.
This incorporates:
2013-10-14 acl: allow cross-compilation to Gentoo
2013-10-18 extern-inline: make safe for -Wundef usage
2013-09-30 fpending: use pure+const function attrs
* lib/fpending.h, m4/acl.m4, m4/extern-inline.m4: Update from gnulib.
Stefan Monnier [Tue, 22 Oct 2013 15:45:56 +0000 (11:45 -0400)]
* lisp/emacs-lisp/smie.el (smie-rule-parent): Fix opener-test.
* lisp/progmodes/ruby-mode.el (ruby-smie-rules):
Remove corresponding workaround. Fix indentation rule of ";" so it
also applies when ";" is the parent.
Katsumi Yamaoka [Tue, 22 Oct 2013 10:22:59 +0000 (10:22 +0000)]
lisp/gnus/mm-decode.el (mm-dissect-buffer): Guess content-type if the first token is missing in the Content-Type header
lisp/gnus/nndoc.el (nndoc-dissect-mime-parts-sub): Ditto
Dmitry Gutov [Mon, 21 Oct 2013 22:25:59 +0000 (02:25 +0400)]
* lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Remove outdated
TODO. Add "." after " @ ".
(ruby-smie--at-dot-call): New function. Checks if point at method
call with explicit target.
(ruby-smie--forward-token, ruby-smie--backward-token): Prepend "."
to the method name tokens when it precedes them.
(ruby-smie--backward-id, ruby-smie--forward-id): Remove.
(ruby-smie-rules): Add rule for indentation before and after "."
token.
Dmitry Antipov [Mon, 21 Oct 2013 14:11:25 +0000 (18:11 +0400)]
Do not allow font caches to grow too large.
* alloc.c (compact_font_cache_entry, compact_font_caches):
New functions or stub if not HAVE_WINDOW_SYSTEM.
(compact_undo_list): Factor out from Fgarbage_collect.
Add comment.
(mark_face_cache): Mark face font. Move down to avoid
extra prototypes.
(mark_terminals): Do not mark font cache here.
(Fgarbage_collect): Call compaction functions described
above. Adjust comment.
Dmitry Gutov [Mon, 21 Oct 2013 03:50:06 +0000 (07:50 +0400)]
* lisp/progmodes/ruby-mode.el (ruby-mode-map): Add binding for
`smie-down-list'.
(ruby-smie--args-separator-p): Check that there's no newline
between method call and its arguments.
(ruby-smie-rules): Handle new cases: curly block with and without
parameters, hash surrounded with parens, block passed to
paren-less method call.
* test/indent/ruby.rb: New examples for indentation of blocks. Example
of hash inside parens that inflooped before this commit.
Alan Mackenzie [Sun, 20 Oct 2013 14:27:22 +0000 (14:27 +0000)]
Allow comma separated lists after Java "implements".
* progmodes/cc-engine.el (c-backward-over-enum-header): parse
commas.
* progmodes/cc-fonts.el (c-basic-matchers-after): Remove comma
from a "disallowed" list in enum fontification.
Alan Mackenzie [Sat, 19 Oct 2013 15:11:07 +0000 (15:11 +0000)]
Fix fontification bugs with constructors and const.
* progmodes/cc-engine.el (c-forward-decl-or-cast-1): (Just after
CASE 2) Remove the check for the absence of a suffix construct
after a function declaration with only types (no identifiers) in
the parentheses. Also, accept a function declaration with just a
type inside the parentheses, if this type can be positively
recognised as such, or if a prefix keyword like "explicit" nails
down the construct as a declaration.
Eli Zaretskii [Sat, 19 Oct 2013 08:35:51 +0000 (11:35 +0300)]
Fix TTY menus when they lead to a minibuffer prompt.
lisp/menu-bar.el (tty-menu-navigation-map): Bind mouse-N to perform
TTY menu actions and down-mouse-N to tty-menu-ignore. This solves
the problem whereby selecting a menu item that leads to a
minibuffer prompt moves the cursor out of the minibuffer window,
making it hard to type at the prompt. Suggested by Stefan Monnier
<monnier@iro.umontreal.ca>.
Eli Zaretskii [Fri, 18 Oct 2013 13:33:25 +0000 (16:33 +0300)]
Fix clicks on the menu bar when GPM mouse is in use.
src/keyboard.c (make_lispy_event): Remove GPM-specific code that
handles mouse clicks. Instead, let GPM use the same code as all
the other mice use. See the discussion starting at
http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00521.html
for the details of the problem with the menu bar this fixes.
Barry O'Reilly [Fri, 18 Oct 2013 04:27:34 +0000 (00:27 -0400)]
Don't run timers in input-pending-p. Its new check-timers param
provides the prior behavior..
* src/keyboard.c (Finput_pending_p): Accept optional check-timers
param.
* lisp/subr.el (sit-for): Call (input-pending-p t) so as to behave
as before.
* test/automated/timer-tests.el: New file. Tests that (sit-for 0)
allows another timer to run.
* net/tramp-cache.el (top): Suppress traces when reading
presistency file.
* net/tramp-sh.el (tramp-sh-handle-file-notify-add-watch):
Refactor common code. Improve debug message.
(tramp-maybe-open-connection)
* net/tramp-smb.el (tramp-smb-call-winexe): Do not request
connection buffer too early.
* net/tramp-smb.el (tramp-smb-actions-get-acl): New defconst, renamed
from `tramp-smb-actions-with-acl'.
(tramp-smb-actions-set-acl): New defconst.
(tramp-smb-handle-copy-directory)
(tramp-smb-action-get-acl): New defun, renamed from
`tramp-smb-action-with-acl'.
(tramp-smb-action-set-acl): New defun.
(tramp-smb-handle-set-file-acl): Rewrite.
Paul Eggert [Thu, 17 Oct 2013 01:02:32 +0000 (18:02 -0700)]
bool vector int width fixes
* data.c (bool_vector_spare_mask, Fbool_vector_count_matches)
(Fbool_vector_count_matches_at):
Use EMACS_INT, not ptrdiff_t, to record bit counts, as a bit count
can exceed PTRDIFF_MAX, at least in theory.
(Fbool_vector_count_matches_at):
Use int, not ptrdiff_t, to record a value that can't exceed INT_MAX.
Eli Zaretskii [Wed, 16 Oct 2013 15:44:02 +0000 (18:44 +0300)]
Implement network-interface-* functions for MS-Windows (bug #15610).
src/w32.c (network_interface_get_info, network_interface_list)
(network_interface_info): New functions.
(GetAdaptersInfo_Proc): New typedef.
(get_adapters_info): New wrapper function.
(globals_of_w32): Initialize g_b_init_get_adapters_info.
src/process.h (network_interface_list, network_interface_info): New
prototypes.
src/process.c (conv_sockaddr_to_lisp): Now externally-visible.
(Fnetwork_interface_list, Fnetwork_interface_info): Define for
all systems. Return non-nil for systems that HAVE_NET_IF_H and
for WINDOWSNT. Doc fix.
(syms_of_process): Defsubr Snetwork_interface_list and
Snetwork_interface_info unconditionally.
Eli Zaretskii [Tue, 15 Oct 2013 18:38:26 +0000 (21:38 +0300)]
Support mouse wheel on MS-Windows text-mode console.
src/w32inevt.c (do_mouse_event): Support mouse wheel and all the 5
standard mouse buttons.
src/termhooks.h (struct input_event): Remove incorrect commentary.
Paul Eggert [Tue, 15 Oct 2013 16:38:36 +0000 (09:38 -0700)]
Disallow bool vector operations on mixed-length operands.
The old behavior left garbage in the result vector sometimes,
and didn't seem to be useful.
* data.c (Qwrong_length_argument): New static var.
(wrong_length_argument): New function.
(bool_vector_binop_driver): Check that args agree in length.
Eli Zaretskii [Mon, 14 Oct 2013 15:37:12 +0000 (18:37 +0300)]
Implement scrolling of TTY menus when the screen is too short.
src/term.c (tty_menu_display): Accept an additional argument, the
menu item from which to start displaying the menu. Account for
the value of Y when limiting the menu to the number of available
screen lines.
(mi_result): New enumeration.
(read_menu_input): Return enumerated value. When the y coordinate
hits min_y or max_y, return scroll indication instead of wrapping
around the menu.
(tty_menu_activate): Handle the scrolling indications from
read_menu_input. Compute the first menu item to display and pass
it to tty_menu_display.
lisp/menu-bar.el (tty-menu-navigation-map): Bind shifted mouse clicks
to commands that scroll the menu.
Paul Eggert [Mon, 14 Oct 2013 07:12:49 +0000 (00:12 -0700)]
* lisp.h (bool_vector_size): New function.
All uses of XBOOL_VECTOR (x)->size changed to bool_vector_size (x).
* data.c (bool_vector_spare_mask, bool_vector_binop_driver)
(Fbool_vector_not, Fbool_vector_count_matches_at):
Remove uses of 'eassume' that should no longer be needed,
because they are subsumed by the 'eassume' in bool_vector_size.
Akinori MUSHA [Mon, 14 Oct 2013 00:23:29 +0000 (03:23 +0300)]
* progmodes/ruby-mode.el (ruby-encoding-map): Add a mapping from
`japanese-cp932' to `cp932' to fix the problem where saving a
source file written in Shift_JIS twice would end up having
`coding: japanese-cp932' which Ruby could not recognize.
(ruby-mode-set-encoding): Add support for encodings mapped to nil
in `ruby-encoding-map'.
(ruby-encoding-map): Map `us-ascii' to nil by default, meaning it
doesn't need to be explicitly declared in magic comment.
(ruby-encoding-map): Add type declaration for better customize UI.
Dmitry Gutov [Sun, 13 Oct 2013 21:35:31 +0000 (00:35 +0300)]
* lisp/progmodes/ruby-mode.el (ruby-mode): Add `ruby-mode-set-encoding'
to `after-save-hook' instead of `before-save-hook'.
(ruby-mode-set-encoding): Use the value of coding system used to
write the file. Call `basic-save-buffer-1' after modifying the
buffer.
Alan Mackenzie [Sun, 13 Oct 2013 19:54:46 +0000 (19:54 +0000)]
Fix indentation/fontification of Java enum with "implements"/generic.
* progmodes/cc-engine.el (c-backward-over-enum-header): Extracted from
the three other places and enhanced to handle generics.
(c-inside-bracelist-p): Uses new function above.
* progmodes/cc-fonts.el (c-font-lock-declarations): Uses new function
above.
(c-font-lock-enum-tail): Uses new function above.