Skip to content

Commit 803a362

Browse files
committed
Move log functions back down where they were.
For whatever reason, moving them up caused the following issue: #79. Moving them back down seems to fix it.
1 parent 48dd7ee commit 803a362

File tree

1 file changed

+15
-31
lines changed

1 file changed

+15
-31
lines changed

csharp-mode.el

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -446,37 +446,6 @@ Most other csharp functions are not instrumented.
446446
;; csharp-mode utility and feature defuns
447447
;; ==================================================================
448448

449-
(defun csharp-time ()
450-
"returns the time of day as a string. Used in the `csharp-log' function."
451-
(substring (current-time-string) 11 19)) ;24-hr time
452-
453-
454-
;; essentially the same as (progn), but this this is required to avoid
455-
;; byte-compilation warnings due to some forms referencing this
456-
;; getting expanded during compilation.
457-
(eval-when-compile
458-
(defun csharp-log (level text &rest args)
459-
"Log a message at level LEVEL.
460-
If LEVEL is higher than `csharp-log-level', the message is
461-
ignored. Otherwise, it is printed using `message'.
462-
TEXT is a format control string, and the remaining arguments ARGS
463-
are the string substitutions (see `format')."
464-
(if (<= level csharp-log-level)
465-
(let* ((msg (apply 'format text args)))
466-
(message "C# %s %s" (csharp-time) msg)))))
467-
468-
;; nasty hack to silence compile-time warnings and runtime-warnings.
469-
;; exact copy of defun above.
470-
(defun csharp-log (level text &rest args)
471-
"Log a message at level LEVEL.
472-
If LEVEL is higher than `csharp-log-level', the message is
473-
ignored. Otherwise, it is printed using `message'.
474-
TEXT is a format control string, and the remaining arguments ARGS
475-
are the string substitutions (see `format')."
476-
(if (<= level csharp-log-level)
477-
(let* ((msg (apply 'format text args)))
478-
(message "C# %s %s" (csharp-time) msg))))
479-
480449
(defun csharp--at-vsemi-p (&optional pos)
481450
"Determines if there is a virtual semicolon at POS or point.
482451
It returns t if at a position where a virtual-semicolon is.
@@ -2408,6 +2377,21 @@ your `csharp-mode-hook' function:
24082377
;; end of c# code-doc insertion magic
24092378
;; ==================================================================
24102379

2380+
(defun csharp-time ()
2381+
"returns the time of day as a string. Used in the `csharp-log' function."
2382+
(substring (current-time-string) 11 19)) ;24-hr time
2383+
2384+
2385+
(defun csharp-log (level text &rest args)
2386+
"Log a message at level LEVEL.
2387+
If LEVEL is higher than `csharp-log-level', the message is
2388+
ignored. Otherwise, it is printed using `message'.
2389+
TEXT is a format control string, and the remaining arguments ARGS
2390+
are the string substitutions (see `format')."
2391+
(if (<= level csharp-log-level)
2392+
(let* ((msg (apply 'format text args)))
2393+
(message "C# %s %s" (csharp-time) msg))))
2394+
24112395
;; ==================================================================
24122396
;; C#-specific optimizations of cc-mode funcs
24132397
;; ==================================================================

0 commit comments

Comments
 (0)