From unknown Fri Jun 20 05:28:34 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#62263 <62263@debbugs.gnu.org> To: bug#62263 <62263@debbugs.gnu.org> Subject: Status: 28.1; Feature Request: Favorites variable support for minibuffers Reply-To: bug#62263 <62263@debbugs.gnu.org> Date: Fri, 20 Jun 2025 12:28:34 +0000 retitle 62263 28.1; Feature Request: Favorites variable support for minibuf= fers reassign 62263 emacs submitter 62263 omer.kasapoglu@boun.edu.tr severity 62263 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 18 12:37:09 2023 Received: (at submit) by debbugs.gnu.org; 18 Mar 2023 16:37:09 +0000 Received: from localhost ([127.0.0.1]:48945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdZYK-0000Zz-FW for submit@debbugs.gnu.org; Sat, 18 Mar 2023 12:37:09 -0400 Received: from lists.gnu.org ([209.51.188.17]:35672) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdW3t-0002WT-LZ for submit@debbugs.gnu.org; Sat, 18 Mar 2023 08:53:30 -0400 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 1pdW3s-0000UE-Em for bug-gnu-emacs@gnu.org; Sat, 18 Mar 2023 08:53:28 -0400 Received: from smtp.boun.edu.tr ([193.140.192.16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pdW3k-00053m-UV for bug-gnu-emacs@gnu.org; Sat, 18 Mar 2023 08:53:27 -0400 Received: from thinkpad-oak (unknown [212.154.4.42]) by smtp.boun.edu.tr (Postfix) with ESMTPSA id 49039AC2AF for ; Sat, 18 Mar 2023 15:53:07 +0300 (+03) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.boun.edu.tr 49039AC2AF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=boun.edu.tr; s=boun.edu.tr; t=1679143987; bh=o26TllASMjlQ5DciRdPH7BwfrXMl15Wm3Ykup5Qm4uk=; h=From:To:Subject:Date:From; b=ETuu69WqsrBxFQ/epxzy8mOb3QrJ/ZSN8Yx5vnjJYWC5TF/2TGeZFC0+W1GSgHkED Ehm1udoI1B3yAfe5FegTW+JeOJPFq4Na1C9nAoq+qvgnrEZ88VasFl/i6ow+8vodpQ K+Of1oljwoXDOdlEsWlWSPLchzbznOYaiYe6MB1AQmBlZIUiXmG1rk1I/Fl2+GhU6X jVhL0brZ/3bmjRNm7Gr247wt9J2b8uNSdO50zZPCSsW+uaVw/UhSYPFFHvw4mR8sJ1 gf242KraXxagAOOE+SFnGy4hEdG+q/GwfZwZg8/KND8atFDQXqX7HuBEDcRrUHkfeM gPAnlNxS9/ffA== From: omer.kasapoglu@boun.edu.tr To: bug-gnu-emacs@gnu.org Subject: 28.1; Feature Request: Favorites variable support for minibuffers Date: Sat, 18 Mar 2023 15:52:58 +0300 Message-ID: <863562usph.fsf@boun.edu.tr> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=193.140.192.16; envelope-from=omer.kasapoglu@boun.edu.tr; helo=smtp.boun.edu.tr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 18 Mar 2023 12:37:07 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) We know that there is many history variables for emacs. Those provide us with the ability to quickly rerun last entries from minibuffers. Some examples to those history variables: extended-command-history : used from the command execute-extended-command minibuffer-history : default history variable for minibuffers command-history : used from the command repeat-matching-complex-command When minibuffers initialized from a command, it sets the variable minibuffer-history-variable to the related history variable. Yes savehist-mode is very good and minibuffer histories are essential for my emacs usage. But there is a thing I want. I want to save some of those history values permanently in a super accessible way. I will call those favorites and favorite variables. I want similar commands for minibuffer histories to exist for also the favorites variables next-history-element --> next-favorite-element previous-history-element --> previous-favorite-element As of emacs 29, there is also minibuffer-complete-history C-x --> minibuffer-complete-favorites One big problem for creating those favorites variables is it is a bit complicated. There is many history variables and all those are defined from many many libraries. Making duplicates of all those variables named favorites variables is probably not the approach we should take. Could there be any work around from the history variables? Can we attach those favorites data into those history variables and access them later from there? I can't see the internals cleary, but i want these use-cases: Saving some history elements to this favorites variable in minibuffers with only one key press. An interface that probably will be named minibuffer-complete-favorites to access all those elements from the comfort of my minibuffer. Maybe a next-history-element and previous-history-element alternatives for quickly accessing last favorite command. If we could implement such a functionality, i think many current emacs functions will be able to serve us in greater ways There is some examples to those. | | with history variable | favorites variable | | | | | | find-file | for accessing last visited files | for accessing favorite files | | dired | for accessing last visited directories | for accessing favorite directories | | execute-extended-command | for running last run commands | for accessing favorite commands | | execute-extended-command-for-buffer | for running last major mode commands | for accessing favorite major mode commands | | eval-expression | for evaluating last expression | for evaluating saved expressions | | customize-set-value | for changing last changed variables | for changing favorite variables | | | | | | ag rg grep locate find | rerun last search | rerun your favorite searches | | | | | | shell-command | rerun last shell commands | rerun favorite shell commands | | async-shell-command | rerun last shell commands | rerun favorite shell commands | | shell-command-on-region | rerun last shell commands on region | rerun favorite shell commands on region | | | | | | | | | | load-theme | reload last loaded themes | reload your favorite themes | | find-library | find last visited libraries | visit your favorite libraries | | load-library | load last loaded libraries | load your favorite libraries | | | | | | describe-function | describe last looked up functions | access favorite functions documentations | | describe-variable | describe last looked up variables | access favorite variables documentations | | | | | find-file with favorites variables will be a simpler alternative to bookmark-jump. eval-expression with favorites variables could be an alternative to repeat-complex-command. Also eval-expression with favorites variables can run your favorite snippets of codes on demand. There is many benefits to using such a favorites functionality. If anyone can provide me with some hack around the history variable to emulate those benefits, i would be glad. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 22 13:52:43 2023 Received: (at 62263) by debbugs.gnu.org; 22 Mar 2023 17:52:43 +0000 Received: from localhost ([127.0.0.1]:36658 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pf2df-0007P7-2O for submit@debbugs.gnu.org; Wed, 22 Mar 2023 13:52:43 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:39489) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pf2dc-0007Op-Cd for 62263@debbugs.gnu.org; Wed, 22 Mar 2023 13:52:41 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 29D1B1BF205; Wed, 22 Mar 2023 17:52:30 +0000 (UTC) From: Juri Linkov To: omer.kasapoglu@boun.edu.tr Subject: Re: bug#62263: 28.1; Feature Request: Favorites variable support for minibuffers In-Reply-To: <863562usph.fsf@boun.edu.tr> (omer kasapoglu's message of "Sat, 18 Mar 2023 15:52:58 +0300") Organization: LINKOV.NET References: <863562usph.fsf@boun.edu.tr> Date: Wed, 22 Mar 2023 19:43:12 +0200 Message-ID: <86y1np42kv.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 62263 Cc: 62263@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > If anyone can provide me with some hack around the history variable > to emulate those benefits, i would be glad. One example that you could look at is project--read-file-cpd-relative where it filters out non-project history items: (relname (cl-letf ((history-add-new-input nil) ((symbol-value hist) (mapcan (lambda (s) (and (string-prefix-p abbr-cpd s) (not (eq abbr-cpd-length (length s))) (list (substring s abbr-cpd-length)))) (symbol-value hist)))) (project--completing-read-strict prompt new-collection predicate hist mb-default))) The same way you could filter out non-favorites from the currently active history list symbol from minibuffer-history-variable for your commands next-favorite-element and previous-favorite-element, or in an advice-add around next-history-element/previous-history-element.