emacs24

Can't set Emacs Speedbar buffer display mode

半腔热情 提交于 2019-12-10 10:28:01
问题 I often work with differents active buffer on emacs like : source files SQL buffer shell buffer I try to get speedbar always display buffer mode but I can't find any option that can load this display when emacs is started (default is file mode), and keep it during all session. I also tried ecb history window that can display opened/recently closed edit buffers but there's no way to make it display specials buffers like SQL or shell. How can I customize emacs to get this behavior? 回答1: I know

macro expansion: to quote the body forms or not?

蓝咒 提交于 2019-12-10 10:27:35
问题 I'm having a hard time understanding exactly how macro expansion works. What is the difference in how the elisp interpreter handles these two snippets of code? (defmacro foo (arg) (message "arg is: %s" arg)) (foo "bar") and: (defmacro foo (arg) `(message "arg is: %s" ,arg)) (foo "bar") 回答1: You example may be confusing because message both displays a message and returns it. strings (like "bar") are self-evaluating. Instructive Example (defconst zzz 123) (defmacro zzz1 (arg) `(insert (format

Strange vertical lines appearing in Emacs on OS X?

帅比萌擦擦* 提交于 2019-12-10 10:07:18
问题 My emacs is displaying strange vertical lines. These lines appear in any colour and length randomly. There doesn't seem to be any reason why they would appear. They disappear/change sometimes when I switch buffers or scroll - basically any activity that forces the entire frame to redraw. They appear in any part of the frame at random, but especially in the line number's gutter, and on both sides. I'm using Emacs 24.1 on OS X 10.7.4. I've checked, all other applications render perfectly fine,

Python dictionary or map in elisp

北城余情 提交于 2019-12-09 17:29:57
问题 What is the equivalent of a python dictionary like {'a':1, 'b':2} in elisp? And again, does elisp have any map-reduce api? 回答1: Association lists are the most commonly used associative containers in elisp. It is just a list of key-value cons cells like this ((key . value)) . You can use the assoc function to get a value corresponding to a key and rassoc to get a key with the required value. Elisp comes with the built-in function mapcar which does map, but AFAIK there is no good fold facility.

Tab in Emacs-helm (anything) does not autocomplete with current best match

戏子无情 提交于 2019-12-09 11:28:07
问题 While trying to autocomplete a file (e.g. to open a file with C-x C-f ) Emacs-helm shows a list of possible candidates. If I then press Tab (which I would hope it would help me choose the first/closest match), I get the following in the minibuffer: It looks like the minibuffer gets confused with escape characters, and it does not choose the file that I actually want to open (the top choice). 回答1: Helm requires this conceptual jump from the default Emacs completion, which is not so obvious:

How are the packages installed with 'package-install'(elpa) in Emacs loaded?

允我心安 提交于 2019-12-08 12:44:08
问题 I have installed some packages by using elpa in my Emacs, but how are they loaded when launching Emacs? 回答1: package-install is a part of package.el -- which You can see with describe-function . From package.el documentation: ;; At activation time we will set up the load-path and the info path, ;; and we will load the package's autoloads. If a package's ;; dependencies are not available, we will not activate that package. So in every package there's a file NAME-autoloads.el and this file is

“value returned is unused” warning when byte-compiling a macro

邮差的信 提交于 2019-12-07 22:30:05
问题 Why does byte-compiling the the following produce a warning? (defmacro foomacro (shiftcode) `(defun foo (&optional arg) (interactive ,(concat shiftcode "p")) (message "arg is %i" arg)) `(defun bar (&optional arg) (interactive ,(concat shiftcode "Nenter a number: ")) (message "arg is %i" arg))) ;; provide backward compatibility for Emacs 22 (if (fboundp 'handle-shift-selection) (foomacro "^") (foomacro "")) This is the warning I get: $ emacs -Q --batch --eval '(byte-compile-file "foo.el")' In

How to disable case-sensitivity for filename auto-completion in Emacs 24 shell-mode?

梦想的初衷 提交于 2019-12-07 16:02:09
问题 On upgrading from Emacs 23 to Emacs 24, filename completion suddenly became case sensitive in shell-mode . I had customized Emacs 23 to be case insensitive in this case but I forget the exact customizations now. Going over my .emacs file, I see that read-file-name-completion-ignore-case is set to non-nil. However, that seems to have no effect in Emacs 24's shell-mode . 回答1: So it turns out that shell-mode in Emacs 24 uses pcomplete by default. pcomplete was always the default for eshell but

How to ask gnutls to use client certificate in emacs 24

别等时光非礼了梦想. 提交于 2019-12-07 05:25:25
问题 I'm trying to use client certificate to authenticate to an irc server. In emacs 23, I was able to use tls-program variable to do so: (setq tls-program '("gnutls-cli --priority secure256 --x509cafile /home/me/CAs.pem --x509certfile /home/me/nick.pem -p %p %h")) However, the support in emacs24 is native using libgnutls and does not use external program, hence it ignores tls-program variable. Could someone tell me, what's the alternative way to define a default client certificate in emacs 24?

Emacs indentation for html (web-mode) doesn't work properly

二次信任 提交于 2019-12-07 04:59:15
问题 I'm using web-mode in Emacs to get syntax highlighting and indentation for PHP and HTML. If I have this code in a .php file <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p> And then put the cursor on the middle line and press tab then nothing happens. I want it to look like this: <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p> If I put the text in a tag on a single line and try to indent, it works. This: <p> <a>Lorem ipsum dolor sit amet, consectetur