Variable: filesets-ingroup-patterns

filesets-ingroup-patterns is a customizable variable defined in filesets.el.gz.

Value

Large value
(("^.+\\.tex$" t
  (((:name "Package")
    (:pattern
     "\\\\usepackage\\W*\\(\\[[^]]*\\]\\W*\\)?{\\W*\\(.+\\)\\W*}")
    (:match-number 2) (:stub-flag t)
    (:get-file-name
     #[514 "\300\301P\302\303\304!\206�\303\305!!#\207"
	   [filesets-which-file ".sty" filesets-convert-path-list
				getenv "MY_TEXINPUTS" "TEXINPUTS"]
	   8
	   ("/nix/store/yvwy8dm26cpa1j12ixgs1dyiaw2abdk9-emacs-snapshot/share/emacs/31.0.50/lisp/filesets.elc"
	    . 18822)]))
   ((:name "Include") (:pattern "\\\\include\\W*{\\W*\\(.+\\)\\W*}")
    (:get-file-name
     #[514 "\300\301P\302\303\304!\206�\303\305!!#\207"
	   [filesets-which-file ".tex" filesets-convert-path-list
				getenv "MY_TEXINPUTS" "TEXINPUTS"]
	   8
	   ("/nix/store/yvwy8dm26cpa1j12ixgs1dyiaw2abdk9-emacs-snapshot/share/emacs/31.0.50/lisp/filesets.elc"
	    . 18822)])
    (:scan-depth 5))
   ((:name "Input") (:pattern "\\\\input\\W*{\\W*\\(.+\\)\\W*}")
    (:stubp
     #[514 "\300\"?\207" [filesets-files-in-same-directory-p] 5
	   ("/nix/store/yvwy8dm26cpa1j12ixgs1dyiaw2abdk9-emacs-snapshot/share/emacs/31.0.50/lisp/filesets.elc"
	    . 18846)])
    (:get-file-name
     #[514 "\300\301P\302\303\304!\206�\303\305!!#\207"
	   [filesets-which-file ".tex" filesets-convert-path-list
				getenv "MY_TEXINPUTS" "TEXINPUTS"]
	   8
	   ("/nix/store/yvwy8dm26cpa1j12ixgs1dyiaw2abdk9-emacs-snapshot/share/emacs/31.0.50/lisp/filesets.elc"
	    . 18822)])
    (:scan-depth 5))
   ((:name "Bibliography")
    (:pattern "\\\\bibliography\\W*{\\W*\\(.+\\)\\W*}")
    (:get-file-name
     #[514 "\300\301P\302\303\304!\206�\303\305!!#\207"
	   [filesets-which-file ".bib" filesets-convert-path-list
				getenv "MY_BIBINPUTS" "BIBINPUTS"]
	   8
	   ("/nix/store/yvwy8dm26cpa1j12ixgs1dyiaw2abdk9-emacs-snapshot/share/emacs/31.0.50/lisp/filesets.elc"
	    . 18822)]))))
 ("^.+\\.el$" t
  (((:name "Require") (:pattern "(require\\W+'\\(.+\\))")
    (:stubp
     #[514 "\300\"?\207" [filesets-files-in-same-directory-p] 5
	   ("/nix/store/yvwy8dm26cpa1j12ixgs1dyiaw2abdk9-emacs-snapshot/share/emacs/31.0.50/lisp/filesets.elc"
	    . 18846)])
    (:get-file-name
     #[514 "\301\302P#\207"
	   [load-path filesets-which-file ".el"] 6
	   ("/nix/store/yvwy8dm26cpa1j12ixgs1dyiaw2abdk9-emacs-snapshot/share/emacs/31.0.50/lisp/filesets.elc"
	    . 18822)]))
   ((:name "Load") (:pattern "(load\\(-library\\)?\\W+\"\\(.+\\)\")")
    (:match-number 2)
    (:get-file-name
     #[514 "\301#\207" [load-path filesets-which-file] 6
	   ("/nix/store/yvwy8dm26cpa1j12ixgs1dyiaw2abdk9-emacs-snapshot/share/emacs/31.0.50/lisp/filesets.elc"
	    . 18822)]))))
 ("^\\([A-ZÄÖÜ][a-zäöüß]+\\([A-ZÄÖÜ][a-zäöüß]+\\)+\\)$" t
  (((:pattern
     "\\<\\([A-ZÄÖÜ][a-zäöüß]+\\([A-ZÄÖÜ][a-zäöüß]+\\)+\\)\\>")
    (:scan-depth 5)
    (:stubp
     #[514 "\300\"?\207" [filesets-files-in-same-directory-p] 5
	   ("/nix/store/yvwy8dm26cpa1j12ixgs1dyiaw2abdk9-emacs-snapshot/share/emacs/31.0.50/lisp/filesets.elc"
	    . 18846)])
    (:case-sensitive t)
    (:get-file-name
     #[514 "\301\302\300!\205\n�#\207"
	   [emacs-wiki-directories filesets-which-file boundp] 7
	   ("/nix/store/yvwy8dm26cpa1j12ixgs1dyiaw2abdk9-emacs-snapshot/share/emacs/31.0.50/lisp/filesets.elc"
	    . 18822)])))))

