emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 55fdbec: CC-Mode: Remove unneeded backslashes from


From: Alan Mackenzie
Subject: [Emacs-diffs] master 55fdbec: CC-Mode: Remove unneeded backslashes from doc strings and regular expressions
Date: Sat, 12 Oct 2019 05:31:59 -0400 (EDT)

branch: master
commit 55fdbec44316036b85d96a4d808a5f1f17276fc6
Author: Alan Mackenzie <address@hidden>
Commit: Alan Mackenzie <address@hidden>

    CC-Mode: Remove unneeded backslashes from doc strings and regular 
expressions
    
    Also make miscellaneous amendments.
    
    * lisp/progmodes/cc-align.el, lisp/progmodes/cc-cmds.el
    * lisp/progmodes/cc-defs.el, lisp/progmodes/cc-engine.el
    * lisp/progmodes/cc-langs.el, lisp/progmodes/cc-vars.el: Remove lots of
    unneeded backslashes.
    
    * lisp/progmodes/cc-langs.el (c-string-innards-re-alist): Remove redundant
    "\\|\r" from regular expression.
    
    * lisp/progmodes/cc-mode.el (c-make-mode-syntax-table): Correct the name of
    the hook normal-erase-is-backspace-MODE-hook from a non-existant hook name.
---
 lisp/progmodes/cc-align.el  |  4 ++--
 lisp/progmodes/cc-cmds.el   |  4 ++--
 lisp/progmodes/cc-defs.el   |  8 ++++----
 lisp/progmodes/cc-engine.el | 16 ++++++++--------
 lisp/progmodes/cc-langs.el  | 16 ++++++++--------
 lisp/progmodes/cc-mode.el   |  2 +-
 lisp/progmodes/cc-vars.el   | 23 ++++++++++++-----------
 7 files changed, 37 insertions(+), 36 deletions(-)

