1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Merge from origin/emacs-26

408862f02a (origin/emacs-26) ; * lisp/emacs-lisp/bytecomp.el: Tweak m...
9964db4c34 Restore obsolete method of changing byte-compile-dest-file
3dd25aeecb Some minor Tramp corrections
d670a15f25 * doc/misc/url.texi (http/https): Fix typo
99d07e8d5e Remove some bogus definition-prefixes from loaddefs
6067f0c702 Shell-quote wildcards when invoking 'vc-git-grep'
0540df10e6 Update documentation of '.dir-locals-2.el'
f2441ab320 ; Fix some tiny doc and comment typos
22ff46e6d8 ; Fix some comment typos

# Conflicts:
#	etc/NEWS
This commit is contained in:
Glenn Morris 2017-11-29 17:12:56 -08:00
commit f069ea4f84
20 changed files with 107 additions and 80 deletions

View file

@ -1919,7 +1919,12 @@ settings to any file in that directory or any of its subdirectories
(optionally, you can exclude subdirectories; see below).
If some of the subdirectories have their own @file{.dir-locals.el}
files, Emacs uses the settings from the deepest file it finds starting
from the file's directory and moving up the directory tree. The file
from the file's directory and moving up the directory tree. This
constant is also used to derive the name of a second dir-locals file
@file{.dir-locals-2.el}. If this second dir-locals file is present,
then that is loaded instead of @file{.dir-locals.el}. This is useful
when @file{.dir-locals.el} is under version control in a shared
repository and cannot be used for personal customizations. The file
specifies local variables as a specially formatted list; see
@ref{Directory Variables, , Per-directory Local Variables, emacs, The
GNU Emacs Manual}, for more details.

View file

@ -401,7 +401,7 @@ gateway method to be used. @xref{Gateways in general}.
@defopt url-honor-refresh-requests
If this option is non-@code{nil} (the default), the @code{url} library
honors the HTTP @samp{Refresh} header, which is used by servers to
direct clients to reload documents from the same URL or a or different
direct clients to reload documents from the same URL or a different
one. If the value is @code{nil}, the @samp{Refresh} header is
ignored; any other value means to ask the user on each request.
@end defopt

View file

@ -366,7 +366,7 @@ These local variables will thus not vanish on setting a major mode.
+++
** A second dir-local file (.dir-locals-2.el) is now accepted.
See the variable 'dir-locals-file-2' for more information.
See the doc string of 'dir-locals-file' for more information.
+++
** Connection-local variables can be used to specify local variables

View file

@ -761,6 +761,7 @@ FILE's modification time."
"def-edebug-spec"
;; Hmm... this is getting ugly:
"define-widget"
"define-erc-module"
"define-erc-response-handler"
"defun-rcirc-command"))))
(push (match-string 2) defs))

View file

