Coder Social home page Coder Social logo

redguardtoo / emacs.d Goto Github PK

View Code? Open in Web Editor NEW
2.4K 193.0 620.0 43.41 MB

Fast and robust Emacs setup.

Home Page: http://blog.binchen.org

License: GNU General Public License v3.0

Emacs Lisp 93.94% Shell 0.01% Roff 0.09% YASnippet 5.90% Makefile 0.06% Vim Snippet 0.01%
emacs-lisp

emacs.d's Introduction

A fast and robust Emacs setup

https://github.com/redguardtoo/emacs.d/actions/workflows/test.yml/badge.svg

  • Fast
  • Robust. Packages could be installed without network
  • Support Windows. Find&Grep needs only minimum setup on Windows
  • Tested with Emacs 27.2, 28.1 on Linux/Windows10/Cygwin/macOS/WSL(Windows Subsystem for Linux)
  • Vanilla key bindings and directory layout is respected
  • Works in emacs-nox and PuTTY

demo.png

Table of Content

Checklist

  • Emacs 27 or higher version is required
  • Please read FAQ to disable Vim key bindings
  • Please read section “Key bindings” to learn key bindings
  • Windows users had better download the version with dependencies bundled. For example, download “emacs-27.2-x86_64.zip” instead of “emacs-27.2-x86_64-no-deps.zip”
  • Unstable packages from MELPA are invisible but stable packages from MELPA Stable are visible. Please modify variable melpa-include-packages in lisp/init-elpa.el to install unstable packages
  • Other issues are covered in FAQ

Installation

Please remove ~/.emacs first. ~ means Home directory.

Most users need follow the section “Install in normal way”.

Section “Install stable version” is useful if and only if,

  • You don’t have network access
  • You have never used any command line program

Install packages from remote repository (RECOMMENDED)

There are two ways to install this setup (I recommend the first way):

First way is to download latest setup and extract its content into ~/.emacs.d, OR run command cd ~; git clone https://github.com/redguardtoo/emacs.d.git .emacs.d in shell.

Second way is to use stable setup, or run command cd ~; git clone https://github.com/redguardtoo/emacs.d.git .emacs.d; cd .emacs.d; git reset --hard stable in shell.

By default, packages are installed automatically during Emacs startup.

Someone reported that package repository http://melpa.org is not responsive in China.

No worries. You could answer “YES” to the question “Switch to faster package repositories in China temporarily?” after firing Emacs. Please note after startup you could change variable package-archives in init-elpa.el to permanently switch to Chinese repositories.

Install packages from stable local repository (OPTIONAL)

Now you are using local package repository ~/myelpa.

You can switch to online repositories like http://elpa.gnu.org or http://melpa.org by modifying lisp/init-elpa.el.

Install everything in one step (OPTIONAL)

Download content of https://github.com/redguardtoo/my-emacs.d-snapshot into ~/.emacs.d. That’s it.

It’s not recommended for daily usage because the third party packages are not optimized for latest Emacs.

Third party programs (OPTIONAL)

Install

Most command line programs can be installed through default package manager.

Default package manager could be:

  • apt-cyg at Cygwin
  • package manager of MSYS2
  • homebrew at macOS
  • any package manager at Linux (apt on Debian/Ubuntu, yum on Redhat, pacman on Arch, emerge on Gentoo …)

Some package managers allow you to install the program for current user. For example, python package manager pip has the option ”–user”.

List of command line programs

These programs are OPTIONAL.

Please ignore error message related to command line programs. For example, if aspell and hunspell are not installed, you can ignore all the flyspell error messages.

fortune-zh or fortune

Show ancient Chinese poem or quotes from random sources. Please note you can’t install fortune-zh through homebrew on macOS.

But there is a simple workaround:

  • Install fortune
  • Download fortune-zh code from https://github.com/debiancn/fortune-zh
  • Extract code and run make in its folder
  • copy data files and the script named fortune-zh into corresponding folders which fortune is using. You may need edit the file fortune-zh before copying

aspell or hunspell

  • Required by flyspell

xmlstarlet or xml

  • Required by lazyflymake for HTML syntax check.

identify from ImageMagick

  • Required by org-mode to export org file to odt contain images

zip and unzip

  • Required by org-mode to export org file to odt file

