emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] xwidget_mvp f61f202 3/3: merge master


From: Joakim Verona
Subject: [Emacs-diffs] xwidget_mvp f61f202 3/3: merge master
Date: Thu, 26 Feb 2015 13:48:25 +0000

branch: xwidget_mvp
commit f61f2029fc4bf91e9e6fa32570209cf4446a103c
Merge: 8cffeb5 d8e9122
Author: Joakim Verona <address@hidden>
Commit: Joakim Verona <address@hidden>

    merge master
---
 ChangeLog                        |    9 +++
 doc/emacs/ChangeLog              |   16 ++++++
 doc/emacs/custom.texi            |    7 +--
 doc/emacs/msdos.texi             |   37 +++++++++++++-
 doc/emacs/mule.texi              |   86 +++++++++++-------------------
 doc/emacs/programs.texi          |    2 +-
 doc/misc/ChangeLog               |    7 +++
 doc/misc/reftex.texi             |   10 ++++
 lib/getdtablesize.c              |    7 +++
 lisp/ChangeLog                   |  100 ++++++++++++++++++++++++++++++++++--
 lisp/comint.el                   |    2 +-
 lisp/emacs-lisp/check-declare.el |   51 +++++++++++++++---
 lisp/emacs-lisp/debug.el         |    6 +--
 lisp/emacs-lisp/edebug.el        |    9 +++
 lisp/eshell/em-hist.el           |    4 +-
 lisp/eshell/em-pred.el           |   14 +++---
 lisp/gnus/ChangeLog              |   17 ++++++
 lisp/gnus/gnus-art.el            |   21 ++++++--
 lisp/gnus/mm-decode.el           |    2 +-
 lisp/gnus/mm-view.el             |    2 +-
 lisp/hi-lock.el                  |    2 +-
 lisp/mail/rmail.el               |    2 +-
 lisp/mail/rmailsum.el            |   12 +---
 lisp/menu-bar.el                 |   12 +++--
 lisp/net/dbus.el                 |    3 +-
 lisp/progmodes/cc-engine.el      |   10 +++-
 lisp/progmodes/cc-mode.el        |   17 ++++--
 lisp/progmodes/elisp-mode.el     |    9 ++--
 lisp/progmodes/python.el         |   48 +++++++----------
 lisp/simple.el                   |    2 +-
 lisp/textmodes/reftex-vars.el    |   33 +++++++-----
 m4/dup2.m4                       |   12 ++++-
 m4/fcntl.m4                      |    8 +++-
 src/ChangeLog                    |   50 ++++++++++++++++++
 src/dispextern.h                 |    6 ++-
 src/emacs.c                      |    4 +-
 src/frame.h                      |    4 --
 src/sysdep.c                     |   12 ++++-
 src/w32.c                        |    1 +
 src/w32fns.c                     |    4 --
 src/xfns.c                       |  107 +++++++++++++++++++++++++++-----------
 src/xmenu.c                      |   16 +++++-
 src/xterm.h                      |   28 +++-------
 test/ChangeLog                   |   13 +++++
 test/automated/python-tests.el   |  104 +++++++++++++++++++++++++++++++------
 45 files changed, 676 insertions(+), 252 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 41bff0e..47ef578 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2015-02-25  Paul Eggert  <address@hidden>
