Martin Rudalics [Thu, 18 Jan 2018 09:36:47 +0000 (10:36 +0100)]
Fix some tooltip related problems
Replace 'tooltip' frame parameter with a 'tooltip' member in
the frame structure. For GTK+ builds use 'tip_last_frame' to
find the frame for which the currently visible tooltip was
made. For modeline help-echoing have tooltips show applicable
actions only.
* lisp/bindings.el (mode-line-default-help-echo): New function
as default value of homonymous option.
* src/dispextern.h (tip_frame, tip_window): Remove
declarations.
* src/frame.c (make_frame): Initialize new frame structure
member 'tooltip'.
(Fframe_list, other_frames): Rewrite with new macro
FRAME_TOOLTIP_P.
* src/frame.h (struct frame): New member 'tooltip'.
(FRAME_TOOLTIP_P): New macro.
* src/gtkutil.c (xg_prepare_tooltip, xg_hide_tooltip): Rewrite
using boolean return values.
* src/nsfns.m (tip_frame): Remove declaration.
* src/w32fns.c (w32_display_monitor_attributes_list)
(w32_display_monitor_attributes_list_fallback): Rewrite with
new macro FRAME_TOOLTIP_P.
(tip_last_string, tip_last_frame, tip_last_parms): New Lisp
scalars replacing Lisp vector last_show_tip_args.
(x_create_tip_frame): Set new frame's 'tooltip' structure
member to true.
(x_hide_tip): Additionally test tip_frame for liveness.
(Fx_show_tip): Handle last_show_tip_args to tip_last_frame,
tip_last_string and tip_last_parms conversion.
(syms_of_w32fns): staticpro tip_last_frame, tip_last_string
and tip_last_parms instead of last_show_tip_args.
* src/w32term.c (w32_read_socket, x_new_font): Rewrite with
new macro FRAME_TOOLTIP_P.
* src/w32term.h (tip_window): Add external declaration.
* src/xdisp.c (x_consider_frame_title, prepare_menu_bars)
(should_produce_line_number): Rewrite with new macro
FRAME_TOOLTIP_P.
(note_mode_line_or_margin_highlight): If
`mode-line-default-help-echo' specifies a function, call it to
produce help echo string.
* src/xfns.c (x_make_monitor_attribute_list)
(Fx_display_monitor_attributes_list): Rewrite with
new macro FRAME_TOOLTIP_P.
(tip_last_string, tip_last_frame, tip_last_parms): New Lisp
scalars replacing Lisp vector last_show_tip_args.
(x_create_tip_frame): Set new frame's 'tooltip' structure
member to true.
(x_hide_tip): Rewrite with additional tests of frames for
liveness and taking into account that for GTK+ tips the
reference frame is now stored in tip_last_frame instead of
tip_frame.
(Fx_show_tip): Handle last_show_tip_args to tip_last_frame,
tip_last_string and tip_last_parms conversion. For GTK+ store
FRAME argument in tip_last-frame.
(syms_of_xfns): staticpro tip_last_frame, tip_last_string
and tip_last_parms instead of last_show_tip_args.
* src/xterm.c (x_update_begin, handle_one_xevent, x_new_font)
(x_set_window_size): Rewrite with new macro FRAME_TOOLTIP_P.
* src/xterm.h (tip_window): Add external declaration.
* etc/NEWS: Mention new modeline tooltips behavior.
Alan Mackenzie [Tue, 16 Jan 2018 21:59:03 +0000 (21:59 +0000)]
C++ Mode: Fontify correctly uniform initialisation with inner parentheses.
E.g.: someStruct x ( (nullptr != y) ? 3 : 4 )
Also fontify declarations of function pointers correctly.
* lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1): While testing for a
typeless declaration, additionally test the variable `got-prefix' to
recognize a function pointer in parentheses. Allow c-fdoc-shift-type-backward
to be invoked when we have nested parens.
Paul Eggert [Tue, 16 Jan 2018 01:18:42 +0000 (17:18 -0800)]
Fix macOS breakage in make_lispy_event
Problem reported by John Wiegley in:
https://lists.gnu.org/r/emacs-devel/2018-01/msg00499.html
* src/keyboard.c (kbd_buffer_get_event) [HAVE_NS]:
Act on used_mouse_menu here...
(make_lispy_event) [HAVE_NS]: ... instead of here.
Glenn Morris [Mon, 15 Jan 2018 21:53:40 +0000 (13:53 -0800)]
Merge from origin/emacs-26
98e5fb9bf3 (origin/emacs-26) Remove incorrect documentation in comint.el 8ba5b85161 An overdue update of src/emacs-icon.h 155b211133 Minor copyedit in ELisp manual
Glenn Morris [Mon, 15 Jan 2018 21:53:40 +0000 (13:53 -0800)]
Merge from origin/emacs-26
2c0cfa6455 * ChangeLog.3: Update 4387bb44ae Update authors bce51bd6f7 * lisp/gnus/message.el (message-do-auto-fill): Prevent do-... bd2a2a1e84 Improve documentation of etags 7ba75b9637 Teach etags new interpreters for some languages 1f7f03742d * lisp/emacs-lisp/generator.el (iter-defun): Add 'doc-stri... dbb4aac212 * lisp/emacs-lisp/syntax.el (syntax-propertize): Fix bug#2... 80463a43da Improve documentation of fill-separate-heterogeneous-words... 4bd2416d55 Fix documentation of some x-* functions 9c2b11484f Inherit query-on-exit flag to stderr process (Bug#30031) 3efb1e7def Fix Bug#30057 a9b884c60f Tag some unstable tests, and skip by default (bug#24503)
Stefan Monnier [Mon, 15 Jan 2018 18:15:12 +0000 (13:15 -0500)]
* lisp/mail/smtpmail.el (smtpmail-send-data-1): No string-as-multibyte
This is not needed any more since unibyte strings will be sent as-is
anyway by process-send-string.
(smtpmail-via-smtp): Avoid set-buffer-process-coding-system.
Michael Albinus [Sat, 13 Jan 2018 16:48:10 +0000 (17:48 +0100)]
Fix Bug#29149 in shell.el
* lisp/shell.el (shell): Change order of `file-local-name' and
`expand-file-name' calls. Otherwise, the local file name
would be extended by a drive letter, even when it is a remote
file, seen from w32. (Bug#29149)
Ken Brown [Fri, 12 Jan 2018 13:51:16 +0000 (08:51 -0500)]
Add battery support to all Cygwin builds
It already exists in the Cygwin-w32 build.
* src/w32fns.c (Fw32_battery_status): Move to...
* src/w32cygwinx: New file, to be used for functions common to
the MS Windows and Cygwin builds.
(syms_of_w32cygwinx): New function.
* src/lisp.h: Add prototype of syms_of_w32cygwinx.
* src/emacs.c (main) [HAVE_NTGUI or CYGWIN]: Call syms_of_w32cygwinx.
* src/Makefile.in (SOME_MACHINE_OBJECTS):
* configure.ac (W32_OBJ) [HAVE_W32]: Add w32cygwinx.o.
(W32_LIBS) [CYGWIN]: Set equal to "-lkernel32" in non-w32 build.
(W32_OBJ) [CYGWIN]: Set equal to "w32cygwinx.o" in non-w32 build.
* etc/NEWS: Document the new battery support.
Michael Albinus [Sat, 13 Jan 2018 16:48:10 +0000 (17:48 +0100)]
Fix Bug#29149 in shell.el
* lisp/shell.el (shell): Change order of `file-local-name' and
`expand-file-name' calls. Otherwise, the local file name
would be extended by a drive letter, even when it is a remote
file, seen from w32. (Bug#29149)
Michael Albinus [Sat, 13 Jan 2018 11:07:28 +0000 (12:07 +0100)]
Improve Tramp robustness
* lisp/net/tramp.el (tramp-message, tramp-process-actions)
(tramp-read-passwd, tramp-interrupt-process):
* lisp/net/tramp-adb.el (tramp-adb-maybe-open-connection):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-notify-add-watch)
(tramp-gvfs-maybe-open-connection):
* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band)
(tramp-process-sentinel)
(tramp-sh-handle-file-notify-add-watch)
(tramp-barf-if-no-shell-prompt, tramp-maybe-open-connection)
* lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory)
(tramp-smb-handle-file-acl, tramp-smb-handle-set-file-acl)
(tramp-smb-maybe-open-connection): Use process property rather
than connection property "vector".
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-notify-add-watch):
Fix scoping error. Let error traces use process buffer.
* lisp/net/tramp-sh.el (tramp-sh-handle-file-notify-add-watch):
Move "inotifywait" up. GVFS based monitoring is not stable.
Let error traces use process buffer.
(tramp-sh-gvfs-monitor-dir-process-filter): Check more error
messages.
(tramp-get-remote-gvfs-monitor-dir): Search also for "gio".
* lisp/net/tramp.el (tramp-get-debug-buffer):
Use `special-mode-map' as parent map in debug buffer.
(tramp-message): Ensure, that proper process buffer is dumped
in error case.
Eli Zaretskii [Sat, 13 Jan 2018 10:48:07 +0000 (12:48 +0200)]
Improve documentation of safe values of variables
* doc/lispref/variables.texi (File Local Variables): Mention the
autoload cookie as a means of defining safe values for variables.
See http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00261.html
for the details.
* doc/lispref/compile.texi (Compiler Errors): Document
'byte-compile-error-on-warn'.
Eli Zaretskii [Sat, 13 Jan 2018 09:45:04 +0000 (11:45 +0200)]
Improve the Emacs manual's "Misc" node
* doc/emacs/misc.texi (Gnus): A more descriptive section name.
(Invoking emacsclient): Mention how to avoid errors when there's
no Emacs server.
(EWW, Embedded WebKit Widgets): Now subsections under
"Hyperlinking and Web Navigation Features".
(Amusements): Add "games" to the section name. Suggested by Alex
Branham <alex.branham@gmail.com> in emacs-manual-bugs@gnu.org.
* doc/emacs/emacs.texi (Top): Adjust the top-level menus to the
above changes.
Stefan Monnier [Sat, 13 Jan 2018 04:37:06 +0000 (23:37 -0500)]
* src/keyboard.c: Consolidate code into make_lispy_event
(clear_event): Change arg type. Adjust callers.
(kbd_buffer_get_event): Move most special event handling to
make_lispy_event.
(make_lispy_event): Add missing cases, taken from kbd_buffer_get_event.
<SAVE_SESSION_EVENT>: Change return value to match what used to be built
in kbd_buffer_get_event.
Alan Mackenzie [Fri, 12 Jan 2018 16:31:35 +0000 (16:31 +0000)]
Make Fzlib_decompress_region always call the change hooks in a balanced way.
This means there will be exactly one call of each of before- and
after-change-functions, regardless of whether or not the decompression
succeeds, and these calls will refer to corresponding buffer regions.
src/decompress.c (struct decompress_unwind_data): add a new field, orig.
(unwind_decompress): Use del_range_2 and update_compositions in place of
del_range, to avoid unwanted change hook calls. Call signal_after_change for
the failed case.
(Fzlib_decompress_region): Call modify_txt for a before-change-functions. Set
the new field orig of unwind_data to the region's start. Use del_range_2 and
update_compositions in place of del_range to avoid unwanted change hook
calls. Call signal_after_change for the successful case.
Ken Brown [Thu, 11 Jan 2018 16:40:37 +0000 (11:40 -0500)]
Unbreak the Cygwin-w32 build
* src/keyboard.c (input_polling_used) [CYGWIN]: Restore. This was
removed on Cygwin in the commit "On non-MS-Windows, omit unnecessary
polling functions". But it is used in w32fns.c:x_make_frame_visible
in the Cygwin-w32 build.
Stefan Monnier [Thu, 11 Jan 2018 16:56:43 +0000 (11:56 -0500)]
* lisp/mail/smtpmail.el: Use lexical-binding and cl-generic
(smtpmail-auth-supported): Mark it as non-constant.
(smtpmail-try-auth-methods): Remove unused var 'ret'.
Test non-nullness of mech user and password before calling
smtpmail-try-auth-method.
(smtpmail-try-auth-method): Make it into a generic function.
(smtpmail-via-smtp): Remove unused var 'response-code'.
Eli Zaretskii [Thu, 11 Jan 2018 16:35:12 +0000 (18:35 +0200)]
Teach etags new interpreters for some languages
* lib-src/etags.c (Erlang_interpreters, Lua_interpreters)
(Prolog_interpreters, Python_interpreters, Ruby_interpreters): New
static variables.
(lang_names): Use them to set interpreters for Erlang, Lua,
Prolog, Python, and Ruby.
(find_entries): Support "/usr/bin/env FOO" form of specifying an
interpreter.
* test/manual/etags/perl-src/htlmify-cystic: Modify the has-bang
line to test the "env FOO" interpreter spec. (Bug#30075)
* test/manual/etags/ETAGS.good_1:
* test/manual/etags/ETAGS.good_2:
* test/manual/etags/ETAGS.good_3:
* test/manual/etags/ETAGS.good_4:
* test/manual/etags/ETAGS.good_5:
* test/manual/etags/ETAGS.good_6: Adapt to latest changes in test
files.
Eli Zaretskii [Wed, 10 Jan 2018 19:24:58 +0000 (21:24 +0200)]
Fix documentation of some x-* functions
* lisp/term/pc-win.el (x-display-pixel-width)
(x-display-pixel-height, x-display-planes)
(x-display-color-cells, x-server-max-request-size)
(x-server-vendor, x-server-version, x-display-screens)
(x-display-mm-height, x-display-mm-width)
(x-display-backing-store, x-display-visual-class): Provide doc
strings, so that 'makedoc' produces non-empty documentation in
etc/DOC for these functions. (Bug#30068)
Stefan Monnier [Wed, 10 Jan 2018 16:45:33 +0000 (11:45 -0500)]
* lisp/calendar/appt.el: Use lexical-binding
(appt-display-message): Remove unused variable 'err'.
(appt-check): Fix typo in search for a function on a hook.
(number, original-date): Move declaration into 'appt-make-list'.
Michael Albinus [Wed, 10 Jan 2018 12:39:17 +0000 (13:39 +0100)]
Fix Bug#30057
* test/lisp/filenotify-tests.el (file-notify--test-tmpdir): New defvar.
(file-notify--test-cleanup, file-notify--test-make-temp-name)
(file-notify-test01-add-watch, file-notify-test03-events)
(file-notify-test05-file-validity)
(file-notify-test09-watched-file-in-watched-dir)
(file-notify-test10-sufficient-resources): Use it. (Bug#30057)
Glenn Morris [Wed, 10 Jan 2018 03:59:04 +0000 (19:59 -0800)]
Tag some unstable tests, and skip by default (bug#24503)
* Makefile.in (check-all): New phony target.
* test/Makefile.in (SELECTOR_DEFAULT, SELECTOR_EXPENSIVE):
Also skip unstable tests.
(SELECTOR_ALL): New variable.
(check-all): New phony target.
* test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el
(eieio-test-method-order-list-6):
* test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
(eieio-test-37-obsolete-name-in-constructor):
Mark as unstable rather than skipping on hydra.nixos.org.
Tino Calancha [Mon, 8 Jan 2018 10:11:20 +0000 (19:11 +0900)]
cl-loop: Add missing guard condition
Consider the expansion of `cl-loop' with a `for' clause and more
than one internal variables, X, Y, processed in parallel.
Each step updates X and Y right after update the loop variable, K; if
either X or Y depend on K, then some forms of the body are
evaluated with the wrong K (Bug#29799).
For instance, consider the following code:
(cl-loop for k below 2
for x = (progn (message "k = %d" k) 1)
and y = 1)
This code should show in *Messages*:
k = 0
k = 1
Instead, the code shows:
k = 0
k = 1
k = 2
To prevent this we must ensure that the loop condition is still
satisfied right after update the loop variable.
In the macro expansion of the example above, right after:
(setq k (+ k 1))
evaluate the rest of the body forms iif the condition
(< k 2)
is still valid.
* lisp/emacs-lisp/cl-macs.el (cl--loop-guard-cond): New variable.
(cl--parse-loop-clause): Set it non-nil if the loop contains
a for/as clause.
(cl-loop): After update the loop variable, evaluate the remaining of
the body forms just if the loop condition is still valid (Bug#29799).
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-loop-for-as-equals-and):
New test.
Michael Albinus [Sun, 7 Jan 2018 17:50:06 +0000 (18:50 +0100)]
Make tramp-tests.el more robust on w32
* test/lisp/net/tramp-tests.el (tramp-test21-file-links):
Do not call `make-symbolic-link' on w32.
(tramp-test36-find-backup-file-name): Call also
`convert-standard-filename' due to w32.
(tramp--test-windows-nt): New defun.
(tramp-test42-auto-load, tramp-test42-delay-load)
(tramp-test42-recursive-load, tramp-test42-remote-load-path):
Quote command due to w32.