This file is indexed.

/usr/share/jed/lib/bufed.sl is in jed-common 1:0.99.19-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
% -*- SLang -*-		bufed.sl
%
% Simple JED `bufed' mode by Mark Olesen <olesen@me.QueensU.CA>
%
% Bufed is a simple buffer manager -- patterned somewhat after dired.
% Provides easy, interactive switching, saving and killing of buffers.
%
% To invoke Bufed, do `M-x bufed'.
% Or re-bind to the key sequence which is normally bound to the
% `list_buffers' function `C-x C-b' (emacs)
%
% ------------------------------------------------------------------------
% TO USE THIS MODE: add the line
%
%	autoload ("bufed", "bufed");		to ~/.jedrc
%
% and optionally re-bind to the `C-x C-b' (emacs) key sequence
%
%	setkey ("bufed", "^X^B");
% ------------------------------------------------------------------------

variable Bufed_buf = "*BufferList*";	% as used by `list_buffers' (buf.sl)

% save the buffer
define bufed_savebuffer (buf)
{
   variable file, dir, flags, ch, this_buf;

   ch = int (buf);
   if ((ch == 32) or (ch == '*')) return;	% internal buffer or special

   this_buf = whatbuf ();
   (file,dir,,flags) = getbuf_info (buf);

   if (strlen (file) and (flags & 1))	% file assciated with it
     {
	setbuf (buf);
	ERROR_BLOCK { setbuf (this_buf); }
	() = write_buffer (dircat (dir, file));
     }
}

% extract the buffer name associated with the current line
% Note: The details of this routine will depend upon how buf.sl formats
%       the line.  Currently, this looks like:
% ----------- 0000    "*scratch*"		    /aluche/h1/davis/src/jed/lib/

define bufed_get ()
{
   variable buf;

   push_spot_bol ();
   EXIT_BLOCK { pop_spot (); }

   !if (ffind_char ('"'))
     return Null_String;

   go_right_1 ();
   push_mark ();
   !if (ffind_char ('"'))
     {
	pop_mark_1 ();
	return Null_String;
     }
   
   buf = bufsubstr ();
   !if (bufferp (buf)) buf = "";
   return buf;
}

define list_buffers ()
{
   variable i, j, tmp, this, name, flags, flag_chars, skip;
   variable umask;
   variable name_col, dir_col, mode_col;
   
   name_col = 21;
   mode_col = 13;
   dir_col = 45;
   
   skip = 0;
   if (prefix_argument(-1) == -1) skip = 1;
   tmp = "*BufferList*";
   this = whatbuf();
   pop2buf(tmp);
   set_readonly(0);
   erase_buffer();
   TAB = 8;
   
   flag_chars = "CBKN-UORDAM";
   insert ("  Flags");
   goto_column (mode_col);
   insert ("umask");
   goto_column (name_col);
   insert ("Buffer Name");
   goto_column(dir_col); insert("Dir/File\n");
   
   loop (buffer_list())
     {
	name = ();
	if (skip and (int(name) == ' ')) continue;   %% internal buffers begin with a space
	flags = getbuf_info (name);    % more on stack
	umask = set_buffer_umask (-1);
	bol();
	i = 0x400; j = 0;
	while (i)
	  {
	     if (flags & i) flag_chars[j]; else '-';
	     insert_char (());
	     i = i shr 1; j++;
	  }
	goto_column (mode_col);
	vinsert ("0%03o", umask);
	goto_column (name_col);
	
	% Since the buffername may contain whitespace, enclose it in quotes
	insert_char ('"');
	insert(()); %% buffer name
	insert_char ('"');

	goto_column(dir_col);
	!if (eolp())
	  {
	     eol(); insert_single_space();
	  }
	
	insert(()); insert(());               %% dir/file
	newline();
     }
   
   insert("\nU:Undo O:Overwrite R:Readonly D:Disk File Changed, A:Autosave, M:Modified\n");
   insert("C:CRmode, B:Binary File, K:Not backed up, N:No autosave");

   bob ();
   set_buffer_modified_flag (0);
   set_readonly (1);
   pop2buf(this);
}

private variable Line_Mark;
private define update_bufed_hook ()
{
   Line_Mark = create_line_mark (color_number ("menu_selection"));
}

