3

There are 5 Elisp commands that can be run on an Emacs fileset, plus the ability to run any shell command. What about all the other Emacs commands? Just to give one example, it would be nice to be able to run M-x occur on a fileset.

I know its possible to mark several files in dired and then run any Emacs command on them (is that true, or am I confused with shell commands?), but it would be very convenient to define a fileset once and then be able to use it like one single file for all kinds of text editing.

Thanks for any advice

4 Answers 4

2

The commands that can operate on file sets are specified in the global custom variable "filesets-commands". You can add your own commands to that list. The default value for this variable is:

("Isearch" multi-isearch-files
  (filesets-cmd-isearch-getargs))
 ("Isearch (regexp)" multi-isearch-files-regexp
  (filesets-cmd-isearch-getargs))
 ("Query Replace" perform-replace
  (filesets-cmd-query-replace-getargs))
 ("Query Replace (regexp)" perform-replace
  (filesets-cmd-query-replace-regexp-getargs))
 ("Grep <<selection>>" "grep"
  ("-n " filesets-get-quoted-selection " " "<<file-name>>"))
 ("Run Shell Command" filesets-cmd-shell-command
  (filesets-cmd-shell-command-getargs)))

The values consist of an association list of names, functions, and an argument list (or a function that returns one) to be run on a filesets' files. So, if you wanted to add a command that does an "occur" command on the file set, you could use the "Isearch" entry as an example to create your own new entry (that you would add to the "filesets-commands" global variable) that would look something like:

 ("Occur (regexp)" multi-occur-files-regexp
  (filesets-cmd-occur-getargs))

You would need to write the "multi-occur-files-regexp" and "filesets-cmd-occur-getargs" functions (you could use the existing "multi-isearch-files-regexp" and "filesets-cmd-isearch-getargs" functions as a basis since they would be similar). The same would apply for any additional Emacs command that you wanted to add to work on file sets.

0
1

Dired has several operations on filesets. An example is dired-do-search (bound to A), where you can navigate through search results on several files with M-, just like with tags-search. Similarly, you can query-replace in tagged files (with Q).

The recent posts on irreal.org describe some nice dired features.

1
  • Nice link - very interesting blog indeed. And thanks for the Dired tips, so much to learn (and to remember ..)
    – Thorsten
    Aug 16, 2011 at 18:25
0

With Icicles you can use filesets for anything you might want to do with a set of files and directories. And you can create a fileset from any set of file and directory names in buffer Completions during completion. And you can use substring and regexp matching during completion to get such a set of file names in Completions.

These links might help:

http://www.emacswiki.org/emacs/Icicles_-_Persistent_Completions#Filesets

http://www.emacswiki.org/emacs/Icicles_-_Dired_Enhancements#OpenDiredOnSavedFiles

http://www.emacswiki.org/emacs/Icicles_-_Dired_Enhancements#MarkedFilesAsProject

http://www.emacswiki.org/emacs/Icicles_-_Customization_and_General_Tips#icicle-filesets-as-saved-completion-sets-flag

1
  • 1
    The Emacs universe seems to be like the real universe - without limits. Thanks, amazing stuff.
    – Thorsten
    Aug 19, 2011 at 22:01
0

Dired+ has command diredp-fileset, which opens Dired on an Emacs fileset. You are prompted for the fileset to use.

4
  • I do have Dired+ installed, but M-x diredp-fileset results in message 'feature filesets not provided'.
    – Thorsten
    Sep 15, 2011 at 8:32
  • That means that library filesets.el is not in your load-path. Command diredp-fileset requires that library -- the first thing the command does is try to load that library. If it is not found then it raises the error you saw. Emacs releases 22 and later come with filesets.el. Otherwise, you can probably google for it, but you might need to find out if it works with your Emacs version. See also filesets+.el, which fixes some limitations in filesets.el.
    – Drew
    Nov 19, 2011 at 23:56
  • @Drew It might also mean that filesets-data is nil. It would be very kind if this case had a different diagnostic message. Best regards, Tobias
    – Tobias
    Nov 10, 2015 at 10:21
  • @Tobias: Good idea - done. Please try the latest dired+.el.
    – Drew
    Nov 10, 2015 at 17:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.