zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk
Subject: Re: PATCH: newuser system
Date: Thu, 24 Nov 2005 11:42:11 +0000	[thread overview]
Message-ID: <20051124114211.1fc867ab.pws@csr.com> (raw)
In-Reply-To: <1051124060054.ZM29995@candle.brasslantern.com>

Bart Schaefer <schaefer@brasslantern.com> wrote:
> This is an impressive piece of work.

Thank you.

> } As this will be seen by a great many new users it
> } really needs to be tested as widely as possible.
> 
> Am I wrong in thinking this could be tested by starting the shell with
> ZDOTDIR in the environment pointing to an empty directory?

That works fine.  Anyone can try it out by:

mkdir /tmp/zdotdir
autoload -Uz zsh-newuser-install
ZDOTDIR=/tmp/zdotdir zsh-newuser-install

(add -f to the end if there's already a .zshrc there.)

> } Index: INSTALL
> } +"name=zsh/newuser" int the config.modules file, which is generated in the
>                        ^^
> (I didn't proofread the rest so closely, I fear.)

I'll check that in.

> } +# Substitute an initial ~ for human consumption.
> } +if [[ $zd = $HOME ]]; then
> } +  zdmsg="~"
> } +else
> } +  zdmsg=$zd
> } +fi
> 
>   zdmsg=${(%):-%~}
> 
> (How's *that* for obfuscation?)

That would deserve another "snicker", but $zd isn't necessarily the current
directory at that point, and we'd like to keep the directory after the
function exits... still, it's certainly a good idea to fix directories
under $HOME and I've done that in the patch.

> Regarding keymaps ... it might be helpful if the explanatory text were
> to recommend choosing the emacs keymap, as that's the one assumed by
> most of the completion system initialization and the one most similar
> to other line editors (e.g. bash/readline).

This is the message you get when you enter the appropriate menu, so it's
explained... but maybe I could set the initial state to "Recommended" and
the default so that it picks "bindkey -e" unless you explicitly tell it not
to?  (This is what happens in the history menu---if you pick that option it
sets your HISTSIZE and SAVEHIST to 1000 unless you explicitly edit them.)


Default editing configuration
=============================

The keys in the shell's line editor can be made to behave either
like Emacs or like Vi, two common Unix editors.  If you have no
experience of either, Emacs is recommended.  If you don't pick one,
the shell will try to guess based on the EDITOR environment variable.
Usually it's better to pick one explicitly.

# (1) Change default editing configuration
# bindkey -e                                                     (no value set)

# (0) or (q)  Return to main menu (no changes made yet)

--- Type one of the keys in parentheses ---


Index: INSTALL
===================================================================
RCS file: /cvsroot/zsh/zsh/INSTALL,v
retrieving revision 1.20
diff -u -r1.20 INSTALL
--- INSTALL	23 Nov 2005 11:29:20 -0000	1.20
+++ INSTALL	24 Nov 2005 11:40:59 -0000
@@ -243,7 +243,7 @@
 /usr/local/share/zsh/<VERSION>/scripts/newuser).  This feature can be
 turned off simply by removing this script.  The module can be removed
 entirely from the configured shell by editing the line starting
-"name=zsh/newuser" int the config.modules file, which is generated in the
+"name=zsh/newuser" in the config.modules file, which is generated in the
 top level distribution directory during configuration: change the line to
 include "link=no auto=no".
 
Index: Functions/Newuser/zsh-newuser-install
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Newuser/zsh-newuser-install,v
retrieving revision 1.2
diff -u -r1.2 zsh-newuser-install
--- Functions/Newuser/zsh-newuser-install	23 Nov 2005 11:29:21 -0000	1.2
+++ Functions/Newuser/zsh-newuser-install	24 Nov 2005 11:41:00 -0000
@@ -61,8 +61,8 @@
 trap 'save=0' HUP INT QUIT
 
 # Substitute an initial ~ for human consumption.
-if [[ $zd = $HOME ]]; then
-  zdmsg="~"
+if [[ $zd = $HOME(#b)(|/*) ]]; then
+  zdmsg="~$match[1]"
 else
   zdmsg=$zd
 fi

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com


  parent reply	other threads:[~2005-11-24 11:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-23 11:13 Peter Stephenson
2005-11-24  6:00 ` Bart Schaefer
2005-11-24  6:17   ` Clint Adams
2005-11-24  6:28   ` Danek Duvall
2005-11-24 11:42   ` Peter Stephenson [this message]
2005-11-24 18:20     ` Bart Schaefer
2005-11-25 10:24       ` Peter Stephenson
2005-11-26 23:18         ` Bart Schaefer
2005-11-24 18:52     ` Wayne Davison
2005-11-29  1:58 ` Geoff Wing
2006-02-18  8:42   ` newuser in 4.3.0-dev-4 (Was: PATCH: newuser system) Geoff Wing
2006-02-18 12:57     ` Peter Stephenson
2006-02-19  5:13       ` Geoff Wing
2006-02-20 11:09         ` Peter Stephenson

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

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

  git send-email \
    --in-reply-to=20051124114211.1fc867ab.pws@csr.com \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /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.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).