How to scroll down on pages in doc-view mode in Emacs? - emacs

I have recently started using doc-view in Emacs, but I am having quite a few problems with it. The main one is that I can't scroll down on pages. I can see the next or previous page using "n" or "p", but the commands to scroll up and down a page, which are supposedly SPACE and DEL, do not work. Well, to be fair, DEL works, but it goes to the previous page rather than scroll up to the bottom of the previous page. The result is that I can only see the top of the pdf pages, but not the bottom parts.
I tried changing the view to continuous, but that doesn't work either. This is what I tried changing:
I did check the customisations for doc-view, but the variables (or options, or whatever they are called) did not appear to me to be the ones which would solve my problem.
More information: I did manage to make SPACE and DEL work at some point, but I don't remember what I did, and I can't get it to work again. I am using Aquamacs.
Any ideas?
By the way, another problem I have is that doc-view causes Aquamacs to sort of crash, meaning it freezes everything, keeps "thinking", and I have to force quit Aquamacs to get it to work again. While this is not my main question, if anyone can tell me anything about this I would also appreciate.
Thanks!
EDIT: I tried what the answer below suggested, it didn't work, kept trying other things/commands, and then C-n and SPACE started working! I quit Aquamacs, started it again, opened a pdf document, and it is back to not working. Can someone please explain what is happening? How can I make this reliable?

(setq doc-view-continuous t)
This lets you scroll the whole document with mouse wheel(not just the current page).

To commands to scroll down are bind to:
C-n, down
not SPC
UPDATE:
SPC is rebound in docview mode. Can't reproduce you issue using GNU Emacs/Linux, can you invoke:
M-x doc-view-scroll-down-or-previous-page

Related

emacs shell tab file name completion never close and multiply - after gdb locking in windows fix

