File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 42
42
(setq calendar-longitude -103.35 )
43
43
(setq wttrin-default-cities '(" Seoul, Korea" ))
44
44
45
+ (defun jj/org-number-of-subentries (&optional pos match scope level )
46
+ " Return number of subentries for entry at POS.
47
+ MATCH and SCOPE are the same as for `org-map-entries' , but
48
+ SCOPE defaults to 'tree.
49
+ By default, all subentries are counted; restrict with LEVEL."
50
+ (interactive )
51
+ (save-excursion
52
+ (goto-char (or pos (point )))
53
+ ; ; If we are in the middle ot an entry, use the current heading.
54
+ (org-back-to-heading t )
55
+ (let ((maxlevel (when (and level (org-current-level ))
56
+ (+ level (org-current-level )))))
57
+ (message " %s subentries"
58
+ (1- (length
59
+ (delq nil
60
+ (org-map-entries
61
+ (lambda ()
62
+ ; ; Return true, unless below maxlevel.
63
+ (or (not maxlevel)
64
+ (<= (org-current-level ) maxlevel)))
65
+ match (or scope 'tree )))))))))
66
+
45
67
(defun jj/delete-backward-char (n &optional killflag )
46
68
" Delete the previous N characters (following if N is negative).
47
69
If Transient Mark mode is enabled, the mark is active, and N is 1,
You can’t perform that action at this time.
0 commit comments