+
+       Merge from gnulib
+       * lib/getdtablesize.c, m4/dup2.m4, m4/fcntl.m4:
+       Update from gnulib, incorporating:
+       2015-02-23 dup2: doc and test for Android bug
+       2015-02-23 Replace dup2() on Android
+       2015-02-22 Android doesn't define RLIM_SAVED_*
+
 2015-02-21  Paul Eggert  <address@hidden>
 
        Merge from gnulib
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 1287733..1353640 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,19 @@
+2015-02-26  Eli Zaretskii  <address@hidden>
+
+       * msdog.texi (Windows Files): Document characters invalid in
+       Windows file names.  (Bug#19463)
+
+       * custom.texi (Customization Groups): Update the looks of the
+       Customize Group buffer.
+
+       * programs.texi (Hungry Delete): Fix a typo: "C-d" instead of
+       "C-c C-d" in hungry-delete mode.
+
+2015-02-26  Eli Zaretskii  <address@hidden>
+
+       * mule.texi (Language Environments): Work around refill bug in
+       makeinfo 4.x.  (Bug#19697)
+
 2015-01-28  Eli Zaretskii  <address@hidden>
 
        * cmdargs.texi (Action Arguments): Clarify into which buffer
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index 095e49b..9fd823b 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -82,14 +82,12 @@ top-level @code{Emacs} group.  It looks like this, in part:
 @c @page
 @smallexample
 @group
-To apply changes, use the Save or Set buttons.
-For details, see [Saving Customizations] in the [Emacs manual].
+For help, see [Easy Customization] in the [Emacs manual].
 
 ________________________________________ [ Search ]
 
  Operate on all settings in this buffer:
- [ Set for current session ] [ Save for future sessions ]
- [ Undo edits ] [ Reset to saved ] [ Erase customizations ] [ Exit ]
+ [ Revert... ] [ Apply ] [ Apply and Save ]
 
 
 Emacs group: Customization of the One True Editor.
@@ -97,7 +95,6 @@ Emacs group: Customization of the One True Editor.
       See also [Manual].
 
 [Editing] : Basic text editing facilities.
-
 [Convenience] : Convenience features for faster editing.
 
 @var{more second-level groups}
diff --git a/doc/emacs/msdos.texi b/doc/emacs/msdos.texi
index b5a6650..10e7923 100644
--- a/doc/emacs/msdos.texi
+++ b/doc/emacs/msdos.texi
@@ -249,7 +249,42 @@ removable and remote volumes, where this could potentially 
slow down
 Dired and other related features.  The value of @code{nil} means never
 issue those system calls.  address@hidden values are more useful on
 NTFS volumes, which support hard links and file security, than on FAT,
-FAT32, and XFAT volumes.
+FAT32, and exFAT volumes.
+
address@hidden file names, invalid characters on MS-Windows
+  Unlike Unix, MS-Windows file systems restrict the set of characters
+that can be used in a file name.  The following characters are not
+allowed:
+
address@hidden @bullet
address@hidden
+Shell redirection symbols @samp{<}, @samp{>}, and @samp{|}.
+
address@hidden
+Colon @samp{:} (except after the drive letter).
+
address@hidden
+Forward slash @samp{/} and backslash @samp{\} (except as directory
+separators).
+
address@hidden
+Wildcard characters @samp{*} and @samp{?}.
+
address@hidden
+Control characters whose codepoints are 1 through 31 decimal.  In
+particular, newlines in file names are not allowed.
+
address@hidden
+The null character, whose codepoint is zero (this limitation exists on
+Unix filesystems as well).
address@hidden itemize
+
address@hidden
+In addition, referencing any file whose name matches a DOS character
+device, such as @file{NUL} or @file{LPT1} or @file{PRN} or @file{CON},
+with or without any file-name extension, will always resolve to those
+character devices, in any directory.  Therefore, only use such file
+names when you want to use the corresponding character device.
 
 @node ls in Lisp
 @section Emulation of @code{ls} on MS-Windows
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi
index bea06f5..f8b06bd 100644
--- a/doc/emacs/mule.texi
+++ b/doc/emacs/mule.texi
@@ -265,123 +265,101 @@ the list of supported language environments, and use 
the command
 for more information about the language environment @var{lang-env}.
 Supported language environments include:
 
address@hidden @cindex entries below are split between portions of the list to
address@hidden make them more accurate, i.e. land on the line that mentions the
address@hidden language.  However, makeinfo 4.x doesn't fill inside @quotation
address@hidden lines that follow a @cindex entry and whose text has no 
whitespace.
address@hidden To work around, we group the language environments together, so
address@hidden that the blank that separates them triggers refill.
 @quotation
 @cindex ASCII
-ASCII,
 @cindex Arabic
-Arabic,
+ASCII, Arabic,
 @cindex Belarusian
-Belarusian,
 @cindex Bengali
-Bengali,
+Belarusian, Bengali,
 @cindex Brazilian Portuguese
-Brazilian Portuguese,
 @cindex Bulgarian
-Bulgarian,
+Brazilian Portuguese, Bulgarian,
 @cindex Burmese
-Burmese,
 @cindex Cham
-Cham,
+Burmese, Cham,
 @cindex Chinese
 Chinese-BIG5, Chinese-CNS, Chinese-EUC-TW, Chinese-GB,
 Chinese-GB18030, Chinese-GBK,
 @cindex Croatian
-Croatian,
 @cindex Cyrillic
-Cyrillic-ALT, Cyrillic-ISO, Cyrillic-KOI8,
+Croatian, Cyrillic-ALT, Cyrillic-ISO, Cyrillic-KOI8,
 @cindex Czech
-Czech,
 @cindex Devanagari
-Devanagari,
+Czech, Devanagari,
 @cindex Dutch
-Dutch,
 @cindex English
-English,
+Dutch, English,
 @cindex Esperanto
-Esperanto,
 @cindex Ethiopic
-Ethiopic,
+Esperanto, Ethiopic,
 @cindex French
-French,
 @cindex Georgian
-Georgian,
+French, Georgian,
 @cindex German
-German,
 @cindex Greek
-Greek,
 @cindex Gujarati
-Gujarati,
+German, Greek, Gujarati,
 @cindex Hebrew
-Hebrew,
 @cindex IPA
-IPA,
+Hebrew, IPA,
 @cindex Italian
 Italian,
 @cindex Japanese
-Japanese,
 @cindex Kannada
-Kannada,
+Japanese, Kannada,
 @cindex Khmer
-Khmer,
 @cindex Korean
-Korean,
 @cindex Lao
-Lao,
+Khmer, Korean, Lao,
 @cindex Latin
 Latin-1, Latin-2, Latin-3, Latin-4, Latin-5, Latin-6, Latin-7,
 Latin-8, Latin-9,
 @cindex Latvian
-Latvian,
 @cindex Lithuanian
-Lithuanian,
+Latvian, Lithuanian,
 @cindex Malayalam
-Malayalam,
 @cindex Oriya
-Oriya,
+Malayalam, Oriya,
 @cindex Persian
-Persian,
 @cindex Polish
-Polish,
+Persian, Polish,
 @cindex Punjabi
-Punjabi,
 @cindex Romanian
-Romanian,
+Punjabi, Romanian,
 @cindex Russian
-Russian,
 @cindex Sinhala
-Sinhala,
+Russian, Sinhala,
 @cindex Slovak
-Slovak,
 @cindex Slovenian
-Slovenian,
 @cindex Spanish
-Spanish,
+Slovak, Slovenian, Spanish,
 @cindex Swedish
-Swedish,
 @cindex TaiViet
-TaiViet,
+Swedish, TaiViet,
 @cindex Tajik
-Tajik,
 @cindex Tamil
-Tamil,
+Tajik, Tamil,
 @cindex Telugu
-Telugu,
 @cindex Thai
-Thai,
+Telugu, Thai,
 @cindex Tibetan
-Tibetan,
 @cindex Turkish
-Turkish,
+Tibetan, Turkish,
 @cindex UTF-8
-UTF-8,
 @cindex Ukrainian
-Ukrainian,
+UTF-8, Ukrainian,
 @cindex Vietnamese
-Vietnamese,
 @cindex Welsh
-Welsh, and
+Vietnamese, Welsh,
 @cindex Windows-1255
-Windows-1255.
+and Windows-1255.
 @end quotation
 
   To display the script(s) used by your language environment on a
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index 609392f..73aed08 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -1666,7 +1666,7 @@ Delete the entire block of whitespace after point 
(@code{c-hungry-delete-forward
   As an alternative to the above commands, you can enable @dfn{hungry
 delete mode}.  When this feature is enabled (indicated by @samp{/h} in
 the mode line after the mode name), a single @key{DEL} deletes all
-preceding whitespace, not just one space, and a single @kbd{C-c C-d}
+preceding whitespace, not just one space, and a single @kbd{C-d}
 (but @emph{not} plain @key{Delete}) deletes all following whitespace.
 
 @table @kbd
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index d04a8bb..448c7f2 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,10 @@
+2015-02-25  Tassilo Horn  <address@hidden>
+
+       * reftex.texi (Multifile Documents): Document
+       reftex-include-file-commands.
+       (Options): Mention that non-customize changes might require
+       calling reftex-compile-variables.
+
 2015-02-21  Paul Eggert  <address@hidden>
 
        * texinfo.tex: Update from gnulib.
diff --git a/doc/misc/reftex.texi b/doc/misc/reftex.texi
index 567063f..facfb43 100644
--- a/doc/misc/reftex.texi
+++ b/doc/misc/reftex.texi
@@ -2961,6 +2961,12 @@ label itself in order to be processed correctly by 
@RefTeX{}.  The only
 exception is that section labels referring to a section statement
 outside the current file can still use that section title as
 context.
+
address@hidden
address@hidden reftex-include-file-commands
address@hidden knows about the @code{\include} and @code{\input} macros.
+In case you use different commands to include files in a multifile
+document, customize the variable @code{reftex-include-file-commands}.
 @end itemize
 
 @node Language Support
@@ -3893,6 +3899,10 @@ Lisp (and even if you are) you might find it more 
comfortable to use
 @code{customize} to look at and change these variables. @kbd{M-x
 reftex-customize} will get you there.
 
+In case you don't use the @code{customize} interface, here's a caveat:
+Changing (mostly parsing-related) options might require a call to
address@hidden in order to become effective.
+
 @menu
 * Options - Table of Contents::
 * Options - Defining Label Environments::
diff --git a/lib/getdtablesize.c b/lib/getdtablesize.c
index bad45f7..03eb7ef 100644
--- a/lib/getdtablesize.c
+++ b/lib/getdtablesize.c
@@ -89,6 +89,13 @@ getdtablesize (void)
 # include <limits.h>
 # include <sys/resource.h>
 
+# ifndef RLIM_SAVED_CUR
+#  define RLIM_SAVED_CUR RLIM_INFINITY
+# endif
+# ifndef RLIM_SAVED_MAX
+#  define RLIM_SAVED_MAX RLIM_INFINITY
+# endif
+
 # ifdef __CYGWIN__
   /* Cygwin 1.7.25 auto-increases the RLIMIT_NOFILE soft limit until it
      hits the compile-time constant hard limit of 3200.  We might as
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b0a07df..8ccc2c3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,95 @@
+2015-02-26  Alan Mackenzie  <address@hidden>
+
+       Handle "#" operator properly inside macro.  Fix coding bug.
+
+       * progmodes/cc-mode.el (c-neutralize-syntax-in-and-mark-CPP): On
+       finding a "#" which looks like the start of a macro, check it
+       isn't already inside a macro.
+
+       * progmodes/cc-engine.el (c-state-safe-place): Don't record a new
+       "safe" position into the list of them when this is beyond our
+       current position.
+
+2015-02-26  Martin Rudalics  <address@hidden>
+
+       * menu-bar.el (menu-bar-non-minibuffer-window-p): Return nil when
+       the menu frame is dead.  (Bug#19728)
+
+2015-02-26  Fabián Ezequiel Gallina  <address@hidden>
+
+       python.el: Handle tabs in python-indent-dedent-line.
+
+       * progmodes/python.el (python-indent-dedent-line): Fixes for
+       indentation with tabs.  Thanks to <address@hidden> (Bug#19730).
+
+2015-02-26  Fabián Ezequiel Gallina  <address@hidden>
+
+       * progmodes/python.el (python-indent-context): Respect user
+       indentation after comment.
+
+2015-02-26  Tassilo Horn  <address@hidden>
+
+       * textmodes/reftex-vars.el (featurep): Conditionalize value of
+       reftex-label-regexps in order to stay compatible with XEmacs 21.5
+       which has no explicitly numbered groups in regexps (bug#19714).
+
+2015-02-26  Daiki Ueno  <address@hidden>
+
+       * net/dbus.el (dbus-register-signal): Convert "N" of ":argN" to
+       integer before comparison.
+
+2015-02-25  Nicolas Richard  <address@hidden>
+
+       * progmodes/elisp-mode.el (elisp--eval-last-sexp): Document argument.
+
+2015-02-25  Oleh Krehel  <address@hidden>
+
+       * emacs-lisp/check-declare.el (check-declare-warn): Use
+       compilation-style warnings.
+       (check-declare-files): Make sure that
+       `check-declare-warning-buffer' is in `compilation-mode'.
+
+2015-02-25  Oleh Krehel  <address@hidden>
+
+       * emacs-lisp/check-declare.el (check-declare-ext-errors): New
+       defcustom.
+       (check-declare): New defgroup.
+       (check-declare-verify): When `check-declare-ext-errors' is
+       non-nil, warn about an unfound function, instead of saying
+       "skipping external file".
+
+2015-02-25  Tassilo Horn  <address@hidden>
+
+       * textmodes/reftex-vars.el (reftex-include-file-commands): Call
+       reftex-set-dirty on changes.
+
+2015-02-25  Stefan Monnier  <address@hidden>
+
+       * emacs-lisp/edebug.el (edebug--display): Save-excursion (bug#19611).
+       * emacs-lisp/debug.el (debugger-env-macro): Remove redundant
+       save-excursion.
+
+2015-02-24  Glenn Morris  <address@hidden>
+
+       * mail/rmailsum.el (rmail-summary-previous-all)
+       (rmail-summary-previous-msg): Simplify.
+
+2015-02-25  Artur Malabarba  <address@hidden>
+
+       * simple.el (region-active-p): Fix doc to say non-nil.
+
+2015-02-24  Samer Masterson  <address@hidden>
+
+       * eshell/em-hist.el (eshell-hist-parse-word-designator):
+       Return args joined with " ".
+       * eshell/em-pred.el (eshell-parse-modifiers): Correct docstring.
+       (eshell-hist-parse-modifier): Pass mod a list instead of a string
+       (bug#18960).
+
+2015-02-24  Karl Fogel  <address@hidden>  (tiny change)
+
+       * comint.el (comint-mode-map): Fix obvious typo.
+
 2015-02-24  Johan Claesson  <address@hidden>  (tiny change)
 
        * filecache.el (file-cache-filter-regexps):
@@ -96,8 +188,8 @@
        (verilog-auto-inst, verilog-auto-inst-param):
        Use arguments rather than vector-skip.
        (verilog-auto-inst-port): Fix AUTOINST interfaces to not show
-       modport if signal attachment is itself a modport.  Reported by
-       Matthew Lovell.
+       modport if signal attachment is itself a modport.
+       Reported by Matthew Lovell.
 
 2015-02-21  Reto Zimmermann  <address@hidden>
 
@@ -337,7 +429,7 @@
 2015-02-11  Stefan Monnier  <address@hidden>
 
        * hi-lock.el (hi-lock-unface-buffer): Don't call
-       font-lock-remove-keywords if not needed (bug#19737).
+       font-lock-remove-keywords if not needed (bug#19796).
 
 2015-02-11  Artur Malabarba  <address@hidden>
 
@@ -1618,7 +1710,7 @@
        * vc/vc-svn.el (vc-svn-dir-status-files): Pass t as
        vc-svn-after-dir-status's second argument.  (Bug#19429)
 
-2015-01-16  Samer Masterson  <address@hidden>  (tiny change)
+2015-01-16  Samer Masterson  <address@hidden>
 
        * pcomplete.el (pcomplete-parse-arguments): Parse arguments
        regardless of pcomplete-cycle-completions's value.  (Bug#18950)
diff --git a/lisp/comint.el b/lisp/comint.el
index 30aece1..2c41684 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -472,7 +472,7 @@ executed once when the buffer is created."
     (define-key map "\C-c\C-\\"   'comint-quit-subjob)
     (define-key map "\C-c\C-m"           'comint-copy-old-input)
     (define-key map "\C-c\C-o"           'comint-delete-output)
-    (defile-key map "\C-c\M-o"    'comint-clear-buffer)
+    (define-key map "\C-c\M-o"    'comint-clear-buffer)
     (define-key map "\C-c\C-r"           'comint-show-output)
     (define-key map "\C-c\C-e"           'comint-show-maximum-output)
     (define-key map "\C-c\C-l"           'comint-dynamic-list-input-ring)
diff --git a/lisp/emacs-lisp/check-declare.el b/lisp/emacs-lisp/check-declare.el
index 13de61c..c263972 100644
--- a/lisp/emacs-lisp/check-declare.el
+++ b/lisp/emacs-lisp/check-declare.el
@@ -125,6 +125,14 @@ With optional argument FULL, sums the number of elements 
in each element."
 
 (autoload 'byte-compile-arglist-signature "bytecomp")
 
+(defgroup check-declare nil
+  "Check declare-function statements."
+  :group 'tools)
+
+(defcustom check-declare-ext-errors nil
+  "When non-nil, warn abount functions not found in :ext."
+  :type 'boolean)
+
 (defun check-declare-verify (fnfile fnlist)
   "Check that FNFILE contains function definitions matching FNLIST.
 Each element of FNLIST has the form (FILE FN ARGLIST FILEONLY), where
@@ -226,7 +234,8 @@ method\\|class\\)\\|fset\\)\\>" type)
       (when type
         (setq errlist (cons (list (car e) (cadr e) type) errlist))))
     (message "%s%s" m
-             (if (or re (not ext))
+             (if (or re (or check-declare-ext-errors
+                            (not ext)))
                  (check-declare-errmsg errlist)
                (progn
                  (setq errlist nil)
@@ -251,12 +260,29 @@ Returned list has elements FNFILE (FILE ...)."
   "Warn that FILE made a false claim about FN in FNFILE.
 TYPE is a string giving the nature of the error.  Warning is displayed in
 `check-declare-warning-buffer'."
-  (display-warning 'check-declare
-                   (format "%s said `%s' was defined in %s: %s"
-                           (file-name-nondirectory file) fn
-                           (file-name-nondirectory fnfile)
-                           type)
-                   nil check-declare-warning-buffer))
+  (let ((warning-prefix-function
+         (lambda (level entry)
+           (let ((line 0)
+                 (col 0))
+             (insert
+              (with-current-buffer (find-file-noselect file)
+                (goto-char (point-min))
+                (when (re-search-forward
+                       (format "(declare-function[ \t\n]+%s" fn) nil t)
+                  (goto-char (match-beginning 0))
+                  (setq line (line-number-at-pos))
+                  (setq col (1+ (current-column))))
+                (format "%s:%d:%d:"
+                        (file-name-nondirectory file)
+                        line col))))
+           entry))
+        (warning-fill-prefix "    "))
+    (display-warning 'check-declare
+                     (format "%s said `%s' was defined in %s: %s"
+                             (file-name-nondirectory file) fn
+                             (file-name-nondirectory fnfile)
+                             type)
+                     nil check-declare-warning-buffer)))
 
 (defun check-declare-files (&rest files)
   "Check veracity of all `declare-function' statements in FILES.
@@ -269,13 +295,20 @@ Return a list of any errors found."
     (dolist (e (check-declare-sort alist))
       (if (setq err (check-declare-verify (car e) (cdr e)))
           (setq errlist (cons (cons (car e) err) errlist))))
+    (setq errlist (nreverse errlist))
     (if (get-buffer check-declare-warning-buffer)
         (kill-buffer check-declare-warning-buffer))
+    (with-current-buffer (get-buffer-create check-declare-warning-buffer)
+      (unless (derived-mode-p 'compilation-mode)
+        (compilation-mode))
+      (let ((inhibit-read-only t))
+        (insert "\f\n"))
+      (compilation-forget-errors))
     ;; Sort back again so that errors are ordered by the files
     ;; containing the declare-function statements.
     (dolist (e (check-declare-sort errlist))
-        (dolist (f (cdr e))
-          (check-declare-warn (car e) (cadr f) (car f) (nth 2 f))))
+      (dolist (f (cdr e))
+        (check-declare-warn (car e) (cadr f) (car f) (nth 2 f))))
     errlist))
 
 ;;;###autoload
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index dc0e666..8c1440d 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -535,11 +535,7 @@ Applies to the frame whose line point is on in the 
backtrace."
 (defmacro debugger-env-macro (&rest body)
   "Run BODY in original environment."
   (declare (indent 0))
-  `(save-excursion
-    (if (null (buffer-live-p debugger-old-buffer))
-        ;; old buffer deleted
-        (setq debugger-old-buffer (current-buffer)))
-    (set-buffer debugger-old-buffer)
+  `(progn
     (set-match-data debugger-outer-match-data)
     (prog1
         (progn ,@body)
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 7faa101..1091877 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -2358,6 +2358,12 @@ MSG is printed after `::::} '."
 (defalias 'edebug-mark-marker 'mark-marker)
 
 (defun edebug--display (value offset-index arg-mode)
+  ;; edebug--display-1 is too big, we should split it.  This function
+  ;; here was just introduced to avoid making edebug--display-1
+  ;; yet a bit deeper.
+  (save-excursion (edebug--display-1 value offset-index arg-mode)))
+
+(defun edebug--display-1 (value offset-index arg-mode)
   (unless (marker-position edebug-def-mark)
     ;; The buffer holding the source has been killed.
     ;; Let's at least show a backtrace so the user can figure out
@@ -3317,6 +3323,9 @@ Return the result of the last expression."
      ;; Restore outside context.
      (setq-default cursor-in-non-selected-windows edebug-outside-d-c-i-n-s-w)
      (unwind-protect
+         ;; FIXME: This restoring of edebug-outside-buffer and
+         ;; edebug-outside-point is redundant now that backtrace-eval does it
+         ;; for us.
          (with-current-buffer edebug-outside-buffer ; of edebug-buffer
            (goto-char edebug-outside-point)
            (if (marker-buffer (edebug-mark-marker))
diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el
index 55c83e4..1cdf6d6 100644
--- a/lisp/eshell/em-hist.el
+++ b/lisp/eshell/em-hist.el
@@ -724,7 +724,7 @@ matched."
        (setq nth (eshell-hist-word-reference nth)))
       (unless (numberp mth)
        (setq mth (eshell-hist-word-reference mth)))
-      (cons (mapconcat 'identity (eshell-sublist textargs nth mth) "")
+      (cons (mapconcat 'identity (eshell-sublist textargs nth mth) " ")
            end))))
 
 (defun eshell-hist-parse-modifier (hist reference)
@@ -737,7 +737,7 @@ matched."
          (goto-char (point-min))
          (let ((modifiers (cdr (eshell-parse-modifiers))))
            (dolist (mod modifiers)
-             (setq hist (funcall mod hist)))
+             (setq hist (car (funcall mod (list hist)))))
            hist))
       (delete-region here (point)))))
 
diff --git a/lisp/eshell/em-pred.el b/lisp/eshell/em-pred.el
index abaa99e..289d37d 100644
--- a/lisp/eshell/em-pred.el
+++ b/lisp/eshell/em-pred.el
@@ -119,7 +119,8 @@ The format of each entry is
                (function
                 (lambda (str)
                   (eshell-stringify
-                   (car (eshell-parse-argument str))))) lst)))
+                   (car (eshell-parse-argument str)))))
+               lst)))
     (?L . #'(lambda (lst) (mapcar 'downcase lst)))
     (?U . #'(lambda (lst) (mapcar 'upcase lst)))
     (?C . #'(lambda (lst) (mapcar 'capitalize lst)))
@@ -296,16 +297,15 @@ This function is specially for adding onto 
`eshell-parse-argument-hook'."
 
 (defun eshell-parse-modifiers ()
   "Parse value modifiers and predicates at point.
-If ALLOW-PREDS is non-nil, predicates will be parsed as well.
 Return a cons cell of the form
 
   (PRED-FUNC-LIST . MOD-FUNC-LIST)
 
-NEW-STRING is STRING minus any modifiers.  PRED-FUNC-LIST is a list of
-predicate functions.  MOD-FUNC-LIST is a list of result modifier
-functions.  PRED-FUNCS take a filename and return t if the test
-succeeds; MOD-FUNCS take any string and preform a modification,
-returning the resultant string."
+PRED-FUNC-LIST is a list of predicate functions.  MOD-FUNC-LIST
+is a list of result modifier functions.  PRED-FUNCS take a
+filename and return t if the test succeeds; MOD-FUNCS take any
+list of strings and perform a modification, returning the
+resultant list of strings."
   (let (negate follow preds mods)
     (condition-case nil
        (while (not (eobp))
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 7a4c463..af49782 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,20 @@
+2015-02-26  Katsumi Yamaoka  <address@hidden>
+
+       * gnus-art.el (gnus-mime-inline-part, gnus-mm-display-part):
+       Fix point motion when removing displayed MIME part.
+       (gnus-article-edit-part): Make jumping to the next part really work
+       when deleting or stripping.
+       (gnus-mime-buttonize-attachments-in-header): Make header attachment
+       buttons identical to the ones in the article body so as to work deleting
+       and stripping.
+
+2015-02-25  Katsumi Yamaoka  <address@hidden>
+
+       * mm-decode.el (mm-shr)
+       * mm-view.el (mm-inline-text-html-render-with-w3m):
+       Revert my bogus change that made the start marker of a part
+       the "moves after insertion" type.
+
 2015-02-23  Tassilo Horn  <address@hidden>
 
        * mailcap.el (mailcap-mime-data): Support `pdf-view-mode' (from PDF
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 83a2f94..5de4b58 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -5064,6 +5064,7 @@ and `gnus-mime-delete-part', and not provided at run-time 
normally."
     (let ((gnus-mime-buttonized-part-id current-id))
       (gnus-article-edit-done))
     (gnus-configure-windows 'article)
+    (sit-for 0)
     (when (and current-id (integerp gnus-auto-select-part))
       (gnus-article-jump-to-part
        (min (max (+ current-id gnus-auto-select-part) 1)
@@ -5359,7 +5360,10 @@ Compressed files like .gz and .bz2 are decompressed."
                                                              'gnus-data))))
        (setq b btn))
       (if (and (not arg) (mm-handle-undisplayer handle))
-         (mm-remove-part handle)
+         (progn
+           (setq b (copy-marker b)
+                 btn (copy-marker btn))
+           (mm-remove-part handle))
        (cond
         ((not arg) nil)
         ((numberp arg)
@@ -5373,6 +5377,9 @@ Compressed files like .gz and .bz2 are decompressed."
          (forward-line 1))
        (mm-display-inline handle))
       ;; Toggle the button appearance between `[button]...' and `[button]'.
+      (when (markerp btn)
+       (setq btn (prog1 (marker-position btn)
+                   (set-marker btn nil))))
       (goto-char btn)
       (let ((displayed-p (mm-handle-displayed-p handle)))
        (gnus-insert-mime-button handle (get-text-property btn 'gnus-part)
@@ -5408,6 +5415,9 @@ Compressed files like .gz and .bz2 are decompressed."
                   '((gnus-treat-highlight-headers
                      gnus-article-highlight-headers))))
              (gnus-treat-article 'head)))))
+      (when (markerp b)
+       (setq b (prog1 (marker-position b)
+                 (set-marker b nil))))
       (goto-char b))))
 
 (defun gnus-mime-set-charset-parameters (handle charset)
@@ -5730,7 +5740,8 @@ all parts."
                point (previous-single-property-change start 'gnus-data))
          (if (mm-handle-displayed-p handle)
              ;; This will remove the part.
-             (setq retval (mm-display-part handle))
+             (setq point (copy-marker point)
+                   retval (mm-display-part handle))
            (let ((part (or (and (mm-inlinable-p handle)
                                 (mm-inlined-p handle)
                                 t)
@@ -5761,6 +5772,9 @@ all parts."
                                            ,(point-max-marker)))))))
                    (part
                     (mm-display-inline handle))))))
+      (when (markerp point)
+       (setq point (prog1 (marker-position point)
+                     (set-marker point nil))))
       (goto-char point)
       ;; Toggle the button appearance between `[button]...' and `[button]'.
       (let ((displayed-p (mm-handle-displayed-p handle)))
@@ -6432,8 +6446,7 @@ in the body.  Use `gnus-header-face-alist' to highlight 
buttons."
              (dolist (button (nreverse buttons))
                (setq st (point))
                (insert " ")
-               (mm-handle-set-undisplayer
-                (setq handle (copy-sequence (cdr button))) nil)
+               (mm-handle-set-undisplayer (setq handle (cdr button)) nil)
                (gnus-insert-mime-button handle (car button))
                (skip-chars-backward "\t\n ")
                (delete-region (point) (point-max))
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 459c793..ae6bb71 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -1895,7 +1895,7 @@ If RECURSIVE, search recursively."
        handle
        `(lambda ()
          (let ((inhibit-read-only t))
-           (delete-region ,(copy-marker (point-min) t)
+           (delete-region ,(point-min-marker)
                           ,(point-max-marker))))))))
 
 (defvar shr-map)
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index 4b520ed..a3d6e74 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -217,7 +217,7 @@
         handle
         `(lambda ()
            (let ((inhibit-read-only t))
-             (delete-region ,(copy-marker (point-min) t)
+             (delete-region ,(point-min-marker)
                             ,(point-max-marker)))))))))
 
 (defvar mm-w3m-standalone-supports-m17n-p (if (featurep 'mule) 'undecided)
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index d74664a..0255585 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -600,7 +600,7 @@ then remove all hi-lock highlighting."
       ;; `font-lock-specified-p' to go from nil to non-nil (because it
       ;; calls font-lock-set-defaults).  This is yet-another bug in
       ;; font-lock-add/remove-keywords, which we circumvent here by
-      ;; testing `font-lock-fontified' (bug#19737).
+      ;; testing `font-lock-fontified' (bug#19796).
       (if font-lock-fontified (font-lock-remove-keywords nil (list keyword)))
       (setq hi-lock-interactive-patterns
             (delq keyword hi-lock-interactive-patterns))
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 855a4c2..1b8dd06 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -4810,7 +4810,7 @@ If prefix argument REVERSE is non-nil, sorts in reverse 
order.
 
 ;;;***
 
-;;;### (autoloads nil "rmailsum" "rmailsum.el" 
"e3943ef45946f10b9b5cab8097d7f271")
+;;;### (autoloads nil "rmailsum" "rmailsum.el" 
"3203e61425330fc20f3154b559f8b539")
 ;;; Generated autoloads from rmailsum.el
 
 (autoload 'rmail-summary "rmailsum" "\
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index bfcd81c..7144e43 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -1,7 +1,6 @@
 ;;; rmailsum.el --- make summary buffers for the mail reader
 
-;; Copyright (C) 1985, 1993-1996, 2000-2015 Free Software Foundation,
-;; Inc.
+;; Copyright (C) 1985, 1993-1996, 2000-2015 Free Software Foundation, Inc.
 
 ;; Maintainer: address@hidden
 ;; Keywords: mail
@@ -813,12 +812,7 @@ the message being processed."
 
 (defun rmail-summary-previous-all (&optional number)
   (interactive "p")
-  (or number (setq number 1))
-  (forward-line (- number))
-  ;; It doesn't look nice to move forward past the last message line.
-  (and (eobp) (< number 0)
-       (forward-line -1))
-  (display-buffer rmail-buffer))
+  (rmail-summary-next-all (- (or number 1))))
 
 (defun rmail-summary-next-msg (&optional number)
   "Display next non-deleted msg from rmail file.
@@ -843,7 +837,7 @@ messages, or backward if NUMBER is negative."
 With optional prefix argument NUMBER, moves backward this number of
 non-deleted messages."
   (interactive "p")
-  (rmail-summary-next-msg (- (if number number 1))))
+  (rmail-summary-next-msg (- (or number 1))))
 
 (defun rmail-summary-next-labeled-message (n labels)
   "Show next message with LABELS.  Defaults to last labels used.
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index cd1a4d0..5fdb937 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -1747,12 +1747,14 @@ The menu frame is the frame for which we are updating 
the menu."
         (frame-visible-p menu-frame))))
 
 (defun menu-bar-non-minibuffer-window-p ()
-  "Return non-nil if selected window of the menu frame is not a minibuf window.
-
-See the documentation of `menu-bar-menu-frame-live-and-visible-p'
-for the definition of the menu frame."
+  "Return non-nil if the menu frame's selected window is no minibuffer window.
+Return nil if the menu frame is dead or its selected window is a
+minibuffer window.  The menu frame is the frame for which we are
+updating the menu."
   (let ((menu-frame (or menu-updating-frame (selected-frame))))
-    (not (window-minibuffer-p (frame-selected-window menu-frame)))))
+    (and (frame-live-p menu-frame)
+        (not (window-minibuffer-p
+              (frame-selected-window menu-frame))))))
 
 (defun kill-this-buffer ()     ; for the menu bar
   "Kill the current buffer.
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el
index bbce300..b2c1ba8 100644
--- a/lisp/net/dbus.el
+++ b/lisp/net/dbus.el
@@ -707,7 +707,8 @@ Example:
                 (setq counter (match-string 2 (symbol-name key))
                       args (cdr args)
                       value (car args))
-                (unless (and (<= counter 63) (stringp value))
+                (unless (and (<= (string-to-number counter) 63)
+                             (stringp value))
                   (signal 'wrong-type-argument
                           (list "Wrong argument" key value)))
                 (format
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 328e0f7..823d795 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -2277,7 +2277,9 @@ comment at the start of cc-engine.el for more info."
          (while
              ;; Add an element to `c-state-nonlit-pos-cache' each iteration.
              (and
-              (<= (setq npos (+ pos c-state-nonlit-pos-interval)) here)
+              (setq npos
+                    (when (<= (+ pos c-state-nonlit-pos-interval) here)
+                      (+ pos c-state-nonlit-pos-interval)))
 
               ;; Test for being in a literal.  If so, go to after it.
               (progn
@@ -2304,7 +2306,9 @@ comment at the start of cc-engine.el for more info."
          ;; Add one extra element above HERE so as to to avoid the previous
          ;; expensive calculation when the next call is close to the current
          ;; one.  This is especially useful when inside a large macro.
-         (setq c-state-nonlit-pos-cache (cons npos c-state-nonlit-pos-cache)))
+         (when npos
+           (setq c-state-nonlit-pos-cache
+                 (cons npos c-state-nonlit-pos-cache))))
 
        (if (> pos c-state-nonlit-pos-cache-limit)
            (setq c-state-nonlit-pos-cache-limit pos))
@@ -3069,7 +3073,7 @@ comment at the start of cc-engine.el for more info."
       (setq dropped-cons (consp (car c-state-cache)))
       (setq c-state-cache (cdr c-state-cache))
       (setq pos pa))
-    ;; At this stage, (> pos here);
+    ;; At this stage, (>= pos here);
     ;; (< (c-state-cache-top-lparen) here)  (or is nil).
 
     (cond
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 01e93b3..c021926 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -968,12 +968,17 @@ Note that the style variables are always made local to 
the buffer."
     (let ((pps-position (point))  pps-state mbeg)
       (while (and (< (point) c-new-END)
                  (search-forward-regexp c-anchored-cpp-prefix c-new-END t))
-       ;; If we've found a "#" inside a string/comment, ignore it.
-       (setq pps-state
-             (parse-partial-sexp pps-position (point) nil nil pps-state)
-             pps-position (point))
-       (unless (or (nth 3 pps-state)   ; in a string?
-                   (nth 4 pps-state))  ; in a comment?
+       ;; If we've found a "#" inside a macro/string/comment, ignore it.
+       (unless
+           (or (save-excursion
+                 (goto-char (match-beginning 0))
+                 (c-beginning-of-macro))
+               (progn
+                 (setq pps-state
+                       (parse-partial-sexp pps-position (point) nil nil 
pps-state)
+                       pps-position (point))
+                 (or (nth 3 pps-state)    ; in a string?
+                     (nth 4 pps-state)))) ; in a comment?
          (goto-char (match-beginning 1))
          (setq mbeg (point))
          (if (> (c-syntactic-end-of-macro) mbeg)
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index b2c5fbf..29f1ee9 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -883,10 +883,11 @@ If CHAR is not a character, return nil."
 
 (defun elisp--eval-last-sexp (eval-last-sexp-arg-internal)
   "Evaluate sexp before point; print value in the echo area.
-With argument, print output into current buffer.
-With a zero prefix arg, print output with no limit on the length
-and level of lists, and include additional formats for integers
-\(octal, hexadecimal, and character)."
+If EVAL-LAST-SEXP-ARG-INTERNAL is non-nil, print output into
+current buffer.  If EVAL-LAST-SEXP-ARG-INTERNAL is `0', print
+output with no limit on the length and level of lists, and
+include additional formats for integers \(octal, hexadecimal, and
+character)."
   (let ((standard-output (if eval-last-sexp-arg-internal (current-buffer) t)))
     ;; Setup the lexical environment if lexical-binding is enabled.
     (elisp--eval-last-sexp-print-value
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 4420faf..1c3f746 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -843,15 +843,6 @@ keyword
        ;; Beginning of buffer.
        ((= (line-number-at-pos) 1)
         (cons :no-indent 0))
-       ;; Comment continuation (maybe).
-       ((save-excursion
-          (when (and
-                 (or
-                  (python-info-current-line-comment-p)
-                  (python-info-current-line-empty-p))
-                 (forward-comment -1)
-                 (python-info-current-line-comment-p))
-            (cons :after-comment (point)))))
        ;; Inside a string.
        ((let ((start (python-syntax-context 'string ppss)))
           (when start
@@ -963,28 +954,29 @@ keyword
        ((let ((start (python-info-dedenter-statement-p)))
           (when start
             (cons :at-dedenter-block-start start))))
-       ;; After normal line.
-       ((let ((start (save-excursion
-                       (back-to-indentation)
-                       (skip-chars-backward " \t\n")
-                       (python-nav-beginning-of-statement)
-                       (point))))
-          (when start
-            (if (save-excursion
-                  (python-util-forward-comment -1)
-                  (python-nav-beginning-of-statement)
-                  (looking-at (python-rx block-ender)))
-                (cons :after-block-end start)
-              (cons :after-line start)))))
-       ;; Default case: do not indent.
-       (t (cons :no-indent 0))))))
+       ;; After normal line, comment or ender (default case).
+       ((save-excursion
+          (back-to-indentation)
+          (skip-chars-backward " \t\n")
+          (python-nav-beginning-of-statement)
+          (cons
+           (cond ((python-info-current-line-comment-p)
+                  :after-comment)
+                 ((save-excursion
+                    (goto-char (line-end-position))
+                    (python-util-forward-comment -1)
+                    (python-nav-beginning-of-statement)
+                    (looking-at (python-rx block-ender)))
+                  :after-block-end)
+                 (t :after-line))
+           (point))))))))
 
 (defun python-indent--calculate-indentation ()
   "Internal implementation of `python-indent-calculate-indentation'.
 May return an integer for the maximum possible indentation at
 current context or a list of integers.  The latter case is only
 happening for :at-dedenter-block-start context since the
-possibilities can be narrowed to especific indentation points."
+possibilities can be narrowed to specific indentation points."
   (save-restriction
     (widen)
     (save-excursion
@@ -1075,7 +1067,7 @@ minimum."
 (defun python-indent-line (&optional previous)
   "Internal implementation of `python-indent-line-function'.
 Use the PREVIOUS level when argument is non-nil, otherwise indent
-to the maxium available level.  When indentation is the minimum
+to the maximum available level.  When indentation is the minimum
 possible and PREVIOUS is non-nil, cycle back to the maximum
 level."
   (let ((follow-indentation-p
@@ -1110,9 +1102,7 @@ indentation levels from right to left."
   (interactive "*")
   (when (and (not (bolp))
            (not (python-syntax-comment-or-string-p))
-           (= (+ (line-beginning-position)
-                 (current-indentation))
-              (point)))
+           (= (current-indentation) (current-column)))
       (python-indent-line t)
       t))
 
diff --git a/lisp/simple.el b/lisp/simple.el
index b78286d..2f09042 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -4865,7 +4865,7 @@ For some commands, it may be appropriate to ignore the 
value of
        (or use-empty-active-region (> (region-end) (region-beginning)))))
 
 (defun region-active-p ()
-  "Return t if Transient Mark mode is enabled and the mark is active.
+  "Return non-nil if Transient Mark mode is enabled and the mark is active.
 
 Some commands act specially on the region when Transient Mark
 mode is enabled.  Usually, such commands should use
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index 115c1e0..7f050e9 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -263,6 +263,7 @@ distribution.  Mixed-case symbols are convenience aliases.")
 The file name is expected after the command, either in braces or separated
 by whitespace."
   :group 'reftex-table-of-contents-browser
+  :set 'reftex-set-dirty
   :type '(repeat string))
 
 (defcustom reftex-max-section-depth 12
@@ -866,13 +867,17 @@ DOWNCASE    t:   Downcase words before using them."
                          (string :tag ""))
                 (option (boolean :tag "Downcase words          "))))
 
-(defcustom reftex-label-regexps
-  '(;; Normal \\label{foo} labels
-    "\\\\label{\\(?1:[^}]*\\)}"
-    ;; keyvals [..., label = {foo}, ...] forms used by ctable,
-    ;; listings, minted, ...
-    "\\[[^]]*\\<label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?")
-  "List of regexps matching \\label definitions.
+(if (featurep 'xemacs)
+    ;; XEmacs 21.5 doesn't have explicitly numbered matching groups,
+    ;; so this list mustn't get any more items.
+    (defconst reftex-label-regexps '("\\\\label{\\([^}]*\\)}"))
+  (defcustom reftex-label-regexps
+    '(;; Normal \\label{foo} labels
+      "\\\\label{\\(?1:[^}]*\\)}"
+      ;; keyvals [..., label = {foo}, ...] forms used by ctable,
+      ;; listings, minted, ...
+      "\\[[^]]*\\<label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?")
+    "List of regexps matching \\label definitions.
 The default value matches usual \\label{...} definitions and
 keyval style [..., label = {...}, ...] label definitions.  It is
 assumed that the regexp group 1 matches the label text, so you
@@ -881,13 +886,13 @@ have to define it using \\(?1:...\\) when adding new 
regexps.
 When changed from Lisp, make sure to call
 `reftex-compile-variables' afterwards to make the change
 effective."
-  :version "24.4"
-  :set (lambda (symbol value)
-        (set symbol value)
-        (when (fboundp 'reftex-compile-variables)
-          (reftex-compile-variables)))
-  :group 'reftex-defining-label-environments
-  :type '(repeat (regexp :tag "Regular Expression")))
+    :version "24.4"
+    :set (lambda (symbol value)
+          (set symbol value)
+          (when (fboundp 'reftex-compile-variables)
+            (reftex-compile-variables)))
+    :group 'reftex-defining-label-environments
+    :type '(repeat (regexp :tag "Regular Expression"))))
 
 (defcustom reftex-label-ignored-macros-and-environments nil
   "List of macros and environments to be ignored when searching for labels.
diff --git a/m4/dup2.m4 b/m4/dup2.m4
index 9aa2ea8..59028e0 100644
--- a/m4/dup2.m4
+++ b/m4/dup2.m4
@@ -1,4 +1,4 @@
-#serial 22
+#serial 24
 dnl Copyright (C) 2002, 2005, 2007, 2009-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -25,6 +25,12 @@ AC_DEFUN([gl_FUNC_DUP2],
              #include <limits.h>
              #include <sys/resource.h>
              #include <unistd.h>
+             #ifndef RLIM_SAVED_CUR
+             # define RLIM_SAVED_CUR RLIM_INFINITY
+             #endif
+             #ifndef RLIM_SAVED_MAX
+             # define RLIM_SAVED_MAX RLIM_INFINITY
+             #endif
            ]],
            [[int result = 0;
              int bad_fd = INT_MAX;
@@ -39,7 +45,7 @@ AC_DEFUN([gl_FUNC_DUP2],
                if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
                  result |= 1;
              #endif
-             if (dup2 (1, 1) == 0)
+             if (dup2 (1, 1) != 1)
                result |= 2;
              #ifdef FD_CLOEXEC
                if (fcntl (1, F_GETFD) != FD_CLOEXEC)
@@ -70,6 +76,8 @@ AC_DEFUN([gl_FUNC_DUP2],
              gl_cv_func_dup2_works="guessing no" ;;
            haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
              gl_cv_func_dup2_works="guessing no" ;;
+           *-android*) # implemented using dup3(), which fails if oldfd == 
newfd
+             gl_cv_func_dup2_works="guessing no" ;;
            *) gl_cv_func_dup2_works="guessing yes" ;;
          esac])
       ])
diff --git a/m4/fcntl.m4 b/m4/fcntl.m4
index 218e786..76dd867 100644
--- a/m4/fcntl.m4
+++ b/m4/fcntl.m4
@@ -1,4 +1,4 @@
-# fcntl.m4 serial 7
+# fcntl.m4 serial 8
 dnl Copyright (C) 2009-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -34,6 +34,12 @@ AC_DEFUN([gl_FUNC_FCNTL],
               #include <limits.h>
               #include <sys/resource.h>
               #include <unistd.h>
+              #ifndef RLIM_SAVED_CUR
+              # define RLIM_SAVED_CUR RLIM_INFINITY
+              #endif
+              #ifndef RLIM_SAVED_MAX
+              # define RLIM_SAVED_MAX RLIM_INFINITY
+              #endif
             ]],
             [[int result = 0;
               int bad_fd = INT_MAX;
diff --git a/src/ChangeLog b/src/ChangeLog
index 6ef5746..f0ec092 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,53 @@
+2015-02-26  Eli Zaretskii  <address@hidden>
+
+       * dispextern.h (FACE_FOR_CHAR): Fix the commentary.
+
+2015-02-26  Hans Wennborg  <address@hidden>  (tiny change)
+
+       * emacs.c (decode_env_path): Add parentheses around ternary
+       operator to increase readability and pacify compiler warnings.
+
+2015-02-26  Eli Zaretskii  <address@hidden>
+
+       * w32.c (sys_readdir): Map ERROR_NOT_READY (as in "device not
+       ready") to ENOENT.
+
+2015-02-26  Paul Eggert  <address@hidden>
+
+       * xfns.c (x_real_pos_and_offsets): Fix pointer signedness.
+
+2015-02-25  Jan Djärv  <address@hidden>
+
+       * xterm.h (struct x_output): Remove x_pixels_outer_diff,
+       y_pixels_outer_diff, FRAME_OUTER_TO_INNER_DIFF_X,
+       FRAME_OUTER_TO_INNER_DIFF_Y. Declare x_real_pos_and_offsets.
+
+       * xmenu.c (create_and_show_popup_menu): Use XTranslateCoordinates
+       instead of OUTER_TO_INNER_DIFF macros.
+
+       * xfns.c (x_real_pos_and_offsets): New function, basically the code
+       from x_real_positions.
+       (x_real_positions): Call x_real_pos_and_offsets.
+       (x_relative_mouse_position): Use XTranslateCoordinates instead of
+       OUTER_TO_INNER_DIFF macros.
+       (Fx_frame_geometry): Get offsets with x_real_pos_and_offsets,
+       border from window attributes.  Adjust tool bar and menu widths.
+
+       * w32fns.c (x_real_positions): Remove setting of x_pixels_diff,
+       y_pixels_diff.
+
+       * frame.h (struct frame): Remove x_pixels_diff, y_pixels_diff.
+
+2015-02-25  Paul Eggert  <address@hidden>
+
+       Backtrace after malloc arena is corrupted
+       Without this change, if the malloc arena is corrupted and then
+       'backtrace' is called, the backtrace can crash because 'backtrace'
+       calls 'malloc'.  For more, please see:
+       https://sourceware.org/ml/libc-alpha/2015-02/msg00678.html
+       * emacs.c (main): Initialize tables used by 'backtrace'.
+       * sysdep.c (emacs_backtrace): Document the newly used part of the API.
+
 2015-02-22  Jan Djärv  <address@hidden>
 
        * nsfns.m (Fx_frame_geometry): New function.
diff --git a/src/dispextern.h b/src/dispextern.h
index 905f2d6..b2d0a54 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1820,8 +1820,10 @@ struct face_cache
   ((FACE) == (FACE)->ascii_face)
 
 /* Return the id of the realized face on frame F that is like the face
-   with id ID but is suitable for displaying character CHAR.
-   This macro is only meaningful for multibyte character CHAR.  */
+   FACE, but is suitable for displaying character CHAR at buffer or
+   string position POS.  OBJECT is the string object, or nil for
+   buffer.  This macro is only meaningful for multibyte character
+   CHAR.  */
 
 #define FACE_FOR_CHAR(F, FACE, CHAR, POS, OBJECT)      \
   face_for_char ((F), (FACE), (CHAR), (POS), (OBJECT))
diff --git a/src/emacs.c b/src/emacs.c
index 76ddd5d..9b4a50c 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -887,6 +887,8 @@ main (int argc, char **argv)
 
   clearerr (stdin);
 
+  emacs_backtrace (-1);
+
 #if !defined SYSTEM_MALLOC && !defined HYBRID_MALLOC
   /* Arrange to get warning messages as memory fills up.  */
   memory_warnings (0, malloc_warning);
@@ -2251,7 +2253,7 @@ decode_env_path (const char *evarname, const char 
*defalt, bool empty)
       p = strchr (path, SEPCHAR);
       if (!p)
        p = path + strlen (path);
-      element = (p - path ? make_unibyte_string (path, p - path)
+      element = ((p - path) ? make_unibyte_string (path, p - path)
                 : empty_element);
       if (! NILP (element))
         {
diff --git a/src/frame.h b/src/frame.h
index 6f5de3f..ddbf93e 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -396,10 +396,6 @@ struct frame
      widths) in pixels.  */
   int pixel_width, pixel_height;
 
-  /* These many pixels are the difference between the outer window (i.e. the
-     left and top of the window manager decoration) and FRAME_X_WINDOW.  */
-  int x_pixels_diff, y_pixels_diff;
-
   /* This is the gravity value for the specified window position.  */
   int win_gravity;
 
diff --git a/src/sysdep.c b/src/sysdep.c
index a2bda96..cb361ec 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -2147,7 +2147,17 @@ snprintf (char *buf, size_t bufsize, char const *format, 
...)
 /* If a backtrace is available, output the top lines of it to stderr.
    Do not output more than BACKTRACE_LIMIT or BACKTRACE_LIMIT_MAX lines.
    This function may be called from a signal handler, so it should
-   not invoke async-unsafe functions like malloc.  */
+   not invoke async-unsafe functions like malloc.
+
+   If BACKTRACE_LIMIT is -1, initialize tables that 'backtrace' uses
+   but do not output anything.  This avoids some problems that can
+   otherwise occur if the malloc arena is corrupted before 'backtrace'
+   is called, since 'backtrace' may call malloc if the tables are not
+   initialized.
+
+   If the static variable THREAD_BACKTRACE_NPOINTERS is nonzero, a
+   fatal error has occurred in some other thread; generate a thread
+   backtrace instead, ignoring BACKTRACE_LIMIT.  */
 void
 emacs_backtrace (int backtrace_limit)
 {
diff --git a/src/w32.c b/src/w32.c
index 9009668..547db0f 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -3455,6 +3455,7 @@ sys_readdir (DIR *dirp)
              break;
            case ERROR_PATH_NOT_FOUND:
            case ERROR_INVALID_DRIVE:
+           case ERROR_NOT_READY:
            case ERROR_BAD_NETPATH:
            case ERROR_BAD_NET_NAME:
              errno = ENOENT;
diff --git a/src/w32fns.c b/src/w32fns.c
index 1e685ad..6f404e9 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -346,10 +346,6 @@ x_real_positions (struct frame *f, int *xptr, int *yptr)
   /* Convert (0, 0) in the client area to screen co-ordinates.  */
   ClientToScreen (FRAME_W32_WINDOW (f), &pt);
 
-  /* Remember x_pixels_diff and y_pixels_diff.  */
-  f->x_pixels_diff = pt.x - rect.left;
-  f->y_pixels_diff = pt.y - rect.top;
-
   *xptr = rect.left;
   *yptr = rect.top;
 }
diff --git a/src/xfns.c b/src/xfns.c
index 80be6ac..4fc92c3 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -168,12 +168,25 @@ check_x_display_info (Lisp_Object object)
   return dpyinfo;
 }
 
-/* Store the screen positions of frame F into XPTR and YPTR.
+/* Return the screen positions and offsets of frame F.
+   Store the offsets between FRAME_OUTER_WINDOW and the containing
+   window manager window into LEFT_OFFSET_X, RIGHT_OFFSET_X,
+   TOP_OFFSET_Y and BOTTOM_OFFSET_Y.
+   Store the offsets between FRAME_X_WINDOW and the containing
+   window manager window into X_PIXELS_DIFF and Y_PIXELS_DIFF.
+   Store the screen positions of frame F into XPTR and YPTR.
    These are the positions of the containing window manager window,
    not Emacs's own window.  */
-
 void
-x_real_positions (struct frame *f, int *xptr, int *yptr)
+x_real_pos_and_offsets (struct frame *f,
+                        int *left_offset_x,
+                        int *right_offset_x,
+                        int *top_offset_y,
+                        int *bottom_offset_y,
+                        int *x_pixels_diff,
+                        int *y_pixels_diff,
+                        int *xptr,
+                        int *yptr)
 {
   int win_x, win_y, outer_x IF_LINT (= 0), outer_y IF_LINT (= 0);
   int real_x = 0, real_y = 0;
@@ -187,6 +200,7 @@ x_real_positions (struct frame *f, int *xptr, int *yptr)
   Display *dpy = FRAME_X_DISPLAY (f);
   unsigned char *tmp_data = NULL;
   Atom target_type = XA_CARDINAL;
+  unsigned int ow IF_LINT (= 0), oh IF_LINT (= 0);
 
   block_input ();
 
@@ -230,7 +244,7 @@ x_real_positions (struct frame *f, int *xptr, int *yptr)
 
       /* Get the real coordinates for the WM window upper left corner */
       XGetGeometry (FRAME_X_DISPLAY (f), win,
-                    &rootw, &real_x, &real_y, &ign, &ign, &ign, &ign);
+                    &rootw, &real_x, &real_y, &ow, &oh, &ign, &ign);
 
       /* Translate real coordinates to coordinates relative to our
          window.  For our window, the upper left corner is 0, 0.
@@ -310,16 +324,39 @@ x_real_positions (struct frame *f, int *xptr, int *yptr)
 
   if (had_errors) return;
 
-  f->x_pixels_diff = -win_x;
-  f->y_pixels_diff = -win_y;
+  if (x_pixels_diff) *x_pixels_diff = -win_x;
+  if (y_pixels_diff) *y_pixels_diff = -win_y;
+
+  if (left_offset_x) *left_offset_x = -outer_x;
+  if (top_offset_y) *top_offset_y = -outer_x;
+
+  if (xptr) *xptr = real_x;
+  if (yptr) *yptr = real_y;
+
+  if (right_offset_x || bottom_offset_y)
+    {
+      int xy_ign;
+      unsigned int ign, fw, fh;
+      Window rootw;
+
+      XGetGeometry (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
+                   &rootw, &xy_ign, &xy_ign, &fw, &fh, &ign, &ign);
+      if (right_offset_x) *right_offset_x = ow - fw + outer_x;
+      if (bottom_offset_y) *bottom_offset_y = oh - fh + outer_y;
+    }
+}
 
-  FRAME_X_OUTPUT (f)->x_pixels_outer_diff = -outer_x;
-  FRAME_X_OUTPUT (f)->y_pixels_outer_diff = -outer_y;
+/* Store the screen positions of frame F into XPTR and YPTR.
+   These are the positions of the containing window manager window,
+   not Emacs's own window.  */
 
-  *xptr = real_x;
-  *yptr = real_y;
+void
+x_real_positions (struct frame *f, int *xptr, int *yptr)
+{
+  x_real_pos_and_offsets (f, NULL, NULL, NULL, NULL, NULL, NULL, xptr, yptr);
 }
 
+
 /* Get the mouse position in frame relative coordinates.  */
 
 void
@@ -351,11 +388,19 @@ x_relative_mouse_position (struct frame *f, int *x, int 
*y)
                     we don't care.  */
                  (unsigned int *) &dummy);
 
-  unblock_input ();
+  XTranslateCoordinates (FRAME_X_DISPLAY (f),
+
+                         /* From-window, to-window.  */
+                         FRAME_DISPLAY_INFO (f)->root_window,
+                         FRAME_X_WINDOW (f),
 
-  /* Translate root window coordinates to window coordinates.  */
-  *x -= f->left_pos + FRAME_OUTER_TO_INNER_DIFF_X (f);
-  *y -= f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f);
+                         /* From-position, to-position.  */
+                         *x, *y, x, y,
+
+                         /* Child of win.  */
+                         &dummy_window);
+
+  unblock_input ();
 }
 
 /* Gamma-correct COLOR on frame F.  */
@@ -4279,13 +4324,23 @@ elements (all size values are in pixels).
   Lisp_Object fullscreen = Fframe_parameter (frame, Qfullscreen);
   int menu_bar_height, menu_bar_width, tool_bar_height, tool_bar_width;
 
-  border = FRAME_OUTER_TO_INNER_DIFF_X (f);
-  title = FRAME_X_OUTPUT (f)->y_pixels_outer_diff - border;
+  int left_off, right_off, top_off, bottom_off;
+  XWindowAttributes atts;
+
+  block_input ();
+
+  XGetWindowAttributes (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &atts);
+
+  x_real_pos_and_offsets (f, &left_off, &right_off, &top_off, &bottom_off,
+                          NULL, NULL, NULL, NULL);
+
+  unblock_input ();
+
+  border = atts.border_width;
+  title = top_off;
 
-  outer_width = FRAME_PIXEL_WIDTH (f) + 2 * border;
-  outer_height = (FRAME_PIXEL_HEIGHT (f)
-                 + FRAME_OUTER_TO_INNER_DIFF_Y (f)
-                 + FRAME_OUTER_TO_INNER_DIFF_X (f));
+  outer_width = FRAME_PIXEL_WIDTH (f) + 2 * border + right_off + left_off;
+  outer_height = FRAME_PIXEL_HEIGHT (f) + 2 * border + top_off + bottom_off;
 
 #if defined (USE_GTK)
   {
@@ -4298,16 +4353,10 @@ elements (all size values are in pixels).
     tool_bar_height = (tool_bar_left_right
                       ? FRAME_PIXEL_HEIGHT (f)
                       : FRAME_TOOLBAR_HEIGHT (f));
-    if (tool_bar_left_right)
-      /* For some reason FRAME_OUTER_TO_INNER_DIFF_X does not count the
-        width of a tool bar.  */
-      outer_width += FRAME_TOOLBAR_WIDTH (f);
   }
 #else
   tool_bar_height = FRAME_TOOL_BAR_HEIGHT (f);
-  tool_bar_width = ((tool_bar_height > 0)
-                   ? outer_width - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)
-                   : 0);
+  tool_bar_width = tool_bar_height > 0 ? FRAME_PIXEL_WIDTH (f) : 0;
 #endif
 
 #if defined (USE_X_TOOLKIT) || defined (USE_GTK)
