From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 547 invoked from network); 18 Mar 2000 19:37:52 -0000 Received: from postoffice.telstra.net (HELO tpostoffice.telstra.net) (203.50.1.76) by ns1.primenet.com.au with SMTP; 18 Mar 2000 19:37:52 -0000 Received: from sunsite.auc.dk (sunsite.auc.dk [130.225.51.30]) by tpostoffice.telstra.net (8.9.3/8.9.3) with SMTP id FAA34520 for ; Sun, 19 Mar 2000 05:52:31 +1100 (EST) (envelope-from zsh-workers-return-10166-mason-zsh=primenet.com.au@sunsite.auc.dk) Received: (qmail 15161 invoked by alias); 18 Mar 2000 18:50:22 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10166 Received: (qmail 15149 invoked from network); 18 Mar 2000 18:50:21 -0000 Message-ID: <38D3CFDB.6DD75999@u.genie.co.uk> Date: Sat, 18 Mar 2000 18:50:03 +0000 From: Oliver Kiddle X-Mailer: Mozilla 4.72 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 To: Zsh workers Subject: PATCH: _xt_arguments and new _nedit Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Multiple -xrm options are allowed with xt applications so I've made a small patch for that. Also here is a new completion for nedit (see nedit.org if you don't know what it is). It would be nice if there was a way of using globbing, similar to *(w) and *(r) to match files which can be written to by the current process as opposed to the file's owner. Taking the nedit completion as an example, it would be useful to only complete files which can be written to because I don't want to edit those which are read-only. Oliver Kiddle --- Completion/X/_xt_arguments.bak Sat Mar 18 18:32:45 2000 +++ Completion/X/_xt_arguments Sat Mar 18 18:33:01 2000 @@ -41,7 +41,7 @@ '-selectionTimeout:selection timeout (milliseconds):_x_selection_timeout' '-title:title:_x_title' '-xnllanguage:locale:_x_locale' - '-xrm:resource:_x_resource' + '*-xrm:resource:_x_resource' '-xtsessionID:session ID:_xt_session_id' ) --- /dev/null Sat Mar 18 18:34:55 2000 +++ Completion/User/_nedit Sat Mar 18 18:25:27 2000 @@ -0,0 +1,49 @@ +#compdef nedit nc + +local state line expl nedit_common + +nedit_common=( \ + '-read[open file read only]' \ + "-create[create file if it doesn't already exist]" \ + '-line[go to specified line number]:line number' \ + '-do[execute macro or action commands]' \ + '-lm[specify language mode]:language mode:->lang' \ + '-svrname[name the server]:nedit server name' \ + '(-noiconic)-iconic[set initial window state to iconic]' \ + '*-xrm:resource:_x_resource' \ + '*:file:_files' ) + +if [[ $words[1] = *nc ]]; then + _x_arguments -C \ + '(-noask)-ask[prompt if no server found]' \ + '(-ask)-noask[start a new server without asking if none found]' \ + '-svrcmd[command to run server]:server command:_command_names -e' \ + "$nedit_common[@]" +else + _x_arguments -C \ + '-server[designate this session as an nedit server]' \ + '-tags[load ctags file]:tags file:_files' \ + '-tabs[specify tab width in characters]:tab width' \ + '(-nowrap -autowrap -noautowrap)-wrap[use continuous wrap mode]' \ + '(-wrap -autowrap -noautowrap)-nowrap[turn off continuous wrap mode]' \ + '(-wrap -nowrap -noautowrap)-autowrap[use auto-newline wrap mode]' \ + '(-wrap -nowrap -autowrap)-noautowrap[turn off auto-newline wrap mode]' \ + '(-noautoindent)-autoindent[maintain a running indent]' \ + '(-autoindent)-noautoindent[turn off autoindent]' \ + '(-noautosave)-autosave[maintain a backup copy of file being edited]' \ + "(-autosave)-noautosave[don't maintain a backup copy of file being edited]" \ + "(-iconic)-noiconic[don't set initial window state to iconic]" \ + '-rows[specify default height in characters for an editing window]:height' \ + '-columns[specify default width in characters for an editing window]:width' \ + '-font[specify font for text window]:font:_x_font' \ + '(-bg)-background:background color:_x_color' \ + '(-background)-bg[specify background color]:background color:_x_color' \ + '(-fg)-foreground:foreground color:_x_color' \ + '(-foreground)-fg[specify foreground color]:foreground color:_x_color' \ + '-import[load additional preferences file]:nedit preferences file:_files' \ + "$nedit_common[@]" +fi + +[[ $state = lang ]] && _wanted neditlanguages expl 'language mode' && + compadd "$expl[@]" - ${(f)"$(sed -n \ + '/^nedit.languageMode/,/^nedit/ s/.* \([^:]*\).*/\1/p' < ~/.nedit)"}