aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2018-07-21 19:11:32 +0300
committerEli Zaretskii2018-07-21 19:11:32 +0300
commitd12215324bb201d5f8c9e2b52c9b8d2abf30b1f4 (patch)
treefe76f52806a7dce0fea32f6c30cff57683216d33
parentf96fe57fb76df8e7282f266d42a0d471780e1d75 (diff)
downloademacs-d12215324bb201d5f8c9e2b52c9b8d2abf30b1f4.tar.gz
emacs-d12215324bb201d5f8c9e2b52c9b8d2abf30b1f4.zip
Minor rewording of last change
* lisp/vc/add-log.el (add-log-dont-create-changelog-file) (add-log--pseudo-changelog-buffer-name) (add-log--changelog-buffer-p, add-change-log-entry): Doc fixes. * etc/NEWS: Improve wording of last change. * doc/emacs/maintaining.texi (Change Log Commands): Improve wording of last change.
-rw-r--r--doc/emacs/maintaining.texi10
-rw-r--r--etc/NEWS12
-rw-r--r--lisp/vc/add-log.el78
3 files changed, 54 insertions, 46 deletions
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index c59978ebbe2..b31cacf998a 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -1657,14 +1657,16 @@ ordering of entries.
1657 1657
1658@vindex add-log-dont-create-changelog-file 1658@vindex add-log-dont-create-changelog-file
1659 Version control systems are another way to keep track of changes in 1659 Version control systems are another way to keep track of changes in
1660your program and keep a change log. In these situations, you may not 1660your program and keep a change log. Many projects that use a VCS don't
1661want to keep a separate versioned change log file. If 1661keep a separate versioned change log file nowadays, so you may wish to
1662avoid having such a file in the repository. If the value of
1662@code{add-log-dont-create-changelog-file} is non-@code{nil}, commands 1663@code{add-log-dont-create-changelog-file} is non-@code{nil}, commands
1663like @kbd{C-x 4 a} (@code{add-change-log-entry-other-window}) will 1664like @kbd{C-x 4 a} (@code{add-change-log-entry-other-window}) will
1664record changes in a suitably named temporary buffer instead of a file, 1665record changes in a suitably named temporary buffer instead of a file,
1665unless such a file already exists. 1666if such a file does not already exist.
1666 1667
1667In either case, you can type @kbd{C-c C-a} 1668Whether you have a change log file or use a temporary buffer for
1669change logs, you can type @kbd{C-c C-a}
1668(@code{log-edit-insert-changelog}) in the VC Log buffer to insert the 1670(@code{log-edit-insert-changelog}) in the VC Log buffer to insert the
1669relevant change log entries, if they exist. @xref{Log Buffer}. 1671relevant change log entries, if they exist. @xref{Log Buffer}.
1670 1672
diff --git a/etc/NEWS b/etc/NEWS
index 72e35f93e19..c2b6b500eeb 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -219,10 +219,14 @@ navigation and editing of large files.
219 219
220** Change Logs and VC 220** Change Logs and VC
221 221
222*** Recording ChangeLog entries doesn't require an actual file 222*** Recording ChangeLog entries doesn't require an actual file.
223An existing file will be used if it already exists. This is 223If a ChangeLog file doesn't exist, and if the new variable
224controlled by the defcustom 'add-log-dont-create-changelog-file', 224'add-log-dont-create-changelog-file' is non-nil (which is the
225which defaults to t. 225default), commands such as 'C-x 4 a' will add log entries to a
226suitable named temporary buffer. (An existing ChangeLog file will
227still be used if it exists.) Set the variable to nil to get the
228previous behavior of always creating a buffer that visits a ChangeLog
229file.
226 230
227** diff-mode 231** diff-mode
228*** Hunks are now automatically refined by default 232*** Hunks are now automatically refined by default
diff --git a/lisp/vc/add-log.el b/lisp/vc/add-log.el
index 5ed43e8c8c4..d6e85408608 100644
--- a/lisp/vc/add-log.el
+++ b/lisp/vc/add-log.el
@@ -744,7 +744,7 @@ Optional arg BUFFER-FILE overrides `buffer-file-name'."
744 file-name) 744 file-name)
745 745
746(defun add-log-file-name (buffer-file log-file) 746(defun add-log-file-name (buffer-file log-file)
747 "Compute file-name of BUFFER-FILE as displayed in LOG-FILE." 747 "Compute file-name of BUFFER-FILE to be used in entries in LOG-FILE."
748 ;; Never want to add a change log entry for the ChangeLog file itself. 748 ;; Never want to add a change log entry for the ChangeLog file itself.
749 (unless (or (null buffer-file) (string= buffer-file log-file)) 749 (unless (or (null buffer-file) (string= buffer-file log-file))
750 (if add-log-file-name-function 750 (if add-log-file-name-function
@@ -770,22 +770,23 @@ Optional arg BUFFER-FILE overrides `buffer-file-name'."
770 770
771(defcustom add-log-dont-create-changelog-file t 771(defcustom add-log-dont-create-changelog-file t
772 "If non-nil, don't create ChangeLog files for log entries. 772 "If non-nil, don't create ChangeLog files for log entries.
773This applies only if no pre-existing ChangeLog is found." 773If a ChangeLog file does not already exist, a non-nil value
774means to put log entries in a suitably named buffer."
774 :type :boolean 775 :type :boolean
775 :version "27.1") 776 :version "27.1")
776 777
777(put 'add-log-dont-create-changelog-file 'safe-local-variable 'booleanp) 778(put 'add-log-dont-create-changelog-file 'safe-local-variable 'booleanp)
778 779
779(defun add-log--pseudo-changelog-buffer-name (changelog-file-name) 780(defun add-log--pseudo-changelog-buffer-name (changelog-file-name)
780 "Compute suitable name for a non-file ChangeLog buffer. 781 "Compute a suitable name for a non-file visiting ChangeLog buffer.
781 CHANGELOG-FILE-NAME is the file name of the actual ChangeLog file 782CHANGELOG-FILE-NAME is the file name of the actual ChangeLog file
782 if it were to exist." 783if it were to exist."
783 (format "*changes to %s*" 784 (format "*changes to %s*"
784 (abbreviate-file-name 785 (abbreviate-file-name
785 (file-name-directory changelog-file-name)))) 786 (file-name-directory changelog-file-name))))
786 787
787(defun add-log--changelog-buffer-p (changelog-file-name buffer) 788(defun add-log--changelog-buffer-p (changelog-file-name buffer)
788 "Tell if BUFFER holds a ChangeLog for CHANGELOG-FILE-NAME." 789 "Return non-nil if BUFFER holds a change log for CHANGELOG-FILE-NAME."
789 (with-current-buffer buffer 790 (with-current-buffer buffer
790 (if buffer-file-name 791 (if buffer-file-name
791 (equal buffer-file-name changelog-file-name) 792 (equal buffer-file-name changelog-file-name)
@@ -794,7 +795,7 @@ This applies only if no pre-existing ChangeLog is found."
794 795
795(defun add-log-find-changelog-buffer (changelog-file-name) 796(defun add-log-find-changelog-buffer (changelog-file-name)
796 "Find a ChangeLog buffer for CHANGELOG-FILE-NAME. 797 "Find a ChangeLog buffer for CHANGELOG-FILE-NAME.
797 Respect `add-log-use-pseudo-changelog', which see." 798Respect `add-log-use-pseudo-changelog', which see."
798 (if (or (file-exists-p changelog-file-name) 799 (if (or (file-exists-p changelog-file-name)
799 (not add-log-dont-create-changelog-file)) 800 (not add-log-dont-create-changelog-file))
800 (find-file-noselect changelog-file-name) 801 (find-file-noselect changelog-file-name)
@@ -807,37 +808,38 @@ This applies only if no pre-existing ChangeLog is found."
807 other-window new-entry 808 other-window new-entry
808 put-new-entry-on-new-line) 809 put-new-entry-on-new-line)
809 "Find ChangeLog buffer, add an entry for today and an item for this file. 810 "Find ChangeLog buffer, add an entry for today and an item for this file.
810 Optional arg WHOAMI (interactive prefix) non-nil means prompt for 811Optional arg WHOAMI (interactive prefix) non-nil means prompt for
811 user name and email (stored in `add-log-full-name' and 812user name and email (stored in `add-log-full-name'
812 `add-log-mailing-address'). 813and `add-log-mailing-address').
813 814
814 Second arg CHANGELOG-FILE-NAME is file name of the change log. 815Second arg CHANGELOG-FILE-NAME is the file name of the change log.
815 If nil, use the value of `change-log-default-name'. If the file 816If nil, use the value of `change-log-default-name'. If the file
816 thus named exists, it's used for the new entry. If it doesn't 817thus named exists, it is used for the new entry. If it doesn't
817 exist, it is created, unless `add-log-dont-create-changelog-file' is t, 818exist, it is created, unless `add-log-dont-create-changelog-file' is t,
818 in which case a suitably named file-less buffer is used for 819in which case a suitably named buffer that doesn't visit any file
819 keeping entries pertaining to CHANGELOG-FILE-NAME's directory. 820is used for keeping entries pertaining to CHANGELOG-FILE-NAME's
820 821directory.
821 Third arg OTHER-WINDOW non-nil means visit in other window. 822
822 823Third arg OTHER-WINDOW non-nil means visit in other window.
823 Fourth arg NEW-ENTRY non-nil means always create a new entry at the front; 824
824 never append to an existing entry. Option `add-log-keep-changes-together' 825Fourth arg NEW-ENTRY non-nil means always create a new entry at the front;
825 otherwise affects whether a new entry is created. 826never append to an existing entry. Option `add-log-keep-changes-together'
826 827otherwise affects whether a new entry is created.
827 Fifth arg PUT-NEW-ENTRY-ON-NEW-LINE non-nil means that if a new 828
828 entry is created, put it on a new line by itself, do not put it 829Fifth arg PUT-NEW-ENTRY-ON-NEW-LINE non-nil means that if a new
829 after a comma on an existing line. 830entry is created, put it on a new line by itself, do not put it
830 831after a comma on an existing line.
831 Option `add-log-always-start-new-record' non-nil means always create a 832
832 new record, even when the last record was made on the same date and by 833Option `add-log-always-start-new-record' non-nil means always create a
833 the same person. 834new record, even when the last record was made on the same date and by
834 835the same person.
835 The change log file can start with a copyright notice and a copying 836
836 permission notice. The first blank line indicates the end of these 837The change log file can start with a copyright notice and a copying
837 notices. 838permission notice. The first blank line indicates the end of these
838 839notices.
839 Today's date is calculated according to `add-log-time-zone-rule' if 840
840 non-nil, otherwise in local time." 841Today's date is calculated according to `add-log-time-zone-rule' if
842non-nil, otherwise in local time."
841 (interactive (list current-prefix-arg 843 (interactive (list current-prefix-arg
842 (prompt-for-change-log-name))) 844 (prompt-for-change-log-name)))
843 (let* ((defun (add-log-current-defun)) 845 (let* ((defun (add-log-current-defun))