Return a list whose CAR is the tangled file name."
(interactive "fFile to tangle: \nP")
- (let ((visited-p (find-buffer-visiting (expand-file-name file)))
- to-be-removed)
+ (let* ((visited (find-buffer-visiting file))
+ (buffer (or visited (find-file-noselect file))))
(prog1
- (save-window-excursion
- (find-file file)
- (setq to-be-removed (current-buffer))
- (mapcar #'expand-file-name (org-babel-tangle nil target-file lang-re)))
- (unless visited-p
- (kill-buffer to-be-removed)))))
+ (with-current-buffer buffer
+ (org-with-wide-buffer
+ (mapcar #'expand-file-name
+ (org-babel-tangle nil target-file lang-re))))
+ (unless visited (kill-buffer buffer)))))
(defun org-babel-tangle-publish (_ filename pub-dir)
"Tangle FILENAME and place the results in PUB-DIR."
(setq duration (- (org-duration-to-minutes s2)
(org-duration-to-minutes s1))))
;; Format S1 and S2 for display.
- (when s1 (setq s1 (org-get-time-of-day s1 'overtime)))
+ (when s1 (setq s1 (format "%5s" (org-get-time-of-day s1 'overtime))))
(when s2 (setq s2 (org-get-time-of-day s2 'overtime))))
(when (string-match org-tag-group-re txt)
;; Tags are in the string
(save-excursion
(goto-char (if line (point-at-bol) (point-min)))
(while (not (eobp))
- (let ((habit (get-text-property (point) 'org-habit-p)))
+ (let ((habit (get-text-property (point) 'org-habit-p))
+ (invisible-prop (get-text-property (point) 'invisible)))
(when habit
(move-to-column org-habit-graph-column t)
(delete-char (min (+ 1 org-habit-preceding-days
habit
(time-subtract moment (days-to-time org-habit-preceding-days))
moment
- (time-add moment (days-to-time org-habit-following-days))))))
+ (time-add moment (days-to-time org-habit-following-days))))
+ ;; Inherit invisible state of hidden entries.
+ (when invisible-prop
+ (put-text-property
+ (- (point) org-habit-graph-column) (point)
+ 'invisible invisible-prop))))
(forward-line)))))
(defun org-habit-toggle-habits ()
(defun org-git-version ()
"The Git version of Org mode.
Inserted by installing Org or when a release is made."
- (let ((org-git-version "release_9.5.1-25-g9ca3bc"))
+ (let ((org-git-version "release_9.5.1-31-ga18849"))
org-git-version))
\f
(provide 'org-version)
(setq beg (point)
heading (org-get-heading 'no-tags))
(org-end-of-subtree t t)
- (when (org-at-heading-p) (backward-char 1))
+ (when (and (not (eobp)) (org-at-heading-p)) (backward-char 1))
(setq end (point)))
(when (and (buffer-live-p org-last-indirect-buffer)
(not (eq org-indirect-buffer-display 'new-frame))