• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/

Lines Matching +defs:rule +defs:alist

187 - `recentf-arrange-by-rule'
211 (function-item recentf-arrange-by-rule)
778 "*List of rules used by `recentf-arrange-by-rule' to build sub-menus.
779 A rule is a pair (SUB-MENU-TITLE . MATCHER). SUB-MENU-TITLE is the
788 may have been modified to match another rule."
793 (defcustom recentf-arrange-by-rule-others "Other files (%d)"
794 "*Title of the `recentf-arrange-by-rule' sub-menu.
804 "*Minimum number of items in a `recentf-arrange-by-rule' sub-menu.
807 menu or in the `recentf-arrange-by-rule-others' sub-menu if
812 (defcustom recentf-arrange-by-rule-subfilter nil
813 "*Function called by a rule based filter to filter sub-menu elements.
815 You can't use another rule based filter here."
819 (when (memq value '(recentf-arrange-by-rule
822 (error "Recursive use of a rule based filter"))
825 (defun recentf-match-rule (file)
826 "Return the rule that match FILE."
840 (defun recentf-arrange-by-rule (l)
848 menu (recentf-match-rule file))
861 ;; - apply `recentf-arrange-by-rule-subfilter' to menu items.
874 recentf-arrange-by-rule-subfilter (nreverse menu)))
881 (if (stringp recentf-arrange-by-rule-others)
884 (format recentf-arrange-by-rule-others
887 recentf-arrange-by-rule-subfilter others)))
890 recentf-arrange-by-rule-subfilter others)))))))
894 ;;; Predefined rule based menu filters
896 (defun recentf-indirect-mode-rule (file)
897 "Apply a second level `auto-mode-alist' regexp to FILE."
898 (recentf-match-rule (substring file 0 (match-beginning 0))))
901 "Convert `auto-mode-alist' to menu filter rules.
904 regexp rule-name rule rules)
905 (dolist (mode auto-mode-alist)
910 ;; Build a special "strip suffix" rule from entries of the
915 (setq rule-name 'recentf-indirect-mode-rule))
917 (setq rule-name (symbol-name mode))
918 (if (string-match "\\(.*\\)-mode$" rule-name)
919 (setq rule-name (match-string 1 rule-name)))
920 (setq rule-name (concat rule-name " (%d)"))))
921 (setq rule (assoc rule-name rules))
922 (if rule
923 (setcdr rule (cons regexp (cdr rule)))
924 (push (list rule-name regexp) rules))))
925 ;; It is important to preserve auto-mode-alist order
932 (recentf-arrange-by-rule-others "others (%d)"))
933 (recentf-arrange-by-rule l)))
939 `recentf-arrange-by-rule-subfilter'."
946 (defun recentf-dir-rule (file)
952 (let ((recentf-arrange-rules '((recentf-dir-rule . ".*")))
953 (recentf-arrange-by-rule-subfilter 'recentf-file-name-nondir)
954 recentf-arrange-by-rule-others)
955 (recentf-arrange-by-rule l)))
963 (defcustom recentf-filter-changer-alist
967 (recentf-arrange-by-rule . "Grouped by Custom Rules")
986 `recentf-filter-changer-alist' defines the filters in the menu.
990 (caar recentf-filter-changer-alist)))
1006 recentf-filter-changer-alist))))