From 3250260c73830b3f7ac43f116559b55ac86656ac Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 28 Oct 2022 22:58:37 +0200 Subject: [PATCH] Make makefile browser obsolete --- lisp/progmodes/make-mode.el | 70 ++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 40 deletions(-) diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index 9b9bb0e9d4..dae4557479 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el @@ -66,17 +66,9 @@ ;; interact with font-lock. ;; * Would be nice to edit the commands in ksh-mode and have ;; indentation and slashification done automatically. Hard. -;; * Consider removing browser mode. It seems useless. ;; * ":" should notice when a new target is made and add it to the ;; list (or at least set `makefile-need-target-pickup'). -;; * Make browser into a major mode. ;; * Clean up macro insertion stuff. It is a mess. -;; * Browser entry and exit is weird. Normalize. -;; * Browser needs to be rewritten. Right now it is kind of a crock. -;; Should at least: -;; * Act more like dired/buffer menu/whatever. -;; * Highlight as mouse traverses. -;; * B2 inserts. ;; * Update documentation above. ;; * Update texinfo manual. ;; * Update files.el. @@ -118,6 +110,7 @@ makefile-makepp-perl "Face to use for additionally highlighting Perl code in Font-Lock mode." :version "22.1") +(make-obsolete-variable 'makefile-browser-buffer-name nil "29.1") (defcustom makefile-browser-buffer-name "*Macros and Targets*" "Name of the macro- and target browser buffer." :type 'string) @@ -152,10 +145,12 @@ makefile-tab-after-target-colon The default is t." :type 'boolean) +(make-obsolete-variable 'makefile-browser-leftmost-column nil "29.1") (defcustom makefile-browser-leftmost-column 10 "Number of blanks to the left of the browser selection mark." :type 'integer) +(make-obsolete-variable 'makefile-browser-cursor-column nil "29.1") (defcustom makefile-browser-cursor-column 10 "Column the cursor goes to when it moves up or down in the Makefile browser." :type 'integer) @@ -168,14 +163,17 @@ makefile-backslash-align "If non-nil, `makefile-backslash-region' will align backslashes." :type 'boolean) +(make-obsolete-variable 'makefile-browser-selected-mark nil "29.1") (defcustom makefile-browser-selected-mark "+ " "String used to mark selected entries in the Makefile browser." :type 'string) +(make-obsolete-variable 'makefile-browser-unselected-mark nil "29.1") (defcustom makefile-browser-unselected-mark " " "String used to mark unselected entries in the Makefile browser." :type 'string) +(make-obsolete-variable 'makefile-browser-auto-advance-after-selection-p nil "29.1") (defcustom makefile-browser-auto-advance-after-selection-p t "If non-nil, cursor will move after item is selected in Makefile browser." :type 'boolean) @@ -198,6 +196,7 @@ makefile-mode-hook "Normal hook run by `makefile-mode'." :type 'hook) +(make-obsolete-variable 'makefile-browser-hook nil "29.1") (defvar makefile-browser-hook '()) ;; @@ -611,9 +610,6 @@ makefile-mode-menu ;; Other. ["Up To Date Overview" makefile-create-up-to-date-overview :help "Create a buffer containing an overview of the state of all known targets"] - ["Pop up Makefile Browser" makefile-switch-to-browser - ;; XXX: this needs a better string, the function is not documented... - :help "Pop up Makefile Browser"] ("Switch Makefile Type" ["GNU make" makefile-gmake-mode :help "An adapted `makefile-mode' that knows about GNU make" @@ -641,6 +637,7 @@ makefile-mode-menu :selected (eq major-mode 'makefile-makepp-mode)]))) +(make-obsolete-variable 'makefile-browser-map nil "29.1") (defvar-keymap makefile-browser-map :doc "The keymap that is used in the macro- and target browser." "n" #'makefile-browser-next-line @@ -695,9 +692,11 @@ makefile-macro-table "Table of all macro names known for this buffer.") (put 'makefile-macro-table 'risky-local-variable t) +(make-obsolete-variable 'makefile-browser-client nil "29.1") (defvar makefile-browser-client "A buffer in Makefile mode that is currently using the browser.") +(make-obsolete-variable 'makefile-browser-selection-vector nil "29.1") (defvar makefile-browser-selection-vector nil) (defvar makefile-has-prereqs nil) (defvar makefile-need-target-pickup t) @@ -757,15 +756,8 @@ makefile-mode \\{makefile-mode-map} -In the browser, use the following keys: - -\\{makefile-browser-map} - Makefile mode can be configured by modifying the following variables: -`makefile-browser-buffer-name': - Name of the macro- and target browser buffer. - `makefile-target-colon': The string that gets appended to all target names inserted by `makefile-insert-target'. @@ -783,24 +775,6 @@ makefile-mode If you want a TAB (instead of a space) to be appended after the target colon, then set this to a non-nil value. -`makefile-browser-leftmost-column': - Number of blanks to the left of the browser selection mark. - -`makefile-browser-cursor-column': - Column in which the cursor is positioned when it moves - up or down in the browser. - -`makefile-browser-selected-mark': - String used to mark selected entries in the browser. - -`makefile-browser-unselected-mark': - String used to mark unselected entries in the browser. - -`makefile-browser-auto-advance-after-selection-p': - If this variable is set to a non-nil value the cursor - will automagically advance to the next line after an item - has been selected in the browser. - `makefile-pickup-everything-picks-up-filenames-p': If this variable is set to a non-nil value then `makefile-pickup-everything' also picks up filenames as targets @@ -816,10 +790,6 @@ makefile-mode IMPORTANT: Please note that enabling this option causes Makefile mode to MODIFY A FILE WITHOUT YOUR CONFIRMATION when \"it seems necessary\". -`makefile-browser-hook': - A function or list of functions to be called just before the - browser is entered. This is executed in the makefile buffer. - `makefile-special-targets-list': List of special targets. You will be offered to complete on one of those in the minibuffer whenever you enter a `.'. @@ -1308,6 +1278,7 @@ makefile-fill-paragraph ;;; ------------------------------------------------------------ (defun makefile-browser-format-target-line (target selected) + (declare (obsolete nil "29.1")) (format (concat (make-string makefile-browser-leftmost-column ?\ ) (if selected @@ -1317,6 +1288,7 @@ makefile-browser-format-target-line target makefile-target-colon)) (defun makefile-browser-format-macro-line (macro selected) + (declare (obsolete nil "29.1")) (format (concat (make-string makefile-browser-leftmost-column ?\ ) (if selected @@ -1325,6 +1297,7 @@ makefile-browser-format-macro-line (makefile-format-macro-ref macro)))) (defun makefile-browser-fill (targets macros) + (declare (obsolete nil "29.1")) (let ((inhibit-read-only t)) (goto-char (point-min)) (erase-buffer) @@ -1348,6 +1321,7 @@ makefile-browser-fill (defun makefile-browser-next-line () "Move the browser selection cursor to the next line." + (declare (obsolete nil "29.1")) (interactive) (if (not (makefile-last-line-p)) (progn @@ -1356,6 +1330,7 @@ makefile-browser-next-line (defun makefile-browser-previous-line () "Move the browser selection cursor to the previous line." + (declare (obsolete nil "29.1")) (interactive) (if (not (makefile-first-line-p)) (progn @@ -1368,6 +1343,7 @@ makefile-browser-previous-line (defun makefile-browser-quit () "Leave the browser and return to the makefile buffer." + (declare (obsolete nil "29.1")) (interactive) (let ((my-client makefile-browser-client)) (setq makefile-browser-client nil) ; we quit, so NO client! @@ -1381,6 +1357,7 @@ makefile-browser-quit (defun makefile-browser-toggle () "Toggle the selection state of the browser item at the cursor position." + (declare (obsolete nil "29.1")) (interactive) (let ((this-line (count-lines (point-min) (point)))) (setq this-line (max 1 this-line)) @@ -1418,6 +1395,7 @@ makefile-browser-insert-continuation This is most useful in the process of creating continued lines when copying large dependencies from the browser to the client buffer. \(point) advances accordingly in the client buffer." + (declare (obsolete nil "29.1")) (interactive) (with-current-buffer makefile-browser-client (end-of-line) @@ -1426,6 +1404,7 @@ makefile-browser-insert-continuation (defun makefile-browser-insert-selection () "Insert all selected targets and/or macros in the makefile buffer. Insertion takes place at point." + (declare (obsolete nil "29.1")) (interactive) (save-excursion (goto-char (point-min)) @@ -1437,11 +1416,13 @@ makefile-browser-insert-selection (setq current-line (1+ current-line)))))) (defun makefile-browser-insert-selection-and-quit () + (declare (obsolete nil "29.1")) (interactive) (makefile-browser-insert-selection) (makefile-browser-quit)) (defun makefile-browser-send-this-line-item () + (declare (obsolete nil "29.1")) (if (makefile-browser-on-macro-line-p) (save-excursion (let ((macro-name (makefile-browser-this-line-macro-name))) @@ -1453,10 +1434,12 @@ makefile-browser-send-this-line-item (insert target-name " "))))) (defun makefile-browser-start-interaction () + (declare (obsolete nil "29.1")) (use-local-map makefile-browser-map) (setq buffer-read-only t)) (defun makefile-browse (targets macros) + (declare (obsolete imenu "29.1")) (if (zerop (+ (length targets) (length macros))) (progn (beep) @@ -1473,6 +1456,7 @@ makefile-browse (makefile-browser-start-interaction)))) (defun makefile-switch-to-browser () + (declare (obsolete imenu "29.1")) (interactive) (run-hooks 'makefile-browser-hook) (setq makefile-browser-client (current-buffer)) @@ -1731,12 +1715,14 @@ makefile-forward-after-target-colon (defun makefile-browser-on-macro-line-p () "Determine if point is on a macro line in the browser." + (declare (obsolete nil "29.1")) (save-excursion (beginning-of-line) (re-search-forward "\\$[{(]" (line-end-position) t))) (defun makefile-browser-this-line-target-name () "Extract the target name from a line in the browser." + (declare (obsolete nil "29.1")) (save-excursion (end-of-line) (skip-chars-backward "^ \t") @@ -1744,6 +1730,7 @@ makefile-browser-this-line-target-name (defun makefile-browser-this-line-macro-name () "Extract the macro name from a line in the browser." + (declare (obsolete nil "29.1")) (save-excursion (beginning-of-line) (re-search-forward "\\$[{(]" (line-end-position) t) @@ -1762,12 +1749,15 @@ makefile-format-macro-ref (format "$(%s)" macro-name)))) (defun makefile-browser-get-state-for-line (n) + (declare (obsolete nil "29.1")) (aref makefile-browser-selection-vector (1- n))) (defun makefile-browser-set-state-for-line (n to-state) + (declare (obsolete nil "29.1")) (aset makefile-browser-selection-vector (1- n) to-state)) (defun makefile-browser-toggle-state-for-line (n) + (declare (obsolete nil "29.1")) (makefile-browser-set-state-for-line n (not (makefile-browser-get-state-for-line n)))) (defun makefile-last-line-p () -- 2.35.1