Add #anchor to next/previous_post_link

This seems to do the trick:

add_filter( 'next_post_link',     'wpse_post_link', 10, 4 );
add_filter( 'previous_post_link', 'wpse_post_link', 10, 4 );

function wpse_post_link( $output, $format, $link, $post )
{
    if( $url = get_permalink( $post ) ) 
        $output = str_replace( $url, $url . '#anchor', $output );

    return $output;
}

i.e. appending the #anchor to the previous/next permalinks.

ps: I removed the WP_Rewrite::using_permalink() check, since we actually don’t need it, example.tld?p=123#anchor should work as well.