This file contains hidden or 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
;; set font per language | |
;; default | |
(set-face-attribute | |
'default nil :font "Inconsolata 14") | |
;; chinese | |
(dolist (charset '(han)) | |
(set-fontset-font (frame-parameter nil 'font) | |
charset | |
(font-spec :family "Microsoft Yahei" :size 14))) |
This file contains hidden or 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
;; diff --git a/melpa-autoloads.el b/melpa-autoloads.el | |
(defadvice package--add-to-archive-contents (around package-filter-add-to-archive-contents (package archive) activate compile) "\ | |
Add filtering of available packages using `package-filter-function', | |
-if non-nil." (when (and package-filter-function (funcall package-filter-function (car package) (package-desc-vers (cdr package)) archive)) ad-do-it)) | |
+if non-nil." (when (and package-filter-function (funcall package-filter-function (car package) (package--ac-desc-version (cdr package)) archive)) ad-do-it)) | |
;; diff --git a/melpa.el b/melpa.el | |
@@ -84,7 +84,7 @@ if non-nil." |
This file contains hidden or 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
public static String stringByAddingPercentEscapesUsingEncoding(String input, String encoding) | |
throws UnsupportedEncodingException { | |
byte[] inputBytes = input.getBytes(encoding); | |
StringBuilder stringBuilder = new StringBuilder(inputBytes.length); | |
for(int i = 0; i < inputBytes.length; ++i) { | |
int charByte = inputBytes[i] < 0 ? inputBytes[i] + 256 : inputBytes[i]; | |
if( charByte <= 0x20 || charByte >= 0x7F || | |
(charByte == 0x22 || charByte == 0x25 || charByte == 0x3C || | |
charByte == 0x3E || charByte == 0x20 || charByte == 0x5B || | |
charByte == 0x5C || charByte == 0x5D || charByte == 0x5E || |
This file contains hidden or 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
diff --git a/src/nsfont.m b/src/nsfont.m | |
index c0bea2e..a5fc570 100644 | |
--- a/src/nsfont.m | |
+++ b/src/nsfont.m | |
@@ -560,10 +560,7 @@ ns_findfonts (Lisp_Object font_spec, BOOL isMatch) | |
if (isMatch) | |
[fkeys removeObject: NSFontFamilyAttribute]; | |
- if ([fkeys count] > 0) | |
- matchingDescs = [fdesc matchingFontDescriptorsWithMandatoryKeys: fkeys]; |
This file contains hidden or 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
// from: http://deusty.blogspot.com/2007/07/gzip-compressiondecompression.html | |
- (NSData *)gzipInflate | |
{ | |
if ([self length] == 0) return self; | |
unsigned full_length = [self length]; | |
unsigned half_length = [self length] / 2; | |
NSMutableData *decompressed = [NSMutableData dataWithLength: full_length + half_length]; |
This file contains hidden or 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 enter-my-chinese-writing-mode () | |
"Set font in current buffer" | |
(interactive) | |
(setq buffer-face-mode-face '(:family "Microsoft YaHei")) | |
(buffer-face-mode)) | |
(defun leave-my-chinese-writing-mode () | |
"Unset buffer face" | |
(interactive) | |
(buffer-face-mode -1)) |
This file contains hidden or 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
function rm () { | |
local path | |
for path in "$@"; do | |
# ignore any arguments | |
if [[ "$path" = -* ]]; then : | |
else | |
local dst=${path##*/} | |
# append the time if necessary | |
while [ -e ~/.Trash/"$dst" ]; do | |
dst="$dst "$(date +%H-%M-%S) |
This file contains hidden or 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
;;------------------------------------------------------------------------;; | |
;; EasyPG | |
;; Cache passphrase for symmetirc encryption, | |
;; it remember your passphrase util exit emacs, kinda not safe | |
;; (setq epa-file-cache-passphrase-for-symmetric-encryption t) | |
;; Enable autosave, I always disable autosave | |
;; (setq epa-file-inhibit-auto-save nil) | |
;;------------------------------------------------------------------------;; |
This file contains hidden or 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
(add-hook 'c-mode-common-hook | |
(lambda () | |
(make-face-unitalic 'font-lock-comment-face))) |
This file contains hidden or 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
(setenv "PATH" | |
(concat | |
"/usr/local/bin" | |
":" | |
(getenv "PATH"))) | |
(setenv "LANG" "en_US.UTF-8") |
NewerOlder