help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to return to the position from where I did tags-query-replace?


From: Ambrose Laing
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)
User-agent: G2/1.0

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 
command 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 the 
commands manually, it does what I want, but if I put the commands into the 
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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]