Now on revision 112638. ------------------------------------------------------------ revno: 112638 committer: Dmitry Gutov branch nick: trunk timestamp: Sun 2013-05-19 10:52:22 +0400 message: * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-heredoc): Leave point at bol following the heredoc openers. (ruby-syntax-propertize-expansions): Remove. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-19 06:01:23 +0000 +++ lisp/ChangeLog 2013-05-19 06:52:22 +0000 @@ -16,11 +16,12 @@ call to `ruby-syntax-propertize-function'. (ruby-syntax-propertize-expansion): Extracted from `ruby-syntax-propertize-expansions'. Handles one expansion. - (ruby-syntax-propertize-heredoc): Explicitly call - `ruby-syntax-propertize-expansions'. (ruby-syntax-propertize-percent-literal): Leave point right after the percent symbol, so that the expression expansion rule can propertize the contents. + (ruby-syntax-propertize-heredoc): Leave point at bol following the + heredoc openers. + (ruby-syntax-propertize-expansions): Remove. 2013-05-18 Juri Linkov === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2013-05-19 06:01:23 +0000 +++ lisp/progmodes/ruby-mode.el 2013-05-19 06:52:22 +0000 @@ -1435,7 +1435,7 @@ (line-end-position) t) (unless (ruby-singleton-class-p (match-beginning 0)) (push (concat (ruby-here-doc-end-match) "\n") res)))) - (let ((start (point))) + (save-excursion ;; With multiple openers on the same line, we don't know in which ;; part `start' is, so we have to go back to the beginning. (when (cdr res) @@ -1445,11 +1445,9 @@ (if (null res) (put-text-property (1- (point)) (point) 'syntax-table (string-to-syntax "\"")))) - ;; Make extra sure we don't move back, lest we could fall into an - ;; inf-loop. - (if (< (point) start) - (goto-char start) - (ruby-syntax-propertize-expansions start (point))))))) + ;; End up at bol following the heredoc openers. + ;; Propertize expression expansions from this point forward. + )))) (defun ruby-syntax-enclosing-percent-literal (limit) (let ((state (syntax-ppss)) ------------------------------------------------------------ revno: 112637 committer: Dmitry Gutov branch nick: trunk timestamp: Sun 2013-05-19 10:01:23 +0400 message: * lisp/progmodes/ruby-mode.el (ruby-expression-expansion-re): Allow to start at point, so that expansion starting right after opening slash in a regexp is recognized. (ruby-syntax-before-regexp-re): New defvar, extracted from ruby-syntax-propertize-function. Since the value of this regexp is looked up at runtime now, we should be able to turn `ruby-syntax-methods-before-regexp' into a defcustom later. (ruby-syntax-propertize-function): Split regexp matching into two parts, for opening and closing slashes. That allows us to skip over string interpolations and support multiline regexps. Don't call `ruby-syntax-propertize-expansions', instead use another rule for them, which calls `ruby-syntax-propertize-expansion'. (ruby-syntax-propertize-expansions): Move `remove-text-properties' call to `ruby-syntax-propertize-function'. (ruby-syntax-propertize-expansion): Extracted from `ruby-syntax-propertize-expansions'. Handles one expansion. (ruby-syntax-propertize-heredoc): Explicitly call `ruby-syntax-propertize-expansions'. (ruby-syntax-propertize-percent-literal): Leave point right after the percent symbol, so that the expression expansion rule can propertize the contents. * test/automated/ruby-mode-tests.el (ruby-heredoc-highlights-interpolations) (ruby-regexp-skips-over-interpolation) (ruby-regexp-continues-till-end-when-unclosed) (ruby-regexp-can-be-multiline) (ruby-interpolation-inside-percent-literal): New tests. * test/indent/ruby.rb: Add multiline regexp example. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-18 23:18:16 +0000 +++ lisp/ChangeLog 2013-05-19 06:01:23 +0000 @@ -1,3 +1,27 @@ +2013-05-19 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-expression-expansion-re): Allow to + start at point, so that expansion starting right after opening + slash in a regexp is recognized. + (ruby-syntax-before-regexp-re): New defvar, extracted from + ruby-syntax-propertize-function. Since the value of this regexp + is looked up at runtime now, we should be able to turn + `ruby-syntax-methods-before-regexp' into a defcustom later. + (ruby-syntax-propertize-function): Split regexp matching into two + parts, for opening and closing slashes. That allows us to skip + over string interpolations and support multiline regexps. + Don't call `ruby-syntax-propertize-expansions', instead use another rule + for them, which calls `ruby-syntax-propertize-expansion'. + (ruby-syntax-propertize-expansions): Move `remove-text-properties' + call to `ruby-syntax-propertize-function'. + (ruby-syntax-propertize-expansion): Extracted from + `ruby-syntax-propertize-expansions'. Handles one expansion. + (ruby-syntax-propertize-heredoc): Explicitly call + `ruby-syntax-propertize-expansions'. + (ruby-syntax-propertize-percent-literal): Leave point right after + the percent symbol, so that the expression expansion rule can + propertize the contents. + 2013-05-18 Juri Linkov * man.el (Man-default-man-entry): Remove `-' from the end === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2013-05-08 20:25:57 +0000 +++ lisp/progmodes/ruby-mode.el 2013-05-19 06:01:23 +0000 @@ -113,7 +113,7 @@ "Regexp to match the beginning of a heredoc.") (defconst ruby-expression-expansion-re - "[^\\]\\(\\\\\\\\\\)*\\(#\\({[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\|\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+\\)\\)")) + "\\(?:[^\\]\\|\\=\\)\\(\\\\\\\\\\)*\\(#\\({[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\|\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+\\)\\)")) (defun ruby-here-doc-end-match () "Return a regexp to find the end of a heredoc. @@ -1360,11 +1360,26 @@ '("gsub" "gsub!" "sub" "sub!" "scan" "split" "split!" "index" "match" "assert_match" "Given" "Then" "When") "Methods that can take regexp as the first argument. -It will be properly highlighted even when the call omits parens.")) +It will be properly highlighted even when the call omits parens.") + + (defvar ruby-syntax-before-regexp-re + (concat + ;; Special tokens that can't be followed by a division operator. + "\\(^\\|[[=(,~?:;<>]" + ;; Control flow keywords and operators following bol or whitespace. + "\\|\\(?:^\\|\\s \\)" + (regexp-opt '("if" "elsif" "unless" "while" "until" "when" "and" + "or" "not" "&&" "||")) + ;; Method name from the list. + "\\|\\_<" + (regexp-opt ruby-syntax-methods-before-regexp) + "\\)\\s *") + "Regexp to match text that can be followed by a regular expression.")) (defun ruby-syntax-propertize-function (start end) "Syntactic keywords for Ruby mode. See `syntax-propertize-function'." (goto-char start) + (remove-text-properties start end '(ruby-expansion-match-data)) (ruby-syntax-propertize-heredoc end) (ruby-syntax-enclosing-percent-literal end) (funcall @@ -1376,25 +1391,26 @@ ;; Not within a string. (nth 3 (syntax-ppss (match-beginning 0)))) (string-to-syntax "\\")))) - ;; Regexps: regexps are distinguished from division because - ;; of the keyword, symbol, or method name before them. - ((concat - ;; Special tokens that can't be followed by a division operator. - "\\(^\\|[[=(,~?:;<>]" - ;; Control flow keywords and operators following bol or whitespace. - "\\|\\(?:^\\|\\s \\)" - (regexp-opt '("if" "elsif" "unless" "while" "until" "when" "and" - "or" "not" "&&" "||")) - ;; Method name from the list. - "\\|\\_<" - (regexp-opt ruby-syntax-methods-before-regexp) - "\\)\\s *" - ;; The regular expression itself. - "\\(/\\)[^/\n\\\\]*\\(?:\\\\.[^/\n\\\\]*\\)*\\(/\\)") - (3 (unless (nth 3 (syntax-ppss (match-beginning 2))) - (put-text-property (match-beginning 2) (match-end 2) - 'syntax-table (string-to-syntax "\"/")) - (string-to-syntax "\"/")))) + ;; Regular expressions. Start with matching unescaped slash. + ("\\(?:\\=\\|[^\\]\\)\\(?:\\\\\\\\\\)*\\(/\\)" + (1 (let ((state (save-excursion (syntax-ppss (match-beginning 1))))) + (when (or + ;; Beginning of a regexp. + (and (null (nth 8 state)) + (save-excursion + (forward-char -1) + (looking-back ruby-syntax-before-regexp-re + (point-at-bol)))) + ;; End of regexp. We don't match the whole + ;; regexp at once because it can have + ;; string interpolation inside, or span + ;; several lines. + (eq ?/ (nth 3 state))) + (string-to-syntax "\"/"))))) + ;; Expression expansions in strings. We're handling them + ;; here, so that the regexp rule never matches inside them. + (ruby-expression-expansion-re + (0 (ignore (ruby-syntax-propertize-expansion)))) ("^=en\\(d\\)\\_>" (1 "!")) ("^\\(=\\)begin\\_>" (1 "!")) ;; Handle here documents. @@ -1406,8 +1422,7 @@ ;; Handle percent literals: %w(), %q{}, etc. ((concat "\\(?:^\\|[[ \t\n<+(,=]\\)" ruby-percent-literal-beg-re) (1 (prog1 "|" (ruby-syntax-propertize-percent-literal end))))) - (point) end) - (ruby-syntax-propertize-expansions start end)) + (point) end)) (defun ruby-syntax-propertize-heredoc (limit) (let ((ppss (syntax-ppss)) @@ -1432,7 +1447,9 @@ 'syntax-table (string-to-syntax "\"")))) ;; Make extra sure we don't move back, lest we could fall into an ;; inf-loop. - (if (< (point) start) (goto-char start)))))) + (if (< (point) start) + (goto-char start) + (ruby-syntax-propertize-expansions start (point))))))) (defun ruby-syntax-enclosing-percent-literal (limit) (let ((state (syntax-ppss)) @@ -1453,44 +1470,47 @@ (cl (or (cdr (aref (syntax-table) op)) (cdr (assoc op '((?< . ?>)))))) parse-sexp-lookup-properties) - (condition-case nil - (progn - (if cl ; Paired delimiters. - ;; Delimiter pairs of the same kind can be nested - ;; inside the literal, as long as they are balanced. - ;; Create syntax table that ignores other characters. - (with-syntax-table (make-char-table 'syntax-table nil) - (modify-syntax-entry op (concat "(" (char-to-string cl))) - (modify-syntax-entry cl (concat ")" ops)) - (modify-syntax-entry ?\\ "\\") - (save-restriction - (narrow-to-region (point) limit) - (forward-list))) ; skip to the paired character - ;; Single character delimiter. - (re-search-forward (concat "[^\\]\\(?:\\\\\\\\\\)*" - (regexp-quote ops)) limit nil)) - ;; Found the closing delimiter. - (put-text-property (1- (point)) (point) 'syntax-table - (string-to-syntax "|"))) - ;; Unclosed literal, leave the following text unpropertized. - ((scan-error search-failed) (goto-char limit)))))) + (save-excursion + (condition-case nil + (progn + (if cl ; Paired delimiters. + ;; Delimiter pairs of the same kind can be nested + ;; inside the literal, as long as they are balanced. + ;; Create syntax table that ignores other characters. + (with-syntax-table (make-char-table 'syntax-table nil) + (modify-syntax-entry op (concat "(" (char-to-string cl))) + (modify-syntax-entry cl (concat ")" ops)) + (modify-syntax-entry ?\\ "\\") + (save-restriction + (narrow-to-region (point) limit) + (forward-list))) ; skip to the paired character + ;; Single character delimiter. + (re-search-forward (concat "[^\\]\\(?:\\\\\\\\\\)*" + (regexp-quote ops)) limit nil)) + ;; Found the closing delimiter. + (put-text-property (1- (point)) (point) 'syntax-table + (string-to-syntax "|"))) + ;; Unclosed literal, do nothing. + ((scan-error search-failed))))))) + + (defun ruby-syntax-propertize-expansion () + ;; Save the match data to a text property, for font-locking later. + ;; Set the syntax of all double quotes and backticks to punctuation. + (let ((beg (match-beginning 2)) + (end (match-end 2))) + (when (and beg (save-excursion (nth 3 (syntax-ppss beg)))) + (put-text-property beg (1+ beg) 'ruby-expansion-match-data + (match-data)) + (goto-char beg) + (while (re-search-forward "[\"`]" end 'move) + (put-text-property (match-beginning 0) (match-end 0) + 'syntax-table (string-to-syntax ".")))))) (defun ruby-syntax-propertize-expansions (start end) - (remove-text-properties start end '(ruby-expansion-match-data)) - (goto-char start) - ;; Find all expression expansions and - ;; - save the match data to a text property, for font-locking later, - ;; - set the syntax of all double quotes and backticks to punctuation. - (while (re-search-forward ruby-expression-expansion-re end 'move) - (let ((beg (match-beginning 2)) - (end (match-end 2))) - (when (and beg (save-excursion (nth 3 (syntax-ppss beg)))) - (put-text-property beg (1+ beg) 'ruby-expansion-match-data - (match-data)) - (goto-char beg) - (while (re-search-forward "[\"`]" end 'move) - (put-text-property (match-beginning 0) (match-end 0) - 'syntax-table (string-to-syntax "."))))))) + (save-excursion + (goto-char start) + (while (re-search-forward ruby-expression-expansion-re end 'move) + (ruby-syntax-propertize-expansion)))) ) ;; For Emacsen where syntax-propertize-rules is not (yet) available, === modified file 'test/ChangeLog' --- test/ChangeLog 2013-05-08 20:25:57 +0000 +++ test/ChangeLog 2013-05-19 06:01:23 +0000 @@ -1,3 +1,13 @@ +2013-05-19 Dmitry Gutov + + * indent/ruby.rb: Add multiline regexp example. + + * automated/ruby-mode-tests.el (ruby-heredoc-highlights-interpolations) + (ruby-regexp-skips-over-interpolation) + (ruby-regexp-continues-till-end-when-unclosed) + (ruby-regexp-can-be-multiline) + (ruby-interpolation-inside-percent-literal): New tests. + 2013-05-08 Stefan Monnier * indent/ruby.rb: Fix indentation after =; add more cases. === modified file 'test/automated/ruby-mode-tests.el' --- test/automated/ruby-mode-tests.el 2013-04-15 23:07:14 +0000 +++ test/automated/ruby-mode-tests.el 2013-05-19 06:01:23 +0000 @@ -84,6 +84,9 @@ (ert-deftest ruby-singleton-class-no-heredoc-font-lock () (ruby-assert-face "class< branch nick: trunk timestamp: Sun 2013-05-19 02:18:16 +0300 message: * lisp/man.el (Man-default-man-entry): Remove `-' from the end of the default value. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-18 19:38:35 +0000 +++ lisp/ChangeLog 2013-05-18 23:18:16 +0000 @@ -1,3 +1,8 @@ +2013-05-18 Juri Linkov + + * man.el (Man-default-man-entry): Remove `-' from the end + of the default value. (Bug#14400) + 2013-05-18 Glenn Morris * comint.el (comint-password-prompt-regexp): === modified file 'lisp/man.el' --- lisp/man.el 2013-02-12 04:46:18 +0000 +++ lisp/man.el 2013-05-18 23:18:16 +0000 @@ -752,7 +752,7 @@ (setq word (concat word (match-string-no-properties 1))) ;; Make sure the section number gets included by the code below. (goto-char (match-end 1))) - (when (string-match "[._]+$" word) + (when (string-match "[-._]+$" word) (setq word (substring word 0 (match-beginning 0)))) ;; The following was commented out since the preceding code ;; should not produce a leading "*" in the first place. ------------------------------------------------------------ revno: 112635 committer: Glenn Morris branch nick: trunk timestamp: Sat 2013-05-18 12:38:35 -0700 message: comint-password-prompt-regexp tweak Ref: http://lists.gnu.org/archive/html/emacs-devel/2013-05/msg00401.html * lisp/comint.el (comint-password-prompt-regexp): Allow "password for XXX" where XXX contains colons (eg https://...). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-18 03:17:35 +0000 +++ lisp/ChangeLog 2013-05-18 19:38:35 +0000 @@ -1,3 +1,8 @@ +2013-05-18 Glenn Morris + + * comint.el (comint-password-prompt-regexp): + Allow "password for XXX" where XXX contains colons (eg https://...). + 2013-05-18 Leo Liu * progmodes/octave.el (inferior-octave-startup): Use OCTAVE_SRCDIR === modified file 'lisp/comint.el' --- lisp/comint.el 2013-05-15 23:55:41 +0000 +++ lisp/comint.el 2013-05-18 19:38:35 +0000 @@ -351,7 +351,7 @@ '("password" "Password" "passphrase" "Passphrase" "pass phrase" "Pass phrase" "Response")) "\\(?:\\(?:, try\\)? *again\\| (empty for no passphrase)\\| (again)\\)?\ -\\(?: for [^:]+\\)?:\\s *\\'") +\\(?: for .+\\)?:\\s *\\'") "Regexp matching prompts for passwords in the inferior process. This is used by `comint-watch-for-password-prompt'." :version "24.1" ------------------------------------------------------------ revno: 112634 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2013-05-18 15:04:40 +0300 message: Add new files in nt/ to make-dist. make-dist (files): Add nt/msysconfig.sh, nt/mingw-cfg.site, nt/epaths.nt, and nt/INSTALL.MSYS. diff: === modified file 'ChangeLog' --- ChangeLog 2013-05-18 05:32:17 +0000 +++ ChangeLog 2013-05-18 12:04:40 +0000 @@ -1,3 +1,8 @@ +2013-05-18 Eli Zaretskii + + * make-dist (files): Add nt/msysconfig.sh, nt/mingw-cfg.site, + nt/epaths.nt, and nt/INSTALL.MSYS. + 2013-05-18 Paul Eggert Port --enable-gcc-warnings to clang. === modified file 'make-dist' --- make-dist 2013-05-18 05:21:24 +0000 +++ make-dist 2013-05-18 12:04:40 +0000 @@ -390,6 +390,7 @@ ln config.nt emacsclient.rc emacs-src.tags ../${tempdir}/nt ln nmake.defs gmake.defs subdirs.el [a-z]*.bat [a-z]*.[ch] ../${tempdir}/nt ln Makefile.in gnulib.mk ../${tempdir}/nt + ln msysconfig.sh mingw-cfg.site epaths.nt INSTALL.MSYS ../${tempdir}/nt ln ChangeLog INSTALL README README.W32 makefile.w32-in ../${tempdir}/nt) echo "Making links to \`nt/inc' and its subdirectories" ------------------------------------------------------------ revno: 112633 committer: Glenn Morris branch nick: trunk timestamp: Sat 2013-05-18 06:17:38 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/configure' --- autogen/configure 2013-05-16 16:37:05 +0000 +++ autogen/configure 2013-05-18 10:17:38 +0000 @@ -7553,27 +7553,13 @@ esac - nw="$nw -Waggregate-return" # anachronistic - nw="$nw -Wlong-long" # C90 is anachronistic - nw="$nw -Wc++-compat" # We don't care about C++ compilers - nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib - nw="$nw -Wtraditional" # Warns on #elif which we use often - nw="$nw -Wcast-qual" # Too many warnings for now - nw="$nw -Wconversion" # Too many warnings for now nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings - nw="$nw -Wsign-conversion" # Too many warnings for now nw="$nw -Woverlength-strings" # Not a problem these days - nw="$nw -Wtraditional-conversion" # Too many warnings for now - nw="$nw -Wunreachable-code" # so buggy that it's now silently ignored - nw="$nw -Wpadded" # Our structs are not padded - nw="$nw -Wredundant-decls" # we regularly (re)declare functions nw="$nw -Wlogical-op" # any use of fwrite provokes this nw="$nw -Wformat-nonliteral" # we do this a lot nw="$nw -Wvla" # warnings in gettext.h nw="$nw -Wnested-externs" # use of XARGMATCH/verify_function__ - nw="$nw -Wswitch-enum" # Too many warnings for now nw="$nw -Wswitch-default" # Too many warnings for now - nw="$nw -Wfloat-equal" # warns about high-quality code nw="$nw -Winline" # OK to ignore 'inline' nw="$nw -Wjump-misses-init" # We sometimes safely jump over init. nw="$nw -Wstrict-overflow" # OK to optimize assuming that @@ -7591,6 +7577,40 @@ # The following line should be removable at some point. nw="$nw -Wsuggest-attribute=pure" + # clang is unduly picky about some things. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is clang" >&5 +$as_echo_n "checking whether the compiler is clang... " >&6; } +if test "${emacs_cv_clang+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #ifndef __clang__ + #error "not clang" + #endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + emacs_cv_clang=yes +else + emacs_cv_clang=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_clang" >&5 +$as_echo "$emacs_cv_clang" >&6; } + if test $emacs_cv_clang = yes; then + nw="$nw -Wcast-align" + fi + if test -n "$GCC"; then @@ -8138,6 +8158,154 @@ + # More things that clang is unduly picky about. + if test $emacs_cv_clang = yes; then + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-format-extra-args" >&5 +$as_echo_n "checking whether C compiler handles -Wno-format-extra-args... " >&6; } +if test "${gl_cv_warn_c__Wno_format_extra_args+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-format-extra-args" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_warn_c__Wno_format_extra_args=yes +else + gl_cv_warn_c__Wno_format_extra_args=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_format_extra_args" >&5 +$as_echo "$gl_cv_warn_c__Wno_format_extra_args" >&6; } +if test "x$gl_cv_warn_c__Wno_format_extra_args" = x""yes; then : + as_fn_append WARN_CFLAGS " -Wno-format-extra-args" +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-tautological-constant-out-of-range-compare" >&5 +$as_echo_n "checking whether C compiler handles -Wno-tautological-constant-out-of-range-compare... " >&6; } +if test "${gl_cv_warn_c__Wno_tautological_constant_out_of_range_compare+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-tautological-constant-out-of-range-compare" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_warn_c__Wno_tautological_constant_out_of_range_compare=yes +else + gl_cv_warn_c__Wno_tautological_constant_out_of_range_compare=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_tautological_constant_out_of_range_compare" >&5 +$as_echo "$gl_cv_warn_c__Wno_tautological_constant_out_of_range_compare" >&6; } +if test "x$gl_cv_warn_c__Wno_tautological_constant_out_of_range_compare" = x""yes; then : + as_fn_append WARN_CFLAGS " -Wno-tautological-constant-out-of-range-compare" +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-unused-command-line-argument" >&5 +$as_echo_n "checking whether C compiler handles -Wno-unused-command-line-argument... " >&6; } +if test "${gl_cv_warn_c__Wno_unused_command_line_argument+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-unused-command-line-argument" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_warn_c__Wno_unused_command_line_argument=yes +else + gl_cv_warn_c__Wno_unused_command_line_argument=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_unused_command_line_argument" >&5 +$as_echo "$gl_cv_warn_c__Wno_unused_command_line_argument" >&6; } +if test "x$gl_cv_warn_c__Wno_unused_command_line_argument" = x""yes; then : + as_fn_append WARN_CFLAGS " -Wno-unused-command-line-argument" +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-unused-value" >&5 +$as_echo_n "checking whether C compiler handles -Wno-unused-value... " >&6; } +if test "${gl_cv_warn_c__Wno_unused_value+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-unused-value" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_warn_c__Wno_unused_value=yes +else + gl_cv_warn_c__Wno_unused_value=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_unused_value" >&5 +$as_echo "$gl_cv_warn_c__Wno_unused_value" >&6; } +if test "x$gl_cv_warn_c__Wno_unused_value" = x""yes; then : + as_fn_append WARN_CFLAGS " -Wno-unused-value" +fi + + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -fdiagnostics-show-option" >&5 $as_echo_n "checking whether C compiler handles -fdiagnostics-show-option... " >&6; } @@ -11187,6 +11355,7 @@ USE_GTK_TOOLKIT="GTK3" if test "x$ac_enable_gtk_deprecation_warnings" = x; then GTK_CFLAGS="$GTK_CFLAGS -DGDK_DISABLE_DEPRECATION_WARNINGS" + GTK_CFLAGS="$GTK_CFLAGS -DGLIB_DISABLE_DEPRECATION_WARNINGS" fi else check_gtk2=yes ------------------------------------------------------------ revno: 112632 committer: Paul Eggert branch nick: trunk timestamp: Sat 2013-05-18 00:17:03 -0700 message: Spelling fixes. diff: === modified file 'nt/mingw-cfg.site' --- nt/mingw-cfg.site 2013-05-16 09:44:44 +0000 +++ nt/mingw-cfg.site 2013-05-18 07:17:03 +0000 @@ -26,7 +26,7 @@ # # In short, examine the test in 'configure' and push the knobs that # are necessary to steer the test in the direction you need, by -# judicioulsy setting variables that control the test results. +# judiciously setting variables that control the test results. # We want to use getopt.h from gnulib ac_cv_header_getopt_h=no === modified file 'nt/msysconfig.sh' --- nt/msysconfig.sh 2013-05-16 09:44:44 +0000 +++ nt/msysconfig.sh 2013-05-18 07:17:03 +0000 @@ -1,5 +1,5 @@ #! /bin/sh -### msysconfig.sh - Run the top-level 'configure' script as approriate +### msysconfig.sh - Run the top-level 'configure' script as appropriate ### for the MinGW/MSYS build of a native MS-Windows port of Emacs. ## Copyright (C) 2013 Free Software Foundation, Inc. ------------------------------------------------------------ revno: 112631 committer: Paul Eggert branch nick: trunk timestamp: Fri 2013-05-17 22:32:17 -0700 message: Port --enable-gcc-warnings to clang. * configure.ac (nw): Remove obsolescent warnings. These aren't needed for clang, or for gcc for that matter. (emacs_cv_clang): New var, which tests for clang. Omit warnings that clang is too picky about. (GLIB_DISABLE_DEPRECATION_WARNINGS): Define this; needed for Ubuntu 13.04 + clang + --enable-gcc-warnings. * lib-src/etags.c: Omit unnecessary forward decls. (print_version, print_help): Declare _Noreturn. * lib-src/pop.c (socket_connection) [HAVE_GETADDRINFO]: Simplify. * src/bytecode.c (exec_byte_code): * src/regex.c: Redo diagnostic pragmas to pacify clang, too. * src/dbusbind.c (xd_retrieve_arg): Do not use uninitialized variable. * src/editfns.c (Fencode_time): * src/fileio.c (file_accessible_directory_p): * src/font.c (font_unparse_xlfd): Use '&"string"[index]' instead of '"string" + (index)'. * src/undo.c (user_error): Remove; unused. diff: === modified file 'ChangeLog' --- ChangeLog 2013-05-18 05:21:24 +0000 +++ ChangeLog 2013-05-18 05:32:17 +0000 @@ -1,5 +1,13 @@ 2013-05-18 Paul Eggert + Port --enable-gcc-warnings to clang. + * configure.ac (nw): Remove obsolescent warnings. + These aren't needed for clang, or for gcc for that matter. + (emacs_cv_clang): New var, which tests for clang. + Omit warnings that clang is too picky about. + (GLIB_DISABLE_DEPRECATION_WARNINGS): Define this; + needed for Ubuntu 13.04 + clang + --enable-gcc-warnings. + * make-dist (files): Add nt/Makefile.in, nt/gnulib.mk. Otherwise, 'configure; make' fails on non-Windows builds. === modified file 'configure.ac' --- configure.ac 2013-05-15 16:15:07 +0000 +++ configure.ac 2013-05-18 05:32:17 +0000 @@ -554,7 +554,7 @@ i[3456]86-*-* ) case "${canonical}" in *-darwin* ) opsys=darwin ;; - *-mingw32 ) + *-mingw32 ) opsys=mingw32 # MinGW overrides and adds some system headers in nt/inc. GCC_TEST_OPTIONS="-I $srcdir/nt/inc" @@ -747,27 +747,13 @@ esac AC_SUBST([WERROR_CFLAGS]) - nw="$nw -Waggregate-return" # anachronistic - nw="$nw -Wlong-long" # C90 is anachronistic - nw="$nw -Wc++-compat" # We don't care about C++ compilers - nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib - nw="$nw -Wtraditional" # Warns on #elif which we use often - nw="$nw -Wcast-qual" # Too many warnings for now - nw="$nw -Wconversion" # Too many warnings for now nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings - nw="$nw -Wsign-conversion" # Too many warnings for now nw="$nw -Woverlength-strings" # Not a problem these days - nw="$nw -Wtraditional-conversion" # Too many warnings for now - nw="$nw -Wunreachable-code" # so buggy that it's now silently ignored - nw="$nw -Wpadded" # Our structs are not padded - nw="$nw -Wredundant-decls" # we regularly (re)declare functions nw="$nw -Wlogical-op" # any use of fwrite provokes this nw="$nw -Wformat-nonliteral" # we do this a lot nw="$nw -Wvla" # warnings in gettext.h nw="$nw -Wnested-externs" # use of XARGMATCH/verify_function__ - nw="$nw -Wswitch-enum" # Too many warnings for now nw="$nw -Wswitch-default" # Too many warnings for now - nw="$nw -Wfloat-equal" # warns about high-quality code nw="$nw -Winline" # OK to ignore 'inline' nw="$nw -Wjump-misses-init" # We sometimes safely jump over init. nw="$nw -Wstrict-overflow" # OK to optimize assuming that @@ -785,6 +771,20 @@ # The following line should be removable at some point. nw="$nw -Wsuggest-attribute=pure" + # clang is unduly picky about some things. + AC_CACHE_CHECK([whether the compiler is clang], [emacs_cv_clang], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #ifndef __clang__ + #error "not clang" + #endif + ]])], + [emacs_cv_clang=yes], + [emacs_cv_clang=no])]) + if test $emacs_cv_clang = yes; then + nw="$nw -Wcast-align" + fi + gl_MANYWARN_ALL_GCC([ws]) gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw]) for w in $ws; do @@ -801,6 +801,14 @@ # gcc 4.5.0 20090517. gl_WARN_ADD([-Wno-logical-op]) + # More things that clang is unduly picky about. + if test $emacs_cv_clang = yes; then + gl_WARN_ADD([-Wno-format-extra-args]) + gl_WARN_ADD([-Wno-tautological-constant-out-of-range-compare]) + gl_WARN_ADD([-Wno-unused-command-line-argument]) + gl_WARN_ADD([-Wno-unused-value]) + fi + gl_WARN_ADD([-fdiagnostics-show-option]) gl_WARN_ADD([-funit-at-a-time]) @@ -1604,15 +1612,15 @@ EMACS_MANIFEST= if test "${with_w32}" != no; then case "${opsys}" in - cygwin) + cygwin) AC_CHECK_HEADER([windows.h], [HAVE_W32=yes], [AC_MSG_ERROR([`--with-w32' was specified, but windows.h - cannot be found.])]) + cannot be found.])]) ;; mingw32) ## Using --with-w32 with MinGW is a no-op, but we allow it. ;; - *) + *) AC_MSG_ERROR([Using w32 with an autotools build is only supported for Cygwin and MinGW32.]) ;; esac @@ -1626,7 +1634,7 @@ [[void test(PIMAGE_NT_HEADERS pHeader) {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);}]])], [emacs_cv_w32api=yes - HAVE_W32=yes], + HAVE_W32=yes], emacs_cv_w32api=no) AC_MSG_RESULT($emacs_cv_w32api) if test "${emacs_cv_w32api}" = "no"; then @@ -2074,6 +2082,7 @@ USE_GTK_TOOLKIT="GTK3" if test "x$ac_enable_gtk_deprecation_warnings" = x; then GTK_CFLAGS="$GTK_CFLAGS -DGDK_DISABLE_DEPRECATION_WARNINGS" + GTK_CFLAGS="$GTK_CFLAGS -DGLIB_DISABLE_DEPRECATION_WARNINGS" fi else check_gtk2=yes === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2013-05-16 12:48:54 +0000 +++ lib-src/ChangeLog 2013-05-18 05:32:17 +0000 @@ -1,3 +1,10 @@ +2013-05-18 Paul Eggert + + Port --enable-gcc-warnings to clang. + * etags.c: Omit unnecessary forward decls. + (print_version, print_help): Declare _Noreturn. + * pop.c (socket_connection) [HAVE_GETADDRINFO]: Simplify. + 2013-05-16 Eli Zaretskii * update-game-score.c [WINDOWSNT]: Include "ntlib.h". === modified file 'lib-src/etags.c' --- lib-src/etags.c 2013-03-13 07:27:34 +0000 +++ lib-src/etags.c 2013-05-18 05:32:17 +0000 @@ -316,15 +316,7 @@ static void Yacc_entries (FILE *); static void just_read_file (FILE *); -static void print_language_names (void); -static void print_version (void); -static void print_help (argument *); -int main (int, char **); - -static compressor *get_compressor_from_suffix (char *, char **); static language *get_language_from_langname (const char *); -static language *get_language_from_interpreter (char *); -static language *get_language_from_filename (char *, bool); static void readline (linebuffer *, FILE *); static long readline_internal (linebuffer *, FILE *); static bool nocase_tail (const char *); @@ -346,7 +338,6 @@ static void free_tree (node *); static void free_fdesc (fdesc *); static void pfnote (char *, bool, char *, int, int, long); -static void make_tag (const char *, int, bool, char *, int, int, long); static void invalidate_nodes (fdesc *, node **); static void put_entries (node *); @@ -816,7 +807,7 @@ #ifndef VERSION # define VERSION "17.38.1.4" #endif -static void +static _Noreturn void print_version (void) { char emacs_copyright[] = COPYRIGHT; @@ -832,7 +823,7 @@ # define PRINT_UNDOCUMENTED_OPTIONS_HELP FALSE #endif -static void +static _Noreturn void print_help (argument *argbuffer) { bool help_for_lang = FALSE; === modified file 'lib-src/pop.c' --- lib-src/pop.c 2013-03-12 22:00:07 +0000 +++ lib-src/pop.c 2013-05-18 05:32:17 +0000 @@ -1075,28 +1075,22 @@ } } while (ret != 0); - if (ret == 0) + for (it = res; it; it = it->ai_next) + if (it->ai_addrlen == sizeof addr) + { + struct sockaddr_in *in_a = (struct sockaddr_in *) it->ai_addr; + addr.sin_addr = in_a->sin_addr; + if (! connect (sock, (struct sockaddr *) &addr, sizeof addr)) + break; + } + connect_ok = it != NULL; + if (connect_ok) { - it = res; - while (it) - { - if (it->ai_addrlen == sizeof (addr)) - { - struct sockaddr_in *in_a = (struct sockaddr_in *) it->ai_addr; - addr.sin_addr = in_a->sin_addr; - if (! connect (sock, (struct sockaddr *) &addr, sizeof (addr))) - break; - } - it = it->ai_next; - } - connect_ok = it != NULL; - if (connect_ok) - { - realhost = alloca (strlen (it->ai_canonname) + 1); - strcpy (realhost, it->ai_canonname); - } - freeaddrinfo (res); + realhost = alloca (strlen (it->ai_canonname) + 1); + strcpy (realhost, it->ai_canonname); } + freeaddrinfo (res); + #else /* !HAVE_GETADDRINFO */ do { === modified file 'src/ChangeLog' --- src/ChangeLog 2013-05-16 19:15:32 +0000 +++ src/ChangeLog 2013-05-18 05:32:17 +0000 @@ -1,3 +1,16 @@ +2013-05-18 Paul Eggert + + Port --enable-gcc-warnings to clang. + * bytecode.c (exec_byte_code): + * regex.c: + Redo diagnostic pragmas to pacify clang, too. + * dbusbind.c (xd_retrieve_arg): Do not use uninitialized variable. + * editfns.c (Fencode_time): + * fileio.c (file_accessible_directory_p): + * font.c (font_unparse_xlfd): + Use '&"string"[index]' instead of '"string" + (index)'. + * undo.c (user_error): Remove; unused. + 2013-05-16 Eli Zaretskii * insdel.c (insert_1_both): Document the arguments, instead of === modified file 'src/bytecode.c' --- src/bytecode.c 2013-03-24 12:59:45 +0000 +++ src/bytecode.c 2013-05-18 05:32:17 +0000 @@ -660,9 +660,12 @@ the table clearer. */ #define LABEL(OP) [OP] = &&insn_ ## OP -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Woverride-init" +#elif defined __clang__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Winitializer-overrides" #endif /* This is the dispatch table for the threaded interpreter. */ @@ -676,7 +679,7 @@ #undef DEFINE }; -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) || defined __clang__ # pragma GCC diagnostic pop #endif === modified file 'src/dbusbind.c' --- src/dbusbind.c 2013-01-02 16:13:04 +0000 +++ src/dbusbind.c 2013-05-18 05:32:17 +0000 @@ -882,7 +882,7 @@ #endif { dbus_uint32_t val; - unsigned int pval = val; + unsigned int pval; dbus_message_iter_get_basic (iter, &val); pval = val; XD_DEBUG_MESSAGE ("%c %u", dtype, pval); === modified file 'src/editfns.c' --- src/editfns.c 2013-04-02 01:54:56 +0000 +++ src/editfns.c 2013-05-18 05:32:17 +0000 @@ -1946,7 +1946,7 @@ EMACS_INT zone_hr = abszone / (60*60); int zone_min = (abszone/60) % 60; int zone_sec = abszone % 60; - sprintf (tzbuf, tzbuf_format, "-" + (XINT (zone) < 0), + sprintf (tzbuf, tzbuf_format, &"-"[XINT (zone) < 0], zone_hr, zone_min, zone_sec); tzstring = tzbuf; } === modified file 'src/fileio.c' --- src/fileio.c 2013-05-07 21:34:03 +0000 +++ src/fileio.c 2013-05-18 05:32:17 +0000 @@ -2873,7 +2873,7 @@ and it's a safe optimization here. */ char *buf = SAFE_ALLOCA (len + 3); memcpy (buf, file, len); - strcpy (buf + len, "/." + (file[len - 1] == '/')); + strcpy (buf + len, &"/."[file[len - 1] == '/']); dir = buf; } === modified file 'src/font.c' --- src/font.c 2013-04-27 13:32:24 +0000 +++ src/font.c 2013-05-18 05:32:17 +0000 @@ -1219,7 +1219,7 @@ return -1; f[j] = p = alloca (alloc); sprintf (p, "%s%s-*", SDATA (val), - "*" + (SDATA (val)[SBYTES (val) - 1] == '*')); + &"*"[SDATA (val)[SBYTES (val) - 1] == '*']); } else f[j] = SSDATA (val); @@ -1618,7 +1618,7 @@ } if (point_size > 0) { - int len = snprintf (p, lim - p, "-%d" + (p == name), point_size); + int len = snprintf (p, lim - p, &"-%d"[p == name], point_size); if (! (0 <= len && len < lim - p)) return -1; p += len; === modified file 'src/regex.c' --- src/regex.c 2013-05-15 00:52:07 +0000 +++ src/regex.c 2013-05-18 05:32:17 +0000 @@ -33,10 +33,9 @@ /* Ignore some GCC warnings for now. This section should go away once the Emacs and Gnulib regex code is merged. */ -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +#if 4 < __GNUC__ + (5 <= __GNUC_MINOR__) || defined __clang__ # pragma GCC diagnostic ignored "-Wstrict-overflow" # ifndef emacs -# pragma GCC diagnostic ignored "-Wunused-but-set-variable" # pragma GCC diagnostic ignored "-Wunused-function" # pragma GCC diagnostic ignored "-Wunused-macros" # pragma GCC diagnostic ignored "-Wunused-result" @@ -44,6 +43,10 @@ # endif #endif +#if 4 < __GNUC__ + (5 <= __GNUC_MINOR__) && ! defined __clang__ +# pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#endif + #include #include === modified file 'src/undo.c' --- src/undo.c 2013-01-08 19:13:31 +0000 +++ src/undo.c 2013-05-18 05:32:17 +0000 @@ -445,12 +445,6 @@ unbind_to (count, Qnil); } -static _Noreturn void -user_error (const char *msg) -{ - xsignal1 (Quser_error, build_string (msg)); -} - void syms_of_undo (void)