all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: 61629@debbugs.gnu.org
Subject: bug#61629: master: Sometimes M-x imenu throws an error when there's a single function in the buffer.
Date: Sun, 19 Feb 2023 15:39:13 +0000	[thread overview]
Message-ID: <Y/JCoQv0vzPOU32d@ACM> (raw)

Hello, Emacs.

On the master branch, the recipe below leads to an error being thrown
from imenu.

Awareness of this bug resulted from the thread Subject: Error in C++
Mode with Emacs 27.0.90, Date: Tue 24 Mar 2020, From: Angelo Graziosi.
This thread reported a bug in imenu, which never made it to debbugs, but
which was partially fixed.

Thanks to Dmitry Gutov, who made me aware of the bit that didn't get
fixed then.

To reproduce the error in the master branch:
(i) emacs -Q in a GUI environment.
(ii) Evaluate the following:

;; C/C++ modes
(defun my-c-mode ()
  "My customization for `c-mode' and `c++-mode'."
  ;; Add index of func. to menu bar
  (imenu-add-to-menubar "Functions"))

;; c++-mode
(add-hook 'c-mode-common-hook 'my-c-mode)

(setq imenu-auto-rescan t)
(setq imenu-use-popup-menu t)

(iii) Type the following into an empty C++ buffer called graziosi.cc:

int main ()
{
    return 0;
}

(iv) M-x imenu<RET>.

This throws the error "Wrong type argument: seqencep, #<marker at 1 in
graziosi.cc>".  This is a bug.

-- 
Alan Mackenzie (Nuremberg, Germany).





             reply	other threads:[~2023-02-19 15:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-19 15:39 Alan Mackenzie [this message]
2023-02-19 16:17 ` bug#61629: master: Sometimes M-x imenu throws an error when there's a single function in the buffer Alan Mackenzie
2023-02-19 17:50   ` Dmitry Gutov

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=Y/JCoQv0vzPOU32d@ACM \
    --to=acm@muc.de \
    --cc=61629@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.