Function: kotl-mode:cell-help

kotl-mode:cell-help is an interactive and byte-compiled function defined in kotl-mode.el.

Signature

(kotl-mode:cell-help &optional CELL-REF CELLS-FLAG)

Documentation

Display a temporary buffer with CELL-REF's attributes.

CELL-REF defaults to current cell. Optional prefix arg CELLS-FLAG selects the cells whose attributes are printed:
  If = 1, print CELL-REF's cell only;
  If > 1, print CELL-REF's visible tree (the tree rooted at CELL-REF);
  If <= 0, print all visible cells in current view (CELL-REF is not used).

See also the documentation for kotl-mode:cell-attributes.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/kotl-mode.el
(defun kotl-mode:cell-help (&optional cell-ref cells-flag)
  "Display a temporary buffer with CELL-REF's attributes.
CELL-REF defaults to current cell.
Optional prefix arg CELLS-FLAG selects the cells whose attributes are printed:
  If =  1, print CELL-REF's cell only;
  If >  1, print CELL-REF's visible tree (the tree rooted at CELL-REF);
  If <= 0, print all visible cells in current view (CELL-REF is not used).

See also the documentation for `kotl-mode:cell-attributes'."
  (interactive
   (append
    (let ((arg (prefix-numeric-value current-prefix-arg)))
      (if (< arg 1)
	  '("0")
	(hargs:iform-read
	 (list 'interactive
	       (format "+KDisplay properties of koutline %s: "
		       (if (= arg 1) "cell" "tree"))))))
    (list current-prefix-arg)))
  (unless (integerp cells-flag)
    ;; If cells-flag is nil, this sets it to 1
    (setq cells-flag (prefix-numeric-value cells-flag)))
  (unless (stringp cell-ref)
    (setq cell-ref (kcell-view:label)))
  ;; Ensure these do not invoke with-output-to-temp-buffer a second time.
  (let ((temp-buffer-show-hook)
	(temp-buffer-show-function)
	(standard-output (get-buffer-create (hypb:help-buf-name "Koutliner"))))
    (with-current-buffer standard-output
      (setq buffer-read-only nil)
      (erase-buffer))
    (save-excursion
      (if (or (member cell-ref '("0" 0))
	      (<= cells-flag 0))
	  (progn
	    (hattr:report (append '(idstamp 0)
				  (kcell:plist (kview:top-cell kotl-kview))))
	    (terpri)
	    (cond ((= cells-flag 1) nil)
		  ((> cells-flag 1)
		   (kview:map-tree #'kotl-mode:print-attributes kotl-kview t t))
		  ;; (<= cells-flag 0)
		  (t (kotl-mode:cell-attributes t))))
	(cond ((= cells-flag 1)
	       (kotl-mode:goto-cell cell-ref)
	       (kotl-mode:print-attributes kotl-kview))
	      ((> cells-flag 1)
	       (kotl-mode:goto-cell cell-ref)
	       (kview:map-tree #'kotl-mode:print-attributes kotl-kview nil t)))))
    (with-current-buffer standard-output
      (goto-char (point-min))
      (set-buffer-modified-p nil)
      (hkey-help-show standard-output))))