This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun callit (fun) | |
(message "Value: %S" (funcall fun))) | |
(dolist (foo '(1 2 3)) | |
(callit (lambda () | |
foo))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# check.sh origin | |
# | |
# This will fetch commits from origin, and then display the log of | |
# changes from origin back to when it first deviated from the current | |
# branch. | |
if [ -z "$1" ] | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun sontek-delete-multiple-spaces-or-normal-backspace () | |
(interactive) | |
(if (looking-back " ") | |
(delete-backward-char 4) | |
(delete-backward-char 1))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defsubst url-port (urlobj) | |
"Return the port number for the URL specified by URLOBJ." | |
(declare (gv-setter (lambda (port) `(setf (url-portspec ,urlobj) ,port)))) | |
(or (url-portspec urlobj) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun tracking-ignored-p (buffer faces) | |
"Return non-nil when BUFFER with FACES shouldn't be tracked. | |
This uses `tracking-ignored-buffers'. Actual returned value is | |
the entry from tracking-ignored-buffers that causes this buffer | |
to be ignored." | |
(catch 'return | |
(let ((buffer-name (buffer-name buffer))) | |
(dolist (entry tracking-ignored-buffers) | |
(if (stringp entry) | |
(and (string-match entry buffer-name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;;;;;;;;;;;;;;; | |
;;; markdown-mode | |
(when (require 'markdown-mode nil t) | |
(setq markdown-command "markdown_py" | |
markdown-italic-underscore t | |
markdown-indent-on-enter nil | |
markdown-follow-wiki-link-on-enter nil | |
) | |
(add-to-list 'auto-mode-alist '("\\.md" . markdown-mode)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun hash-items (tab) | |
(let ((r nil)) | |
(maphash (lambda (k v) | |
(setq r (cons (cons k v) r))) | |
tab) | |
r)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun search-word-at-point () | |
"Search and move point to the next occurrence of the word at point." | |
(interactive) | |
;; This code is a bit more complex than it should be, mainly to get | |
;; the "intuitive" result in all cases. `thing-at-point' does not, | |
;; for example. | |
(let (beg end word found) | |
(setq start (point)) | |
(save-excursion | |
(cond |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun search-symbol-at-point () | |
"Search and move point to the next occurrence of the symbol at point." | |
(interactive) | |
;; This code is a bit more complex than it should be, mainly to get | |
;; the "intuitive" result in all cases. `thing-at-point' does not, | |
;; for example. | |
(let (beg end symbol found) | |
(setq start (point)) | |
(save-excursion | |
(cond |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun lui-scroll-window (window display-start) | |
"Scroll the input line to the bottom of the WINDOW. | |
DISPLAY-START is passed by the hook `window-scroll-functions' and | |
is ignored. | |
See `lui-scroll-behavior' for how to customize this." | |
(when (and (eq lui-scroll-behavior 'post-scroll) | |
window | |
(window-live-p window)) |
OlderNewer