Discussion:
Page down does not work and does pasting instead
(too old to reply)
AndreLTR
2013-06-21 20:11:23 UTC
Permalink
Hello,

I'm facing a weird problem that I don't know how to solve. The problem is that C-v which should perform page down does pasting of the last copied content instead. This occurs even after restarting emacs so I guess it may be related to a copied content be stored in an internal hidden buffer somehow. I run under ubuntu 13.04, my .emacs as well as the .bashrc are below. Any help greatly appreciated!

.emacs

;; File name: ` ~/.emacs
;; ---------------------

;; If you need your own personal ~/.emacs
;; please make a copy of this file
;; an placein your changes and/or extension.

;; Copyright (c) 1997-2002 SuSE Gmbh Nuernberg, Germany.

;; Author: Werner Fink, <***@suse.de> 1997,98,99,2002

;; Test of Emacs derivates
;; -----------------------
(if (string-match "XEmacs\\|Lucid" emacs-version)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; XEmacs
;;; ------
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(progn
(if (file-readable-p "~/.xemacs/init.el")
(load "~/.xemacs/init.el" nil t))
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; GNU-Emacs
;;; ---------
;;; load ~/.gnu-emacs or, if not exists /etc/skel/.gnu-emacs
;;; For a description and the settings see /etc/skel/.gnu-emacs
;;; ... for your private ~/.gnu-emacs your are on your one.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(if (file-readable-p "~/.gnu-emacs")
(load "~/.gnu-emacs" nil t)
(if (file-readable-p "/etc/skel/.gnu-emacs")
(load "/etc/skel/.gnu-emacs" nil t)))

;; Custum Settings
;; ===============
;; To avoid any trouble with the customization system of GNU emacs
;; we set the default file ~/.gnu-emacs-custom
(setq custom-file "~/.gnu-emacs-custom")
(load "~/.gnu-emacs-custom" t t)
)
;; end of test emacs derivatives

;; auto save and backup setup
;; disable backup
(setq backup-inhibited t)
;; disable auto save
(setq auto-save-default nil)
;; enable cua-mode
;; (setq cua-mode t)

;; (setq auto-mode-alist
;; (append '(("\\.tex$" . sensitive-mode) ("\\.bib$" . sensitive-mode))
;; auto-mode-alist))
;; I know that string is in my Emacs somewhere!

;; spell options
(setq ispell-program-name "aspell")
(setq-default ispell-program-name "aspell")
(setq-default ispell-extra-args '("--reverse"))
;; ;; dicionario brasileiro ispell
(setq ispell-dictionary "brasileiro")
(global-set-key (kbd "C-c C-x") 'ispell-buffer)

;; keyword configuration
(global-set-key [f5] 'query-replace-in-open-buffers) ;; replace word(s) em todos buffers
(global-set-key [f6] 'search-all-buffers) ;; search word(s) em todos buffers
(global-set-key [f7] 'spell-buffer) ;; spell buffer
(global-set-key [f8] 'spell-region) ;; spell region
(global-set-key [f9] 'spell-word) ;; spell word
;; (global-set-key s-` `)
;; search multiple buffers
(defun my-multi-occur-in-matching-buffers (regexp &optional allbufs)
"Show all lines matching REGEXP in all buffers."
(interactive (occur-read-primary-args))
(multi-occur-in-matching-buffers ".*" regexp))
(global-set-key (kbd "M-s /") 'my-multi-occur-in-matching-buffers)

;; menu customization
(require 'easymenu)
;; (easy-menu-add-item nil '("tools") ["biblatex" biblatex t])
;; font size and type
(set-face-attribute 'default nil :font "Droid Sans Mono-13")

;;; line width
(setq-default fill-column 80)
(add-hook 'text-mode-hook 'turn-on-auto-fill)
;;; frame size and position
(defun arrange-frame (w h x y)
"Set the width, height, and x/y position of the current frame"
(let ((frame (selected-frame)))
(delete-other-windows)
(set-frame-position frame x y)
(set-frame-size frame w h)))
(arrange-frame 125 110 80 80)

;; maximize window
;; winner-mode
;; C-c left-right
(when (fboundp 'winner-mode)
(winner-mode 1))

;; General configuration
;; Text and the such
;; Use colors to highlight commands, etc.
(global-font-lock-mode t)
;; Disable the welcome message
(setq inhibit-startup-message t)
;; Format the title-bar to always include the buffer name
(setq frame-title-format "emacs - %b")
;; Display date and time
(setq display-time-day-and-date 't)
;; Make the mouse wheel scroll Emacs
(mouse-wheel-mode t)
;; Always end a file with a newline
(setq require-final-newline t)
;; Stop emacs from arbitrarily adding lines to the end of a file when the
;; cursor is moved past the end of it:
(setq next-line-add-newlines nil)
;; Flash instead of that annoying bell
(setq visible-bell t)
;; Remove icons toolbar
(if (> emacs-major-version 20)
(tool-bar-mode -1))
;; Use y or n instead of yes or not
(fset 'yes-or-no-p 'y-or-n-p)
(set-input-mode (car (current-input-mode))
(nth 1 (current-input-mode)) 0)
;; (require 'iso-acc)
(setq line-number-mode t)
(setq column-number-mode t)

;; Windows ALT-TAB
(defun switch-to-previous-buffer ()
(interactive)
(switch-to-buffer (other-buffer (current-buffer) 1)))

;;; color interface
;;;;;;;;;;;;Emacs customizations in general;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;(set-foreground-color "black")
(set-background-color "wheat")
(set-cursor-color "red")
;;; Permite usar font-lock sempre
(cond ((fboundp 'global-font-lock-mode)
;; turn on font-lock in all modes that support it
(global-font-lock-mode t)
;; maximum colors
(setq font-lock-maximum-decoration t)))

;; TeX
(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)
;;; AUCTeX
(setq TeX-auto-save t) ; Enable parse on save
(setq TeX-parse-self t) ; Enable parse on load
;; (setq-default TeX-master nil) ; multi-document structure
(setq TeX-PDF-mode t) ; pdflatex default
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode) ; enable math mode default
;; (setq-default TeX-master "master") ; All master files called "master"
(setq TeX-view-program-list '(("Acrobat Reader" "acroread %o")))
(setq TeX-view-program-selection '((output-pdf "Acrobat Reader")))
;; ;; latexmk
(add-hook 'LaTeX-mode-hook (lambda ()
(push
'("Latexmk" "latexmk -pdf %(mode) %s" TeX-run-command nil t
:help "Run Latexmk on file")
TeX-command-list)))
;; Configuracao de teclado
;; traducao automatica de acentos p/ LaTeX
(require 'iso-cvt)

;; beamer frames
(require 'latex-frame-mode)

;; owl mode
;; (setq load-path (append '("/usr/share/emacs/site-lisp/owl/" "/usr/share/emacs/23.4/lisp/org/") load-path)
;;; autoload declaration
(autoload 'owl-mode "owl-mode" "OWL mode." t)
(push (cons "\\.owl" 'owl-mode) auto-mode-alist)

;; Protégé and Jess
;; Jess mode
;; where jess-mode is
;; (setq load-path
;; (cons "/usr/share/emacs/site-lisp" load-path))
;; "auto load" the functions jess-mode and run-jess
(autoload 'jess-mode "jess-mode" "Jess Editing Mode" t nil)
;; jess-mode font lock
(add-hook 'jess-mode-hook #'(lambda()
(turn-on-font-lock)))
;; start 'jess-mode' whenever you visit a Jess source file:
(setq auto-mode-alist
(append auto-mode-alist '(("\\.clp$" . jess-mode))))
;; running a Jess Process Within Emacs
;; jess via a shell script, do something like
(add-hook 'inferior-jess-load-hook #'(lambda ()
(setq inferior-jess-program "/usr/local/bin/jess.sh")))

;; ARDUINO MODE
(setq auto-mode-alist (cons '("\\.\\(pde\\|ino\\)$" . arduino-mode) auto-mode-alist))
(autoload 'arduino-mode "arduino-mode" "Major mode for editing Arduino." t)

;; SML/NJ MODE
;; path names will probably need to be changed
;; (setq load-path (cons "c:/.emacs.d/sml" load-path))
;; (setq sml-mode-info "c:/.emacs.d/sml/sml-mode")
(setq load-path (cons "~/.emacs.d/sml" load-path))
(setq sml-mode-info "~/.emacs.d/sml/sml-mode")
;; load sml-mode setup code
(load "/usr/share/emacs/site-lisp/sml-mode/sml-mode-startup")
(setq sml-mode-info "/usr/info/sml-mode")
(autoload 'sml-mode "sml-mode" "Major mode for editing ML programs." t)
(autoload 'sml "sml-proc" "Run an inferior ML process." t)
(autoload 'cpn-mode "cpn-mode" "CPN-ML interface" t)
(setq auto-mode-alist
(append '(("\\.sig$" . sml-mode)
("\\.cml$" . sml-mode)
("\\.sml$" . sml-mode)) auto-mode-alist))
(setq sml-load-hook
'(lambda() "Highlights." (require 'sml-hilite)))

;; SVN
(require 'psvn)


.bashrc

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi

if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to ***@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi

export EDITOR=emacs

PATH=$PATH:/opt/gams:/opt/cmucl/bin:/opt/MagicDraw_UML/bin:/opt/CPNTools:/opt/Protege:/opt/bin:/opt/android-sdk:/opt/android-sdk/tools:/opt/android-sdk/platform-tools:/opt/smlnj:/opt/smlnj/bin:/opt/smlnj/lib
export PATH

# for frepple
export PATH=/usr/share/xerces-c-3.1.1-x86_64-linux-gcc-3.4:$PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

CLASSPATH=$CLASSPATH:/usr/local/lib/postgres/postgresql-8.4-703.jdbc4.jar:/opt/jade/lib/jade.jar:/opt/jade/lib/commons-codec/commons-codec-1.3.jar:/opt/jade/:/opt/jade/lib/:/opt/jade/lib/jadeTools.jar:/opt/jade/lib/Base64.jar:/opt/jade/lib/http.jar:/opt/Protege_4.1/plugins/beangenerator_4.1.jar:/opt/Protege_4.2_beta/plugins/beangenerator.jar:/opt/JSDAI_Standalone/JSDAI:/opt/JSDAI_Standalone/JSDAI/lib:/opt/jena/lib:/opt/jess:/opt/jess/jess.jar
export CLASSPATH

# /opt/jade/:/opt/jade/lib/:/opt/jade/lib/jadeTools.jar:/opt/jade/lib/Base64.jar:/opt/jade/lib/http.jar

export JAVA_HOME=/usr/lib/jvm/java-7-oracle
export JAVA=$JAVA_HOME:$JAVA
export PATH=$PATH:$JAVA_HOME/bin

PROTEGE_HOME=/opt/Protege_4.1
export PROTEGE_HOME

# JESS_HOME=/opt/Jess
JESS_HOME=/opt/jess
export JESS_HOME
export PATH=$PATH:$JESS_HOME

# MATLAB
export PATH=$PATH:/opt/matlab/bin

PYTHONPATH=$PYTHONPATH:/usr/share/python-support/python-simpy/SimPy
export PYTHONPATH

SVN_EDITOR=/usr/bin/emacs
export SVN_EDITOR

UGII_ROOT_DIR=/opt/ugs060
export UGII_ROOT_DIR
UGS_LICENSE_SERVER=/home/andreltr/CRACK/CAD/UGS/nx6.lic
export UGS_LICENSE_SERVER

# Arduino
export ARDUINO_DIR=/usr/share/arduino
export ARDMK_DIR=/usr
export AVR_TOOLS_DIR=/usr

# devede and dvdauthor
VIDEO_FORMAT=PAL
export VIDEO_FORMAT

# TESSDATA language files
export TESSDATA_PREFIX=/usr/share/tesseract-ocr/


Sincerely,

André Luiz
Michael Heerdegen
2013-06-21 21:38:40 UTC
Permalink
Hi AndreLTR,
Post by AndreLTR
I'm facing a weird problem that I don't know how to solve. The problem
is that C-v which should perform page down does pasting of the last
copied content instead. This occurs even after restarting emacs so I
guess it may be related to a copied content be stored in an internal
hidden buffer somehow. I run under ubuntu 13.04, my .emacs as well as
the .bashrc are below. Any help greatly appreciated!
What does C-h k C-v tell you? That pops up a help buffer describing the
command C-v is bound to, and to which package this command belongs.


Michael.
AndreLTR
2013-06-24 18:26:30 UTC
Permalink
Hello Michael,

Problem solved! Thanks for your help! It was quite simple to solve, once one knows it,

;; enable cua-mode
(setq cua-mode t)

Yours truly,

André Luiz
AndreLTR
2013-06-24 20:38:53 UTC
Permalink
Hello Michael,

After trying it a few more times, the problem was in .emacs initial test for its derivatives,

;; ;; Test of Emacs derivates
;; ;; -----------------------
;; (if (string-match "XEmacs\\|Lucid" emacs-version)
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;; XEmacs
;; ;;; ------
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; (progn
;; (if (file-readable-p "~/.xemacs/init.el")
;; (load "~/.xemacs/init.el" nil t))
;; )
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;; GNU-Emacs
;; ;;; ---------
;; ;;; load ~/.gnu-emacs or, if not exists /etc/skel/.gnu-emacs
;; ;;; For a description and the settings see /etc/skel/.gnu-emacs
;; ;;; ... for your private ~/.gnu-emacs your are on your one.
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; (if (file-readable-p "~/.gnu-emacs")
;; (load "~/.gnu-emacs" nil t)
;; (if (file-readable-p "/etc/skel/.gnu-emacs")
;; (load "/etc/skel/.gnu-emacs" nil t)))
;; ;; Custum Settings
;; ;; ===============
;; ;; To avoid any trouble with the customization system of GNU emacs
;; ;; we set the default file ~/.gnu-emacs-custom
;; (setq custom-file "~/.gnu-emacs-custom")
;; (load "~/.gnu-emacs-custom" t t)
;; )
;; ;; end of test emacs derivatives

Once I commented it out, the problem disappeared.

Best,

André Luiz

Loading...