Skip to content

Remove some outdated code #1144

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

Merged
merged 2 commits into from
Feb 11, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions haskell-compile.el
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,8 @@ This is a child of `compilation-mode-map'.")

(when haskell-compile-ghc-filter-linker-messages
(delete-matching-lines "^ *Loading package [^ \t\r\n]+ [.]+ linking [.]+ done\\.$"
(if (boundp 'compilation-filter-start) ;; available since Emacs 24.2
(save-excursion (goto-char compilation-filter-start)
(line-beginning-position))
(point-min))
(save-excursion (goto-char compilation-filter-start)
(line-beginning-position))
(point))))

(define-compilation-mode haskell-compilation-mode "HsCompilation"
Expand Down Expand Up @@ -138,8 +136,7 @@ derived from `compilation-mode'. See Info
node `(haskell-mode)compilation' for more details."
(interactive "P")
(save-some-buffers (not compilation-ask-about-save)
(if (boundp 'compilation-save-buffers-predicate) ;; since Emacs 24.1(?)
compilation-save-buffers-predicate))
compilation-save-buffers-predicate)
(let* ((cabdir (haskell-cabal-find-dir))
(command1 (if (eq edit-command '-)
haskell-compile-cabal-build-alt-command
Expand Down
46 changes: 4 additions & 42 deletions haskell-doc.el
Original file line number Diff line number Diff line change
Expand Up @@ -493,37 +493,6 @@ Each element is of the form (ID . DOC) where both ID and DOC are strings.
DOC should be a concise single-line string describing the construct in which
the keyword is used.")

(eval-and-compile
(defalias 'haskell-doc-split-string
(if (condition-case ()
(split-string "" nil t)
(wrong-number-of-arguments nil))
'split-string
;; copied from Emacs 22
(lambda (string &optional separators omit-nulls)
(let ((keep-nulls (not (if separators omit-nulls t)))
(rexp (or separators "[ \f\t\n\r\v]+"))
(start 0)
notfirst
(list nil))
(while (and (string-match rexp string
(if (and notfirst
(= start (match-beginning 0))
(< start (length string)))
(1+ start) start))
(< start (length string)))
(setq notfirst t)
(if (or keep-nulls (< start (match-beginning 0)))
(setq list
(cons (substring string start (match-beginning 0))
list)))
(setq start (match-end 0)))
(if (or keep-nulls (< start (length string)))
(setq list
(cons (substring string start)
list)))
(nreverse list))))))


(defun haskell-doc-extract-types (url)
(with-temp-buffer
Expand Down Expand Up @@ -636,7 +605,7 @@ the keyword is used.")
;; module vars)
nil)
(setq curclass nil))
(dolist (var (haskell-doc-split-string vars comma-re t))
(dolist (var (split-string vars comma-re t))
(if (string-match "(.*)" var) (setq var (substring var 1 -1)))
(push (cons var type) elems))))
;; A datatype decl.
Expand All @@ -657,7 +626,7 @@ the keyword is used.")
(if (string-match ",\\'" type)
(setq type (substring type 0 -1)))
(setq type (concat name " -> " type))
(dolist (var (haskell-doc-split-string vars comma-re t))
(dolist (var (split-string vars comma-re t))
(if (string-match "(.*)" var)
(setq var (substring var 1 -1)))
(push (cons var type) elems))))))))
Expand Down Expand Up @@ -1251,8 +1220,6 @@ URL is the URL of the online doc."
(append (default-value 'minor-mode-alist)
'((haskell-doc-mode haskell-doc-minor-mode-string)))))

;; a dummy definition needed for XEmacs (I know, it's horrible :-(


(defvar haskell-doc-keymap
(let ((map (make-sparse-keymap)))
Expand Down Expand Up @@ -1490,13 +1457,8 @@ current buffer."
;; In Emacs 19.29 and later, and XEmacs 19.13 and later, all
;; messages are recorded in a log. Do not put haskell-doc messages
;; in that log since they are legion.
(if (eval-when-compile (fboundp 'display-message))
;; XEmacs 19.13 way of preventing log messages.
;;(display-message 'no-log (format <args>))
;; XEmacs 19.15 seems to be a bit different.
(display-message 'message (format "%s" doc))
(let ((message-log-max nil))
(message "%s" doc)))))))
(let ((message-log-max nil))
(message "%s" doc))))))

(defvar haskell-doc-current-info--interaction-last nil
"If non-nil, a previous eldoc message from an async call, that
Expand Down
3 changes: 1 addition & 2 deletions haskell-font-lock.el
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@ Regexp match data 0 points to the chars."

(defun haskell-font-lock-symbols-keywords ()
(when (and haskell-font-lock-symbols
haskell-font-lock-symbols-alist
(fboundp 'compose-region))
haskell-font-lock-symbols-alist)
`((,(regexp-opt (mapcar 'car haskell-font-lock-symbols-alist) t)
(0 (haskell-font-lock-compose-symbol ',haskell-font-lock-symbols-alist)
;; In Emacs-21, if the `override' field is nil, the face
Expand Down
6 changes: 1 addition & 5 deletions haskell-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -577,13 +577,9 @@ May return a qualified name."
"Special variable indicating a state of user input waiting.")


;; For compatibility with Emacs < 24, derive conditionally
(defalias 'haskell-parent-mode
(if (fboundp 'prog-mode) 'prog-mode 'fundamental-mode))

;; The main mode functions
;;;###autoload
(define-derived-mode haskell-mode haskell-parent-mode "Haskell"
(define-derived-mode haskell-mode prog-mode "Haskell"
"Major mode for editing Haskell programs.

For more information see also Info node `(haskell-mode)Getting Started'.
Expand Down