all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Question Regarding Why Hydra For SSH Connections Isn't Working
@ 2022-02-07 21:56 Samuel Banya
  2022-02-08  8:36 ` Michael Albinus
  0 siblings, 1 reply; 3+ messages in thread
From: Samuel Banya @ 2022-02-07 21:56 UTC (permalink / raw)
  To: Emanuel Berg

Hey there,
*
*
*Can anyone help me figure out why my Hydra isn't working:*

`  (if (equal (system-name) '("notestation" "fossastation"))`

`    ;; Create separate connection based functions to later call within the 'hydra-connect' hydra:`

`    (defun ssh-into-musimatic-sam ()`

`      (interactive)`

`      (find-file "/ssh:sam@musimatic.xyz:/var/www/musimatic"))`



`    (defun ssh-into-musimatic-git ()`

`      (interactive)`

`      (find-file "/ssh:git@musimatic.xyz:/var/www/musimatic"))  `



`    (defun ssh-into-musimatic-root ()`

`      (interactive)`

`      (find-file "/ssh:root@musimatic.xyz:/var/www/musimatic"))`



`    (defun ssh-into-sambanya-sam ()`

`      (interactive)`

`      (find-file "/ssh:sam@sambanya.com:/var/www/sambanya"))`



`    (defun ssh-into-sambanya-root ()`

`      (interactive)`

`      (find-file "/ssh:root@sambanya.com:/var/www/sambanya"))`



`    (defun ssh-into-fedoraserver-sam ()`

`      (interactive)`

`      (find-file "/ssh:sam@fedoraserver:/media/REDHDD"))`



`    (defhydra hydra-connect (:color pink`

`    :hint nil)`

`      "`

`    ^Connect^`

`    ^^^^^^^^^^-----------------------------`

`    _a_: connect to musimatic.xyz as sam user`

`    _b_: connect to musimatic.xyz as git user`

`    _c_: connect to musimatic.xyz as root user`

`    _d_: connect to sambanya.com as sam user`

`    _e_: connect to sambanya.com as root user`

`    _f_: connect to fedoraserver as sam user`

`    _q_: quit`

`    "`

`      ("a" ssh-into-musimatic-sam)`

`      ("b" ssh-into-musimatic-git)    `

`      ("c" ssh-into-musimatic-root)`

`      ("d" ssh-into-sambanya-sam)`

`      ("e" ssh-into-sambanya-root)`

`      ("f" ssh-into-fedoraserver-sam)`

`      ("q" nil))`


`    (global-set-key (kbd "M-n") 'hydra-connect/body))`


`*CONTINUED:*`
`*When I try to run the above hydra, and use the 'a' key, I get the following message:*`
Wrong type argument: commandp, ssh-into-musimatic-sam
`**`
`Thanks!`

`Sam`


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Question Regarding Why Hydra For SSH Connections Isn't Working
  2022-02-07 21:56 Question Regarding Why Hydra For SSH Connections Isn't Working Samuel Banya
@ 2022-02-08  8:36 ` Michael Albinus
  2022-02-08 14:36   ` Samuel Banya
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Albinus @ 2022-02-08  8:36 UTC (permalink / raw)
  To: Samuel Banya; +Cc: Emanuel Berg

"Samuel Banya" <sbanya@fastmail.com> writes:

> Hey there,

Hi Sam,

> *Can anyone help me figure out why my Hydra isn't working:*
>
>   (if (equal (system-name) '("notestation" "fossastation"))

This looks wrong. (system-name) returns a string, not a list. And (if ...)
allows only one form in its then-part. So I would write

(when (member (system-name) '("notestation" "fossastation")) ...)

> Thanks!
>
> Sam

Best regards, Michael.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Question Regarding Why Hydra For SSH Connections Isn't Working
  2022-02-08  8:36 ` Michael Albinus
@ 2022-02-08 14:36   ` Samuel Banya
  0 siblings, 0 replies; 3+ messages in thread
From: Samuel Banya @ 2022-02-08 14:36 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Emanuel Berg

Hey MIchael,

Thanks man, you're a wizard :)

But really, that did the trick!

Will apply this idea throughout the rest of my config :)

Thanks again,

Sam

On Tue, Feb 8, 2022, at 3:36 AM, Michael Albinus wrote:
> "Samuel Banya" <sbanya@fastmail.com> writes:
> 
> > Hey there,
> 
> Hi Sam,
> 
> > *Can anyone help me figure out why my Hydra isn't working:*
> >
> >   (if (equal (system-name) '("notestation" "fossastation"))
> 
> This looks wrong. (system-name) returns a string, not a list. And (if ...)
> allows only one form in its then-part. So I would write
> 
> (when (member (system-name) '("notestation" "fossastation")) ...)
> 
> > Thanks!
> >
> > Sam
> 
> Best regards, Michael.
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-08 14:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-07 21:56 Question Regarding Why Hydra For SSH Connections Isn't Working Samuel Banya
2022-02-08  8:36 ` Michael Albinus
2022-02-08 14:36   ` Samuel Banya

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.