Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Make our after-save-hook be local #93

Merged
merged 2 commits into from

3 participants

@expez

No description provided.

expez added some commits
@expez expez Make after-save-hook local.
Eclim spam in the modeline just because I have eclim installed is
annoying.  Can fix this by making the after-save-hook local to buffers
where eclim is activated.
28b0b56
@expez expez Minor refactoring.
- There's not point in setting a value to its default.  In any event, we
  should probably not just setq variables like this because it affects
  the global session.  We should instead use global variables.

- The if-progn idiom is so common that someone made a macro for it a
  long time ago.  It's also good style to use WHEN/UNLESS if there's no
  ELSE clause.

- We should be consistent when we retrieve the function to add to a
  hook.  While #'function is technically more correct, nobody bothers
  using this form, so we'll favor the other one.
a45fe2c
@senny
Owner

looks good. Thanks for your contribution!

/cc @fred-o

@fred-o fred-o merged commit a45fe2c into senny:master
@expez expez deleted the expez:local-hooks branch
@fred-o
Collaborator

Agreed. Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 25, 2013
  1. @expez

    Make after-save-hook local.

    expez authored
    Eclim spam in the modeline just because I have eclim installed is
    annoying.  Can fix this by making the after-save-hook local to buffers
    where eclim is activated.
  2. @expez

    Minor refactoring.

    expez authored
    - There's not point in setting a value to its default.  In any event, we
      should probably not just setq variables like this because it affects
      the global session.  We should instead use global variables.
    
    - The if-progn idiom is so common that someone made a macro for it a
      long time ago.  It's also good style to use WHEN/UNLESS if there's no
      ELSE clause.
    
    - We should be consistent when we retrieve the function to add to a
      hook.  While #'function is technically more correct, nobody bothers
      using this form, so we'll favor the other one.
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 14 deletions.
  1. +1 −3 eclim-problems.el
  2. +6 −11 eclim.el
View
4 eclim-problems.el
@@ -188,7 +188,7 @@
(= (assoc-default 'line p) line)))
eclim--problems-list)
(error "No problem on this line")))))))
-
+
(defun eclim-problems-open-current ()
(interactive)
(let* ((p (eclim--problems-get-current-problem)))
@@ -440,6 +440,4 @@ is convenient as it lets the user navigate between errors using
(col (assoc-default 'column problem)))
(insert (format "%s:%s:%s: %s: %s\n" filename line col (upcase type) description)))))
-(add-hook 'after-save-hook #'eclim--problems-update-maybe)
-
(provide 'eclim-problems)
View
17 eclim.el
@@ -460,12 +460,13 @@ FILENAME is given, return that file's project name instead."
nil
" Eclim"
eclim-mode-map
- (if eclim-mode
- (progn
- (when (and (featurep 'yasnippet) eclim-use-yasnippet)
- (yas/load-directory eclim--snippet-directory)))
+ (when eclim-mode
+ (when (and (featurep 'yasnippet) eclim-use-yasnippet)
+ (yas/load-directory eclim--snippet-directory))
(kill-local-variable 'eclim--project-dir)
- (kill-local-variable 'eclim--project-name)))
+ (kill-local-variable 'eclim--project-name)
+ (add-hook 'after-save-hook 'eclim--problems-update-maybe nil 't)
+ (add-hook 'after-save-hook 'eclim--after-save-hook nil 't)))
(defcustom eclim-accepted-file-regexps
'("\\.java" "\\.js" "\\.xml" "\\.rb" "\\.php")
@@ -521,12 +522,6 @@ the use of eclim to java and ant files."
(not-modified)
(set-visited-file-modtime)))
-;; (setq revert-buffer-function 'revert-buffer-keep-history)
-
-(setq revert-buffer-function nil)
-
-(add-hook 'after-save-hook 'eclim--after-save-hook)
-
(define-globalized-minor-mode global-eclim-mode eclim-mode
(lambda ()
(if (and buffer-file-name
Something went wrong with that request. Please try again.