commit e3a57e27a6c6ef2d36d967841e88451c494b1fb7
parent cc19d83d41d613d791376cb3e26d3793bc38b4cb
Author: Hugo Soucy <hugo.soucy@savoirfairelinux.com>
Date: Sun, 16 Oct 2016 19:08:09 -0400
Add several changes.
Diffstat:
6 files changed, 65 insertions(+), 54 deletions(-)
diff --git a/defuns/duplicate-line.el b/defuns/duplicate-line.el
@@ -1,15 +1,15 @@
;; Duplicating lines & commenting them
(defun djcb-duplicate-line (&optional commentfirst)
- "comment line at point; if COMMENTFIRST is non-nil, comment the original"
- (interactive)
- (beginning-of-line)
- (let
- ((beg (point)))
- (end-of-line)
- (let ((str (buffer-substring beg (point))))
- (when commentfirst
- (comment-region beg (point)))
- (insert-string
- (concat (if (= 0 (forward-line 1)) "" "\n") str "\n"))
- (forward-line -1))))
+ "comment line at point; if COMMENTFIRST is non-nil, comment the original"
+ (interactive)
+ (beginning-of-line)
+ (let
+ ((beg (point)))
+ (end-of-line)
+ (let ((str (buffer-substring beg (point))))
+ (when commentfirst
+ (comment-region beg (point)))
+ (insert-string
+ (concat (if (= 0 (forward-line 1)) "" "\n") str "\n"))
+ (forward-line -1))))
diff --git a/defuns/navigate-brackets.el b/defuns/navigate-brackets.el
@@ -1,57 +1,57 @@
;; Commands to Navigate Brackets (http://ergoemacs.org/emacs/emacs_navigating_keys_for_brackets.html)
(defun forward-open-bracket (&optional number)
- "Move cursor to the next occurrence of left bracket or quotation mark.
+ "Move cursor to the next occurrence of left bracket or quotation mark.
With prefix NUMBER, move forward to the next NUMBER left bracket or quotation mark.
With a negative prefix NUMBER, move backward to the previous NUMBER left bracket or quotation mark."
- (interactive "p")
- (if (and number
- (> 0 number))
- (backward-open-bracket (- 0 number))
- (forward-char 1)
- (search-forward-regexp
- (eval-when-compile
- (regexp-opt
- '("(" "{" "[" "<" "〔" "【" "〖" "〈" "《" "「" "『" "“" "‘" "‹" "«"))) nil t number)
- (backward-char 1)))
+ (interactive "p")
+ (if (and number
+ (> 0 number))
+ (backward-open-bracket (- 0 number))
+ (forward-char 1)
+ (search-forward-regexp
+ (eval-when-compile
+ (regexp-opt
+ '("(" "{" "[" "<" "〔" "【" "〖" "〈" "《" "「" "『" "“" "‘" "‹" "«"))) nil t number)
+ (backward-char 1)))
(defun backward-open-bracket (&optional number)
- "Move cursor to the previous occurrence of left bracket or quotation mark.
+ "Move cursor to the previous occurrence of left bracket or quotation mark.
With prefix argument NUMBER, move backward NUMBER open brackets.
With a negative prefix NUMBER, move forward NUMBER open brackets."
- (interactive "p")
- (if (and number
- (> 0 number))
- (forward-open-bracket (- 0 number))
- (search-backward-regexp
- (eval-when-compile
- (regexp-opt
- '("(" "{" "[" "<" "〔" "【" "〖" "〈" "《" "「" "『" "“" "‘" "‹" "«"))) nil t number)))
+ (interactive "p")
+ (if (and number
+ (> 0 number))
+ (forward-open-bracket (- 0 number))
+ (search-backward-regexp
+ (eval-when-compile
+ (regexp-opt
+ '("(" "{" "[" "<" "〔" "【" "〖" "〈" "《" "「" "『" "“" "‘" "‹" "«"))) nil t number)))
(defun forward-close-bracket (&optional number)
- "Move cursor to the next occurrence of right bracket or quotation mark.
+ "Move cursor to the next occurrence of right bracket or quotation mark.
With a prefix argument NUMBER, move forward NUMBER closed bracket.
With a negative prefix argument NUMBER, move backward NUMBER closed brackets."
- (interactive "p")
- (if (and number
- (> 0 number))
- (backward-close-bracket (- 0 number))
- (search-forward-regexp
- (eval-when-compile
- (regexp-opt '(")" "]" "}" ">" "〕" "】" "〗" "〉" "》" "」" "』" "”" "’" "›" "»"))) nil t number)))
+ (interactive "p")
+ (if (and number
+ (> 0 number))
+ (backward-close-bracket (- 0 number))
+ (search-forward-regexp
+ (eval-when-compile
+ (regexp-opt '(")" "]" "}" ">" "〕" "】" "〗" "〉" "》" "」" "』" "”" "’" "›" "»"))) nil t number)))
(defun backward-close-bracket (&optional number)
- "Move cursor to the previous occurrence of right bracket or quotation mark.
+ "Move cursor to the previous occurrence of right bracket or quotation mark.
With a prefix argument NUMBER, move backward NUMBER closed brackets.
With a negative prefix argument NUMBER, move forward NUMBER closed brackets."
- (interactive "p")
- (if (and number
- (> 0 number))
- (forward-close-bracket (- 0 number))
- (backward-char 1)
- (search-backward-regexp
- (eval-when-compile
- (regexp-opt '(")" "]" "}" ">" "〕" "】" "〗" "〉" "》" "」" "』" "”" "’" "›" "»"))) nil t number)
- (forward-char 1)))
+ (interactive "p")
+ (if (and number
+ (> 0 number))
+ (forward-close-bracket (- 0 number))
+ (backward-char 1)
+ (search-backward-regexp
+ (eval-when-compile
+ (regexp-opt '(")" "]" "}" ">" "〕" "】" "〗" "〉" "》" "」" "』" "”" "’" "›" "»"))) nil t number)
+ (forward-char 1)))
diff --git a/defuns/top-join-line.el b/defuns/top-join-line.el
@@ -1,6 +1,6 @@
;; Compress a few lines into one
(defun top-join-line ()
- "Join the current line with the line beneath it."
- (interactive)
- (delete-indentation 1))
+ "Join the current line with the line beneath it."
+ (interactive)
+ (delete-indentation 1))
diff --git a/init.el b/init.el
@@ -1,4 +1,11 @@
;; Workaround to fix problems with accented characters in Ubuntu 13.10
+
+;; Added by Package.el. This must come before configurations of
+;; installed packages. Don't delete this line. If you don't want it,
+;; just comment it out by adding a semicolon to the start of the line.
+;; You may delete these explanatory comments.
+(package-initialize)
+
(require 'iso-transl)
;; It adds in a ton of compatibility with Common Lisp, so that you can just use the Common Lisp functions.
diff --git a/lisp/setup-package.el b/lisp/setup-package.el
@@ -2,7 +2,7 @@
(require 'package)
(package-initialize)
(add-to-list 'package-archives '("melpa-stable" . "http://melpa-stable.milkbox.net/packages/") t)
- (add-to-list 'package-archives '("marmalade" . "https://marmalade-repo.org/packages/") t)
+ (add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/") t)
)
(provide 'setup-package)
diff --git a/lisp/setup-web-mode.el b/lisp/setup-web-mode.el
@@ -2,6 +2,10 @@
;; templates: HTML documents embedding CSS / JavaScript and Server
;; blocks.
+;; To set engine on the fly :
+;; `M-x web-mode-set-engine`
+;; Then indicate the name of the engine
+
(add-to-list 'auto-mode-alist '("\\.html\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.xhtml\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode))