From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id Odq9LBXqzl8BXgAA0tVLHw (envelope-from ) for ; Tue, 08 Dec 2020 02:51:01 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id iI1JKBXqzl+xDAAA1q6Kng (envelope-from ) for ; Tue, 08 Dec 2020 02:51:01 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A61809403CA for ; Tue, 8 Dec 2020 02:51:00 +0000 (UTC) Received: from localhost ([::1]:43654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kmT5f-0000ic-AU for larch@yhetil.org; Mon, 07 Dec 2020 21:50:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34954) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kmT4f-0000iT-7s for emacs-orgmode@gnu.org; Mon, 07 Dec 2020 21:49:58 -0500 Received: from mail-vk1-xa2b.google.com ([2607:f8b0:4864:20::a2b]:33587) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kmT4Y-0001Bk-5W for emacs-orgmode@gnu.org; Mon, 07 Dec 2020 21:49:56 -0500 Received: by mail-vk1-xa2b.google.com with SMTP id b190so3633579vka.0 for ; Mon, 07 Dec 2020 18:49:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=DARvnTmG05+fhPB2JKj/5jP2G/ndSIikrNuyAXVRwG4=; b=VVDFR3kOeG7V7+D4itMjdO85psvKYSs9tNdqFeqoiQdHRUmMb61SrQBkoU3zxo/vMT eh5rg6TZRZQ5mL/C7xQsa7jv9ZM2FNtjW7KsTQRYJnfeE+n3DafDxCveziBBqJr9dOhA Qj14e/sjkA6h+KtRcQ3YbohAQmnkP2TEnmVi9TZQm4LiJolrvlLvrZlLCBf7vYVoMFuC bqJJEzcY0jLL/JhGuBusObDp4OYET7/81XEO2sXHCunja7ieJORU4y4DVOn3ckUP83XC 53DOWQnYHOQIEFIXNDnYFsr1z5ZXrK8cPzAOlpPv7qva2NqK1ZSFoARb2FsM4LbYwK5w h6sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=DARvnTmG05+fhPB2JKj/5jP2G/ndSIikrNuyAXVRwG4=; b=AHbFCQBkweB/Op3bM8T6LvhXOFZnZ0Qzx6FOxMul9kpnhStg81yDRCJYSw2N/nP28S xOOX4PsXd3FVH/mnLNlO9nmRmW4xjVrv8BU4kZW0XRs/QzVhXptxSGy5D4YM2lGJJB80 gvF22IX56tAqog54WTkEQ2vJdgTxfuYYds/H+Oh3OcRytZiP2y4rwScxla7HptIhEJf3 o96xiLqKVPIkCAOAb1aQUf28lFXn6qMMnziiBm3zpkbAP+9HqvnIv//vQNC+n9+q3W1g /rkzuUoS0BJweSZX+v3BsEIaCuL7EdbVMia0SUY7rZ6etUT3t0xfZ54fpviu1+Sq4AfL nOtg== X-Gm-Message-State: AOAM532xemnn+z38HP+d3u/gWif5LQLD83g4/U9gNwYCFQGYr6Sivu6U GympN0GFpjxGlg9Uc15S7JjY0lbSteo4suDgNiOZvTNEMhqA X-Google-Smtp-Source: ABdhPJxjgqY3zXXr+s1CpBqCs0uwilAzWJzK/KrMBM30lvswbi6jiyEVY0MoKtd5Us2rxa8tsn1SjlynMwo2DNxF820= X-Received: by 2002:ac5:c5b5:: with SMTP id f21mr13851825vkl.13.1607395787024; Mon, 07 Dec 2020 18:49:47 -0800 (PST) MIME-Version: 1.0 From: stardiviner Date: Tue, 8 Dec 2020 10:49:20 +0800 Message-ID: Subject: Archive an task which has un-indented logbook caused error To: Org-mode Content-Type: multipart/alternative; boundary="000000000000e62fcb05b5eafedb" Received-SPF: pass client-ip=2607:f8b0:4864:20::a2b; envelope-from=numbchild@gmail.com; helo=mail-vk1-xa2b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.00 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=VVDFR3kO; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: A61809403CA X-Spam-Score: -3.00 X-Migadu-Scanner: ns3122888.ip-94-23-21.eu X-TUID: iCQ1a3cloDrx --000000000000e62fcb05b5eafedb Content-Type: text/plain; charset="UTF-8" I have an Org task like this: ```org ** DONE lantern [2/2] CLOSED: [2019-02-16 Sat 23:45] :LOGBOOK: - State "DONE" from "TODO" [2019-02-16 Sat 23:45] \\ Arch Linux install lantern from AUR. CLOCK: [2019-02-16 Sat 23:38]--[2019-02-16 Sat 23:45] => 0:07 - State "TODO" from [2016-01-09 Sat 10:37] :END: happey ending! ``` You can noticed that there are three spaces offset before `CLOSED`. And NO spaces before the `:LOGBOOK:` drawer. When I press `[C-c C-x C-a]`. I got following error. Here is the error after I `toggle-debug-on-error`. ``` Debugger entered--Lisp error: (wrong-type-argument wholenump -1) move-to-column(-1 t) indent-line-to(-1) (while (and (not (> (point) end-marker)) (>= ci diff)) (indent-line-to (+ ci diff)) (forward-line)) (let ((end-marker (move-marker (make-marker) (match-end 0))) (ci (current-indentation))) (while (and (not (> (point) end-marker)) (>= ci diff)) (indent-line-to (+ ci diff)) (forward-line))) (progn (let ((end-marker (move-marker (make-marker) (match-end 0))) (ci (current-indentation))) (while (and (not (> (point) end-marker)) (>= ci diff)) (indent-line-to (+ ci diff)) (forward-line)))) (if (looking-at org-logbook-drawer-re) (progn (let ((end-marker (move-marker (make-marker) (match-end 0))) (ci (current-indentation))) (while (and (not (> (point) end-marker)) (>= ci diff)) (indent-line-to (+ ci diff)) (forward-line))))) (save-restriction (widen) (narrow-to-region (line-beginning-position) (save-excursion (if (progn (defvar org-called-with-limited-levels) (defvar org-outline-regexp) (defvar outline-regexp) (defvar org-outline-regexp-bol) (let* ((org-called-with-limited-levels t) (org-outline-regexp ...) (outline-regexp org-outline-regexp) (org-outline-regexp-bol ...)) (org-at-heading-p))) (progn (defvar org-called-with-limited-levels) (defvar org-outline-regexp) (defvar outline-regexp) (defvar org-outline-regexp-bol) (let* ((org-called-with-limited-levels t) (org-outline-regexp ...) (outline-regexp org-outline-regexp) (org-outline-regexp-bol ...)) (outline-next-heading))) (org-inlinetask-goto-end)) (point))) (forward-line) (if (looking-at-p org-planning-line-re) (progn (org-indent-line) (forward-line))) (if (looking-at org-property-drawer-re) (progn (goto-char (match-end 0)) (forward-line) (org-indent-region (match-beginning 0) (match-end 0)))) (if (looking-at org-logbook-drawer-re) (progn (let ((end-marker (move-marker (make-marker) (match-end 0))) (ci (current-indentation))) (while (and (not (> ... end-marker)) (>= ci diff)) (indent-line-to (+ ci diff)) (forward-line))))) (catch 'no-shift (if (or (= 0 diff) (not (eq org-adapt-indentation t))) (progn (throw 'no-shift nil))) (let ((case-fold-search t)) (if (< diff 0) (progn (let ((diff ...) (forbidden-re ...)) (save-excursion (while ... ...))))) (while (not (eobp)) (cond ((and (looking-at-p org-footnote-definition-re) (let ... ...))) ((looking-at-p org-outline-regexp) (forward-line)) ((looking-at-p "[ \11]*$") (forward-line)) (t (indent-line-to (+ ... diff)) (beginning-of-line) (or (and ... ...) (forward-line)))))))) (save-excursion (save-restriction (widen) (narrow-to-region (line-beginning-position) (save-excursion (if (progn (defvar org-called-with-limited-levels) (defvar org-outline-regexp) (defvar outline-regexp) (defvar org-outline-regexp-bol) (let* (... ... ... ...) (org-at-heading-p))) (progn (defvar org-called-with-limited-levels) (defvar org-outline-regexp) (defvar outline-regexp) (defvar org-outline-regexp-bol) (let* (... ... ... ...) (outline-next-heading))) (org-inlinetask-goto-end)) (point))) (forward-line) (if (looking-at-p org-planning-line-re) (progn (org-indent-line) (forward-line))) (if (looking-at org-property-drawer-re) (progn (goto-char (match-end 0)) (forward-line) (org-indent-region (match-beginning 0) (match-end 0)))) (if (looking-at org-logbook-drawer-re) (progn (let ((end-marker (move-marker ... ...)) (ci (current-indentation))) (while (and (not ...) (>= ci diff)) (indent-line-to (+ ci diff)) (forward-line))))) (catch 'no-shift (if (or (= 0 diff) (not (eq org-adapt-indentation t))) (progn (throw 'no-shift nil))) (let ((case-fold-search t)) (if (< diff 0) (progn (let (... ...) (save-excursion ...)))) (while (not (eobp)) (cond ((and ... ...)) ((looking-at-p org-outline-regexp) (forward-line)) ((looking-at-p "[ \11]*$") (forward-line)) (t (indent-line-to ...) (beginning-of-line) (or ... ...)))))))) org-fixup-indentation(-1) (progn (org-fixup-indentation (- diff))) (if org-adapt-indentation (progn (org-fixup-indentation (- diff)))) (if (= level 1) nil (if org-auto-align-tags (progn (org-align-tags))) (if org-adapt-indentation (progn (org-fixup-indentation (- diff))))) (let* ((after-change-functions (remq 'flyspell-after-change-function after-change-functions)) (level (let ((save-match-data-internal (match-data))) (unwind-protect (progn (funcall outline-level)) (set-match-data save-match-data-internal 'evaporate)))) (up-head (concat (make-string (org-get-valid-level level -1) 42) " ")) (diff (abs (- level (length up-head) -1)))) (cond ((and (= level 1) org-allow-promoting-top-level-subtree) (replace-match "# " nil t)) ((= level 1) (user-error "Cannot promote to level 0. UNDO to recover if nec...")) (t (replace-match up-head nil t))) (if (= level 1) nil (if org-auto-align-tags (progn (org-align-tags))) (if org-adapt-indentation (progn (org-fixup-indentation (- diff))))) (run-hooks 'org-after-promote-entry-hook)) (save-restriction (widen) (org-back-to-heading t) (let* ((after-change-functions (remq 'flyspell-after-change-function after-change-functions)) (level (let ((save-match-data-internal (match-data))) (unwind-protect (progn (funcall outline-level)) (set-match-data save-match-data-internal 'evaporate)))) (up-head (concat (make-string (org-get-valid-level level -1) 42) " ")) (diff (abs (- level (length up-head) -1)))) (cond ((and (= level 1) org-allow-promoting-top-level-subtree) (replace-match "# " nil t)) ((= level 1) (user-error "Cannot promote to level 0. UNDO to recover if nec...")) (t (replace-match up-head nil t))) (if (= level 1) nil (if org-auto-align-tags (progn (org-align-tags))) (if org-adapt-indentation (progn (org-fixup-indentation (- diff))))) (run-hooks 'org-after-promote-entry-hook))) (save-excursion (save-restriction (widen) (org-back-to-heading t) (let* ((after-change-functions (remq 'flyspell-after-change-function after-change-functions)) (level (let ((save-match-data-internal ...)) (unwind-protect (progn ...) (set-match-data save-match-data-internal ...)))) (up-head (concat (make-string (org-get-valid-level level -1) 42) " ")) (diff (abs (- level (length up-head) -1)))) (cond ((and (= level 1) org-allow-promoting-top-level-subtree) (replace-match "# " nil t)) ((= level 1) (user-error "Cannot promote to level 0. UNDO to recover if nec...")) (t (replace-match up-head nil t))) (if (= level 1) nil (if org-auto-align-tags (progn (org-align-tags))) (if org-adapt-indentation (progn (org-fixup-indentation (- diff))))) (run-hooks 'org-after-promote-entry-hook)))) org-promote() funcall(org-promote) (progn (funcall fun)) (if (and (re-search-forward org-outline-regexp-bol nil t) (< (point) end)) (progn (funcall fun))) (save-excursion (setq end (copy-marker end)) (goto-char beg) (if (and (re-search-forward org-outline-regexp-bol nil t) (< (point) end)) (progn (funcall fun))) (while (and (progn (outline-next-heading) (< (point) end)) (not (eobp))) (funcall fun))) (let ((org-ignore-region t)) (save-excursion (setq end (copy-marker end)) (goto-char beg) (if (and (re-search-forward org-outline-regexp-bol nil t) (< (point) end)) (progn (funcall fun))) (while (and (progn (outline-next-heading) (< (point) end)) (not (eobp))) (funcall fun)))) org-map-region(org-promote 187514 187890) (while (not (= shift 0)) (org-map-region func (point-min) (point-max)) (setq shift (+ delta shift))) (save-restriction (narrow-to-region beg end) (while (not (= shift 0)) (org-map-region func (point-min) (point-max)) (setq shift (+ delta shift))) (goto-char (point-min)) (setq newend (point-max))) (if (= shift 0) nil (save-restriction (narrow-to-region beg end) (while (not (= shift 0)) (org-map-region func (point-min) (point-max)) (setq shift (+ delta shift))) (goto-char (point-min)) (setq newend (point-max)))) (let* ((visp (not (org-invisible-p))) (txt tree) (old-level (if (string-match org-outline-regexp-bol txt) (- (match-end 0) (match-beginning 0) 1) -1)) (force-level (cond (level (prefix-numeric-value level)) ((and (org-match-line "^\\*+[ \11]*$") (not (eq 42 ...))) (org-outline-level)) ((looking-at-p org-outline-regexp-bol) (org-outline-level)))) (previous-level (save-excursion (org-previous-visible-heading 1) (if (org-at-heading-p) (org-outline-level) 1))) (next-level (save-excursion (if (org-at-heading-p) (org-outline-level) (org-next-visible-heading 1) (if (org-at-heading-p) (org-outline-level) 1)))) (new-level (or force-level (max previous-level next-level))) (shift (if (or (= old-level -1) (= new-level -1) (= old-level new-level)) 0 (- new-level old-level))) (delta (if (> shift 0) -1 1)) (func (if (> shift 0) #'org-demote #'org-promote)) (org-odd-levels-only nil) beg end newend) (if (and force-level (not level)) (progn (delete-region (line-beginning-position) (point)))) (if (and (bolp) (org-at-heading-p)) nil (org-next-visible-heading 1) (if (bolp) nil (insert "\n"))) (setq beg (point)) (if (fboundp 'org-id-paste-tracker) (progn (org-id-paste-tracker txt))) (insert-before-markers txt) (if (string-suffix-p "\n" txt) nil (insert "\n")) (setq newend (point)) (org-reinstall-markers-in-region beg) (setq end (point)) (goto-char beg) (skip-chars-forward " \11\n\15") (setq beg (point)) (if (and (org-invisible-p) visp) (progn (save-excursion (outline-show-heading)))) (if (= shift 0) nil (save-restriction (narrow-to-region beg end) (while (not (= shift 0)) (org-map-region func (point-min) (point-max)) (setq shift (+ delta shift))) (goto-char (point-min)) (setq newend (point-max)))) (if (or for-yank (called-interactively-p 'interactive)) (progn (message "Clipboard pasted as level %d subtree" new-level))) (if (and (not for-yank) kill-ring (equal org-subtree-clip (current-kill 0)) org-subtree-clip-folded) (progn (org-flag-subtree t))) (if for-yank (progn (goto-char newend))) (if remove (progn (car-safe (prog1 kill-ring (setq kill-ring (cdr kill-ring))))))) (let* ((org-called-with-limited-levels t) (org-outline-regexp (org-get-limited-outline-regexp)) (outline-regexp org-outline-regexp) (org-outline-regexp-bol (concat "^" org-outline-regexp))) (let* ((visp (not (org-invisible-p))) (txt tree) (old-level (if (string-match org-outline-regexp-bol txt) (- (match-end 0) (match-beginning 0) 1) -1)) (force-level (cond (level (prefix-numeric-value level)) ((and (org-match-line "^\\*+[ \11]*$") (not ...)) (org-outline-level)) ((looking-at-p org-outline-regexp-bol) (org-outline-level)))) (previous-level (save-excursion (org-previous-visible-heading 1) (if (org-at-heading-p) (org-outline-level) 1))) (next-level (save-excursion (if (org-at-heading-p) (org-outline-level) (org-next-visible-heading 1) (if (org-at-heading-p) (org-outline-level) 1)))) (new-level (or force-level (max previous-level next-level))) (shift (if (or (= old-level -1) (= new-level -1) (= old-level new-level)) 0 (- new-level old-level))) (delta (if (> shift 0) -1 1)) (func (if (> shift 0) #'org-demote #'org-promote)) (org-odd-levels-only nil) beg end newend) (if (and force-level (not level)) (progn (delete-region (line-beginning-position) (point)))) (if (and (bolp) (org-at-heading-p)) nil (org-next-visible-heading 1) (if (bolp) nil (insert "\n"))) (setq beg (point)) (if (fboundp 'org-id-paste-tracker) (progn (org-id-paste-tracker txt))) (insert-before-markers txt) (if (string-suffix-p "\n" txt) nil (insert "\n")) (setq newend (point)) (org-reinstall-markers-in-region beg) (setq end (point)) (goto-char beg) (skip-chars-forward " \11\n\15") (setq beg (point)) (if (and (org-invisible-p) visp) (progn (save-excursion (outline-show-heading)))) (if (= shift 0) nil (save-restriction (narrow-to-region beg end) (while (not (= shift 0)) (org-map-region func (point-min) (point-max)) (setq shift (+ delta shift))) (goto-char (point-min)) (setq newend (point-max)))) (if (or for-yank (called-interactively-p 'interactive)) (progn (message "Clipboard pasted as level %d subtree" new-level))) (if (and (not for-yank) kill-ring (equal org-subtree-clip (current-kill 0)) org-subtree-clip-folded) (progn (org-flag-subtree t))) (if for-yank (progn (goto-char newend))) (if remove (progn (car-safe (prog1 kill-ring (setq kill-ring (cdr kill-ring)))))))) (progn (defvar org-called-with-limited-levels) (defvar org-outline-regexp) (defvar outline-regexp) (defvar org-outline-regexp-bol) (let* ((org-called-with-limited-levels t) (org-outline-regexp (org-get-limited-outline-regexp)) (outline-regexp org-outline-regexp) (org-outline-regexp-bol (concat "^" org-outline-regexp))) (let* ((visp (not (org-invisible-p))) (txt tree) (old-level (if (string-match org-outline-regexp-bol txt) (- (match-end 0) (match-beginning 0) 1) -1)) (force-level (cond (level (prefix-numeric-value level)) ((and ... ...) (org-outline-level)) ((looking-at-p org-outline-regexp-bol) (org-outline-level)))) (previous-level (save-excursion (org-previous-visible-heading 1) (if (org-at-heading-p) (org-outline-level) 1))) (next-level (save-excursion (if (org-at-heading-p) (org-outline-level) (org-next-visible-heading 1) (if ... ... 1)))) (new-level (or force-level (max previous-level next-level))) (shift (if (or (= old-level -1) (= new-level -1) (= old-level new-level)) 0 (- new-level old-level))) (delta (if (> shift 0) -1 1)) (func (if (> shift 0) #'org-demote #'org-promote)) (org-odd-levels-only nil) beg end newend) (if (and force-level (not level)) (progn (delete-region (line-beginning-position) (point)))) (if (and (bolp) (org-at-heading-p)) nil (org-next-visible-heading 1) (if (bolp) nil (insert "\n"))) (setq beg (point)) (if (fboundp 'org-id-paste-tracker) (progn (org-id-paste-tracker txt))) (insert-before-markers txt) (if (string-suffix-p "\n" txt) nil (insert "\n")) (setq newend (point)) (org-reinstall-markers-in-region beg) (setq end (point)) (goto-char beg) (skip-chars-forward " \11\n\15") (setq beg (point)) (if (and (org-invisible-p) visp) (progn (save-excursion (outline-show-heading)))) (if (= shift 0) nil (save-restriction (narrow-to-region beg end) (while (not (= shift 0)) (org-map-region func (point-min) (point-max)) (setq shift (+ delta shift))) (goto-char (point-min)) (setq newend (point-max)))) (if (or for-yank (called-interactively-p 'interactive)) (progn (message "Clipboard pasted as level %d subtree" new-level))) (if (and (not for-yank) kill-ring (equal org-subtree-clip (current-kill 0)) org-subtree-clip-folded) (progn (org-flag-subtree t))) (if for-yank (progn (goto-char newend))) (if remove (progn (car-safe (prog1 kill-ring (setq kill-ring ...)))))))) org-paste-subtree(1) (let ((org-todo-line-regexp tr-org-todo-line-regexp) (org-todo-keywords-1 tr-org-todo-keywords-1) (org-todo-kwd-alist tr-org-todo-kwd-alist) (org-done-keywords tr-org-done-keywords) (org-todo-regexp tr-org-todo-regexp) (org-todo-line-regexp tr-org-todo-line-regexp)) (goto-char (point-min)) (org-show-all '(headings blocks)) (if (and heading (not (and datetree-date (not datetree-subheading-p)))) (progn (if (re-search-forward (concat "^" (regexp-quote heading) "\\([ \11]+:\\(" org-tag-re ":\\)+\\)?[ \11]*$") nil t) (goto-char (match-end 0)) (goto-char (point-max)) (or (bolp) (insert "\n")) (insert (if datetree-date "" "\n") heading "\n") (end-of-line 0)) (outline-show-subtree) (if org-archive-reversed-order (progn (org-back-to-heading t) (outline-next-heading)) (org-end-of-subtree t)) (skip-chars-backward " \11\15\n") (and (looking-at "[ \11\15\n]*") (replace-match (if datetree-date "\n" "\n\n")))) (if org-archive-reversed-order (progn (goto-char (point-min)) (if (org-at-heading-p) nil (outline-next-heading))) (goto-char (point-max)) (if (and datetree-date (bolp)) nil (insert "\n")))) (org-paste-subtree (org-get-valid-level level (and heading 1))) (and inherited-tags (or (and (eq org-archive-subtree-add-inherited-tags 'infile) infile-p) (eq org-archive-subtree-add-inherited-tags t)) (org-set-tags all-tags)) (if (and org-archive-mark-done (let ((case-fold-search nil)) (looking-at org-todo-line-regexp)) (or (not (match-end 2)) (not (member (match-string 2) org-done-keywords)))) (progn (let (org-log-done org-todo-log-states) (org-todo (car (or (member org-archive-mark-done org-done-keywords) org-done-keywords)))))) (let ((--dolist-tail-- org-archive-save-context-info)) (while --dolist-tail-- (let ((item (car --dolist-tail--))) (let ((value (cdr ...))) (if (org-string-nw-p value) (progn (org-entry-put ... ... value)))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (if (eq this-buffer buffer) nil (if (or (eq org-archive-subtree-save-file-p t) (eq org-archive-subtree-save-file-p (if (boundp 'org-archive-from-agenda) 'from-agenda 'from-org))) (progn (save-buffer)))) (widen)) (let* ((all-tags (org-get-tags)) (local-tags (cl-remove-if #'(lambda (tag) (get-text-property 0 'inherited tag)) all-tags)) (inherited-tags (cl-remove-if-not #'(lambda (tag) (get-text-property 0 'inherited tag)) all-tags)) (context (list (cons 'category (org-get-category nil 'force-refresh)) (cons 'file file) (cons 'itags (mapconcat #'identity inherited-tags " ")) (cons 'ltags (mapconcat #'identity local-tags " ")) (cons 'olpath (mapconcat #'identity (org-get-outline-path) "/")) (cons 'time time) (cons 'todo (org-entry-get (point) "TODO"))))) (let (this-command) (org-copy-subtree 1 nil t)) (set-buffer buffer) (if (not (derived-mode-p 'org-mode)) (let ((org-insert-mode-line-in-empty-file t) (org-inhibit-startup t)) (call-interactively 'org-mode))) (if (and newfile-p org-archive-file-header-format) (progn (goto-char (point-max)) (insert (format org-archive-file-header-format (buffer-file-name this-buffer))))) (if datetree-date (progn (require 'org-datetree) (org-datetree-find-date-create datetree-date) (org-narrow-to-subtree))) (let ((org-todo-line-regexp tr-org-todo-line-regexp) (org-todo-keywords-1 tr-org-todo-keywords-1) (org-todo-kwd-alist tr-org-todo-kwd-alist) (org-done-keywords tr-org-done-keywords) (org-todo-regexp tr-org-todo-regexp) (org-todo-line-regexp tr-org-todo-line-regexp)) (goto-char (point-min)) (org-show-all '(headings blocks)) (if (and heading (not (and datetree-date (not datetree-subheading-p)))) (progn (if (re-search-forward (concat "^" (regexp-quote heading) "\\([ \11]+:\\(" org-tag-re ":\\)+\\)?[ \11]*$") nil t) (goto-char (match-end 0)) (goto-char (point-max)) (or (bolp) (insert "\n")) (insert (if datetree-date "" "\n") heading "\n") (end-of-line 0)) (outline-show-subtree) (if org-archive-reversed-order (progn (org-back-to-heading t) (outline-next-heading)) (org-end-of-subtree t)) (skip-chars-backward " \11\15\n") (and (looking-at "[ \11\15\n]*") (replace-match (if datetree-date "\n" "\n\n")))) (if org-archive-reversed-order (progn (goto-char (point-min)) (if (org-at-heading-p) nil (outline-next-heading))) (goto-char (point-max)) (if (and datetree-date (bolp)) nil (insert "\n")))) (org-paste-subtree (org-get-valid-level level (and heading 1))) (and inherited-tags (or (and (eq org-archive-subtree-add-inherited-tags 'infile) infile-p) (eq org-archive-subtree-add-inherited-tags t)) (org-set-tags all-tags)) (if (and org-archive-mark-done (let ((case-fold-search nil)) (looking-at org-todo-line-regexp)) (or (not (match-end 2)) (not (member (match-string 2) org-done-keywords)))) (progn (let (org-log-done org-todo-log-states) (org-todo (car (or ... org-done-keywords)))))) (let ((--dolist-tail-- org-archive-save-context-info)) (while --dolist-tail-- (let ((item (car --dolist-tail--))) (let ((value ...)) (if (org-string-nw-p value) (progn ...))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (if (eq this-buffer buffer) nil (if (or (eq org-archive-subtree-save-file-p t) (eq org-archive-subtree-save-file-p (if (boundp ...) 'from-agenda 'from-org))) (progn (save-buffer)))) (widen))) (save-excursion (org-back-to-heading t) (let* ((all-tags (org-get-tags)) (local-tags (cl-remove-if #'(lambda (tag) (get-text-property 0 ... tag)) all-tags)) (inherited-tags (cl-remove-if-not #'(lambda (tag) (get-text-property 0 ... tag)) all-tags)) (context (list (cons 'category (org-get-category nil 'force-refresh)) (cons 'file file) (cons 'itags (mapconcat #'identity inherited-tags " ")) (cons 'ltags (mapconcat #'identity local-tags " ")) (cons 'olpath (mapconcat #'identity (org-get-outline-path) "/")) (cons 'time time) (cons 'todo (org-entry-get (point) "TODO"))))) (let (this-command) (org-copy-subtree 1 nil t)) (set-buffer buffer) (if (not (derived-mode-p 'org-mode)) (let ((org-insert-mode-line-in-empty-file t) (org-inhibit-startup t)) (call-interactively 'org-mode))) (if (and newfile-p org-archive-file-header-format) (progn (goto-char (point-max)) (insert (format org-archive-file-header-format (buffer-file-name this-buffer))))) (if datetree-date (progn (require 'org-datetree) (org-datetree-find-date-create datetree-date) (org-narrow-to-subtree))) (let ((org-todo-line-regexp tr-org-todo-line-regexp) (org-todo-keywords-1 tr-org-todo-keywords-1) (org-todo-kwd-alist tr-org-todo-kwd-alist) (org-done-keywords tr-org-done-keywords) (org-todo-regexp tr-org-todo-regexp) (org-todo-line-regexp tr-org-todo-line-regexp)) (goto-char (point-min)) (org-show-all '(headings blocks)) (if (and heading (not (and datetree-date (not datetree-subheading-p)))) (progn (if (re-search-forward (concat "^" ... "\\([ \11]+:\\(" org-tag-re ":\\)+\\)?[ \11]*$") nil t) (goto-char (match-end 0)) (goto-char (point-max)) (or (bolp) (insert "\n")) (insert (if datetree-date "" "\n") heading "\n") (end-of-line 0)) (outline-show-subtree) (if org-archive-reversed-order (progn (org-back-to-heading t) (outline-next-heading)) (org-end-of-subtree t)) (skip-chars-backward " \11\15\n") (and (looking-at "[ \11\15\n]*") (replace-match (if datetree-date "\n" "\n\n")))) (if org-archive-reversed-order (progn (goto-char (point-min)) (if (org-at-heading-p) nil (outline-next-heading))) (goto-char (point-max)) (if (and datetree-date (bolp)) nil (insert "\n")))) (org-paste-subtree (org-get-valid-level level (and heading 1))) (and inherited-tags (or (and (eq org-archive-subtree-add-inherited-tags 'infile) infile-p) (eq org-archive-subtree-add-inherited-tags t)) (org-set-tags all-tags)) (if (and org-archive-mark-done (let ((case-fold-search nil)) (looking-at org-todo-line-regexp)) (or (not (match-end 2)) (not (member ... org-done-keywords)))) (progn (let (org-log-done org-todo-log-states) (org-todo (car ...))))) (let ((--dolist-tail-- org-archive-save-context-info)) (while --dolist-tail-- (let ((item ...)) (let (...) (if ... ...)) (setq --dolist-tail-- (cdr --dolist-tail--))))) (if (eq this-buffer buffer) nil (if (or (eq org-archive-subtree-save-file-p t) (eq org-archive-subtree-save-file-p (if ... ... ...))) (progn (save-buffer)))) (widen)))) (let* ((tr-org-todo-keywords-1 org-todo-keywords-1) (tr-org-todo-kwd-alist org-todo-kwd-alist) (tr-org-done-keywords org-done-keywords) (tr-org-todo-regexp org-todo-regexp) (tr-org-todo-line-regexp org-todo-line-regexp) (tr-org-odd-levels-only org-odd-levels-only) (this-buffer (current-buffer)) (time (format-time-string (substring (cdr org-time-stamp-formats) 1 -1))) (file (abbreviate-file-name (or (buffer-file-name (buffer-base-buffer)) (error "No file associated to buffer")))) (location (org-archive--compute-location (or (org-entry-get nil "ARCHIVE" 'inherit) org-archive-location))) (afile (car location)) (heading (cdr location)) (infile-p (equal file (abbreviate-file-name (or afile "")))) (newfile-p (and (org-string-nw-p afile) (not (file-exists-p afile)))) (buffer (cond ((not (org-string-nw-p afile)) this-buffer) ((find-buffer-visiting afile)) ((find-file-noselect afile)) (t (error "Cannot access file \"%s\"" afile)))) (org-odd-levels-only (if (local-variable-p 'org-odd-levels-only (current-buffer)) org-odd-levels-only tr-org-odd-levels-only)) level datetree-date datetree-subheading-p) (if (string-match "\\`datetree/\\(\\**\\)" heading) (progn (let ((nsub (length (match-string 1 heading)))) (setq heading (concat (make-string (+ ... ...) 42) (substring heading (match-end 0)))) (setq datetree-subheading-p (> nsub 0))) (setq datetree-date (org-date-to-gregorian (or (org-entry-get nil "CLOSED" t) time))))) (if (and (> (length heading) 0) (string-match "^\\*+" heading)) (setq level (match-end 0)) (setq heading nil level 0)) (save-excursion (org-back-to-heading t) (let* ((all-tags (org-get-tags)) (local-tags (cl-remove-if #'(lambda ... ...) all-tags)) (inherited-tags (cl-remove-if-not #'(lambda ... ...) all-tags)) (context (list (cons 'category (org-get-category nil ...)) (cons 'file file) (cons 'itags (mapconcat ... inherited-tags " ")) (cons 'ltags (mapconcat ... local-tags " ")) (cons 'olpath (mapconcat ... ... "/")) (cons 'time time) (cons 'todo (org-entry-get ... "TODO"))))) (let (this-command) (org-copy-subtree 1 nil t)) (set-buffer buffer) (if (not (derived-mode-p 'org-mode)) (let ((org-insert-mode-line-in-empty-file t) (org-inhibit-startup t)) (call-interactively 'org-mode))) (if (and newfile-p org-archive-file-header-format) (progn (goto-char (point-max)) (insert (format org-archive-file-header-format (buffer-file-name this-buffer))))) (if datetree-date (progn (require 'org-datetree) (org-datetree-find-date-create datetree-date) (org-narrow-to-subtree))) (let ((org-todo-line-regexp tr-org-todo-line-regexp) (org-todo-keywords-1 tr-org-todo-keywords-1) (org-todo-kwd-alist tr-org-todo-kwd-alist) (org-done-keywords tr-org-done-keywords) (org-todo-regexp tr-org-todo-regexp) (org-todo-line-regexp tr-org-todo-line-regexp)) (goto-char (point-min)) (org-show-all '(headings blocks)) (if (and heading (not (and datetree-date ...))) (progn (if (re-search-forward ... nil t) (goto-char ...) (goto-char ...) (or ... ...) (insert ... heading "\n") (end-of-line 0)) (outline-show-subtree) (if org-archive-reversed-order (progn ... ...) (org-end-of-subtree t)) (skip-chars-backward " \11\15\n") (and (looking-at "[ \11\15\n]*") (replace-match ...))) (if org-archive-reversed-order (progn (goto-char ...) (if ... nil ...)) (goto-char (point-max)) (if (and datetree-date ...) nil (insert "\n")))) (org-paste-subtree (org-get-valid-level level (and heading 1))) (and inherited-tags (or (and (eq org-archive-subtree-add-inherited-tags ...) infile-p) (eq org-archive-subtree-add-inherited-tags t)) (org-set-tags all-tags)) (if (and org-archive-mark-done (let (...) (looking-at org-todo-line-regexp)) (or (not ...) (not ...))) (progn (let (org-log-done org-todo-log-states) (org-todo ...)))) (let ((--dolist-tail-- org-archive-save-context-info)) (while --dolist-tail-- (let (...) (let ... ...) (setq --dolist-tail-- ...)))) (if (eq this-buffer buffer) nil (if (or (eq org-archive-subtree-save-file-p t) (eq org-archive-subtree-save-file-p ...)) (progn (save-buffer)))) (widen)))) (run-hooks 'org-archive-hook) (let (this-command) (org-cut-subtree)) (if (featurep 'org-inlinetask) (progn (org-inlinetask-remove-END-maybe))) (setq org-markers-to-move nil) (if org-provide-todo-statistics (progn (save-excursion (org-up-heading-safe) (org-update-statistics-cookies nil)))) (message "Subtree archived %s" (if (eq this-buffer buffer) (concat "under heading: " heading) (concat "in file: " (abbreviate-file-name afile))))) (cond ((equal find-done '(4)) (org-archive-all-done)) ((equal find-done '(16)) (org-archive-all-old)) (t (let* ((tr-org-todo-keywords-1 org-todo-keywords-1) (tr-org-todo-kwd-alist org-todo-kwd-alist) (tr-org-done-keywords org-done-keywords) (tr-org-todo-regexp org-todo-regexp) (tr-org-todo-line-regexp org-todo-line-regexp) (tr-org-odd-levels-only org-odd-levels-only) (this-buffer (current-buffer)) (time (format-time-string (substring (cdr org-time-stamp-formats) 1 -1))) (file (abbreviate-file-name (or (buffer-file-name ...) (error "No file associated to buffer")))) (location (org-archive--compute-location (or (org-entry-get nil "ARCHIVE" ...) org-archive-location))) (afile (car location)) (heading (cdr location)) (infile-p (equal file (abbreviate-file-name (or afile "")))) (newfile-p (and (org-string-nw-p afile) (not (file-exists-p afile)))) (buffer (cond ((not ...) this-buffer) ((find-buffer-visiting afile)) ((find-file-noselect afile)) (t (error "Cannot access file \"%s\"" afile)))) (org-odd-levels-only (if (local-variable-p 'org-odd-levels-only (current-buffer)) org-odd-levels-only tr-org-odd-levels-only)) level datetree-date datetree-subheading-p) (if (string-match "\\`datetree/\\(\\**\\)" heading) (progn (let ((nsub ...)) (setq heading (concat ... ...)) (setq datetree-subheading-p (> nsub 0))) (setq datetree-date (org-date-to-gregorian (or ... time))))) (if (and (> (length heading) 0) (string-match "^\\*+" heading)) (setq level (match-end 0)) (setq heading nil level 0)) (save-excursion (org-back-to-heading t) (let* ((all-tags (org-get-tags)) (local-tags (cl-remove-if ... all-tags)) (inherited-tags (cl-remove-if-not ... all-tags)) (context (list ... ... ... ... ... ... ...))) (let (this-command) (org-copy-subtree 1 nil t)) (set-buffer buffer) (if (not (derived-mode-p ...)) (let (... ...) (call-interactively ...))) (if (and newfile-p org-archive-file-header-format) (progn (goto-char ...) (insert ...))) (if datetree-date (progn (require ...) (org-datetree-find-date-create datetree-date) (org-narrow-to-subtree))) (let ((org-todo-line-regexp tr-org-todo-line-regexp) (org-todo-keywords-1 tr-org-todo-keywords-1) (org-todo-kwd-alist tr-org-todo-kwd-alist) (org-done-keywords tr-org-done-keywords) (org-todo-regexp tr-org-todo-regexp) (org-todo-line-regexp tr-org-todo-line-regexp)) (goto-char (point-min)) (org-show-all '...) (if (and heading ...) (progn ... ... ... ... ...) (if org-archive-reversed-order ... ... ...)) (org-paste-subtree (org-get-valid-level level ...)) (and inherited-tags (or ... ...) (org-set-tags all-tags)) (if (and org-archive-mark-done ... ...) (progn ...)) (let (...) (while --dolist-tail-- ...)) (if (eq this-buffer buffer) nil (if ... ...)) (widen)))) (run-hooks 'org-archive-hook) (let (this-command) (org-cut-subtree)) (if (featurep 'org-inlinetask) (progn (org-inlinetask-remove-END-maybe))) (setq org-markers-to-move nil) (if org-provide-todo-statistics (progn (save-excursion (org-up-heading-safe) (org-update-statistics-cookies nil)))) (message "Subtree archived %s" (if (eq this-buffer buffer) (concat "under heading: " heading) (concat "in file: " (abbreviate-file-name afile))))))) (if (and (org-region-active-p) org-loop-over-headlines-in-active-region) (let ((cl (if (eq org-loop-over-headlines-in-active-region 'start-level) 'region-start-level 'region)) org-loop-over-headlines-in-active-region) (org-map-entries (list 'progn '(setq org-map-continue-from (progn (org-back-to-heading) (point))) (list 'org-archive-subtree find-done)) org-loop-over-headlines-in-active-region cl (if (org-invisible-p) (org-end-of-subtree nil t)))) (cond ((equal find-done '(4)) (org-archive-all-done)) ((equal find-done '(16)) (org-archive-all-old)) (t (let* ((tr-org-todo-keywords-1 org-todo-keywords-1) (tr-org-todo-kwd-alist org-todo-kwd-alist) (tr-org-done-keywords org-done-keywords) (tr-org-todo-regexp org-todo-regexp) (tr-org-todo-line-regexp org-todo-line-regexp) (tr-org-odd-levels-only org-odd-levels-only) (this-buffer (current-buffer)) (time (format-time-string (substring ... 1 -1))) (file (abbreviate-file-name (or ... ...))) (location (org-archive--compute-location (or ... org-archive-location))) (afile (car location)) (heading (cdr location)) (infile-p (equal file (abbreviate-file-name ...))) (newfile-p (and (org-string-nw-p afile) (not ...))) (buffer (cond (... this-buffer) (...) (...) (t ...))) (org-odd-levels-only (if (local-variable-p ... ...) org-odd-levels-only tr-org-odd-levels-only)) level datetree-date datetree-subheading-p) (if (string-match "\\`datetree/\\(\\**\\)" heading) (progn (let (...) (setq heading ...) (setq datetree-subheading-p ...)) (setq datetree-date (org-date-to-gregorian ...)))) (if (and (> (length heading) 0) (string-match "^\\*+" heading)) (setq level (match-end 0)) (setq heading nil level 0)) (save-excursion (org-back-to-heading t) (let* ((all-tags ...) (local-tags ...) (inherited-tags ...) (context ...)) (let (this-command) (org-copy-subtree 1 nil t)) (set-buffer buffer) (if (not ...) (let ... ...)) (if (and newfile-p org-archive-file-header-format) (progn ... ...)) (if datetree-date (progn ... ... ...)) (let (... ... ... ... ... ...) (goto-char ...) (org-show-all ...) (if ... ... ...) (org-paste-subtree ...) (and inherited-tags ... ...) (if ... ...) (let ... ...) (if ... nil ...) (widen)))) (run-hooks 'org-archive-hook) (let (this-command) (org-cut-subtree)) (if (featurep 'org-inlinetask) (progn (org-inlinetask-remove-END-maybe))) (setq org-markers-to-move nil) (if org-provide-todo-statistics (progn (save-excursion (org-up-heading-safe) (org-update-statistics-cookies nil)))) (message "Subtree archived %s" (if (eq this-buffer buffer) (concat "under heading: " heading) (concat "in file: " (abbreviate-file-name afile))))))) (org-reveal) (if (looking-at "^[ \11]*$") (outline-next-visible-heading 1))) org-archive-subtree(nil) funcall-interactively(org-archive-subtree nil) call-interactively(org-archive-subtree) org-archive-subtree-default() funcall-interactively(org-archive-subtree-default) call-interactively(org-archive-subtree-default nil nil) command-execute(org-archive-subtree-default) ``` [stardiviner] GPG key ID: 47C32433 IRC(freeenode): stardiviner Twitter: @numbchild Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 Blog: http://stardiviner.github.io/ --000000000000e62fcb05b5eafedb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I have an Org task like this:
```org
** DONE la= ntern [2/2]
=C2=A0 =C2=A0CLOSED: [2019-02-16 Sat 23:45]
:LOGBOOK:
= - State "DONE" =C2=A0 =C2=A0 =C2=A0 from "TODO" =C2=A0 = =C2=A0 =C2=A0 [2019-02-16 Sat 23:45] \\
=C2=A0 Arch Linux install lanter= n from AUR.
CLOCK: [2019-02-16 Sat 23:38]--[2019-02-16 Sat 23:45] =3D>= ; =C2=A00:07
- State "TODO" =C2=A0 =C2=A0 =C2=A0 from =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[2016-01-09 Sat 10:37]
:END:

happey ending!
```
You can noticed that there are th= ree spaces offset before `CLOSED`.
And NO spaces before the `:LOGBOOK= :` drawer. When I press `[C-c C-x C-a]`. I got following error.
Here is the error after I `toggle-debug-on-error`.
```
<= div class=3D"gmail_default" style=3D"font-family:trebuchet ms,sans-serif">D= ebugger entered--Lisp error: (wrong-type-argument wholenump -1)
=C2=A0 m= ove-to-column(-1 t)
=C2=A0 indent-line-to(-1)
=C2=A0 (while (and (not= (> (point) end-marker)) (>=3D ci diff)) (indent-line-to (+ ci diff))= (forward-line))
=C2=A0 (let ((end-marker (move-marker (make-marker) (ma= tch-end 0))) (ci (current-indentation))) (while (and (not (> (point) end= -marker)) (>=3D ci diff)) (indent-line-to (+ ci diff)) (forward-line)))<= br>=C2=A0 (progn (let ((end-marker (move-marker (make-marker) (match-end 0)= )) (ci (current-indentation))) (while (and (not (> (point) end-marker)) = (>=3D ci diff)) (indent-line-to (+ ci diff)) (forward-line))))
=C2=A0= (if (looking-at org-logbook-drawer-re) (progn (let ((end-marker (move-mark= er (make-marker) (match-end 0))) (ci (current-indentation))) (while (and (n= ot (> (point) end-marker)) (>=3D ci diff)) (indent-line-to (+ ci diff= )) (forward-line)))))
=C2=A0 (save-restriction (widen) (narrow-to-region= (line-beginning-position) (save-excursion (if (progn (defvar org-called-wi= th-limited-levels) (defvar org-outline-regexp) (defvar outline-regexp) (def= var org-outline-regexp-bol) (let* ((org-called-with-limited-levels t) (org-= outline-regexp ...) (outline-regexp org-outline-regexp) (org-outline-regexp= -bol ...)) (org-at-heading-p))) (progn (defvar org-called-with-limited-leve= ls) (defvar org-outline-regexp) (defvar outline-regexp) (defvar org-outline= -regexp-bol) (let* ((org-called-with-limited-levels t) (org-outline-regexp = ...) (outline-regexp org-outline-regexp) (org-outline-regexp-bol ...)) (out= line-next-heading))) (org-inlinetask-goto-end)) (point))) (forward-line) (i= f (looking-at-p org-planning-line-re) (progn (org-indent-line) (forward-lin= e))) (if (looking-at org-property-drawer-re) (progn (goto-char (match-end 0= )) (forward-line) (org-indent-region (match-beginning 0) (match-end 0)))) (= if (looking-at org-logbook-drawer-re) (progn (let ((end-marker (move-marker= (make-marker) (match-end 0))) (ci (current-indentation))) (while (and (not= (> ... end-marker)) (>=3D ci diff)) (indent-line-to (+ ci diff)) (fo= rward-line))))) (catch 'no-shift (if (or (=3D 0 diff) (not (eq org-adap= t-indentation t))) (progn (throw 'no-shift nil))) (let ((case-fold-sear= ch t)) (if (< diff 0) (progn (let ((diff ...) (forbidden-re ...)) (save-= excursion (while ... ...))))) (while (not (eobp)) (cond ((and (looking-at-p= org-footnote-definition-re) (let ... ...))) ((looking-at-p org-outline-reg= exp) (forward-line)) ((looking-at-p "[ \11]*$") (forward-line)) (= t (indent-line-to (+ ... diff)) (beginning-of-line) (or (and ... ...) (forw= ard-line))))))))
=C2=A0 (save-excursion (save-restriction (widen) (narro= w-to-region (line-beginning-position) (save-excursion (if (progn (defvar or= g-called-with-limited-levels) (defvar org-outline-regexp) (defvar outline-r= egexp) (defvar org-outline-regexp-bol) (let* (... ... ... ...) (org-at-head= ing-p))) (progn (defvar org-called-with-limited-levels) (defvar org-outline= -regexp) (defvar outline-regexp) (defvar org-outline-regexp-bol) (let* (...= ... ... ...) (outline-next-heading))) (org-inlinetask-goto-end)) (point)))= (forward-line) (if (looking-at-p org-planning-line-re) (progn (org-indent-= line) (forward-line))) (if (looking-at org-property-drawer-re) (progn (goto= -char (match-end 0)) (forward-line) (org-indent-region (match-beginning 0) = (match-end 0)))) (if (looking-at org-logbook-drawer-re) (progn (let ((end-m= arker (move-marker ... ...)) (ci (current-indentation))) (while (and (not .= ..) (>=3D ci diff)) (indent-line-to (+ ci diff)) (forward-line))))) (cat= ch 'no-shift (if (or (=3D 0 diff) (not (eq org-adapt-indentation t))) (= progn (throw 'no-shift nil))) (let ((case-fold-search t)) (if (< dif= f 0) (progn (let (... ...) (save-excursion ...)))) (while (not (eobp)) (con= d ((and ... ...)) ((looking-at-p org-outline-regexp) (forward-line)) ((look= ing-at-p "[ \11]*$") (forward-line)) (t (indent-line-to ...) (beg= inning-of-line) (or ... ...))))))))
=C2=A0 org-fixup-indentation(-1)
= =C2=A0 (progn (org-fixup-indentation (- diff)))
=C2=A0 (if org-adapt-ind= entation (progn (org-fixup-indentation (- diff))))
=C2=A0 (if (=3D level= 1) nil (if org-auto-align-tags (progn (org-align-tags))) (if org-adapt-ind= entation (progn (org-fixup-indentation (- diff)))))
=C2=A0 (let* ((after= -change-functions (remq 'flyspell-after-change-function after-change-fu= nctions)) (level (let ((save-match-data-internal (match-data))) (unwind-pro= tect (progn (funcall outline-level)) (set-match-data save-match-data-intern= al 'evaporate)))) (up-head (concat (make-string (org-get-valid-level le= vel -1) 42) " ")) (diff (abs (- level (length up-head) -1)))) (co= nd ((and (=3D level 1) org-allow-promoting-top-level-subtree) (replace-matc= h "# " nil t)) ((=3D level 1) (user-error "Cannot promote to= level 0.=C2=A0 UNDO to recover if nec...")) (t (replace-match up-head= nil t))) (if (=3D level 1) nil (if org-auto-align-tags (progn (org-align-t= ags))) (if org-adapt-indentation (progn (org-fixup-indentation (- diff)))))= (run-hooks 'org-after-promote-entry-hook))
=C2=A0 (save-restriction= (widen) (org-back-to-heading t) (let* ((after-change-functions (remq '= flyspell-after-change-function after-change-functions)) (level (let ((save-= match-data-internal (match-data))) (unwind-protect (progn (funcall outline-= level)) (set-match-data save-match-data-internal 'evaporate)))) (up-hea= d (concat (make-string (org-get-valid-level level -1) 42) " ")) (= diff (abs (- level (length up-head) -1)))) (cond ((and (=3D level 1) org-al= low-promoting-top-level-subtree) (replace-match "# " nil t)) ((= =3D level 1) (user-error "Cannot promote to level 0.=C2=A0 UNDO to rec= over if nec...")) (t (replace-match up-head nil t))) (if (=3D level 1)= nil (if org-auto-align-tags (progn (org-align-tags))) (if org-adapt-indent= ation (progn (org-fixup-indentation (- diff))))) (run-hooks 'org-after-= promote-entry-hook)))
=C2=A0 (save-excursion (save-restriction (widen) (= org-back-to-heading t) (let* ((after-change-functions (remq 'flyspell-a= fter-change-function after-change-functions)) (level (let ((save-match-data= -internal ...)) (unwind-protect (progn ...) (set-match-data save-match-data= -internal ...)))) (up-head (concat (make-string (org-get-valid-level level = -1) 42) " ")) (diff (abs (- level (length up-head) -1)))) (cond (= (and (=3D level 1) org-allow-promoting-top-level-subtree) (replace-match &q= uot;# " nil t)) ((=3D level 1) (user-error "Cannot promote to lev= el 0.=C2=A0 UNDO to recover if nec...")) (t (replace-match up-head nil= t))) (if (=3D level 1) nil (if org-auto-align-tags (progn (org-align-tags)= )) (if org-adapt-indentation (progn (org-fixup-indentation (- diff))))) (ru= n-hooks 'org-after-promote-entry-hook))))
=C2=A0 org-promote()
= =C2=A0 funcall(org-promote)
=C2=A0 (progn (funcall fun))
=C2=A0 (if (= and (re-search-forward org-outline-regexp-bol nil t) (< (point) end)) (p= rogn (funcall fun)))
=C2=A0 (save-excursion (setq end (copy-marker end))= (goto-char beg) (if (and (re-search-forward org-outline-regexp-bol nil t) = (< (point) end)) (progn (funcall fun))) (while (and (progn (outline-next= -heading) (< (point) end)) (not (eobp))) (funcall fun)))
=C2=A0 (let = ((org-ignore-region t)) (save-excursion (setq end (copy-marker end)) (goto-= char beg) (if (and (re-search-forward org-outline-regexp-bol nil t) (< (= point) end)) (progn (funcall fun))) (while (and (progn (outline-next-headin= g) (< (point) end)) (not (eobp))) (funcall fun))))
=C2=A0 org-map-reg= ion(org-promote 187514 187890)
=C2=A0 (while (not (=3D shift 0)) (org-ma= p-region func (point-min) (point-max)) (setq shift (+ delta shift)))
=C2= =A0 (save-restriction (narrow-to-region beg end) (while (not (=3D shift 0))= (org-map-region func (point-min) (point-max)) (setq shift (+ delta shift))= ) (goto-char (point-min)) (setq newend (point-max)))
=C2=A0 (if (=3D shi= ft 0) nil (save-restriction (narrow-to-region beg end) (while (not (=3D shi= ft 0)) (org-map-region func (point-min) (point-max)) (setq shift (+ delta s= hift))) (goto-char (point-min)) (setq newend (point-max))))
=C2=A0 (let*= ((visp (not (org-invisible-p))) (txt tree) (old-level (if (string-match or= g-outline-regexp-bol txt) (- (match-end 0) (match-beginning 0) 1) -1)) (for= ce-level (cond (level (prefix-numeric-value level)) ((and (org-match-line &= quot;^\\*+[ \11]*$") (not (eq 42 ...))) (org-outline-level)) ((looking= -at-p org-outline-regexp-bol) (org-outline-level)))) (previous-level (save-= excursion (org-previous-visible-heading 1) (if (org-at-heading-p) (org-outl= ine-level) 1))) (next-level (save-excursion (if (org-at-heading-p) (org-out= line-level) (org-next-visible-heading 1) (if (org-at-heading-p) (org-outlin= e-level) 1)))) (new-level (or force-level (max previous-level next-level)))= (shift (if (or (=3D old-level -1) (=3D new-level -1) (=3D old-level new-le= vel)) 0 (- new-level old-level))) (delta (if (> shift 0) -1 1)) (func (i= f (> shift 0) #'org-demote #'org-promote)) (org-odd-levels-only = nil) beg end newend) (if (and force-level (not level)) (progn (delete-regio= n (line-beginning-position) (point)))) (if (and (bolp) (org-at-heading-p)) = nil (org-next-visible-heading 1) (if (bolp) nil (insert "\n"))) (= setq beg (point)) (if (fboundp 'org-id-paste-tracker) (progn (org-id-pa= ste-tracker txt))) (insert-before-markers txt) (if (string-suffix-p "\= n" txt) nil (insert "\n")) (setq newend (point)) (org-reinst= all-markers-in-region beg) (setq end (point)) (goto-char beg) (skip-chars-f= orward " \11\n\15") (setq beg (point)) (if (and (org-invisible-p)= visp) (progn (save-excursion (outline-show-heading)))) (if (=3D shift 0) n= il (save-restriction (narrow-to-region beg end) (while (not (=3D shift 0)) = (org-map-region func (point-min) (point-max)) (setq shift (+ delta shift)))= (goto-char (point-min)) (setq newend (point-max)))) (if (or for-yank (call= ed-interactively-p 'interactive)) (progn (message "Clipboard paste= d as level %d subtree" new-level))) (if (and (not for-yank) kill-ring = (equal org-subtree-clip (current-kill 0)) org-subtree-clip-folded) (progn (= org-flag-subtree t))) (if for-yank (progn (goto-char newend))) (if remove (= progn (car-safe (prog1 kill-ring (setq kill-ring (cdr kill-ring)))))))
= =C2=A0 (let* ((org-called-with-limited-levels t) (org-outline-regexp (org-g= et-limited-outline-regexp)) (outline-regexp org-outline-regexp) (org-outlin= e-regexp-bol (concat "^" org-outline-regexp))) (let* ((visp (not = (org-invisible-p))) (txt tree) (old-level (if (string-match org-outline-reg= exp-bol txt) (- (match-end 0) (match-beginning 0) 1) -1)) (force-level (con= d (level (prefix-numeric-value level)) ((and (org-match-line "^\\*+[ \= 11]*$") (not ...)) (org-outline-level)) ((looking-at-p org-outline-reg= exp-bol) (org-outline-level)))) (previous-level (save-excursion (org-previo= us-visible-heading 1) (if (org-at-heading-p) (org-outline-level) 1))) (next= -level (save-excursion (if (org-at-heading-p) (org-outline-level) (org-next= -visible-heading 1) (if (org-at-heading-p) (org-outline-level) 1)))) (new-l= evel (or force-level (max previous-level next-level))) (shift (if (or (=3D = old-level -1) (=3D new-level -1) (=3D old-level new-level)) 0 (- new-level = old-level))) (delta (if (> shift 0) -1 1)) (func (if (> shift 0) #= 9;org-demote #'org-promote)) (org-odd-levels-only nil) beg end newend) = (if (and force-level (not level)) (progn (delete-region (line-beginning-pos= ition) (point)))) (if (and (bolp) (org-at-heading-p)) nil (org-next-visible= -heading 1) (if (bolp) nil (insert "\n"))) (setq beg (point)) (if= (fboundp 'org-id-paste-tracker) (progn (org-id-paste-tracker txt))) (i= nsert-before-markers txt) (if (string-suffix-p "\n" txt) nil (ins= ert "\n")) (setq newend (point)) (org-reinstall-markers-in-region= beg) (setq end (point)) (goto-char beg) (skip-chars-forward " \11\n\1= 5") (setq beg (point)) (if (and (org-invisible-p) visp) (progn (save-e= xcursion (outline-show-heading)))) (if (=3D shift 0) nil (save-restriction = (narrow-to-region beg end) (while (not (=3D shift 0)) (org-map-region func = (point-min) (point-max)) (setq shift (+ delta shift))) (goto-char (point-mi= n)) (setq newend (point-max)))) (if (or for-yank (called-interactively-p &#= 39;interactive)) (progn (message "Clipboard pasted as level %d subtree= " new-level))) (if (and (not for-yank) kill-ring (equal org-subtree-cl= ip (current-kill 0)) org-subtree-clip-folded) (progn (org-flag-subtree t)))= (if for-yank (progn (goto-char newend))) (if remove (progn (car-safe (prog= 1 kill-ring (setq kill-ring (cdr kill-ring))))))))
=C2=A0 (progn (defvar= org-called-with-limited-levels) (defvar org-outline-regexp) (defvar outlin= e-regexp) (defvar org-outline-regexp-bol) (let* ((org-called-with-limited-l= evels t) (org-outline-regexp (org-get-limited-outline-regexp)) (outline-reg= exp org-outline-regexp) (org-outline-regexp-bol (concat "^" org-o= utline-regexp))) (let* ((visp (not (org-invisible-p))) (txt tree) (old-leve= l (if (string-match org-outline-regexp-bol txt) (- (match-end 0) (match-beg= inning 0) 1) -1)) (force-level (cond (level (prefix-numeric-value level)) (= (and ... ...) (org-outline-level)) ((looking-at-p org-outline-regexp-bol) (= org-outline-level)))) (previous-level (save-excursion (org-previous-visible= -heading 1) (if (org-at-heading-p) (org-outline-level) 1))) (next-level (sa= ve-excursion (if (org-at-heading-p) (org-outline-level) (org-next-visible-h= eading 1) (if ... ... 1)))) (new-level (or force-level (max previous-level = next-level))) (shift (if (or (=3D old-level -1) (=3D new-level -1) (=3D old= -level new-level)) 0 (- new-level old-level))) (delta (if (> shift 0) -1= 1)) (func (if (> shift 0) #'org-demote #'org-promote)) (org-odd= -levels-only nil) beg end newend) (if (and force-level (not level)) (progn = (delete-region (line-beginning-position) (point)))) (if (and (bolp) (org-at= -heading-p)) nil (org-next-visible-heading 1) (if (bolp) nil (insert "= \n"))) (setq beg (point)) (if (fboundp 'org-id-paste-tracker) (pro= gn (org-id-paste-tracker txt))) (insert-before-markers txt) (if (string-suf= fix-p "\n" txt) nil (insert "\n")) (setq newend (point)= ) (org-reinstall-markers-in-region beg) (setq end (point)) (goto-char beg) = (skip-chars-forward " \11\n\15") (setq beg (point)) (if (and (org= -invisible-p) visp) (progn (save-excursion (outline-show-heading)))) (if (= =3D shift 0) nil (save-restriction (narrow-to-region beg end) (while (not (= =3D shift 0)) (org-map-region func (point-min) (point-max)) (setq shift (+ = delta shift))) (goto-char (point-min)) (setq newend (point-max)))) (if (or = for-yank (called-interactively-p 'interactive)) (progn (message "C= lipboard pasted as level %d subtree" new-level))) (if (and (not for-ya= nk) kill-ring (equal org-subtree-clip (current-kill 0)) org-subtree-clip-fo= lded) (progn (org-flag-subtree t))) (if for-yank (progn (goto-char newend))= ) (if remove (progn (car-safe (prog1 kill-ring (setq kill-ring ...))))))))<= br>=C2=A0 org-paste-subtree(1)
=C2=A0 (let ((org-todo-line-regexp tr-org= -todo-line-regexp) (org-todo-keywords-1 tr-org-todo-keywords-1) (org-todo-k= wd-alist tr-org-todo-kwd-alist) (org-done-keywords tr-org-done-keywords) (o= rg-todo-regexp tr-org-todo-regexp) (org-todo-line-regexp tr-org-todo-line-r= egexp)) (goto-char (point-min)) (org-show-all '(headings blocks)) (if (= and heading (not (and datetree-date (not datetree-subheading-p)))) (progn (= if (re-search-forward (concat "^" (regexp-quote heading) "\\= ([ \11]+:\\(" org-tag-re ":\\)+\\)?[ \11]*$") nil t) (goto-c= har (match-end 0)) (goto-char (point-max)) (or (bolp) (insert "\n"= ;)) (insert (if datetree-date "" "\n") heading "\n= ") (end-of-line 0)) (outline-show-subtree) (if org-archive-reversed-or= der (progn (org-back-to-heading t) (outline-next-heading)) (org-end-of-subt= ree t)) (skip-chars-backward " \11\15\n") (and (looking-at "= [ \11\15\n]*") (replace-match (if datetree-date "\n" "\= n\n")))) (if org-archive-reversed-order (progn (goto-char (point-min))= (if (org-at-heading-p) nil (outline-next-heading))) (goto-char (point-max)= ) (if (and datetree-date (bolp)) nil (insert "\n")))) (org-paste-= subtree (org-get-valid-level level (and heading 1))) (and inherited-tags (o= r (and (eq org-archive-subtree-add-inherited-tags 'infile) infile-p) (e= q org-archive-subtree-add-inherited-tags t)) (org-set-tags all-tags)) (if (= and org-archive-mark-done (let ((case-fold-search nil)) (looking-at org-tod= o-line-regexp)) (or (not (match-end 2)) (not (member (match-string 2) org-d= one-keywords)))) (progn (let (org-log-done org-todo-log-states) (org-todo (= car (or (member org-archive-mark-done org-done-keywords) org-done-keywords)= ))))) (let ((--dolist-tail-- org-archive-save-context-info)) (while --dolis= t-tail-- (let ((item (car --dolist-tail--))) (let ((value (cdr ...))) (if (= org-string-nw-p value) (progn (org-entry-put ... ... value)))) (setq --doli= st-tail-- (cdr --dolist-tail--))))) (if (eq this-buffer buffer) nil (if (or= (eq org-archive-subtree-save-file-p t) (eq org-archive-subtree-save-file-p= (if (boundp 'org-archive-from-agenda) 'from-agenda 'from-org))= ) (progn (save-buffer)))) (widen))
=C2=A0 (let* ((all-tags (org-get-tags= )) (local-tags (cl-remove-if #'(lambda (tag) (get-text-property 0 '= inherited tag)) all-tags)) (inherited-tags (cl-remove-if-not #'(lambda = (tag) (get-text-property 0 'inherited tag)) all-tags)) (context (list (= cons 'category (org-get-category nil 'force-refresh)) (cons 'fi= le file) (cons 'itags (mapconcat #'identity inherited-tags " &= quot;)) (cons 'ltags (mapconcat #'identity local-tags " "= )) (cons 'olpath (mapconcat #'identity (org-get-outline-path) "= ;/")) (cons 'time time) (cons 'todo (org-entry-get (point) &qu= ot;TODO"))))) (let (this-command) (org-copy-subtree 1 nil t)) (set-buf= fer buffer) (if (not (derived-mode-p 'org-mode)) (let ((org-insert-mode= -line-in-empty-file t) (org-inhibit-startup t)) (call-interactively 'or= g-mode))) (if (and newfile-p org-archive-file-header-format) (progn (goto-c= har (point-max)) (insert (format org-archive-file-header-format (buffer-fil= e-name this-buffer))))) (if datetree-date (progn (require 'org-datetree= ) (org-datetree-find-date-create datetree-date) (org-narrow-to-subtree))) (= let ((org-todo-line-regexp tr-org-todo-line-regexp) (org-todo-keywords-1 tr= -org-todo-keywords-1) (org-todo-kwd-alist tr-org-todo-kwd-alist) (org-done-= keywords tr-org-done-keywords) (org-todo-regexp tr-org-todo-regexp) (org-to= do-line-regexp tr-org-todo-line-regexp)) (goto-char (point-min)) (org-show-= all '(headings blocks)) (if (and heading (not (and datetree-date (not d= atetree-subheading-p)))) (progn (if (re-search-forward (concat "^"= ; (regexp-quote heading) "\\([ \11]+:\\(" org-tag-re ":\\)+\= \)?[ \11]*$") nil t) (goto-char (match-end 0)) (goto-char (point-max))= (or (bolp) (insert "\n")) (insert (if datetree-date ""= "\n") heading "\n") (end-of-line 0)) (outline-show-sub= tree) (if org-archive-reversed-order (progn (org-back-to-heading t) (outlin= e-next-heading)) (org-end-of-subtree t)) (skip-chars-backward " \11\15= \n") (and (looking-at "[ \11\15\n]*") (replace-match (if dat= etree-date "\n" "\n\n")))) (if org-archive-reversed-ord= er (progn (goto-char (point-min)) (if (org-at-heading-p) nil (outline-next-= heading))) (goto-char (point-max)) (if (and datetree-date (bolp)) nil (inse= rt "\n")))) (org-paste-subtree (org-get-valid-level level (and he= ading 1))) (and inherited-tags (or (and (eq org-archive-subtree-add-inherit= ed-tags 'infile) infile-p) (eq org-archive-subtree-add-inherited-tags t= )) (org-set-tags all-tags)) (if (and org-archive-mark-done (let ((case-fold= -search nil)) (looking-at org-todo-line-regexp)) (or (not (match-end 2)) (n= ot (member (match-string 2) org-done-keywords)))) (progn (let (org-log-done= org-todo-log-states) (org-todo (car (or ... org-done-keywords)))))) (let (= (--dolist-tail-- org-archive-save-context-info)) (while --dolist-tail-- (le= t ((item (car --dolist-tail--))) (let ((value ...)) (if (org-string-nw-p va= lue) (progn ...))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (if (eq = this-buffer buffer) nil (if (or (eq org-archive-subtree-save-file-p t) (eq = org-archive-subtree-save-file-p (if (boundp ...) 'from-agenda 'from= -org))) (progn (save-buffer)))) (widen)))
=C2=A0 (save-excursion (org-ba= ck-to-heading t) (let* ((all-tags (org-get-tags)) (local-tags (cl-remove-if= #'(lambda (tag) (get-text-property 0 ... tag)) all-tags)) (inherited-t= ags (cl-remove-if-not #'(lambda (tag) (get-text-property 0 ... tag)) al= l-tags)) (context (list (cons 'category (org-get-category nil 'forc= e-refresh)) (cons 'file file) (cons 'itags (mapconcat #'identit= y inherited-tags " ")) (cons 'ltags (mapconcat #'identity= local-tags " ")) (cons 'olpath (mapconcat #'identity (or= g-get-outline-path) "/")) (cons 'time time) (cons 'todo (= org-entry-get (point) "TODO"))))) (let (this-command) (org-copy-s= ubtree 1 nil t)) (set-buffer buffer) (if (not (derived-mode-p 'org-mode= )) (let ((org-insert-mode-line-in-empty-file t) (org-inhibit-startup t)) (c= all-interactively 'org-mode))) (if (and newfile-p org-archive-file-head= er-format) (progn (goto-char (point-max)) (insert (format org-archive-file-= header-format (buffer-file-name this-buffer))))) (if datetree-date (progn (= require 'org-datetree) (org-datetree-find-date-create datetree-date) (o= rg-narrow-to-subtree))) (let ((org-todo-line-regexp tr-org-todo-line-regexp= ) (org-todo-keywords-1 tr-org-todo-keywords-1) (org-todo-kwd-alist tr-org-t= odo-kwd-alist) (org-done-keywords tr-org-done-keywords) (org-todo-regexp tr= -org-todo-regexp) (org-todo-line-regexp tr-org-todo-line-regexp)) (goto-cha= r (point-min)) (org-show-all '(headings blocks)) (if (and heading (not = (and datetree-date (not datetree-subheading-p)))) (progn (if (re-search-for= ward (concat "^" ... "\\([ \11]+:\\(" org-tag-re "= :\\)+\\)?[ \11]*$") nil t) (goto-char (match-end 0)) (goto-char (point= -max)) (or (bolp) (insert "\n")) (insert (if datetree-date "= " "\n") heading "\n") (end-of-line 0)) (outline-sh= ow-subtree) (if org-archive-reversed-order (progn (org-back-to-heading t) (= outline-next-heading)) (org-end-of-subtree t)) (skip-chars-backward " = \11\15\n") (and (looking-at "[ \11\15\n]*") (replace-match (= if datetree-date "\n" "\n\n")))) (if org-archive-revers= ed-order (progn (goto-char (point-min)) (if (org-at-heading-p) nil (outline= -next-heading))) (goto-char (point-max)) (if (and datetree-date (bolp)) nil= (insert "\n")))) (org-paste-subtree (org-get-valid-level level (= and heading 1))) (and inherited-tags (or (and (eq org-archive-subtree-add-i= nherited-tags 'infile) infile-p) (eq org-archive-subtree-add-inherited-= tags t)) (org-set-tags all-tags)) (if (and org-archive-mark-done (let ((cas= e-fold-search nil)) (looking-at org-todo-line-regexp)) (or (not (match-end = 2)) (not (member ... org-done-keywords)))) (progn (let (org-log-done org-to= do-log-states) (org-todo (car ...))))) (let ((--dolist-tail-- org-archive-s= ave-context-info)) (while --dolist-tail-- (let ((item ...)) (let (...) (if = ... ...)) (setq --dolist-tail-- (cdr --dolist-tail--))))) (if (eq this-buff= er buffer) nil (if (or (eq org-archive-subtree-save-file-p t) (eq org-archi= ve-subtree-save-file-p (if ... ... ...))) (progn (save-buffer)))) (widen)))= )
=C2=A0 (let* ((tr-org-todo-keywords-1 org-todo-keywords-1) (tr-org-tod= o-kwd-alist org-todo-kwd-alist) (tr-org-done-keywords org-done-keywords) (t= r-org-todo-regexp org-todo-regexp) (tr-org-todo-line-regexp org-todo-line-r= egexp) (tr-org-odd-levels-only org-odd-levels-only) (this-buffer (current-b= uffer)) (time (format-time-string (substring (cdr org-time-stamp-formats) 1= -1))) (file (abbreviate-file-name (or (buffer-file-name (buffer-base-buffe= r)) (error "No file associated to buffer")))) (location (org-arch= ive--compute-location (or (org-entry-get nil "ARCHIVE" 'inher= it) org-archive-location))) (afile (car location)) (heading (cdr location))= (infile-p (equal file (abbreviate-file-name (or afile "")))) (ne= wfile-p (and (org-string-nw-p afile) (not (file-exists-p afile)))) (buffer = (cond ((not (org-string-nw-p afile)) this-buffer) ((find-buffer-visiting af= ile)) ((find-file-noselect afile)) (t (error "Cannot access file \&quo= t;%s\"" afile)))) (org-odd-levels-only (if (local-variable-p '= ;org-odd-levels-only (current-buffer)) org-odd-levels-only tr-org-odd-level= s-only)) level datetree-date datetree-subheading-p) (if (string-match "= ;\\`datetree/\\(\\**\\)" heading) (progn (let ((nsub (length (match-st= ring 1 heading)))) (setq heading (concat (make-string (+ ... ...) 42) (subs= tring heading (match-end 0)))) (setq datetree-subheading-p (> nsub 0))) = (setq datetree-date (org-date-to-gregorian (or (org-entry-get nil "CLO= SED" t) time))))) (if (and (> (length heading) 0) (string-match &qu= ot;^\\*+" heading)) (setq level (match-end 0)) (setq heading nil level= 0)) (save-excursion (org-back-to-heading t) (let* ((all-tags (org-get-tags= )) (local-tags (cl-remove-if #'(lambda ... ...) all-tags)) (inherited-t= ags (cl-remove-if-not #'(lambda ... ...) all-tags)) (context (list (con= s 'category (org-get-category nil ...)) (cons 'file file) (cons = 9;itags (mapconcat ... inherited-tags " ")) (cons 'ltags (map= concat ... local-tags " ")) (cons 'olpath (mapconcat ... ... = "/")) (cons 'time time) (cons 'todo (org-entry-get ... &q= uot;TODO"))))) (let (this-command) (org-copy-subtree 1 nil t)) (set-bu= ffer buffer) (if (not (derived-mode-p 'org-mode)) (let ((org-insert-mod= e-line-in-empty-file t) (org-inhibit-startup t)) (call-interactively 'o= rg-mode))) (if (and newfile-p org-archive-file-header-format) (progn (goto-= char (point-max)) (insert (format org-archive-file-header-format (buffer-fi= le-name this-buffer))))) (if datetree-date (progn (require 'org-datetre= e) (org-datetree-find-date-create datetree-date) (org-narrow-to-subtree))) = (let ((org-todo-line-regexp tr-org-todo-line-regexp) (org-todo-keywords-1 t= r-org-todo-keywords-1) (org-todo-kwd-alist tr-org-todo-kwd-alist) (org-done= -keywords tr-org-done-keywords) (org-todo-regexp tr-org-todo-regexp) (org-t= odo-line-regexp tr-org-todo-line-regexp)) (goto-char (point-min)) (org-show= -all '(headings blocks)) (if (and heading (not (and datetree-date ...))= ) (progn (if (re-search-forward ... nil t) (goto-char ...) (goto-char ...) = (or ... ...) (insert ... heading "\n") (end-of-line 0)) (outline-= show-subtree) (if org-archive-reversed-order (progn ... ...) (org-end-of-su= btree t)) (skip-chars-backward " \11\15\n") (and (looking-at &quo= t;[ \11\15\n]*") (replace-match ...))) (if org-archive-reversed-order = (progn (goto-char ...) (if ... nil ...)) (goto-char (point-max)) (if (and d= atetree-date ...) nil (insert "\n")))) (org-paste-subtree (org-ge= t-valid-level level (and heading 1))) (and inherited-tags (or (and (eq org-= archive-subtree-add-inherited-tags ...) infile-p) (eq org-archive-subtree-a= dd-inherited-tags t)) (org-set-tags all-tags)) (if (and org-archive-mark-do= ne (let (...) (looking-at org-todo-line-regexp)) (or (not ...) (not ...))) = (progn (let (org-log-done org-todo-log-states) (org-todo ...)))) (let ((--d= olist-tail-- org-archive-save-context-info)) (while --dolist-tail-- (let (.= ..) (let ... ...) (setq --dolist-tail-- ...)))) (if (eq this-buffer buffer)= nil (if (or (eq org-archive-subtree-save-file-p t) (eq org-archive-subtree= -save-file-p ...)) (progn (save-buffer)))) (widen)))) (run-hooks 'org-a= rchive-hook) (let (this-command) (org-cut-subtree)) (if (featurep 'org-= inlinetask) (progn (org-inlinetask-remove-END-maybe))) (setq org-markers-to= -move nil) (if org-provide-todo-statistics (progn (save-excursion (org-up-h= eading-safe) (org-update-statistics-cookies nil)))) (message "Subtree = archived %s" (if (eq this-buffer buffer) (concat "under heading: = " heading) (concat "in file: " (abbreviate-file-name afile))= )))
=C2=A0 (cond ((equal find-done '(4)) (org-archive-all-done)) ((e= qual find-done '(16)) (org-archive-all-old)) (t (let* ((tr-org-todo-key= words-1 org-todo-keywords-1) (tr-org-todo-kwd-alist org-todo-kwd-alist) (tr= -org-done-keywords org-done-keywords) (tr-org-todo-regexp org-todo-regexp) = (tr-org-todo-line-regexp org-todo-line-regexp) (tr-org-odd-levels-only org-= odd-levels-only) (this-buffer (current-buffer)) (time (format-time-string (= substring (cdr org-time-stamp-formats) 1 -1))) (file (abbreviate-file-name = (or (buffer-file-name ...) (error "No file associated to buffer")= ))) (location (org-archive--compute-location (or (org-entry-get nil "A= RCHIVE" ...) org-archive-location))) (afile (car location)) (heading (= cdr location)) (infile-p (equal file (abbreviate-file-name (or afile "= ")))) (newfile-p (and (org-string-nw-p afile) (not (file-exists-p afil= e)))) (buffer (cond ((not ...) this-buffer) ((find-buffer-visiting afile)) = ((find-file-noselect afile)) (t (error "Cannot access file \"%s\&= quot;" afile)))) (org-odd-levels-only (if (local-variable-p 'org-o= dd-levels-only (current-buffer)) org-odd-levels-only tr-org-odd-levels-only= )) level datetree-date datetree-subheading-p) (if (string-match "\\`da= tetree/\\(\\**\\)" heading) (progn (let ((nsub ...)) (setq heading (co= ncat ... ...)) (setq datetree-subheading-p (> nsub 0))) (setq datetree-d= ate (org-date-to-gregorian (or ... time))))) (if (and (> (length heading= ) 0) (string-match "^\\*+" heading)) (setq level (match-end 0)) (= setq heading nil level 0)) (save-excursion (org-back-to-heading t) (let* ((= all-tags (org-get-tags)) (local-tags (cl-remove-if ... all-tags)) (inherite= d-tags (cl-remove-if-not ... all-tags)) (context (list ... ... ... ... ... = ... ...))) (let (this-command) (org-copy-subtree 1 nil t)) (set-buffer buff= er) (if (not (derived-mode-p ...)) (let (... ...) (call-interactively ...))= ) (if (and newfile-p org-archive-file-header-format) (progn (goto-char ...)= (insert ...))) (if datetree-date (progn (require ...) (org-datetree-find-d= ate-create datetree-date) (org-narrow-to-subtree))) (let ((org-todo-line-re= gexp tr-org-todo-line-regexp) (org-todo-keywords-1 tr-org-todo-keywords-1) = (org-todo-kwd-alist tr-org-todo-kwd-alist) (org-done-keywords tr-org-done-k= eywords) (org-todo-regexp tr-org-todo-regexp) (org-todo-line-regexp tr-org-= todo-line-regexp)) (goto-char (point-min)) (org-show-all '...) (if (and= heading ...) (progn ... ... ... ... ...) (if org-archive-reversed-order ..= . ... ...)) (org-paste-subtree (org-get-valid-level level ...)) (and inheri= ted-tags (or ... ...) (org-set-tags all-tags)) (if (and org-archive-mark-do= ne ... ...) (progn ...)) (let (...) (while --dolist-tail-- ...)) (if (eq th= is-buffer buffer) nil (if ... ...)) (widen)))) (run-hooks 'org-archive-= hook) (let (this-command) (org-cut-subtree)) (if (featurep 'org-inlinet= ask) (progn (org-inlinetask-remove-END-maybe))) (setq org-markers-to-move n= il) (if org-provide-todo-statistics (progn (save-excursion (org-up-heading-= safe) (org-update-statistics-cookies nil)))) (message "Subtree archive= d %s" (if (eq this-buffer buffer) (concat "under heading: " = heading) (concat "in file: " (abbreviate-file-name afile)))))))=C2=A0 (if (and (org-region-active-p) org-loop-over-headlines-in-active-r= egion) (let ((cl (if (eq org-loop-over-headlines-in-active-region 'star= t-level) 'region-start-level 'region)) org-loop-over-headlines-in-a= ctive-region) (org-map-entries (list 'progn '(setq org-map-continue= -from (progn (org-back-to-heading) (point))) (list 'org-archive-subtree= find-done)) org-loop-over-headlines-in-active-region cl (if (org-invisible= -p) (org-end-of-subtree nil t)))) (cond ((equal find-done '(4)) (org-ar= chive-all-done)) ((equal find-done '(16)) (org-archive-all-old)) (t (le= t* ((tr-org-todo-keywords-1 org-todo-keywords-1) (tr-org-todo-kwd-alist org= -todo-kwd-alist) (tr-org-done-keywords org-done-keywords) (tr-org-todo-rege= xp org-todo-regexp) (tr-org-todo-line-regexp org-todo-line-regexp) (tr-org-= odd-levels-only org-odd-levels-only) (this-buffer (current-buffer)) (time (= format-time-string (substring ... 1 -1))) (file (abbreviate-file-name (or .= .. ...))) (location (org-archive--compute-location (or ... org-archive-loca= tion))) (afile (car location)) (heading (cdr location)) (infile-p (equal fi= le (abbreviate-file-name ...))) (newfile-p (and (org-string-nw-p afile) (no= t ...))) (buffer (cond (... this-buffer) (...) (...) (t ...))) (org-odd-lev= els-only (if (local-variable-p ... ...) org-odd-levels-only tr-org-odd-leve= ls-only)) level datetree-date datetree-subheading-p) (if (string-match &quo= t;\\`datetree/\\(\\**\\)" heading) (progn (let (...) (setq heading ...= ) (setq datetree-subheading-p ...)) (setq datetree-date (org-date-to-gregor= ian ...)))) (if (and (> (length heading) 0) (string-match "^\\*+&qu= ot; heading)) (setq level (match-end 0)) (setq heading nil level 0)) (save-= excursion (org-back-to-heading t) (let* ((all-tags ...) (local-tags ...) (i= nherited-tags ...) (context ...)) (let (this-command) (org-copy-subtree 1 n= il t)) (set-buffer buffer) (if (not ...) (let ... ...)) (if (and newfile-p = org-archive-file-header-format) (progn ... ...)) (if datetree-date (progn .= .. ... ...)) (let (... ... ... ... ... ...) (goto-char ...) (org-show-all .= ..) (if ... ... ...) (org-paste-subtree ...) (and inherited-tags ... ...) (= if ... ...) (let ... ...) (if ... nil ...) (widen)))) (run-hooks 'org-a= rchive-hook) (let (this-command) (org-cut-subtree)) (if (featurep 'org-= inlinetask) (progn (org-inlinetask-remove-END-maybe))) (setq org-markers-to= -move nil) (if org-provide-todo-statistics (progn (save-excursion (org-up-h= eading-safe) (org-update-statistics-cookies nil)))) (message "Subtree = archived %s" (if (eq this-buffer buffer) (concat "under heading: = " heading) (concat "in file: " (abbreviate-file-name afile))= ))))) (org-reveal) (if (looking-at "^[ \11]*$") (outline-next-vis= ible-heading 1)))
=C2=A0 org-archive-subtree(nil)
=C2=A0 funcall-inte= ractively(org-archive-subtree nil)
=C2=A0 call-interactively(org-archive= -subtree)
=C2=A0 org-archive-subtree-default()
=C2=A0 funcall-interac= tively(org-archive-subtree-default)
=C2=A0 call-interactively(org-archiv= e-subtree-default nil nil)
=C2=A0 command-execute(org-archive-subtree-de= fault)
```


[stardiviner]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Hack this world!>=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 GPG key ID: 47C32433
IRC(freeenode): stardiviner =C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Twitter:=C2=A0 @numbchild
Key fingerprint= =3D 9BAA 92BC CDDD B9EF 3B36=C2=A0 CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.g= ithub.io/
--000000000000e62fcb05b5eafedb--