[OS X Emacs] Help getting rid of Toolbar Preview icon; thinner titlebar wanted

Christopher Menzel cmenzel at tamu.edu
Fri Sep 12 16:56:26 EDT 2008


On Sep 11, 2008, at 3:22 PM, David Reitter wrote:
> On 11 Sep 2008, at 15:52, Christopher Menzel wrote:
>>
>> I can't for the life of me figure out how to get rid of the  
>> "Preview Here" toolbar icon when I'm editing a LaTeX file in  
>> Aquamacs Emacs.  I have toggled all of the toolbar icon options in  
>> the Aquamacs Options group to off and have searched fruitlessly  
>> among the LaTeX and Preview options, but this one icon remains: http://cmenzel.org/cp.tiff 
>>  .
>
> Well that's some AUCTeX stuff where they probably don't use a normal  
> keymap to define the tool bar.
>
> To come up with an answer, I did this on the emacs lisp source code  
> (comes with the Aquamacs .app bundle, in Resources/site-lisp):
>
> grep "Preview Here" -r *
>
> Now I saw where this icon was defined (prv-emacs.el):
>
> (defun preview-mode-setup ()
>  "Setup proper buffer hooks and behavior for previews."
>  (set (make-local-variable 'desktop-save-buffer)
>       #'desktop-buffer-preview-misc-data)
>  (add-hook 'pre-command-hook #'preview-mark-point nil t)
>  (add-hook 'post-command-hook #'preview-move-point nil t)
>  (easy-menu-add preview-menu LaTeX-mode-map)
>  (unless preview-tb-icon
>    (setq preview-tb-icon (preview-filter-specs preview-tb-icon- 
> specs)))
>  (when preview-tb-icon
>    (define-key LaTeX-mode-map [tool-bar preview]
>      `(menu-item "Preview Here" preview-at-point
> 		  :image ,preview-tb-icon
> 		  :help "Preview on/off at point")))
>
> Ah, so there's a convenient `preview-tb-icon' variable, but we can't  
> just set it to nil.
>
> So, let's try to remove the icon after it was added.  That's really  
> easy:
>
> (define-key LaTeX-mode-map [tool-bar preview]  nil)
>
> Now we just need to do this after entering latex-mode:
>
> (add-hook 'latex-mode-hook (lambda ()
> 	(define-key LaTeX-mode-map [tool-bar preview]  nil)))
>
> The last bit is untested - try it out!

Thanks for the analysis.  But...*blush*...the following is all I need:

>> Also, in earlier versions (I'm using 1.4 after trying the 1.5 RC),  
>> not only was I able (somehow) to get rid of this icon, I was also  
>> able to get the titlebar to be nice and thin, as in a Terminal.app  
>> window.  What I get in HTML and other modes is this one: http://cmenzel.org/FatTitleBar.tiff 
>>  , with a lot of grey between the window buttons and the top of the  
>> text area that makes the titlebar twice as thick as it needs to be.
>
> When I toggle my tool bar with the toolbar toggle button, I get what  
> is shown in the attached screenshot.  Looks good to me.
> You seem to be taking out all of the icons instead, is that right?

DOH!  Sometimes, jumping back and forth between Linux and OS X as I  
do, I forget about the easiest solutions...

-chris




More information about the MacOSX-Emacs mailing list