From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.help Subject: Re: Saving and recalling registers, using the same key sequence ? Date: Wed, 20 Mar 2019 20:23:52 +0100 Message-ID: <87lg19qrhz.fsf@telefonica.net> References: <20190320134439.51ea2240@mistral> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="18083"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.90 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: jonetsu Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 20 20:25:23 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6gq2-0004aM-JO for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Mar 2019 20:25:22 +0100 Original-Received: from localhost ([127.0.0.1]:52128 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6gq1-0007cS-Gy for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Mar 2019 15:25:21 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6gpn-0007bc-BL for help-gnu-emacs@gnu.org; Wed, 20 Mar 2019 15:25:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h6gog-000206-Df for help-gnu-emacs@gnu.org; Wed, 20 Mar 2019 15:23:58 -0400 Original-Received: from relayout02-redir.e.movistar.es ([86.109.101.202]:64819) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h6gog-0001yP-2i for help-gnu-emacs@gnu.org; Wed, 20 Mar 2019 15:23:58 -0400 Original-Received: from sky (31.red-79-151-6.dynamicip.rima-tde.net [79.151.6.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: 981711563@telefonica.net) by relayout02.e.movistar.es (Postfix) with ESMTPSA id 44Pfwn1T6tzdb1G; Wed, 20 Mar 2019 20:23:52 +0100 (CET) In-Reply-To: <20190320134439.51ea2240@mistral> (jonetsu@teksavvy.com's message of "Wed, 20 Mar 2019 13:44:39 -0400") X-CTCH-Score: 0.000 X-CTCH-ScoreCust: 0.000 X-TnetOut-Country: IP: 79.151.6.31 | Country: ES X-TnetOut-Information: AntiSPAM and AntiVIRUS on relayout02 X-TnetOut-MsgID: 44Pfwn1T6tzdb1G.A781C X-TnetOut-SpamCheck: no es spam, Unknown X-TnetOut-From: ofv@wanadoo.es X-TnetOut-Watermark: 1553714634.66442@Ser+90MMPfXXmmPxHBld2A X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 86.109.101.202 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:119701 Archived-At: jonetsu writes: > Is it possible to save a text register and use it in the exact same way > at a later time ? > > For instance, I define very simple useful things that I recall by doing: > > C-x r i i ;; inserts : #include <> > C-x r i u ;; inserts : using std::; > C-x r i n ;; inserts : << '\n'; > > I would like to have these always ready when editing C++ code. They > could be globally defined, or bound to the editing of C++ files, I > wouldn't mind. You can use `set-register' to set your registers programatically in your .emacs file: (set-register ?i "#include <>") IMO abbrevs are a better choice for what you want. See `Abbrevs' in the Emacs manual. Depending on your specific needs and preferences, the Yasnippet package can be even better.