elisp

FlySpell in Org-Mode recognize latex syntax like auctex

和自甴很熟 提交于 2019-12-05 06:38:23
Original Response: I was trying to figure out how in auctex mode latex doesn't seem to highlight any latex functions with flyspell turned on. Is this a custom dictionary file or how is this implemented? Can this be easily incorporated into an org-mode file so it doesn't highlight inserted latex code that will get exported. Edit: Simple example taken from top of file and in the text. Basically so latex syntax like ref or label inside {} won't be spell checked (this has been fixed by using (setq ispell-parser tex). Then also setting up a function that specific labels with #+ as the first text on

Open dired and select the file associated with the previous buffer?

被刻印的时光 ゝ 提交于 2019-12-05 05:42:39
Let's say I am editing blah.txt with Emacs and I decide to open dired to rename the file blah.txt. When I press C-x d RET (or C-x C-f RET ), a dired buffer will show up to display the content of the directory containing blah.txt , but the cursor will not be on blah.txt . So I need to search my file first ( C-s blah.txt ) to place my cursor on it and then I can rename it ( R ). How do I automate or remove the step C-s blah.txt ? dired-jump is exactly what you want. (autoload 'dired-jump "dired-x" "Jump to dired corresponding current buffer.") (autoload 'dired-jump-other-window "dired-x" "jump

Switching between color themes in Emacs ( < v.24)

时光总嘲笑我的痴心妄想 提交于 2019-12-05 05:41:26
Update: Note that this thread does not applyt o recent versions of Emacs (24+). Emacs now comes with it's own powerful color theming system (e.g. see a review here ) that does not required loading the external package color-theme . I have the following code snippet in my .emacs file, where I defined a few aliases that allow me to switch conveniently between a couple of color themes using short extended commands: (require 'color-theme) (eval-after-load "color-theme" '(progn (color-theme-initialize) (color-theme-aalto-light))) ;; Aliases to color-themes, e.g. 'M-x a' switches to color-theme

Emacs Lisp: getting ascii value of character

谁都会走 提交于 2019-12-05 05:19:31
I'd like to translate a character in Emacs to its numeric ascii code, similar to casting char a = 'a'; int i = (int)a in c. I've tried string-to-number and a few other functions, but none seem to make Emacs read the char as a number in the end. What's the easiest way to do this? String is an array. (aref "foo" 0) To get the ascii-number which represents the character --as Drew said-- put a question mark before the character and evaluate that expression ?a ==> 97 Number appears in minibuffer, with C-u it's written behind expression. Also the inverse works (insert 97) will insert an "a" in the

improper exiting from indentation in emacs python-mode

南楼画角 提交于 2019-12-05 04:39:23
I am using Emacs python-mode. I invoke it using this in my .emacs (add-to-list 'load-path "~/emacs/python-mode.el-6.0.3/") (autoload 'python-mode "python-mode" "Python Mode." t) (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode)) (add-to-list 'interpreter-mode-alist '("python" . python-mode)) (require 'python-mode) (add-hook 'python-mode-hook (lambda () (set-variable 'py-indent-offset 4) ;(set-variable 'py-smart-indentation nil) (set-variable 'indent-tabs-mode nil) (define-key py-mode-map (kbd "RET") 'newline-and-indent) ;(define-key py-mode-map [tab] 'yas/expand) ;(setq yas/after-exit

How to let Emacs display a different character from that actually stored?

别等时光非礼了梦想. 提交于 2019-12-05 04:09:09
I want to implement dynamical text replacement (only the display is replaced, the actual stored file is not replaced) for Emacs, using Elisp. For example, in LaTeX documents, I want to type \alpha , and let Emacs display it just as α , so it is easier to read. But in the result .tex file, I still want \alpha , instead of α to be saved. (Remark: I could use XeTeX or LuaTeX myself to support UTF-8 directly. But for the reason of collaboration and journal requirements, I don't want the UTF-8 characters to be directly saved in the .tex files. Alternatively I could use preview in AUCTeX. But that

Indenting SQL in another major mode in Emacs

假如想象 提交于 2019-12-05 02:08:55
问题 Oftentimes I'm writing some script to do some stuff, often involving SQL, in a different major mode. Maybe it looks like this: sql = """ SELECT * FROM table WHERE row_awesomeness > 1000 """ I'd like to be able to indent the SQL propertly, so it looks something like: sql = """ SELECT * FROM table WHERE row_awesomeness > 1000 """ I'm not picky about the SQL indentation algorithm used, but I can't get anything to work at all. I'm not a huge fan of sql-indent.el, but I can't even get that to work

Does learning one Lisp help in learning the other?

五迷三道 提交于 2019-12-05 02:07:50
Is there any synergy between learning different Lisp languages? I'm currently learning Emacs Lisp, as it is immediately useful in my daily Emacs usage, however i'm fascinated with all Lisps, so maybe someday i will learn and use others. Will learning Emacs Lisp help me, when i start digging in Common Lisp, Scheme or Clojure? In other words, will it be for me like learning a completely new language, or some notions and paradigms are common? I'm also interested in comparison of unique differences between the Lisps, which will be a problem, when i come from one Lisp to another. In How to go about

Changing margin for emacs text-mode

半城伤御伤魂 提交于 2019-12-05 02:01:22
问题 The only way I found to change margins in emacs to my liking without things acting funny is this: (add-hook 'window-configuration-change-hook (lambda () (set-window-margins (car (get-buffer-window-list (current-buffer) nil t)) 24 24))) I would like for this setting to be invoked only in text-mode and change back when I change to other modes. Somewhat naively I tried this: (add-hook 'text-mode-hook (lambda () (set-window-margins (car (get-buffer-window-list (current-buffer) nil t)) 24 24)))

Emacs lisp evaluate variable in alist

倾然丶 夕夏残阳落幕 提交于 2019-12-05 01:55:57
问题 This is a follow-up question to Emacs Lisp: evaluate variable in alist.. I am trying to set default-frame-alist in my .emacs file. Consider, e.g. (setq default-frame-alist '((auto-lower . nil) (auto-raise . nil) (height . 41) (width . 80) (top . 1) (left . 1))) (I have omitted some values) This works fine.. Suppose now I want set the height according to another variable..Say, I stored the integer value 50 in the variable my-height .. How can I set height to the value of my-height ? I have