*** other stuff
#+BEGIN_SRC emacs-lisp
- ;;; * Specify printing format
- (setq ps-paper-type 'a4)
-
- ;;; * Set ispell dictionary
- (setq ispell-dictionary "english")
-
- ;;; * Set Shell for M-| command
- (setq shell-file-name "/bin/bash")
-
- ;;; * Set Shell used by TeX
- (setq tex-shell-file-name "/bin/bash")
-
- ;;; * Set grep command options
- (setq grep-command "grep -i -nH -e ")
-
- ;;; * Confirm quit
- (setq confirm-kill-emacs 'yes-or-no-p)
-
- ;;; * Ignore case when completing file names
- (setq read-file-name-completion-ignore-case t)
-
- ;;; * Highlight parenthesis pairs
- (show-paren-mode 1)
-
- ;;; * Blinking parenthesis
- (setq blink-matching-paren-distance nil)
-
- ;;; * Highlight text between parens
- (setq show-paren-style 'expression)
-
- ;;; * Use buffer nane as frame title
- (setq frame-title-format "%b - emacs")
-
- ;;; * Completion in mini-buffer
- (icomplete-mode t)
-
- ;;; * Stack minibuffers
- (setq enable-recursive-minibuffers t)
-
- ;;; * RecentFiles http://www.emacswiki.org/emacs/RecentFiles
- (require 'recentf)
- (recentf-mode 1)
- (setq recentf-max-menu-items 42)
- (global-set-key "\C-cr" 'recentf-open-files)
+ ;;; * Specify printing format
+ (setq ps-paper-type 'a4)
+
+ ;;; * Set ispell dictionary
+ (setq ispell-dictionary "english")
+
+ ;;; * Set Shell for M-| command
+ (setq shell-file-name "/bin/bash")
+
+ ;;; * Set Shell used by TeX
+ (setq tex-shell-file-name "/bin/bash")
+
+ ;;; * Set grep command options
+ (setq grep-command "grep -i -nH -e ")
+
+ ;;; * Confirm quit
+ (setq confirm-kill-emacs 'yes-or-no-p)
- ;;; * ipcalc https://github.com/dotemacs/ipcalc.el
- (require 'ipcalc)
+ ;;; * Ignore case when completing file names
+ (setq read-file-name-completion-ignore-case t)
+
+ ;;; * Highlight parenthesis pairs
+ (show-paren-mode 1)
+
+ ;;; * Blinking parenthesis
+ (setq blink-matching-paren-distance nil)
+
+ ;;; * Highlight text between parens
+ (setq show-paren-style 'expression)
+
+ ;;; * Use buffer nane as frame title
+ (setq frame-title-format "%b - emacs")
+
+ ;;; * Completion in mini-buffer
+ (icomplete-mode t)
+
+ ;;; * Stack minibuffers
+ (setq enable-recursive-minibuffers t)
+
+ ;;; * RecentFiles http://www.emacswiki.org/emacs/RecentFiles
+ (require 'recentf)
+ (recentf-mode 1)
+ (setq recentf-max-menu-items 42)
+ (global-set-key "\C-cr" 'recentf-open-files)
+
+ ;;; * ipcalc https://github.com/dotemacs/ipcalc.el
+ (require 'ipcalc)
+
+ ;;; * Some nice functions
+ ;;(blink-matching-paren 1)
+ ;;(paren-activate)
+ (defun insert-date ()
+ "Insert the current date"
+ (interactive)
+ (insert-string (format-time-string "%B %e, %Y")))
+ (defun insert-timestamp ()
+ "Insert the current timestamp"
+ (interactive)
+ (insert-string (format-time-string "%a %b %e %Y") " " (or (and (boundp 'user-full-name) user-full-name) (user-full-name))" <" (getenv "EMAIL") ">" ))
+
+ ;; eshell-here: Thanks to Howard Abrahams:
+ ;; http://www.howardism.org/Technical/Emacs/eshell-fun.html
+ ;;
+ ;; modified because current version lacks function have window-total-height.
+
+ (defun eshell-here ()
+ "Opens up a new shell in the directory associated with the
+ current buffer's file. The eshell is renamed to match that
+ directory to make multiple eshell windows easier."
+ (interactive)
+ (let* ((parent (if (buffer-file-name)
+ (file-name-directory (buffer-file-name))
+ default-directory))
+ ;; (height (/ (window-total-height) 3))
+ (name (car (last (split-string parent "/" t)))))
+ ;; (split-window-vertically (- height))
+ (split-window-vertically '-10)
+ (other-window 1)
+ (eshell "new")
+ (rename-buffer (concat "*eshell: " name "*"))
+
+ (insert (concat "ls"))
+ (eshell-send-input)))
+
+ (define-key global-map "\C-c!" 'eshell-here)
+
+ (defun eshell/x ()
+ (insert "exit")
+ (eshell-send-input)
+ (delete-window))
- ;;; * Some nice functions
- ;;(blink-matching-paren 1)
- ;;(paren-activate)
- (defun insert-date ()
- "Insert the current date"
- (interactive)
- (insert-string (format-time-string "%B %e, %Y")))
- (defun insert-timestamp ()
- "Insert the current timestamp"
- (interactive)
- (insert-string (format-time-string "%a %b %e %Y") " " (or (and (boundp 'user-full-name) user-full-name) (user-full-name))" <" (getenv "EMAIL") ">" ))
- ;; eshell-here: Thanks to Howard Abrahams:
- ;; http://www.howardism.org/Technical/Emacs/eshell-fun.html
- ;;
- ;; modified because current version lacks function have window-total-height.
- (defun eshell-here ()
- "Opens up a new shell in the directory associated with the
- current buffer's file. The eshell is renamed to match that
- directory to make multiple eshell windows easier."
+ (defun eshell/ssh (&rest args)
+ "Secure shell"
+ (let ((cmd (eshell-flatten-and-stringify
+ (cons "ssh" args)))
+ (display-type (framep (selected-frame))))
+ (cond
+ ((and
+ (eq display-type 't)
+ (getenv "STY"))
+ (send-string-to-terminal (format "\033]83;screen %s\007" cmd)))
+ ((eq display-type 'x)
+ (eshell-do-eval
+ (eshell-parse-command
+ (format "rxvt -e %s &" cmd)))
+ nil)
+ (t
+ (apply 'eshell-exec-visual (cons "ssh" args))))))
+
+ (defun goto-match-paren (arg)
+ "Go to the matching parenthesis if on parenthesis, otherwise insert %.
+ vi style of % jumping to matching brace."
+ (interactive "p")
+ (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
+ ((looking-at "\\s\)") (forward-char 1) (backward-list 1))
+ (t (self-insert-command (or arg 1)))))
+ (global-set-key "%" 'goto-match-paren)
+
+ ;;(move-overlay hl-line-overlay
+ ;; (line-beginning-position) (1+ (line-end-position))
+ ;; (current-buffer)))))
+
+ ;; (set-face-background-pixmap 'default "~/.xemacs/xemacs-bg.xpm")
+ (set-foreground-color "green")
+ (set-background-color "black")
+
+ ;; pos1: goto start of line, start of screen, start of buffer
+ ;; end: goto end of line, end of screen, end of buffer
+
+ (global-set-key '[(home)] 'chb-home)
+ (global-set-key '[(end)] 'chb-end)
+ ;;
+ (defun chb-home ()
(interactive)
- (let* ((parent (if (buffer-file-name)
- (file-name-directory (buffer-file-name))
- default-directory))
- ;; (height (/ (window-total-height) 3))
- (name (car (last (split-string parent "/" t)))))
- ;; (split-window-vertically (- height))
- (split-window-vertically '-10)
- (other-window 1)
- (eshell "new")
- (rename-buffer (concat "*eshell: " name "*"))
-
- (insert (concat "ls"))
- (eshell-send-input)))
-
- (define-key global-map "\C-c!" 'eshell-here)
+ (setq zmacs-region-stays t)
+ (if (not (bolp))
+ (beginning-of-line)
+ (if (eq this-command last-command)
+ (cond
+ ((not (= (point) (window-start)))
+ (move-to-window-line 0)
+ (beginning-of-line))
+ (t
+ (goto-char (point-min)))))))
+
+ (defun chb-end ()
+ (interactive)
+ (setq zmacs-region-stays t)
+ (if (not (eolp))
+ (end-of-line)
+ (if (eq this-command last-command)
+ (cond
+ ((not (= (point) (save-excursion
+ (move-to-window-line -1)
+ (end-of-line)
+ (point))))
+ (move-to-window-line -1)
+ (end-of-line))
+ (t
+ (goto-char (point-max)))))))
+
+
+
+
+ ;; safe files with #! in first line as user executable
+
+ (add-hook `after-safe-hook
+ #'(lambda ()
+ (and (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (save-match-data
+ (looking-at "^#!"))))
+ (not (file-executable-p buffer-file-name))
+ (shell-command (concat "chmod u+x " buffer-file-name))
+ (message
+ (concat "Saved as script: " buffer-file-name)))))
+
+ ;;
+ ;; list of recently opened files
+ ;;
+
+ ;; (load "recent-files")
+ ;; (setq recent-files-dont-include
+ ;; '("~$" "tmp/." "INBOX" ".bbdb" ".newsrc." ))
+
+ ;; (setq recent-files-non-permanent-submenu t)
+ ;; (setq recent-files-commands-submenu t)
+ ;; (setq recent-files-number-of-entries 30)
+ ;; (recent-files-initialize)
+
+ ;; Make the <ctrl> c F12 key toggle Whitespace mode on and off. Whitespace mode causes
+ ;; all hard tabs to be highlighted. You can also configure it to highlight space characters
+ ;; in a different color. There is also an untabify function to convert hard tabs to the
+ ;; appropriate number of spaces, and a tabify function to convert groups of spaces to
+ ;; hard tabs.
+ (global-set-key (kbd "C-c <f12>") 'whitespace-mode)
+
+
+ ;; (add-hook 'find-file-hooks 'fume-setup-buffer)
+ ;; (add-hook 'Manual-mode-hook 'turn-on-fume-mode)
+
+ ;; (function-menu USE-MENUBAR RETURN-ONLY MENU-ITEM-FUNCTION)
+
+ ;;====================================================================
+ ;;The Following Code Will Enable Me To Use The "Fume" Package Which
+ ;;Creates, On The Menubar, A "Functions" Menu Containing The List Of
+ ;;All The Functions In The Buffer Being Currently Displayed.
+ ;;====================================================================
+ ;;
+ ;;Setq-Default Set The Default Value Of A Var. This Def. Val. Is Seen
+ ;;In Buffers That *Don'T* Have Their Own Values For The Variable.
+
+ ;(require function-menu)
+ ;(Define-Key Global-Map 'F8 'Function-Menu)
+ ;(Add-Hook 'Find-File-Hooks 'Fume-Add-Menubar-Entry)
+ ;(Define-Key Global-Map "\C-Cl" 'Fume-List-Functions)
+ ;(Define-Key Global-Map "\C-Cg" 'Fume-Prompt-Function-Goto)
+ ;(Define-Key Global-Map '(Shift Button3) 'Mouse-Function-Menu)
+ ;(Define-Key Global-Map '(Meta Button1) 'Fume-Mouse-Function-Goto)
+
+ ;(Add-Hook
+ ; 'Find-File-Hooks
+ ; (Function
+ ; (Lambda()
+ ; (If (And (String-Match "Xemacs" Emacs-Version)
+ ; (Boundp 'Emacs-Major-Version)
+ ; (Or (= Emacs-Major-Version 20)
+ ; (And
+ ; (= Emacs-Major-Version 19)
+ ; (>= Emacs-Minor-Version 13)))
+ ; (Not (Eq Major-Mode 'Latex-Mode)))
+ ; (Fume-Add-Menubar-Entry))
+ ; )))
+
+
+ (define-key global-map "\C-c\S-t" 'visit-tags-table)
+ (define-key global-map "\C-cf" 'tags-search)
- (defun eshell/x ()
- (insert "exit")
- (eshell-send-input)
- (delete-window))
-
+ (define-prefix-command 'bba/toggle)
+ (define-key global-map "\C-ct" 'bba/toggle)
+ (define-key bba/toggle "f" 'auto-fill-mode)
+ (defin-key bba/toggle "p" 'smartparens-mode)
+ (define-prefix-command 'bba/launcher)
+ (define-key global-map "\C-xl" 'bba/launcher)
- (defun eshell/ssh (&rest args)
- "Secure shell"
- (let ((cmd (eshell-flatten-and-stringify
- (cons "ssh" args)))
- (display-type (framep (selected-frame))))
- (cond
- ((and
- (eq display-type 't)
- (getenv "STY"))
- (send-string-to-terminal (format "\033]83;screen %s\007" cmd)))
- ((eq display-type 'x)
- (eshell-do-eval
- (eshell-parse-command
- (format "rxvt -e %s &" cmd)))
- nil)
- (t
- (apply 'eshell-exec-visual (cons "ssh" args))))))
-
- (defun goto-match-paren (arg)
- "Go to the matching parenthesis if on parenthesis, otherwise insert %.
- vi style of % jumping to matching brace."
- (interactive "p")
- (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
- ((looking-at "\\s\)") (forward-char 1) (backward-list 1))
- (t (self-insert-command (or arg 1)))))
- (global-set-key "%" 'goto-match-paren)
-
- ;;(move-overlay hl-line-overlay
- ;; (line-beginning-position) (1+ (line-end-position))
- ;; (current-buffer)))))
-
- ;; (set-face-background-pixmap 'default "~/.xemacs/xemacs-bg.xpm")
- (set-foreground-color "green")
- (set-background-color "black")
-
- ;; pos1: goto start of line, start of screen, start of buffer
- ;; end: goto end of line, end of screen, end of buffer
-
- (global-set-key '[(home)] 'chb-home)
- (global-set-key '[(end)] 'chb-end)
- ;;
- (defun chb-home ()
- (interactive)
- (setq zmacs-region-stays t)
- (if (not (bolp))
- (beginning-of-line)
- (if (eq this-command last-command)
- (cond
- ((not (= (point) (window-start)))
- (move-to-window-line 0)
- (beginning-of-line))
- (t
- (goto-char (point-min)))))))
-
- (defun chb-end ()
- (interactive)
- (setq zmacs-region-stays t)
- (if (not (eolp))
- (end-of-line)
- (if (eq this-command last-command)
- (cond
- ((not (= (point) (save-excursion
- (move-to-window-line -1)
- (end-of-line)
- (point))))
- (move-to-window-line -1)
- (end-of-line))
- (t
- (goto-char (point-max)))))))
-
-
-
-
- ;; safe files with #! in first line as user executable
-
- (add-hook `after-safe-hook
- #'(lambda ()
- (and (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (save-match-data
- (looking-at "^#!"))))
- (not (file-executable-p buffer-file-name))
- (shell-command (concat "chmod u+x " buffer-file-name))
- (message
- (concat "Saved as script: " buffer-file-name)))))
-
- ;;
- ;; list of recently opened files
- ;;
-
- ;; (load "recent-files")
- ;; (setq recent-files-dont-include
- ;; '("~$" "tmp/." "INBOX" ".bbdb" ".newsrc." ))
-
- ;; (setq recent-files-non-permanent-submenu t)
- ;; (setq recent-files-commands-submenu t)
- ;; (setq recent-files-number-of-entries 30)
- ;; (recent-files-initialize)
-
- ;; Make the <ctrl> c F12 key toggle Whitespace mode on and off. Whitespace mode causes
- ;; all hard tabs to be highlighted. You can also configure it to highlight space characters
- ;; in a different color. There is also an untabify function to convert hard tabs to the
- ;; appropriate number of spaces, and a tabify function to convert groups of spaces to
- ;; hard tabs.
- (global-set-key (kbd "C-c <f12>") 'whitespace-mode)
-
-
- ;; (add-hook 'find-file-hooks 'fume-setup-buffer)
- ;; (add-hook 'Manual-mode-hook 'turn-on-fume-mode)
-
- ;; (function-menu USE-MENUBAR RETURN-ONLY MENU-ITEM-FUNCTION)
+ (define-key bba/launcher "c" 'calculator)
+ (define-key bba/launcher "d" 'ediff-buffers)
+ (defin-key bba/launcher "s" 'shell)
- ;;====================================================================
- ;;The Following Code Will Enable Me To Use The "Fume" Package Which
- ;;Creates, On The Menubar, A "Functions" Menu Containing The List Of
- ;;All The Functions In The Buffer Being Currently Displayed.
- ;;====================================================================
- ;;
- ;;Setq-Default Set The Default Value Of A Var. This Def. Val. Is Seen
- ;;In Buffers That *Don'T* Have Their Own Values For The Variable.
-
- ;(require function-menu)
- ;(Define-Key Global-Map 'F8 'Function-Menu)
- ;(Add-Hook 'Find-File-Hooks 'Fume-Add-Menubar-Entry)
- ;(Define-Key Global-Map "\C-Cl" 'Fume-List-Functions)
- ;(Define-Key Global-Map "\C-Cg" 'Fume-Prompt-Function-Goto)
- ;(Define-Key Global-Map '(Shift Button3) 'Mouse-Function-Menu)
- ;(Define-Key Global-Map '(Meta Button1) 'Fume-Mouse-Function-Goto)
-
- ;(Add-Hook
- ; 'Find-File-Hooks
- ; (Function
- ; (Lambda()
- ; (If (And (String-Match "Xemacs" Emacs-Version)
- ; (Boundp 'Emacs-Major-Version)
- ; (Or (= Emacs-Major-Version 20)
- ; (And
- ; (= Emacs-Major-Version 19)
- ; (>= Emacs-Minor-Version 13)))
- ; (Not (Eq Major-Mode 'Latex-Mode)))
- ; (Fume-Add-Menubar-Entry))
- ; )))
-
-
- (define-key global-map "\C-ct" 'visit-tags-table)
- (define-key global-map "\C-cf" 'tags-search)
-
- (define-key global-map "\C-c\C-t" 'insert-timestamp)
- (define-key global-map "\C-c\M-c" 'centered-cursor-mode)
-
- (define-key global-map "\C-c\S-g" 'rgrep)
- (define-key global-map "\C-cf" 'load-git-cfengine)
-
- (define-key global-map "\C-c\C-w" 'fixup-whitespace)
-
-
- (define-key global-map "\M-g\M-d" 'magit-diff-unstaged)
- (define-key global-map "\M-g\M-b" 'magit-branch-manager)
- (define-key global-map "\M-gb" 'magit-blame-mode)
- (define-key global-map "\C-cm" 'magit-status)
-
- (define-key global-map "\C-cw" (lambda ()
- (interactive)
- (let ((woman-use-topic-at-point t))
- (woman))))
- (define-key global-map "\C-c\M-d" 'diff-buffer-with-file)
-
- ;;; ** Use C-+ and C-- to adjust font size
-
- (define-key global-map (kbd "C-+") 'text-scale-increase)
- (define-key global-map (kbd "C--") 'text-scale-decrease)
-
- ;; NUMBERIC KEYPAD. nice number pad conveniences as extra function keys
-
- ;; (global-set-key (kbd "<kp-subtract>") 'ergoemacs-close-current-buffer)
- ;; (global-set-key (kbd "<kp-divide>") 'ergoemacs-previous-user-buffer)
- ;; (global-set-key (kbd "<kp-multiply>") 'ergoemacs-next-user-buffer)
-
- ;; (global-set-key (kbd "<C-kp-divide>") 'ergoemacs-previous-emacs-buffer)
- ;; (global-set-key (kbd "<C-kp-multiply>") 'ergoemacs-next-emacs-buffer)
-
- ;; (global-set-key (kbd "<kp-decimal>") 'other-window)
- ;; (global-set-key (kbd "<kp-0>") 'delete-window)
- ;; (global-set-key (kbd "<kp-1>") 'delete-other-windows)
- ;; (global-set-key (kbd "<kp-2>") 'split-window-vertically)
- ;; (global-set-key (kbd "<kp-3>") 'xah-open-file-at-cursor)
-
- ;; (global-set-key (kbd "<kp-9>") 'isearch-forward)
+ (define-key global-map "\C-c\C-t" 'insert-timestamp)
+ (define-key global-map "\C-c\M-c" 'centered-cursor-mode)
+
+ (define-key global-map "\C-c\S-g" 'rgrep)
+ (define-key global-map "\C-cf" 'load-git-cfengine)
+
+ (define-key global-map "\C-c\C-w" 'fixup-whitespace)
+
+
+ (define-key global-map "\M-g\M-d" 'magit-diff-unstaged)
+ (define-key global-map "\M-g\M-b" 'magit-branch-manager)
+ (define-key global-map "\M-gb" 'magit-blame-mode)
+ (define-key global-map "\C-cm" 'magit-status)
+
+ (define-key global-map "\C-cw" (lambda ()
+ (interactive)
+ (let ((woman-use-topic-at-point t))
+ (woman))))
+ (define-key global-map "\C-c\M-d" 'diff-buffer-with-file)
+
+ ;;; ** Use C-+ and C-- to adjust font size
+
+ (define-key global-map (kbd "C-+") 'text-scale-increase)
+ (define-key global-map (kbd "C--") 'text-scale-decrease)
+
+ ;; NUMBERIC KEYPAD. nice number pad conveniences as extra function keys
+
+ ;; (global-set-key (kbd "<kp-subtract>") 'ergoemacs-close-current-buffer)
+ ;; (global-set-key (kbd "<kp-divide>") 'ergoemacs-previous-user-buffer)
+ ;; (global-set-key (kbd "<kp-multiply>") 'ergoemacs-next-user-buffer)
+
+ ;; (global-set-key (kbd "<C-kp-divide>") 'ergoemacs-previous-emacs-buffer)
+ ;; (global-set-key (kbd "<C-kp-multiply>") 'ergoemacs-next-emacs-buffer)
+
+ ;; (global-set-key (kbd "<kp-decimal>") 'other-window)
+ ;; (global-set-key (kbd "<kp-0>") 'delete-window)
+ ;; (global-set-key (kbd "<kp-1>") 'delete-other-windows)
+ ;; (global-set-key (kbd "<kp-2>") 'split-window-vertically)
+ ;; (global-set-key (kbd "<kp-3>") 'xah-open-file-at-cursor)
+
+ ;; (global-set-key (kbd "<kp-9>") 'isearch-forward)
+
+ (setq custom-file
+ (expand-file-name "custom.el"
+ (expand-file-name ".xemacs" "~")))
+ ;; (load-file user-init-file)
+ (load-file custom-file)
- (setq custom-file
- (expand-file-name "custom.el"
- (expand-file-name ".xemacs" "~")))
- ;; (load-file user-init-file)
- (load-file custom-file)
-
#+END_SRC
*** dns-mode