Fix Emacs 29 compiler warnings

* lisp/oc-basic.el (org-cite-basic--parse-bibliography): Do not use
obsolete `buffer-file-name' generalized variable.  Prefer
`set-visited-file-name'.
* lisp/ol-bibtex.el (org-indent-region): Declare function.
(org-bibtex-import-from-file): Remove unused variable.
* lisp/ol.el (org-link--decode-compound): Use `ash' instead of
obsolete `lsh'.
* lisp/org-macs.el: Do no use obsolete generalized variable
`buffer-string'.
* lisp/org-plot.el (org-plot/redisplay-img-in-buffer):
* lisp/org.el (image-flush):
(org-display-inline-images): Use `image-flush' instead of obsolete
`image-refresh'.
* lisp/ox.el (org-export-to-file): Quote ' in the docstring.

All other changes are changing obsolete `point-at-bol' and
`point-at-eol' to `line-beginning-position' and `line-end-position'.
This commit is contained in:
Ihor Radchenko 2022-09-06 20:50:59 +08:00
parent 0c055d2d31
commit e73c5b7d0d
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
24 changed files with 210 additions and 207 deletions

View File

@ -939,7 +939,7 @@ arguments and pop open the results in a preview buffer."
vals "")))))) vals ""))))))
(save-excursion (save-excursion
(goto-char begin) (goto-char begin)
(goto-char (point-at-eol)) (goto-char (line-end-position))
(unless (= (char-before (point)) ?\ ) (insert " ")) (unless (= (char-before (point)) ?\ ) (insert " "))
(insert ":" header-arg) (when value (insert " " value))))) (insert ":" header-arg) (when value (insert " " value)))))
@ -1958,9 +1958,9 @@ region is not active then the point is demarcated."
(let ((lang (nth 0 info)) (let ((lang (nth 0 info))
(indent (make-string (current-indentation) ?\s))) (indent (make-string (current-indentation) ?\s)))
(when (string-match "^[[:space:]]*$" (when (string-match "^[[:space:]]*$"
(buffer-substring (point-at-bol) (buffer-substring (line-beginning-position)
(point-at-eol))) (line-end-position)))
(delete-region (point-at-bol) (point-at-eol))) (delete-region (line-beginning-position) (line-end-position)))
(insert (concat (insert (concat
(if (looking-at "^") "" "\n") (if (looking-at "^") "" "\n")
indent (if upper-case-p "#+END_SRC\n" "#+end_src\n") indent (if upper-case-p "#+END_SRC\n" "#+end_src\n")

View File

@ -315,7 +315,7 @@ LINENO is the number of the erroneous line."
(progn (progn
(goto-char (point-min)) (goto-char (point-min))
(forward-line (- lineNo 1)) (forward-line (- lineNo 1))
(buffer-substring (point) (point-at-eol))) (buffer-substring (point) (line-end-position)))
nil))) nil)))
(defun org-babel-lilypond-attempt-to-open-pdf (file-name &optional test) (defun org-babel-lilypond-attempt-to-open-pdf (file-name &optional test)

View File

@ -259,7 +259,7 @@ This removes initial blank and comment lines and then calls
(insert-file-contents file-name) (insert-file-contents file-name)
(re-search-forward "^[ \t]*[^# \t]" nil t) (re-search-forward "^[ \t]*[^# \t]" nil t)
(when (< (setq beg (point-min)) (when (< (setq beg (point-min))
(setq end (point-at-bol))) (setq end (line-beginning-position)))
(delete-region beg end))) (delete-region beg end)))
(org-babel-import-elisp-from-file temp-file '(16)))) (org-babel-import-elisp-from-file temp-file '(16))))

View File

@ -277,7 +277,7 @@ Optional argument INFO is the export state, as a property list."
(when (or (org-file-has-changed-p file) (when (or (org-file-has-changed-p file)
(not (gethash file org-cite-basic--file-id-cache))) (not (gethash file org-cite-basic--file-id-cache)))
(insert-file-contents file) (insert-file-contents file)
(setf (buffer-file-name) file) (set-visited-file-name file t)
(puthash file (org-buffer-hash) org-cite-basic--file-id-cache)) (puthash file (org-buffer-hash) org-cite-basic--file-id-cache))
(condition-case nil (condition-case nil
(unwind-protect (unwind-protect
@ -295,7 +295,7 @@ Optional argument INFO is the export state, as a property list."
(push (cons file-id table) org-cite-basic--bibliography-cache) (push (cons file-id table) org-cite-basic--bibliography-cache)
table)))) table))))
(push (cons file entries) results)) (push (cons file entries) results))
(setf (buffer-file-name) nil)) (set-visited-file-name nil t))
(error (setq org-cite-basic--file-id-cache nil)))))) (error (setq org-cite-basic--file-id-cache nil))))))
(when info (plist-put info :cite-basic/bibliography results)) (when info (plist-put info :cite-basic/bibliography results))
results))) results)))

View File

