GNU bug report logs -
#24021
FEATURE ADDITION: 25.0.94: goto-marker, jumps to a marker potentially in a different buffer
Previous Next
Reported by: rswgnu <at> gmail.com
Date: Mon, 18 Jul 2016 16:24:02 UTC
Severity: wishlist
Tags: wontfix
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #20 received at 24021 <at> debbugs.gnu.org (full text, mbox):
Robert Weiner <rsw <at> gnu.org> writes:
>
> I like these checks as they make the specific error very
> clear. set-buffer will trigger a type error when given a nil buffer
> but neither marker-buffer nor marker-position signal an error when
> given a marker that doesn't point anywhere, so the checks prior to
> calling those functions are relevant.
Fair enough, I would suggest using (unless ... (error ...)) to avoid
having the error checking add nesting depth to the main code.
>>
>> If this is just a "simple function" (not an interactive command), it
>> shouldn't widen, or call switch-to-buffer.
>>
>>
>>
>> save-excursion or save-current-buffer don't counteract
>> switch-to-buffer, because it affects the UI selected buffer.
>
> You are right that save-excursion and save-restriction won't
> counteract the effects of this function, so its purpose must be to put
> the selected window's point at the location of the marker. Possibly, a
> macro called with-marker-location could be useful when one needs to
> temporarily set buffer and point from a marker and evaluate some forms
> but not affect the display.
It really just makes more sense to let the caller do (switch-to-buffer
(current-buffer)) if needed. Or display-buffer, or pop-to-buffer. Not
hard coding the switch-to-buffer call makes the function more flexible
and usable in more situations.
This bug report was last modified 3 years and 167 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.