Skip to content

Instantly share code, notes, and snippets.

@leoliu
leoliu / gist:afb14ec7705790d11c446a5e789cafe1
Created January 1, 2019 10:55
swi-prolog homebrew build log
2019-01-01 18:43:42 +0800
echo 3 | ./prepare
sh: ./prepare: No such file or directory
HOMEBREW_VERSION: 1.8.6
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 858c5e1afb0eb00079a4f014e8fbedf9065d50e4
Last commit: 2 weeks ago
@leoliu
leoliu / pcase.el
Created December 24, 2016 01:56
The version of pcase.el that I used with Emacs 24.x
;;; pcase.el --- ML-style pattern-matching macro for Elisp -*- lexical-binding: t; coding: utf-8 -*-
;; Copyright (C) 2010-2015 Free Software Foundation, Inc.
;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords:
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
@leoliu
leoliu / pr.md
Created April 28, 2016 08:59 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

diff --git a/controls/cf_serverd.cf b/controls/cf_serverd.cf
index 7a8c2201..e1490d42 100644
--- a/controls/cf_serverd.cf
+++ b/controls/cf_serverd.cf
@@ -50,7 +50,7 @@ body server control
cfruncommand => "$(def.cf_runagent_shell) -c \"$(sys.cf_agent) -f $(sys.update_policy_path)\" ; $(sys.cf_agent)";
!(windows|hpux|aix|solaris)::
- cfruncommand => "$(def.cf_runagent_shell) -c \"$(sys.cf_agent) -f $(sys.update_policy_path)\" ; $(sys.cf_agent)";
+ cfruncommand => "@(def.cf_runagent_shell) -c \"$(sys.cf_agent) -f $(sys.update_policy_path)\" ; $(sys.cf_agent)";
@leoliu
leoliu / gist:9508659
Created March 12, 2014 14:58
ggtags.diff
diff --git a/ggtags.el b/ggtags.el
index fa007a9f..1584f8b3 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -1128,6 +1128,7 @@ (defvar ggtags-navigation-map
(define-key map "\M-{" 'ggtags-navigation-previous-file)
(define-key map "\M->" 'ggtags-navigation-last-error)
(define-key map "\M-<" 'ggtags-navigation-first-error)
+ (define-key map "\C-hr" 'ggtags-navigation-rename-buffer)
(define-key map "\C-c\C-k"
diff --git a/elisp/erl-service.el b/elisp/erl-service.el
index fa23aed1..73dcc58e 100644
--- a/elisp/erl-service.el
+++ b/elisp/erl-service.el
@@ -25,11 +25,9 @@ (defvar erl-nodename-history nil
"The historical list of node names that have been selected.")
(defun erl-target-node ()
- "Return the name of the default target node for commands.
-Force node selection if no such node has been choosen yet, or when
@leoliu
leoliu / gist:8466231
Last active January 3, 2016 12:59
ack.diff
diff --git a/ack.el b/ack.el
index 3b7e25dc..8eb1fa4d 100644
--- a/ack.el
+++ b/ack.el
@@ -282,7 +282,11 @@ (define-compilation-mode ack-mode "Ack"
nil '(((lambda (limit)
(let ((beg (marker-position ack--ansi-color-last-marker)))
(move-marker ack--ansi-color-last-marker limit)
- (ansi-color-apply-on-region beg ack--ansi-color-last-marker))
+ (ansi-color-apply-on-region beg ack--ansi-color-last-marker)
@leoliu
leoliu / gctags
Last active October 6, 2017 00:58
gctags
#!/bin/bash
export GTAGSLABEL=ctags
if [ -r $PWD/.globalrc ]; then
GTAGSCONF=$PWD/.globalrc
elif [ -r $HOME/.globalrc ]; then
GTAGSCONF=$HOME/.globalrc
elif [ -r /usr/local/share/gtags/gtags.conf ]; then
GTAGSCONF=/usr/local/share/gtags/gtags.conf
@leoliu
leoliu / gist:5193415
Created March 19, 2013 03:05
Add sharpsign dot #. for read-time evaluation
commit 0cdc60320269e696c18e9423c2f0e15b52beeb81
Author: Leo Liu <sdl.web@gmail.com>
Date: Sun Mar 4 09:22:57 2012 +0800
Add sharpsign dot #. for read-time evaluation
---
src/lread.c | 2 ++
1 file changed, 2 insertions(+)
Modified src/lread.c
@leoliu
leoliu / gist:4035971
Created November 8, 2012 01:48
Another way to address the ido flex matching performance problem (bug#12796)
From 0aa950d6989e4129c53390422dcd1173189082e7 Mon Sep 17 00:00:00 2001
From: Leo Liu <sdl.web@gmail.com>
Date: Wed, 7 Nov 2012 21:14:45 +0800
Subject: [PATCH] Optimise flex matching with ido-chars-in-string
---
lisp/ido.el | 26 ++++++++++++++++++++------
1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/lisp/ido.el b/lisp/ido.el