Documentation

Inclusion group definitions.

Define how to find included file according to a file's mode (being defined by a file pattern).

A valid entry has the form (FILE-PATTERN REMOVE-DUPLICATES-FLAG CMD-DEF1 ...), CMD-DEF1 being a plist containing the fields :pattern
(mandatory), :name, :get-file-name, :match-number, :scan-depth,
:preprocess, :case-sensitive.

File Pattern ... A regexp matching the file's name for which the following rules should be applied.

Remove Duplicates ... If t, only the first occurrence of an included file is retained. (See below for a full explanation.)

:name STRING ... This pattern's name.

:pattern REGEXP ... A regexp matching the command. This regexp has to
include a group that holds the name of the included file.

:get-file-name FUNCTION (default: filesets-which-file) ... A function
that takes two arguments (the path of the master file and the name of the included file) and returns a valid path or nil -- if the subfile can't be found.

:match-number INTEGER (default: 1) ... The number of the match/group
in the pattern holding the subfile's name. 0 refers the whole match, 1 to the first group.

:stubp FUNCTION ... If (FUNCTION MASTER INCLUDED-FILE) returns non-nil,
INCLUDED-FILE is a stub -- see below.

:stub-flag ... Files of this type are stubs -- see below.

:scan-depth INTEGER (default: 0) ... Whether included files should be
rescanned. Set this to 0 to disable re-scanning of included file.

:preprocess FUNCTION ... A function modifying a buffer holding the
master file so that pattern matching becomes easier. This is usually used to narrow a buffer to the relevant region. This function could also be destructive and simply delete non-relevant text.

:case-sensitive BOOLEAN (default: nil) ... Whether a pattern is
case-sensitive or not.

Stubs:

First, a stub is a file that shows up in the menu but will not be included in an ingroup's file listing -- i.e. filesets will never operate on this file automatically. Secondly, in opposition to normal files stubs are not scanned for new inclusion groups. This is useful if you want to have quick access to library headers.

In the menu, an asterisk is appended to the stub's name.

Remove Duplicates:

E.g. File A and file B refer to file X; X refers to A. If you choose not to remove duplicates the tree would look like:

    M + A - X - A ...
        B - X - A ...

As you can see, there is some chance that you run in circles. Nevertheless, up to some degree this could still be what you want.

With duplicates removed, it would be:

    M + A - X
        B

Source Code

