all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: 58848@debbugs.gnu.org
Subject: bug#58848: 29.0.50; Make makefile browser mode obsolete?
Date: Tue, 13 Dec 2022 14:16:28 -0800	[thread overview]
Message-ID: <CADwFkmmwYNHOSDpSnM=fgnULueq9QtxGBnfPBYgZp78HmW0b1g@mail.gmail.com> (raw)
In-Reply-To: <CADwFkmkKFzdA9G-xs-4wipABD_R4V5HBtEZVLuQEQ+BVbpPb7g@mail.gmail.com> (Stefan Kangas's message of "Fri, 28 Oct 2022 14:07:44 -0700")

[-- Attachment #1: Type: text/plain, Size: 1142 bytes --]

tags 58848 + patch
thanks

Stefan Kangas <stefankangas@gmail.com> writes:

> Severity: wishlist
>
> While looking at make-mode.el, I found out that there's a "browser" mode
> in there, that's basically a poor mans imenu.  Richard added this
> comment to make-mode.el in 1994, and I'm inclined to agree:
>
>     ;; * Consider removing browser mode.  It seems useless.
>
> I have no idea what the situation was in 1994, but these days we have
> imenu (and various associated frontends), so I think it is fully
> redundant.
>
> I also tried
>
>     git log --grep=browse lisp/progmodes/make-mode.el
>
> and it seems like the only changes in it over the years have been
> cleanup type changes (fixing quoting in docstrings, and similar).
> I also note that "emacs makefile browser" and "emacs make browser" gives
> no hits on a web search, and I also can't find anything in the bug tracker.
>
> So how about making that stuff obsolete, as in the attached?  In the
> unlikely event that anyone is really attached to it, they will then have
> a decade or so to pipe up.

I've updated the patch for Emacs 30, added a NEWS and proper commit
message.

[-- Attachment #2: 0001-Make-Makefile-browser-obsolete.patch --]
[-- Type: text/x-diff, Size: 14366 bytes --]

From 883d1706b97d928d3713145d15e43d2c0e9e0b14 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Fri, 28 Oct 2022 22:58:37 +0200
Subject: [PATCH] Make Makefile browser obsolete

* lisp/progmodes/make-mode.el:
(makefile-mode): Don't document Makefile browser mode.
(makefile-browser-toggle-state-for-line):
(makefile-browser-buffer-name, makefile-browser-leftmost-column)
(makefile-browser-cursor-column, makefile-browser-selected-mark)
(makefile-browser-unselected-mark)
(makefile-browser-auto-advance-after-selection-p)
(makefile-browser-hook, makefile-browser-map)
(makefile-browser-client, makefile-browser-selection-vector)
(makefile-browser-format-target-line)
(makefile-browser-format-macro-line, makefile-browser-fill)
(makefile-browser-next-line, makefile-browser-previous-line)
(makefile-browser-quit, makefile-browser-toggle)
(makefile-browser-insert-continuation)
(makefile-browser-insert-selection)
(makefile-browser-insert-selection-and-quit)
(makefile-browser-send-this-line-item)
(makefile-browser-start-interaction, makefile-browse)
(makefile-switch-to-browser, makefile-browser-on-macro-line-p)
(makefile-browser-this-line-target-name)
(makefile-browser-this-line-macro-name)
(makefile-browser-get-state-for-line)
(makefile-browser-set-state-for-line)
(makefile-browser-toggle-state-for-line): Make obsolete.  (Bug#58848)
(makefile-mode-menu): Remove Makefile browser from menu.
* etc/NEWS: Announce its obsoletion.
---
 etc/NEWS                    |  7 ++++
 lisp/progmodes/make-mode.el | 76 +++++++++++++++----------------------
 2 files changed, 38 insertions(+), 45 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 8f6c67a3cb..726f8f8575 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -76,6 +76,13 @@ using this new option.  (Or set 'display-buffer-alist' directly.)
 After manually editing 'eshell-aliases-file', you can use
 'M-x eshell-read-aliases-list' to load the edited aliases.
 
+** Make mode
+
+*** The Makefile browser is now obsolete.
+The command 'makefile-switch-to-browser' command was is now obsolete,
+as well as its related commands used in the "*Macros and Targets*"
+buffer.  We recommend using an alternative like 'imenu' instead.
+
 ** Prog Mode
 +++
 *** New command 'prog-fill-reindent-defun'
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el
index 4cee361df3..39711557c5 100644
--- a/lisp/progmodes/make-mode.el
+++ b/lisp/progmodes/make-mode.el
@@ -44,10 +44,6 @@
 ;; prerequisites, which targets are out-of-date, and which have no
 ;; prerequisites.
 ;;
-;; The command C-c C-b pops up a browser window listing all target and
-;; macro names.  You can mark or unmark items with C-c SPC, and insert
-;; all marked items back in the Makefile with C-c TAB.
-;;
 ;; The command C-c TAB in the makefile buffer inserts a GNU make builtin.
 ;; You will be prompted for the builtin's arguments.
 ;;
@@ -66,17 +62,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 +106,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 "30.1")
 (defcustom makefile-browser-buffer-name "*Macros and Targets*"
   "Name of the macro- and target browser buffer."
   :type 'string)
@@ -152,10 +141,12 @@ makefile-tab-after-target-colon
 The default is t."
   :type 'boolean)
 
+(make-obsolete-variable 'makefile-browser-leftmost-column nil "30.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 "30.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 +159,17 @@ makefile-backslash-align
   "If non-nil, `makefile-backslash-region' will align backslashes."
   :type 'boolean)
 
+(make-obsolete-variable 'makefile-browser-selected-mark nil "30.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 "30.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 "30.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 +192,7 @@ makefile-mode-hook
   "Normal hook run by `makefile-mode'."
   :type 'hook)
 
+(make-obsolete-variable 'makefile-browser-hook nil "30.1")
 (defvar makefile-browser-hook '())
 
 ;;
@@ -611,9 +606,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 +633,7 @@ makefile-mode-menu
       :selected (eq major-mode 'makefile-makepp-mode)])))
 
 
+(make-obsolete-variable 'makefile-browser-map nil "30.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 +688,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 "30.1")
 (defvar makefile-browser-client
   "A buffer in Makefile mode that is currently using the browser.")
 
+(make-obsolete-variable 'makefile-browser-selection-vector nil "30.1")
 (defvar makefile-browser-selection-vector nil)
 (defvar makefile-has-prereqs nil)
 (defvar makefile-need-target-pickup t)
@@ -757,15 +752,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 +771,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 +786,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 `.'.
@@ -1306,6 +1272,7 @@ makefile-fill-paragraph
 ;;; ------------------------------------------------------------
 
 (defun makefile-browser-format-target-line (target selected)
+  (declare (obsolete nil "30.1"))
   (format
    (concat (make-string makefile-browser-leftmost-column ?\ )
 	   (if selected
@@ -1315,6 +1282,7 @@ makefile-browser-format-target-line
    target makefile-target-colon))
 
 (defun makefile-browser-format-macro-line (macro selected)
+  (declare (obsolete nil "30.1"))
   (format
    (concat (make-string makefile-browser-leftmost-column ?\ )
 	   (if selected
@@ -1323,6 +1291,7 @@ makefile-browser-format-macro-line
 	   (makefile-format-macro-ref macro))))
 
 (defun makefile-browser-fill (targets macros)
+  (declare (obsolete nil "30.1"))
   (let ((inhibit-read-only t))
     (goto-char (point-min))
     (erase-buffer)
@@ -1346,6 +1315,7 @@ makefile-browser-fill
 
 (defun makefile-browser-next-line ()
   "Move the browser selection cursor to the next line."
+  (declare (obsolete nil "30.1"))
   (interactive)
   (unless (makefile-last-line-p)
     (forward-line 1)
@@ -1353,6 +1323,7 @@ makefile-browser-next-line
 
 (defun makefile-browser-previous-line ()
   "Move the browser selection cursor to the previous line."
+  (declare (obsolete nil "30.1"))
   (interactive)
   (unless (makefile-first-line-p)
     (forward-line -1)
@@ -1364,6 +1335,7 @@ makefile-browser-previous-line
 
 (defun makefile-browser-quit ()
   "Leave the browser and return to the makefile buffer."
+  (declare (obsolete nil "30.1"))
   (interactive)
   (let ((my-client makefile-browser-client))
     (setq makefile-browser-client nil)	; we quit, so NO client!
@@ -1377,6 +1349,7 @@ makefile-browser-quit
 
 (defun makefile-browser-toggle ()
   "Toggle the selection state of the browser item at the cursor position."
+  (declare (obsolete nil "30.1"))
   (interactive)
   (let ((this-line (count-lines (point-min) (point))))
     (setq this-line (max 1 this-line))
@@ -1414,6 +1387,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 "30.1"))
   (interactive)
   (with-current-buffer makefile-browser-client
     (end-of-line)
@@ -1422,6 +1396,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 "30.1"))
   (interactive)
   (save-excursion
     (goto-char (point-min))
@@ -1433,11 +1408,13 @@ makefile-browser-insert-selection
 	(setq current-line (1+ current-line))))))
 
 (defun makefile-browser-insert-selection-and-quit ()
+  (declare (obsolete nil "30.1"))
   (interactive)
   (makefile-browser-insert-selection)
   (makefile-browser-quit))
 
 (defun makefile-browser-send-this-line-item ()
+  (declare (obsolete nil "30.1"))
   (if (makefile-browser-on-macro-line-p)
       (save-excursion
 	(let ((macro-name (makefile-browser-this-line-macro-name)))
@@ -1449,10 +1426,12 @@ makefile-browser-send-this-line-item
 	(insert target-name " ")))))
 
 (defun makefile-browser-start-interaction ()
+  (declare (obsolete nil "30.1"))
   (use-local-map makefile-browser-map)
   (setq buffer-read-only t))
 
 (defun makefile-browse (targets macros)
+  (declare (obsolete imenu "30.1"))
   (if (zerop (+ (length targets) (length macros)))
       (progn
 	(beep)
@@ -1469,6 +1448,7 @@ makefile-browse
       (makefile-browser-start-interaction))))
 
 (defun makefile-switch-to-browser ()
+  (declare (obsolete imenu "30.1"))
   (interactive)
   (run-hooks 'makefile-browser-hook)
   (setq makefile-browser-client (current-buffer))
@@ -1726,12 +1706,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 "30.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 "30.1"))
   (save-excursion
     (end-of-line)
     (skip-chars-backward "^ \t")
@@ -1739,6 +1721,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 "30.1"))
   (save-excursion
     (beginning-of-line)
     (re-search-forward "\\$[{(]" (line-end-position) t)
@@ -1757,12 +1740,15 @@ makefile-format-macro-ref
       (format "$(%s)" macro-name))))
 
 (defun makefile-browser-get-state-for-line (n)
+  (declare (obsolete nil "30.1"))
   (aref makefile-browser-selection-vector (1- n)))
 
 (defun makefile-browser-set-state-for-line (n to-state)
+  (declare (obsolete nil "30.1"))
   (aset makefile-browser-selection-vector (1- n) to-state))
 
 (defun makefile-browser-toggle-state-for-line (n)
+  (declare (obsolete nil "30.1"))
   (makefile-browser-set-state-for-line n (not (makefile-browser-get-state-for-line n))))
 
 (defun makefile-last-line-p ()
@@ -1799,7 +1785,7 @@ makefile-add-log-defun
 
 (defun makefile-generate-temporary-filename ()
   "Create a filename suitable for use in `makefile-save-temporary'."
-  (declare (obsolete make-temp-name "29.1"))
+  (declare (obsolete make-temp-name "30.1"))
   (format "mktmp%s.%s"
           (string-limit (user-login-name) 3)
           (string-limit (int-to-string (user-uid)) 3)))
-- 
2.35.1


  reply	other threads:[~2022-12-13 22:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-28 21:07 bug#58848: 29.0.50; Make makefile browser mode obsolete? Stefan Kangas
2022-12-13 22:16 ` Stefan Kangas [this message]
2023-08-29 16:32   ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADwFkmmwYNHOSDpSnM=fgnULueq9QtxGBnfPBYgZp78HmW0b1g@mail.gmail.com' \
    --to=stefankangas@gmail.com \
    --cc=58848@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.