summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-07-04 08:33:03 +0300
committerThanos Apollo <[email protected]>2023-07-04 08:33:03 +0300
commit0696bec4252cd592399fdb38159972913f308aa8 (patch)
tree574abac6a5cb78c20c0c39194810c5dfdfb79abd
parent4265ae3e455aded7337580ae39750386d40c3377 (diff)
yeetube-update-info: use push-mark
Use push-mark and let a variable for buffer to always switch. Replace kill-visual-line with kill-region to not mess with the kill-ring
-rw-r--r--yeetube.el12
1 files changed, 6 insertions, 6 deletions
diff --git a/yeetube.el b/yeetube.el
index 99f36af..52d30d9 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -256,24 +256,24 @@ WHERE indicates where in the buffer the update should happen.
OPERATION & WHERE are required to work with 'add-variable-watcher."
(when (get-buffer "*Yeetube Search*")
+ (push-mark)
(let ((to-change
(pcase symbol-name
('yeetube-player "Yeetube Player:")
('yeetube-download-directory "Download Directory:")
- ('yeetube-download-audio-format "Download as audio format:"))))
+ ('yeetube-download-audio-format "Download as audio format:")))
+ (buffer-cur (buffer-name)))
(switch-to-buffer (get-buffer "*Yeetube Search*"))
(setq-local buffer-read-only nil)
(goto-char (point-min))
(search-forward to-change)
(beginning-of-visual-line)
- (kill-visual-line)
+ (kill-region (point) (line-end-position))
(insert
(format "%s *%s*" to-change new-value))
- (goto-char (point-min))
- (search-forward yeetube-results-prefix)
(setq-local buffer-read-only t)
- (unless (equal (buffer-name) "*Yeetube Search*")
- (switch-to-buffer (other-buffer))))))
+ (switch-to-buffer buffer-cur))
+ (goto-char (mark))))
;; Variable to watch