@ -172,6 +172,12 @@ are found in the same directory is hard-coded in various places in Emacs.)"
(funcall handler 'byte-compiler-base-file-name filename)
filename)))
;; Sadly automake relies on this misfeature up to at least version 1.15.1.
(if (fboundp 'byte-compile-dest-file)
(or (featurep 'bytecomp)
(display-warning 'bytecomp (format-message "\
Changing `byte-compile-dest-file' is obsolete (as of 23.2);
set `byte-compile-dest-file-function' instead.")))
(defun byte-compile-dest-file (filename)
"Convert an Emacs Lisp source file name to a compiled file name.
If `byte-compile-dest-file-function' is non-nil, uses that
@ -186,6 +192,7 @@ otherwise adds \".elc\"."
(cond ((string-match emacs-lisp-file-regexp filename)
(concat (substring filename 0 (match-beginning 0)) ".elc"))
(t (concat filename ".elc")))))
)
;; This can be the 'byte-compile property of any symbol.
(autoload 'byte-compile-inline-expand "byte-opt")

View file

@ -3905,16 +3905,16 @@ VARIABLES list of the class. The list is processed in order.
"File that contains directory-local variables.
It has to be constant to enforce uniform values across different
environments and users.
See also `dir-locals-file-2', whose values override this one's.
See Info node `(elisp)Directory Local Variables' for details.")
(defconst dir-locals-file-2 ".dir-locals-2.el"
"File that contains directory-local variables.
This essentially a second file that can be used like
`dir-locals-file', so that users can have specify their personal
dir-local variables even if the current directory already has a
`dir-locals-file' that is shared with other users (such as in a
git repository).
A second dir-locals file can be used by a user to specify their
personal dir-local variables even if the current directory
already has a `dir-locals-file' that is shared with other
users (such as in a git repository). The name of this second
file is derived by appending \"-2\" to the base name of
`dir-locals-file'. With the default value of `dir-locals-file',
a \".dir-locals-2.el\" file in the same directory will override
the \".dir-locals.el\".
See Info node `(elisp)Directory Local Variables' for details.")
(defun dir-locals--all-files (directory)

View file

@ -454,7 +454,7 @@ Set variables local to the group you are entering.
If you want to turn threading off in `news.answers', you could put
`(gnus-show-threads nil)' in the group parameters of that group.
`gnus-show-threads' will be made into a local variable in the summary
buffer you enter, and the form nil will be `eval'ed there.
buffer you enter, and the form nil will be `eval'uated there.
This can also be used as a group-specific hook function, if you'd
like. If you want to hear a beep when you enter a group, you could
@ -535,7 +535,7 @@ These files will not be loaded, even though they would normally be so,
for some reason or other.")
(eval (sexp :tag "Eval" :value nil) "\
The value of this entry will be `eval'el.
The value of this entry will be `eval'uated.
This element will be ignored when handling global score files.")
(read-only (boolean :tag "Read-only" :value t) "\

View file

@ -4774,7 +4774,7 @@ to find out how to use this."
message-qmail-inject-program nil nil nil
;; qmail-inject's default behavior is to look for addresses on the
;; command line; if there're none, it scans the headers.
;; yes, it does The Right Thing w.r.t. Resent-To and it's kin.
;; yes, it does The Right Thing w.r.t. Resent-To and its kin.
;;
;; in general, ALL of qmail-inject's defaults are perfect for simply
;; reading a formatted (i. e., at least a To: or Resent-To header)
@ -4792,7 +4792,7 @@ to find out how to use this."
(if (functionp message-qmail-inject-args)
(funcall message-qmail-inject-args)
message-qmail-inject-args)))
;; qmail-inject doesn't say anything on it's stdout/stderr,
;; qmail-inject doesn't say anything on its stdout/stderr,
;; we have to look at the retval instead
(0 nil)
(100 (error "qmail-inject reported permanent failure"))

View file

@ -676,7 +676,7 @@ MIME-Version header before proceeding."
(mm-alist-to-plist (cdr ctl)) (car ctl))
;; what really needs to be done here is a way to link a
;; MIME handle back to it's parent MIME handle (in a multilevel
;; MIME handle back to its parent MIME handle (in a multilevel
;; MIME article). That would probably require changing
;; the mm-handle API so we simply store the multipart buffer
;; name as a text property of the "multipart/whatever" string.

View file

@ -67,7 +67,7 @@
;;
;; To be able to verify messages you need to build up trust with
;; someone. Perhaps you trust the CA that issued your certificate, at
;; least I did, so I export it's certificates from my PKCS#12
;; least I did, so I export its certificates from my PKCS#12
;; certificate with:
;;
;; $ openssl pkcs12 -in mykey.p12 -cacerts -nodes > cacert.pem

View file

@ -461,7 +461,7 @@ and so on."
optimization - If on, preserve overlay highlighting
(cf ediff or goo-font-lock) as well as basic faces.\n
body-text-only : Emit only body-text. In concrete terms,
1. Suppress calls to `hfy-page-header'and
1. Suppress calls to `hfy-page-header' and
`hfy-page-footer'
2. Pretend that `div-wrapper' option above is
turned off

View file

@ -323,7 +323,7 @@ means the viewer is always valid. If it is a Lisp function, it is
called with a list of items from any extra fields from the
Content-Type header as argument to return a boolean value for the
validity. Otherwise, if it is a non-function Lisp symbol or list
whose car is a symbol, it is `eval'led to yield the validity. If it
whose car is a symbol, it is `eval'uated to yield the validity. If it
is a string or list of strings, it represents a shell command to run
to return a true or false shell value for the validity.")
(put 'mailcap-mime-data 'risky-local-variable t)

View file

@ -137,7 +137,7 @@ It is used for TCP/IP devices."
(file-readable-p . tramp-handle-file-exists-p)
(file-regular-p . tramp-handle-file-regular-p)
(file-remote-p . tramp-handle-file-remote-p)
(file-selinux-context . ignore)
(file-selinux-context . tramp-handle-file-selinux-context)
(file-symlink-p . tramp-handle-file-symlink-p)
(file-system-info . tramp-adb-handle-file-system-info)
(file-truename . tramp-adb-handle-file-truename)

View file

@ -517,7 +517,7 @@ Every entry is a list (NAME ADDRESS).")
(file-readable-p . tramp-gvfs-handle-file-readable-p)
(file-regular-p . tramp-handle-file-regular-p)
(file-remote-p . tramp-handle-file-remote-p)
(file-selinux-context . ignore)
(file-selinux-context . tramp-handle-file-selinux-context)
(file-symlink-p . tramp-handle-file-symlink-p)
(file-system-info . tramp-gvfs-handle-file-system-info)
(file-truename . tramp-handle-file-truename)

View file

@ -253,7 +253,7 @@ See `tramp-actions-before-shell' for more info.")
(file-readable-p . tramp-handle-file-exists-p)
(file-regular-p . tramp-handle-file-regular-p)
(file-remote-p . tramp-handle-file-remote-p)
;; `file-selinux-context' performed by default handler.
(file-selinux-context . tramp-handle-file-selinux-context)
(file-symlink-p . tramp-handle-file-symlink-p)
(file-system-info . tramp-smb-handle-file-system-info)
(file-truename . tramp-handle-file-truename)

View file

@ -2937,14 +2937,13 @@ User is always nil."
"Like `directory-file-name' for Tramp files."
;; If localname component of filename is "/", leave it unchanged.
;; Otherwise, remove any trailing slash from localname component.
;; Method, host, etc, are unchanged. Does it make sense to try
;; to avoid parsing the filename?
(with-parsed-tramp-file-name directory nil
(if (and (not (zerop (length localname)))
(eq (aref localname (1- (length localname))) ?/)
(not (string= localname "/")))
(substring directory 0 -1)
directory)))
;; Method, host, etc, are unchanged.
(while (with-parsed-tramp-file-name directory nil
(and (not (zerop (length localname)))
(eq (aref localname (1- (length localname))) ?/)
(not (string= localname "/"))))
(setq directory (substring directory 0 -1)))
directory)
(defun tramp-handle-directory-files (directory &optional full match nosort)
"Like `directory-files' for Tramp files."
@ -3172,6 +3171,11 @@ User is always nil."
(t (tramp-make-tramp-file-name
method user domain host port "" hop)))))))))
(defun tramp-handle-file-selinux-context (_filename)
"Like `file-selinux-context' for Tramp files."
;; Return nil context.
'(nil nil nil nil))
(defun tramp-handle-file-symlink-p (filename)
"Like `file-symlink-p' for Tramp files."
(let ((x (tramp-compat-file-attribute-type (file-attributes filename))))

View file

@ -1135,7 +1135,7 @@ Please send all bug fixes and enhancements to
;; Thanks to Drew Adams <drew.adams@oracle.com> for suggestions:
;; - `ebnf-arrow-extra-width', `ebnf-arrow-scale',
;; `ebnf-production-name-p', `ebnf-stop-on-error',
;; `ebnf-file-suffix-regexp'and `ebnf-special-show-delimiter' variables.
;; `ebnf-file-suffix-regexp' and `ebnf-special-show-delimiter' variables.
;; - `ebnf-delete-style', `ebnf-eps-file' and `ebnf-eps-directory'
;; commands.
;; - some docs fix.

View file

@ -125,7 +125,7 @@ If nil, never start checking buffer automatically like this."
"it no longer has any effect." "26.1")
(defcustom flymake-start-on-flymake-mode t
"Start syntax check when `flymake-mode'is enabled.
"Start syntax check when `flymake-mode' is enabled.
Specifically, start it when the buffer is actually displayed."
:type 'boolean)

View file

@ -1431,7 +1431,9 @@ This command shares argument histories with \\[rgrep] and \\[grep]."
nil nil 'grep-history)
nil))
(t (let* ((regexp (grep-read-regexp))
(files (grep-read-files regexp))
(files
(mapconcat #'shell-quote-argument
(split-string (grep-read-files regexp)) " "))
(dir (read-directory-name "In directory: "
nil default-directory t)))
(list regexp files dir))))))

