aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/opener.tes
blob: 59af79a61cecaacedea0a0419435a456233b35f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
!*$
 * M[opener] -- Open files, specified on the command line
 *
 * It supports both the +line[,column] and filename:line[:column] syntaxes.
 * Since this may make it hard to open files with certain file names, all
 * filenames after "--" are interpreted verbatim.
 * It does not change the current buffer.
 *!
@[opener]{ [*
  <%.i :Q[\.i]:; EQ[\.i]
    !* --/-S stops processing of special arguments *!
    0A--"= 1A--"= 2A"<
      <%.i :Q[\.i]:; EBN[\.i]> 1;
    '''

    1U.l 1U.c
    !* +line[,column] *!
    0A-+"= C 0A"D
      \U.l <0A"DC|1;'> 0A-,"= C \U.c <0A"DC|1;'> '
      0A"< %.i Oopen '
    ''

    !* filename:line[:column][:] *!
    ZJ -A-:"=R'
    0U.p <-%.pA"D|1;'> Q.pA-:"=
      Q.p+1C \U.a R 0U.p <-%.pA"D|1;'> Q.pA-:"=
        Q.p+1C \U.l Q.aU.c R
      |
        Q.aU.l 1U.c
      '
      !* FIXME: modifies the i *!
      .,ZD
    '

  !open!
    EBN[\.i] Q.c-1,Q.l-1ESFINDCOLUMN:J
  >
]* }

!*$
 * M[opener.check-recovery] -- Warn if there if a recovery file (#filename#) is detected
 *
 * This points to a prior crash or unexpected termination.
 *!
@[opener.check-recovery]{
  :Q*"=  '
  [*
    EQ.f G* I# R
    <-A"I 1; ' :R;>
    I#
    1:EN*Q.f"S
      !* FIXME: log as a true warning once  supports it *!
      Warning: Detected recovery file "Q.f"^J
    '
  ]*
}