From 1c1673283186780e6db007f79d4f8aa864660f79 Mon Sep 17 00:00:00 2001 From: Fermin Date: Thu, 1 Apr 2021 21:53:16 +0200 Subject: [PATCH] Add display as a optional parameter for displaying the buffer --- lisp/cedet/semantic.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el index 421597fceb..256b420688 100644 --- a/lisp/cedet/semantic.el +++ b/lisp/cedet/semantic.el @@ -337,21 +337,20 @@ Arguments START and END bound the time being calculated." (define-derived-mode bovinate-mode emacs-lisp-mode "Bovinate" "Bovinate buffer major-mode, giving that the list is generated with -`pp-to-string', the syntax is very similar to a list of Emacs Lisp. +`pp-to-string', the syntax is very similar to a list in Emacs Lisp. This major mode helps with the syntax highlight of some of the symbols.") -(defun bovinate (&optional clear) - "Parse the current buffer. Show output in a temp buffer. +(defun bovinate (&optional clear display) + "Parse the current buffer. Show output in a `bovinate-mode' buffer. Optional argument CLEAR will clear the cache before parsing. -If CLEAR is negative, it will do a full reparse, and also display -the output buffer." +If non-nil DISPLAY will display the buffer `pop-to-buffer'." (interactive "P") (when clear (semantic-clear-toplevel-cache)) (let* ((start (current-time)) (tags (semantic-fetch-tags)) (time-elapse (semantic-elapsed-time start nil)) (bovinate-buffer - (format "*Parser Output from %s buffer*" (buffer-name)))) + (format "*Parser Output from %s*" (buffer-name)))) (message "Retrieving tags took %.2f seconds." time-elapse) (unless (get-buffer bovinate-buffer) (setq bovinate-buffer (get-buffer-create bovinate-buffer))) @@ -359,7 +358,8 @@ the output buffer." (erase-buffer) (insert (pp-to-string tags)) (bovinate-mode) - (goto-char (point-min))))) + (goto-char (point-min))) + (when display (pop-to-buffer bovinate-buffer)))) ;;; Functions of the parser plug-in API -- 2.30.2