diff options
| author | Richard M. Stallman | 2005-04-30 20:12:13 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-04-30 20:12:13 +0000 |
| commit | f6c9b68362f40a48c21176cf49de74be14f11988 (patch) | |
| tree | 1725c587f44681e7a85fa46466597fd445a5be71 /src | |
| parent | 600e4de59290fa16e2ce4cc3bcf138bfb8a258f3 (diff) | |
| download | emacs-f6c9b68362f40a48c21176cf49de74be14f11988.tar.gz emacs-f6c9b68362f40a48c21176cf49de74be14f11988.zip | |
(Ffind_file_name_handler): Handle the `operations'
property of the file name handler.
(Qoperations): New variable.
(syms_of_fileio): Initialize and staticpro it.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/fileio.c b/src/fileio.c index 45c9d3463f7..24b6080251f 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -175,6 +175,10 @@ Lisp_Object Vdefault_file_name_coding_system; | |||
| 175 | whose I/O is done with a special handler. */ | 175 | whose I/O is done with a special handler. */ |
| 176 | Lisp_Object Vfile_name_handler_alist; | 176 | Lisp_Object Vfile_name_handler_alist; |
| 177 | 177 | ||
| 178 | /* Property name of a file name handler, | ||
| 179 | which gives a list of operations it handles.. */ | ||
| 180 | Lisp_Object Qoperations; | ||
| 181 | |||
| 178 | /* Lisp functions for translating file formats */ | 182 | /* Lisp functions for translating file formats */ |
| 179 | Lisp_Object Qformat_decode, Qformat_annotate_function; | 183 | Lisp_Object Qformat_decode, Qformat_annotate_function; |
| 180 | 184 | ||
| @@ -366,13 +370,16 @@ use the standard functions without calling themselves recursively. */) | |||
| 366 | elt = XCAR (chain); | 370 | elt = XCAR (chain); |
| 367 | if (CONSP (elt)) | 371 | if (CONSP (elt)) |
| 368 | { | 372 | { |
| 369 | Lisp_Object string; | 373 | Lisp_Object string = XCAR (elt); |
| 370 | int match_pos; | 374 | int match_pos; |
| 371 | string = XCAR (elt); | 375 | Lisp_Object handler = XCDR (elt); |
| 376 | Lisp_Object operations = Fget (handler, Qoperations); | ||
| 377 | |||
| 372 | if (STRINGP (string) | 378 | if (STRINGP (string) |
| 373 | && (match_pos = fast_string_match (string, filename)) > pos) | 379 | && (match_pos = fast_string_match (string, filename)) > pos |
| 380 | && (NILP (operations) || ! NILP (Fmemq (operation, operations)))) | ||
| 374 | { | 381 | { |
| 375 | Lisp_Object handler, tem; | 382 | Lisp_Object tem; |
| 376 | 383 | ||
| 377 | handler = XCDR (elt); | 384 | handler = XCDR (elt); |
| 378 | tem = Fmemq (handler, inhibited_handlers); | 385 | tem = Fmemq (handler, inhibited_handlers); |
| @@ -6437,6 +6444,7 @@ init_fileio_once () | |||
| 6437 | void | 6444 | void |
| 6438 | syms_of_fileio () | 6445 | syms_of_fileio () |
| 6439 | { | 6446 | { |
| 6447 | Qoperations = intern ("operations"); | ||
| 6440 | Qexpand_file_name = intern ("expand-file-name"); | 6448 | Qexpand_file_name = intern ("expand-file-name"); |
| 6441 | Qsubstitute_in_file_name = intern ("substitute-in-file-name"); | 6449 | Qsubstitute_in_file_name = intern ("substitute-in-file-name"); |
| 6442 | Qdirectory_file_name = intern ("directory-file-name"); | 6450 | Qdirectory_file_name = intern ("directory-file-name"); |
| @@ -6471,6 +6479,7 @@ syms_of_fileio () | |||
| 6471 | Qset_visited_file_modtime = intern ("set-visited-file-modtime"); | 6479 | Qset_visited_file_modtime = intern ("set-visited-file-modtime"); |
| 6472 | Qauto_save_coding = intern ("auto-save-coding"); | 6480 | Qauto_save_coding = intern ("auto-save-coding"); |
| 6473 | 6481 | ||
| 6482 | staticpro (&Qoperations); | ||
| 6474 | staticpro (&Qexpand_file_name); | 6483 | staticpro (&Qexpand_file_name); |
| 6475 | staticpro (&Qsubstitute_in_file_name); | 6484 | staticpro (&Qsubstitute_in_file_name); |
| 6476 | staticpro (&Qdirectory_file_name); | 6485 | staticpro (&Qdirectory_file_name); |