define bufed_list ()
{
   Line_Mark = NULL;
   check_buffers ();
   list_buffers ();
   pop2buf (Bufed_buf);
   set_buffer_hook ("update_hook", &update_bufed_hook);
   set_readonly (0);
   bob();
   insert ("Press '?' for help.  Press ENTER to select a buffer.\n\n");
   set_readonly (0);
   set_buffer_modified_flag(0);
   go_down (1);
   %goto_column (21);
}

% kill a buffer, if it has been modified then pop to it so it's obvious
define bufed_kill ()
{
   variable file, dir, flags, buf = bufed_get ();
   variable line;

   !if (strlen (buf)) return;

   line = what_line ();
   (file,dir,,flags) = getbuf_info (buf);

   if (flags & 1)		% modified
     {
	pop2buf (buf);
	update (1);
     }
   delbuf (buf);
   if (strcmp (buf, Bufed_buf))
     bufed_list ();
   goto_line (line);
}

define bufed_save ()
{
   variable buf = bufed_get ();
   !if (int (buf)) return;
   bufed_savebuffer (buf);
}

% try to re-load the file from disk
define bufed_update ()
{
   variable file, dir, flags;
   (file,dir,,flags) = getbuf_info ();
   if (flags & 2)		% file on disk modified?
     {
	!if (find_file (dircat (dir, file)))
	  error ("Error reading file");
     }
}


define bufed_pop2buf ()
{
   variable buf = bufed_get ();

   !if (int (buf)) return;

   % if the buffer is already visible, scroll down
   buffer_visible (buf);	% leave on the stack
   pop2buf (buf);
   if (() and not(eobp ())) 
     call ("page_down");

   bufed_update ();
   pop2buf (Bufed_buf);
}

define bufed_sw2buf (one)
{
   variable buf = bufed_get ();
   !if (int (buf)) return;
   sw2buf (buf);
   bufed_update ();
   if (one) onewindow ();
}

define bufed_exit ()
{
   delbuf (whatbuf ());
}

variable Bufed_help;
Bufed_help = "k:kill, s:save, g:refresh, SPC,f:pop2buf, CR,TAB:sw2buf, q:quit, h:help, ?:this help";

define bufed_help ()
{
   message (Bufed_help);
}

$1 = "bufed";
!if (keymap_p ($1)) make_keymap ($1);
definekey ("bufed_list",	"g",	$1);
definekey ("describe_mode",	"h",	$1);
definekey ("bufed_kill",	"k",	$1);
definekey ("bufed_save",	"s",	$1);
definekey ("bufed_pop2buf",	"f",	$1);
definekey ("bufed_pop2buf",	" ",	$1);
definekey (".0 bufed_sw2buf",	"\r",	$1);
definekey (".1 bufed_sw2buf",	"\t",	$1);
definekey ("bufed_exit",	"q",	$1);
definekey ("bufed_help",	"?",	$1);

% Also possible,
%  U	toggle_undo
%  O	toggle_overwrite
%  R	toggle_readonly
%  C	toggle_crmode

%!%+
%\function{bufed}
%\synopsis{bufed}
%\description
% Mode designed to aid in navigating through multiple buffers
% patterned somewhat after dired.
% 
% To invoke Bufed, do \var{M-x bufed} or bind to \var{C-x C-b} (emacs)
% 
% \var{g}	Update the buffer listing.
% 
% \var{k}	Kill the buffer described on the current line, like typing
% 	\var{M-x kill_buffer} and supplying that buffer name.
% 
% \var{s}	Save the buffer described on the current line.
% 
% \var{f}, \var{SPC}, \var{CR}, \var{TAB}
% 	Visit the buffer described on the current line. 
% 	\var{f} and \var{SPC} will create a new window if required.
% 	\var{CR} will use the current window.
% 	\var{TAB} will revert to a single window.
% 
% \var{Q}	Quit bufed mode.
%!%-
define bufed ()
{
   variable mode = "bufed";
   variable this_buf;
   
   this_buf = sprintf ("\"%s\"", whatbuf ());
   bufed_list ();
   () = fsearch (this_buf);

   bufed_help ();
   use_keymap (mode);
   set_mode (mode, 0);
   run_mode_hooks ("bufed_hook");
}