Skip to content

Instantly share code, notes, and snippets.

agzam / diff-last-two-kills.el
Last active Jul 27, 2020
Diff last couple of things in the kill ring
View diff-last-two-kills.el
(defun diff-last-two-kills (&optional ediff?)
"Diff last couple of things in the kill-ring. With prefix open ediff."
(interactive "P")
(let* ((old "/tmp/old-kill")
(new "/tmp/new-kill")
(prev-ediff-quit-hook ediff-quit-hook))
(cl-flet ((kill-temps
(dolist (f (list old new))
(kill-buffer (find-buffer-visiting f)))
agzam /
Last active Jun 30, 2020
Customize org-insert-link
agzam / ibuffer-unsaved-files.el
Last active Mar 27, 2020
Custom iBuffer filter for unsaved buffers
View ibuffer-unsaved-files.el
(define-ibuffer-filter unsaved-file-buffers
"Toggle current view to buffers whose file is unsaved."
(:description "file is unsaved")
(ignore qualifier)
(and (buffer-local-value 'buffer-file-name buf)
(buffer-modified-p buf)))
(define-key ibuffer-mode-map (kbd "/ u") #'ibuffer-filter-by-unsaved-file-buffers)
agzam / find-message.el
Last active Jun 30, 2020
Mu4e action to find a message in mailing list archives
View find-message.el
;; If you subscribed to mailing list(s) in or
;; and using mu4e as your mailing app, very often you need to
;; find a message in or
;; For example, when you don't have the context of a particular thread
;; and all prior messages got deleted locally.
;; This mu4e action allows you
;; to quickly find selected email post in the archive
;; and open in the browser
agzam / toggle-frame-maximized-undecorated.el
Last active Dec 18, 2019
Maximized undecorated (title-less) Emacs frame with no gaps around
View toggle-frame-maximized-undecorated.el
(defun toggle-frame-maximized-undecorated ()
(let* ((frame (selected-frame))
(on? (and (frame-parameter frame 'undecorated)
(eq (frame-parameter frame 'fullscreen) 'maximized)))
(geom (frame-monitor-attribute 'geometry))
(x (first geom))
(y (second geom))
(display-height (first (last geom))))
(if on?
agzam / diff-buffers.el
Last active Jun 30, 2020
Diff two buffers
View diff-buffers.el
(defun diff-buffers (buffer-A buffer-B)
"Diff two buffers."
(let* ((only-two? (eq 2 (count-windows)))
(wins (sort (window-list)
(lambda (a b) (< (window-use-time a)
(window-use-time b)))))
(b1 (if only-two?
(window-buffer (first wins))
(read-buffer "Buffer A to compare")))
agzam / all ex
Last active Apr 13, 2020
All ex commands
View all ex

Keybase proof

I hereby claim:

  • I am agzam on github.
  • I am agzam ( on keybase.
  • I have a public key whose fingerprint is E099 A300 39C1 2143 0579 BA65 CFE1 2444 AF47 BD1D

To claim this, I am signing this object:

You can’t perform that action at this time.