mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-27 03:02:52 +00:00
New yank function.
This commit is contained in:
parent
5dde398b92
commit
5aaccd93c4
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
* org.el (org-indent-line-function): Do not indent in regions that
|
* org.el (org-indent-line-function): Do not indent in regions that
|
||||||
are external source code.
|
are external source code.
|
||||||
|
(org-yank-and-fold-if-subtree): New function.
|
||||||
|
|
||||||
* org-agenda.el (org-agenda-todayp): New function.
|
* org-agenda.el (org-agenda-todayp): New function.
|
||||||
(org-agenda-get-deadlines, org-agenda-get-scheduled): Use
|
(org-agenda-get-deadlines, org-agenda-get-scheduled): Use
|
||||||
|
|
29
lisp/org.el
29
lisp/org.el
|
@ -14392,27 +14392,23 @@ beyond the end of the headline."
|
||||||
(org-set-tags nil t))
|
(org-set-tags nil t))
|
||||||
(t (kill-region (point) (point-at-eol)))))
|
(t (kill-region (point) (point-at-eol)))))
|
||||||
|
|
||||||
|
|
||||||
(define-key org-mode-map "\C-k" 'org-kill-line)
|
(define-key org-mode-map "\C-k" 'org-kill-line)
|
||||||
|
|
||||||
(defun org-yank (&optional arg)
|
(defun org-yank-and-fold-if-subtree ()
|
||||||
(interactive "*P")
|
"Yank, and if the yanked text is a single subtree, fold it."
|
||||||
(let ((fold (get-text-property 0 :org-folded-kill
|
(interactive)
|
||||||
(current-kill (cond ((listp arg) 0)
|
(let ((pos (point)) p1)
|
||||||
((eq arg '-) -2)
|
|
||||||
(t (1- arg))))))
|
|
||||||
(fold t)
|
|
||||||
(yank-excluded-properties
|
|
||||||
(cons :org-folded-kill yank-excluded-properties))
|
|
||||||
(pos (point)) p1)
|
|
||||||
(call-interactively 'yank)
|
(call-interactively 'yank)
|
||||||
(setq p1 (point))
|
(setq p1 (point))
|
||||||
(goto-char pos)
|
(goto-char pos)
|
||||||
(when (and (bolp) (looking-at outline-regexp) fold)
|
(when (and (bolp)
|
||||||
(save-restriction
|
(looking-at outline-regexp)
|
||||||
(narrow-to-region pos p1)
|
(org-kill-is-subtree-p))
|
||||||
(hide-subtree)
|
(hide-subtree)
|
||||||
(org-cycle-show-empty-lines 'folded))
|
(org-cycle-show-empty-lines 'folded))
|
||||||
(goto-char p1))))
|
(goto-char p1)
|
||||||
|
(skip-chars-forward " \t\n\r")))
|
||||||
|
|
||||||
(defun org-invisible-p ()
|
(defun org-invisible-p ()
|
||||||
"Check if point is at a character currently not visible."
|
"Check if point is at a character currently not visible."
|
||||||
|
@ -14775,3 +14771,4 @@ Still experimental, may disappear in the future."
|
||||||
;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd
|
;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd
|
||||||
|
|
||||||
;;; org.el ends here
|
;;; org.el ends here
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue