~abcdw/rde-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] rde: emacs: Add option default-pass-prompt?

Details
Message ID
<20220917132904.15848-1-ngraves@ngraves.fr>
DKIM signature
missing
Download raw message
Patch: +26 -12
---
 rde/features/emacs.scm          | 19 +++++++++++++++++++
 rde/features/password-utils.scm | 13 ++-----------
 rde/features/wm.scm             |  6 +++++-
 3 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/rde/features/emacs.scm b/rde/features/emacs.scm
index 1ab77f9..51dd8b2 100644
--- a/rde/features/emacs.scm
+++ b/rde/features/emacs.scm
@@ -209,6 +209,7 @@ environment outside of Guix Home."
          (extra-early-init-el '())
          (default-terminal? #t)
          (default-application-launcher? #t)
          (default-pass-prompt? #f)
          (disable-warnings? #t)
          (auto-update-buffers? #t)
          (auto-clean-space? #t))
@@ -216,6 +217,7 @@ environment outside of Guix Home."
  (ensure-pred boolean? emacs-server-mode?)
  (ensure-pred boolean? default-terminal?)
  (ensure-pred boolean? default-application-launcher?)
  (ensure-pred boolean? default-pass-prompt?)
  (ensure-pred boolean? disable-warnings?)
  (ensure-pred boolean? auto-update-buffers?)
  (ensure-pred boolean? auto-clean-space?)
@@ -254,6 +256,20 @@ environment outside of Guix Home."
                           "-F"
                           "((minibuffer . only) (width . 120) (height . 11))")))

(define emacs-pass-prompt
    (program-file
     "emacs-pass-prompt"
     #~(system* #$emacs-client-create-frame
                ;; https://git.sr.ht/~bruun/home/tree/master/item/.config/emacs/bruun/bruun-emacs-menu.el
                "--eval" "(progn \
(set-frame-name \"pass - Emacs Client\") \
(let ((current-frame (selected-frame))) \
  (unwind-protect \
      (command-execute 'rde-consult-pass) \
    (delete-frame current-frame))))"
                "-F"
                "((minibuffer . only) (width . 120) (height . 11))")))

  (define (emacs-home-services config)
    "Returns home services related to GNU Emacs."
    (require-value 'full-name config)
@@ -538,6 +554,9 @@ It can contain settings not yet moved to separate features."
                '())
            (if default-application-launcher?
                   `((default-application-launcher . ,emacs-application-launcher))
                   '())
            (if default-pass-prompt?
                   `((default-pass-prompt . ,emacs-pass-prompt))
                   '())))
   (home-services-getter emacs-home-services)))

diff --git a/rde/features/password-utils.scm b/rde/features/password-utils.scm
index cde214b..369fb40 100644
--- a/rde/features/password-utils.scm
+++ b/rde/features/password-utils.scm
@@ -41,20 +41,11 @@
	      "/.local/var/lib/password-store")
	     remote-password-store-url)))

          (when (get-value 'emacs config)
          (when (get-value 'default-pass-prompt config)
            (emacs-xdg-service
             'pass
             "Emacs (Client) [pass]"
             #~(system* #$(get-value 'emacs-client-create-frame config)
;; https://git.sr.ht/~bruun/home/tree/master/item/.config/emacs/bruun/bruun-emacs-menu.el
                        "--eval" "(progn \
(set-frame-name \"pass - Emacs Client\") \
(let ((current-frame (selected-frame))) \
  (unwind-protect \
      (command-execute 'rde-consult-pass) \
    (delete-frame current-frame))))"
                        "-F"
                        "((minibuffer . only) (width . 120) (height . 11))")))
             #~(system* #$(get-value 'default-pass-prompt config))))

          (when (get-value 'emacs config)
            (let ((emacs-embark (get-value 'emacs-embark config))
diff --git a/rde/features/wm.scm b/rde/features/wm.scm
index efeaee8..b5dd116 100644
--- a/rde/features/wm.scm
+++ b/rde/features/wm.scm
@@ -127,7 +127,9 @@
                        (file-append foot "/bin/foot")))
           (default-application-launcher
             (get-value 'default-application-launcher config
                        (file-append bemenu "/bin/bemenu-run -l 20 -p run:"))))
                        (file-append bemenu "/bin/bemenu-run -l 20 -p run:")))
           (default-pass-prompt
             (get-value 'default-pass-prompt config)))
      (list
       (service
        home-sway-service-type
@@ -144,6 +146,7 @@
            (set $backup-term ,backup-terminal)
            (set $menu ,default-application-launcher)
            (set $lock ,lock-cmd)
            (set $pass-prompt ,default-pass-prompt)

            (floating_modifier $mod normal)

@@ -163,6 +166,7 @@

            (bindsym --to-code $mod+Shift+d exec $menu)
            (bindsym --to-code $mod+Shift+l exec $lock)
            (bindsym --to-code $mod+Shift+p exec $pass-prompt)

            (,#~"\n\n# Manipulating windows:")
            (bindsym --to-code $mod+Shift+c kill)
-- 
2.37.3
Details
Message ID
<87tu523x84.fsf@trop.in>
In-Reply-To
<20220917132904.15848-1-ngraves@ngraves.fr> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
On 2022-09-17 15:29, Nicolas Graves wrote:

> ---
>  rde/features/emacs.scm          | 19 +++++++++++++++++++
>  rde/features/password-utils.scm | 13 ++-----------
>  rde/features/wm.scm             |  6 +++++-
>  3 files changed, 26 insertions(+), 12 deletions(-)
>
> diff --git a/rde/features/emacs.scm b/rde/features/emacs.scm
> index 1ab77f9..51dd8b2 100644
> --- a/rde/features/emacs.scm
> +++ b/rde/features/emacs.scm
> @@ -209,6 +209,7 @@ environment outside of Guix Home."
>            (extra-early-init-el '())
>            (default-terminal? #t)
>            (default-application-launcher? #t)
> +          (default-pass-prompt? #f)
>            (disable-warnings? #t)
>            (auto-update-buffers? #t)
>            (auto-clean-space? #t))
> @@ -216,6 +217,7 @@ environment outside of Guix Home."
>    (ensure-pred boolean? emacs-server-mode?)
>    (ensure-pred boolean? default-terminal?)
>    (ensure-pred boolean? default-application-launcher?)
> +  (ensure-pred boolean? default-pass-prompt?)
>    (ensure-pred boolean? disable-warnings?)
>    (ensure-pred boolean? auto-update-buffers?)
>    (ensure-pred boolean? auto-clean-space?)
> @@ -254,6 +256,20 @@ environment outside of Guix Home."
>                             "-F"
>                             "((minibuffer . only) (width . 120) (height . 11))")))
>  
> +(define emacs-pass-prompt
> +    (program-file
> +     "emacs-pass-prompt"
> +     #~(system* #$emacs-client-create-frame
> +                ;; https://git.sr.ht/~bruun/home/tree/master/item/.config/emacs/bruun/bruun-emacs-menu.el
> +                "--eval" "(progn \
> +(set-frame-name \"pass - Emacs Client\") \
> +(let ((current-frame (selected-frame))) \
> +  (unwind-protect \
> +      (command-execute 'rde-consult-pass) \
> +    (delete-frame current-frame))))"
> +                "-F"
> +                "((minibuffer . only) (width . 120) (height . 11))")))
> +
>    (define (emacs-home-services config)
>      "Returns home services related to GNU Emacs."
>      (require-value 'full-name config)
> @@ -538,6 +554,9 @@ It can contain settings not yet moved to separate features."
>                  '())
>              (if default-application-launcher?
>                     `((default-application-launcher . ,emacs-application-launcher))
> +                   '())
> +            (if default-pass-prompt?
> +                   `((default-pass-prompt . ,emacs-pass-prompt))
>                     '())))
>     (home-services-getter emacs-home-services)))
>  
> diff --git a/rde/features/password-utils.scm b/rde/features/password-utils.scm
> index cde214b..369fb40 100644
> --- a/rde/features/password-utils.scm
> +++ b/rde/features/password-utils.scm
> @@ -41,20 +41,11 @@
>  	      "/.local/var/lib/password-store")
>  	     remote-password-store-url)))
>  
> -          (when (get-value 'emacs config)
> +          (when (get-value 'default-pass-prompt config)
>              (emacs-xdg-service
>               'pass
>               "Emacs (Client) [pass]"
> -             #~(system* #$(get-value 'emacs-client-create-frame config)
> -;; https://git.sr.ht/~bruun/home/tree/master/item/.config/emacs/bruun/bruun-emacs-menu.el
> -                        "--eval" "(progn \
> -(set-frame-name \"pass - Emacs Client\") \
> -(let ((current-frame (selected-frame))) \
> -  (unwind-protect \
> -      (command-execute 'rde-consult-pass) \
> -    (delete-frame current-frame))))"
> -                        "-F"
> -                        "((minibuffer . only) (width . 120) (height . 11))")))
> +             #~(system* #$(get-value 'default-pass-prompt config))))
>  
>            (when (get-value 'emacs config)
>              (let ((emacs-embark (get-value 'emacs-embark config))
> diff --git a/rde/features/wm.scm b/rde/features/wm.scm
> index efeaee8..b5dd116 100644
> --- a/rde/features/wm.scm
> +++ b/rde/features/wm.scm
> @@ -127,7 +127,9 @@
>                          (file-append foot "/bin/foot")))
>             (default-application-launcher
>               (get-value 'default-application-launcher config
> -                        (file-append bemenu "/bin/bemenu-run -l 20 -p run:"))))
> +                        (file-append bemenu "/bin/bemenu-run -l 20 -p run:")))
> +           (default-pass-prompt
> +             (get-value 'default-pass-prompt config)))
>        (list
>         (service
>          home-sway-service-type
> @@ -144,6 +146,7 @@
>              (set $backup-term ,backup-terminal)
>              (set $menu ,default-application-launcher)
>              (set $lock ,lock-cmd)
> +            (set $pass-prompt ,default-pass-prompt)
>  
>              (floating_modifier $mod normal)
>  
> @@ -163,6 +166,7 @@
>  
>              (bindsym --to-code $mod+Shift+d exec $menu)
>              (bindsym --to-code $mod+Shift+l exec $lock)
> +            (bindsym --to-code $mod+Shift+p exec $pass-prompt)
>  
>              (,#~"\n\n# Manipulating windows:")
>              (bindsym --to-code $mod+Shift+c kill)

Thank you for the patch.  Implemented the same functionality slightly
other way.

-- 
Best regards,
Andrew Tropin
Reply to thread Export thread (mbox)