Merge pull request #785 from k1-hedayati/improvments

Some bug fixes and improvments
This commit is contained in:
Bozhidar Batsov 2015-01-17 19:52:28 +02:00
commit 9ac7ccbea8
6 changed files with 13 additions and 16 deletions

View file

@ -181,16 +181,6 @@ point reaches the beginning or end of the buffer, stop there."
'display '(left-fringe right-triangle)) 'display '(left-fringe right-triangle))
'modification-hooks '(prelude-todo-ov-evaporate))) 'modification-hooks '(prelude-todo-ov-evaporate)))
(defun prelude-copy-file-name-to-clipboard ()
"Copy the current buffer file name to the clipboard."
(interactive)
(let ((filename (if (equal major-mode 'dired-mode)
default-directory
(buffer-file-name))))
(when filename
(kill-new filename)
(message "Copied buffer file name '%s' to the clipboard." filename))))
(defun prelude-get-positions-of-line-or-region () (defun prelude-get-positions-of-line-or-region ()
"Return positions (beg . end) of the current line "Return positions (beg . end) of the current line
or region." or region."

View file

@ -87,8 +87,7 @@
("Files" ("Files"
["Open with..." prelude-open-with] ["Open with..." prelude-open-with]
["Delete file and buffer" prelude-delete-file-and-buffer] ["Delete file and buffer" prelude-delete-file-and-buffer]
["Rename buffer and file" prelude-rename-buffer-and-file] ["Rename buffer and file" prelude-rename-buffer-and-file])
["Copy file name to clipboard" prelude-copy-file-name-to-clipboard])
("Buffers" ("Buffers"
["Clean up buffer or region" prelude-cleanup-buffer-or-region] ["Clean up buffer or region" prelude-cleanup-buffer-or-region]

View file

@ -52,7 +52,6 @@
diff-hl diff-hl
diminish diminish
easy-kill easy-kill
elisp-slime-nav
epl epl
expand-region expand-region
flycheck flycheck
@ -68,7 +67,6 @@
magit magit
move-text move-text
operate-on-number operate-on-number
rainbow-mode
smartparens smartparens
smartrep smartrep
undo-tree undo-tree
@ -76,6 +74,9 @@
zenburn-theme) zenburn-theme)
"A list of packages to ensure are installed at launch.") "A list of packages to ensure are installed at launch.")
(when (version<= "24.4" emacs-version)
(add-to-list 'prelude-packages '(magit-filenotify)))
(defun prelude-packages-installed-p () (defun prelude-packages-installed-p ()
"Check if all packages in `prelude-packages' are installed." "Check if all packages in `prelude-packages' are installed."
(every #'package-installed-p prelude-packages)) (every #'package-installed-p prelude-packages))
@ -152,6 +153,9 @@ PACKAGE is installed only if not already present. The file is opened in MODE."
("\\.pp\\'" puppet-mode puppet-mode) ("\\.pp\\'" puppet-mode puppet-mode)
("\\.php\\'" php-mode php-mode) ("\\.php\\'" php-mode php-mode)
("\\.proto\\'" protobuf-mode protobuf-mode) ("\\.proto\\'" protobuf-mode protobuf-mode)
("\\.pyd\\'" cython-mode cython-mode)
("\\.pyi\\'" cython-mode cython-mode)
("\\.pyx\\'" cython-mode cython-mode)
("PKGBUILD\\'" pkgbuild-mode pkgbuild-mode) ("PKGBUILD\\'" pkgbuild-mode pkgbuild-mode)
("\\.rs\\'" rust-mode rust-mode) ("\\.rs\\'" rust-mode rust-mode)
("\\.sass\\'" sass-mode sass-mode) ("\\.sass\\'" sass-mode sass-mode)

View file

@ -35,6 +35,8 @@
(require 'prelude-lisp) (require 'prelude-lisp)
(prelude-require-packages '(elisp-slime-nav rainbow-mode))
(defun prelude-recompile-elc-on-save () (defun prelude-recompile-elc-on-save ()
"Recompile your elc when saving an elisp file." "Recompile your elc when saving an elisp file."
(add-hook 'after-save-hook (add-hook 'after-save-hook

View file

@ -32,8 +32,6 @@
;;; Code: ;;; Code:
(prelude-require-packages '(guru-mode))
(defun prelude-local-comment-auto-fill () (defun prelude-local-comment-auto-fill ()
(set (make-local-variable 'comment-auto-fill-only-comments) t)) (set (make-local-variable 'comment-auto-fill-only-comments) t))
@ -84,6 +82,9 @@ This functions should be added to the hooks of major modes for programming."
(add-hook 'prog-mode-hook (lambda () (add-hook 'prog-mode-hook (lambda ()
(run-hooks 'prelude-prog-mode-hook))) (run-hooks 'prelude-prog-mode-hook)))
(when (version<= "24.4" emacs-version)
(add-hook 'magit-status-mode-hook (lambda () (magit-filenotify-mode 1))))
;; enable on-the-fly syntax checking ;; enable on-the-fly syntax checking
(if (fboundp 'global-flycheck-mode) (if (fboundp 'global-flycheck-mode)
(global-flycheck-mode +1) (global-flycheck-mode +1)

View file

@ -89,6 +89,7 @@
(subword-mode +1) (subword-mode +1)
(anaconda-mode) (anaconda-mode)
(eldoc-mode) (eldoc-mode)
(which-function-mode -1)
(setq-local electric-layout-rules (setq-local electric-layout-rules
'((?: . (lambda () '((?: . (lambda ()
(and (zerop (first (syntax-ppss))) (and (zerop (first (syntax-ppss)))