X-Debbugs-CC: Dmitry Gutov Tags: patch >>> diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el >>> @@ -897,8 +897,10 @@ xref-location-marker >>> - (goto-char (or (cdr buffer-point) (point-min))) >>> - (point-marker)))))) >>> + (save-restriction >>> + (widen) >>> + (goto-char (or (cdr buffer-point) (point-min))) >>> + (point-marker))))))) > > If this works, sure, please install. This piece by itself makes sense. > >> Hm... Does Dmitry have any comments here? (Added to Cc.) > > I'm subscribed to the bug tracker, but I skip over a number of discussions > automatically (and an extra email in a thread is relatively easy to miss, > too). > > In case I don't respond in similar circumstances in the future, may I ask > for a personal email? One without 'debbugs.gnu.org' in the From/To/Cc. Oh, sorry, I noticed this problem is just the tip of the iceberg, so creating a separate bug report from bug#5042 and bug#9917. The patch above fixes the problem of using xref-find-definitions in elisp-mode, but using xref-find-definitions in narrowed C files still fails with the error "Rerun etags: `%s' not found in %s". Here is an additional patch that fixes this as well: