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/bash | |
EMACS_VER=28.1 | |
MACPORT_VER=9.0 | |
tar xvfz emacs-${EMACS_VER}.tar.gz | |
tar xvfz emacs-${EMACS_VER}-mac-${MACPORT_VER}.tar.gz | |
cd emacs-${EMACS_VER} | |
patch -p 1 < ../emacs-${EMACS_VER}-mac-${MACPORT_VER}/patch-mac | |
cp -r ../emacs-${EMACS_VER}-mac-${MACPORT_VER}/mac mac |
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
;; Add Resouce path(macOS) | |
(add-to-list 'Info-default-directory-list (expand-file-name "../info" data-directory)) | |
;; Add user local info path | |
(add-to-list 'Info-default-directory-list (expand-file-name "info" user-emacs-directory)) |
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 my-jump-brace() | |
"対応括弧へジャンプ" | |
(interactive) | |
(let ((c (following-char)) | |
(p (preceding-char))) | |
(if (eq (char-syntax c) 40) (forward-list) | |
(if (eq (char-syntax p) 41) (backward-list) | |
(backward-up-list))))) |
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 my-buffer-mode (buffer-or-string) | |
"Returns the major mode associated with a buffer. | |
to see http://stackoverflow.com/questions/2238418/emacs-lisp-how-to-get-buffer-major-mode" | |
(with-current-buffer buffer-or-string | |
major-mode)) | |
(defun my-dired-directory (buffer-or-string) | |
"Dired-modeのpathを取得" | |
(with-current-buffer buffer-or-string | |
dired-directory)) |
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
#include <map> | |
#include <functional> | |
std::map<int, std::function<void ()>> func; | |
struct Hoge { | |
void f() {} | |
}; | |
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 my-color-rgb-to-hsv (r g b) | |
"RGB[0.0, 1.0]からHSV[0.0, 1.0]へ変換する (SOURCE:Wikipedia)" | |
(let* ((max (max r g b)) | |
(min (min r g b)) | |
(h (- max min)) | |
(s (- max min)) | |
(v max)) | |
(if (> h 0.0) | |
(cond ((= max r) | |
(progn |
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 my-color-hsv-to-rgb (h s v) | |
"HSV[0.0, 1.0]からRGB[0.0, 1.0]へ変換する (SOURCE:Wikipedia)" | |
(let ((r v) | |
(g v) | |
(b v)) | |
(if (> s 0) | |
(progn | |
(setq h (* h 6)) | |
(let* ((i (truncate h)) | |
(f (- h i))) |
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
--- src/lisp.h.orig 2014-11-19 15:00:20.843528000 +0900 | |
+++ src/lisp.h 2014-11-19 15:07:48.693175100 +0900 | |
@@ -2810,7 +2810,11 @@ | |
/* A platform that uses neither _longjmp nor siglongjmp; assume | |
longjmp does not affect the sigmask. */ | |
typedef jmp_buf sys_jmp_buf; | |
+#if defined __MINGW64__ && defined __clang__ | |
+# define sys_setjmp(j) _setjmp (j, NULL) | |
+#else | |
# define sys_setjmp(j) setjmp (j) |
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 my-insert-newline-and-indent(arg) | |
"カーソル行の上や下に一行挿入してインデント(前置引数が4だと下の行に挿入)" | |
(interactive "p") | |
(let ((p (if (eq arg 4) | |
2 | |
1))) | |
(move-beginning-of-line p) | |
(open-line 1) | |
(indent-for-tab-command))) |
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 my-set-encoding () | |
"新規ファイル生成時のみ、エンコードを強制する Thanks for Syohei YOSHIDA" | |
(let ((bufname (buffer-file-name))) | |
(when (not (file-exists-p buffer-file-name)) | |
(when (and bufname (string-match-p ".+\\.\\(cpp\\|c\\|hpp\\|h\\|mm\\)$" bufname)) | |
(set-buffer-file-coding-system 'utf-8-with-signature))))) | |
(add-hook 'find-file-hook 'my-set-encoding) |
NewerOlder