emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/cpupower d2e1eacaba 13/35: ok, that looks reasonable


From: ELPA Syncer
Subject: [elpa] externals/cpupower d2e1eacaba 13/35: ok, that looks reasonable
Date: Thu, 5 May 2022 15:57:45 -0400 (EDT)

branch: externals/cpupower
commit d2e1eacabaaec92b6c5479960169570ee65bb61b
Author: smeister <smeister@awstruepower.com>
Commit: smeister <smeister@awstruepower.com>

    ok, that looks reasonable
---
 cpupower.el | 28 ++++++++++++----------------
 1 file changed, 12 insertions(+), 16 deletions(-)

diff --git a/cpupower.el b/cpupower.el
index edd5bb4aed..b1ecaf0438 100644
--- a/cpupower.el
+++ b/cpupower.el
@@ -20,12 +20,11 @@
 
 ;; If you have cpupower installed, this provides a very simple wrapper
 ;; to that program.  You'll need to configure your system such that
-;; the user you're using emacs as can run cpupower (probably as `sudo
-;; cpupower` from a command line).  You can configure how cpupower is
-;; called by customizing cpupower-cmd.
+;; the current user can run cpupower (maybe as `sudo cpupower` from a
+;; command line).  You can configure how cpupower is called by
+;; customizing cpupower-cmd.
 ;;
 ;; This module interacts with cpupower via running it in a shell.
-;; 
 ;;
 ;; The commands you'll probably want to use:
 ;; * cpupower-info
@@ -131,7 +130,7 @@ TODO: do this in a less bad way?"
   (cond ((> KHz 1000000)
          (format "%.2fGHz" (/ KHz 1000000.0)))
         ((> KHz 1000)
-         (format "%.1fMHz" (/ KHz 1000.0)))
+         (format "%.0fMHz" (/ KHz 1000.0)))
         (t
          (format "%dKHz" KHz))))
 
@@ -214,16 +213,13 @@ message the user with current CPU governors"
                                   ", "))))
     governors))
 
-(defun cpupower-helm-set-governor ()
-  "Set cpu governor using helm.
-
-@TODO - this should only exist when helm is installed?"
-  (interactive)
-  (if (package-installed-p 'helm)
-      (cpupower-set-governor
-       (helm :sources (helm-build-sync-source "cpu-governors"
-                        :candidates (cpupower--get-available-governors))
-             :buffer "*helm set cpu governor*"))
-    (call-interactively 'cpupower-set-governor)))
+(with-eval-after-load 'helm
+  (defun cpupower-helm-set-governor ()
+    "Set cpu governor using helm."
+    (interactive) 
+    (cpupower-set-governor
+     (helm :sources (helm-build-sync-source "cpu-governors"
+                      :candidates (cpupower--get-available-governors)) 
+           :buffer "*helm set cpu governor*"))))
 
 (provide 'cpupower)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]