unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: "Trent W. Buck" <trentbuck@gmail.com>, 58137@debbugs.gnu.org
Subject: bug#58137: 28.1; M-x setenv RET PATH RET should default to the current $PATH
Date: Wed, 28 Sep 2022 09:35:50 -0400	[thread overview]
Message-ID: <CADwFkmkiiMn4uYhbnzce_zZqd6WX79ncizKKrXuF4m-nH4oO7Q@mail.gmail.com> (raw)
In-Reply-To: <87o7uzg6ul.fsf@gmail.com>

tags 58137 + moreinfo
thanks

"Trent W. Buck" <trentbuck@gmail.com> writes:

> I wish M-x setenv, when setting a variable that already has a value,
> defaulted to that value (instead of the empty string).
>
> This would make it easier to make minor adjustments to a long messy value.
> The history is already there (M-p), but it's input history.

AFAICT, M-p already brings in the previous value of the variable, if it
was set:

     (let* ((var (read-envvar-name "Set environment variable: " nil))
	    (value (getenv var)))
       (when value
	 (add-to-history 'setenv-history value))
       ;; Here finally we specify the args to give call setenv with.
       (list var
	     (read-from-minibuffer (format "Set %s to value: " var)
				   nil nil nil 'setenv-history
				   value)
	     t))))

> If the variable was initially set outside of Emacs, it won't be in history.

Do you have a recipe to reproduce this?

What is the value of (getenv "FOO") before you run `M-x setenv'?





      parent reply	other threads:[~2022-09-28 13:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28  9:56 bug#58137: 28.1; M-x setenv RET PATH RET should default to the current $PATH Trent W. Buck
2022-09-28 11:14 ` Lars Ingebrigtsen
2022-09-29  3:26   ` Trent W. Buck
2022-09-28 12:42 ` Gregory Heytings
2022-09-28 12:45 ` Andreas Schwab
2022-09-28 13:09 ` Robert Pluim
2022-09-28 14:28   ` Gregory Heytings
2022-09-28 14:56     ` Robert Pluim
2022-09-28 13:35 ` Stefan Kangas [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=CADwFkmkiiMn4uYhbnzce_zZqd6WX79ncizKKrXuF4m-nH4oO7Q@mail.gmail.com \
    --to=stefankangas@gmail.com \
    --cc=58137@debbugs.gnu.org \
    --cc=trentbuck@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

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

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).