aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2014-11-16 00:22:20 -0500
committerStefan Monnier2014-11-16 00:22:20 -0500
commit9075fcc1937a211bc91e8bc49c332bc55ac99e24 (patch)
tree1cff4991107011e0b5d13fac46b0881c30d31a63
parent86009dd5d886f1101358990e4f8f69a5d1467eb8 (diff)
parent4f4cf9c855f5818d4c3c0fb772db8bbcf4f33780 (diff)
downloademacs-9075fcc1937a211bc91e8bc49c332bc55ac99e24.tar.gz
emacs-9075fcc1937a211bc91e8bc49c332bc55ac99e24.zip
Merge from emacs-24
-rw-r--r--.gitignore18
-rw-r--r--ChangeLog19
-rw-r--r--admin/ChangeLog16
-rwxr-xr-xadmin/update_autogen13
-rw-r--r--lisp/ChangeLog36
-rw-r--r--lisp/gnus/ChangeLog4
-rw-r--r--lisp/mail/emacsbug.el17
-rw-r--r--lisp/progmodes/python.el52
-rw-r--r--lisp/version.el4
-rw-r--r--src/ChangeLog24
-rw-r--r--src/nsfns.m23
-rw-r--r--src/nsmenu.m5
-rw-r--r--src/nsterm.m1
-rw-r--r--src/window.c18
-rw-r--r--src/window.h2
-rw-r--r--test/ChangeLog11
-rw-r--r--test/automated/python-tests.el119
17 files changed, 321 insertions, 61 deletions
diff --git a/.gitignore b/.gitignore
index b5483840f3a..1fb7d493177 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,7 @@ autom4te.cache
12makefile 12makefile
13TAGS 13TAGS
14*~ 14*~
15.#*
15/README.W32 16/README.W32
16 17
17/bin/ 18/bin/
@@ -26,6 +27,8 @@ test/biditest.txt
26Makefile 27Makefile
27config.log 28config.log
28config.status 29config.status
30config.cache
31lib-src/blessmail
29lib-src/ctags 32lib-src/ctags
30lib-src/ebrowse 33lib-src/ebrowse
31lib-src/emacsclient 34lib-src/emacsclient
@@ -34,12 +37,18 @@ lib-src/hexl
34lib-src/make-docfile 37lib-src/make-docfile
35lib-src/movemail 38lib-src/movemail
36lib-src/profile 39lib-src/profile
40lib-src/test-distrib
37lib-src/update-game-score 41lib-src/update-game-score
38*.o 42*.o
43*.exe
44*.res
39lib/alloca.h 45lib/alloca.h
40lib/arg-nonnull.h 46lib/arg-nonnull.h
47lib/byteswap.h
41lib/c++defs.h 48lib/c++defs.h
42lib/dirent.h 49lib/dirent.h
50lib/errno.h
51lib/execinfo.h
43lib/fcntl.h 52lib/fcntl.h
44lib/getopt.h 53lib/getopt.h
45lib/inttypes.h 54lib/inttypes.h
@@ -47,6 +56,7 @@ lib/libgnu.a
47lib/signal.h 56lib/signal.h
48lib/stdio.h 57lib/stdio.h
49lib/stdlib.h 58lib/stdlib.h
59lib/stdalign.h
50lib/string.h 60lib/string.h
51lib/sys/ 61lib/sys/
52lib/time.h 62lib/time.h
@@ -55,12 +65,13 @@ lib/warn-on-use.h
55src/bootstrap-emacs 65src/bootstrap-emacs
56src/deps/ 66src/deps/
57src/emacs 67src/emacs
58src/emacs-25.0.50.1 68src/emacs-[0-9]*
59src/emacs-25.0.50.2
60src/gl-stamp 69src/gl-stamp
61src/globals.h 70src/globals.h
62src/stamp-h1 71src/stamp-h1
63src/temacs 72src/temacs
73src/temacs.map
74src/temacs.tmp
64doc/emacs/emacsver.texi 75doc/emacs/emacsver.texi
65doc/man/emacs.1 76doc/man/emacs.1
66etc/refcards/emacsver.tex 77etc/refcards/emacsver.tex
@@ -68,4 +79,5 @@ lib/.deps/
68lisp/international/uni-brackets.el 79lisp/international/uni-brackets.el
69lwlib/deps/ 80lwlib/deps/
70lwlib/liblw.a 81lwlib/liblw.a
71 82leim/changed.misc
83leim/changed.tit
diff --git a/ChangeLog b/ChangeLog
index 6d8543c7884..885be446e8b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
12014-11-16 Christoph Scholtes <cschol2112@gmail.com>
2
3 * .gitignore: Ignore generated file lib/stdalign.h.
4
52014-11-16 Paul Eggert <eggert@cs.ucla.edu>
6
7 Backport fix for minor Bazaar leftovers.
8 * .dir-locals.el: Remove reference to bzr commit --fixes debbugs.
9
102014-11-16 Eli Zaretskii <eliz@gnu.org>
11
12 * .gitignore: Add more ignorables.
13
12014-11-14 Andreas Schwab <schwab@linux-m68k.org> 142014-11-14 Andreas Schwab <schwab@linux-m68k.org>
2 15
3 * Makefile.in (config.status): Don't depend on 16 * Makefile.in (config.status): Don't depend on
@@ -28,8 +41,7 @@
282014-11-13 Lars Magne Ingebrigtsen <larsi@gnus.org> 412014-11-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
29 42
30 * .gitignore: Copy over sufficient ignorable files from the old 43 * .gitignore: Copy over sufficient ignorable files from the old
31 .bzrignore that a simple build doesn't list lots of unregistered 44 .bzrignore that a simple build doesn't list lots of unregistered files.
32 files.
33 45
342014-11-11 Eric S. Raymond <esr@thyrsus.com> 462014-11-11 Eric S. Raymond <esr@thyrsus.com>
35 47
@@ -45,8 +57,7 @@
45 The last CVS commit was 2009-12-27T08:11:12Z!cyd@stupidchicken.com.) 57 The last CVS commit was 2009-12-27T08:11:12Z!cyd@stupidchicken.com.)
46 58
47 Committer/author email addresses are generally correct for the 59 Committer/author email addresses are generally correct for the
48 transition day, not necessarily when the comit was originally 60 transition day, not necessarily when the comit was originally made.
49 made.
50 61
512014-11-10 Glenn Morris <rgm@gnu.org> 622014-11-10 Glenn Morris <rgm@gnu.org>
52 63
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 900da6aefa4..96a98e56109 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,9 @@
12014-11-16 Glenn Morris <rgm@gnu.org>
2
3 * update_autogen: Auto-detect VCS in use.
4 (vcs): New variable.
5 (status, commit, main): Handle git.
6
12014-11-13 Andreas Schwab <schwab@suse.de> 72014-11-13 Andreas Schwab <schwab@suse.de>
2 8
3 * make-tarball.txt: Make annotated tag and push it out. 9 * make-tarball.txt: Make annotated tag and push it out.
@@ -10,8 +16,8 @@
10 16
112014-11-10 Eli Zaretskii <eliz@gnu.org> 172014-11-10 Eli Zaretskii <eliz@gnu.org>
12 18
13 * unidata/Makefile.in (${top_srcdir}/src/macuvs.h): Use 19 * unidata/Makefile.in (${top_srcdir}/src/macuvs.h):
14 unmsys--file-name. (Bug#18955) 20 Use unmsys--file-name. (Bug#18955)
15 21
162014-11-10 Glenn Morris <rgm@gnu.org> 222014-11-10 Glenn Morris <rgm@gnu.org>
17 23
@@ -28,7 +34,7 @@
28 34
29 * grammars/c.by (template-type): Add :template-specifier and 35 * grammars/c.by (template-type): Add :template-specifier and
30 :typevar to capture extra details about the template. 36 :typevar to capture extra details about the template.
31 (opt-post-fcn-modifiers): Splice in the found symbol into the 37 (opt-post-fcn-modifiers): Splice in the found symbol into the
32 return value correctly. 38 return value correctly.
33 (QUESTION): New punctuation. 39 (QUESTION): New punctuation.
34 (expression): Add ternary conditional support. 40 (expression): Add ternary conditional support.
@@ -36,8 +42,8 @@
36 * grammars/scheme.by (MODULE): New token. 42 * grammars/scheme.by (MODULE): New token.
37 (scheme): Handle expanding the MODULE tag. 43 (scheme): Handle expanding the MODULE tag.
38 (scheme-list): Remove closeparen required match. 44 (scheme-list): Remove closeparen required match.
39 (scheme-in-list): Remove extraneous matches for DEFINE. Add 45 (scheme-in-list): Remove extraneous matches for DEFINE.
40 support for MODULE Simplify matching for code & make work. 46 Add support for MODULE Simplify matching for code & make work.
41 (name-args, name-arg-list, name-arg-expand): Make it work. 47 (name-args, name-arg-list, name-arg-expand): Make it work.
42 48
432014-11-09 David Engster <dengste@eml.cc> 492014-11-09 David Engster <dengste@eml.cc>
diff --git a/admin/update_autogen b/admin/update_autogen
index 8b0ae67028a..4c4f52e2d2d 100755
--- a/admin/update_autogen
+++ b/admin/update_autogen
@@ -47,7 +47,9 @@ cd $PD
47cd ../ 47cd ../
48[ -d admin ] || die "Could not locate admin directory" 48[ -d admin ] || die "Could not locate admin directory"
49 49
50if [ -d .git ]; then 50if [ -d .bzr ]; then
51 vcs=bzr
52elif [ -d .git ]; then
51 vcs=git 53 vcs=git
52else 54else
53 die "Cannot determine vcs" 55 die "Cannot determine vcs"
@@ -303,6 +305,9 @@ EOF
303 305
304 modified=$(status $basegen) || die 306 modified=$(status $basegen) || die
305 307
308 ## bzr status output is always relative to top-level, not PWD.
309 [ "$vcs" = "bzr" ] && cd $oldpwd
310
306 commit "generated" $modified || die "commit error" 311 commit "generated" $modified || die "commit error"
307 312
308 exit 0 313 exit 0
@@ -374,7 +379,11 @@ echo "Checking status of loaddef files..."
374## It probably would be fine to just check+commit lisp/, since 379## It probably would be fine to just check+commit lisp/, since
375## making autoloads should not effect any other files. But better 380## making autoloads should not effect any other files. But better
376## safe than sorry. 381## safe than sorry.
377modified=$(status $genfiles $ldefs_out) || die 382modified=$(status $genfiles ${ldefs_out#lisp/}) || die
383
384
385## bzr status output is always relative to top-level, not PWD.
386[ "$vcs" = "bzr" ] && cd ../
378 387
379 388
380commit "loaddefs" $modified || die "commit error" 389commit "loaddefs" $modified || die "commit error"
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 634412ec989..42de048e429 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,6 +1,26 @@
12014-11-16 Andreas Schwab <schwab@linux-m68k.org>
2
3 * version.el (emacs-repository-get-version): Use git rev-parse
4 instead of git log.
5
62014-11-16 Fabián Ezequiel Gallina <fgallina@gnu.org>
7
8 * progmodes/python.el (python-indent-calculate-levels):
9 Fix indentation behavior multiline dedenter statement. (Bug#18432)
10
112014-11-16 Fabián Ezequiel Gallina <fgallina@gnu.org>
12
13 * progmodes/python.el (python-indent-region):
14 Use python-indent-line and skip special cases. (Bug#18843)
15
162014-11-16 Peder O. Klingenberg <peder@klingenberg.no> (tiny change)
17
18 * mail/emacsbug.el (report-emacs-bug): Make a better guess at
19 envelope-from when reporting through sendmail (bug#19054).
20
12014-11-16 Stefan Monnier <monnier@iro.umontreal.ca> 212014-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
2 22
3 * emacs-lisp/backquote.el (backquote-process): Optimize away the ,' case. 23 * emacs-lisp/backquote.el (backquote-process): Optimize away ",'".
4 24
52014-11-15 Lars Magne Ingebrigtsen <larsi@gnus.org> 252014-11-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
6 26
@@ -94,13 +114,13 @@
94 114
952014-11-10 Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com> 1152014-11-10 Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com>
96 116
97 * net/eww.el(eww-form-file(defface)): New defface of file upload form. 117 * net/eww.el(eww-form-file(defface)): New defface of file upload form.
98 (eww-submit-file): New key map of file upload. 118 (eww-submit-file): New key map of file upload.
99 (eww-form-file): New file upload button and file name context. 119 (eww-form-file): New file upload button and file name context.
100 (eww-select-file): Select file and display selected file name. 120 (eww-select-file): Select file and display selected file name.
101 (eww-tag-input): Handle input tag of file type. 121 (eww-tag-input): Handle input tag of file type.
102 (eww-update-field): Add point offset. 122 (eww-update-field): Add point offset.
103 (eww-submit): Add submit with multipart/form-data. 123 (eww-submit): Add submit with multipart/form-data.
104 124
1052014-11-10 Lars Magne Ingebrigtsen <larsi@gnus.org> 1252014-11-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
106 126
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index e107dbd3b5a..1d9b1465fa5 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,7 @@
12014-11-16 Adam Sjøgren <asjo@koldfront.dk>
2
3 * mml2015.el (mml2015-display-key-image): New variable.
4
12014-11-14 Lars Magne Ingebrigtsen <larsi@gnus.org> 52014-11-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 6
3 * gnus-sum.el (gnus-summary-exit-no-update): Don't query about 7 * gnus-sum.el (gnus-summary-exit-no-update): Don't query about
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index 4e3eb324e59..5dde90b9fe4 100644
--- a/lisp/mail/emacsbug.el
+++ b/lisp/mail/emacsbug.el
@@ -137,6 +137,12 @@ This requires either the OS X \"open\" command, or the freedesktop
137 (concat "mailto:" to))) 137 (concat "mailto:" to)))
138 (error "Subject, To or body not found"))))) 138 (error "Subject, To or body not found")))))
139 139
140;; It's the default mail mode, so it seems OK to use its features.
141(autoload 'message-bogus-recipient-p "message")
142(autoload 'message-make-address "message")
143(defvar message-send-mail-function)
144(defvar message-sendmail-envelope-from)
145
140;;;###autoload 146;;;###autoload
141(defun report-emacs-bug (topic &optional unused) 147(defun report-emacs-bug (topic &optional unused)
142 "Report a bug in GNU Emacs. 148 "Report a bug in GNU Emacs.
@@ -164,7 +170,12 @@ Prompts for bug subject. Leaves you in a mail buffer."
164 ;; that report-emacs-bug-orig-text remains valid. (Bug#5178) 170 ;; that report-emacs-bug-orig-text remains valid. (Bug#5178)
165 (message-sort-headers) 171 (message-sort-headers)
166 ;; Stop message-mode stealing the properties we will add. 172 ;; Stop message-mode stealing the properties we will add.
167 (set (make-local-variable 'message-strip-special-text-properties) nil)) 173 (set (make-local-variable 'message-strip-special-text-properties) nil)
174 ;; Make sure we default to the From: address as envelope when sending
175 ;; through sendmail.
176 (when (and (not message-sendmail-envelope-from)
177 (message-bogus-recipient-p (message-make-address)))
178 (set (make-local-variable 'message-sendmail-envelope-from) 'header)))
168 (rfc822-goto-eoh) 179 (rfc822-goto-eoh)
169 (forward-line 1) 180 (forward-line 1)
170 ;; Move the mail signature to the proper place. 181 ;; Move the mail signature to the proper place.
@@ -346,10 +357,6 @@ usually do not have translators for other languages.\n\n")))
346 357
347(define-obsolete-function-alias 'report-emacs-bug-info 'info-emacs-bug "24.3") 358(define-obsolete-function-alias 'report-emacs-bug-info 'info-emacs-bug "24.3")
348 359
349;; It's the default mail mode, so it seems OK to use its features.
350(autoload 'message-bogus-recipient-p "message")
351(defvar message-send-mail-function)
352
353(defun report-emacs-bug-hook () 360(defun report-emacs-bug-hook ()
354 "Do some checking before sending a bug report." 361 "Do some checking before sending a bug report."
355 (save-excursion 362 (save-excursion
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 961aebeeecd..7ed218c7c98 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -964,7 +964,11 @@ START is the buffer position where the sexp starts."
964 964
965(defun python-indent-calculate-levels () 965(defun python-indent-calculate-levels ()
966 "Calculate `python-indent-levels' and reset `python-indent-current-level'." 966 "Calculate `python-indent-levels' and reset `python-indent-current-level'."
967 (if (not (python-info-dedenter-statement-p)) 967 (if (or (python-info-continuation-line-p)
968 (not (python-info-dedenter-statement-p)))
969 ;; XXX: This asks for a refactor. Even if point is on a
970 ;; dedenter statement, it could be multiline and in that case
971 ;; the continuation lines should be indented with normal rules.
968 (let* ((indentation (python-indent-calculate-indentation)) 972 (let* ((indentation (python-indent-calculate-indentation))
969 (remainder (% indentation python-indent-offset)) 973 (remainder (% indentation python-indent-offset))
970 (steps (/ (- indentation remainder) python-indent-offset))) 974 (steps (/ (- indentation remainder) python-indent-offset)))
@@ -1070,24 +1074,34 @@ Called from a program, START and END specify the region to indent."
1070 (or (bolp) (forward-line 1)) 1074 (or (bolp) (forward-line 1))
1071 (while (< (point) end) 1075 (while (< (point) end)
1072 (or (and (bolp) (eolp)) 1076 (or (and (bolp) (eolp))
1073 (let (word) 1077 (when (and
1074 (forward-line -1) 1078 ;; Skip if previous line is empty or a comment.
1075 (back-to-indentation) 1079 (save-excursion
1076 (setq word (current-word)) 1080 (let ((line-is-comment-p
1077 (forward-line 1) 1081 (python-info-current-line-comment-p)))
1078 (when (and word 1082 (forward-line -1)
1079 ;; Don't mess with strings, unless it's the 1083 (not
1080 ;; enclosing set of quotes. 1084 (or (and (python-info-current-line-comment-p)
1081 (or (not (python-syntax-context 'string)) 1085 ;; Unless this line is a comment too.
1082 (eq 1086 (not line-is-comment-p))
1083 (syntax-after 1087 (python-info-current-line-empty-p)))))
1084 (+ (1- (point)) 1088 ;; Don't mess with strings, unless it's the
1085 (current-indentation) 1089 ;; enclosing set of quotes.
1086 (python-syntax-count-quotes (char-after) (point)))) 1090 (or (not (python-syntax-context 'string))
1087 (string-to-syntax "|")))) 1091 (eq
1088 (beginning-of-line) 1092 (syntax-after
1089 (delete-horizontal-space) 1093 (+ (1- (point))
1090 (indent-to (python-indent-calculate-indentation))))) 1094 (current-indentation)
1095 (python-syntax-count-quotes (char-after) (point))))
1096 (string-to-syntax "|")))
1097 ;; Skip if current line is a block start, a
1098 ;; dedenter or block ender.
1099 (save-excursion
1100 (back-to-indentation)
1101 (not (looking-at
1102 (python-rx
1103 (or block-start dedenter block-ender))))))
1104 (python-indent-line)))
1091 (forward-line 1)) 1105 (forward-line 1))
1092 (move-marker end nil)))) 1106 (move-marker end nil))))
1093 1107
diff --git a/lisp/version.el b/lisp/version.el
index 1ea38da9cae..cab2d28db4c 100644
--- a/lisp/version.el
+++ b/lisp/version.el
@@ -187,8 +187,8 @@ only ask the VCS if we cannot find any information ourselves."
187 (let ((default-directory (file-name-as-directory dir))) 187 (let ((default-directory (file-name-as-directory dir)))
188 (and (eq 0 188 (and (eq 0
189 (condition-case nil 189 (condition-case nil
190 (call-process "git" nil '(t nil) nil "log" 190 (call-process "git" nil '(t nil) nil "rev-parse"
191 "-1" "--pretty=format:%H") 191 "HEAD")
192 (error nil))) 192 (error nil)))
193 (not (zerop (buffer-size))) 193 (not (zerop (buffer-size)))
194 (replace-regexp-in-string "\n" "" (buffer-string)))))))) 194 (replace-regexp-in-string "\n" "" (buffer-string))))))))
diff --git a/src/ChangeLog b/src/ChangeLog
index cf352183414..7bb16668406 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,22 @@
12014-11-16 Eli Zaretskii <eliz@gnu.org>
2
3 * window.c (window_scroll_pixel_based): Avoid truncation/rounding
4 errors in computing the number of pixels to scroll. Suggested by
5 Kelly Dean <kelly@prtime.org>. (Bug#19060)
6
72014-11-16 Jan Djärv <jan.h.d@swipnet.se>
8
9 * nsmenu.m (update_frame_tool_bar): If tool bar changes height,
10 call updateFrameSize.
11
12 * nsterm.m (setFrame:): Remove call to display (Bug#18757).
13
142014-11-16 Jan Djärv <jan.h.d@swipnet.se>
15
16 * nsfns.m (x_set_foreground_color, x_set_background_color)
17 (x_set_cursor_color, Fxw_color_values): Block/unblock input,
18 use SET_FRAME_GARBAGED instead of redraw_frame (Bug#19036).
19
12014-11-15 Jan Djärv <jan.h.d@swipnet.se> 202014-11-15 Jan Djärv <jan.h.d@swipnet.se>
2 21
3 * nsterm.m (ns_send_appdefined): Check for application defined 22 * nsterm.m (ns_send_appdefined): Check for application defined
@@ -6,7 +25,7 @@
6 25
72014-11-14 David Reitter <david.reitter@gmail.com> 262014-11-14 David Reitter <david.reitter@gmail.com>
8 27
9 * nsterm.m (run): set timeout for event loop to prevent hang. 28 * nsterm.m (run): Set timeout for event loop to prevent hang.
10 (Bug#18993) 29 (Bug#18993)
11 30
122014-11-14 Paul Eggert <eggert@cs.ucla.edu> 312014-11-14 Paul Eggert <eggert@cs.ucla.edu>
@@ -2856,8 +2875,7 @@
2856 Consider horizontal scroll bar. 2875 Consider horizontal scroll bar.
2857 (check_frame_size, adjust_window_margins): Remove functions and 2876 (check_frame_size, adjust_window_margins): Remove functions and
2858 corresponding calls. 2877 corresponding calls.
2859 (set_window_buffer): Initialize old_pointm and horizontal scroll 2878 (set_window_buffer): Initialize old_pointm and horizontal scroll bars.
2860 bars.
2861 (temp_output_buffer_show): Reset hscroll related fields. 2879 (temp_output_buffer_show): Reset hscroll related fields.
2862 Initialize old_pointm. 2880 Initialize old_pointm.
2863 (make_parent_window): Initialize old_pointm. 2881 (make_parent_window): Initialize old_pointm.
diff --git a/src/nsfns.m b/src/nsfns.m
index c4b273c3bf5..4f158f4c51e 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -280,9 +280,14 @@ x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
280 NSColor *col; 280 NSColor *col;
281 EmacsCGFloat r, g, b, alpha; 281 EmacsCGFloat r, g, b, alpha;
282 282
283 /* Must block_input, because ns_lisp_to_color does block/unblock_input
284 which means that col may be deallocated in its unblock_input if there
285 is user input, unless we also block_input. */
286 block_input ();
283 if (ns_lisp_to_color (arg, &col)) 287 if (ns_lisp_to_color (arg, &col))
284 { 288 {
285 store_frame_param (f, Qforeground_color, oldval); 289 store_frame_param (f, Qforeground_color, oldval);
290 unblock_input ();
286 error ("Unknown color"); 291 error ("Unknown color");
287 } 292 }
288 293
@@ -299,8 +304,9 @@ x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
299 update_face_from_frame_parameter (f, Qforeground_color, arg); 304 update_face_from_frame_parameter (f, Qforeground_color, arg);
300 /*recompute_basic_faces (f); */ 305 /*recompute_basic_faces (f); */
301 if (FRAME_VISIBLE_P (f)) 306 if (FRAME_VISIBLE_P (f))
302 redraw_frame (f); 307 SET_FRAME_GARBAGED (f);
303 } 308 }
309 unblock_input ();
304} 310}
305 311
306 312
@@ -312,9 +318,11 @@ x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
312 NSView *view = FRAME_NS_VIEW (f); 318 NSView *view = FRAME_NS_VIEW (f);
313 EmacsCGFloat r, g, b, alpha; 319 EmacsCGFloat r, g, b, alpha;
314 320
321 block_input ();
315 if (ns_lisp_to_color (arg, &col)) 322 if (ns_lisp_to_color (arg, &col))
316 { 323 {
317 store_frame_param (f, Qbackground_color, oldval); 324 store_frame_param (f, Qbackground_color, oldval);
325 unblock_input ();
318 error ("Unknown color"); 326 error ("Unknown color");
319 } 327 }
320 328
@@ -351,8 +359,9 @@ x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
351 } 359 }
352 360
353 if (FRAME_VISIBLE_P (f)) 361 if (FRAME_VISIBLE_P (f))
354 redraw_frame (f); 362 SET_FRAME_GARBAGED (f);
355 } 363 }
364 unblock_input ();
356} 365}
357 366
358 367
@@ -361,9 +370,11 @@ x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
361{ 370{
362 NSColor *col; 371 NSColor *col;
363 372
373 block_input ();
364 if (ns_lisp_to_color (arg, &col)) 374 if (ns_lisp_to_color (arg, &col))
365 { 375 {
366 store_frame_param (f, Qcursor_color, oldval); 376 store_frame_param (f, Qcursor_color, oldval);
377 unblock_input ();
367 error ("Unknown color"); 378 error ("Unknown color");
368 } 379 }
369 380
@@ -376,6 +387,7 @@ x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
376 x_update_cursor (f, 1); 387 x_update_cursor (f, 1);
377 } 388 }
378 update_face_from_frame_parameter (f, Qcursor_color, arg); 389 update_face_from_frame_parameter (f, Qcursor_color, arg);
390 unblock_input ();
379} 391}
380 392
381 393
@@ -2331,11 +2343,16 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0,
2331 check_window_system (NULL); 2343 check_window_system (NULL);
2332 CHECK_STRING (color); 2344 CHECK_STRING (color);
2333 2345
2346 block_input ();
2334 if (ns_lisp_to_color (color, &col)) 2347 if (ns_lisp_to_color (color, &col))
2335 return Qnil; 2348 {
2349 unblock_input ();
2350 return Qnil;
2351 }
2336 2352
2337 [[col colorUsingDefaultColorSpace] 2353 [[col colorUsingDefaultColorSpace]
2338 getRed: &red green: &green blue: &blue alpha: &alpha]; 2354 getRed: &red green: &green blue: &blue alpha: &alpha];
2355 unblock_input ();
2339 return list3i (lrint (red * 65280), lrint (green * 65280), 2356 return list3i (lrint (red * 65280), lrint (green * 65280),
2340 lrint (blue * 65280)); 2357 lrint (blue * 65280));
2341} 2358}
diff --git a/src/nsmenu.m b/src/nsmenu.m
index a90cb970874..0e8b68b38f1 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -1026,10 +1026,13 @@ update_frame_tool_bar (struct frame *f)
1026 EmacsView *view = FRAME_NS_VIEW (f); 1026 EmacsView *view = FRAME_NS_VIEW (f);
1027 NSWindow *window = [view window]; 1027 NSWindow *window = [view window];
1028 EmacsToolbar *toolbar = [view toolbar]; 1028 EmacsToolbar *toolbar = [view toolbar];
1029 int oldh;
1029 1030
1030 if (view == nil || toolbar == nil) return; 1031 if (view == nil || toolbar == nil) return;
1031 block_input (); 1032 block_input ();
1032 1033
1034 oldh = FRAME_TOOLBAR_HEIGHT (f);
1035
1033#ifdef NS_IMPL_COCOA 1036#ifdef NS_IMPL_COCOA
1034 [toolbar clearActive]; 1037 [toolbar clearActive];
1035#else 1038#else
@@ -1136,6 +1139,8 @@ update_frame_tool_bar (struct frame *f)
1136 if (FRAME_TOOLBAR_HEIGHT (f) < 0) // happens if frame is fullscreen. 1139 if (FRAME_TOOLBAR_HEIGHT (f) < 0) // happens if frame is fullscreen.
1137 FRAME_TOOLBAR_HEIGHT (f) = 0; 1140 FRAME_TOOLBAR_HEIGHT (f) = 0;
1138 1141
1142 if (oldh != FRAME_TOOLBAR_HEIGHT (f))
1143 [view updateFrameSize:YES];
1139 if (view->wait_for_tool_bar && FRAME_TOOLBAR_HEIGHT (f) > 0) 1144 if (view->wait_for_tool_bar && FRAME_TOOLBAR_HEIGHT (f) > 0)
1140 { 1145 {
1141 view->wait_for_tool_bar = NO; 1146 view->wait_for_tool_bar = NO;
diff --git a/src/nsterm.m b/src/nsterm.m
index c36b9ed4554..8729fa55a92 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -7213,7 +7213,6 @@ if (cols > 0 && rows > 0)
7213 if (pixel_height == 0) pixel_height = 1; 7213 if (pixel_height == 0) pixel_height = 1;
7214 min_portion = 20 / pixel_height; 7214 min_portion = 20 / pixel_height;
7215 [super setFrame: newRect]; 7215 [super setFrame: newRect];
7216 [self display];
7217/* unblock_input (); */ 7216/* unblock_input (); */
7218} 7217}
7219 7218
diff --git a/src/window.c b/src/window.c
index e4ff2b41806..7c2b3ca29d2 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4950,9 +4950,14 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
4950 { 4950 {
4951 int px; 4951 int px;
4952 int dy = frame_line_height; 4952 int dy = frame_line_height;
4953 /* In the below we divide the window box height by the
4954 frame's line height to make the result predictable when
4955 the window box is not an integral multiple of the line
4956 height. This is important to ensure we get back to the
4957 same position when scrolling up, then down. */
4953 if (whole) 4958 if (whole)
4954 dy = max ((window_box_height (w) 4959 dy = max ((window_box_height (w) / dy
4955 - next_screen_context_lines * dy), 4960 - next_screen_context_lines) * dy,
4956 dy); 4961 dy);
4957 dy *= n; 4962 dy *= n;
4958 4963
@@ -5034,9 +5039,12 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
5034 { 5039 {
5035 ptrdiff_t start_pos = IT_CHARPOS (it); 5040 ptrdiff_t start_pos = IT_CHARPOS (it);
5036 int dy = frame_line_height; 5041 int dy = frame_line_height;
5037 5042 /* In the below we divide the window box height by the frame's
5038 dy = max ((window_box_height (w) 5043 line height to make the result predictable when the window
5039 - next_screen_context_lines * dy), 5044 box is not an integral multiple of the line height. This is
5045 important to ensure we get back to the same position when
5046 scrolling up, then down. */
5047 dy = max ((window_box_height (w) / dy - next_screen_context_lines) * dy,
5040 dy) * n; 5048 dy) * n;
5041 5049
5042 /* Note that move_it_vertically always moves the iterator to the 5050 /* Note that move_it_vertically always moves the iterator to the
diff --git a/src/window.h b/src/window.h
index ea5dddc9fc8..4e4c65b83e6 100644
--- a/src/window.h
+++ b/src/window.h
@@ -519,7 +519,7 @@ wset_next_buffers (struct window *w, Lisp_Object val)
519#define WINDOW_FRAME_COLUMN_WIDTH(W) \ 519#define WINDOW_FRAME_COLUMN_WIDTH(W) \
520 (FRAME_COLUMN_WIDTH (WINDOW_XFRAME ((W)))) 520 (FRAME_COLUMN_WIDTH (WINDOW_XFRAME ((W))))
521 521
522/* Return the canonical column width of the frame of window W. */ 522/* Return the canonical line height of the frame of window W. */
523#define WINDOW_FRAME_LINE_HEIGHT(W) \ 523#define WINDOW_FRAME_LINE_HEIGHT(W) \
524 (FRAME_LINE_HEIGHT (WINDOW_XFRAME ((W)))) 524 (FRAME_LINE_HEIGHT (WINDOW_XFRAME ((W))))
525 525
diff --git a/test/ChangeLog b/test/ChangeLog
index 48e01ca973a..a09c6f78fc7 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,14 @@
12014-11-16 Fabián Ezequiel Gallina <fgallina@gnu.org>
2
3 * automated/python-tests.el (python-indent-dedenters-8): New test
4 for Bug#18432.
5
62014-11-16 Fabián Ezequiel Gallina <fgallina@gnu.org>
7
8 * automated/python-tests.el (python-indent-region-1)
9 (python-indent-region-2, python-indent-region-3)
10 (python-indent-region-4, python-indent-region-5): New tests.
11
12014-11-08 Stefan Monnier <monnier@iro.umontreal.ca> 122014-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2 13
3 * automated/bytecomp-tests.el (bytecomp-tests--warnings): New tests. 14 * automated/bytecomp-tests.el (bytecomp-tests--warnings): New tests.
diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el
index 39195fd7086..f368f995cae 100644
--- a/test/automated/python-tests.el
+++ b/test/automated/python-tests.el
@@ -711,6 +711,21 @@ if a:
711 (should (= (python-indent-calculate-indentation) 0)) 711 (should (= (python-indent-calculate-indentation) 0))
712 (should (equal (python-indent-calculate-levels) '(0))))) 712 (should (equal (python-indent-calculate-levels) '(0)))))
713 713
714(ert-deftest python-indent-dedenters-8 ()
715 "Test indentation for Bug#18432."
716 (python-tests-with-temp-buffer
717 "
718if (a == 1 or
719 a == 2):
720 pass
721elif (a == 3 or
722a == 4):
723"
724 (python-tests-look-at "a == 4):\n")
725 (should (eq (car (python-indent-context)) 'inside-paren))
726 (should (= (python-indent-calculate-indentation) 6))
727 (should (equal (python-indent-calculate-levels) '(0 4 6)))))
728
714(ert-deftest python-indent-electric-colon-1 () 729(ert-deftest python-indent-electric-colon-1 ()
715 "Test indentation case from Bug#18228." 730 "Test indentation case from Bug#18228."
716 (python-tests-with-temp-buffer 731 (python-tests-with-temp-buffer
@@ -725,6 +740,110 @@ def b()
725 (python-tests-self-insert ":") 740 (python-tests-self-insert ":")
726 (should (= (current-indentation) 0)))) 741 (should (= (current-indentation) 0))))
727 742
743(ert-deftest python-indent-region-1 ()
744 "Test indentation case from Bug#18843."
745 (let ((contents "
746def foo ():
747 try:
748 pass
749 except:
750 pass
751"))
752 (python-tests-with-temp-buffer
753 contents
754 (python-indent-region (point-min) (point-max))
755 (should (string= (buffer-substring-no-properties (point-min) (point-max))
756 contents)))))
757
758(ert-deftest python-indent-region-2 ()
759 "Test region indentation on comments."
760 (let ((contents "
761def f():
762 if True:
763 pass
764
765# This is
766# some multiline
767# comment
768"))
769 (python-tests-with-temp-buffer
770 contents
771 (python-indent-region (point-min) (point-max))
772 (should (string= (buffer-substring-no-properties (point-min) (point-max))
773 contents)))))
774
775(ert-deftest python-indent-region-3 ()
776 "Test region indentation on comments."
777 (let ((contents "
778def f():
779 if True:
780 pass
781# This is
782# some multiline
783# comment
784")
785 (expected "
786def f():
787 if True:
788 pass
789 # This is
790 # some multiline
791 # comment
792"))
793 (python-tests-with-temp-buffer
794 contents
795 (python-indent-region (point-min) (point-max))
796 (should (string= (buffer-substring-no-properties (point-min) (point-max))
797 expected)))))
798
799(ert-deftest python-indent-region-4 ()
800 "Test region indentation block starts, dedenders and enders."
801 (let ((contents "
802def f():
803 if True:
804a = 5
805 else:
806 a = 10
807 return a
808")
809 (expected "
810def f():
811 if True:
812 a = 5
813 else:
814 a = 10
815 return a
816"))
817 (python-tests-with-temp-buffer
818 contents
819 (python-indent-region (point-min) (point-max))
820 (should (string= (buffer-substring-no-properties (point-min) (point-max))
821 expected)))))
822
823(ert-deftest python-indent-region-5 ()
824 "Test region indentation leaves strings untouched (start delimiter)."
825 (let ((contents "
826def f():
827'''
828this is
829a multiline
830string
831'''
832")
833 (expected "
834def f():
835 '''
836this is
837a multiline
838string
839'''
840"))
841 (python-tests-with-temp-buffer
842 contents
843 (python-indent-region (point-min) (point-max))
844 (should (string= (buffer-substring-no-properties (point-min) (point-max))
845 expected)))))
846
728 847
729;;; Navigation 848;;; Navigation
730 849