Skip to content

Commit

Permalink
Fix Emacs 29 compiler warnings
Browse files Browse the repository at this point in the history
* 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'.
  • Loading branch information
yantar92 committed Sep 6, 2022
1 parent 0c055d2 commit e73c5b7
Show file tree
Hide file tree
Showing 24 changed files with 210 additions and 207 deletions.
8 changes: 4 additions & 4 deletions lisp/ob-core.el
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,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 @@ -1958,9 +1958,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 @@ -315,7 +315,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 @@ -259,7 +259,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
4 changes: 2 additions & 2 deletions lisp/oc-basic.el
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ Optional argument INFO is the export state, as a property list."
(when (or (org-file-has-changed-p file)
(not (gethash file org-cite-basic--file-id-cache)))
(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))
(condition-case nil
(unwind-protect
Expand All @@ -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)
table))))
(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))))))
(when info (plist-put info :cite-basic/bibliography results))
results)))
Expand Down
3 changes: 2 additions & 1 deletion lisp/ol-bibtex.el
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
(declare-function org-narrow-to-subtree "org" (&optional element))
(declare-function org-set-property "org" (property value))
(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))

Expand Down Expand Up @@ -764,7 +765,7 @@ drawer."
"Read bibtex entries from FILE and insert as Org headlines after point."
(interactive "fFile: ")
(let ((pos (point)))
(dotimes (i (org-bibtex-read-file file))
(dotimes (_ (org-bibtex-read-file file))
(save-excursion (org-bibtex-write 'noindent))
(re-search-forward org-property-end-re)
(insert "\n"))
Expand Down
12 changes: 6 additions & 6 deletions lisp/ol-irc.el
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,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 @@ -154,7 +154,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
4 changes: 2 additions & 2 deletions lisp/ol.el
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ followed by another \"%[A-F0-9]{2}\" group."
(cons 6 128))))
(when (>= val 192) (setq eat (car 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)))
(cond
((= 0 eat) ;multi byte
Expand Down Expand Up @@ -1529,7 +1529,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 e73c5b7

Please sign in to comment.