Skip to content

Flymake produce temp file without cleaning it up #130

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

Closed
ArthurTu opened this issue Mar 16, 2013 · 10 comments
Closed

Flymake produce temp file without cleaning it up #130

ArthurTu opened this issue Mar 16, 2013 · 10 comments

Comments

@ArthurTu
Copy link

If I edit a file named a.hs, it takes a long time to start haskell mode. And a file named a_flymake.hs is created on that directory without asking me. It stands there even after i closed a.hs.

I do not have ghc installed in my host os. So haskell-program-name is not set in my .emacs. Check if this is related to the bug.

However, i want to use emacs to edit haskell files with hilight and indent features.

I think codes about flymake should be written into a function instead of being a default feature. If somebody want to enable it, just that to the haskell-mode-hook.

I have to dive into haskell-mode.el and comment the last few lines to disable flymake. That is embarrassing and dirty.

@ivan-m
Copy link
Contributor

ivan-m commented Mar 20, 2013

There's probably some configuration issue going on here; I don't have any flymake files or buffers being created for me when I use haskell-mode :/

Can you put your config up somewhere?

@ArthurTu
Copy link
Author

;; set the load path

(add-to-list 'load-path "~/.emacs.d/lisp/")
(add-to-list 'load-path "~/.emacs.d/lisp/matlab-emacs")
(let ((default-directory "~/.emacs.d/elpa/"))
  (normal-top-level-add-subdirs-to-load-path))

;;(setq server-use-tcp t)

(fset 'yes-or-no-p 'y-or-n-p)
(setq dired-recursive-deletes t)
;; (setq frame-title-format "%b@emacs")
(setq frame-title-format "%f")
(setq inhibit-startup-screen t)
(setq initial-scratch-message nil)
(setq backup-directory-alist (quote (("." . "~/.backups"))))
(setq delete-old-versions t)
(defadvice ansi-term (after advice-term-line-mode activate)
  (term-line-mode))

(setq auto-mode-alist
      (cons '("\\.m$" . octave-mode) auto-mode-alist))
(setq octave-continuation-string "...")
(setq octave-comment-start "%")
(add-hook 'octave-mode-hook
      (lambda ()
        (abbrev-mode 1)
        (auto-fill-mode 1)
        (if (eq window-system 'x)
        (font-lock-mode 1))))
;; (autoload 'matlab-mode "matlab" "Enter MATLAB mode." t)
;; (setq auto-mode-alist (cons '("\\.m\\'" . matlab-mode) auto-mode-alist))
;; (autoload 'matlab-shell "matlab" "Interactive MATLAB mode." t)

;; (require 'modeline-posn)
(column-number-mode t)

;; (require 'ido)
(ido-mode t)

;; (require 'linum)
(global-linum-mode t)
(defun set-linum-format ()
  (interactive)
  (if (eq window-system nil)
      (setq linum-format "%4d| ")
    (setq linum-format 'dynamic)))
(add-hook 'linum-before-numbering-hook 'set-linum-format)

(require 'uniquify)
(setq uniquify-buffer-name-style 'forward)

;; (require 'paren)
(show-paren-mode t)
(setq show-paren-delay 0)
(setq show-paren-style 'parentheses)

(mouse-avoidance-mode 'animate)
(setq ring-bell-function 'ignore)

(setq visible-bell t)

(set-face-attribute 'default nil :height 120)
(set-default-font "YaHei Consolas Hybrid:antialias=natural")

(global-set-key (kbd "C-x C-b") 'ibuffer)
(autoload 'ibuffer "ibuffer" "List buffers." t)

(add-to-list 'default-frame-alist
         (cons 'height (/ (- (x-display-pixel-height) 250)
                  (frame-char-height))))

;; (set-face-attribute 'default nil :height 120)
(defadvice shell-command (after shell-in-new-buffer (command &optional output-buffer error-buffer))
  (when (get-buffer "*Async Shell Command*")
    (with-current-buffer "*Async Shell Command*"
      (rename-uniquely))))
(ad-activate 'shell-command)

(prefer-coding-system 'gb18030)
(prefer-coding-system 'utf-8)

(defun iwb ()
  "indent whole buffer"
  (interactive)
  (save-excursion
    (beginning-of-buffer)
    (whitespace-cleanup)
    ;;  (delete-trailing-whitespace)
    (indent-region (point-min) (point-max) nil)
    ;;  (untabify (point-min) (point-max))
    ))
(global-set-key [f3] 'iwb)

;; Make it easy to revert buffer
(global-set-key [f4] 'revert-buffer)

;;(add-to-list 'initial-frame-alist '(is-full-screen . nil))
(defun toggle-full-screen (&optional f)
  "Toggles full-screen mode for Emacs window on Win32."
  (interactive)
  (if (eq (frame-parameter f 'is-full-screen) t)
      (progn
    (w32-send-sys-command 61728)
    (modify-frame-parameters f '((is-full-screen . nil)))
    (message "Change from full screen"))
    (progn
      (w32-send-sys-command #xf030)
      (modify-frame-parameters f '((is-full-screen . t)))
      (message "Change to full screen"))))
;;(shell-command "emacs_fullscreen.exe"))

(global-set-key [f11] 'toggle-full-screen)

(setq-default ispell-program-name "aspell")

(tool-bar-mode -1)
;; (if (eq window-system 'w32)
;;     (tool-bar-mode -1))
;; (menu-bar-mode -1)

(load-theme 'tsdh-dark)

(global-ede-mode 1)
(require 'semantic/sb)
(semantic-mode 1)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;; Finish native settings ;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;(require 'bison-mode)
(autoload 'bison-mode "bison-mode.el")
(add-to-list 'auto-mode-alist '("\\.y$" . bison-mode))

(require 'flex-mode)
(autoload 'flex-mode "flex-mode")
(add-to-list 'auto-mode-alist '("\\.l$" . flex-mode))


(require 'cygwin-terminal-clipboard)
(cygwin-terminal-clipboard-mode)

;; (require 'windows-path)
;; (setq cygwin-mount-cygwin-bin-directory "/bin")
;; (windows-path-activate)

;; (require 'tex-mode)
(setq latex-run-command "xelatex \-shell\-escape")

(autoload 'flymake-find-file-hook "flymake" "" t)
(add-hook 'find-file-hook 'flymake-find-file-hook)
(setq flymake-gui-warnings-enabled nil)
(setq flymake-log-level 0)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;; Loaded by ELPA Automaticly ;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; (require 'package)
(package-initialize)
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
             ("melpa" . "http://melpa.milkbox.net/packages/")
             ("marmalade" . "http://marmalade-repo.org/packages/")
             ("original" . "http://tromey.com/elpa/")
             ))

;; (require 'auto-complete)
(require 'auto-complete-config)
(ac-config-default)
(setq ac-auto-start t)
(ac-flyspell-workaround)

;; flymake-cursor
(setq help-at-pt-display-when-idle '(flymake-overlay))

;; (require 'flymake-css)
(add-hook 'css-mode-hook 'flymake-css-load)

;; (require 'flymake-python-pyflakes)
(add-hook 'python-mode-hook 'flymake-python-pyflakes-load)

;; (require 'haskell-mode)
;; (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)

;; (require 'flymake-shell)
(add-hook 'sh-set-shell-hook 'flymake-shell-load)

;; (require 'google-this)
(google-this-mode t)

;; (require 'google-translate)
(global-set-key "\C-ct" 'google-translate-at-point)
(global-set-key "\C-cT" 'google-translate-query-translate)
(setq google-translate-default-source-language "zh-CN")
(setq google-translate-default-target-language "en")

;; (require 'guess-offset)

;; (require 'php-mode)
;; (add-to-list 'auto-mode-alist '("\\.php$" . php-mode))
(add-hook 'php-mode-hook (lambda ()
            (auto-fill-mode 1)
        (c-set-style "k&r")
        (setq c-basic-offset 4)
            (set (make-local-variable 'fill-nobreak-predicate)
             (lambda ()
               (not (eq (get-text-property (point) 'face)
                    'font-lock-comment-face))))))

;; (require 'w32-browser)

;; (require 'yasnippet)
(yas-global-mode)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;; ELPA END ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

@ArthurTu
Copy link
Author

I do not have any special configuration for flymake or haskell.

Haskell is auto-loaded by package-initialize().

Flymake didn't annoy me, since i comment on below lines.

;; (eval-after-load "flymake"
;;   '(add-to-list 'flymake-allowed-file-name-masks
;;      '("\\.l?hs\\'" haskell-flymake-init)))

I looked up flymake on emacswiki, and try to add flymake-simple-java-cleanup after haskell-flymake-init, but it didn't work.

I do use flymake on other modes like flymake-python. However, these flymake-modes rely on flymake-easy. They are configured differently from native flymake.

@ivan-m
Copy link
Contributor

ivan-m commented Mar 27, 2013

So, we should have the flymake support for haskell-mode explicitly optional rather than automatically being enabled if flymake is detected?

@ArthurTu
Copy link
Author

haskell-mode turn on flymake, even though i do not have any cmd like "hlint" or "ghc -fno-code" in my system.

flymake-css will produce an error

Not enabling flymake: 'csslint' command not found

if i do not have csslint installed. Flymake won't be turned on in css-mode.

Maybe i should learn some config of flymake and fix it myself, so that i can provide a patch.

@chrisdone
Copy link
Member

Can someone who uses flymake take ownership of this issue and assign a priority according to #145. Thanks.

@gracjan gracjan removed the blocked label Mar 25, 2015
@gracjan gracjan removed this from the milestone Oct 16, 2015
@gracjan
Copy link
Contributor

gracjan commented Dec 5, 2015

Lets agree to use flycheck instead of flymake, flycheck is better at handling temporary files.

@gracjan gracjan closed this as completed Dec 5, 2015
@terlar
Copy link

terlar commented Nov 11, 2018

Perhaps this could be revisited with the new and improved flymake version.

@carlosdagos
Copy link

As far as I can see, flycheck never made it? :(

@codygman
Copy link
Contributor

codygman commented Apr 15, 2020

I don't think it did @carlosdagos, but it seems the temp file junk endlessly created by flymake defaults is fixed by this code.

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

No branches or pull requests

7 participants