commit af3db69ee640d9a1e9027c04ba3b5bec7c2681ab (HEAD, refs/remotes/origin/master) Author: Alan Third Date: Sat Jan 14 16:57:46 2017 +0000 Fix NS main thread check (bug#25265) * src/nsterm.m (ns_read_socket, ns_select): Replace mainThread with isMainThread. diff --git a/src/nsterm.m b/src/nsterm.m index 90664f652f..63f1b15b24 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -4039,7 +4039,7 @@ in certain situations (rapid incoming events). return i; } - if ([NSThread mainThread]) + if ([NSThread isMainThread]) { block_input (); n_emacs_events_pending = 0; @@ -4123,7 +4123,7 @@ in certain situations (rapid incoming events). } if (NSApp == nil - || ![NSThread mainThread] + || ![NSThread isMainThread] || (timeout && timeout->tv_sec == 0 && timeout->tv_nsec == 0)) return pselect (nfds, readfds, writefds, exceptfds, timeout, sigmask); commit a23974d6e62f660259409baadd848cf6f834d88b Author: Alan Mackenzie Date: Sat Jan 14 12:38:43 2017 +0000 Correct c-parse-state-get-strategy for moving HERE backward into a macro. * list/progmodes/c-engine.el (c-parse-state-get-strategy): When HERE is below its previous value, we chose strategy 'forward, and the new HERE is in a (different) macro, ensure the returned START-POINT is not above the start of the macro. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 3077e0085d..e84c4cebf6 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -2931,11 +2931,23 @@ comment at the start of cc-engine.el for more info." ;; o - ('BOD START-POINT) - scan forwards from START-POINT, which is at the ;; top level. ;; o - ('IN-LIT nil) - point is inside the literal containing point-min. - (let ((cache-pos (c-get-cache-scan-pos here)) ; highest position below HERE in cache (or 1) - BOD-pos ; position of 2nd BOD before HERE. - strategy ; 'forward, 'backward, 'BOD, or 'IN-LIT. - start-point - how-far) ; putative scanning distance. + (let* ((in-macro-start ; start of macro containing HERE or nil. + (save-excursion + (goto-char here) + (and (c-beginning-of-macro) + (point)))) + (changed-macro-start + (and in-macro-start + (not (and c-state-old-cpp-beg + (= in-macro-start c-state-old-cpp-beg))) + in-macro-start)) + (cache-pos (c-get-cache-scan-pos (if changed-macro-start + (min changed-macro-start here) + here))) ; highest suitable position in cache (or 1) + BOD-pos ; position of 2nd BOD before HERE. + strategy ; 'forward, 'backward, 'BOD, or 'IN-LIT. + start-point + how-far) ; putative scanning distance. (setq good-pos (or good-pos (c-state-get-min-scan-pos))) (cond ((< here (c-state-get-min-scan-pos)) @@ -2945,7 +2957,9 @@ comment at the start of cc-engine.el for more info." how-far 0)) ((<= good-pos here) (setq strategy 'forward - start-point (max good-pos cache-pos) + start-point (if changed-macro-start + cache-pos + (max good-pos cache-pos)) how-far (- here start-point))) ((< (- good-pos here) (- here cache-pos)) ; FIXME!!! ; apply some sort of weighting. (setq strategy 'backward