aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2015-02-25 22:53:56 -0800
committerPaul Eggert2015-02-25 22:53:56 -0800
commitd8e9122115b5ffcec342c841b81cb2d2b8217e4b (patch)
tree477830be0a1707699381146a4ed45c53d0b928b0
parentcbd447e1cdbbebcd2a04144194138bb7936dea9d (diff)
parente726f2058c98e68c951bdb290fe68dac2a84ff65 (diff)
downloademacs-d8e9122115b5ffcec342c841b81cb2d2b8217e4b.tar.gz
emacs-d8e9122115b5ffcec342c841b81cb2d2b8217e4b.zip
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
-rw-r--r--doc/emacs/ChangeLog16
-rw-r--r--doc/emacs/custom.texi7
-rw-r--r--doc/emacs/msdos.texi37
-rw-r--r--doc/emacs/mule.texi86
-rw-r--r--doc/emacs/programs.texi2
-rw-r--r--lisp/ChangeLog35
-rw-r--r--lisp/menu-bar.el12
-rw-r--r--lisp/progmodes/cc-engine.el10
-rw-r--r--lisp/progmodes/cc-mode.el17
-rw-r--r--lisp/progmodes/python.el48
-rw-r--r--lisp/textmodes/reftex-vars.el32
-rw-r--r--src/ChangeLog14
-rw-r--r--src/dispextern.h6
-rw-r--r--src/emacs.c2
-rw-r--r--src/w32.c1
-rw-r--r--test/ChangeLog13
-rw-r--r--test/automated/python-tests.el104
17 files changed, 304 insertions, 138 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 1287733b129..13536406158 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,19 @@
12015-02-26 Eli Zaretskii <eliz@gnu.org>
2
3 * msdog.texi (Windows Files): Document characters invalid in
4 Windows file names. (Bug#19463)
5
6 * custom.texi (Customization Groups): Update the looks of the
7 Customize Group buffer.
8
9 * programs.texi (Hungry Delete): Fix a typo: "C-d" instead of
10 "C-c C-d" in hungry-delete mode.
11
122015-02-26 Eli Zaretskii <eliz@gnu.org>
13
14 * mule.texi (Language Environments): Work around refill bug in
15 makeinfo 4.x. (Bug#19697)
16
12015-01-28 Eli Zaretskii <eliz@gnu.org> 172015-01-28 Eli Zaretskii <eliz@gnu.org>
2 18
3 * cmdargs.texi (Action Arguments): Clarify into which buffer 19 * cmdargs.texi (Action Arguments): Clarify into which buffer
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index 095e49be90c..9fd823bbae1 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:
82@c @page 82@c @page
83@smallexample 83@smallexample
84@group 84@group
85To apply changes, use the Save or Set buttons. 85For help, see [Easy Customization] in the [Emacs manual].
86For details, see [Saving Customizations] in the [Emacs manual].
87 86
88________________________________________ [ Search ] 87________________________________________ [ Search ]
89 88
90 Operate on all settings in this buffer: 89 Operate on all settings in this buffer:
91 [ Set for current session ] [ Save for future sessions ] 90 [ Revert... ] [ Apply ] [ Apply and Save ]
92 [ Undo edits ] [ Reset to saved ] [ Erase customizations ] [ Exit ]
93 91
94 92
95Emacs group: Customization of the One True Editor. 93Emacs group: Customization of the One True Editor.
@@ -97,7 +95,6 @@ Emacs group: Customization of the One True Editor.
97 See also [Manual]. 95 See also [Manual].
98 96
99[Editing] : Basic text editing facilities. 97[Editing] : Basic text editing facilities.
100
101[Convenience] : Convenience features for faster editing. 98[Convenience] : Convenience features for faster editing.
102 99
103@var{more second-level groups} 100@var{more second-level groups}
diff --git a/doc/emacs/msdos.texi b/doc/emacs/msdos.texi
index b5a66503ca2..10e79236938 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
249Dired and other related features. The value of @code{nil} means never 249Dired and other related features. The value of @code{nil} means never
250issue those system calls. Non-@code{nil} values are more useful on 250issue those system calls. Non-@code{nil} values are more useful on
251NTFS volumes, which support hard links and file security, than on FAT, 251NTFS volumes, which support hard links and file security, than on FAT,
252FAT32, and XFAT volumes. 252FAT32, and exFAT volumes.
253
254@cindex file names, invalid characters on MS-Windows
255 Unlike Unix, MS-Windows file systems restrict the set of characters
256that can be used in a file name. The following characters are not
257allowed:
258
259@itemize @bullet
260@item
261Shell redirection symbols @samp{<}, @samp{>}, and @samp{|}.
262
263@item
264Colon @samp{:} (except after the drive letter).
265
266@item
267Forward slash @samp{/} and backslash @samp{\} (except as directory
268separators).
269
270@item
271Wildcard characters @samp{*} and @samp{?}.
272
273@item
274Control characters whose codepoints are 1 through 31 decimal. In
275particular, newlines in file names are not allowed.
276
277@item
278The null character, whose codepoint is zero (this limitation exists on
279Unix filesystems as well).
280@end itemize
281
282@noindent
283In addition, referencing any file whose name matches a DOS character
284device, such as @file{NUL} or @file{LPT1} or @file{PRN} or @file{CON},
285with or without any file-name extension, will always resolve to those
286character devices, in any directory. Therefore, only use such file
287names when you want to use the corresponding character device.
253 288
254@node ls in Lisp 289@node ls in Lisp
255@section Emulation of @code{ls} on MS-Windows 290@section Emulation of @code{ls} on MS-Windows
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi
index bea06f5ff5a..f8b06bdb5d9 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
265for more information about the language environment @var{lang-env}. 265for more information about the language environment @var{lang-env}.
266Supported language environments include: 266Supported language environments include:
267 267
268@c @cindex entries below are split between portions of the list to
269@c make them more accurate, i.e. land on the line that mentions the
270@c language. However, makeinfo 4.x doesn't fill inside @quotation
271@c lines that follow a @cindex entry and whose text has no whitespace.
272@c To work around, we group the language environments together, so
273@c that the blank that separates them triggers refill.
268@quotation 274@quotation
269@cindex ASCII 275@cindex ASCII
270ASCII,
271@cindex Arabic 276@cindex Arabic
272Arabic, 277ASCII, Arabic,
273@cindex Belarusian 278@cindex Belarusian
274Belarusian,
275@cindex Bengali 279@cindex Bengali
276Bengali, 280Belarusian, Bengali,
277@cindex Brazilian Portuguese 281@cindex Brazilian Portuguese
278Brazilian Portuguese,
279@cindex Bulgarian 282@cindex Bulgarian
280Bulgarian, 283Brazilian Portuguese, Bulgarian,
281@cindex Burmese 284@cindex Burmese
282Burmese,
283@cindex Cham 285@cindex Cham
284Cham, 286Burmese, Cham,
285@cindex Chinese 287@cindex Chinese
286Chinese-BIG5, Chinese-CNS, Chinese-EUC-TW, Chinese-GB, 288Chinese-BIG5, Chinese-CNS, Chinese-EUC-TW, Chinese-GB,
287Chinese-GB18030, Chinese-GBK, 289Chinese-GB18030, Chinese-GBK,
288@cindex Croatian 290@cindex Croatian
289Croatian,
290@cindex Cyrillic 291@cindex Cyrillic
291Cyrillic-ALT, Cyrillic-ISO, Cyrillic-KOI8, 292Croatian, Cyrillic-ALT, Cyrillic-ISO, Cyrillic-KOI8,
292@cindex Czech 293@cindex Czech
293Czech,
294@cindex Devanagari 294@cindex Devanagari
295Devanagari, 295Czech, Devanagari,
296@cindex Dutch 296@cindex Dutch
297Dutch,
298@cindex English 297@cindex English
299English, 298Dutch, English,
300@cindex Esperanto 299@cindex Esperanto
301Esperanto,
302@cindex Ethiopic 300@cindex Ethiopic
303Ethiopic, 301Esperanto, Ethiopic,
304@cindex French 302@cindex French
305French,
306@cindex Georgian 303@cindex Georgian
307Georgian, 304French, Georgian,
308@cindex German 305@cindex German
309German,
310@cindex Greek 306@cindex Greek
311Greek,
312@cindex Gujarati 307@cindex Gujarati
313Gujarati, 308German, Greek, Gujarati,
314@cindex Hebrew 309@cindex Hebrew
315Hebrew,
316@cindex IPA 310@cindex IPA
317IPA, 311Hebrew, IPA,
318@cindex Italian 312@cindex Italian
319Italian, 313Italian,
320@cindex Japanese 314@cindex Japanese
321Japanese,
322@cindex Kannada 315@cindex Kannada
323Kannada, 316Japanese, Kannada,
324@cindex Khmer 317@cindex Khmer
325Khmer,
326@cindex Korean 318@cindex Korean
327Korean,
328@cindex Lao 319@cindex Lao
329Lao, 320Khmer, Korean, Lao,
330@cindex Latin 321@cindex Latin
331Latin-1, Latin-2, Latin-3, Latin-4, Latin-5, Latin-6, Latin-7, 322Latin-1, Latin-2, Latin-3, Latin-4, Latin-5, Latin-6, Latin-7,
332Latin-8, Latin-9, 323Latin-8, Latin-9,
333@cindex Latvian 324@cindex Latvian
334Latvian,
335@cindex Lithuanian 325@cindex Lithuanian
336Lithuanian, 326Latvian, Lithuanian,
337@cindex Malayalam 327@cindex Malayalam
338Malayalam,
339@cindex Oriya 328@cindex Oriya
340Oriya, 329Malayalam, Oriya,
341@cindex Persian 330@cindex Persian
342Persian,
343@cindex Polish 331@cindex Polish
344Polish, 332Persian, Polish,
345@cindex Punjabi 333@cindex Punjabi
346Punjabi,
347@cindex Romanian 334@cindex Romanian
348Romanian, 335Punjabi, Romanian,
349@cindex Russian 336@cindex Russian
350Russian,
351@cindex Sinhala 337@cindex Sinhala
352Sinhala, 338Russian, Sinhala,
353@cindex Slovak 339@cindex Slovak
354Slovak,
355@cindex Slovenian 340@cindex Slovenian
356Slovenian,
357@cindex Spanish 341@cindex Spanish
358Spanish, 342Slovak, Slovenian, Spanish,
359@cindex Swedish 343@cindex Swedish
360Swedish,
361@cindex TaiViet 344@cindex TaiViet
362TaiViet, 345Swedish, TaiViet,
363@cindex Tajik 346@cindex Tajik
364Tajik,
365@cindex Tamil 347@cindex Tamil
366Tamil, 348Tajik, Tamil,
367@cindex Telugu 349@cindex Telugu
368Telugu,
369@cindex Thai 350@cindex Thai
370Thai, 351Telugu, Thai,
371@cindex Tibetan 352@cindex Tibetan
372Tibetan,
373@cindex Turkish 353@cindex Turkish
374Turkish, 354Tibetan, Turkish,
375@cindex UTF-8 355@cindex UTF-8
376UTF-8,
377@cindex Ukrainian 356@cindex Ukrainian
378Ukrainian, 357UTF-8, Ukrainian,
379@cindex Vietnamese 358@cindex Vietnamese
380Vietnamese,
381@cindex Welsh 359@cindex Welsh
382Welsh, and 360Vietnamese, Welsh,
383@cindex Windows-1255 361@cindex Windows-1255
384Windows-1255. 362and Windows-1255.
385@end quotation 363@end quotation
386 364
387 To display the script(s) used by your language environment on a 365 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 609392f6bb7..73aed087f45 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
1666 As an alternative to the above commands, you can enable @dfn{hungry 1666 As an alternative to the above commands, you can enable @dfn{hungry
1667delete mode}. When this feature is enabled (indicated by @samp{/h} in 1667delete mode}. When this feature is enabled (indicated by @samp{/h} in
1668the mode line after the mode name), a single @key{DEL} deletes all 1668the mode line after the mode name), a single @key{DEL} deletes all
1669preceding whitespace, not just one space, and a single @kbd{C-c C-d} 1669preceding whitespace, not just one space, and a single @kbd{C-d}
1670(but @emph{not} plain @key{Delete}) deletes all following whitespace. 1670(but @emph{not} plain @key{Delete}) deletes all following whitespace.
1671 1671
1672@table @kbd 1672@table @kbd
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 33e04807e87..8ccc2c35b1f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,38 @@
12015-02-26 Alan Mackenzie <acm@muc.de>
2
3 Handle "#" operator properly inside macro. Fix coding bug.
4
5 * progmodes/cc-mode.el (c-neutralize-syntax-in-and-mark-CPP): On
6 finding a "#" which looks like the start of a macro, check it
7 isn't already inside a macro.
8
9 * progmodes/cc-engine.el (c-state-safe-place): Don't record a new
10 "safe" position into the list of them when this is beyond our
11 current position.
12
132015-02-26 Martin Rudalics <rudalics@gmx.at>
14
15 * menu-bar.el (menu-bar-non-minibuffer-window-p): Return nil when
16 the menu frame is dead. (Bug#19728)
17
182015-02-26 Fabián Ezequiel Gallina <fgallina@gnu.org>
19
20 python.el: Handle tabs in python-indent-dedent-line.
21
22 * progmodes/python.el (python-indent-dedent-line): Fixes for
23 indentation with tabs. Thanks to <dale@codefu.org> (Bug#19730).
24
252015-02-26 Fabián Ezequiel Gallina <fgallina@gnu.org>
26
27 * progmodes/python.el (python-indent-context): Respect user
28 indentation after comment.
29
302015-02-26 Tassilo Horn <tsdh@gnu.org>
31
32 * textmodes/reftex-vars.el (featurep): Conditionalize value of
33 reftex-label-regexps in order to stay compatible with XEmacs 21.5
34 which has no explicitly numbered groups in regexps (bug#19714).
35
12015-02-26 Daiki Ueno <ueno@gnu.org> 362015-02-26 Daiki Ueno <ueno@gnu.org>
2 37
3 * net/dbus.el (dbus-register-signal): Convert "N" of ":argN" to 38 * net/dbus.el (dbus-register-signal): Convert "N" of ":argN" to
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index cd1a4d05b55..5fdb9377a48 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."
1747 (frame-visible-p menu-frame)))) 1747 (frame-visible-p menu-frame))))
1748 1748
1749(defun menu-bar-non-minibuffer-window-p () 1749(defun menu-bar-non-minibuffer-window-p ()
1750 "Return non-nil if selected window of the menu frame is not a minibuf window. 1750 "Return non-nil if the menu frame's selected window is no minibuffer window.
1751 1751Return nil if the menu frame is dead or its selected window is a
1752See the documentation of `menu-bar-menu-frame-live-and-visible-p' 1752minibuffer window. The menu frame is the frame for which we are
1753for the definition of the menu frame." 1753updating the menu."
1754 (let ((menu-frame (or menu-updating-frame (selected-frame)))) 1754 (let ((menu-frame (or menu-updating-frame (selected-frame))))
1755 (not (window-minibuffer-p (frame-selected-window menu-frame))))) 1755 (and (frame-live-p menu-frame)
1756 (not (window-minibuffer-p
1757 (frame-selected-window menu-frame))))))
1756 1758
1757(defun kill-this-buffer () ; for the menu bar 1759(defun kill-this-buffer () ; for the menu bar
1758 "Kill the current buffer. 1760 "Kill the current buffer.
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 328e0f79a1c..823d795b6de 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."
2277 (while 2277 (while
2278 ;; Add an element to `c-state-nonlit-pos-cache' each iteration. 2278 ;; Add an element to `c-state-nonlit-pos-cache' each iteration.
2279 (and 2279 (and
2280 (<= (setq npos (+ pos c-state-nonlit-pos-interval)) here) 2280 (setq npos
2281 (when (<= (+ pos c-state-nonlit-pos-interval) here)
2282 (+ pos c-state-nonlit-pos-interval)))
2281 2283
2282 ;; Test for being in a literal. If so, go to after it. 2284 ;; Test for being in a literal. If so, go to after it.
2283 (progn 2285 (progn
@@ -2304,7 +2306,9 @@ comment at the start of cc-engine.el for more info."
2304 ;; Add one extra element above HERE so as to to avoid the previous 2306 ;; Add one extra element above HERE so as to to avoid the previous
2305 ;; expensive calculation when the next call is close to the current 2307 ;; expensive calculation when the next call is close to the current
2306 ;; one. This is especially useful when inside a large macro. 2308 ;; one. This is especially useful when inside a large macro.
2307 (setq c-state-nonlit-pos-cache (cons npos c-state-nonlit-pos-cache))) 2309 (when npos
2310 (setq c-state-nonlit-pos-cache
2311 (cons npos c-state-nonlit-pos-cache))))
2308 2312
2309 (if (> pos c-state-nonlit-pos-cache-limit) 2313 (if (> pos c-state-nonlit-pos-cache-limit)
2310 (setq c-state-nonlit-pos-cache-limit pos)) 2314 (setq c-state-nonlit-pos-cache-limit pos))
@@ -3069,7 +3073,7 @@ comment at the start of cc-engine.el for more info."
3069 (setq dropped-cons (consp (car c-state-cache))) 3073 (setq dropped-cons (consp (car c-state-cache)))
3070 (setq c-state-cache (cdr c-state-cache)) 3074 (setq c-state-cache (cdr c-state-cache))
3071 (setq pos pa)) 3075 (setq pos pa))
3072 ;; At this stage, (> pos here); 3076 ;; At this stage, (>= pos here);
3073 ;; (< (c-state-cache-top-lparen) here) (or is nil). 3077 ;; (< (c-state-cache-top-lparen) here) (or is nil).
3074 3078
3075 (cond 3079 (cond
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 01e93b3f202..c02192608b2 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."
968 (let ((pps-position (point)) pps-state mbeg) 968 (let ((pps-position (point)) pps-state mbeg)
969 (while (and (< (point) c-new-END) 969 (while (and (< (point) c-new-END)
970 (search-forward-regexp c-anchored-cpp-prefix c-new-END t)) 970 (search-forward-regexp c-anchored-cpp-prefix c-new-END t))
971 ;; If we've found a "#" inside a string/comment, ignore it. 971 ;; If we've found a "#" inside a macro/string/comment, ignore it.
972 (setq pps-state 972 (unless
973 (parse-partial-sexp pps-position (point) nil nil pps-state) 973 (or (save-excursion
974 pps-position (point)) 974 (goto-char (match-beginning 0))
975 (unless (or (nth 3 pps-state) ; in a string? 975 (c-beginning-of-macro))
976 (nth 4 pps-state)) ; in a comment? 976 (progn
977 (setq pps-state
978 (parse-partial-sexp pps-position (point) nil nil pps-state)
979 pps-position (point))
980 (or (nth 3 pps-state) ; in a string?
981 (nth 4 pps-state)))) ; in a comment?
977 (goto-char (match-beginning 1)) 982 (goto-char (match-beginning 1))
978 (setq mbeg (point)) 983 (setq mbeg (point))
979 (if (> (c-syntactic-end-of-macro) mbeg) 984 (if (> (c-syntactic-end-of-macro) mbeg)
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 4420faf3dfc..1c3f7466c8c 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -843,15 +843,6 @@ keyword
843 ;; Beginning of buffer. 843 ;; Beginning of buffer.
844 ((= (line-number-at-pos) 1) 844 ((= (line-number-at-pos) 1)
845 (cons :no-indent 0)) 845 (cons :no-indent 0))
846 ;; Comment continuation (maybe).
847 ((save-excursion
848 (when (and
849 (or
850 (python-info-current-line-comment-p)
851 (python-info-current-line-empty-p))
852 (forward-comment -1)
853 (python-info-current-line-comment-p))
854 (cons :after-comment (point)))))
855 ;; Inside a string. 846 ;; Inside a string.
856 ((let ((start (python-syntax-context 'string ppss))) 847 ((let ((start (python-syntax-context 'string ppss)))
857 (when start 848 (when start
@@ -963,28 +954,29 @@ keyword
963 ((let ((start (python-info-dedenter-statement-p))) 954 ((let ((start (python-info-dedenter-statement-p)))
964 (when start 955 (when start
965 (cons :at-dedenter-block-start start)))) 956 (cons :at-dedenter-block-start start))))
966 ;; After normal line. 957 ;; After normal line, comment or ender (default case).
967 ((let ((start (save-excursion 958 ((save-excursion
968 (back-to-indentation) 959 (back-to-indentation)
969 (skip-chars-backward " \t\n") 960 (skip-chars-backward " \t\n")
970 (python-nav-beginning-of-statement) 961 (python-nav-beginning-of-statement)
971 (point)))) 962 (cons
972 (when start 963 (cond ((python-info-current-line-comment-p)
973 (if (save-excursion 964 :after-comment)
974 (python-util-forward-comment -1) 965 ((save-excursion
975 (python-nav-beginning-of-statement) 966 (goto-char (line-end-position))
976 (looking-at (python-rx block-ender))) 967 (python-util-forward-comment -1)
977 (cons :after-block-end start) 968 (python-nav-beginning-of-statement)
978 (cons :after-line start))))) 969 (looking-at (python-rx block-ender)))
979 ;; Default case: do not indent. 970 :after-block-end)
980 (t (cons :no-indent 0)))))) 971 (t :after-line))
972 (point))))))))
981 973
982(defun python-indent--calculate-indentation () 974(defun python-indent--calculate-indentation ()
983 "Internal implementation of `python-indent-calculate-indentation'. 975 "Internal implementation of `python-indent-calculate-indentation'.
984May return an integer for the maximum possible indentation at 976May return an integer for the maximum possible indentation at
985current context or a list of integers. The latter case is only 977current context or a list of integers. The latter case is only
986happening for :at-dedenter-block-start context since the 978happening for :at-dedenter-block-start context since the
987possibilities can be narrowed to especific indentation points." 979possibilities can be narrowed to specific indentation points."
988 (save-restriction 980 (save-restriction
989 (widen) 981 (widen)
990 (save-excursion 982 (save-excursion
@@ -1075,7 +1067,7 @@ minimum."
1075(defun python-indent-line (&optional previous) 1067(defun python-indent-line (&optional previous)
1076 "Internal implementation of `python-indent-line-function'. 1068 "Internal implementation of `python-indent-line-function'.
1077Use the PREVIOUS level when argument is non-nil, otherwise indent 1069Use the PREVIOUS level when argument is non-nil, otherwise indent
1078to the maxium available level. When indentation is the minimum 1070to the maximum available level. When indentation is the minimum
1079possible and PREVIOUS is non-nil, cycle back to the maximum 1071possible and PREVIOUS is non-nil, cycle back to the maximum
1080level." 1072level."
1081 (let ((follow-indentation-p 1073 (let ((follow-indentation-p
@@ -1110,9 +1102,7 @@ indentation levels from right to left."
1110 (interactive "*") 1102 (interactive "*")
1111 (when (and (not (bolp)) 1103 (when (and (not (bolp))
1112 (not (python-syntax-comment-or-string-p)) 1104 (not (python-syntax-comment-or-string-p))
1113 (= (+ (line-beginning-position) 1105 (= (current-indentation) (current-column)))
1114 (current-indentation))
1115 (point)))
1116 (python-indent-line t) 1106 (python-indent-line t)
1117 t)) 1107 t))
1118 1108
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index 7fe6882d3ca..7f050e9fd90 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -867,13 +867,17 @@ DOWNCASE t: Downcase words before using them."
867 (string :tag "")) 867 (string :tag ""))
868 (option (boolean :tag "Downcase words ")))) 868 (option (boolean :tag "Downcase words "))))
869 869
870(defcustom reftex-label-regexps 870(if (featurep 'xemacs)
871 '(;; Normal \\label{foo} labels 871 ;; XEmacs 21.5 doesn't have explicitly numbered matching groups,
872 "\\\\label{\\(?1:[^}]*\\)}" 872 ;; so this list mustn't get any more items.
873 ;; keyvals [..., label = {foo}, ...] forms used by ctable, 873 (defconst reftex-label-regexps '("\\\\label{\\([^}]*\\)}"))
874 ;; listings, minted, ... 874 (defcustom reftex-label-regexps
875 "\\[[^]]*\\<label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?") 875 '(;; Normal \\label{foo} labels
876 "List of regexps matching \\label definitions. 876 "\\\\label{\\(?1:[^}]*\\)}"
877 ;; keyvals [..., label = {foo}, ...] forms used by ctable,
878 ;; listings, minted, ...
879 "\\[[^]]*\\<label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?")
880 "List of regexps matching \\label definitions.
877The default value matches usual \\label{...} definitions and 881The default value matches usual \\label{...} definitions and
878keyval style [..., label = {...}, ...] label definitions. It is 882keyval style [..., label = {...}, ...] label definitions. It is
879assumed that the regexp group 1 matches the label text, so you 883assumed 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.
882When changed from Lisp, make sure to call 886When changed from Lisp, make sure to call
883`reftex-compile-variables' afterwards to make the change 887`reftex-compile-variables' afterwards to make the change
884effective." 888effective."
885 :version "24.4" 889 :version "24.4"
886 :set (lambda (symbol value) 890 :set (lambda (symbol value)
887 (set symbol value) 891 (set symbol value)
888 (when (fboundp 'reftex-compile-variables) 892 (when (fboundp 'reftex-compile-variables)
889 (reftex-compile-variables))) 893 (reftex-compile-variables)))
890 :group 'reftex-defining-label-environments 894 :group 'reftex-defining-label-environments
891 :type '(repeat (regexp :tag "Regular Expression"))) 895 :type '(repeat (regexp :tag "Regular Expression"))))
892 896
893(defcustom reftex-label-ignored-macros-and-environments nil 897(defcustom reftex-label-ignored-macros-and-environments nil
894 "List of macros and environments to be ignored when searching for labels. 898 "List of macros and environments to be ignored when searching for labels.
diff --git a/src/ChangeLog b/src/ChangeLog
index 37e6d20eb83..f0ec092c068 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,17 @@
12015-02-26 Eli Zaretskii <eliz@gnu.org>
2
3 * dispextern.h (FACE_FOR_CHAR): Fix the commentary.
4
52015-02-26 Hans Wennborg <hwennborg@google.com> (tiny change)
6
7 * emacs.c (decode_env_path): Add parentheses around ternary
8 operator to increase readability and pacify compiler warnings.
9
102015-02-26 Eli Zaretskii <eliz@gnu.org>
11
12 * w32.c (sys_readdir): Map ERROR_NOT_READY (as in "device not
13 ready") to ENOENT.
14
12015-02-26 Paul Eggert <eggert@cs.ucla.edu> 152015-02-26 Paul Eggert <eggert@cs.ucla.edu>
2 16
3 * xfns.c (x_real_pos_and_offsets): Fix pointer signedness. 17 * xfns.c (x_real_pos_and_offsets): Fix pointer signedness.
diff --git a/src/dispextern.h b/src/dispextern.h
index 5f730df514b..329572eda22 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1810,8 +1810,10 @@ struct face_cache
1810 ((FACE) == (FACE)->ascii_face) 1810 ((FACE) == (FACE)->ascii_face)
1811 1811
1812/* Return the id of the realized face on frame F that is like the face 1812/* Return the id of the realized face on frame F that is like the face
1813 with id ID but is suitable for displaying character CHAR. 1813 FACE, but is suitable for displaying character CHAR at buffer or
1814 This macro is only meaningful for multibyte character CHAR. */ 1814 string position POS. OBJECT is the string object, or nil for
1815 buffer. This macro is only meaningful for multibyte character
1816 CHAR. */
1815 1817
1816#define FACE_FOR_CHAR(F, FACE, CHAR, POS, OBJECT) \ 1818#define FACE_FOR_CHAR(F, FACE, CHAR, POS, OBJECT) \
1817 face_for_char ((F), (FACE), (CHAR), (POS), (OBJECT)) 1819 face_for_char ((F), (FACE), (CHAR), (POS), (OBJECT))
diff --git a/src/emacs.c b/src/emacs.c
index c2b698ba50b..cb0c8417794 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -2247,7 +2247,7 @@ decode_env_path (const char *evarname, const char *defalt, bool empty)
2247 p = strchr (path, SEPCHAR); 2247 p = strchr (path, SEPCHAR);
2248 if (!p) 2248 if (!p)
2249 p = path + strlen (path); 2249 p = path + strlen (path);
2250 element = (p - path ? make_unibyte_string (path, p - path) 2250 element = ((p - path) ? make_unibyte_string (path, p - path)
2251 : empty_element); 2251 : empty_element);
2252 if (! NILP (element)) 2252 if (! NILP (element))
2253 { 2253 {
diff --git a/src/w32.c b/src/w32.c
index 90096689776..547db0f6dd9 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -3455,6 +3455,7 @@ sys_readdir (DIR *dirp)
3455 break; 3455 break;
3456 case ERROR_PATH_NOT_FOUND: 3456 case ERROR_PATH_NOT_FOUND:
3457 case ERROR_INVALID_DRIVE: 3457 case ERROR_INVALID_DRIVE:
3458 case ERROR_NOT_READY:
3458 case ERROR_BAD_NETPATH: 3459 case ERROR_BAD_NETPATH:
3459 case ERROR_BAD_NET_NAME: 3460 case ERROR_BAD_NET_NAME:
3460 errno = ENOENT; 3461 errno = ENOENT;
diff --git a/test/ChangeLog b/test/ChangeLog
index 7ba14964c0a..ff3042e8cbf 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,16 @@
12015-02-26 Fabián Ezequiel Gallina <fgallina@gnu.org>
2
3 * automated/python-tests.el
4 (python-indent-dedent-line-backspace-2)
5 (python-indent-dedent-line-backspace-3): New tests.
6
72015-02-26 Fabián Ezequiel Gallina <fgallina@gnu.org>
8
9 * automated/python-tests.el (python-indent-pep8-1)
10 (python-indent-pep8-2, python-indent-pep8-3)
11 (python-indent-after-comment-2): Fix tests.
12 (python-indent-after-comment-3): New test.
13
12015-02-24 Glenn Morris <rgm@gnu.org> 142015-02-24 Glenn Morris <rgm@gnu.org>
2 15
3 * automated/f90.el (f90-test-bug-19809): New test. 16 * automated/f90.el (f90-test-bug-19809): New test.
diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el
index 47e2a6e8195..b377a26f77a 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,
204 (should (eq (car (python-indent-context)) :no-indent)) 204 (should (eq (car (python-indent-context)) :no-indent))
205 (should (= (python-indent-calculate-indentation) 0)) 205 (should (= (python-indent-calculate-indentation) 0))
206 (python-tests-look-at "foo = long_function_name(var_one, var_two,") 206 (python-tests-look-at "foo = long_function_name(var_one, var_two,")
207 (should (eq (car (python-indent-context)) :after-line)) 207 (should (eq (car (python-indent-context)) :after-comment))
208 (should (= (python-indent-calculate-indentation) 0)) 208 (should (= (python-indent-calculate-indentation) 0))
209 (python-tests-look-at "var_three, var_four)") 209 (python-tests-look-at "var_three, var_four)")
210 (should (eq (car (python-indent-context)) :inside-paren)) 210 (should (eq (car (python-indent-context)) :inside-paren))
@@ -222,7 +222,7 @@ def long_function_name(
222 (should (eq (car (python-indent-context)) :no-indent)) 222 (should (eq (car (python-indent-context)) :no-indent))
223 (should (= (python-indent-calculate-indentation) 0)) 223 (should (= (python-indent-calculate-indentation) 0))
224 (python-tests-look-at "def long_function_name(") 224 (python-tests-look-at "def long_function_name(")
225 (should (eq (car (python-indent-context)) :after-line)) 225 (should (eq (car (python-indent-context)) :after-comment))
226 (should (= (python-indent-calculate-indentation) 0)) 226 (should (= (python-indent-calculate-indentation) 0))
227 (python-tests-look-at "var_one, var_two, var_three,") 227 (python-tests-look-at "var_one, var_two, var_three,")
228 (should (eq (car (python-indent-context)) 228 (should (eq (car (python-indent-context))
@@ -248,7 +248,7 @@ foo = long_function_name(
248 (should (eq (car (python-indent-context)) :no-indent)) 248 (should (eq (car (python-indent-context)) :no-indent))
249 (should (= (python-indent-calculate-indentation) 0)) 249 (should (= (python-indent-calculate-indentation) 0))
250 (python-tests-look-at "foo = long_function_name(") 250 (python-tests-look-at "foo = long_function_name(")
251 (should (eq (car (python-indent-context)) :after-line)) 251 (should (eq (car (python-indent-context)) :after-comment))
252 (should (= (python-indent-calculate-indentation) 0)) 252 (should (= (python-indent-calculate-indentation) 0))
253 (python-tests-look-at "var_one, var_two,") 253 (python-tests-look-at "var_one, var_two,")
254 (should (eq (car (python-indent-context)) :inside-paren-newline-start)) 254 (should (eq (car (python-indent-context)) :inside-paren-newline-start))
@@ -313,10 +313,10 @@ class Blag(object):
313def func(arg): 313def func(arg):
314 # I don't do much 314 # I don't do much
315 return arg 315 return arg
316 # This comment is badly indented just because. 316 # This comment is badly indented because the user forced so.
317 # But we won't mess with the user in this line. 317 # At this line python.el wont dedent, user is always right.
318 318
319now_we_do_mess_cause_this_is_not_a_comment = 1 319comment_wins_over_ender = True
320 320
321# yeah, that. 321# yeah, that.
322" 322"
@@ -328,28 +328,49 @@ now_we_do_mess_cause_this_is_not_a_comment = 1
328 ;; the rules won't apply here. 328 ;; the rules won't apply here.
329 (should (eq (car (python-indent-context)) :after-block-start)) 329 (should (eq (car (python-indent-context)) :after-block-start))
330 (should (= (python-indent-calculate-indentation) 4)) 330 (should (= (python-indent-calculate-indentation) 4))
331 (python-tests-look-at "# This comment is badly") 331 (python-tests-look-at "# This comment is badly indented")
332 (should (eq (car (python-indent-context)) :after-block-end)) 332 (should (eq (car (python-indent-context)) :after-block-end))
333 ;; The return keyword moves indentation backwards 4 spaces, but 333 ;; The return keyword do make indentation lose a level...
334 ;; let's assume this comment was placed there because the user
335 ;; wanted to (manually adding spaces or whatever).
336 (should (= (python-indent-calculate-indentation) 0)) 334 (should (= (python-indent-calculate-indentation) 0))
337 (python-tests-look-at "# but we won't mess") 335 ;; ...but the current indentation was forced by the user.
336 (python-tests-look-at "# At this line python.el wont dedent")
338 (should (eq (car (python-indent-context)) :after-comment)) 337 (should (eq (car (python-indent-context)) :after-comment))
339 (should (= (python-indent-calculate-indentation) 4)) 338 (should (= (python-indent-calculate-indentation) 4))
340 ;; Behave the same for blank lines: potentially a comment. 339 ;; Should behave the same for blank lines: potentially a comment.
341 (forward-line 1) 340 (forward-line 1)
342 (should (eq (car (python-indent-context)) :after-comment)) 341 (should (eq (car (python-indent-context)) :after-comment))
343 (should (= (python-indent-calculate-indentation) 4)) 342 (should (= (python-indent-calculate-indentation) 4))
344 (python-tests-look-at "now_we_do_mess") 343 (python-tests-look-at "comment_wins_over_ender")
345 ;; Here is where comment indentation starts to get ignored and 344 ;; The comment won over the ender because the user said so.
346 ;; where the user can't freely indent anymore. 345 (should (eq (car (python-indent-context)) :after-comment))
347 (should (eq (car (python-indent-context)) :after-block-end)) 346 (should (= (python-indent-calculate-indentation) 4))
348 (should (= (python-indent-calculate-indentation) 0)) 347 ;; The indentation calculated fine for the assignment, but the user
348 ;; choose to force it back to the first column. Next line should
349 ;; be aware of that.
349 (python-tests-look-at "# yeah, that.") 350 (python-tests-look-at "# yeah, that.")
350 (should (eq (car (python-indent-context)) :after-line)) 351 (should (eq (car (python-indent-context)) :after-line))
351 (should (= (python-indent-calculate-indentation) 0)))) 352 (should (= (python-indent-calculate-indentation) 0))))
352 353
354(ert-deftest python-indent-after-comment-3 ()
355 "Test after-comment in buggy case."
356 (python-tests-with-temp-buffer
357 "
358class A(object):
359
360 def something(self, arg):
361 if True:
362 return arg
363
364 # A comment
365
366 @adecorator
367 def method(self, a, b):
368 pass
369"
370 (python-tests-look-at "@adecorator")
371 (should (eq (car (python-indent-context)) :after-comment))
372 (should (= (python-indent-calculate-indentation) 4))))
373
353(ert-deftest python-indent-inside-paren-1 () 374(ert-deftest python-indent-inside-paren-1 ()
354 "The most simple inside-paren case that shouldn't fail." 375 "The most simple inside-paren case that shouldn't fail."
355 (python-tests-with-temp-buffer 376 (python-tests-with-temp-buffer
@@ -2133,6 +2154,55 @@ if True:
2133 (call-interactively #'python-indent-dedent-line-backspace) 2154 (call-interactively #'python-indent-dedent-line-backspace)
2134 (should (zerop (current-indentation))))) 2155 (should (zerop (current-indentation)))))
2135 2156
2157(ert-deftest python-indent-dedent-line-backspace-2 ()
2158 "Check de-indentation with tabs. Bug#19730."
2159 (let ((tab-width 8))
2160 (python-tests-with-temp-buffer
2161 "
2162if x:
2163\tabcdefg
2164"
2165 (python-tests-look-at "abcdefg")
2166 (goto-char (line-end-position))
2167 (call-interactively #'python-indent-dedent-line-backspace)
2168 (should
2169 (string= (buffer-substring-no-properties
2170 (line-beginning-position) (line-end-position))
2171 "\tabcdef")))))
2172
2173(ert-deftest python-indent-dedent-line-backspace-3 ()
2174 "Paranoid check of de-indentation with tabs. Bug#19730."
2175 (let ((tab-width 8))
2176 (python-tests-with-temp-buffer
2177 "
2178if x:
2179\tif y:
2180\t abcdefg
2181"
2182 (python-tests-look-at "abcdefg")
2183 (goto-char (line-end-position))
2184 (call-interactively #'python-indent-dedent-line-backspace)
2185 (should
2186 (string= (buffer-substring-no-properties
2187 (line-beginning-position) (line-end-position))
2188 "\t abcdef"))
2189 (back-to-indentation)
2190 (call-interactively #'python-indent-dedent-line-backspace)
2191 (should
2192 (string= (buffer-substring-no-properties
2193 (line-beginning-position) (line-end-position))
2194 "\tabcdef"))
2195 (call-interactively #'python-indent-dedent-line-backspace)
2196 (should
2197 (string= (buffer-substring-no-properties
2198 (line-beginning-position) (line-end-position))
2199 " abcdef"))
2200 (call-interactively #'python-indent-dedent-line-backspace)
2201 (should
2202 (string= (buffer-substring-no-properties
2203 (line-beginning-position) (line-end-position))
2204 "abcdef")))))
2205
2136 2206
2137;;; Shell integration 2207;;; Shell integration
2138 2208