diff options
| author | Michael R. Mauger | 2017-07-05 23:37:13 -0400 |
|---|---|---|
| committer | Michael R. Mauger | 2017-07-05 23:37:13 -0400 |
| commit | 7f62a4a7440aee6aacf04036feb3384a6515e48f (patch) | |
| tree | eedee2b54ffce3756f9ca3ef5a1e6e48d83472b6 | |
| parent | 776635c01abd4aa759e7aa9584b513146978568c (diff) | |
| parent | 7a0170de20fe1225d3eeac099d1e61a0c0410bf3 (diff) | |
| download | emacs-7f62a4a7440aee6aacf04036feb3384a6515e48f.tar.gz emacs-7f62a4a7440aee6aacf04036feb3384a6515e48f.zip | |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
38 files changed, 266 insertions, 229 deletions
diff --git a/configure.ac b/configure.ac index ef61107b025..980b4c633ba 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -957,6 +957,7 @@ AS_IF([test $gl_gcc_warnings = no], | |||
| 957 | # This part is merely for shortening the command line, | 957 | # This part is merely for shortening the command line, |
| 958 | # since -Wno-FOO needs to be added below regardless. | 958 | # since -Wno-FOO needs to be added below regardless. |
| 959 | nw="$nw -Wmissing-field-initializers" | 959 | nw="$nw -Wmissing-field-initializers" |
| 960 | nw="$nw -Woverride-init" | ||
| 960 | nw="$nw -Wtype-limits" | 961 | nw="$nw -Wtype-limits" |
| 961 | nw="$nw -Wunused-parameter" | 962 | nw="$nw -Wunused-parameter" |
| 962 | 963 | ||
| @@ -978,6 +979,7 @@ AS_IF([test $gl_gcc_warnings = no], | |||
| 978 | done | 979 | done |
| 979 | gl_WARN_ADD([-Wredundant-decls]) # Prefer this, as we don't use Bison. | 980 | gl_WARN_ADD([-Wredundant-decls]) # Prefer this, as we don't use Bison. |
| 980 | gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one | 981 | gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one |
| 982 | gl_WARN_ADD([-Wno-override-init]) # More trouble than it is worth | ||
| 981 | gl_WARN_ADD([-Wno-sign-compare]) # Too many warnings for now | 983 | gl_WARN_ADD([-Wno-sign-compare]) # Too many warnings for now |
| 982 | gl_WARN_ADD([-Wno-type-limits]) # Too many warnings for now | 984 | gl_WARN_ADD([-Wno-type-limits]) # Too many warnings for now |
| 983 | gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now | 985 | gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now |
| @@ -1005,9 +1007,10 @@ AS_IF([test $gl_gcc_warnings = no], | |||
| 1005 | ]) | 1007 | ]) |
| 1006 | ]) | 1008 | ]) |
| 1007 | 1009 | ||
| 1008 | # clang is unduly picky about these regardless of whether | 1010 | # clang is picky about these regardless of whether |
| 1009 | # --enable-gcc-warnings is specified. | 1011 | # --enable-gcc-warnings is specified. |
| 1010 | if test "$emacs_cv_clang" = yes; then | 1012 | if test "$emacs_cv_clang" = yes; then |
| 1013 | gl_WARN_ADD([-Wno-initializer-overrides]) | ||
| 1011 | gl_WARN_ADD([-Wno-tautological-compare]) | 1014 | gl_WARN_ADD([-Wno-tautological-compare]) |
| 1012 | gl_WARN_ADD([-Wno-tautological-constant-out-of-range-compare]) | 1015 | gl_WARN_ADD([-Wno-tautological-constant-out-of-range-compare]) |
| 1013 | fi | 1016 | fi |
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 222d1c2a4de..27ac0eb6400 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi | |||
| @@ -1146,9 +1146,12 @@ comment or for aligning an existing comment. It is set differently by | |||
| 1146 | various major modes. The function is called with no arguments, but with | 1146 | various major modes. The function is called with no arguments, but with |
| 1147 | point at the beginning of the comment, or at the end of a line if a new | 1147 | point at the beginning of the comment, or at the end of a line if a new |
| 1148 | comment is to be inserted. It should return the column in which the | 1148 | comment is to be inserted. It should return the column in which the |
| 1149 | comment ought to start. For example, in Lisp mode, the indent hook | 1149 | comment ought to start. For example, the default hook function bases |
| 1150 | function bases its decision on how many semicolons begin an existing | 1150 | its decision on how many comment characters begin an existing comment. |
| 1151 | comment, and on the code in the preceding lines. | 1151 | |
| 1152 | Emacs also tries to align comments on adjacent lines. To override | ||
| 1153 | this, the function may return a cons of two (possibly equal) integers | ||
| 1154 | to indicate an acceptable range of indentation. | ||
| 1152 | 1155 | ||
| 1153 | @node Documentation | 1156 | @node Documentation |
| 1154 | @section Documentation Lookup | 1157 | @section Documentation Lookup |
| @@ -405,6 +405,10 @@ display of raw bytes from octal to hex. | |||
| 405 | ** You can now provide explicit field numbers in format specifiers. | 405 | ** You can now provide explicit field numbers in format specifiers. |
| 406 | For example, '(format "%2$s %1$s" "X" "Y")' produces "Y X". | 406 | For example, '(format "%2$s %1$s" "X" "Y")' produces "Y X". |
| 407 | 407 | ||
| 408 | +++ | ||
| 409 | ** 'comment-indent-function' values may now return a cons to specify a | ||
| 410 | range of indentation. | ||
| 411 | |||
| 408 | 412 | ||
| 409 | * Editing Changes in Emacs 26.1 | 413 | * Editing Changes in Emacs 26.1 |
| 410 | 414 | ||
diff --git a/etc/themes/manoj-dark-theme.el b/etc/themes/manoj-dark-theme.el index 87a2af74f10..bbfeb83d53e 100644 --- a/etc/themes/manoj-dark-theme.el +++ b/etc/themes/manoj-dark-theme.el | |||
| @@ -602,6 +602,18 @@ jarring angry fruit salad look to reduce eye fatigue.") | |||
| 602 | '(paren-no-match-face ((t (:bold t :background "white" :foreground "red")))) | 602 | '(paren-no-match-face ((t (:bold t :background "white" :foreground "red")))) |
| 603 | '(query-replace ((t (:foreground "brown4" :background "palevioletred2")))) | 603 | '(query-replace ((t (:foreground "brown4" :background "palevioletred2")))) |
| 604 | '(region ((t (:background "blue3")))) | 604 | '(region ((t (:background "blue3")))) |
| 605 | |||
| 606 | `(realgud-overlay-arrow1 ((t (:foreground "medium sea green")))) | ||
| 607 | `(realgud-overlay-arrow2 ((t (:foreground "white")))) | ||
| 608 | `(realgud-overlay-arrow3 ((t (:foreground "indian red")))) | ||
| 609 | `(realgud-bp-enabled-face ((t (:inherit error)))) | ||
| 610 | `(realgud-bp-disabled-face ((t (:underline t)))) | ||
| 611 | `(realgud-bp-line-enabled-face ((t (:foreground "orange")))) | ||
| 612 | `(realgud-bp-line-disabled-face ((t (:underline t)))) | ||
| 613 | `(realgud-file-name ((t (:foreground "cyan")))) | ||
| 614 | `(realgud-line-number ((t (:foreground "yellow")))) | ||
| 615 | `(realgud-backtrace-number ((t (:foreground "yellow" :weight bold)))))) | ||
| 616 | |||
| 605 | '(scroll-bar ((t (:background "grey75" :foreground "WhiteSmoke")))) | 617 | '(scroll-bar ((t (:background "grey75" :foreground "WhiteSmoke")))) |
| 606 | '(secondary-selection ((t (:background "SkyBlue4")))) | 618 | '(secondary-selection ((t (:background "SkyBlue4")))) |
| 607 | '(semantic-dirty-token-face ((t (:background "lightyellow")))) | 619 | '(semantic-dirty-token-face ((t (:background "lightyellow")))) |
diff --git a/etc/themes/tsdh-dark-theme.el b/etc/themes/tsdh-dark-theme.el index cd94a71bd38..4f48854d449 100644 --- a/etc/themes/tsdh-dark-theme.el +++ b/etc/themes/tsdh-dark-theme.el | |||
| @@ -118,6 +118,16 @@ | |||
| 118 | '(outline-6 ((t (:foreground "light salmon" :weight bold)))) | 118 | '(outline-6 ((t (:foreground "light salmon" :weight bold)))) |
| 119 | '(outline-7 ((t (:foreground "pale goldenrod" :weight bold)))) | 119 | '(outline-7 ((t (:foreground "pale goldenrod" :weight bold)))) |
| 120 | '(outline-8 ((t (:foreground "OliveDrab1" :weight bold)))) | 120 | '(outline-8 ((t (:foreground "OliveDrab1" :weight bold)))) |
| 121 | `(realgud-overlay-arrow1 ((t (:foreground "medium spring green")))) | ||
| 122 | `(realgud-overlay-arrow2 ((t (:foreground "OliveDrab1")))) | ||
| 123 | `(realgud-overlay-arrow3 ((t (:foreground "light salmon")))) | ||
| 124 | `(realgud-bp-enabled-face ((t (:inherit error)))) | ||
| 125 | `(realgud-bp-disabled-face ((t (:foreground "gray35")))) | ||
| 126 | `(realgud-bp-line-enabled-face ((t (:foreground "light salmon")))) | ||
| 127 | `(realgud-bp-line-disabled-face ((t (:foreground "medium spring green")))) | ||
| 128 | `(realgud-file-name ((t (:foreground "dark khaki")))) | ||
| 129 | `(realgud-line-number ((t (:foreground "cyan3")))) | ||
| 130 | `(realgud-backtrace-number ((t (:foreground "cyan3" :weight bold)))))) | ||
| 121 | '(rcirc-my-nick ((t (:foreground "SpringGreen1" :weight bold))) t) | 131 | '(rcirc-my-nick ((t (:foreground "SpringGreen1" :weight bold))) t) |
| 122 | '(rcirc-other-nick ((t (:foreground "dodger blue"))) t) | 132 | '(rcirc-other-nick ((t (:foreground "dodger blue"))) t) |
| 123 | '(rcirc-track-keyword ((t (:foreground "DodgerBlue" :weight bold))) t) | 133 | '(rcirc-track-keyword ((t (:foreground "DodgerBlue" :weight bold))) t) |
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 59db00d5f96..985b7513a3b 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el | |||
| @@ -602,6 +602,7 @@ font-lock keywords will not be case sensitive." | |||
| 602 | ;;(set (make-local-variable 'adaptive-fill-mode) nil) | 602 | ;;(set (make-local-variable 'adaptive-fill-mode) nil) |
| 603 | (setq-local indent-line-function 'lisp-indent-line) | 603 | (setq-local indent-line-function 'lisp-indent-line) |
| 604 | (setq-local indent-region-function 'lisp-indent-region) | 604 | (setq-local indent-region-function 'lisp-indent-region) |
| 605 | (setq-local comment-indent-function #'lisp-comment-indent) | ||
| 605 | (setq-local outline-regexp ";;;\\(;* [^ \t\n]\\|###autoload\\)\\|(") | 606 | (setq-local outline-regexp ";;;\\(;* [^ \t\n]\\|###autoload\\)\\|(") |
| 606 | (setq-local outline-level 'lisp-outline-level) | 607 | (setq-local outline-level 'lisp-outline-level) |
| 607 | (setq-local add-log-current-defun-function #'lisp-current-defun-name) | 608 | (setq-local add-log-current-defun-function #'lisp-current-defun-name) |
| @@ -735,9 +736,15 @@ or to switch back to an existing one." | |||
| 735 | 736 | ||
| 736 | (autoload 'lisp-eval-defun "inf-lisp" nil t) | 737 | (autoload 'lisp-eval-defun "inf-lisp" nil t) |
| 737 | 738 | ||
| 738 | ;; May still be used by some external Lisp-mode variant. | 739 | (defun lisp-comment-indent () |
| 739 | (define-obsolete-function-alias 'lisp-comment-indent | 740 | "Like `comment-indent-default', but don't put space after open paren." |
| 740 | 'comment-indent-default "22.1") | 741 | (let ((pt (point))) |
| 742 | (skip-syntax-backward " ") | ||
| 743 | (if (eq (preceding-char) ?\() | ||
| 744 | (cons (current-column) (current-column)) | ||
| 745 | (goto-char pt) | ||
| 746 | (comment-indent-default)))) | ||
| 747 | |||
| 741 | (define-obsolete-function-alias 'lisp-mode-auto-fill 'do-auto-fill "23.1") | 748 | (define-obsolete-function-alias 'lisp-mode-auto-fill 'do-auto-fill "23.1") |
| 742 | 749 | ||
| 743 | (defcustom lisp-indent-offset nil | 750 | (defcustom lisp-indent-offset nil |
diff --git a/lisp/ffap.el b/lisp/ffap.el index 87531110b86..8bcfbfcdff7 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el | |||
| @@ -1536,7 +1536,8 @@ If `ffap-url-regexp' is not nil, the FILENAME may also be an URL. | |||
| 1536 | With a prefix, this command behaves exactly like `ffap-file-finder'. | 1536 | With a prefix, this command behaves exactly like `ffap-file-finder'. |
| 1537 | If `ffap-require-prefix' is set, the prefix meaning is reversed. | 1537 | If `ffap-require-prefix' is set, the prefix meaning is reversed. |
| 1538 | See also the variables `ffap-dired-wildcards', `ffap-newfile-prompt', | 1538 | See also the variables `ffap-dired-wildcards', `ffap-newfile-prompt', |
| 1539 | and the functions `ffap-file-at-point' and `ffap-url-at-point'." | 1539 | `ffap-url-unwrap-local', `ffap-url-unwrap-remote', and the functions |
| 1540 | `ffap-file-at-point' and `ffap-url-at-point'." | ||
| 1540 | (interactive) | 1541 | (interactive) |
| 1541 | (if (and (called-interactively-p 'interactive) | 1542 | (if (and (called-interactively-p 'interactive) |
| 1542 | (if ffap-require-prefix (not current-prefix-arg) | 1543 | (if ffap-require-prefix (not current-prefix-arg) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 9c327c410a7..945f81188c8 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -2128,9 +2128,7 @@ Falls back to normal file name handler if no Tramp file name handler exists." | |||
| 2128 | (unwind-protect | 2128 | (unwind-protect |
| 2129 | (let ((tramp-locker t)) | 2129 | (let ((tramp-locker t)) |
| 2130 | (apply foreign operation args)) | 2130 | (apply foreign operation args)) |
| 2131 | ;; Give timers a chance. | 2131 | (setq tramp-locked tl)))))) |
| 2132 | (unless (setq tramp-locked tl) | ||
| 2133 | (sit-for 0.001 'nodisp))))))) | ||
| 2134 | (cond | 2132 | (cond |
| 2135 | ((eq result 'non-essential) | 2133 | ((eq result 'non-essential) |
| 2136 | (tramp-message | 2134 | (tramp-message |
diff --git a/lisp/newcomment.el b/lisp/newcomment.el index 4b261c34c65..8772b52376d 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el | |||
| @@ -142,9 +142,10 @@ Should be an empty string if comments are terminated by end-of-line.") | |||
| 142 | ;;;###autoload | 142 | ;;;###autoload |
| 143 | (defvar comment-indent-function 'comment-indent-default | 143 | (defvar comment-indent-function 'comment-indent-default |
| 144 | "Function to compute desired indentation for a comment. | 144 | "Function to compute desired indentation for a comment. |
| 145 | This function is called with no args with point at the beginning of | 145 | This function is called with no args with point at the beginning |
| 146 | the comment's starting delimiter and should return either the desired | 146 | of the comment's starting delimiter and should return either the |
| 147 | column indentation or nil. | 147 | desired column indentation, a range of acceptable |
| 148 | indentation (MIN . MAX), or nil. | ||
| 148 | If nil is returned, indentation is delegated to `indent-according-to-mode'.") | 149 | If nil is returned, indentation is delegated to `indent-according-to-mode'.") |
| 149 | 150 | ||
| 150 | ;;;###autoload | 151 | ;;;###autoload |
| @@ -649,13 +650,20 @@ The criteria are (in this order): | |||
| 649 | - prefer INDENT (or `comment-column' if nil). | 650 | - prefer INDENT (or `comment-column' if nil). |
| 650 | Point is expected to be at the start of the comment." | 651 | Point is expected to be at the start of the comment." |
| 651 | (unless indent (setq indent comment-column)) | 652 | (unless indent (setq indent comment-column)) |
| 652 | ;; Avoid moving comments past the fill-column. | 653 | (let ((other nil) |
| 653 | (let ((max (+ (current-column) | 654 | min max) |
| 654 | (- (or comment-fill-column fill-column) | 655 | (pcase indent |
| 655 | (save-excursion (end-of-line) (current-column))))) | 656 | (`(,lo . ,hi) (setq min lo) (setq max hi) |
| 656 | (other nil) | 657 | (setq indent comment-column)) |
| 657 | (min (save-excursion (skip-chars-backward " \t") | 658 | (_ ;; Avoid moving comments past the fill-column. |
| 658 | (if (bolp) 0 (+ comment-inline-offset (current-column)))))) | 659 | (setq max (+ (current-column) |
| 660 | (- (or comment-fill-column fill-column) | ||
| 661 | (save-excursion (end-of-line) (current-column))))) | ||
| 662 | (setq min (save-excursion | ||
| 663 | (skip-chars-backward " \t") | ||
| 664 | ;; Leave at least `comment-inline-offset' space after | ||
| 665 | ;; other nonwhite text on the line. | ||
| 666 | (if (bolp) 0 (+ comment-inline-offset (current-column))))))) | ||
| 659 | ;; Fix up the range. | 667 | ;; Fix up the range. |
| 660 | (if (< max min) (setq max min)) | 668 | (if (< max min) (setq max min)) |
| 661 | ;; Don't move past the fill column. | 669 | ;; Don't move past the fill column. |
| @@ -750,13 +758,6 @@ If CONTINUE is non-nil, use the `comment-continue' markers if any." | |||
| 750 | ;; If the comment is at the right of code, adjust the indentation. | 758 | ;; If the comment is at the right of code, adjust the indentation. |
| 751 | (unless (save-excursion (skip-chars-backward " \t") (bolp)) | 759 | (unless (save-excursion (skip-chars-backward " \t") (bolp)) |
| 752 | (setq indent (comment-choose-indent indent))) | 760 | (setq indent (comment-choose-indent indent))) |
| 753 | ;; Update INDENT to leave at least one space | ||
| 754 | ;; after other nonwhite text on the line. | ||
| 755 | (save-excursion | ||
| 756 | (skip-chars-backward " \t") | ||
| 757 | (unless (bolp) | ||
| 758 | (setq indent (max indent | ||
| 759 | (+ (current-column) comment-inline-offset))))) | ||
| 760 | ;; If that's different from comment's current position, change it. | 761 | ;; If that's different from comment's current position, change it. |
| 761 | (unless (= (current-column) indent) | 762 | (unless (= (current-column) indent) |
| 762 | (delete-region (point) (progn (skip-chars-backward " \t") (point))) | 763 | (delete-region (point) (progn (skip-chars-backward " \t") (point))) |
| @@ -815,7 +816,7 @@ N defaults to 0. | |||
| 815 | If N is `re', a regexp is returned instead, that would match | 816 | If N is `re', a regexp is returned instead, that would match |
| 816 | the string for any N." | 817 | the string for any N." |
| 817 | (setq n (or n 0)) | 818 | (setq n (or n 0)) |
| 818 | (when (and (stringp str) (not (string= "" str))) | 819 | (when (and (stringp str) (string-match "\\S-" str)) |
| 819 | ;; Separate the actual string from any leading/trailing padding | 820 | ;; Separate the actual string from any leading/trailing padding |
| 820 | (string-match "\\`\\s-*\\(.*?\\)\\s-*\\'" str) | 821 | (string-match "\\`\\s-*\\(.*?\\)\\s-*\\'" str) |
| 821 | (let ((s (match-string 1 str)) ;actual string | 822 | (let ((s (match-string 1 str)) ;actual string |
diff --git a/lisp/org/ob-abc.el b/lisp/org/ob-abc.el index 0ce503d3b09..9fbe35b7d83 100644 --- a/lisp/org/ob-abc.el +++ b/lisp/org/ob-abc.el | |||
| @@ -7,22 +7,20 @@ | |||
| 7 | ;; Homepage: http://www.tardis.ed.ac.uk/wwaites | 7 | ;; Homepage: http://www.tardis.ed.ac.uk/wwaites |
| 8 | ;; Version: 0.01 | 8 | ;; Version: 0.01 |
| 9 | 9 | ||
| 10 | ;;; License: | 10 | ;; This file is part of GNU Emacs. |
| 11 | 11 | ||
| 12 | ;; This program is free software; you can redistribute it and/or modify | 12 | ;; GNU Emacs is free software: you can redistribute it and/or modify |
| 13 | ;; it under the terms of the GNU General Public License as published by | 13 | ;; it under the terms of the GNU General Public License as published by |
| 14 | ;; the Free Software Foundation; either version 3, or (at your option) | 14 | ;; the Free Software Foundation, either version 3 of the License, or |
| 15 | ;; any later version. | 15 | ;; (at your option) any later version. |
| 16 | ;; | 16 | |
| 17 | ;; This program is distributed in the hope that it will be useful, | 17 | ;; GNU Emacs is distributed in the hope that it will be useful, |
| 18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | 18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 | ;; GNU General Public License for more details. | 20 | ;; GNU General Public License for more details. |
| 21 | ;; | 21 | |
| 22 | ;; You should have received a copy of the GNU General Public License | 22 | ;; You should have received a copy of the GNU General Public License |
| 23 | ;; along with GNU Emacs; see the file COPYING. If not, write to the | 23 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
| 24 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
| 25 | ;; Boston, MA 02110-1301, USA. | ||
| 26 | 24 | ||
| 27 | ;;; Commentary: | 25 | ;;; Commentary: |
| 28 | 26 | ||
diff --git a/lisp/org/ob-ebnf.el b/lisp/org/ob-ebnf.el index 410570bc5d6..ec5001cde81 100644 --- a/lisp/org/ob-ebnf.el +++ b/lisp/org/ob-ebnf.el | |||
| @@ -7,22 +7,20 @@ | |||
| 7 | ;; Homepage: http://orgmode.org | 7 | ;; Homepage: http://orgmode.org |
| 8 | ;; Version: 1.00 | 8 | ;; Version: 1.00 |
| 9 | 9 | ||
| 10 | ;;; License: | 10 | ;; This file is part of GNU Emacs. |
| 11 | 11 | ||
| 12 | ;; This program is free software; you can redistribute it and/or modify | 12 | ;; GNU Emacs is free software: you can redistribute it and/or modify |
| 13 | ;; it under the terms of the GNU General Public License as published by | 13 | ;; it under the terms of the GNU General Public License as published by |
| 14 | ;; the Free Software Foundation; either version 3, or (at your option) | 14 | ;; the Free Software Foundation, either version 3 of the License, or |
| 15 | ;; any later version. | 15 | ;; (at your option) any later version. |
| 16 | ;; | 16 | |
| 17 | ;; This program is distributed in the hope that it will be useful, | 17 | ;; GNU Emacs is distributed in the hope that it will be useful, |
| 18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | 18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 | ;; GNU General Public License for more details. | 20 | ;; GNU General Public License for more details. |
| 21 | ;; | 21 | |
| 22 | ;; You should have received a copy of the GNU General Public License | 22 | ;; You should have received a copy of the GNU General Public License |
| 23 | ;; along with GNU Emacs; see the file COPYING. If not, write to the | 23 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
| 24 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
| 25 | ;; Boston, MA 02110-1301, USA. | ||
| 26 | 24 | ||
| 27 | ;;; Commentary: | 25 | ;;; Commentary: |
| 28 | 26 | ||
diff --git a/lisp/org/ob-lua.el b/lisp/org/ob-lua.el index fa60b0ee2d6..686d41a4b68 100644 --- a/lisp/org/ob-lua.el +++ b/lisp/org/ob-lua.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; ob-lua.el --- Org Babel functions for Lua evaluation -*- lexical-binding: t; -*- | 1 | ;;; ob-lua.el --- Org Babel functions for Lua evaluation -*- lexical-binding: t; -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2014, 2016, 2017 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2014, 2016-2017 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Authors: Dieter Schoen | 5 | ;; Authors: Dieter Schoen |
| 6 | ;; Keywords: literate programming, reproducible research | 6 | ;; Keywords: literate programming, reproducible research |
diff --git a/lisp/org/ob-sed.el b/lisp/org/ob-sed.el index 733c7e19d35..f249d3240ef 100644 --- a/lisp/org/ob-sed.el +++ b/lisp/org/ob-sed.el | |||
| @@ -8,20 +8,18 @@ | |||
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| 10 | 10 | ||
| 11 | ;;; License: | 11 | ;; GNU Emacs is free software: you can redistribute it and/or modify |
| 12 | |||
| 13 | ;; This program is free software; you can redistribute it and/or modify | ||
| 14 | ;; it under the terms of the GNU General Public License as published by | 12 | ;; it under the terms of the GNU General Public License as published by |
| 15 | ;; the Free Software Foundation; either version 3, or (at your option) | 13 | ;; the Free Software Foundation, either version 3 of the License, or |
| 16 | ;; any later version. | 14 | ;; (at your option) any later version. |
| 17 | ;; | 15 | |
| 18 | ;; This program is distributed in the hope that it will be useful, | 16 | ;; GNU Emacs is distributed in the hope that it will be useful, |
| 19 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | 17 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 18 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 | ;; GNU General Public License for more details. | 19 | ;; GNU General Public License for more details. |
| 22 | ;; | 20 | |
| 23 | ;; You should have received a copy of the GNU General Public License | 21 | ;; You should have received a copy of the GNU General Public License |
| 24 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | 22 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
| 25 | 23 | ||
| 26 | ;;; Commentary: | 24 | ;;; Commentary: |
| 27 | 25 | ||
diff --git a/lisp/org/org-eww.el b/lisp/org/org-eww.el index 7bc248d4dff..c14ae115afb 100644 --- a/lisp/org/org-eww.el +++ b/lisp/org/org-eww.el | |||
| @@ -5,15 +5,15 @@ | |||
| 5 | ;; Author: Marco Wahl <marcowahlsoft>a<gmailcom> | 5 | ;; Author: Marco Wahl <marcowahlsoft>a<gmailcom> |
| 6 | ;; Keywords: link, eww | 6 | ;; Keywords: link, eww |
| 7 | ;; Homepage: http://orgmode.org | 7 | ;; Homepage: http://orgmode.org |
| 8 | ;; | 8 | |
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| 10 | ;; | 10 | |
| 11 | ;; This program is free software: you can redistribute it and/or modify | 11 | ;; GNU Emacs is free software: you can redistribute it and/or modify |
| 12 | ;; it under the terms of the GNU General Public License as published by | 12 | ;; it under the terms of the GNU General Public License as published by |
| 13 | ;; the Free Software Foundation, either version 3 of the License, or | 13 | ;; the Free Software Foundation, either version 3 of the License, or |
| 14 | ;; (at your option) any later version. | 14 | ;; (at your option) any later version. |
| 15 | 15 | ||
| 16 | ;; This program is distributed in the hope that it will be useful, | 16 | ;; GNU Emacs is distributed in the hope that it will be useful, |
| 17 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | 17 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 18 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | ;; GNU General Public License for more details. | 19 | ;; GNU General Public License for more details. |
diff --git a/lisp/org/org-lint.el b/lisp/org/org-lint.el index 89aed4bbb19..5abda7c4a6b 100644 --- a/lisp/org/org-lint.el +++ b/lisp/org/org-lint.el | |||
| @@ -1,22 +1,24 @@ | |||
| 1 | ;;; org-lint.el --- Linting for Org documents -*- lexical-binding: t; -*- | 1 | ;;; org-lint.el --- Linting for Org documents -*- lexical-binding: t; -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2015-2017 Free Software Foundation | 3 | ;; Copyright (C) 2015-2017 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr> | 5 | ;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr> |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 6 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | 7 | ||
| 8 | ;; This program is free software; you can redistribute it and/or modify | 8 | ;; This file is part of GNU Emacs. |
| 9 | |||
| 10 | ;; GNU Emacs is free software; you can redistribute it and/or modify | ||
| 9 | ;; it under the terms of the GNU General Public License as published by | 11 | ;; it under the terms of the GNU General Public License as published by |
| 10 | ;; the Free Software Foundation, either version 3 of the License, or | 12 | ;; the Free Software Foundation, either version 3 of the License, or |
| 11 | ;; (at your option) any later version. | 13 | ;; (at your option) any later version. |
| 12 | 14 | ||
| 13 | ;; This program is distributed in the hope that it will be useful, | 15 | ;; GNU Emacs is distributed in the hope that it will be useful, |
| 14 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | 16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | ;; GNU General Public License for more details. | 18 | ;; GNU General Public License for more details. |
| 17 | 19 | ||
| 18 | ;; You should have received a copy of the GNU General Public License | 20 | ;; You should have received a copy of the GNU General Public License |
| 19 | ;; along with this program. If not, see <http://www.gnu.org/licenses/>. | 21 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
| 20 | 22 | ||
| 21 | ;;; Commentary: | 23 | ;;; Commentary: |
| 22 | 24 | ||
diff --git a/lisp/org/ox-html.el b/lisp/org/ox-html.el index 9c0ba65398e..49562fa6918 100644 --- a/lisp/org/ox-html.el +++ b/lisp/org/ox-html.el | |||
| @@ -518,7 +518,7 @@ means to use the maximum value consistent with other options." | |||
| 518 | * @licstart The following is the entire license notice for the | 518 | * @licstart The following is the entire license notice for the |
| 519 | * JavaScript code in %SCRIPT_PATH. | 519 | * JavaScript code in %SCRIPT_PATH. |
| 520 | * | 520 | * |
| 521 | * Copyright (C) 2012-2013 Free Software Foundation, Inc. | 521 | * Copyright (C) 2012-2017 Free Software Foundation, Inc. |
| 522 | * | 522 | * |
| 523 | * | 523 | * |
| 524 | * The JavaScript code in this tag is free software: you can | 524 | * The JavaScript code in this tag is free software: you can |
| @@ -547,7 +547,7 @@ means to use the maximum value consistent with other options." | |||
| 547 | @licstart The following is the entire license notice for the | 547 | @licstart The following is the entire license notice for the |
| 548 | JavaScript code in this tag. | 548 | JavaScript code in this tag. |
| 549 | 549 | ||
| 550 | Copyright (C) 2012-2013 Free Software Foundation, Inc. | 550 | Copyright (C) 2012-2017 Free Software Foundation, Inc. |
| 551 | 551 | ||
| 552 | The JavaScript code in this tag is free software: you can | 552 | The JavaScript code in this tag is free software: you can |
| 553 | redistribute it and/or modify it under the terms of the GNU | 553 | redistribute it and/or modify it under the terms of the GNU |
diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el index 210f0356084..13c52a4571b 100644 --- a/lisp/progmodes/bug-reference.el +++ b/lisp/progmodes/bug-reference.el | |||
| @@ -73,10 +73,12 @@ so that it is considered safe, see `enable-local-variables'.") | |||
| 73 | "Regular expression matching bug references. | 73 | "Regular expression matching bug references. |
| 74 | The second subexpression should match the bug reference (usually a number)." | 74 | The second subexpression should match the bug reference (usually a number)." |
| 75 | :type 'string | 75 | :type 'string |
| 76 | :safe 'stringp | ||
| 77 | :version "24.3" ; previously defconst | 76 | :version "24.3" ; previously defconst |
| 78 | :group 'bug-reference) | 77 | :group 'bug-reference) |
| 79 | 78 | ||
| 79 | ;;;###autoload | ||
| 80 | (put 'bug-reference-bug-regexp 'safe-local-variable 'stringp) | ||
| 81 | |||
| 80 | (defun bug-reference-set-overlay-properties () | 82 | (defun bug-reference-set-overlay-properties () |
| 81 | "Set properties of bug reference overlays." | 83 | "Set properties of bug reference overlays." |
| 82 | (put 'bug-reference 'evaporate t) | 84 | (put 'bug-reference 'evaporate t) |
diff --git a/lisp/progmodes/cc-align.el b/lisp/progmodes/cc-align.el index 0f7e4b598dc..dbedb592895 100644 --- a/lisp/progmodes/cc-align.el +++ b/lisp/progmodes/cc-align.el | |||
| @@ -159,7 +159,7 @@ Works with: topmost-intro-cont." | |||
| 159 | (c-safe-position (or containing-sexp (point)) c-state-cache) | 159 | (c-safe-position (or containing-sexp (point)) c-state-cache) |
| 160 | containing-sexp)))) | 160 | containing-sexp)))) |
| 161 | 161 | ||
| 162 | (defun c-lineup-arglist (langelem) | 162 | (defun c-lineup-arglist (_langelem) |
| 163 | "Line up the current argument line under the first argument. | 163 | "Line up the current argument line under the first argument. |
| 164 | 164 | ||
| 165 | As a special case, if the indented line is inside a brace block | 165 | As a special case, if the indented line is inside a brace block |
| @@ -265,7 +265,7 @@ Works with: arglist-cont, arglist-cont-nonempty." | |||
| 265 | (c-forward-syntactic-ws)) | 265 | (c-forward-syntactic-ws)) |
| 266 | (c-lineup-argcont-scan other-match))))) | 266 | (c-lineup-argcont-scan other-match))))) |
| 267 | 267 | ||
| 268 | (defun c-lineup-arglist-intro-after-paren (langelem) | 268 | (defun c-lineup-arglist-intro-after-paren (_langelem) |
| 269 | "Line up a line to just after the open paren of the surrounding paren | 269 | "Line up a line to just after the open paren of the surrounding paren |
| 270 | or brace block. | 270 | or brace block. |
| 271 | 271 | ||
| @@ -483,7 +483,7 @@ Works with: func-decl-cont." | |||
| 483 | (vector (+ (current-column) c-basic-offset))) | 483 | (vector (+ (current-column) c-basic-offset))) |
| 484 | c-basic-offset)))) | 484 | c-basic-offset)))) |
| 485 | 485 | ||
| 486 | (defun c-indent-one-line-block (langelem) | 486 | (defun c-indent-one-line-block (_langelem) |
| 487 | "Indent a one line block `c-basic-offset' extra. | 487 | "Indent a one line block `c-basic-offset' extra. |
| 488 | E.g.: | 488 | E.g.: |
| 489 | 489 | ||
| @@ -506,7 +506,7 @@ Work with: Almost all syntactic symbols, but most useful on *-open." | |||
| 506 | c-basic-offset | 506 | c-basic-offset |
| 507 | nil)))) | 507 | nil)))) |
| 508 | 508 | ||
| 509 | (defun c-indent-multi-line-block (langelem) | 509 | (defun c-indent-multi-line-block (_langelem) |
| 510 | "Indent a multi line block `c-basic-offset' extra. | 510 | "Indent a multi line block `c-basic-offset' extra. |
| 511 | E.g.: | 511 | E.g.: |
| 512 | 512 | ||
| @@ -642,7 +642,7 @@ Works with: The `c' syntactic symbol." | |||
| 642 | (goto-char (c-langelem-pos langelem))))) | 642 | (goto-char (c-langelem-pos langelem))))) |
| 643 | (vector (current-column))))))) | 643 | (vector (current-column))))))) |
| 644 | 644 | ||
| 645 | (defun c-lineup-comment (langelem) | 645 | (defun c-lineup-comment (_langelem) |
| 646 | "Line up a comment start according to `c-comment-only-line-offset'. | 646 | "Line up a comment start according to `c-comment-only-line-offset'. |
| 647 | If the comment is lined up with a comment starter on the previous | 647 | If the comment is lined up with a comment starter on the previous |
| 648 | line, that alignment is preserved. | 648 | line, that alignment is preserved. |
| @@ -667,7 +667,7 @@ Works with: comment-intro." | |||
| 667 | -1000)) ;jam it against the left side | 667 | -1000)) ;jam it against the left side |
| 668 | )))) | 668 | )))) |
| 669 | 669 | ||
| 670 | (defun c-lineup-knr-region-comment (langelem) | 670 | (defun c-lineup-knr-region-comment (_langelem) |
| 671 | "Line up a comment in the \"K&R region\" with the declaration. | 671 | "Line up a comment in the \"K&R region\" with the declaration. |
| 672 | That is the region between the function or class header and the | 672 | That is the region between the function or class header and the |
| 673 | beginning of the block. E.g.: | 673 | beginning of the block. E.g.: |
| @@ -836,7 +836,7 @@ arglist-cont-nonempty." | |||
| 836 | 836 | ||
| 837 | (vector col)))))) | 837 | (vector col)))))) |
| 838 | 838 | ||
| 839 | (defun c-lineup-string-cont (langelem) | 839 | (defun c-lineup-string-cont (_langelem) |
| 840 | "Line up a continued string under the one it continues. | 840 | "Line up a continued string under the one it continues. |
| 841 | A continued string in this sense is where a string literal follows | 841 | A continued string in this sense is where a string literal follows |
| 842 | directly after another one. E.g.: | 842 | directly after another one. E.g.: |
| @@ -861,7 +861,7 @@ arglist-cont-nonempty." | |||
| 861 | (goto-char pos) | 861 | (goto-char pos) |
| 862 | (vector (current-column))))))) | 862 | (vector (current-column))))))) |
| 863 | 863 | ||
| 864 | (defun c-lineup-template-args (langelem) | 864 | (defun c-lineup-template-args (_langelem) |
| 865 | "Line up template argument lines under the first argument. | 865 | "Line up template argument lines under the first argument. |
| 866 | To allow this function to be used in a list expression, nil is | 866 | To allow this function to be used in a list expression, nil is |
| 867 | returned if there's no template argument on the first line. | 867 | returned if there's no template argument on the first line. |
| @@ -992,7 +992,7 @@ Works with: objc-method-args-cont." | |||
| 992 | (+ curcol (- prev-col-column (current-column))) | 992 | (+ curcol (- prev-col-column (current-column))) |
| 993 | c-basic-offset))))) | 993 | c-basic-offset))))) |
| 994 | 994 | ||
| 995 | (defun c-lineup-inexpr-block (langelem) | 995 | (defun c-lineup-inexpr-block (_langelem) |
| 996 | "Line up the block for constructs that use a block inside an expression, | 996 | "Line up the block for constructs that use a block inside an expression, |
| 997 | e.g. anonymous classes in Java and lambda functions in Pike. The body | 997 | e.g. anonymous classes in Java and lambda functions in Pike. The body |
| 998 | is aligned with the start of the header, e.g. with the \"new\" or | 998 | is aligned with the start of the header, e.g. with the \"new\" or |
| @@ -1020,7 +1020,7 @@ Works with: inlambda, inexpr-statement, inexpr-class." | |||
| 1020 | (goto-char (cdr res)) | 1020 | (goto-char (cdr res)) |
| 1021 | (vector (current-column)))))) | 1021 | (vector (current-column)))))) |
| 1022 | 1022 | ||
| 1023 | (defun c-lineup-whitesmith-in-block (langelem) | 1023 | (defun c-lineup-whitesmith-in-block (_langelem) |
| 1024 | "Line up lines inside a block in Whitesmith style. | 1024 | "Line up lines inside a block in Whitesmith style. |
| 1025 | It's done in a way that works both when the opening brace hangs and | 1025 | It's done in a way that works both when the opening brace hangs and |
| 1026 | when it doesn't. E.g.: | 1026 | when it doesn't. E.g.: |
| @@ -1084,7 +1084,7 @@ arglist-cont." | |||
| 1084 | (vector (+ (current-column) c-basic-offset)))) | 1084 | (vector (+ (current-column) c-basic-offset)))) |
| 1085 | (vector 0))))) | 1085 | (vector 0))))) |
| 1086 | 1086 | ||
| 1087 | (defun c-lineup-cpp-define (langelem) | 1087 | (defun c-lineup-cpp-define (_langelem) |
| 1088 | "Line up macro continuation lines according to the indentation of | 1088 | "Line up macro continuation lines according to the indentation of |
| 1089 | the construct preceding the macro. E.g.: | 1089 | the construct preceding the macro. E.g.: |
| 1090 | 1090 | ||
| @@ -1233,7 +1233,7 @@ Works with: Any syntactic symbol which has an anchor position." | |||
| 1233 | (vector (current-column)))) | 1233 | (vector (current-column)))) |
| 1234 | 1234 | ||
| 1235 | 1235 | ||
| 1236 | (defun c-lineup-dont-change (langelem) | 1236 | (defun c-lineup-dont-change (_langelem) |
| 1237 | "Do not change the indentation of the current line. | 1237 | "Do not change the indentation of the current line. |
| 1238 | 1238 | ||
| 1239 | Works with: Any syntactic symbol." | 1239 | Works with: Any syntactic symbol." |
| @@ -1241,7 +1241,7 @@ Works with: Any syntactic symbol." | |||
| 1241 | (back-to-indentation) | 1241 | (back-to-indentation) |
| 1242 | (vector (current-column)))) | 1242 | (vector (current-column)))) |
| 1243 | 1243 | ||
| 1244 | (defun c-lineup-respect-col-0 (langelem) | 1244 | (defun c-lineup-respect-col-0 (_langelem) |
| 1245 | "If the current line starts at column 0, return [0]. Otherwise return nil. | 1245 | "If the current line starts at column 0, return [0]. Otherwise return nil. |
| 1246 | 1246 | ||
| 1247 | This can be used for comments (in conjunction with, say, | 1247 | This can be used for comments (in conjunction with, say, |
| @@ -1254,7 +1254,7 @@ anchored there, but reindent other comments." | |||
| 1254 | nil))) | 1254 | nil))) |
| 1255 | 1255 | ||
| 1256 | 1256 | ||
| 1257 | (defun c-snug-do-while (syntax pos) | 1257 | (defun c-snug-do-while (syntax _pos) |
| 1258 | "Dynamically calculate brace hanginess for do-while statements. | 1258 | "Dynamically calculate brace hanginess for do-while statements. |
| 1259 | Using this function, `while' clauses that end a `do-while' block will | 1259 | Using this function, `while' clauses that end a `do-while' block will |
| 1260 | remain on the same line as the brace that closes that block. | 1260 | remain on the same line as the brace that closes that block. |
| @@ -1272,7 +1272,7 @@ ACTION associated with `block-close' syntax." | |||
| 1272 | '(before) | 1272 | '(before) |
| 1273 | '(before after))))) | 1273 | '(before after))))) |
| 1274 | 1274 | ||
| 1275 | (defun c-snug-1line-defun-close (syntax pos) | 1275 | (defun c-snug-1line-defun-close (_syntax pos) |
| 1276 | "Determine the brace hanginess for an AWK defun-close. | 1276 | "Determine the brace hanginess for an AWK defun-close. |
| 1277 | If the action/function being closed is a one-liner, keep it so. Otherwise put | 1277 | If the action/function being closed is a one-liner, keep it so. Otherwise put |
| 1278 | the closing brace on its own line." | 1278 | the closing brace on its own line." |
diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el index 736f1de2094..662329b5a9d 100644 --- a/lisp/progmodes/cc-awk.el +++ b/lisp/progmodes/cc-awk.el | |||
| @@ -592,7 +592,7 @@ | |||
| 592 | ;; starts at a `while' token. | 592 | ;; starts at a `while' token. |
| 593 | (not (c-get-char-property (c-point 'eol) 'c-awk-NL-prop))) | 593 | (not (c-get-char-property (c-point 'eol) 'c-awk-NL-prop))) |
| 594 | 594 | ||
| 595 | (defun c-awk-clear-NL-props (beg end) | 595 | (defun c-awk-clear-NL-props (beg _end) |
| 596 | ;; This function is run from before-change-hooks. It clears the | 596 | ;; This function is run from before-change-hooks. It clears the |
| 597 | ;; c-awk-NL-prop text property from beg to the end of the buffer (The END | 597 | ;; c-awk-NL-prop text property from beg to the end of the buffer (The END |
| 598 | ;; parameter is ignored). This ensures that the indentation engine will | 598 | ;; parameter is ignored). This ensures that the indentation engine will |
| @@ -847,7 +847,7 @@ | |||
| 847 | ;; Just beyond logical line following the region which is about to be changed. | 847 | ;; Just beyond logical line following the region which is about to be changed. |
| 848 | ;; Set in c-awk-record-region-clear-NL and used in c-awk-after-change. | 848 | ;; Set in c-awk-record-region-clear-NL and used in c-awk-after-change. |
| 849 | 849 | ||
| 850 | (defun c-awk-record-region-clear-NL (beg end) | 850 | (defun c-awk-record-region-clear-NL (_beg end) |
| 851 | ;; This function is called exclusively from the before-change-functions hook. | 851 | ;; This function is called exclusively from the before-change-functions hook. |
| 852 | ;; It does two things: Finds the end of the (logical) line on which END lies, | 852 | ;; It does two things: Finds the end of the (logical) line on which END lies, |
| 853 | ;; and clears c-awk-NL-prop text properties from this point onwards. BEG is | 853 | ;; and clears c-awk-NL-prop text properties from this point onwards. BEG is |
diff --git a/lisp/progmodes/cc-bytecomp.el b/lisp/progmodes/cc-bytecomp.el index e98b3dfa9df..f15d28e3da4 100644 --- a/lisp/progmodes/cc-bytecomp.el +++ b/lisp/progmodes/cc-bytecomp.el | |||
| @@ -86,6 +86,7 @@ | |||
| 86 | (defvar cc-bytecomp-environment-set nil) | 86 | (defvar cc-bytecomp-environment-set nil) |
| 87 | 87 | ||
| 88 | (defmacro cc-bytecomp-debug-msg (&rest args) | 88 | (defmacro cc-bytecomp-debug-msg (&rest args) |
| 89 | (ignore args) | ||
| 89 | ;;`(message ,@args) | 90 | ;;`(message ,@args) |
| 90 | ) | 91 | ) |
| 91 | 92 | ||
| @@ -252,7 +253,7 @@ perhaps a `cc-bytecomp-restore-environment' is forgotten somewhere")) | |||
| 252 | (cc-bytecomp-debug-msg | 253 | (cc-bytecomp-debug-msg |
| 253 | "cc-bytecomp-restore-environment: Done")))) | 254 | "cc-bytecomp-restore-environment: Done")))) |
| 254 | 255 | ||
| 255 | (defun cc-bytecomp-load (cc-part) | 256 | (defun cc-bytecomp-load (_cc-part) |
| 256 | ;; A dummy function which will immediately be overwritten by the | 257 | ;; A dummy function which will immediately be overwritten by the |
| 257 | ;; following at load time. This should suppress the byte compiler | 258 | ;; following at load time. This should suppress the byte compiler |
| 258 | ;; error that the function is "not known to be defined". | 259 | ;; error that the function is "not known to be defined". |
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index de2543951b9..121ba24f090 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el | |||
| @@ -51,6 +51,8 @@ | |||
| 51 | ;; Indentation / Display syntax functions | 51 | ;; Indentation / Display syntax functions |
| 52 | (defvar c-fix-backslashes t) | 52 | (defvar c-fix-backslashes t) |
| 53 | 53 | ||
| 54 | (defvar c-syntactic-context) | ||
| 55 | |||
| 54 | (defun c-indent-line (&optional syntax quiet ignore-point-pos) | 56 | (defun c-indent-line (&optional syntax quiet ignore-point-pos) |
| 55 | "Indent the current line according to the syntactic context, | 57 | "Indent the current line according to the syntactic context, |
| 56 | if `c-syntactic-indentation' is non-nil. Optional SYNTAX is the | 58 | if `c-syntactic-indentation' is non-nil. Optional SYNTAX is the |
| @@ -1635,7 +1637,6 @@ defun." | |||
| 1635 | (c-save-buffer-state | 1637 | (c-save-buffer-state |
| 1636 | (beginning-of-defun-function | 1638 | (beginning-of-defun-function |
| 1637 | end-of-defun-function | 1639 | end-of-defun-function |
| 1638 | (start (point)) | ||
| 1639 | (paren-state (c-parse-state)) | 1640 | (paren-state (c-parse-state)) |
| 1640 | (orig-point-min (point-min)) (orig-point-max (point-max)) | 1641 | (orig-point-min (point-min)) (orig-point-max (point-max)) |
| 1641 | lim ; Position of { which has been widened to. | 1642 | lim ; Position of { which has been widened to. |
| @@ -1759,7 +1760,6 @@ the open-parenthesis that starts a defun; see `beginning-of-defun'." | |||
| 1759 | (c-save-buffer-state | 1760 | (c-save-buffer-state |
| 1760 | (beginning-of-defun-function | 1761 | (beginning-of-defun-function |
| 1761 | end-of-defun-function | 1762 | end-of-defun-function |
| 1762 | (start (point)) | ||
| 1763 | (paren-state (c-parse-state)) | 1763 | (paren-state (c-parse-state)) |
| 1764 | (orig-point-min (point-min)) (orig-point-max (point-max)) | 1764 | (orig-point-min (point-min)) (orig-point-max (point-max)) |
| 1765 | lim | 1765 | lim |
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index 85a4085e490..eb7bde0f767 100644 --- a/lisp/progmodes/cc-defs.el +++ b/lisp/progmodes/cc-defs.el | |||
| @@ -367,6 +367,8 @@ to it is returned. This function does not modify the point or the mark." | |||
| 367 | (t (error "Unknown buffer position requested: %s" position)))) | 367 | (t (error "Unknown buffer position requested: %s" position)))) |
| 368 | (point)))) | 368 | (point)))) |
| 369 | 369 | ||
| 370 | (defvar lookup-syntax-properties) ;XEmacs. | ||
| 371 | |||
| 370 | (eval-and-compile | 372 | (eval-and-compile |
| 371 | ;; Constant to decide at compilation time whether to use category | 373 | ;; Constant to decide at compilation time whether to use category |
| 372 | ;; properties. Currently (2010-03) they're available only on GNU Emacs. | 374 | ;; properties. Currently (2010-03) they're available only on GNU Emacs. |
| @@ -1832,8 +1834,6 @@ non-nil, a caret is prepended to invert the set." | |||
| 1832 | 1834 | ||
| 1833 | (cc-bytecomp-defvar open-paren-in-column-0-is-defun-start) | 1835 | (cc-bytecomp-defvar open-paren-in-column-0-is-defun-start) |
| 1834 | 1836 | ||
| 1835 | (defvar lookup-syntax-properties) ;XEmacs. | ||
| 1836 | |||
| 1837 | (defconst c-emacs-features | 1837 | (defconst c-emacs-features |
| 1838 | (let (list) | 1838 | (let (list) |
| 1839 | 1839 | ||
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 955e1ebb08d..e880bd39321 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -241,7 +241,7 @@ | |||
| 241 | ;; Either nil, or the last character of the macro currently represented by | 241 | ;; Either nil, or the last character of the macro currently represented by |
| 242 | ;; `c-macro-cache' which isn't in a comment. */ | 242 | ;; `c-macro-cache' which isn't in a comment. */ |
| 243 | 243 | ||
| 244 | (defun c-invalidate-macro-cache (beg end) | 244 | (defun c-invalidate-macro-cache (beg _end) |
| 245 | ;; Called from a before-change function. If the change region is before or | 245 | ;; Called from a before-change function. If the change region is before or |
| 246 | ;; in the macro characterized by `c-macro-cache' etc., nullify it | 246 | ;; in the macro characterized by `c-macro-cache' etc., nullify it |
| 247 | ;; appropriately. BEG and END are the standard before-change-functions | 247 | ;; appropriately. BEG and END are the standard before-change-functions |
| @@ -834,7 +834,7 @@ comment at the start of cc-engine.el for more info." | |||
| 834 | (c-stmt-delim-chars (if comma-delim | 834 | (c-stmt-delim-chars (if comma-delim |
| 835 | c-stmt-delim-chars-with-comma | 835 | c-stmt-delim-chars-with-comma |
| 836 | c-stmt-delim-chars)) | 836 | c-stmt-delim-chars)) |
| 837 | c-in-literal-cache c-maybe-labelp after-case:-pos saved | 837 | c-maybe-labelp after-case:-pos saved |
| 838 | ;; Current position. | 838 | ;; Current position. |
| 839 | pos | 839 | pos |
| 840 | ;; Position of last stmt boundary character (e.g. ;). | 840 | ;; Position of last stmt boundary character (e.g. ;). |
| @@ -1680,6 +1680,7 @@ comment at the start of cc-engine.el for more info." | |||
| 1680 | ; (not (eobp))))))) | 1680 | ; (not (eobp))))))) |
| 1681 | 1681 | ||
| 1682 | (defmacro c-debug-sws-msg (&rest args) | 1682 | (defmacro c-debug-sws-msg (&rest args) |
| 1683 | (ignore args) | ||
| 1683 | ;;`(message ,@args) | 1684 | ;;`(message ,@args) |
| 1684 | ) | 1685 | ) |
| 1685 | 1686 | ||
| @@ -3307,7 +3308,6 @@ comment at the start of cc-engine.el for more info." | |||
| 3307 | paren+1s ; A list of `paren+1's; used to determine a | 3308 | paren+1s ; A list of `paren+1's; used to determine a |
| 3308 | ; good-pos. | 3309 | ; good-pos. |
| 3309 | bra+1 ; just after L bra-ce. | 3310 | bra+1 ; just after L bra-ce. |
| 3310 | bra+1s ; list of OLD values of bra+1. | ||
| 3311 | mstart) ; start of a macro. | 3311 | mstart) ; start of a macro. |
| 3312 | 3312 | ||
| 3313 | (save-excursion | 3313 | (save-excursion |
| @@ -3345,7 +3345,7 @@ comment at the start of cc-engine.el for more info." | |||
| 3345 | ;; Insert the opening brace/bracket/paren position. | 3345 | ;; Insert the opening brace/bracket/paren position. |
| 3346 | (setq c-state-cache (cons (1- pa+1) c-state-cache)) | 3346 | (setq c-state-cache (cons (1- pa+1) c-state-cache)) |
| 3347 | ;; Clear admin stuff for the next more nested part of the scan. | 3347 | ;; Clear admin stuff for the next more nested part of the scan. |
| 3348 | (setq ren+1 pa+1 pa+1 nil bra+1 nil bra+1s nil) | 3348 | (setq ren+1 pa+1 pa+1 nil bra+1 nil) |
| 3349 | t) ; Carry on the loop | 3349 | t) ; Carry on the loop |
| 3350 | 3350 | ||
| 3351 | ;; All open p/b/b's at this nesting level, if any, have probably | 3351 | ;; All open p/b/b's at this nesting level, if any, have probably |
| @@ -3429,7 +3429,7 @@ comment at the start of cc-engine.el for more info." | |||
| 3429 | upper-lim ; ,beyond which `c-state-cache' entries are removed | 3429 | upper-lim ; ,beyond which `c-state-cache' entries are removed |
| 3430 | scan-back-pos | 3430 | scan-back-pos |
| 3431 | cons-separated | 3431 | cons-separated |
| 3432 | pair-beg pps-point-state target-depth) | 3432 | pair-beg target-depth) |
| 3433 | 3433 | ||
| 3434 | ;; Remove entries beyond HERE. Also remove any entries inside | 3434 | ;; Remove entries beyond HERE. Also remove any entries inside |
| 3435 | ;; a macro, unless HERE is in the same macro. | 3435 | ;; a macro, unless HERE is in the same macro. |
| @@ -3485,9 +3485,6 @@ comment at the start of cc-engine.el for more info." | |||
| 3485 | target-depth | 3485 | target-depth |
| 3486 | nil pps-state)) | 3486 | nil pps-state)) |
| 3487 | 3487 | ||
| 3488 | (if (= (point) pps-point) | ||
| 3489 | (setq pps-point-state pps-state)) | ||
| 3490 | |||
| 3491 | (when (eq (car pps-state) target-depth) | 3488 | (when (eq (car pps-state) target-depth) |
| 3492 | (setq pos (point)) ; POS is now just after an R-paren/brace. | 3489 | (setq pos (point)) ; POS is now just after an R-paren/brace. |
| 3493 | (cond | 3490 | (cond |
| @@ -3732,11 +3729,10 @@ comment at the start of cc-engine.el for more info." | |||
| 3732 | ;; brace pair. | 3729 | ;; brace pair. |
| 3733 | (let ((here-bol (c-point 'bol here)) | 3730 | (let ((here-bol (c-point 'bol here)) |
| 3734 | too-high-pa ; recorded {/(/[ next above or just below here, or nil. | 3731 | too-high-pa ; recorded {/(/[ next above or just below here, or nil. |
| 3735 | dropped-cons ; was the last removed element a brace pair? | 3732 | dropped-cons) ; was the last removed element a brace pair? |
| 3736 | pa) | ||
| 3737 | ;; The easy bit - knock over-the-top bits off `c-state-cache'. | 3733 | ;; The easy bit - knock over-the-top bits off `c-state-cache'. |
| 3738 | (while (and c-state-cache | 3734 | (while (and c-state-cache |
| 3739 | (>= (setq pa (c-state-cache-top-paren)) here)) | 3735 | (>= (c-state-cache-top-paren) here)) |
| 3740 | (setq dropped-cons (consp (car c-state-cache)) | 3736 | (setq dropped-cons (consp (car c-state-cache)) |
| 3741 | too-high-pa (c-state-cache-top-lparen) | 3737 | too-high-pa (c-state-cache-top-lparen) |
| 3742 | c-state-cache (cdr c-state-cache))) | 3738 | c-state-cache (cdr c-state-cache))) |
| @@ -5027,7 +5023,7 @@ comment at the start of cc-engine.el for more info." | |||
| 5027 | 5023 | ||
| 5028 | ;; Tools for handling comments and string literals. | 5024 | ;; Tools for handling comments and string literals. |
| 5029 | 5025 | ||
| 5030 | (defun c-in-literal (&optional lim detect-cpp) | 5026 | (defun c-in-literal (&optional _lim detect-cpp) |
| 5031 | "Return the type of literal point is in, if any. | 5027 | "Return the type of literal point is in, if any. |
| 5032 | The return value is `c' if in a C-style comment, `c++' if in a C++ | 5028 | The return value is `c' if in a C-style comment, `c++' if in a C++ |
| 5033 | style comment, `string' if in a string literal, `pound' if DETECT-CPP | 5029 | style comment, `string' if in a string literal, `pound' if DETECT-CPP |
| @@ -5035,9 +5031,6 @@ is non-nil and in a preprocessor line, or nil if somewhere else. | |||
| 5035 | Optional LIM is used as the backward limit of the search. If omitted, | 5031 | Optional LIM is used as the backward limit of the search. If omitted, |
| 5036 | or nil, `c-beginning-of-defun' is used. | 5032 | or nil, `c-beginning-of-defun' is used. |
| 5037 | 5033 | ||
| 5038 | The last point calculated is cached if the cache is enabled, i.e. if | ||
| 5039 | `c-in-literal-cache' is bound to a two element vector. | ||
| 5040 | |||
| 5041 | Note that this function might do hidden buffer changes. See the | 5034 | Note that this function might do hidden buffer changes. See the |
| 5042 | comment at the start of cc-engine.el for more info." | 5035 | comment at the start of cc-engine.el for more info." |
| 5043 | (save-restriction | 5036 | (save-restriction |
| @@ -6139,7 +6132,7 @@ comment at the start of cc-engine.el for more info." | |||
| 6139 | ;; Shut up the byte compiler. | 6132 | ;; Shut up the byte compiler. |
| 6140 | (defvar c-maybe-stale-found-type) | 6133 | (defvar c-maybe-stale-found-type) |
| 6141 | 6134 | ||
| 6142 | (defun c-trim-found-types (beg end old-len) | 6135 | (defun c-trim-found-types (beg end _old-len) |
| 6143 | ;; An after change function which, in conjunction with the info in | 6136 | ;; An after change function which, in conjunction with the info in |
| 6144 | ;; c-maybe-stale-found-type (set in c-before-change), removes a type | 6137 | ;; c-maybe-stale-found-type (set in c-before-change), removes a type |
| 6145 | ;; from `c-found-types', should this type have become stale. For | 6138 | ;; from `c-found-types', should this type have become stale. For |
| @@ -6409,6 +6402,9 @@ comment at the start of cc-engine.el for more info." | |||
| 6409 | (c-clear-<>-pair-props) | 6402 | (c-clear-<>-pair-props) |
| 6410 | (forward-char))))))) | 6403 | (forward-char))))))) |
| 6411 | 6404 | ||
| 6405 | (defvar c-restricted-<>-arglists) ;FIXME: Move definition here? | ||
| 6406 | (defvar c-parse-and-markup-<>-arglists) ;FIXME: Move definition here? | ||
| 6407 | |||
| 6412 | (defun c-restore-<>-properties (_beg _end _old-len) | 6408 | (defun c-restore-<>-properties (_beg _end _old-len) |
| 6413 | ;; This function is called as an after-change function. It restores the | 6409 | ;; This function is called as an after-change function. It restores the |
| 6414 | ;; category/syntax-table properties on template/generic <..> pairs between | 6410 | ;; category/syntax-table properties on template/generic <..> pairs between |
| @@ -6715,7 +6711,7 @@ comment at the start of cc-engine.el for more info." | |||
| 6715 | (c-put-char-property open-paren 'syntax-table '(1))) | 6711 | (c-put-char-property open-paren 'syntax-table '(1))) |
| 6716 | (goto-char bound)))) | 6712 | (goto-char bound)))) |
| 6717 | 6713 | ||
| 6718 | (defun c-after-change-re-mark-raw-strings (beg end old-len) | 6714 | (defun c-after-change-re-mark-raw-strings (_beg _end _old-len) |
| 6719 | ;; This function applies `syntax-table' text properties to C++ raw strings | 6715 | ;; This function applies `syntax-table' text properties to C++ raw strings |
| 6720 | ;; beginning in the region (c-new-BEG c-new-END). BEG, END, and OLD-LEN are | 6716 | ;; beginning in the region (c-new-BEG c-new-END). BEG, END, and OLD-LEN are |
| 6721 | ;; the standard arguments supplied to any after-change function. | 6717 | ;; the standard arguments supplied to any after-change function. |
| @@ -8239,10 +8235,6 @@ comment at the start of cc-engine.el for more info." | |||
| 8239 | ;; If `backup-at-type' is nil then the other variables have | 8235 | ;; If `backup-at-type' is nil then the other variables have |
| 8240 | ;; undefined values. | 8236 | ;; undefined values. |
| 8241 | backup-at-type backup-type-start backup-id-start | 8237 | backup-at-type backup-type-start backup-id-start |
| 8242 | ;; This stores `kwd-sym' of the symbol before the current one. | ||
| 8243 | ;; This is needed to distinguish the C++11 version of "auto" from | ||
| 8244 | ;; the pre C++11 meaning. | ||
| 8245 | backup-kwd-sym | ||
| 8246 | ;; Set if we've found a specifier (apart from "typedef") that makes | 8238 | ;; Set if we've found a specifier (apart from "typedef") that makes |
| 8247 | ;; the defined identifier(s) types. | 8239 | ;; the defined identifier(s) types. |
| 8248 | at-type-decl | 8240 | at-type-decl |
| @@ -8350,7 +8342,6 @@ comment at the start of cc-engine.el for more info." | |||
| 8350 | (setq backup-at-type at-type | 8342 | (setq backup-at-type at-type |
| 8351 | backup-type-start type-start | 8343 | backup-type-start type-start |
| 8352 | backup-id-start id-start | 8344 | backup-id-start id-start |
| 8353 | backup-kwd-sym kwd-sym | ||
| 8354 | at-type found-type | 8345 | at-type found-type |
| 8355 | type-start start | 8346 | type-start start |
| 8356 | id-start (point) | 8347 | id-start (point) |
| @@ -8904,9 +8895,9 @@ comment at the start of cc-engine.el for more info." | |||
| 8904 | ;; uncommon (e.g. some placements of "const" in C++) it's not worth | 8895 | ;; uncommon (e.g. some placements of "const" in C++) it's not worth |
| 8905 | ;; the effort to look for them.) | 8896 | ;; the effort to look for them.) |
| 8906 | 8897 | ||
| 8907 | ;;; 2008-04-16: commented out the next form, to allow the function to recognize | 8898 | ;;; 2008-04-16: commented out the next form, to allow the function to recognize |
| 8908 | ;;; "foo (int bar)" in CC (an implicit type (in class foo) without a semicolon) | 8899 | ;;; "foo (int bar)" in CC (an implicit type (in class foo) without a semicolon) |
| 8909 | ;;; as a(n almost complete) declaration, enabling it to be fontified. | 8900 | ;;; as a(n almost complete) declaration, enabling it to be fontified. |
| 8910 | ;; CASE 13 | 8901 | ;; CASE 13 |
| 8911 | ;; (unless (or at-decl-end (looking-at "=[^=]")) | 8902 | ;; (unless (or at-decl-end (looking-at "=[^=]")) |
| 8912 | ;; If this is a declaration it should end here or its initializer(*) | 8903 | ;; If this is a declaration it should end here or its initializer(*) |
| @@ -10038,7 +10029,7 @@ comment at the start of cc-engine.el for more info." | |||
| 10038 | (c-syntactic-re-search-forward ";" nil 'move t)))) | 10029 | (c-syntactic-re-search-forward ";" nil 'move t)))) |
| 10039 | nil))) | 10030 | nil))) |
| 10040 | 10031 | ||
| 10041 | (defun c-looking-at-decl-block (containing-sexp goto-start &optional limit) | 10032 | (defun c-looking-at-decl-block (_containing-sexp goto-start &optional limit) |
| 10042 | ;; Assuming the point is at an open brace, check if it starts a | 10033 | ;; Assuming the point is at an open brace, check if it starts a |
| 10043 | ;; block that contains another declaration level, i.e. that isn't a | 10034 | ;; block that contains another declaration level, i.e. that isn't a |
| 10044 | ;; statement block or a brace list, and if so return non-nil. | 10035 | ;; statement block or a brace list, and if so return non-nil. |
| @@ -10311,7 +10302,7 @@ comment at the start of cc-engine.el for more info." | |||
| 10311 | ;; We're at a "{". Move back to the enum-like keyword that starts this | 10302 | ;; We're at a "{". Move back to the enum-like keyword that starts this |
| 10312 | ;; declaration and return t, otherwise don't move and return nil. | 10303 | ;; declaration and return t, otherwise don't move and return nil. |
| 10313 | (let ((here (point)) | 10304 | (let ((here (point)) |
| 10314 | up-sexp-pos before-identifier) | 10305 | before-identifier) |
| 10315 | (when c-recognize-post-brace-list-type-p | 10306 | (when c-recognize-post-brace-list-type-p |
| 10316 | (c-backward-typed-enum-colon)) | 10307 | (c-backward-typed-enum-colon)) |
| 10317 | (while | 10308 | (while |
| @@ -10581,7 +10572,7 @@ comment at the start of cc-engine.el for more info." | |||
| 10581 | next-containing nil)))) | 10572 | next-containing nil)))) |
| 10582 | (and (consp bufpos) (car bufpos)))))) | 10573 | (and (consp bufpos) (car bufpos)))))) |
| 10583 | 10574 | ||
| 10584 | (defun c-looking-at-special-brace-list (&optional lim) | 10575 | (defun c-looking-at-special-brace-list (&optional _lim) |
| 10585 | ;; If we're looking at the start of a pike-style list, i.e., `({Â })', | 10576 | ;; If we're looking at the start of a pike-style list, i.e., `({Â })', |
| 10586 | ;; `([Â ])', `(<Â >)', etc., a cons of a cons of its starting and ending | 10577 | ;; `([Â ])', `(<Â >)', etc., a cons of a cons of its starting and ending |
| 10587 | ;; positions and its entry in c-special-brace-lists is returned, nil | 10578 | ;; positions and its entry in c-special-brace-lists is returned, nil |
| @@ -10644,7 +10635,7 @@ comment at the start of cc-engine.el for more info." | |||
| 10644 | (cons (list beg) type))))) | 10635 | (cons (list beg) type))))) |
| 10645 | (error nil)))) | 10636 | (error nil)))) |
| 10646 | 10637 | ||
| 10647 | (defun c-looking-at-bos (&optional lim) | 10638 | (defun c-looking-at-bos (&optional _lim) |
| 10648 | ;; Return non-nil if between two statements or declarations, assuming | 10639 | ;; Return non-nil if between two statements or declarations, assuming |
| 10649 | ;; point is not inside a literal or comment. | 10640 | ;; point is not inside a literal or comment. |
| 10650 | ;; | 10641 | ;; |
| @@ -11206,7 +11197,7 @@ comment at the start of cc-engine.el for more info." | |||
| 11206 | containing-decl-open | 11197 | containing-decl-open |
| 11207 | containing-decl-start | 11198 | containing-decl-start |
| 11208 | containing-decl-kwd | 11199 | containing-decl-kwd |
| 11209 | paren-state) | 11200 | _paren-state) |
| 11210 | ;; The inclass and class-close syntactic symbols are added in | 11201 | ;; The inclass and class-close syntactic symbols are added in |
| 11211 | ;; several places and some work is needed to fix everything. | 11202 | ;; several places and some work is needed to fix everything. |
| 11212 | ;; Therefore it's collected here. | 11203 | ;; Therefore it's collected here. |
| @@ -11422,7 +11413,7 @@ comment at the start of cc-engine.el for more info." | |||
| 11422 | ;; following result clauses, and most of this function is a | 11413 | ;; following result clauses, and most of this function is a |
| 11423 | ;; single gigantic cond. :P | 11414 | ;; single gigantic cond. :P |
| 11424 | literal char-before-ip before-ws-ip char-after-ip macro-start | 11415 | literal char-before-ip before-ws-ip char-after-ip macro-start |
| 11425 | in-macro-expr c-syntactic-context placeholder c-in-literal-cache | 11416 | in-macro-expr c-syntactic-context placeholder |
| 11426 | step-type tmpsymbol keyword injava-inher special-brace-list tmp-pos | 11417 | step-type tmpsymbol keyword injava-inher special-brace-list tmp-pos |
| 11427 | containing-< | 11418 | containing-< |
| 11428 | ;; The following record some positions for the containing | 11419 | ;; The following record some positions for the containing |
diff --git a/lisp/progmodes/cc-guess.el b/lisp/progmodes/cc-guess.el index 153b3a31e56..c8cd6fbe40b 100644 --- a/lisp/progmodes/cc-guess.el +++ b/lisp/progmodes/cc-guess.el | |||
| @@ -494,8 +494,7 @@ is called with one argument, the guessed style." | |||
| 494 | ;; If an entry in `c-offsets-alist' holds a guessed value, move it to | 494 | ;; If an entry in `c-offsets-alist' holds a guessed value, move it to |
| 495 | ;; front in the field. In addition alphabetical sort by entry name is done. | 495 | ;; front in the field. In addition alphabetical sort by entry name is done. |
| 496 | (setq style (copy-tree style)) | 496 | (setq style (copy-tree style)) |
| 497 | (let ((offsets-alist-cell (assq 'c-offsets-alist style)) | 497 | (let ((offsets-alist-cell (assq 'c-offsets-alist style))) |
| 498 | (guessed-syntactic-symbols (c-guess-guessed-syntactic-symbols))) | ||
| 499 | (setcdr offsets-alist-cell | 498 | (setcdr offsets-alist-cell |
| 500 | (sort (cdr offsets-alist-cell) | 499 | (sort (cdr offsets-alist-cell) |
| 501 | (lambda (a b) | 500 | (lambda (a b) |
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 8be806094cd..93e8df16c16 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el | |||
| @@ -115,7 +115,7 @@ | |||
| 115 | 115 | ||
| 116 | ;; For Emacs < 22.2. | 116 | ;; For Emacs < 22.2. |
| 117 | (eval-and-compile | 117 | (eval-and-compile |
| 118 | (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) | 118 | (unless (fboundp 'declare-function) (defmacro declare-function (&rest _)))) |
| 119 | 119 | ||
| 120 | (eval-when-compile | 120 | (eval-when-compile |
| 121 | (let ((load-path | 121 | (let ((load-path |
| @@ -245,12 +245,12 @@ the evaluated constant value at compile time." | |||
| 245 | (unless (listp (car-safe ops)) | 245 | (unless (listp (car-safe ops)) |
| 246 | (setq ops (list ops))) | 246 | (setq ops (list ops))) |
| 247 | (cond ((eq opgroup-filter t) | 247 | (cond ((eq opgroup-filter t) |
| 248 | (setq opgroup-filter (lambda (opgroup) t))) | 248 | (setq opgroup-filter (lambda (_opgroup) t))) |
| 249 | ((not (functionp opgroup-filter)) | 249 | ((not (functionp opgroup-filter)) |
| 250 | (setq opgroup-filter `(lambda (opgroup) | 250 | (setq opgroup-filter `(lambda (opgroup) |
| 251 | (memq opgroup ',opgroup-filter))))) | 251 | (memq opgroup ',opgroup-filter))))) |
| 252 | (cond ((eq op-filter t) | 252 | (cond ((eq op-filter t) |
| 253 | (setq op-filter (lambda (op) t))) | 253 | (setq op-filter (lambda (_op) t))) |
| 254 | ((stringp op-filter) | 254 | ((stringp op-filter) |
| 255 | (setq op-filter `(lambda (op) | 255 | (setq op-filter `(lambda (op) |
| 256 | (string-match ,op-filter op))))) | 256 | (string-match ,op-filter op))))) |
| @@ -2852,14 +2852,7 @@ Note that Java specific rules are currently applied to tell this from | |||
| 2852 | left-assoc | 2852 | left-assoc |
| 2853 | right-assoc | 2853 | right-assoc |
| 2854 | right-assoc-sequence) | 2854 | right-assoc-sequence) |
| 2855 | t)) | 2855 | t))) |
| 2856 | |||
| 2857 | (unambiguous-prefix-ops (c--set-difference nonkeyword-prefix-ops | ||
| 2858 | in-or-postfix-ops | ||
| 2859 | :test 'string-equal)) | ||
| 2860 | (ambiguous-prefix-ops (c--intersection nonkeyword-prefix-ops | ||
| 2861 | in-or-postfix-ops | ||
| 2862 | :test 'string-equal))) | ||
| 2863 | 2856 | ||
| 2864 | (concat | 2857 | (concat |
| 2865 | "\\(" | 2858 | "\\(" |
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index ef93f75c5f3..4ea097445da 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el | |||
| @@ -927,7 +927,7 @@ Note that the style variables are always made local to the buffer." | |||
| 927 | (c-clear-char-property-with-value | 927 | (c-clear-char-property-with-value |
| 928 | m-beg (point) 'syntax-table '(1))))) | 928 | m-beg (point) 'syntax-table '(1))))) |
| 929 | 929 | ||
| 930 | (defun c-extend-region-for-CPP (beg end) | 930 | (defun c-extend-region-for-CPP (_beg _end) |
| 931 | ;; Adjust `c-new-BEG', `c-new-END' respectively to the beginning and end of | 931 | ;; Adjust `c-new-BEG', `c-new-END' respectively to the beginning and end of |
| 932 | ;; any preprocessor construct they may be in. | 932 | ;; any preprocessor construct they may be in. |
| 933 | ;; | 933 | ;; |
| @@ -951,7 +951,7 @@ Note that the style variables are always made local to the buffer." | |||
| 951 | (when (> (point) c-new-END) | 951 | (when (> (point) c-new-END) |
| 952 | (setq c-new-END (min (point) (c-determine-+ve-limit 500 c-new-END))))) | 952 | (setq c-new-END (min (point) (c-determine-+ve-limit 500 c-new-END))))) |
| 953 | 953 | ||
| 954 | (defun c-depropertize-new-text (beg end old-len) | 954 | (defun c-depropertize-new-text (beg end _old-len) |
| 955 | ;; Remove from the new text in (BEG END) any and all text properties which | 955 | ;; Remove from the new text in (BEG END) any and all text properties which |
| 956 | ;; might interfere with CC Mode's proper working. | 956 | ;; might interfere with CC Mode's proper working. |
| 957 | ;; | 957 | ;; |
| @@ -970,7 +970,7 @@ Note that the style variables are always made local to the buffer." | |||
| 970 | (c-clear-char-properties beg end 'c-type) | 970 | (c-clear-char-properties beg end 'c-type) |
| 971 | (c-clear-char-properties beg end 'c-awk-NL-prop)))) | 971 | (c-clear-char-properties beg end 'c-awk-NL-prop)))) |
| 972 | 972 | ||
| 973 | (defun c-extend-font-lock-region-for-macros (begg endd old-len) | 973 | (defun c-extend-font-lock-region-for-macros (_begg endd _old-len) |
| 974 | ;; Extend the region (c-new-BEG c-new-END) to cover all (possibly changed) | 974 | ;; Extend the region (c-new-BEG c-new-END) to cover all (possibly changed) |
| 975 | ;; preprocessor macros; The return value has no significance. | 975 | ;; preprocessor macros; The return value has no significance. |
| 976 | ;; | 976 | ;; |
| @@ -1015,7 +1015,7 @@ Note that the style variables are always made local to the buffer." | |||
| 1015 | t) | 1015 | t) |
| 1016 | (t nil))))))) | 1016 | (t nil))))))) |
| 1017 | 1017 | ||
| 1018 | (defun c-neutralize-syntax-in-and-mark-CPP (begg endd old-len) | 1018 | (defun c-neutralize-syntax-in-and-mark-CPP (_begg _endd _old-len) |
| 1019 | ;; (i) "Neutralize" every preprocessor line wholly or partially in the | 1019 | ;; (i) "Neutralize" every preprocessor line wholly or partially in the |
| 1020 | ;; changed region. "Restore" lines which were CPP lines before the change | 1020 | ;; changed region. "Restore" lines which were CPP lines before the change |
| 1021 | ;; and are no longer so. | 1021 | ;; and are no longer so. |
| @@ -1197,7 +1197,7 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".") | |||
| 1197 | ;; | 1197 | ;; |
| 1198 | ;; This function is called exclusively as a before-change function via the | 1198 | ;; This function is called exclusively as a before-change function via the |
| 1199 | ;; variable `c-get-state-before-change-functions'. | 1199 | ;; variable `c-get-state-before-change-functions'. |
| 1200 | (c-save-buffer-state (p-limit limits found) | 1200 | (c-save-buffer-state (p-limit found) |
| 1201 | ;; Special consideraton for deleting \ from '\''. | 1201 | ;; Special consideraton for deleting \ from '\''. |
| 1202 | (if (and (> end beg) | 1202 | (if (and (> end beg) |
| 1203 | (eq (char-before end) ?\\) | 1203 | (eq (char-before end) ?\\) |
| @@ -1266,7 +1266,7 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".") | |||
| 1266 | 'c-digit-separator t | 1266 | 'c-digit-separator t |
| 1267 | ?')))) | 1267 | ?')))) |
| 1268 | 1268 | ||
| 1269 | (defun c-parse-quotes-after-change (beg end old-len) | 1269 | (defun c-parse-quotes-after-change (_beg _end _old-len) |
| 1270 | ;; This function applies syntax-table properties (value '(1)) and | 1270 | ;; This function applies syntax-table properties (value '(1)) and |
| 1271 | ;; c-digit-separator properties as needed to 's within the range (c-new-BEG | 1271 | ;; c-digit-separator properties as needed to 's within the range (c-new-BEG |
| 1272 | ;; c-new-END). This operation is performed even within strings and | 1272 | ;; c-new-END). This operation is performed even within strings and |
| @@ -1274,7 +1274,7 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".") | |||
| 1274 | ;; | 1274 | ;; |
| 1275 | ;; This function is called exclusively as an after-change function via the | 1275 | ;; This function is called exclusively as an after-change function via the |
| 1276 | ;; variable `c-before-font-lock-functions'. | 1276 | ;; variable `c-before-font-lock-functions'. |
| 1277 | (c-save-buffer-state (p-limit limits num-beg num-end clear-from-BEG-to) | 1277 | (c-save-buffer-state (num-beg num-end) |
| 1278 | ;; Apply the needed syntax-table and c-digit-separator text properties to | 1278 | ;; Apply the needed syntax-table and c-digit-separator text properties to |
| 1279 | ;; quotes. | 1279 | ;; quotes. |
| 1280 | (goto-char c-new-BEG) | 1280 | (goto-char c-new-BEG) |
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el index ccd4fd29940..2ae90ce4236 100644 --- a/lisp/progmodes/cc-vars.el +++ b/lisp/progmodes/cc-vars.el | |||
| @@ -87,7 +87,7 @@ use c-constant-symbol instead." | |||
| 87 | :value nil | 87 | :value nil |
| 88 | :tag "Symbol" | 88 | :tag "Symbol" |
| 89 | :format "%t: %v\n%d" | 89 | :format "%t: %v\n%d" |
| 90 | :match (lambda (widget value) (symbolp value)) | 90 | :match (lambda (_widget value) (symbolp value)) |
| 91 | :value-to-internal | 91 | :value-to-internal |
| 92 | (lambda (widget value) | 92 | (lambda (widget value) |
| 93 | (let ((s (if (symbolp value) | 93 | (let ((s (if (symbolp value) |
| @@ -98,7 +98,7 @@ use c-constant-symbol instead." | |||
| 98 | (setq s (concat s (make-string (- l (length s)) ?\ )))) | 98 | (setq s (concat s (make-string (- l (length s)) ?\ )))) |
| 99 | s)) | 99 | s)) |
| 100 | :value-to-external | 100 | :value-to-external |
| 101 | (lambda (widget value) | 101 | (lambda (_widget value) |
| 102 | (if (stringp value) | 102 | (if (stringp value) |
| 103 | (intern (progn | 103 | (intern (progn |
| 104 | (string-match "\\`[^ ]*" value) | 104 | (string-match "\\`[^ ]*" value) |
| @@ -109,14 +109,14 @@ use c-constant-symbol instead." | |||
| 109 | "An integer or the value nil." | 109 | "An integer or the value nil." |
| 110 | :value nil | 110 | :value nil |
| 111 | :tag "Optional integer" | 111 | :tag "Optional integer" |
| 112 | :match (lambda (widget value) (or (integerp value) (null value)))) | 112 | :match (lambda (_widget value) (or (integerp value) (null value)))) |
| 113 | 113 | ||
| 114 | (define-widget 'c-symbol-list 'sexp | 114 | (define-widget 'c-symbol-list 'sexp |
| 115 | "A single symbol or a list of symbols." | 115 | "A single symbol or a list of symbols." |
| 116 | :tag "Symbols separated by spaces" | 116 | :tag "Symbols separated by spaces" |
| 117 | :validate 'widget-field-validate | 117 | :validate 'widget-field-validate |
| 118 | :match | 118 | :match |
| 119 | (lambda (widget value) | 119 | (lambda (_widget value) |
| 120 | (or (symbolp value) | 120 | (or (symbolp value) |
| 121 | (catch 'ok | 121 | (catch 'ok |
| 122 | (while (listp value) | 122 | (while (listp value) |
| @@ -125,7 +125,7 @@ use c-constant-symbol instead." | |||
| 125 | (setq value (cdr value))) | 125 | (setq value (cdr value))) |
| 126 | (null value)))) | 126 | (null value)))) |
| 127 | :value-to-internal | 127 | :value-to-internal |
| 128 | (lambda (widget value) | 128 | (lambda (_widget value) |
| 129 | (cond ((null value) | 129 | (cond ((null value) |
| 130 | "") | 130 | "") |
| 131 | ((symbolp value) | 131 | ((symbolp value) |
| @@ -138,7 +138,7 @@ use c-constant-symbol instead." | |||
| 138 | (t | 138 | (t |
| 139 | value))) | 139 | value))) |
| 140 | :value-to-external | 140 | :value-to-external |
| 141 | (lambda (widget value) | 141 | (lambda (_widget value) |
| 142 | (if (stringp value) | 142 | (if (stringp value) |
| 143 | (let (list end) | 143 | (let (list end) |
| 144 | (while (string-match "\\S +" value end) | 144 | (while (string-match "\\S +" value end) |
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 464b931cffc..6f169123b95 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -273,7 +273,7 @@ | |||
| 273 | (autoload 'help-function-arglist "help-fns") | 273 | (autoload 'help-function-arglist "help-fns") |
| 274 | 274 | ||
| 275 | ;;;###autoload | 275 | ;;;###autoload |
| 276 | (add-to-list 'auto-mode-alist (cons (purecopy "\\.pyw?\\'") 'python-mode)) | 276 | (add-to-list 'auto-mode-alist (cons (purecopy "\\.py[iw]?\\'") 'python-mode)) |
| 277 | ;;;###autoload | 277 | ;;;###autoload |
| 278 | (add-to-list 'interpreter-mode-alist (cons (purecopy "python[0-9.]*") 'python-mode)) | 278 | (add-to-list 'interpreter-mode-alist (cons (purecopy "python[0-9.]*") 'python-mode)) |
| 279 | 279 | ||
diff --git a/src/bytecode.c b/src/bytecode.c index e781a87d16f..a473dfb9c8c 100644 --- a/src/bytecode.c +++ b/src/bytecode.c | |||
| @@ -452,14 +452,6 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, | |||
| 452 | the table clearer. */ | 452 | the table clearer. */ |
| 453 | #define LABEL(OP) [OP] = &&insn_ ## OP | 453 | #define LABEL(OP) [OP] = &&insn_ ## OP |
| 454 | 454 | ||
| 455 | #if GNUC_PREREQ (4, 6, 0) | ||
| 456 | # pragma GCC diagnostic push | ||
| 457 | # pragma GCC diagnostic ignored "-Woverride-init" | ||
| 458 | #elif defined __clang__ | ||
| 459 | # pragma GCC diagnostic push | ||
| 460 | # pragma GCC diagnostic ignored "-Winitializer-overrides" | ||
| 461 | #endif | ||
| 462 | |||
| 463 | /* This is the dispatch table for the threaded interpreter. */ | 455 | /* This is the dispatch table for the threaded interpreter. */ |
| 464 | static const void *const targets[256] = | 456 | static const void *const targets[256] = |
| 465 | { | 457 | { |
| @@ -471,10 +463,6 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, | |||
| 471 | #undef DEFINE | 463 | #undef DEFINE |
| 472 | }; | 464 | }; |
| 473 | 465 | ||
| 474 | #if GNUC_PREREQ (4, 6, 0) || defined __clang__ | ||
| 475 | # pragma GCC diagnostic pop | ||
| 476 | #endif | ||
| 477 | |||
| 478 | #endif | 466 | #endif |
| 479 | 467 | ||
| 480 | 468 | ||
diff --git a/src/character.c b/src/character.c index cf460540725..1c6020ee468 100644 --- a/src/character.c +++ b/src/character.c | |||
| @@ -1050,9 +1050,26 @@ blankp (int c) | |||
| 1050 | return XINT (category) == UNICODE_CATEGORY_Zs; /* separator, space */ | 1050 | return XINT (category) == UNICODE_CATEGORY_Zs; /* separator, space */ |
| 1051 | } | 1051 | } |
| 1052 | 1052 | ||
| 1053 | signed char HEXDIGIT_CONST hexdigit[UCHAR_MAX + 1] = | ||
| 1054 | { | ||
| 1055 | #if HEXDIGIT_IS_CONST | ||
| 1056 | [0 ... UCHAR_MAX] = -1, | ||
| 1057 | #endif | ||
| 1058 | ['0'] = 0, ['1'] = 1, ['2'] = 2, ['3'] = 3, ['4'] = 4, | ||
| 1059 | ['5'] = 5, ['6'] = 6, ['7'] = 7, ['8'] = 8, ['9'] = 9, | ||
| 1060 | ['A'] = 10, ['B'] = 11, ['C'] = 12, ['D'] = 13, ['E'] = 14, ['F'] = 15, | ||
| 1061 | ['a'] = 10, ['b'] = 11, ['c'] = 12, ['d'] = 13, ['e'] = 14, ['f'] = 15 | ||
| 1062 | }; | ||
| 1063 | |||
| 1053 | void | 1064 | void |
| 1054 | syms_of_character (void) | 1065 | syms_of_character (void) |
| 1055 | { | 1066 | { |
| 1067 | #if !HEXDIGIT_IS_CONST | ||
| 1068 | /* Set the non-hex digit values to -1. */ | ||
| 1069 | for (int i = 0; i <= UCHAR_MAX; i++) | ||
| 1070 | hexdigit[i] -= i != '0' && !hexdigit[i]; | ||
| 1071 | #endif | ||
| 1072 | |||
| 1056 | DEFSYM (Qcharacterp, "characterp"); | 1073 | DEFSYM (Qcharacterp, "characterp"); |
| 1057 | DEFSYM (Qauto_fill_chars, "auto-fill-chars"); | 1074 | DEFSYM (Qauto_fill_chars, "auto-fill-chars"); |
| 1058 | 1075 | ||
diff --git a/src/character.h b/src/character.h index 62d252e91ba..b073a0dd1e4 100644 --- a/src/character.h +++ b/src/character.h | |||
| @@ -700,6 +700,24 @@ char_table_translate (Lisp_Object obj, int ch) | |||
| 700 | return CHARACTERP (obj) ? XINT (obj) : ch; | 700 | return CHARACTERP (obj) ? XINT (obj) : ch; |
| 701 | } | 701 | } |
| 702 | 702 | ||
| 703 | #if defined __GNUC__ && !defined __STRICT_ANSI__ | ||
| 704 | # define HEXDIGIT_CONST const | ||
| 705 | # define HEXDIGIT_IS_CONST true | ||
| 706 | #else | ||
| 707 | # define HEXDIGIT_CONST | ||
| 708 | # define HEXDIGIT_IS_CONST false | ||
| 709 | #endif | ||
| 710 | extern signed char HEXDIGIT_CONST hexdigit[]; | ||
| 711 | |||
| 712 | /* If C is a hexadecimal digit ('0'-'9', 'a'-'f', 'A'-'F'), return its | ||
| 713 | value (0-15). Otherwise return -1. */ | ||
| 714 | |||
| 715 | INLINE int | ||
| 716 | char_hexdigit (int c) | ||
| 717 | { | ||
| 718 | return 0 <= c && c <= UCHAR_MAX ? hexdigit[c] : -1; | ||
| 719 | } | ||
| 720 | |||
| 703 | INLINE_HEADER_END | 721 | INLINE_HEADER_END |
| 704 | 722 | ||
| 705 | #endif /* EMACS_CHARACTER_H */ | 723 | #endif /* EMACS_CHARACTER_H */ |
diff --git a/src/charset.c b/src/charset.c index d0840f7d2a9..9c3b8db2a53 100644 --- a/src/charset.c +++ b/src/charset.c | |||
| @@ -33,7 +33,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 33 | #include <unistd.h> | 33 | #include <unistd.h> |
| 34 | #include <limits.h> | 34 | #include <limits.h> |
| 35 | #include <sys/types.h> | 35 | #include <sys/types.h> |
| 36 | #include <c-ctype.h> | ||
| 37 | #include "lisp.h" | 36 | #include "lisp.h" |
| 38 | #include "character.h" | 37 | #include "character.h" |
| 39 | #include "charset.h" | 38 | #include "charset.h" |
| @@ -434,14 +433,15 @@ read_hex (FILE *fp, bool *eof, bool *overflow) | |||
| 434 | return 0; | 433 | return 0; |
| 435 | } | 434 | } |
| 436 | n = 0; | 435 | n = 0; |
| 437 | while (c_isxdigit (c = getc_unlocked (fp))) | 436 | while (true) |
| 438 | { | 437 | { |
| 438 | c = getc_unlocked (fp); | ||
| 439 | int digit = char_hexdigit (c); | ||
| 440 | if (digit < 0) | ||
| 441 | break; | ||
| 439 | if (INT_LEFT_SHIFT_OVERFLOW (n, 4)) | 442 | if (INT_LEFT_SHIFT_OVERFLOW (n, 4)) |
| 440 | *overflow = 1; | 443 | *overflow = 1; |
| 441 | n = ((n << 4) | 444 | n = (n << 4) + digit; |
| 442 | | (c - ('0' <= c && c <= '9' ? '0' | ||
| 443 | : 'A' <= c && c <= 'F' ? 'A' - 10 | ||
| 444 | : 'a' - 10))); | ||
| 445 | } | 445 | } |
| 446 | if (c != EOF) | 446 | if (c != EOF) |
| 447 | ungetc (c, fp); | 447 | ungetc (c, fp); |
diff --git a/src/editfns.c b/src/editfns.c index da99c055b54..d599fcfec80 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -4704,10 +4704,8 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) | |||
| 4704 | char src0 = src[0]; | 4704 | char src0 = src[0]; |
| 4705 | int exponent_bytes = 0; | 4705 | int exponent_bytes = 0; |
| 4706 | bool signedp = src0 == '-' || src0 == '+' || src0 == ' '; | 4706 | bool signedp = src0 == '-' || src0 == '+' || src0 == ' '; |
| 4707 | if (zero_flag | 4707 | unsigned char after_sign = src[signedp]; |
| 4708 | && ((src[signedp] >= '0' && src[signedp] <= '9') | 4708 | if (zero_flag && 0 <= char_hexdigit (after_sign)) |
| 4709 | || (src[signedp] >= 'a' && src[signedp] <= 'f') | ||
| 4710 | || (src[signedp] >= 'A' && src[signedp] <= 'F'))) | ||
| 4711 | { | 4709 | { |
| 4712 | leading_zeros += padding; | 4710 | leading_zeros += padding; |
| 4713 | padding = 0; | 4711 | padding = 0; |
diff --git a/src/image.c b/src/image.c index 07c4769e9e3..91749fb8733 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -2444,7 +2444,8 @@ static struct image_type xbm_type = | |||
| 2444 | enum xbm_token | 2444 | enum xbm_token |
| 2445 | { | 2445 | { |
| 2446 | XBM_TK_IDENT = 256, | 2446 | XBM_TK_IDENT = 256, |
| 2447 | XBM_TK_NUMBER | 2447 | XBM_TK_NUMBER, |
| 2448 | XBM_TK_OVERFLOW | ||
| 2448 | }; | 2449 | }; |
| 2449 | 2450 | ||
| 2450 | 2451 | ||
| @@ -2586,6 +2587,7 @@ xbm_scan (char **s, char *end, char *sval, int *ival) | |||
| 2586 | else if (c_isdigit (c)) | 2587 | else if (c_isdigit (c)) |
| 2587 | { | 2588 | { |
| 2588 | int value = 0, digit; | 2589 | int value = 0, digit; |
| 2590 | bool overflow = false; | ||
| 2589 | 2591 | ||
| 2590 | if (c == '0' && *s < end) | 2592 | if (c == '0' && *s < end) |
| 2591 | { | 2593 | { |
| @@ -2595,23 +2597,22 @@ xbm_scan (char **s, char *end, char *sval, int *ival) | |||
| 2595 | while (*s < end) | 2597 | while (*s < end) |
| 2596 | { | 2598 | { |
| 2597 | c = *(*s)++; | 2599 | c = *(*s)++; |
| 2598 | if (c_isdigit (c)) | 2600 | digit = char_hexdigit (c); |
| 2599 | digit = c - '0'; | 2601 | if (digit < 0) |
| 2600 | else if (c >= 'a' && c <= 'f') | ||
| 2601 | digit = c - 'a' + 10; | ||
| 2602 | else if (c >= 'A' && c <= 'F') | ||
| 2603 | digit = c - 'A' + 10; | ||
| 2604 | else | ||
| 2605 | break; | 2602 | break; |
| 2606 | value = 16 * value + digit; | 2603 | overflow |= INT_MULTIPLY_WRAPV (value, 16, &value); |
| 2604 | value += digit; | ||
| 2607 | } | 2605 | } |
| 2608 | } | 2606 | } |
| 2609 | else if (c_isdigit (c)) | 2607 | else if ('0' <= c && c <= '7') |
| 2610 | { | 2608 | { |
| 2611 | value = c - '0'; | 2609 | value = c - '0'; |
| 2612 | while (*s < end | 2610 | while (*s < end |
| 2613 | && (c = *(*s)++, c_isdigit (c))) | 2611 | && (c = *(*s)++, '0' <= c && c <= '7')) |
| 2614 | value = 8 * value + c - '0'; | 2612 | { |
| 2613 | overflow |= INT_MULTIPLY_WRAPV (value, 8, &value); | ||
| 2614 | value += c - '0'; | ||
| 2615 | } | ||
| 2615 | } | 2616 | } |
| 2616 | } | 2617 | } |
| 2617 | else | 2618 | else |
| @@ -2619,13 +2620,16 @@ xbm_scan (char **s, char *end, char *sval, int *ival) | |||
| 2619 | value = c - '0'; | 2620 | value = c - '0'; |
| 2620 | while (*s < end | 2621 | while (*s < end |
| 2621 | && (c = *(*s)++, c_isdigit (c))) | 2622 | && (c = *(*s)++, c_isdigit (c))) |
| 2622 | value = 10 * value + c - '0'; | 2623 | { |
| 2624 | overflow |= INT_MULTIPLY_WRAPV (value, 10, &value); | ||
| 2625 | overflow |= INT_ADD_WRAPV (value, c - '0', &value); | ||
| 2626 | } | ||
| 2623 | } | 2627 | } |
| 2624 | 2628 | ||
| 2625 | if (*s < end) | 2629 | if (*s < end) |
| 2626 | *s = *s - 1; | 2630 | *s = *s - 1; |
| 2627 | *ival = value; | 2631 | *ival = value; |
| 2628 | return XBM_TK_NUMBER; | 2632 | return overflow ? XBM_TK_OVERFLOW : XBM_TK_NUMBER; |
| 2629 | } | 2633 | } |
| 2630 | else if (c_isalpha (c) || c == '_') | 2634 | else if (c_isalpha (c) || c == '_') |
| 2631 | { | 2635 | { |
diff --git a/src/lread.c b/src/lread.c index 182f96223a5..7c554ba8536 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -2426,25 +2426,13 @@ read_escape (Lisp_Object readcharfun, bool stringp) | |||
| 2426 | while (1) | 2426 | while (1) |
| 2427 | { | 2427 | { |
| 2428 | c = READCHAR; | 2428 | c = READCHAR; |
| 2429 | if (c >= '0' && c <= '9') | 2429 | int digit = char_hexdigit (c); |
| 2430 | { | 2430 | if (digit < 0) |
| 2431 | i *= 16; | ||
| 2432 | i += c - '0'; | ||
| 2433 | } | ||
| 2434 | else if ((c >= 'a' && c <= 'f') | ||
| 2435 | || (c >= 'A' && c <= 'F')) | ||
| 2436 | { | ||
| 2437 | i *= 16; | ||
| 2438 | if (c >= 'a' && c <= 'f') | ||
| 2439 | i += c - 'a' + 10; | ||
| 2440 | else | ||
| 2441 | i += c - 'A' + 10; | ||
| 2442 | } | ||
| 2443 | else | ||
| 2444 | { | 2431 | { |
| 2445 | UNREAD (c); | 2432 | UNREAD (c); |
| 2446 | break; | 2433 | break; |
| 2447 | } | 2434 | } |
| 2435 | i = (i << 4) + digit; | ||
| 2448 | /* Allow hex escapes as large as ?\xfffffff, because some | 2436 | /* Allow hex escapes as large as ?\xfffffff, because some |
| 2449 | packages use them to denote characters with modifiers. */ | 2437 | packages use them to denote characters with modifiers. */ |
| 2450 | if ((CHAR_META | (CHAR_META - 1)) < i) | 2438 | if ((CHAR_META | (CHAR_META - 1)) < i) |
| @@ -2474,11 +2462,10 @@ read_escape (Lisp_Object readcharfun, bool stringp) | |||
| 2474 | c = READCHAR; | 2462 | c = READCHAR; |
| 2475 | /* `isdigit' and `isalpha' may be locale-specific, which we don't | 2463 | /* `isdigit' and `isalpha' may be locale-specific, which we don't |
| 2476 | want. */ | 2464 | want. */ |
| 2477 | if (c >= '0' && c <= '9') i = (i << 4) + (c - '0'); | 2465 | int digit = char_hexdigit (c); |
| 2478 | else if (c >= 'a' && c <= 'f') i = (i << 4) + (c - 'a') + 10; | 2466 | if (digit < 0) |
| 2479 | else if (c >= 'A' && c <= 'F') i = (i << 4) + (c - 'A') + 10; | ||
| 2480 | else | ||
| 2481 | error ("Non-hex digit used for Unicode escape"); | 2467 | error ("Non-hex digit used for Unicode escape"); |
| 2468 | i = (i << 4) + digit; | ||
| 2482 | } | 2469 | } |
| 2483 | if (i > 0x10FFFF) | 2470 | if (i > 0x10FFFF) |
| 2484 | error ("Non-Unicode character: 0x%x", i); | 2471 | error ("Non-Unicode character: 0x%x", i); |
diff --git a/src/regex.c b/src/regex.c index 240a91f2ba8..fb48765c96c 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -306,9 +306,7 @@ enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 }; | |||
| 306 | /* In Emacs, these are only used for single-byte characters. */ | 306 | /* In Emacs, these are only used for single-byte characters. */ |
| 307 | # define ISDIGIT(c) ((c) >= '0' && (c) <= '9') | 307 | # define ISDIGIT(c) ((c) >= '0' && (c) <= '9') |
| 308 | # define ISCNTRL(c) ((c) < ' ') | 308 | # define ISCNTRL(c) ((c) < ' ') |
| 309 | # define ISXDIGIT(c) (((c) >= '0' && (c) <= '9') \ | 309 | # define ISXDIGIT(c) (0 <= char_hexdigit (c)) |
| 310 | || ((c) >= 'a' && (c) <= 'f') \ | ||
| 311 | || ((c) >= 'A' && (c) <= 'F')) | ||
| 312 | 310 | ||
| 313 | /* The rest must handle multibyte characters. */ | 311 | /* The rest must handle multibyte characters. */ |
| 314 | 312 | ||
diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el index 9dd27661d46..c4ccec7a0d8 100644 --- a/test/lisp/electric-tests.el +++ b/test/lisp/electric-tests.el | |||
| @@ -706,8 +706,7 @@ baz\"\"" | |||
| 706 | :test-in-comments nil :test-in-strings nil) | 706 | :test-in-comments nil :test-in-strings nil) |
| 707 | 707 | ||
| 708 | (define-electric-pair-test electric-quote-markdown-in-code | 708 | (define-electric-pair-test electric-quote-markdown-in-code |
| 709 | #("`a`" 1 2 (face font-lock-constant-face)) "-'" | 709 | "`a`" "-'" :expected-string "`'a`" :expected-point 3 |
| 710 | :expected-string "`'a`" :expected-point 3 | ||
| 711 | :modes '(text-mode) | 710 | :modes '(text-mode) |
| 712 | :fixture-fn (lambda () | 711 | :fixture-fn (lambda () |
| 713 | (electric-quote-local-mode) | 712 | (electric-quote-local-mode) |
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 31cf7f9ba1c..6c02daa6547 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -3739,6 +3739,8 @@ process sentinels. They shall not disturb each other." | |||
| 3739 | 3739 | ||
| 3740 | ;; Open asynchronous processes. Set process filter and sentinel. | 3740 | ;; Open asynchronous processes. Set process filter and sentinel. |
| 3741 | (dolist (buf buffers) | 3741 | (dolist (buf buffers) |
| 3742 | ;; Activate timer. | ||
| 3743 | (sit-for 0.01 'nodisp) | ||
| 3742 | (let ((proc | 3744 | (let ((proc |
| 3743 | (start-file-process-shell-command | 3745 | (start-file-process-shell-command |
| 3744 | (buffer-name buf) buf | 3746 | (buffer-name buf) buf |
| @@ -3768,6 +3770,8 @@ process sentinels. They shall not disturb each other." | |||
| 3768 | ;; with regular operation. | 3770 | ;; with regular operation. |
| 3769 | (let ((buffers (copy-sequence buffers))) | 3771 | (let ((buffers (copy-sequence buffers))) |
| 3770 | (while buffers | 3772 | (while buffers |
| 3773 | ;; Activate timer. | ||
| 3774 | (sit-for 0.01 'nodisp) | ||
| 3771 | (let* ((buf (nth (random (length buffers)) buffers)) | 3775 | (let* ((buf (nth (random (length buffers)) buffers)) |
| 3772 | (proc (get-buffer-process buf)) | 3776 | (proc (get-buffer-process buf)) |
| 3773 | (file (process-get proc 'foo)) | 3777 | (file (process-get proc 'foo)) |
| @@ -3808,31 +3812,34 @@ process sentinels. They shall not disturb each other." | |||
| 3808 | "Check that Tramp does not fail due to recursive load." | 3812 | "Check that Tramp does not fail due to recursive load." |
| 3809 | (skip-unless (tramp--test-enabled)) | 3813 | (skip-unless (tramp--test-enabled)) |
| 3810 | 3814 | ||
| 3811 | (dolist (code | 3815 | (let ((default-directory (expand-file-name temporary-file-directory))) |
| 3812 | (list | 3816 | (dolist (code |
| 3813 | (format "(expand-file-name %S)" tramp-test-temporary-file-directory) | 3817 | (list |
| 3814 | (format | 3818 | (format |
| 3815 | "(let ((default-directory %S)) (expand-file-name %S))" | 3819 | "(expand-file-name %S)" tramp-test-temporary-file-directory) |
| 3816 | tramp-test-temporary-file-directory | 3820 | (format |
| 3817 | temporary-file-directory))) | 3821 | "(let ((default-directory %S)) (expand-file-name %S))" |
| 3818 | (should-not | 3822 | tramp-test-temporary-file-directory |
| 3819 | (string-match | 3823 | temporary-file-directory))) |
| 3820 | "Recursive load" | 3824 | (should-not |
| 3821 | (shell-command-to-string | 3825 | (string-match |
| 3822 | (format | 3826 | "Recursive load" |
| 3823 | "%s -batch -Q -L %s --eval %s" | 3827 | (shell-command-to-string |
| 3824 | (expand-file-name invocation-name invocation-directory) | 3828 | (format |
| 3825 | (mapconcat 'shell-quote-argument load-path " -L ") | 3829 | "%s -batch -Q -L %s --eval %s" |
| 3826 | (shell-quote-argument code))))))) | 3830 | (expand-file-name invocation-name invocation-directory) |
| 3831 | (mapconcat 'shell-quote-argument load-path " -L ") | ||
| 3832 | (shell-quote-argument code)))))))) | ||
| 3827 | 3833 | ||
| 3828 | (ert-deftest tramp-test38-remote-load-path () | 3834 | (ert-deftest tramp-test38-remote-load-path () |
| 3829 | "Check that Tramp autoloads its packages with remote `load-path'." | 3835 | "Check that Tramp autoloads its packages with remote `load-path'." |
| 3830 | ;; `tramp-cleanup-all-connections' is autoloaded from tramp-cmds.el. | 3836 | ;; `tramp-cleanup-all-connections' is autoloaded from tramp-cmds.el. |
| 3831 | ;; It shall still work, when a remote file name is in the | 3837 | ;; It shall still work, when a remote file name is in the |
| 3832 | ;; `load-path'. | 3838 | ;; `load-path'. |
| 3833 | (let ((code | 3839 | (let ((default-directory (expand-file-name temporary-file-directory)) |
| 3834 | "(let ((force-load-messages t)\ | 3840 | (code |
| 3835 | (load-path (cons \"/foo:bar:\" load-path)))\ | 3841 | "(let ((force-load-messages t) \ |
| 3842 | (load-path (cons \"/foo:bar:\" load-path))) \ | ||
| 3836 | (tramp-cleanup-all-connections))")) | 3843 | (tramp-cleanup-all-connections))")) |
| 3837 | (should | 3844 | (should |
| 3838 | (string-match | 3845 | (string-match |