How to stay zoomed in emacs rnw - emacs

I am writing using knitr/sweave and hence working from an rnw file in emacs. When I zoom (c-+) the enhanced buffer only stays zoomed in for a little while before reverting back to standard font size. I have none of these problems using regular tex files or other file types in emacs
Any ideas?

Related

Can I scroll the windows in emacs synchronously?

I mean if I type in c-x 2, then for comparasion I want it to scroll the other window synchronously when I scroll the temporary window.
Try Follow Mode:
M-x follow-mode
Follow mode is a minor mode that makes two windows, both showing the same buffer, scroll as a single tall “virtual window”.
Note that follow mode can only synchronize scrolling windows which content a same file. For scrolling windows with diffrent files synchronously, here's an answer for it.
Follow mode can only synchronize scrolling windows which content a
same file. Does it possible to scrolling windows with diffrent files
synchronously? – 9307420654
There is a minor mode to apply all scrolling commands to all visible
windows in the current frame. Check scroll-all-mode for that. Or else,
if you want to scroll together only 2 windows and only when you use a
specific keystroke, you can do something like a function that scrolls
the current window (scroll-up or scroll-down) and then the “other
window” (i.e., the next one in the list of windows), with
scroll-other-window (with argument '-, i.e., the symbol “minus”, for
scrolling down). Then you can assign this to a keystroke, e.g., C-M-up
/ down.
scroll-all-mode:
Use M-x scroll-all-mode to scroll multiple buffers together.
Very useful for visually comparing two files which are hard to diff
because of lots of trivial changes amongst the changes you are looking
for.
Another solution might be the scroll-all-mode:
M-x scroll-all-mode
Of course, if the windows you want to compare are somehow similar (like different versions of the same file), you probably would like to use a "diff" tool, like M-x ediff-buffers which compares the buffers with colors and keeps them scrolling in sync.

using org-preview-latex-fragment to display math formula in markdown-mode emacs

I'm using emacs to edit markdown file and I wanna display the inline formulas in the markdown mode. I thought org-preview-latex-fragment is a good idea, but there're some problems:
It's slow.
I cannot use the org-preview-latex-fragment directly, I have to launch org-mode at first and until then the org-preview-latex-fragment can be seen and used.
The effect of org-preview-latex-fragment is whole buffer. Sometimes I just want to display the formula at a single point.
And When I'm using org-preview-latex-fragment in markdown-mode, I cannot cancel the preview anyhow.
Is there a workaround or enhancement? Thank you so much!
Not sure about 1, 2 and 4. But for your third question:
If you place your cursor within a LaTeX fragment C-c C-x C-l org-mode will preview just that equation. If you move your cursor to a text area, it will preview the entire buffer.
You can read more about this is the documentation.

Emacs auto-complete popup menu broken

I'm have reinstalled my emacs and now I'm using emacs v24.3.50 with auto-complete v1.4 and popup.el v0.5. Unfortunately the popup "menu" of auto-complete is kinda broken (see attached screenshot).
The different items are not aligned along a commong vertical line [ignore the black overlay, that stems from CEDET and is probably meant to be placed on the right side next to the popup menu; the problem remains when disabling CEDET, so it is not related).
From what I can tell it looks like the extent of this "shift" between lines depends on how much the length of the strings differs. Also, when selecting a different suggestion using the arrow keys the horizontal shift of the lines changes a little (~few pixels) each time the mark is moved one line up/down.
I have uploaded the part of my .emacs.d/init.el that is used for configuring auto-complete here.
Any suggestions on how to fix this?
It appears you are using a proportional font, which breaks the calculation of the left edge of the overlay.
You can try changing the way auto-complete computes the column:
(setq popup-use-optimized-column-computation nil)
You can also change to a fixed width font.
Note that some other completion systems for Emacs can use tooltips instead of overlays, which would avoid this problem.

Emacs scrolling behaviour after changing font size

Emacs23 GUI in Ubuntu 10.04 LTS. I've previously not changed any settings relating to Emacs scrolling behaviour. However, today I noticed a peculiar jumping behaviour when scrolling down in a buffer -- the cursor down key would scroll down as normal to a point and then the next keypress down would sometimes scroll the buffer down instead or sometimes appear to scroll the buffer up and then move the selected line down. It appeared to be more buggy behaviour rather than the normal or predictable jumping of the buffer. If I held down the down cursor the screen would jump and scroll and stutter and then lurch forward and then stutter.
I searched for some answers and tried a few mentioned here, but nothing solved the problem. Only then did I realize that this behaviour is new -- it only appeared after I changed the font in the buffer with C-x C--. When I returned the font to the "default" with C-x C-+, the scrolling behaviour returned to normal (the point moves to the last line, then the next press scrolls a few lines and moves the point up and displays the lines below; this is the default I think and I'm happy with it). Ideas?
Edit: Scrolling up works fine (as expected/default) regardless of font-size changes. Changing the font smaller a second time only makes the scrolling more bizarre.
Edit: Temporary workaround: return to using emacs -nw
Update: Tested on another Ubuntu 10.04 machine (desktop). Launched Emacs 23 and loaded a log file. Maximized Emacs. Help down cursor and scrolling worked as normal -- the cursor gets to the bottom, the buffer scrolls and the cursor moves to the middle of the screen. C-x C-- to reduce font size. Scroll down again. Same strange jerky behaviour, where some jumps don't seem to even move the buffer properly. Enlarge font once, and scrolling returns to normal. Scrolling up is fine regardless of font size. I searched the Emacs bug tracker briefly but did not find a bug which matched.
I've had this problem (or something very similar) for a long time. I finally found something (on EmacsWiki) that's working:
(setq auto-window-vscroll nil)
Without this, the buffer will not scroll down correctly when I've altered the font size, regardless of my scroll settings, which are, for what it's worth,
(setq scroll-conservatively 10)
(setq scroll-margin 7)
Consider filing an Emacs bug: M-x report-emacs-bug.

emacs23 buffer menu font (GTK)

I've recently upgraded to emacs23 (Ubuntu 10.04) and I've managed to get my faces (fonts) all sorted out with relevant .emacs options.
However the one font I can't seem to change is the one used to display the Buffer Menu (i.e. when you CTRL+left-click on a buffer, you get a pop-up menu that lists all open buffers).
The problem is that the font used to display this menu is proportional (not fixed-width) and it makes a big mess of the menu - nothing is lined up vertically, and I often use this to see which buffers hold files that are in common directories. The proportional font has the paths all over the place.
I believe Ubuntu's emacs23 was built with GTK rather than Lucid. Some things I've read seem to indicate that there's no way to set this font within Emacs - that is has to be done externally using GTK config - if this is true, how?
Otherwise, if it can't be done, how tricky is it to recompile emacs23 with Lucid rather than GTK support on Ubuntu? Can it be done easily with "apt-get source"?
I believe I have discovered the answer:
http://www.gnu.org/software/emacs/manual/html_node/emacs/GTK-resources.html
The idea is to create ~/.emacs.d/gtkrc and use the GTK config mechanism to set up alternative styles for emacs' GTK widgets.
$ cat ~/.emacs.d/gtkrc
style "menufont"
{
font_name = "monospace 10" # Pango font name
}
widget "*emacs-menuitem*" style "menufont"
Seems to work well.