Function: klabel-type:function

klabel-type:function is a byte-compiled function defined in klabel.el.

Signature

(klabel-type:function &optional LABEL-TYPE)

Documentation

Return function which will return display label for current cell.

Label format is optional LABEL-TYPE or the default label type for the current view.

Function signature is: (func prev-label &optional child-p), where prev-label is the display label of the cell preceding the current one and child-p is non-nil if cell is to be the child of the preceding cell.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/klabel.el
;;;
;;; klabel-type - Sets display label format and converts among formats
;;;
;; Default label-type to use for new views.
;; It must be one of the following symbols:
;;   alpha           for `1a2' full alphanumeric labels
;;   id              for permanent idstamp labels, e.g. 001, 002, etc.
;;   legal           for `1.1.2' labels
;;
;;   These are disable for now as more work is needed:
;;     no              for no labels,
;;     partial-alpha   for partial alphanumeric labels, e.g. `2' for node `1a2'
;;     star            for multi-star labeling, e.g. `***'.

;;
;; Functions to compute sibling and child labels for particular label types.
;;
(defun klabel-type:function (&optional label-type)
  "Return function which will return display label for current cell.
Label format is optional LABEL-TYPE or the default label type for
the current view.

Function signature is: (func prev-label &optional child-p), where
prev-label is the display label of the cell preceding the current
one and child-p is non-nil if cell is to be the child of the
preceding cell."
  (or label-type (setq label-type (kview:label-type kotl-kview)))
  (cond ((eq label-type 'no)
	 (lambda (_prev-label &optional _child-p)
	   ""))
	((eq label-type 'partial-alpha)
	 (lambda (prev-label &optional child-p)
	   (if child-p
	       (if (kotl-label:integer-p prev-label)
		   "a" "1")
	     (kotl-label:increment prev-label 1))))
	((eq label-type 'id)
	 (lambda (_prev-label &optional _child-p)
	   (kcell-view:idstamp)))
	(t (intern-soft (concat "klabel-type:"
				(symbol-name label-type) "-label")))))