Stefan Monnier [Tue, 19 Jul 2016 01:04:39 +0000 (21:04 -0400)]
* lisp/simple.el (undo-amalgamate-change-group): New function
* lisp/emulation/viper-cmd.el (viper-adjust-undo): Use it.
(viper-set-complex-command-for-undo): Save current state with
prepare-change-group.
* lisp/emulation/viper-init.el (viper-undo-needs-adjustment)
(viper-buffer-undo-list-mark): Remove.
Noam Postavsky [Wed, 29 Jun 2016 22:52:57 +0000 (18:52 -0400)]
Keep w32 environment settings internal only
* src/emacs.c (main) [WINDOWSNT]: Move init_environment calls after the
set_initial_environment call. This prevents Emacs' modifications to the
environment from contaminating Vprocess_environment and
Vinitial_environment (Bug #10980).
* src/callproc.c (getenv_internal) [WINDOWSNT]: Consult Emacs' internal
environment in as a fallback to Vprocess_environment.
* test/src/callproc-tests.el (initial-environment-preserved): New Test.
* lisp/international/ucs-normalize.el (ucs-normalize-combining-chars-regexp):
(quick-check-list-to-regexp): Use regexp-opt-charset instead of
regexp-opt.
* lisp/international/ucs-normalize.el (quick-check-list): Reuse a single
temp buffer for the whole loop.
* test/lisp/international/ucs-normalize-tests.el: New tests.
* admin/unidata/NormalizationTest.txt: Add data for tests.
* admin/unidata/README: Add URL for NormalizationTest.txt.
* admin/notes/unicode: Add note about running (and updating the data
for) the new tests. Remove note about normalization being unsupported.
Paul Eggert [Fri, 15 Jul 2016 20:15:42 +0000 (22:15 +0200)]
Remove BYTE_MAINTAIN_TOP
It is no longer needed now that we assume GC_MARK_STACK ==
GC_MAKE_GCPROS_NOOPS.
* src/bytecode.c (BYTE_MAINTAIN_TOP): Remove.
All uses removed, and code simplified accordingly.
(BEFORE_POTENTIAL_GC, AFTER_POTENTIAL_GC): Remove, since they
are always no-ops now. All uses removed.
(MAYBE_GC): Remove. All uses replaced by maybe_gc,
since it is now equivalent.
Paul Eggert [Fri, 15 Jul 2016 11:07:09 +0000 (13:07 +0200)]
Port to glibc 2.24 (pre-release) + ppc64
Inspired by a suggestion by Florian Weimer in:
https://sourceware.org/ml/libc-alpha/2016-07/msg00425.html
* configure.ac (HAVE_PERSONALITY_ADDR_NO_RANDOMIZE):
Rename from HAVE_PERSONALITY_LINUX32, and check for
ADDR_NO_RANDOMIZE (the crucial thing) instead of for LINUX32.
All uses changed.
* src/emacs.c (main) [HAVE_PERSONALITY_ADDR_NO_RANDOMIZE]:
Use ADDR_NO_RANDOMIZE from personality.h rather than inventing the
flag ourselves. Just set that flag, rather than also setting the
persona. When doing it, avoid functions like putenv that may
allocate memory.
Chris Feng [Wed, 13 Jul 2016 11:52:10 +0000 (19:52 +0800)]
Include versioned preloaded libraries in `package--builtin-versions'
* lisp/emacs-lisp/autoload.el (update-directory-autoloads): Do not
exclude preloaded libraries or remove entries generated for them.
(autoload-generate-file-autoloads): Do not generate autoload
statements for preloaded libraries.
Paul Eggert [Wed, 13 Jul 2016 08:15:42 +0000 (10:15 +0200)]
Omit unnecessary #includes from xwidget.c
* src/xwidget.c: Remove #include directives that are not needed.
Also, don’t conditionalize #includes on HAVE_X_WINDOWS, since this
file is compiled only if the X interface is available.
Paul Eggert [Wed, 13 Jul 2016 07:56:50 +0000 (09:56 +0200)]
Port xwidget.c to GCC 6 with --enable-gcc-warnings
* src/xwidget.c (x_draw_xwidget_glyph_string, xwidget_end_redisplay):
Adjust to pacify GCC. Add a couple of FIXME comments, suggesting
possible bugs found by GCC.
I am reverting this change because it was applied without prior discussion
on emacs-devel, and has been found to break the NS port. It needs more
testing and review before it should be applied here.
Stefan Monnier [Tue, 12 Jul 2016 16:04:01 +0000 (12:04 -0400)]
* cl-generic.el (cl-defmethod): Make docstring dynamic
* lisp/emacs-lisp/cl-generic.el (cl-defmethod): Make docstring dynamic.
(cl--generic-make-defmethod-docstring): New function for that.
(cl-defmethod, cl-generic-generalizers): Tweak docstrings accordingly.
(cl-generic-define-method, cl--generic-describe): Change `load-history'
format of cl-defmethods, so as not to confused methods with equal
specializers but different qualifiers.
* lisp/emacs-lisp/eieio-core.el (cl-generic-generalizers): Provide docstrings.
Eli Zaretskii [Tue, 12 Jul 2016 13:18:06 +0000 (16:18 +0300)]
Don't install keyboard hook when debugged on MS-Windows
* src/w32fns.c (setup_w32_kbdhook): Don't install the keyboard
hook if we are being debugged. This avoids hosing the debugger,
because the hook is global, and is called in the context of the
thread which installed it, and that thread is stopped when GDB has
control. Reported by Fabrice Popineau <fabrice.popineau@gmail.com>.
Alan Mackenzie [Tue, 12 Jul 2016 13:16:02 +0000 (13:16 +0000)]
Amend CC Mode to handle big C++ raw strings correctly.
Problems were caused by such a string spanning jit-lock chunks, and by a flaw
in the +-500 bytes boundaries imposed for macros.
* lisp/progmodes/cc-mode.el (c-extend-region-for-CPP): Check the +-500 byte
macro boundaries here.
(c-extend-font-lock-region-for-macros): Remove the check on the +-500 byte
lower boundary. Fix the check on the upper boundary.
* lisp/progmodes/cc-fonts.el (c-font-lock-raw-strings): Handle the starting
point already being within a raw string.
* lisp/progmodes/cc-engine.el (c-raw-string-pos)
(c-depropertize-raw-strings-in-region, c-after-change-re-mark-raw-strings):
Modify regexp element "\\{,16\\}" to "\\{0,16\\}" for greater compatibility
with other Emacsen.
* src/dispextern.h (toplevel): Remove 'tip_frame' and 'tip_window' decls.
* src/frame.h (struct frame): New bitfield to indicate tooltip frame.
(FRAME_TOOLTIP_P): New macro.
* src/frame.c (make_frame): Mark new frame as regular frame by default.
(Fframe_list, delete_frame): Redesign to use FRAME_TOOLTIP_P.
(syms_of_frame): Don't DEFSYM 'Qtooltip' but use 'Qtooltip_timer'
and 'Qtooltip_parameters' instead.
* src/gtkutil.h (toplevel): Add 'xg_hide_tip' decl.
* src/gtkutil.c (xg_hide_tip): New function.
(xg_hide_tooltip): Adjust to cancel GTK event loop timeout if needed.
* src/menu.c (Fx_popup_menu): Adjust call to Fx_hide_tip.
* src/nsfns.c (toplevel): Remove 'tip_frame' leftover.
* src/w32fns.c (unwind_create_tip_frame): Remove.
(w32_display_monitor_attributes_list)
(w32_display_monitor_attributes_list_fallback): Use FRAME_TOOLTIP_P.
(toplevel): Remove 'tip_frame', 'tip_window' and 'last_show_tip_args'.
(x_create_tip_frame): Use do_unwind_create_frame. Mark new frame
as a tooltip frame and record it using appropriate display info.
(x_hide_tooltip): Add frame arg.
(Fx_show_tip): Adjust to avoid globals, store tooltip parameters among
base frame parameters, store tooltip hide timer among tooltip frame
parameters.
(Fx_hide_tip): Add frame arg, hide tooltips on all displays by default.
(syms_of_w32fns): Don't DEFSYM 'Qtip_frame', don't initialize
and GC-protect 'tip_timer', 'tip_frame' and 'last_show_tip_args'.
* src/w32term.c (w32_read_socket): Extract tooltip window id from
per-display data. Use FRAME_TOOLTIP_P where appropriate.
(x_new_font): Use FRAME_TOOLTIP_P.
(x_free_frame_resources): Reset pointer to tooltip frame.
* src/w32term.h (struct w32_display_info): New member 'w32_tooltip_frame'.
* src/xdisp.c (init_iterator, x_consider_frame_title, prepare_menu_bars):
Use FRAME_TOOLTIP_P.
* src/xfns.c (x_make_monitor_attribute_list)
(Fx_display_monitor_attributes_list): Likewise.
(unwind_create_tip_frame): Remove.
(toplevel): Remove 'tip_frame', 'tip_window' and 'last_show_tip_args'.
(x_create_tip_frame): Use do_unwind_create_frame. Mark new frame
as a tooltip frame and record it using appropriate display info.
(x_hide_tooltip): Add frame arg.
(Fx_show_tip): Adjust to avoid globals, store tooltip parameters among
base frame parameters, store tooltip hide timer among tooltip frame
parameters. To hide GTK system tooltip, use timeout hooked into GTK
event loop.
(Fx_hide_tip): Add frame arg, hide tooltips on all displays by default.
(syms_of_xfns): Don't DEFSYM 'Qtip_frame', don't initialize
and GC-protect 'tip_timer', 'tip_frame' and 'last_show_tip_args'.
* src/xterm.c (handle_one_xevent): Extract tooltip window id from
per-display data. Use FRAME_TOOLTIP_P where appropriate.
(x_new_font, x_set_window_size): Use FRAME_TOOLTIP_P.
(x_free_frame_resources): Reset pointer to tooltip frame.
* src/xterm.h (struct x_display_info): New member 'x_tooltip_frame'.
(struct x_output) [USE_GTK_TOOLTIP]: New member 'ttip_timeout'.
* lisp/calc/calc-forms.el (math-to-hms, math-from-hms):
Ignore value of 'calc-angle-mode' when 'math-simplifying-units'
is non-nil (Bug#23889).
* lisp/calc/calc-math.el (math-to-radians, math-from-radians)
(math-from-radians-2, math-to-radians-2): Idem.
* dired.el (dired-always-read-filesystem): Add new option.
(dired-mark-files-containing-regexp): Use it (Bug#22694).
* doc/emacs/dired.texi: Mention it in the manual.
* test/lisp/dired-tests.el (dired-test-bug22694): Add test.
;* etc/NEWS: Add entry for this change.
Michael Albinus [Sun, 10 Jul 2016 15:03:48 +0000 (17:03 +0200)]
Add a note how to use `tramp-own-remote-path'
* doc/misc/tramp.texi (Inline methods, External methods)
(Remote shell setup, Android shell setup)
(Frequently Asked Questions, Frequently Asked Questions):
Use @command and @samp consequently.
(Remote programs): The remote shell must support the -l
argument, in order to use `tramp-own-remote-path'. (Bug#23914)
Mark Oteiza [Sat, 9 Jul 2016 01:10:32 +0000 (21:10 -0400)]
Derive secrets-mode from special-mode
* lisp/net/secrets.el: Remove top-level secrets-mode hack.
(secrets-mode-map): New variable. Add key bindings to n and p for
navigating lines.
(secrets-mode): Derive from special-mode. Remove keymap code and
initialization code. Do not record undo information. Make
secrets-show-collections the local revert-buffer-function.
(secrets-show-collections): Change signature to satisfy revert-buffer.
Michael Albinus [Fri, 8 Jul 2016 20:44:11 +0000 (22:44 +0200)]
Detect remote uid and gid in tramp-gvfs.el
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name)
(tramp-gvfs-handler-mounted-unmounted)
(tramp-gvfs-connection-mounted-p):
Make "default-location" a connection property.
(tramp-gvfs-get-remote-uid, tramp-gvfs-get-remote-gid): New defuns.
(tramp-gvfs-maybe-open-connection): Use them.
Eli Zaretskii [Fri, 8 Jul 2016 19:34:34 +0000 (22:34 +0300)]
Yet another fix for copying properties by 'format'
* src/textprop.c (extend_property_ranges): Accept an additional
argument OLD_END, and only extend the end of a property range if
its original end is at OLD_END; all the other ranges are left
intact. (Bug#23897)
* src/editfns.c (styled_format): Pass the original length of the
string to 'extend_property_ranges'.
* src/intervals.h (extend_property_ranges): Adjust prototype.
* test/src/editfns-tests.el (format-properties): Add tests for
bug#23897.
Stephen Berman [Fri, 8 Jul 2016 15:36:55 +0000 (17:36 +0200)]
Allow selecting region with mouse to move point to beginning
* etc/NEWS: Mention new user option
`mouse-select-region-move-to-beginning'.
* doc/emacs/frames.texi (Mouse Commands): Add cross-reference
to the following.
(Word and Line Mouse): Describe how double-clicking mouse-1 to
activate region and `mouse-select-region-move-to-beginning'
affect point.
* lisp/mouse.el (mouse-select-region-move-to-beginning): New defcustom.
(mouse-set-point): Use it. (Bug#23478)
* ibuf-ext.el (ibuffer-copy-buffername-as-kill): New command.
* lisp/ibuffer (ibuffer-mode-map): Bound it to 'B'.
;* etc/NEWS: Add entry for this new feature.
* lisp/ibuffer.el (ibuffer-change-marks): New command.
(ibuffer-mode-map): Bind it to '* c'.
(ibuffer-mode-groups-popup): Update menus.
(ibuffer-mode): Update mode doc.
; * etc/NEWS: Add entry for this new feature.
Alan Third [Thu, 7 Jul 2016 19:42:11 +0000 (20:42 +0100)]
Fix some deprecated functions
* src/nsterm.m (firstRectForCharacterRange): In OS X >10.6 replace
convertBaseToScreen with convertRectToScreen.
* src/nsmenu.m (ns_update_menubar): Remove attachedMenu, deprecated in
OS X 10.2, and always seems to return nil.
Michael Albinus [Thu, 7 Jul 2016 16:50:24 +0000 (18:50 +0200)]
Fix an error in Tramp for rsync
* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band):
Make it work for "rsync".
(tramp-make-copy-program-file-name): Apply `directory-file-name'.
* lisp/ibuf-ext.el (ibuffer-locked-buffer-p): New defun.
(ibuffer-mark-by-locked): New command.
(ibuffer-mode-map): Bind it to '% L'; update menus.
(ibuffer-mode): Update mode doc.
;* etc/NEWS: Add NEWS entry for these changes and previous two commits.
* lisp/ibuffer.el (ibuffer-mode-map): 'ibuffer-mark-by-content-regexp'
just bound to '% g'.
As suggested in:
http://lists.gnu.org/archive/html/emacs-devel/2016-07/msg00165.html
Mark Oteiza [Thu, 7 Jul 2016 03:16:32 +0000 (23:16 -0400)]
Replace eldoc-documentation-function with a hook
* lisp/emacs-lisp/eldoc.el (eldoc-documentation-functions): New hook.
(eldoc-documentation-function): Make into obsolete alias.
(eldoc-echo-area-use-multiline-p, eldoc-highlight-function-argument):
(eldoc-argument-case, global-eldoc-mode): Update docstrings.
(eldoc-print-current-symbol-info): Use run-hook-with-args-until-success
on eldoc-documentation-functions.
(eldoc-supported-p): New function.
(eldoc-mode, global-eldoc-mode, eldoc-schedule-timer): Use eldoc-supported-p.
* etc/NEWS: Mention eldoc-documentation-functions.
* doc/lispref/modes.texi: Update reference.
* lisp/textmodes/css-mode.el (css--complete-property-value): Make
"initial" and "unset" completion candidates for all CSS properties,
just like "inherit".
* test/lisp/textmodes/css-mode-tests.el
(css-test-complete-property-value): Update test to reflect the above
change.
Paul Eggert [Wed, 6 Jul 2016 14:10:13 +0000 (16:10 +0200)]
Simplify rfc1345.el a bit
* lisp/leim/quail/rfc1345.el: Omit commented-out codes for ASCII
that would no longer parse. Replace control characters with
escapes in character constants. Omit unnecessary \ after ?.
This does not change behavior.
Eli Zaretskii [Tue, 5 Jul 2016 16:33:01 +0000 (19:33 +0300)]
Fix redisplay with window-start on continuation lines
* src/xdisp.c (pos_visible_p): Return false if the window starts
after CHARPOS.
(compute_window_start_on_continuation_line): Don't return
window-start position that is after point in the buffer, as the
callers don't expect this to happen, and will generally display an
empty window with the cursor in its middle. (Bug#23871)
Simplify ‘delete-trailing-whitespace’ by not treating \n as whitespace
* lisp/simple.el (delete-trailing-whitespace): Set newline’s character
syntax to non-whitespace so that ‘\s-’ regular expression does not match
it.
This simplifies the loop slightly since a simple ‘\s-+$’ can be used and
as a consequence ‘line-beginning-position’ function does not need to be
called any longer.
Furthermore, when newline has whitespace syntax, ‘\s-$’ regular
expression ends up matching empty lins since ‘\s-’ matches newline
characetr of proceeding line. This leads to needless loop iterations.
Since previous change to ‘delete-trailing-whitespace’ already introduced
‘with-syntax-table’, take advantage of it and also overwrite newline’s
character syntax.
Make ‘delete-trailing-whitespace’ delete spaces after form feed
* lisp/simple.el (delete-trailing-whitespace): Treat form fead as
a non-whitespace character (regradless of whether it’s character syntax
is whitespace) and delete any whitespace following it instead of leaving
lines with form feeds completely unchanged. I.e. a line like "\f " will
now became "\f".
* configure.ac [USE_X_TOOLKIT]: Define X_TOOLKIT_EDITRES if
_XEditResCheckMessages is declared in X11/Xmu/Editres.h and may be
linked with -lXmu. This should work with any non-ancient Xmu library.
* xfns.c (toplevel): Remove old cruft.
(x_window) [USE_X_TOOLKIT]: Use X_TOOLKIT_EDITRES.
* xterm.c (toplevel): Remove old cruft.
(handle_one_xevent): Use X_TOOLKIT_EDITRES.
* xterm.h (toplevel): Include X11/Xmu/Editres.h if X_TOOLKIT_EDITRES.
Michael Albinus [Mon, 4 Jul 2016 13:36:30 +0000 (15:36 +0200)]
Add Google Drive support to Tramp
* doc/misc/tramp.texi: Add `gdrive' method.
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.3.1-pre".
* etc/NEWS: Add Tramp connection method "gdrive".
* lisp/net/tramp-gvfs.el (tramp-gvfs-methods) <gdrive>: Add.
(tramp-default-user-alist, tramp-default-host-alist): Add rule
for "gdrive".
(tramp-gvfs-file-attributes): Add "name", remove "standard::icon".
(tramp-gvfs-file-attributes-with-gvfs-ls-regexp): Simplify regexp.
(tramp-gvfs-get-directory-attributes): Improve loop. Use
"standard::display-name" as file name, if available.
(tramp-gvfs-handle-file-name-all-completions): Simplify.
(tramp-gvfs-url-file-name, tramp-gvfs-handler-mounted-unmounted)
(tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec):
Map between "gdrive" and "google-drive".
* lisp/net/tramp.el (tramp-call-process): Do not signal error.
* test/lisp/net/tramp-tests.el (tramp--instrument-test-case):
Do not enable `tramp-message-show-message'.
(tramp-test13-make-directory, tramp-test14-delete-directory):
Do not specify error type.
Paul Eggert [Sun, 3 Jul 2016 22:46:57 +0000 (00:46 +0200)]
Re-fix open-network-stream responsiveness
Problem reported by Christer Ekholm (Bug#23864).
* src/process.c (wait_reading_process_output): Further fix for
typo introduced in 2015-07-06T02:19:13Z!eggert@cs.ucla.edu when
wait == INFINITY and got_output_end_time is invalid. See:
http://bugs.gnu.org/23864#20
Alan Mackenzie [Sun, 3 Jul 2016 18:13:51 +0000 (18:13 +0000)]
Remove redundant forms from CC Mode for faster fontification
* lisp/progmodes/cc-fonts.el (c-font-lock-declarations): Remove four arms of
the "main" cond form in the function, which have been redundant since the
extraction of c-font-lock-cut-off-declarators from the function on
2016-06-15/16.