unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* `next-file' in etags.el signaling error to denote end of operation
@ 2009-12-18  0:15 Tobias C. Rittweiler
  2009-12-27  0:34 ` Kevin Ryde
  0 siblings, 1 reply; 2+ messages in thread
From: Tobias C. Rittweiler @ 2009-12-18  0:15 UTC (permalink / raw)
  To: emacs-devel


The function `next-file' in etags.el signals an unnamed error when the
end of `next-file-list' is reached.

This makes it not all that easy to call `tags-query-replace' multiple
times in a row programmatically as far as I can see.

An easy solution would be to make `next-file' signal a named condition
that can then be caught programmatically.

I'll post this to the bug tracker unless someone can point out that I'm
missing something.

  -T.








^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: `next-file' in etags.el signaling error to denote end of operation
  2009-12-18  0:15 `next-file' in etags.el signaling error to denote end of operation Tobias C. Rittweiler
@ 2009-12-27  0:34 ` Kevin Ryde
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Ryde @ 2009-12-27  0:34 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 909 bytes --]

"Tobias C. Rittweiler" <tcr@freebits.de> writes:
>
> This makes it not all that easy to call `tags-query-replace' multiple
> times in a row programmatically as far as I can see.

I struck that recently too, trying to use it programmatically.
I wondered if it was the right tool for the job.

I also struck that if you pass relative filenames then they can be taken
relative to the directories of other files in the list, if some of those
are in buffers already.

I've been contemplating the change below, without being sure if it
affects anything except programmed usages, which may not be its purpose
...

2009-11-16  Kevin Ryde  <user42@zip.com.au>

	* progmodes/etags.el (next-file): expand-file-name on files from
	the eval, the same as in the tags-table-files case.  This lets
	tags-query-replace go to the right place if the evalled form gives
	relative filenames some of which are already in buffers.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: etags.el.exapnd-file-name.diff --]
[-- Type: text/x-diff, Size: 661 bytes --]

Index: etags.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/etags.el,v
retrieving revision 1.218
diff -u -u -r1.218 etags.el
--- etags.el	5 Dec 2009 22:01:04 -0000	1.218
+++ etags.el	27 Dec 2009 00:26:41 -0000
@@ -1708,7 +1708,8 @@
 					      (tags-table-files))))))))
 	(t
 	 ;; Initialize the list by evalling the argument.
-	 (setq next-file-list (eval initialize))))
+	 ;; expand-file-name in case the tags-loop-operate goes to a new dir.
+	 (setq next-file-list (mapcar 'expand-file-name (eval initialize)))))
   (unless next-file-list
     (and novisit
 	 (get-buffer " *next-file*")

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-12-27  0:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-18  0:15 `next-file' in etags.el signaling error to denote end of operation Tobias C. Rittweiler
2009-12-27  0:34 ` Kevin Ryde

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).