* lisp/subr.el (add-to-history): Clarify docstring.
Protect against negative history-length and unnecessary variable
modification, as per read_minibuf.
Michael Albinus [Wed, 2 May 2018 10:31:51 +0000 (12:31 +0200)]
Fix some edge cases of tramp-smb
* lisp/net/tramp-smb.el (tramp-smb-errors):
Add "NT_STATUS_REVISION_MISMATCH".
(tramp-smb-handle-delete-directory): Check, that the directory
has been removed indeed.
(tramp-smb-get-localname): Add further checks on filename syntax.
* lisp/net/tramp.el (tramp-localname-regexp): Do not allow linefeeds.
* test/lisp/net/tramp-tests.el (tramp-smb-get-localname): Declare.
(auth-source-save-behavior): Set it to nil.
(tramp-test01-file-name-syntax): Extend, checking for linefeeds.
(tramp-test03-file-name-host-rules, tramp--test-utf8): Refine tests.
(tramp-test03-file-name-method-rules): New test.
(tramp--test-ignore-add-name-to-file-error): New defmacro.
(tramp-test21-file-links): Use it.
Paul Eggert [Tue, 1 May 2018 00:17:11 +0000 (17:17 -0700)]
Port --enable-gcc-warnings to GCC 8
Backport from master.
* lib-src/emacsclient.c (fail):
Do not dereference a null pointer.
* src/frame.c (delete_frame):
Add a decl with UNINIT to work around GCC bug 85563.
* src/menu.h (finish_menu_items):
Do not use attribute const.
* src/regex.c (analyze_first): Use FALLTHROUGH, not a comment.
Stefan Monnier [Mon, 30 Apr 2018 02:25:09 +0000 (22:25 -0400)]
* lisp/net/socks.el: Use lexical-binding and process properties
Remove unneeded requires. Better following commenting conventions.
(socks-connections): Remove (use process properties instead).
(socks-wait-for-state-change): Make it a function.
(open-network-stream): Use an advice when overriding.
(socks-send-command): Avoid string-make-unibyte.
(socks--open-network-stream): New function (extracted from
socks-open-network-stream).
(socks-open-network-stream): Rewrite using it.
Paul Eggert [Sat, 28 Apr 2018 23:49:24 +0000 (16:49 -0700)]
Port --enable-gcc-warnings to GCC 8
* configure.ac: Do not use GCC 8’s new -Wcast-align flag.
* lib-src/ebrowse.c (xmalloc):
* lib-src/emacsclient.c (xmalloc, xstrdup):
* lib-src/etags.c (xmalloc):
* lib-src/make-docfile.c (xmalloc):
* lib-src/movemail.c (xmalloc):
* src/dispnew.c (new_glyph_pool):
* src/regex.c (xmalloc):
* src/term.c (tty_menu_create):
* src/tparam.h (tparam):
Use ATTRIBUTE_MALLOC. Also see GCC bug 85562.
* lib-src/emacsclient.c (fail):
Do not dereference a null pointer.
* src/frame.c (delete_frame):
Add a decl with UNINIT to work around GCC bug 85563.
* src/menu.h (finish_menu_items):
Do not use attribute const.
* src/regex.c (analyze_first): Use FALLTHROUGH, not a comment.
Juri Linkov [Sat, 28 Apr 2018 20:20:33 +0000 (23:20 +0300)]
* lisp/subr.el (dotimes): Deprecate RESULT field. (Bug#16206)
* doc/lispref/control.texi (Iteration):
* doc/misc/cl.texi (Iteration): Document deprecation of its use.
* doc/lispintro/emacs-lisp-intro.texi (dotimes):
* test/src/emacs-module-tests.el (multiply-string):
* test/lisp/filenotify-tests.el (file-notify-test07-many-events):
Place RESULT field after the form.
* lisp/gnus/message.el (message-forward-included-headers): Change
the default to exclude most messages.
(message-remove-ignored-headers): Make
message-forward-included-headers actually work -- it's a list of
regexps, not a list of strings.
Ivan Shmakov [Fri, 23 Mar 2018 03:24:17 +0000 (03:24 +0000)]
Ensure woman2-roff-buffer restores functions on error (Bug#30908)
* lisp/woman.el (woman2-roff-buffer): Put the fallback paragraph
processing inside the protected part of the unwind-protect form,
rather than the cleanup forms. Attempting to format paragraphs again
after an error has been signaled is unlikely to be helpful. The
fallback processing should be triggered only in case the loop
terminated normally, but did not reach the end of the buffer for some
reason.
* lisp/emacs-lisp/cl-print.el (cl-print-object) <cons>: Push each
element of list being printed onto cl-print--currently-printing.
* test/lisp/emacs-lisp/cl-print-tests.el (cl-print-circle-2): New
test.
Paul Eggert [Wed, 25 Apr 2018 19:20:04 +0000 (12:20 -0700)]
Don’t set print-escape-newlines in the minibuffer
This appears to be an unnecessary and possibly-confusing
revenant from ancient code (Bug#31251). See thread containing:
https://lists.gnu.org/r/emacs-devel/2018-04/msg00654.html
* src/minibuf.c (read_minibuf): Do not set print-escape-newlines.
* src/print.c (syms_of_print): Do not defsym print-escape-newlines
or print-escape-control-characters, as these symbols are not used
in C code.
Do not call interprogram-paste-function repeatedly
* lisp/simple.el (current-kill): Disable interprogram-paste-function
so that kill-new doesn't call it repeatedly when
save-interprogram-paste-before-kill is enabled. (bug#31209)
* lisp/subr.el (add-to-invisibility-spec)
(remove-from-invisibility-spec): Make the doc string say what
happens if `buffer-invisibility-spec' is an atom (bug#30171).
Paul Eggert [Mon, 23 Apr 2018 17:44:24 +0000 (10:44 -0700)]
Backspace is not a paragraph separator in Texinfo files
* lisp/textmodes/texinfo.el (texinfo-mode): Omit backspace from
paragraph separator and start. Perhaps there was some confusion
about .texi vs .info files long ago?
Michael Albinus [Mon, 23 Apr 2018 08:16:06 +0000 (10:16 +0200)]
Let Tramp save passwords
* lisp/auth-source.el (auth-source-secrets-saver): New defun.
(auth-source-secrets-create): Use it.
* lisp/net/secrets.el (secrets-struct-secret-content-type):
(secrets-create-item): Do not hard-code :xdg:schema.
* lisp/net/tramp.el (tramp-password-save-function): New defvar.
(tramp-read-passwd): Set it properly.
(tramp-process-actions):
* lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection):
Save password.
Juri Linkov [Sun, 22 Apr 2018 22:10:49 +0000 (01:10 +0300)]
Improve Isearch error handling
* lisp/isearch.el (isearch--momentary-message): Propertize message
suffix with minibuffer-prompt face.
(isearch--describe-regexp-mode): Do not omit description in case
of error in default non-literal search.
(isearch-message-prefix): Display “case-sensitive” in case of error.
(isearch-message-suffix): Propertize message suffix with
minibuffer-prompt face.
(isearch-search-fun-default): Remove unused error handling.
* lisp/vc/add-log.el (change-log-next-buffer): Better handle
errors during wrapping.
Karl Otness [Sun, 22 Apr 2018 03:01:11 +0000 (23:01 -0400)]
Fix pre- and post-command-hook errors in term.el
Before this patch, after the terminal process dies the command
hooks added in term-mode's char mode would produce errors.
This fix removes these hooks when the process dies.
* lisp/term.el (term-handle-exit): Remove pre-command-hook and
post-command-hook because the process is dead. (Bug#31236)
5de608f (origin/emacs-26) Update the documentation of 'perform-replace' 06245b6 * etc/NEWS: Another fix for the last change (noted by Juri Li... 8f6293c Fix use of @key in Texinfo manuals f4c9894 Improve documentation of actual arglist ce0e253 ; * etc/NEWS: Improve last change as proposed by Phil Sainty b89ff0e Don't assume term-current-row cache is valid (Bug#31193) 326a296 ; * etc/NEWS: Mention 'display-buffer-in-major-side-window' c... 3bdc9a1 Fix flyspell-auto-correct-previous-word broken by recent change a539eb5 * test/src/lread-tests.el (lread-test-bug-31186): New test. 3fa472b Fix undefined behaviour while looking for lexical-binding fil... 4341aac Minor wording improvement in "Bookmarks"
Juri Linkov [Thu, 19 Apr 2018 20:30:46 +0000 (23:30 +0300)]
Use text properties to save search parameters. (Bug#22479)
* lisp/isearch.el (isearch-update-ring): Call isearch-string-propertize.
Delete duplicates with possibly different text properties.
(isearch-string-propertize)
(isearch-update-from-string-properties): New functions.
(with-isearch-suspended, isearch-ring-adjust1):
Call isearch-update-from-string-properties.
(isearch-edit-string): Let-bind minibuffer-allow-text-properties to t.
(isearch-query-replace): Use propertized isearch-string.
(isearch--lax-regexp-function-p): Simplify.
* lisp/replace.el (query-replace-descr): Rewrite to keep text properties
non-destructively in the replacement string.
(query-replace--split-string): Don't remove text properties
by substring-no-properties.
(query-replace-read-args): Try to get isearch-regexp-function
from text-properties.
(perform-replace): Display parameters in the replacement message.
* lisp/desktop.el (desktop--v2s): Check if text properties are unreadable.
(Bug#30786)
Michael Albinus [Thu, 19 Apr 2018 09:04:01 +0000 (11:04 +0200)]
Handle chrooted environments in Tramp
* doc/misc/tramp.texi (Frequently Asked Questions): New item, chrooted
environments.
* lisp/net/tramp.el (tramp-local-host-regexp): Make it a defcustom.
Allow nil.
(tramp-local-host-p):
* lisp/net/tramp-sh.el (tramp-compute-multi-hops): Handle this.
Eli Zaretskii [Thu, 19 Apr 2018 08:29:50 +0000 (11:29 +0300)]
Improve documentation of actual arglist
* doc/lispref/functions.texi (Function Documentation): Advise
against using '(fn ARGLIST)' method of advertising a calling
convention when the old calling convention is deprecated.
(Bug#31191)
Paul Eggert [Thu, 19 Apr 2018 00:12:56 +0000 (17:12 -0700)]
Fix botched merge of FQDNs in PROBLEMS
This text was originally removed in
2014-12-30T04:42:26Z!eggert@cs.ucla.edu but then was
mistakenly re-added in the merge in
2015-03-23T17:30:30Z!eggert@cs.ucla.edu.
* etc/PROBLEMS: Omit obsolete mention of FQDNs.