See further below for the original question.
I've used gdb for over a couple of decades, and after an update gdb started defeating c-x-b and preventing windows from being used to view things I wanted to see, while forcing bindings to buffers I didn't care to see. The fix seems to have broken tab completion for shells.
Ah, so how can I to stop gdb from taking control of the buffers/windows/frames layout without breaking something else?
;; fix 'feature' of broken gdb where it takes control of an
;; emacs window, and locks the user out from switching from it
;;
(defun set-window-undedicated-p (window flag)
"Never set window dedicated."
flag)
(advice-add 'set-window-dedicated-p :override #'set-window-undedicated-p)
--- problem in the original post --->
about a year back, after an update, file name completion windows in the shell stopped closing after the completion. I figured this behavior would go away on the next release .. but it never has.
hitting tab -- all good
after completion, then another ls with tab
I can repeat this process until my shell panel is all but crowded out, and emacs fills with completion panels that all contain additional views of the shell.
Is this some kind of new feature that can be turned off? Or is it, as seems more likely, a bug? (How can it have lived for so long!?). Is there a simple way without taking one's hands off the keyboard to, in general, close the completion window so that the screen looks like it did before hitting tab?
[I had to take out the more detailed descriptions of the images because with them, stack exchange complained of unformatted code and wouldn't take the post... there was not even a hint of code in them. Anyway, this should be good enough.]

Emacs minibuffer typing backwards while debugging

Frequently when debugging backtraces pop up in Emacs, the minibuffer stops working properly. Specifically, anything I try typing in it 'types backward'. See the following screenshot (I was trying to type 'haskell' in the minibuffer):
When I quit out of the debug pane, the minibuffer starts typing normally again.
What's causing this? Any suggestions on how I can make it stop?
As nmichaels says, this is possibly related to the bidi-display-reordering setting (which is true by default, see: https://www.gnu.org/software/emacs/manual/html_node/emacs/Bidirectional-Editing.html
Could it be that the abbrev-insert or any other part of your code inserts one of the Unicode characters that change the direction of your text?
The root cause of this is that something makes it so that after inserting a character, Emacs moves point back to before that character. Why? I'm not completely sure, but I have a hunch:
Emacs is very smart, so it probably noticed you're coding in a pure language and figures you probably don't want to change "point" with those nasty side effects, so it resets it back to its initial value for you.

How to make emacs smoothly scroll

I've used emacs for some time, the most inconvenience of emacs for me is that it doesn't scroll smoothly when I'am reading the source code by the mouse's scroll button, though some configuration do thing similarly, it still can't make emacs scroll as vim,browsers,etc. How can I make it, should I hack the source code of emacs, if someone did that, please let me know, it has confused me for such a long time.
Have you tried this: http://www.emacswiki.org/emacs/SmoothScrolling

Emacs - cursor misalignment, and disappearing text

I've been using a copy of emacs (in a Debian VM I ssh to with putty) at work for a couple of months now, and up until now everything has been working brilliantly... but this morning I'm trying to edit a file in shell-script-mode, and am seeing some weird behavior with text around the cursor.
Basically, when I type the following ( [ ] represents my cursor):
export DATABASE[]
After I've typed the first few characters of the variable name the export statement disappears and the variable name aligns to the left margin, and all I end up seeing is (with the cursor out in the wilderness):
DATABASE []
If I then hit CTRL-L, the screen refreshes, and I see the text as it should be displayed... until I start typing, and then the buffer start acting strangly again (characters disappearing, moving, cursor ending up in the wrong place, etc)
I've not, to my knowledge, added anything to my .emacs file since this last worked as I expect it to, so I'm at a loss as to what could be happening here. It doesn't seem specific to sh-mode either - I've tested a few other file types and observed similar strange behavior. Are there any emacs afficianados out there who might be able to point me in the right direction to figure out what's wrong here?
Thanks in advance
I'm not sure what to suggest, but this sounds awfully like an issue with the terminal: I suspect that Emacs redraws the current line whenever it changes and I guess it tries to do so incrementally. If something's got out of whack with your terminal, then it seems quite plausible that the current word would get written at the start of the line (all Emacs sent) and your cursor would get abandoned "out in the wilderness" :-)
Obviously, this is a new change. Since it doesn't sound like the sort of issue that would be caused by Elisp configurations in your .emacs, you should check whether you've recently upgraded one of
PuTTY
Emacs version
SSH version (unlikely...)
Then maybe the relevant tool will have something in the changelog (which maybe you can disable via a config?)
One thing you could check: you say this isn't just SH-mode. Is it "any mode with syntax highlighting"? Maybe Emacs just sends over the wire the text with the current colour?
I had a similar problem of disappearing text using PuTTY / Emacs / Remote AWS Ubuntu when running ABCL LISP in a shell window.
The solution was: I had changed my foreground and background font colors (essentially reversed) in PuTTY but had neglected to change the bold fonts, so they were disappearing into the background.

Emacs mouse focus stuck in one frame

Twice in the past two days, I've had a problem with my emacs sessions. Somehow emacs is keeping the focus within one frame. So, if I mouse over another frame and click in it, the cursor in the new frame stays put and the cursor in frame 1 moves as if I clicked in the corresponding position in it. Same happens with mouse-wheel scrolling. But not keyboard input.
Killing the hogging frame just causes another frame to become the hoarder.
My solution yesterday was to quit and restart emacs.
Some googling pointed me towards the variable focus-follows-mouse, but that appears to be set correctly (i.e. "t").
Any ideas what caused it and how to reset it?
(I'm using Ubuntu intrepid's package of emacs 22.2-0ubuntu2.)
I have
(setq focus-follows-mouse t)
(setq mouse-autoselect-window t)
in my .emacs file, and find that this makes focus follow mouse work correctly. Maybe there's something else in your config that's changing emacs' behaviour, do you have your elisp in version control? Can you identify when this started happening, and look at changes to your elisp around then ?
Try starting emacs with --no-init-file and seeing if the undesired behaviour persists.
I have discovered that switching to another tty (eg crtl-alt-1) then back to whatever tty you were on before will reset your focus.
Not a general solution, but at least you don't have to kill X (which is what I've been doing until now).