diff options
| author | Noam Postavsky | 2018-07-09 20:06:27 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2018-07-09 20:06:27 -0400 |
| commit | 6b8349a90274686d9cb67a2ffaac2d930d5f6b46 (patch) | |
| tree | d2fbc56f7a21120951cb0c14bbe349e388b35e62 /lisp | |
| parent | 6de90fb41b63d33457c1fa41cbb4bd8b25e4cc7f (diff) | |
| parent | db3f7797809ed9de8dd92ce38bf34f768ddc64ad (diff) | |
| download | emacs-6b8349a90274686d9cb67a2ffaac2d930d5f6b46.tar.gz emacs-6b8349a90274686d9cb67a2ffaac2d930d5f6b46.zip | |
Merge from emacs-26
db3f779780 ; Test for Bug#32014
90d95b000c Explicitly reject :server and :nowait (Bug#31903)
917158f8c9 Fix Bug#32090
# Conflicts:
# src/process.c
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/files-x.el | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/lisp/files-x.el b/lisp/files-x.el index 74ea77678ec..2a52792222d 100644 --- a/lisp/files-x.el +++ b/lisp/files-x.el | |||
| @@ -578,31 +578,33 @@ strings. All properties are optional; if CRITERIA is nil, it | |||
| 578 | always applies. | 578 | always applies. |
| 579 | PROFILES is a list of connection profiles (symbols).") | 579 | PROFILES is a list of connection profiles (symbols).") |
| 580 | 580 | ||
| 581 | (defsubst connection-local-normalize-criteria (criteria &rest properties) | 581 | (defsubst connection-local-normalize-criteria (criteria) |
| 582 | "Normalize plist CRITERIA according to PROPERTIES. | 582 | "Normalize plist CRITERIA according to properties. |
| 583 | Return a new ordered plist list containing only property names from PROPERTIES." | 583 | Return a reordered plist." |
| 584 | (delq | 584 | (apply |
| 585 | nil | 585 | 'append |
| 586 | (mapcar | 586 | (mapcar |
| 587 | (lambda (property) | 587 | (lambda (property) |
| 588 | (when (and (plist-member criteria property) (plist-get criteria property)) | 588 | (when (and (plist-member criteria property) (plist-get criteria property)) |
| 589 | (list property (plist-get criteria property)))) | 589 | (list property (plist-get criteria property)))) |
| 590 | properties))) | 590 | '(:application :protocol :user :machine)))) |
| 591 | 591 | ||
| 592 | (defsubst connection-local-get-profiles (criteria) | 592 | (defsubst connection-local-get-profiles (criteria) |
| 593 | "Return the connection profiles list for CRITERIA. | 593 | "Return the connection profiles list for CRITERIA. |
| 594 | CRITERIA is a plist identifying a connection and the application | 594 | CRITERIA is a plist identifying a connection and the application |
| 595 | using this connection, see `connection-local-criteria-alist'." | 595 | using this connection, see `connection-local-criteria-alist'." |
| 596 | (or (cdr | 596 | (let (profiles) |
| 597 | (assoc | 597 | (dolist (crit-alist connection-local-criteria-alist) |
| 598 | (connection-local-normalize-criteria | 598 | (let ((crit criteria) |
| 599 | criteria :application :protocol :user :machine) | 599 | (match t)) |
| 600 | connection-local-criteria-alist)) | 600 | (while (and crit match) |
| 601 | ;; Try it without :application. | 601 | (when (plist-member (car crit-alist) (car crit)) |
| 602 | (cdr | 602 | (setq match (equal (plist-get (car crit-alist) (car crit)) |
| 603 | (assoc | 603 | (plist-get criteria (car crit))))) |
| 604 | (connection-local-normalize-criteria criteria :protocol :user :machine) | 604 | (setq crit (cddr crit))) |
| 605 | connection-local-criteria-alist)))) | 605 | (when match |
| 606 | (setq profiles (append profiles (cdr crit-alist)))))) | ||
| 607 | (delete-dups profiles))) | ||
| 606 | 608 | ||
| 607 | ;;;###autoload | 609 | ;;;###autoload |
| 608 | (defun connection-local-set-profiles (criteria &rest profiles) | 610 | (defun connection-local-set-profiles (criteria &rest profiles) |
| @@ -621,8 +623,7 @@ variables for a connection profile are defined using | |||
| 621 | (dolist (profile profiles) | 623 | (dolist (profile profiles) |
| 622 | (unless (assq profile connection-local-profile-alist) | 624 | (unless (assq profile connection-local-profile-alist) |
| 623 | (error "No such connection profile `%s'" (symbol-name profile)))) | 625 | (error "No such connection profile `%s'" (symbol-name profile)))) |
| 624 | (let* ((criteria (connection-local-normalize-criteria | 626 | (let* ((criteria (connection-local-normalize-criteria criteria)) |
| 625 | criteria :application :protocol :user :machine)) | ||
| 626 | (slot (assoc criteria connection-local-criteria-alist))) | 627 | (slot (assoc criteria connection-local-criteria-alist))) |
| 627 | (if slot | 628 | (if slot |
| 628 | (setcdr slot (delete-dups (append (cdr slot) profiles))) | 629 | (setcdr slot (delete-dups (append (cdr slot) profiles))) |