branch: externals/csharp-mode commit 49a957b4ab6c50c4521e8b184ad05f751710bf89 Author: Jostein Kjønigsen <jost...@kjonigsen.net> Commit: Jostein Kjønigsen <jost...@kjonigsen.net>
Super-ugly hacks to fix build. Addresses https://github.com/josteink/csharp-mode/issues/79. I'm so so sorry. --- csharp-mode.el | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/csharp-mode.el b/csharp-mode.el index 448a17b..f5c5e47 100644 --- a/csharp-mode.el +++ b/csharp-mode.el @@ -466,6 +466,18 @@ are the string substitutions (see `format')." (let* ((msg (apply 'format text args))) (message "C# %s %s" (csharp-time) msg))))) +;; nasty hack to silence compile-time warnings and runtime-warnings. +;; exact copy of defun above. +(defun csharp-log (level text &rest args) + "Log a message at level LEVEL. +If LEVEL is higher than `csharp-log-level', the message is +ignored. Otherwise, it is printed using `message'. +TEXT is a format control string, and the remaining arguments ARGS +are the string substitutions (see `format')." + (if (<= level csharp-log-level) + (let* ((msg (apply 'format text args))) + (message "C# %s %s" (csharp-time) msg)))) + (defun csharp--at-vsemi-p (&optional pos) "Determines if there is a virtual semicolon at POS or point. It returns t if at a position where a virtual-semicolon is. @@ -563,6 +575,20 @@ a square parentasis block [ ... ]." (eq (char-before) 93))) ;; close square )) +;; nasty hack to silence compile-time warnings and runtime-warnings. +;; exact copy of defun above. +(defun csharp-is-square-parentasis-block-p () + "Attempts to safely assess if the current point is at the opening of +a square parentasis block [ ... ]." + (let* ((start (point)) ;; variables used to hold our position, so that we know that + (end)) ;; our code isn't stuck trying to look for a non-existant sexp. + (and (eq (char-after) 91) ;; open square + (while (and (eq (char-after) 91) + (not (eq start end))) + (c-safe (c-forward-sexp 1)) + (setq end (point))) + (eq (char-before) 93))) ;; close square + ) ;; ================================================================== ;; end of csharp-mode utility and feature defuns