xsel or xclip

  • Required by my clipboard command copy-to-x-clipboard and paste-from-x-clipboard under Linux
  • Required by cpputils-cmake, company-clang from company-mode
  • If you use cpputils-cmake and cmake, cpputils-cmake will do all the setup for you. You need not read next item! But please spend a few minutes to learn the basics of cmake! There is a one minute step-by-step-guide in README of cpputils-cmake to teach you how to use cmake.
  • If you use company-clang, add (setq company-clang-arguments '("-I/example1/dir" "-I/example2/dir")) into init.el

Pandoc

  • Required by markdown-preview from markdown-mode
  • It creates tags file for code navigation and code completion
  • Required by many tags related packages (xref, counsel-etags, company-ctags from company-mode, etc)
  • See How to use ctags in Emacs effectively
  • Required by counsel-gtags and company-gtags from company-mode
  • It creates index files for code navigation and auto-completion
  • Please read GNU Global manual about environment variables GTAGSLIBPATH and MAKEOBJDIRPREFIX

LibreOffice

  • Only its executable soffice is used for converting odt file into doc/pdf
  • Conversion happens automatically when exporting org-mode to odt
  • The conversion command is defined in variable org-export-odt-convert-processes

js-beautify

  • Beautify javascript code
  • Install pip through OS package manager, then pip install jsbeautifier

StarDict dictionaries

  • Cli program is not needed
  • Required by stardict.el
  • Run curl http://pkgs.fedoraproject.org/repo/pkgs/stardict-dic/stardict-dictd_www.dict.org_wn-2.4.2.tar.bz2/f164dcb24b1084e1cfa2b1cb63d590e6/stardict-dictd_www.dict.org_wn-2.4.2.tar.bz2 | tar jx -C ~/.stardict/dic and curl https://src.fedoraproject.org/repo/pkgs/stardict-dic/stardict-langdao-ec-gb-2.4.2.tar.bz2/41a71f5b3952709746dd7e52cf155b8b/stardict-langdao-ec-gb-2.4.2.tar.bz2 | tar jx -C ~/.stardict/dic to install English dictionaries
  • Optionally used by M-x counsel-etags-grep to search text in files
  • Run curl https://sh.rustup.rs -sSf | sh in shell to install Rust then cargo install ripgrep
  • Tweak environment variable PATH so Emacs can find ripgrep

ffmpeg

  • Some dired commands use ffmpeg to process video/audio

LanguageTool

Grammar, Style and Spell Checker

  • Download from https://languagetool.org/download/LanguageTool-stable.zip.
  • Used by Langtool. Check its README for usage. My setup is just one liner (setq langtool-language-tool-jar "/path/to/languagetool-commandline.jar")
  • Read the head of site-lisp/langtool/langtool.el for more customization because I patched it and added more features
  • Check syntax of shell script
  • Required by lazyflymake
  • Used by hydra in dired buffer
  • Used by my-pdfgrep-in-directory

Tutorial (OPTIONAL)

Knowledge of Linux/Unix is required. At least you need know the meanings of “environment variable”, “shell”, “stdin”, “stdout”, “man”, “info”.

Quickstart

Step 1, learn basics

At minimum you need know how Emacs interacts with other command line programs,

Step 2, read official tutorial

Press C-h t in Emacs (“C” means Ctrl key, “M” means Alt key) to read bundled tutorial.

At minimum, you need learn:

  • How to move cursor
  • C-h v to describe variable
  • C-h f to describe function
  • C-h k to describe command key binding

Step 3, know org-mode basics

Org-mode is for notes-keeping and planning.

Please watch Carsten Dominik’s talk. It’s really simple. The only hot key to remember is Tab.

Step 4, start from a real world problem

You can visit EmacsWiki for the solution. Newbies can ask for help at http://www.reddit.com/r/emacs/.

Step 5 (optional), improve your shell/cli skills

You could read free books/guides at The Linux Documentation Project.

Evil-mode tutorial

Required for vim user,

Methodology

See Master Emacs in One Year.

Usage

Original configuration from Emacs or third party packages are respected.

Quick start

On Windows, you need install Cygwin which provides command line programs to Emacs. Cygwin could be installed on any hard drive but it’s highly recommended don’t change it relative path to the root driver.

Install Ctags (Universal Ctags is better. Exuberant Ctags is fine). On Windows, you could install Ctags through Cygwin.

Run M-x counsel-etags-find-tag-at-point from counsel-etags to navigate code. It uses tags files created by ctags. Tags file will be automatically created/update when you start using counsel-etags.

Run M-x counsel-etags-grep to search text (grep) in project. Project root is automatically detected.

Run M-x find-file-in-project-by-selected from find-file-in-project to find file in project. Project root is automatically detected. You can also add one line setup in .emacs like (setq ffip-project-root "~/proj1/").

Code auto-completion works out of box by using tags file created by Ctags. You need run counsel-etags at least once to fire up Ctags. company-ctags from company-mode provides the candidates for auto completion. No manual setup is required.

Please grep in the directory ~/.emacs.d/lisp if you have any further questions on setup.

Better runtime performance

Why opening file is slow

Insert below code into ~/.custom.el, replace “/home/user1/your-file-path” with the file you want to open,

(defun profile-open-file ()
  (interactive)
  (profiler-start 'cpu)
  (find-file "/home/user1/your-file-path")
  (profiler-report)
  (profiler-stop))

Run M-x profile-open-file and read the report.

Key bindings

Don’t memorize any key binding. Try M-x any-command-in-emacs and hint for its key binding is displayed.

Most key bindings are defined in lisp/init-evil.el, a few key in lisp/init-hydra.el which uses Hydra.

Press C-c C-y anywhere to bring up default hydra menu.

The tutorials I recommended have enough information about commands.

Besides, ”How to be extremely efficient in Emacs” lists my frequently used commands.

Press kj to escape from evil-insert-state and everything else in Emacs. It’s much more efficient than ESC in Vim or C-g in Emacs. Search evil-escape in init-evil.el for details.

FAQ

Computers with smaller memory

Make sure you have this line in early-init.el or at the beginning of init.el,

(setq my-computer-has-smaller-memory-p t)

Vim vs Emacs

I prefer vim keybindings provided by EVIL.

But mixed style is also used in my workflow. See the function my-optimize-evil in init-evil.el.

You can insert (my-optimize-evil) into ~/.custom.el to enable it.

Backup packages

Run M-x elpamr-create-mirror-for-installed create a local repository from installed packages. See https://github.com/redguardtoo/elpa-mirror for more details.

Hardcore debug technique

This Emacs configuration is fast and robust.

So most tricky problems come from extra third party packages you installed.

Try Strace if you can’t resolve the issue by grepping the Emacs Lisp code.

Debug network request sent by Emacs,

strace -f -e trace=network -s 10000 -o ~/emacs-err.txt /usr/bin/emacs -nw

Debug system API call sent by Emacs,

strace -o ~/emacs-err.txt /usr/bin/emacs -nw

Spell check code

This configuration uses wucuo which is alternative of flyspell-mode and flyspell-prog-mode.

Wucuo is fast, reliable, and powerful. It’s better than any spell checking solutions of other text and IDE.

If you prefer your own spell check solution, insert below code to disable wucuo first,

(setq my-disable-wucuo t)

For further knowledge on spell checking, you could read my article and code in init-spelling.el.

Lock packages

Some packages are so important to my workflow that they are locked.

Those packages are placed at site-lisp/.

They will not be upgraded by package system.

Please make sure same package is not installed through elpa. Please check the content of directory “elpa/” in .emacs.d root.

How to install new packages?

I only use two package repositories,

If a package named MY-PKG exists in the stable repository, you only need one line setup,

(require-package 'MY-PKG)

This line could be placed in lisp/init-elpa.el or ~/.custom.el.

You’d better place everything related to MY-PKG into ~/.custom.el so the main stream change won’t impact your own configuration.

If the package does not exist in the stable repository, modify melpa-include-packages in lisp/init-elpa.el first.

I encourage you to read init-elpa.el to understand how packages are managed if you are good at Emacs Lisp,

Git blame current line

Run vc-msg-show.

If you select a region inside current line, the correct commit which submits the selected snippet is displayed instead of the latest commit touch the whole line.

Save/Load windows layout

SPC s s or M-x wg-create-workgroup to save windows layout. SPC l l or M-x wg-open-workgroup to load windows layout.

Use this configuration as merge tool for Git

This configuration might be the most efficient and most powerful merge tool for VCS. Insert below configuration into ~/.gitconfig,

[mergetool.ediff]
# use git mergetool ediff to resolve conflicts
cmd = emacs -nw -Q --eval \"(setq startup-now t)\" -l \"~/.emacs.d/init.el\" --eval \"(progn (setq ediff-quit-hook 'kill-emacs) (if (file-readable-p \\\"$BASE\\\") (ediff-merge-files-with-ancestor \\\"$LOCAL\\\" \\\"$REMOTE\\\" \\\"$BASE\\\" nil \\\"$MERGED\\\") (ediff-merge-files \\\"$LOCAL\\\" \\\"$REMOTE\\\" nil \\\"$MERGED\\\")))\"

Then run git mergetool -t ediff to resolve conflicts.

Here is my ~/.gitconfig. You can use https://github.com/redguardtoo/test-git-mergetool to practice.

Default terminal shell

Run M-x shell. If you use Zsh instead of Bash, please modify init-term-mode.el.

You can customize my-term-program whose default value is /bin/bash. It’s used by ansi-term.

Override default setup

Place your setup in ~/.custom.el which is loaded after other “*.el”.

So you can use any functions defined in my emacs configuration.

Here is a sample to override keybindings defined in lisp/init-evil.el,

(with-eval-after-load 'evil
  (my-space-leader-def
    "ss" 'pwd
    "ll" 'pwd
    "pp" 'pwd))

Code navigation

It’s usable out of box if Ctags is installed.

To navigate, M-x counsel-etags-find-tag-at-point.

To enable code auto-completion, M-x counsel-etags-scan-code at least once.

Optionally, you can add (add-hook 'after-save-hook 'counsel-etags-virtual-update-tags) into your .emacs to automatically update tags file.

No further setup is required.

Code auto-completion

I assume you are using company-mode. In this setup, users can press digit key to select the candidate from company-mode. To disabled this feature, (setq my-company-select-by-number-p nil). Please see my-company-zero-key-for-filter for more tips.

C++ auto-completion doesn’t work?

There are many ways to scan the C++ source files. company-clang from company-mode and Clang is good at handling C++.

If you use clang to parse the C++ code:

  • Make sure code is syntax correct
  • assign reasonable value into company-clang-arguments

Here is sample setup:

(setq company-clang-arguments '("-I/home/myname/projs/test-cmake" "-I/home/myname/projs/test-cmake/inc"))

In “friendly” Visual C++, similar setup is required.

You can use other backends instead of clang. For example, you can use company-gtags and GNU Global instead. See Emacs as C++ IDE, easy way for details.

Auto-completion for other languages

It’s similar to C++ setup. Since GNU Global supports many popular languages, you can use company-gtags.

For languages GNU Global doesn’t support, you can fall back to company-ctags and Ctags. Ctags configuration file is ~/.ctags.

You can also complete line by M-x eacl-complete-line and complete multi-lines statement by M-x eacl-complete-multiline.

Color theme

Auto load classic color theme

Add below code to ~/.custom.el to load a random classic dark color theme during startup,

(setq my-enable-startup-color-theme-p t)

If you prefer using your own color theme, you don’t need above line.

Preview color theme

Check https://emacsthemes.com/.

Write down the name of color theme (for example, molokai).

Setup color theme manually (recommended)

You can M-x counsel-load-theme to switch themes.

Or you can insert below code into end of ~/.custom.el or init.el,

;; Please note the color theme's name is "molokai"
(load-theme 'molokai t)

You can also run M-x random-color-theme to load random color theme.

Use color theme in terminal

Use 256 colors is just one CLI without any extra setup,

TERM=xterm-256color emacs -nw

True colors in terminal Emacs

Grep/Replace text in project

Many third party plugins bundled in this setup have already provided enough features. For example, if you use git, counsel-git-grep from package counsel/ivy works out of the box.

A generic grep program counsel-etags-grep is also provided. Since counsel-etags-grep is based on counsel/ivy, it also supports a magic called “multi-editing via Ivy”. You could read Nuclear weapon multi-editing via Ivy and Ag to get the idea.

Multi-edit workflow is optimized. After M-x counsel-etags-grep or pressing =,qq=, press C-c C-o C-x C-q to enable wgrep-mode. You can edit text (for example, delete lines) in wgrep-mode directly.

You can exclude multiple keywords using !keyword1 keyword2 in ivy.

Hydra/Swiper/Counsel/Ivy

I love all the packages from Oleh Krehel (AKA abo-abo). Every article from his blog is worth reading ten times.

You can input :pinyin1 pinyin2 !pinyin3 pinyin4 in ivy UI to search by Chinese Pinyin. The key point is to make sure the first character of input is “:”.

Set “auto-mode-alist”

The auto-mode-alist associates major modes with files.

For example, associate rjsx-mode file with extension “*.jsx”,

(push ("\\.jsx\\'" . rsjx-mode) auto-mode-alist)

Or you can use function my-add-auto-mode provided by this configuration,

(my-add-auto-mode 'rjsx-mode "\\.jsx\\'")

git-gutter

I use modified version of git-gutter for now until my pull request is merged into official repository.

You can set git-gutter:exp-to-create-diff to make git gutter support other VCS (Perforce, for example),

(setq git-gutter:exp-to-create-diff
      (shell-command-to-string (format "p4 diff -du -db %s"
                                       (file-relative-name buffer-file-name))))

Please note git-gutter assumes the cli program diff is added into environment variable PATH. You might need install it through MSYS2 or Cygwin on Windows.

Setup fonts in GUI Emacs

Non-Chinese can use unicode-fonts.

Chinese can use cnfonts.

They are not included in this setup. You need install them manually.

Synchronize setup with Git

Synchronize from my stable setup:

git pull https://[email protected]/redguardtoo/emacs.d.git stable

Or latest setup:

git pull https://[email protected]/redguardtoo/emacs.d.git

You can revert commit:

# always start from the latest related commit
git revert commit-2014-12-01
git revert commit-2014-11-01

Indentation

Learn basics. Then use my solution.

Editing Lisp

Please note paredit-mode is enabled when editing Lisp. Search “paredit cheat sheet” to learn its key bindings.

Comment out (require 'init-modeline) in init.el at first.

Key bindings don’t work?

Other desktop applications may intercept the key bindings. For example, it’s reported QQ on windows 8 can intercept “M-x”.

Org-mode

Press M-x org-version, then read online manual to set up.

For example, org-capture requires manual setup.

Run M-x org-open-at-point to open link under cursor. Http link will be opened by built in browser. C-u M-x org-open-at-point uses the external browser specified by browse-url-generic-program whose value could be /usr/bin/firefox.

macOS user?

Please replace legacy Emacs 22 and ctags with the new versions.

The easiest way is change Environment variable PATH.

Customize global variables

Some variables are set by this configuration so you can’t M-x customize to modify them.

Here are the steps to set these variables:

  • Find the variable description by M-x customize. For example, if the description of a variable is “Company Clang Insert Arguments”, then the variable name is company-clang-insert-argument
  • Find the variable company-clang-insert-argument in lisp/init-company.el and change its value

BTW, please read my code comment first before changing my code.

Open/Save files with Counsel/Ivy

Keep pressing C-M-j to ignore candidates and open/save files using current input.

You can also press M-o to apply other action on selected file. See https://oremacs.com/2015/07/23/ivy-multiaction/ for details.

Windows

If you use Windows Emacs, you need Emacs to find third party command line programs from Cygwin/MSYS2. Please add C:\Cygwin64\bin or C:\msys64\bin to environment variable PATH.

Most command line programs are originally developed for macOS and Linux. They can only handle UTF-8 encoded text. When grepping texts or searching files, the Windows Emacs need run the command line programs in Command Prompt which uses UTF-16 encoded text. So you might need see Using UTF-8 Encoding (CHCP 65001) in Command Prompt / Windows Powershell (Windows 10) if Emacs need pass Non-ASCII text to external command line programs.

Below Emacs commands do not require external command line programs and work out of box on Windows,

  • `M-x swiper`
  • `M-x ffip-lisp-find-file-in-project`
  • `M-x find-lisp-find-dired`
  • `M-x find-by-pinyin-dired`
  • `M-x find-by-pinyin-in-project-dired`

You can set environment variables in PowerShell, like,

setx var_name "var_value"

Environment variable HOME points to the directory C:\Users\<username> on Windows by default. You need copy the folder .emacs.d into that directory. Or you can change the value of HOME.

I use below cli to set the variable HOME to “c:\cygwin\home\cb”,

setx HOME "c:\cygwin\home\cb"

Yasnippet

  • Instead of M-x yas-expand or pressing TAB key, you can press M-j instead.
  • Yasnippet works out of box. But you can M-x my-yas-reload-all to force Yasnippet compile all the snippets. If you run my-yas-reload-all once, you always need run it when new snippets is added. The purpose of my-yas-reload-all is to make Emacs start up faster.
  • You can add your snippets into snippets/.
  • Run grep -rns --exclude‘.yas*’ ‘key:’ *= in snippets/ to see my own snippets

Non-English users

Locale must be UTF-8 compatible. For example, as I type locale in shell, I got the output zh_CN.UTF-8.

Behind corporate firewall

Run below command in shell:

http_proxy=http://yourname:[email protected]:8080 emacs -nw

Network is blocked

Try https://github.com/XX-net/XX-Net. Run command http_proxy=http://127.0.0.1:8087 emacs -nw in shell after starting XX-Net.

Email

If you use Gnus for email, check init-gnus.el and read my Gnus tutorial.

Cannot download packages?

Some package cannot be downloaded automatically because of network problem.

Run M-x package-refresh-content, restart Emacs, reinstall package.

Installing missing packages by using GNU ELPA

The GNU ELPA repository contains FSF-sanctioned Emacs packages. It is the default repository used by package.el.

GNU ELPA are deactivated in this setup.

GNU ELPA is deactivated for below reasons,

  • 99% packages can be found from other repositories like MELPA
  • ”~/.emacs.d/localelpa/” contains GNU ELPA packages required by this setup

To re-activate GNU ELPA, please search the line “uncomment below line if you need use GNU ELPA” in init-elpa.el .

Use flycheck to syntax check code

If you prefer flycheck instead the default syntax check solution lazyflymake built into this configuration.

Install and set up flycheck and insert below code to disable lazyflymake,

(setq my-disable-lazyflymake t)

Disable Vim key bindings

By default EVIL (Vim emulation in Emacs) is used. Comment out line containing (require 'init-evil) in init.el to unload it.

Evil setup

It’s defined in lisp/init-evil.el. Press C-z to switch between Emacs and Vim key bindings.

You could visit its website to download its free ebook there.

You can set my-initial-evil-state-setup to customize the initial evil state per major mode,

;; `diff-mode' uses Emacs original key bindings
(push '(diff-mode . emacs) my-initial-evil-state-setup)
;; `ivy-occur-grep-mode' initial state is evil normal state. Vim key bindings are used.
(push '(ivy-occur-grep-mode . normal) my-initial-evil-state-setup)

Chinese Input Method Editor

Please note pyim is already built into this setup. You need not install it through ELPA.

Run M-x toggle-input-method to toggle input method pyim.

Use Pinyin

The default dictionary for pinyin might not be big enough. So you need install bigger dictionaries.

Dictionaries with “.pyim” extension under the directory ~/.eim/ are automatically loaded.

Please run curl -L https://raw.githubusercontent.com/redguardtoo/pyim-tsinghua-dict/master/pyim-tsinghua-dict.pyim > ~/.eim/pyim-tsinghua-dict.pyim to install extra dictionaries.

The default pinyin scheme is quanpin but you can insert below code into ~/.custom.el to switch to a different pinyin scheme,

(with-eval-after-load 'pyim
  (setq pyim-default-scheme 'xiaohe-shuangpin))

Use Wubi

Dictionary for wubi is already installed. Please insert below code into ~/.custom.el to enable wubi dictionary and use wubi scheme,

(setq my-pyim-enable-wubi-dict t)
;; ;; @see https://github.com/tumashu/pyim-wbdict for more information
;; (setq my-pyim-enable-wubi-dict pyim-wbdict-v86-enable)
;; (setq my-pyim-enable-wubi-dict pyim-wbdict-v98-enable)
;; (setq my-pyim-enable-wubi-dict pyim-wbdict-v98-morphe-enable)
;; (setq my-pyim-enable-wubi-dict pyim-wbdict-v86-single-enable)

Install multiple versions of Emacs

Run below commands to install Emacs 26.3 into the directory ~/myemacs/26.3:

mkdir -p ~/tmp;
curl http://ftp.gnu.org/gnu/emacs/emacs-26.3.tar.gz | tar xvz -C ~/tmp/emacs-26.3
cd ~/tmp/emacs-26.3;
mkdir -p ~/myemacs/26.3;
rm -rf ~/myemacs/26.3/*;
./configure --prefix=~/myemacs/26.3 --without-x --without-dbus --without-sound && make && make install

Change Time Locale

Insert below code into ~/.emacs or ~/.custom.el,

;; Use en_US locale to format time.
;; if not set, the OS locale is used.
(setq system-time-locale "C")

Directory structure

init.el is the main file. It includes other *.el files.

lisp/init-elpa.el defines what packages will be installed from MELPA.

Packages are installed into the directory elpa/.

I also manually download and extract some packages into site-lisp/. Packages in site-lisp/ are not visible to the package manager.

My own snippets is at snippets/.

The git hooks is placed in githooks directory.

Other directories don’t matter.

Run the unit test before git commit

On macOS/Linux/Cygwin, run make githooks to install hooks into .git/hooks.

Then unit test is run automatically before git commit.

Python environment

Elpy (Emacs Python Development Environment) is used.

The flag elpy-disable-backend-error-display is set to nil so you can easily report any error to its developers.

If you don’t use Elpy, comment out the line (elpy-enable) in init-python.el.

To enable the virtual environment created by Elpy, add below code into ~/.custom.el,

(with-eval-after-load 'elpy
  (let* ((venv-dir "~/.emacs.d/elpy/rpc-venv"))
    (when (and (file-exists-p venv-dir)
               (executable-find pyvenv-virtualenvwrapper-python))
      (pyvenv-activate venv-dir))))

After activating the virtual environment created by Elpy, you could backup its required packages,

source ~/.emacs.d/elpy/rpc-venv/bin/activate && pip freeze > elpy-requirements.txt && deactivate

Restore the packages,

source ~/.emacs.d/elpy/rpc-venv/bin/activate && pip install -r elpy-requirements.txt && deactivate

Then run M-x elpy-config to double check elpy status and install any missing python package.

You might want to modify include-system-site-packages in ~/.emacs.d/elpy/rpc-venv/pyvenv.cfg

Set up lsp-mode

You could insert below code into ~/.custom.el,

(with-eval-after-load 'lsp-mode
  ;; enable log only for debug
  (setq lsp-log-io nil)
  ;; use `evil-matchit' instead
  (setq lsp-enable-folding nil)
  ;; no real time syntax check
  (setq lsp-diagnostic-package :none)
  ;; handle yasnippet by myself
  (setq lsp-enable-snippet nil)
  ;; turn off for better performance
  (setq lsp-enable-symbol-highlighting nil)
  ;; use find-fine-in-project instead
  (setq lsp-enable-links nil)
  ;; auto restart lsp
  (setq lsp-restart 'auto-restart)
  ;; don't watch 3rd party javascript libraries
  (push "[/\\\\][^/\\\\]*\\.\\(json\\|html\\|jade\\)$" lsp-file-watch-ignored)
  ;; don't ping LSP language server too frequently
  (defvar lsp-on-touch-time 0)
  (defun my-lsp-on-change-hack (orig-fun &rest args)
    ;; do NOT run `lsp-on-change' too frequently
    (when (> (- (float-time (current-time))
                lsp-on-touch-time) 120) ;; 2 mins
      (setq lsp-on-touch-time (float-time (current-time)))
      (apply orig-fun args)))
  (advice-add 'lsp-on-change :around #'my-lsp-on-change-hack))

Then run M-x lsp to start lsp client and server. Check https://github.com/emacs-lsp/lsp-mode on how to install lsp server.

Enable typewriter sounds when typing

Run M-x my-toggle-typewriter. Please check bundled typewriter-mode.el for further setup.

pdf-tools

Check its official documentation.

Here is my setup in ~/.custom.el,

;; @see https://github.com/vedang/pdf-tools/
;; Don't bother Windows
(when (and (display-graphic-p) (or *linux* *is-a-mac*))
  (my-run-with-idle-timer
   2
   (lambda ()
     (when *is-a-mac*
       (setenv "PKG_CONFIG_PATH" "/usr/local/Cellar/zlib/1.2.8/lib/pkgconfig:/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig"))
     (pdf-loader-install))))

Support legacy Emacs versions

Emacs 26

Version 4.0 is the last version to support Emacs 26 Please use https://github.com/redguardtoo/emacs.d/archive/4.0.zip and https://github.com/redguardtoo/myelpa/archive/4.0.zip.

Emacs 25

Version 3.2 is the last version to support Emacs 25

Please use https://github.com/redguardtoo/emacs.d/archive/3.2.zip and https://github.com/redguardtoo/myelpa/archive/3.2.zip.

Emacs 24.4 and 24.5

Version 2.9 is the last version to support Emacs 24.4+

Please use https://github.com/redguardtoo/emacs.d/archive/2.9.zip and https://github.com/redguardtoo/myelpa/archive/2.9.zip.

Emacs 24.3

Version 2.6 is the last version to support Emacs 24.3.

Download https://github.com/redguardtoo/emacs.d/archive/2.6.zip and https://github.com/redguardtoo/myelpa/archive/2.6.zip and you are good to go.

Emacs 23

Version 1.2 of this setup is the last version to support Emacs v23.

Here are the steps to use that setup:

Tips

  • Never turn off any bundled mode if it’s on by default. Future version of Emacs may assume it’s on. Tweak its flag in mode hook instead!
  • Git skills are extremely useful. Please read the chapters “Git Basics”, “Git Branching”, “Git Tools” from Pro Git
  • You can run optimize-emacs-startup to compile “*.el” under lisp/
  • Many advanced features in this configuration is only enabled in my personal ~/.custom.el. Grep defvar my-.* in ~/.emacs.d/lisp/ to find them. You can start from init-company.el and init-spelling.el.

Report bug

Please check EmacsWiki and my FAQ first.

If you still can’t resolve the issue,

  • Restart Emacs with option --debug-init in shell
  • Run M-x toggle-debug-on-error in Emacs
  • Reproduce the issue and send me the error message

The full command line to start Emacs is emacs -nw --debug-init.

If you use Emacs for Mac OS X, the command line is /Application/Emacs.app/Contents/MacOS/Emacs -nw --debug-init.

Send error messages to the original developer if it’s third party package’s problem.

If you are sure it’s this my bug, file report at https://github.com/redguardtoo/emacs.d. Don’t email me!

Bug report need include environment details.

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

emacs.d's People

Contributors

albert748 avatar blacamdk avatar chen-bin-newscorp avatar dalugm avatar demon386 avatar fenguoerbian avatar fpghwd avatar fun1355 avatar ixnij avatar jsntn avatar lesleylai avatar nahso avatar ozanmakes avatar peng051410 avatar phye avatar purcell avatar redguardtoo avatar sniperwolf avatar vipzrx avatar whatacold avatar ynjxsjmh avatar yuziwen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emacs.d's Issues

关于c/c++自动补全bug

您好:
之前一直使用vim编写c代码,这两天试着用您的配置,在emacs下写c代码,不知道我这里有什么问题,我的自动补全一直感觉不太对劲,比如pri_buf,printf,我按下pri的时候,应该出现补全窗口,但是我的看不见补全窗口,只看到了前面的行号出现好几行的空白,文本内容没有任何变化,应该有补全动作,只是不太对,这个是什么情况呢?
2013-09-02 09 42 54

I just got an error

Debugger entered--Lisp error: (error "Error during download request: Not Found")
signal(error ("Error during download request: Not Found"))
error("Error during download request:%s" " Not Found")
package-handle-response()
package-download-tar(yasnippet "20130218.2229")
package-download-transaction((yasnippet))
package-install(yasnippet)
(if (or (assoc package package-archive-contents) no-refresh) (package-install package) (progn (package-refresh-contents) (require-package package min-version t)))
(if (package-installed-p package min-version) t (if (or (assoc package package-archive-contents) no-refresh) (package-install package) (progn (package-refresh-contents) (require-package package min-version t))))
require-package(yasnippet (20130505 2115 0) nil)
eval-buffer(#<buffer load-84331> nil "/home/fengxiaolong/.emacs.d/init-elpa.el" nil t) ; Reading at buffer position 9511
load-with-code-conversion("/home/fengxiaolong/.emacs.d/init-elpa.el" "/home/fengxiaolong/.emacs.d/init-elpa.el" nil t)
require(init-elpa)
eval-buffer(#<buffer load> nil "/home/fengxiaolong/.emacs.d/init.el" nil t) ; Reading at buffer position 2358
load-with-code-conversion("/home/fengxiaolong/.emacs.d/init.el" "/home/fengxiaolong/.emacs.d/init.el" t t)
load("/home/fengxiaolong/.emacs.d/init" t t)

初始化错误

我将所有的文件清理了,重新git clone,然后启动出错,我把debug打开了,信息如下:
Debugger entered--Lisp error: (void-function cl-loop)
(cl-loop for (widget-name widget-tag key field-type matcher) in (quote ((exact-match "Exact match" exact string string=) (pre$
eval-buffer(#<buffer load<3>> nil "/home/houzy/.emacs.d/elpa/ido-ubiquitous-2.1.2/ido-ubiquitous.el" nil t) ; Reading at $
load-with-code-conversion("/home/houzy/.emacs.d/elpa/ido-ubiquitous-2.1.2/ido-ubiquitous.el" "/home/houzy/.emacs.d/elpa/ido-u$
require(ido-ubiquitous)
eval-buffer(#<buffer load<2>> nil "/home/houzy/.emacs.d/init-ido.el" nil t) ; Reading at buffer position 90
load-with-code-conversion("/home/houzy/.emacs.d/init-ido.el" "/home/houzy/.emacs.d/init-ido.el" nil t)
require(init-ido)
eval-buffer(#<buffer load> nil "/home/houzy/.emacs.d/init.el" nil t) ; Reading at buffer position 2747
load-with-code-conversion("/home/houzy/.emacs.d/init.el" "/home/houzy/.emacs.d/init.el" t t)
load("/home/houzy/.emacs.d/init" t t)
#[0 "^H\205\262^@ \306=\203^Q^@\307^H\310Q\202;^@ \311=\204^^^@\307^H\312Q\202;^@\313\307\314\315#\203*^@\316\202;^@\313$
command-line()
normal-top-level()

python-mode能把解释器指定为python3.3吗?

我现在在学习python3,但是在python-mode下打开的解释器是python2.7的,如果我用3的语法写程序按下C-c C-c来运行程序的时候会出问题,请问如何设置python3.3解释器为默认?

org-mode output Chinese pdf problem

why I can not output it to pdf correct? I can output English pdf correct.

#+LATEX_HEADER: \usepackage{xeCJK}
#+LATEX_HEADER: \setCJKmainfont{SimSun}

* 近期工作
** 学业<2013-05-21 Tue>
你好,你好你好你好

** 论文 <2013-06-17 Mon>
*** 论文
** job-hunting

Debugger entered--Lisp error: (error "Required feature `files' was not provided")

Debugger entered--Lisp error: (error "Required feature `files' was not provided")
require(files)
eval-buffer(#<buffer load<3>> nil "/root/.emacs.d/elpa/smarter-compile-2012.4.9/smarter-compile.el" nil t) ; Reading at buffer position 6342
load-with-code-conversion("/root/.emacs.d/elpa/smarter-compile-2012.4.9/smarter-compile.el" "/root/.emacs.d/elpa/smarter-compile-2012.4.9/smarter-compile.el" nil t)
require(smarter-compile)
eval-buffer(#<buffer load<2>> nil "/root/.emacs.d/init-smarter-compile.el" nil t) ; Reading at buffer position 27
load-with-code-conversion("/root/.emacs.d/init-smarter-compile.el" "/root/.emacs.d/init-smarter-compile.el" nil t)
require(init-smarter-compile)
eval-buffer(#<buffer load> nil "/home/zhangyin/.emacs.d/init.el" nil t) ; Reading at buffer position 5050
load-with-code-conversion("/home/zhangyin/.emacs.d/init.el" "/home/zhangyin/.emacs.d/init.el" t t)
load("/home/zhangyin/.emacs.d/init" t t)

error:required feature bbdb-autoloads was not provided

Debugger entered--Lisp error: (error "Required feature `bbdb-autoloads' was not provided")
require(bbdb-autoloads)
eval-buffer(#<buffer load-676402> nil "/home/fenghelong/.emacs.d/init-bbdb.el" nil t) ; Reading at buffer position 26
load-with-code-conversion("/home/fenghelong/.emacs.d/init-bbdb.el" "/home/fenghelong/.emacs.d/init-bbdb.el" nil t)
require(init-bbdb)
eval-buffer(#<buffer load> nil "/home/fenghelong/.emacs.d/init.el" nil t) ; Reading at buffer position 5001
load-with-code-conversion("/home/fenghelong/.emacs.d/init.el" "/home/fenghelong/.emacs.d/init.el" t t)
load("/home/fenghelong/.emacs.d/init" t t)
#[0 "�\205\262

debian 7.2 emacs23 init error

my debian version:
Linux coding 3.2.0-4-686-pae #1 SMP Debian 3.2.51-1 i686 GNU/Linux

my emacs version:
This is GNU Emacs 23.4.1 (i486-pc-linux-gnu, GTK+ Version 2.24.10) of 2012-09-10 on murphy, modified by Debian

error message:
error: Package `xml-rpc' is not available for installation

建立c语言源文件

建立一个新的c语言的源文件,在开始处输入#符号,显示不出来,minibuffer 中现实no symbol under point,必须要先输入一个别的字符,例如字母,才可以继续输入#

package error 提示emms is not available for install

Debugger entered--Lisp error: (error "Package emms' is not available for installation") signal(error ("Packageemms' is not available for installation"))
error("Package `%s' is not available for installation" "emms")
package-install(emms)
(if (or (assoc package package-archive-contents) no-refresh) (package-install package) (progn (package-refresh-contents) (re$
(if (package-installed-p package min-version) t (if (or (assoc package package-archive-contents) no-refresh) (package-instal$
require-package(emms nil t)
(progn (package-refresh-contents) (require-package package min-version t))
(if (or (assoc package package-archive-contents) no-refresh) (package-install package) (progn (package-refresh-contents) (re$
(if (package-installed-p package min-version) t (if (or (assoc package package-archive-contents) no-refresh) (package-instal$

这是错误信息 希望能帮我看下怎么解决 谢谢了

现在版本第一次打开的总会有包下载出错,无论是否挂代理

我是个emacs初学者,您的现在版本第一次打开的总会有包下载出错,无论是否挂代理,我试过大概四次了,也用http_proxy挂了代理,但是确实每次都有问题,好像是confluence-edit需要的几个包无法安装的问题,希望您能指正一下,也许是我的问题。

Evil-mode leader command in ex state

The default setting for Evil leader command takes effect in all states. However, this means even in ex state, when I want to apply search and replace in a specific range of lines, I can't type the literal comma ","
In other state I can use "" or C-z to temporarily input Emacs command, but they are also disabled in ex state.
I believe this is an unwanted behaviour. Can you fix this?
Thanks in advance!

sunrise-commander setup error

On initial setup it is not possible to install sunrise-commander. sunrise-commander package repository should be added to the list of available repositories

emacs 配置 首次加载出错

Debugger entered--Lisp error: (void-variable completing-read-function)
(eq completing-read-function (quote completing-read-ido))
(if (eq completing-read-function (quote completing-read-ido)) (quote completing-r$
(defvar ido-ubiquitous-fallback-completing-read-function (if (eq completing-read-$
eval-buffer(#<buffer load<3>> nil "/home/ymt/.emacs.d/elpa/ido-ubiquitous-2.0.$
load-with-code-conversion("/home/ymt/.emacs.d/elpa/ido-ubiquitous-2.0.4/ido-ubiqu$
load("/home/ymt/.emacs.d/elpa/ido-ubiquitous-2.0.4/ido-ubiquitous-autoloads" nil $
(let* ((name ...) (version-str ...) (pkg-dir ...)) (unless pkg-dir (error "Intern$
package-activate-1(ido-ubiquitous [(2 0 4) nil "Use ido (nearly) everywhere."])
(if fail (warn "Unable to activate package %s'.\nRequired package%s-%s' is una$
(let ((fail ...)) (if fail (warn "Unable to activate package `%s'.\nRequired pack$
(cond ((null found) (package-built-in-p package version)) ((memq package package-$
(let ((pkg-vec ...) available-version found) (when pkg-vec (setq available-versio$
package-activate(ido-ubiquitous (2 0 4))
(while --cl-dolist-temp-- (setq elt (car --cl-dolist-temp--)) (package-activate ($
(let ((--cl-dolist-temp-- package-alist) elt) (while --cl-dolist-temp-- (setq elt$
(catch (quote --cl-block-nil--) (let (... elt) (while --cl-dolist-temp-- ... ... $
(cl-block-wrapper (catch (quote --cl-block-nil--) (let ... ... nil)))
(block nil (let (... elt) (while --cl-dolist-temp-- ... ... ...) nil))
(dolist (elt package-alist) (package-activate (car elt) (package-desc-vers ...)))
(if no-activate nil (dolist (elt package-alist) (package-activate ... ...)))
(unless no-activate (dolist (elt package-alist) (package-activate ... ...)))
package-initialize()
eval-buffer(#<buffer load<2>> nil "/home/ymt/.emacs.d/init-elpa.el" nil t) ; $
load-with-code-conversion("/home/ymt/.emacs.d/init-elpa.el" "/home/ymt/.emacs.d/i$
require(init-elpa)
eval-buffer(#<buffer load> nil "/home/ymt/.emacs.d/init.el" nil t) ; Reading $
load-with-code-conversion("/home/ymt/.emacs.d/init.el" "/home/ymt/.emacs.d/init.e$
load("/home/ymt/.emacs.d/init" t t)
#[nil "^H\205\264^@ \306=\203^Q^@\307^H\310Q\2027^@ \311=\2033^@\312\307\313\31$
command-line()
normal-top-level()

emacspeak: Process speaker not running

Hi,
I can't configure emacspeak. Error "Process speaker not running" keeps showing
after I started emacspeak.

I looked for manual of emacspeak, when I insert "tcl" at command line, BUT "tcl command not found" I only have the command "tclsh"
It seems I've installed wrong package tcl, tk, tclx,
but I've tried tcl8.4 tk8.4 tclx8.4 tcl8.5 tk8.5 tck8.6 tk8.6, yet can't have command "tcl"

Could you show me where i can get the correct packages (for Ubuntu) if you still remember how you installed it?

Thanks in advance.

括号匹配问题

写C语言程序的时候例如输入int main(int argc,char **argv)的时候,输入int main(int afgc,argc打成了afgc,此时我删除前面的单词,然后输入余下的内容,但是当我再次输入到)的时候,右边的括号没有匹配成功,此时多了一个括号

用clang补全时出错

用clang补全时
clang failed with error 1:
/usr/bin/clang-cc1 -fsyntax-only -code-completion-macros -x c++ -code-completion-at -:7:10 -
但clang我自己用的时候没有error 1 的问题,求助大神呀喵

evil mode 范围替换

再evil mode命令模式下使用范围替换,例如想替换1到4行中的if到else。
:1,4 s/if/else/g 出现错误“,4 undefined”。

刚刚更新了下emacs.d遇到这个错误

Debugger entered--Lisp error: (void-function evil-declare-change-repeat)
evil-declare-change-repeat(company-complete-common)
mapc(evil-declare-change-repeat (company-complete-common company-select-next company-select-previous company-complete-selection))
eval-buffer(#<buffer load-709832> nil "/home/fenghelong/.emacs.d/init-company.el" nil t) ; Reading at buffer position 399
load-with-code-conversion("/home/fenghelong/.emacs.d/init-company.el" "/home/fenghelong/.emacs.d/init-company.el" nil t)
require(init-company)
eval-buffer(#<buffer load> nil "/home/fenghelong/.emacs.d/init.el" nil t) ; Reading at buffer position 5505
load-with-code-conversion("/home/fenghelong/.emacs.d/init.el" "/home/fenghelong/.emacs.d/init.el" t t)
load("/home/fenghelong/.emacs.d/init" t t)
#[0 "�\205\262

I use purcell's emacs init.el .

I use purcell's emacs init.el .why on start it ask me : Loading a theme can run Lisp code. Really load? (y or n)
Warning (initialization): An error occurred while loading c:/Users/Jason/AppData/Roaming/.emacs.d/init.el': File error: Spawning child process, invalid argument To ensure normal operation, you should investigate and remove the cause of the error in your initialization file. Start Emacs with the--debug-init' option to view a complete error backtrace.

load *.coffee error

when i open a coffeescript file, emacs tells me "File mode specification error: (void-variable js2-mode)", it seems 49 lines in init-javascript.el should be 'js2-mode, not js2-mode

Can't use AC to complete in php-mode, Debugger entered--Lisp error: (wrong-type-argument stringp nil)

Hi redguardtoo!
Recently I Clone your .emacs cfg, and refresh my local cfg with yours'.
But when I wana to use complete in a php major mode. It comes wrong.. Such like below:
-----------------------------------------

----------------------------------- Loading info when open test1.php file: ----------------------------------
(little confused as emacs load c-mode and cc-mode in snippets?)

Loading mwheel...done
[yas] Loading for 'c-mode', just-in-time: (yas/load-directory-1 e:/soft/editor/emacs-24.0.93/config/.emacs.d/elpa/yasnippet-20120718/snippets/c-mode (quote c-mode) (quote (cc-mode)))!
[yas] Loading compiled snippets from e:/soft/editor/emacs-24.0.93/config/.emacs.d/elpa/yasnippet-20120718/snippets/c-mode
[yas] Loading for 'cc-mode', just-in-time: (yas/load-directory-1 e:/soft/editor/emacs-24.0.93/config/.emacs.d/snippets/cc-mode (quote cc-mode) (quote nil))!
[yas] Loading compiled snippets from e:/soft/editor/emacs-24.0.93/config/.emacs.d/snippets/cc-mode
[yas] Loading for 'cc-mode', just-in-time: (yas/load-directory-1 e:/soft/editor/emacs-24.0.93/config/.emacs.d/elpa/yasnippet-20120718/snippets/cc-mode (quote cc-mode) (quote (text-mode)))!
[yas] Loading compiled snippets from e:/soft/editor/emacs-24.0.93/config/.emacs.d/elpa/yasnippet-20120718/snippets/cc-mode
Loading vc-git...done

----------------------------------- Mode-info-line: ----------------------------------
(PHP/1h Flymake ws ErgoEmacs AC yas pair Abbrev)

-----------------------------------Warning Info When I tpye php[tab] to complete ----------------------------------
Entering debugger...
then It took me to Backtrace buffer with such info below:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
call-process(nil nil #<buffer clang-output> nil "-cc1" "-fsyntax-only" "-I/usr/include" "-I/usr/lib/wx/include/gtk2-unicode-release-2.8" "-I/usr/include/wx-2.8" "-I/usr/include/gtk-2.0" "-I/usr/lib/gtk-2.0/include" "-I/usr/include/atk-1.0" "-I/usr/include/cairo" "-I/usr/include/gdk-pixbuf-2.0" "-I/usr/include/pango-1.0" "-I/usr/include/glib-2.0" "-I/usr/lib/glib-2.0/include" "-I/usr/include/pixman-1" "-I/usr/include/freetype2" "-I/usr/include/libpng14" "-code-completion-at" "e:/soft/editor/emacs-24.0.93/config/prj/phpstar/test1.php:2:1" "e:/soft/editor/emacs-24.0.93/config/prj/phpstar/test1.php")
apply(call-process nil nil #<buffer clang-output> nil ("-cc1" "-fsyntax-only" "-I/usr/include" "-I/usr/lib/wx/include/gtk2-unicode-release-2.8" "-I/usr/include/wx-2.8" "-I/usr/include/gtk-2.0" "-I/usr/lib/gtk-2.0/include" "-I/usr/include/atk-1.0" "-I/usr/include/cairo" "-I/usr/include/gdk-pixbuf-2.0" "-I/usr/include/pango-1.0" "-I/usr/include/glib-2.0" "-I/usr/lib/glib-2.0/include" "-I/usr/include/pixman-1" "-I/usr/include/freetype2" "-I/usr/include/libpng14" "-code-completion-at" "e:/soft/editor/emacs-24.0.93/config/prj/phpstar/test1.php:2:1" "e:/soft/editor/emacs-24.0.93/config/prj/phpstar/test1.php"))
ac-clang-call-process("php" "-cc1" "-fsyntax-only" "-I/usr/include" "-I/usr/lib/wx/include/gtk2-unicode-release-2.8" "-I/usr/include/wx-2.8" "-I/usr/include/gtk-2.0" "-I/usr/lib/gtk-2.0/include" "-I/usr/include/atk-1.0" "-I/usr/include/cairo" "-I/usr/include/gdk-pixbuf-2.0" "-I/usr/include/pango-1.0" "-I/usr/include/glib-2.0" "-I/usr/lib/glib-2.0/include" "-I/usr/include/pixman-1" "-I/usr/include/freetype2" "-I/usr/include/libpng14" "-code-completion-at" "e:/soft/editor/emacs-24.0.93/config/prj/phpstar/test1.php:2:1" "e:/soft/editor/emacs-24.0.93/config/prj/phpstar/test1.php")
apply(ac-clang-call-process "php" ("-cc1" "-fsyntax-only" "-I/usr/include" "-I/usr/lib/wx/include/gtk2-unicode-release-2.8" "-I/usr/include/wx-2.8" "-I/usr/include/gtk-2.0" "-I/usr/lib/gtk-2.0/include" "-I/usr/include/atk-1.0" "-I/usr/include/cairo" "-I/usr/include/gdk-pixbuf-2.0" "-I/usr/include/pango-1.0" "-I/usr/include/glib-2.0" "-I/usr/lib/glib-2.0/include" "-I/usr/include/pixman-1" "-I/usr/include/freetype2" "-I/usr/include/libpng14" "-code-completion-at" "e:/soft/editor/emacs-24.0.93/config/prj/phpstar/test1.php:2:1" "e:/soft/editor/emacs-24.0.93/config/prj/phpstar/test1.php"))
ac-clang-candidate()
funcall(ac-clang-candidate)
(cond ((functionp function) (funcall function)) (t (eval function)))
(save-excursion (cond ((functionp function) (funcall function)) (t (eval function))))
(setq candidates (save-excursion (cond ((functionp function) (funcall function)) (t (eval function)))))
(if cache nil (setq candidates (save-excursion (cond ((functionp function) (funcall function)) (t (eval function))))) (setq candidates (mapcar (lambda (candidate) (if (consp candidate) (propertize (car candidate) (quote value) (cdr candidate)) candidate)) candidates)) (when do-cache (push (cons source candidates) ac-candidates-cache)))
(unless cache (setq candidates (save-excursion (cond ((functionp function) (funcall function)) (t (eval function))))) (setq candidates (mapcar (lambda (candidate) (if (consp candidate) (propertize (car candidate) (quote value) (cdr candidate)) candidate)) candidates)) (when do-cache (push (cons source candidates) ac-candidates-cache)))
(let* ((do-cache (assq (quote cache) source)) (function (assoc-default (quote candidates) source)) (action (assoc-default (quote action) source)) (document (assoc-default (quote document) source)) (symbol (assoc-default (quote symbol) source)) (ac-limit (or (assoc-default (quote limit) source) ac-limit)) (face (or (assoc-default (quote face) source) (assoc-default (quote candidate-face) source))) (selection-face (assoc-default (quote selection-face) source)) (cache (and do-cache (assq source ac-candidates-cache))) (candidates (cdr cache))) (unless cache (setq candidates (save-excursion (cond ((functionp function) (funcall function)) (t (eval function))))) (setq candidates (mapcar (lambda (candidate) (if (consp candidate) (propertize (car candidate) (quote value) (cdr candidate)) candidate)) candidates)) (when do-cache (push (cons source candidates) ac-candidates-cache))) (setq candidates (funcall (or (assoc-default (quote match) source) ac-match-function) ac-prefix candidates)) (if (and (integerp ac-limit) (> ac-limit 1) (> (length candidates) ac-limit)) (setcdr (nthcdr (1- ac-limit) candidates) nil)) (setq candidates (mapcar (lambda (candidate) (popup-item-propertize candidate (quote action) action (quote symbol) symbol (quote document) document (quote popup-face) face (quote selection-face) selection-face)) candidates)) candidates)
ac-candidates-1(((candidates . ac-clang-candidate) (candidate-face . ac-clang-candidate-face) (selection-face . ac-clang-selection-face) (prefix . ac-clang-prefix) (requires . 0) (document . ac-clang-document) (action . ac-clang-action) (cache) (symbol . "c")))
(append candidates (ac-candidates-1 source))
(setq candidates (append candidates (ac-candidates-1 source)))
(while (consp --cl-var--) (setq source (car --cl-var--)) (setq candidates (append candidates (ac-candidates-1 source))) (setq --cl-var-- (cdr --cl-var--)))
(let* ((completion-ignore-case (or (eq ac-ignore-case t) (and (eq ac-ignore-case (quote smart)) (let ((case-fold-search nil)) (not (string-match "[[:upper:]]" ac-prefix)))))) (case-fold-search completion-ignore-case) (prefix-len (length ac-prefix)) (--cl-var-- ac-current-sources) (source nil) (candidates nil)) (while (consp --cl-var--) (setq source (car --cl-var--)) (setq candidates (append candidates (ac-candidates-1 source))) (setq --cl-var-- (cdr --cl-var--))) (progn (delete-dups candidates) (if (and ac-use-comphist ac-comphist) (if ac-show-menu (let* ((pair (ac-comphist-sort ac-comphist candidates prefix-len ac-comphist-threshold)) (n (car pair)) (result (cdr pair)) (cons (if ... ...)) (cdr (cdr cons))) (if cons (setcdr cons nil)) (setq ac-common-part (try-completion ac-prefix result)) (setq ac-whole-common-part (try-completion ac-prefix candidates)) (if cons (setcdr cons cdr)) result) (setq candidates (ac-comphist-sort ac-comphist candidates prefix-len)) (setq ac-common-part (if candidates (popup-x-to-string (car candidates)))) (setq ac-whole-common-part (try-completion ac-prefix candidates)) candidates) (setq ac-common-part (try-completion ac-prefix candidates)) (setq ac-whole-common-part ac-common-part) candidates)))
(catch (quote --cl-block-nil--) (let* ((completion-ignore-case (or (eq ac-ignore-case t) (and (eq ac-ignore-case (quote smart)) (let (...) (not ...))))) (case-fold-search completion-ignore-case) (prefix-len (length ac-prefix)) (--cl-var-- ac-current-sources) (source nil) (candidates nil)) (while (consp --cl-var--) (setq source (car --cl-var--)) (setq candidates (append candidates (ac-candidates-1 source))) (setq --cl-var-- (cdr --cl-var--))) (progn (delete-dups candidates) (if (and ac-use-comphist ac-comphist) (if ac-show-menu (let* ((pair ...) (n ...) (result ...) (cons ...) (cdr ...)) (if cons (setcdr cons nil)) (setq ac-common-part (try-completion ac-prefix result)) (setq ac-whole-common-part (try-completion ac-prefix candidates)) (if cons (setcdr cons cdr)) result) (setq candidates (ac-comphist-sort ac-comphist candidates prefix-len)) (setq ac-common-part (if candidates (popup-x-to-string ...))) (setq ac-whole-common-part (try-completion ac-prefix candidates)) candidates) (setq ac-common-part (try-completion ac-prefix candidates)) (setq ac-whole-common-part ac-common-part) candidates))))
(cl-block-wrapper (catch (quote --cl-block-nil--) (let* ((completion-ignore-case (or (eq ac-ignore-case t) (and (eq ac-ignore-case ...) (let ... ...)))) (case-fold-search completion-ignore-case) (prefix-len (length ac-prefix)) (--cl-var-- ac-current-sources) (source nil) (candidates nil)) (while (consp --cl-var--) (setq source (car --cl-var--)) (setq candidates (append candidates (ac-candidates-1 source))) (setq --cl-var-- (cdr --cl-var--))) (progn (delete-dups candidates) (if (and ac-use-comphist ac-comphist) (if ac-show-menu (let* (... ... ... ... ...) (if cons ...) (setq ac-common-part ...) (setq ac-whole-common-part ...) (if cons ...) result) (setq candidates (ac-comphist-sort ac-comphist candidates prefix-len)) (setq ac-common-part (if candidates ...)) (setq ac-whole-common-part (try-completion ac-prefix candidates)) candidates) (setq ac-common-part (try-completion ac-prefix candidates)) (setq ac-whole-common-part ac-common-part) candidates)))))
(block nil (let* ((completion-ignore-case (or (eq ac-ignore-case t) (and (eq ac-ignore-case (quote smart)) (let (...) (not ...))))) (case-fold-search completion-ignore-case) (prefix-len (length ac-prefix)) (--cl-var-- ac-current-sources) (source nil) (candidates nil)) (while (consp --cl-var--) (setq source (car --cl-var--)) (setq candidates (append candidates (ac-candidates-1 source))) (setq --cl-var-- (cdr --cl-var--))) (progn (delete-dups candidates) (if (and ac-use-comphist ac-comphist) (if ac-show-menu (let* ((pair ...) (n ...) (result ...) (cons ...) (cdr ...)) (if cons (setcdr cons nil)) (setq ac-common-part (try-completion ac-prefix result)) (setq ac-whole-common-part (try-completion ac-prefix candidates)) (if cons (setcdr cons cdr)) result) (setq candidates (ac-comphist-sort ac-comphist candidates prefix-len)) (setq ac-common-part (if candidates (popup-x-to-string ...))) (setq ac-whole-common-part (try-completion ac-prefix candidates)) candidates) (setq ac-common-part (try-completion ac-prefix candidates)) (setq ac-whole-common-part ac-common-part) candidates))))
(loop with completion-ignore-case = (or (eq ac-ignore-case t) (and (eq ac-ignore-case (quote smart)) (let ((case-fold-search nil)) (not (string-match "[[:upper:]]" ac-prefix))))) with case-fold-search = completion-ignore-case with prefix-len = (length ac-prefix) for source in ac-current-sources append (ac-candidates-1 source) into candidates finally return (progn (delete-dups candidates) (if (and ac-use-comphist ac-comphist) (if ac-show-menu (let* ((pair (ac-comphist-sort ac-comphist candidates prefix-len ac-comphist-threshold)) (n (car pair)) (result (cdr pair)) (cons (if ... ...)) (cdr (cdr cons))) (if cons (setcdr cons nil)) (setq ac-common-part (try-completion ac-prefix result)) (setq ac-whole-common-part (try-completion ac-prefix candidates)) (if cons (setcdr cons cdr)) result) (setq candidates (ac-comphist-sort ac-comphist candidates prefix-len)) (setq ac-common-part (if candidates (popup-x-to-string (car candidates)))) (setq ac-whole-common-part (try-completion ac-prefix candidates)) candidates) (setq ac-common-part (try-completion ac-prefix candidates)) (setq ac-whole-common-part ac-common-part) candidates)))
ac-candidates()
(setq ac-candidates (ac-candidates))
(progn (ac-put-prefix-overlay) (setq ac-candidates (ac-candidates)) (let ((preferred-width (popup-preferred-width ac-candidates))) (when (or (null ac-menu) (>= (popup-width ac-menu) preferred-width) (<= (popup-width ac-menu) (- preferred-width 10)) (and (> (popup-direction ac-menu) 0) (ac-menu-at-wrapper-line-p))) (ac-inline-hide) (ac-menu-delete) (ac-menu-create ac-point preferred-width ac-menu-height))) (ac-update-candidates 0 0) t)
(if (and auto-complete-mode ac-prefix (or ac-triggered force) (not isearch-mode)) (progn (ac-put-prefix-overlay) (setq ac-candidates (ac-candidates)) (let ((preferred-width (popup-preferred-width ac-candidates))) (when (or (null ac-menu) (>= (popup-width ac-menu) preferred-width) (<= (popup-width ac-menu) (- preferred-width 10)) (and (> (popup-direction ac-menu) 0) (ac-menu-at-wrapper-line-p))) (ac-inline-hide) (ac-menu-delete) (ac-menu-create ac-point preferred-width ac-menu-height))) (ac-update-candidates 0 0) t))
(when (and auto-complete-mode ac-prefix (or ac-triggered force) (not isearch-mode)) (ac-put-prefix-overlay) (setq ac-candidates (ac-candidates)) (let ((preferred-width (popup-preferred-width ac-candidates))) (when (or (null ac-menu) (>= (popup-width ac-menu) preferred-width) (<= (popup-width ac-menu) (- preferred-width 10)) (and (> (popup-direction ac-menu) 0) (ac-menu-at-wrapper-line-p))) (ac-inline-hide) (ac-menu-delete) (ac-menu-create ac-point preferred-width ac-menu-height))) (ac-update-candidates 0 0) t)
ac-update(t)
(setq result (ac-update force))
(and (setq result (ac-update force)) (null ac-candidates))
(if (and (setq result (ac-update force)) (null ac-candidates)) (progn (add-to-list (quote ac-ignoring-prefix-def) ac-current-prefix-def) (ac-start :force-init t) ac-current-prefix-def))
(when (and (setq result (ac-update force)) (null ac-candidates)) (add-to-list (quote ac-ignoring-prefix-def) ac-current-prefix-def) (ac-start :force-init t) ac-current-prefix-def)
(while (when (and (setq result (ac-update force)) (null ac-candidates)) (add-to-list (quote ac-ignoring-prefix-def) ac-current-prefix-def) (ac-start :force-init t) ac-current-prefix-def))
(let (result) (while (when (and (setq result (ac-update force)) (null ac-candidates)) (add-to-list (quote ac-ignoring-prefix-def) ac-current-prefix-def) (ac-start :force-init t) ac-current-prefix-def)) result)
ac-update-greedy(t)
(if (ac-update-greedy t) (progn (if (ac-inline-live-p) (ac-inline-hide)) (when (and (or (and (not ac-expand-on-auto-complete) (> (length ac-candidates) 1) (not menu-live)) (not (let (...) (ac-expand-common)))) ac-use-fuzzy (null ac-candidates)) (ac-fuzzy-complete))))
(when (ac-update-greedy t) (if (ac-inline-live-p) (ac-inline-hide)) (when (and (or (and (not ac-expand-on-auto-complete) (> (length ac-candidates) 1) (not menu-live)) (not (let ((ac-common-part ac-whole-common-part)) (ac-expand-common)))) ac-use-fuzzy (null ac-candidates)) (ac-fuzzy-complete)))
(let ((menu-live (ac-menu-live-p)) (inline-live (ac-inline-live-p))) (ac-abort) (let ((ac-sources (or sources ac-sources))) (if (or ac-show-menu-immediately-on-auto-complete inline-live) (setq ac-show-menu t)) (ac-start)) (when (ac-update-greedy t) (if (ac-inline-live-p) (ac-inline-hide)) (when (and (or (and (not ac-expand-on-auto-complete) (> (length ac-candidates) 1) (not menu-live)) (not (let (...) (ac-expand-common)))) ac-use-fuzzy (null ac-candidates)) (ac-fuzzy-complete))))
auto-complete()
(if (or force (ac-trigger-command-p last-command)) (auto-complete) (ac-fallback-command (quote ac-trigger-key-command)))
ac-trigger-key-command(nil)
call-interactively(ac-trigger-key-command nil nil)
-----------------------------------------

Is there is a bug? How to fix it? Thx

More info about my cfg:
-----------
Win7 + emacs24 + auto-complete-20120717 + yasnippet-20120718 + php-mode-20120722

C/C++ complete error

Hi, Bin Chen
There is a problem when I update your newest configuration.When I try to complete the c code ,for example
struct sockaddr_in servaddr;
servaddr.
It shows me that

/usr/bin/clang-cc1 -fsyntax-only -code-completion-macros -x c -code-completion-at -:9:14 -

:1:10: fatal error: 'sys/socket.h' file not found

include <sys/socket.h>

What's the problem?

Best regards.

emacs -nw 的时候 pagedown 变成 [5~] pagedown 变成[6~] delete 变为[3~]

图形界面没有这个问题.
在 init-local.el

(defun chb-page-down ()
(interactive)
(when (featurep 'xemacs) (setq zmacs-region-stays t))
(forward-line
(- (if (fboundp 'window-displayed-height) ;XEmacs
(window-displayed-height)
(window-text-height)) ;GNUEmacs
next-screen-context-lines)))

(defun chb-page-up ()
(interactive)
(when (featurep 'xemacs) (setq zmacs-region-stays t))
(forward-line
(- (- (if (fboundp 'window-displayed-height) ;XEmacs
(window-displayed-height)
(window-text-height)) ;GNUEmacs
next-screen-context-lines))))

(global-set-key [next] 'chb-page-down)
(global-set-key [prior] 'chb-page-up)

绑定之后还是无效.
不知是哪个插件导致的.

clone了你的仓库提示下面的错误

clone了你的仓库,出现了这个错误,Warning (initialization): An error occurred while loading `/home/fenghelong/.emacs.d/init.el':

File error: Opening directory, 没有那个文件或目录, /home/fenghelong/.emacs.d/defuns,但是这个目录是有的,运行emacs --debug-inti,的提示信息是这个:Debugger entered--Lisp error: (file-error "Opening directory" "没有那个文件或目录" "/home/fenghelong/.emacs.d/defuns")
directory-files("/home/fenghelong/.emacs.d/defuns" t "\w+")
(let ((--dolist-tail-- ...) file) (while --dolist-tail-- (setq file ...) (when ... ...) (setq --dolist-tail-- ...)))
(dolist (file (directory-files defuns-dir t "\w+")) (when (file-regular-p file) (load file)))
eval-buffer(#<buffer load> nil "/home/fenghelong/.emacs.d/init.el" nil t) ; Reading at buffer position 1508
load-with-code-conversion("/home/fenghelong/.emacs.d/init.el" "/home/fenghelong/.emacs.d/init.el" t t)
load("/home/fenghelong/.emacs.d/init" t t)
#[nil "�\205\264

默认没有启用 evil-leader-mode

请问配置中为什么没有自动启动 evil-leader-mode 呢? 是因为与某些 mode 或者插件有冲突的原因么? 现在每次启动 emacs 需要手动 M-x evil-leader-mode, 才能使用 init-evil.el 中定义的 evil leader 快捷键,不是很方便.

出现Package `emacs-24.1` is unavailable

运行:emacs -nw --debug-init错误信息:
eval-buffer(#<buffer load<2>> nil "/home/fengxiaolong/.emacs.d/init-elpa.el" nil t) ; Reading at buffer position 4852
load-with-code-conversion("/home/fengxiaolong/.emacs.d/init-elpa.el" "/home/fengxiaolong/.emacs.d/init-elpa.el" nil t)
require(init-elpa)
eval-buffer(#<buffer load> nil "/home/fengxiaolong/.emacs.d/init.el" nil t) ; Reading at buffer position 2286
load-with-code-conversion("/home/fengxiaolong/.emacs.d/init.el" "/home/fengxiaolong/.emacs.d/init.el" t t)
load("/home/fengxiaolong/.emacs.d/init" t t)
#[nil "^H\205\264^@ \306=\203^Q^@\307^H\310Q\2027^@ \311=\2033^@\312\307\313\314#\203#^@\315\2027^@\312\307\313\316#\203/^@\317\2027^@\315$
command-line()
normal-top-level()
在.emacs.d中运行grep -rsn emacs-24.1终端一直在等待输出结果

sth wrong with w3m

hi redguardtoo,
when i use w3m your emacs.d,it told me " Invalid function: w3m-substitute-key-definitions" in the minibuffer.

emacs.d使用的问题(找不到解决方案)

我这版安装了emacs24.3.1 Mac os版本的,看了您的博客准备使用您的配置,将配置down到.emacs.d/目录下 启动emacs怎么感觉好像没起作用,是还需要运行配置吗? 不好意思新手,希望帮个忙!!!!!!!

emacs shell自动补全问题

您好,进几个月一直使用您的配置,我比较喜欢在emacs里面使用shell(M+x:shell),最近更新后,文件路径补全存在问题:
例如:
projects目录下存在两个p开头目录:
projects/project projects/python
cd projects/ tab补全按y后
会将projects/python/路径补全,但是光标定位不对,
没有定位到目录最后,而是定位到了y字母后面,只能手动移到后面。
麻烦解决一下。

另外,shell中会回显输入的命令:
比如
~p/shell ᐅ ls
ls <-此处将ls又打印一遍,加了后面的代码去掉了。希望默认不要回显一遍。
profile_patch test tftp

;; turn off shell command echo
(defun my-comint-init ()
(setq comint-process-echoes t))
(add-hook 'comint-mode-hook 'my-comint-init)

is there sth wrong in my installing?

hello, redguardtoo. I am the student emailing you long before.
I wanted to use your init.el on my emacs, but it don't seem to work well.
I finished the clone smoothly, then I start the emacs , it downloaded and compiled anything auto. At last, he asked me if i wanted to use the theme next time, I answered "y".
ok,the problem came. When i fire it again, emacs connected to marmalade-repo.org:80.
Then it installed ruby-mode(everytime the emacs starts)
I use slackware64 and slackware on my Thinkpad r400 and eeepc 701.the issues were same.
so I want to ask if it is normal?

here is my start log:

Loading /home/oxsard/.emacs.d/defuns/buffer-defuns.el (source)...done
Removing local package.el from load-path to avoid shadowing bundled version
Contacting host: marmalade-repo.org:80
Parsing tar file...done
Extracting ruby-mode-1.1/ruby-mode-autoloads.el
Wrote /home/oxsard/.emacs.d/elpa/ruby-mode-1.1/ruby-mode-autoloads.el
Extracting ruby-mode-1.1/ruby-mode-pkg.el
Wrote /home/oxsard/.emacs.d/elpa/ruby-mode-1.1/ruby-mode-pkg.el
Extracting ruby-mode-1.1/._ruby-mode.el
Wrote /home/oxsard/.emacs.d/elpa/ruby-mode-1.1/._ruby-mode.el
Extracting ruby-mode-1.1/ruby-mode.el
Wrote /home/oxsard/.emacs.d/elpa/ruby-mode-1.1/ruby-mode.el
Making version-control local to ruby-mode-autoloads.el while let-bound!
Loading vc-git...done
Generating autoloads for ruby-mode.el...done
Generating autoloads for ruby-mode-pkg.el...done
Saving file /home/oxsard/.emacs.d/elpa/ruby-mode-1.1/ruby-mode-autoloads.el...
Wrote /home/oxsard/.emacs.d/elpa/ruby-mode-1.1/ruby-mode-autoloads.el
(No files need saving)
Checking /home/oxsard/.emacs.d/elpa/ruby-mode-1.1...
Compiling /home/oxsard/.emacs.d/elpa/ruby-mode-1.1/._ruby-mode.el...done
Wrote /home/oxsard/.emacs.d/elpa/ruby-mode-1.1/._ruby-mode.elc
Checking /home/oxsard/.emacs.d/elpa/ruby-mode-1.1... [2 times]
Compiling /home/oxsard/.emacs.d/elpa/ruby-mode-1.1/ruby-mode-pkg.el...done
Wrote /home/oxsard/.emacs.d/elpa/ruby-mode-1.1/ruby-mode-pkg.elc
Checking /home/oxsard/.emacs.d/elpa/ruby-mode-1.1...
Compiling /home/oxsard/.emacs.d/elpa/ruby-mode-1.1/ruby-mode.el...done
Wrote /home/oxsard/.emacs.d/elpa/ruby-mode-1.1/ruby-mode.elc
Checking /home/oxsard/.emacs.d/elpa/ruby-mode-1.1...
Done (Total of 3 files compiled, 1 skipped)
Loading /home/oxsard/.recentf...done
Cleaning up the recentf list...done (0 removed)
Helm completion enabled
Loading /home/oxsard/.emacs.d/site-lisp/nxml-mode/rng-auto.el (source)...done
Starting new Ispell process [default] ...
Loading a theme can run Lisp code. Really load? (y or n) y
Treat this theme as safe in future sessions? (y or n) y
[yas] Prepared just-in-time loading for /home/oxsard/.emacs.d/elpa/yasnippet-20130505.2115/snippets
[yas] Prepared just-in-time loading for ~/.emacs.d/snippets
[yas] Reloaded everything (snippets will load just-in-time)....
Loading /home/oxsard/.emacs.d/site-lisp/eim/eim-py.el (source)...done
Emacs startup time: 54 seconds.
[yas] Cyclic parenthood: mode text-mode has already seen as a parent of mode emacs-lisp-mode
[yas] Loading for emacs-lisp-mode', just-in-time: (yas--load-directory-1 /home/oxsard/.emacs.d/elpa/yasnippet-20130505.2115/snippets/emacs-lisp-mode (quote emacs-lisp-mode) (quote (text-mode)))! [yas] Loading compiled snippets from /home/oxsard/.emacs.d/elpa/yasnippet-20130505.2115/snippets/emacs-lisp-mode [yas] Loading fortext-mode', just-in-time: (yas--load-directory-1 /home/oxsard/.emacs.d/elpa/yasnippet-20130505.2115/snippets/text-mode (quote text-mode) (quote nil))!
[yas] Loading compiled snippets from /home/oxsard/.emacs.d/elpa/yasnippet-20130505.2115/snippets/text-mode
Saving file /home/oxsard/.emacs.d/init.el...
Wrote /home/oxsard/.emacs.d/init.el [2 times]
Loading /home/oxsard/.emacs.d/.session...done
No desktop file.
For information about GNU Emacs and the GNU system, type C-h C-a.
byte-code: Beginning of buffer [3 times]
evil-repeat-pop: Previous command was not evil-repeat: nilError during redisplay: (void-variable utf-8-unix)
Error during redisplay: (void-variable utf-8-unix) [7 times]
byte-code: End of buffer

something error with slime

when I open a xxx.lisp file, it report:
../.emacs.d/elpa/slime-repl-20100404/slime-repl.el: flet' is an obsolete macro (as of 24.3); use eithercl-flet' or `cl-letf'. [2 times]

Linux: debian testing
emacs: GNU Emacs 24.3.50.1 (i486-pc-linux-gnu, GTK+ Version 3.4.2)

出现Package `emacs-24.1` is unavailable

我的系统是:Linux fenghelong-H61M-S2-B3 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
我的emacs版本是:GNU Emacs 23.3.1
Copyright (C) 2011 Free Software Foundation, Inc.

error when offline

If I run emacs without Internet, error: marmalade-repo.org/80 System error will occur, Can I close this check option?

emacs version : 24.3.1
system: Debian sid amd64

emms 安装的问题。。。。。

Debugger entered--Lisp error: (error "Package emms' is not available for installation")
signal(error ("Packageemms' is not available for installation"))
error("Package `%s' is not available for installation" "emms")
package-install(emms)
(if (or (assoc package package-archive-contents) no-refresh) (package-install package) (progn (package-refresh-contents) (re$
(if (package-installed-p package min-version) t (if (or (assoc package package-archive-contents) no-refresh) (package-instal$
require-package(emms nil t)
(progn (package-refresh-contents) (require-package package min-version t))
(if (or (assoc package package-archive-contents) no-refresh) (package-install package) (progn (package-refresh-contents) (re$
(if (package-installed-p package min-version) t (if (or (assoc package package-archive-contents) no-refresh) (package-instal$

这是错误信息 希望能帮我看下怎么解决 谢谢了

之前您的回答是install emms

可是怎么才算安装emms呢?我从http://www.gnu.org/software/emms clone 了一份下来 然后放到.emacs.d目录下 还是不行啊 老是报这个错 求大神 给点清晰的指导。 试过在init.el 和init-emms.el中加入(add-to-list 'load-path "~/.emacs.d/emms/")这样的命令但还是不起作用

怎么使用evil-leader

问题是这样的在init-evil.el中(setq evil-leader/leader "," evil-leader/in-all-states t)设置了leader为","。但是我通过C-h k查询到","绑定到了evil-repeat-find-char-reverse上。

Column view error in org-mode

I cann't turn on the column view by C-c C-x C-c in org mode by following message:

Invalid function: org-with-silent-modifications

thanks.

(error "Package `ctags' is not available for installation")

[root@fzzying zhangyin]# yum install ctags
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile

  • base: mirrors.163.com
  • extras: mirrors.163.com
  • updates: mirrors.163.com
    Setting up Install Process
    Package ctags-5.8-2.el6.i686 already installed and latest version
    Package ctags-etags-5.8-2.el6.i686 already installed and latest version
    Nothing to do

I use CentOS 6.4 but when I open emacs, I got the following error:

͂͂͂͂Debugger entered--Lisp error: (error "Package ctags' is not available for installation") signal(error ("Packagectags' is not available for installation"))
error("Package %s' is not available for installation" "ctags") (if pkg-desc nil (error "Package%s' is not available for installation" (symbol-name name)))
(unless pkg-desc (error "Package %s' is not available for installation" (symbol-name name))) (let ((pkg-desc ...)) (unless pkg-desc (error "Package%s' is not available for installation" ...)) (package-download-transaction (package-compute-transaction ... ...)))
package-install(ctags)
(if (or (assoc package package-archive-contents) no-refresh) (package-install package) (progn (package-refresh-contents) (require-package package min-version t)))
(if (package-installed-p package min-version) t (if (or ... no-refresh) (package-install package) (progn ... ...)))
require-package(ctags nil t)
(progn (package-refresh-contents) (require-package package min-version t))
(if (or (assoc package package-archive-contents) no-refresh) (package-install package) (progn (package-refresh-contents) (require-package package min-version t)))
(if (package-installed-p package min-version) t (if (or ... no-refresh) (package-install package) (progn ... ...)))
require-package(ctags)
eval-buffer(#<buffer load<2>> nil "/root/.emacs.d/init-elpa.el" nil t) ; Reading at buffer position 8707
load-with-code-conversion("/root/.emacs.d/init-elpa.el" "/root/.emacs.d/init-elpa.el" nil t)
require(init-elpa)
eval-buffer(#<buffer load> nil "/home/zhangyin/.emacs.d/init.el" nil t) ; Reading at buffer position 2358
load-with-code-conversion("/home/zhangyin/.emacs.d/init.el" "/home/zhangyin/.emacs.d/init.el" t t)
load("/home/zhangyin/.emacs.d/init" t t)
#nil "��� �=�� ���Q�7 �=�3 ����#�# ͂7 ����#�/ ς7 ͂7 ���Q����\nщ#���=�_ ������Q!"��\fщ#���=�^ \n�)��� ��!ؚ�� ��!���P�"��"!�� �"�� �
!��
�� ˉ��� �
�"�� ��
�#���!�
�*�#?�� ��$��щ#))�" [init-file-user system-type user-init-file-1 user-init-file otherfile source ms-dos "" "/_emacs" windows-nt directory-files nil "^.emacs(.elc?)?$" "/.emacs" "^_emacs(.elc?)?$" "~/_emacs" "/.emacs" t load expand-file-name "init" file-name-as-directory "/.emacs.d" file-name-extension "elc" file-name-sans-extension ".el" file-exists-p file-newer-than-file-p message "Warning: %s is newer than %s" sit-for 1 "default" alt inhibit-default-init inhibit-startup-screen] 7

command-line()
normal-top-level()

Issues with auto-complete and org-mode

I changed a bit from your settings. But recently I came across several problems with org-mode

  1. When editing with c/c++ code in org-mode source code block(in another buffer
    trigger by C-c ') the auto-complete-clang always fails. In effect, it
    prompts in minibuffer where to save current file. The problem is that
    whichever keys I press, it tells me that it is UNDEFINED. I can make sure
    this problem has nothing to do with yasnippet since I turn off the
    yas-minor-mode, but the problem still exists. But I am not sure whether it is
    the fault of auto-complete-clang or ido plugins. Have you ever come
    across similar cases?
  2. How to publish htmls from org mode with TOC, while using worg.css right? I
    just updated org to 8 and there seems a huge changes from 7.x. The html
    publish method changed and when I set org-html-head to a self customized
    css, the table of contents often generates badly: for instance, the code
    blocks can be above the layer of the table of contens region when the side
    bar is expanded. More problems occur when publishing as project. Do you feel
    like that org has bad compatiblity?
  3. Seems that the latest auto-complete cannot be byte-compiled right. In my
    case, it complains popup-cursor ac-menu is not a valid .... Since I updated
    my Emacs to 24.3 and didn't recompile the el files, I don't know when this
    problem occured. Actually I also recompiled the auto-complete-20130330
    version and saw the similar error message(the latest version seems adds some
    helper functions.) Do you have any ideas?

Thanks.

cannot open load file dropdown-list require(dropdown-list)

Debugger entered--Lisp error: (file-error "Cannot open load file" "dropdown-list")
require(dropdown-list)
eval-buffer(#<buffer load-700881> nil "/home/fenghelong/.emacs.d/init-yasnippet.el" nil t) ; Reading at buffer position 314
load-with-code-conversion("/home/fenghelong/.emacs.d/init-yasnippet.el" "/home/fenghelong/.emacs.d/init-yasnippet.el" nil t)
require(init-yasnippet)
(if (not (boundp (quote light-weight-emacs))) (require (quote init-yasnippet)))
eval-buffer(#<buffer load> nil "/home/fenghelong/.emacs.d/init.el" nil t) ; Reading at buffer position 3949
load-with-code-conversion("/home/fenghelong/.emacs.d/init.el" "/home/fenghelong/.emacs.d/init.el" t t)
load("/home/fenghelong/.emacs.d/init" t t)
#[0 "�\205\262

更新你的配置后出现的Error

Error in post-command-hook (flyspell-post-command-hook): (error "Can't open affix or dictionary f
iles for dictionary named "zh_CN".
@(#) International Ispell Version 3.2.06 (but really Hunspell 1.3.2)
Can't open affix or dictionary files for dictionary named "zh_CN".")

还是关于yasnippet的问题

昨天已经问过你,你说到用list-packages,我不知道这个命令究竟是做什么用的,我运行后发现我的yasnippet是红色的,我尝试删除elpa中的yasnippet,让emacs重新下载,但是还是有问题。问题如我昨天给你发的一样,我环境是xp+cygwin,相信你也看出来了。

NanQi

need loading theme every time start emacs

When I start emacs24 in Debian amd64, These two questions must be answered:

  1. Loading a theme can run Lisp code. Really load?
  2. Treat this theme as safe in future sessions?

Whether can memory my choice?

thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.