Skip to content

Commit

Permalink
Backport commit b7e867b84 from Emacs
Browse files Browse the repository at this point in the history
Make point-at-eol and point-at-bol obsolete
b7e867b841f47dcff3aeaef9b5608a237386ce70
Stefan Kangas
Tue Aug 23 04:54:57 2022 +0200

[ km: This was independently covered on the main branch with
  e73c5b7.  I'm applying it here too for bookkeeping/traceability
  purposes. ]
  • Loading branch information
skangas authored and kyleam committed Oct 4, 2022
1 parent 9c2bc28 commit c2c8e66
Show file tree
Hide file tree
Showing 19 changed files with 198 additions and 178 deletions.
8 changes: 4 additions & 4 deletions lisp/ob-core.el
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ arguments and pop open the results in a preview buffer."
vals ""))))))
(save-excursion
(goto-char begin)
(goto-char (point-at-eol))
(goto-char (line-end-position))
(unless (= (char-before (point)) ?\ ) (insert " "))
(insert ":" header-arg) (when value (insert " " value)))))

Expand Down Expand Up @@ -1936,9 +1936,9 @@ region is not active then the point is demarcated."
(let ((lang (nth 0 info))
(indent (make-string (current-indentation) ?\s)))
(when (string-match "^[[:space:]]*$"
(buffer-substring (point-at-bol)
(point-at-eol)))
(delete-region (point-at-bol) (point-at-eol)))
(buffer-substring (line-beginning-position)
(line-end-position)))
(delete-region (line-beginning-position) (line-end-position)))
(insert (concat
(if (looking-at "^") "" "\n")
indent (if upper-case-p "#+END_SRC\n" "#+end_src\n")
Expand Down
2 changes: 1 addition & 1 deletion lisp/ob-lilypond.el
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ LINENO is the number of the erroneous line."
(progn
(goto-char (point-min))
(forward-line (- lineNo 1))
(buffer-substring (point) (point-at-eol)))
(buffer-substring (point) (line-end-position)))
nil)))

(defun org-babel-lilypond-attempt-to-open-pdf (file-name &optional test)
Expand Down
2 changes: 1 addition & 1 deletion lisp/ob-octave.el
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ This removes initial blank and comment lines and then calls
(insert-file-contents file-name)
(re-search-forward "^[ \t]*[^# \t]" nil t)
(when (< (setq beg (point-min))
(setq end (point-at-bol)))
(setq end (line-beginning-position)))
(delete-region beg end)))
(org-babel-import-elisp-from-file temp-file '(16))))

Expand Down
12 changes: 6 additions & 6 deletions lisp/ol-irc.el
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ result is a cons of the filename and search string."
;; can we get a '::' part?
(if (string= erc-line (erc-prompt))
(progn
(goto-char (point-at-bol))
(goto-char (line-beginning-position))
(when (search-backward-regexp "^[^ ]" nil t)
(buffer-substring-no-properties (point-at-bol)
(point-at-eol))))
(buffer-substring-no-properties (line-beginning-position)
(line-end-position))))
(when (search-backward erc-line nil t)
(buffer-substring-no-properties (point-at-bol)
(point-at-eol)))))))
(buffer-substring-no-properties (line-beginning-position)
(line-end-position)))))))

(defun org-irc-erc-store-link ()
"Store a link to the IRC log file or the session itself.
Expand All @@ -151,7 +151,7 @@ the session itself."
(require 'erc-log)
(if org-irc-link-to-logs
(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)))
(if (erc-logging-enabled nil)
(progn
Expand Down
2 changes: 1 addition & 1 deletion lisp/ol.el
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,7 @@ non-nil."
(let ((end (region-end)))
(goto-char (region-beginning))
(set-mark (point))
(while (< (point-at-eol) end)
(while (< (line-end-position) end)
(move-end-of-line 1) (activate-mark)
(let (current-prefix-arg)
(call-interactively 'org-store-link))
Expand Down
Loading

0 comments on commit c2c8e66

Please sign in to comment.