From: Bastian Beischer <bastian.beischer@gmail.com>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: bug#28645 <28645@debbugs.gnu.org>
Subject: bug#28645: Status: 26.0.50; semantic-ia-fast-jump jumps to a random place in buffer
Date: Tue, 17 Oct 2017 14:30:35 +0200 [thread overview]
Message-ID: <878tgalzx0.fsf@gmail.com> (raw)
In-Reply-To: <937f31d2-2952-8e88-1dd4-81ee243cd1fd@yandex.ru> (Dmitry Gutov's message of "Tue, 17 Oct 2017 13:44:30 +0300")
Dmitry Gutov <dgutov@yandex.ru> writes:
> On 10/16/17 1:21 PM, Bastian Beischer wrote:
>
>> I replaced switch-to-buffer with pop-to-buffer-same-window in those functions
>> which I'm using regularly and it fixes the problem. The CEDET functions where
>> I made the replacements and checked them are:
>>
>> semantic-analyze-proto-impl-toggle
>> semantic-complete-jump
>> semantic-decoration-include-visit
>> semantic-ia--fast-jump-helper
>> semantic-mrub-vist
>> senator-jump
>> senator-jump-regexp
>> senator-go-to-up-reference
>>
It turns out that senator-jump and senator-jump-regexp don't exist in
emacs but only in upstream CEDET. So no need to change these.
>> I didn't make any other replacements because:
>>
>> a) For some of them I'm not sure if 'pop-to-buffer-same-window' or
>> 'pop-to-buffer' should be used.
>> b) I'm not using any of the other functions with matches so I wouldn't be able
>> to test the change.
>>
>> Also, searching for 'switch-to-buffer' in non-CEDET related lisp files in the
>> emacs sources reveals more places which need to be fixed, but I didn't go that
>> far. However, probably somebody (tm) should check them all one-by-one :-(
>
> Could you send a patch with the replacements you did make?
Sure:
diff --git a/lisp/cedet/semantic/analyze/refs.el b/lisp/cedet/semantic/analyze/refs.el
index 55fcd83043..a58479f505 100644
--- a/lisp/cedet/semantic/analyze/refs.el
+++ b/lisp/cedet/semantic/analyze/refs.el
@@ -348,7 +348,7 @@ Only works for tags in the global namespace."
(push-mark)
(semantic-go-to-tag target)
- (switch-to-buffer (current-buffer))
+ (pop-to-buffer-same-windown (current-buffer))
(semantic-momentary-highlight-tag target))
)
diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el
index ff8e61e54d..325ca1f441 100644
--- a/lisp/cedet/semantic/complete.el
+++ b/lisp/cedet/semantic/complete.el
@@ -2120,7 +2120,7 @@ completion works."
(when (semantic-tag-p tag)
(push-mark)
(semantic-go-to-tag tag)
- (switch-to-buffer (current-buffer))
+ (pop-to-buffer-same-window (current-buffer))
(semantic-momentary-highlight-tag tag)
(message "%S: %s "
(semantic-tag-class tag)
diff --git a/lisp/cedet/semantic/decorate/include.el b/lisp/cedet/semantic/decorate/include.el
index 6876e5f3a4..4a86b9e4ee 100644
--- a/lisp/cedet/semantic/decorate/include.el
+++ b/lisp/cedet/semantic/decorate/include.el
@@ -467,7 +467,7 @@ its contents.
(error "Could not location include %s"
(semantic-tag-name tag)))
((get-file-buffer file)
- (switch-to-buffer (get-file-buffer file)))
+ (pop-to-buffer-same-window (get-file-buffer file)))
((stringp file)
(find-file file))
))))
diff --git a/lisp/cedet/semantic/mru-bookmark.el b/lisp/cedet/semantic/mru-bookmark.el
index 5fa58e08ea..24863de01b 100644
--- a/lisp/cedet/semantic/mru-bookmark.el
+++ b/lisp/cedet/semantic/mru-bookmark.el
@@ -113,7 +113,7 @@ Uses `semantic-go-to-tag' and highlighting."
(forward-char o))
(error nil))
;; make it visible
- (switch-to-buffer (current-buffer))
+ (pop-to-buffer-same-window (current-buffer))
(semantic-momentary-highlight-tag tag)
))
diff --git a/lisp/cedet/semantic/senator.el b/lisp/cedet/semantic/senator.el
index e86658628b..d37345aa2d 100644
--- a/lisp/cedet/semantic/senator.el
+++ b/lisp/cedet/semantic/senator.el
@@ -530,11 +530,11 @@ Some tags such as includes have other reference features."
;; A tag
((semantic-tag-p result)
(semantic-go-to-tag result)
- (switch-to-buffer (current-buffer))
+ (pop-to-buffer-same-window (current-buffer))
(semantic-momentary-highlight-tag result))
;; Buffers
((bufferp result)
- (switch-to-buffer result)
+ (pop-to-buffer-same-window result)
(pulse-momentary-highlight-one-line (point)))
;; Files
((and (stringp result) (file-exists-p result))
next prev parent reply other threads:[~2017-10-17 12:30 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-29 13:23 bug#28645: 26.0.50; semantic-ia-fast-jump jumps to a random place in buffer Constantine
2017-09-29 14:42 ` Dmitry Gutov
2017-09-29 14:57 ` Constantine
2017-09-29 18:18 ` martin rudalics
2017-09-30 14:19 ` Dmitry Gutov
2017-10-03 9:40 ` bug#28645: Status: " Bastian Beischer
2017-10-04 9:03 ` martin rudalics
2017-10-04 11:11 ` Bastian Beischer
2017-10-05 8:09 ` martin rudalics
2017-10-15 23:06 ` Dmitry Gutov
2017-10-16 10:21 ` Bastian Beischer
2017-10-17 8:58 ` martin rudalics
2017-10-17 10:44 ` Dmitry Gutov
2017-10-17 12:30 ` Bastian Beischer [this message]
2017-10-18 23:46 ` Dmitry Gutov
2017-10-19 9:41 ` Bastian Beischer
2017-10-19 10:03 ` Dmitry Gutov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878tgalzx0.fsf@gmail.com \
--to=bastian.beischer@gmail.com \
--cc=28645@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.