Skip to content

Commit

Permalink
Minor refactoring.
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
expez committed Mar 25, 2013
1 parent 28b0b56 commit a45fe2c
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions eclim.el
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,12 @@ 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)
(add-hook 'after-save-hook #'eclim--problems-update-maybe nil 't)
(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
Expand Down Expand Up @@ -523,10 +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)

(define-globalized-minor-mode global-eclim-mode eclim-mode
(lambda ()
(if (and buffer-file-name
Expand Down

0 comments on commit a45fe2c

Please sign in to comment.