elisp

emacs font for western and Other like rtl

梦想与她 提交于 2019-12-05 01:45:14
问题 In office like libreOffice we have two type font in style, western font and CTL font. all English font use western font and other things like persian and arabic font use CTL font. in emacs 24 i want western text use this settings '(default ((t (:stipple nil :background "black" :foreground "chartreuse" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 96 :width normal :family monaco )))) and all rtl and persian text use some thing

How to permanently enable the hs-minor-mode in emacs

青春壹個敷衍的年華 提交于 2019-12-05 01:16:36
I am using thhs code in the .emacs file to permanently enable the hs-minor-mode and to change the shortcut: (setq-default hs-minor-mode t) (global-set-key (kbd "C-c C-h") (kbd "C-c @ C-h")) ;;hiding block of code (global-set-key (kbd "C-c C-r") (kbd "C-c @ C-s")) ;;revealing block of code But the mode is not activated automatically. what should i do? If you want it to be truly global, this does the trick: (define-globalized-minor-mode global-hs-minor-mode hs-minor-mode hs-minor-mode) (global-hs-minor-mode 1) You can turn on hs-minor-mode for a specific mode like C, C++ mode using c-mode-common

Emacs .dir-locals.el - setting key bindings

≡放荡痞女 提交于 2019-12-05 00:48:39
问题 I'm not sure this is possible, but I'd like to setup some project specific key bindings by using .dir-locals.el Of course .dir-locals.el has to contain a special list of settings, so I can't do: (global-set-key [24 down] 'move-text-down) Is there any way I can inject a lambda to run arbitrary code or some other way to set key bindings in .dir-locals.el ? 回答1: The eval pseudo-variable enables you to specify arbitrary elisp for evaluation with your local variables. e.g. https://stackoverflow

How to call interactive Emacs Lisp function with a prefix argument, from another Emacs Lisp function?

删除回忆录丶 提交于 2019-12-05 00:34:40
I want to write an Emacs Lisp function that will turn on flyspell-mode regardless of the current state of the mode. Function flyspell-mode-on is deprecated. The documentation suggests that a positive prefix argument will turn flyspell-mode , but unfortunately running (flyspell-mode 1) results in an error message: Wrong number of arguments: (lambda (flyspell-mode 1)), 0 If I could figure out how to call flyspell-mode with a prefix argument, I believe I could solve this problem. The most relevant section I can find in the Emacs Lisp manual is the section entitled "Interactive Call", which

Add/remove column spreadsheet features in Emacs?

我怕爱的太早我们不能终老 提交于 2019-12-04 21:44:46
Given delimited data in the following format, how can I insert and delete columns? abc|efg|123|xyz123abc|yes xxx|bbb|cc|ddd|no Say, for example, that I wanted to add a 3rd column with a default value of 1 and remove the 4th column so the data would look like this: abc|efg|1|123|yes xxx|bbb|1|cc|no I was looking into org-mode tables as a starting point, however it puts extra spaces around the data. | abc | efg | 123 | xyz123abc | | xxx | bbb | cc | ddd | | | | | | Well I just found out how to import data into SES (there are no "ses-import" functions, but it turns out you can simply yank tab

Sync two windows of emacs together

大城市里の小女人 提交于 2019-12-04 21:34:14
I have a snippet of code in my dotemacs file that would sync two opened buffers side by side (Thanks to Tobias), scrolling in the master buffer will result in moving the slave buffer accordingly matching the same "line" the cursor is at. I have been trying to modify the code and have one buffer act as master when it has the focus and the other act as a slave following lead. Basically, I want then both to sync up no matter which buffer is scrolling. Unfortunately, Applying (Xsync-window) on both buffers failed because of how tightly synced the master and slave together. Here is the code: (defun

elisp: Is there a way to get the name of the current .el module (like __FILE__ in C)?

隐身守侯 提交于 2019-12-04 18:38:48
问题 At the top of my elisp module, I want to do something as simple as: (message (concat "Loading " (expand-file-name (current-elisp-module) "."))) 回答1: You can use the variable load-file-name, which is set by the function load, documented as follows: Full name of file being loaded by `load'. As elaborated in the manual: When Emacs is in the process of loading a file, this variable’s value is the name of that file, as Emacs found it during the search described earlier in this section. Note:

Change X11 window title after emacs started

夙愿已清 提交于 2019-12-04 18:16:41
问题 When I start emacs, I can use the --title= option to control the title of the x-window that holds the emacs application. Is it possible to change the title after emacs starts from elisp? 回答1: M-x set-frame-name NewName RET and from elisp (set-frame-name "NewName") 回答2: I use (setq frame-title-format "%b - emacs") to include the current buffer name in the frame title. 回答3: The following worked for me (GNU EMACS 24.3.1 on cygwin multiwindow X11): (set-frame-parameter frame 'title arg) which I

Custom shells started automatically from .emacs

十年热恋 提交于 2019-12-04 17:56:40
I would like to start a few shells, and set their directories from my .emacs. Opening them is easy: ;; run a few shells. (shell "*shell5*") (shell "*shell6*") (shell "*shell7*") But I would like to specify their directory, too. The following works for me (let ((default-directory "/path/to/whereever/")) (shell "*shell1*")) (shell "*shell5*") (with-current-buffer "*shell5*" (goto-char (point-max)) (insert "cd dir")) ;;for example (comint-send-input nil t) ;; enter For now I have this, its need some improvement I think. When I use in my emacs its causes an error, but does what you want. I will

How to view history of various commands in Emacs

試著忘記壹切 提交于 2019-12-04 16:20:16
问题 Commands entered after pressing M-x can be viewed using the up / down arrow keys. How can I get a list of all the commands including menu bar invocation, commands triggered using mouse clicks, etc. in Emacs? 回答1: I've used mwe-log-commands to make screencasts. It shows events and the commands they trigger as you work in Emacs. command-log-mode I've just forked it and made it into a proper minor-mode and global-minor-mode along with some other improvements as command-log-mode . Give it a shot