elisp - emacs hangs on viewing pdf -


when view pdf in emacs in default version(emacs -q), doc-view works perfectly. in customized version of emacs, opening smallest of pdfs hangs emacs. can possible reason this?

edit: used bisection , found linum-mode producing problems. once put off, docs opening correctly without delay whatsoever. there way off linum-mode doc-view mode?

edit: higly unorganised, i'm posting .emacs here.

;c-x c-q read mode enabled or disabled  ;full screen on startup start  (defun fullscreen ()        (interactive)        (x-send-client-message nil 0 nil "_net_wm_state" 32                  '(2 "_net_wm_state_fullscreen" 0))) (fullscreen)   (setq initial-scratch-message "rough buffer.") (global-visual-line-mode t)  ;needed emacs knows how display dvi(basically binary file generated latex converted pdf) files.device independent file format ;c-c c-v generate pdf  (setq inhibit-splash-screen 0) (global-linum-mode t)  ;c++ customizations  (add-to-list 'auto-mode-alist '("\\.h\\'" . c++-mode))    ;.h files treated c files instaed of c++ in emacs. remove it!  (require 'cl)  (defun file-in-directory-list-p (file dirlist)   "returns true if file specified contained within 1 of directories in list. directories must exist."   (let ((dirs (mapcar 'expand-file-name dirlist))         (filedir (expand-file-name (file-name-directory file))))     (and      (file-directory-p filedir)      (member-if (lambda (x) ; check directory prefix matches                   (string-match (substring x 0 (min(length filedir) (length x))) filedir))                 dirs))))  (defun buffer-standard-include-p ()   "returns true if current buffer contained within 1 of directories in include environment variable."   (and (getenv "include")        (file-in-directory-list-p buffer-file-name (split-string (getenv "include") path-separator))))  (add-to-list 'magic-fallback-mode-alist '(buffer-standard-include-p . c++-mode))   ;indentation customization(replacing tabs 4 spaces) (setq-default c-basic-offset 4                   tab-width 4                   indent-tabs-mode t)  ;indentating curly braces(the braces don't indent inner code)  (setq c-default-style "linux"           c-basic-offset 4)  ;handling uncommon file extensions  (add-to-list 'auto-mode-alist '("\\.ext\\'" . c-mode))  ;c++ customizations end (show-paren-mode 1) ;highlighting matching parenthses (global-font-lock-mode 1)   (defun delete-selected-region ()   "delete selected region"   (interactive)   (delete-region (point) (mark)))  (global-set-key (kbd "c-z") 'delete-selected-region)  ;selected region deletion using  c-z (this helps prevent accidental iconification of emacs due c-z) end  (show-paren-mode 1) ;highlighting matching parenthses (transient-mark-mode t) (global-font-lock-mode 1) ;line duplication using c-d start  (defun line-duplicate ()   "line-duplication"   (interactive)   (setq position (point))   (command-execute (kbd "c-a c-k c-k c-y c-y"))   (goto-char position) )  (global-set-key (kbd "c-m-d") 'line-duplicate)  ;can use  ;(global-set-key "\c-d" "\c-s-backspace\c-y\c-y")  ;line duplication using c-d end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;      ;images display  ;; -- laoding images in org mode ;; enable image mode first (setq-default iimage-mode t)   ;splitted window switching c-tab  (global-set-key (kbd "<c-escape>") 'other-window) ;       ;hiding code(hiding contents of function)c-c @ c-h , c-c @ c-s  (add-hook 'c-mode-common-hook #'hs-minor-mode) (add-hook 'c++-mode-common-hook #'hs-minor-mode) (add-hook 'java-mode-common-hook #'hs-minor-mode)   ;(setq-default hs-minor-mode 1) (global-set-key (kbd "c-c c-h") (kbd "c-c @ c-h"))         ;;hiding block of code (global-set-key (kbd "c-c c-r") (kbd "c-c @ c-s"))         ;;revealing block of code   ;black screen (invert-face 'default)   ;removing ststus line ;(setq-default mode-line-format nil) ;(insert-image (create-image "~/car.jpg"))  (setq-default fill-column 72) (setq auto-fill-mode 1) (setq major-mode 'text-mode)   ;no backup files (setq make-backup-files nil)    (blink-cursor-mode -1) (set-scroll-bar-mode 'right)  ;disables scroll bar ;(if (fboundp 'scroll-bar-mode) (scroll-bar-mode 1))   (auto-image-file-mode 1)   (setq hippie-expand-try-functions-list       '(;try-expand-all-abbrevs     yas/hippie-try-expand     try-complete-file-name     try-expand-list     ;; fixme function causing unexpected point movement.     ;; try-expand-dabbrev-visible     try-expand-dabbrev-all-buffers     try-expand-dabbrev-from-kill     try-complete-lisp-symbol-partially     try-complete-lisp-symbol     try-expand-all-abbrevs     ))  ;disabling tool bar (tool-bar-mode -1) (put 'upcase-region 'disabled nil)      ;qt customizations  (make-face 'qt-keywords-face)   (set-face-foreground 'qt-keywords-face "blueviolet")   (font-lock-add-keywords 'c++-mode '(("\\<q_object\\>" . 'qt-keywords-face)))   (font-lock-add-keywords 'c++-mode '(("\\<signal\\|slot\\>" . 'qt-keywords-face)))   (font-lock-add-keywords 'c++-mode '(("\\<q[a-z3][a-za-z0-9]*" . 'qt-keywords-face)))  (setq auto-mode-alist (cons '("\\.pro$" . makefile-mode) auto-mode-alist))   ;  ;hideshow: hide initial blocks of comments (load-library "hideshow") (add-hook 'c++-mode-hook       (lambda () (hs-minor-mode 1)) ) (add-hook 'c-mode-hook         (lambda () (hs-minor-mode 1)) ) (add-hook 'makefile-mode-hook  (lambda () (hs-minor-mode 1)) ) (add-hook 'css-mode-hook       (lambda () (hs-minor-mode 1)) ) (add-hook 'java-mode-hook       (lambda () (hs-minor-mode 1)) ) (add-hook 'python-mode-hook       (lambda () (hs-minor-mode 1)) ) (add-hook 'sh-mode-hook       (lambda () (hs-minor-mode 1)) ) (setq hs-minor-mode-hook  'hs-hide-initial-comment-block)   ;  ;cool theme visit m-x color-theme-select ;(color-theme-robin-hood)  ;(set-face-background 'font-lock-comment-face "red")  ;(require 'color-theme) ;(color-theme-initialize) ;(color-theme-whateveryouwant)  (set-background-color "black") (set-border-color "white")  (setq font-lock-maximum-decoration t)   ;; ;font size   (set-face-attribute 'default nil :height 86)  ;; ;font size ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;    ;miscellaneous (setq max-mini-window-height .25) (which-function-mode)     ;the perfect terminal ansi-term ;(desktop-save-mode  ;a couple of productivity incrementers (defalias 'rs 'replace-string) (defalias 'qr 'query-replace) (defalias 'rr 'replace-regexp) (defalias 'yes-or-no-p 'y-or-n-p) ; y or n enough (defalias 'qrr 'query-replace-regexp) (defalias 'g 'goto-line) (defalias 'bd 'bookmark-delete) (defalias 'acm 'auto-complete-mode) (defalias 'hsa 'hs-show-all) (defalias 'hha 'hs-hide-all) (defalias 'sb 'speedbar) (defalias 'gfr 'gtags-find-rtag)  ;(setq texpdf-mode t) ;(add-hook 'doc-view-mode-hook 'auto-revert-mode) (custom-set-variables   ;; custom-set-variables added custom.   ;; if edit hand, mess up, careful.   ;; init file should contain 1 such instance.   ;; if there more one, won't work right.  '(ansi-color-names-vector ["#242424" "#e5786d" "#95e454" "#cae682" "#8ac6f2" "#333366" "#ccaa8f" "#f6f3e8"])  '(custom-enabled-themes (quote (wheatgrass)))  '(custom-safe-themes (quote ("de4403b9a108d38f35a1717b43a8ebe40410dd44b6324e3bc1adfdb658a8004c" default))))  ;insert date using emacs (defun insertdate ()   (interactive)   (insert (format-time-string "%d-%m-%y"))) (global-set-key [(f5)] 'insertdate)    (add-to-list 'load-path "~/.emacs.d/") (require 'auto-complete-config) (add-to-list 'ac-dictionary-directories "~/.emacs.d//ac-dict") (ac-config-default)   (load-file "~/.emacs.d/bufferswitch.el")  (defun encrypt ()   (interactive)   (epa-encrypt-region (point-min) (point-max) nil nil nil) )  (global-set-key (kbd "c-c c-e") 'encrypt)   (defun decrypt ()   (interactive)   (epa-decrypt-region (point-min) (point-max)) )  (global-set-key (kbd "c-c c-d") 'decrypt)    (defun terminal-come ()   (interactive)   (command-execute (kbd "c-x 2 esc 14 c-x ^ c-<escape>"))   (if (equal (get-buffer "*ansi-term*") nil) (command-execute (kbd "m-x ansi-term ret")) (switch-to-buffer "*ansi-term*")) ) (global-set-key (kbd "c-x c-c") 'terminal-come)    (setq ido-enable-flex-matching t) (setq ido-everywhere t) (ido-mode 1)   (setq locale-coding-system 'utf-8) (set-terminal-coding-system 'utf-8-unix) (set-keyboard-coding-system 'utf-8) (set-selection-coding-system 'utf-8) (prefer-coding-system 'utf-8)   ;; 1- if remove-if not found, add here (require 'cl)  ;; 2- in emacs 23, had remove "b" "lambda (b)"  (require 'cl)  (when (require 'tabbar nil t)    (setq tabbar-buffer-groups-function          (lambda (b) (list "all buffers")))    (setq tabbar-buffer-list-function          (lambda ()            (remove-if             (lambda(buffer)               (find (aref (buffer-name buffer) 0) " *"))             (buffer-list))))    (tabbar-mode))   (setq tabbar-buffer-groups-function           (lambda ()             (list "all"))) (require 'tabbar) (tabbar-mode 1) (global-set-key [(c-s-iso-lefttab)] 'tabbar-backward) (global-set-key (kbd "c-<tab>") 'tabbar-forward)  (load-file "~/.emacs.d/commoncppfunctions.el")  (set-face-attribute 'default nil :height 94)  (add-hook 'asm-mode-set-comment-hook '(lambda () (setq asm-comment-char ?#)))    (menu-bar-mode -1) ;(setq mode-line-format nil)  ;bookmarks (global-set-key (kbd "c-c c-z") 'bookmark-set) (global-set-key (kbd "c-c c-a") 'bookmark-jump) (global-set-key (kbd "c-c c-q") 'bookmark-delete) (global-set-key (kbd "c-`") 'shell-command) (global-set-key (kbd "c-!") 'gtags-pop-stack)  (defadvice bookmark-jump (after bookmark-jump activate)   (let ((latest (bookmark-get-bookmark bookmark)))     (setq bookmark-alist (delq latest bookmark-alist))     (add-to-list 'bookmark-alist latest)))  (display-time-mode 1)  ;highlighting  todo,fixme, bug  (add-hook 'prog-mode-common-hook                (lambda ()                 (font-lock-add-keywords nil                  '(("\\<\\(fixme\\|todo\\|bug\\):" 1 font-lock-warning-face t)))))  (setq load-path (cons ".emacs.d/" load-path)) (autoload 'gtags-mode "gtags" "" t)  (setq term-default-bg-color "#000000") (setq term-default-fg-color "#7cfc00")  (add-hook 'prog-mode-hook (lambda () (gtags-mode 1))) (scroll-bar-mode -1)   (defun auto-recompile-emacs-file ()   (interactive)   (when (and buffer-file-name (string-match "\\.emacs" buffer-file-name))     (let ((byte-file (concat buffer-file-name "\\.elc")))       (if (or (not (file-exists-p byte-file))               (file-newer-than-file-p buffer-file-name byte-file))           (byte-compile-file buffer-file-name)))))  (add-hook 'after-save-hook 'auto-recompile-emacs-file)  (require 'color-theme) (color-theme-initialize) ;(setq color-theme-is-global t) ;(color-theme-arjen)   ;don't fiddle this. added custom, if reused, in syatem, might have deleted. (custom-set-faces   ;; custom-set-faces added custom.   ;; if edit hand, mess up, careful.   ;; init file should contain 1 such instance.   ;; if there more one, won't work right.  '(default ((t (:inherit nil :stipple nil :background "black" :foreground "green" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 90 :width normal :foundry "unknown" :family "dejavu sans mono"))))  '(compilation-info ((((class color) (min-colors 88) (background dark)) (:foreground "red" :weight bold))))  '(cursor ((t (:background "red"))))  '(custom-comment ((((class grayscale color) (background dark)) (:background "dim gray" :height 110))))  '(custom-state ((((class color) (background dark)) (:foreground "pink1"))))  '(font-lock-comment-delimiter-face ((default (:inherit font-lock-comment-face :height 97)) (((class color) (min-colors 16)) nil)))  '(font-lock-comment-face ((((class color) (min-colors 88) (background dark)) (:foreground "chocolate1" :height 90))))  '(font-lock-function-name-face ((((class color) (min-colors 88) (background dark)) (:foreground "lightskyblue" :height 96))))  '(font-lock-preprocessor-face ((t (:inherit font-lock-builtin-face :weight semi-bold))))  '(font-lock-string-face ((((class color) (min-colors 88) (background dark)) (:foreground "lightsalmon" :height 97))))  '(font-lock-variable-name-face ((((class color) (min-colors 89)) (:foreground "midnight blue"))))  '(highlight ((((class color) (min-colors 89)) (:background "azure3" :foreground "white"))))  '(ido-only-match ((((class color)) (:foreground "khaki4"))))  '(mode-line ((((class color) (min-colors 88)) (:background "red" :foreground "black" :box (:line-width -1 :color "blue" :style released-button)))))  '(region ((((class color) (min-colors 89)) (:background "sienna4" :foreground "white"))))  '(tool-bar ((default (:foreground "black" :box (:line-width 3 :style released-button))) (((type x w32 ns) (class color)) (:background "blue")))))  (set-face-foreground 'default "green") (column-number-mode) 

(add-hook 'doc-view-mode-hook   (lambda ()     (linum-mode -1)   )) 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -