Function: kview:set-label-type

kview:set-label-type is an interactive and byte-compiled function defined in kview.el.

Signature

(kview:set-label-type KVIEW NEW-TYPE)

Documentation

Change KVIEW's label display type to NEW-TYPE, updating all displayed labels.

See documentation for variable, kview:default-label-type, for valid values of NEW-TYPE.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/kview.el
(defun kview:set-label-type (kview new-type)
  "Change KVIEW's label display type to NEW-TYPE, updating all displayed labels.
See documentation for variable, kview:default-label-type, for
valid values of NEW-TYPE."
  (interactive (list kotl-kview
		     (let ((completion-ignore-case)
			   (label-type (kview:label-type kotl-kview))
			   new-type-str)
		       (if (string-equal
			    ""
			    (setq new-type-str
				  (completing-read
				   (format "View label type (current = %s): "
					   label-type)
				   '(("alpha") ("legal") ("id")
				     ;; ("no") ("partial-alpha") ("star")
				     )
				   nil t)))
			   label-type
			 (intern new-type-str)))))
  ;; no partial-alpha star
  (unless (memq new-type '(alpha legal id))
    (error "(kview:set-label-type): Invalid label type, `%s'" new-type))
  (let ((old-label-type (kview:label-type kview)))
    (if (eq old-label-type new-type)
	;; Per kview function definitions might have changed, so reset them.
	(kview:set-functions new-type)
      (klabel-type:set-labels new-type)
      (kview:set-attr kview 'label-type new-type)
      (kview:set-functions new-type)
      (kvspec:update t))))