Skip to content
This repository
Browse code

Use rx for regex construction for great justice.

  • Loading branch information...
commit eff2c7525d4cd9a84d2613584931f640097cbdd0 1 parent 8b83d57
Phil Hagelberg authored
3  starter-kit-defuns.el
@@ -80,7 +80,8 @@
80 80
81 81 (defun pretty-lambdas ()
82 82 (font-lock-add-keywords
83   - nil `(("(?\\(lambda\\>\\)"
  83 + nil `(((rx (opt "(")
  84 + (group "lambda" word-end))
84 85 (0 (progn (compose-region (match-beginning 1) (match-end 1)
85 86 ,(make-char 'greek-iso8859-7 107))
86 87 nil))))))
11 starter-kit-eshell.el
@@ -4,7 +4,12 @@
4 4
5 5 (setq eshell-cmpl-cycle-completions nil
6 6 eshell-save-history-on-exit t
7   - eshell-cmpl-dir-ignore "\\`\\(\\.\\.?\\|CVS\\|\\.svn\\|\\.git\\)/\\'")
  7 + eshell-cmpl-dir-ignore (rx bos (or (and "." (opt "."))
  8 + "CVS"
  9 + ".svn"
  10 + ".git")
  11 + "/"
  12 + eos))
8 13
9 14 (eval-after-load 'esh-opt
10 15 '(progn
@@ -18,9 +23,9 @@
18 23 (add-to-list 'eshell-visual-commands "ssh")
19 24 (add-to-list 'eshell-visual-commands "tail")
20 25 (add-to-list 'eshell-command-completions-alist
21   - '("gunzip" "gz\\'"))
  26 + `("gunzip" ,(rx "gz" eos)))
22 27 (add-to-list 'eshell-command-completions-alist
23   - '("tar" "\\(\\.tar|\\.tgz\\|\\.tar\\.gz\\)\\'"))
  28 + `("tar" ,(rx (group (or ".tar" ".tgz" ".tar.gz" eos)))))
24 29 (add-to-list 'eshell-output-filter-functions 'eshell-handle-ansi-color)))
25 30
26 31 (provide 'starter-kit-eshell)
4 starter-kit-lisp.el
@@ -17,10 +17,10 @@
17 17 (delete-file (concat buffer-file-name "c"))))))
18 18
19 19 (font-lock-add-keywords 'emacs-lisp-mode
20   - '(("(\\|)" . 'paren-face)))
  20 + `((,(rx (or "(" ")")) paren-face)))
21 21
22 22 (font-lock-add-keywords 'scheme-mode
23   - '(("(\\|)" . 'paren-face)))
  23 + `((,(rx (or "(" ")")) paren-face)))
24 24
25 25 (define-key lisp-mode-shared-map (kbd "C-c l") "lambda")
26 26

0 comments on commit eff2c75

Please sign in to comment.
Something went wrong with that request. Please try again.