commit 0e09d00f29e370ecfe2f2b22acff7b98c448bc30 (HEAD, refs/remotes/origin/master) Author: Alan Mackenzie Date: Fri May 12 21:11:49 2017 +0000 Fontify C++ for loop variable as variable, even when followed by parentheses In the following: "for (auto *Friend : Class->friends()) {", "Friend" was getting fontified as a function, due to insufficient checking of the tokens between it and "()". * lisp/progmodes/cc-langs.el (c-:-op-cont-tokens, c-:-op-cont-regexp): New lang-consts/vars. * lisp/progmodes/cc-engine.el (c-forward-declarator): After finding a putative declarator's identifier, check for a ":" token inside a for's parentheses, and abort the search for "(" if this is found. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 6d7bab7a65..9773b1ca85 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -8092,8 +8092,29 @@ comment at the start of cc-engine.el for more info." ;; initializing brace lists. (let (found) (while - (and (setq found (c-syntactic-re-search-forward - "[;,]\\|\\s)\\|\\'\\|\\(=\\|\\s(\\)" limit t t)) + (and (progn + ;; In the next loop, we keep searching forward whilst + ;; we find ":"s which aren't single colons inside C++ + ;; "for" statements. + (while + (and + (setq found + (c-syntactic-re-search-forward + "[;:,]\\|\\s)\\|\\'\\|\\(=\\|\\s(\\)" + limit t t)) + (eq (char-before) ?:) + (if (looking-at c-:-op-cont-regexp) + (progn (goto-char (match-end 0)) t) + (not + (and (c-major-mode-is 'c++-mode) + (save-excursion + (and + (c-go-up-list-backward) + (eq (char-after) ?\() + (progn (c-backward-syntactic-ws) + (c-simple-skip-symbol-backward)) + (looking-at c-paren-stmt-key)))))))) + found) (eq (char-before) ?\[) (c-go-up-list-forward)) (setq brackets-after-id t)) diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 3b455fc090..84d4eab75a 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -1334,6 +1334,21 @@ operators." (c-lang-defvar c-multichar->-op-not->>-regexp (c-lang-const c-multichar->-op-not->>-regexp)) +(c-lang-defconst c-:-op-cont-tokens + ;; A list of second and subsequent characters of all multicharacter tokens + ;; that begin with ":". + t (c-filter-ops (c-lang-const c-all-op-syntax-tokens) + t + "\\`:." + (lambda (op) (substring op 1)))) + +(c-lang-defconst c-:-op-cont-regexp + ;; Regexp matching the second and subsequent characters of all + ;; multicharacter tokens that begin with ":". + t (c-make-keywords-re nil (c-lang-const c-:-op-cont-tokens))) +(c-lang-defvar c-:-op-cont-regexp + (c-lang-const c-:-op-cont-regexp)) + (c-lang-defconst c-stmt-delim-chars ;; The characters that should be considered to bound statements. To ;; optimize `c-crosses-statement-barrier-p' somewhat, it's assumed to commit afd8c762b7bb534f5686a0273f42cb7cd08e0d6f Author: Michael Albinus Date: Fri May 12 18:36:41 2017 +0200 Make Tramp backward compatible * lisp/net/tramp-cmds.el (tramp-change-syntax): Set tramp-autoload cookie. * lisp/net/tramp-compat.el: Run `tramp-change-syntax' at startup, if necessary. * lisp/net/tramp.el (tramp-syntax): Use `tramp-compat-user-error'. (tramp-register-autoload-file-name-handlers): Do not mark `operations' for `tramp-file-name-handler'. (tramp-register-file-name-handlers): Remove also `tramp-autoload-file-name-handler' for backward compatibility. (tramp-register-foreign-file-name-handler): Use `delete-dups'. * test/lisp/net/tramp-tests.el (tramp-change-syntax): Declare. diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index a11908af63..4007b65c3a 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -37,7 +37,7 @@ (defvar reporter-eval-buffer) (defvar reporter-prompt-for-summary-p) -;;;###autoload +;;;###tramp-autoload (defun tramp-change-syntax (&optional syntax) "Change Tramp syntax. SYNTAX can be one of the symbols `default' (default), diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 322e9c3689..53266e806c 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -384,6 +384,12 @@ If NAME is a remote file name, the local part of NAME is unquoted." ((eq tramp-syntax 'sep) 'separate) (t tramp-syntax))) +;; Older Emacsen keep incompatible autoloaded values of `tramp-syntax'. +(eval-after-load 'tramp + '(unless + (memq tramp-syntax (tramp-compat-funcall (quote tramp-syntax-values))) + (tramp-change-syntax (tramp-compat-tramp-syntax)))) + (provide 'tramp-compat) ;;; TODO: diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 071114a015..8c317df976 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -683,7 +683,7 @@ Do not change the value by `setq', it must be changed only by :set (lambda (symbol value) ;; Check allowed values. (unless (memq value (tramp-syntax-values)) - (user-error "Wrong `tramp-syntax' %s" tramp-syntax)) + (tramp-compat-user-error "Wrong `tramp-syntax' %s" tramp-syntax)) ;; Cleanup existing buffers. (unless (eq (symbol-value symbol) value) (tramp-cleanup-all-buffers)) @@ -2196,9 +2196,6 @@ Falls back to normal file name handler if no Tramp file name handler exists." (add-to-list 'file-name-handler-alist (cons tramp-initial-file-name-regexp 'tramp-file-name-handler)) (put 'tramp-file-name-handler 'safe-magic t) - ;; Mark `operations' the handler is responsible for. It's a short list ... - (put 'tramp-file-name-handler 'operations - '(file-name-all-completions file-name-completion file-remote-p)) (add-to-list 'file-name-handler-alist (cons tramp-initial-completion-file-name-regexp @@ -2216,7 +2213,9 @@ Falls back to normal file name handler if no Tramp file name handler exists." ;; Remove autoloaded handlers from file name handler alist. Useful, ;; if `tramp-syntax' has been changed. (dolist (fnh '(tramp-file-name-handler - tramp-completion-file-name-handler)) + tramp-completion-file-name-handler + ;; This is autoloaded in Emacs 24 & 25. + tramp-autoload-file-name-handler)) (let ((a1 (rassq fnh file-name-handler-alist))) (setq file-name-handler-alist (delq a1 file-name-handler-alist)))) @@ -2256,7 +2255,7 @@ Add operations defined in `HANDLER-alist' to `tramp-file-name-handler'." ;; Mark `operations' the handler is responsible for. (put 'tramp-file-name-handler 'operations - (cl-delete-duplicates + (delete-dups (append (get 'tramp-file-name-handler 'operations) (mapcar diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index a380e95c1a..d3a93d27b2 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -45,6 +45,7 @@ (require 'vc-git) (require 'vc-hg) +(declare-function tramp-change-syntax "tramp-cmds") (declare-function tramp-find-executable "tramp-sh") (declare-function tramp-get-remote-path "tramp-sh") (declare-function tramp-get-remote-stat "tramp-sh") commit e5c71dcaf7481cd5f19706e6bea3361f5c1a83e7 Author: Alfred M. Szmidt Date: Fri May 12 11:44:07 2017 +0300 * lisp/mail/rmail.el (rmail-ignored-headers): Add 3 headers to ignore. Copyright-paperwork-exempt: yes. diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 209b5a7140..df07140d87 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -363,6 +363,9 @@ explicitly.") "\\|^importance:\\|^envelope-to:\\|^delivery-date\\|^openpgp:" "\\|^mbox-line:\\|^cancel-lock:" "\\|^DomainKey-Signature:\\|^dkim-signature:" + "\\|^ARC-.*:" + "\\|^Received-SPF:" + "\\|^Authentication-Results:" "\\|^resent-face:\\|^resent-x.*:\\|^resent-organization:\\|^resent-openpgp:" "\\|^x-.*:")) "Regexp to match header fields that Rmail should normally hide.