Function: allout-kill-line

allout-kill-line is an interactive and byte-compiled function defined in allout.el.gz.

Signature

(allout-kill-line &optional ARG)

Documentation

Kill line, adjusting subsequent lines suitably for outline mode.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/allout.el.gz
;;;_   : Surgery (kill-ring) functions with special provisions for outlines:
;;;_    > allout-kill-line (&optional arg)
(defun allout-kill-line (&optional arg)
  "Kill line, adjusting subsequent lines suitably for outline mode."

  (interactive "*P")

  (if (or (not (allout-mode-p))
          (not (bolp))
          (not (save-match-data (looking-at allout-regexp))))
      ;; Just do a regular kill:
      (kill-line arg)
    ;; Ah, have to watch out for adjustments:
    (let* ((beg (point))
           end
           (beg-hidden (allout-hidden-p))
           (end-hidden (save-excursion (allout-end-of-current-line)
                                       (setq end (point))
                                       (allout-hidden-p)))
           (depth (allout-depth)))

      (allout-annotate-hidden beg end)
      (unwind-protect
          (if (and (not beg-hidden) (not end-hidden))
              (allout-unprotected (kill-line arg))
            (kill-line arg))
        (run-hooks 'allout-after-copy-or-kill-hook)
        (allout-deannotate-hidden beg end)

        (if allout-numbered-bullet
            (save-excursion         ; Renumber subsequent topics if needed:
              (if (not (save-match-data (looking-at allout-regexp)))
                  (allout-next-heading))
              (allout-renumber-to-depth depth)))
        (run-hook-with-args 'allout-structure-deleted-functions depth (point))))))