# inspec+ovid.nm # # NEdit macro file # Put into ~/.nedit/ and load with # load_macro_file( getenv("HOME") "/.nedit/inspec+ovid.nm" ) # from ~/.nedit/autoload.nm. # # Copyright (C) by Volker Kuhlmann # Released under the same license as NEdit itself. # # Volker Kuhlmann # 31 Dec 2003 Created from ~/.neditmacro # 13 Jan 2004 Added license # # For Languages "inspec" + "ovid" # define sub_next_citation {# (regexp [, anything for not EOL]) line=$line if ($n_args <= 1) # if second arg given, do NOT go to end-of-line end_of_line() find($1, "forward", "regex") if ($line < line) { beep() end_of_file() } else { scroll_to_line($line) beginning_of_line() } } define sub_copy_entry {# (regexp) # this also works for before-the-first (for the 1st) and past the last # (for the last) entry line=$line end_of_line() find($1, "backward", "regex") if ($line > line) { beginning_of_file() find($1, "forward", "regex") } mark(1) find($1, "forward", "regex") beginning_of_line() if ($line < line) end_of_file() deselect_all() goto_mark(1, "extend") copy_clipboard() beginning_of_line() sub_next_citation($1,2) } define sub_cut_entry { # this also works for before-the-first (for the 1st) and past the last # (for the last) entry line=$line end_of_line() find($1, "backward", "regex") if ($line > line) { beginning_of_file() find($1, "forward", "regex") } mark(1) find($1, "forward", "regex") beginning_of_line() if ($line < line) end_of_file() deselect_all() goto_mark(1, "extend") cut_clipboard() beginning_of_line() sub_next_citation($1,2) } # For Language "ovid" # define ovid_next_citation { ##process_down() #line=$line #end_of_line() #find("^Accession", "forward", "regex") ##scroll_to_line($line) #beginning_of_line() #if ($line < line) { # beep() # end_of_file() #} else { # scroll_to_line($line) # beginning_of_line() #} sub_next_citation("^.*\n^Accession") } define ovid_copy_entry { sub_copy_entry("^<\\<[0-9]*\\>>") } define ovid_cut_entry { sub_cut_entry("^<\\<[0-9]*\\>>") } # for language "inspec" # define inspec_next_citation { sub_next_citation("^ INSPEC ") } define inspec_copy_entry { sub_copy_entry("^ INSPEC ") } define inspec_cut_entry { sub_cut_entry("^ INSPEC ") }