[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master fa043b6 70/92: Fixed issue #5 with electric-indent-mode by
From: |
Alexey Veretennikov |
Subject: |
[elpa] master fa043b6 70/92: Fixed issue #5 with electric-indent-mode by turning it off |
Date: |
Thu, 11 Jun 2015 19:48:15 +0000 |
branch: master
commit fa043b619999b8972e71d27155e6d358eb6d02a4
Author: Alexey Veretennikov <address@hidden>
Commit: Alexey Veretennikov <address@hidden>
Fixed issue #5 with electric-indent-mode by turning it off
---
ztree-diff.el | 16 ++++++++--------
ztree-dir.el | 4 ++--
ztree-util.el | 5 +++++
ztree-view.el | 11 +++++++++--
4 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/ztree-diff.el b/ztree-diff.el
index 044ab90..9d01d8e 100644
--- a/ztree-diff.el
+++ b/ztree-diff.el
@@ -107,27 +107,27 @@ including . and ..")
(defun ztree-diff-insert-buffer-header ()
(insert-with-face "Differences tree" ztreep-diff-header-face)
- (newline)
+ (newline-and-begin)
(when ztree-diff-dirs-pair
(insert-with-face (concat "Left: " (car ztree-diff-dirs-pair))
ztreep-diff-header-small-face)
- (newline)
+ (newline-and-begin)
(insert-with-face (concat "Right: " (cdr ztree-diff-dirs-pair))
ztreep-diff-header-small-face)
- (newline))
+ (newline-and-begin))
(insert-with-face "Legend:" ztreep-diff-header-small-face)
- (newline)
+ (newline-and-begin)
(insert-with-face " Normal file " ztreep-diff-model-normal-face)
(insert-with-face "- same on both sides" ztreep-diff-header-small-face)
- (newline)
+ (newline-and-begin)
(insert-with-face " Orphan file " ztreep-diff-model-add-face)
(insert-with-face "- does not exist on other side"
ztreep-diff-header-small-face)
- (newline)
+ (newline-and-begin)
(insert-with-face " Mismatch file " ztreep-diff-model-diff-face)
(insert-with-face "- different from other side"
ztreep-diff-header-small-face)
- (newline)
+ (newline-and-begin)
(insert-with-face "==============" ztreep-diff-header-face)
- (newline))
+ (newline-and-begin))
(defun ztree-diff-full-rescan ()
"Forces full rescan of the directory trees"
diff --git a/ztree-dir.el b/ztree-dir.el
index 5d67b64..d321d16 100644
--- a/ztree-dir.el
+++ b/ztree-dir.el
@@ -80,10 +80,10 @@ including . and ..")
(defun ztree-insert-buffer-header ()
(let ((start (point)))
(insert "Directory tree")
- (newline)
+ (newline-and-begin)
(insert "==============")
(set-text-properties start (point) '(face ztreep-header-face)))
- (newline))
+ (newline-and-begin))
(defun ztree-file-not-hidden (filename)
(not (string-match ztree-hidden-files-regexp
diff --git a/ztree-util.el b/ztree-util.el
index 0fbdadc..6698d7d 100644
--- a/ztree-util.el
+++ b/ztree-util.el
@@ -51,6 +51,11 @@ Taken from
http://www.emacswiki.org/emacs/ElispCookbook#toc39"
http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg01238.html"
(printable-string (file-name-nondirectory (directory-file-name file))))
+
+(defun newline-and-begin ()
+ (newline)
+ (beginning-of-line))
+
(defun car-atom (value)
"Returns value if value is an atom, otherwise (car value) or nil.
Used since car-safe returns nil for atoms"
diff --git a/ztree-view.el b/ztree-view.el
index e2a460e..2e0980f 100644
--- a/ztree-view.el
+++ b/ztree-view.el
@@ -179,9 +179,16 @@ the buffer is split to 2 trees")
;;;###autoload
(define-derived-mode ztree-mode special-mode "Ztree"
+ "A major mode for displaying the directory tree in text mode."
;; only spaces
(setq indent-tabs-mode nil)
- "A major mode for displaying the directory tree in text mode.")
+ ;; fix for electric-indent-mode
+ ;; for emacs 24.4
+ (if (fboundp 'electric-indent-local-mode)
+ (electric-indent-local-mode -1)
+ ;; for emacs 24.3 or less
+ (add-hook 'electric-indent-functions
+ (lambda (arg) 'no-indent) nil 'local)))
(defun ztree-find-node-in-line (line)
@@ -454,7 +461,7 @@ list of leafs"
(puthash line side ztree-line-tree-properties))
(ztree-insert-single-entry short-name depth expandable expanded 0))
(puthash line node ztree-line-to-node-table)
- (newline)
+ (newline-and-begin)
line))
(defun ztree-insert-single-entry (short-name depth
- [elpa] master 11bcff0 60/92: Updated docstrings; removed debug print from partial rescan, (continued)
- [elpa] master 11bcff0 60/92: Updated docstrings; removed debug print from partial rescan, Alexey Veretennikov, 2015/06/11
- [elpa] master 865afb0 59/92: Implemented partial rescan/refresh feature ('r' hotkey), Alexey Veretennikov, 2015/06/11
- [elpa] master 15f376d 63/92: Add -pkg.el file, Alexey Veretennikov, 2015/06/11
- [elpa] master 7530053 64/92: Merge pull request #2 from yasuyk/patch-1, Alexey Veretennikov, 2015/06/11
- [elpa] master 0642c05 61/92: Updated readme, Alexey Veretennikov, 2015/06/11
- [elpa] master bd7547b 66/92: Add autoload cookies, Alexey Veretennikov, 2015/06/11
- [elpa] master c81ae1f 65/92: Merge pull request #3 from yasuyk/patch-2, Alexey Veretennikov, 2015/06/11
- [elpa] master 635eb9a 67/92: Merge pull request #4 from yasuyk/patch-3, Alexey Veretennikov, 2015/06/11
- [elpa] master b772a0c 71/92: Merge branch 'master' of github.com:fourier/ztree, Alexey Veretennikov, 2015/06/11
- [elpa] master 557024f 72/92: Merge pull request #6 from jpkotta/master, Alexey Veretennikov, 2015/06/11
- [elpa] master fa043b6 70/92: Fixed issue #5 with electric-indent-mode by turning it off,
Alexey Veretennikov <=
- [elpa] master 4086298 68/92: add ztree-find-file as the action for ztree-dir, Alexey Veretennikov, 2015/06/11
- [elpa] master d44da81 69/92: Fixed issue #1 with electric-indent-mode by turning it off, Alexey Veretennikov, 2015/06/11
- [elpa] master 111afc6 73/92: Issue #8: Added hotkey 'x' to toggle between expanded/collapsed state of the current directory and its children, Alexey Veretennikov, 2015/06/11
- [elpa] master 2dd7c7b 75/92: Fixed vertical line for separator - now it is not rounded, Alexey Veretennikov, 2015/06/11
- [elpa] master f037979 74/92: Added rounding at the end of vertical line, Alexey Veretennikov, 2015/06/11
- [elpa] master 364eced 76/92: Make it work over TRAMP, Alexey Veretennikov, 2015/06/11
- [elpa] master 32db847 78/92: Fixed files with spaces comparison error, Alexey Veretennikov, 2015/06/11
- [elpa] master cefecf1 77/92: Merge pull request #9 from Silex/master, Alexey Veretennikov, 2015/06/11
- [elpa] master 9b1f994 79/92: Fixed tree offset on the right side, Alexey Veretennikov, 2015/06/11
- [elpa] master b217776 80/92: Added reference to zdircmp, Alexey Veretennikov, 2015/06/11