elisp

In Emacs, how do I figure out which package is loading tramp?

和自甴很熟 提交于 2019-12-03 07:20:45
I have a strange interaction with tramp and cygwin-mount (I think: Emacs: Tab completion of file name appends an extra i:\cygwin ). Because of this, I want to disable tramp. I'm unable to find anything in my .emacs which is loading tramp explicitly. I can see "Loading tramp..." when I hit a tab in the find-file minibuffer. I'd like to figure out what package is causing the loading of tramp and disable that. How do I go about doing this? I tried searching for (require 'tramp) but couldn't find anything interesting. The only other option I can think of is to comment out bits of my .emacs one-by

How do I use Emacs's DBUS interface?

我只是一个虾纸丫 提交于 2019-12-03 06:38:49
I looked up the dbus package and it seems like all of the functions are built-in to the C source code and there's no documentation for them. How do I use the dbus-call-method function? Google to the rescue... Follow the link for the example, it's not my code so I won't put it here. http://emacs-fu.blogspot.com/2009/01/using-d-bus-example.html I just had the same problem and found the emacs-fu article that comes up when googling a little too basic for my needs. In particular I wanted to export my own elisp methods via dbus, and had problems making sense of the dbus terminology and how it

emacs list-buffers behavior

你离开我真会死。 提交于 2019-12-03 06:28:36
问题 In GNU emacs, every time I hit Ctrl-x Ctrl-b to see all of my buffers, the window is split to show the buffer list, or if I have my window already split in 2 (for instance, I will have a shell running in the lower window), the buffer list appears in the other window. My desired behavior is for the buffer list to appear in my active window so that I can select the buffer I want and continue to working in the same window, rather than having to Ctrl-x Ctrl-o to the other buffer, selecting the

Opening files with default Windows application from within emacs

做~自己de王妃 提交于 2019-12-03 05:55:22
I'm trying to tweak the dired-find-file function in emacs on Windows XP so that when I open (say) a pdf file from dired it fires up a copy of Acrobat Reader and opens that file with it, instead of opening it within emacs. But I can't work out what variant on shell-command/call-process to use. Here's what I have so far: (defadvice dired-find-file (around dired-find-file-external (filename &optional wildcards)) "Open non-text files with an appropriate external program." (if (string= ".pdf" (substring filename (- (length filename) 4))) ; obviously I'll replace this with something more general

What are the new rules for variable scoping in Emacs 24?

馋奶兔 提交于 2019-12-03 05:52:15
Emacs 24 now has lexically-scoped variables. It also still has dynamically-scoped variables, of course. Now that it has both, I'm quite confused about when a variable will have which kind of scope. There's a lexical-binding variable that controls when lexical binding is enabled, and I think I read something about defvar now declaring a dynamically-scoped variable, but in general I'm pretty lost. Is there a good explanation somewhere of Emacs 24's new scoping rules? Or put another way, when I look at a variable in Emacs Lisp code written for Emacs 24, how do I tell what scope that variable is

After 'emacs --deamon' I can not see new theme in emacsclient frame. It works from 'emacs M-x server-start'

妖精的绣舞 提交于 2019-12-03 05:32:21
Minimal config https://www.refheap.com/18816 Scenario 1. Run 'emacs' from terminal. M-x server-start Run 'emacsclient -c' from terminal. Effect: Theme applied. Scenario 2. Run 'emacs --daemon' from terminal Run 'emacsclient -c' Effect: Theme is not applied. Why is that? .emacs.d/init.d config: (require 'package) (package-initialize) (defun install-pack (p) "A utility function to help in installing emacs package." (unless (package-installed-p p) (package-install p))) (defun install-packs (packs) "A utility function to help in installing emacs packages." (unless package-archive-contents (package

How can I check if a file exists using Emacs Lisp?

瘦欲@ 提交于 2019-12-03 05:21:58
问题 I would like emacs to mark files that are generated as read-only when they're opened. The part of the puzzle that I'm missing is how to check if a file "exists". I currently have the following: ;; ;; get file extension ;; (defun get-ext (file-name) (car (cdr (split-string file-name "\\.")))) ;; ;; get the base name of the file ;; (defun base-name (file-name) (car (split-string file-name "\\."))) ;; ;; if an 'lzz' file exists for this header, mark it as read only ;; (defun mark-read-only ()

Elisp: How to delete an element from an association list with string key

血红的双手。 提交于 2019-12-03 05:12:37
Now this works just fine: (setq al '((a . "1") (b . "2"))) (assq-delete-all 'a al) But I'm using strings as keys in my app: (setq al '(("a" . "foo") ("b" . "bar"))) And this fails to do anything: (assq-delete-all "a" al) I think that's because the string object instance is different (?) So how should I delete an element with a string key from an association list? Or should I give up and use symbols as keys instead, and convert them to strings when needed? If you know there can only be a single matching entry in your list, you can also use the following form: (setq al (delq (assoc <string> al)

How to convert list to string in Emacs Lisp

…衆ロ難τιáo~ 提交于 2019-12-03 04:50:05
问题 How can I convert a list to string so I can call insert or message with it? I need to display c-offsets-alist but I got Wrong type argument: char-or-string-p for insert or Wrong type argument: stringp for message. 回答1: I am not sure of what you are trying to achieve, but format converts "stuff" to strings. For instance: (format "%s" your-list) will return a representation of your list. message uses format internally, so (message "%s" your-list) will print it 回答2: (format) will embed

What are the major differences between Emacs Lisp and Common Lisp? [closed]

早过忘川 提交于 2019-12-03 04:43:24
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I want to learn the lisp language, since my editor is emacs, I prefer emacs lisp. Can anyone give me some suggestions to learn lisp, emacs lisp, or common lisp? What are the major differences between those two? 回答1: There's quite a bit of crossover, especially at the beginner level, so whichever you start with