From 284c470ef752967fcd8bae6a450dc138462b1e49 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 17 Sep 2015 16:08:20 -0700 Subject: Backslash cleanup in Elisp source files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch should not change behavior. It typically omits backslashes where they are redundant (e.g., in the string literal "^\$"). In a few places, insert backslashes where they make regular expressions clearer: e.g., replace "^\*" (equivalent to "^*") with "^\\*", which has the same effect as a regular expression. Also, use ‘\ %’ instead of ‘\%’ when avoiding confusion with SCCS IDs, and similarly use ‘\ $’ instead of ‘\$’ when avoiding confusion with RCS IDs, as that makes it clearer that the backslash is intended. --- lisp/progmodes/js.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lisp/progmodes/js.el') diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 98a22dd8441..71d0229471a 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -126,7 +126,7 @@ An example of this is \"Class.prototype = { method1: ...}\".") (defconst js--prototype-objextend-class-decl-re-2 (concat "^\\s-*\\(?:var\\s-+\\)?" "\\(" js--dotted-name-re "\\)" - "\\s-*=\\s-*Object\\.extend\\s-*\(")) + "\\s-*=\\s-*Object\\.extend\\s-*(")) ;; var NewClass = Class.create({ (defconst js--prototype-class-decl-re @@ -639,7 +639,7 @@ enabled frameworks." (js--maybe-join "\\(?:var[ \t]+\\)?[a-zA-Z_$0-9.]+[ \t]*=[ \t]*\\(?:" "\\|" - "\\)[ \t]*\(" + "\\)[ \t]*(" (when (memq 'prototype js-enabled-frameworks) "Class\\.create") @@ -651,10 +651,10 @@ enabled frameworks." "[a-zA-Z_$0-9]+\\.extend\\(?:Final\\)?")) (when (memq 'dojo js-enabled-frameworks) - "dojo\\.declare[ \t]*\(") + "dojo\\.declare[ \t]*(") (when (memq 'mochikit js-enabled-frameworks) - "MochiKit\\.Base\\.update[ \t]*\(") + "MochiKit\\.Base\\.update[ \t]*(") ;; mumble.prototypeTHING (js--maybe-join @@ -662,7 +662,7 @@ enabled frameworks." (when (memq 'javascript js-enabled-frameworks) '( ;; foo.prototype.bar = function( - "\\.[a-zA-Z_$0-9]+[ \t]*=[ \t]*function[ \t]*\(" + "\\.[a-zA-Z_$0-9]+[ \t]*=[ \t]*function[ \t]*(" ;; mumble.prototype = { "[ \t]*=[ \t]*{"))))) -- cgit v1.2.3