From: Philipp Stephani <p.stephani2@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 27764@debbugs.gnu.org
Subject: bug#27764: 26.0.50; Argument STARTUP-HOOKS for `ediff-files' undocumented
Date: Sun, 24 Sep 2017 08:00:53 +0000 [thread overview]
Message-ID: <CAArVCkRC4o35H38arC6F2JFus8TsDNeFpVKjnzrqonESNPL9Dg@mail.gmail.com> (raw)
In-Reply-To: <83lgl59r6j.fsf@gnu.org>
[-- Attachment #1.1: Type: text/plain, Size: 1005 bytes --]
Eli Zaretskii <eliz@gnu.org> schrieb am Sa., 23. Sep. 2017 um 21:00 Uhr:
> > From: Philipp Stephani <p.stephani2@gmail.com>
> > Date: Sat, 23 Sep 2017 18:46:57 +0000
> >
> > Here's a patch that adds some missing documentation to ediff.el.
>
> Thanks.
>
> > ;;;###autoload
> > (defun ediff-buffers (buffer-A buffer-B &optional startup-hooks
> job-name)
> > - "Run Ediff on a pair of buffers, BUFFER-A and BUFFER-B."
> > + "Run Ediff on a pair of buffers, BUFFER-A and BUFFER-B.
> > +STARTUP-HOOKS is a list of functions that Emacs calls without
> > +arguments after setting up the Ediff buffers. JOB-NAME is a
> > +symbol describing the Ediff job type; it defaults to
> > +`ediff-buffers'."
>
> Here and elsewhere where JOB-NAME is mentioned, it would be good to
> have a full list of supported symbols, not just the default one.
>
>
I've added some generic text to the docstrings. I have no idea what the
full list of supported symbols are and what the point of this argument is
in the first place.
[-- Attachment #1.2: Type: text/html, Size: 1470 bytes --]
[-- Attachment #2: 0001-Ediff-add-some-missing-documentation.txt --]
[-- Type: text/plain, Size: 16839 bytes --]
From 098072c1b5959b3458f8859d505a2cf92bbf1d36 Mon Sep 17 00:00:00 2001
From: Philipp Stephani <phst@google.com>
Date: Sat, 23 Sep 2017 20:43:44 +0200
Subject: [PATCH] Ediff: add some missing documentation
* vc/ediff.el (ediff-files, ediff-files3, ediff-buffers)
(ediff-buffers3, ediff-merge-directories)
(ediff-merge-directories-with-ancestor)
(ediff-merge-directory-revisions)
(ediff-merge-directory-revisions-with-ancestor)
(ediff-windows-wordwise, ediff-windows-linewise)
(ediff-regions-wordwise, ediff-regions-linewise)
(ediff-merge-files, ediff-merge-files-with-ancestor)
(ediff-merge-buffers, ediff-merge-buffers-with-ancestor)
(ediff-merge-revisions, ediff-merge-revisions-with-ancestor)
(ediff-patch-file, ediff-revision): Document missing arguments.
(ediff-patch-buffer, ediff-revision): Add second space after
period.
(ediff-files-command, ediff3-files-command, ediff-merge-command)
(ediff-merge-with-ancestor-command, ediff-directories-command)
(ediff-directories3-command, ediff-merge-directories-command): Add
documentation for the command line functions.
---
lisp/vc/ediff.el | 118 +++++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 93 insertions(+), 25 deletions(-)
diff --git a/lisp/vc/ediff.el b/lisp/vc/ediff.el
index d0f8e63dcb..993ff934df 100644
--- a/lisp/vc/ediff.el
+++ b/lisp/vc/ediff.el
@@ -185,7 +185,9 @@ ediff-get-default-file-name
;;;###autoload
(defun ediff-files (file-A file-B &optional startup-hooks)
- "Run Ediff on a pair of files, FILE-A and FILE-B."
+ "Run Ediff on a pair of files, FILE-A and FILE-B.
+STARTUP-HOOKS is a list of functions that Emacs calls without
+arguments after setting up the Ediff buffers."
(interactive
(let ((dir-A (if ediff-use-last-dir
ediff-last-dir-A
@@ -221,7 +223,9 @@ ediff-files
;;;###autoload
(defun ediff-files3 (file-A file-B file-C &optional startup-hooks)
- "Run Ediff on three files, FILE-A, FILE-B, and FILE-C."
+ "Run Ediff on three files, FILE-A, FILE-B, and FILE-C.
+STARTUP-HOOKS is a list of functions that Emacs calls without
+arguments after setting up the Ediff buffers."
(interactive
(let ((dir-A (if ediff-use-last-dir
ediff-last-dir-A
@@ -419,7 +423,12 @@ ediff-backup
;;;###autoload
(defun ediff-buffers (buffer-A buffer-B &optional startup-hooks job-name)
- "Run Ediff on a pair of buffers, BUFFER-A and BUFFER-B."
+ "Run Ediff on a pair of buffers, BUFFER-A and BUFFER-B.
+STARTUP-HOOKS is a list of functions that Emacs calls without
+arguments after setting up the Ediff buffers. JOB-NAME is a
+symbol describing the Ediff job type; it defaults to
+`ediff-buffers', but can also be one of the other `ediff'
+function symbols."
(interactive
(let (bf)
(list (setq bf (read-buffer "Buffer A to compare: "
@@ -441,7 +450,12 @@ 'ebuffers
;;;###autoload
(defun ediff-buffers3 (buffer-A buffer-B buffer-C
&optional startup-hooks job-name)
- "Run Ediff on three buffers, BUFFER-A, BUFFER-B, and BUFFER-C."
+ "Run Ediff on three buffers, BUFFER-A, BUFFER-B, and BUFFER-C.
+STARTUP-HOOKS is a list of functions that Emacs calls without
+arguments after setting up the Ediff buffers. JOB-NAME is a
+symbol describing the Ediff job type; it defaults to
+`ediff-buffers3', but can also be one of the other `ediff'
+function symbols."
(interactive
(let (bf bff)
(list (setq bf (read-buffer "Buffer A to compare: "
@@ -637,7 +651,8 @@ 'edirs3
(defun ediff-merge-directories (dir1 dir2 regexp &optional merge-autostore-dir)
"Run Ediff on a pair of directories, DIR1 and DIR2, merging files that have
the same name in both. The third argument, REGEXP, is nil or a regular
-expression; only file names that match the regexp are considered."
+expression; only file names that match the regexp are considered.
+MERGE-AUTOSTORE-DIR is the directory in which to store merged files."
(interactive
(let ((dir-A (ediff-get-default-directory-name))
(default-regexp (eval ediff-default-filtering-regexp))
@@ -674,7 +689,8 @@ ediff-merge-directories-with-ancestor
Ediff merges files that have identical names in DIR1, DIR2. If a pair of files
in DIR1 and DIR2 doesn't have an ancestor in ANCESTOR-DIR, Ediff will merge
without ancestor. The fourth argument, REGEXP, is nil or a regular expression;
-only file names that match the regexp are considered."
+only file names that match the regexp are considered.
+MERGE-AUTOSTORE-DIR is the directory in which to store merged files."
(interactive
(let ((dir-A (ediff-get-default-directory-name))
(default-regexp (eval ediff-default-filtering-regexp))
@@ -710,7 +726,8 @@ ediff-merge-directory-revisions
&optional merge-autostore-dir)
"Run Ediff on a directory, DIR1, merging its files with their revisions.
The second argument, REGEXP, is a regular expression that filters the file
-names. Only the files that are under revision control are taken into account."
+names. Only the files that are under revision control are taken into account.
+MERGE-AUTOSTORE-DIR is the directory in which to store merged files."
(interactive
(let ((dir-A (ediff-get-default-directory-name))
(default-regexp (eval ediff-default-filtering-regexp))
@@ -740,7 +757,8 @@ ediff-merge-directory-revisions-with-ancestor
merge-autostore-dir)
"Run Ediff on a directory, DIR1, merging its files with their revisions and ancestors.
The second argument, REGEXP, is a regular expression that filters the file
-names. Only the files that are under revision control are taken into account."
+names. Only the files that are under revision control are taken into account.
+MERGE-AUTOSTORE-DIR is the directory in which to store merged files."
(interactive
(let ((dir-A (ediff-get-default-directory-name))
(default-regexp (eval ediff-default-filtering-regexp))
@@ -908,7 +926,9 @@ ediff-windows-wordwise
With prefix argument, DUMB-MODE, or on a non-windowing display, works as
follows:
If WIND-A is nil, use selected window.
-If WIND-B is nil, use window next to WIND-A."
+If WIND-B is nil, use window next to WIND-A.
+STARTUP-HOOKS is a list of functions that Emacs calls without
+arguments after setting up the Ediff buffers."
(interactive "P")
(ediff-windows dumb-mode wind-A wind-B
startup-hooks 'ediff-windows-wordwise 'word-mode))
@@ -919,7 +939,9 @@ ediff-windows-linewise
With prefix argument, DUMB-MODE, or on a non-windowing display, works as
follows:
If WIND-A is nil, use selected window.
-If WIND-B is nil, use window next to WIND-A."
+If WIND-B is nil, use window next to WIND-A.
+STARTUP-HOOKS is a list of functions that Emacs calls without
+arguments after setting up the Ediff buffers."
(interactive "P")
(ediff-windows dumb-mode wind-A wind-B
startup-hooks 'ediff-windows-linewise nil))
@@ -963,9 +985,12 @@ ediff-windows
;;;###autoload
(defun ediff-regions-wordwise (buffer-A buffer-B &optional startup-hooks)
"Run Ediff on a pair of regions in specified buffers.
+BUFFER-A and BUFFER-B are the buffers to be compared.
Regions (i.e., point and mark) can be set in advance or marked interactively.
This function is effective only for relatively small regions, up to 200
-lines. For large regions, use `ediff-regions-linewise'."
+lines. For large regions, use `ediff-regions-linewise'.
+STARTUP-HOOKS is a list of functions that Emacs calls without
+arguments after setting up the Ediff buffers."
(interactive
(let (bf)
(list (setq bf (read-buffer "Region's A buffer: "
@@ -1003,10 +1028,13 @@ ediff-regions-wordwise
;;;###autoload
(defun ediff-regions-linewise (buffer-A buffer-B &optional startup-hooks)
"Run Ediff on a pair of regions in specified buffers.
+BUFFER-A and BUFFER-B are the buffers to be compared.
Regions (i.e., point and mark) can be set in advance or marked interactively.
Each region is enlarged to contain full lines.
This function is effective for large regions, over 100-200
-lines. For small regions, use `ediff-regions-wordwise'."
+lines. For small regions, use `ediff-regions-wordwise'.
+STARTUP-HOOKS is a list of functions that Emacs calls without
+arguments after setting up the Ediff buffers."
(interactive
(let (bf)
(list (setq bf (read-buffer "Region A's buffer: "
@@ -1127,7 +1155,11 @@ ediff-merge-files
;; MERGE-BUFFER-FILE is the file to be
;; associated with the merge buffer
&optional startup-hooks merge-buffer-file)
- "Merge two files without ancestor."
+ "Merge two files without ancestor.
+FILE-A and FILE-B are the names of the files to be merged.
+STARTUP-HOOKS is a list of functions that Emacs calls without
+arguments after setting up the Ediff buffers. MERGE-BUFFER-FILE
+is the name of the file to be associated with the merge buffer.."
(interactive
(let ((dir-A (if ediff-use-last-dir
ediff-last-dir-A
@@ -1171,7 +1203,12 @@ ediff-merge-files-with-ancestor
;; to be associated with the
;; merge buffer
merge-buffer-file)
- "Merge two files with ancestor."
+ "Merge two files with ancestor.
+FILE-A and FILE-B are the names of the files to be merged, and
+FILE-ANCESTOR is the name of the ancestor file. STARTUP-HOOKS is
+a list of functions that Emacs calls without arguments after
+setting up the Ediff buffers. MERGE-BUFFER-FILE is the name of
+the file to be associated with the merge buffer."
(interactive
(let ((dir-A (if ediff-use-last-dir
ediff-last-dir-A
@@ -1229,7 +1266,14 @@ ediff-merge-buffers
;; MERGE-BUFFER-FILE is the file to be
;; associated with the merge buffer
startup-hooks job-name merge-buffer-file)
- "Merge buffers without ancestor."
+ "Merge buffers without ancestor.
+BUFFER-A and BUFFER-B are the buffers to be merged.
+STARTUP-HOOKS is a list of functions that Emacs calls without
+arguments after setting up the Ediff buffers. JOB-NAME is a
+symbol describing the Ediff job type; it defaults to
+`ediff-merge-buffers', but can also be one of the other `ediff'
+function symbols. MERGE-BUFFER-FILE is the name of the file to
+be associated with the merge buffer."
(interactive
(let (bf)
(list (setq bf (read-buffer "Buffer A to merge: "
@@ -1256,7 +1300,15 @@ ediff-merge-buffers-with-ancestor
;; file to be associated
;; with the merge buffer
merge-buffer-file)
- "Merge buffers with ancestor."
+ "Merge buffers with ancestor.
+BUFFER-A and BUFFER-B are the buffers to be merged, and
+BUFFER-ANCESTOR is their ancestor. STARTUP-HOOKS is a list of
+functions that Emacs calls without arguments after setting up the
+Ediff buffers. JOB-NAME is a symbol describing the Ediff job
+type; it defaults to `ediff-merge-buffers-with-ancestor', but can
+also be one of the other `ediff' function symbols.
+MERGE-BUFFER-FILE is the name of the file to be associated with
+the merge buffer."
(interactive
(let (bf bff)
(list (setq bf (read-buffer "Buffer A to merge: "
@@ -1287,8 +1339,11 @@ ediff-merge-buffers-with-ancestor
(defun ediff-merge-revisions (&optional file startup-hooks merge-buffer-file)
;; MERGE-BUFFER-FILE is the file to be associated with the merge buffer
"Run Ediff by merging two revisions of a file.
-The file is the optional FILE argument or the file visited by the current
-buffer."
+The file is the optional FILE argument or the file visited by the
+current buffer. STARTUP-HOOKS is a list of functions that Emacs
+calls without arguments after setting up the Ediff buffers.
+MERGE-BUFFER-FILE is the name of the file to be associated with
+the merge buffer."
(interactive)
(if (stringp file) (find-file file))
(let (rev1 rev2)
@@ -1319,8 +1374,11 @@ ediff-merge-revisions-with-ancestor
;; buffer
merge-buffer-file)
"Run Ediff by merging two revisions of a file with a common ancestor.
-The file is the optional FILE argument or the file visited by the current
-buffer."
+The file is the optional FILE argument or the file visited by the
+current buffer. STARTUP-HOOKS is a list of functions that Emacs
+calls without arguments after setting up the Ediff buffers.
+MERGE-BUFFER-FILE is the name of the file to be associated with
+the merge buffer."
(interactive)
(if (stringp file) (find-file file))
(let (rev1 rev2 ancestor-rev)
@@ -1360,8 +1418,8 @@ ediff-patch-file
"Query for a file name, and then run Ediff by patching that file.
If optional PATCH-BUF is given, use the patch in that buffer
and don't ask the user.
-If prefix argument, then: if even argument, assume that the patch is in a
-buffer. If odd -- assume it is in a file."
+If prefix argument ARG, then: if even argument, assume that the
+patch is in a buffer. If odd -- assume it is in a file."
(interactive "P")
(let (source-dir source-file)
(require 'ediff-ptch)
@@ -1394,7 +1452,7 @@ ediff-patch-buffer
With ARG=1, assumes the patch is in a file and prompts for the file.
With ARG=2, assumes the patch is in a buffer and prompts for the buffer.
PATCH-BUF is an optional argument, which specifies the buffer that contains the
-patch. If not given, the user is prompted according to the prefix argument."
+patch. If not given, the user is prompted according to the prefix argument."
(interactive "P")
(require 'ediff-ptch)
(setq patch-buf
@@ -1421,7 +1479,9 @@ ediff-revision
"Run Ediff by comparing versions of a file.
The file is an optional FILE argument or the file entered at the prompt.
Default: the file visited by the current buffer.
-Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'."
+Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'.
+STARTUP-HOOKS is a list of functions that Emacs calls without
+arguments after setting up the Ediff buffers."
;; if buffer is non-nil, use that buffer instead of the current buffer
(interactive "P")
(if (not (stringp file))
@@ -1434,7 +1494,7 @@ ediff-revision
'no-dirs)))
(find-file file)
(if (and (buffer-modified-p)
- (y-or-n-p (format "Buffer %s is modified. Save buffer? "
+ (y-or-n-p (format "Buffer %s is modified. Save buffer? "
(buffer-name))))
(save-buffer (current-buffer)))
(let (rev1 rev2)
@@ -1517,6 +1577,7 @@ ediff-documentation
;;;###autoload
(defun ediff-files-command ()
+ "Call `ediff-files' with the next two command line arguments."
(let ((file-a (nth 0 command-line-args-left))
(file-b (nth 1 command-line-args-left)))
(setq command-line-args-left (nthcdr 2 command-line-args-left))
@@ -1524,6 +1585,7 @@ ediff-files-command
;;;###autoload
(defun ediff3-files-command ()
+ "Call `ediff3-files' with the next three command line arguments."
(let ((file-a (nth 0 command-line-args-left))
(file-b (nth 1 command-line-args-left))
(file-c (nth 2 command-line-args-left)))
@@ -1532,6 +1594,7 @@ ediff3-files-command
;;;###autoload
(defun ediff-merge-command ()
+ "Call `ediff-merge-files' with the next two command line arguments."
(let ((file-a (nth 0 command-line-args-left))
(file-b (nth 1 command-line-args-left)))
(setq command-line-args-left (nthcdr 2 command-line-args-left))
@@ -1539,6 +1602,7 @@ ediff-merge-command
;;;###autoload
(defun ediff-merge-with-ancestor-command ()
+ "Call `ediff-merge-files-with-ancestor' with the next three command line arguments."
(let ((file-a (nth 0 command-line-args-left))
(file-b (nth 1 command-line-args-left))
(ancestor (nth 2 command-line-args-left)))
@@ -1547,6 +1611,7 @@ ediff-merge-with-ancestor-command
;;;###autoload
(defun ediff-directories-command ()
+ "Call `ediff-directories' with the next three command line arguments."
(let ((file-a (nth 0 command-line-args-left))
(file-b (nth 1 command-line-args-left))
(regexp (nth 2 command-line-args-left)))
@@ -1555,6 +1620,7 @@ ediff-directories-command
;;;###autoload
(defun ediff-directories3-command ()
+ "Call `ediff-directories3' with the next four command line arguments."
(let ((file-a (nth 0 command-line-args-left))
(file-b (nth 1 command-line-args-left))
(file-c (nth 2 command-line-args-left))
@@ -1564,6 +1630,7 @@ ediff-directories3-command
;;;###autoload
(defun ediff-merge-directories-command ()
+ "Call `ediff-merge-directories' with the next three command line arguments."
(let ((file-a (nth 0 command-line-args-left))
(file-b (nth 1 command-line-args-left))
(regexp (nth 2 command-line-args-left)))
@@ -1572,6 +1639,7 @@ ediff-merge-directories-command
;;;###autoload
(defun ediff-merge-directories-with-ancestor-command ()
+ "Call `ediff-merge-directories-with-ancestor' with the next four command line arguments."
(let ((file-a (nth 0 command-line-args-left))
(file-b (nth 1 command-line-args-left))
(ancestor (nth 2 command-line-args-left))
--
2.14.1
next prev parent reply other threads:[~2017-09-24 8:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-19 9:20 bug#27764: 26.0.50; Argument STARTUP-HOOKS for `ediff-files' undocumented Philipp Stephani
2017-09-23 18:46 ` Philipp Stephani
2017-09-23 18:59 ` Eli Zaretskii
2017-09-24 8:00 ` Philipp Stephani [this message]
2017-09-29 7:17 ` Eli Zaretskii
2017-11-05 16:29 ` Philipp Stephani
2017-11-05 16:51 ` Eli Zaretskii
2017-11-05 17:54 ` Philipp Stephani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAArVCkRC4o35H38arC6F2JFus8TsDNeFpVKjnzrqonESNPL9Dg@mail.gmail.com \
--to=p.stephani2@gmail.com \
--cc=27764@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.