View file

@ -1683,6 +1683,10 @@ This checks also `file-name-as-directory', `file-name-directory',
(string-equal
(directory-file-name "/method:host:/path/to/file/")
"/method:host:/path/to/file"))
(should
(string-equal
(directory-file-name "/method:host:/path/to/file//")
"/method:host:/path/to/file"))
(should
(string-equal
(file-name-as-directory "/method:host:/path/to/file")
@ -2341,7 +2345,10 @@ This tests also `file-directory-p' and `file-accessible-directory-p'."
;; There might be a summary line.
"\\(total.+[[:digit:]]+\n\\)?"
;; We don't know in which order ".", ".." and "foo" appear.
"\\(.+ \\(\\.?\\.\\|foo\\)\n\\)\\{3\\}")))))
(format
"\\(.+ %s\\( ->.+\\)?\n\\)\\{%d\\}"
(regexp-opt (directory-files tmp-name1))
(length (directory-files tmp-name1))))))))
;; Cleanup.
(ignore-errors (delete-directory tmp-name1 'recursive))))))
@ -4445,8 +4452,8 @@ Use the `ls' command."
;; Since Emacs 27.1.
(skip-unless (fboundp 'file-system-info))
;; `file-system-info' exists since Emacs 27. We don't
;; want to see compiler warnings for older Emacsen.
;; `file-system-info' exists since Emacs 27. We don't want to see
;; compiler warnings for older Emacsen.
(let ((fsi (with-no-warnings
(file-system-info tramp-test-temporary-file-directory))))
(skip-unless fsi)
@ -4622,22 +4629,50 @@ process sentinels. They shall not disturb each other."
(skip-unless (tramp--test-enabled))
(skip-unless (not (tramp--test-mock-p)))
(let ((default-directory (expand-file-name temporary-file-directory)))
(let ((code
(format
"(message \"Tramp loaded: %%s\" (consp (file-attributes \"%s\")))"
tramp-test-temporary-file-directory)))
(let ((default-directory (expand-file-name temporary-file-directory))
(code
(format
"(message \"Tramp loaded: %%s\" (consp (file-attributes %S)))"
tramp-test-temporary-file-directory)))
(should
(string-match
"Tramp loaded: t[\n\r]+"
(shell-command-to-string
(format
"%s -batch -Q -L %s --eval %s"
(expand-file-name invocation-name invocation-directory)
(mapconcat 'shell-quote-argument load-path " -L ")
(shell-quote-argument code)))))))
(ert-deftest tramp-test42-delay-load ()
"Check that Tramp is loaded lazily, only when needed."
;; Tramp is neither loaded at Emacs startup, nor when completing a
;; non-Tramp file name like "/foo". Completing a Tramp-alike file
;; name like "/foo:" autoloads Tramp, when `tramp-mode' is t.
(let ((default-directory (expand-file-name temporary-file-directory))
(code
"(progn \
(setq tramp-mode %s) \
(message \"Tramp loaded: %%s\" (featurep 'tramp)) \
(file-name-all-completions \"/foo\" \"/\") \
(message \"Tramp loaded: %%s\" (featurep 'tramp)) \
(file-name-all-completions \"/foo:\" \"/\") \
(message \"Tramp loaded: %%s\" (featurep 'tramp)))"))
;; Tramp doesn't load when `tramp-mode' is nil since Emacs 26.1.
(dolist (tm (if (tramp--test-emacs26-p) '(t nil) '(nil)))
(should
(string-match
"Tramp loaded: t[\n\r]+"
(format
"Tramp loaded: nil[\n\r]+Tramp loaded: nil[\n\r]+Tramp loaded: %s[\n\r]+"
tm)
(shell-command-to-string
(format
"%s -batch -Q -L %s --eval %s"
(expand-file-name invocation-name invocation-directory)
(mapconcat 'shell-quote-argument load-path " -L ")
(shell-quote-argument code))))))))
(shell-quote-argument (format code tm)))))))))
(ert-deftest tramp-test43-recursive-load ()
(ert-deftest tramp-test42-recursive-load ()
"Check that Tramp does not fail due to recursive load."
(skip-unless (tramp--test-enabled))
@ -4660,7 +4695,7 @@ process sentinels. They shall not disturb each other."
(mapconcat 'shell-quote-argument load-path " -L ")
(shell-quote-argument code))))))))
(ert-deftest tramp-test44-remote-load-path ()
(ert-deftest tramp-test42-remote-load-path ()
"Check that Tramp autoloads its packages with remote `load-path'."
;; `tramp-cleanup-all-connections' is autoloaded from tramp-cmds.el.
;; It shall still work, when a remote file name is in the
@ -4683,34 +4718,7 @@ process sentinels. They shall not disturb each other."
(mapconcat 'shell-quote-argument load-path " -L ")
(shell-quote-argument code)))))))
(ert-deftest tramp-test45-delay-load ()
"Check that Tramp is loaded lazily, only when needed."
;; Tramp is neither loaded at Emacs startup, nor when completing a
;; non-Tramp file name like "/foo". Completing a Tramp-alike file
;; name like "/foo:" autoloads Tramp, when `tramp-mode' is t.
(let ((code
"(progn \
(setq tramp-mode %s) \
(message \"Tramp loaded: %%s\" (featurep 'tramp)) \
(file-name-all-completions \"/foo\" \"/\") \
(message \"Tramp loaded: %%s\" (featurep 'tramp)) \
(file-name-all-completions \"/foo:\" \"/\") \
(message \"Tramp loaded: %%s\" (featurep 'tramp)))"))
;; Tramp doesn't load when `tramp-mode' is nil since Emacs 26.1.
(dolist (tm (if (tramp--test-emacs26-p) '(t nil) '(nil)))
(should
(string-match
(format
"Tramp loaded: nil[\n\r]+Tramp loaded: nil[\n\r]+Tramp loaded: %s[\n\r]+"
tm)
(shell-command-to-string
(format
"%s -batch -Q -L %s --eval %s"
(expand-file-name invocation-name invocation-directory)
(mapconcat 'shell-quote-argument load-path " -L ")
(shell-quote-argument (format code tm)))))))))
(ert-deftest tramp-test46-unload ()
(ert-deftest tramp-test43-unload ()
"Check that Tramp and its subpackages unload completely.
Since it unloads Tramp, it shall be the last test to run."
:tags '(:expensive-test)
@ -4756,6 +4764,12 @@ Since it unloads Tramp, it shall be the last test to run."
(ignore-errors (all-completions "tramp" (symbol-value x)))
(ert-fail (format "Hook `%s' still contains Tramp function" x)))))))
(defun tramp-test-all (&optional interactive)
"Run all tests for \\[tramp]."
(interactive "p")
(funcall
(if interactive 'ert-run-tests-interactively 'ert-run-tests-batch) "^tramp"))
;; TODO:
;; * dired-compress-file
@ -4769,11 +4783,5 @@ Since it unloads Tramp, it shall be the last test to run."
;; * Fix `tramp-test30-interrupt-process', timeout doesn't work reliably.
;; * Fix Bug#16928 in `tramp-test41-asynchronous-requests'.
(defun tramp-test-all (&optional interactive)
"Run all tests for \\[tramp]."
(interactive "p")
(funcall
(if interactive 'ert-run-tests-interactively 'ert-run-tests-batch) "^tramp"))
(provide 'tramp-tests)
;;; tramp-tests.el ends here