emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r115320: Apply the initial log-edit tweaks discussed


From: Dmitry Gutov
Subject: [Emacs-diffs] trunk r115320: Apply the initial log-edit tweaks discussed at emacs-devel
Date: Sun, 01 Dec 2013 04:13:59 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115320
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Gutov <address@hidden>
branch nick: trunk
timestamp: Sun 2013-12-01 06:13:50 +0200
message:
  Apply the initial log-edit tweaks discussed at emacs-devel
  * .dir-locals.el: (log-edit-move): Add the "Author: " header.
  
  * lisp/vc/log-edit.el (log-edit-mode-map): Add binding for
  `log-edit-beginning-of-line'.
  (log-edit-setup-add-author): New user option.
  (log-edit-beginning-of-line): New command.
  (log-edit): Move major mode call above the contents setup so that
  the local variable values are already applied.
  (log-edit): Only insert "Author: " when
  `log-edit-setup-add-author' is non-nil.
  (log-edit): When SETUP is non-nil, position point after ": "
  instead of point-min.
modified:
  .dir-locals.el                 
dirlocals.el-20091113204419-o5vbwnq5f7feedwu-8809
  ChangeLog                      changelog-20091113204419-o5vbwnq5f7feedwu-1538
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/vc/log-edit.el            logedit.el-20091113204419-o5vbwnq5f7feedwu-1776
=== modified file '.dir-locals.el'
--- a/.dir-locals.el    2012-09-24 14:38:10 +0000
+++ b/.dir-locals.el    2013-12-01 04:13:50 +0000
@@ -7,7 +7,8 @@
  ;; See admin/notes/bugtracker.
  (log-edit-mode . ((log-edit-rewrite-fixes
                     "[ \n](bug#\\([0-9]+\\))" . "debbugs:\\1")
-                   (log-edit-font-lock-gnu-style . t)))
+                   (log-edit-font-lock-gnu-style . t)
+                   (log-edit-setup-add-author . t)))
  (change-log-mode . ((add-log-time-zone-rule . t)
                     (fill-column . 74)
                     (bug-reference-url-format . "http://debbugs.gnu.org/%s";)

=== modified file 'ChangeLog'
--- a/ChangeLog 2013-11-30 15:42:13 +0000
+++ b/ChangeLog 2013-12-01 04:13:50 +0000
@@ -1,3 +1,7 @@
+2013-12-01  Dmitry Gutov  <address@hidden>
+
+       * .dir-locals.el: (log-edit-move): Add the "Author: " header.
+
 2013-11-30  Dani Moncayo  <address@hidden>
 
        * build-aux/msys-to-w32 (w32pathlist): Do not translate paths

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-12-01 02:04:46 +0000
+++ b/lisp/ChangeLog    2013-12-01 04:13:50 +0000
@@ -1,3 +1,16 @@
+2013-12-01  Dmitry Gutov  <address@hidden>
+
+       * vc/log-edit.el (log-edit-mode-map): Add binding for
+       `log-edit-beginning-of-line'.
+       (log-edit-setup-add-author): New user option.
+       (log-edit-beginning-of-line): New command.
+       (log-edit): Move major mode call above the contents setup so that
+       the local variable values are already applied.
+       (log-edit): Only insert "Author: " when
+       `log-edit-setup-add-author' is non-nil.
+       (log-edit): When SETUP is non-nil, position point after ": "
+       instead of point-min.
+
 2013-12-01  Glenn Morris  <address@hidden>
 
        * startup.el (command-line): Warn if ~/emacs.d is in load-path.

=== modified file 'lisp/vc/log-edit.el'
--- a/lisp/vc/log-edit.el       2013-01-12 03:15:14 +0000
+++ b/lisp/vc/log-edit.el       2013-12-01 04:13:50 +0000
@@ -32,6 +32,7 @@
 (require 'add-log)                     ; for all the ChangeLog goodies
 (require 'pcvs-util)
 (require 'ring)
+(require 'message)
 
 ;;;;
 ;;;; Global Variables
@@ -55,6 +56,7 @@
     ("\C-c\C-a" . log-edit-insert-changelog)
     ("\C-c\C-d" . log-edit-show-diff)
     ("\C-c\C-f" . log-edit-show-files)
+    ("\C-a"     . log-edit-beginning-of-line)
     ("\M-n"    . log-edit-next-comment)
     ("\M-p"    . log-edit-previous-comment)
     ("\M-r"    . log-edit-comment-search-backward)
@@ -116,6 +118,13 @@
   :group 'log-edit
   :type 'boolean)
 
+(defcustom log-edit-setup-add-author nil
+  "Non-nil means `log-edit' should add the `Author:' header when
+its SETUP argument is non-nil."
+  :group 'log-edit
+  :type 'boolean
+  :safe 'booleanp)
+
 (defcustom log-edit-hook '(log-edit-insert-cvs-template
                            log-edit-show-files
                           log-edit-insert-changelog)
@@ -427,13 +436,15 @@
     (if buffer (pop-to-buffer buffer))
     (when (and log-edit-setup-invert (not (eq setup 'force)))
       (setq setup (not setup)))
-    (when setup
-      (erase-buffer)
-      (insert "Summary: \nAuthor: ")
-      (save-excursion (insert "\n\n")))
     (if mode
        (funcall mode)
       (log-edit-mode))
+    (when setup
+      (erase-buffer)
+      (insert "Summary: ")
+      (when log-edit-setup-add-author
+        (insert "\nAuthor: "))
+      (insert "\n\n"))
     (set (make-local-variable 'log-edit-callback) callback)
     (if (listp params)
        (dolist (crt params)
@@ -445,7 +456,10 @@
     (if buffer (set (make-local-variable 'log-edit-parent-buffer) parent))
     (set (make-local-variable 'log-edit-initial-files) (log-edit-files))
     (when setup (run-hooks 'log-edit-hook))
-    (goto-char (point-min)) (push-mark (point-max))
+    (if setup
+        (message-position-point)
+      (goto-char (point-min)))
+    (push-mark (point-max))
     (message "%s" (substitute-command-keys
              "Press \\[log-edit-done] when you are done editing."))))
 
@@ -574,6 +588,15 @@
        (shrink-window-if-larger-than-buffer)
        (selected-window)))))
 
+(defun log-edit-beginning-of-line (&optional n)
+  "Move point to beginning of header value or to beginning of line.
+
+It works the same as `message-beginning-of-line', but it uses a
+different header separator appropriate for `log-edit-mode'."
+  (interactive "p")
+  (let ((mail-header-separator ""))
+    (message-beginning-of-line n)))
+
 (defun log-edit-empty-buffer-p ()
   "Return non-nil if the buffer is \"empty\"."
   (or (= (point-min) (point-max))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]