1

I notice there is a strange box-shaped icon in the toolbar in the AUCTeX mode (circled in the picture below).

Strange toolbar icon in AUCTeX

It should be a toolbar separator (for example, on Linux):

On Linux platform

I am using GNU Emacs 26.1 with AUCTeX 12.1.1 on macOS 10.13.6. This problem seems to have existed for many years. The exact same problem was reported in 2011. Does anyone know what causes this problem and how to fix it?

Huihui Li
  • 13
  • 3
  • Paste `(insert (propertize " " 'display (eval tool-bar-separator-image-expression)))` into the `*scratch*` buffer, place point behind the last closing parenthesis and press `C-j`. That should insert the separator image at point. Call `C-h v` `tool-bar-separator-image-expression` to get the relative file path to the separator image. For me that is `separator.xbm`. Call `C-h v image-load-path` to get the completion to an absolute path (for me: `/usr/share/emacs/26.1/etc/images/`). Search there for the image and look what you get.Compare the appearance in Emacs and in some external image program. – Tobias Jan 11 '19 at 16:36
  • @Tobias Thank you. I did what you suggested. Emacs shows the separator image (in the `*scratch*` buffer) as a thin vertical bar which is exactly it should be (see [the screenshot](https://imgur.com/TNSqosG)). The separator image files (in `/Applications/Emacs.app/Contents/Resources/etc/images/` with names `separator.pbm` and `separator.xpm`) show exactly the same as the one shown from executing `(insert (propertize " " 'display (eval tool-bar-separator-image-expression)))`. But it is not like the one shown on the toolbar. – Huihui Li Jan 12 '19 at 05:57
  • @Tobias I do notice that AUCTeX carries a separator image itself (for me, it is located at `~/.emacs.d/elpa/auctex-12.1.1/images/sep.xpm`). But this image also shows a thin vertical bar when I view it by external image program. – Huihui Li Jan 12 '19 at 06:02
  • Go to the buffer `1.tex` and type `M-: (nth 7 (cdr tool-bar-map))` and finish with ``. That should output the binding for the separator. (We should have done this first.) Normally it is just `(separator-1 "--")`. (For that reason I asked the previous questions.) But in auctex it is a real noop-binding like `(separator menu-item "Separator" (lambda nil (interactive) t) :image (image :type xpm :file "/home/naehring/.emacs.d/elpa/auctex-12.1.1/images/sep.xpm" :scale 1) :help "" :enable nil)`. – Tobias Jan 12 '19 at 15:06
  • @Tobias Running that line in the `1.tex` buffer yields `(separator menu-item "Separator" (lambda nil (interactive) t) :image (image :type xpm :file "/Users/huihui/.emacs.d/elpa/auctex-12.1.1/images/sep.xpm" :scale 1) :help "" :enable nil)` ([the screenshot](https://imgur.com/aN3NxYG)) – Huihui Li Jan 12 '19 at 15:06
  • Could you go to buffer `1.tex` and try `M-: (setf (nth 7 (cdr tool-bar-map)) '(separator-1 "--"))`? – Tobias Jan 12 '19 at 15:09
  • @Tobias The separator icon disappears after running `(setf (nth 7 (cdr tool-bar-map)) '(separator-1 "--"))`. ([screenshot](https://imgur.com/hPuo5QG)) – Huihui Li Jan 12 '19 at 15:25
  • Try with separator instead of separator-1. – Tobias Jan 12 '19 at 15:43
  • Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/88178/discussion-between-huihui-li-and-tobias). – Huihui Li Jan 12 '19 at 15:47

1 Answers1

0

Huihui Li pointed out in a discussion that separators are not shown in the standard tool bars of GNU Emacs 26.1 with AUCTeX 12.1.1 on macOS 10.13.6.

The strange AUCTeX tool bar separator icon comes from the XEmacs compatibility package toolbarx.

You can turn off this icon by unchecking the [separator nil] entry in the customization menu of TeX-bar-LaTeX-buttons (e.g., call M-x customize-option RET TeX-bar-LaTeX-buttons RET and uncheck [separator nil] in the appearing customization menu, afterwards press Apply and Save).

Tobias
  • 32,569
  • 1
  • 34
  • 75