summaryrefslogtreecommitdiffhomepage
path: root/prog/jao-sloc.el
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-02-02 05:16:17 +0000
committerjao <jao@gnu.org>2021-02-02 05:16:17 +0000
commit771abb84830678455de4625ac7f082d8100f0ea0 (patch)
tree0d303c2cb0861b949ca73a9705954f6a69c4f877 /prog/jao-sloc.el
parent81eceb5507aa0659e9f0c9761e54e9102085c4ac (diff)
downloadelibs-771abb84830678455de4625ac7f082d8100f0ea0.tar.gz
elibs-771abb84830678455de4625ac7f082d8100f0ea0.tar.bz2
libs -> lib/
Diffstat (limited to 'prog/jao-sloc.el')
-rw-r--r--prog/jao-sloc.el33
1 files changed, 0 insertions, 33 deletions
diff --git a/prog/jao-sloc.el b/prog/jao-sloc.el
deleted file mode 100644
index 1f0e9ab..0000000
--- a/prog/jao-sloc.el
+++ /dev/null
@@ -1,33 +0,0 @@
-;; sloc.el -- LOC utilities
-
-;;;###autoload
-(defun count-sloc-region (beg end kind)
- "Count source lines of code in region (or (narrowed part of)
- the buffer when no region is active). SLOC means that empty
- lines and comment-only lines are not taken into consideration.
-
- (function by Stefan Monnier).
- "
- (interactive
- (if (use-region-p)
- (list (region-beginning) (region-end) 'region)
- (list (point-min) (point-max) 'buffer)))
- (save-excursion
- (goto-char beg)
- (let ((count 0))
- (while (< (point) end)
- (cond
- ((nth 4 (syntax-ppss)) ;; BOL is already inside a comment.
- (let ((pos (point)))
- (goto-char (nth 8 (syntax-ppss)))
- (forward-comment (point-max))
- (if (< (point) pos) (goto-char pos)))) ;; Just paranoia
- (t (forward-comment (point-max))))
- (setq count (1+ count))
- (forward-line))
- (when kind
- (message "SLOC in %s: %s." kind count)))))
-
-
-(provide 'jao-sloc)
-;;; sloc.el ends here