unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: 51102@debbugs.gnu.org
Cc: "Eric M. Ludlam" <zappo@gnu.org>
Subject: bug#51102: [PATCH] Make speedbar XEmacs compatibility mode obsolete (etags)
Date: Fri, 8 Oct 2021 17:36:04 -0400	[thread overview]
Message-ID: <CADwFkmk+ooQLiaGMdar+7GR7B-wfc_5do5AtnUhgt8LBjVEEFw@mail.gmail.com> (raw)

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

Severity: wishlist

The documentation for `speedbar-use-imenu-flag' says:

    (defcustom speedbar-use-imenu-flag t
      "Non-nil means use imenu for file parsing, nil to use etags.
    XEmacs prior to 20.4 doesn't support imenu, therefore the default is to
    use etags instead.  Etags support is not as robust as imenu support."
    :tag "Use Imenu for tags"
    :group 'speedbar
    :type 'boolean)

Is there any reason to keep the etags support around, or should we
install something like the attached patch?

[-- Attachment #2: 0001-Make-speedbar-XEmacs-compatibility-mode-obsolete-eta.patch --]
[-- Type: text/x-diff, Size: 7362 bytes --]

From beb2633f5c5642d2c9a9a5d9727ae9df3df7ff05 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefan@marxist.se>
Date: Fri, 8 Oct 2021 23:09:50 +0200
Subject: [PATCH] Make speedbar XEmacs compatibility mode obsolete (etags)

* lisp/speedbar.el: (speedbar): Remove :group etags from defgroup.
(speedbar-dynamic-tags-function-list): Remove etags support that was
only kept around for XEmacs compatibility.
(speedbar-use-imenu-flag, speedbar-insert-etags-list)
(speedbar-extract-one-symbol, speedbar-parse-c-or-c++tag)
(speedbar-parse-tex-string, speedbar-fetch-etags-parse-list)
(speedbar-fetch-etags-command, speedbar-fetch-etags-arguments)
(speedbar-toggle-etags): Make obsolete.
(speedbar-tag-expand): Doc fix.
---
 etc/NEWS         |  7 +++++++
 lisp/speedbar.el | 43 +++++++++++++++----------------------------
 2 files changed, 22 insertions(+), 28 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index b91a5cbb72..32c8dbd8c2 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -105,6 +105,13 @@ also handle ANSI codes for faint, italic and blinking text, displaying
 it with new 'ansi-term-faint/italic/slow-blinking/fast-blinking'
 faces.
 
+** speedbar
+
+---
+*** etags support is now obsolete.
+This was only kept around for XEmacs compatibility, and the imenu
+support is more robust.
+
 \f
 * New Modes and Packages in Emacs 29.1
 
diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index 3cc3e27606..96e668fc06 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -112,7 +112,6 @@
 ;; customization stuff
 (defgroup speedbar nil
   "File and tag browser frame."
-  :group 'etags
   :group 'tools
   :group 'convenience
   :link '(custom-manual "(speedbar) Top")
@@ -306,17 +305,17 @@ speedbar-frame-parameters
 		       (symbol :tag "Parameter")
 		       (sexp :tag "Value"))))
 
-(defcustom speedbar-use-imenu-flag (fboundp 'imenu)
+(defcustom speedbar-use-imenu-flag t
   "Non-nil means use imenu for file parsing, nil to use etags.
 XEmacs prior to 20.4 doesn't support imenu, therefore the default is to
 use etags instead.  Etags support is not as robust as imenu support."
   :tag "Use Imenu for tags"
   :group 'speedbar
   :type 'boolean)
+(make-obsolete-variable 'speedbar-use-imenu-flag nil "29.1")
 
 (defvar speedbar-dynamic-tags-function-list
-  '((speedbar-fetch-dynamic-imenu . speedbar-insert-imenu-list)
-    (speedbar-fetch-dynamic-etags . speedbar-insert-etags-list))
+  '((speedbar-fetch-dynamic-imenu . speedbar-insert-imenu-list))
   "Set to a list of functions which will return and insert a list of tags.
 Each element is of the form ( FETCH . INSERT ) where FETCH
 is a function which takes one parameter (the file to tag) and returns a
@@ -2350,6 +2349,7 @@ speedbar-insert-imenu-list
 
 (defun speedbar-insert-etags-list (indent lst)
   "At level INDENT, insert the etags generated LST."
+  (declare (obsolete nil "29.1"))
   (speedbar-insert-generic-list indent lst
 				'speedbar-tag-expand
 				'speedbar-tag-find))
@@ -3356,7 +3356,7 @@ speedbar-tag-find
 
 (defun speedbar-tag-expand (text token indent)
   "Expand a tag sublist.  Imenu will return sub-lists of specialized tag types.
-Etags does not support this feature.  TEXT will be the button string.
+TEXT will be the button string.
 TOKEN will be the list, and INDENT is the current indentation level."
   (cond ((string-search "+" text)	;we have to expand this file
 	 (speedbar-change-expand-button-char ?-)
@@ -3503,10 +3503,6 @@ speedbar-fetch-dynamic-tags
 
 ;;; Tag Management -- Imenu
 ;;
-(if (not speedbar-use-imenu-flag)
-
-    nil
-
 (eval-when-compile (condition-case nil (require 'imenu) (error nil)))
 (declare-function imenu--make-index-alist "imenu" (&optional no-error))
 
@@ -3524,7 +3520,7 @@ speedbar-fetch-dynamic-imenu
 		  (lambda (a b) (string< (car a) (car b))))
 	  index-alist))
     (error t)))
-)
+
 \f
 ;;; Tag Management -- etags  (old XEmacs compatibility part)
 ;;
@@ -3548,12 +3544,14 @@ speedbar-fetch-etags-parse-list
 to be at the beginning of a line in the etags buffer.
 
 This variable is ignored if `speedbar-use-imenu-flag' is non-nil.")
