summaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRavi R Kiran <aine.marina@gmail.com>2017-03-07 03:03:26 (GMT)
committerRavi R Kiran <aine.marina@gmail.com>2017-03-07 03:03:26 (GMT)
commit3865ad9cda55e2520d808badd4e65c7aaed01e3b (patch)
treee7bb501158067948451591083cbc643bd5ce9d8c /lisp
parentdf526791671aa562fb96a3dfa0f1ce5b8ac1fdbb (diff)
downloaddotemacs-3865ad9cda55e2520d808badd4e65c7aaed01e3b.zip
dotemacs-3865ad9cda55e2520d808badd4e65c7aaed01e3b.tar.gz
dotemacs-3865ad9cda55e2520d808badd4e65c7aaed01e3b.tar.bz2
Looking back requires two arguments
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ravi-init-cpp.el20
1 files changed, 10 insertions, 10 deletions
diff --git a/lisp/ravi-init-cpp.el b/lisp/ravi-init-cpp.el
index 3244ab9..200d942 100644
--- a/lisp/ravi-init-cpp.el
+++ b/lisp/ravi-init-cpp.el
@@ -368,7 +368,7 @@ this to 3 makes header-protection define KIG_MISC_NEWTYPE_H for a file named
(defun ravi/add-space-before-paren-c (&rest ignored)
(message "Handler invoked")
- (when (looking-back "\\b\\(for\\|while\\|if\\|switch\\)(")
+ (when (looking-back "\\b\\(for\\|while\\|if\\|switch\\)(" nil)
(save-excursion
(backward-char)
(insert-char ?\s)
@@ -378,25 +378,25 @@ this to 3 makes header-protection define KIG_MISC_NEWTYPE_H for a file named
(defadvice c-electric-paren (after ravi/add-space-around-parens activate)
(unless (c-in-literal)
(cond
- ((looking-back "([[:space:]]*")
+ ((looking-back "([[:space:]]*" nil)
(progn
;; Open parenthesis was the last command; add a space before it if
;; necessary, and ensure that the point is placed after a space
(save-excursion
(re-search-backward "([[:space:]]*")
(unless (looking-at "(") (message "Logic error; opening paren not found"))
- (when (looking-back "\\b\\(for\\|while\\|if\\|switch\\|catch\\)")
+ (when (looking-back "\\b\\(for\\|while\\|if\\|switch\\|catch\\)" nil)
(insert-char ?\s)))
(if (and (looking-at " ") (not (looking-at " )")))
(forward-char)
(insert-char ?\s))
)
)
- ((looking-back ")[[:space:]]*")
+ ((looking-back ")[[:space:]]*" nil)
;; Closing parenthesis was the last command; add spaces if necessary
(progn
;; Compact empty function calls
- (when (looking-back "([[:space:]]+)[[:space:]]*")
+ (when (looking-back "([[:space:]]+)[[:space:]]*" nil)
(save-excursion
(re-search-backward ")[[:space:]]*")
(delete-horizontal-space)
@@ -404,11 +404,11 @@ this to 3 makes header-protection define KIG_MISC_NEWTYPE_H for a file named
)
;; Add space before closing parenthesis
- (unless (looking-back "()[[:space:]]*")
+ (unless (looking-back "()[[:space:]]*" nil)
(save-excursion
(re-search-backward ")[[:space:]]*")
(unless (looking-at ")") (message "Logic error; closing paren not found"))
- (unless (looking-back " ") (insert-char ?\s)))
+ (unless (looking-back " " nil) (insert-char ?\s)))
)
(let (need-to-add-newline)
@@ -416,7 +416,7 @@ this to 3 makes header-protection define KIG_MISC_NEWTYPE_H for a file named
(c-backward-sexp)
(c-backward-syntactic-ws)
;; FIXME: do-while loops are not handled correctly
- (setq need-to-add-newline (looking-back "\\b\\(for\\|while\\|if\\|switch\\|catch\\)"))
+ (setq need-to-add-newline (looking-back "\\b\\(for\\|while\\|if\\|switch\\|catch\\)" nil))
)
(when need-to-add-newline (c-newline-and-indent)))
)
@@ -426,9 +426,9 @@ this to 3 makes header-protection define KIG_MISC_NEWTYPE_H for a file named
(defadvice c-electric-semi&comma (after ravi/add-space-after-comma activate)
(cond
- ((looking-back ",")
+ ((looking-back "," nil)
(if (looking-at " [^)]") (forward-char) (insert-char ?\s)))
- ((looking-back ") ;[[:space:]\n]*")
+ ((looking-back ") ;[[:space:]\n]*" nil)
(save-excursion
(re-search-backward " ;[[:space:]\n]*")
(delete-char 1)))))