commit 4f45e89852129db6a3026187768c6ba5b30c39fe (HEAD, refs/remotes/origin/master) Author: Katsumi Yamaoka Date: Thu Nov 14 08:27:58 2019 +0000 Obsolete rfc2047-quote-special-characters-in-quoted-strings (bug#38200) * lisp/mail/rfc2047.el (rfc2047-quote-special-characters-in-quoted-strings): Make obsolete instead of removing it. diff --git a/lisp/mail/rfc2047.el b/lisp/mail/rfc2047.el index 8229bebfd6..d8511d4e39 100644 --- a/lisp/mail/rfc2047.el +++ b/lisp/mail/rfc2047.el @@ -184,6 +184,56 @@ This is either `base64' or `quoted-printable'." (re-search-forward ":[ \t\n]*" nil t) (buffer-substring-no-properties (point) (point-max))))) +(make-obsolete 'rfc2047-quote-special-characters-in-quoted-strings nil "27.1") +(defun rfc2047-quote-special-characters-in-quoted-strings (&optional + encodable-regexp) + "Quote special characters with `\\'s in quoted strings. +Quoting will not be done in a quoted string if it contains characters +matching ENCODABLE-REGEXP or it is within parentheses." + (goto-char (point-min)) + (let ((tspecials (concat "[" ietf-drums-tspecials "]")) + (start (point)) + beg end) + (with-syntax-table (standard-syntax-table) + (while (not (eobp)) + (if (ignore-errors + (forward-list 1) + (eq (char-before) ?\))) + (forward-list -1) + (goto-char (point-max))) + (save-restriction + (narrow-to-region start (point)) + (goto-char start) + (while (search-forward "\"" nil t) + (setq beg (match-beginning 0)) + (unless (eq (char-before beg) ?\\) + (goto-char beg) + (setq beg (1+ beg)) + (condition-case nil + (progn + (forward-sexp) + (setq end (1- (point))) + (goto-char beg) + (if (and encodable-regexp + (re-search-forward encodable-regexp end t)) + (goto-char (1+ end)) + (save-restriction + (narrow-to-region beg end) + (while (re-search-forward tspecials nil 'move) + (if (eq (char-before) ?\\) + (if (looking-at tspecials) ;; Already quoted. + (forward-char) + (insert "\\")) + (goto-char (match-beginning 0)) + (insert "\\") + (forward-char)))) + (forward-char))) + (error + (goto-char beg))))) + (goto-char (point-max))) + (forward-list 1) + (setq start (point)))))) + (defvar rfc2047-encoding-type 'address-mime "The type of encoding done by `rfc2047-encode-region'. This should be dynamically bound around calls to commit 7a1f401b8341f363f2c6b9e58344dc2738259ddc Author: Katsumi Yamaoka Date: Thu Nov 14 08:05:05 2019 +0000 Remove rfc2047-quote-special-characters-in-quoted-strings (bug#38200) * lisp/mail/rfc2047.el (rfc2047-quote-special-characters-in-quoted-strings): Remove function. (rfc2047-encode-message-header, rfc2047-encode-region): Don't use it. diff --git a/lisp/mail/rfc2047.el b/lisp/mail/rfc2047.el index 188e5dc396..8229bebfd6 100644 --- a/lisp/mail/rfc2047.el +++ b/lisp/mail/rfc2047.el @@ -184,55 +184,6 @@ This is either `base64' or `quoted-printable'." (re-search-forward ":[ \t\n]*" nil t) (buffer-substring-no-properties (point) (point-max))))) -(defun rfc2047-quote-special-characters-in-quoted-strings (&optional - encodable-regexp) - "Quote special characters with `\\'s in quoted strings. -Quoting will not be done in a quoted string if it contains characters -matching ENCODABLE-REGEXP or it is within parentheses." - (goto-char (point-min)) - (let ((tspecials (concat "[" ietf-drums-tspecials "]")) - (start (point)) - beg end) - (with-syntax-table (standard-syntax-table) - (while (not (eobp)) - (if (ignore-errors - (forward-list 1) - (eq (char-before) ?\))) - (forward-list -1) - (goto-char (point-max))) - (save-restriction - (narrow-to-region start (point)) - (goto-char start) - (while (search-forward "\"" nil t) - (setq beg (match-beginning 0)) - (unless (eq (char-before beg) ?\\) - (goto-char beg) - (setq beg (1+ beg)) - (condition-case nil - (progn - (forward-sexp) - (setq end (1- (point))) - (goto-char beg) - (if (and encodable-regexp - (re-search-forward encodable-regexp end t)) - (goto-char (1+ end)) - (save-restriction - (narrow-to-region beg end) - (while (re-search-forward tspecials nil 'move) - (if (eq (char-before) ?\\) - (if (looking-at tspecials) ;; Already quoted. - (forward-char) - (insert "\\")) - (goto-char (match-beginning 0)) - (insert "\\") - (forward-char)))) - (forward-char))) - (error - (goto-char beg))))) - (goto-char (point-max))) - (forward-list 1) - (setq start (point)))))) - (defvar rfc2047-encoding-type 'address-mime "The type of encoding done by `rfc2047-encode-region'. This should be dynamically bound around calls to @@ -269,18 +220,15 @@ Should be called narrowed to the head of the message." (setq alist nil method (cdr elem)))) (if (not (rfc2047-encodable-p)) - (prog2 - (when (eq method 'address-mime) - (rfc2047-quote-special-characters-in-quoted-strings)) - (if (and (eq (mm-body-7-or-8) '8bit) - (mm-multibyte-p) - (mm-coding-system-p - (car message-posting-charset))) - ;; 8 bit must be decoded. - (encode-coding-region - (point-min) (point-max) - (mm-charset-to-coding-system - (car message-posting-charset))))) + (if (and (eq (mm-body-7-or-8) '8bit) + (mm-multibyte-p) + (mm-coding-system-p + (car message-posting-charset))) + ;; 8 bit must be decoded. + (encode-coding-region + (point-min) (point-max) + (mm-charset-to-coding-system + (car message-posting-charset)))) ;; We found something that may perhaps be encoded. (re-search-forward "^[^:]+: *" nil t) (cond @@ -397,8 +345,6 @@ Dynamically bind `rfc2047-encoding-type' to change that." (if (> (point) start) (rfc2047-encode start (point)) (goto-char end)))) - ;; `address-mime' case -- take care of quoted words, comments. - (rfc2047-quote-special-characters-in-quoted-strings encodable-regexp) (with-syntax-table rfc2047-syntax-table (goto-char (point-min)) (condition-case err ; in case of unbalanced quotes commit fd60824be998d47baa19cee317c96d1c7c97251b Author: Andrii Kolomoiets Date: Thu Nov 14 08:18:22 2019 +0100 (vc-default-update-on-retrieve-tag): Accept backend argument * lisp/vc/vc.el (vc-default-update-on-retrieve-tag): Accept backend argument (bug#38156). This fixes a bug introduced in the previous patch. diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 401b39145c..0d29c80d02 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -3032,7 +3032,7 @@ to provide the `find-revision' operation instead." "Let BACKEND receive FILE from another version control system." (vc-call-backend backend 'register (list file) rev "")) -(defun vc-default-update-on-retrieve-tag () +(defun vc-default-update-on-retrieve-tag (_backend) "Prompt for update buffers on `vc-retrieve-tag'." t) commit 900ace0dcecc4ad7a27106cfa0e45f64168dce49 Author: Lars Ingebrigtsen Date: Thu Nov 14 07:48:41 2019 +0100 Fix mouse-1 on Gnus article buffer buttons * lisp/gnus/gnus-art.el (gnus-article-add-button): Make mouse-1 work as required by mouse-1-click-follows-link (bug#38144). diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index a962566f1e..ff365ed686 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -8077,6 +8077,7 @@ url is put as the `gnus-button-url' overlay property on the button." 'button-data data 'action fun 'keymap gnus-url-button-map + 'follow-link t 'category t 'button t) (and data (list 'gnus-data data)))) commit 7afde23248e17c155dc6a632d9a3eca44ab5c1b4 Author: Andrii Kolomoiets Date: Thu Nov 14 06:55:28 2019 +0100 VC: ability to skip update buffers prompt * lisp/vc/vc.el (vc-default-update-on-retrieve-tag): New function. (vc-retrieve-tag): Call `update-on-retrieve-tag' backend function to determine if prompt for update buffers is needed; Include tag name into the "Retrieving tag" message. * lisp/vc/vc-git.el (vc-git-update-on-retrieve-tag): * lisp/vc/vc-hg.el (vc-hg-update-on-retrieve-tag): * lisp/vc/vc-svn.el (vc-svn-udate-on-retrieve-tag): New functions. Buffers update prompt on `vc-retrieve-tag' is omitted (bug#38156). diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 2046a9dcec..5ab8e7ec53 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -47,6 +47,7 @@ ;; FUNCTION NAME STATUS ;; BACKEND PROPERTIES ;; * revision-granularity OK +;; - update-on-retrieve-tag OK ;; STATE-QUERYING FUNCTIONS ;; * registered (file) OK ;; * state (file) OK @@ -218,6 +219,7 @@ toggle display of the entire list." (defun vc-git-revision-granularity () 'repository) (defun vc-git-checkout-model (_files) 'implicit) +(defun vc-git-update-on-retrieve-tag () nil) ;;; STATE-QUERYING FUNCTIONS diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index cc737b30b1..16e5dd6db0 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -40,6 +40,7 @@ ;; FUNCTION NAME STATUS ;; BACKEND PROPERTIES ;; * revision-granularity OK +;; - update-on-retrieve-tag OK ;; STATE-QUERYING FUNCTIONS ;; * registered (file) OK ;; * state (file) OK @@ -194,6 +195,7 @@ highlighting the Log View buffer." (defun vc-hg-revision-granularity () 'repository) (defun vc-hg-checkout-model (_files) 'implicit) +(defun vc-hg-update-on-retrieve-tag () nil) ;;; State querying functions diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index 942dbd5fa5..ed34b357f9 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el @@ -127,6 +127,7 @@ switches." (defun vc-svn-revision-granularity () 'repository) (defun vc-svn-checkout-model (_files) 'implicit) +(defun vc-svn-update-on-retrieve-tag () nil) ;;; ;;; State-querying functions diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 20056dec7f..401b39145c 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -110,6 +110,12 @@ ;; that return 'file have per-file revision numbering; backends ;; that return 'repository have per-repository revision numbering, ;; so a revision level implicitly identifies a changeset +;; +;; - update-on-retrieve-tag +;; +;; Takes no arguments. Backends that return non-nil can update +;; buffers on `vc-retrieve-tag' based on user input. In this case +;; user will be prompted to update buffers on `vc-retrieve-tag'. ;; STATE-QUERYING FUNCTIONS ;; @@ -2302,14 +2308,15 @@ This function runs the hook `vc-retrieve-tag-hook' when finished." (vc-read-revision "Tag name to retrieve (default latest revisions): " (list dir) (vc-responsible-backend dir))))) - (let ((update (yes-or-no-p "Update any affected buffers? ")) - (msg (if (or (not name) (string= name "")) - (format "Updating %s... " (abbreviate-file-name dir)) - (format "Retrieving tag into %s... " - (abbreviate-file-name dir))))) + (let* ((backend (vc-responsible-backend dir)) + (update (when (vc-call-backend backend 'update-on-retrieve-tag) + (yes-or-no-p "Update any affected buffers? "))) + (msg (if (or (not name) (string= name "")) + (format "Updating %s... " (abbreviate-file-name dir)) + (format "Retrieving tag %s into %s... " + name (abbreviate-file-name dir))))) (message "%s" msg) - (vc-call-backend (vc-responsible-backend dir) - 'retrieve-tag dir name update) + (vc-call-backend backend 'retrieve-tag dir name update) (vc-resynch-buffer dir t t t) (run-hooks 'vc-retrieve-tag-hook) (message "%s" (concat msg "done")))) @@ -3025,6 +3032,10 @@ to provide the `find-revision' operation instead." "Let BACKEND receive FILE from another version control system." (vc-call-backend backend 'register (list file) rev "")) +(defun vc-default-update-on-retrieve-tag () + "Prompt for update buffers on `vc-retrieve-tag'." + t) + (defun vc-default-retrieve-tag (backend dir name update) (if (string= name "") (progn commit c9ede465de7e1aaa692f12538adf2e35b9ed2748 Author: Braun Gábor Date: Thu Nov 14 06:45:37 2019 +0100 Make clone-buffer not unbind global variable * lisp/simple.el (clone-buffer): Make clone-buffer not globally unset locally void variable (bug#38179). Copyright-paperwork-exempt: yes diff --git a/lisp/simple.el b/lisp/simple.el index 872fb13237..e3ac709408 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -8658,7 +8658,7 @@ after it has been set up properly in other respects." (mapc (lambda (v) (condition-case () (if (symbolp v) - (makunbound v) + (makunbound (make-local-variable v)) (set (make-local-variable (car v)) (cdr v))) (setting-constant nil))) ;E.g. for enable-multibyte-characters. lvars) commit 6e2fd351c84c048e4646aa600c43c5796cf46273 Author: Lars Ingebrigtsen Date: Thu Nov 14 06:37:09 2019 +0100 Update signature in etc/DISTRIB * etc/DISTRIB: Update signature (bug#38188). diff --git a/etc/DISTRIB b/etc/DISTRIB index 4b8e4de2ca..7d0a62e936 100644 --- a/etc/DISTRIB +++ b/etc/DISTRIB @@ -77,8 +77,7 @@ For more information on GNU, see the file 'GNU' in this directory (see above). Richard M Stallman - Chief GNUisance, - President of the Free Software Foundation + Chief GNUisance, Founder of the FSF This file is part of GNU Emacs. commit 3591cb8dcc04181e2a3f1bbcdbf8e3286f2b5434 Author: Lars Ingebrigtsen Date: Thu Nov 14 06:31:50 2019 +0100 Make dired-do-compress-to require format-spec * lisp/dired-aux.el (dired-do-compress-to): Require format-spec runtime (bug#38189). diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 9f34b2afe9..6fcb074f6a 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -1061,6 +1061,7 @@ Prompt for the archive file name. Choose the archiving command based on the archive file-name extension and `dired-compress-files-alist'." (interactive) + (require 'format-spec) (let* ((in-files (dired-get-marked-files nil nil nil nil t)) (out-file (expand-file-name (read-file-name "Compress to: "))) (rule (cl-find-if commit d9ea77af4cbbc4826200ef712a93592320978f15 Author: Lars Ingebrigtsen Date: Thu Nov 14 06:19:59 2019 +0100 Allow using edebug-remove-instrumentation more fine-grained * lisp/emacs-lisp/edebug.el (edebug-remove-instrumentation): Prompt the user for what functions to remove instrumentation from a la cancel-edebug-on-entry (bug#38195). diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index d81052318c..6b55d7cff0 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -4571,23 +4571,37 @@ With prefix argument, make it a temporary breakpoint." ;; Continue standard unloading. nil) -(defun edebug-remove-instrumentation () - "Remove Edebug instrumentation from all functions." - (interactive) - (let ((functions nil)) - (mapatoms - (lambda (symbol) - (when (and (functionp symbol) - (get symbol 'edebug)) - (let ((unwrapped (edebug-unwrap* (symbol-function symbol)))) - (unless (equal unwrapped (symbol-function symbol)) - (push symbol functions) - (setf (symbol-function symbol) unwrapped))))) - obarray) - (if (not functions) - (message "Found no functions to remove instrumentation from") - (message "Remove edebug instrumentation from %s" - (mapconcat #'symbol-name functions ", "))))) +(defun edebug-remove-instrumentation (functions) + "Remove Edebug instrumentation from FUNCTIONS. +Interactively, the user is prompted for the function to remove +instrumentation for, defaulting to all functions." + (interactive + (list + (let ((functions nil)) + (mapatoms + (lambda (symbol) + (when (and (functionp symbol) + (get symbol 'edebug)) + (let ((unwrapped (edebug-unwrap* (symbol-function symbol)))) + (unless (equal unwrapped (symbol-function symbol)) + (push symbol functions))))) + obarray) + (unless functions + (error "Found no functions to remove instrumentation from")) + (let ((name + (completing-read + "Remove instrumentation from (default all functions): " + functions))) + (if (and name + (not (equal name ""))) + (list (intern name)) + functions))))) + ;; Remove instrumentation. + (dolist (symbol functions) + (setf (symbol-function symbol) + (edebug-unwrap* (symbol-function symbol)))) + (message "Removed edebug instrumentation from %s" + (mapconcat #'symbol-name functions ", "))) (provide 'edebug) ;;; edebug.el ends here commit 1d189843bb2a4f23dc269314d5e6dfb4f9fe801e Author: Stephen Gildea Date: Wed Nov 13 20:21:42 2019 -0800 time-stamp: update support for time zone numeric offset * time-stamp.el (time-stamp-string-preprocess): Change new format for numeric time zone from %:z to %5z to match format-time-string better. (time-stamp-format): Document support for numeric time zone. See discussion in bug#32931. * NEWS: Mention time-stamp-format %5z. diff --git a/etc/NEWS b/etc/NEWS index ff33449329..485d2b1fdf 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2248,7 +2248,18 @@ and 'gravatar-force-default'. *** The built-in ada-mode is now deleted. The GNU ELPA package is a good replacement, even in very large source files. -** Some conversions recommended for 'time-stamp-format' have changed. +** time-stamp + +*** New '%5z' conversion for 'time-stamp-format' gives time zone offset. +Specifying '%5z' in 'time-stamp-format' or 'time-stamp-pattern' +expands to the time zone offset, e.g., '+0100'. The time zone used is +specified by 'time-stamp-time-zone'. + +Because this feature is new in Emacs 27.1, do not use it in the local +variables section of any file that might be edited by an older version +of Emacs. + +*** Some conversions recommended for 'time-stamp-format' have changed. The new documented/recommended %-conversions are closer to those used by 'format-time-string' and are compatible at least as far back as Emacs 22.1 (released in 2007). diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el index 55892cdb83..4a6b203ccc 100644 --- a/lisp/time-stamp.el +++ b/lisp/time-stamp.el @@ -62,7 +62,8 @@ on the locale setting recorded in `system-time-locale' and %02S seconds %w day number of week, Sunday is 0 %02y 2-digit year: `03' %Y 4-digit year: `2003' -%#Z lowercase time zone name: `est' %Z gives uppercase: `EST' +%Z time zone name: `EST' %#Z gives lowercase: `est' +%5z time zone offset: `-0500' (since Emacs 27; see note below) Non-date items: %% a literal percent character: `%' @@ -81,7 +82,10 @@ use \"%3a %3b %2d %02H:%02M:%02S %Z %Y\". The default padding of some formats has changed to be more compatible with format-time-string. To be compatible with older versions of Emacs, specify a padding width (as shown) or use the : modifier to request the -transitional behavior (again, as shown)." +transitional behavior (again, as shown). + +The behavior of `%5z' is new in Emacs 27. If your files might be +edited by older versions of Emacs also, do not use this format yet." :type 'string :group 'time-stamp :version "27.1") @@ -469,7 +473,7 @@ and all `time-stamp-format' compatibility." (cond ((eq cur-char ?%) ;; eat any additional args to allow for future expansion - (setq alt-form nil change-case nil upcase nil field-width "") + (setq alt-form 0 change-case nil upcase nil field-width "") (while (progn (setq ind (1+ ind)) (setq cur-char (if (< ind fmt-len) @@ -503,7 +507,7 @@ and all `time-stamp-format' compatibility." (setq prev-char cur-char) ;; some characters we actually use (cond ((eq cur-char ?:) - (setq alt-form t)) + (setq alt-form (1+ alt-form))) ((eq cur-char ?#) (setq change-case t)) ((eq cur-char ?^) @@ -517,7 +521,7 @@ and all `time-stamp-format' compatibility." ((eq cur-char ?%) "%") ((eq cur-char ?a) ;day of week - (if alt-form + (if (> alt-form 0) (if (string-equal field-width "") (time-stamp--format "%A" time) "") ;discourage "%:3a" @@ -529,7 +533,7 @@ and all `time-stamp-format' compatibility." (time-stamp--format "%#A" time) (time-stamp--format "%A" time))) ((eq cur-char ?b) ;month name - (if alt-form + (if (> alt-form 0) (if (string-equal field-width "") (time-stamp--format "%B" time) "") ;discourage "%:3b" @@ -561,7 +565,7 @@ and all `time-stamp-format' compatibility." ((eq cur-char ?w) ;weekday number, Sunday is 0 (time-stamp--format "%w" time)) ((eq cur-char ?y) ;year - (if alt-form + (if (> alt-form 0) (string-to-number (time-stamp--format "%Y" time)) (if (or (string-equal field-width "") (<= (string-to-number field-width) 2)) @@ -573,9 +577,24 @@ and all `time-stamp-format' compatibility." ((eq cur-char ?z) ;time zone offset (if change-case "" ;discourage %z variations - (if alt-form - (time-stamp--format "%z" time) - (time-stamp--format "%#Z" time)))) ;backward compat, will change + (cond ((= alt-form 0) + (if (string-equal field-width "") + (progn + (time-stamp-conv-warn "%z" "%#Z") + (time-stamp--format "%#Z" time)) + (cond ((string-equal field-width "1") + (setq field-width "3")) ;%-z -> "+00" + ((string-equal field-width "2") + (setq field-width "5")) ;%_z -> "+0000" + ((string-equal field-width "4") + (setq field-width "0"))) ;discourage %4z + (time-stamp--format "%z" time))) + ((= alt-form 1) + (time-stamp--format "%:z" time)) + ((= alt-form 2) + (time-stamp--format "%::z" time)) + ((= alt-form 3) + (time-stamp--format "%:::z" time))))) ((eq cur-char ?Z) ;time zone name (if change-case (time-stamp--format "%#Z" time) @@ -608,7 +627,7 @@ and all `time-stamp-format' compatibility." (system-name)) )) (and (numberp field-result) - (not alt-form) + (= alt-form 0) (string-equal field-width "") ;; no width provided; set width for default (setq field-width "02")) @@ -637,7 +656,7 @@ and all `time-stamp-format' compatibility." ALT-FORM is whether `#' specified. FIELD-WIDTH is the string width specification or \"\". TIME is the time to convert." (let ((format-string (concat "%" (char-to-string format-char)))) - (if (and alt-form (not (string-equal field-width ""))) + (if (and (> alt-form 0) (not (string-equal field-width ""))) "" ;discourage "%:2d" and the like (string-to-number (time-stamp--format format-string time))))) diff --git a/test/lisp/time-stamp-tests.el b/test/lisp/time-stamp-tests.el index 77cd6c5b94..ae8eaf467d 100644 --- a/test/lisp/time-stamp-tests.el +++ b/test/lisp/time-stamp-tests.el @@ -312,19 +312,24 @@ (ert-deftest time-stamp-test-format-time-zone-offset () "Test time-stamp format %z." (with-time-stamp-test-env - ;; documented 1995-2019, will change - (should (equal (time-stamp-string "%z" ref-time1) - (format-time-string "%#Z" ref-time1 t))) - ;; undocumented, changed in 2019 - (should (equal (time-stamp-string "%:z" ref-time1) "+0000")) - (should (equal (time-stamp-string "%:7z" ref-time1) " +0000")) - (should (equal (time-stamp-string "%:07z" ref-time1) " +0000")) + (let ((utc-abbr (format-time-string "%#Z" ref-time1 t))) + ;; documented 1995-2019, warned since 2019, will change + (time-stamp-should-warn + (equal (time-stamp-string "%z" ref-time1) utc-abbr))) + ;; implemented and documented (with compat caveat) since 2019 + (should (equal (time-stamp-string "%5z" ref-time1) "+0000")) (let ((time-stamp-time-zone "PST8")) - (should (equal (time-stamp-string "%:z" ref-time1) "-0800"))) + (should (equal (time-stamp-string "%5z" ref-time1) "-0800"))) (let ((time-stamp-time-zone "HST10")) - (should (equal (time-stamp-string "%:z" ref-time1) "-1000"))) + (should (equal (time-stamp-string "%5z" ref-time1) "-1000"))) (let ((time-stamp-time-zone "CET-1")) - (should (equal (time-stamp-string "%:z" ref-time1) "+0100"))))) + (should (equal (time-stamp-string "%5z" ref-time1) "+0100"))) + ;; implemented since 2019, verify that these don't warn + (should (equal (time-stamp-string "%-z" ref-time1) "+00")) + (should (equal (time-stamp-string "%_z" ref-time1) "+0000")) + (should (equal (time-stamp-string "%:z" ref-time1) "+00:00")) + (should (equal (time-stamp-string "%::z" ref-time1) "+00:00:00")) + (should (equal (time-stamp-string "%:::z" ref-time1) "+00")))) (ert-deftest time-stamp-test-format-non-date-conversions () "Test time-stamp formats for non-date items." commit 3ecbfefa7239bd071262db25dfc9c97a01ec9ca1 Author: Katsumi Yamaoka Date: Thu Nov 14 02:24:26 2019 +0000 Don't show Attachment(s) header in html article viewed with browse-url * lisp/gnus/gnus-art.el (gnus-article-browse-html-article): Bind gnus-mime-display-attachment-buttons-in-header to nil. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 922bb99d70..a962566f1e 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -3035,6 +3035,7 @@ images if any to the browser, and deletes them when exiting the group (gnus-summary-show-article) (let ((gnus-visible-headers (or (get 'gnus-visible-headers 'standard-value) gnus-visible-headers)) + (gnus-mime-display-attachment-buttons-in-header nil) ;; As we insert a
, there's no need for the body boundary. (gnus-treat-body-boundary nil)) (gnus-summary-show-article))) commit ea73c66423ecb92e8aae4cabacd908168c095c07 Author: Juri Linkov Date: Thu Nov 14 00:09:06 2019 +0200 * lisp/tab-line.el (tab-line-tabs-buffer-list): Use window-prev-buffers too. * lisp/tab-line.el (tab-line-tabs-buffer-list): Move window-prev-buffers here from tab-line-tabs-buffer-groups. diff --git a/lisp/tab-line.el b/lisp/tab-line.el index 6f5b40657a..7701498ae2 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el @@ -288,7 +288,9 @@ Used only for `tab-line-tabs-mode-buffers' and `tab-line-tabs-buffer-groups'.") (defun tab-line-tabs-buffer-list () (seq-filter (lambda (b) (and (buffer-live-p b) (/= (aref (buffer-name b) 0) ?\s))) - (buffer-list))) + (seq-uniq (append (list (current-buffer)) + (mapcar #'car (window-prev-buffers)) + (buffer-list))))) (defun tab-line-tabs-mode-buffers () "Return a list of buffers with the same major mode with current buffer." @@ -363,11 +365,8 @@ If the major mode's name string matches REGEXP, use GROUPNAME instead.") (set-window-parameter nil 'tab-line-hscroll nil))))) (buffers (seq-filter (lambda (b) - (equal (tab-line-tabs-buffer-group-name b) - group)) - (seq-uniq (append (list (current-buffer)) - (mapcar #'car (window-prev-buffers)) - (funcall tab-line-tabs-buffer-list-function))))) + (equal (tab-line-tabs-buffer-group-name b) group)) + (funcall tab-line-tabs-buffer-list-function))) (sorted-buffers (if (functionp tab-line-tabs-buffer-group-sort-function) (seq-sort tab-line-tabs-buffer-group-sort-function buffers) commit bede5984246ba734c93fc28148b5f8e1b14d30c5 Author: Paul Eggert Date: Wed Nov 13 13:07:01 2019 -0800 Fix double-rounding bug in ceiling etc. This is doable now that we have bignums. * src/floatfns.c (integer_value): Remove; no longer used. (rescale_for_division): New function. (rounding_driver): Use it to divide properly (by using bignums) even when arguments are float, fixing a double-rounding FIXME. * src/lisp.h (LOG2_FLT_RADIX): Move here ... * src/timefns.c (frac_to_double): ... from here. * test/src/floatfns-tests.el (big-round): Add a test to catch the double-rounding bug. diff --git a/src/floatfns.c b/src/floatfns.c index 7e77dbd16d..a626845377 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -335,19 +335,6 @@ This is the same as the exponent of a float. */) return make_fixnum (value); } -/* True if A is exactly representable as an integer. */ - -static bool -integer_value (Lisp_Object a) -{ - if (FLOATP (a)) - { - double d = XFLOAT_DATA (a); - return d == floor (d) && isfinite (d); - } - return true; -} - /* Return the integer exponent E such that D * FLT_RADIX**E (i.e., scalbn (D, E)) is an integer that has precision equal to D and is representable as a double. @@ -371,70 +358,68 @@ double_integer_scale (double d) && (FP_ILOGB0 != INT_MIN || d != 0))))); } +/* Convert the Lisp number N to an integer and return a pointer to the + converted integer, represented as an mpz_t *. Use *T as a + temporary; the returned value might be T. Scale N by the maximum + of NSCALE and DSCALE while converting. If NSCALE is nonzero, N + must be a float; signal an overflow if NSCALE is greater than + DBL_MANT_DIG - DBL_MIN_EXP, otherwise scalbn (XFLOAT_DATA (N), NSCALE) + must return an integer value, without rounding or overflow. */ + +static mpz_t const * +rescale_for_division (Lisp_Object n, mpz_t *t, int nscale, int dscale) +{ + mpz_t const *pn; + + if (FLOATP (n)) + { + if (DBL_MANT_DIG - DBL_MIN_EXP < nscale) + overflow_error (); + mpz_set_d (*t, scalbn (XFLOAT_DATA (n), nscale)); + pn = t; + } + else + pn = bignum_integer (t, n); + + if (nscale < dscale) + { + emacs_mpz_mul_2exp (*t, *pn, (dscale - nscale) * LOG2_FLT_RADIX); + pn = t; + } + return pn; +} + /* the rounding functions */ static Lisp_Object -rounding_driver (Lisp_Object arg, Lisp_Object divisor, +rounding_driver (Lisp_Object n, Lisp_Object d, double (*double_round) (double), void (*int_divide) (mpz_t, mpz_t const, mpz_t const), EMACS_INT (*fixnum_divide) (EMACS_INT, EMACS_INT)) { - CHECK_NUMBER (arg); + CHECK_NUMBER (n); - double d; - if (NILP (divisor)) - { - if (! FLOATP (arg)) - return arg; - d = XFLOAT_DATA (arg); - } - else - { - CHECK_NUMBER (divisor); - if (integer_value (arg) && integer_value (divisor)) - { - /* Divide as integers. Converting to double might lose - info, even for fixnums; also see the FIXME below. */ - - if (FLOATP (arg)) - arg = double_to_integer (XFLOAT_DATA (arg)); - if (FLOATP (divisor)) - divisor = double_to_integer (XFLOAT_DATA (divisor)); - - if (FIXNUMP (divisor)) - { - if (XFIXNUM (divisor) == 0) - xsignal0 (Qarith_error); - if (FIXNUMP (arg)) - return make_int (fixnum_divide (XFIXNUM (arg), - XFIXNUM (divisor))); - } - int_divide (mpz[0], - *bignum_integer (&mpz[0], arg), - *bignum_integer (&mpz[1], divisor)); - return make_integer_mpz (); - } + if (NILP (d)) + return FLOATP (n) ? double_to_integer (double_round (XFLOAT_DATA (n))) : n; - double f1 = XFLOATINT (arg); - double f2 = XFLOATINT (divisor); - if (! IEEE_FLOATING_POINT && f2 == 0) - xsignal0 (Qarith_error); - /* FIXME: This division rounds, so the result is double-rounded. */ - d = f1 / f2; - } + CHECK_NUMBER (d); - /* Round, coarsely test for fixnum overflow before converting to - EMACS_INT (to avoid undefined C behavior), and then exactly test - for overflow after converting (as FIXNUM_OVERFLOW_P is inaccurate - on floats). */ - double dr = double_round (d); - if (fabs (dr) < 2 * (MOST_POSITIVE_FIXNUM + 1)) + if (FIXNUMP (d)) { - EMACS_INT ir = dr; - if (! FIXNUM_OVERFLOW_P (ir)) - return make_fixnum (ir); + if (XFIXNUM (d) == 0) + xsignal0 (Qarith_error); + + /* Divide fixnum by fixnum specially, for speed. */ + if (FIXNUMP (n)) + return make_int (fixnum_divide (XFIXNUM (n), XFIXNUM (d))); } - return double_to_integer (dr); + + int nscale = FLOATP (n) ? double_integer_scale (XFLOAT_DATA (n)) : 0; + int dscale = FLOATP (d) ? double_integer_scale (XFLOAT_DATA (d)) : 0; + int_divide (mpz[0], + *rescale_for_division (n, &mpz[0], nscale, dscale), + *rescale_for_division (d, &mpz[1], dscale, nscale)); + return make_integer_mpz (); } static EMACS_INT diff --git a/src/lisp.h b/src/lisp.h index 38e1891c89..1d25add928 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3684,6 +3684,8 @@ extern Lisp_Object string_make_unibyte (Lisp_Object); extern void syms_of_fns (void); /* Defined in floatfns.c. */ +verify (FLT_RADIX == 2 || FLT_RADIX == 16); +enum { LOG2_FLT_RADIX = FLT_RADIX == 2 ? 1 : 4 }; int double_integer_scale (double); #ifndef HAVE_TRUNC extern double trunc (double); diff --git a/src/timefns.c b/src/timefns.c index cf634a82b4..cb04d39aa1 100644 --- a/src/timefns.c +++ b/src/timefns.c @@ -574,8 +574,6 @@ frac_to_double (Lisp_Object numerator, Lisp_Object denominator) && integer_to_intmax (numerator, &intmax_numerator)) return intmax_numerator; - verify (FLT_RADIX == 2 || FLT_RADIX == 16); - enum { LOG2_FLT_RADIX = FLT_RADIX == 2 ? 1 : 4 }; mpz_t const *n = bignum_integer (&mpz[0], numerator); mpz_t const *d = bignum_integer (&mpz[1], denominator); ptrdiff_t nbits = mpz_sizeinbase (*n, 2); diff --git a/test/src/floatfns-tests.el b/test/src/floatfns-tests.el index 62201a877d..7f1d4691bf 100644 --- a/test/src/floatfns-tests.el +++ b/test/src/floatfns-tests.el @@ -122,6 +122,8 @@ (ert-deftest big-round () (should (= (floor 54043195528445955 3) - (floor 54043195528445955 3.0)))) + (floor 54043195528445955 3.0))) + (should (= (floor 1.7976931348623157e+308 5e-324) + (ash (1- (ash 1 53)) 2045)))) (provide 'floatfns-tests) commit 02e637ecca3b1419d2a6c433eca72c5728c65051 Author: Paul Eggert Date: Wed Nov 13 12:10:31 2019 -0800 Refactor bignum multiplication, exponentiation This doesn’t alter behavior, and simplifies the next commit. * src/bignum.c (GMP_NLIMBS_MAX, NLIMBS_LIMIT, emacs_mpz_size) (emacs_mpz_mul, emacs_mpz_mul_2exp, emacs_mpz_pow_ui): Move here ... * src/data.c: ... from here. diff --git a/src/bignum.c b/src/bignum.c index 167b73eee0..c31cf3d59a 100644 --- a/src/bignum.c +++ b/src/bignum.c @@ -273,6 +273,84 @@ bignum_to_uintmax (Lisp_Object x) return mpz_to_uintmax (*xbignum_val (x), &i) ? i : 0; } + +/* Multiply and exponentiate mpz_t values without aborting due to size + limits. */ + +/* GMP tests for this value and aborts (!) if it is exceeded. + This is as of GMP 6.1.2 (2016); perhaps future versions will differ. */ +enum { GMP_NLIMBS_MAX = min (INT_MAX, ULONG_MAX / GMP_NUMB_BITS) }; + +/* An upper bound on limb counts, needed to prevent libgmp and/or + Emacs from aborting or otherwise misbehaving. This bound applies + to estimates of mpz_t sizes before the mpz_t objects are created, + as opposed to integer-width which operates on mpz_t values after + creation and before conversion to Lisp bignums. */ +enum + { + NLIMBS_LIMIT = min (min (/* libgmp needs to store limb counts. */ + GMP_NLIMBS_MAX, + + /* Size calculations need to work. */ + min (PTRDIFF_MAX, SIZE_MAX) / sizeof (mp_limb_t)), + + /* Emacs puts bit counts into fixnums. */ + MOST_POSITIVE_FIXNUM / GMP_NUMB_BITS) + }; + +/* Like mpz_size, but tell the compiler the result is a nonnegative int. */ + +static int +emacs_mpz_size (mpz_t const op) +{ + mp_size_t size = mpz_size (op); + eassume (0 <= size && size <= INT_MAX); + return size; +} + +/* Wrappers to work around GMP limitations. As of GMP 6.1.2 (2016), + the library code aborts when a number is too large. These wrappers + avoid the problem for functions that can return numbers much larger + than their arguments. For slowly-growing numbers, the integer + width checks in bignum.c should suffice. */ + +void +emacs_mpz_mul (mpz_t rop, mpz_t const op1, mpz_t const op2) +{ + if (NLIMBS_LIMIT - emacs_mpz_size (op1) < emacs_mpz_size (op2)) + overflow_error (); + mpz_mul (rop, op1, op2); +} + +void +emacs_mpz_mul_2exp (mpz_t rop, mpz_t const op1, EMACS_INT op2) +{ + /* Fudge factor derived from GMP 6.1.2, to avoid an abort in + mpz_mul_2exp (look for the '+ 1' in its source code). */ + enum { mul_2exp_extra_limbs = 1 }; + enum { lim = min (NLIMBS_LIMIT, GMP_NLIMBS_MAX - mul_2exp_extra_limbs) }; + + EMACS_INT op2limbs = op2 / GMP_NUMB_BITS; + if (lim - emacs_mpz_size (op1) < op2limbs) + overflow_error (); + mpz_mul_2exp (rop, op1, op2); +} + +void +emacs_mpz_pow_ui (mpz_t rop, mpz_t const base, unsigned long exp) +{ + /* This fudge factor is derived from GMP 6.1.2, to avoid an abort in + mpz_n_pow_ui (look for the '5' in its source code). */ + enum { pow_ui_extra_limbs = 5 }; + enum { lim = min (NLIMBS_LIMIT, GMP_NLIMBS_MAX - pow_ui_extra_limbs) }; + + int nbase = emacs_mpz_size (base), n; + if (INT_MULTIPLY_WRAPV (nbase, exp, &n) || lim < n) + overflow_error (); + mpz_pow_ui (rop, base, exp); +} + + /* Yield an upper bound on the buffer size needed to contain a C string representing the NUM in base BASE. This includes any preceding '-' and the terminating NUL. */ diff --git a/src/bignum.h b/src/bignum.h index bf7b366953..432fcbc99e 100644 --- a/src/bignum.h +++ b/src/bignum.h @@ -49,6 +49,12 @@ extern bool mpz_to_intmax (mpz_t const, intmax_t *) ARG_NONNULL ((1, 2)); extern bool mpz_to_uintmax (mpz_t const, uintmax_t *) ARG_NONNULL ((1, 2)); extern void mpz_set_intmax_slow (mpz_t, intmax_t) ARG_NONNULL ((1)); extern void mpz_set_uintmax_slow (mpz_t, uintmax_t) ARG_NONNULL ((1)); +extern void emacs_mpz_mul (mpz_t, mpz_t const, mpz_t const) + ARG_NONNULL ((1, 2, 3)); +extern void emacs_mpz_mul_2exp (mpz_t, mpz_t const, EMACS_INT) + ARG_NONNULL ((1, 2)); +extern void emacs_mpz_pow_ui (mpz_t, mpz_t const, unsigned long) + ARG_NONNULL ((1, 2)); extern double mpz_get_d_rounded (mpz_t const); INLINE_HEADER_BEGIN diff --git a/src/data.c b/src/data.c index 649dc174f9..9efcd72f93 100644 --- a/src/data.c +++ b/src/data.c @@ -2351,80 +2351,6 @@ bool-vector. IDX starts at 0. */) return newelt; } - -/* GMP tests for this value and aborts (!) if it is exceeded. - This is as of GMP 6.1.2 (2016); perhaps future versions will differ. */ -enum { GMP_NLIMBS_MAX = min (INT_MAX, ULONG_MAX / GMP_NUMB_BITS) }; - -/* An upper bound on limb counts, needed to prevent libgmp and/or - Emacs from aborting or otherwise misbehaving. This bound applies - to estimates of mpz_t sizes before the mpz_t objects are created, - as opposed to integer-width which operates on mpz_t values after - creation and before conversion to Lisp bignums. */ -enum - { - NLIMBS_LIMIT = min (min (/* libgmp needs to store limb counts. */ - GMP_NLIMBS_MAX, - - /* Size calculations need to work. */ - min (PTRDIFF_MAX, SIZE_MAX) / sizeof (mp_limb_t)), - - /* Emacs puts bit counts into fixnums. */ - MOST_POSITIVE_FIXNUM / GMP_NUMB_BITS) - }; - -/* Like mpz_size, but tell the compiler the result is a nonnegative int. */ - -static int -emacs_mpz_size (mpz_t const op) -{ - mp_size_t size = mpz_size (op); - eassume (0 <= size && size <= INT_MAX); - return size; -} - -/* Wrappers to work around GMP limitations. As of GMP 6.1.2 (2016), - the library code aborts when a number is too large. These wrappers - avoid the problem for functions that can return numbers much larger - than their arguments. For slowly-growing numbers, the integer - width checks in bignum.c should suffice. */ - -static void -emacs_mpz_mul (mpz_t rop, mpz_t const op1, mpz_t const op2) -{ - if (NLIMBS_LIMIT - emacs_mpz_size (op1) < emacs_mpz_size (op2)) - overflow_error (); - mpz_mul (rop, op1, op2); -} - -static void -emacs_mpz_mul_2exp (mpz_t rop, mpz_t const op1, EMACS_INT op2) -{ - /* Fudge factor derived from GMP 6.1.2, to avoid an abort in - mpz_mul_2exp (look for the '+ 1' in its source code). */ - enum { mul_2exp_extra_limbs = 1 }; - enum { lim = min (NLIMBS_LIMIT, GMP_NLIMBS_MAX - mul_2exp_extra_limbs) }; - - EMACS_INT op2limbs = op2 / GMP_NUMB_BITS; - if (lim - emacs_mpz_size (op1) < op2limbs) - overflow_error (); - mpz_mul_2exp (rop, op1, op2); -} - -static void -emacs_mpz_pow_ui (mpz_t rop, mpz_t const base, unsigned long exp) -{ - /* This fudge factor is derived from GMP 6.1.2, to avoid an abort in - mpz_n_pow_ui (look for the '5' in its source code). */ - enum { pow_ui_extra_limbs = 5 }; - enum { lim = min (NLIMBS_LIMIT, GMP_NLIMBS_MAX - pow_ui_extra_limbs) }; - - int nbase = emacs_mpz_size (base), n; - if (INT_MULTIPLY_WRAPV (nbase, exp, &n) || lim < n) - overflow_error (); - mpz_pow_ui (rop, base, exp); -} - /* Arithmetic functions */ commit ff10e9517d98aa606e007d3aa4d5aef1c423ab77 Author: Paul Eggert Date: Sun Nov 10 15:06:49 2019 -0800 Refactor double integer scaling This doesn’t alter behavior, and simplifies a future commit. * src/floatfns.c (double_integer_scale): New function, with body adapted from the old timefns.c. * src/timefns.c (decode_float_time): Use it. diff --git a/src/floatfns.c b/src/floatfns.c index 3199d57213..7e77dbd16d 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -348,6 +348,29 @@ integer_value (Lisp_Object a) return true; } +/* Return the integer exponent E such that D * FLT_RADIX**E (i.e., + scalbn (D, E)) is an integer that has precision equal to D and is + representable as a double. + + Return DBL_MANT_DIG - DBL_MIN_EXP (the maximum possible valid + scale) if D is zero or tiny. Return a value greater than + DBL_MANT_DIG - DBL_MIN_EXP if there is conversion trouble; on all + current platforms this can happen only if D is infinite or a NaN. */ + +int +double_integer_scale (double d) +{ + int exponent = ilogb (d); + return (DBL_MIN_EXP - 1 <= exponent && exponent < INT_MAX + ? DBL_MANT_DIG - 1 - exponent + : (DBL_MANT_DIG - DBL_MIN_EXP + + (exponent == INT_MAX + || (exponent == FP_ILOGBNAN + && (FP_ILOGBNAN != FP_ILOGB0 || isnan (d))) + || (!IEEE_FLOATING_POINT && exponent == INT_MIN + && (FP_ILOGB0 != INT_MIN || d != 0))))); +} + /* the rounding functions */ static Lisp_Object diff --git a/src/lisp.h b/src/lisp.h index 04fa1d64ea..38e1891c89 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3684,6 +3684,7 @@ extern Lisp_Object string_make_unibyte (Lisp_Object); extern void syms_of_fns (void); /* Defined in floatfns.c. */ +int double_integer_scale (double); #ifndef HAVE_TRUNC extern double trunc (double); #endif diff --git a/src/timefns.c b/src/timefns.c index fe08efd4c1..cf634a82b4 100644 --- a/src/timefns.c +++ b/src/timefns.c @@ -406,26 +406,9 @@ decode_float_time (double t, struct lisp_time *result) } else { - int exponent = ilogb (t); - int scale; - if (exponent < DBL_MANT_DIG) - { - if (exponent < DBL_MIN_EXP - 1) - { - if (exponent == FP_ILOGBNAN - && (FP_ILOGBNAN != FP_ILOGB0 || isnan (t))) - return EINVAL; - /* T is tiny. SCALE must be less than FLT_RADIX_POWER_SIZE, - as otherwise T would be scaled as if it were normalized. */ - scale = flt_radix_power_size - 1; - } - else - { - /* The typical case. */ - scale = DBL_MANT_DIG - 1 - exponent; - } - } - else if (exponent < INT_MAX) + int scale = double_integer_scale (t); + + if (scale < 0) { /* T is finite but so large that HZ would be less than 1 if T's precision were represented exactly. SCALE must be @@ -435,8 +418,8 @@ decode_float_time (double t, struct lisp_time *result) which is typically better than signaling overflow. */ scale = 0; } - else - return FP_ILOGBNAN == INT_MAX && isnan (t) ? EINVAL : EOVERFLOW; + else if (flt_radix_power_size <= scale) + return isnan (t) ? EDOM : EOVERFLOW; double scaled = scalbn (t, scale); eassert (trunc (scaled) == scaled); commit 65fb04801c59ac204790e0a5c0599c9b11151f32 Author: Michael Albinus Date: Wed Nov 13 15:55:35 2019 +0100 Finish last Tramp patch * lisp/net/tramp.el (outline-regexp): Remove declaration. (tramp-debug-outline-regexp): Add thread regexp. (tramp-debug-font-lock-keywords): New defconst. (tramp-debug-outline-level): Adapt to changed `tramp-debug-outline-regexp'. (tramp-get-debug-buffer): Use `tramp-debug-font-lock-keywords'. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index ab1b4d354f..99c93eaa57 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1648,7 +1648,11 @@ version, the function does nothing." (format "*debug tramp/%s %s*" method host-port)))) (defconst tramp-debug-outline-regexp - "[0-9]+:[0-9]+:[0-9]+\\.[0-9]+ [a-z0-9-]+ (\\([0-9]+\\)) #" + (eval-when-compile + (concat + "[0-9]+:[0-9]+:[0-9]+\\.[0-9]+ " ;; Timestamp. + "\\(?:\\(#\\) \\)?" ;; Thread. + "[a-z0-9-]+ (\\([0-9]+\\)) #")) ;; Function name, verbosity. "Used for highlighting Tramp debug buffers in `outline-mode'.") (defconst tramp-debug-font-lock-keywords @@ -1663,7 +1667,7 @@ version, the function does nothing." Point must be at the beginning of a header line. The outline level is equal to the verbosity of the Tramp message." - (1+ (string-to-number (match-string 1)))) + (1+ (string-to-number (match-string 2)))) (defun tramp-get-debug-buffer (vec) "Get the debug buffer for VEC." commit eae50e88ef80a000f87954813b4b4cb8c8a1bb17 Author: Robert Pluim Date: Wed Nov 13 14:43:33 2019 +0100 Add "Noto Color Emoji" to face-ignored-fonts * src/xfaces.c (syms_of_xfaces) [HAVE_XFT]: Add "Noto Color Emoji" to face-ignored-fonts (Bug#37786). diff --git a/src/xfaces.c b/src/xfaces.c index 67fa9e24b8..d2dfbffe4e 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -6776,12 +6776,16 @@ other font of the appropriate family and registry is available. */); doc: /* List of ignored fonts. Each element is a regular expression that matches names of fonts to ignore. */); -#ifdef HAVE_OTF_KANNADA_BUG - /* https://debbugs.gnu.org/30193 */ - Vface_ignored_fonts = list1 (build_string ("Noto Serif Kannada")); +#ifdef HAVE_XFT + /* Bug#37786. */ + Vface_ignored_fonts = list1 (build_string ("Noto Color Emoji")); #else Vface_ignored_fonts = Qnil; #endif +#ifdef HAVE_OTF_KANNADA_BUG + /* https://debbugs.gnu.org/30193 */ + Vface_ignored_fonts = Fcons (build_string ("Noto Serif Kannada"), Vface_ignored_fonts); +#endif DEFVAR_LISP ("face-remapping-alist", Vface_remapping_alist, doc: /* Alist of face remappings. commit 3b88ab1a5035abccedcdb5d271d8a8cb7827b342 Author: Michael Albinus Date: Wed Nov 13 14:53:43 2019 +0100 Some refinement in Tramp debug buffer. * lisp/net/tramp.el (outline-regexp): Remove declaration. (tramp-debug-font-lock-keywords): New defconst. (tramp-get-debug-buffer): Use it. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index ba8b9aa5c4..ab1b4d354f 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -64,7 +64,6 @@ (require 'cl-lib) (declare-function netrc-parse "netrc") (defvar auto-save-file-name-transforms) -(defvar outline-regexp) ;;; User Customizable Internal Variables: @@ -1652,6 +1651,13 @@ version, the function does nothing." "[0-9]+:[0-9]+:[0-9]+\\.[0-9]+ [a-z0-9-]+ (\\([0-9]+\\)) #" "Used for highlighting Tramp debug buffers in `outline-mode'.") +(defconst tramp-debug-font-lock-keywords + '(list + (concat "^\\(?:" tramp-debug-outline-regexp "\\).+") + '(1 font-lock-warning-face t t) + '(0 (outline-font-lock-face) keep t)) + "Used for highlighting Tramp debug buffers in `outline-mode'.") + (defun tramp-debug-outline-level () "Return the depth to which a statement is nested in the outline. Point must be at the beginning of a header line. @@ -1668,14 +1674,16 @@ The outline level is equal to the verbosity of the Tramp message." ;; Activate `outline-mode'. This runs `text-mode-hook' and ;; `outline-mode-hook'. We must prevent that local processes ;; die. Yes: I've seen `flyspell-mode', which starts "ispell". - ;; Furthermore, `outline-regexp' must have the correct value - ;; already, because it is used by `font-lock-compile-keywords'. + ;; `(custom-declare-variable outline-minor-mode-prefix ...)' + ;; raises on error in `(outline-mode)', we don't want to see it + ;; in the traces. (let ((default-directory (tramp-compat-temporary-file-directory)) - (outline-regexp tramp-debug-outline-regexp) signal-hook-function) (outline-mode)) - (set (make-local-variable 'outline-regexp) tramp-debug-outline-regexp) (set (make-local-variable 'outline-level) 'tramp-debug-outline-level) + (set (make-local-variable 'font-lock-keywords) + `(t (eval ,tramp-debug-font-lock-keywords) + ,(eval tramp-debug-font-lock-keywords))) ;; Do not edit the debug buffer. (use-local-map special-mode-map)) (current-buffer))) commit d3438460ef2e41815b01632781bfc1e4697f70eb Author: Michael Albinus Date: Wed Nov 13 13:10:58 2019 +0100 Adapt Tramp docstrings according to checkdoc * lisp/net/tramp.el (tramp-backup-directory-alist) (tramp-echoed-echo-mark-regexp, tramp-syntax-values) (tramp-lookup-syntax, tramp-build-prefix-format) (tramp-build-prefix-regexp, tramp-build-method-regexp) (tramp-build-postfix-method-format) (tramp-build-postfix-method-regexp) (tramp-build-prefix-ipv6-format, tramp-build-prefix-ipv6-regexp) (tramp-build-postfix-ipv6-format) (tramp-build-postfix-ipv6-regexp) (tramp-build-postfix-host-format) (tramp-build-postfix-host-regexp, tramp-unknown-id-string) (tramp-unknown-id-integer, tramp-build-file-name-regexp) (tramp-build-completion-file-name-regexp, tramp-chunksize) (tramp-find-method, tramp-find-user, tramp-find-host) (tramp-dissect-file-name, tramp-get-buffer) (tramp-get-connection-buffer, tramp-debug-message, tramp-error) (with-tramp-connection-property, tramp-run-real-handler) (tramp-file-name-for-operation, tramp-file-name-handler) (tramp-completion-file-name-handler) (tramp-completion-handle-file-name-completion) (tramp-completion-dissect-file-name) (tramp-completion-dissect-file-name1) (tramp-handle-file-name-as-directory) (tramp-handle-file-name-directory) (tramp-handle-file-name-nondirectory, tramp-mode-string-to-int) (tramp-file-mode-from-int): * lisp/net/tramp-adb.el (tramp-adb-file-name-p): * lisp/net/tramp-archive.el (tramp-archive-run-real-handler) (tramp-archive-file-name-handler) (tramp-archive-dissect-file-name) (with-parsed-tramp-archive-file-name) (tramp-archive-gvfs-file-name, tramp-archive-handle-access-file): * lisp/net/tramp-cmds.el (tramp-list-remote-buffers): * lisp/net/tramp-compat.el (tramp-unload-file-name-handlers) (tramp-compat-funcall, tramp-compat-tramp-file-name-slots): * lisp/net/tramp-ftp.el (tramp-ftp-file-name-handler) (tramp-ftp-file-name-p): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-p) (tramp-gvfs-file-name-handler) (tramp-gvfs-stringify-dbus-message) (tramp-gvfs-monitor-process-filter) (tramp-gvfs-handler-mounted-unmounted): * lisp/net/tramp-integration.el (tramp-rfn-eshadow-update-overlay-regexp): * lisp/net/tramp-rclone.el (tramp-rclone-file-name-p) (tramp-rclone-file-name-handler, tramp-rclone-send-command): * lisp/net/tramp-sh.el (tramp-sh--quoting-style-options) (tramp-sh-gio-monitor-process-filter) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter, tramp-find-executable) (tramp-set-remote-path, tramp-open-shell, tramp-find-shell) (tramp-send-command-and-check, tramp-shell-case-fold) (tramp-get-remote-path): * lisp/net/tramp-smb.el (tramp-smb-file-name-p) (tramp-smb-file-name-handler) (tramp-smb-do-file-attributes-with-stat) (tramp-smb-handle-substitute-in-file-name) (tramp-smb-get-stat-capability, tramp-smb-shell-quote-argument): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-p) (tramp-sudoedit-file-name-handler) (tramp-sudoedit-send-command-string): * test/lisp/net/tramp-archive-tests.el (tramp-archive-test-all): * test/lisp/net/tramp-tests.el (tramp--test-gvfs-p) (tramp--test-with-proper-process-name-and-buffer) (tramp-test-all): Adapt docstrings according to `checkdoc'. diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index cfbda0824e..b56ffdd7bc 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -171,7 +171,7 @@ It is used for TCP/IP devices." ;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading. ;;;###tramp-autoload (defsubst tramp-adb-file-name-p (filename) - "Check if it's a filename for ADB." + "Check if it's a FILENAME for ADB." (and (tramp-tramp-file-p filename) (string= (tramp-file-name-method (tramp-dissect-file-name filename)) tramp-adb-method))) diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el index 84dba32cb6..1158b03b51 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el @@ -295,8 +295,8 @@ Operations not mentioned here will be handled by the default Emacs primitives.") (defun tramp-archive-run-real-handler (operation args) "Invoke normal file name handler for OPERATION. -First arg specifies the OPERATION, second arg is a list of arguments to -pass to the OPERATION." +First arg specifies the OPERATION, second arg ARGS is a list of +arguments to pass to the OPERATION." (let* ((inhibit-file-name-handlers `(tramp-archive-file-name-handler . @@ -308,8 +308,8 @@ pass to the OPERATION." ;;;###tramp-autoload (defun tramp-archive-file-name-handler (operation &rest args) "Invoke the file archive related OPERATION. -First arg specifies the OPERATION, second arg is a list of arguments to -pass to the OPERATION." +First arg specifies the OPERATION, second arg ARGS is a list of +arguments to pass to the OPERATION." (if (not tramp-archive-enabled) ;; Unregister `tramp-archive-file-name-handler'. (progn @@ -413,7 +413,7 @@ name of a local copy, if any.") (url-hexify-string (tramp-gvfs-url-file-name archive))) (defun tramp-archive-dissect-file-name (name) - "Return a `tramp-file-name' structure. + "Return a `tramp-file-name' structure for NAME. The structure consists of the `tramp-archive-method' method, the hexified archive name as host, and the localname. The archive name is kept in slot `hop'" @@ -507,7 +507,7 @@ archive name is extracted from the hop part of the VEC structure." (tramp-file-name-hop vec))) (defmacro with-parsed-tramp-archive-file-name (filename var &rest body) - "Parse an archive filename and make components available in the body. + "Parse an archive filename and make components available in the BODY. This works exactly as `with-parsed-tramp-file-name' for the Tramp file name structure returned by `tramp-archive-dissect-file-name'. A variable `foo-archive' (or `archive') will be bound to the @@ -533,7 +533,7 @@ offered." ,@body))) (defun tramp-archive-gvfs-file-name (name) - "Return FILENAME in GVFS syntax." + "Return NAME in GVFS syntax." (tramp-make-tramp-file-name (tramp-archive-dissect-file-name name) nil 'nohop)) @@ -541,7 +541,7 @@ offered." ;; File name primitives. (defun tramp-archive-handle-access-file (filename string) - "Like `access-file' for Tramp files." + "Like `access-file' for file archives." (access-file (tramp-archive-gvfs-file-name filename) string)) (defun tramp-archive-handle-copy-file diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 0f7e14b704..ae3fdcb777 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -28,7 +28,7 @@ ;; An implementation of information caching for remote files. ;; Each connection, identified by a `tramp-file-name' structure or by -;; a process, has a unique cache. We distinguish 4 kind of caches, +;; a process, has a unique cache. We distinguish 4 kind of caches, ;; depending on the key: ;; ;; - localname is NIL. This are reusable properties. Examples: diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index 35bb85b82d..56ccf73807 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -60,7 +60,7 @@ SYNTAX can be one of the symbols `default' (default), "*debug tramp" (mapcar #'list (mapcar #'buffer-name (buffer-list)))))) (defun tramp-list-remote-buffers () - "Return a list of all buffers with remote default-directory." + "Return a list of all buffers with remote `default-directory'." (delq nil (mapcar diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 232230f869..1c41437220 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -32,7 +32,7 @@ ;; In Emacs 24 and 25, `tramp-unload-file-name-handlers' is not ;; autoloaded. So we declare it here in order to avoid recursive ;; load. This will be overwritten in tramp.el. -(defun tramp-unload-file-name-handlers ()) +(defun tramp-unload-file-name-handlers () ".") (require 'auth-source) (require 'format-spec) @@ -47,7 +47,7 @@ ;; changed argument list, there are compiler warnings. We want to ;; avoid them in cases we know what we do. (defmacro tramp-compat-funcall (function &rest arguments) - "Call FUNCTION if it exists. Do not raise compiler warnings." + "Call FUNCTION with ARGUMENTS if it exists. Do not raise compiler warnings." `(when (functionp ,function) (with-no-warnings (funcall ,function ,@arguments)))) @@ -267,6 +267,7 @@ NAME is unquoted." ;; `cl-struct-slot-info' has been introduced with Emacs 25. (defmacro tramp-compat-tramp-file-name-slots () + "Return a list of slot names." (if (fboundp 'cl-struct-slot-info) '(cdr (mapcar #'car (cl-struct-slot-info 'tramp-file-name))) '(cdr (mapcar #'car (get 'tramp-file-name 'cl-struct-slots))))) diff --git a/lisp/net/tramp-ftp.el b/lisp/net/tramp-ftp.el index 2a4fccf57e..69646c7df5 100644 --- a/lisp/net/tramp-ftp.el +++ b/lisp/net/tramp-ftp.el @@ -110,7 +110,7 @@ present for backward compatibility." ;;;###tramp-autoload (defun tramp-ftp-file-name-handler (operation &rest args) - "Invoke the Ange-FTP handler for OPERATION. + "Invoke the Ange-FTP handler for OPERATION and ARGS. First arg specifies the OPERATION, second arg is a list of arguments to pass to the OPERATION." (save-match-data @@ -178,7 +178,7 @@ pass to the OPERATION." ;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading. ;;;###tramp-autoload (defsubst tramp-ftp-file-name-p (filename) - "Check if it's a filename that should be forwarded to Ange-FTP." + "Check if it's a FILENAME that should be forwarded to Ange-FTP." (and (tramp-tramp-file-p filename) (string= (tramp-file-name-method (tramp-dissect-file-name filename)) tramp-ftp-method))) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index f13564c544..1b87e34aa3 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -612,7 +612,7 @@ Operations not mentioned here will be handled by the default Emacs primitives.") ;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading. ;;;###tramp-autoload (defsubst tramp-gvfs-file-name-p (filename) - "Check if it's a filename handled by the GVFS daemon." + "Check if it's a FILENAME handled by the GVFS daemon." (and (tramp-tramp-file-p filename) (let ((method (tramp-file-name-method (tramp-dissect-file-name filename)))) @@ -620,7 +620,7 @@ Operations not mentioned here will be handled by the default Emacs primitives.") ;;;###tramp-autoload (defun tramp-gvfs-file-name-handler (operation &rest args) - "Invoke the GVFS related OPERATION. + "Invoke the GVFS related OPERATION and ARGS. First arg specifies the OPERATION, second arg is a list of arguments to pass to the OPERATION." (unless tramp-gvfs-enabled @@ -658,7 +658,7 @@ Return nil for null BYTE-ARRAY." (butlast byte-array) byte-array))))) (defun tramp-gvfs-stringify-dbus-message (message) - "Convert a D-Bus message into readable UTF8 strings, used for traces." + "Convert a D-Bus MESSAGE into readable UTF8 strings, used for traces." (cond ((and (consp message) (characterp (car message))) (format "%S" (tramp-gvfs-dbus-byte-array-to-string message))) @@ -1208,7 +1208,7 @@ If FILE-SYSTEM is non-nil, return file system attributes." (defun tramp-gvfs-monitor-process-filter (proc string) "Read output from \"gvfs-monitor-file\" and add corresponding \ -file-notify events." +`file-notify' events." (let* ((events (process-get proc 'events)) (rest-string (process-get proc 'rest-string)) (dd (with-current-buffer (process-buffer proc) default-directory)) @@ -1524,7 +1524,7 @@ file-notify events." result)))) (defun tramp-gvfs-handler-mounted-unmounted (mount-info) - "Signal handler for the \"org.gtk.vfs.MountTracker.mounted\" and + "Signal handler for the \"org.gtk.vfs.MountTracker.mounted\" and \ \"org.gtk.vfs.MountTracker.unmounted\" signals." (ignore-errors (let ((signal-name (dbus-event-member-name last-input-event)) diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el index 0c706da1ca..0bb19ed9c4 100644 --- a/lisp/net/tramp-integration.el +++ b/lisp/net/tramp-integration.el @@ -69,6 +69,7 @@ special handling of `substitute-in-file-name'." #'tramp-rfn-eshadow-setup-minibuffer))) (defun tramp-rfn-eshadow-update-overlay-regexp () + "An overlay covering the shadowed part of the filename." (format "[^%s/~]*\\(/\\|~\\)" tramp-postfix-host-format)) ;; Package rfn-eshadow is preloaded in Emacs, but for some reason, diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el index 56afdba742..109d8c5c4a 100644 --- a/lisp/net/tramp-rclone.el +++ b/lisp/net/tramp-rclone.el @@ -147,14 +147,14 @@ Operations not mentioned here will be handled by the default Emacs primitives.") ;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading. ;;;###tramp-autoload (defsubst tramp-rclone-file-name-p (filename) - "Check if it's a filename for rclone." + "Check if it's a FILENAME for rclone." (and (tramp-tramp-file-p filename) (string= (tramp-file-name-method (tramp-dissect-file-name filename)) tramp-rclone-method))) ;;;###tramp-autoload (defun tramp-rclone-file-name-handler (operation &rest args) - "Invoke the rclone handler for OPERATION. + "Invoke the rclone handler for OPERATION and ARGS. First arg specifies the OPERATION, second arg is a list of arguments to pass to the OPERATION." (let ((fn (assoc operation tramp-rclone-file-name-handler-alist))) @@ -583,7 +583,8 @@ connection if a previous connection has died for some reason." vec "gid-string" (tramp-get-local-gid 'string))) (defun tramp-rclone-send-command (vec &rest args) - "Send the COMMAND to connection VEC." + "Send a command to connection VEC. +The command is the list of strings ARGS." (with-current-buffer (tramp-get-connection-buffer vec) (erase-buffer) (let ((flags (tramp-get-method-parameter diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 76bb10a277..59a93a839e 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -25,6 +25,10 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + +;; The file name handler implementation for ssh-alike remote connections. + ;;; Code: (eval-when-compile (require 'cl-lib)) @@ -1249,6 +1253,7 @@ component is used as the target of the symlink." (tramp-do-file-attributes-with-ls v localname id-format)))))))) (defun tramp-sh--quoting-style-options (vec) + "Quoting style options to be used for VEC." (or (tramp-get-ls-command-with vec "--quoting-style=literal --show-control-chars") @@ -3676,7 +3681,7 @@ Fall back to normal file name handler if no Tramp handler exists." p)))) (defun tramp-sh-gio-monitor-process-filter (proc string) - "Read output from \"gio monitor\" and add corresponding file-notify events." + "Read output from \"gio monitor\" and add corresponding `file-notify' events." (let ((events (process-get proc 'events)) (remote-prefix (with-current-buffer (process-buffer proc) @@ -3736,7 +3741,7 @@ Fall back to normal file name handler if no Tramp handler exists." (defun tramp-sh-gvfs-monitor-dir-process-filter (proc string) "Read output from \"gvfs-monitor-dir\" and add corresponding \ -file-notify events." +`file-notify' events." (let ((events (process-get proc 'events)) (remote-prefix (with-current-buffer (process-buffer proc) @@ -3786,7 +3791,7 @@ file-notify events." (process-put proc 'rest-string string))) (defun tramp-sh-inotifywait-process-filter (proc string) - "Read output from \"inotifywait\" and add corresponding file-notify events." + "Read output from \"inotifywait\" and add corresponding `file-notify' events." (let ((events (process-get proc 'events))) (tramp-message proc 6 "%S\n%s" proc string) (dolist (line (split-string string "[\n\r]+" 'omit)) @@ -3906,11 +3911,11 @@ hosts, or files, disagree." (defun tramp-find-executable (vec progname dirlist &optional ignore-tilde ignore-path) - "Searches for PROGNAME in $PATH and all directories mentioned in DIRLIST. + "Search for PROGNAME in $PATH and all directories mentioned in DIRLIST. First arg VEC specifies the connection, PROGNAME is the program to search for, and DIRLIST gives the list of directories to search. If IGNORE-TILDE is non-nil, directory names starting -with `~' will be ignored. If IGNORE-PATH is non-nil, searches +with `~' will be ignored. If IGNORE-PATH is non-nil, searches only in DIRLIST. Returns the absolute file name of PROGNAME, if found, and nil otherwise. @@ -3964,7 +3969,7 @@ This function expects to be in the right *tramp* buffer." ;; send it. This is likely not due to PATH_MAX, but PIPE_BUF. We ;; check it, and use a temporary file in case of. See Bug#33781. (defun tramp-set-remote-path (vec) - "Sets the remote environment PATH to existing directories. + "Set the remote environment PATH to existing directories. I.e., for each directory in `tramp-remote-path', it is tested whether it exists and if so, it is added to the environment variable PATH." @@ -4057,7 +4062,7 @@ file exists and nonzero exit status otherwise." extra-args)) (defun tramp-open-shell (vec shell) - "Opens shell SHELL." + "Open shell SHELL." (with-tramp-progress-reporter vec 5 (format-message "Opening remote shell `%s'" shell) ;; Find arguments for this shell. @@ -4111,7 +4116,7 @@ file exists and nonzero exit status otherwise." (tramp-get-connection-process vec) "remote-shell" shell))) (defun tramp-find-shell (vec) - "Opens a shell on the remote host which groks tilde expansion." + "Open a shell on the remote host which groks tilde expansion." (with-current-buffer (tramp-get-buffer vec) (let ((default-shell (tramp-get-method-parameter vec 'tramp-remote-shell)) shell) @@ -5108,8 +5113,8 @@ function waits for output unless NOOUTPUT is set." (defun tramp-send-command-and-check (vec command &optional subshell dont-suppress-err) "Run COMMAND and check its exit status. -Sends `echo $?' along with the COMMAND for checking the exit status. -If COMMAND is nil, just sends `echo $?'. Returns t if the exit +Send `echo $?' along with the COMMAND for checking the exit status. +If COMMAND is nil, just send `echo $?'. Return t if the exit status is 0, and nil otherwise. If the optional argument SUBSHELL is non-nil, the command is @@ -5261,7 +5266,7 @@ Return ATTR." attr)) (defun tramp-shell-case-fold (string) - "Converts STRING to shell glob pattern which ignores case." + "Convert STRING to shell glob pattern which ignores case." (mapconcat (lambda (c) (if (equal (downcase c) (upcase c)) @@ -5305,7 +5310,7 @@ Return ATTR." ;; Variables local to connection. (defun tramp-get-remote-path (vec) - "Compile list of remote directories for $PATH. + "Compile list of remote directories for PATH. Nonexistent directories are removed from spec." (with-current-buffer (tramp-get-connection-buffer vec) ;; Expand connection-local variables. diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 95cdb4cbff..38149da664 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -319,14 +319,14 @@ This can be used to disable echo etc." ;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading. ;;;###tramp-autoload (defsubst tramp-smb-file-name-p (filename) - "Check if it's a filename for SMB servers." + "Check if it's a FILENAME for SMB servers." (and (tramp-tramp-file-p filename) (string= (tramp-file-name-method (tramp-dissect-file-name filename)) tramp-smb-method))) ;;;###tramp-autoload (defun tramp-smb-file-name-handler (operation &rest args) - "Invoke the SMB related OPERATION. + "Invoke the SMB related OPERATION and ARGS. First arg specifies the OPERATION, second arg is a list of arguments to pass to the OPERATION." (let ((fn (assoc operation tramp-smb-file-name-handler-alist))) @@ -844,7 +844,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." device)))))))) ;11 file system number (defun tramp-smb-do-file-attributes-with-stat (vec &optional id-format) - "Implement `file-attributes' for Tramp files using stat command." + "Implement `file-attributes' for Tramp files using `stat' command." (tramp-message vec 5 "file attributes with stat: %s" (tramp-file-name-localname vec)) (let* (size id link uid gid atime mtime ctime mode inode) @@ -1530,7 +1530,7 @@ component is used as the target of the symlink." (tramp-flush-connection-property v "process-buffer"))))) (defun tramp-smb-handle-substitute-in-file-name (filename) - "Like `handle-substitute-in-file-name' for Tramp files. + "Like `substitute-in-file-name' for Tramp files. \"//\" substitutes only in the local filename part. Catches errors for shares like \"C$/\", which are common in Microsoft Windows." ;; Check, whether the local part is a quoted file name. @@ -1858,7 +1858,7 @@ are listed. Result is the list (LOCALNAME MODE SIZE MTIME)." (buffer-substring (point) (point-at-eol)) nil 'omit))))))))) (defun tramp-smb-get-stat-capability (vec) - "Check whether the SMB server supports the STAT command." + "Check whether the SMB server supports the `stat' command." ;; When we are not logged in yet, we return nil. (if (and (tramp-smb-get-share vec) (process-live-p (tramp-get-connection-process vec))) @@ -2117,7 +2117,7 @@ Removes smb prompt. Returns nil if an error message has appeared." (tramp-smb-send-command vec "$rawui.WindowSize = $winsize")) (defun tramp-smb-shell-quote-argument (s) - "Similar to `shell-quote-argument', but uses windows cmd syntax." + "Similar to `shell-quote-argument', but uses Windows cmd syntax." (let ((system-type 'ms-dos)) (tramp-unquote-shell-quote-argument s))) diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el index 43ac6ff66b..2a588f7b19 100644 --- a/lisp/net/tramp-sudoedit.el +++ b/lisp/net/tramp-sudoedit.el @@ -143,14 +143,14 @@ See `tramp-actions-before-shell' for more info.") ;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading. ;;;###tramp-autoload (defsubst tramp-sudoedit-file-name-p (filename) - "Check if it's a filename for SUDOEDIT." + "Check if it's a FILENAME for SUDOEDIT." (and (tramp-tramp-file-p filename) (string= (tramp-file-name-method (tramp-dissect-file-name filename)) tramp-sudoedit-method))) ;;;###tramp-autoload (defun tramp-sudoedit-file-name-handler (operation &rest args) - "Invoke the SUDOEDIT handler for OPERATION. + "Invoke the SUDOEDIT handler for OPERATION and ARGS. First arg specifies the OPERATION, second arg is a list of arguments to pass to the OPERATION." (let ((fn (assoc operation tramp-sudoedit-file-name-handler-alist))) @@ -749,8 +749,7 @@ ID-FORMAT valid values are `string' and `integer'." ;; Used in `tramp-sudoedit-sudo-actions'. (defun tramp-sudoedit-action-sudo (proc vec) - "Check, whether a sudo process has finished. -Remove unneeded output." + "Check, whether a sudo process has finished. Remove unneeded output." ;; There might be pending output for the exit status. (unless (process-live-p proc) (while (tramp-accept-process-output proc 0)) @@ -866,7 +865,7 @@ In case there is no valid Lisp expression, it raises an error." (car args) (buffer-string))))))) (defun tramp-sudoedit-send-command-string (vec &rest args) - "Run command ARGS and return the output as astring." + "Run command ARGS and return the output as a string." (when (apply #'tramp-sudoedit-send-command vec args) (with-current-buffer (tramp-get-connection-buffer vec) (tramp-message vec 6 "\n%s" (buffer-string)) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 50f8c5d991..ba8b9aa5c4 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -116,7 +116,7 @@ in `backup-directory-alist'. If a Tramp file is backed up, and DIRECTORY is a local file name, the backup directory is prepended with Tramp file name prefix \(method, user, host) of file. -\(setq tramp-backup-directory-alist backup-directory-alist) + (setq tramp-backup-directory-alist backup-directory-alist) gives the same backup policy for Tramp files on their hosts like the policy for local files." @@ -528,7 +528,7 @@ usually suffice.") (defconst tramp-echoed-echo-mark-regexp (format "%s\\(\b\\( \b\\)?\\)\\{%d\\}" tramp-echo-mark-marker tramp-echo-mark-marker-length) - "Regexp which matches `tramp-echo-mark' as it gets echoed by + "Regexp which matches `tramp-echo-mark' as it gets echoed by \ the remote shell.") (defcustom tramp-local-end-of-line @@ -760,14 +760,14 @@ to be set, depending on VALUE." (tramp-set-syntax 'tramp-syntax (tramp-compat-tramp-syntax))) (defun tramp-syntax-values () - "Return possible values of `tramp-syntax', a list" + "Return possible values of `tramp-syntax', a list." (let ((values (cdr (get 'tramp-syntax 'custom-type)))) (setq values (mapcar #'last values) values (mapcar #'car values)) values)) (defun tramp-lookup-syntax (alist) - "Look up a syntax string in ALIST according to `tramp-compat-tramp-syntax.' + "Look up a syntax string in ALIST according to `tramp-compat-tramp-syntax'. Raise an error if `tramp-syntax' is invalid." (or (cdr (assq (tramp-compat-tramp-syntax) alist)) (error "Wrong `tramp-syntax' %s" tramp-syntax))) @@ -779,6 +779,7 @@ Raise an error if `tramp-syntax' is invalid." "Alist mapping Tramp syntax to strings beginning Tramp file names.") (defun tramp-build-prefix-format () + "Return `tramp-prefix-format' according to `tramp-syntax'." (tramp-lookup-syntax tramp-prefix-format-alist)) (defvar tramp-prefix-format nil ;Initialized when defining `tramp-syntax'! @@ -786,6 +787,7 @@ Raise an error if `tramp-syntax' is invalid." Used in `tramp-make-tramp-file-name'.") (defun tramp-build-prefix-regexp () + "Return `tramp-prefix-regexp'." (concat "^" (regexp-quote tramp-prefix-format))) (defvar tramp-prefix-regexp nil ;Initialized when defining `tramp-syntax'! @@ -799,6 +801,7 @@ Should always start with \"^\". Derived from `tramp-prefix-format'.") "Alist mapping Tramp syntax to regexps matching methods identifiers.") (defun tramp-build-method-regexp () + "Return `tramp-method-regexp' according to `tramp-syntax'." (tramp-lookup-syntax tramp-method-regexp-alist)) (defvar tramp-method-regexp nil ;Initialized when defining `tramp-syntax'! @@ -812,6 +815,7 @@ The `ftp' syntax does not support methods.") "Alist mapping Tramp syntax to the delimiter after the method.") (defun tramp-build-postfix-method-format () + "Return `tramp-postfix-method-format' according to `tramp-syntax'." (tramp-lookup-syntax tramp-postfix-method-format-alist)) (defvar tramp-postfix-method-format nil ;Init'd when defining `tramp-syntax'! @@ -820,6 +824,7 @@ The `ftp' syntax does not support methods. Used in `tramp-make-tramp-file-name'.") (defun tramp-build-postfix-method-regexp () + "Return `tramp-postfix-method-regexp'." (regexp-quote tramp-postfix-method-format)) (defvar tramp-postfix-method-regexp nil ;Init'd when defining `tramp-syntax'! @@ -863,6 +868,7 @@ Derived from `tramp-postfix-user-format'.") "Alist mapping Tramp syntax to strings prefixing IPv6 addresses.") (defun tramp-build-prefix-ipv6-format () + "Return `tramp-prefix-ipv6-format' according to `tramp-syntax'." (tramp-lookup-syntax tramp-prefix-ipv6-format-alist)) (defvar tramp-prefix-ipv6-format nil ;Initialized when defining `tramp-syntax'! @@ -870,6 +876,7 @@ Derived from `tramp-postfix-user-format'.") Used in `tramp-make-tramp-file-name'.") (defun tramp-build-prefix-ipv6-regexp () + "Return `tramp-prefix-ipv6-regexp'." (regexp-quote tramp-prefix-ipv6-format)) (defvar tramp-prefix-ipv6-regexp nil ;Initialized when defining `tramp-syntax'! @@ -889,6 +896,7 @@ Derived from `tramp-prefix-ipv6-format'.") "Alist mapping Tramp syntax to suffix for IPv6 addresses.") (defun tramp-build-postfix-ipv6-format () + "Return `tramp-postfix-ipv6-format' according to `tramp-syntax'." (tramp-lookup-syntax tramp-postfix-ipv6-format-alist)) (defvar tramp-postfix-ipv6-format nil ;Initialized when defining `tramp-syntax'! @@ -896,6 +904,7 @@ Derived from `tramp-prefix-ipv6-format'.") Used in `tramp-make-tramp-file-name'.") (defun tramp-build-postfix-ipv6-regexp () + "Return `tramp-postfix-ipv6-regexp'." (regexp-quote tramp-postfix-ipv6-format)) (defvar tramp-postfix-ipv6-regexp nil ;Initialized when defining `tramp-syntax'! @@ -932,6 +941,7 @@ Derived from `tramp-postfix-hop-format'.") "Alist mapping Tramp syntax to strings between host and local names.") (defun tramp-build-postfix-host-format () + "Return `tramp-postfix-host-format' according to `tramp-syntax'." (tramp-lookup-syntax tramp-postfix-host-format-alist)) (defvar tramp-postfix-host-format nil ;Initialized when defining `tramp-syntax'! @@ -939,6 +949,7 @@ Derived from `tramp-postfix-hop-format'.") Used in `tramp-make-tramp-file-name'.") (defun tramp-build-postfix-host-regexp () + "Return `tramp-postfix-host-regexp'." (regexp-quote tramp-postfix-host-format)) (defvar tramp-postfix-host-regexp nil ;Initialized when defining `tramp-syntax'! @@ -949,10 +960,10 @@ Derived from `tramp-postfix-host-format'.") "Regexp matching localnames.") (defconst tramp-unknown-id-string "UNKNOWN" - "String used to denote an unknown user or group") + "String used to denote an unknown user or group.") (defconst tramp-unknown-id-integer -1 - "Integer used to denote an unknown user or group") + "Integer used to denote an unknown user or group.") ;;; File name format: @@ -1005,6 +1016,7 @@ means the opening parentheses are counted to identify the pair. See also `tramp-file-name-regexp'.") (defun tramp-build-file-name-regexp () + "Return `tramp-file-name-regexp'." (car tramp-file-name-structure)) ;;;###autoload @@ -1073,6 +1085,7 @@ See `tramp-file-name-structure' for more explanations.") "Alist mapping incomplete Tramp file names.") (defun tramp-build-completion-file-name-regexp () + "Return `tramp-completion-file-name-regexp' according to `tramp-syntax'." (tramp-lookup-syntax tramp-completion-file-name-regexp-alist)) (defvar tramp-completion-file-name-regexp @@ -1147,13 +1160,13 @@ checked via the following code: In the Emacs normally running Tramp, evaluate the above code \(replace \"xxx\" and \"yyy\" by the remote user and host name, respectively). You can do this, for example, by pasting it into -the `*scratch*' buffer and then hitting C-j with the cursor after the +the `*scratch*' buffer and then hitting `C-j' with the cursor after the last closing parenthesis. Note that it works only if you have configured \"ssh\" to run without password query, see ssh-agent(1). You will see the number of bytes sent successfully to the remote host. If that number exceeds 1000, you can stop the execution by hitting -C-g, because your Emacs is likely clean. +`C-g', because your Emacs is likely clean. When it is necessary to set `tramp-chunksize', you might consider to use an out-of-the-band method \(like \"scp\") instead of an internal one @@ -1165,7 +1178,7 @@ about the value `tramp-chunksize' should be set. Maybe you could just experiment a bit, e.g. changing the values of `init' and `step' in the third line of the code. -Please raise a bug report via \"M-x tramp-bug\" if your system needs +Please raise a bug report via \\[tramp-bug] if your system needs this variable to be set as well." :type '(choice (const nil) integer)) @@ -1317,8 +1330,8 @@ entry does not exist, return nil." t)) (defun tramp-find-method (method user host) - "Return the right method string to use. -This is METHOD, if non-nil. Otherwise, do a lookup in + "Return the right method string to use depending on USER and HOST. +This is METHOD, if non-nil. Otherwise, do a lookup in `tramp-default-method-alist' and `tramp-default-method'." (when (and method (or (string-equal method "") @@ -1342,8 +1355,8 @@ This is METHOD, if non-nil. Otherwise, do a lookup in (propertize result 'tramp-default t)))) (defun tramp-find-user (method user host) - "Return the right user string to use. -This is USER, if non-nil. Otherwise, do a lookup in + "Return the right user string to use depending on METHOD and HOST. +This is USER, if non-nil. Otherwise, do a lookup in `tramp-default-user-alist' and `tramp-default-user'." (let ((result (or user @@ -1363,8 +1376,8 @@ This is USER, if non-nil. Otherwise, do a lookup in (propertize result 'tramp-default t)))) (defun tramp-find-host (method user host) - "Return the right host string to use. -This is HOST, if non-nil. Otherwise, do a lookup in + "Return the right host string to use depending on METHOD and USER. +This is HOST, if non-nil. Otherwise, do a lookup in `tramp-default-host-alist' and `tramp-default-host'." (let ((result (or (and (> (length host) 0) host) @@ -1389,7 +1402,7 @@ The structure consists of method, user, domain, host, port, localname (file name on remote host), and hop. Unless NODEFAULT is non-nil, method, user and host are expanded -to their default values. For the other file name parts, no +to their default values. For the other file name parts, no default values are used." (save-match-data (unless (tramp-tramp-file-p name) @@ -1564,7 +1577,8 @@ necessary only. This function will be used in file name completion." (when localname localname))) (defun tramp-get-buffer (vec &optional dont-create) - "Get the connection buffer to be used for VEC." + "Get the connection buffer to be used for VEC. +Unless DONT-CREATE, the buffer is created when it doesn't exist yet." (or (get-buffer (tramp-buffer-name vec)) (unless dont-create (with-current-buffer (get-buffer-create (tramp-buffer-name vec)) @@ -1580,6 +1594,7 @@ necessary only. This function will be used in file name completion." (defun tramp-get-connection-buffer (vec &optional dont-create) "Get the connection buffer to be used for VEC. +Unless DONT-CREATE, the buffer is created when it doesn't exist yet. In case a second asynchronous communication has been started, it is different from `tramp-get-buffer'." (or (tramp-get-connection-property vec "process-buffer" nil) @@ -1666,7 +1681,7 @@ The outline level is equal to the verbosity of the Tramp message." (current-buffer))) (defsubst tramp-debug-message (vec fmt-string &rest arguments) - "Append message to debug buffer. + "Append message to debug buffer of VEC. Message is formatted with FMT-STRING as control string and the remaining ARGUMENTS to actually emit the message (if applicable)." (with-current-buffer (tramp-get-debug-buffer vec) @@ -1803,7 +1818,8 @@ function is meant for debugging purposes." "Emit an error. VEC-OR-PROC identifies the connection to use, SIGNAL is the signal identifier to be raised, remaining arguments passed to -`tramp-message'. Finally, signal SIGNAL is raised." +`tramp-message'. Finally, signal SIGNAL is raised with +FMT-STRING and ARGUMENTS." (let (tramp-message-show-message signal-hook-function) (tramp-backtrace vec-or-proc) (unless arguments @@ -1989,7 +2005,7 @@ FILE must be a local file name on a connection identified via VEC." (font-lock-add-keywords 'emacs-lisp-mode '("\\")) (defmacro with-tramp-connection-property (key property &rest body) - "Check in Tramp for property PROPERTY, otherwise executes BODY and set." + "Check in Tramp for property PROPERTY, otherwise execute BODY and set." `(let ((value (tramp-get-connection-property ,key ,property 'undef))) (when (eq value 'undef) ;; We cannot pass ,@body as parameter to @@ -2120,8 +2136,8 @@ coding system might not be determined. This function repairs it." (defun tramp-run-real-handler (operation args) "Invoke normal file name handler for OPERATION. -First arg specifies the OPERATION, second arg is a list of arguments to -pass to the OPERATION." +First arg specifies the OPERATION, second arg ARGS is a list of +arguments to pass to the OPERATION." (let* ((inhibit-file-name-handlers `(tramp-file-name-handler tramp-vc-file-name-handler @@ -2228,7 +2244,7 @@ Must be handled by the callers." (with-current-buffer (process-buffer (nth 0 args)) default-directory))) ;; Unknown file primitive. - (t (error "unknown file I/O primitive: %s" operation)))) + (t (error "Unknown file I/O primitive: %s" operation)))) (defun tramp-find-foreign-file-name-handler (filename &optional _operation) "Return foreign file name handler if exists." @@ -2272,7 +2288,7 @@ preventing reentrant calls of Tramp.") ;; Main function. (defun tramp-file-name-handler (operation &rest args) - "Invoke Tramp file name handler. + "Invoke Tramp file name handler for OPERATION and ARGS. Fall back to normal file name handler if no Tramp file name handler exists." (let ((filename (apply #'tramp-file-name-for-operation operation args)) ;; `file-remote-p' is called for everything, even for symbolic @@ -2370,7 +2386,7 @@ Fall back to normal file name handler if no Tramp file name handler exists." (tramp-run-real-handler operation args)))) (defun tramp-completion-file-name-handler (operation &rest args) - "Invoke Tramp file name completion handler. + "Invoke Tramp file name completion handler for OPERATION and ARGS. Falls back to normal file name handler if no Tramp file name handler exists." (let ((fn (assoc operation tramp-completion-file-name-handler-alist))) (if (and fn tramp-mode) @@ -2614,7 +2630,7 @@ not in completion mode." ;; Method, host name and user name completion for a file. (defun tramp-completion-handle-file-name-completion (filename directory &optional predicate) - "Like `file-name-completion' for Tramp files." + "Like `file-name-completion' for partial Tramp files." ;; Suppress eager completion on not connected hosts. (let ((non-essential t)) (try-completion @@ -2641,7 +2657,7 @@ not in completion mode." ;; "/x:y@""/[x/y@" "/x:y@z" "/[x/y@z" "/x:y@z:" "/[x/y@z]" ;;["x" "y" nil nil] ["x" "y" "z" nil] ["x" "y" "z" ""] (defun tramp-completion-dissect-file-name (name) - "Return a list of `tramp-file-name' structures. + "Return a list of `tramp-file-name' structures for NAME. They are collected by `tramp-completion-dissect-file-name1'." (let* ((x-nil "\\|\\(\\)") (tramp-completion-ipv6-regexp @@ -2714,7 +2730,7 @@ They are collected by `tramp-completion-dissect-file-name1'." tramp-completion-file-name-structure6))))) (defun tramp-completion-dissect-file-name1 (structure name) - "Return a `tramp-file-name' structure matching STRUCTURE. + "Return a `tramp-file-name' structure for NAME matching STRUCTURE. The structure consists of remote method, remote user, remote host and localname (filename on remote host)." (save-match-data @@ -3161,7 +3177,7 @@ User is always nil." ;; Localname manipulation functions that grok Tramp localnames... (defun tramp-handle-file-name-as-directory (file) - "Like `file-name-as-directory' but aware of Tramp files." + "Like `file-name-as-directory' for Tramp files." ;; `file-name-as-directory' would be sufficient except localname is ;; the empty string. (let ((v (tramp-dissect-file-name file t))) @@ -3248,7 +3264,7 @@ User is always nil." (try-completion filename hits-ignored-extensions)))) (defun tramp-handle-file-name-directory (file) - "Like `file-name-directory' but aware of Tramp files." + "Like `file-name-directory' for Tramp files." ;; Everything except the last filename thing is the directory. We ;; cannot apply `with-parsed-tramp-file-name', because this expands ;; the remote file name parts. @@ -3261,7 +3277,7 @@ User is always nil." 'noloc)))) (defun tramp-handle-file-name-nondirectory (file) - "Like `file-name-nondirectory' but aware of Tramp files." + "Like `file-name-nondirectory' for Tramp files." (with-parsed-tramp-file-name file nil (tramp-run-real-handler #'file-name-nondirectory (list localname)))) @@ -4291,7 +4307,7 @@ If both files are local, the function returns t." (string-equal (file-remote-p file1) (file-remote-p file2))))) (defun tramp-mode-string-to-int (mode-string) - "Convert a ten-letter `drwxrwxrwx'-style mode string into mode bits." + "Convert a ten-letter \"drwxrwxrwx\"-style MODE-STRING into mode bits." (let* (case-fold-search (mode-chars (string-to-vector mode-string)) (owner-read (aref mode-chars 1)) @@ -4370,7 +4386,7 @@ If both files are local, the function returns t." This is used to map a mode number to a permission string.") (defun tramp-file-mode-from-int (mode) - "Turn an integer representing a file mode into an ls(1)-like string." + "Turn an integer representing a file MODE into an ls(1)-like string." (let ((type (cdr (assoc (logand (ash mode -12) 15) tramp-file-mode-type-map))) (user (logand (ash mode -6) 7)) diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 9fe848dbbe..64df1eeb8b 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -23,6 +23,11 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + +;; Convenience functions around the Tramp version. Partly generated +;; during Tramp configuration. + ;;; Code: ;; In the Tramp GIT, the version number is auto-frobbed from tramp.el, diff --git a/test/lisp/net/tramp-archive-tests.el b/test/lisp/net/tramp-archive-tests.el index 00d3b4a478..80bc9ccaae 100644 --- a/test/lisp/net/tramp-archive-tests.el +++ b/test/lisp/net/tramp-archive-tests.el @@ -17,6 +17,10 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see `https://www.gnu.org/licenses/'. +;;; Commentary: + +;; A testsuite for testing file archives. + ;;; Code: ;; The `tramp-archive-testnn-*' tests correspond to the respective @@ -959,7 +963,8 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." (tramp-archive-cleanup-hash))) (defun tramp-archive-test-all (&optional interactive) - "Run all tests for \\[tramp-archive]." + "Run all tests for \\[tramp-archive]. +If INTERACTIVE is non-nil, the tests are run interactively." (interactive "p") (funcall (if interactive #'ert-run-tests-interactively #'ert-run-tests-batch) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 271ac7299d..9b1af1b28b 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -5146,7 +5146,8 @@ This does not support globbing characters in file names (yet)." (defun tramp--test-gvfs-p (&optional method) "Check, whether the remote host runs a GVFS based method. -This requires restrictions of file name syntax." +This requires restrictions of file name syntax. +If optional METHOD is given, it is checked first." (or (member method tramp-gvfs-methods) (tramp-gvfs-file-name-p tramp-test-temporary-file-directory))) @@ -5661,6 +5662,7 @@ Use the `ls' command." (defmacro tramp--test-with-proper-process-name-and-buffer (proc &rest body) "Set \"process-name\" and \"process-buffer\" connection properties. +The values are derived from PROC. Run BODY. This is needed in timer functions as well as process filters and sentinels." (declare (indent 1) (debug (processp body))) `(let* ((v (tramp-get-connection-property ,proc "vector" nil)) @@ -6054,7 +6056,8 @@ Since it unloads Tramp, it shall be the last test to run." (ert-fail (format "Hook `%s' still contains Tramp function" x)))))) (defun tramp-test-all (&optional interactive) - "Run all tests for \\[tramp]." + "Run all tests for \\[tramp]. +If INTERACTIVE is non-nil, the tests are run interactively." (interactive "p") (funcall (if interactive commit bf7debec3b2cdc4a5bc00c62046a6cb24c3f32af Author: João Távora Date: Wed Nov 13 09:47:25 2019 +0000 Avoid fido-mode's setup on non-icomplete minibuffers Otherwise we would lose things like C-r (isearch-backward) when doing simple stuff like non-icomplete pp-eval-expression. * lisp/icomplete.el (icomplete--fido-mode-setup): Restrict setup to when icomplete-mode really kicks in. diff --git a/lisp/icomplete.el b/lisp/icomplete.el index d0d3d65c34..a732d4cc0d 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -319,13 +319,14 @@ require user confirmation." (defun icomplete--fido-mode-setup () "Setup `fido-mode''s minibuffer." - (use-local-map (make-composed-keymap icomplete-fido-mode-map - (current-local-map))) - (setq-local icomplete-tidy-shadowed-file-names t - icomplete-show-matches-on-no-input t - icomplete-hide-common-prefix nil - completion-styles '(flex) - completion-category-defaults nil)) + (when (and icomplete-mode (icomplete-simple-completing-p)) + (use-local-map (make-composed-keymap icomplete-fido-mode-map + (current-local-map))) + (setq-local icomplete-tidy-shadowed-file-names t + icomplete-show-matches-on-no-input t + icomplete-hide-common-prefix nil + completion-styles '(flex) + completion-category-defaults nil))) ;;;###autoload (define-minor-mode fido-mode