From c4c447d8cca960513428eb3cfde73adca627d566 Mon Sep 17 00:00:00 2001 From: Tassilo Horn Date: Thu, 29 Jan 2015 15:51:40 +0100 Subject: [PATCH 01/14] Restore XEmacs compatibility * textmodes/reftex-vars.el (featurep): Conditionalize value of reftex-label-regexps in order to stay compatible with XEmacs 25 which has no explicitly numbered groups in regexps (bug#19714). --- lisp/ChangeLog | 6 ++++++ lisp/textmodes/reftex-vars.el | 32 ++++++++++++++++++-------------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2c852f9a40a..2811556c71c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2015-01-29 Tassilo Horn + + * textmodes/reftex-vars.el (featurep): Conditionalize value of + reftex-label-regexps in order to stay compatible with XEmacs 25 + which has no explicitly numbered groups in regexps (bug#19714). + 2015-01-28 Tassilo Horn * textmodes/reftex.el (reftex-syntax-table-for-bib): Give ( and ) diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el index 115c1e0cde4..96d76fb011b 100644 --- a/lisp/textmodes/reftex-vars.el +++ b/lisp/textmodes/reftex-vars.el @@ -866,13 +866,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, ... - "\\[[^]]*\\ Date: Thu, 29 Jan 2015 18:51:24 +0200 Subject: [PATCH 02/14] Fix refilling of list of language environments in User Manual (Bug#19697) doc/emacs/mule.texi (Language Environments): Work around refill bug in makeinfo 4.x. --- doc/emacs/ChangeLog | 5 +++ doc/emacs/mule.texi | 86 +++++++++++++++++---------------------------- 2 files changed, 37 insertions(+), 54 deletions(-) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 93ae618d1bc..24d94f95454 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,8 @@ +2015-01-29 Eli Zaretskii + + * mule.texi (Language Environments): Work around refill bug in + makeinfo 4.x. (Bug#19697) + 2015-01-26 Eli Zaretskii * cmdargs.texi (Action Arguments): Clarify into which buffer 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 for more information about the language environment @var{lang-env}. Supported language environments include: +@c @cindex entries below are split between portions of the list to +@c make them more accurate, i.e. land on the line that mentions the +@c language. However, makeinfo 4.x doesn't fill inside @quotation +@c lines that follow a @cindex entry and whose text has no whitespace. +@c To work around, we group the language environments together, so +@c 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 From 989fb32064c890dd6df4aa77da5394e655af6f51 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 29 Jan 2015 20:43:08 +0200 Subject: [PATCH 03/14] Improve solution of bug #19701 src/w32.c (sys_readdir): Map ERROR_NOT_READY (as in "device not ready") to ENOENT. --- src/ChangeLog | 5 +++++ src/w32.c | 1 + 2 files changed, 6 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index dc495089739..08779405acb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2015-01-29 Eli Zaretskii + + * w32.c (sys_readdir): Map ERROR_NOT_READY (as in "device not + ready") to ENOENT. + 2015-01-28 Eli Zaretskii * dired.c (directory_files_internal, file_name_completion) diff --git a/src/w32.c b/src/w32.c index 2faa742f9d7..f8284f3e4cc 100644 --- a/src/w32.c +++ b/src/w32.c @@ -3454,6 +3454,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; From b28c97942e29eb193951e56b6b8c2b7f21763333 Mon Sep 17 00:00:00 2001 From: Tassilo Horn Date: Thu, 29 Jan 2015 20:28:16 +0100 Subject: [PATCH 04/14] Fix XEmacs version typo in comment and ChangeLog --- lisp/ChangeLog | 2 +- lisp/textmodes/reftex-vars.el | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2811556c71c..0d0f7aa2f9f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,7 @@ 2015-01-29 Tassilo Horn * textmodes/reftex-vars.el (featurep): Conditionalize value of - reftex-label-regexps in order to stay compatible with XEmacs 25 + reftex-label-regexps in order to stay compatible with XEmacs 21.5 which has no explicitly numbered groups in regexps (bug#19714). 2015-01-28 Tassilo Horn diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el index 96d76fb011b..b471707e7ba 100644 --- a/lisp/textmodes/reftex-vars.el +++ b/lisp/textmodes/reftex-vars.el @@ -867,8 +867,8 @@ DOWNCASE t: Downcase words before using them." (option (boolean :tag "Downcase words ")))) (if (featurep 'xemacs) - ;; XEmacs 25 doesn't have explicitly numbered matching groups, so - ;; this list mustn't get any more items. + ;; 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 From 868df451530c294cff3d4ccb98873626aa8105df Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Thu, 29 Jan 2015 21:31:14 +0200 Subject: [PATCH 05/14] Avoid compiler warnings in decode_env_path. src/emacs.c (decode_env_path): Add parentheses around ternary operator to increase readability and pacify compiler warnings. --- src/ChangeLog | 5 +++++ src/emacs.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 08779405acb..949ea741e1d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2015-01-29 Hans Wennborg (tiny change) + + * emacs.c (decode_env_path): Add parentheses around ternary + operator to increase readability and pacify compiler warnings. + 2015-01-29 Eli Zaretskii * w32.c (sys_readdir): Map ERROR_NOT_READY (as in "device not diff --git a/src/emacs.c b/src/emacs.c index 0b7adbd0967..9b78a70428e 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2300,7 +2300,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)) { From 41c3b9241cd78a1eaeb159572b6f4e546b1f8d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A1n=20Ezequiel=20Gallina?= Date: Fri, 30 Jan 2015 00:19:55 -0300 Subject: [PATCH 06/14] * lisp/progmodes/python.el (python-indent-context): Respect user indentation after comment. * test/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. --- lisp/ChangeLog | 5 ++++ lisp/progmodes/python.el | 40 ++++++++++--------------- test/ChangeLog | 7 +++++ test/automated/python-tests.el | 55 +++++++++++++++++++++++----------- 4 files changed, 66 insertions(+), 41 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0d0f7aa2f9f..20686014bf3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-01-30 Fabián Ezequiel Gallina + + * progmodes/python.el (python-indent-context): Respect user + indentation after comment. + 2015-01-29 Tassilo Horn * textmodes/reftex-vars.el (featurep): Conditionalize value of diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index d0a83087554..5842be7cf64 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -810,15 +810,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 @@ -930,21 +921,22 @@ 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'. diff --git a/test/ChangeLog b/test/ChangeLog index 62876e9ecae..72e1b854fd9 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,10 @@ +2015-01-30 Fabián Ezequiel Gallina + + * 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-01-26 Fabián Ezequiel Gallina * automated/python-tests.el (python-indent-pep8-1) diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el index 5bddfe845ed..4972731d0d2 100644 --- a/test/automated/python-tests.el +++ b/test/automated/python-tests.el @@ -177,7 +177,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)) @@ -195,7 +195,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)) @@ -221,7 +221,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)) @@ -286,10 +286,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. " @@ -301,28 +301,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 From 6c8231ee8ce527b779df81249c0e597b9a04a17f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A1n=20Ezequiel=20Gallina?= Date: Fri, 30 Jan 2015 00:41:52 -0300 Subject: [PATCH 07/14] python.el: Handle tabs in python-indent-dedent-line. Fixes: debbugs:19730 * lisp/progmodes/python.el (python-indent-dedent-line): Fixes for indentation with tabs. Thanks to . * test/automated/python-tests.el (python-indent-dedent-line-backspace-2) (python-indent-dedent-line-backspace-3): New tests. --- lisp/ChangeLog | 7 +++++ lisp/progmodes/python.el | 4 +-- test/ChangeLog | 6 +++++ test/automated/python-tests.el | 49 ++++++++++++++++++++++++++++++++++ 4 files changed, 63 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 20686014bf3..51d47a791ad 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2015-01-30 Fabián Ezequiel Gallina + + python.el: Handle tabs in python-indent-dedent-line. + + * progmodes/python.el (python-indent-dedent-line): Fixes for + indentation with tabs. Thanks to (Bug#19730). + 2015-01-30 Fabián Ezequiel Gallina * progmodes/python.el (python-indent-context): Respect user diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 5842be7cf64..0d314d669eb 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1067,9 +1067,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/test/ChangeLog b/test/ChangeLog index 72e1b854fd9..f33cf84cf98 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,9 @@ +2015-01-30 Fabián Ezequiel Gallina + + * automated/python-tests.el + (python-indent-dedent-line-backspace-2) + (python-indent-dedent-line-backspace-3): New tests. + 2015-01-30 Fabián Ezequiel Gallina * automated/python-tests.el (python-indent-pep8-1) diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el index 4972731d0d2..42c26fc3482 100644 --- a/test/automated/python-tests.el +++ b/test/automated/python-tests.el @@ -2127,6 +2127,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 From 33c4409a8edb03d686ab41d493ec3668e5cd597f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 29 Jan 2015 19:45:04 -0800 Subject: [PATCH 08/14] Spelling fixes --- lisp/progmodes/python.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 0d314d669eb..dea316ec32d 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -943,7 +943,7 @@ keyword 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 @@ -1032,7 +1032,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 From be7fb822b8bfee77c705fb5bccdc35d4212cfde0 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 30 Jan 2015 13:47:47 +0200 Subject: [PATCH 09/14] src/dispextern.h (FACE_FOR_CHAR): Fix the commentary. --- src/ChangeLog | 4 ++++ src/dispextern.h | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 949ea741e1d..829eb25f4d9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2015-01-30 Eli Zaretskii + + * dispextern.h (FACE_FOR_CHAR): Fix the commentary. + 2015-01-29 Hans Wennborg (tiny change) * emacs.c (decode_env_path): Add parentheses around ternary diff --git a/src/dispextern.h b/src/dispextern.h index d6bbb0b4c6c..239c4425646 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1821,8 +1821,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)) From 1c1d0b75e8b2650184c96476449a66884e663372 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 31 Jan 2015 17:50:36 +0200 Subject: [PATCH 10/14] Fix a typo in the Emacs manual's Hungry Delete description. doc/emacs/programs.texi (Hungry Delete): Fix a typo: "C-d" instead of "C-c C-d" in hungry-delete mode. --- doc/emacs/ChangeLog | 5 +++++ doc/emacs/programs.texi | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 24d94f95454..02e4845e0b8 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,8 @@ +2015-01-31 Eli Zaretskii + + * programs.texi (Hungry Delete): Fix a typo: "C-d" instead of + "C-c C-d" in hungry-delete mode. + 2015-01-29 Eli Zaretskii * mule.texi (Language Environments): Work around refill bug in diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 547de42ed49..329175409bf 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 From f3faf4f0275d7f94011464ca35d4e7a7ce49b746 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 31 Jan 2015 18:05:38 +0200 Subject: [PATCH 11/14] Fix description of Customize buffer in Emacs manual. doc/emacs/custom.texi (Customization Groups): Update the looks of the Customize Group buffer. --- doc/emacs/ChangeLog | 3 +++ doc/emacs/custom.texi | 7 ++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 02e4845e0b8..4e3c60efa03 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,5 +1,8 @@ 2015-01-31 Eli Zaretskii + * 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. diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index d36e15ef92e..0e9c4fb941b 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} From 017a03afc92ba084898fc897c7e3dbf90197e0b6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 31 Jan 2015 18:32:11 +0200 Subject: [PATCH 12/14] Document MS-Windows file-name idiosyncrasies (Bug#19463) doc/emacs/msdog.texi (Windows Files): Document characters invalid in Windows file names. --- doc/emacs/ChangeLog | 3 +++ doc/emacs/msdog.texi | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 4e3c60efa03..7d8fcf4cb6d 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,5 +1,8 @@ 2015-01-31 Eli Zaretskii + * 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. diff --git a/doc/emacs/msdog.texi b/doc/emacs/msdog.texi index bf130eba7c2..0245fed208c 100644 --- a/doc/emacs/msdog.texi +++ b/doc/emacs/msdog.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. Non-@code{nil} 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. + +@cindex 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: + +@itemize @bullet +@item +Shell redirection symbols @samp{<}, @samp{>}, and @samp{|}. + +@item +Colon @samp{:} (except after the drive letter). + +@item +Forward slash @samp{/} and backslash @samp{\} (except as directory +separators). + +@item +Wildcard characters @samp{*} and @samp{?}. + +@item +Control characters whose codepoints are 1 through 31 decimal. In +particular, newlines in file names are not allowed. + +@item +The null character, whose codepoint is zero (this limitation exists on +Unix filesystems as well). +@end itemize + +@noindent +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 From 618931b5b614df307cfe74c2175287e3f6dfa2a0 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sat, 31 Jan 2015 19:38:58 +0100 Subject: [PATCH 13/14] Handle dead frame in menu-bar-non-minibuffer-window-p. (Bug#19728) * menu-bar.el (menu-bar-non-minibuffer-window-p): Return nil when the menu frame is dead. (Bug#19728) --- lisp/ChangeLog | 5 +++++ lisp/menu-bar.el | 12 +++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 51d47a791ad..6cdaf14abe2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-01-31 Martin Rudalics + + * menu-bar.el (menu-bar-non-minibuffer-window-p): Return nil when + the menu frame is dead. (Bug#19728) + 2015-01-30 Fabián Ezequiel Gallina python.el: Handle tabs in python-indent-dedent-line. diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 25d41dcdd85..e82c089850a 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -1737,12 +1737,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. From e726f2058c98e68c951bdb290fe68dac2a84ff65 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Sat, 31 Jan 2015 21:44:47 +0000 Subject: [PATCH 14/14] Handle "#" operator properly inside macro. Fix coding bug. 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. 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. --- lisp/ChangeLog | 12 ++++++++++++ lisp/progmodes/cc-engine.el | 10 +++++++--- lisp/progmodes/cc-mode.el | 17 +++++++++++------ 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6cdaf14abe2..fd54c688640 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,15 @@ +2015-01-31 Alan Mackenzie + + 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-01-31 Martin Rudalics * menu-bar.el (menu-bar-non-minibuffer-window-p): Return nil when diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 1f4aa819a53..b8051b274d2 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -2275,7 +2275,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 @@ -2302,7 +2304,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)) @@ -3066,7 +3070,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 c4f1efbfdb1..1cba5027f28 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -957,12 +957,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)