Skip to content

Commit 1fc4bb1

Browse files
committed
Rename variables *-in-progress-p to *-in-progress
* doc/lispref/backups.texi (Reverting): Fix variable names revert-buffer-in-progress and auto-revert-buffer-in-progress. * etc/NEWS: Fix variable names revert-buffer-in-progress and auto-revert-buffer-in-progress. Presentational fixes and improvements. * lisp/autorevert.el (auto-revert-buffer-in-progress): Rename. (auto-revert-handler, auto-revert-buffer): Use renamed variables. * lisp/dired-x.el (dired-omit-expunge): Use `auto-revert-buffer-in-progress'. * lisp/files.el (revert-buffer-in-progress): Rename. (revert-buffer-in-progress-p): Declare obsolete. (after-find-file, revert-buffer): * lisp/saveplace.el (save-place-find-file-hook) (save-place-dired-hook): * lisp/vc/vc-git.el (vc-git-command, vc-git--out-ok): * lisp/vc/vc.el (vc-diff-internal): Use `revert-buffer-in-progress'. * lisp/net/tramp-sh.el (tramp-sh-handle-vc-registered): Suppress warning.
1 parent 5c8234e commit 1fc4bb1

File tree

9 files changed

+32
-19
lines changed

9 files changed

+32
-19
lines changed

doc/lispref/backups.texi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ preserved, but this is up to the specific @code{revert-buffer-function}
719719
implementation.
720720
@end deffn
721721

722-
@defvar revert-buffer-in-progress-p
722+
@defvar revert-buffer-in-progress
723723
@code{revert-buffer} binds this variable to a non-@code{nil} value
724724
while it is working.
725725
@end defvar
@@ -852,7 +852,7 @@ It is important to assure that point does not continuously jump around
852852
as a consequence of auto-reverting. Of course, moving point might be
853853
inevitable if the buffer radically changes.
854854

855-
@defvar auto-revert-buffer-in-progress-p
855+
@defvar auto-revert-buffer-in-progress
856856
@code{auto-revert-buffer} binds this variable to a non-@code{nil} value
857857
while it is working. This can be used by major mode
858858
@code{revert-buffer-function} implementations to suppress messages in

etc/NEWS

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ characters in CJK texts. For example, 'A' is converted to 'A', '1' is
966966
converted to '1', etc. Companion commands 'halfwidth-region' and
967967
'halfwidth-word' perform the opposite conversion.
968968

969-
** Texinfo Mode
969+
** Texinfo mode
970970

971971
---
972972
*** texinfo-mode now can auto-close the ``'' pairs.
@@ -2212,6 +2212,16 @@ destination window is chosen using 'display-buffer-alist'. Example:
22122212
display-buffer-use-some-window)
22132213
(some-window . mru))))
22142214

2215+
** Revert
2216+
2217+
+++
2218+
*** Variable 'revert-buffer-in-progress' has been renamed.
2219+
The old name, 'revert-buffer-in-progress-p', is kept as obsolete
2220+
variable alias.
2221+
2222+
Symbol names with a trailing '-p' are reserved for predicates. Calling
2223+
a variable like this was a mistake.
2224+
22152225
** Autorevert
22162226

22172227
+++
@@ -2226,7 +2236,7 @@ runs its body, and removes the current buffer from
22262236
'inhibit-auto-revert-buffers' afterwards.
22272237

22282238
+++
2229-
*** New variable 'auto-revert-buffer-in-progress-p'.
2239+
*** New variable 'auto-revert-buffer-in-progress'.
22302240
'auto-revert-buffer' binds this variable to a non-nil value while it is
22312241
working. This can be used by major mode 'revert-buffer-function'
22322242
implementations to suppress messages in Auto Revert modes, for example.

lisp/autorevert.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ seconds, in addition to using notification for those files."
330330
;; Internal variables:
331331

