commit 62e27ebd54336d30a90ae71e5bdcb910e954c061 (HEAD, refs/remotes/origin/master) Author: Katsumi Yamaoka Date: Fri Jan 13 07:42:35 2017 +0000 Fix last change of dd80ee6 (was: mm-uu.el: Don't dissect patch part) diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el index 3455cc423d..10cdeed3fb 100644 --- a/lisp/gnus/mm-uu.el +++ b/lisp/gnus/mm-uu.el @@ -711,8 +711,7 @@ Assume text has been decoded if DECODED is non-nil." ;; Mutt still uses application/pgp even though ;; it has already been withdrawn. (string-match "\\`text/\\|\\`application/pgp\\'" type) - (not - (string-match "\\`text/x-\\(?:diff\\|patch\\)\\'" type)) + (not (string-match "/x-\\(?:diff\\|patch\\)\\'" type)) (equal (car (mm-handle-disposition handle)) "inline") (setq commit dd80ee695cac629792f5b230496a9f9ea2f600a5 Author: Katsumi Yamaoka Date: Fri Jan 13 07:22:30 2017 +0000 mm-uu.el: Don't dissect patch part This fixes a bug that the patch part is broken in the article <87inpjzhpb.fsf@users.sourceforge.net> in the bug-gnu-emacs list. * lisp/gnus/mm-uu.el (mm-uu-dissect-text-parts): Don't dissect patch part. diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el index 18322ecb4d..3455cc423d 100644 --- a/lisp/gnus/mm-uu.el +++ b/lisp/gnus/mm-uu.el @@ -711,6 +711,8 @@ Assume text has been decoded if DECODED is non-nil." ;; Mutt still uses application/pgp even though ;; it has already been withdrawn. (string-match "\\`text/\\|\\`application/pgp\\'" type) + (not + (string-match "\\`text/x-\\(?:diff\\|patch\\)\\'" type)) (equal (car (mm-handle-disposition handle)) "inline") (setq commit d4a97088f69eb5729261ee4581cfb7d60c673ebd Author: Dmitry Lazurkin Date: Wed Jan 4 21:46:21 2017 +0300 Fix extracting async def type and name in python mode imenu * lisp/progmodes/python.el (python-imenu--get-defun-type-name): New function. (python-imenu--build-tree): Use python-imenu--get-defun-type-name for extract async or simple def type and name at current position (Bug#24820). * test/lisp/progmodes/python-tests.el (python-imenu-create-index-1): (python-imenu-create-flat-index-1): Add async def's. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 68e19ef5b3..d8262dd0a7 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -4415,6 +4415,15 @@ It must be a function with two arguments: TYPE and NAME.") "*class definition*" "*function definition*")) +(defun python-imenu--get-defun-type-name () + "Return defun type and name at current position." + (when (looking-at python-nav-beginning-of-defun-regexp) + (let ((split (split-string (match-string-no-properties 0)))) + (if (= (length split) 2) + split + (list (concat (car split) " " (cadr split)) + (car (last split))))))) + (defun python-imenu--put-parent (type name pos tree) "Add the parent with TYPE, NAME and POS to TREE." (let ((label @@ -4432,11 +4441,9 @@ not be passed explicitly unless you know what you are doing." (setq min-indent (or min-indent 0) prev-indent (or prev-indent python-indent-offset)) (let* ((pos (python-nav-backward-defun)) - (type) - (name (when (and pos (looking-at python-nav-beginning-of-defun-regexp)) - (let ((split (split-string (match-string-no-properties 0)))) - (setq type (car split)) - (cadr split)))) + (defun-type-name (and pos (python-imenu--get-defun-type-name))) + (type (car defun-type-name)) + (name (cadr defun-type-name)) (label (when name (funcall python-imenu-format-item-label-function type name))) (indent (current-indentation)) diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 94c356b589..2df1bbf50d 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -3559,6 +3559,9 @@ class Baz(object): def c(self): pass + + async def d(self): + pass " (goto-char (point-max)) (should (equal @@ -3580,7 +3583,8 @@ class Baz(object): (list "Frob (class)" (cons "*class definition*" (copy-marker 601)) - (cons "c (def)" (copy-marker 626))))) + (cons "c (def)" (copy-marker 626)) + (cons "d (async def)" (copy-marker 665))))) (python-imenu-create-index))))) (ert-deftest python-imenu-create-index-2 () @@ -3702,6 +3706,9 @@ class Baz(object): def c(self): pass + + async def d(self): + pass " (goto-char (point-max)) (should (equal @@ -3714,7 +3721,8 @@ class Baz(object): (cons "Baz.a" (copy-marker 539)) (cons "Baz.b" (copy-marker 570)) (cons "Baz.Frob" (copy-marker 601)) - (cons "Baz.Frob.c" (copy-marker 626))) + (cons "Baz.Frob.c" (copy-marker 626)) + (cons "Baz.Frob.d" (copy-marker 665))) (python-imenu-create-flat-index))))) (ert-deftest python-imenu-create-flat-index-2 () commit 55b52658470322a701000e88728d096a03b7c8ca Author: Katsumi Yamaoka Date: Thu Jan 12 23:32:41 2017 +0000 Remove garbage from Content-Transfer-Encoding value (bug#25420) * lisp/mail/ietf-drums.el (ietf-drums-strip-cte): New function. (ietf-drums-remove-garbage): New function. (ietf-drums-remove-whitespace): Remove CR as well. * lisp/mail/mail-parse.el (mail-header-strip-cte): Alias to ietf-drums-strip-cte. * lisp/gnus/gnus-art.el (article-decode-charset): * lisp/gnus/gnus-sum.el (gnus-summary-enter-digest-group): * lisp/gnus/mm-decode.el (mm-dissect-buffer): * lisp/gnus/nndoc.el (nndoc-decode-content-transfer-encoding) (nndoc-rfc822-forward-generate-article): * lisp/mh-e/mh-mime.el (mh-decode-message-body): Replace mail-header-strip with mail-header-strip-cte. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 920ef1e249..e1af859516 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -2508,7 +2508,7 @@ If PROMPT (the prefix), prompt for a coding system to use." (mail-content-type-get ctl 'charset))) format (and ctl (mail-content-type-get ctl 'format))) (when cte - (setq cte (mail-header-strip cte))) + (setq cte (mail-header-strip-cte cte))) (if (and ctl (not (string-match "/" (car ctl)))) (setq ctl nil)) (goto-char (point-max))) @@ -2523,8 +2523,7 @@ If PROMPT (the prefix), prompt for a coding system to use." (equal (car ctl) "text/plain")) (not format)) ;; article with format will decode later. (mm-decode-body - charset (and cte (intern (downcase - (gnus-strip-whitespace cte)))) + charset (and cte (intern (downcase cte))) (car ctl))))))) (defun article-decode-encoded-words () diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index c28557af76..72e902a11f 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -9211,7 +9211,7 @@ To control what happens when you exit the group, see the (widen) (narrow-to-region (point) (point-max)) (mm-decode-content-transfer-encoding - (intern (downcase (mail-header-strip encoding)))))) + (intern (downcase (mail-header-strip-cte encoding)))))) (widen)) (unwind-protect (if (let ((gnus-newsgroup-ephemeral-charset diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index c3fdc75a4c..579222f0f6 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -655,9 +655,9 @@ MIME-Version header before proceeding." description))))) (if (or (not ctl) (not (string-match "/" (car ctl)))) - (mm-dissect-singlepart + (mm-dissect-singlepart (list mm-dissect-default-type) - (and cte (intern (downcase (mail-header-strip cte)))) + (and cte (intern (downcase (mail-header-strip-cte cte)))) no-strict-mime (and cd (mail-header-parse-content-disposition cd)) description) @@ -690,7 +690,7 @@ MIME-Version header before proceeding." (mm-possibly-verify-or-decrypt (mm-dissect-singlepart ctl - (and cte (intern (downcase (mail-header-strip cte)))) + (and cte (intern (downcase (mail-header-strip-cte cte)))) no-strict-mime (and cd (mail-header-parse-content-disposition cd)) description id) diff --git a/lisp/gnus/nndoc.el b/lisp/gnus/nndoc.el index f32a3e70c9..ede118d6eb 100644 --- a/lisp/gnus/nndoc.el +++ b/lisp/gnus/nndoc.el @@ -495,7 +495,7 @@ from the document.") (save-restriction (narrow-to-region (point) (point-max)) (mm-decode-content-transfer-encoding - (intern (downcase (mail-header-strip encoding)))))))) + (intern (downcase (mail-header-strip-cte encoding)))))))) (defun nndoc-babyl-type-p () (when (re-search-forward "\^_\^L *\n" nil t) @@ -558,7 +558,7 @@ from the document.") (save-restriction (narrow-to-region begin (point-max)) (mm-decode-content-transfer-encoding - (intern (downcase (mail-header-strip encoding)))))) + (intern (downcase (mail-header-strip-cte encoding)))))) (when head (goto-char begin) (when (search-forward "\n\n" nil t) diff --git a/lisp/mail/ietf-drums.el b/lisp/mail/ietf-drums.el index 8c84158a51..a3e53cfe79 100644 --- a/lisp/mail/ietf-drums.el +++ b/lisp/mail/ietf-drums.el @@ -143,7 +143,7 @@ backslash and doublequote.") (forward-sexp 1)) ((eq c ?\() (forward-sexp 1)) - ((memq c '(?\ ?\t ?\n)) + ((memq c '(?\ ?\t ?\n ?\r)) (delete-char 1)) (t (forward-char 1)))) @@ -172,6 +172,19 @@ backslash and doublequote.") "Remove comments and whitespace from STRING." (ietf-drums-remove-whitespace (ietf-drums-remove-comments string))) +(defun ietf-drums-remove-garbage (string) + "Remove some garbage from STRING." + (while (string-match "[][()<>@,;:\\\"/?=]+" string) + (setq string (concat (substring string 0 (match-beginning 0)) + (substring string (match-end 0))))) + string) + +(defun ietf-drums-strip-cte (string) + "Remove comments, whitespace and garbage from STRING. +STRING is assumed to be a string that is extracted from +the Content-Transfer-Encoding header of a mail." + (ietf-drums-remove-garbage (inline (ietf-drums-strip string)))) + (defun ietf-drums-parse-address (string) "Parse STRING and return a MAILBOX / DISPLAY-NAME pair." (with-temp-buffer diff --git a/lisp/mail/mail-parse.el b/lisp/mail/mail-parse.el index 546673db6f..0578b98c93 100644 --- a/lisp/mail/mail-parse.el +++ b/lisp/mail/mail-parse.el @@ -49,6 +49,7 @@ (defalias 'mail-header-remove-comments 'ietf-drums-remove-comments) (defalias 'mail-header-remove-whitespace 'ietf-drums-remove-whitespace) (defalias 'mail-header-strip 'ietf-drums-strip) +(defalias 'mail-header-strip-cte 'ietf-drums-strip-cte) (defalias 'mail-header-get-comment 'ietf-drums-get-comment) (defalias 'mail-header-parse-address 'ietf-drums-parse-address) (defalias 'mail-header-parse-addresses 'ietf-drums-parse-addresses) diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el index 01fa5a18c4..7238de08b9 100644 --- a/lisp/mh-e/mh-mime.el +++ b/lisp/mh-e/mh-mime.el @@ -56,7 +56,7 @@ (autoload 'mail-content-type-get "mail-parse") (autoload 'mail-decode-encoded-word-string "mail-parse") (autoload 'mail-header-parse-content-type "mail-parse") -(autoload 'mail-header-strip "mail-parse") +(autoload 'mail-header-strip-cte "mail-parse") (autoload 'mail-strip-quoted-names "mail-utils") (autoload 'message-options-get "message") (autoload 'message-options-set "message") @@ -580,14 +580,13 @@ If message has been encoded for transfer take that into account." (message-fetch-field "Content-Type" t))) charset (mail-content-type-get ct 'charset) cte (message-fetch-field "Content-Transfer-Encoding"))) - (when (stringp cte) (setq cte (mail-header-strip cte))) + (when (stringp cte) (setq cte (mail-header-strip-cte cte))) (when (or (not ct) (equal (car ct) "text/plain")) (save-restriction (narrow-to-region (min (1+ (mh-mail-header-end)) (point-max)) (point-max)) (mm-decode-body charset - (and cte (intern (downcase - (gnus-strip-whitespace cte)))) + (and cte (intern (downcase cte))) (car ct)))))) (defun mh-mime-display-part (handle) commit 70d6f2d14f87ab8fe164e1d461b7a55ed1ca3c62 Author: Paul Eggert Date: Thu Jan 12 15:04:38 2017 -0800 Restore behavior of ‘./autogen.sh autoconf git’ * autogen.sh: Do both autoconf and git setup when invoked as ‘./autogen.sh autoconf git’. Avoid unnecessary newline in chatter. Mention new --no-check option in usage message. (Bug#25359) diff --git a/autogen.sh b/autogen.sh index cb2a9151af..bb3f8185f7 100755 --- a/autogen.sh +++ b/autogen.sh @@ -104,27 +104,32 @@ check_version () } do_check=true -do_autoconf=true +do_autoconf=false do_git=false for arg; do case $arg in --help) - exec echo "$0: usage: $0 [all|autoconf|git]";; + exec echo "$0: usage: $0 [--no-check] [target...] + Targets are: all autoconf git";; --no-check) do_check=false;; all) + do_autoconf=true test -e .git && do_git=true;; autoconf) - true;; + do_autoconf=true;; git) - do_autoconf=false do_git=true;; *) echo >&2 "$0: $arg: unknown argument"; exit 1;; esac done +case $do_autoconf,$do_git in + false,false) + do_autoconf=true;; +esac # Generate Autoconf and Automake related files, if requested. @@ -143,7 +148,7 @@ if $do_autoconf; then eval min=\$${sprog}_min - echo "Checking for $prog (need at least version $min)..." + printf '%s' "Checking for $prog (need at least version $min) ... " check_version $prog $min commit 3713c7a0621f4a5ae73e45c6d0d5c55b154611ad Author: Glenn Morris Date: Thu Jan 12 14:06:03 2017 -0500 * autogen.sh: Simplify argument parsing. diff --git a/autogen.sh b/autogen.sh index 8679db78fd..cb2a9151af 100755 --- a/autogen.sh +++ b/autogen.sh @@ -104,8 +104,7 @@ check_version () } do_check=true -do_autoconf=false -test $# -eq 0 && do_autoconf=true +do_autoconf=true do_git=false for arg; do @@ -113,14 +112,13 @@ for arg; do --help) exec echo "$0: usage: $0 [all|autoconf|git]";; --no-check) - do_check=false - test $# -eq 1 && do_autoconf=true;; + do_check=false;; all) - do_autoconf=true test -e .git && do_git=true;; autoconf) - do_autoconf=true;; + true;; git) + do_autoconf=false do_git=true;; *) echo >&2 "$0: $arg: unknown argument"; exit 1;;