Function: org-at-encrypted-entry-p

org-at-encrypted-entry-p is a byte-compiled function defined in org-crypt.el.gz.

Signature

(org-at-encrypted-entry-p)

Documentation

Is the current entry encrypted? When the entry is encrypted, return a pair (BEG . END) where BEG and END are buffer positions delimiting the encrypted area.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-crypt.el.gz
(defun org-at-encrypted-entry-p ()
  "Is the current entry encrypted?
When the entry is encrypted, return a pair (BEG . END) where BEG
and END are buffer positions delimiting the encrypted area."
  (org-with-wide-buffer
   (unless (org-before-first-heading-p)
     (org-back-to-heading t)
     (org-end-of-meta-data 'standard)
     (let ((case-fold-search nil)
	   (banner-start (rx (seq bol
				  (zero-or-more (any "\t "))
				  "-----BEGIN PGP MESSAGE-----"
				  eol))))
       (when (looking-at banner-start)
	 (let ((start (point))
	       (banner-end (rx (seq bol
				    (or (group (zero-or-more (any "\t "))
					       "-----END PGP MESSAGE-----"
					       eol)
					(seq (one-or-more "*") " "))))))
	   (when (and (re-search-forward banner-end nil t) (match-string 1))
	     (cons start (line-beginning-position 2)))))))))