Auto-insert snippet for python emacs

A small skeleton you can put into your python emacs editing session: ;; insert python skeleton with auto-insert (eval-after-load ‘autoinsert ‘(define-auto-insert ‘(“\\.\\py\\'” . “python skeleton”) ‘(“” “#!/usr/bin/env python” \n “# ” (file-name-nondirectory (buffer-file-name)) \n \n “def main():” \n “pass” \n \n “if __name__ == ‘__main__’:” \n “main()” \n \n)))

Build emacs 25 rpm for redhat / centos 7

This is for the console only (no graphical xwindows) version. Installs into /opt/emacs253 so can run side-by-side with system emacs. # Download emacs tarball & untar ./configure –prefix=/opt/emacs253 –with-gif=no –with-tiff=no –with-x-toolkit=no \ –with-xpm=no –with-jpeg=no –with-png=no # install any dependencies & build make make DESTDIR=/tmp/emacs install # Install fpm (gem install fpm) to build package fpm …

Continue reading ‘Build emacs 25 rpm for redhat / centos 7’ »

Another useful emacs package: crux

Contains various helper functions including crux-duplicate-and-comment-current-line-or-region for when you want to rework a line of code but keep the original. I’ve added these shortcuts: ;; crux (global-set-key (kbd “C-c I”) #’crux-find-user-init-file) (global-set-key (kbd “C-c r”) #’crux-rename-file-and-buffer) (global-set-key (kbd “C-c d”) #’crux-duplicate-current-line-or-region) (global-set-key (kbd “C-c M-d”) #’crux-duplicate-and-comment-current-line-or-region) (global-set-key (kbd “C-c n”) #’crux-cleanup-buffer-or-region)