From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.help Subject: Re: Listing headings in dedicated buffer with imenu. Date: Mon, 29 Jul 2024 11:33:31 +0200 Message-ID: <87ed7ctudw.fsf@gmx.net> References: Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36119"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Heime via Users list for the GNU Emacs text editor To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 29 11:34:26 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sYMlt-0009EU-Vt for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 29 Jul 2024 11:34:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sYMlJ-00089C-D4; Mon, 29 Jul 2024 05:33:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sYMlH-00088t-9B for help-gnu-emacs@gnu.org; Mon, 29 Jul 2024 05:33:47 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sYMlF-000295-8c for help-gnu-emacs@gnu.org; Mon, 29 Jul 2024 05:33:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1722245612; x=1722850412; i=stephen.berman@gmx.net; bh=xNcyYCnKoo//4pDiE6oZA7tK58w5vGdHYb2BbqoKGrg=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=IUrRS4wQcauTcBvyQxMz/GI4wL8T7nIuBgL5sJ3dRzSBhGY3rYaJkmd9hXME4/a7 jcICAOTY6uRC/vzu7dm/UYGXuu5EyVxJmy4W81rKOXBy/kmfHFT0Zp0Cgo65MrHHK XEcQ7KQBr1I777r1q6Do6p3uD9ELyCPrWEsG5OVbbSMZNUohigJKNcWk1oa6h/wTb o96ot1UfCzdegNJ/NemxIE6KkQjrHV5PCwXolEZ1aTy/uhkX+eq9bSTjEHR2kFEBx i0R+f/8ghVDnYZaLnrMH76B1Y8InRUL5QZ2TuHqmG8rDXMgFY7jzvGf36BmVG2xAj 3ipe9GHi6Af8UM2UPg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from strobelfs ([94.134.95.223]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N2mBQ-1s978346nM-00zAgb; Mon, 29 Jul 2024 11:33:32 +0200 In-Reply-To: (Heime's message of "Mon, 29 Jul 2024 08:48:38 +0000") X-Provags-ID: V03:K1:qSP3QMZ/SN4MHMY6+zyWqg0NojUxCUR/KxBv2Rj8vIJh8wFApqO sPGN8ACFHhzuFSzt9Zs9CP+3tm9KkXcn2iExD22B2JYrMY4OQ5q5VP6wUWpDSXUvHptxdj5 OsvEeP+RgUQyytmsH/NKr+32R8plKNW2+XoKd24M+GY7cLRH8Q8VkQ9BTUnaPNu9dx3ri7f rIqHK3X/CJKAbhk6xecrg== UI-OutboundReport: notjunk:1;M01:P0:09IdOXyqqz4=;RjBwy3LZuq5Lgyxu1by7sQuPnBz ILvaoI7sPgUtAf9iMWOVlLwjNO5/Bn4Z4jApTFtigqogdjOu/7IMQ37C5e/HCRazsVXwfUWET j5N0LeilK3j+LocKK06X+m1HBpE3br0xjXSxX6rm3Bd+DSH8AFq79tNdqEahulZ27EK8HDkw2 q26I0/UkM42n7gYQ8Z2Nr4Yr0/xwgFBlYc+PEbnGTbjqY2t/8ze9yQ/0hgtaMLPzGDXhF1ypR s2SeoEfnv3ySsVz4c1RoHEwpsC6LCD0BtgSDhojI0298v+FLXwDRoVEpjPrFrq/3Z+neiqupA jmqISyJy9LG92HT9FidIs8D2SRoI8ZzGQl0d7MGysb4qvB2CFcrnvqfpDhL7NmhjhDEsWTHi8 oYBDyM/FE0JREL8G380obIpPZDhzfDA8VSlO7AjFS1E4Rua0cAIONvqqS30Z1ZpPMjyWNgLUH hanlBafkTpQCx+HJsJNEYHKl8naZM3l7Oo0238MSVtEHxVSZnejwFYX7s7vmX0DcQ/5+Wnmh3 SGLyTxUQKChvMHw1tNfqHY6gR/I2jgcV9wiwyZbu+sxI6EPyNkHsCdj0x0DmqJ72KiKb6a3IZ ZUwaoW/7ikk4bIVLh2YjigHfGbC0Gvr1J3ioFqU10GSCtkm9/XUy8wvoBaiaGWsjyVymONghX rXa63ghOXADw2A8xrvcoEjHRtKfV8CiyoR0rV+62R57aAeAh+/fOBxGCW2hH9ryxMAfVBPTjH 7oPc/PFtnr6pyV0P6hheuZgtcDbDehl52yVNS1fCSh5X5jPhpQyoUU9KGRkgsVVNfUyuLx4m Received-SPF: pass client-ip=212.227.17.22; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147433 Archived-At: On Mon, 29 Jul 2024 08:48:38 +0000 Heime wrot= e: > I wish to list headings in a dedicated buffer with imenu. > The listing should be in the order in which headings occur > in the buffer. > > Have done the following, but the buffer ends up empty. > > (defun vodil-imenu-bfh () > "Insert imenu headings in order in a dedicated buffer." > (interactive) > > (let ((imenu-items (imenu--make-index-alist t)) > (buffer-name "*Imenu Headings*")) > (with-current-buffer (get-buffer-create buffer-name) > (erase-buffer) > (dolist (item imenu-items) > (let ((name (car item)) > (position (cdr item))) > (when (and (stringp name) (number-or-marker-p position)) > (insert (format "%s\n" name))))) > (goto-char (point-min))) > (pop-to-buffer buffer-name))) It works for me, as long as imenu.el is loaded. Steve Berman