The following content is collected from the Internet or unexpected discoveries during use. The content collected from the Internet will indicate the source. If you think it is inappropriate, please let me know how to delete it.
In emacs, only half of a Chinese character is displayed:
Solution:Http://tikii.javaeye.com/blog/135007
As shown in the following figure, the words "no" and "wonderful" are both half displayed.
The answer was found at http://tikii.javaeye.com/blog/135007. the answer was originally the question of installing lingoes. Delete the font of lingoes installation. Specifically, delete the lingoes. ttf file in the c:/windows/fonts directory. Or find the installation directory of lingoes and delete all the font files listed in the following font sub-directories from C:/windows/fonts.
Settings of compilation commands in emacs:
From: http://suchang.net/slack/Emacs.html
Add the following code to. emacs:
- ; C-f5, set the compile command, use the original compile of Emacs
- ; F5: Save the current window and use different compilers for compilation. You can add a match as shown in the following code.
- (Defun sucha-smart-compile ()
- "Simply compile your file according to the file type ."
- (Interactive)
- (Save-some-buffers t)
- (Let
- (Compile-command nil)
- (Alist
- (List '("//. c $". "c:/mingw/bin/gcc ")
- '("//. Cc $". "c:/mingw/bin/g ++ ")
- '("//. Cpp $". "c:/mingw/bin/g ++ "))))
- (While (not (null alist ))
- (If (string-match (caar alist) (buffer-file-name ))
- (Setq compile-command
- (Concat (cdar alist) ""/"" (buffer-file-name )"/"")))
- (Setq alist (cdr alist )))
- (If (null compile-command)
- (Setq compile-command
- (Read-from-minibuffer "Compile command :")))
- (Compile-command )))
- (Global-set-key [C-f5] 'compile)
- (Global-set-key [f5] 'sucha-smart-compile)
In the author's original article, lines 10, 11 and 12 are followed by: "gcc", "g ++", "g ++", c: /mingw/bin is the compiler path on your computer. In 16 lines of code, buffer-file-name is enclosed in double quotation marks to prevent spaces in the path.
Insert the current system time at the cursor:
From: http://if.ustc.edu.cn /~ Xbzhou/blog/archives/ipv72.html
- ; Insert-current-time
- (Defun insert-current-time ()
- "Insert the current time"
- (Interactive "*")
- (Insert (current-time-string )))
- (Global-set-key "/C-xt" 'insert-current-time)
Settings on the emacs startup window:
From: http://if.ustc.edu.cn /~ Xbzhou/blog/archives/ipv72.html
- ;;;;;;;;;;;;;;;;;;;;;;;;;;; Set the window interface ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (Set-foreground-color "gray ")
- (Set-background-color "black ")
- (Set-cursor-color "gold1 ")
- (Set-mouse-color "gold1 ")
- (Set-scroll-bar-mode nil)
- ; Cancel the scroll bar
- ; (Customize-set-variable 'scroll-bar-mode' right ))
- ; Set the scroll bar to the right of the window, and the default is on the left
- (Tool-bar-mode nil)
- ; Cancel the toolbar
- (Setq default-frame-alist
- '(Vertical-scroll-bars)
- (Top. 25)
- (Left. 45)
- (Width. 110)
- (Height. 40)
- (Background-color. "black ")
- (Foreground-color. "gray ")
- (Cursor-color. "gold1 ")
- (Mouse-color. "gold1 ")
- (Tool-bar-lines. 0)
- (Menu-bar-lines. 1)
- (Right-fringe)
- (Left-fringe )))
- ; Set other colors: the background and topic highlighted by the syntax, the background and topic selected by the region, and the background and topic selected by the secondary selection.
- (Set-face-foreground 'highlight "white ")
- (Set-face-background 'highlight "blue ")
- (Set-face-foreground 'region "cyan ")
- (Set-face-background 'region "blue ")
- (Set-face-foreground 'secondary-selection "skyblue ")
- (Set-face-background 'secondary-selection "darkblue ")
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;; Set the interface to end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
You can modify the code in line 17--30 to automatically maximize the window at startup. Very convenient.
Copy the current row (that is, when we need to copy a row or cut a row, we do not need to select this row as region first, you only need to move the cursor to the current line and execute the normal copy and cut command)
From: http://blog.csdn.net/g9yuayon/archive/2007/03/04/1520466.aspx
- (Defadvice kill-ring-save (before slickcopy activate compile)
- "When called interactively with no active region, copy a single line instead ."
- (Interactive
- (If mark-active (list (region-beginning) (region-end ))
- (List (line-beginning-position)
- (Line-beginning-position 2 )))))
- (Defadvice kill-region (before slickcut activate compile)
- "When called interactively with no active region, kill a single line instead ."
- (Interactive
- (If mark-active (list (region-beginning) (region-end ))
- (List (line-beginning-position)
- (Line-beginning-Position 2 )))))