Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teach shell-scripts about common ZSH files #2332

Closed
wants to merge 1 commit into from

Conversation

jcf
Copy link

@jcf jcf commented Jul 15, 2015

I wasn't sure of the best place to put these settings. As it's related to shell scripting I thought the shell-scripts layer might be the right place.

I was looking for something like add-auto-mode to simplify adding a list of file patterns to the auto-mode-alist but nothing jumped out at me. If there's an existing way of doing this I'll happily make use of it, or failing that can repeat the calls to add-to-list (maybe that should be a push…)

(defun add-auto-mode (mode &rest patterns)
  "Add entries to `auto-mode-alist' to use `MODE' for all given file
`PATTERNS'."
  (dolist (pattern patterns)
    (add-to-list 'auto-mode-alist (cons pattern mode))))

@jcf
Copy link
Author

jcf commented Jul 15, 2015

Tests pass locally, and the error seems unrelated to my changes which makes me think this is a temporary issue. I can't run the build again to verify my hypothesis so will squash and force push up - see if that helps.

@robbyoconnor
Copy link
Contributor

👍

@TheBB
Copy link
Collaborator

TheBB commented Nov 15, 2015

Thank you! Cherry-picked in develop. You can safely delete your branch.

I refactored a bit in c609f48 and 692c4dc. Basically I moved your code to packages.el, gave an explicit name to the hooked function and added a guard for buffer-file-name (which may be nil).

@TheBB TheBB closed this Nov 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants