@code{goto-line-relative} to move point to the line relative to the
accessible portion of the narrowed buffer.
+@code{goto-line} has its own history list (@pxref{Minibuffer
+History}). You can have either a single list shared between all
+buffers (the default) or a separate list for each buffer, by
+customizing the user option @code{goto-line-history-local}.
+
@item M-g @key{TAB}
@kindex M-g TAB
@findex move-to-column
This command opens a new buffer called "*Memory Report*" and gives a
summary of where Emacs is using memory currently.
++++
+** The history list for the 'goto-line' command is now a single list
+for all buffers by default. You can configure a separate list for
+each buffer by customizing the user option 'goto-line-history-local'.
+
** Outline
+++
\f
;; Counting lines, one way or another.
-(defvar-local goto-line-history nil
+(defcustom goto-line-history-local nil
+ "If this option is nil, `goto-line-history' is shared between all buffers.
+if it is non-nil, each buffer has its own value of this history list.
+
+Note that on changing from non-nil to nil, the former contents of
+`goto-line-history' for each buffer are discarded on use of
+`goto-line' in that buffer."
+ :group 'editing
+ :type 'boolean
+ :safe #'booleanp
+ :version "28.1")
+
+(defvar goto-line-history nil
"History of values entered with `goto-line'.")
(defun goto-line-read-args (&optional relative)
(if buffer
(concat " in " (buffer-name buffer))
"")))
+ ;; Has the buffer locality of `goto-line-history' changed?
+ (cond ((and goto-line-history-local (not (local-variable-p 'goto-line-history)))
+ (make-local-variable 'goto-line-history))
+ ((and (not goto-line-history-local) (local-variable-p 'goto-line-history))
+ (kill-local-variable 'goto-line-history)))
;; Read the argument, offering that number (if any) as default.
(list (read-number (format "Goto%s line%s: "
(if (buffer-narrowed-p)