unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jean Louis <bugs@gnu.support>
To: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: 31.0.50; shell, virtualenv
Date: Mon, 16 Dec 2024 12:20:40 +0300	[thread overview]
Message-ID: <Z1_w6PxTs1PClpne@lco2> (raw)
In-Reply-To: <1c08db0b-270c-48e0-a5e0-6092bfee40ef@easy-emacs.de>

* Andreas Röhler <andreas.roehler@easy-emacs.de> [2024-12-16 11:54]:
> Have in init a command like that:
> 
> (defun aktivate-My-shell-virtualenv-root()
>   (interactive)
>   (when (boundp 'My-shell-virtualenv-root)
>     (unless (string= "" My-shell-virtualenv-root)
>       (dired My-shell-virtualenv-root)
>       (setq default-directory My-shell-virtualenv-root)
>       (shell)
>       (virtualenv-activate My-shell-virtualenv-root))))

You could ensure that `My-shell-virtualenv-root' is string by using:

(unless (and My-shell-virtualenv-root
	     (stringp My-shell-virtualenv-root)
	     (string= "" My-shell-virtualenv-root))

and I guess you may do this too:

(unless (and (boundp 'My-shell-virtualenv-root) ;; that it is bound
	     My-shell-virtualenv-root           ;; that it is not NIL
	     (stringp My-shell-virtualenv-root) ;; that it is string
	     (string= "" My-shell-virtualenv-root)) ;; that string is empty string

-- 
Jean Louis



      reply	other threads:[~2024-12-16  9:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-16  8:51 31.0.50; shell, virtualenv Andreas Röhler
2024-12-16  9:20 ` Jean Louis [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z1_w6PxTs1PClpne@lco2 \
    --to=bugs@gnu.support \
    --cc=andreas.roehler@easy-emacs.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).