;; Defined in /usr/src/emacs/lisp/filesets.el.gz
(defcustom filesets-ingroup-patterns
  ;; FIXME: This value does not seem realistically editable via the Custom UI.
  `(("^.+\\.tex$" t
     (((:name "Package")
       (:pattern "\\\\usepackage\\W*\\(\\[[^]]*\\]\\W*\\)?{\\W*\\(.+\\)\\W*}")
       (:match-number 2)
       (:stub-flag t)
       (:get-file-name ,(lambda (master file)
			  (filesets-which-file master
					       (concat file ".sty")
					       (filesets-convert-path-list
						(or (getenv "MY_TEXINPUTS")
						    (getenv "TEXINPUTS")))))))
      ((:name "Include")
       (:pattern "\\\\include\\W*{\\W*\\(.+\\)\\W*}")
       (:get-file-name ,(lambda (master file)
			  (filesets-which-file master
					       (concat file ".tex")
					       (filesets-convert-path-list
						(or (getenv "MY_TEXINPUTS")
						    (getenv "TEXINPUTS"))))))
       (:scan-depth 5))
      ((:name "Input")
       (:pattern "\\\\input\\W*{\\W*\\(.+\\)\\W*}")
       (:stubp ,(lambda (a b) (not (filesets-files-in-same-directory-p a b))))
       (:get-file-name ,(lambda (master file)
			  (filesets-which-file master
					       (concat file ".tex")
					       (filesets-convert-path-list
						(or (getenv "MY_TEXINPUTS")
						    (getenv "TEXINPUTS"))))))
       (:scan-depth 5))
      ((:name "Bibliography")
       (:pattern "\\\\bibliography\\W*{\\W*\\(.+\\)\\W*}")
       (:get-file-name ,(lambda (master file)
			  (filesets-which-file master
					       (concat file ".bib")
					       (filesets-convert-path-list
						(or (getenv "MY_BIBINPUTS")
						    (getenv "BIBINPUTS")))))))))
    ("^.+\\.el$" t
     (((:name "Require")
       (:pattern "(require\\W+'\\(.+\\))")
       (:stubp ,(lambda (a b) (not (filesets-files-in-same-directory-p a b))))
       (:get-file-name ,(lambda (master file)
			  (filesets-which-file master
					       (concat file ".el")
					       load-path))))
      ((:name "Load")
       (:pattern "(load\\(-library\\)?\\W+\"\\(.+\\)\")")
       (:match-number 2)
       (:get-file-name ,(lambda (master file)
			  (filesets-which-file master file load-path))))))
    ("^\\([A-ZÄÖÜ][a-zäöüß]+\\([A-ZÄÖÜ][a-zäöüß]+\\)+\\)$" t
     (((:pattern "\\<\\([A-ZÄÖÜ][a-zäöüß]+\\([A-ZÄÖÜ][a-zäöüß]+\\)+\\)\\>")
       (:scan-depth 5)
       (:stubp ,(lambda (a b) (not (filesets-files-in-same-directory-p a b))))
       (:case-sensitive t)
       (:get-file-name ,(lambda (master file)
			  (filesets-which-file
			   master
			   file
			   (if (boundp 'emacs-wiki-directories)
			       emacs-wiki-directories
			     nil))))))))

  "Inclusion group definitions.

Define how to find included file according to a file's mode (being
defined by a file pattern).

A valid entry has the form (FILE-PATTERN REMOVE-DUPLICATES-FLAG
CMD-DEF1 ...), CMD-DEF1 being a plist containing the fields :pattern
\(mandatory), :name, :get-file-name, :match-number, :scan-depth,
:preprocess, :case-sensitive.

File Pattern ... A regexp matching the file's name for which the
following rules should be applied.

Remove Duplicates ... If t, only the first occurrence of an included
file is retained.  (See below for a full explanation.)

:name STRING ... This pattern's name.

:pattern REGEXP ... A regexp matching the command.  This regexp has to
include a group that holds the name of the included file.

:get-file-name FUNCTION (default: `filesets-which-file') ... A function
that takes two arguments (the path of the master file and the name
of the included file) and returns a valid path or nil -- if the
subfile can't be found.

:match-number INTEGER (default: 1) ... The number of the match/group
in the pattern holding the subfile's name.  0 refers the whole
match, 1 to the first group.

:stubp FUNCTION ... If (FUNCTION MASTER INCLUDED-FILE) returns non-nil,
INCLUDED-FILE is a stub -- see below.

:stub-flag ... Files of this type are stubs -- see below.

:scan-depth INTEGER (default: 0) ... Whether included files should be
rescanned.  Set this to 0 to disable re-scanning of included file.

:preprocess FUNCTION ... A function modifying a buffer holding the
master file so that pattern matching becomes easier.  This is usually
used to narrow a buffer to the relevant region.  This function could also
be destructive and simply delete non-relevant text.

:case-sensitive BOOLEAN (default: nil) ... Whether a pattern is
case-sensitive or not.


Stubs:

First, a stub is a file that shows up in the menu but will not be
included in an ingroup's file listing -- i.e. filesets will never
operate on this file automatically.  Secondly, in opposition to normal
files stubs are not scanned for new inclusion groups.  This is useful if
you want to have quick access to library headers.

In the menu, an asterisk is appended to the stub's name.


Remove Duplicates:

E.g. File A and file B refer to file X; X refers to A.  If
you choose not to remove duplicates the tree would look like:

    M + A - X - A ...
        B - X - A ...

As you can see, there is some chance that you run in circles.
Nevertheless, up to some degree this could still be what you want.

With duplicates removed, it would be:

    M + A - X
        B"
  :set #'filesets-set-default
  :risky t
  :type '(repeat
	  :tag "Include"
	  (list
	   :tag "Definition" :value ("^.+\\.suffix$" t)
	   (regexp :tag "File Pattern" :value "^.+\\.suffix$")
	   (boolean :tag "Remove Duplicates" :value t)
	   (repeat :tag "Commands"
		   (repeat :tag "Command"
			   (choice
			    :tag "Definition"
			    (list :tag ":name"
				  :value (:name "")
				  (const :format "" :value :name)
				  (string :tag "String"))
			    (list :tag ":pattern"
				  :value (:pattern "\\<CMD\\W*\\(.+\\)\\>")
				  (const :format "" :value :pattern)
				  (regexp :tag "RegExp"))
			    (list :tag ":get-file-name"
				  :value (:get-file-name)
				  (const :format "" :value :get-file-name)
				  (function :tag "Function"))
			    (list :tag ":match-number"
				  :value (:match-number 1)
				  (const :format "" :value :match-number)
				  (integer :tag "Integer"))
			    (list :tag ":stub-flag"
				  :value (:stub-flag t)
				  (const :format "" :value :stub-flag)
				  (boolean :tag "Boolean"))
			    (list :tag ":stubp"
				  :value (:stubp)
				  (const :format "" :value :stubp)
				  (function :tag "Function"))
			    (list :tag ":scan-depth"
				  :value (:scan-depth 0)
				  (const :format "" :value :scan-depth)
				  (integer :tag "Integer"))
			    (list :tag ":case-sensitive"
				  :value (:case-sensitive)
				  (const :format "" :value :case-sensitive)
				  (boolean :tag "Boolean"))
			    (list :tag ":preprocess"
				  :value (:preprocess)
				  (const :format "" :value :preprocess)
				  (function :tag "Function"))))))))