summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
makefile
TAGS
*~
+.#*
/README.W32
/bin/
@@ -26,6 +27,8 @@ test/biditest.txt
Makefile
config.log
config.status
+config.cache
+lib-src/blessmail
lib-src/ctags
lib-src/ebrowse
lib-src/emacsclient
@@ -34,12 +37,18 @@ lib-src/hexl
lib-src/make-docfile
lib-src/movemail
lib-src/profile
+lib-src/test-distrib
lib-src/update-game-score
*.o
+*.exe
+*.res
lib/alloca.h
lib/arg-nonnull.h
+lib/byteswap.h
lib/c++defs.h
lib/dirent.h
+lib/errno.h
+lib/execinfo.h
lib/fcntl.h
lib/getopt.h
lib/inttypes.h
@@ -47,6 +56,7 @@ lib/libgnu.a
lib/signal.h
lib/stdio.h
lib/stdlib.h
+lib/stdalign.h
lib/string.h
lib/sys/
lib/time.h
@@ -55,12 +65,13 @@ lib/warn-on-use.h
src/bootstrap-emacs
src/deps/
src/emacs
-src/emacs-25.0.50.1
-src/emacs-25.0.50.2
+src/emacs-[0-9]*
src/gl-stamp
src/globals.h
src/stamp-h1
src/temacs
+src/temacs.map
+src/temacs.tmp
doc/emacs/emacsver.texi
doc/man/emacs.1
etc/refcards/emacsver.tex
@@ -68,4 +79,5 @@ lib/.deps/
lisp/international/uni-brackets.el
lwlib/deps/
lwlib/liblw.a
-
+leim/changed.misc
+leim/changed.tit
diff --git a/ChangeLog b/ChangeLog
index 6d8543c7884..885be446e8b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2014-11-16 Christoph Scholtes <cschol2112@gmail.com>
+
+ * .gitignore: Ignore generated file lib/stdalign.h.
+
+2014-11-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ Backport fix for minor Bazaar leftovers.
+ * .dir-locals.el: Remove reference to bzr commit --fixes debbugs.
+
+2014-11-16 Eli Zaretskii <eliz@gnu.org>
+
+ * .gitignore: Add more ignorables.
+
2014-11-14 Andreas Schwab <schwab@linux-m68k.org>
* Makefile.in (config.status): Don't depend on
@@ -28,8 +41,7 @@
2014-11-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
* .gitignore: Copy over sufficient ignorable files from the old
- .bzrignore that a simple build doesn't list lots of unregistered
- files.
+ .bzrignore that a simple build doesn't list lots of unregistered files.
2014-11-11 Eric S. Raymond <esr@thyrsus.com>
@@ -45,8 +57,7 @@
The last CVS commit was 2009-12-27T08:11:12Z!cyd@stupidchicken.com.)
Committer/author email addresses are generally correct for the
- transition day, not necessarily when the comit was originally
- made.
+ transition day, not necessarily when the comit was originally made.
2014-11-10 Glenn Morris <rgm@gnu.org>
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 900da6aefa4..96a98e56109 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,9 @@
+2014-11-16 Glenn Morris <rgm@gnu.org>
+
+ * update_autogen: Auto-detect VCS in use.
+ (vcs): New variable.
+ (status, commit, main): Handle git.
+
2014-11-13 Andreas Schwab <schwab@suse.de>
* make-tarball.txt: Make annotated tag and push it out.
@@ -10,8 +16,8 @@
2014-11-10 Eli Zaretskii <eliz@gnu.org>
- * unidata/Makefile.in (${top_srcdir}/src/macuvs.h): Use
- unmsys--file-name. (Bug#18955)
+ * unidata/Makefile.in (${top_srcdir}/src/macuvs.h):
+ Use unmsys--file-name. (Bug#18955)
2014-11-10 Glenn Morris <rgm@gnu.org>
@@ -28,7 +34,7 @@
* grammars/c.by (template-type): Add :template-specifier and
:typevar to capture extra details about the template.
- (opt-post-fcn-modifiers): Splice in the found symbol into the
+ (opt-post-fcn-modifiers): Splice in the found symbol into the
return value correctly.
(QUESTION): New punctuation.
(expression): Add ternary conditional support.
@@ -36,8 +42,8 @@
* grammars/scheme.by (MODULE): New token.
(scheme): Handle expanding the MODULE tag.
(scheme-list): Remove closeparen required match.
- (scheme-in-list): Remove extraneous matches for DEFINE. Add
- support for MODULE Simplify matching for code & make work.
+ (scheme-in-list): Remove extraneous matches for DEFINE.
+ Add support for MODULE Simplify matching for code & make work.
(name-args, name-arg-list, name-arg-expand): Make it work.
2014-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
cd ../
[ -d admin ] || die "Could not locate admin directory"
-if [ -d .git ]; then
+if [ -d .bzr ]; then
+ vcs=bzr
+elif [ -d .git ]; then
vcs=git
else
die "Cannot determine vcs"
@@ -303,6 +305,9 @@ EOF
modified=$(status $basegen) || die
+ ## bzr status output is always relative to top-level, not PWD.
+ [ "$vcs" = "bzr" ] && cd $oldpwd
+
commit "generated" $modified || die "commit error"
exit 0
@@ -374,7 +379,11 @@ echo "Checking status of loaddef files..."
## It probably would be fine to just check+commit lisp/, since
## making autoloads should not effect any other files. But better
## safe than sorry.
-modified=$(status $genfiles $ldefs_out) || die
+modified=$(status $genfiles ${ldefs_out#lisp/}) || die
+
+
+## bzr status output is always relative to top-level, not PWD.
+[ "$vcs" = "bzr" ] && cd ../
commit "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 @@
+2014-11-16 Andreas Schwab <schwab@linux-m68k.org>
+
+ * version.el (emacs-repository-get-version): Use git rev-parse
+ instead of git log.
+
+2014-11-16 Fabián Ezequiel Gallina <fgallina@gnu.org>
+
+ * progmodes/python.el (python-indent-calculate-levels):
+ Fix indentation behavior multiline dedenter statement. (Bug#18432)
+
+2014-11-16 Fabián Ezequiel Gallina <fgallina@gnu.org>
+
+ * progmodes/python.el (python-indent-region):
+ Use python-indent-line and skip special cases. (Bug#18843)
+
+2014-11-16 Peder O. Klingenberg <peder@klingenberg.no> (tiny change)
+
+ * mail/emacsbug.el (report-emacs-bug): Make a better guess at
+ envelope-from when reporting through sendmail (bug#19054).
+
2014-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
- * emacs-lisp/backquote.el (backquote-process): Optimize away the ,' case.
+ * emacs-lisp/backquote.el (backquote-process): Optimize away ",'".
2014-11-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -94,13 +114,13 @@
2014-11-10 Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com>
- * net/eww.el(eww-form-file(defface)): New defface of file upload form.
- (eww-submit-file): New key map of file upload.
- (eww-form-file): New file upload button and file name context.
- (eww-select-file): Select file and display selected file name.
- (eww-tag-input): Handle input tag of file type.
- (eww-update-field): Add point offset.
- (eww-submit): Add submit with multipart/form-data.
+ * net/eww.el(eww-form-file(defface)): New defface of file upload form.
+ (eww-submit-file): New key map of file upload.
+ (eww-form-file): New file upload button and file name context.
+ (eww-select-file): Select file and display selected file name.
+ (eww-tag-input): Handle input tag of file type.
+ (eww-update-field): Add point offset.
+ (eww-submit): Add submit with multipart/form-data.
2014-11-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
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 @@
+2014-11-16 Adam Sjøgren <asjo@koldfront.dk>
+
+ * mml2015.el (mml2015-display-key-image): New variable.
+
2014-11-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
* 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
(concat "mailto:" to)))
(error "Subject, To or body not found")))))
+;; It's the default mail mode, so it seems OK to use its features.
+(autoload 'message-bogus-recipient-p "message")
+(autoload 'message-make-address "message")
+(defvar message-send-mail-function)
+(defvar message-sendmail-envelope-from)
+
;;;###autoload
(defun report-emacs-bug (topic &optional unused)
"Report a bug in GNU Emacs.
@@ -164,7 +170,12 @@ Prompts for bug subject. Leaves you in a mail buffer."
;; that report-emacs-bug-orig-text remains valid. (Bug#5178)
(message-sort-headers)
;; Stop message-mode stealing the properties we will add.
- (set (make-local-variable 'message-strip-special-text-properties) nil))
+ (set (make-local-variable 'message-strip-special-text-properties) nil)
+ ;; Make sure we default to the From: address as envelope when sending
+ ;; through sendmail.
+ (when (and (not message-sendmail-envelope-from)
+ (message-bogus-recipient-p (message-make-address)))
+ (set (make-local-variable 'message-sendmail-envelope-from) 'header)))
(rfc822-goto-eoh)
(forward-line 1)
;; Move the mail signature to the proper place.
@@ -346,10 +357,6 @@ usually do not have translators for other languages.\n\n")))
(define-obsolete-function-alias 'report-emacs-bug-info 'info-emacs-bug "24.3")
-;; It's the default mail mode, so it seems OK to use its features.
-(autoload 'message-bogus-recipient-p "message")
-(defvar message-send-mail-function)
-
(defun report-emacs-bug-hook ()
"Do some checking before sending a bug report."
(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."
(defun python-indent-calculate-levels ()
"Calculate `python-indent-levels' and reset `python-indent-current-level'."
- (if (not (python-info-dedenter-statement-p))
+ (if (or (python-info-continuation-line-p)
+ (not (python-info-dedenter-statement-p)))
+ ;; XXX: This asks for a refactor. Even if point is on a
+ ;; dedenter statement, it could be multiline and in that case
+ ;; the continuation lines should be indented with normal rules.
(let* ((indentation (python-indent-calculate-indentation))
(remainder (% indentation python-indent-offset))
(steps (/ (- indentation remainder) python-indent-offset)))
@@ -1070,24 +1074,34 @@ Called from a program, START and END specify the region to indent."
(or (bolp) (forward-line 1))
(while (< (point) end)
(or (and (bolp) (eolp))
- (let (word)
- (forward-line -1)
- (back-to-indentation)
- (setq word (current-word))
- (forward-line 1)
- (when (and word
- ;; Don't mess with strings, unless it's the
- ;; enclosing set of quotes.
- (or (not (python-syntax-context 'string))
- (eq
- (syntax-after
- (+ (1- (point))
- (current-indentation)
- (python-syntax-count-quotes (char-after) (point))))
- (string-to-syntax "|"))))
- (beginning-of-line)
- (delete-horizontal-space)
- (indent-to (python-indent-calculate-indentation)))))
+ (when (and
+ ;; Skip if previous line is empty or a comment.
+ (save-excursion
+ (let ((line-is-comment-p
+ (python-info-current-line-comment-p)))
+ (forward-line -1)
+ (not
+ (or (and (python-info-current-line-comment-p)
+ ;; Unless this line is a comment too.
+ (not line-is-comment-p))
+ (python-info-current-line-empty-p)))))
+ ;; Don't mess with strings, unless it's the
+ ;; enclosing set of quotes.
+ (or (not (python-syntax-context 'string))
+ (eq
+ (syntax-after
+ (+ (1- (point))
+ (current-indentation)
+ (python-syntax-count-quotes (char-after) (point))))
+ (string-to-syntax "|")))
+ ;; Skip if current line is a block start, a
+ ;; dedenter or block ender.
+ (save-excursion
+ (back-to-indentation)
+ (not (looking-at
+ (python-rx
+ (or block-start dedenter block-ender))))))
+ (python-indent-line)))
(forward-line 1))
(move-marker end nil))))
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."
(let ((default-directory (file-name-as-directory dir)))
(and (eq 0
(condition-case nil
- (call-process "git" nil '(t nil) nil "log"
- "-1" "--pretty=format:%H")
+ (call-process "git" nil '(t nil) nil "rev-parse"
+ "HEAD")
(error nil)))
(not (zerop (buffer-size)))
(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 @@
+2014-11-16 Eli Zaretskii <eliz@gnu.org>
+
+ * window.c (window_scroll_pixel_based): Avoid truncation/rounding
+ errors in computing the number of pixels to scroll. Suggested by
+ Kelly Dean <kelly@prtime.org>. (Bug#19060)
+
+2014-11-16 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsmenu.m (update_frame_tool_bar): If tool bar changes height,
+ call updateFrameSize.
+
+ * nsterm.m (setFrame:): Remove call to display (Bug#18757).
+
+2014-11-16 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsfns.m (x_set_foreground_color, x_set_background_color)
+ (x_set_cursor_color, Fxw_color_values): Block/unblock input,
+ use SET_FRAME_GARBAGED instead of redraw_frame (Bug#19036).
+
2014-11-15 Jan Djärv <jan.h.d@swipnet.se>
* nsterm.m (ns_send_appdefined): Check for application defined
@@ -6,7 +25,7 @@
2014-11-14 David Reitter <david.reitter@gmail.com>
- * nsterm.m (run): set timeout for event loop to prevent hang.
+ * nsterm.m (run): Set timeout for event loop to prevent hang.
(Bug#18993)
2014-11-14 Paul Eggert <eggert@cs.ucla.edu>
@@ -2856,8 +2875,7 @@
Consider horizontal scroll bar.
(check_frame_size, adjust_window_margins): Remove functions and
corresponding calls.
- (set_window_buffer): Initialize old_pointm and horizontal scroll
- bars.
+ (set_window_buffer): Initialize old_pointm and horizontal scroll bars.
(temp_output_buffer_show): Reset hscroll related fields.
Initialize old_pointm.
(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)
NSColor *col;
EmacsCGFloat r, g, b, alpha;
+ /* Must block_input, because ns_lisp_to_color does block/unblock_input
+ which means that col may be deallocated in its unblock_input if there
+ is user input, unless we also block_input. */
+ block_input ();
if (ns_lisp_to_color (arg, &col))
{
store_frame_param (f, Qforeground_color, oldval);
+ unblock_input ();
error ("Unknown color");
}
@@ -299,8 +304,9 @@ x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
update_face_from_frame_parameter (f, Qforeground_color, arg);
/*recompute_basic_faces (f); */
if (FRAME_VISIBLE_P (f))
- redraw_frame (f);
+ SET_FRAME_GARBAGED (f);
}
+ unblock_input ();
}
@@ -312,9 +318,11 @@ x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
NSView *view = FRAME_NS_VIEW (f);
EmacsCGFloat r, g, b, alpha;
+ block_input ();
if (ns_lisp_to_color (arg, &col))
{
store_frame_param (f, Qbackground_color, oldval);
+ unblock_input ();
error ("Unknown color");
}
@@ -351,8 +359,9 @@ x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
}
if (FRAME_VISIBLE_P (f))
- redraw_frame (f);
+ SET_FRAME_GARBAGED (f);
}
+ unblock_input ();
}
@@ -361,9 +370,11 @@ x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
NSColor *col;
+ block_input ();
if (ns_lisp_to_color (arg, &col))
{
store_frame_param (f, Qcursor_color, oldval);
+ unblock_input ();
error ("Unknown color");
}
@@ -376,6 +387,7 @@ x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
x_update_cursor (f, 1);
}
update_face_from_frame_parameter (f, Qcursor_color, arg);
+ unblock_input ();
}
@@ -2331,11 +2343,16 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0,
check_window_system (NULL);
CHECK_STRING (color);
+ block_input ();
if (ns_lisp_to_color (color, &col))
- return Qnil;
+ {
+ unblock_input ();
+ return Qnil;
+ }
[[col colorUsingDefaultColorSpace]
getRed: &red green: &green blue: &blue alpha: &alpha];
+ unblock_input ();
return list3i (lrint (red * 65280), lrint (green * 65280),
lrint (blue * 65280));
}
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)
EmacsView *view = FRAME_NS_VIEW (f);
NSWindow *window = [view window];
EmacsToolbar *toolbar = [view toolbar];
+ int oldh;
if (view == nil || toolbar == nil) return;
block_input ();
+ oldh = FRAME_TOOLBAR_HEIGHT (f);
+
#ifdef NS_IMPL_COCOA
[toolbar clearActive];
#else
@@ -1136,6 +1139,8 @@ update_frame_tool_bar (struct frame *f)
if (FRAME_TOOLBAR_HEIGHT (f) < 0) // happens if frame is fullscreen.
FRAME_TOOLBAR_HEIGHT (f) = 0;
+ if (oldh != FRAME_TOOLBAR_HEIGHT (f))
+ [view updateFrameSize:YES];
if (view->wait_for_tool_bar && FRAME_TOOLBAR_HEIGHT (f) > 0)
{
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)
if (pixel_height == 0) pixel_height = 1;
min_portion = 20 / pixel_height;
[super setFrame: newRect];
- [self display];
/* unblock_input (); */
}
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)
{
int px;
int dy = frame_line_height;
+ /* In the below we divide the window box height by the
+ frame's line height to make the result predictable when
+ the window box is not an integral multiple of the line
+ height. This is important to ensure we get back to the
+ same position when scrolling up, then down. */
if (whole)
- dy = max ((window_box_height (w)
- - next_screen_context_lines * dy),
+ dy = max ((window_box_height (w) / dy
+ - next_screen_context_lines) * dy,
dy);
dy *= n;
@@ -5034,9 +5039,12 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
{
ptrdiff_t start_pos = IT_CHARPOS (it);
int dy = frame_line_height;
-
- dy = max ((window_box_height (w)
- - next_screen_context_lines * dy),
+ /* In the below we divide the window box height by the frame's
+ line height to make the result predictable when the window
+ box is not an integral multiple of the line height. This is
+ important to ensure we get back to the same position when
+ scrolling up, then down. */
+ dy = max ((window_box_height (w) / dy - next_screen_context_lines) * dy,
dy) * n;
/* 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)
#define WINDOW_FRAME_COLUMN_WIDTH(W) \
(FRAME_COLUMN_WIDTH (WINDOW_XFRAME ((W))))
-/* Return the canonical column width of the frame of window W. */
+/* Return the canonical line height of the frame of window W. */
#define WINDOW_FRAME_LINE_HEIGHT(W) \
(FRAME_LINE_HEIGHT (WINDOW_XFRAME ((W))))
diff --git a/test/ChangeLog b/test/ChangeLog
index 48e01ca973a..a09c6f78fc7 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,14 @@
+2014-11-16 Fabián Ezequiel Gallina <fgallina@gnu.org>
+
+ * automated/python-tests.el (python-indent-dedenters-8): New test
+ for Bug#18432.
+
+2014-11-16 Fabián Ezequiel Gallina <fgallina@gnu.org>
+
+ * automated/python-tests.el (python-indent-region-1)
+ (python-indent-region-2, python-indent-region-3)
+ (python-indent-region-4, python-indent-region-5): New tests.
+
2014-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
* 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:
(should (= (python-indent-calculate-indentation) 0))
(should (equal (python-indent-calculate-levels) '(0)))))
+(ert-deftest python-indent-dedenters-8 ()
+ "Test indentation for Bug#18432."
+ (python-tests-with-temp-buffer
+ "
+if (a == 1 or
+ a == 2):
+ pass
+elif (a == 3 or
+a == 4):
+"
+ (python-tests-look-at "a == 4):\n")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 6))
+ (should (equal (python-indent-calculate-levels) '(0 4 6)))))
+
(ert-deftest python-indent-electric-colon-1 ()
"Test indentation case from Bug#18228."
(python-tests-with-temp-buffer
@@ -725,6 +740,110 @@ def b()
(python-tests-self-insert ":")
(should (= (current-indentation) 0))))
+(ert-deftest python-indent-region-1 ()
+ "Test indentation case from Bug#18843."
+ (let ((contents "
+def foo ():
+ try:
+ pass
+ except:
+ pass
+"))
+ (python-tests-with-temp-buffer
+ contents
+ (python-indent-region (point-min) (point-max))
+ (should (string= (buffer-substring-no-properties (point-min) (point-max))
+ contents)))))
+
+(ert-deftest python-indent-region-2 ()
+ "Test region indentation on comments."
+ (let ((contents "
+def f():
+ if True:
+ pass
+
+# This is
+# some multiline
+# comment
+"))
+ (python-tests-with-temp-buffer
+ contents
+ (python-indent-region (point-min) (point-max))
+ (should (string= (buffer-substring-no-properties (point-min) (point-max))
+ contents)))))
+
+(ert-deftest python-indent-region-3 ()
+ "Test region indentation on comments."
+ (let ((contents "
+def f():
+ if True:
+ pass
+# This is
+# some multiline
+# comment
+")
+ (expected "
+def f():
+ if True:
+ pass
+ # This is
+ # some multiline
+ # comment
+"))
+ (python-tests-with-temp-buffer
+ contents
+ (python-indent-region (point-min) (point-max))
+ (should (string= (buffer-substring-no-properties (point-min) (point-max))
+ expected)))))
+
+(ert-deftest python-indent-region-4 ()
+ "Test region indentation block starts, dedenders and enders."
+ (let ((contents "
+def f():
+ if True:
+a = 5
+ else:
+ a = 10
+ return a
+")
+ (expected "
+def f():
+ if True:
+ a = 5
+ else:
+ a = 10
+ return a
+"))
+ (python-tests-with-temp-buffer
+ contents
+ (python-indent-region (point-min) (point-max))
+ (should (string= (buffer-substring-no-properties (point-min) (point-max))
+ expected)))))
+
+(ert-deftest python-indent-region-5 ()
+ "Test region indentation leaves strings untouched (start delimiter)."
+ (let ((contents "
+def f():
+'''
+this is
+a multiline
+string
+'''
+")
+ (expected "
+def f():
+ '''
+this is
+a multiline
+string
+'''
+"))
+ (python-tests-with-temp-buffer
+ contents
+ (python-indent-region (point-min) (point-max))
+ (should (string= (buffer-substring-no-properties (point-min) (point-max))
+ expected)))))
+
;;; Navigation