[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-contrib 90aa5dd81f 1/2: lisp/org-eval-light.el: Fix so
|
From: |
ELPA Syncer |
|
Subject: |
[nongnu] elpa/org-contrib 90aa5dd81f 1/2: lisp/org-eval-light.el: Fix some compiler warnings |
|
Date: |
Thu, 18 Jan 2024 07:00:07 -0500 (EST) |
branch: elpa/org-contrib
commit 90aa5dd81f152119557dc1e7798472bb74d157ab
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>
lisp/org-eval-light.el: Fix some compiler warnings
* lisp/org-eval-light.el (org-eval-light-current-snippet): Use
`org-goto-line' instead of `goto-line' that is only for interactive
use.
(org-ctrl-c-ctrl-c): Rewrite using `define-advice'.
---
lisp/org-eval-light.el | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/lisp/org-eval-light.el b/lisp/org-eval-light.el
index dd39494f1d..8d4d644d9b 100644
--- a/lisp/org-eval-light.el
+++ b/lisp/org-eval-light.el
@@ -126,20 +126,20 @@ commented by `org-eval-light-make-region-example'."
(info (org-edit-src-find-region-and-lang))
beg end lang result)
(setq beg (nth 0 info)
- end (nth 1 info)
- lang (nth 2 info))
+ end (nth 1 info)
+ lang (nth 2 info))
(unless (member lang org-eval-light-interpreters)
(error "Language is not in `org-eval-light-interpreters': %s" lang))
- (goto-line line)
+ (org-goto-line line)
(setq result (org-eval-light-code lang (buffer-substring beg end)))
(unless arg
(save-excursion
- (re-search-forward "^#\\+end_src" nil t) (open-line 1) (forward-char 2)
- (let ((beg (point))
- (end (progn (insert result)
- (point))))
- (message (format "from %S %S" beg end))
- (org-eval-light-make-region-example beg end))))))
+ (re-search-forward "^#\\+end_src" nil t) (open-line 1) (forward-char 2)
+ (let ((beg (point))
+ (end (progn (insert result)
+ (point))))
+ (message (format "from %S %S" beg end))
+ (org-eval-light-make-region-example beg end))))))
(defun org-eval-light-eval-subtree (&optional arg)
"Replace EVAL snippets in the entire subtree."
@@ -189,10 +189,10 @@ commented by `org-eval-light-make-region-example'."
(shell-command-on-region (point-min) (point-max) cmd nil 'replace)
(buffer-string)))
-(defadvice org-ctrl-c-ctrl-c (around org-cc-eval-source activate)
+(define-advice org-ctrl-c-ctrl-c (:around (fun &rest args) org-cc-eval-source)
(if (org-eval-light-inside-snippet)
(call-interactively 'org-eval-light-current-snippet)
- ad-do-it))
+ (apply fun args)))
(provide 'org-eval-light)