@@ -4316,9 +4365,7 @@ elements (all size values are in pixels).
   menu_bar_height = FRAME_MENU_BAR_HEIGHT (f);
 #endif
 
-  menu_bar_width = ((menu_bar_height > 0)
-                   ? outer_width - 2 * border
-                   : 0);
+  menu_bar_width = menu_bar_height > 0 ? FRAME_PIXEL_WIDTH (f) : 0;
 
   if (!FRAME_EXTERNAL_MENU_BAR (f))
     inner_height -= menu_bar_height;
diff --git a/src/xmenu.c b/src/xmenu.c
index fdf1f6f..c9f150f 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1211,13 +1211,25 @@ create_and_show_popup_menu (struct frame *f, 
widget_value *first_wv,
 
   if (use_pos_func)
     {
+      Window dummy_window;
+
       /* Not invoked by a click.  pop up at x/y.  */
       pos_func = menu_position_func;
 
       /* Adjust coordinates to be root-window-relative.  */
-      x += f->left_pos + FRAME_OUTER_TO_INNER_DIFF_X (f);
-      y += f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f);
+      block_input ();
+      XTranslateCoordinates (FRAME_X_DISPLAY (f),
+
+                             /* From-window, to-window.  */
+                             FRAME_X_WINDOW (f),
+                             FRAME_DISPLAY_INFO (f)->root_window,
 
+                             /* From-position, to-position.  */
+                             x, y, &x, &y,
+
+                             /* Child of win.  */
+                             &dummy_window);
+      unblock_input ();
       popup_x_y.x = x;
       popup_x_y.y = y;
       popup_x_y.f = f;
diff --git a/src/xterm.h b/src/xterm.h
index e597227..16868f1 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -628,15 +628,6 @@ struct x_output
      They are changed only when a different background is involved.  */
   unsigned long relief_background;
 
-  /* As x_pixels_diff, but to FRAME_OUTER_WINDOW.  For some reason the
-     two might differ by a pixel, depending on WM */
-  int x_pixels_outer_diff;
-
-  /* As y_pixels_diff, but to FRAME_OUTER_WINDOW.  In the toolkit version,
-     these may differ because this does not take into account possible
-     menubar.  y_pixels_diff is with menubar height included */
-  int y_pixels_outer_diff;
-
   /* Keep track of focus.  May be EXPLICIT if we received a FocusIn for this
      frame, or IMPLICIT if we received an EnterNotify.
      FocusOut and LeaveNotify clears EXPLICIT/IMPLICIT. */
@@ -759,16 +750,6 @@ enum
 /* This is the Colormap which frame F uses.  */
 #define FRAME_X_COLORMAP(f) FRAME_DISPLAY_INFO (f)->cmap
 
-/* The difference in pixels between the top left corner of the
-   Emacs window (including possible window manager decorations)
-   and FRAME_X_WINDOW (f).  */
-#define FRAME_OUTER_TO_INNER_DIFF_X(f) \
-     ((f)->output_data.x->x_pixels_outer_diff)
-#define FRAME_OUTER_TO_INNER_DIFF_Y(f)          \
-     ((f)->output_data.x->y_pixels_outer_diff   \
-      + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f))
-
-
 #define FRAME_XIC(f) ((f)->output_data.x->xic)
 #define FRAME_X_XIM(f) (FRAME_DISPLAY_INFO (f)->xim)
 #define FRAME_X_XIM_STYLES(f) (FRAME_DISPLAY_INFO (f)->xim_styles)
