--- /dev/null
+
+### Better diff hunk headers
+# Git's builtin diff hunk header styles.
+*.ad[abs] diff=ada
+*.[Cch] diff=cpp
+*.cc diff=cpp
+*.[ch]pp diff=cpp
+*.hh diff=cpp
+*.for diff=fortran
+*.html diff=html
+*.shtml diff=html
+*.xml diff=html
+*.java diff=java
+*.[HMm] diff=objc
+*.pas diff=pascal
+*.perl diff=perl
+*.pl diff=perl
+*.php diff=php
+*.py diff=python
+*.rb diff=ruby
+*.tex diff=tex
+
+# Snarfed this from FSF; see contrib/git-for-steve.sh
+*.el diff=elisp
+*.ac diff=m4
+*.m4 diff=m4
+*.mk diff=make
+*[Mm]akefile diff=make
+Makefile.in diff=make
+*[-.]sh diff=shell
+*.texi diff=texinfo
;; Time-stamp: <Thursday Feb 13, 2020 22:54:52 steve>
;; Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
;; HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/00-build.html>
-;; Git Repo: git clone http://git.sxemacs.org/syinit
+;; Git Repo: git clone https://git.sxemacs.org/syinit
;; Keywords: init, compile
;; This file is part of SYinit
-;; 01-vars-sy.el --- Various variables -*- Emacs-Lisp -*-
+;; 01-vars-sy.el --- Various variables
;; Copyright (C) 2007 - 2020 Steve Youngs
;; Author: Steve Youngs <steve@sxemacs.org>
;; Maintainer: Steve Youngs <steve@sxemacs.org>
;; Created: <2007-12-02>
-;; Time-stamp: <Wednesday Feb 12, 2020 13:35:35 steve>
+;; Time-stamp: <Sunday Mar 8, 2020 11:17:00 steve>
;; Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
;; HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/01-vars-sy.html>
-;; Git Repo: git clone http://git.sxemacs.org/syinit
+;; Git Repo: git clone https://git.sxemacs.org/syinit
;; Keywords: init, compile
;; This file is part of SYinit
;:*=======================
;:* Unicode shit
-;; (unless (fboundp 'ucs-to-char)
-;; (when (featurep '(and mule mule-ucs-autoloads))
-;; (require 'un-define)
-;; (and (coding-system-p (find-coding-system 'utf-8))
-;; (setq-default buffer-file-coding-system
-;; (coding-system-name
-;; (find-coding-system 'utf-8))))))
+;(unless (fboundp 'ucs-to-char)
+(when (featurep '(and mule mule-ucs-autoloads))
+ ;; Order is important here
+ (progn
+ (require 'tae)
+ (require 'un-define))
+ (and (coding-system-p (find-coding-system 'utf-8))
+ (setq-default buffer-file-coding-system
+ (coding-system-name
+ (find-coding-system 'utf-8)))))
+;)
;:*=======================
;:* Fix #'run-at-time
;; Author: Steve Youngs <steve@sxemacs.org>
;; Maintainer: Steve Youngs <steve@sxemacs.org>
;; Created: <2007-12-02>
-;; Time-stamp: <Wednesday Feb 12, 2020 11:56:43 steve>
+;; Time-stamp: <Thursday Mar 19, 2020 09:43:00 steve>
;; Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
;; HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/02-keys-sy.html>
-;; Git Repo: git clone http://git.sxemacs.org/syinit
+;; Git Repo: git clone https://git.sxemacs.org/syinit
;; Keywords: init, compile
;; This file is part of SYinit
;:* Global key bindings
(global-set-key "\C-xw" 'what-line)
(global-set-key [f2] 'undo)
-(global-set-key [f3] 'find-file)
(global-set-key [(super tab)] 'lisp-complete-symbol)
(global-set-key [(meta f3)] 'view-file)
(global-set-key [f5] "\M-w")
;; Time-stamp: <Wednesday Feb 12, 2020 12:00:39 steve>
;; Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
;; HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/03-c-mode-sy.html>
-;; Git Repo: git clone http://git.sxemacs.org/syinit
+;; Git Repo: git clone https://git.sxemacs.org/syinit
;; Keywords: init, compile
;; This file is part of SYinit
;; Time-stamp: <Wednesday Feb 12, 2020 12:01:38 steve>
;; Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
;; HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/04-w3-sy.html>
-;; Git Repo: git clone http://git.sxemacs.org/syinit
+;; Git Repo: git clone https://git.sxemacs.org/syinit
;; Keywords: init, compile
;; This file is part of SYinit
;; Author: Steve Youngs <steve@sxemacs.org>
;; Maintainer: Steve Youngs <steve@sxemacs.org>
;; Created: <2007-12-02>
-;; Time-stamp: <Wednesday Feb 12, 2020 16:45:05 steve>
+;; Time-stamp: <Monday Mar 16, 2020 12:51:47 steve>
;; Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
;; HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/05-latex-sy.html>
-;; Git Repo: git clone http://git.sxemacs.org/syinit
+;; Git Repo: git clone https://git.sxemacs.org/syinit
;; Keywords: init, compile
;; This file is part of SYinit
;; incompatible GNUisms of some kind. Explicitly loading the .el gets
;; around it.
(require 'font-latex "font-latex.el")
+(require 'latex-toolbar)
;:*=======================
;:* Shutup the byte-compiler
" "
(substring time -4) " ")))
-;:*=======================
-;:* outl-mouse-minor-mode for all LaTeX files
-(defun turn-on-outl-mouse-minor-mode ()
- (outl-mouse-minor-mode 1))
-
;:*=======================
;* Hooks.
+(defun sy-LaTeX-toolbar ()
+ (interactive)
+ (set-specifier left-toolbar-width (cons (current-buffer) 32))
+ (latex-toolbar-install))
+
(defun sy-LaTeX-mode-hook ()
(turn-on-auto-fill)
(setq TeX-shell "/bin/zsh")
'("gv" "gv %s.ps" TeX-run-silent t nil))
(add-to-list 'TeX-command-list
'("pdflatex" "pdflatex -interaction=nonstopmode %t"
- TeX-run-command nil t)))
-
-(add-hook 'LaTeX-mode-hook #'sy-LaTeX-mode-hook)
-
+ TeX-run-command nil t))
+ (when (device-on-window-system-p)
+ (outl-mouse-minor-mode 1)
+ (local-set-key [(super hyper t)] #'sy-LaTeX-toolbar)))
-;; Add a couple more things if we're in X
-;;(when (and (device-on-window-system-p)
-;; (featurep 'latex-toolbar)
-;; (featurep 'outl-mouse))
-;; (add-hook 'LaTeX-mode-hook
-;; #'(lambda ()
-;; (turn-on-outl-mouse-minor-mode)
-;; (latex-toolbar-install))))
+(add-hook 'LaTeX-mode-hook #'sy-LaTeX-mode-hook 'append)
(setq LaTeX-section-hook
'(LaTeX-section-heading
;:*=======================
;:* Texinfo
-;; This is _NOT_ the texinfo-mode that comes with AucTeX, because that
-;; sucks. AucTeX actually loads `texinfo.el' and then overwrites
-;; everything with the DAK-inspired crap! So I explicitly load it
-;; here to reinstate the better `texinfo-mode'.
-(require 'texinfo)
+;; Jumping through hoops to ensure that we DO NOT get the AUCTeX
+;; tex-info. The texinfo.el from the "texinfo" (S)XEmacs package is
+;; older, but far, far, superior. Honestly, the AUCTeX / GNU people
+;; have no idea what they're missing.
+(eval-after-load 'tex-info
+ (progn
+ (delq 'texinfo-mode TeX-modes)
+ (defalias 'texinfo-mode #'ignore)
+ (require 'texinfo)))
-;; `texinfo.el' uses the GNU `:inherit' property which (S)XEmacs
-;; doesn't have... a quick `set-face-parent' fixes that.
-;; Update: SXEmacs does have `:inherit' now, at least, I'm pretty sure
-;; it does
(set-face-parent 'texinfo-heading-face 'font-lock-function-name-face)
;; Perdy colours!
;; Author: Steve Youngs <steve@sxemacs.org>
;; Maintainer: Steve Youngs <steve@sxemacs.org>
;; Created: <2007-12-02>
-;; Time-stamp: <Wednesday Feb 12, 2020 12:48:57 steve>
+;; Time-stamp: <Thursday Mar 19, 2020 10:58:18 steve>
;; Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
;; HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/06-tex-site-sy.html>
-;; Git Repo: git clone http://git.sxemacs.org/syinit
+;; Git Repo: git clone https://git.sxemacs.org/syinit
;; Keywords: init, compile
;; This file is part of SYinit
Full documentation will be available after autoloading the function."
"Documentation for autoload functions.")
-(defcustom TeX-image-directory
- (if (featurep 'xemacs)
+(setq TeX-image-directory
(file-name-as-directory
- (expand-file-name "images" (locate-data-directory "auctex")))
- (file-name-as-directory (concat TeX-lisp-directory "images")))
- "*Directory containing hand generated TeX information.
-Must end with a directory separator.
-
-These correspond to TeX macros shared by all users of a site."
- :group 'TeX-file
- :type 'directory)
-
-(defcustom TeX-auto-global
- (file-name-as-directory
- (expand-file-name "auto"
- (locate-data-directory "auctex")))
- "*Directory containing automatically generated information.
-Must end with a directory separator.
-
-For storing automatic extracted information about the TeX macros
-shared by all users of a site."
- :group 'TeX-file
- :type 'directory)
-
+ (expand-file-name "images" (locate-data-directory "auctex"))))
+
+;; System-wide writable directories are a bad idea at the best of
+;; times. Pretty much the only way of doing it even remotely safely
+;; is to use 1777 perms on the directory. Until I update AUCTeX to do
+;; just that this var will default to nil unless it is writable to me.
+(setq TeX-auto-global
+ (let ((dir (file-name-as-directory
+ (expand-file-name "auto"
+ (locate-data-directory "auctex")))))
+ (or (and (file-writable-p dir) dir)
+ ;; If it doesn't exist but parent is writable, allow it.
+ (and (file-writable-p (file-dirname dir)) dir))))
+
+;:*=======================
+;:* LaTeX or latex ???
+;; Remove the built-in ones that use latex-mode
+(remove-alist 'auto-mode-alist "\\.\\(?:sty\\|cls\\|bbl\\)\\'")
+(remove-alist 'auto-mode-alist "\\.[tT]e[xX]\\'")
+(remove-alist 'auto-mode-alist "\\.ltx\\'")
+;; Add them back for LaTeX-mode
+(add-to-list 'auto-mode-alist '("\\.\\(?:sty\\|cls\\|bbl\\)\\'" . LaTeX-mode))
+(add-to-list 'auto-mode-alist '("\\.[tT]e[xX]\\'" . LaTeX-mode))
+(add-to-list 'auto-mode-alist '("\\.ltx\\'" . LaTeX-mode))
+(add-to-list 'auto-mode-alist '("\\.drv\\'" . LaTeX-mode))
+;; doctex
(add-to-list 'auto-mode-alist '("\\.dtx\\'" . doctex-mode))
-(add-to-list 'auto-mode-alist '("\\.drv\\'" . latex-mode))
;; This hook will store bibitems when you save a BibTeX buffer.
(add-hook 'bibtex-mode-hook 'BibTeX-auto-store)
(autoload 'japanese-plain-tex-mode "tex-jp" no-doc t)
(autoload 'japanese-latex-mode "tex-jp" no-doc t)
(autoload 'latex-mode "latex" no-doc t)
+(autoload 'LaTeX-mode "latex" no-doc t)
+(autoload 'TeX-latex-mode "latex" no-doc t)
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
(message "Sane tex-site loaded successfully")
;; Time-stamp: <Wednesday Feb 12, 2020 13:05:05 steve>
;; Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
;; HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/07-html-sy.html>
-;; Git Repo: git clone http://git.sxemacs.org/syinit
+;; Git Repo: git clone https://git.sxemacs.org/syinit
;; Keywords: init, compile
;; This file is part of SYinit
;; Time-stamp: <Wednesday Feb 12, 2020 13:33:32 steve>
;; Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
;; HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/08-sounds-sy.html>
-;; Git Repo: git clone http://git.sxemacs.org/syinit
+;; Git Repo: git clone https://git.sxemacs.org/syinit
;; Keywords: init, compile
;; This file is part of SYinit
;; Time-stamp: <Wednesday Feb 12, 2020 13:37:36 steve>
;; Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
;; HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/09-toolbar-sy.html>
-;; Git Repo: git clone http://git.sxemacs.org/syinit
+;; Git Repo: git clone https://git.sxemacs.org/syinit
;; Keywords: init, compile
;; This file is part of SYinit
;; Author: Steve Youngs <steve@sxemacs.org>
;; Maintainer: Steve Youngs <steve@sxemacs.org>
;; Created: <2007-12-02>
-;; Time-stamp: <Wednesday Feb 12, 2020 15:30:24 steve>
+;; Time-stamp: <Thursday Mar 19, 2020 12:15:35 steve>
;; Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
;; HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/10-pkgs-sy.html>
-;; Git Repo: git clone http://git.sxemacs.org/syinit
+;; Git Repo: git clone https://git.sxemacs.org/syinit
;; Keywords: init, compile
;; This file is part of SYinit
;;; Todo:
;;
-;;
+;;
;;; Code:
;:*======================
(push (cons 'border-width 1) mpd-dock-frame-plist)
(push (cons 'border-color "red") mpd-dock-frame-plist)
-
-;:*======================
-;; pcl-cvs - a GNU Emacs front-end to CVS
-;; Does anyone use CVS anymore?
-;(autoload 'cvs-update "pcl-cvs" nil t)
-;(setq
-; cvs-reuse-cvs-buffer 'always
-; cvs-add-default-message "Initial version"
-; cvs-allow-dir-commit t)
-
;:*======================
;:* View-process (`top' for emacs)
(require 'view-process-mode)
(setq View-process-host-names-and-system-types
'(("bastard.steveyoungs.com"
- ("linux" nil "bsd"
- View-process-field-name-descriptions-linux
- View-process-kill-signals-linux))))
+ ("linux" nil "bsd"
+ View-process-field-name-descriptions-linux
+ View-process-kill-signals-linux))))
(setq View-process-status-command-switches-system-v "auxw")
(setq View-process-ps-header-window-offset 3)
-(add-hook 'View-process-header-mode-hook
- (lambda ()
- (set-specifier horizontal-scrollbar-visible-p nil (current-buffer))
- (set-specifier vertical-scrollbar-visible-p nil (current-buffer))))
+(add-hook 'View-process-header-mode-hook
+ (lambda ()
+ (set-specifier horizontal-scrollbar-visible-p nil (current-buffer))
+ (set-specifier vertical-scrollbar-visible-p nil (current-buffer))))
;:*=====================
;:* whitespace-mode
-(autoload 'whitespace-mode "whitespace-mode"
- "Toggle whitespace mode.
- With arg, turn whitespace mode on iff arg is positive. In
- whitespace mode the different whitespaces (tab, blank return) are
- highlighted with different faces. The faces are:
- `whitespace-blank-face', `whitespace-tab-face' and
- `whitespace-return-face'."
- t)
-
-(autoload 'whitespace-incremental-mode "whitespace-mode"
- "Toggle whitespace incremental mode.
- With arg, turn whitespace incremental mode on iff arg is positive.
- In whitespace incremental mode the different whitespaces (tab and
- blank) are highlighted with different faces. The faces are:
- `whitespace-blank-face' and `whitespace-tab-face'. Use the command
- `whitespace-show-faces' to show their values. In this mode only
- these tabs and blanks are highlighted, which are in the region from
- (point) - (window-heigh) to (point) + (window-heigh)."
- t)
+(autoload 'whitespace-mode "whitespace-mode" nil t)
+(autoload 'whitespace-incremental-mode "whitespace-mode" nil t)
;:*======================
;:* func-menu
fume-display-in-modeline-p t
fume-menu-path '("View"))
-;:*======================
-;:* font-lock
-;(remove-hook 'font-lock-mode-hook 'turn-on-fast-lock)
-(require 'font-lock)
-
;:*======================
;:* recent-files.el --- Maintain menu of recently opened files.
(when (featurep 'menubar)
(require 'savehist)
(setq savehist-file (expand-file-name "history" user-init-directory))
(setq savehist-coding-system
- (coding-system-name (find-coding-system 'iso-8859-1)))
+ (coding-system-name (find-coding-system 'iso-8859-1)))
(savehist-mode 1))
;:*======================
(global-set-key '(control f12) 'comment-or-uncomment-region)
(global-set-key '(meta f12) 'comment-or-uncomment-region)
-
+;;; FIXME: <<< SXEInits
;:*======================
;:* parens that mark sexpressions
(require 'paren)
speedbar-query-confirmation-method 'none-but-delete
speedbar-show-unknown-files t
speedbar-tag-hierarchy-method '(speedbar-prefix-group-tag-hierarchy
- speedbar-trim-words-tag-hierarchy
- speedbar-simple-group-tag-hierarchy
- speedbar-sort-tag-hierarchy)
+ speedbar-trim-words-tag-hierarchy
+ speedbar-simple-group-tag-hierarchy
+ speedbar-sort-tag-hierarchy)
;; speedbar-track-mouse-flag t
;; speedbar-use-tool-tips-flag t
speedbar-visiting-tag-hook 'speedbar-recenter-to-top)
(when (featurep 'menubar)
(add-menu-button '("Tools")
- ["Speedbar" speedbar-frame-mode
- :style toggle
- :selected (and (boundp 'speedbar-frame)
- (frame-live-p speedbar-frame)
- (frame-visible-p speedbar-frame))]
- "--"))
+ ["Speedbar" speedbar-frame-mode
+ :style toggle
+ :selected (and (boundp 'speedbar-frame)
+ (frame-live-p speedbar-frame)
+ (frame-visible-p speedbar-frame))]
+ "--"))
(global-set-key [(f4)] 'speedbar-get-focus)
(require 'sb-image)
(require 'sb-info)
;:*======================
;:* Shell-mode
+;; Trying to get compilation buffers to recognise ANSI colour
+;; sequences because GCC. Doesn't seem to work. Probably have to
+;; stick to `GCC_COLORS= make'
+(defun sy/comint-hooks ()
+ (ansi-color-for-comint-mode-on)
+ (fast-lock-mode 1)
+ (font-lock-mode 1))
(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
+(add-hook 'comint-mode-hook #'sy/comint-hooks)
+(add-hook 'compilation-mode-hook #'sy/comint-hooks)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
(add-hook 'shell-mode-hook 'turn-on-font-lock)
;:* Compile-Mode
(setq
compilation-always-signal-completion t
- mode-compile-make-program "make"
+ mode-compile-make-program "GCC_COLORS= make"
compilation-read-command t
compilation-window-height 10
- compile-command "make")
-
-;:*======================
-;:* Balloon Help (now in calendar settings)
-
+ compile-command "GCC_COLORS= make")
;:*======================
;:* Version Control
;:* Ediff & Diff-mode
(require 'ediff)
(require 'diff-mode)
-(setq ediff-use-toolbar-p nil ; was t but plays havoc with xwem
+(setq ediff-use-toolbar-p t
ediff-custom-diff-options "-u"
ediff-window-setup-function 'ediff-setup-windows-plain)
(setq diff-switches "-u")
tramp-auto-save-directory "~/.autosave/"
tramp-remote-path
'("/usr/lib/pkgusr"
- "/usr/bin"
- "/bin"
- "/usr/X11R6/bin"))
+ "/usr/bin"
+ "/bin"
+ "/usr/X11R6/bin"))
; :*======================
; :* Eshell
-;(require 'pcmpl-arch)
-(setq
+(setq
eshell-directory-name
(file-name-as-directory
(expand-file-name "eshell" user-init-directory))
eshell-ask-to-save-history 'always
eshell-save-history-on-exit t
eshell-banner-message (concat "Welcome to Eshell on "
- (system-name)
- ", running "
- (shell-command-to-string "uname -rs")
- "In: "
- emacs-version
- "\n\n")
+ (system-name)
+ ", running "
+ (shell-command-to-string "uname -rs")
+ "In: "
+ emacs-version
+ "\n\n")
eshell-hist-ignoredups t
eshell-modules-list '(eshell-alias
- eshell-banner
- eshell-basic
- eshell-cmpl
- eshell-dirs
- eshell-glob
- eshell-hist
- eshell-ls
- eshell-pred
- eshell-prompt
- ;eshell-rebind
- eshell-script
+ eshell-banner
+ eshell-basic
+ eshell-cmpl
+ eshell-dirs
+ eshell-glob
+ eshell-hist
+ eshell-ls
+ eshell-pred
+ eshell-prompt
+ ;eshell-rebind
+ eshell-script
;eshell-smart
- eshell-term
- eshell-unix
- eshell-xtra))
+ eshell-term
+ eshell-unix
+ eshell-xtra))
(defun sy-eshell-bol-maybe (&optional prompt)
"*Move point to beginning of command or bol if there already.
Optional arg, PROMPT is a regexp of your eshell prompt."
(interactive)
(let* ((prompt (or prompt "^.+ [$%] "))
- (lbpos (point-at-bol))
- (prspos (save-excursion
- (goto-char lbpos)
- (search-forward-regexp prompt (point-at-eol) t)))
- (cpos (point)))
+ (lbpos (point-at-bol))
+ (prspos (save-excursion
+ (goto-char lbpos)
+ (search-forward-regexp prompt (point-at-eol) t)))
+ (cpos (point)))
(goto-char
(cond ((null prspos)
- lbpos)
- ((= cpos (or prspos 0))
- lbpos)
- (prspos)
- (t lbpos)))))
+ lbpos)
+ ((= cpos (or prspos 0))
+ lbpos)
+ (prspos)
+ (t lbpos)))))
(defun sy-eshell-bol-maybe-key ()
(define-key eshell-mode-map [(control ?a)] 'sy-eshell-bol-maybe))
Non-nil TYPE means find the current kernel's build directory, otherwise
find the source directory."
(let* ((base "/lib/modules/")
- (ver (substring (shell-command-to-string "uname -r") 0 -1))
- (dir (file-name-as-directory
- (concat base ver "/"
- (if type
- "build"
- "source")))))
+ (ver (substring (shell-command-to-string "uname -r") 0 -1))
+ (dir (file-name-as-directory
+ (concat base ver "/"
+ (if type
+ "build"
+ "source")))))
(cd dir)))
(defun cdls ()
; :* FFAP -- Find File At Point
(require 'ffap)
+;; Make sure ffap does NOT get in my way...
+(setq ffap-bindings nil)
+
+(global-set-key [f3] #'find-file-at-point)
+(global-set-key [(control x) ?4 f3] #'ffap-other-window)
+(global-set-key [(control x) ?5 f3] #'ffap-other-frame)
+(global-set-key [(shift button3)] #'ffap-at-mouse)
+(global-set-key [(control shift button3)] #'ffap-menu)
+
(setq
- ffap-bindings
- (nconc
- '((global-set-key '(shift button3) 'ffap-at-mouse)
- (global-set-key '(control shift button3) 'ffap-menu)
- (global-set-key "\C-x\C-f" 'find-file-at-point)
- (global-set-key "\C-x4f" 'ffap-other-window)
- (global-set-key "\C-x5f" 'ffap-other-frame)))
ffap-machine-p-known 'accept
ffap-machine-p-unknown 'accept
ffap-machine-p-local 'accept)
-(ffap-bindings)
-(add-hook 'mouse-track-click-hook 'ffap-mouse-track-click)
;:*======================
;:* Auto-Insert
(require 'auto-insert-tkld)
(setq auto-insert-alist '(("\\.texi\\(nfo\\)?$" . "TeXinfo")
- ("\\.c$" . "C")
- ("\\.cc$" . "C++")
- ("\\.h$" . "C Header")
- ("\\.el$" . "Emacs Lisp")
- ("[Mm]akefile" . "Makefile")
- ("\\.sh$" . "Sh")
- ("\\.pl$" . "Perl")))
+ ("\\.c$" . "C")
+ ("\\.cc$" . "C++")
+ ("\\.h$" . "C Header")
+ ("\\.el$" . "Emacs Lisp")
+ ("[Mm]akefile" . "Makefile")
+ ("\\.sh$" . "Sh")
+ ("\\.pl$" . "Perl")))
(setq auto-insert-type-alist '(("TeXinfo" . "texinfo-insert.texi")
- ("C" . "c-insert.c")
- ("C Header" . "h-insert.h")
- ("C++" . "c++-insert.cc")
- ("Emacs Lisp" . "elisp-insert.el")
- ("Makefile" . "makefile.inc")
- ("Perl" . "perl-insert.pl")
- ("Sh" . "sh-insert.sh")))
+ ("C" . "c-insert.c")
+ ("C Header" . "h-insert.h")
+ ("C++" . "c++-insert.cc")
+ ("Emacs Lisp" . "elisp-insert.el")
+ ("Makefile" . "makefile.inc")
+ ("Perl" . "perl-insert.pl")
+ ("Sh" . "sh-insert.sh")))
(add-to-list 'auto-insert-path '"~/documents/Templates/")
(let ((auto-insert-automatically nil))
ad-do-it))
(message "Auto-Insert initialised!")
-;:*======================
-;:* XEtla
-; I don't think anyone uses tla anymore
-;(require 'xetla)
-;(setq
-; xetla-show-internal-buffers-on-menu nil
-; xetla-switch-to-buffer-mode 'single-window
-; xetla-use-arrow-keys-for-navigation t)
-;(defun sy-xetla-reload ()
-; "Reload XEtla."
-; (interactive)
-; (call-interactively 'xetla-reload)
-; (require 'xetla-browse)
-; (setq
-; xetla-show-internal-buffers-on-menu nil
-; xetla-switch-to-buffer-mode 'single-window
-; xetla-use-arrow-keys-for-navigation t))
;:*=======================
;:* My git shit
(defvar sxell-initialised-flag)
(defvar sxell-download-directory)
(when (and (featurep '(and sxemacs postgresql))
- (fboundp 'ffi-defun))
+ (fboundp 'ffi-defun))
(require 'sxell)
(setq sxell-initialised-flag t
sxell-download-directory
(add-hook 'message-mode-hook #'(lambda ()
(font-lock-mode)
(font-lock-mode)))
-;; XEtla/howm probs
-;(add-hook 'xetla-changelog-mode-hook #'turn-on-font-lock)
-;(add-hook 'xetla-log-edit-mode-hook #'turn-on-font-lock)
;; ChangeLogs
(add-hook 'change-log-mode-hook #'font-lock-mode)
;; (2) Yank (C-y) on any buffer, e.g. *scratch* or ~/memo.txt.
;; (3) M-x snap-play on yanked text ==> snapshot (1) is restored.
(require 'snap)
+(global-set-key [(hyper ?s) ?r] #'snap-record)
;; env var trickery.
(setq snap-abbreviate-environment-variables
- '("HOME" "JAVA_HOME" "module_path"))
+ '("EMCHAT" "JAVA_HOME" "LISP" "PKGS" "QTDIR"
+ "SXEBLD" "SXESITE" "SXEWD" "SYdrive" "SYdrop" "HOME"))
(defadvice snap-abbreviate-file-name (around env-var (raw-path) activate)
ad-do-it
(let ((path (expand-file-name raw-path))
- (rules (mapcar #'(lambda (var)
- (let ((val (getenv var)))
- (and val
- (cons (concat "^" (regexp-quote val))
- (format "${%s}" var)))))
- snap-abbreviate-environment-variables)))
+ (rules (mapcar #'(lambda (var)
+ (let ((val (getenv var)))
+ (and val
+ (cons (concat "^" (regexp-quote val))
+ (format "${%s}" var)))))
+ snap-abbreviate-environment-variables)))
(mapc #'(lambda (r)
- (when (and r (string-match (car r) path))
- (setq ad-return-value
- (replace-regexp-in-string (car r) (cdr r) path))))
- (reverse rules))))
+ (when (and r (string-match (car r) path))
+ (setq ad-return-value
+ (replace-regexp-in-string (car r) (cdr r) path))))
+ (reverse rules))))
;; Bookmark extras
(eval-after-load "bookmark"
(ad-enable-advice 'bookmark-buffer-file-name 'around 'with-snap)
(ad-enable-advice 'bookmark-jump-noselect 'around 'with-snap)))
-;; ffap extras
+;; ffap extras
(setq ffap-url-regexp snap-ffap-url-regexp)
(setq ffap-url-fetcher snap-ffap-url-fetcher)
;(add-hook 'emacs-lisp-mode-hook #'turn-on-eldoc-mode)
;(add-hook 'lisp-interaction-mode-hook #'turn-on-eldoc-mode)
+;:*=======================
+;:* Man pages
+(require 'man)
+
+;; You can't follow xrefs via keyboard, so...
+(defun sy:Manual-follow-xref-kbd ()
+ "Invoke `manual-entry' on the cross-reference at point."
+ (interactive)
+ (let* ((ext (extent-at (point)))
+ (data (and ext (extent-property ext 'man))))
+ (if (eq (car-safe data) 'Manual-follow-xref)
+ (eval data)
+ (error 'search-failed "no manual cross-reference there."))
+ (or (manual-entry (extent-string ext))
+ ;; Couldn't find it, try other sections.
+ (and (string-match "[ \t]*([^)]+)\\'" (extent-string ext))
+ (progn
+ (message "No entries found for %s; checking other sections..."
+ (extent-string ext))
+ (manual-entry
+ (substring (extent-string ext) 0 (match-beginning 0))
+ nil t))))))
+
+(define-key Manual-mode-map [(control return)] #'sy:Manual-follow-xref-kbd)
+(define-key Manual-mode-map [button1] #'Manual-follow-xref)
+
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*
(message "packages loaded")
;; Author: Steve Youngs <steve@sxemacs.org>
;; Maintainer: Steve Youngs <steve@sxemacs.org>
;; Created: <2007-12-02>
-;; Time-stamp: <Friday Feb 14, 2020 01:18:48 steve>
+;; Time-stamp: <Thursday Feb 20, 2020 08:23:46 steve>
;; Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
;; HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/11-cal-sy.html>
-;; Git Repo: git clone http://git.sxemacs.org/syinit
+;; Git Repo: git clone https://git.sxemacs.org/syinit
;; Keywords: init, compile
;; This file is part of SYinit
;:*=======================
;:* Start itimer to refresh just after midnight
-;;
+;; <<< run-at-time
;; This needs my `future-run-at-time' advice.
(run-at-time "00:01" 86400 #'redraw-calendar)
;; Author: Steve Youngs <steve@sxemacs.org>
;; Maintainer: Steve Youngs <steve@sxemacs.org>
;; Created: <2007-12-02>
-;; Time-stamp: <Friday Feb 14, 2020 01:39:28 steve>
+;; Time-stamp: <Tuesday Mar 17, 2020 13:38:11 steve>
;; Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
;; HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/12-misc-sy.html>
-;; Git Repo: git clone http://git.sxemacs.org/syinit
+;; Git Repo: git clone https://git.sxemacs.org/syinit
;; Keywords: init, compile
;; This file is part of SYinit
nil))
(add-hook 'mouse-track-drag-up-hook 'mouse-track-drag-copy-to-kill)
-;:*=======================
-;:* manual follows xref instead of opening a new buffer
-;: Glynn Clements <glynn@sensei.co.uk>
-(defun Manual-follow-xref (&optional name-or-event)
- "Invoke `manual-entry' on the cross-reference under the mouse.
-When invoked noninteractively, the arg may be an xref string to parse
-instead."
- (interactive "e")
- (if (eventp name-or-event)
- (let* ((p (event-point name-or-event))
- (extent (and p (extent-at p
- (event-buffer name-or-event)
- 'highlight)))
- (data (and extent (extent-property extent 'man))))
- (if (eq (car-safe data) 'Manual-follow-xref)
- (eval data)
- (error "no manual cross-reference there.")))
- (let ((buff (current-buffer)))
- (or (and (manual-entry name-or-event)
- (or (eq (current-buffer) buff)
- (kill-buffer buff)))
- ;: If that didn't work, maybe it's in a different section than the
- ;: man page writer expected. For example, man pages tend assume
- ;: that all user programs are in section 1, but X tends to generate
- ;: makefiles that put things in section "n" instead...
- (and (string-match "[ \t]*([^)]+)\\'" name-or-event)
- (progn
- (message "No entries found for %s; checking other sections..."
- name-or-event)
- (and (manual-entry
- (substring name-or-event 0 (match-beginning 0)) nil t)
- (or (eq (current-buffer) buff)
- (kill-buffer buff)))))))))
+;:*=======================
+;:* Keep the mouse pointer away from the text cursor
+(require 'avoid)
+(mouse-avoidance-mode 'jump)
;:*=======================
;:* Frame title.
;;(require 'ffi-wand)
(Wand-find-file-enable)
+;:*=======================
+;:* ffi-magic
+;; Automatic coding-system detection via libmagic
+(require 'ffi-magic)
+(magic:find-file-magic-alist-enable)
+
;:*======================
;:* Dired enhancements.
(require 'dired)
(defun sy-dired-play-audio ()
(interactive)
(let ((file (dired-get-filename)))
- (when (string-match #r"\.\(wav\|au\|ogg\|mp3\|flac\)$" file)
+ (when (magic:file-audio-p file)
(let ((stream (make-media-stream :file file)))
(play-media-stream stream)))))
;:*======================
;:* Change some modeline indicators
-(setq pending-delete-modeline-string " PD")
-(setq filladapt-mode-line-string "")
+(setq pending-delete-modeline-string nil)
+(setq fume-mode-line-string nil)
+(setq filladapt-mode-line-string nil)
+(setq mouse-avoidance-mode-line-string nil)
(add-minor-mode 'abbrev-mode " Ab")
(add-hook 'lisp-interaction-mode-hook #'(lambda () (setq mode-name "LI")))
("^/sxe" . "/home/steve/programming/SXEmacs")
("^/core" . "/home/steve/programming/SXEmacs/core/sxemacs.git")
("^/web" . "/home/steve/programming/SXEmacs/web/website")
- ("^/init" . ,(expand-file-name "init.d" user-init-directory))))
+ ("^/init" . ,(expand-file-name "init.d" user-init-directory))
+ ("^/blds" . "/home/steve/programming/SXEmacs/core/BUILDS")
+ ("^/lisp" . "/home/steve/programming/lisp")
+ ("^/pkgs" . "/home/steve/programming/SXEmacs/packages")))
;:*======================
;:* The beginnings of procmail-mode.el.
(customize-set-variable 'user-mail-address "steve@steveyoungs.com")
(setq query-user-mail-address nil)
(blink-cursor-mode 1)
-(when (featurep 'mule)
- (set-language-environment "Latin-1"))
+;; (when (featurep 'mule)
+;; (set-language-environment "Latin-1"))
(unless (gnuserv-running-p)
(gnuserv-start))
(require 'mozmail)
(setq
Info-directory-list
'("/home/steve/.local/share/sxemacs/site-packages/info"
+ "/home/steve/.local/share/sxemacs/xemacs-packages/info"
"/usr/share/info"
;; "/usr/share/sxemacs/site-packages/info"
;; "/usr/share/sxemacs/sxemacs-packages/info"
"/usr/share/sxemacs/mule-packages/info")
Info-dir-contents-directory
"/home/steve/.local/share/sxemacs/site-packages/info"
- Info-save-auto-generated-dir 'always)
-
+ Info-save-auto-generated-dir 'always
+ Info-button1-follows-hyperlink t)
;:*=======================
;:* gdb-highlight
(add-hook 'gdb-mode-hook #'(lambda () (require 'gdb-highlight)))
;; Time-stamp: <Wednesday Feb 12, 2020 14:46:05 steve>
;; Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
;; HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/13-bbdb-sy.html>
-;; Git Repo: git clone http://git.sxemacs.org/syinit
+;; Git Repo: git clone https://git.sxemacs.org/syinit
;; Keywords: init, compile
;; This file is part of SYinit
;; Author: Steve Youngs <steve@sxemacs.org>
;; Maintainer: Steve Youngs <steve@sxemacs.org>
;; Created: <2007-12-02>
-;; Time-stamp: <Wednesday Feb 12, 2020 15:10:58 steve>
+;; Time-stamp: <Thursday Mar 19, 2020 11:11:22 steve>
;; Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
;; HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/14-fonts-sy.html>
-;; Git Repo: git clone http://git.sxemacs.org/syinit
+;; Git Repo: git clone https://git.sxemacs.org/syinit
;; Keywords: init, compile
;; This file is part of SYinit
;;
;;; Code:
+;:*=======================
+;:* font-lock
+(require 'font-lock)
+
;:*=======================
;:* Turn on Lazy-(lock|shot)
;;; Lazy-lock
;; Time-stamp: <Wednesday Feb 12, 2020 14:51:28 steve>
;; Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
;; HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/15-supercite-sy.html>
-;; Git Repo: git clone http://git.sxemacs.org/syinit
+;; Git Repo: git clone https://git.sxemacs.org/syinit
;; Keywords: init, compile
;; This file is part of SYinit
;; Author: Steve Youngs <steve@sxemacs.org>
;; Maintainer: Steve Youngs <steve@sxemacs.org>
;; Created: <2007-12-02>
-;; Time-stamp: <Wednesday Feb 12, 2020 14:59:12 steve>
+;; Time-stamp: <Sunday Mar 1, 2020 14:29:44 steve>
;; Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
;; HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/16-riece-sy.html>
-;; Git Repo: git clone http://git.sxemacs.org/syinit
+;; Git Repo: git clone https://git.sxemacs.org/syinit
;; Keywords: init, compile
;; This file is part of SYinit
"purple" "orange" "yellow" "lightgreen" "darkcyan"
"cyan" "lightblue" "HotPink" "grey35" "grey")
riece-default-channel-binding nil
- riece-default-coding-system 'binary
+ riece-default-coding-system 'utf-8
riece-desktop-notify-always t
riece-gather-channel-modes t
riece-hide-list '(joins parts quits)
;; Time-stamp: <Friday Feb 14, 2020 01:48:44 steve>
;; Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
;; HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/17-emchat-sy.html>
-;; Git Repo: git clone http://git.sxemacs.org/syinit
+;; Git Repo: git clone https://git.sxemacs.org/syinit
;; Keywords: init, compile
;; This file is part of SYinit
;; (when (or (member alias emchat-visible-contacts)
;; (not (member alias emchat-invisible-contacts)))
;; (let ((repo "The main EMchat git repo is:
-;; git clone http://git.emchat.org/emchat")
+;; git clone https://git.emchat.org/emchat")
;; (download "EMchat source tarballs and (S)XEmacs pkg tarballs
;; can be downloaded from: Offline ATM, sorry")
;; (latest (shell-command-to-string