Michael Albinus [Sat, 20 Jan 2018 15:26:02 +0000 (16:26 +0100)]
Use file notification in autorevert also for recreated files
* lisp/autorevert.el (auto-revert-mode)
(global-auto-revert-mode, auto-revert-notify-add-watch)
(auto-revert-notify-handler, auto-revert-handler): Do not use
buffer local `auto-revert-use-notify' anymore.
* test/lisp/autorevert-tests.el
(auto-revert-test02-auto-revert-deleted-file): Adapt test in
order to check, that file notification is reenabled when possible.
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Do not follow a
definite article with an action verb in C-h help text. Use
'with-help-window' instead of 'with-output-to-temp-buffer'.
Simplify string concatenation. (Bug#30064)
* src/xdisp.c (move_it_in_display_line_to): Don't exit the loop
under truncate-lines if the glyph at TO_CHARPOS was not yet
produced. This avoids bailing out too early when we are at
TO_CHARPOS, but didn't yet produce glyphs for that buffer
position, because the last call to PRODUCE_GLYPHS at this position
was for an object other than the buffer. For further details, see
http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00537.html.
Stefan Monnier [Fri, 19 Jan 2018 04:01:35 +0000 (23:01 -0500)]
* lisp/calendar/calendar.el: Use lexical-binding
(calendar-generate-window): Remove unused variable `day'.
(calendar-generate-month): Use calendar-dlet* to provide the dynbind
vars promised by the respective docstrings.
(calendar-update-mode-line): Use calendar-dlet* to provide `date' to
calendar-mode-line-format. Don't call `eval' here since it's called in
calendar-string-spread anyway!
(calendar-date-string): Use calendar-dlet* to provide the dynbind
vars promised by the docstring of calendar-date-display-form.
* lisp/calendar/diary-lib.el (diary--date-string): Rename from date-string.
Noam Postavsky [Thu, 18 Jan 2018 13:22:47 +0000 (08:22 -0500)]
Switch term.el to lexical binding, and clean up code a bit
* lisp/term.el (term-terminal-state): Remove.
(term-do-line-wrapping): New variable, equivalent to state 1.
(term-terminal-previous-parameter, term-terminal-parameter)
(term-terminal-more-parameters)
(term-terminal-previous-parameter-2)
(term-terminal-previous-parameter-3)
(term-terminal-previous-parameter-4): Remove.
(term-move-to-column): New function, for absolute column movement.
(term-control-seq-regexp, term-control-seq-prefix-regexp): New
constants.
(term-emulate-terminal, term-pager-discard): Use them via string-match
instead of implementing a state machine in elisp. Handle all
unprocessed input via term-terminal-undecoded-bytes (this solves
Bug#17231).
(term-handle-ansi-escape): Take a list of escape sequence parameters
as an argument, rather than via dynamic variables.
(term-erase-in-display): Consult the argument, not the dynamically
bound term-terminal-parameter (which happened to be the same as the
argument up until now).
Noam Postavsky [Tue, 16 Jan 2018 21:26:56 +0000 (16:26 -0500)]
Handle case-insensitive filenames for load-path shadows (Bug#5845)
* lisp/emacs-lisp/shadow.el (load-path-shadows-find): Check for
shadowing with case-insensitive matching for files of case-insensitive
directories (as determined by `file-name-case-insensitive-p').
* test/lisp/emacs-lisp/shadow-tests.el: New test.
* test/lisp/emacs-lisp/shadow-resources/p1/foo.el:
* test/lisp/emacs-lisp/shadow-resources/p2/FOO.el: New test files.
Alan Mackenzie [Thu, 18 Jan 2018 17:54:02 +0000 (17:54 +0000)]
CC Mode: stop distinguishing brace blocks from defun blocks by content.
Don't merge to master; this is a quick fix for the emacs-26 branch. This is
essentially a reversion of the patch from 2017-11-10 which attempted to handle
C99's compound literals.
The bug here was triggered when a defun block contained a declaration ending
in a comma, yet without a semicolon.
* lisp/progmodes/cc-engine.el (c-guess-basic-syntax): At the CASE 9 test,
remove from the `or' form the test of a block's contents.
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.
Glenn Morris [Wed, 17 Jan 2018 20:13:40 +0000 (15:13 -0500)]
An overdue update of GNUstep emacs.tiff
* nextstep/GNUstep/Emacs.base/Resources/emacs.tiff:
Update to the Emacs 25 icon.
Converted from hicolor/scalable/apps/emacs.svg using Gimp.
* nextstep/GNUstep/Emacs.base/Resources/README: Update.
Glenn Morris [Wed, 17 Jan 2018 18:41:07 +0000 (13:41 -0500)]
Add some test skip conditions
* test/lisp/vc/vc-bzr-tests.el (vc-bzr-test-bug9726)
(vc-bzr-test-bug9781): Skip if bzr is faulty.
* test/src/thread-tests.el: Skip if not compiled with threads.
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)