diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 3dea91e..099f2b1 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -752,6 +752,16 @@ If no direction is given, don't split." (define-key yas-minor-mode-map [(tab)] nil) (define-key yas-minor-mode-map (kbd "C-\\") 'yas-expand)) +(defun multiplication-table (number &optional upto) + "" + (interactive "nMultiplication table for: \nP") + (let ((upto (or upto 10)) + (buffer (get-buffer-create "*Multiplication*"))) + (with-current-buffer buffer + (erase-buffer) + (cl-loop for i from 1 to upto do (insert (format "%5d: %d\n" i (* number i))))) + (pop-to-buffer buffer))) + ;;;; Tests (stante-after ert