Showing posts with label emacs. Show all posts
Showing posts with label emacs. Show all posts

Thursday, October 11, 2018

emoji

to get emoji in emacs
apt-get install ttf-ancient-fonts

Thursday, June 16, 2016

transparency of emacs in xmonad

To enable transparency run

xcompmgr -c &


 and in emacs


(set-frame-parameter (selected-frame) 'alpha '(85 . 50))
 (add-to-list 'default-frame-alist '(alpha . (85 . 50)))

sources:

https://www.emacswiki.org/emacs/TransparentEmacs

https://wiki.haskell.org/Xmonad/Frequently_asked_questions#How_do_I_use_compositing_with_xmonad.3F

Thursday, May 12, 2016

auto complete for ein

if
(setq ein:use-auto-complete t)

gives the error
symbol's function definition is void: ac-define-source

then install auto-complete in emacs
(it comes automatically if you install ac-anaconda)


M-x elpy- config tells what is not installed
install it with pip

source:
https://realpython.com/blog/python/emacs-the-best-python-editor/

Friday, April 22, 2016

ein ipython notebook

ein does not work when the system variables http_proxy and https_proxy are set.

ein:notebooklist-open

gives the error

REQUEST [error] Error (error) while connecting to http://127.0.0.1:8888/api/contents.
REQUEST [error] Callback is not called when stopping process! Explicitly calling from timer.
ein: [error] Content list call http://127.0.0.1:8888/api/contents/ failed with status timeout.

remove the variables and set the proxies manually.

For ELPA:
(setq url-proxy-services '(("no_proxy" . "127.0.0.1")
                           ("http" . "myproxy.com:8080")))

For erc:
(setq socks-noproxy '("localhost"))
(require 'socks)
(setq erc-server-connect-function 'socks-open-network-stream)
(setq socks-server (list "proxyIdentifier" "myproxy.com" 8080 5))

where 5 is the SOCKS version (can be 4)

to have inline images in emacs, libraries for the images are required, otherwise the following error is reported

Error (websocket): in callback `on-message': error: "Not an image: nil"

in windows
copy bin/libpng16-16.dll and bin/zlib1.dll of
https://sourceforge.net/projects/ezwinports/files/libpng-1.6.12-w32-bin.zip/download

to emacs's bin directory

To enable / disable transparent plots:

import matplotlib
matplotlib.rcParams["figure.facecolor"]=(1,1,1,x)
matplotlib.rcParams["axes.facecolor"]=(1,1,1,x)
where x is the alpha (0 for transparent, 1 for fully opaque)


sources:
 https://www.emacswiki.org/emacs/UrlPackage
https://www.emacswiki.org/emacs/ErcProxy
http://stackoverflow.com/questions/2650041/emacs-under-windows-and-png-files

Tuesday, November 4, 2014

emacs open file directly

remove the initial help / splash screen by adding

;; prevent silly initial splash screen
(setq inhibit-splash-screen t)

to .emacs

source:
http://www.win.tue.nl/~aeb/linux/misc/emacs.html


Friday, October 18, 2013

japanese latex



dvipdfmx
** ERROR ** Could not find encoding file "H".

solution:
sudo apt-get install cmap-adobe-japan1


No file C40song.fd.
solution:
sudo apt-get install latex-cjk-japanese latex-cjk-japanese-wadalab


open file as euc-jp in emacs:
C-x ret r
euc-jp
yes

Saturday, May 19, 2012

emacs japanese

c-x ret r for changing the encoding of an already opened file
x-x ret f for changing the encoding for saving the file

sudo apt-get install  anthy-el

then, in emacs

m-x load-library:
  anthy

and c-\  :
  japanese-anthy

 =========
for mozc

sudo apt-get install emacs-mozc emacs-mozc-bin







and in emacs add


(require 'mozc)
;; or (load-file "/path/to/mozc.el")
(set-language-environment "Japanese")
(setq default-input-method "japanese-mozc")
(prefer-coding-system 'utf-8) 
 
for key mode change (USE FCITX,NOT IBUS)
dconf-editor, org.gnome.desktop.input-sources sources should read
[('fcitx', 'mozc-jp')]
(global-set-key (kbd "<zenkaku-hankaku>") 'toggle-input-method)


for cursor color depending on the input mode
;; Change cursor color according to mode
    (defvar hcz-set-cursor-color-color "")
    (defvar hcz-set-cursor-color-buffer "")
    (defun hcz-set-cursor-color-according-to-mode ()
      "change cursor color according to some minor modes."
      ;; set-cursor-color is somewhat costly, so we only call it when needed:
      (let ((color
             (if buffer-read-only "white"
               (if mozc-mode "red"
                 saved-cursor-color))))
        (unless (and
                 (string= color hcz-set-cursor-color-color)
                 (string= (buffer-name) hcz-set-cursor-color-buffer))
          (set-cursor-color (setq hcz-set-cursor-color-color color))
          (setq hcz-set-cursor-color-buffer (buffer-name)))))
    (add-hook 'post-command-hook 'hcz-set-cursor-color-according-to-mode)





sources:
http://d.hatena.ne.jp/kitokitoki/20120925/p2
https://www.emacswiki.org/emacs/ChangingCursorDynamically
https://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Binding-Commands.html

Wednesday, January 11, 2012

Sunday, November 20, 2011

black emacs .emacs


;; ========== Line by line scrolling ==========

;; This makes the buffer scroll by only a single line when the up or
;; down cursor keys push the cursor (tool-bar-mode) outside the
;; buffer. The standard emacs behaviour is to reposition the cursor in
;; the center of the screen, but this can make the scrolling confusing

(setq scroll-step 1)

;; ========== Enable Line and Column Numbering ==========

;; Show line-number in the mode line
(line-number-mode 1)

;; Show column-number in the mode line
(column-number-mode 1)

;; Set region background colour
(set-face-background 'region "blue")

;; Set emacs background colour
(set-background-color "black")
(set-foreground-color "white")


(setq default-frame-alist
      (append default-frame-alist
       '((foreground-color . "white")
 (background-color . "black")
 (cursor-color . "SkyBlue")
 )))


(add-to-list 'auto-mode-alist '("\\.h\\'" . c++-mode))