Eli Zaretskii [Tue, 14 Aug 2012 18:48:39 +0000 (21:48 +0300)]
Fix and improve GUD Tooltip mode.
lisp/tooltip.el (tooltip-identifier-from-point): Don't treat tokens
inside comments and strings as identifiers.
lisp/progmodes/gud.el (gud-tooltip-print-command): Quote the
expression to evaluate. This allows to evaluate expressions with
embedded whitespace.
(gud-tooltip-tips): Add a blank before the newline in the
message-box text, for the benefit of message-box emulation on
MS-Windows.
lisp/progmodes/gdb-mi.el (gdb-tooltip-print): Don't ignore error
messages from GDB, pop them up in a tooltip to give feedback to
user.
(gdb-tooltip-print-1): Quote the expression to evaluate. This
allows to evaluate expressions with embedded whitespace.
(gdb-inferior-io--init-proc): Don't send "-inferior-tty" command
if the TTY name is nil or empty (which happens when communicating
with the inferior via pipes, e.g. on MS-Windows).
(gdb-internals): If GDB sends a "&\n" empty debugging message,
don't send that to the GUD buffer.
doc/emacs/building.texi (Debugger Operation): Correct and improve
documentation of the GUD Tooltip mode.
Eli Zaretskii [Tue, 14 Aug 2012 18:25:47 +0000 (21:25 +0300)]
Fix a problem with disabled mouse movement events.
src/keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
iteration through the command loop. Fixes a problem whereby mouse
movements are ignored until the first mouse click.
Paul Eggert [Tue, 14 Aug 2012 17:45:25 +0000 (10:45 -0700)]
Use bool for Emacs Lisp booleans.
This is more natural, and on my platform (GCC 4.7.1 x86-64) it
makes Emacs's text size .03% smaller and presumably a bit faster.
* admin/merge-gnulib (GNULIB_MODULES): Add stdbool. This documents a
new direct dependency; stdbool was already being used indirectly
via other gnulib modules.
* lib-src/make-docfile.c (enum global_type): Sort values roughly in
decreasing alignment, except put functions last.
(compare_globals): Use this new property of enum global_type.
(write_globals): Use bool, not int, for booleans.
* src/lisp.h: Include <stdbool.h>.
(struct Lisp_Boolfwd, defvar_bool):
* src/lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
* src/regex.c [!emacs]: Include <stdbool.h>.
(false, true): Remove; <stdbool.h> does this for us now.
Dmitry Gutov [Tue, 14 Aug 2012 12:38:11 +0000 (08:38 -0400)]
* lisp/progmodes/ruby-mode.el (ruby-syntax-methods-before-regexp): New const.
(ruby-syntax-propertize-function): Use it to recognize regexps.
Don't look at the text after regexp, just use the whitelist.
* test/indent/ruby.rb: Rearrange examples, add new ones.
Dmitry Gutov [Tue, 14 Aug 2012 12:28:12 +0000 (08:28 -0400)]
* lisp/progmodes/ruby-mode.el: Improve percent literals.
(ruby-percent-literal-beg-re): New constant.
(ruby-syntax-general-delimiters-goto-beg): Rename to
`ruby-syntax-enclosing-percent-literal', improve literal type check.
(ruby-syntax-propertize-general-delimiters): Rename to
`ruby-syntax-propertize-percent-literal', it's a shorter and more
popular term. Adjust comments everywhere.
(ruby-syntax-propertize-percent-literal): Only propertize when not
inside a simple string or comment. When the literal is unclosed,
leave the text after it unpropertized.
Chong Yidong [Tue, 14 Aug 2012 06:52:59 +0000 (14:52 +0800)]
Fix highlight-regexp's use of Font Lock mode.
* hi-lock.el (hi-lock-mode): Do not unilaterally enable font lock.
(hi-lock-set-pattern): When deciding whether to use font lock or
overlays, look at font-lock-mode instead of font-lock-fontified.
(hi-lock-mode, hi-lock-line-face-buffer, hi-lock-unface-buffer)
(hi-lock-face-buffer, hi-lock-face-phrase-buffer): Doc fix.
Use `completion-table-dynamic' for completion functions.
* progmodes/python.el
(python-shell-completion--do-completion-at-point)
(python-shell-completion--get-completions): Remove
functions.
(python-shell-completion-complete-at-point): New function.
(python-completion-complete-at-point): Use it.
Stefan Monnier [Mon, 13 Aug 2012 21:23:09 +0000 (17:23 -0400)]
* lisp/subr.el (function-get): Refine `autoload' arg so it can also
autoload functions for gv.el.
* lisp/emacs-lisp/edebug.el (get-edebug-spec): Adjust so it only
autoloads macros.
Jan Djärv [Mon, 13 Aug 2012 19:12:26 +0000 (21:12 +0200)]
Don't redraw tool bar for Gtk+ unless out of date.
* gtkutil.c (xg_frame_tb_info): New struct.
(TB_INFO_KEY): New define.
(xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
(xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
(xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
if not present.
(update_frame_tool_bar): Return early if data in xg_frame_tb_info
is up to date. Otherwise store new data.
(free_frame_tool_bar): Free xg_frame_tb_info if present.
Stefan Monnier [Mon, 13 Aug 2012 19:10:35 +0000 (15:10 -0400)]
* lisp/color.el (color-xyz-to-lab, color-lab-to-xyz, color-cie-de2000):
Prefer pcase-let over destructuring-bind.
* lisp/vc/diff-mode.el (diff-remove-trailing-whitespace): Same.
Also, remove whitespace as we go, rather than after accumulating the
various places.
Andreas Schwab [Mon, 13 Aug 2012 10:34:25 +0000 (12:34 +0200)]
* tar-mode.el (tar-header-data-end): Only ignore size for files of
type 1-6.
(tar-header-block-summarize, tar-get-descriptor): Handle pax
extended headers.
Stefan Monnier [Sun, 12 Aug 2012 22:52:33 +0000 (18:52 -0400)]
* lisp/subr.el (internal--before-with-seleted-window)
(internal--after-with-seleted-window): New functions.
(with-selected-window): Use them, to replace dependency on tty-top-frame.
Jay Belanger [Sun, 12 Aug 2012 04:32:28 +0000 (23:32 -0500)]
calc/calc-units.el (math-default-units-table): Give it an
initial value.
(math-put-default-units): Add options to put composite units and unit
systems in default units table.
(calc-convert-units): Send composite units to `math-put-default-units'
when appropriate.
Jan Djärv [Sat, 11 Aug 2012 09:10:08 +0000 (11:10 +0200)]
* nsterm.m (not_in_argv): New function.
(application:openFile, application:openTempFile:):
(application:openFileWithoutUI:, application:openFiles:): Open file
if not_in_argv returns non-zero.
Jan Djärv [Sat, 11 Aug 2012 08:54:35 +0000 (10:54 +0200)]
Use GtkFontChooser on Gtk+ 3.2 and up.
* src/gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
(gtk_font_chooser_set_font, gtk_font_chooser_get_font): Define
for Gtk+ versions less than 3.2.
(xg_get_font_name): Use those functions/macros here.
Reported by Frans Oilinki <moilinki@gmail.com>.
Dmitry Gutov [Fri, 10 Aug 2012 20:25:43 +0000 (16:25 -0400)]
* test/automated/ruby-mode-tests.el (ruby-should-indent):
Add docstring, check (current-indentation) instead of (current-column).
(ruby-should-indent-buffer): New function.
Add tests for `ruby-deep-indent-paren' behavior.
Port all tests from test/misc/test_ruby_mode.rb in Ruby repo.
Dmitry Gutov [Fri, 10 Aug 2012 20:19:09 +0000 (16:19 -0400)]
Merge stuff from upsteam ruby-mode, part 1.
* lisp/progmodes/ruby-mode.el (ruby-mode-map): Remove deprecated
binding (use `M-;' instead).
(ruby-expr-beg, ruby-parse-partial): ?, _, and : are symbol
constituents, ! is not (but kinda should be).
(ruby-singleton-class-p): New function.
(ruby-expr-beg, ruby-in-here-doc-p)
(ruby-syntax-propertize-heredoc): Use it.
(ruby-syntax-propertize-function): Adjust for changes in
`ruby-syntax-propertize-heredoc'.
* test/automated/ruby-mode-tests.el (ruby-should-indent)
(ruby-assert-state): New functions.
Add new tests.
Chong Yidong [Fri, 10 Aug 2012 16:46:07 +0000 (00:46 +0800)]
Remove some unnecessary bindings of same-window-* variables.
* lisp/progmodes/python.el (python-shell-get-process-name): Don't mess
with same-window-buffer-names.
* lisp/eshell/eshell.el (eshell-add-to-window-buffer-names)
(eshell-remove-from-window-buffer-names): Make obsolete.
(eshell-buffer-name, eshell-unload-hook): Don't use them.
(eshell): Just use pop-to-buffer-same-window instead.
Stefan Monnier [Fri, 10 Aug 2012 14:47:12 +0000 (10:47 -0400)]
* lisp/term/x-win.el (x-menu-bar-open): Always pass last-nonmenu-event.
* lisp/subr.el (eventp): `nil' is not an event, and eventp is not hot.
(event-start, event-end): Use posn-at-point to return a more
informative posn.
(posnp): New function.
* lisp/mouse.el (popup-menu-normalize-position): Use it.
Dmitry Antipov [Fri, 10 Aug 2012 13:24:20 +0000 (17:24 +0400)]
Fix last change to allow compilation with low optimization levels.
* intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
Reported by Jan Djärv <jan.h.d@swipnet.se>.
Masatake YAMATO [Fri, 10 Aug 2012 12:44:06 +0000 (08:44 -0400)]
* lisp/mouse.el (popup-menu-normalize-position): New function.
(popup-menu): Use `popup-menu-normalize-position' to normalize
the form for POSITION argument.
* lisp/term/x-win.el (x-menu-bar-open):
Use the value returend from (posn-at-point) as position
passed to `popup-menu'.
Eli Zaretskii [Fri, 10 Aug 2012 07:16:58 +0000 (10:16 +0300)]
Improve commit in 2012-08-10T06:54:37Z!eliz@gnu.org.
src/w32fns.c <w32_unicode_gui>: New static variable.
(globals_of_w32fns): Initialize it according to os_subtype.
(w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
testing os_subtype.
Eli Zaretskii [Fri, 10 Aug 2012 06:54:37 +0000 (09:54 +0300)]
Fix bug #10299 with Unicode characters sent on MS-Windows by MSKLC.
src/w32fns.c (INIT_WINDOW_CLASS): New macro.
(w32_init_class): Use it to initialize the Emacs class with either
ANSI or Unicode API calls.
(w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
later.
(w32_wnd_proc): If the character code sent by WM_CHAR or
WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
original message. Call DefWindowProcW on NT and later.
Jay Belanger [Thu, 9 Aug 2012 14:46:03 +0000 (09:46 -0500)]
calccomp.el (math-compose-expr): Add extra argument indicating that
parentheses should be put around products in denominators. Give
multiplication precedence over division during composition.