Thinking about it again, I'd prefer no prompt at all. A simple user setting `EDIT_PATCHES' that can be set to "No" does the job.
Here's a new diff introducing that knob. While here, I dropped the redundant and too specific explanation about patch files' names and endings. update-patches(1) already covers this mentioning the respective variables. Feedback? Objections? OK? Index: bsd.port.mk =================================================================== RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v retrieving revision 1.1414 diff -u -p -r1.1414 bsd.port.mk --- bsd.port.mk 4 Jun 2018 06:14:56 -0000 1.1414 +++ bsd.port.mk 10 Jun 2018 10:02:13 -0000 @@ -2362,11 +2362,9 @@ update-patches: PATCH_LIST='${PATCH_LIST}' DIFF_ARGS='${DIFF_ARGS}' \ DISTORIG=${DISTORIG} PATCHORIG=${PATCHORIG} \ ${_PERLSCRIPT}/update-patches`; \ - case $$toedit in "");; \ - *) read i?'edit patches: '; \ - cd ${PATCHDIR} && $${VISUAL:-$${EDITOR:-/usr/bin/vi}} $$toedit;; esac - - + if [ -n "$$toedit" -a "${EDIT_PATCHES:L}" != no ]; then \ + cd ${PATCHDIR} && $${VISUAL:-$${EDITOR:-/usr/bin/vi}} $$toedit; \ + fi .endif # IGNORECMD Index: bsd.port.mk.5 =================================================================== RCS file: /cvs/src/share/man/man5/bsd.port.mk.5,v retrieving revision 1.481 diff -u -p -r1.481 bsd.port.mk.5 --- bsd.port.mk.5 29 May 2018 11:45:25 -0000 1.481 +++ bsd.port.mk.5 10 Jun 2018 10:44:17 -0000 @@ -743,27 +743,16 @@ See .Cm lock . .It Cm update-patches Create or update patches for a port, using -.Xr update-patches 1 , -which invokes -.Xr diff 1 -between -.Pa file -and -.Pa file.orig , -based on -.Pa file.orig -existence. -In order to generate a patch, the original file needs to be named -.Pa file.orig -and -.Pa file -edited. -After the target is invoked, the patches are placed under the -patches/ directory. -It moves existing patches from -.Pa patch-file -to -.Pa patch-file.orig . +.Xr update-patches 1 . +Unless +.Ev EDIT_PATCHES +is set to +.Sq \&No , +changed files are opened using +.Ev VISUAL , +.Ev EDITOR +or +.Xr vi 1 . .It Cm update Update an existing installation to a newer package: scan the installation for a package with the same @@ -1558,6 +1547,12 @@ Annotations for the Distributed Ports Bu See .Xr dpb 1 for semantics. +.It EDIT_PATCHES +User settings. +If set to +.Sq \&No , +.Cm update-patches +will not open changed files in an editor. .It Ev ECHO_MSG User settings. Used to display