332332
;;;###autoload
333-
(defvar auto-revert-buffer-in-progress-p nil "\
333+
(defvar auto-revert-buffer-in-progress nil "\
334334
Non-nil if a `auto-revert-buffer' operation is in progress, nil otherwise.")
335335

336336
(defvar auto-revert-buffer-list ()
@@ -875,7 +875,7 @@ This is an internal function used by Auto-Revert Mode."
875875
;; `preserve-modes' avoids changing the (minor) modes. But we do
876876
;; want to reset the mode for VC, so we do it manually.
877877
(when (and (not auto-revert-tail-mode) (or revert auto-revert-check-vc-info))
878-
(let ((revert-buffer-in-progress-p t))
878+
(let ((revert-buffer-in-progress t))
879879
(vc-refresh-state)))))
880880

881881
(defun auto-revert-tail-handler (size)
@@ -936,7 +936,7 @@ buffers not reverted last time due to user interruption."
936936
937937
This is performed as specified by Auto-Revert and Global
938938
Auto-Revert Modes."
939-
(let ((auto-revert-buffer-in-progress-p t))
939+
(let ((auto-revert-buffer-in-progress t))
940940
(if (not (buffer-live-p buf))
941941
(auto-revert-remove-current-buffer buf)
942942
(with-current-buffer buf

lisp/dired-x.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ status message."
477477
(old-modified-p (buffer-modified-p))
478478
(count (or init-count 0))
479479
(dired-omit-verbose
480-
(and dired-omit-verbose (not auto-revert-buffer-in-progress-p))))
480+
(and dired-omit-verbose (not auto-revert-buffer-in-progress))))
481481
(unless (string= omit-re "")
482482
(let ((dired-marker-char dired-omit-marker-char))
483483
(when dired-omit-verbose (message "Omitting..."))

lisp/files.el

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2887,7 +2887,7 @@ error in reading the file. WARN non-nil means warn if there
28872887
exists an auto-save file more recent than the visited file.
28882888
NOAUTO means don't mess with auto-save mode.
28892889
Fourth arg AFTER-FIND-FILE-FROM-REVERT-BUFFER is ignored
2890-
\(see `revert-buffer-in-progress-p' for similar functionality).
2890+
\(see `revert-buffer-in-progress' for similar functionality).
28912891
Fifth arg NOMODES non-nil means don't alter the file's modes.
28922892
Finishes by calling the functions in `find-file-hook'
28932893
unless NOMODES is non-nil."
@@ -7107,9 +7107,10 @@ hook functions.
71077107
The function `revert-buffer--default' runs this.
71087108
A customized `revert-buffer-function' need not run this hook.")
71097109

7110-
(defvar revert-buffer-in-progress-p nil
7110+
(defvar revert-buffer-in-progress nil
71117111
"Non-nil if a `revert-buffer' operation is in progress, nil otherwise.")
7112-
7112+
(define-obsolete-variable-alias
7113+
'revert-buffer-in-progress-p 'revert-buffer-in-progress "31.1")
71137114
(defvar revert-buffer-internal-hook)
71147115

71157116
;; `revert-buffer-function' was defined long ago to be a function of only
@@ -7168,7 +7169,7 @@ revert buffers without querying for confirmation.)
71687169
Optional third argument PRESERVE-MODES non-nil means don't alter
71697170
the files modes. Normally we reinitialize them using `normal-mode'.
71707171

7171-
This function binds `revert-buffer-in-progress-p' non-nil while it operates.
7172+
This function binds `revert-buffer-in-progress' non-nil while it operates.
71727173

71737174
This function calls the function that `revert-buffer-function' specifies
71747175
to do the work, with arguments IGNORE-AUTO and NOCONFIRM.
@@ -7189,7 +7190,7 @@ preserve markers and overlays, at the price of being slower."
71897190
;; reversal of the argument sense. So I'm just changing the user
71907191
;; interface, but leaving the programmatic interface the same.
71917192
(interactive (list (not current-prefix-arg)))
7192-
(let ((revert-buffer-in-progress-p t)
7193+
(let ((revert-buffer-in-progress t)
71937194
(revert-buffer-preserve-modes preserve-modes)
71947195
restore-functions)
71957196
(run-hook-wrapped 'revert-buffer-restore-functions

lisp/net/tramp-sh.el

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3669,6 +3669,8 @@ are \"file-exists-p\", \"file-readable-p\", \"file-directory-p\" and
36693669
(defun tramp-sh-handle-vc-registered (file)
36703670
"Like `vc-registered' for Tramp files."
36713671
(when vc-handled-backends
3672+
;; Starting with Emacs 31, use `revert-buffer-in-progress'.
3673+
(with-suppressed-warnings ((obsolete revert-buffer-in-progress-p))
36723674
(let ((inhibit-message (or revert-buffer-in-progress-p inhibit-message))
36733675
(temp-message (unless revert-buffer-in-progress-p "")))
36743676
(with-temp-message temp-message
@@ -3728,7 +3730,7 @@ are \"file-exists-p\", \"file-readable-p\", \"file-directory-p\" and
37283730
;; Run.
37293731
(tramp-with-demoted-errors
37303732
v "Error in 2nd pass of `vc-registered': %s"
3731-
(tramp-run-real-handler #'vc-registered (list file))))))))))
3733+
(tramp-run-real-handler #'vc-registered (list file)))))))))))
37323734

37333735
;;;###tramp-autoload
37343736
(defun tramp-sh-file-name-handler (operation &rest args)

lisp/saveplace.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ It runs the hook `save-place-after-find-file-hook'."
444444
save-place-alist))))
445445
(if cell
446446
(progn
447-
(or revert-buffer-in-progress-p
447+
(or revert-buffer-in-progress
448448
(and (integerp (cdr cell))
449449
(goto-char (cdr cell))))
450450
;; and make sure it will be saved again for later
@@ -467,7 +467,7 @@ This is run via `dired-initial-position-hook', which see."
467467
(cell (assoc (if save-place-abbreviate-file-names
468468
(abbreviate-file-name item) item)
469469
save-place-alist)))
470-
(or revert-buffer-in-progress-p
470+
(or revert-buffer-in-progress
471471
(cond
472472
((integerp (cdr cell))
473473
(goto-char (cdr cell)))

lisp/vc/vc-git.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2488,7 +2488,7 @@ The difference to `vc-do-command' is that this function always invokes
24882488
'("GIT_LITERAL_PATHSPECS=1"))
24892489
;; Avoid repository locking during background operations
24902490
;; (bug#21559).
2491-
,@(when revert-buffer-in-progress-p
2491+
,@(when revert-buffer-in-progress
24922492
'("GIT_OPTIONAL_LOCKS=0")))
24932493
process-environment)))
24942494
(apply #'vc-do-command (or buffer "*vc*") okstatus vc-git-program
@@ -2527,7 +2527,7 @@ The difference to `vc-do-command' is that this function always invokes
25272527
'("GIT_LITERAL_PATHSPECS=1"))
25282528
;; Avoid repository locking during background operations
25292529
;; (bug#21559).
2530-
,@(when revert-buffer-in-progress-p
2530+
,@(when revert-buffer-in-progress
25312531
'("GIT_OPTIONAL_LOCKS=0")))
25322532
process-environment)))
25332533
(apply #'process-file vc-git-program nil buffer nil "--no-pager" command args)))

lisp/vc/vc.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2286,7 +2286,7 @@ Return t if the buffer had changes, nil otherwise."
22862286
(if files (vc-coding-system-for-diff (car files)) 'undecided)
22872287
'unix))
22882288
(orig-diff-buffer-clone
2289-
(if revert-buffer-in-progress-p
2289+
(if revert-buffer-in-progress
22902290
(clone-buffer
22912291
(generate-new-buffer-name " *vc-diff-clone*") nil))))
22922292
;; On MS-Windows and MS-DOS, Diff is likely to produce DOS-style

0 commit comments

Comments
 (0)