From 9458d9be390830806c2541bca93a2ea65081bd48 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Sun, 17 Mar 2013 12:20:32 +0100 Subject: [PATCH] Ranger: texi support. Emacs: fixed texinfo bugs. --- .config/ranger/rifle.conf | 1 + .emacs.d/modes.el | 28 ++++++++++++++++++++-------- .emacs.d/plugins.el | 2 +- .emacs.d/theme.el | 2 +- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.config/ranger/rifle.conf b/.config/ranger/rifle.conf index 5b3e31cc..bcf28970 100644 --- a/.config/ranger/rifle.conf +++ b/.config/ranger/rifle.conf @@ -90,6 +90,7 @@ ext s[wmf]c, has zsnes, X = zsnes "$1" ext nes, has fceux, X = fceux "$1" ext exe = wine "$1" name ^[mM]akefile$ = make +ext texi = "$EDITOR" -- "$@" #-------------------------------------------- # Code diff --git a/.emacs.d/modes.el b/.emacs.d/modes.el index 97049c9a..0606d45c 100644 --- a/.emacs.d/modes.el +++ b/.emacs.d/modes.el @@ -496,7 +496,7 @@ The file that should be compiled." (delete-windows-on "*compilation*")))) -(defcustom texinfo-my-extension-list '(".aux" ".cp" ".cps" ".fn" ".ky" ".log" ".pg" ".toc" ".tp" ".vr" ".vrs") +(defcustom texinfo-my-extension-list '("aux" "cp" "cps" "fn" "ky" "log" "pg" "toc" "tp" "vr" "vrs") "List of known Texinfo exentsions. This list is used by 'texinfo-clean to purge all matching files." :safe 'listp) @@ -532,12 +532,12 @@ but there is no warranty." "Call a PDF viewer for current buffer file. File name should be properly escaped with double-quotes in case it has spaces." (interactive) - (let ( - ;; Master file. - (local-master - (if (not texinfo-my-masterfile) - buffer-file-name - texinfo-my-masterfile))) + (let + ;; Master file. + ((local-master + (if (not texinfo-my-masterfile) + buffer-file-name + texinfo-my-masterfile))) (shell-command (concat texinfo-my-viewer @@ -546,10 +546,22 @@ properly escaped with double-quotes in case it has spaces." "\" &" )) (delete-windows-on "*Async Shell Command*"))) +(defun texinfo-my-menu-update () + "Update texinfo node menu automatically." + (interactive) + (let + ;; Master file. + ((local-master + (if (not texinfo-my-masterfile) + buffer-file-name + texinfo-my-masterfile))) + + (texinfo-multiple-files-update local-master t 8))) + (add-hook 'texinfo-mode-hook (lambda () (setq compilation-scroll-output t) - (local-set-key (kbd "C-c C-b") (lambda (interactive) (texinfo-multiple-files-update 8))) + (local-set-key (kbd "C-c C-b") 'texinfo-my-menu-update) (local-set-key (kbd "C-c C-v") 'texinfo-pdf-view) (local-set-key "\C-c\C-t\C-b" 'texinfo-my-compile))) diff --git a/.emacs.d/plugins.el b/.emacs.d/plugins.el index d2ff434d..947a8761 100644 --- a/.emacs.d/plugins.el +++ b/.emacs.d/plugins.el @@ -150,7 +150,7 @@ ;;============================================================================== ;; Multiple-Cursors ;;============================================================================== -(add-to-list 'load-path "/usr/share/emacs/site-lisp/multiple-cursors") +;; (add-to-list 'load-path "/usr/share/emacs/site-lisp/multiple-cursors") (if (require 'multiple-cursors nil t) (progn (setq mc/list-file "~/.emacs.d/mc-lists.el") diff --git a/.emacs.d/theme.el b/.emacs.d/theme.el index a9aa225a..d7eed051 100644 --- a/.emacs.d/theme.el +++ b/.emacs.d/theme.el @@ -106,7 +106,7 @@ '(("\\<\\(FIXME\\):" 1 font-lock-warning-face prepend) ("\\<\\(TODO\\):" 1 font-lock-warning-face prepend) ("\\<\\(WARNING\\):" 1 font-lock-warning-face prepend)))))) - '(lua-mode-hook prog-mode-hook tex-mode-hook)) + '(lua-mode-hook prog-mode-hook tex-mode-hook texinfo-mode-hook)) ;; Digits regex are not perfect, and may make emacs slow. Sure? ;; ("[^[:digit:][:space:]][[:space:]]*\\(-\\)[[:digit:]]+" 1 font-lock-constant-face) ;; ("\\(0x[[:digit:]a-fA-F]+\\)[^[:alnum:]_]" 1 font-lock-constant-face)