@@ -971,6 +952,15 @@ SELECTION_EVENT_DISPLAY (struct input_event *ev)
 
 extern void x_free_gcs (struct frame *);
 extern void x_relative_mouse_position (struct frame *, int *, int *);
+extern void x_real_pos_and_offsets (struct frame *f,
+                                    int *left_offset_x,
+                                    int *right_offset_x,
+                                    int *top_offset_y,
+                                    int *bottom_offset_y,
+                                    int *x_pixels_diff,
+                                    int *y_pixels_diff,
+                                    int *xptr,
+                                    int *yptr);
 
 /* From xrdb.c.  */
 
diff --git a/test/ChangeLog b/test/ChangeLog
index 7ba1496..ff3042e 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,16 @@
+2015-02-26  Fabián Ezequiel Gallina  <address@hidden>
+
+       * automated/python-tests.el
+       (python-indent-dedent-line-backspace-2)
+       (python-indent-dedent-line-backspace-3): New tests.
+
+2015-02-26  Fabián Ezequiel Gallina  <address@hidden>
+
+       * automated/python-tests.el (python-indent-pep8-1)
+       (python-indent-pep8-2, python-indent-pep8-3)
+       (python-indent-after-comment-2): Fix tests.
+       (python-indent-after-comment-3): New test.
+
 2015-02-24  Glenn Morris  <address@hidden>
 
        * automated/f90.el (f90-test-bug-19809): New test.
diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el
index 47e2a6e..b377a26 100644
--- a/test/automated/python-tests.el
+++ b/test/automated/python-tests.el
@@ -204,7 +204,7 @@ foo = long_function_name(var_one, var_two,
    (should (eq (car (python-indent-context)) :no-indent))
    (should (= (python-indent-calculate-indentation) 0))
    (python-tests-look-at "foo = long_function_name(var_one, var_two,")
-   (should (eq (car (python-indent-context)) :after-line))
+   (should (eq (car (python-indent-context)) :after-comment))
    (should (= (python-indent-calculate-indentation) 0))
    (python-tests-look-at "var_three, var_four)")
    (should (eq (car (python-indent-context)) :inside-paren))
@@ -222,7 +222,7 @@ def long_function_name(
    (should (eq (car (python-indent-context)) :no-indent))
    (should (= (python-indent-calculate-indentation) 0))
    (python-tests-look-at "def long_function_name(")
-   (should (eq (car (python-indent-context)) :after-line))
+   (should (eq (car (python-indent-context)) :after-comment))
    (should (= (python-indent-calculate-indentation) 0))
    (python-tests-look-at "var_one, var_two, var_three,")
    (should (eq (car (python-indent-context))
@@ -248,7 +248,7 @@ foo = long_function_name(
    (should (eq (car (python-indent-context)) :no-indent))
    (should (= (python-indent-calculate-indentation) 0))
    (python-tests-look-at "foo = long_function_name(")
-   (should (eq (car (python-indent-context)) :after-line))
+   (should (eq (car (python-indent-context)) :after-comment))
    (should (= (python-indent-calculate-indentation) 0))
    (python-tests-look-at "var_one, var_two,")
    (should (eq (car (python-indent-context)) :inside-paren-newline-start))
@@ -313,10 +313,10 @@ class Blag(object):
 def func(arg):
     # I don't do much
     return arg
-    # This comment is badly indented just because.
-    # But we won't mess with the user in this line.
+    # This comment is badly indented because the user forced so.
+    # At this line python.el wont dedent, user is always right.
 
-now_we_do_mess_cause_this_is_not_a_comment = 1
+comment_wins_over_ender = True
 
 # yeah, that.
 "
@@ -328,28 +328,49 @@ now_we_do_mess_cause_this_is_not_a_comment = 1
    ;; the rules won't apply here.
    (should (eq (car (python-indent-context)) :after-block-start))
    (should (= (python-indent-calculate-indentation) 4))
-   (python-tests-look-at "# This comment is badly")
+   (python-tests-look-at "# This comment is badly indented")
    (should (eq (car (python-indent-context)) :after-block-end))
-   ;; The return keyword moves indentation backwards 4 spaces, but
-   ;; let's assume this comment was placed there because the user
-   ;; wanted to (manually adding spaces or whatever).
+   ;; The return keyword do make indentation lose a level...
    (should (= (python-indent-calculate-indentation) 0))
-   (python-tests-look-at "# but we won't mess")
+   ;; ...but the current indentation was forced by the user.
+   (python-tests-look-at "# At this line python.el wont dedent")
    (should (eq (car (python-indent-context)) :after-comment))
    (should (= (python-indent-calculate-indentation) 4))
-   ;; Behave the same for blank lines: potentially a comment.
+   ;; Should behave the same for blank lines: potentially a comment.
    (forward-line 1)
    (should (eq (car (python-indent-context)) :after-comment))
    (should (= (python-indent-calculate-indentation) 4))
-   (python-tests-look-at "now_we_do_mess")
-   ;; Here is where comment indentation starts to get ignored and
-   ;; where the user can't freely indent anymore.
-   (should (eq (car (python-indent-context)) :after-block-end))
-   (should (= (python-indent-calculate-indentation) 0))
+   (python-tests-look-at "comment_wins_over_ender")
+   ;; The comment won over the ender because the user said so.
+   (should (eq (car (python-indent-context)) :after-comment))
+   (should (= (python-indent-calculate-indentation) 4))
+   ;; The indentation calculated fine for the assignment, but the user
+   ;; choose to force it back to the first column.  Next line should
+   ;; be aware of that.
    (python-tests-look-at "# yeah, that.")
    (should (eq (car (python-indent-context)) :after-line))
    (should (= (python-indent-calculate-indentation) 0))))
 
+(ert-deftest python-indent-after-comment-3 ()
+  "Test after-comment in buggy case."
+  (python-tests-with-temp-buffer
+   "
+class A(object):
+
+    def something(self, arg):
+        if True:
+            return arg
+
+    # A comment
+
+    @adecorator
+    def method(self, a, b):
+        pass
+"
+   (python-tests-look-at "@adecorator")
+   (should (eq (car (python-indent-context)) :after-comment))
+   (should (= (python-indent-calculate-indentation) 4))))
+
 (ert-deftest python-indent-inside-paren-1 ()
   "The most simple inside-paren case that shouldn't fail."
   (python-tests-with-temp-buffer
@@ -2133,6 +2154,55 @@ if True:
    (call-interactively #'python-indent-dedent-line-backspace)
    (should (zerop (current-indentation)))))
 
+(ert-deftest python-indent-dedent-line-backspace-2 ()
+  "Check de-indentation with tabs.  Bug#19730."
+  (let ((tab-width 8))
+    (python-tests-with-temp-buffer
+     "
+if x:
+\tabcdefg
+"
+     (python-tests-look-at "abcdefg")
+     (goto-char (line-end-position))
+     (call-interactively #'python-indent-dedent-line-backspace)
+     (should
+      (string= (buffer-substring-no-properties
+                (line-beginning-position) (line-end-position))
+               "\tabcdef")))))
+
+(ert-deftest python-indent-dedent-line-backspace-3 ()
+  "Paranoid check of de-indentation with tabs.  Bug#19730."
+  (let ((tab-width 8))
+    (python-tests-with-temp-buffer
+     "
+if x:
+\tif y:
+\t abcdefg
+"
+     (python-tests-look-at "abcdefg")
+     (goto-char (line-end-position))
+     (call-interactively #'python-indent-dedent-line-backspace)
+     (should
+      (string= (buffer-substring-no-properties
+                (line-beginning-position) (line-end-position))
+               "\t abcdef"))
+     (back-to-indentation)
+     (call-interactively #'python-indent-dedent-line-backspace)
+     (should
+      (string= (buffer-substring-no-properties
+                (line-beginning-position) (line-end-position))
+               "\tabcdef"))
+     (call-interactively #'python-indent-dedent-line-backspace)
+     (should
+      (string= (buffer-substring-no-properties
+                (line-beginning-position) (line-end-position))
+               "    abcdef"))
+     (call-interactively #'python-indent-dedent-line-backspace)
+     (should
+      (string= (buffer-substring-no-properties
+                (line-beginning-position) (line-end-position))
+               "abcdef")))))
+
 
 ;;; Shell integration
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]