From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ambrose Laing Newsgroups: gmane.emacs.help Subject: Re: How to return to the position from where I did tags-query-replace? Date: Sat, 3 Feb 2018 14:27:15 -0800 (PST) Message-ID: <2f9fe1c0-f382-47d4-8df2-0b39d3645385@googlegroups.com> References: <1189017224.525081.173930@22g2000hsm.googlegroups.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1517696927 1406 195.159.176.226 (3 Feb 2018 22:28:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 3 Feb 2018 22:28:47 +0000 (UTC) Injection-Date: Sat, 03 Feb 2018 22:27:15 +0000 User-Agent: G2/1.0 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 03 23:28:43 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ei6IM-0007RV-7K for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Feb 2018 23:28:26 +0100 Original-Received: from localhost ([::1]:55306 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ei6KL-0002DL-S8 for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Feb 2018 17:30:29 -0500 X-Received: by 10.55.73.12 with SMTP id w12mr30731927qka.12.1517696835742; Sat, 03 Feb 2018 14:27:15 -0800 (PST) X-Received: by 10.31.180.205 with SMTP id d196mr3843876vkf.10.1517696835464; Sat, 03 Feb 2018 14:27:15 -0800 (PST) Original-Path: usenet.stanford.edu!i22no6954835qta.1!news-out.google.com!e39ni2271qtk.1!nntp.google.com!s47no6953432qta.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Original-Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:183:c900:9ffa:ace3:157e:c60b:dbb0; posting-account=dhIQkAoAAAC3SN9RXz6IZxkZKNcT7tos Original-NNTP-Posting-Host: 2601:183:c900:9ffa:ace3:157e:c60b:dbb0 Original-Xref: usenet.stanford.edu gnu.emacs.help:221788 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:115905 Archived-At: I would like the same outcome as the original poster: I would like for tags= -query-replace to always return to the position of the point when the comma= nd was invoked, except that I want it to happen programmatically. Here are= two approaches I tried, neither of which works. In each case, if I run th= e commands manually, it does what I want, but if I put the commands into th= e function, it doesn't work. (defun my-tags-query-replace () (interactive) (point-to-register "a") (command-execute 'tags-query-replace) (jump-to-register "a")) (defun my-tags-query-replace () (interactive) (bc-set) (command-execute 'tags-query-replace) (bc-goto-current) (setq *bc-bookmarks* (cdr *bc-bookmarks*))) Any ideas how to do this correctly? Thanks you, Ambrose