commit 112111c4e489aae5cbe241ffa458d97b6a133d3a (HEAD, refs/remotes/origin/master) Author: Daniel Colascione Date: Tue Nov 8 15:26:43 2016 -0800 Avoid infloop in python Fix bug#24905 * lisp/progmodes/python.el (python-info-docstring-p): Improve infloop avoidance: replace (bobp) with generic test for forward progress. * test/lisp/progmodes/python-tests.el (python-bob-infloop-avoid): Add test for bug#24905 diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 290cdc8..f9b28c3 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -4892,12 +4892,19 @@ point's current `syntax-ppss'." ;; Allow up to two consecutive docstrings only. (>= 2 - (progn + (let (last-backward-sexp-point) (while (save-excursion (python-nav-backward-sexp) (setq backward-sexp-point (point)) (and (= indentation (current-indentation)) - (not (bobp)) ; Prevent infloop. + ;; Make sure we're always moving point. + ;; If we get stuck in the same position + ;; on consecutive loop iterations, + ;; bail out. + (prog1 (not (eql last-backward-sexp-point + backward-sexp-point)) + (setq last-backward-sexp-point + backward-sexp-point)) (looking-at-p (concat "[uU]?[rR]?" (python-rx string-delimiter))))) diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 54ed922..f6564dd 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -2452,6 +2452,13 @@ if x: (line-beginning-position) (line-end-position)) "abcdef"))))) +(ert-deftest python-bob-infloop-avoid () + "Test that strings at BOB don't confuse syntax analysis. Bug#24905" + (python-tests-with-temp-buffer + " \"\n" + (goto-char (point-min)) + (font-lock-fontify-buffer))) + ;;; Shell integration commit 06cfaa3dfa1888b55df437a16ced6f718678bc56 Author: Daniel Colascione Date: Tue Nov 8 12:37:30 2016 -0800 Make gnus/message.el work correctly under lexical binding * lisp/gnus/message.el (message-send-mail): Rename `arg' to `_' to shut up the byte compiler. (sha1-maximum-internal-length, smtpmail-smtp-server) (smtpmail-smtp-service): add missing defvars diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 8804513..bdf1b15 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -4481,7 +4481,7 @@ This function could be useful in `message-setup-hook'." (declare-function hashcash-wait-async "hashcash" (&optional buffer)) -(defun message-send-mail (&optional arg) +(defun message-send-mail (&optional _) (require 'mail-utils) (let* ((tembuf (message-generate-new-buffer-clone-locals " message temp")) (case-fold-search nil) @@ -4638,6 +4638,8 @@ If you always want Gnus to send messages in one piece, set (push 'mail message-sent-message-via))) (defvar sendmail-program) +(defvar smtpmail-smtp-server) +(defvar smtpmail-smtp-service) (defvar smtpmail-smtp-user) (defun message-multi-smtp-send-mail () @@ -4817,6 +4819,8 @@ command evaluates `message-send-mail-hook' just before sending a message." (run-hooks 'message-send-mail-hook) (mailclient-send-it)) +(defvar sha1-maximum-internal-length) + (defun message-canlock-generate () "Return a string that is non-trivial to guess. Do not use this for anything important, it is cryptographically weak." commit 39c0b8b6b189cef3cd7118ac7c213a09fa8be398 Author: Michael Albinus Date: Tue Nov 8 20:45:59 2016 +0100 Fix Bug#24889 * lisp/net/tramp.el (tramp-file-name-regexp): Make it a defvar. Fix docstring. (tramp-completion-file-name-handler-alist): Fix docstring. (tramp-register-file-name-handlers): Reassign `tramp-file-name-regexp' to the car of `tramp-file-name-structure'. (Bug#24889) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index e03b614..8a81311 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -867,24 +867,14 @@ On W32 systems, the volume letter must be ignored.") See `tramp-file-name-structure' for more explanations.") ;;;###autoload -(defconst tramp-file-name-regexp +(defvar tramp-file-name-regexp (cond ((equal tramp-syntax 'ftp) tramp-file-name-regexp-unified) ((equal tramp-syntax 'sep) tramp-file-name-regexp-separate) (t (error "Wrong `tramp-syntax' defined"))) "Regular expression matching file names handled by Tramp. -This regexp should match Tramp file names but no other file names. -When tramp.el is loaded, this regular expression is prepended to -`file-name-handler-alist', and that is searched sequentially. Thus, -if the Tramp entry appears rather early in the `file-name-handler-alist' -and is a bit too general, then some files might be considered Tramp -files which are not really Tramp files. - -Please note that the entry in `file-name-handler-alist' is made when -this file \(tramp.el) is loaded. This means that this variable must be set -before loading tramp.el. Alternatively, `file-name-handler-alist' can be -updated after changing this variable. - -Also see `tramp-file-name-structure'.") +This regexp should match Tramp file names but no other file +names. When calling `tramp-register-file-name-handlers', the +initial value is overwritten by the car of `tramp-file-name-structure'.") ;;;###autoload (defconst tramp-completion-file-name-regexp-unified @@ -1055,9 +1045,9 @@ means to use always cached values for the directory contents." . tramp-completion-handle-file-name-all-completions) (file-name-completion . tramp-completion-handle-file-name-completion)) "Alist of completion handler functions. -Used for file names matching `tramp-file-name-regexp'. Operations -not mentioned here will be handled by Tramp's file name handler -functions, or the normal Emacs functions.") +Used for file names matching `tramp-completion-file-name-regexp'. +Operations not mentioned here will be handled by Tramp's file +name handler functions, or the normal Emacs functions.") ;; Handlers for foreign methods, like FTP or SMB, shall be plugged here. ;;;###tramp-autoload @@ -2192,6 +2182,10 @@ Falls back to normal file name handler if no Tramp file name handler exists." tramp-autoload-file-name-handler)) (let ((a1 (rassq fnh file-name-handler-alist))) (setq file-name-handler-alist (delq a1 file-name-handler-alist)))) + ;; The initial value of `tramp-file-name-regexp' is too simple + ;; minded, but we cannot give it the real value in the autoload + ;; pattern. See Bug#24889. + (setq tramp-file-name-regexp (car tramp-file-name-structure)) ;; Add the handlers. (add-to-list 'file-name-handler-alist (cons tramp-file-name-regexp 'tramp-file-name-handler)) commit 3b5e6774ed9743fb726ac8c15341eaa09375cfbf Author: Paul Eggert Date: Tue Nov 8 09:48:53 2016 -0800 Port to FreeBSD 11 AMD Problem reported by Ashish Shukla (Bug#24892). I tested this on FreeBSD 11 x86-64 with HAVE_SBRK manually undefined. * configure.ac (system_malloc): Set to 'yes' if there is no sbrk. (sbrk): Check whether it exists. * src/alloc.c (my_heap_start) [!GNU_LINUX]: Do not define, since this function is now used only on GNU/Linux, and sbrk might not exist on other platforms. (malloc_initialize_hook) [!GNU_LINUX]: Do not call my_heap_start, since its side effect will never be used. (Fmemory_limit) [!HAVE_SBRK]: Do not call sbrk. * src/unexelf.c (unexec) [!HAVE_SBRK]: Assume that nothing like sbrk exists. diff --git a/configure.ac b/configure.ac index f67fe83..7450e2f 100644 --- a/configure.ac +++ b/configure.ac @@ -2151,14 +2151,14 @@ AC_CACHE_CHECK( fi]) doug_lea_malloc=$emacs_cv_var_doug_lea_malloc -system_malloc=$emacs_cv_sanitize_address - hybrid_malloc= +system_malloc=yes case "$opsys" in ## darwin ld insists on the use of malloc routines in the System framework. - darwin | mingw32 | nacl | sol2-10) system_malloc=yes ;; + darwin | mingw32 | nacl | sol2-10) ;; cygwin) hybrid_malloc=yes;; + *) test "$ac_cv_func_sbrk" = yes && system_malloc=$emacs_cv_sanitize_address;; esac if test "${system_malloc}" != yes && test "${doug_lea_malloc}" != yes \ @@ -4155,7 +4155,7 @@ AC_CHECK_HEADERS(valgrind/valgrind.h) AC_CHECK_MEMBERS([struct unipair.unicode], [], [], [[#include ]]) -AC_CHECK_FUNCS_ONCE(tzset) +AC_CHECK_FUNCS_ONCE([sbrk tzset]) ok_so_far=yes AC_CHECK_FUNC(socket, , ok_so_far=no) diff --git a/src/alloc.c b/src/alloc.c index a58dc13..90c6f94 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -97,7 +97,7 @@ static bool valgrind_p; #include "w32heap.h" /* for sbrk */ #endif -#if defined DOUG_LEA_MALLOC || defined GNU_LINUX +#ifdef GNU_LINUX /* The address where the heap starts. */ void * my_heap_start (void) @@ -130,7 +130,9 @@ malloc_initialize_hook (void) if (! initialized) { +#ifdef GNU_LINUX my_heap_start (); +#endif malloc_using_checking = getenv ("MALLOC_CHECK_") != NULL; } else @@ -7053,7 +7055,7 @@ We divide the value by 1024 to make sure it fits in a Lisp integer. */) { Lisp_Object end; -#ifdef HAVE_NS +#if defined HAVE_NS || !HAVE_SBRK /* Avoid warning. sbrk has no relation to memory allocated anyway. */ XSETINT (end, 0); #else diff --git a/src/unexelf.c b/src/unexelf.c index 5519157..748e7a4 100644 --- a/src/unexelf.c +++ b/src/unexelf.c @@ -329,7 +329,11 @@ unexec (const char *new_name, const char *old_name) if (old_bss_index == -1) fatal ("no bss section found"); +#ifdef HAVE_SBRK new_break = sbrk (0); +#else + new_break = (byte *) old_bss_addr + old_bss_size; +#endif new_bss_addr = (ElfW (Addr)) new_break; bss_size_growth = new_bss_addr - old_bss_addr; new_data2_size = bss_size_growth; commit 86baa208f84597068b3d55420eae0100a59e44b7 Author: Paul Eggert Date: Tue Nov 8 08:54:23 2016 -0800 Port emacsclient to FreeBSD 11 etc. * lib-src/emacsclient.c: Include . This is needed on platforms like FreeBSD 11 that use code involving strlen etc., and because no longer includes string.h. diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 59b6ac9..2909d63 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -75,6 +75,7 @@ char *w32_getenv (const char *); #include #include #include +#include #include #include