[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master d8e9122 4/4: Merge from origin/emacs-24
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master d8e9122 4/4: Merge from origin/emacs-24 |
Date: |
Thu, 26 Feb 2015 06:59:18 +0000 |
branch: master
commit d8e9122115b5ffcec342c841b81cb2d2b8217e4b
Merge: cbd447e e726f20
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
Merge from origin/emacs-24
e726f20 Handle "#" operator properly inside macro. Fix coding bug.
618931b Handle dead frame in menu-bar-non-minibuffer-window-p. (Bug#19728)
017a03a Document MS-Windows file-name idiosyncrasies (Bug#19463)
f3faf4f Fix description of Customize buffer in Emacs manual.
1c1d0b7 Fix a typo in the Emacs manual's Hungry Delete description.
be7fb82 src/dispextern.h (FACE_FOR_CHAR): Fix the commentary.
33c4409 Spelling fixes
6c8231e python.el: Handle tabs in python-indent-dedent-line.
41c3b92 * lisp/progmodes/python.el: Respect user indentation after comment.
868df45 Avoid compiler warnings in decode_env_path.
b28c979 Fix XEmacs version typo in comment and ChangeLog
989fb32 Improve solution of bug #19701
6310530 Fix refilling of list of language environments in User Manual
c4c447d Restore XEmacs compatibility
Conflicts:
doc/emacs/ChangeLog
lisp/ChangeLog
src/ChangeLog
test/ChangeLog
---
doc/emacs/ChangeLog | 16 ++++++
doc/emacs/custom.texi | 7 +--
doc/emacs/msdos.texi | 37 ++++++++++++++-
doc/emacs/mule.texi | 86 ++++++++++++---------------------
doc/emacs/programs.texi | 2 +-
lisp/ChangeLog | 35 +++++++++++++
lisp/menu-bar.el | 12 +++--
lisp/progmodes/cc-engine.el | 10 +++-
lisp/progmodes/cc-mode.el | 17 ++++--
lisp/progmodes/python.el | 48 +++++++-----------
lisp/textmodes/reftex-vars.el | 32 +++++++-----
src/ChangeLog | 14 +++++
src/dispextern.h | 6 ++-
src/emacs.c | 2 +-
src/w32.c | 1 +
test/ChangeLog | 13 +++++
test/automated/python-tests.el | 104 +++++++++++++++++++++++++++++++++-------
17 files changed, 304 insertions(+), 138 deletions(-)
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/lisp/ChangeLog b/lisp/ChangeLog
index 33e0480..8ccc2c3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,38 @@
+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
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/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/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/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index 7fe6882..7f050e9 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -867,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
@@ -882,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/src/ChangeLog b/src/ChangeLog
index 37e6d20..f0ec092 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,17 @@
+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.
diff --git a/src/dispextern.h b/src/dispextern.h
index 5f730df..329572e 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1810,8 +1810,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 c2b698b..cb0c841 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -2247,7 +2247,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/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/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