diff options
| author | Eli Zaretskii | 2023-03-17 10:14:41 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2023-03-17 10:14:41 +0200 |
| commit | a4a9ffdd80a2b8ccd2e6705887d3cae0876a50ab (patch) | |
| tree | a8a8aa585e1c88298f6ff2bb22bc6168390fb07d | |
| parent | a2222b9a9bfa039d66f836f06762ddea1544df11 (diff) | |
| download | emacs-a4a9ffdd80a2b8ccd2e6705887d3cae0876a50ab.tar.gz emacs-a4a9ffdd80a2b8ccd2e6705887d3cae0876a50ab.zip | |
Fix the documentation of various aspects of adding Xref history
* lisp/progmodes/xref.el (xref-marker-ring-length)
(xref-set-marker-ring-length):
* lisp/progmodes/etags.el (tags-location-ring-length)
(find-tag-marker-ring): Add doc strings saying the variables are
unused.
* etc/NEWS: Enhance the description of the change which made Xref
marker stack unlimited in its length.
* doc/emacs/maintaining.texi (Looking Up Identifiers): Add back
text lost when xref forward history was added in bug#38797.
Explain the difference between 'C-M-,' and 'M-.'. Improve
wording (Bug#62229)
| -rw-r--r-- | doc/emacs/maintaining.texi | 19 | ||||
| -rw-r--r-- | etc/NEWS | 12 | ||||
| -rw-r--r-- | lisp/progmodes/etags.el | 10 | ||||
| -rw-r--r-- | lisp/progmodes/xref.el | 14 |
4 files changed, 40 insertions, 15 deletions
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index f5bbc4d65c0..7d49e28d11f 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi | |||
| @@ -2283,16 +2283,25 @@ buffer, but doesn't select any of them. | |||
| 2283 | 2283 | ||
| 2284 | @kindex M-, | 2284 | @kindex M-, |
| 2285 | @findex xref-go-back | 2285 | @findex xref-go-back |
| 2286 | To go back to places @emph{from where} you've displayed the definition, | 2286 | To go back to places @emph{from where} you've displayed the |
| 2287 | use @kbd{M-,} (@code{xref-go-back}). It jumps back to the | 2287 | definition, use @kbd{M-,} (@code{xref-go-back}). It jumps back to the |
| 2288 | point of the last invocation of @kbd{M-.}. Thus you can find and | 2288 | point of the last invocation of @kbd{M-.}. Thus you can find and |
| 2289 | examine the definition of something with @kbd{M-.} and then return to | 2289 | examine the definition of something with @kbd{M-.} and then return to |
| 2290 | where you were with @kbd{M-,}. | 2290 | where you were with @kbd{M-,}. @kbd{M-,} allows you to retrace the |
| 2291 | steps you made forward in the history of places, all the way to the | ||
| 2292 | first place in history, where you first invoked @kbd{M-.}, or to any | ||
| 2293 | place in-between. | ||
| 2291 | 2294 | ||
| 2292 | @kindex C-M-, | 2295 | @kindex C-M-, |
| 2293 | @findex xref-go-forward | 2296 | @findex xref-go-forward |
| 2294 | If you previously went back too far with @kbd{M-,}, @kbd{C-M-,} | 2297 | If you previously went back too far with @kbd{M-,}, or want to |
| 2295 | (@code{xref-go-forward}) can be used to go forward again. | 2298 | re-examine a place from which you went back, you can use @kbd{C-M-,} |
| 2299 | (@code{xref-go-forward}) to go forward again. This is similar to | ||
| 2300 | using @kbd{M-.}, except that you don't need on each step to move point | ||
| 2301 | to the identifier whose definition you want to look up. @kbd{C-M-,} | ||
| 2302 | allows you to retrace all the steps you made back in the history of | ||
| 2303 | places, all the way to the last place in history, where you invoked | ||
| 2304 | @kbd{M-,}, or to any place in-between. | ||
| 2296 | 2305 | ||
| 2297 | @findex xref-etags-mode | 2306 | @findex xref-etags-mode |
| 2298 | Some major modes install @code{xref} support facilities that might | 2307 | Some major modes install @code{xref} support facilities that might |
| @@ -2540,8 +2540,16 @@ the project by a VC project based on that VCS. | |||
| 2540 | 2540 | ||
| 2541 | +++ | 2541 | +++ |
| 2542 | *** New command 'xref-go-forward'. | 2542 | *** New command 'xref-go-forward'. |
| 2543 | It is bound to 'C-M-,' and jumps to the location where 'xref-go-back' | 2543 | It is bound to 'C-M-,' and jumps to the location where you previously |
| 2544 | ('M-,', also known as 'xref-pop-marker-stack') was invoked previously. | 2544 | invoked 'xref-go-back' ('M-,', also known as 'xref-pop-marker-stack'). |
| 2545 | |||
| 2546 | +++ | ||
| 2547 | *** The depth of the Xref marker stack is now infinite. | ||
| 2548 | The implementation of the Xref marker stack was changed in a way that | ||
| 2549 | allows as many places to be saved on the stack as needed, limited only | ||
| 2550 | by the available memory. Therefore, the variables | ||
| 2551 | 'find-tag-marker-ring-length' and 'xref-marker-ring-length' are now | ||
| 2552 | obsolete and unused; setting them has no effect. | ||
| 2545 | 2553 | ||
| 2546 | +++ | 2554 | +++ |
| 2547 | *** 'xref-query-replace-in-results' prompting change. | 2555 | *** 'xref-query-replace-in-results' prompting change. |
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 8efdae6060f..cb95f29b5fe 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el | |||
| @@ -146,7 +146,10 @@ Otherwise, `find-tag-default' is used." | |||
| 146 | (define-obsolete-variable-alias 'find-tag-marker-ring-length | 146 | (define-obsolete-variable-alias 'find-tag-marker-ring-length |
| 147 | 'tags-location-ring-length "25.1") | 147 | 'tags-location-ring-length "25.1") |
| 148 | 148 | ||
| 149 | (defvar tags-location-ring-length 16) | 149 | (defvar tags-location-ring-length 16 |
| 150 | "Size of the find-tag marker ring. | ||
| 151 | This variable has no effect, and is kept only for backward compatibility. | ||
| 152 | The actual size of the find-tag marker ring is unlimited.") | ||
| 150 | 153 | ||
| 151 | (defcustom tags-tag-face 'default | 154 | (defcustom tags-tag-face 'default |
| 152 | "Face for tags in the output of `tags-apropos'." | 155 | "Face for tags in the output of `tags-apropos'." |
| @@ -181,8 +184,9 @@ Example value: | |||
| 181 | (sexp :tag "Tags to search"))) | 184 | (sexp :tag "Tags to search"))) |
| 182 | :version "21.1") | 185 | :version "21.1") |
| 183 | 186 | ||
| 184 | ;; Obsolete variable kept for compatibility. We don't use it in any way. | 187 | (defvar find-tag-marker-ring (make-ring 16) |
| 185 | (defvar find-tag-marker-ring (make-ring 16)) | 188 | "Find-tag marker ring. |
| 189 | Obsolete variable kept for compatibility. It is not used in any way.") | ||
| 186 | (make-obsolete-variable | 190 | (make-obsolete-variable |
| 187 | 'find-tag-marker-ring | 191 | 'find-tag-marker-ring |
| 188 | "use `xref-push-marker-stack' or `xref-go-back' instead." | 192 | "use `xref-push-marker-stack' or `xref-go-back' instead." |
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index d4e34f7e55a..ee4253960c5 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el | |||
| @@ -355,8 +355,10 @@ backward." | |||
| 355 | (t (goto-char start) nil)))) | 355 | (t (goto-char start) nil)))) |
| 356 | 356 | ||
| 357 | 357 | ||
| 358 | ;; Dummy variable retained for compatibility. | 358 | (defvar xref-marker-ring-length 16 |
| 359 | (defvar xref-marker-ring-length 16) | 359 | "Xref marker ring length. |
| 360 | This is a dummy variable retained for backward compatibility, and | ||
| 361 | otherwise unused.") | ||
| 360 | (make-obsolete-variable 'xref-marker-ring-length nil "29.1") | 362 | (make-obsolete-variable 'xref-marker-ring-length nil "29.1") |
| 361 | 363 | ||
| 362 | (defcustom xref-prompt-for-identifier '(not xref-find-definitions | 364 | (defcustom xref-prompt-for-identifier '(not xref-find-definitions |
| @@ -453,7 +455,9 @@ are predefined: | |||
| 453 | (make-obsolete-variable 'xref--marker-ring 'xref--history "29.1") | 455 | (make-obsolete-variable 'xref--marker-ring 'xref--history "29.1") |
| 454 | 456 | ||
| 455 | (defun xref-set-marker-ring-length (_var _val) | 457 | (defun xref-set-marker-ring-length (_var _val) |
| 456 | (declare (obsolete nil "29.1")) | 458 | (declare (obsolete |
| 459 | "this function has no effect: Xref marker ring is now unlimited in size" | ||
| 460 | "29.1")) | ||
| 457 | nil) | 461 | nil) |
| 458 | 462 | ||
| 459 | (defun xref--make-xref-history () | 463 | (defun xref--make-xref-history () |
| @@ -499,7 +503,7 @@ Override existing value with NEW-VALUE if NEW-VALUE is set." | |||
| 499 | 503 | ||
| 500 | (defun xref-push-marker-stack (&optional m) | 504 | (defun xref-push-marker-stack (&optional m) |
| 501 | "Add point M (defaults to `point-marker') to the marker stack. | 505 | "Add point M (defaults to `point-marker') to the marker stack. |
| 502 | The future stack is erased." | 506 | Erase the stack slots following this one." |
| 503 | (xref--push-backward (or m (point-marker))) | 507 | (xref--push-backward (or m (point-marker))) |
| 504 | (let ((history (xref--get-history))) | 508 | (let ((history (xref--get-history))) |
| 505 | (dolist (mk (cdr history)) | 509 | (dolist (mk (cdr history)) |
| @@ -527,7 +531,7 @@ To undo, use \\[xref-go-forward]." | |||
| 527 | 531 | ||
| 528 | ;;;###autoload | 532 | ;;;###autoload |
| 529 | (defun xref-go-forward () | 533 | (defun xref-go-forward () |
| 530 | "Got to the point where a previous \\[xref-go-back] was invoked." | 534 | "Go to the point where a previous \\[xref-go-back] was invoked." |
| 531 | (interactive) | 535 | (interactive) |
| 532 | (let ((history (xref--get-history))) | 536 | (let ((history (xref--get-history))) |
| 533 | (if (null (cdr history)) | 537 | (if (null (cdr history)) |