Skip to content

Commit

Permalink
Use \\' instead of $ to mark the end of auto-mode-alist file patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
purcell committed Dec 24, 2012
1 parent 232553b commit 68913b7
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 25 deletions.
2 changes: 1 addition & 1 deletion init-common-lisp.el
@@ -1,5 +1,5 @@
;; See http://bc.tech.coop/blog/070927.html
(add-auto-mode 'lisp-mode "\\.cl$")
(add-auto-mode 'lisp-mode "\\.cl\\'")
(add-hook 'lisp-mode-hook (lambda ()
(cond ((not (featurep 'slime))
(require 'slime)
Expand Down
2 changes: 1 addition & 1 deletion init-css.el
Expand Up @@ -22,7 +22,7 @@
:front "style=\""
:back "\"")))
(dolist (mode (list 'html-mode 'nxml-mode))
(mmm-add-mode-ext-class mode "\\.r?html\\(\\.erb\\)?$" 'html-css))))
(mmm-add-mode-ext-class mode "\\.r?html\\(\\.erb\\)?\\'" 'html-css))))



Expand Down
2 changes: 1 addition & 1 deletion init-git.el
Expand Up @@ -20,7 +20,7 @@
(autoload 'rebase-mode "rebase-mode")
(add-to-list 'auto-mode-alist '("git-rebase-todo" . rebase-mode))

(add-to-list 'auto-mode-alist '("\\(?:\\.gitconfig\\|\\.gitmodules\\|config\\)$" . conf-mode))
(add-to-list 'auto-mode-alist '("\\(?:\\.gitconfig\\|\\.gitmodules\\|config\\)\\'" . conf-mode))

;;----------------------------------------------------------------------------
;; git-svn conveniences
Expand Down
2 changes: 1 addition & 1 deletion init-javascript.el
Expand Up @@ -8,7 +8,7 @@
;; Need to first remove from list if present, since elpa adds entries too, which
;; may be in an arbitrary order
(eval-when-compile (require 'cl))
(setq auto-mode-alist (cons `("\\.js\\(\\.erb\\|on\\)?$" . ,preferred-javascript-mode)
(setq auto-mode-alist (cons `("\\.js\\(\\.erb\\|on\\)?\\'" . ,preferred-javascript-mode)
(loop for entry in auto-mode-alist
unless (eq preferred-javascript-mode (cdr entry))
collect entry)))
Expand Down
4 changes: 2 additions & 2 deletions init-lisp.el
Expand Up @@ -114,8 +114,8 @@

(require 'eldoc-eval)

(add-to-list 'auto-mode-alist '("\\.emacs-project$" . emacs-lisp-mode))
(add-to-list 'auto-mode-alist '("archive-contents$" . emacs-lisp-mode))
(add-to-list 'auto-mode-alist '("\\.emacs-project\\'" . emacs-lisp-mode))
(add-to-list 'auto-mode-alist '("archive-contents\\'" . emacs-lisp-mode))

(define-key emacs-lisp-mode-map (kbd "C-x C-a") 'pp-macroexpand-last-sexp)

Expand Down
2 changes: 1 addition & 1 deletion init-markdown.el
@@ -1,5 +1,5 @@
(autoload 'markdown-mode "markdown-mode" "Mode for editing Markdown documents" t)
(setq auto-mode-alist
(cons '("\\.\\(md\\|markdown\\)$" . markdown-mode) auto-mode-alist))
(cons '("\\.\\(md\\|markdown\\)\\'" . markdown-mode) auto-mode-alist))

(provide 'init-markdown)
2 changes: 1 addition & 1 deletion init-misc.el
@@ -1,7 +1,7 @@
;;----------------------------------------------------------------------------
;; Misc config - yet to be placed in separate files
;;----------------------------------------------------------------------------
(add-auto-mode 'tcl-mode "Portfile$")
(add-auto-mode 'tcl-mode "Portfile\\'")
(fset 'yes-or-no-p 'y-or-n-p)
(add-hook 'find-file-hooks 'goto-address-prog-mode)
(add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p)
Expand Down
2 changes: 1 addition & 1 deletion init-nxml.el
Expand Up @@ -38,7 +38,7 @@ indentation rules."
(add-hook 'html-mode-hook (lambda () (tidy-build-menu html-mode-map)))


(add-auto-mode 'html-mode "\\.(jsp|tmpl)$")
(add-auto-mode 'html-mode "\\.(jsp|tmpl)\\'")


(provide 'init-nxml)
2 changes: 1 addition & 1 deletion init-org.el
@@ -1,6 +1,6 @@
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))

;; Various preferences
(setq org-log-done t
Expand Down
4 changes: 2 additions & 2 deletions init-php.el
@@ -1,7 +1,7 @@
(add-auto-mode 'php-mode "\\.php[345]?\\'\\|\\.phtml\\." "\\.(inc|tpl)$" "\\.module$")
(add-auto-mode 'php-mode "\\.php[345]?\\'\\|\\.phtml\\." "\\.(inc|tpl)\\'" "\\.module\\'")
(add-hook 'php-mode-hook 'flymake-php-load)

(autoload 'smarty-mode "smarty-mode" "Smarty Mode" t)
(add-auto-mode 'smarty-mode "\\.tpl$")
(add-auto-mode 'smarty-mode "\\.tpl\\'")

(provide 'init-php)
5 changes: 2 additions & 3 deletions init-python-mode.el
@@ -1,9 +1,8 @@
(autoload 'doctest-mode "doctest-mode" "Python doctest editing mode." t)

(setq auto-mode-alist
(append '(("\\.py$" . python-mode)
("SConstruct$" . python-mode)
("SConscript$" . python-mode))
(append '(("SConstruct\\'" . python-mode)
("SConscript\\'" . python-mode))
auto-mode-alist))

(setq interpreter-mode-alist
Expand Down
18 changes: 9 additions & 9 deletions init-ruby-mode.el
Expand Up @@ -5,7 +5,7 @@
(eval-after-load 'rinari
'(diminish 'rinari-minor-mode "Rin"))

(add-auto-mode 'ruby-mode "\\.rb$" "Rakefile$" "\.rake$" "\.rxml$" "\.rjs$" ".irbrc$" "\.builder$" "\.ru$" "\.gemspec$" "Gemfile$")
(add-auto-mode 'ruby-mode "\\.rb\\'" "Rakefile\\'" "\.rake\\'" "\.rxml\\'" "\.rjs\\'" ".irbrc\\'" "\.builder\\'" "\.ru\\'" "\.gemspec\\'" "Gemfile\\'")


(autoload 'run-ruby "inf-ruby" "Run an inferior Ruby process")
Expand Down Expand Up @@ -47,20 +47,20 @@

(add-to-list 'auto-mode-alist '("\\.r?html\\(\\.erb\\)?\\'" . html-erb-mode))
(add-to-list 'auto-mode-alist '("\\.jst\\.ejs\\'" . html-erb-mode))
(mmm-add-mode-ext-class 'yaml-mode "\\.yaml$" 'erb)
(mmm-add-mode-ext-class 'yaml-mode "\\.yaml\\'" 'erb)

(dolist (mode (list 'js-mode 'js2-mode 'js3-mode))
(mmm-add-mode-ext-class mode "\\.js\\.erb$" 'erb))
(mmm-add-mode-ext-class mode "\\.js\\.erb\\'" 'erb))


;;----------------------------------------------------------------------------
;; Ruby - my convention for heredocs containing SQL
;;----------------------------------------------------------------------------
(eval-after-load 'mmm-mode
'(progn
(mmm-add-classes
'((ruby-heredoc-sql :submode sql-mode :front "<<-?end_sql.*\r?\n" :back "[ \t]*end_sql" :face mmm-code-submode-face)))
(mmm-add-mode-ext-class 'ruby-mode "\\.rb$" 'ruby-heredoc-sql)))
;; (eval-after-load 'mmm-mode
;; '(progn
;; (mmm-add-classes
;; '((ruby-heredoc-sql :submode sql-mode :front "<<-?end_sql.*\r?\n" :back "[ \t]*end_sql" :face mmm-code-submode-face)))
;; (mmm-add-mode-ext-class 'ruby-mode "\\.rb\\'" 'ruby-heredoc-sql)))


;;----------------------------------------------------------------------------
Expand All @@ -80,7 +80,7 @@
;; Yaml
;;----------------------------------------------------------------------------
(autoload 'yaml-mode "yaml-mode" "Major mode for YAML source")
(add-auto-mode 'yaml-mode "\\.ya?ml$")
(add-auto-mode 'yaml-mode "\\.ya?ml\\'")


(provide 'init-ruby-mode)
2 changes: 1 addition & 1 deletion init-textile.el
@@ -1,6 +1,6 @@
(autoload 'textile-mode "textile-mode" "Mode for editing Textile documents" t)
(setq auto-mode-alist
(cons '("\\.textile$" . textile-mode) auto-mode-alist))
(cons '("\\.textile\\'" . textile-mode) auto-mode-alist))


(provide 'init-textile)

0 comments on commit 68913b7

Please sign in to comment.