Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: _xt_arguments and new _nedit



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)"}



Messages sorted by: Reverse Date, Date, Thread, Author