Moved move-line package from elpa to github import
This commit is contained in:
parent
05af188366
commit
edd251c9e0
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -13,3 +13,6 @@
|
|||||||
[submodule "emacs-helm-gtags"]
|
[submodule "emacs-helm-gtags"]
|
||||||
path = emacs-helm-gtags
|
path = emacs-helm-gtags
|
||||||
url = git://github.com/syohex/emacs-helm-gtags.git
|
url = git://github.com/syohex/emacs-helm-gtags.git
|
||||||
|
[submodule "move-line"]
|
||||||
|
path = move-line
|
||||||
|
url = git://github.com/nflath/move-line.git
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
;;; move-line-autoloads.el --- automatically extracted autoloads
|
|
||||||
;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
|
|
||||||
;;;### (autoloads nil nil ("move-line-pkg.el" "move-line.el") (21553
|
|
||||||
;;;;;; 16742 574441 73000))
|
|
||||||
|
|
||||||
;;;***
|
|
||||||
|
|
||||||
(provide 'move-line-autoloads)
|
|
||||||
;; Local Variables:
|
|
||||||
;; version-control: never
|
|
||||||
;; no-byte-compile: t
|
|
||||||
;; no-update-autoloads: t
|
|
||||||
;; coding: utf-8
|
|
||||||
;; End:
|
|
||||||
;;; move-line-autoloads.el ends here
|
|
@ -1 +0,0 @@
|
|||||||
(define-package "move-line" "0.0.1" "utilities for moving lines in file" (quote nil))
|
|
@ -1,73 +0,0 @@
|
|||||||
;;; move-line.el --- utilities for moving lines in file
|
|
||||||
|
|
||||||
;; Copyright (C) 2014 Nathaniel Flath <flat0103@gmail.com>
|
|
||||||
|
|
||||||
;; Author: Nathaniel Flath <flat0103@gmail.com>
|
|
||||||
;; URL: http://github.com/nflath/move-line
|
|
||||||
;; Version: 0.0.1
|
|
||||||
|
|
||||||
;; This file is not part of GNU Emacs.
|
|
||||||
|
|
||||||
;;; Commentary:
|
|
||||||
|
|
||||||
;; This file provides several utility functions for moving the current line
|
|
||||||
;; up/down. The functions provided are move-line-up and move-line-down, bound
|
|
||||||
;; to control-shift-up and control-shift-down by default.
|
|
||||||
|
|
||||||
;;; Installation
|
|
||||||
|
|
||||||
;; To use this mode, put the following in your init.el:
|
|
||||||
;; (require 'move-line)
|
|
||||||
|
|
||||||
;;; License:
|
|
||||||
|
|
||||||
;; This program is free software; you can redistribute it and/or
|
|
||||||
;; modify it under the terms of the GNU General Public License
|
|
||||||
;; as published by the Free Software Foundation; either version 3
|
|
||||||
;; of the License, or (at your option) any later version.
|
|
||||||
;;
|
|
||||||
;; This program is distributed in the hope that it will be useful,
|
|
||||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
;; GNU General Public License for more details.
|
|
||||||
;;
|
|
||||||
;; You should have received a copy of the GNU General Public License
|
|
||||||
;; along with GNU Emacs; see the file COPYING. If not, write to the
|
|
||||||
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
;; Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(defun move-line (n)
|
|
||||||
"Move the current line up or down by N lines."
|
|
||||||
(interactive "p")
|
|
||||||
(let ((col (current-column))
|
|
||||||
start
|
|
||||||
end)
|
|
||||||
(beginning-of-line)
|
|
||||||
(setq start (point))
|
|
||||||
(end-of-line)
|
|
||||||
(forward-char)
|
|
||||||
(setq end (point))
|
|
||||||
(let ((line-text (delete-and-extract-region start end)))
|
|
||||||
(forward-line n)
|
|
||||||
(insert line-text)
|
|
||||||
;; restore point to original column in moved line
|
|
||||||
(forward-line -1)
|
|
||||||
(forward-char col))))
|
|
||||||
|
|
||||||
(defun move-line-up (n)
|
|
||||||
"Move the current line up by N lines."
|
|
||||||
(interactive "p")
|
|
||||||
(move-line (if (null n) -1 (- n))))
|
|
||||||
|
|
||||||
(defun move-line-down (n)
|
|
||||||
"Move the current line down by N lines."
|
|
||||||
(interactive "p")
|
|
||||||
(move-line (if (null n) 1 n)))
|
|
||||||
|
|
||||||
(global-set-key [(control shift up)] 'move-line-up)
|
|
||||||
(global-set-key [(control shift down)] 'move-line-down)
|
|
||||||
|
|
||||||
(provide 'move-line)
|
|
||||||
;;; move-line.el ends here
|
|
1
move-line
Submodule
1
move-line
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit f1707658df1621a9acc9d728c92d12bfef22d55d
|
Loading…
Reference in New Issue
Block a user