diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 13 | ||||
-rw-r--r-- | lisp/ffap.el | 3 | ||||
-rw-r--r-- | lisp/net/tramp.el | 4 | ||||
-rw-r--r-- | lisp/newcomment.el | 37 | ||||
-rw-r--r-- | lisp/org/ob-abc.el | 18 | ||||
-rw-r--r-- | lisp/org/ob-ebnf.el | 18 | ||||
-rw-r--r-- | lisp/org/ob-lua.el | 2 | ||||
-rw-r--r-- | lisp/org/ob-sed.el | 16 | ||||
-rw-r--r-- | lisp/org/org-eww.el | 8 | ||||
-rw-r--r-- | lisp/org/org-lint.el | 10 | ||||
-rw-r--r-- | lisp/org/ox-html.el | 4 | ||||
-rw-r--r-- | lisp/progmodes/bug-reference.el | 4 | ||||
-rw-r--r-- | lisp/progmodes/cc-align.el | 30 | ||||
-rw-r--r-- | lisp/progmodes/cc-awk.el | 4 | ||||
-rw-r--r-- | lisp/progmodes/cc-bytecomp.el | 3 | ||||
-rw-r--r-- | lisp/progmodes/cc-cmds.el | 4 | ||||
-rw-r--r-- | lisp/progmodes/cc-defs.el | 4 | ||||
-rw-r--r-- | lisp/progmodes/cc-engine.el | 53 | ||||
-rw-r--r-- | lisp/progmodes/cc-guess.el | 3 | ||||
-rw-r--r-- | lisp/progmodes/cc-langs.el | 15 | ||||
-rw-r--r-- | lisp/progmodes/cc-mode.el | 14 | ||||
-rw-r--r-- | lisp/progmodes/cc-vars.el | 12 | ||||
-rw-r--r-- | lisp/progmodes/python.el | 2 |
23 files changed, 135 insertions, 146 deletions
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." ;;(set (make-local-variable 'adaptive-fill-mode) nil) (setq-local indent-line-function 'lisp-indent-line) (setq-local indent-region-function 'lisp-indent-region) + (setq-local comment-indent-function #'lisp-comment-indent) (setq-local outline-regexp ";;;\\(;* [^ \t\n]\\|###autoload\\)\\|(") (setq-local outline-level 'lisp-outline-level) (setq-local add-log-current-defun-function #'lisp-current-defun-name) @@ -735,9 +736,15 @@ or to switch back to an existing one." (autoload 'lisp-eval-defun "inf-lisp" nil t) -;; May still be used by some external Lisp-mode variant. -(define-obsolete-function-alias 'lisp-comment-indent - 'comment-indent-default "22.1") +(defun lisp-comment-indent () + "Like `comment-indent-default', but don't put space after open paren." + (let ((pt (point))) + (skip-syntax-backward " ") + (if (eq (preceding-char) ?\() + (cons (current-column) (current-column)) + (goto-char pt) + (comment-indent-default)))) + (define-obsolete-function-alias 'lisp-mode-auto-fill 'do-auto-fill "23.1") (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. With a prefix, this command behaves exactly like `ffap-file-finder'. If `ffap-require-prefix' is set, the prefix meaning is reversed. See also the variables `ffap-dired-wildcards', `ffap-newfile-prompt', -and the functions `ffap-file-at-point' and `ffap-url-at-point'." +`ffap-url-unwrap-local', `ffap-url-unwrap-remote', and the functions +`ffap-file-at-point' and `ffap-url-at-point'." (interactive) (if (and (called-interactively-p 'interactive) (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." (unwind-protect (let ((tramp-locker t)) (apply foreign operation args)) - ;; Give timers a chance. - (unless (setq tramp-locked tl) - (sit-for 0.001 'nodisp))))))) + (setq tramp-locked tl)))))) (cond ((eq result 'non-essential) (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.") ;;;###autoload (defvar comment-indent-function 'comment-indent-default "Function to compute desired indentation for a comment. -This function is called with no args with point at the beginning of -the comment's starting delimiter and should return either the desired -column indentation or nil. +This function is called with no args with point at the beginning +of the comment's starting delimiter and should return either the +desired column indentation, a range of acceptable +indentation (MIN . MAX), or nil. If nil is returned, indentation is delegated to `indent-according-to-mode'.") ;;;###autoload @@ -649,13 +650,20 @@ The criteria are (in this order): - prefer INDENT (or `comment-column' if nil). Point is expected to be at the start of the comment." (unless indent (setq indent comment-column)) - ;; Avoid moving comments past the fill-column. - (let ((max (+ (current-column) - (- (or comment-fill-column fill-column) - (save-excursion (end-of-line) (current-column))))) - (other nil) - (min (save-excursion (skip-chars-backward " \t") - (if (bolp) 0 (+ comment-inline-offset (current-column)))))) + (let ((other nil) + min max) + (pcase indent + (`(,lo . ,hi) (setq min lo) (setq max hi) + (setq indent comment-column)) + (_ ;; Avoid moving comments past the fill-column. + (setq max (+ (current-column) + (- (or comment-fill-column fill-column) + (save-excursion (end-of-line) (current-column))))) + (setq min (save-excursion + (skip-chars-backward " \t") + ;; Leave at least `comment-inline-offset' space after + ;; other nonwhite text on the line. + (if (bolp) 0 (+ comment-inline-offset (current-column))))))) ;; Fix up the range. (if (< max min) (setq max min)) ;; Don't move past the fill column. @@ -750,13 +758,6 @@ If CONTINUE is non-nil, use the `comment-continue' markers if any." ;; If the comment is at the right of code, adjust the indentation. (unless (save-excursion (skip-chars-backward " \t") (bolp)) (setq indent (comment-choose-indent indent))) - ;; Update INDENT to leave at least one space - ;; after other nonwhite text on the line. - (save-excursion - (skip-chars-backward " \t") - (unless (bolp) - (setq indent (max indent - (+ (current-column) comment-inline-offset))))) ;; If that's different from comment's current position, change it. (unless (= (current-column) indent) (delete-region (point) (progn (skip-chars-backward " \t") (point))) @@ -815,7 +816,7 @@ N defaults to 0. If N is `re', a regexp is returned instead, that would match the string for any N." (setq n (or n 0)) - (when (and (stringp str) (not (string= "" str))) + (when (and (stringp str) (string-match "\\S-" str)) ;; Separate the actual string from any leading/trailing padding (string-match "\\`\\s-*\\(.*?\\)\\s-*\\'" str) (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 @@ ;; Homepage: http://www.tardis.ed.ac.uk/wwaites ;; Version: 0.01 -;;; License: +;; This file is part of GNU Emacs. -;; This program is free software; you can redistribute it and/or modify +;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. -;; -;; This program is distributed in the hope that it will be useful, +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. -;; + ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. ;;; Commentary: 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 @@ ;; Homepage: http://orgmode.org ;; Version: 1.00 -;;; License: +;; This file is part of GNU Emacs. -;; This program is free software; you can redistribute it and/or modify +;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. -;; -;; This program is distributed in the hope that it will be useful, +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. -;; + ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. ;;; Commentary: 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 @@ ;;; ob-lua.el --- Org Babel functions for Lua evaluation -*- lexical-binding: t; -*- -;; Copyright (C) 2014, 2016, 2017 Free Software Foundation, Inc. +;; Copyright (C) 2014, 2016-2017 Free Software Foundation, Inc. ;; Authors: Dieter Schoen ;; 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 @@ ;; This file is part of GNU Emacs. -;;; License: - -;; This program is free software; you can redistribute it and/or modify +;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. -;; -;; This program is distributed in the hope that it will be useful, +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. -;; + ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. +;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. ;;; Commentary: 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 @@ ;; Author: Marco Wahl <marcowahlsoft>a<gmailcom> ;; Keywords: link, eww ;; Homepage: http://orgmode.org -;; + ;; This file is part of GNU Emacs. -;; -;; This program is free software: you can redistribute it and/or modify + +;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. -;; This program is distributed in the hope that it will be useful, +;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; 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 @@ ;;; org-lint.el --- Linting for Org documents -*- lexical-binding: t; -*- -;; Copyright (C) 2015-2017 Free Software Foundation +;; Copyright (C) 2015-2017 Free Software Foundation, Inc. ;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr> ;; Keywords: outlines, hypermedia, calendar, wp -;; This program is free software; you can redistribute it and/or modify +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. -;; This program is distributed in the hope that it will be useful, +;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see <http://www.gnu.org/licenses/>. +;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. ;;; Commentary: 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." * @licstart The following is the entire license notice for the * JavaScript code in %SCRIPT_PATH. * - * Copyright (C) 2012-2013 Free Software Foundation, Inc. + * Copyright (C) 2012-2017 Free Software Foundation, Inc. * * * 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." @licstart The following is the entire license notice for the JavaScript code in this tag. -Copyright (C) 2012-2013 Free Software Foundation, Inc. +Copyright (C) 2012-2017 Free Software Foundation, Inc. The JavaScript code in this tag is free software: you can 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'.") "Regular expression matching bug references. The second subexpression should match the bug reference (usually a number)." :type 'string - :safe 'stringp :version "24.3" ; previously defconst :group 'bug-reference) +;;;###autoload +(put 'bug-reference-bug-regexp 'safe-local-variable 'stringp) + (defun bug-reference-set-overlay-properties () "Set properties of bug reference overlays." (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." (c-safe-position (or containing-sexp (point)) c-state-cache) containing-sexp)))) -(defun c-lineup-arglist (langelem) +(defun c-lineup-arglist (_langelem) "Line up the current argument line under the first argument. As a special case, if the indented line is inside a brace block @@ -265,7 +265,7 @@ Works with: arglist-cont, arglist-cont-nonempty." (c-forward-syntactic-ws)) (c-lineup-argcont-scan other-match))))) -(defun c-lineup-arglist-intro-after-paren (langelem) +(defun c-lineup-arglist-intro-after-paren (_langelem) "Line up a line to just after the open paren of the surrounding paren or brace block. @@ -483,7 +483,7 @@ Works with: func-decl-cont." (vector (+ (current-column) c-basic-offset))) c-basic-offset)))) -(defun c-indent-one-line-block (langelem) +(defun c-indent-one-line-block (_langelem) "Indent a one line block `c-basic-offset' extra. E.g.: @@ -506,7 +506,7 @@ Work with: Almost all syntactic symbols, but most useful on *-open." c-basic-offset nil)))) -(defun c-indent-multi-line-block (langelem) +(defun c-indent-multi-line-block (_langelem) "Indent a multi line block `c-basic-offset' extra. E.g.: @@ -642,7 +642,7 @@ Works with: The `c' syntactic symbol." (goto-char (c-langelem-pos langelem))))) (vector (current-column))))))) -(defun c-lineup-comment (langelem) +(defun c-lineup-comment (_langelem) "Line up a comment start according to `c-comment-only-line-offset'. If the comment is lined up with a comment starter on the previous line, that alignment is preserved. @@ -667,7 +667,7 @@ Works with: comment-intro." -1000)) ;jam it against the left side )))) -(defun c-lineup-knr-region-comment (langelem) +(defun c-lineup-knr-region-comment (_langelem) "Line up a comment in the \"K&R region\" with the declaration. That is the region between the function or class header and the beginning of the block. E.g.: @@ -836,7 +836,7 @@ arglist-cont-nonempty." (vector col)))))) -(defun c-lineup-string-cont (langelem) +(defun c-lineup-string-cont (_langelem) "Line up a continued string under the one it continues. A continued string in this sense is where a string literal follows directly after another one. E.g.: @@ -861,7 +861,7 @@ arglist-cont-nonempty." (goto-char pos) (vector (current-column))))))) -(defun c-lineup-template-args (langelem) +(defun c-lineup-template-args (_langelem) "Line up template argument lines under the first argument. To allow this function to be used in a list expression, nil is returned if there's no template argument on the first line. @@ -992,7 +992,7 @@ Works with: objc-method-args-cont." (+ curcol (- prev-col-column (current-column))) c-basic-offset))))) -(defun c-lineup-inexpr-block (langelem) +(defun c-lineup-inexpr-block (_langelem) "Line up the block for constructs that use a block inside an expression, e.g. anonymous classes in Java and lambda functions in Pike. The body 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." (goto-char (cdr res)) (vector (current-column)))))) -(defun c-lineup-whitesmith-in-block (langelem) +(defun c-lineup-whitesmith-in-block (_langelem) "Line up lines inside a block in Whitesmith style. It's done in a way that works both when the opening brace hangs and when it doesn't. E.g.: @@ -1084,7 +1084,7 @@ arglist-cont." (vector (+ (current-column) c-basic-offset)))) (vector 0))))) -(defun c-lineup-cpp-define (langelem) +(defun c-lineup-cpp-define (_langelem) "Line up macro continuation lines according to the indentation of the construct preceding the macro. E.g.: @@ -1233,7 +1233,7 @@ Works with: Any syntactic symbol which has an anchor position." (vector (current-column)))) -(defun c-lineup-dont-change (langelem) +(defun c-lineup-dont-change (_langelem) "Do not change the indentation of the current line. Works with: Any syntactic symbol." @@ -1241,7 +1241,7 @@ Works with: Any syntactic symbol." (back-to-indentation) (vector (current-column)))) -(defun c-lineup-respect-col-0 (langelem) +(defun c-lineup-respect-col-0 (_langelem) "If the current line starts at column 0, return [0]. Otherwise return nil. This can be used for comments (in conjunction with, say, @@ -1254,7 +1254,7 @@ anchored there, but reindent other comments." nil))) -(defun c-snug-do-while (syntax pos) +(defun c-snug-do-while (syntax _pos) "Dynamically calculate brace hanginess for do-while statements. Using this function, `while' clauses that end a `do-while' block will remain on the same line as the brace that closes that block. @@ -1272,7 +1272,7 @@ ACTION associated with `block-close' syntax." '(before) '(before after))))) -(defun c-snug-1line-defun-close (syntax pos) +(defun c-snug-1line-defun-close (_syntax pos) "Determine the brace hanginess for an AWK defun-close. If the action/function being closed is a one-liner, keep it so. Otherwise put 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 @@ ;; starts at a `while' token. (not (c-get-char-property (c-point 'eol) 'c-awk-NL-prop))) -(defun c-awk-clear-NL-props (beg end) +(defun c-awk-clear-NL-props (beg _end) ;; This function is run from before-change-hooks. It clears the ;; c-awk-NL-prop text property from beg to the end of the buffer (The END ;; parameter is ignored). This ensures that the indentation engine will @@ -847,7 +847,7 @@ ;; Just beyond logical line following the region which is about to be changed. ;; Set in c-awk-record-region-clear-NL and used in c-awk-after-change. -(defun c-awk-record-region-clear-NL (beg end) +(defun c-awk-record-region-clear-NL (_beg end) ;; This function is called exclusively from the before-change-functions hook. ;; It does two things: Finds the end of the (logical) line on which END lies, ;; 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 @@ (defvar cc-bytecomp-environment-set nil) (defmacro cc-bytecomp-debug-msg (&rest args) + (ignore args) ;;`(message ,@args) ) @@ -252,7 +253,7 @@ perhaps a `cc-bytecomp-restore-environment' is forgotten somewhere")) (cc-bytecomp-debug-msg "cc-bytecomp-restore-environment: Done")))) -(defun cc-bytecomp-load (cc-part) +(defun cc-bytecomp-load (_cc-part) ;; A dummy function which will immediately be overwritten by the ;; following at load time. This should suppress the byte compiler ;; 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 @@ ;; Indentation / Display syntax functions (defvar c-fix-backslashes t) +(defvar c-syntactic-context) + (defun c-indent-line (&optional syntax quiet ignore-point-pos) "Indent the current line according to the syntactic context, if `c-syntactic-indentation' is non-nil. Optional SYNTAX is the @@ -1635,7 +1637,6 @@ defun." (c-save-buffer-state (beginning-of-defun-function end-of-defun-function - (start (point)) (paren-state (c-parse-state)) (orig-point-min (point-min)) (orig-point-max (point-max)) lim ; Position of { which has been widened to. @@ -1759,7 +1760,6 @@ the open-parenthesis that starts a defun; see `beginning-of-defun'." (c-save-buffer-state (beginning-of-defun-function end-of-defun-function - (start (point)) (paren-state (c-parse-state)) (orig-point-min (point-min)) (orig-point-max (point-max)) 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." (t (error "Unknown buffer position requested: %s" position)))) (point)))) +(defvar lookup-syntax-properties) ;XEmacs. + (eval-and-compile ;; Constant to decide at compilation time whether to use category ;; 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." (cc-bytecomp-defvar open-paren-in-column-0-is-defun-start) -(defvar lookup-syntax-properties) ;XEmacs. - (defconst c-emacs-features (let (list) 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 @@ ;; Either nil, or the last character of the macro currently represented by ;; `c-macro-cache' which isn't in a comment. */ -(defun c-invalidate-macro-cache (beg end) +(defun c-invalidate-macro-cache (beg _end) ;; Called from a before-change function. If the change region is before or ;; in the macro characterized by `c-macro-cache' etc., nullify it ;; 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." (c-stmt-delim-chars (if comma-delim c-stmt-delim-chars-with-comma c-stmt-delim-chars)) - c-in-literal-cache c-maybe-labelp after-case:-pos saved + c-maybe-labelp after-case:-pos saved ;; Current position. pos ;; Position of last stmt boundary character (e.g. ;). @@ -1680,6 +1680,7 @@ comment at the start of cc-engine.el for more info." ; (not (eobp))))))) (defmacro c-debug-sws-msg (&rest args) + (ignore args) ;;`(message ,@args) ) @@ -3307,7 +3308,6 @@ comment at the start of cc-engine.el for more info." paren+1s ; A list of `paren+1's; used to determine a ; good-pos. bra+1 ; just after L bra-ce. - bra+1s ; list of OLD values of bra+1. mstart) ; start of a macro. (save-excursion @@ -3345,7 +3345,7 @@ comment at the start of cc-engine.el for more info." ;; Insert the opening brace/bracket/paren position. (setq c-state-cache (cons (1- pa+1) c-state-cache)) ;; Clear admin stuff for the next more nested part of the scan. - (setq ren+1 pa+1 pa+1 nil bra+1 nil bra+1s nil) + (setq ren+1 pa+1 pa+1 nil bra+1 nil) t) ; Carry on the loop ;; 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." upper-lim ; ,beyond which `c-state-cache' entries are removed scan-back-pos cons-separated - pair-beg pps-point-state target-depth) + pair-beg target-depth) ;; Remove entries beyond HERE. Also remove any entries inside ;; a macro, unless HERE is in the same macro. @@ -3485,9 +3485,6 @@ comment at the start of cc-engine.el for more info." target-depth nil pps-state)) - (if (= (point) pps-point) - (setq pps-point-state pps-state)) - (when (eq (car pps-state) target-depth) (setq pos (point)) ; POS is now just after an R-paren/brace. (cond @@ -3732,11 +3729,10 @@ comment at the start of cc-engine.el for more info." ;; brace pair. (let ((here-bol (c-point 'bol here)) too-high-pa ; recorded {/(/[ next above or just below here, or nil. - dropped-cons ; was the last removed element a brace pair? - pa) + dropped-cons) ; was the last removed element a brace pair? ;; The easy bit - knock over-the-top bits off `c-state-cache'. (while (and c-state-cache - (>= (setq pa (c-state-cache-top-paren)) here)) + (>= (c-state-cache-top-paren) here)) (setq dropped-cons (consp (car c-state-cache)) too-high-pa (c-state-cache-top-lparen) c-state-cache (cdr c-state-cache))) @@ -5027,7 +5023,7 @@ comment at the start of cc-engine.el for more info." ;; Tools for handling comments and string literals. -(defun c-in-literal (&optional lim detect-cpp) +(defun c-in-literal (&optional _lim detect-cpp) "Return the type of literal point is in, if any. The return value is `c' if in a C-style comment, `c++' if in a C++ 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. Optional LIM is used as the backward limit of the search. If omitted, or nil, `c-beginning-of-defun' is used. -The last point calculated is cached if the cache is enabled, i.e. if -`c-in-literal-cache' is bound to a two element vector. - Note that this function might do hidden buffer changes. See the comment at the start of cc-engine.el for more info." (save-restriction @@ -6139,7 +6132,7 @@ comment at the start of cc-engine.el for more info." ;; Shut up the byte compiler. (defvar c-maybe-stale-found-type) -(defun c-trim-found-types (beg end old-len) +(defun c-trim-found-types (beg end _old-len) ;; An after change function which, in conjunction with the info in ;; c-maybe-stale-found-type (set in c-before-change), removes a type ;; 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." (c-clear-<>-pair-props) (forward-char))))))) +(defvar c-restricted-<>-arglists) ;FIXME: Move definition here? +(defvar c-parse-and-markup-<>-arglists) ;FIXME: Move definition here? + (defun c-restore-<>-properties (_beg _end _old-len) ;; This function is called as an after-change function. It restores the ;; category/syntax-table properties on template/generic <..> pairs between @@ -6715,7 +6711,7 @@ comment at the start of cc-engine.el for more info." (c-put-char-property open-paren 'syntax-table '(1))) (goto-char bound)))) -(defun c-after-change-re-mark-raw-strings (beg end old-len) +(defun c-after-change-re-mark-raw-strings (_beg _end _old-len) ;; This function applies `syntax-table' text properties to C++ raw strings ;; beginning in the region (c-new-BEG c-new-END). BEG, END, and OLD-LEN are ;; the standard arguments supplied to any after-change function. @@ -8239,10 +8235,6 @@ comment at the start of cc-engine.el for more info." ;; If `backup-at-type' is nil then the other variables have ;; undefined values. backup-at-type backup-type-start backup-id-start - ;; This stores `kwd-sym' of the symbol before the current one. - ;; This is needed to distinguish the C++11 version of "auto" from - ;; the pre C++11 meaning. - backup-kwd-sym ;; Set if we've found a specifier (apart from "typedef") that makes ;; the defined identifier(s) types. at-type-decl @@ -8350,7 +8342,6 @@ comment at the start of cc-engine.el for more info." (setq backup-at-type at-type backup-type-start type-start backup-id-start id-start - backup-kwd-sym kwd-sym at-type found-type type-start start id-start (point) @@ -8904,9 +8895,9 @@ comment at the start of cc-engine.el for more info." ;; uncommon (e.g. some placements of "const" in C++) it's not worth ;; the effort to look for them.) -;;; 2008-04-16: commented out the next form, to allow the function to recognize -;;; "foo (int bar)" in CC (an implicit type (in class foo) without a semicolon) -;;; as a(n almost complete) declaration, enabling it to be fontified. +;;; 2008-04-16: commented out the next form, to allow the function to recognize +;;; "foo (int bar)" in CC (an implicit type (in class foo) without a semicolon) +;;; as a(n almost complete) declaration, enabling it to be fontified. ;; CASE 13 ;; (unless (or at-decl-end (looking-at "=[^=]")) ;; 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." (c-syntactic-re-search-forward ";" nil 'move t)))) nil))) -(defun c-looking-at-decl-block (containing-sexp goto-start &optional limit) +(defun c-looking-at-decl-block (_containing-sexp goto-start &optional limit) ;; Assuming the point is at an open brace, check if it starts a ;; block that contains another declaration level, i.e. that isn't a ;; 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." ;; We're at a "{". Move back to the enum-like keyword that starts this ;; declaration and return t, otherwise don't move and return nil. (let ((here (point)) - up-sexp-pos before-identifier) + before-identifier) (when c-recognize-post-brace-list-type-p (c-backward-typed-enum-colon)) (while @@ -10581,7 +10572,7 @@ comment at the start of cc-engine.el for more info." next-containing nil)))) (and (consp bufpos) (car bufpos)))))) -(defun c-looking-at-special-brace-list (&optional lim) +(defun c-looking-at-special-brace-list (&optional _lim) ;; If we're looking at the start of a pike-style list, i.e., `({ })', ;; `([ ])', `(< >)', etc., a cons of a cons of its starting and ending ;; 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." (cons (list beg) type))))) (error nil)))) -(defun c-looking-at-bos (&optional lim) +(defun c-looking-at-bos (&optional _lim) ;; Return non-nil if between two statements or declarations, assuming ;; point is not inside a literal or comment. ;; @@ -11206,7 +11197,7 @@ comment at the start of cc-engine.el for more info." containing-decl-open containing-decl-start containing-decl-kwd - paren-state) + _paren-state) ;; The inclass and class-close syntactic symbols are added in ;; several places and some work is needed to fix everything. ;; Therefore it's collected here. @@ -11422,7 +11413,7 @@ comment at the start of cc-engine.el for more info." ;; following result clauses, and most of this function is a ;; single gigantic cond. :P literal char-before-ip before-ws-ip char-after-ip macro-start - in-macro-expr c-syntactic-context placeholder c-in-literal-cache + in-macro-expr c-syntactic-context placeholder step-type tmpsymbol keyword injava-inher special-brace-list tmp-pos containing-< ;; 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." ;; If an entry in `c-offsets-alist' holds a guessed value, move it to ;; front in the field. In addition alphabetical sort by entry name is done. (setq style (copy-tree style)) - (let ((offsets-alist-cell (assq 'c-offsets-alist style)) - (guessed-syntactic-symbols (c-guess-guessed-syntactic-symbols))) + (let ((offsets-alist-cell (assq 'c-offsets-alist style))) (setcdr offsets-alist-cell (sort (cdr offsets-alist-cell) (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 @@ ;; For Emacs < 22.2. (eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) + (unless (fboundp 'declare-function) (defmacro declare-function (&rest _)))) (eval-when-compile (let ((load-path @@ -245,12 +245,12 @@ the evaluated constant value at compile time." (unless (listp (car-safe ops)) (setq ops (list ops))) (cond ((eq opgroup-filter t) - (setq opgroup-filter (lambda (opgroup) t))) + (setq opgroup-filter (lambda (_opgroup) t))) ((not (functionp opgroup-filter)) (setq opgroup-filter `(lambda (opgroup) (memq opgroup ',opgroup-filter))))) (cond ((eq op-filter t) - (setq op-filter (lambda (op) t))) + (setq op-filter (lambda (_op) t))) ((stringp op-filter) (setq op-filter `(lambda (op) (string-match ,op-filter op))))) @@ -2852,14 +2852,7 @@ Note that Java specific rules are currently applied to tell this from left-assoc right-assoc right-assoc-sequence) - t)) - - (unambiguous-prefix-ops (c--set-difference nonkeyword-prefix-ops - in-or-postfix-ops - :test 'string-equal)) - (ambiguous-prefix-ops (c--intersection nonkeyword-prefix-ops - in-or-postfix-ops - :test 'string-equal))) + t))) (concat "\\(" 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." (c-clear-char-property-with-value m-beg (point) 'syntax-table '(1))))) -(defun c-extend-region-for-CPP (beg end) +(defun c-extend-region-for-CPP (_beg _end) ;; Adjust `c-new-BEG', `c-new-END' respectively to the beginning and end of ;; any preprocessor construct they may be in. ;; @@ -951,7 +951,7 @@ Note that the style variables are always made local to the buffer." (when (> (point) c-new-END) (setq c-new-END (min (point) (c-determine-+ve-limit 500 c-new-END))))) -(defun c-depropertize-new-text (beg end old-len) +(defun c-depropertize-new-text (beg end _old-len) ;; Remove from the new text in (BEG END) any and all text properties which ;; might interfere with CC Mode's proper working. ;; @@ -970,7 +970,7 @@ Note that the style variables are always made local to the buffer." (c-clear-char-properties beg end 'c-type) (c-clear-char-properties beg end 'c-awk-NL-prop)))) -(defun c-extend-font-lock-region-for-macros (begg endd old-len) +(defun c-extend-font-lock-region-for-macros (_begg endd _old-len) ;; Extend the region (c-new-BEG c-new-END) to cover all (possibly changed) ;; preprocessor macros; The return value has no significance. ;; @@ -1015,7 +1015,7 @@ Note that the style variables are always made local to the buffer." t) (t nil))))))) -(defun c-neutralize-syntax-in-and-mark-CPP (begg endd old-len) +(defun c-neutralize-syntax-in-and-mark-CPP (_begg _endd _old-len) ;; (i) "Neutralize" every preprocessor line wholly or partially in the ;; changed region. "Restore" lines which were CPP lines before the change ;; and are no longer so. @@ -1197,7 +1197,7 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".") ;; ;; This function is called exclusively as a before-change function via the ;; variable `c-get-state-before-change-functions'. - (c-save-buffer-state (p-limit limits found) + (c-save-buffer-state (p-limit found) ;; Special consideraton for deleting \ from '\''. (if (and (> end beg) (eq (char-before end) ?\\) @@ -1266,7 +1266,7 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".") 'c-digit-separator t ?')))) -(defun c-parse-quotes-after-change (beg end old-len) +(defun c-parse-quotes-after-change (_beg _end _old-len) ;; This function applies syntax-table properties (value '(1)) and ;; c-digit-separator properties as needed to 's within the range (c-new-BEG ;; 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....\".") ;; ;; This function is called exclusively as an after-change function via the ;; variable `c-before-font-lock-functions'. - (c-save-buffer-state (p-limit limits num-beg num-end clear-from-BEG-to) + (c-save-buffer-state (num-beg num-end) ;; Apply the needed syntax-table and c-digit-separator text properties to ;; quotes. (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." :value nil :tag "Symbol" :format "%t: %v\n%d" - :match (lambda (widget value) (symbolp value)) + :match (lambda (_widget value) (symbolp value)) :value-to-internal (lambda (widget value) (let ((s (if (symbolp value) @@ -98,7 +98,7 @@ use c-constant-symbol instead." (setq s (concat s (make-string (- l (length s)) ?\ )))) s)) :value-to-external - (lambda (widget value) + (lambda (_widget value) (if (stringp value) (intern (progn (string-match "\\`[^ ]*" value) @@ -109,14 +109,14 @@ use c-constant-symbol instead." "An integer or the value nil." :value nil :tag "Optional integer" - :match (lambda (widget value) (or (integerp value) (null value)))) + :match (lambda (_widget value) (or (integerp value) (null value)))) (define-widget 'c-symbol-list 'sexp "A single symbol or a list of symbols." :tag "Symbols separated by spaces" :validate 'widget-field-validate :match - (lambda (widget value) + (lambda (_widget value) (or (symbolp value) (catch 'ok (while (listp value) @@ -125,7 +125,7 @@ use c-constant-symbol instead." (setq value (cdr value))) (null value)))) :value-to-internal - (lambda (widget value) + (lambda (_widget value) (cond ((null value) "") ((symbolp value) @@ -138,7 +138,7 @@ use c-constant-symbol instead." (t value))) :value-to-external - (lambda (widget value) + (lambda (_widget value) (if (stringp value) (let (list end) (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 @@ (autoload 'help-function-arglist "help-fns") ;;;###autoload -(add-to-list 'auto-mode-alist (cons (purecopy "\\.pyw?\\'") 'python-mode)) +(add-to-list 'auto-mode-alist (cons (purecopy "\\.py[iw]?\\'") 'python-mode)) ;;;###autoload (add-to-list 'interpreter-mode-alist (cons (purecopy "python[0-9.]*") 'python-mode)) |