I have configured forward and backward search between Emacs and Skim (MacOS) for my LaTeX work. While the search works fine, every time I do an backward search from Skim, an additional shell buffer opens in Emacs besides my .tex file. This is somewhat annoying and I would like to avoid it if possible. My backward search configuration as suggested on the Skim website is as follows:

;; Auto-raise Emacs on activation
(defun raise-emacs-on-aqua() 
(shell-command "osascript -e 'tell application \"Emacs\" to activate' &"))
(add-hook 'server-switch-hook 'raise-emacs-on-aqua)

How can I avoid the shell buffer from opening when I do backward search from Skim?

  • Using a generic version of Emacs.app built --with-ns on OSX, all I had to do was ensure that the path to my chosen version of emacsclient was correct in the preferences section of Skim and run (server-start) in Emacs. Then, I just do a CMD-SHIFT-Click on the PDF file in Skim at whatever line was desired. I did not need any hooks to raise Emacs .... As such, it would be helpful if you provide your relevant details, such as Emacs version, MacOS version, and how you have configured Skim; and, what type of buffer is being opened; i.e., what is the name of the buffer and all its contents? – lawlist Sep 24 '19 at 7:31
  • Thanks. I removed the auto-raise command suggested by Skim and it works fine for me now. It appears that Skim has not updated the suggestions and the above command is unnecessary now. I was using Emacs Mac Port 26.3 by the way on Mojave. – latex_guy Sep 24 '19 at 8:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.