diff --git a/lisp/progmodes/cc-align.el b/lisp/progmodes/cc-align.el
index 74548f6..82587b7 100644
--- a/lisp/progmodes/cc-align.el
+++ b/lisp/progmodes/cc-align.el
@@ -322,7 +322,7 @@ if (  x < 10
 
 Since this function doesn't do anything for lines without an infix
 operator you typically want to use it together with some other line-up
-settings, e.g. as follows \(the arglist-close setting is just a
+settings, e.g. as follows (the arglist-close setting is just a
 suggestion to get a consistent style):
 
 \(c-set-offset \\='arglist-cont \\='(c-lineup-arglist-operators 0))
@@ -1246,7 +1246,7 @@ That is useful in a list expression to specify the 
default indentation
 on the top level.
 
 If `c-syntactic-indentation-in-macros' is nil then this function keeps
-the current indentation, except for empty lines \(ignoring the ending
+the current indentation, except for empty lines (ignoring the ending
 backslash) where it takes the indentation from the closest preceding
 nonempty line in the macro.  If there's no such line in the macro then
 the indentation is taken from the construct preceding it, as described
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index acf4c4a..0d9414e 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -61,7 +61,7 @@ syntactic information for the current line.  Be silent about 
syntactic
 errors if the optional argument QUIET is non-nil, even if
 `c-report-syntactic-errors' is non-nil.  Normally the position of
 point is used to decide where the old indentation is on a lines that
-is otherwise empty \(ignoring any line continuation backslash), but
+is otherwise empty (ignoring any line continuation backslash), but
 that's not done if IGNORE-POINT-POS is non-nil.  Returns the amount of
 indentation change \(in columns)."
 
@@ -3257,7 +3257,7 @@ to call `c-scan-conditionals' directly instead."
 A prefix argument acts as a repeat count.  With a negative argument,
 move backward across a preprocessor conditional.
 
-If there aren't enough conditionals after \(or before) point, an
+If there aren't enough conditionals after (or before) point, an
 error is signaled.
 
 \"#elif\" is treated like \"#else\" followed by \"#if\", except that
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index 34f47de..e9a3e16 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -566,11 +566,11 @@ known to be writable.  That way, these text properties 
remain set
 even if the user undoes the command which set them.
 
 This macro should ALWAYS be placed around \"temporary\" internal buffer
-changes \(like adding a newline to calculate a text-property then
+changes (like adding a newline to calculate a text-property then
 deleting it again), so that the user never sees them on his
 `buffer-undo-list'.  See also `c-tentative-buffer-changes'.
 
-However, any user-visible changes to the buffer \(like auto-newlines)
+However, any user-visible changes to the buffer (like auto-newlines)
 must not be within a `c-save-buffer-state', since the user then
 wouldn't be able to undo them.
 
@@ -597,7 +597,7 @@ was in before BODY.  Any changes are kept if the last form 
in BODY
 returns non-nil.  Otherwise it's undone using the undo facility, and
 various other buffer state that might be affected by the changes is
 restored.  That includes the current buffer, point, mark, mark
-activation \(similar to `save-excursion'), and the modified state.
+activation (similar to `save-excursion'), and the modified state.
 The state is also restored if BODY exits nonlocally.
 
 If BODY makes a change that unconditionally is undone then wrap this
@@ -2360,7 +2360,7 @@ VAL is not evaluated right away but rather when the value 
is requested
 with `c-lang-const'.  Thus it's possible to use `c-lang-const' inside
 VAL to refer to language constants that haven't been defined yet.
 However, if the definition of a language constant is in another file
-then that file must be loaded \(at compile time) before it's safe to
+then that file must be loaded (at compile time) before it's safe to
 reference the constant.
 
 The assignments in ARGS are processed in sequence like `setq', so
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 9ed4fe3..8d92b26 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -788,7 +788,7 @@ IGNORE-LABELS is non-nil.  (FIXME: Doesn't work if we stop 
at a known
 statement start keyword.)  Otherwise, each label is treated as a
 separate statement.
 
-Macros are ignored \(i.e. skipped over) unless point is within one, in
+Macros are ignored (i.e. skipped over) unless point is within one, in
 which case the content of the macro is treated as normal code.  Aside
 from any normal statement starts found in it, stop at the first token
 of the content in the macro, i.e. the expression of an \"#if\" or the
@@ -4706,7 +4706,7 @@ comment at the start of cc-engine.el for more info."
   "Return non-nil if the point is on or directly after an identifier.
 Keywords are recognized and not considered identifiers.  If an
 identifier is detected, the returned value is its starting position.
-If an identifier ends at the point and another begins at it \(can only
+If an identifier ends at the point and another begins at it (can only
 happen in Pike) then the point for the preceding one is returned.
 
 Note that this function might do hidden buffer changes.  See the
@@ -4905,7 +4905,7 @@ over the final token in a buffer, up to EOB."
 (defun c-forward-token-2 (&optional count balanced limit)
   "Move forward by tokens.
 A token is defined as all symbols and identifiers which aren't
-syntactic whitespace \(note that multicharacter tokens like \"==\" are
+syntactic whitespace (note that multicharacter tokens like \"==\" are
 treated properly).  Point is always either left at the beginning of a
 token or not moved at all.  COUNT specifies the number of tokens to
 move; a negative COUNT moves in the opposite direction.  A COUNT of 0
@@ -4917,11 +4917,11 @@ LIMIT sets the limit for the movement and defaults to 
the point limit.
 The case when LIMIT is set in the middle of a token, comment or macro
 is handled correctly, i.e. the point won't be left there.
 
-Return the number of tokens left to move \(positive or negative).  If
+Return the number of tokens left to move (positive or negative).  If
 BALANCED is true, a move over a balanced paren counts as one.  Note
 that if COUNT is 0 and no appropriate token beginning is found, 1 will
 be returned.  Thus, a return value of 0 guarantees that point is at
-the requested position and a return value less \(without signs) than
+the requested position and a return value less (without signs) than
 COUNT guarantees that point is at the beginning of some token.
 
 Note that this function might do hidden buffer changes.  See the
@@ -5065,7 +5065,7 @@ inside a literal there.
 If PAREN-LEVEL is non-nil, an additional restriction is added to
 ignore matches in nested paren sexps.  The search will also not go
 outside the current list sexp, which has the effect that if the point
-should be moved to BOUND when no match is found \(i.e. NOERROR is
+should be moved to BOUND when no match is found (i.e. NOERROR is
 neither nil nor t), then it will be at the closing paren if the end of
 the current list sexp is encountered first.
 
@@ -5090,7 +5090,7 @@ hand not safe to assume that the \"look behind\" 
subexpression never
 matches syntactic whitespace.
 
 Bug: Unbalanced parens inside cpp directives are currently not handled
-correctly \(i.e. they don't get ignored as they should) when
+correctly (i.e. they don't get ignored as they should) when
 PAREN-LEVEL is set.
 
 Note that this function might do hidden buffer changes.  See the
@@ -8965,7 +8965,7 @@ point unchanged and return nil."
 
         ;; Search syntactically to the end of the declarator (";",
         ;; ",", a closing paren, eob etc) or to the beginning of an
-        ;; initializer or function prototype ("=" or "\\s\(").
+        ;; initializer or function prototype ("=" or "\\s(").
         ;; Note that square brackets are now not also treated as
         ;; initializers, since this broke when there were also
         ;; initializing brace lists.
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index a6fdc3e..44d0d49 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -545,7 +545,7 @@ buffer local variables c-new-BEG and c-new-END.
 The functions are called even when font locking is disabled.
 
 When the mode is initialized, these functions are called with
-parameters \(point-min), \(point-max) and <buffer size>.")
+parameters (point-min), (point-max) and <buffer size>.")
 
 (c-lang-defconst c-before-context-fontification-functions
   t 'c-context-expand-fl-region
@@ -878,7 +878,7 @@ literal are multiline."
   t (mapcar (lambda (delim)
              (cons
               delim
-              (concat "\\(\\\\\\(.\\|\n\\|\r\\)\\|[^\\\n\r"
+              (concat "\\(\\\\\\(.\\|\n\\)\\|[^\\\n\r"
                       (string delim)
                       "]\\)*")))
            (and
@@ -2338,7 +2338,7 @@ will be handled."
 (c-lang-defvar c-typedef-decl-key (c-lang-const c-typedef-decl-key))
 
 (c-lang-defconst c-typeless-decl-kwds
-  "Keywords introducing declarations where the \(first) identifier
+  "Keywords introducing declarations where the (first) identifier
 \(declarator) follows directly after the keyword, without any type.
 
 If any of these also are on `c-type-list-kwds', `c-ref-list-kwds',
@@ -2442,7 +2442,7 @@ Note that unrecognized plain symbols are skipped anyway 
if they occur
 before the type, so such things are not necessary to mention here.
 Mentioning them here is necessary only if they can occur in other
 places, or if they are followed by a construct that must be skipped
-over \(like the parens in the \"__attribute__\" and \"__declspec\"
+over (like the parens in the \"__attribute__\" and \"__declspec\"
 examples above).  In the last case, they alse need to be present on
 one of `c-type-list-kwds', `c-ref-list-kwds',
 `c-colon-type-list-kwds', `c-paren-nontype-kwds', `c-paren-type-kwds',
@@ -2574,7 +2574,7 @@ The keywords on list are assumed to also be present on 
one of the
 
 (c-lang-defconst c-postfix-decl-spec-kwds
   "Keywords introducing extra declaration specifiers in the region
-between the header and the body \(i.e. the \"K&R-region\") in
+between the header and the body (i.e. the \"K&R-region\") in
 declarations."
   t    nil
   java '("extends" "implements" "throws")
@@ -2926,7 +2926,7 @@ expressions."
 
 (c-lang-defconst c-inexpr-block-kwds
   "Keywords that start constructs followed by statement blocks which can
-be used in expressions \(the gcc extension for this in C and C++ is
+be used in expressions (the gcc extension for this in C and C++ is
 handled separately by `c-recognize-paren-inexpr-blocks')."
   t    nil
   pike '("catch" "gauge"))
@@ -3403,7 +3403,7 @@ possible for good performance."
 identifier in a declaration, e.g. the \"*\" in \"char *argv\".  This
 regexp should match \"(\" if parentheses are valid in declarators.
 The end of the first submatch is taken as the end of the operator.
-Identifier syntax is in effect when this is matched \(see
+Identifier syntax is in effect when this is matched (see
 `c-identifier-syntax-table')."
   t (if (c-lang-const c-type-modifier-kwds)
        (concat (regexp-opt (c-lang-const c-type-modifier-kwds) t) "\\>")
@@ -3444,7 +3444,7 @@ Identifier syntax is in effect when this is matched \(see
 that might precede the identifier in a declaration, e.g. the
 \"*\" in \"char *argv\".  The end of the first submatch is taken
 as the end of the operator.  Identifier syntax is in effect when
-this is matched \(see `c-identifier-syntax-table')."
+this is matched (see `c-identifier-syntax-table')."
   t ;; Default to a regexp that never matches.
     regexp-unmatchable
   ;; Check that there's no "=" afterwards to avoid matching tokens
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 631787d..6bdfb17 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -377,7 +377,7 @@ control).  See \"cc-mode.el\" for more info."
     ;; to special combinations like C-c C-<delete>, so we have to hook
     ;; into the `normal-erase-is-backspace' system to bind it directly
     ;; as appropriate.
-    (add-hook 'normal-erase-is-backspace-hook 'c-bind-special-erase-keys)
+    (add-hook 'normal-erase-is-backspace-mode-hook 'c-bind-special-erase-keys)
     (c-bind-special-erase-keys))
 
   (when (fboundp 'delete-forward-p)
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index 54d6347..60ad42f 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -289,9 +289,9 @@ nil."
   "Controls the operation of the TAB key.
 If t, hitting TAB always just indents the current line.  If nil, hitting
 TAB indents the current line if point is at the left margin or in the
-line's indentation, otherwise it inserts a `real' tab character \(see
-note).  If some other value \(not nil or t), then tab is inserted only
-within literals \(comments and strings), but the line is always
+line's indentation, otherwise it inserts a `real' tab character (see
+note).  If some other value (not nil or t), then tab is inserted only
+within literals (comments and strings), but the line is always
 reindented.
 
 Note: The value of `indent-tabs-mode' will determine whether a real
@@ -345,10 +345,11 @@ of the macro content.  The default context inside the 
macro is the
 same as the top level, so if it contains \"bare\" statements they
 might be indented wrongly, although there are special cases that
 handle this in most cases.  If this problem occurs, it's usually
-countered easily by surrounding the statements by a block \(or even
-better with the \"do { ... } while \(0)\" trick)."
+countered easily by surrounding the statements by a block (or even
+better with the \"do { ... } while (0)\" trick)."
   :type 'boolean
   :group 'c)
+
 (put 'c-syntactic-indentation-in-macros 'safe-local-variable 'booleanp)
 
 (defcustom c-defun-tactic 'go-outward
@@ -1293,7 +1294,7 @@ OFFSET can specify an offset in several different ways:
 this variable are normally taken from the style system in CC Mode
 \(see `c-default-style' and `c-style-alist').  However, any offsets
 put explicitly on this list will override the style system when a CC
-Mode buffer is initialized \(there is a variable
+Mode buffer is initialized (there is a variable
 `c-old-style-variable-behavior' that changes this, though).
 
 Here is the current list of valid syntactic element symbols:
@@ -1670,7 +1671,7 @@ this implicitly by reinitializing C/C++/Objc Mode on any 
buffer)."
 (make-variable-buffer-local 'c-noise-macro-names)
 
 (defcustom c-noise-macro-with-parens-names nil
-  "A list of names of macros \(or compiler extensions like \"__attribute__\")
+  "A list of names of macros (or compiler extensions like \"__attribute__\")
 which optionally have arguments in parentheses, and which expand to nothing.
 These are recognized by CC Mode only in declarations."
   :version "26.1"
@@ -1718,7 +1719,7 @@ Alternatively it can be a string, a regular expression 
which
 matches all such symbols.
 
 The \"symbols\" must be syntactically valid identifiers in the
-target language \(C, C++, Objective C), or \(as the case may be)
+target language (C, C++, Objective C), or (as the case may be)
 the regular expression must match only valid identifiers.
 
 If you change this variable's value, call the function
@@ -1788,9 +1789,9 @@ as designated in the variable `c-file-style'.")
 It is a list with one element for each syntactic symbol pertinent to the
 line, for example \"((defun-block-intro 1) (comment-intro))\".
 
-It is dynamically bound when calling \(i) a brace hanging \"action
-function\"; \(ii) a semicolon/comma hanging \"criteria function\"; \(iii) a
-\"line-up function\"; \(iv) a c-special-indent-hook function.  It is also
+It is dynamically bound when calling (i) a brace hanging \"action
+function\"; (ii) a semicolon/comma hanging \"criteria function\"; (iii) a
+\"line-up function\"; (iv) a c-special-indent-hook function.  It is also
 used internally by CC Mode.
 
 c-syntactic-context is always bound dynamically.  It must NEVER be set



reply via email to

[Prev in Thread] Current Thread [Next in Thread]