@ -139,6 +139,7 @@
(declare-function org-narrow-to-subtree "org" (&optional element)) (declare-function org-narrow-to-subtree "org" (&optional element))
(declare-function org-set-property "org" (property value)) (declare-function org-set-property "org" (property value))
(declare-function org-toggle-tag "org" (tag &optional onoff)) (declare-function org-toggle-tag "org" (tag &optional onoff))
(declare-function org-indent-region "org" (start end))
(declare-function org-search-view "org-agenda" (&optional todo-only string edit-at)) (declare-function org-search-view "org-agenda" (&optional todo-only string edit-at))
@ -764,7 +765,7 @@ drawer."
"Read bibtex entries from FILE and insert as Org headlines after point." "Read bibtex entries from FILE and insert as Org headlines after point."
(interactive "fFile: ") (interactive "fFile: ")
(let ((pos (point))) (let ((pos (point)))
(dotimes (i (org-bibtex-read-file file)) (dotimes (_ (org-bibtex-read-file file))
(save-excursion (org-bibtex-write 'noindent)) (save-excursion (org-bibtex-write 'noindent))
(re-search-forward org-property-end-re) (re-search-forward org-property-end-re)
(insert "\n")) (insert "\n"))

View File

@ -138,13 +138,13 @@ result is a cons of the filename and search string."
;; can we get a '::' part? ;; can we get a '::' part?
(if (string= erc-line (erc-prompt)) (if (string= erc-line (erc-prompt))
(progn (progn
(goto-char (point-at-bol)) (goto-char (line-beginning-position))
(when (search-backward-regexp "^[^ ]" nil t) (when (search-backward-regexp "^[^ ]" nil t)
(buffer-substring-no-properties (point-at-bol) (buffer-substring-no-properties (line-beginning-position)
(point-at-eol)))) (line-end-position))))
(when (search-backward erc-line nil t) (when (search-backward erc-line nil t)
(buffer-substring-no-properties (point-at-bol) (buffer-substring-no-properties (line-beginning-position)
(point-at-eol))))))) (line-end-position)))))))
(defun org-irc-erc-store-link () (defun org-irc-erc-store-link ()
"Store a link to the IRC log file or the session itself. "Store a link to the IRC log file or the session itself.
@ -154,7 +154,7 @@ the session itself."
(require 'erc-log) (require 'erc-log)
(if org-irc-link-to-logs (if org-irc-link-to-logs
(let* ((erc-line (buffer-substring-no-properties (let* ((erc-line (buffer-substring-no-properties
(point-at-bol) (point-at-eol))) (line-beginning-position) (line-end-position)))
(parsed-line (org-irc-erc-get-line-from-log erc-line))) (parsed-line (org-irc-erc-get-line-from-log erc-line)))
(if (erc-logging-enabled nil) (if (erc-logging-enabled nil)
(progn (progn

View File

@ -681,7 +681,7 @@ followed by another \"%[A-F0-9]{2}\" group."
(cons 6 128)))) (cons 6 128))))
(when (>= val 192) (setq eat (car shift-xor))) (when (>= val 192) (setq eat (car shift-xor)))
(setq val (logxor val (cdr shift-xor))) (setq val (logxor val (cdr shift-xor)))
(setq sum (+ (lsh sum (car shift-xor)) val)) (setq sum (+ (ash sum (car shift-xor)) val))
(when (> eat 0) (setq eat (- eat 1))) (when (> eat 0) (setq eat (- eat 1)))
(cond (cond
((= 0 eat) ;multi byte ((= 0 eat) ;multi byte
@ -1529,7 +1529,7 @@ non-nil."
(let ((end (region-end))) (let ((end (region-end)))
(goto-char (region-beginning)) (goto-char (region-beginning))
(set-mark (point)) (set-mark (point))
(while (< (point-at-eol) end) (while (< (line-end-position) end)
(move-end-of-line 1) (activate-mark) (move-end-of-line 1) (activate-mark)
(let (current-prefix-arg) (let (current-prefix-arg)
(call-interactively 'org-store-link)) (call-interactively 'org-store-link))

View File

@ -2150,7 +2150,7 @@ in that string. If STRING is nil, it will be fetched from the beginning
of the current line." of the current line."
(declare (debug t) (indent 1)) (declare (debug t) (indent 1))
(org-with-gensyms (marker) (org-with-gensyms (marker)
`(let ((,marker (get-text-property (if ,string 0 (point-at-bol)) `(let ((,marker (get-text-property (if ,string 0 (line-beginning-position))
'org-hd-marker ,string))) 'org-hd-marker ,string)))
(with-current-buffer (marker-buffer ,marker) (with-current-buffer (marker-buffer ,marker)
(save-excursion (save-excursion
@ -3116,10 +3116,10 @@ s Search for keywords M Like m, but only TODO entries
(when (eq rmheader t) (when (eq rmheader t)
(org-goto-line 1) (org-goto-line 1)
(re-search-forward ":" nil t) (re-search-forward ":" nil t)
(delete-region (match-end 0) (point-at-eol)) (delete-region (match-end 0) (line-end-position))
(forward-char 1) (forward-char 1)
(looking-at "-+") (looking-at "-+")
(delete-region (match-end 0) (point-at-eol)) (delete-region (match-end 0) (line-end-position))
(move-marker header-end (match-end 0))) (move-marker header-end (match-end 0)))
(goto-char header-end) (goto-char header-end)
(delete-region (point) (point-max)) (delete-region (point) (point-max))
@ -3545,10 +3545,10 @@ This ensures the export commands can easily use it."
"Mark the line at POS as an agenda structure header." "Mark the line at POS as an agenda structure header."
(save-excursion (save-excursion
(goto-char pos) (goto-char pos)
(put-text-property (point-at-bol) (point-at-eol) (put-text-property (line-beginning-position) (line-end-position)
'org-agenda-structural-header t) 'org-agenda-structural-header t)
(when org-agenda-title-append (when org-agenda-title-append
(put-text-property (point-at-bol) (point-at-eol) (put-text-property (line-beginning-position) (line-end-position)
'org-agenda-title-append org-agenda-title-append)))) 'org-agenda-title-append org-agenda-title-append))))
(defvar org-mobile-creating-agendas) ; defined in org-mobile.el (defvar org-mobile-creating-agendas) ; defined in org-mobile.el
@ -3755,7 +3755,7 @@ removed from the entry content. Currently only `planning' is allowed here."
(while (not (eobp)) (while (not (eobp))
(unless (looking-at "[ \t]*$") (unless (looking-at "[ \t]*$")
(move-to-column ind) (move-to-column ind)
(delete-region (point-at-bol) (point))) (delete-region (line-beginning-position) (point)))
(beginning-of-line 2)) (beginning-of-line 2))
(run-hooks 'org-agenda-entry-text-cleanup-hook) (run-hooks 'org-agenda-entry-text-cleanup-hook)
@ -4027,7 +4027,7 @@ agenda display, configure `org-agenda-finalize-hook'."
(goto-char (point-min)) (goto-char (point-min))
(while (equal (forward-line) 0) (while (equal (forward-line) 0)
(when (setq mrk (get-text-property (point) 'org-hd-marker)) (when (setq mrk (get-text-property (point) 'org-hd-marker))
(put-text-property (point-at-bol) (point-at-eol) (put-text-property (line-beginning-position) (line-end-position)
'tags 'tags
(org-with-point-at mrk (org-with-point-at mrk
(org-get-tags)))))))) (org-get-tags))))))))
@ -4075,7 +4075,7 @@ agenda display, configure `org-agenda-finalize-hook'."
(goto-char s) (goto-char s)
(when (equal (org-get-at-bol 'org-hd-marker) (when (equal (org-get-at-bol 'org-hd-marker)
org-clock-hd-marker) org-clock-hd-marker)
(setq ov (make-overlay (point-at-bol) (1+ (point-at-eol)))) (setq ov (make-overlay (line-beginning-position) (1+ (line-end-position))))
(overlay-put ov 'type 'org-agenda-clocking) (overlay-put ov 'type 'org-agenda-clocking)
(overlay-put ov 'face 'org-agenda-clocking) (overlay-put ov 'face 'org-agenda-clocking)
(overlay-put ov 'help-echo (overlay-put ov 'help-echo
@ -4106,7 +4106,7 @@ agenda display, configure `org-agenda-finalize-hook'."
b (match-beginning 1) b (match-beginning 1)
e (if (eq org-agenda-fontify-priorities 'cookies) e (if (eq org-agenda-fontify-priorities 'cookies)
(1+ (match-end 2)) (1+ (match-end 2))
(point-at-eol)) (line-end-position))
ov (make-overlay b e)) ov (make-overlay b e))
(overlay-put (overlay-put
ov 'face ov 'face
@ -4210,7 +4210,7 @@ Also moves point to the end of the skipped region, so that search can
continue from there. continue from there.
Optional argument ELEMENT contains element at point." Optional argument ELEMENT contains element at point."
(let ((p (point-at-bol)) to) (let ((p (line-beginning-position)) to)
(when (or (when (or
(save-excursion (goto-char p) (looking-at comment-start-skip)) (save-excursion (goto-char p) (looking-at comment-start-skip))
(and org-agenda-skip-archived-trees (not org-agenda-archives-mode) (and org-agenda-skip-archived-trees (not org-agenda-archives-mode)
@ -4286,7 +4286,7 @@ This check for agenda markers in all agenda buffers currently active."
m org-agenda-entry-text-maxlines m org-agenda-entry-text-maxlines
org-agenda-entry-text-leaders)))) org-agenda-entry-text-leaders))))
(when (string-match "\\S-" txt) (when (string-match "\\S-" txt)
(setq o (make-overlay (point-at-bol) (point-at-eol))) (setq o (make-overlay (line-beginning-position) (line-end-position)))
(overlay-put o 'evaporate t) (overlay-put o 'evaporate t)
(overlay-put o 'org-overlay-type 'agenda-entry-content) (overlay-put o 'org-overlay-type 'agenda-entry-content)
(overlay-put o 'after-string txt)))) (overlay-put o 'after-string txt))))
@ -4795,7 +4795,7 @@ is active."
(forward-line -1) (forward-line -1)
(org-back-to-heading t))) (org-back-to-heading t)))
(skip-chars-forward "* ") (skip-chars-forward "* ")
(setq beg (point-at-bol) (setq beg (line-beginning-position)
beg1 (point) beg1 (point)
end (progn end (progn
(outline-next-heading) (outline-next-heading)
@ -4810,8 +4810,8 @@ is active."
(goto-char beg) (goto-char beg)
(org-agenda-skip) (org-agenda-skip)
(setq str (buffer-substring-no-properties (setq str (buffer-substring-no-properties
(point-at-bol) (line-beginning-position)
(if hdl-only (point-at-eol) end))) (if hdl-only (line-end-position) end)))
(mapc (lambda (wr) (when (string-match wr str) (mapc (lambda (wr) (when (string-match wr str)
(goto-char (1- end)) (goto-char (1- end))
(throw :skip t))) (throw :skip t)))
@ -4839,7 +4839,7 @@ is active."
txt (org-agenda-format-item txt (org-agenda-format-item
"" ""
(buffer-substring-no-properties (buffer-substring-no-properties
beg1 (point-at-eol)) beg1 (line-end-position))
level category tags t)) level category tags t))
(org-add-props txt props (org-add-props txt props
'org-marker marker 'org-hd-marker marker 'org-marker marker 'org-hd-marker marker
@ -5381,7 +5381,7 @@ each date. It also removes lines that contain only whitespace."
(abbreviate-file-name buffer-file-name)) (abbreviate-file-name buffer-file-name))
"") "")
'org-agenda-diary-link t 'org-agenda-diary-link t
'org-marker (org-agenda-new-marker (point-at-bol)))) 'org-marker (org-agenda-new-marker (line-beginning-position))))
(defun org-diary-default-entry () (defun org-diary-default-entry ()
"Add a dummy entry to the diary. "Add a dummy entry to the diary.
@ -6057,7 +6057,7 @@ then those holidays will be skipped."
clockp (not (or closedp statep)) clockp (not (or closedp statep))
state (and statep (match-string 2)) state (and statep (match-string 2))
category (org-get-category (match-beginning 0)) category (org-get-category (match-beginning 0))
timestr (buffer-substring (match-beginning 0) (point-at-eol)) timestr (buffer-substring (match-beginning 0) (line-end-position))
effort (save-match-data (or (get-text-property (point) 'effort) effort (save-match-data (or (get-text-property (point) 'effort)
(org-entry-get (point) org-effort-property)))) (org-entry-get (point) org-effort-property))))
(setq effort-minutes (when effort (save-match-data (org-duration-to-minutes effort)))) (setq effort-minutes (when effort (save-match-data (org-duration-to-minutes effort))))
@ -6122,7 +6122,7 @@ then those holidays will be skipped."
'type type 'date date 'type type 'date date
'undone-face 'org-warning 'done-face 'org-agenda-done) 'undone-face 'org-warning 'done-face 'org-agenda-done)
(push txt ee)) (push txt ee))
(goto-char (point-at-eol)))) (goto-char (line-end-position))))
(nreverse ee))) (nreverse ee)))
(defun org-agenda-show-clocking-issues () (defun org-agenda-show-clocking-issues ()
@ -6159,7 +6159,7 @@ See also the user option `org-agenda-clock-consistency-checks'."
(setq issue "No valid clock line") (throw 'next t)) (setq issue "No valid clock line") (throw 'next t))
(org-with-point-at m (org-with-point-at m
(save-excursion (save-excursion
(goto-char (point-at-bol)) (goto-char (line-beginning-position))
(unless (looking-at re) (unless (looking-at re)
(error "No valid Clock line") (error "No valid Clock line")
(throw 'next t)) (throw 'next t))
@ -6205,7 +6205,7 @@ See also the user option `org-agenda-clock-consistency-checks'."
(setq tlend (or te tlend) tlstart (or ts tlstart)) (setq tlend (or te tlend) tlstart (or ts tlstart))
(when issue (when issue
;; OK, there was some issue, add an overlay to show the issue ;; OK, there was some issue, add an overlay to show the issue
(setq ov (make-overlay (point-at-bol) (point-at-eol))) (setq ov (make-overlay (line-beginning-position) (line-end-position)))
(overlay-put ov 'before-string (overlay-put ov 'before-string
(concat (concat
(org-add-props (org-add-props
@ -7633,7 +7633,7 @@ The optional argument TYPE tells the agenda type."
(save-excursion (save-excursion
(beginning-of-line 1) (beginning-of-line 1)
(setq re (org-get-at-bol 'org-todo-regexp)) (setq re (org-get-at-bol 'org-todo-regexp))
(goto-char (or (text-property-any (point-at-bol) (point-at-eol) 'org-heading t) (point))) (goto-char (or (text-property-any (line-beginning-position) (line-end-position) 'org-heading t) (point)))
(when (looking-at (concat "[ \t]*\\.*\\(" re "\\) +")) (when (looking-at (concat "[ \t]*\\.*\\(" re "\\) +"))
(add-text-properties (match-beginning 0) (match-end 1) (add-text-properties (match-beginning 0) (match-end 1)
(list 'face (org-get-todo-face 1))) (list 'face (org-get-todo-face 1)))
@ -7914,7 +7914,7 @@ subtree."
(point) (point)
(if org-agenda-restriction-lock-highlight-subtree (if org-agenda-restriction-lock-highlight-subtree
(save-excursion (org-end-of-subtree t t) (point)) (save-excursion (org-end-of-subtree t t) (point))
(point-at-eol))) (line-end-position)))
(move-marker org-agenda-restrict-begin (point)) (move-marker org-agenda-restrict-begin (point))
(move-marker org-agenda-restrict-end (move-marker org-agenda-restrict-end
(save-excursion (org-end-of-subtree t t))) (save-excursion (org-end-of-subtree t t)))
@ -8743,8 +8743,8 @@ grouptags."
(defun org-agenda-filter-hide-line (type) (defun org-agenda-filter-hide-line (type)
"If current line is TYPE, hide it in the agenda buffer." "If current line is TYPE, hide it in the agenda buffer."
(let* (buffer-invisibility-spec (let* (buffer-invisibility-spec
(beg (max (point-min) (1- (point-at-bol)))) (beg (max (point-min) (1- (line-beginning-position))))
(end (point-at-eol))) (end (line-end-position)))
(let ((inhibit-read-only t)) (let ((inhibit-read-only t))
(add-text-properties (add-text-properties
beg end `(invisible org-filtered org-filter-type ,type))))) beg end `(invisible org-filtered org-filter-type ,type)))))
@ -9400,7 +9400,7 @@ When called with a prefix argument, include all archive files as well."
(interactive "p") (interactive "p")
(let ((col (current-column))) (let ((col (current-column)))
(dotimes (_ n) (dotimes (_ n)
(when (next-single-property-change (point-at-eol) 'org-marker) (when (next-single-property-change (line-end-position) 'org-marker)
(move-end-of-line 1) (move-end-of-line 1)
(goto-char (next-single-property-change (point) 'org-marker)))) (goto-char (next-single-property-change (point) 'org-marker))))
(org-move-to-column col)) (org-move-to-column col))
@ -9458,7 +9458,7 @@ When called with a prefix argument, include all archive files as well."
(when (re-search-forward org-complex-heading-regexp nil t) (when (re-search-forward org-complex-heading-regexp nil t)
(goto-char (match-beginning 4))))) (goto-char (match-beginning 4)))))
(run-hooks 'org-agenda-after-show-hook) (run-hooks 'org-agenda-after-show-hook)
(and highlight (org-highlight (point-at-bol) (point-at-eol))))) (and highlight (org-highlight (line-beginning-position) (line-end-position)))))
(defvar org-agenda-after-show-hook nil (defvar org-agenda-after-show-hook nil
"Normal hook run after an item has been shown from the agenda. "Normal hook run after an item has been shown from the agenda.
@ -9481,10 +9481,10 @@ deletes the agenda entry and don't move to the next entry."
(level (and (eq org-agenda-loop-over-headlines-in-active-region 'start-level) (level (and (eq org-agenda-loop-over-headlines-in-active-region 'start-level)
(org-get-at-bol 'level)))) (org-get-at-bol 'level))))
(while (< (point) mend) (while (< (point) mend)
(let ((ov (make-overlay (point) (point-at-eol)))) (let ((ov (make-overlay (point) (line-end-position))))
(if (not (or all (if (not (or all
(and match (looking-at-p match)) (and match (looking-at-p match))
(eq level (org-get-at-bol 'level)))) (eq level (org-get-at-bol 'level))))
(org-agenda-next-item 1) (org-agenda-next-item 1)
(overlay-put ov 'face 'region) (overlay-put ov 'face 'region)
(if (or arg force-arg) (funcall cmd arg) (funcall cmd)) (if (or arg force-arg) (funcall cmd arg) (funcall cmd))
@ -9526,8 +9526,8 @@ Pass ARG, FORCE-ARG, DELETE and BODY to `org-agenda-do-in-region'."
(if (and (derived-mode-p 'org-mode) (not (member type '("sexp")))) (if (and (derived-mode-p 'org-mode) (not (member type '("sexp"))))
(setq dbeg (progn (org-back-to-heading t) (point)) (setq dbeg (progn (org-back-to-heading t) (point))
dend (org-end-of-subtree t t)) dend (org-end-of-subtree t t))
(setq dbeg (point-at-bol) (setq dbeg (line-beginning-position)
dend (min (point-max) (1+ (point-at-eol))))) dend (min (point-max) (1+ (line-end-position)))))
(goto-char dbeg) (goto-char dbeg)
(while (re-search-forward "^[ \t]*\\S-" dend t) (setq n (1+ n))))) (while (re-search-forward "^[ \t]*\\S-" dend t) (setq n (1+ n)))))
(when (or (eq t org-agenda-confirm-kill) (when (or (eq t org-agenda-confirm-kill)
@ -9539,8 +9539,8 @@ Pass ARG, FORCE-ARG, DELETE and BODY to `org-agenda-do-in-region'."
(prog2 (prog2
(org-agenda-tree-to-indirect-buffer nil) (org-agenda-tree-to-indirect-buffer nil)
(not (y-or-n-p (not (y-or-n-p
(format "Delete entry with %d lines in buffer \"%s\"? " (format "Delete entry with %d lines in buffer \"%s\"? "
n (buffer-name buffer)))) n (buffer-name buffer))))
(kill-buffer org-last-indirect-buffer)) (kill-buffer org-last-indirect-buffer))
(error "Abort")) (error "Abort"))
(set-window-configuration win-conf)))) (set-window-configuration win-conf))))
@ -9626,7 +9626,7 @@ If this information is not given, the function uses the tree at point."
(>= p beg) (>= p beg)
(< p end)) (< p end))
(let ((inhibit-read-only t)) (let ((inhibit-read-only t))
(delete-region (point-at-bol) (1+ (point-at-eol))))) (delete-region (line-beginning-position) (1+ (line-end-position)))))
(beginning-of-line 0)))))) (beginning-of-line 0))))))
(defun org-agenda-refile (&optional goto rfloc no-update) (defun org-agenda-refile (&optional goto rfloc no-update)
@ -9675,7 +9675,7 @@ It also looks at the text of the entry itself."
(let* ((marker (or (org-get-at-bol 'org-hd-marker) (let* ((marker (or (org-get-at-bol 'org-hd-marker)
(org-get-at-bol 'org-marker))) (org-get-at-bol 'org-marker)))
(buffer (and marker (marker-buffer marker))) (buffer (and marker (marker-buffer marker)))
(prefix (buffer-substring (point-at-bol) (point-at-eol))) (prefix (buffer-substring (line-beginning-position) (line-end-position)))
(lkall (and buffer (org-offer-links-in-entry (lkall (and buffer (org-offer-links-in-entry
buffer marker arg prefix))) buffer marker arg prefix)))
(lk0 (car lkall)) (lk0 (car lkall))
@ -9808,7 +9808,7 @@ if it was hidden in the outline."
(let ((win (selected-window))) (let ((win (selected-window)))
(org-agenda-goto t) (org-agenda-goto t)
(org-back-to-heading) (org-back-to-heading)
(set-window-start (selected-window) (point-at-bol)) (set-window-start (selected-window) (line-beginning-position))
(cond (cond
((= more 0) ((= more 0)
(org-fold-subtree t) (org-fold-subtree t)
@ -10009,7 +10009,7 @@ the same tree node, and the headline of the tree node in the Org file."
(org-add-note)))) (org-add-note))))
(defun org-agenda-change-all-lines (newhead hdmarker (defun org-agenda-change-all-lines (newhead hdmarker
&optional fixface just-this) &optional fixface just-this)
"Change all lines in the agenda buffer which match HDMARKER. "Change all lines in the agenda buffer which match HDMARKER.
The new content of the line will be NEWHEAD (as modified by The new content of the line will be NEWHEAD (as modified by
`org-agenda-format-item'). HDMARKER is checked with `org-agenda-format-item'). HDMARKER is checked with
@ -10052,7 +10052,7 @@ If FORCE-TAGS is non-nil, the car of it returns the new tags."
'effort effort 'effort effort
'effort-minutes effort-minutes) 'effort-minutes effort-minutes)
level cat tags dotime)))) level cat tags dotime))))
;; pl (text-property-any (point-at-bol) (point-at-eol) 'org-heading t) ;; pl (text-property-any (line-beginning-position) (line-end-position) 'org-heading t)
undone-face (org-get-at-bol 'undone-face) undone-face (org-get-at-bol 'undone-face)
done-face (org-get-at-bol 'done-face)) done-face (org-get-at-bol 'done-face))
(beginning-of-line 1) (beginning-of-line 1)
@ -10069,10 +10069,10 @@ If FORCE-TAGS is non-nil, the car of it returns the new tags."
(replace-match new t t) (replace-match new t t)
(beginning-of-line) (beginning-of-line)
(when mark (move-overlay mark (point) (+ 2 (point))))) (when mark (move-overlay mark (point) (+ 2 (point)))))
(add-text-properties (point-at-bol) (point-at-eol) props) (add-text-properties (line-beginning-position) (line-end-position) props)
(when fixface (when fixface
(add-text-properties (add-text-properties
(point-at-bol) (point-at-eol) (line-beginning-position) (line-end-position)
(list 'face (list 'face
(if org-last-todo-state-is-todo (if org-last-todo-state-is-todo
undone-face done-face)))) undone-face done-face))))
@ -10080,7 +10080,7 @@ If FORCE-TAGS is non-nil, the car of it returns the new tags."
(beginning-of-line 1)) (beginning-of-line 1))
(t (error "Line update did not work"))) (t (error "Line update did not work")))
(save-restriction (save-restriction
(narrow-to-region (point-at-bol) (point-at-eol)) (narrow-to-region (line-beginning-position) (line-end-position))
(org-agenda-finalize))) (org-agenda-finalize)))
(beginning-of-line 0))))) (beginning-of-line 0)))))
@ -10312,7 +10312,7 @@ When called programmatically, FORCE-DIRECTION can be `set', `up',
(setq arg (- today cdate)))) (setq arg (- today cdate))))
(org-timestamp-change arg (or what 'day)) (org-timestamp-change arg (or what 'day))
(when (and (org-at-date-range-p) (when (and (org-at-date-range-p)
(re-search-backward org-tr-regexp-both (point-at-bol))) (re-search-backward org-tr-regexp-both (line-beginning-position)))
(let ((end org-last-changed-timestamp)) (let ((end org-last-changed-timestamp))
(org-timestamp-change arg (or what 'day)) (org-timestamp-change arg (or what 'day))
(setq org-last-changed-timestamp (setq org-last-changed-timestamp
@ -10364,7 +10364,7 @@ When called programmatically, FORCE-DIRECTION can be `set', `up',
(length stamp)) (length stamp))
t) t)
(add-text-properties (add-text-properties
(1- (point)) (point-at-eol) (1- (point)) (line-end-position)
(list 'display (org-add-props stamp nil (list 'display (org-add-props stamp nil
'face '(secondary-selection default)))) 'face '(secondary-selection default))))
(beginning-of-line 1)) (beginning-of-line 1))
@ -10508,13 +10508,13 @@ buffer, display it in another window."
(if (equal (buffer-name) "*Calendar*") (if (equal (buffer-name) "*Calendar*")
(setq d1 (calendar-cursor-to-date t) (setq d1 (calendar-cursor-to-date t)
d2 (car calendar-mark-ring)) d2 (car calendar-mark-ring))
(setq dp1 (get-text-property (point-at-bol) 'day)) (setq dp1 (get-text-property (line-beginning-position) 'day))
(unless dp1 (user-error "No date defined in current line")) (unless dp1 (user-error "No date defined in current line"))
(setq d1 (calendar-gregorian-from-absolute dp1) (setq d1 (calendar-gregorian-from-absolute dp1)
d2 (and (ignore-errors (mark)) d2 (and (ignore-errors (mark))
(save-excursion (save-excursion
(goto-char (mark)) (goto-char (mark))
(setq dp2 (get-text-property (point-at-bol) 'day))) (setq dp2 (get-text-property (line-beginning-position) 'day)))
(calendar-gregorian-from-absolute dp2)))) (calendar-gregorian-from-absolute dp2))))
(message "Diary entry: [d]ay [a]nniversary [b]lock [j]ump to date tree") (message "Diary entry: [d]ay [a]nniversary [b]lock [j]ump to date tree")
(setq char (read-char-exclusive)) (setq char (read-char-exclusive))
@ -10837,7 +10837,7 @@ This is a command that has to be installed in `calendar-mode-map'."
(defun org-agenda-bulk-marked-p () (defun org-agenda-bulk-marked-p ()
"Non-nil when current entry is marked for bulk action." "Non-nil when current entry is marked for bulk action."
(eq (get-char-property (point-at-bol) 'type) (eq (get-char-property (line-beginning-position) 'type)
'org-marked-entry-overlay)) 'org-marked-entry-overlay))
(defun org-agenda-bulk-mark (&optional arg) (defun org-agenda-bulk-mark (&optional arg)
@ -10862,7 +10862,7 @@ When ARG is greater than one mark ARG lines."
(unless (org-agenda-bulk-marked-p) (unless (org-agenda-bulk-marked-p)
(unless m (user-error "Nothing to mark at point")) (unless m (user-error "Nothing to mark at point"))
(push m org-agenda-bulk-marked-entries) (push m org-agenda-bulk-marked-entries)
(setq ov (make-overlay (point-at-bol) (+ 2 (point-at-bol)))) (setq ov (make-overlay (line-beginning-position) (+ 2 (line-beginning-position))))
(org-overlay-display ov (concat org-agenda-bulk-mark-char " ") (org-overlay-display ov (concat org-agenda-bulk-mark-char " ")
(org-get-todo-face "TODO") (org-get-todo-face "TODO")
'evaporate) 'evaporate)
@ -10906,7 +10906,7 @@ When ARG is greater than one mark ARG lines."
(org-agenda-bulk-unmark-all) (org-agenda-bulk-unmark-all)
(cond ((org-agenda-bulk-marked-p) (cond ((org-agenda-bulk-marked-p)
(org-agenda-bulk-remove-overlays (org-agenda-bulk-remove-overlays
(point-at-bol) (+ 2 (point-at-bol))) (line-beginning-position) (+ 2 (line-beginning-position)))
(setq org-agenda-bulk-marked-entries (setq org-agenda-bulk-marked-entries
(delete (org-get-at-bol 'org-hd-marker) (delete (org-get-at-bol 'org-hd-marker)
org-agenda-bulk-marked-entries)) org-agenda-bulk-marked-entries))
@ -11286,8 +11286,8 @@ tag and note")))))
(message "Entry unflagged"))) (message "Entry unflagged")))
(defun org-agenda-get-any-marker (&optional pos) (defun org-agenda-get-any-marker (&optional pos)
(or (get-text-property (or pos (point-at-bol)) 'org-hd-marker) (or (get-text-property (or pos (line-beginning-position)) 'org-hd-marker)
(get-text-property (or pos (point-at-bol)) 'org-marker))) (get-text-property (or pos (line-beginning-position)) 'org-marker)))
;;; Appointment reminders ;;; Appointment reminders

View File

@ -1458,7 +1458,7 @@ Of course, if exact position has been required, just put it there."
(if (org-at-table-p) (if (org-at-table-p)
(save-excursion (save-excursion
(org-table-goto-line (nth 1 where)) (org-table-goto-line (nth 1 where))
(point-at-bol)) (line-beginning-position))
(point)))))) (point))))))
(with-current-buffer (buffer-base-buffer (current-buffer)) (with-current-buffer (buffer-base-buffer (current-buffer))
(org-with-point-at pos (org-with-point-at pos

View File

@ -1325,7 +1325,7 @@ the default behavior."
;; Clock in at which position? ;; Clock in at which position?
(setq target-pos (setq target-pos
(if (and (eobp) (not (org-at-heading-p))) (if (and (eobp) (not (org-at-heading-p)))
(org-with-wide-buffer (point-at-bol 0)) (org-with-wide-buffer (line-beginning-position 0))
(point))) (point)))
(save-excursion (save-excursion
(when (and selected-task (marker-buffer selected-task)) (when (and selected-task (marker-buffer selected-task))
@ -1349,8 +1349,8 @@ the default behavior."
(when newstate (org-todo newstate)))) (when newstate (org-todo newstate))))
((and org-clock-in-switch-to-state ((and org-clock-in-switch-to-state
(not (looking-at (concat org-outline-regexp "[ \t]*" (not (looking-at (concat org-outline-regexp "[ \t]*"
org-clock-in-switch-to-state org-clock-in-switch-to-state
"\\>")))) "\\>"))))
(org-todo org-clock-in-switch-to-state))) (org-todo org-clock-in-switch-to-state)))
(setq org-clock-heading (org-clock--mode-line-heading)) (setq org-clock-heading (org-clock--mode-line-heading))
(org-clock-find-position org-clock-in-resume) (org-clock-find-position org-clock-in-resume)
@ -1679,7 +1679,7 @@ to, overriding the existing value of `org-clock-out-switch-to-state'."
(setq ts (match-string 2)) (setq ts (match-string 2))
(if fail-quietly (throw 'exit nil) (error "Clock start time is gone"))) (if fail-quietly (throw 'exit nil) (error "Clock start time is gone")))
(goto-char (match-end 0)) (goto-char (match-end 0))
(delete-region (point) (point-at-eol)) (delete-region (point) (line-end-position))
(org-fold-core-ignore-modifications (org-fold-core-ignore-modifications
(insert-and-inherit "--") (insert-and-inherit "--")
(setq te (org-insert-time-stamp (or at-time now) 'with-hm 'inactive)) (setq te (org-insert-time-stamp (or at-time now) 'with-hm 'inactive))
@ -1820,7 +1820,7 @@ Optional argument N tells to change by that many units."
(goto-char org-clock-marker) (goto-char org-clock-marker)
(if (looking-back (concat "^[ \t]*" org-clock-string ".*") (if (looking-back (concat "^[ \t]*" org-clock-string ".*")
(line-beginning-position)) (line-beginning-position))
(progn (delete-region (1- (point-at-bol)) (point-at-eol)) (progn (delete-region (1- (line-beginning-position)) (line-end-position))
(org-remove-empty-drawer-at (point))) (org-remove-empty-drawer-at (point)))
(message "Clock gone, cancel the timer anyway") (message "Clock gone, cancel the timer anyway")
(sit-for 2))) (sit-for 2)))
@ -1959,7 +1959,7 @@ PROPNAME lets you set a custom text property instead of :org-clock-minutes."
(aset ltimes l (+ (aref ltimes l) t1)))) (aset ltimes l (+ (aref ltimes l) t1))))
(setq time (aref ltimes level)) (setq time (aref ltimes level))
(goto-char (match-beginning 0)) (goto-char (match-beginning 0))
(put-text-property (point) (point-at-eol) (put-text-property (point) (line-end-position)
(or propname :org-clock-minutes) time) (or propname :org-clock-minutes) time)
(when headline-filter (when headline-filter
(save-excursion (save-excursion
@ -2127,7 +2127,7 @@ fontified, and then returned."
(forward-line 2) (forward-line 2)
(buffer-substring (point) (progn (buffer-substring (point) (progn
(re-search-forward "^[ \t]*#\\+END" nil t) (re-search-forward "^[ \t]*#\\+END" nil t)
(point-at-bol))))) (line-beginning-position)))))
;;;###autoload ;;;###autoload
(defun org-clock-report (&optional arg) (defun org-clock-report (&optional arg)
@ -2403,7 +2403,7 @@ the currently selected interval size."
(setq n (prefix-numeric-value n)) (setq n (prefix-numeric-value n))
(and (memq dir '(left down)) (setq n (- n))) (and (memq dir '(left down)) (setq n (- n)))
(save-excursion (save-excursion
(goto-char (point-at-bol)) (goto-char (line-beginning-position))
(if (not (looking-at "^[ \t]*#\\+BEGIN:[ \t]+clocktable\\>.*?:block[ \t]+\\(\\S-+\\)")) (if (not (looking-at "^[ \t]*#\\+BEGIN:[ \t]+clocktable\\>.*?:block[ \t]+\\(\\S-+\\)"))
(user-error "Line needs a :block definition before this command works") (user-error "Line needs a :block definition before this command works")
(let* ((b (match-beginning 1)) (e (match-end 1)) (let* ((b (match-beginning 1)) (e (match-end 1))
@ -3057,7 +3057,7 @@ Otherwise, return nil."
((not (match-end 2)) ((not (match-end 2))
(when (and (equal (marker-buffer org-clock-marker) (current-buffer)) (when (and (equal (marker-buffer org-clock-marker) (current-buffer))
(> org-clock-marker (point)) (> org-clock-marker (point))
(<= org-clock-marker (point-at-eol))) (<= org-clock-marker (line-end-position)))
;; The clock is running here ;; The clock is running here
(setq org-clock-start-time (setq org-clock-start-time
(org-time-string-to-time (match-string 1))) (org-time-string-to-time (match-string 1)))

View File

@ -1222,7 +1222,7 @@ To get rid of the restriction, use `\\[org-agenda-remove-restriction-lock]'."
(require 'org-agenda) (require 'org-agenda)
(let (p m tp np dir txt) (let (p m tp np dir txt)
(cond (cond
((setq p (text-property-any (point-at-bol) (point-at-eol) ((setq p (text-property-any (line-beginning-position) (line-end-position)
'org-imenu t)) 'org-imenu t))
(setq m (get-text-property p 'org-imenu-marker)) (setq m (get-text-property p 'org-imenu-marker))
(with-current-buffer (marker-buffer m) (with-current-buffer (marker-buffer m)
@ -1232,7 +1232,7 @@ To get rid of the restriction, use `\\[org-agenda-remove-restriction-lock]'."
(overlays-at (point)))) (overlays-at (point))))
(org-agenda-remove-restriction-lock 'noupdate) (org-agenda-remove-restriction-lock 'noupdate)
(org-agenda-set-restriction-lock 'subtree)))) (org-agenda-set-restriction-lock 'subtree))))
((setq p (text-property-any (point-at-bol) (point-at-eol) ((setq p (text-property-any (line-beginning-position) (line-end-position)
'speedbar-function 'speedbar-find-file)) 'speedbar-function 'speedbar-find-file))
(setq tp (previous-single-property-change (setq tp (previous-single-property-change
(1+ p) 'speedbar-function) (1+ p) 'speedbar-function)
@ -1249,7 +1249,7 @@ To get rid of the restriction, use `\\[org-agenda-remove-restriction-lock]'."
(org-agenda-set-restriction-lock 'file))) (org-agenda-set-restriction-lock 'file)))
(t (user-error "Don't know how to restrict Org mode agenda"))) (t (user-error "Don't know how to restrict Org mode agenda")))
(move-overlay org-speedbar-restriction-lock-overlay (move-overlay org-speedbar-restriction-lock-overlay
(point-at-bol) (point-at-eol)) (line-beginning-position) (line-end-position))
(setq current-prefix-arg nil) (setq current-prefix-arg nil)
(org-agenda-maybe-redo))) (org-agenda-maybe-redo)))

View File

@ -412,7 +412,7 @@ Use `\\[org-edit-special]' to edit table.el tables"))
(and (memq org-cycle-emulate-tab '(white whitestart)) (and (memq org-cycle-emulate-tab '(white whitestart))
(save-excursion (beginning-of-line 1) (looking-at "[ \t]*")) (save-excursion (beginning-of-line 1) (looking-at "[ \t]*"))
(or (and (eq org-cycle-emulate-tab 'white) (or (and (eq org-cycle-emulate-tab 'white)
(= (match-end 0) (point-at-eol))) (= (match-end 0) (line-end-position)))
(and (eq org-cycle-emulate-tab 'whitestart) (and (eq org-cycle-emulate-tab 'whitestart)
(>= (match-end 0) pos))))) (>= (match-end 0) pos)))))
(call-interactively (global-key-binding (kbd "TAB")))) (call-interactively (global-key-binding (kbd "TAB"))))
@ -471,7 +471,7 @@ Use `\\[org-edit-special]' to edit table.el tables"))
(progn (progn
(beginning-of-line) (beginning-of-line)
(setq struct (org-list-struct)) (setq struct (org-list-struct))
(setq eoh (point-at-eol)) (setq eoh (line-end-position))
(setq eos (org-list-get-item-end-before-blank (point) struct)) (setq eos (org-list-get-item-end-before-blank (point) struct))
(setq has-children (org-list-has-child-p (point) struct))) (setq has-children (org-list-has-child-p (point) struct)))
(org-back-to-heading) (org-back-to-heading)
@ -525,7 +525,7 @@ Use `\\[org-edit-special]' to edit table.el tables"))
(org-with-limited-levels (org-with-limited-levels
(run-hook-with-args 'org-cycle-pre-hook 'children))) (run-hook-with-args 'org-cycle-pre-hook 'children)))
(if (org-at-item-p) (if (org-at-item-p)
(org-list-set-item-visibility (point-at-bol) struct 'children) (org-list-set-item-visibility (line-beginning-position) struct 'children)
(org-fold-show-entry) (org-fold-show-entry)
(org-with-limited-levels (org-fold-show-children)) (org-with-limited-levels (org-fold-show-children))
(org-fold-show-set-visibility 'tree) (org-fold-show-set-visibility 'tree)

View File

@ -2414,7 +2414,7 @@ CDR is a plist containing `:key', `:value', `:begin', `:end',
(key (progn (looking-at "[ \t]*#\\+\\(\\S-*\\):") (key (progn (looking-at "[ \t]*#\\+\\(\\S-*\\):")
(upcase (match-string-no-properties 1)))) (upcase (match-string-no-properties 1))))
(value (org-trim (buffer-substring-no-properties (value (org-trim (buffer-substring-no-properties
(match-end 0) (point-at-eol)))) (match-end 0) (line-end-position))))
(pos-before-blank (progn (forward-line) (point))) (pos-before-blank (progn (forward-line) (point)))
(end (progn (skip-chars-forward " \r\t\n" limit) (end (progn (skip-chars-forward " \r\t\n" limit)
(if (eobp) (point) (line-beginning-position))))) (if (eobp) (point) (line-beginning-position)))))
@ -4496,7 +4496,7 @@ This function assumes that current major mode is `org-mode'."
(gc-cons-threshold #x40000000)) (gc-cons-threshold #x40000000))
(org-skip-whitespace) (org-skip-whitespace)
(org-element--parse-elements (org-element--parse-elements
(point-at-bol) (point-max) (line-beginning-position) (point-max)
;; Start in `first-section' mode so text before the first ;; Start in `first-section' mode so text before the first
;; headline belongs to a section. ;; headline belongs to a section.
'first-section nil granularity visible-only org-data)))) 'first-section nil granularity visible-only org-data))))
@ -8030,12 +8030,12 @@ end of ELEM-A."
(end-A (save-excursion (end-A (save-excursion
(goto-char (org-element-property :end elem-A)) (goto-char (org-element-property :end elem-A))
(skip-chars-backward " \r\t\n") (skip-chars-backward " \r\t\n")
(point-at-eol))) (line-end-position)))
(beg-B (org-element-property :begin elem-B)) (beg-B (org-element-property :begin elem-B))
(end-B (save-excursion (end-B (save-excursion
(goto-char (org-element-property :end elem-B)) (goto-char (org-element-property :end elem-B))
(skip-chars-backward " \r\t\n") (skip-chars-backward " \r\t\n")
(point-at-eol))) (line-end-position)))
;; Store inner folds responsible for visibility status. ;; Store inner folds responsible for visibility status.
(folds (folds
(cons (cons

View File

@ -428,7 +428,7 @@ current time."
(buffer-invisibility-spec '(org-link)) (buffer-invisibility-spec '(org-link))
(moment (time-subtract nil (* 3600 org-extend-today-until)))) (moment (time-subtract nil (* 3600 org-extend-today-until))))
(save-excursion (save-excursion
(goto-char (if line (point-at-bol) (point-min))) (goto-char (if line (line-beginning-position) (point-min)))
(while (not (eobp)) (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))) (invisible-prop (get-text-property (point) 'invisible)))

View File

@ -241,7 +241,7 @@ going below `org-inlinetask-min-level'."
(setq beg (point)) (setq beg (point))
(replace-match down-task nil t nil 1) (replace-match down-task nil t nil 1)
(org-inlinetask-goto-end) (org-inlinetask-goto-end)
(if (and (eobp) (looking-back "END\\s-*" (point-at-bol))) (if (and (eobp) (looking-back "END\\s-*" (line-beginning-position)))
(beginning-of-line) (beginning-of-line)
(forward-line -1)) (forward-line -1))
(unless (= (point) beg) (unless (= (point) beg)
@ -267,7 +267,7 @@ If the task has an end part, also demote it."
(setq beg (point)) (setq beg (point))
(replace-match down-task nil t nil 1) (replace-match down-task nil t nil 1)
(org-inlinetask-goto-end) (org-inlinetask-goto-end)
(if (and (eobp) (looking-back "END\\s-*" (point-at-bol))) (if (and (eobp) (looking-back "END\\s-*" (line-beginning-position)))
(beginning-of-line) (beginning-of-line)
(forward-line -1)) (forward-line -1))
(unless (= (point) beg) (unless (= (point) beg)
@ -317,7 +317,7 @@ When STATE is `unfold', unfold unconditionally."
(if (bolp) (1- (point)) (point)))) (if (bolp) (1- (point)) (point))))
(start (save-excursion (start (save-excursion
(org-inlinetask-goto-beginning) (org-inlinetask-goto-beginning)
(point-at-eol)))) (line-end-position))))
(cond (cond
;; Nothing to show/hide. ;; Nothing to show/hide.
((= end start)) ((= end start))

View File

@ -522,7 +522,7 @@ Contexts `block' and `invalid' refer to `org-list-forbidden-blocks'."
(and (not (looking-at beg-re)) (and (not (looking-at beg-re))
(not (looking-at end-re)) (not (looking-at end-re))
(setq beg (and (re-search-backward beg-re lim-up t) (setq beg (and (re-search-backward beg-re lim-up t)
(1+ (point-at-eol)))) (1+ (line-end-position))))
(setq end (or (and (re-search-forward end-re lim-down t) (setq end (or (and (re-search-forward end-re lim-down t)
(1- (match-beginning 0))) (1- (match-beginning 0)))
lim-down)) lim-down))
@ -533,12 +533,12 @@ Contexts `block' and `invalid' refer to `org-list-forbidden-blocks'."
(when (save-excursion (when (save-excursion
(and (not (looking-at block-re)) (and (not (looking-at block-re))
(setq beg (and (re-search-backward block-re lim-up t) (setq beg (and (re-search-backward block-re lim-up t)
(1+ (point-at-eol)))) (1+ (line-end-position))))
(looking-at "^[ \t]*#\\+begin_\\(\\S-+\\)") (looking-at "^[ \t]*#\\+begin_\\(\\S-+\\)")
(setq type (downcase (match-string 1))) (setq type (downcase (match-string 1)))
(goto-char beg) (goto-char beg)
(setq end (or (and (re-search-forward block-re lim-down t) (setq end (or (and (re-search-forward block-re lim-down t)
(1- (point-at-bol))) (1- (line-beginning-position)))
lim-down)) lim-down))
(>= end pos) (>= end pos)
(equal (downcase (match-string 1)) "end"))) (equal (downcase (match-string 1)) "end")))
@ -552,7 +552,7 @@ Contexts `block' and `invalid' refer to `org-list-forbidden-blocks'."
(end-re (concat beg-re "END[ \t]*$"))) (end-re (concat beg-re "END[ \t]*$")))
(and (not (looking-at "^\\*+")) (and (not (looking-at "^\\*+"))
(setq beg (and (re-search-backward beg-re lim-up t) (setq beg (and (re-search-backward beg-re lim-up t)
(1+ (point-at-eol)))) (1+ (line-end-position))))
(not (looking-at end-re)) (not (looking-at end-re))
(setq end (and (re-search-forward end-re lim-down t) (setq end (and (re-search-forward end-re lim-down t)
(1- (match-beginning 0)))) (1- (match-beginning 0))))
@ -574,7 +574,7 @@ values are:
6. position at item end. 6. position at item end.
Thus the following list, where numbers in parens are Thus the following list, where numbers in parens are
point-at-bol: line-beginning-position:
- [X] first item (1) - [X] first item (1)
1. sub-item 1 (18) 1. sub-item 1 (18)
@ -622,7 +622,7 @@ Assume point is at an item."
;; Ensure list ends at the first blank line. ;; Ensure list ends at the first blank line.
(lambda () (lambda ()
(skip-chars-backward " \r\t\n") (skip-chars-backward " \r\t\n")
(min (1+ (point-at-eol)) lim-down)))) (min (1+ (line-end-position)) lim-down))))
;; 1. Read list from starting item to its beginning, and save ;; 1. Read list from starting item to its beginning, and save
;; top item position and indentation in BEG-CELL. Also store ;; top item position and indentation in BEG-CELL. Also store
;; ending position of items in END-LST. ;; ending position of items in END-LST.
@ -877,7 +877,7 @@ Point returned is at end of line."
(save-excursion (save-excursion
(goto-char (org-list-get-item-end item struct)) (goto-char (org-list-get-item-end item struct))
(skip-chars-backward " \r\t\n") (skip-chars-backward " \r\t\n")
(point-at-eol))) (line-end-position)))
(defun org-list-get-parent (item struct parents) (defun org-list-get-parent (item struct parents)
"Return parent of ITEM or nil. "Return parent of ITEM or nil.
@ -1172,7 +1172,7 @@ some heuristics to guess the result."
(lambda () (lambda ()
;; Count blank lines above beginning of line. ;; Count blank lines above beginning of line.
(save-excursion (save-excursion
(count-lines (goto-char (point-at-bol)) (count-lines (goto-char (line-beginning-position))
(progn (skip-chars-backward " \r\t\n") (progn (skip-chars-backward " \r\t\n")
(forward-line) (forward-line)
(point))))))) (point)))))))
@ -1277,7 +1277,7 @@ This function modifies STRUCT."
;; must be removed, or they will be left, stacking up ;; must be removed, or they will be left, stacking up
;; after the list. ;; after the list.
(when (< item-end pos) (when (< item-end pos)
(delete-region (1- item-end) (point-at-eol))) (delete-region (1- item-end) (line-end-position)))
(skip-chars-backward " \r\t\n") (skip-chars-backward " \r\t\n")
;; Cut position is after any blank on the line. ;; Cut position is after any blank on the line.
(save-excursion (save-excursion
@ -1354,7 +1354,7 @@ STRUCT is the list structure."
(save-excursion (save-excursion
(goto-char item) (goto-char item)
(skip-chars-backward " \r\t\n") (skip-chars-backward " \r\t\n")
(min (1+ (point-at-eol)) (point-max))) (min (1+ (line-end-position)) (point-max)))
item))) item)))
;; Remove item from buffer. ;; Remove item from buffer.
(delete-region beg end) (delete-region beg end)
@ -1431,7 +1431,7 @@ This function returns, destructively, the new list structure."
(setq dest (org-list-get-list-end item struct prevs)) (setq dest (org-list-get-list-end item struct prevs))
(save-excursion (save-excursion
(goto-char (org-list-get-last-item item struct prevs)) (goto-char (org-list-get-last-item item struct prevs))
(point-at-eol))) (line-end-position)))
((and (stringp dest) (string-match-p "\\`[0-9]+\\'" dest)) ((and (stringp dest) (string-match-p "\\`[0-9]+\\'" dest))
(let* ((all (org-list-get-all-items item struct prevs)) (let* ((all (org-list-get-all-items item struct prevs))
(len (length all)) (len (length all))
@ -1443,7 +1443,7 @@ This function returns, destructively, the new list structure."
(save-excursion (save-excursion
(goto-char (goto-char
(org-list-get-last-item item struct prevs)) (org-list-get-last-item item struct prevs))
(point-at-eol))))) (line-end-position)))))
(t dest))) (t dest)))
(org-M-RET-may-split-line nil) (org-M-RET-may-split-line nil)
;; Store inner overlays (to preserve visibility). ;; Store inner overlays (to preserve visibility).
@ -1885,7 +1885,7 @@ Initial position of cursor is restored after the changes."
(insert (concat new-box (unless counterp " ")))))) (insert (concat new-box (unless counterp " "))))))
;; c. Indent item to appropriate column. ;; c. Indent item to appropriate column.
(unless (= new-ind old-ind) (unless (= new-ind old-ind)
(delete-region (goto-char (point-at-bol)) (delete-region (goto-char (line-beginning-position))
(progn (skip-chars-forward " \t") (point))) (progn (skip-chars-forward " \t") (point)))
(indent-to new-ind)))))) (indent-to new-ind))))))
;; 1. First get list of items and position endings. We maintain ;; 1. First get list of items and position endings. We maintain
@ -2015,7 +2015,7 @@ Sublists of the list are skipped. Cursor is always at the
beginning of the item." beginning of the item."
(let* ((struct (org-list-struct)) (let* ((struct (org-list-struct))
(prevs (org-list-prevs-alist struct)) (prevs (org-list-prevs-alist struct))
(item (copy-marker (point-at-bol))) (item (copy-marker (line-beginning-position)))
(all (org-list-get-all-items (marker-position item) struct prevs)) (all (org-list-get-all-items (marker-position item) struct prevs))
(value init-value)) (value init-value))
(dolist (e (nreverse all)) (dolist (e (nreverse all))
@ -2152,10 +2152,10 @@ the item, so this really moves item trees."
(interactive) (interactive)
(unless (org-at-item-p) (error "Not at an item")) (unless (org-at-item-p) (error "Not at an item"))
(let* ((col (current-column)) (let* ((col (current-column))
(item (point-at-bol)) (item (line-beginning-position))
(struct (org-list-struct)) (struct (org-list-struct))
(prevs (org-list-prevs-alist struct)) (prevs (org-list-prevs-alist struct))
(next-item (org-list-get-next-item (point-at-bol) struct prevs))) (next-item (org-list-get-next-item (line-beginning-position) struct prevs)))
(unless (or next-item org-list-use-circular-motion) (unless (or next-item org-list-use-circular-motion)
(user-error "Cannot move this item further down")) (user-error "Cannot move this item further down"))
(if (not next-item) (if (not next-item)
@ -2173,10 +2173,10 @@ the item, so this really moves item trees."
(interactive) (interactive)
(unless (org-at-item-p) (error "Not at an item")) (unless (org-at-item-p) (error "Not at an item"))
(let* ((col (current-column)) (let* ((col (current-column))
(item (point-at-bol)) (item (line-beginning-position))
(struct (org-list-struct)) (struct (org-list-struct))
(prevs (org-list-prevs-alist struct)) (prevs (org-list-prevs-alist struct))
(prev-item (org-list-get-prev-item (point-at-bol) struct prevs))) (prev-item (org-list-get-prev-item (line-beginning-position) struct prevs)))
(unless (or prev-item org-list-use-circular-motion) (unless (or prev-item org-list-use-circular-motion)
(user-error "Cannot move this item further up")) (user-error "Cannot move this item further up"))
(if (not prev-item) (if (not prev-item)
@ -2342,7 +2342,7 @@ is an integer, 0 means `-', 1 means `+' etc. If WHICH is
(old-struct (copy-tree struct)) (old-struct (copy-tree struct))
(cbox (org-list-get-checkbox cpos struct)) (cbox (org-list-get-checkbox cpos struct))
(prevs (org-list-prevs-alist struct)) (prevs (org-list-prevs-alist struct))
(start (org-list-get-list-begin (point-at-bol) struct prevs)) (start (org-list-get-list-begin (line-beginning-position) struct prevs))
(new (unless (and cbox (equal arg '(4)) (equal start cpos)) (new (unless (and cbox (equal arg '(4)) (equal start cpos))
"[ ]"))) "[ ]")))
(dolist (pos (org-list-get-all-items (dolist (pos (org-list-get-all-items
@ -2402,7 +2402,7 @@ subtree, ignoring planning line and any drawer following it."
(let ((limit (region-end))) (let ((limit (region-end)))
(goto-char (region-beginning)) (goto-char (region-beginning))
(if (org-list-search-forward (org-item-beginning-re) limit t) (if (org-list-search-forward (org-item-beginning-re) limit t)
(setq lim-up (point-at-bol)) (setq lim-up (line-beginning-position))
(error "No item in region")) (error "No item in region"))
(setq lim-down (copy-marker limit)))) (setq lim-down (copy-marker limit))))
((org-at-heading-p) ((org-at-heading-p)
@ -2411,14 +2411,14 @@ subtree, ignoring planning line and any drawer following it."
(let ((limit (save-excursion (outline-next-heading) (point)))) (let ((limit (save-excursion (outline-next-heading) (point))))
(org-end-of-meta-data t) (org-end-of-meta-data t)
(if (org-list-search-forward (org-item-beginning-re) limit t) (if (org-list-search-forward (org-item-beginning-re) limit t)
(setq lim-up (point-at-bol)) (setq lim-up (line-beginning-position))
(error "No item in subtree")) (error "No item in subtree"))
(setq lim-down (copy-marker limit)))) (setq lim-down (copy-marker limit))))
;; Just one item: set SINGLEP flag. ;; Just one item: set SINGLEP flag.
((org-at-item-p) ((org-at-item-p)
(setq singlep t) (setq singlep t)
(setq lim-up (point-at-bol) (setq lim-up (line-beginning-position)
lim-down (copy-marker (point-at-eol)))) lim-down (copy-marker (line-end-position))))
(t (error "Not at an item or heading, and no active region")))) (t (error "Not at an item or heading, and no active region"))))
;; Determine the checkbox going to be applied to all items ;; Determine the checkbox going to be applied to all items
;; within bounds. ;; within bounds.
@ -2666,7 +2666,7 @@ Return t if successful."
;; Are we going to move the whole list? ;; Are we going to move the whole list?
(specialp (specialp
(and (not regionp) (and (not regionp)
(= top (point-at-bol)) (= top (line-beginning-position))
(cdr (assq 'indent org-list-automatic-rules)) (cdr (assq 'indent org-list-automatic-rules))
(if no-subtree (if no-subtree
(user-error (user-error
@ -2680,12 +2680,12 @@ Return t if successful."
(progn (progn
(set-marker org-last-indent-begin-marker rbeg) (set-marker org-last-indent-begin-marker rbeg)
(set-marker org-last-indent-end-marker rend)) (set-marker org-last-indent-end-marker rend))
(set-marker org-last-indent-begin-marker (point-at-bol)) (set-marker org-last-indent-begin-marker (line-beginning-position))
(set-marker org-last-indent-end-marker (set-marker org-last-indent-end-marker
(cond (cond
(specialp (org-list-get-bottom-point struct)) (specialp (org-list-get-bottom-point struct))
(no-subtree (1+ (point-at-bol))) (no-subtree (1+ (line-beginning-position)))
(t (org-list-get-item-end (point-at-bol) struct)))))) (t (org-list-get-item-end (line-beginning-position) struct))))))
(let* ((beg (marker-position org-last-indent-begin-marker)) (let* ((beg (marker-position org-last-indent-begin-marker))
(end (marker-position org-last-indent-end-marker))) (end (marker-position org-last-indent-end-marker)))
(cond (cond
@ -2923,8 +2923,8 @@ function is being called interactively."
(let* ((case-func (if with-case 'identity 'downcase)) (let* ((case-func (if with-case 'identity 'downcase))
(struct (org-list-struct)) (struct (org-list-struct))
(prevs (org-list-prevs-alist struct)) (prevs (org-list-prevs-alist struct))
(start (org-list-get-list-begin (point-at-bol) struct prevs)) (start (org-list-get-list-begin (line-beginning-position) struct prevs))
(end (org-list-get-list-end (point-at-bol) struct prevs)) (end (org-list-get-list-end (line-beginning-position) struct prevs))
(sorting-type (sorting-type
(or sorting-type (or sorting-type
(progn (progn
@ -2969,21 +2969,21 @@ function is being called interactively."
((= dcst ?n) ((= dcst ?n)
(string-to-number (string-to-number
(org-sort-remove-invisible (org-sort-remove-invisible
(buffer-substring (match-end 0) (point-at-eol))))) (buffer-substring (match-end 0) (line-end-position)))))
((= dcst ?a) ((= dcst ?a)
(funcall case-func (funcall case-func
(org-sort-remove-invisible (org-sort-remove-invisible
(buffer-substring (buffer-substring
(match-end 0) (point-at-eol))))) (match-end 0) (line-end-position)))))
((= dcst ?t) ((= dcst ?t)
(cond (cond
;; If it is a timer list, convert timer to seconds ;; If it is a timer list, convert timer to seconds
((org-at-item-timer-p) ((org-at-item-timer-p)
(org-timer-hms-to-secs (match-string 1))) (org-timer-hms-to-secs (match-string 1)))
((or (save-excursion ((or (save-excursion
(re-search-forward org-ts-regexp (point-at-eol) t)) (re-search-forward org-ts-regexp (line-end-position) t))
(save-excursion (re-search-forward org-ts-regexp-both (save-excursion (re-search-forward org-ts-regexp-both
(point-at-eol) t))) (line-end-position) t)))
(org-time-string-to-seconds (match-string 0))) (org-time-string-to-seconds (match-string 0)))
(t (float-time now)))) (t (float-time now))))
((= dcst ?x) (or (and (stringp (match-string 1)) ((= dcst ?x) (or (and (stringp (match-string 1))
@ -3056,14 +3056,14 @@ With a prefix argument ARG, change the region in a single item."
(save-excursion (save-excursion
(goto-char pos) (goto-char pos)
(skip-chars-forward " \r\t\n") (skip-chars-forward " \r\t\n")
(point-at-bol)))) (line-beginning-position))))
beg end) beg end)
;; Determine boundaries of changes. ;; Determine boundaries of changes.
(if (org-region-active-p) (if (org-region-active-p)
(setq beg (funcall skip-blanks (region-beginning)) (setq beg (funcall skip-blanks (region-beginning))
end (copy-marker (region-end))) end (copy-marker (region-end)))
(setq beg (point-at-bol) (setq beg (line-beginning-position)
end (copy-marker (point-at-eol)))) end (copy-marker (line-end-position))))
;; Depending on the starting line, choose an action on the text ;; Depending on the starting line, choose an action on the text
;; between BEG and END. ;; between BEG and END.
(org-with-limited-levels (org-with-limited-levels

View File

@ -1062,7 +1062,8 @@ Return width in pixels when PIXELS is non-nil."
current-char-property-alias-alist) current-char-property-alias-alist)
(let (pixel-width symbol-width) (let (pixel-width symbol-width)
(with-silent-modifications (with-silent-modifications
(setf (buffer-string) string) (erase-buffer)
(insert string)
(setq pixel-width (setq pixel-width
(if (get-buffer-window (current-buffer)) (if (get-buffer-window (current-buffer))
(car (window-text-pixel-size (car (window-text-pixel-size
@ -1071,7 +1072,8 @@ Return width in pixels when PIXELS is non-nil."
(car (window-text-pixel-size (car (window-text-pixel-size
nil (line-beginning-position) (point-max))))) nil (line-beginning-position) (point-max)))))
(unless pixels (unless pixels
(setf (buffer-string) "a") (erase-buffer)
(insert "a")
(setq symbol-width (setq symbol-width
(if (get-buffer-window (current-buffer)) (if (get-buffer-window (current-buffer))
(car (window-text-pixel-size (car (window-text-pixel-size
@ -1286,11 +1288,11 @@ the value in cadr."
(defsubst org-get-at-bol (property) (defsubst org-get-at-bol (property)
"Get text property PROPERTY at the beginning of line." "Get text property PROPERTY at the beginning of line."
(get-text-property (point-at-bol) property)) (get-text-property (line-beginning-position) property))
(defun org-get-at-eol (property n) (defun org-get-at-eol (property n)
"Get text property PROPERTY at the end of line less N characters." "Get text property PROPERTY at the end of line less N characters."
(get-text-property (- (point-at-eol) n) property)) (get-text-property (- (line-end-position) n) property))
(defun org-find-text-property-in-string (prop s) (defun org-find-text-property-in-string (prop s)
"Return the first non-nil value of property PROP in string S." "Return the first non-nil value of property PROP in string S."

View File

@ -620,7 +620,7 @@ The table of checksums is written to the file mobile-checksums."
((looking-at "[ \t]*$")) ; keep empty lines ((looking-at "[ \t]*$")) ; keep empty lines
((looking-at "=+$") ((looking-at "=+$")
;; remove underlining ;; remove underlining
(delete-region (point) (point-at-eol))) (delete-region (point) (line-end-position)))
((get-text-property (point) 'org-agenda-structural-header) ((get-text-property (point) 'org-agenda-structural-header)
(setq in-date nil) (setq in-date nil)
(setq app (get-text-property (point) 'org-agenda-title-append)) (setq app (get-text-property (point) 'org-agenda-title-append))
@ -640,14 +640,14 @@ The table of checksums is written to the file mobile-checksums."
(get-text-property (point) 'org-marker))) (get-text-property (point) 'org-marker)))
(setq sexp (member (get-text-property (point) 'type) (setq sexp (member (get-text-property (point) 'type)
'("diary" "sexp"))) '("diary" "sexp")))
(if (setq pl (text-property-any (point) (point-at-eol) 'org-heading t)) (if (setq pl (text-property-any (point) (line-end-position) 'org-heading t))
(progn (progn
(setq prefix (org-trim (buffer-substring (setq prefix (org-trim (buffer-substring
(point) pl)) (point) pl))
line (org-trim (buffer-substring line (org-trim (buffer-substring
pl pl
(point-at-eol)))) (line-end-position))))
(delete-region (point-at-bol) (point-at-eol)) (delete-region (line-beginning-position) (line-end-position))
(insert line "<before>" prefix "</before>") (insert line "<before>" prefix "</before>")
(beginning-of-line 1)) (beginning-of-line 1))
(and (looking-at "[ \t]+") (replace-match ""))) (and (looking-at "[ \t]+") (replace-match "")))
@ -860,7 +860,7 @@ If BEG and END are given, only do this in that region."
(org-mobile-timestamp-buffer (marker-buffer id-pos)) (org-mobile-timestamp-buffer (marker-buffer id-pos))
(push (marker-buffer id-pos) buf-list)) (push (marker-buffer id-pos) buf-list))
(unless (markerp id-pos) (unless (markerp id-pos)
(goto-char (+ 2 (point-at-bol))) (goto-char (+ 2 (line-beginning-position)))
(if (stringp id-pos) (if (stringp id-pos)
(insert id-pos " ") (insert id-pos " ")
(insert "BAD REFERENCE ")) (insert "BAD REFERENCE "))
@ -1096,7 +1096,7 @@ be returned that indicates what went wrong."
(org-archive-to-archive-sibling)) (org-archive-to-archive-sibling))
((eq what 'body) ((eq what 'body)
(setq current (buffer-substring (min (1+ (point-at-eol)) (point-max)) (setq current (buffer-substring (min (1+ (line-end-position)) (point-max))
(save-excursion (outline-next-heading) (save-excursion (outline-next-heading)
(point)))) (point))))
(if (not (string-match "\\S-" current)) (setq current nil)) (if (not (string-match "\\S-" current)) (setq current nil))

View File

@ -187,7 +187,7 @@ Changing this variable requires a restart of Emacs to get activated."
(defun org-mouse-re-search-line (regexp) (defun org-mouse-re-search-line (regexp)
"Search the current line for a given regular expression." "Search the current line for a given regular expression."
(beginning-of-line) (beginning-of-line)
(re-search-forward regexp (point-at-eol) t)) (re-search-forward regexp (line-end-position) t))
(defun org-mouse-end-headline () (defun org-mouse-end-headline ()
"Go to the end of current headline (ignoring tags)." "Go to the end of current headline (ignoring tags)."
@ -574,7 +574,7 @@ This means, between the beginning of line and the point."
(insert "+ ")) (insert "+ "))
(:end ; insert text here (:end ; insert text here
(skip-chars-backward " \t") (skip-chars-backward " \t")
(kill-region (point) (point-at-eol)) (kill-region (point) (line-end-position))
(unless (looking-back org-mouse-punctuation (line-beginning-position)) (unless (looking-back org-mouse-punctuation (line-beginning-position))
(insert (concat org-mouse-punctuation " "))))) (insert (concat org-mouse-punctuation " ")))))
(insert text) (insert text)
@ -989,7 +989,7 @@ This means, between the beginning of line and the point."
(defun org-mouse-do-remotely (command) (defun org-mouse-do-remotely (command)
;; (org-agenda-check-no-diary) ;; (org-agenda-check-no-diary)
(when (get-text-property (point) 'org-marker) (when (get-text-property (point) 'org-marker)
(let* ((anticol (- (point-at-eol) (point))) (let* ((anticol (- (line-end-position) (point)))
(marker (get-text-property (point) 'org-marker)) (marker (get-text-property (point) 'org-marker))
(buffer (marker-buffer marker)) (buffer (marker-buffer marker))
(pos (marker-position marker)) (pos (marker-position marker))
@ -1013,7 +1013,7 @@ This means, between the beginning of line and the point."
(org-fold-heading nil))) ; show the next heading (org-fold-heading nil))) ; show the next heading
(org-back-to-heading) (org-back-to-heading)
(setq marker (point-marker)) (setq marker (point-marker))
(goto-char (max (point-at-bol) (- (point-at-eol) anticol))) (goto-char (max (line-beginning-position) (- (line-end-position) anticol)))
(funcall command) (funcall command)
(message "_cmd: %S" org-mouse-cmd) (message "_cmd: %S" org-mouse-cmd)
(message "this-command: %S" this-command) (message "this-command: %S" this-command)

View File

@ -625,7 +625,7 @@ manner suitable for prepending to a user-specified script."
(dolist (img-overlay org-inline-image-overlays) (dolist (img-overlay org-inline-image-overlays)
(when (string= img-file (plist-get (cdr (overlay-get img-overlay 'display)) :file)) (when (string= img-file (plist-get (cdr (overlay-get img-overlay 'display)) :file))
(when (file-exists-p img-file) (when (file-exists-p img-file)
(image-refresh (overlay-get img-overlay 'display)))))) (image-flush (overlay-get img-overlay 'display))))))
;;----------------------------------------------------------------------------- ;;-----------------------------------------------------------------------------
;; facade functions ;; facade functions

View File

@ -467,9 +467,9 @@ prefix argument (`C-u C-u C-u C-c C-w')."
(unless (or (org-kill-is-subtree-p (unless (or (org-kill-is-subtree-p
(buffer-substring region-start region-end)) (buffer-substring region-start region-end))
(prog1 org-refile-active-region-within-subtree (prog1 org-refile-active-region-within-subtree
(let ((s (point-at-eol))) (let ((s (line-end-position)))
(org-toggle-heading) (org-toggle-heading)
(setq region-end (+ (- (point-at-eol) s) region-end))))) (setq region-end (+ (- (line-end-position) s) region-end)))))
(user-error "The region is not a (sequence of) subtree(s)"))) (user-error "The region is not a (sequence of) subtree(s)")))
(if (equal arg '(16)) (if (equal arg '(16))
(org-refile-goto-last-stored) (org-refile-goto-last-stored)

View File

@ -490,7 +490,7 @@ This may be useful when columns have been shrunk."
(looking-at-p ".*|\\s-+<[rcl]?\\([0-9]+\\)?>")) (looking-at-p ".*|\\s-+<[rcl]?\\([0-9]+\\)?>"))
(move-beginning-of-line 2)) (move-beginning-of-line 2))
(line-beginning-position))) (line-beginning-position)))
(end (save-excursion (goto-char beg) (point-at-eol)))) (end (save-excursion (goto-char beg) (line-end-position))))
(if (pos-visible-in-window-p beg) (if (pos-visible-in-window-p beg)
(when (overlayp org-table-header-overlay) (when (overlayp org-table-header-overlay)
(delete-overlay org-table-header-overlay)) (delete-overlay org-table-header-overlay))
@ -829,7 +829,7 @@ SIZE is a string Columns x Rows like for example \"3x2\"."
(line (concat (apply 'concat indent "|" (make-list columns " |")) (line (concat (apply 'concat indent "|" (make-list columns " |"))
"\n"))) "\n")))
(if (string-match "^[ \t]*$" (buffer-substring-no-properties (if (string-match "^[ \t]*$" (buffer-substring-no-properties
(point-at-bol) (point))) (line-beginning-position) (point)))
(beginning-of-line 1) (beginning-of-line 1)
(newline)) (newline))
;; (mapcar (lambda (x) (insert line)) (make-list rows t)) ;; (mapcar (lambda (x) (insert line)) (make-list rows t))
@ -1091,7 +1091,7 @@ With numeric argument N, move N-1 fields backward first."
(while (> n 1) (while (> n 1)
(setq n (1- n)) (setq n (1- n))
(org-table-previous-field)) (org-table-previous-field))
(if (not (re-search-backward "|" (point-at-bol 0) t)) (if (not (re-search-backward "|" (line-beginning-position 0) t))
(user-error "No more table fields before the current") (user-error "No more table fields before the current")
(goto-char (match-end 0)) (goto-char (match-end 0))
(and (looking-at " ") (forward-char 1))) (and (looking-at " ") (forward-char 1)))
@ -1106,7 +1106,7 @@ With numeric argument N, move N-1 fields forward first."
(while (> n 1) (while (> n 1)
(setq n (1- n)) (setq n (1- n))
(org-table-next-field)) (org-table-next-field))
(when (re-search-forward "|" (point-at-eol 1) t) (when (re-search-forward "|" (line-end-position 1) t)
(backward-char 1) (backward-char 1)
(skip-chars-backward " ") (skip-chars-backward " ")
(when (and (equal (char-before (point)) ?|) (equal (char-after (point)) ?\s)) (when (and (equal (char-before (point)) ?|) (equal (char-after (point)) ?\s))
@ -1163,7 +1163,7 @@ When ALIGN is set, also realign the table."
(goto-char (org-table-begin)) (goto-char (org-table-begin))
(while (and (re-search-forward org-table-dataline-regexp end t) (while (and (re-search-forward org-table-dataline-regexp end t)
(setq cnt (1+ cnt)) (setq cnt (1+ cnt))
(< (point-at-eol) pos)))) (< (line-end-position) pos))))
cnt)) cnt))
(defun org-table-current-column () (defun org-table-current-column ()
@ -1326,7 +1326,7 @@ However, when FORCE is non-nil, create new columns if necessary."
(beginning-of-line 1) (beginning-of-line 1)
(when (> n 0) (when (> n 0)
(while (and (> (setq n (1- n)) -1) (while (and (> (setq n (1- n)) -1)
(or (search-forward "|" (point-at-eol) t) (or (search-forward "|" (line-end-position) t)
(and force (and force
(progn (end-of-line 1) (progn (end-of-line 1)
(skip-chars-backward "^|") (skip-chars-backward "^|")
@ -1667,7 +1667,7 @@ With prefix ABOVE, insert above the current line."
(org-table-align)) (org-table-align))
(org-table-with-shrunk-columns (org-table-with-shrunk-columns
(let ((line (org-table-clean-line (let ((line (org-table-clean-line
(buffer-substring (point-at-bol) (point-at-eol)))) (buffer-substring (line-beginning-position) (line-end-position))))
(col (current-column))) (col (current-column)))
(while (string-match "|\\( +\\)|" line) (while (string-match "|\\( +\\)|" line)
(setq line (replace-match (setq line (replace-match
@ -1716,7 +1716,7 @@ In particular, this does handle wide and invisible characters."
(dline (and (not (org-match-line org-table-hline-regexp)) (dline (and (not (org-match-line org-table-hline-regexp))
(org-table-current-dline)))) (org-table-current-dline))))
(org-table-with-shrunk-columns (org-table-with-shrunk-columns
(kill-region (point-at-bol) (min (1+ (point-at-eol)) (point-max))) (kill-region (line-beginning-position) (min (1+ (line-end-position)) (point-max)))
(if (not (org-at-table-p)) (beginning-of-line 0)) (if (not (org-at-table-p)) (beginning-of-line 0))
(org-move-to-column col) (org-move-to-column col)
(when (and dline (when (and dline
@ -2257,14 +2257,14 @@ For all numbers larger than LIMIT, shift them by DELTA."
(format "@%d\\$[0-9]+=.*?\\(::\\|$\\)" remove)))) (format "@%d\\$[0-9]+=.*?\\(::\\|$\\)" remove))))
s n a) s n a)
(when remove (when remove
(while (re-search-forward re2 (point-at-eol) t) (while (re-search-forward re2 (line-end-position) t)
(unless (save-match-data (org-in-regexp "remote([^)]+?)")) (unless (save-match-data (org-in-regexp "remote([^)]+?)"))
(if (equal (char-before (match-beginning 0)) ?.) (if (equal (char-before (match-beginning 0)) ?.)
(user-error (user-error
"Change makes TBLFM term %s invalid, use undo to recover" "Change makes TBLFM term %s invalid, use undo to recover"
(match-string 0)) (match-string 0))
(replace-match ""))))) (replace-match "")))))
(while (re-search-forward re (point-at-eol) t) (while (re-search-forward re (line-end-position) t)
(unless (save-match-data (org-in-regexp "remote([^)]+?)")) (unless (save-match-data (org-in-regexp "remote([^)]+?)"))
(setq s (match-string 1) n (string-to-number s)) (setq s (match-string 1) n (string-to-number s))
(cond (cond
@ -3790,8 +3790,8 @@ FACE, when non-nil, for the highlight."
(let ((id 0) (ih 0) hline eol str ov) (let ((id 0) (ih 0) hline eol str ov)
(goto-char (org-table-begin)) (goto-char (org-table-begin))
(while (org-at-table-p) (while (org-at-table-p)
(setq eol (point-at-eol)) (setq eol (line-end-position))
(setq ov (make-overlay (point-at-bol) (1+ (point-at-bol)))) (setq ov (make-overlay (line-beginning-position) (1+ (line-beginning-position))))
(push ov org-table-coordinate-overlays) (push ov org-table-coordinate-overlays)
(setq hline (looking-at org-table-hline-regexp)) (setq hline (looking-at org-table-hline-regexp))
(setq str (if hline (format "I*%-2d" (setq ih (1+ ih))) (setq str (if hline (format "I*%-2d" (setq ih (1+ ih)))
@ -4924,7 +4924,7 @@ When LOCAL is non-nil, show references for the table at point."
((not local) nil) ((not local) nil)
(t (user-error "No reference at point"))) (t (user-error "No reference at point")))
match (and what (or match (match-string 0)))) match (and what (or match (match-string 0))))
(when (and match (not (equal (match-beginning 0) (point-at-bol)))) (when (and match (not (equal (match-beginning 0) (line-beginning-position))))
(org-table-add-rectangle-overlay (match-beginning 0) (match-end 0) (org-table-add-rectangle-overlay (match-beginning 0) (match-end 0)
'secondary-selection)) 'secondary-selection))
(add-hook 'before-change-functions (add-hook 'before-change-functions

View File

@ -5994,7 +5994,7 @@ and subscripts."
(emph-p (get-text-property mpos 'org-emphasis)) (emph-p (get-text-property mpos 'org-emphasis))
(link-p (get-text-property mpos 'mouse-face)) (link-p (get-text-property mpos 'mouse-face))
(keyw-p (eq 'org-special-keyword (get-text-property mpos 'face)))) (keyw-p (eq 'org-special-keyword (get-text-property mpos 'face))))
(goto-char (point-at-bol)) (goto-char (line-beginning-position))
(setq table-p (looking-at-p org-table-dataline-regexp) (setq table-p (looking-at-p org-table-dataline-regexp)
comment-p (looking-at-p "^[ \t]*#[ +]")) comment-p (looking-at-p "^[ \t]*#[ +]"))
(goto-char pos) (goto-char pos)
@ -6381,7 +6381,7 @@ This is a list with the following elements:
"Get the entry text, after heading, entire subtree." "Get the entry text, after heading, entire subtree."
(save-excursion (save-excursion
(org-back-to-heading t) (org-back-to-heading t)
(filter-buffer-substring (point-at-bol 2) (org-end-of-subtree t)))) (filter-buffer-substring (line-beginning-position 2) (org-end-of-subtree t))))
(defun org-edit-headline (&optional heading) (defun org-edit-headline (&optional heading)
"Edit the current headline. "Edit the current headline.
@ -6861,7 +6861,7 @@ case."
(org-get-next-sibling) (org-get-next-sibling)
(org-get-next-sibling)) (org-get-next-sibling))
(if (org-at-heading-p) (if (org-at-heading-p)
(point-at-eol) (line-end-position)
(point)))) (point))))
(level (looking-at "\\*+")) (level (looking-at "\\*+"))
(re (when level (concat "^" (regexp-quote (match-string 0)) " ")))) (re (when level (concat "^" (regexp-quote (match-string 0)) " "))))
@ -7686,7 +7686,7 @@ function is being called interactively."
(org-time-string-to-seconds (match-string 1)) (org-time-string-to-seconds (match-string 1))
(float-time now)))) (float-time now))))
((= dcst ?p) ((= dcst ?p)
(if (re-search-forward org-priority-regexp (point-at-eol) t) (if (re-search-forward org-priority-regexp (line-end-position) t)
(string-to-char (match-string 2)) (string-to-char (match-string 2))
org-priority-default)) org-priority-default))
((= dcst ?r) ((= dcst ?r)
@ -8595,7 +8595,7 @@ If not found, stay at current position and return nil."
(defun org-create-dblock (plist) (defun org-create-dblock (plist)
"Create a dynamic block section, with parameters taken from PLIST. "Create a dynamic block section, with parameters taken from PLIST.
PLIST must contain a :name entry which is used as the name of the block." PLIST must contain a :name entry which is used as the name of the block."
(when (string-match "\\S-" (buffer-substring (point-at-bol) (point-at-eol))) (when (string-match "\\S-" (buffer-substring (line-beginning-position) (line-end-position)))
(end-of-line 1) (end-of-line 1)
(newline)) (newline))
(let ((col (current-column)) (let ((col (current-column))
@ -9281,7 +9281,7 @@ When called through ELisp, arg is also interpreted in the following way:
(run-hooks 'org-after-todo-state-change-hook) (run-hooks 'org-after-todo-state-change-hook)
(when (and arg (not (member org-state org-done-keywords))) (when (and arg (not (member org-state org-done-keywords)))
(setq head (org-get-todo-sequence-head org-state))) (setq head (org-get-todo-sequence-head org-state)))
(put-text-property (point-at-bol) (point-at-eol) 'org-todo-head head) (put-text-property (line-beginning-position) (line-end-position) 'org-todo-head head)
;; Do we need to trigger a repeat? ;; Do we need to trigger a repeat?
(when now-done-p (when now-done-p
(when (boundp 'org-agenda-headline-snapshot-before-repeat) (when (boundp 'org-agenda-headline-snapshot-before-repeat)
@ -9494,7 +9494,7 @@ all statistics cookies in the buffer."
(beginning-of-line 1) (beginning-of-line 1)
(while (re-search-forward (while (re-search-forward
"\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)" "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)"
(point-at-eol) t) (line-end-position) t)
(replace-match (if (match-end 2) "[100%]" "[0/0]") t t))))) (replace-match (if (match-end 2) "[100%]" "[0/0]") t t)))))
(goto-char pos) (goto-char pos)
(move-marker pos nil))))) (move-marker pos nil)))))
@ -9537,11 +9537,11 @@ statistics everywhere."
(setq first nil cookie-present nil) (setq first nil cookie-present nil)
(unless (and level (unless (and level
(not (string-match (not (string-match
"\\<checkbox\\>" "\\<checkbox\\>"
(downcase (or (org-entry-get nil "COOKIE_DATA") (downcase (or (org-entry-get nil "COOKIE_DATA")
""))))) "")))))
(throw 'exit nil)) (throw 'exit nil))
(while (re-search-forward box-re (point-at-eol) t) (while (re-search-forward box-re (line-end-position) t)
(setq cnt-all 0 cnt-done 0 cookie-present t) (setq cnt-all 0 cnt-done 0 cookie-present t)
(setq is-percent (match-end 2) checkbox-beg (match-beginning 0)) (setq is-percent (match-end 2) checkbox-beg (match-beginning 0))
(save-match-data (save-match-data
@ -9650,10 +9650,10 @@ right sequence."
(let (p) (let (p)
(cond (cond
((not kwd) ((not kwd)
(or (get-text-property (point-at-bol) 'org-todo-head) (or (get-text-property (line-beginning-position) 'org-todo-head)
(progn (progn
(setq p (next-single-property-change (point-at-bol) 'org-todo-head (setq p (next-single-property-change (line-beginning-position) 'org-todo-head
nil (point-at-eol))) nil (line-end-position)))
(get-text-property p 'org-todo-head)))) (get-text-property p 'org-todo-head))))
((not (member kwd org-todo-keywords-1)) ((not (member kwd org-todo-keywords-1))
(car org-todo-keywords-1)) (car org-todo-keywords-1))
@ -10115,13 +10115,13 @@ nil."
(outline-next-heading) (outline-next-heading)
(while (re-search-backward re beg t) (while (re-search-backward re beg t)
(replace-match "") (replace-match "")
(if (and (string-match "\\S-" (buffer-substring (point-at-bol) (point))) (if (and (string-match "\\S-" (buffer-substring (line-beginning-position) (point)))
(equal (char-before) ?\ )) (equal (char-before) ?\ ))
(backward-delete-char 1) (backward-delete-char 1)
(when (string-match "^[ \t]*$" (buffer-substring (when (string-match "^[ \t]*$" (buffer-substring
(point-at-bol) (point-at-eol))) (line-beginning-position) (line-end-position)))
(delete-region (point-at-bol) (delete-region (line-beginning-position)
(min (point-max) (1+ (point-at-eol)))))))))) (min (point-max) (1+ (line-end-position))))))))))
(defvar org-time-was-given) ; dynamically scoped parameter (defvar org-time-was-given) ; dynamically scoped parameter
(defvar org-end-time-was-given) ; dynamically scoped parameter (defvar org-end-time-was-given) ; dynamically scoped parameter
@ -11718,7 +11718,7 @@ Also insert END."
(defun org-fast-tag-show-exit (flag) (defun org-fast-tag-show-exit (flag)
(save-excursion (save-excursion
(org-goto-line 3) (org-goto-line 3)
(when (re-search-forward "[ \t]+Next change exits" (point-at-eol) t) (when (re-search-forward "[ \t]+Next change exits" (line-end-position) t)
(replace-match "")) (replace-match ""))
(when flag (when flag
(end-of-line 1) (end-of-line 1)
@ -11765,7 +11765,7 @@ Returns the new tags string, or nil to not change the current settings."
(setq ov-start (match-beginning 1) (setq ov-start (match-beginning 1)
ov-end (match-end 1) ov-end (match-end 1)
ov-prefix "") ov-prefix "")
(setq ov-start (1- (point-at-eol)) (setq ov-start (1- (line-end-position))
ov-end (1+ ov-start)) ov-end (1+ ov-start))
(skip-chars-forward "^\n\r") (skip-chars-forward "^\n\r")
(setq ov-prefix (setq ov-prefix
@ -11932,7 +11932,7 @@ Returns the new tags string, or nil to not change the current settings."
(when (eq exit-after-next 'now) (throw 'exit t)) (when (eq exit-after-next 'now) (throw 'exit t))
(goto-char (point-min)) (goto-char (point-min))
(beginning-of-line 2) (beginning-of-line 2)
(delete-region (point) (point-at-eol)) (delete-region (point) (line-end-position))
(org-fast-tag-insert "Current" current c-face) (org-fast-tag-insert "Current" current c-face)
(org-set-current-tags-overlay current ov-prefix) (org-set-current-tags-overlay current ov-prefix)
(let ((tag-re (concat "\\[.\\] \\(" org-tag-re "\\)"))) (let ((tag-re (concat "\\[.\\] \\(" org-tag-re "\\)")))
@ -13682,7 +13682,7 @@ user."
(max (point-min) (- (point) 4)) (point)) (max (point-min) (- (point) 4)) (point))
" ")) " "))
(insert " "))) (insert " ")))
(let* ((ans (concat (buffer-substring (point-at-bol) (point-max)) (let* ((ans (concat (buffer-substring (line-beginning-position) (point-max))
" " (or org-ans1 org-ans2))) " " (or org-ans1 org-ans2)))
(org-end-time-was-given nil) (org-end-time-was-given nil)
(f (org-read-date-analyze ans org-def org-defdecode)) (f (org-read-date-analyze ans org-def org-defdecode))
@ -13704,7 +13704,7 @@ user."
(when org-read-date-analyze-futurep (when org-read-date-analyze-futurep
(setq txt (concat txt " (=>F)"))) (setq txt (concat txt " (=>F)")))
(setq org-read-date-overlay (setq org-read-date-overlay
(make-overlay (1- (point-at-eol)) (point-at-eol))) (make-overlay (1- (line-end-position)) (line-end-position)))
(org-overlay-display org-read-date-overlay txt 'secondary-selection))))) (org-overlay-display org-read-date-overlay txt 'secondary-selection)))))
(defun org-read-date-analyze (ans def defdecode) (defun org-read-date-analyze (ans def defdecode)
@ -14259,8 +14259,8 @@ days in order to avoid rounding problems."
(org-clock-update-time-maybe) (org-clock-update-time-maybe)
(save-excursion (save-excursion
(unless (org-at-date-range-p t) (unless (org-at-date-range-p t)
(goto-char (point-at-bol)) (goto-char (line-beginning-position))
(re-search-forward org-tr-regexp-both (point-at-eol) t)) (re-search-forward org-tr-regexp-both (line-end-position) t))
(unless (org-at-date-range-p t) (unless (org-at-date-range-p t)
(user-error "Not at a time-stamp range, and none found in current line"))) (user-error "Not at a time-stamp range, and none found in current line")))
(let* ((ts1 (match-string 1)) (let* ((ts1 (match-string 1))
@ -16053,7 +16053,7 @@ INCLUDE-LINKED is passed to `org-display-inline-images'."
(org-toggle-inline-images))) (org-toggle-inline-images)))
;; For without-x builds. ;; For without-x builds.
(declare-function image-refresh "image" (spec &optional frame)) (declare-function image-flush "image" (spec &optional frame))
(defcustom org-display-remote-inline-images 'skip (defcustom org-display-remote-inline-images 'skip
"How to display remote inline images. "How to display remote inline images.
@ -16194,7 +16194,7 @@ buffer boundaries with possible narrowing."
(org-element-property :begin link) (org-element-property :begin link)
'org-image-overlay))) 'org-image-overlay)))
(if (and (car-safe old) refresh) (if (and (car-safe old) refresh)
(image-refresh (overlay-get (cdr old) 'display)) (image-flush (overlay-get (cdr old) 'display))
(let ((image (org--create-inline-image file width))) (let ((image (org--create-inline-image file width)))
(when image (when image
(let ((ov (make-overlay (let ((ov (make-overlay
@ -16738,14 +16738,14 @@ this function returns t, nil otherwise."
(save-excursion (save-excursion
(catch 'exit (catch 'exit
(unless (org-region-active-p) (unless (org-region-active-p)
(setq beg (point-at-bol)) (setq beg (line-beginning-position))
(beginning-of-line 2) (beginning-of-line 2)
(while (and (not (eobp)) ;; this is like `next-line' (while (and (not (eobp)) ;; this is like `next-line'
(org-invisible-p (1- (point)))) (org-invisible-p (1- (point))))
(beginning-of-line 2)) (beginning-of-line 2))
(setq end (point)) (setq end (point))
(goto-char beg) (goto-char beg)
(goto-char (point-at-eol)) (goto-char (line-end-position))
(setq end (max end (point))) (setq end (max end (point)))
(while (re-search-forward re end t) (while (re-search-forward re end t)
(when (org-invisible-p (match-beginning 0)) (when (org-invisible-p (match-beginning 0))
@ -17660,7 +17660,7 @@ number of stars to add."
(goto-char pos) (goto-char pos)
(while (org-at-comment-p) (forward-line)) (while (org-at-comment-p) (forward-line))
(skip-chars-forward " \r\t\n") (skip-chars-forward " \r\t\n")
(point-at-bol)))) (line-beginning-position))))
beg end toggled) beg end toggled)
;; Determine boundaries of changes. If a universal prefix has ;; Determine boundaries of changes. If a universal prefix has
;; been given, put the list in a region. If region ends at a bol, ;; been given, put the list in a region. If region ends at a bol,
@ -17674,9 +17674,9 @@ number of stars to add."
(setq beg (funcall skip-blanks (region-beginning)) (setq beg (funcall skip-blanks (region-beginning))
end (copy-marker (save-excursion end (copy-marker (save-excursion
(goto-char (region-end)) (goto-char (region-end))
(if (bolp) (point) (point-at-eol))))) (if (bolp) (point) (line-end-position)))))
(setq beg (funcall skip-blanks (point-at-bol)) (setq beg (funcall skip-blanks (line-beginning-position))
end (copy-marker (point-at-eol)))) end (copy-marker (line-end-position))))
;; Ensure inline tasks don't count as headings. ;; Ensure inline tasks don't count as headings.
(org-with-limited-levels (org-with-limited-levels
(save-excursion (save-excursion
@ -18249,10 +18249,10 @@ When ELEMENT is provided, it is considered to be element at point."
(when (eq 'src-block (org-element-type element)) (when (eq 'src-block (org-element-type element))
(or (not inside) (or (not inside)
(not (or (= (line-beginning-position) (not (or (= (line-beginning-position)
(org-element-property :post-affiliated element)) (org-element-property :post-affiliated element))
(= (1+ (line-end-position)) (= (1+ (line-end-position))
(- (org-element-property :end element) (- (org-element-property :end element)
(org-element-property :post-blank element)))))))) (org-element-property :post-blank element))))))))
(defun org-context () (defun org-context ()
"Return a list of contexts of the current cursor position. "Return a list of contexts of the current cursor position.
@ -18289,7 +18289,7 @@ and :keyword."
;; First the large context ;; First the large context
(cond (cond
((org-at-heading-p) ((org-at-heading-p)
(push (list :headline (point-at-bol) (point-at-eol)) clist) (push (list :headline (line-beginning-position) (line-end-position)) clist)
(when (progn (when (progn
(beginning-of-line 1) (beginning-of-line 1)
(looking-at org-todo-line-tags-regexp)) (looking-at org-todo-line-tags-regexp))
@ -18303,7 +18303,7 @@ and :keyword."
((org-at-item-p) ((org-at-item-p)
(push (org-point-in-group p 2 :item-bullet) clist) (push (org-point-in-group p 2 :item-bullet) clist)
(push (list :item (point-at-bol) (push (list :item (line-beginning-position)
(save-excursion (org-end-of-item) (point))) (save-excursion (org-end-of-item) (point)))
clist) clist)
(and (org-at-item-checkbox-p) (and (org-at-item-checkbox-p)
@ -18594,12 +18594,12 @@ ELEMENT."
(and (and
(eq org-adapt-indentation 'headline-data) (eq org-adapt-indentation 'headline-data)
(not (or (org-at-clock-log-p) (not (or (org-at-clock-log-p)
(org-at-planning-p))) (org-at-planning-p)))
(progn (progn
(beginning-of-line 1) (beginning-of-line 1)
(skip-chars-backward "\n") (skip-chars-backward "\n")
(or (org-at-heading-p) (or (org-at-heading-p)
(looking-back ":END:.*" (point-at-bol)))))) (looking-back ":END:.*" (line-beginning-position))))))
(throw 'exit 0)) (throw 'exit 0))
(t (goto-char (org-element-property :begin previous)) (t (goto-char (org-element-property :begin previous))
(throw 'exit (throw 'exit
@ -18722,7 +18722,7 @@ Also align node properties according to `org-property-format'."
(beginning-of-line 1) (beginning-of-line 1)
(skip-chars-backward "\n") (skip-chars-backward "\n")
(or (org-at-heading-p) (or (org-at-heading-p)
(looking-back ":END:.*" (point-at-bol)))))) (looking-back ":END:.*" (line-beginning-position))))))
(let* ((element (save-excursion (beginning-of-line) (org-element-at-point-no-context))) (let* ((element (save-excursion (beginning-of-line) (org-element-at-point-no-context)))
(type (org-element-type element))) (type (org-element-type element)))
(cond ((and (memq type '(plain-list item)) (cond ((and (memq type '(plain-list item))
@ -19468,7 +19468,7 @@ major mode."
(point)))) (point))))
(org-babel-do-in-edit-buffer (call-interactively 'comment-dwim)) (org-babel-do-in-edit-buffer (call-interactively 'comment-dwim))
(beginning-of-line) (beginning-of-line)
(if (looking-at "\\s-*$") (delete-region (point) (point-at-eol)) (if (looking-at "\\s-*$") (delete-region (point) (line-end-position))
(open-line 1)) (open-line 1))
(org-indent-line) (org-indent-line)
(insert "# "))) (insert "# ")))
@ -19486,10 +19486,10 @@ strictly within a source block, use appropriate comment syntax."
(line-end-position)) (line-end-position))
beg) beg)
(>= (save-excursion (>= (save-excursion
(goto-char (org-element-property :end element)) (goto-char (org-element-property :end element))
(skip-chars-backward " \r\t\n") (skip-chars-backward " \r\t\n")
(line-beginning-position)) (line-beginning-position))
end))) end)))
;; Translate region boundaries for the Org buffer to the source ;; Translate region boundaries for the Org buffer to the source
;; buffer. ;; buffer.
(let ((offset (- end beg))) (let ((offset (- end beg)))
@ -19963,7 +19963,7 @@ interactive command with similar behavior."
(and (looking-at "[ \t]*$") (and (looking-at "[ \t]*$")
(string-match (string-match
"\\`\\*+\\'" "\\`\\*+\\'"
(buffer-substring (point-at-bol) (point))))))) (buffer-substring (line-beginning-position) (point)))))))
swallowp) swallowp)
(cond (cond
((and subtreep org-yank-folded-subtrees) ((and subtreep org-yank-folded-subtrees)
@ -19996,7 +19996,7 @@ interactive command with similar behavior."
(beginning-of-line 1) (beginning-of-line 1)
(push-mark beg 'nomsg))) (push-mark beg 'nomsg)))
((and subtreep org-yank-adjusted-subtrees) ((and subtreep org-yank-adjusted-subtrees)
(let ((beg (point-at-bol))) (let ((beg (line-beginning-position)))
(org-paste-subtree nil nil 'for-yank) (org-paste-subtree nil nil 'for-yank)
(push-mark beg 'nomsg))) (push-mark beg 'nomsg)))
(t (t

View File

@ -6542,7 +6542,7 @@ to send the output file through additional processing, e.g,
(let ((outfile (org-export-output-file-name \".tex\" subtreep))) (let ((outfile (org-export-output-file-name \".tex\" subtreep)))
(org-export-to-file \\='latex outfile (org-export-to-file \\='latex outfile
async subtreep visible-only body-only ext-plist async subtreep visible-only body-only ext-plist
#'org-latex-compile))) #\\='org-latex-compile)))
When expressed as an anonymous function, using `lambda', When expressed as an anonymous function, using `lambda',
POST-PROCESS needs to be quoted. POST-PROCESS needs to be quoted.