From a2f4aa8fe3707e70f1feb620f78f5b2af5d39424 Mon Sep 17 00:00:00 2001 From: Steve Youngs Date: Thu, 19 Mar 2020 12:36:02 +1000 Subject: [PATCH] Loads more updates -- large assortment of stuffs * *.el: Update repo URL... https * 16-riece-sy.el (riece-default-coding-system): Set to utf-8. * 14-fonts-sy.el (font-lock): Require it. * 12-misc-sy.el (Manual-follow-xref): Nuke it. (mouse-avoidance-mode): Add it, turn it on. (magic:find-file-magic-alist-enable): Add it. (sy-dired-play-audio): Use #'magic:file-audio-p instead of string matching the filename. (fume-mode-line-string): Set to nil. (pending-delete-modeline-string): Ditto. (filladapt-mode-line-string): Ditto. (mouse-avoidance-mode-line-string): Ditto. (directory-abbrev-alist): Add blds lisp pkgs. Don't #'set-language-environment. (Info-directory-list): Add xemacs-packages dir. (Info-button1-follows-hyperlink): Yes please. * 11-cal-sy.el: Add a howm magic anchor to point to run-at-time prob / fix. * 10-pkgs-sy.el: Nuke pcl-cvs. (whitespace-mode): Lose the docstring in the autoload. (whitespace-incremental-mode): Ditto. Move font-lock stuff to 14-fonts-sy.el Add FIXME for paren-set-mode issue. (sy/comint-hooks): An attempt to get compilation buffers to be ANSI colour aware. Currently not working. (mode-compile-make-program): Set to "GCC_COLORS= make" (compile-command): Ditto. (ediff-use-toolbar-p): Set to t. (FFAP settings): Keep them right out of my way and nowhere near traditional find-file bindings. Nuke XEtla settings. (snap-record): Bind `H-s r' to it. (snap-abbreviate-environment-variables): Add EMCHAT, LISP, PKGS, QTDIR, SXEBLD, SXESITE, SXEWD, SYdrive, SYdrop. Remove module_path. (sy:Manual-follow-xref-kbd): New. Does what it says on the tin. Bind `control return' to it (Manual-mode-map): Bind button1 to #'Manual-follow-xref. * 06-tex-site-sy.el (TeX-image-directory): #'setq it instead of #'defcustom and don't bother having a non-XE value. (TeX-auto-global): Ditto. Plus set to nil if the directory isn't writable. Ensure that `auto-mode-alist' is set up correctly for `LaTeX-mode'. (TeX-latex-mode,LaTeX-mode): Autoload em. Probably not _really_ needed as latex-mode and LaTeX-mode are both aliases to TeX-latex-mode. * 05-latex-sy.el (latex-toolbar): Require it. (turn-on-outl-mouse-minor-mode): Nuke it. (sy-LaTeX-toolbar): New. Sets toolbar width and installs the latex-toolbar. Bound to `H-S-t'. (LaTeX-mode-hook): Add #'sy-LaTeX-mode-hook the end rather than the beginning of the list. (tex-info): Re-do how I avoid AUCTeX tex-info so I can use texinfo instead. * 02-keys-sy.el: Don't bind F3 to #'find-file * 01-vars-sy.el: Re-enable the unicode stuff, adding `tae' into the mix. Signed-off-by: Steve Youngs --- .gitattributes | 31 +++++ 00-build.el | 2 +- 01-vars-sy.el | 24 ++-- 02-keys-sy.el | 5 +- 03-c-mode-sy.el | 2 +- 04-w3-sy.el | 2 +- 05-latex-sy.el | 50 ++++---- 06-tex-site-sy.el | 57 +++++---- 07-html-sy.el | 2 +- 08-sounds-sy.el | 2 +- 09-toolbar-sy.el | 2 +- 10-pkgs-sy.el | 298 +++++++++++++++++++++------------------------ 11-cal-sy.el | 6 +- 12-misc-sy.el | 69 ++++------- 13-bbdb-sy.el | 2 +- 14-fonts-sy.el | 8 +- 15-supercite-sy.el | 2 +- 16-riece-sy.el | 6 +- 17-emchat-sy.el | 4 +- 19 files changed, 287 insertions(+), 287 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..e54d417 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,31 @@ + +### 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 diff --git a/00-build.el b/00-build.el index 58b5d97..b0cd3db 100644 --- a/00-build.el +++ b/00-build.el @@ -8,7 +8,7 @@ ;; Time-stamp: ;; Download: ;; HTMLised: -;; 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 diff --git a/01-vars-sy.el b/01-vars-sy.el index 87db01d..18d8127 100644 --- a/01-vars-sy.el +++ b/01-vars-sy.el @@ -1,14 +1,14 @@ -;; 01-vars-sy.el --- Various variables -*- Emacs-Lisp -*- +;; 01-vars-sy.el --- Various variables ;; Copyright (C) 2007 - 2020 Steve Youngs ;; Author: Steve Youngs ;; Maintainer: Steve Youngs ;; Created: <2007-12-02> -;; Time-stamp: +;; Time-stamp: ;; Download: ;; HTMLised: -;; 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 @@ -145,13 +145,17 @@ ;:*======================= ;:* 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 diff --git a/02-keys-sy.el b/02-keys-sy.el index 44254ac..e29fa84 100644 --- a/02-keys-sy.el +++ b/02-keys-sy.el @@ -5,10 +5,10 @@ ;; Author: Steve Youngs ;; Maintainer: Steve Youngs ;; Created: <2007-12-02> -;; Time-stamp: +;; Time-stamp: ;; Download: ;; HTMLised: -;; 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 @@ -66,7 +66,6 @@ ;:* 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") diff --git a/03-c-mode-sy.el b/03-c-mode-sy.el index 19c511c..34a2d7e 100644 --- a/03-c-mode-sy.el +++ b/03-c-mode-sy.el @@ -8,7 +8,7 @@ ;; Time-stamp: ;; Download: ;; HTMLised: -;; 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 diff --git a/04-w3-sy.el b/04-w3-sy.el index f1d1a20..efad85a 100644 --- a/04-w3-sy.el +++ b/04-w3-sy.el @@ -8,7 +8,7 @@ ;; Time-stamp: ;; Download: ;; HTMLised: -;; 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 diff --git a/05-latex-sy.el b/05-latex-sy.el index e18a1bb..18fc584 100644 --- a/05-latex-sy.el +++ b/05-latex-sy.el @@ -5,10 +5,10 @@ ;; Author: Steve Youngs ;; Maintainer: Steve Youngs ;; Created: <2007-12-02> -;; Time-stamp: +;; Time-stamp: ;; Download: ;; HTMLised: -;; 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 @@ -73,6 +73,7 @@ ;; 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 @@ -193,13 +194,13 @@ Replacement for count-lines-region." " " (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") @@ -212,19 +213,12 @@ Replacement for count-lines-region." '("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 @@ -235,16 +229,16 @@ Replacement for count-lines-region." ;:*======================= ;:* 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! diff --git a/06-tex-site-sy.el b/06-tex-site-sy.el index 598845f..564ad59 100644 --- a/06-tex-site-sy.el +++ b/06-tex-site-sy.el @@ -5,10 +5,10 @@ ;; Author: Steve Youngs ;; Maintainer: Steve Youngs ;; Created: <2007-12-02> -;; Time-stamp: +;; Time-stamp: ;; Download: ;; HTMLised: -;; 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 @@ -64,32 +64,35 @@ 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) @@ -107,6 +110,8 @@ shared by all users of a site." (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") diff --git a/07-html-sy.el b/07-html-sy.el index b9cabfe..da7f80d 100644 --- a/07-html-sy.el +++ b/07-html-sy.el @@ -8,7 +8,7 @@ ;; Time-stamp: ;; Download: ;; HTMLised: -;; 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 diff --git a/08-sounds-sy.el b/08-sounds-sy.el index b9b77c0..fb2786f 100644 --- a/08-sounds-sy.el +++ b/08-sounds-sy.el @@ -8,7 +8,7 @@ ;; Time-stamp: ;; Download: ;; HTMLised: -;; 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 diff --git a/09-toolbar-sy.el b/09-toolbar-sy.el index 159b871..c77d24a 100644 --- a/09-toolbar-sy.el +++ b/09-toolbar-sy.el @@ -8,7 +8,7 @@ ;; Time-stamp: ;; Download: ;; HTMLised: -;; 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 diff --git a/10-pkgs-sy.el b/10-pkgs-sy.el index 836205f..a6b6ad7 100644 --- a/10-pkgs-sy.el +++ b/10-pkgs-sy.el @@ -5,10 +5,10 @@ ;; Author: Steve Youngs ;; Maintainer: Steve Youngs ;; Created: <2007-12-02> -;; Time-stamp: +;; Time-stamp: ;; Download: ;; HTMLised: -;; 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 @@ -58,7 +58,7 @@ ;;; Todo: ;; -;; +;; ;;; Code: ;:*====================== @@ -102,52 +102,25 @@ (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 @@ -159,11 +132,6 @@ 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) @@ -215,7 +183,7 @@ (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)) ;:*====================== @@ -245,7 +213,7 @@ (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) @@ -282,21 +250,21 @@ 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) @@ -339,7 +307,16 @@ ;:*====================== ;:* 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) @@ -351,14 +328,10 @@ ;:* 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 @@ -376,7 +349,7 @@ ;:* 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") @@ -388,43 +361,42 @@ 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. @@ -432,18 +404,18 @@ 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)) @@ -458,12 +430,12 @@ 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 () @@ -484,42 +456,42 @@ ; :* 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/") @@ -529,23 +501,6 @@ (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 @@ -557,7 +512,7 @@ (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 @@ -662,9 +617,6 @@ (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) @@ -677,25 +629,27 @@ ;; (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" @@ -703,7 +657,7 @@ (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) @@ -715,5 +669,31 @@ ;(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") diff --git a/11-cal-sy.el b/11-cal-sy.el index d00943d..3274686 100644 --- a/11-cal-sy.el +++ b/11-cal-sy.el @@ -5,10 +5,10 @@ ;; Author: Steve Youngs ;; Maintainer: Steve Youngs ;; Created: <2007-12-02> -;; Time-stamp: +;; Time-stamp: ;; Download: ;; HTMLised: -;; 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 @@ -614,7 +614,7 @@ Ever-so-slightly modified to include the Easter Monday holiday." ;:*======================= ;:* 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) diff --git a/12-misc-sy.el b/12-misc-sy.el index 0ed9b7a..1b93220 100644 --- a/12-misc-sy.el +++ b/12-misc-sy.el @@ -5,10 +5,10 @@ ;; Author: Steve Youngs ;; Maintainer: Steve Youngs ;; Created: <2007-12-02> -;; Time-stamp: +;; Time-stamp: ;; Download: ;; HTMLised: -;; 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 @@ -82,39 +82,10 @@ 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 -(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. @@ -254,6 +225,12 @@ instead." ;;(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) @@ -275,7 +252,7 @@ instead." (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))))) @@ -286,8 +263,10 @@ instead." ;:*====================== ;:* 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"))) @@ -405,7 +384,10 @@ instead." ("^/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. @@ -556,8 +538,8 @@ instead." (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) @@ -584,6 +566,7 @@ instead." (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" @@ -591,8 +574,8 @@ instead." "/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))) diff --git a/13-bbdb-sy.el b/13-bbdb-sy.el index 35c9890..ab1c80a 100644 --- a/13-bbdb-sy.el +++ b/13-bbdb-sy.el @@ -8,7 +8,7 @@ ;; Time-stamp: ;; Download: ;; HTMLised: -;; 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 diff --git a/14-fonts-sy.el b/14-fonts-sy.el index 2bb011e..8eeb910 100644 --- a/14-fonts-sy.el +++ b/14-fonts-sy.el @@ -5,10 +5,10 @@ ;; Author: Steve Youngs ;; Maintainer: Steve Youngs ;; Created: <2007-12-02> -;; Time-stamp: +;; Time-stamp: ;; Download: ;; HTMLised: -;; 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 @@ -56,6 +56,10 @@ ;; ;;; Code: +;:*======================= +;:* font-lock +(require 'font-lock) + ;:*======================= ;:* Turn on Lazy-(lock|shot) ;;; Lazy-lock diff --git a/15-supercite-sy.el b/15-supercite-sy.el index 6232578..ac7b3a9 100644 --- a/15-supercite-sy.el +++ b/15-supercite-sy.el @@ -8,7 +8,7 @@ ;; Time-stamp: ;; Download: ;; HTMLised: -;; 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 diff --git a/16-riece-sy.el b/16-riece-sy.el index 85a1ce0..d687685 100644 --- a/16-riece-sy.el +++ b/16-riece-sy.el @@ -5,10 +5,10 @@ ;; Author: Steve Youngs ;; Maintainer: Steve Youngs ;; Created: <2007-12-02> -;; Time-stamp: +;; Time-stamp: ;; Download: ;; HTMLised: -;; 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 @@ -82,7 +82,7 @@ "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) diff --git a/17-emchat-sy.el b/17-emchat-sy.el index 4a14133..c388dee 100644 --- a/17-emchat-sy.el +++ b/17-emchat-sy.el @@ -8,7 +8,7 @@ ;; Time-stamp: ;; Download: ;; HTMLised: -;; 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 @@ -243,7 +243,7 @@ ;; (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 -- 2.25.1