Robert Pluim [Thu, 31 Jan 2019 13:20:32 +0000 (14:20 +0100)]
Use IPv6 localhost when family is 'ipv6
This fixes Bug#34193
* src/process.c (Fmake_network_process): Explicitly use ::1 when
using IPv6 with 'local. Update docstring.
* test/lisp/net/network-stream-tests.el
(make-ipv6-tcp-server-with-unspecified-port):
(make-ipv6-tcp-server-with-specified-port): Test creating ipv6
local server.
(make-server): Add optional family argument, default ipv4
(echo-server-with-local-ipv4): Test connecting to 'local ipv4
(echo-server-with-local-ipv6): Test connecting to 'local ipv6
* doc/lispref/processes.texi (Network Processes): Describe
behavior when using 'local.
* etc/NEWS: Document new 'make-network-process' behavior when
connecting to 'local with ipv6.
Michael Albinus [Sun, 3 Feb 2019 10:07:36 +0000 (11:07 +0100)]
Work on accept-process-output in Tramp
* lisp/net/tramp.el (tramp-accept-process-output): Rework timer
handling.
(tramp-call-process): Adapt VEC if nil.
(tramp-interrupt-process): Use `tramp-accept-process-output'.
(tramp-process-lines): New defun.
* lisp/net/tramp-adb.el (tramp-adb-parse-device-names):
* lisp/net/tramp-rclone.el (tramp-rclone-parse-device-names): Use it.
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-notify-add-watch):
Use timeout 0 in `tramp-accept-process-output'.
* test/lisp/net/tramp-tests.el (tramp--test-timeout-handler): Move up.
(tramp-test29-start-file-process, tramp-test30-make-process)
(tramp-test32-shell-command)
(tramp--test-shell-command-to-string-asynchronously): Use it.
(tramp-test35-remote-path): Suppress warning.
(tramp--test-asynchronous-requests-timeout): New defconst.
(tramp-test43-asynchronous-requests): Skip if not the only test.
Use `tramp--test-asynchronous-requests-timeout'.
Remove instrumentation. Use `start-process-shell-command' for
watchdog. Add timeout in timer function. Print status messages.
Remove file operations from sentinel. Suppress timers in
`accept-process-output'.
Paul Eggert [Sat, 2 Feb 2019 21:23:04 +0000 (13:23 -0800)]
Support (locale-info 'paper) on GNU platforms
* configure.ac (HAVE_LANGINFO__NL_PAPER_WIDTH): New macro.
* src/fns.c (Flocale_info) [HAVE_LANGINFO__NL_PAPER_WIDTH]:
Get paper width and height from locale.
Martin Rudalics [Sat, 2 Feb 2019 08:43:34 +0000 (09:43 +0100)]
Fix bugs caused by running window change functions during redisplay
* src/xdisp.c (redisplay_internal): Run window change
functions before updating the display so changes induced by
these functions can get caught by redisplay (Bug#34138).
* src/window.c (run_window_change_functions): Bind
Qinhibit_redisplay to avoid that the minibuffer window gets
resized while running window change functions (Bug#34179,
Bug#34260).
Paul Eggert [Sat, 2 Feb 2019 01:07:13 +0000 (17:07 -0800)]
Restore SETFATTR substitution
* configure.ac (SETFATTR): Restore the AC_SUBST of this
that was inadvertently removed when pdumper support was added.
Need for ./configure --with-dumping=unexec on Fedora 29.
Paul Eggert [Fri, 1 Feb 2019 23:17:48 +0000 (15:17 -0800)]
Make make-dist more automatic
Simplify make-dist maintenance by having it generate its
list of files more automatically. Put the list of distributed
files into a file MANIFEST that can be used in the unusual
situations when you’re making a distribution without having
access to a Git repository.
* make-dist (top_level_ChangeLog): Now nonempty if the
distribution tarball will contain a ChangeLog, instead of
being nonempty when a ChangeLog is requested, Git is present
and a readable ChangeLog exists. The new interpretation makes
the script a bit easier to follow.
(possibly_non_vc_files, info_files, mkdir_verbose)
(file_to_skip, MANIFEST_subdir_sed, tempsubdirs):
New variables.
(MANIFEST): Update and use this file, which now records what
files are distributed.
(top_level, subdir, files, file): Remove.
Paul Eggert [Fri, 1 Feb 2019 21:03:18 +0000 (13:03 -0800)]
Rename CANNOT_DUMP to HAVE_UNEXEC
* configure.ac (CANNOT_DUMP): Remove. All uses removed,
or changed to the negative of with_unexec.
(HAVE_UNEXEC): New macro. All uses of CANNOT_DUMP changed
to the negative of this macro.
Paul Eggert [Fri, 1 Feb 2019 16:45:20 +0000 (08:45 -0800)]
Stop using macOS -prebind option
* configure.ac (LD_SWITCH_SYSTEM_TEMACS): Remove -prebind,
which has been obsolete and ineffective since Mac OS X 10.4 (2005),
which was never necessary for correct operation, and which now
generates annoying warnings. Problem reported by Robert Pluim in:
https://lists.gnu.org/r/emacs-devel/2019-01/msg00761.html
Eli Zaretskii [Fri, 1 Feb 2019 15:34:23 +0000 (17:34 +0200)]
Correct the docs of inserting kmacro counter
* doc/emacs/kmacro.texi (Keyboard Macro Counter): Correct the
description of the affect "C-u" has on inserting the macro
counter. Define "previous counter value".
* lisp/kmacro.el (kmacro-insert-counter)
(kmacro-start-macro-or-insert-counter): Fix the doc strings
regarding the effect of "C-u". (Bug#34263)
* lisp/emacs-lisp/rx.el (rx-kleene):
Treat \? and \?? like ? and ?? (Bug#34100).
* test/lisp/emacs-lisp/rx-tests.el: Add tests for all repetition operators.
Paul Eggert [Thu, 31 Jan 2019 23:31:41 +0000 (15:31 -0800)]
Prefer static to extern where either will do
* src/charset.c (charset_table_size):
* src/pdumper.c (dump_private):
* src/sysdep.c (init_sigsegv):
* src/window.c (old_selected_window):
Now static.
* src/charset.c (charset_table_size):
Now int, since the value always fits in int.
* src/gtkutil.c (xg_gtk_initialized): Now present only if
HAVE_XWIDGETS, to make it clearer that this is an xwidgets
hack. All uses changed.
* src/lread.c (ndefsubr): Remove; unused.
* src/pdumper.h: Use usual GNU indenting style for functions,
since my static-vs-extern checking hack relies on it.
(dump_public): Always declare; simpler and doesn’t hurt.
(pdumper_handle_page_fault): Remove unused decl.
Paul Eggert [Wed, 30 Jan 2019 23:11:17 +0000 (15:11 -0800)]
Fix process-contact bug with TCP connections
This fixes a regression from Emacs 25.3 (Bug#34134).
* src/process.c (server_accept_connection):
Set host correctly, fixing a bug introduced in
2017-09-16T21:29:18Z!eggert@cs.ucla.edu
when working around a GCC bug.
Glenn Morris [Wed, 30 Jan 2019 17:12:15 +0000 (09:12 -0800)]
Merge from origin/emacs-26
b94d767 (origin/emacs-26) Minor copyedits in last manual change 73508e6 Improve documentation of face numbers bf235ce * doc/emacs/custom.texi (Authentication): Refer to the "Help ... ceccb3c New node Authentication in the Emacs manual 9078f34 Fix a loop in c-fl-decl-start. This fixes bug #34186. a177fe7 Fix LaTeX output of month and day from cal-tex.el 90177d7 Avoid elisp crash for OpenPGP User IDs with no e-mail address 68e55a0 image-mode: Do not use default scaling (bug#33990) b6c762a create-image: Expand documentation (bug#33990) 928d342 Improve documentation of 'isearch-filter-predicate' 9034dd6 Fix cursor column positioning on Grep hits
Eli Zaretskii [Tue, 29 Jan 2019 16:28:13 +0000 (18:28 +0200)]
Improve documentation of face numbers
* doc/lispref/display.texi (Face Functions): Mention where the
face number is used and that it depends on the 'face' property
of the face symbol. Improve indexing.
* lisp/vc/diff-mode.el (diff-syntax-fontify-hunk): Set overlay
property 'diff-mode to 'syntax. (Bug#33567)
(diff-syntax-fontify-props): Reset buffer-file-name to nil.
Juri Linkov [Mon, 28 Jan 2019 20:27:22 +0000 (22:27 +0200)]
More checks for live buffers.
* lisp/dired-x.el (dired-jump): Check if archive/tar superior buffer
was killed by the user.
* lisp/progmodes/ruby-mode.el (ruby-flymake--helper): Check if source buffer
was killed by the user immediately after visiting and before process finishes.
Alan Mackenzie [Mon, 28 Jan 2019 10:54:42 +0000 (10:54 +0000)]
Detect when we hit limit in backward search in c-just-after-func-arglist-p
This fixes a bug reported by Yasushi SHOJI <yasushi.shoji@gmail.com> to
emacs-devel on 2018-11-26, where wrong analysis and fontification occurred.
* lisp/progmodes/cc-engine.el (c-beginning-of-statement-1): Add new parameter
HIT-LIM which, if non-nil causes the function to return nil rather than 'same
when we reach the backward search limit without finding the beginning of
statement.
(c-just-after-func-arglist-p): Supply argument t to this new parameter in call
to c-beginning-of-statement-1.
Paul Eggert [Sun, 27 Jan 2019 23:49:53 +0000 (15:49 -0800)]
forward-line now works with bignums
* src/cmds.c (Fforward_line): Support bignum arg.
(scan_newline): Return void since no caller was using the
return value.
* src/search.c (find_newline, scan_newline_from_point)
(find_newline1): Return the number of newlines counted, not
the count shortage, so that the return value always fits in
ptrdiff_t even if the original count was a bignum. All
callers changed.
* test/src/cmds-tests.el (forward-line-with-bignum): New test.
Eli Zaretskii [Sat, 26 Jan 2019 10:08:56 +0000 (12:08 +0200)]
Improve pdump file search and 'pdumper-stats'
* src/pdumper.c (pdumper_record_wd): New function.
(pdumper_load): Use xstrdup instead of strdup, as on
MS-Windows the latter uses the wrong heap. Don't free a
NULL pointer.
* src/emacs.c (load_pdump): Support the use case where the
Emacs binary was renamed: look in exec-directory for the
pdump file whose base name is derived from the Emacs binary,
in addition to just emacs.pdmp.
(main): Call pdumper_record_wd to prepend CWD to the pdump
file name.
* src/fileio.c (file_name_absolute_p): Now extern.
* src/lisp.h (file_name_absolute_p): Add prototype.
* src/pdumper.h (pdumper_record_wd): Add prototype.
* doc/emacs/cmdargs.texi (Initial Options): Update the
documentation of where Emacs looks for the dump file.
João Távora [Fri, 25 Jan 2019 13:04:13 +0000 (13:04 +0000)]
Adjust previous electric.el and elec-pair.el change
This fixes a serious bug introduced previously
electric-pair-inhibit-if-helps-balance and
electric-pair-skip-if-helps-balance, whereby "innocent" markers were
being pushed by those function's new save-change-and-restore
semantics. The fix can probably still be improved.
It also adds comments to parts of the code, where deemed necessary.
* lisp/elec-pair.el (electric-pair--insert): Add comment.
(electric-pair--save-literal-point-excursion): New helper macro.
(electric-pair-inhibit-if-helps-balance)
(electric-pair-skip-if-helps-balance): Don't use
insert-before-markers since it may hurt other markers that have
nothing to do with the 'save-excursion'.
(electric-pair-post-self-insert-function): Use
electric-pair--save-literal-point-excursion.
Alan Mackenzie [Fri, 25 Jan 2019 16:14:00 +0000 (16:14 +0000)]
Fix a loop in c-fl-decl-start. This fixes bug #34186.
* lisp/progmodes/cc-mode.el (c-fl-decl-start) In the pair of operations
c-syntactic-skip-backward and c-forward-syntactic-ws, ensure the latter
doesn't come back to the position before the former, and break out of the
enclosing loop if it does.
Eli Zaretskii [Fri, 25 Jan 2019 09:14:32 +0000 (11:14 +0200)]
; Fix recent changes in ELisp manual
* doc/lispref/commands.texi (Using Interactive): Add a period
at the end of a sentence.
(Event Input Misc): Fix typo and leave 2 spaces between
sentences.
Avoid elisp crash for OpenPGP User IDs with no e-mail address
* lisp/gnus/mml-sec.el (mml-secure-check-user-id): Verify that
there is an e-mail address in the current User ID before trying
to downcase it. (Bug#34121)
Image parameters were treated as image specific, but because they
actually were global variables, their behaviour transfered to new
images.
* lisp/image-mode.el (image-transform-resize, image-transform-scale)
(image-transform-rotation): Declare with defvar-local. (Bug#33990)
Robert Pluim [Thu, 24 Jan 2019 10:34:34 +0000 (11:34 +0100)]
Check for client certificates when using GnuTLS
This fixes Bug#33780, and extends the documentation to describe how to
enable use of client certificates.
* lisp/net/network-stream.el (network-stream-certificate): Correct
order of parameters to plist-get.
(network-stream-open-tls): Pass all received parameters to
open-gnutls-stream as plist, not just :nowait.
* lisp/net/gnutls.el (open-gnutls-stream): Change optional nowait arg
to be plist. Derive nowait and client certificate(s) and keys(s) from
plist (maybe via auth-source) and pass to gnutls-boot-parameters and
gnutls-negotiate.
(network-stream-certificate): Add declare-function form for it.
* doc/misc/auth.texi (Help for users): Describe format to use for
client key/cert specification.
* doc/misc/emacs-gnutls.texi (Help For Developers): Describe usage of
optional plist argument. Add crossreference to description of
.authinfo format for client key/cert specification.
* etc/NEWS: Describe new client certificate functionality for
'open-network-stream'.
* test/lisp/net/network-stream-tests.el: Add require of network-stream.
(connect-to-tls-ipv4-nowait): Bind network-security-level to 'low
in order to bypass nsm prompting.
(connect-to-tls-ipv6-nowait): Likewise.
(open-network-stream-tls-wait): New test.
(open-network-stream-tls-nowait): New test.
(open-network-stream-tls): New test.
(open-network-stream-tls-nocert): New test.
(open-gnutls-stream-new-api-default): New test.
(open-gnutls-stream-new-api-wait): New test.
(open-gnutls-stream-old-api-wait): New test.
(open-gnutls-stream-new-api-nowait): New test.
(open-gnutls-stream-old-api-nowait): New test.
(open-gnutls-stream-new-api-errors): New test.
The new tests exercise 'open-network-stream' and the old and new
api of 'open-gnutls-stream'.
Stefan Monnier [Wed, 23 Jan 2019 22:27:21 +0000 (17:27 -0500)]
doc-view-presentation, doc-view-fit-window-to-page, and use mutool
* lisp/doc-view.el (doc-view-pdfdraw-program): Use "mutool" if available.
(doc-view-mode-map): Keep default 'g' binding of 'revert-buffer'.
Change 'r' binding to 'revert-buffer'.
(doc-view-revert-buffer): Make it an obsolete alias.
(doc-view--revert-buffer): Rename from doc-view-revert-buffer, change
calling convention for use in add-function.
(doc-view-fit-window-to-page): New command.
(doc-view-pdf->png-converter-mupdf): Make it work with "mutool".
(doc-view-mode): Use add-function for revert-buffer-function.
(doc-view-presentation-mode-map, doc-view-presentation--src-data):
New vars.
(doc-view-presentation-exit, doc-view-presentation-mode)
(doc-view-presentation--propagate-pn, doc-view-presentation):
New functions.
Eli Zaretskii [Wed, 23 Jan 2019 19:53:29 +0000 (21:53 +0200)]
Fix build errors with pdump fingerprint on macOS
* src/Makefile.in ($(lispsource)/international/charprop.el):
Remove macuvs.h from the target list, to avoid circular
dependency on macOS. Reported by Alan Third <alan@idiocy.org>.
Stefan Monnier [Wed, 23 Jan 2019 17:30:54 +0000 (12:30 -0500)]
Rework last commit to icomplete and minibuffer.el.
Rather than let minibuffer-force-complete set up cycling and then undoing it,
better tell it directly not to setup cycling. Also be a bit more careful
to remove the transient map.
Additionally to bug#34077 and bug#34116, this also relates to bug#25644.
* lisp/minibuffer.el (completion--flush-all-sorted-completions):
Also take down the transient cycling map if applicable.
(minibuffer-force-complete): New arg dont-cycle.
Set completion-cycling to the actual function that takes down the
transient map rather than just t.
(minibuffer-force-complete-and-exit):
* lisp/icomplete.el (icomplete-force-complete): Use new dont-cycle arg.
João Távora [Wed, 23 Jan 2019 16:30:41 +0000 (16:30 +0000)]
Force completion in icomplete with C-M-i, but don't cycle (bug#34077)
Cycling after forcing a completion with C-M-i in icomplete can be
confusing, as it leaves rotated prospects in the minibuffer. In C-x
C-f, for example it is very difficult to understand if the prospects
refer to subdirectories of the directory being completed to, which
happens naturally when the completion is unique; or if they are a
cycled version of prospects that match the new completion pattern, in
case the completion happens to still match other items.
To resolve this confusion, never cycle with C-M-i in icomplete:
non-ambiguous cycling can be achieved with C-. and C-,
Eli Zaretskii [Wed, 23 Jan 2019 15:40:10 +0000 (17:40 +0200)]
Fix compilation of pdumper.c with old buggy GCC
* src/pdumper.c (emacs_ptr_at): Renamed from emacs_ptr, to
avoid compilation errors with GCC 4.7. Reported by Martin
Rudalics <rudalics@gmx.at>. All callers changed.