commit 0956a3e41eea6a651a40bdbb8f8310a23733a739 (HEAD, refs/remotes/origin/master) Author: Yuri Khan Date: Tue Oct 18 09:42:54 2016 +0300 Support Shift selection in nxml-mode commands * lisp/nxml/nxml-mode.el (nxml-forward-balanced-item) (nxml-up-element, nxml-backward-up-element, nxml-down-element) (nxml-backward-down-element, nxml-forward-element) (nxml-backward-element, nxml-forward-paragraph) (nxml-backward-paragraph): Use "^p" as the interactive spec, to support shift-selection. Copyright-paperwork-exempt: yes diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el index cceb75e..0b9975f 100644 --- a/lisp/nxml/nxml-mode.el +++ b/lisp/nxml/nxml-mode.el @@ -1521,7 +1521,7 @@ references and character references. A processing instruction consists of a target and a content string. A comment or a CDATA section contains a single string. An entity reference contains a single name. A character reference contains a character number." - (interactive "p") + (interactive "^p") (or arg (setq arg 1)) (cond ((> arg 0) (while (progn @@ -1733,7 +1733,7 @@ single name. A character reference contains a character number." ret)) (defun nxml-up-element (&optional arg) - (interactive "p") + (interactive "^p") (or arg (setq arg 1)) (if (< arg 0) (nxml-backward-up-element (- arg)) @@ -1761,7 +1761,7 @@ single name. A character reference contains a character number." (apply #'error (cddr err)))))) (defun nxml-backward-up-element (&optional arg) - (interactive "p") + (interactive "^p") (or arg (setq arg 1)) (if (< arg 0) (nxml-up-element (- arg)) @@ -1793,7 +1793,7 @@ single name. A character reference contains a character number." "Move forward down into the content of an element. With ARG, do this that many times. Negative ARG means move backward but still down." - (interactive "p") + (interactive "^p") (or arg (setq arg 1)) (if (< arg 0) (nxml-backward-down-element (- arg)) @@ -1811,7 +1811,7 @@ Negative ARG means move backward but still down." (setq arg (1- arg))))) (defun nxml-backward-down-element (&optional arg) - (interactive "p") + (interactive "^p") (or arg (setq arg 1)) (if (< arg 0) (nxml-down-element (- arg)) @@ -1839,7 +1839,7 @@ Negative ARG means move backward but still down." "Move forward over one element. With ARG, do it that many times. Negative ARG means move backward." - (interactive "p") + (interactive "^p") (or arg (setq arg 1)) (if (< arg 0) (nxml-backward-element (- arg)) @@ -1858,7 +1858,7 @@ Negative ARG means move backward." "Move backward over one element. With ARG, do it that many times. Negative ARG means move forward." - (interactive "p") + (interactive "^p") (or arg (setq arg 1)) (if (< arg 0) (nxml-forward-element (- arg)) @@ -1893,7 +1893,7 @@ The paragraph marked is the one that contains point or follows point." (nxml-backward-paragraph)) (defun nxml-forward-paragraph (&optional arg) - (interactive "p") + (interactive "^p") (or arg (setq arg 1)) (cond ((< arg 0) (nxml-backward-paragraph (- arg))) @@ -1903,7 +1903,7 @@ The paragraph marked is the one that contains point or follows point." (> (setq arg (1- arg)) 0)))))) (defun nxml-backward-paragraph (&optional arg) - (interactive "p") + (interactive "^p") (or arg (setq arg 1)) (cond ((< arg 0) (nxml-forward-paragraph (- arg))) commit 73d4c86ee1cd8cf991ca5fde224adfbb2d626f4f Author: Mark Oteiza Date: Tue Oct 18 01:53:22 2016 -0400 Simplify some loops and cons * lisp/net/mailcap.el: Replace cl with cl-lib. (mailcap--get-user-mime-data, mailcap--set-user-mime-data): (mailcap-parse-mailcaps, mailcap-parse-mailcap-extras): (mailcap-possible-viewers): Use push and dolist where possible. (mailcap-viewer-passes-test): Remove unused binding. (mailcap-add-mailcap-entry): Use push. (mailcap-mime-info): Remove unused binding. Use push. (mailcap-parse-mimetypes): Use dolist. diff --git a/lisp/net/mailcap.el b/lisp/net/mailcap.el index f80b300..f71d7ba 100644 --- a/lisp/net/mailcap.el +++ b/lisp/net/mailcap.el @@ -29,7 +29,7 @@ ;;; Code: -(eval-when-compile (require 'cl)) +(eval-when-compile (require 'cl-lib)) (autoload 'mail-header-parse-content-type "mail-parse") (defgroup mailcap nil @@ -62,20 +62,20 @@ (let ((val (default-value sym)) res) (dolist (entry val) - (setq res (cons (list (cdr (assq 'viewer entry)) - (cdr (assq 'type entry)) - (cdr (assq 'test entry))) - res))) + (push (list (cdr (assq 'viewer entry)) + (cdr (assq 'type entry)) + (cdr (assq 'test entry))) + res)) (nreverse res))) (defun mailcap--set-user-mime-data (sym val) (let (res) (dolist (entry val) - (setq res (cons `((viewer . ,(car entry)) - (type . ,(cadr entry)) - ,@(when (caddr entry) - `((test . ,(caddr entry))))) - res))) + (push `((viewer . ,(car entry)) + (type . ,(cadr entry)) + ,@(when (cl-caddr entry) + `((test . ,(cl-caddr entry))))) + res)) (set-default sym (nreverse res)))) (defcustom mailcap-user-mime-data nil @@ -430,18 +430,14 @@ MAILCAPS if set; otherwise (on Unix) use the path from RFC 1524, plus ;; with /usr before /usr/local. '("~/.mailcap" "/etc/mailcap" "/usr/etc/mailcap" "/usr/local/etc/mailcap")))) - (let ((fnames (reverse - (if (stringp path) - (split-string path path-separator t) - path))) - fname) - (while fnames - (setq fname (car fnames)) - (if (and (file-readable-p fname) - (file-regular-p fname)) - (mailcap-parse-mailcap fname)) - (setq fnames (cdr fnames)))) - (setq mailcap-parsed-p t))) + (dolist (fname (reverse + (if (stringp path) + (split-string path path-separator t) + path))) + (if (and (file-readable-p fname) + (file-regular-p fname)) + (mailcap-parse-mailcap fname))) + (setq mailcap-parsed-p t))) (defun mailcap-parse-mailcap (fname) "Parse out the mailcap file specified by FNAME." @@ -560,10 +556,7 @@ MAILCAPS if set; otherwise (on Unix) use the path from RFC 1524, plus (setq value (buffer-substring val-pos (point)))) ;; `test' as symbol, others like "copiousoutput" and "needsx11" as ;; strings - (setq results (cons (cons (if (string-equal name "test") - 'test - name) - value) results)) + (push (cons (if (string-equal name "test") 'test name) value) results) (skip-chars-forward " \";\n\t")) results))) @@ -607,9 +600,9 @@ the test clause will be unchanged." (while major (cond ((equal (car (car major)) minor) - (setq exact (cons (cdr (car major)) exact))) + (push (cdr (car major)) exact)) ((and minor (string-match (concat "^" (car (car major)) "$") minor)) - (setq wildcard (cons (cdr (car major)) wildcard)))) + (push (cdr (car major)) wildcard))) (setq major (cdr major))) (nconc exact wildcard))) @@ -672,7 +665,7 @@ to supply to the test." (otest test) (viewer (cdr (assq 'viewer viewer-info))) (default-directory (expand-file-name "~/")) - status parsed-test cache result) + status cache result) (cond ((not (or (stringp viewer) (fboundp viewer))) nil) ; Non-existent Lisp function ((setq cache (assoc test mailcap-viewer-test-cache)) @@ -704,9 +697,7 @@ to supply to the test." (defun mailcap-add-mailcap-entry (major minor info) (let ((old-major (assoc major mailcap-mime-data))) (if (null old-major) ; New major area - (setq mailcap-mime-data - (cons (cons major (list (cons minor info))) - mailcap-mime-data)) + (push (cons major (list (cons minor info))) mailcap-mime-data) (let ((cur-minor (assoc minor old-major))) (cond ((or (null cur-minor) ; New minor area, or @@ -786,10 +777,7 @@ If NO-DECODE is non-nil, don't decode STRING." major ; Major encoding (text, etc) minor ; Minor encoding (html, etc) info ; Other info - save-pos ; Misc. position during parse major-info ; (assoc major mailcap-mime-data) - minor-info ; (assoc minor major-info) - test ; current test proc. viewers ; Possible viewers passed ; Viewers that passed the test viewer ; The one and only viewer @@ -815,7 +803,7 @@ If NO-DECODE is non-nil, don't decode STRING." (cdr ctl))) (while viewers (if (mailcap-viewer-passes-test (car viewers) info) - (setq passed (cons (car viewers) passed))) + (push (car viewers) passed)) (setq viewers (cdr viewers))) (setq passed (sort passed 'mailcap-viewer-lessp)) (setq viewer (car passed)))) @@ -980,15 +968,11 @@ If FORCE, re-parse even if already parsed." "/usr/etc/mime-types" "/usr/local/etc/mime-types" "/usr/local/www/conf/mime-types")))) - (let ((fnames (reverse (if (stringp path) - (split-string path path-separator t) - path))) - fname) - (while fnames - (setq fname (car fnames)) - (if (and (file-readable-p fname)) - (mailcap-parse-mimetype-file fname)) - (setq fnames (cdr fnames)))) + (dolist (fname (reverse (if (stringp path) + (split-string path path-separator t) + path))) + (if (and (file-readable-p fname)) + (mailcap-parse-mimetype-file fname))) (setq mailcap-mimetypes-parsed-p t))) (defun mailcap-parse-mimetype-file (fname) commit e697ccab77b1668a0781397b55b676fc4e9bc1b6 Author: Mark Oteiza Date: Mon Oct 17 14:31:31 2016 -0400 Turn on lexical-binding in auth-source * lisp/auth-source.el: Turn on lexical-binding. (auth-source-netrc-parse, auth-source-netrc-normalize): (auth-source-token-passphrase-callback-function): (auth-source-netrc-create, auth-source-secrets-search): (auth-source-macos-keychain-search-items): (auth-source-plstore-search): Use let instead of lexical-let. diff --git a/lisp/auth-source.el b/lisp/auth-source.el index 97059fa..9e1f468 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -1,4 +1,4 @@ -;;; auth-source.el --- authentication sources for Gnus and Emacs +;;; auth-source.el --- authentication sources for Gnus and Emacs -*- lexical-binding: t -*- ;; Copyright (C) 2008-2016 Free Software Foundation, Inc. @@ -1002,7 +1002,7 @@ Note that the MAX parameter is used so we can exit the parse early." (auth-source--aput auth-source-netrc-cache file (list :mtime (nth 5 (file-attributes file)) - :secret (lexical-let ((v (mapcar #'1+ (buffer-string)))) + :secret (let ((v (mapcar #'1+ (buffer-string)))) (lambda () (apply #'string (mapcar #'1- v))))))) (goto-char (point-min)) (let ((entries (auth-source-netrc-parse-entries check max)) @@ -1118,7 +1118,7 @@ Note that the MAX parameter is used so we can exit the parse early." (read-passwd (format "Passphrase for %s tokens: " file) t)) - (setcdr entry (lexical-let ((p (copy-sequence passphrase))) + (setcdr entry (let ((p (copy-sequence passphrase))) (lambda () p))) passphrase)))) @@ -1174,8 +1174,8 @@ FILE is the file from which we obtained this token." ;; send back the secret in a function (lexical binding) (when (equal k "secret") - (setq v (lexical-let ((lexv v) - (token-decoder nil)) + (setq v (let ((lexv v) + (token-decoder nil)) (when (string-match "^gpg:" lexv) ;; it's a GPG token: create a token decoder ;; which unsets itself once @@ -1384,7 +1384,7 @@ See `auth-source-search' for details on SPEC." (setq artificial (plist-put artificial (auth-source--symbol-keyword r) (if (eq r 'secret) - (lexical-let ((data data)) + (let ((data data)) (lambda () data)) data)))) @@ -1414,8 +1414,8 @@ See `auth-source-search' for details on SPEC." (plist-put artificial :save-function - (lexical-let ((file file) - (add add)) + (let ((file file) + (add add)) (lambda () (auth-source-netrc-saver file add)))) (list artificial))) @@ -1611,7 +1611,7 @@ authentication tokens: ;; make an entry for the secret (password) element (list :secret - (lexical-let ((v (secrets-get-secret coll item))) + (let ((v (secrets-get-secret coll item))) (lambda () v))) ;; rewrite the entry from ((k1 v1) (k2 v2)) to plist (apply #'append @@ -1813,8 +1813,8 @@ entries for git.gnus.org: ret keychain-generic "secret" - (lexical-let ((v (auth-source--decode-octal-string - (match-string 1)))) + (let ((v (auth-source--decode-octal-string + (match-string 1)))) (lambda () v))))) ;; TODO: check if this is really the label ;; match 0x00000007 ="AppleID" @@ -1896,7 +1896,7 @@ entries for git.gnus.org: (if secret (setcar (cdr secret) - (lexical-let ((v (car (cdr secret)))) + (let ((v (car (cdr secret)))) (lambda () v)))) plist)) items)) commit 421c0512f76683e0b85ea5e1362291c2da4149ba Author: Martin Rudalics Date: Mon Oct 17 10:52:01 2016 +0200 Fix frame focus redirection with shared minibuffer windows (Bug#24500) * src/frame.c (do_switch_frame): Redirect frame focus also when the frame switched to has its minibuffer window on the selected frame. * src/window.c (candidate_window_p): To qualify as candidate it's not sufficient for the window's frame to just share the minibuffer window - it must be active as well. diff --git a/src/frame.c b/src/frame.c index 45559b0..a1c2199 100644 --- a/src/frame.c +++ b/src/frame.c @@ -1160,7 +1160,12 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor if (FRAMEP (xfocus)) { focus = FRAME_FOCUS_FRAME (XFRAME (xfocus)); - if (FRAMEP (focus) && XFRAME (focus) == SELECTED_FRAME ()) + if ((FRAMEP (focus) && XFRAME (focus) == SELECTED_FRAME ()) + /* Redirect frame focus also when FRAME has its minibuffer + window on the selected frame (see Bug#24500). */ + || (NILP (focus) + && EQ (FRAME_MINIBUF_WINDOW (XFRAME (frame)), + sf->selected_window))) Fredirect_frame_focus (xfocus, frame); } } diff --git a/src/window.c b/src/window.c index 753ebc1..acbefcd 100644 --- a/src/window.c +++ b/src/window.c @@ -2377,8 +2377,10 @@ candidate_window_p (Lisp_Object window, Lisp_Object owindow, == FRAME_TERMINAL (XFRAME (selected_frame))); } else if (WINDOWP (all_frames)) - candidate_p = (EQ (FRAME_MINIBUF_WINDOW (f), all_frames) - || EQ (XWINDOW (all_frames)->frame, w->frame) + /* To qualify as candidate, it's not sufficient for WINDOW's frame + to just share the minibuffer window - it must be active as well + (see Bug#24500). */ + candidate_p = (EQ (XWINDOW (all_frames)->frame, w->frame) || EQ (XWINDOW (all_frames)->frame, FRAME_FOCUS_FRAME (f))); else if (FRAMEP (all_frames)) candidate_p = EQ (all_frames, w->frame);