Permalink
Browse files

merge from upstream

  • Loading branch information...
2 parents 6485b14 + a4c89bd commit d3065f2badfef8276c2788c3574ce1cc8f0fbe04 @marivas committed Sep 7, 2012
Showing with 21 additions and 3 deletions.
  1. +19 −3 prelude/prelude-core.el
  2. +2 −0 prelude/prelude-global-keybindings.el
View
22 prelude/prelude-core.el
@@ -338,7 +338,7 @@ there's a region, all lines that region covers will be duplicated."
The new command is named CMD-repeat. CMD should be a quoted
command.
-This allows you to bind the command to a compound keystroke and
+This allows you to bind the command to a compound keystroke andб
repeat it with just the final key. For example:
(global-set-key (kbd \"C-c a\") (make-repeatable-command 'foo))
@@ -348,13 +348,22 @@ just invoke foo. Typing C-c a a a will invoke foo three times,
and so on."
(fset (intern (concat (symbol-name cmd) "-repeat"))
`(lambda ,(help-function-arglist cmd) ;; arg list
- ,(format "A repeatable version of `%s'." (symbol-name cmd)) ;; doc string
+ ,(format "A repeatable version of `%s'."
+ (symbol-name cmd)) ;; doc string
,(interactive-form cmd) ;; interactive form
;; see also repeat-message-function
(setq last-repeatable-command ',cmd)
(repeat nil)))
(intern (concat (symbol-name cmd) "-repeat")))
+(defun prelude-create-scratch-buffer ()
+ "Create a new scratch buffer."
+ (interactive)
+ (progn
+ (switch-to-buffer
+ (get-buffer-create (generate-new-buffer-name "*scratch*")))
+ (emacs-lisp-mode)))
+
(defvar prelude-tips
'("Press <C-c o> to open a file with external program."
"Press <C-c p f> to navigate a project's files with ido."
@@ -368,7 +377,8 @@ and so on."
(defun prelude-tip-of-the-day ()
(interactive)
- (message (concat "Prelude tip: " (nth (random (length prelude-tips)) prelude-tips))))
+ (message
+ (concat "Prelude tip: " (nth (random (length prelude-tips)) prelude-tips))))
(defun prelude-eval-after-init (form)
"Add `(lambda () FORM)' to `after-init-hook'.
@@ -379,5 +389,11 @@ and so on."
(when after-init-time
(eval form))))
+(defun prelude-exchange-point-and-mark ()
+ "Identical to `exchange-point-and-mark' but will not activate the region."
+ (interactive)
+ (exchange-point-and-mark)
+ (deactivate-mark nil))
+
(provide 'prelude-core)
;;; prelude-core.el ends here
View
2 prelude/prelude-global-keybindings.el
@@ -90,6 +90,8 @@
(global-set-key (kbd "C-=") 'er/expand-region)
(global-set-key (kbd "C-c w") (make-repeatable-command 'er/expand-region))
+(define-key global-map [remap exchange-point-and-mark] 'prelude-exchange-point-and-mark)
+
(provide 'prelude-global-keybindings)
;;; prelude-global-keybindings.el ends here

0 comments on commit d3065f2

Please sign in to comment.