chiark / gitweb /
stgit.el: Allow operating on the end of each line
authorGustav Hållberg <gustav@virtutech.com>
Fri, 31 Jul 2009 11:52:56 +0000 (13:52 +0200)
committerGustav Hållberg <gustav@virtutech.com>
Thu, 6 Aug 2009 20:49:07 +0000 (22:49 +0200)
Extend patch/file properties to the newline at the end of each line,
allowing stgit-select and similar to take effect with point at the end
of line.

Signed-off-by: Gustav Hållberg <gustav@virtutech.com>
contrib/stgit.el

index 3d6be1f158516f5248ad8fc699aba4187c4e4ee3..078e46f9de0edd8104a94aa71cc4c8d721751932 100644 (file)
@@ -92,6 +92,7 @@ (defun stgit-patch-pp (patch)
                   (if (stgit-patch-empty patch) "(empty) " "")
                   (propertize (or (stgit-patch-desc patch) "")
                               'face 'stgit-description-face))))
+    (insert "\n")
     (put-text-property start (point) 'entry-type 'patch)
     (when (memq name stgit-expanded-patches)
       (stgit-insert-patch-files patch))
@@ -106,7 +107,7 @@ (defun create-stgit-buffer (dir)
       (setq default-directory dir)
       (stgit-mode)
       (set (make-local-variable 'stgit-ewoc)
-           (ewoc-create #'stgit-patch-pp "Branch:\n" "--"))
+           (ewoc-create #'stgit-patch-pp "Branch:\n\n" "--\n" t))
       (setq buffer-read-only t))
     buf))
 
@@ -258,7 +259,7 @@ (defun stgit-reload ()
                             (stgit-run-silent "branch")
                             (buffer-substring (point-min) (1- (point-max))))
                           'face 'stgit-branch-name-face)
-                         "\n")
+                         "\n\n")
                  (if stgit-show-worktree
                      "--"
                    (propertize
@@ -536,7 +537,7 @@ (defun stgit-insert-patch-files (patch)
         (ewoc-set-hf ewoc "" (propertize "    <no files>\n"
                                          'face 'stgit-description-face))))
     (goto-char end)
-    (delete-char -2)))
+    (delete-char -1)))
 
 (defun stgit-select-file ()
   (let ((filename (expand-file-name