+(make-obsolete-variable 'speedbar-fetch-etags-parse-list nil "29.1")
 
 (defcustom speedbar-fetch-etags-command "etags"
   "Command used to create an etags file.
 This variable is ignored if `speedbar-use-imenu-flag' is t."
   :group 'speedbar
   :type 'string)
+(make-obsolete-variable 'speedbar-fetch-etags-command nil "29.1")
 
 (defcustom speedbar-fetch-etags-arguments '("-D" "-I" "-o" "-")
   "List of arguments to use with `speedbar-fetch-etags-command'.
@@ -3562,7 +3560,8 @@ speedbar-fetch-etags-arguments
 This variable is ignored if `speedbar-use-imenu-flag' is t."
   :group 'speedbar
   :type '(choice (const nil)
-		 (repeat :tag "List of arguments" string)))
+                 (repeat :tag "List of arguments" string)))
+(make-obsolete-variable 'speedbar-fetch-etags-arguments nil "29.1")
 
 (defun speedbar-toggle-etags (flag)
   "Toggle FLAG in `speedbar-fetch-etags-arguments'.
@@ -3573,6 +3572,7 @@ speedbar-toggle-etags
 
   This function is a convenience function for XEmacs menu created by
 Farzin Guilak <farzin@protocol.com>."
+  (declare (obsolete nil "29.1"))
   (interactive)
   (cond
    ((equal flag "sort")
@@ -3591,6 +3591,7 @@ speedbar-toggle-etags
 (defun speedbar-fetch-dynamic-etags (file)
   "For FILE, run etags and create a list of symbols extracted.
 Each symbol will be associated with its line position in FILE."
+  (declare (obsolete nil "29.1"))
   (let ((newlist nil))
     (unwind-protect
 	(save-excursion
@@ -3628,27 +3629,11 @@ speedbar-fetch-dynamic-etags
 	(sort newlist (lambda (a b) (string< (car a) (car b))))
       (reverse newlist))))
 
-;; This bit donated by Farzin Guilak <farzin@protocol.com> but I'm not
-;; sure it's needed with the different sorting method.
-;;
-;(defun speedbar-clean-etags()
-;  "Removes spaces before the ^? character, and removes `#define',
-;return types, etc. preceding tags.  This ensures that the sort operation
-;works on the tags, not the return types."
-;  (save-excursion
-;    (goto-char (point-min))
-;    (while
-;	(re-search-forward "(?[ \t](?\C-?" nil t)
-;      (replace-match "\C-?" nil nil))
-;    (goto-char (point-min))
-;    (while
-;	(re-search-forward "\\(.*[ \t]+\\)\\([^ \t\n]+.*\C-?\\)" nil t)
-;      (delete-region (match-beginning 1) (match-end 1)))))
-
 (defun speedbar-extract-one-symbol (expr)
   "At point, return nil, or one alist in the form (SYMBOL . POSITION).
 The line should contain output from etags.  Parse the output using the
 regular expression EXPR."
+  (declare (obsolete nil "29.1"))
   (let* ((sym (if (stringp expr)
 		  (if (save-excursion
 			(re-search-forward expr (line-end-position) t))
@@ -3668,6 +3653,7 @@ speedbar-extract-one-symbol
 
 (defun speedbar-parse-c-or-c++tag ()
   "Parse a C or C++ tag, which tends to be a little complex."
+  (declare (obsolete nil "29.1"))
   (save-excursion
     (let ((bound (line-end-position)))
       (cond ((re-search-forward "\C-?\\([^\C-a]+\\)\C-a" bound t)
@@ -3684,6 +3670,7 @@ speedbar-parse-c-or-c++tag
 
 (defun speedbar-parse-tex-string ()
   "Parse a Tex string.  Only find data which is relevant."
+  (declare (obsolete nil "29.1"))
   (save-excursion
     (let ((bound (line-end-position)))
       (cond ((re-search-forward "\\(\\(sub\\)*section\\|chapter\\|cite\\)\\s-*{[^\C-?}]*}?" bound t)
-- 
2.30.2


             reply	other threads:[~2021-10-08 21:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-08 21:36 Stefan Kangas [this message]
2021-10-09  6:29 ` bug#51102: [PATCH] Make speedbar XEmacs compatibility mode obsolete (etags) Eli Zaretskii
2021-10-09  7:08   ` Stefan Kangas
2021-10-09  7:52     ` Eli Zaretskii
2021-10-10 16:31       ` Eric Ludlam
2021-10-10 17:51         ` Eli Zaretskii
2021-10-10 17:57           ` Eric Ludlam
2021-10-10 18:37             ` Eli Zaretskii
2021-10-10 20:16               ` Eric Ludlam
2021-10-11 14:18               ` Stefan Kangas
2021-10-11 15:57                 ` Eli Zaretskii
2022-09-12 11:11                 ` bug#51102: Document speedbar etags compatibility mode better Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CADwFkmk+ooQLiaGMdar+7GR7B-wfc_5do5AtnUhgt8LBjVEEFw@mail.gmail.com \
    --to=stefan@marxist.se \
    --cc=51102@debbugs.gnu.org \
    --cc=zappo@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).