Variable: hyrolo-org-mode-hook

hyrolo-org-mode-hook is a variable defined in hyrolo.el.

Value

nil

Documentation

Hook run after entering hyrolo-org-mode.

No problems result if this variable is not bound. add-hook automatically binds it. (This is true for all hook variables.)

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hyrolo.el
(define-derived-mode hyrolo-org-mode outline-mode "HyRoloOrg"
  "Basic Org mode for use in HyRolo display match searches."
  (require 'org)
  ;; Don't actually derive from `org-mode' to avoid its costly setup but set
  ;; its parent mode property to org-mode so `derived-mode-p' checks will
  ;; pass.
  (put 'hyrolo-org-mode 'derived-mode-parent 'org-mode)

  (font-lock-mode -1) ;; Never font-lock in this mode to keep it fast

  (when (featurep 'org-fold) ;; newer Org versions
    (setq org-fold-core-style 'overlays) ;; Make compatible with reveal minor mode
    (hypb:add-to-invisibility-spec '(org-link))
    (org-fold-initialize (or (and (stringp org-ellipsis) (not (equal "" org-ellipsis)) org-ellipsis)
                             "..."))
    (make-local-variable 'org-link-descriptive)
    (when (eq org-fold-core-style 'overlays)
      (hypb:add-to-invisibility-spec '(org-hide-block . t)))
    (org-fold-core-set-folding-spec-property
     (cond ((boundp 'org-fold-core--specs)
	    ;; Org 9.7 and up
	    (caar org-fold-core--specs))
	   ((boundp 'org-link--link-folding-spec)
	    ;; Org pre-9.7
	    (car org-link--link-folding-spec)))
     :visible (not org-link-descriptive)))

  (setq-local hyrolo-entry-regexp "^\\(\\*+\\)\\([ \t\n\r]+\\)"
	      hyrolo-hdr-and-entry-regexp (concat hyrolo-hdr-prefix-regexp hyrolo-entry-regexp)
	      hyrolo-entry-group-number 1
	      ;; `hyrolo-add' handles removing * prefix from
	      ;; trailing-space grouping below
	      hyrolo-entry-trailing-space-group-number 2
	      outline-regexp (concat hyrolo-hdr-prefix-regexp "^\\(\\*+\\)\\([ \t\n\r]\\)")
	      outline-level #'hyrolo-outline-level)
  (use-local-map org-mode-map)
  ;; Modify a few syntax entries
  (modify-syntax-entry ?\" "\"")
  (modify-syntax-entry ?\\ "_")
  (modify-syntax-entry ?~ "_")
  (modify-syntax-entry ?< "(>")
  (modify-syntax-entry ?> ")<")

  (setq-local imenu-generic-expression
	      (if (boundp 'outline-imenu-generic-expression)
		  outline-imenu-generic-expression
		(list (list nil (concat "^\\(?:" outline-regexp "\\).*$") 0))))
  (remove-hook 'change-major-mode-hook #'outline-show-all t)
  (remove-hook 'hack-local-variables-hook #'outline-apply-default-state t)

  ;; Expose hidden text as move into it
  (hyrolo-reveal-mode 1))