elisp

How to copy some content in a system clipboard not a kill ring with elisp/emacs?

I learned that copy something to kill buffer, I can use the kill-new buffer (kill-new (file-truename buffer-file-name)) How about copying the content to clipboard? Does emacs/elisp provide the function? ADDED I got 2 answers, but the answer seems to apply X windows system. As I use Aquamacs, it may not be a universal solution that c...

Redefining keys in Emacs on Windows

Hi, I use my command keys as extra control keys on Mac OS X (and I believe the space cadet keyboards had this configuration). I want to emulate this on my Windows machines by switching Alt to Ctrl and the Windows key to Alt within Emacs. Is this possible? I found this post which suggests something like (setq w32-pass-lwindow-to-system n...

Concatenate string in elisp

I need to concatenate path string as follows, so I added the following lines in .emacs. (setq org_base_path "~/smcho/time/") (setq org-default-notes-file-path (concatenate 'string org_base_path "notes.org")) (setq todo-file-path (concatenate 'string org_base_path "gtd.org")) (setq journal-file-path (concatenate 'string org_base_path "j...

Emacs elscreen - how do I jump to numbered tabs

Elscreen has a method called elscreen-jump and also elscreen-jump-0 and elscreen-jump-9. I'd like to be able to jump to tabs between 0 and 9. How do I define a keymap for this? I've tried: (global-set-key (kbd "M-1") (lambda () (interactive) (elscreen-jump 0))) (global-set-key (kbd "M-2") (lambda () (interactive) (elscreen-jump 1))) b...

Using emacs for coloring display of texts

I have a log file that has a lot of tagging information, i.e, "ERROR", "WARNING", "*". I want to show the log info with different color/fonts based on the tagging info. How can I do that? Do I have to come up with my own major/minor modes? Is there some elisp code that I can reuse? ...

Using pydbgr with Emacs

Has anyone used Pydbgr with Emacs and if so would they mind sharing their .emacs configuration plus any associated elisp sources required. The installation instructions can be found at: http://code.google.com/p/pydbgr/wiki/Tutorial#Installation Pydbgr looks like a really useful extension to the capabilities of pdb, especially its su...

Setting frame size in Emacs on toggle out of fullscreen

I am using Carbon Emacs 23 and am trying to get the frame width to be a certain value after toggling out of a fullscreen frame (as set by a function). Actually, the weird thing is that not only is the width not set, but if you toggle out of fullscreen repeatedly the frame gets smaller and smaller, like a disappearing window. Appreciate a...

How can I write a hook to activate when any emacs frame is raised/focused?

Under Win32, each emacs frame shows up as a different window when Alt-tabbing, which makes sense. However, when I select my main editing window, I'd also like my speedbar frame to auto-raise along with it. Writing a function to raise all frames (or even all currently NOT visible frames) is relatively trivial, but I can't figure out hoo...

How to live with Emacs Lisp dynamic scoping?

I've learned Clojure previously and really like the language. I also love Emacs and have hacked some simple stuff with Emacs Lisp. There is one thing which prevents me mentally from doing anything more substantial with Elisp though. It's the concept of dynamic scoping. I'm just scared of it since it's so alien to me and smells like semi-...

Emacs search and open multiple files and search on all buffers.

Hello Im not sure if this question should be placed here or in another forum. But here goes. Im currently in the beginning of a switching process forwards Emacs. However im having to basic problems, I cant seem to find an answer for on the internet (google). A. How do I search for multiple files recursively from a specific path. I assum...

regexp-opt function missing in emacs?

I've started playing around with elisp to create font-locks (syntax highlighting) in Emacs. Most of the tutorials out there mention using an elisp function "regexp-opt" to optimize regular expressions, but my version of emacs (23.2) doesn't seem to have that function. Furthermore, Googling for the answer doesn't seem to turn up useful re...

How do I set the colour of brackets/braces/parentheses in Emacs?

I'd like to specify the colour of {}, () and [] in a custom colour theme. Is this possible? Update: Here's the source. Please note the in-development status of this theme; it is unsafe for use both at the workplace and around the home. ;;; Color theme based on Moria for VIM. (defun color-theme-moria () "A color theme based on Moria f...

How can I get a variable's initial value in Elisp?

In Emacs Lisp, is there a function to get the initial value of a symbol initilized by defvar? Like the some-function shown below: (defvar var "initial value") (setq var "changed value") (some-function 'var) => "inital value" ...

Stripping duplicate elements in a list of strings in elisp

Given a list such as (list "foo" "bar" nil "moo" "bar" "moo" nil "affe") how would I build a new list with the duplicate strings removed, as well as the nils stripped, i.e. (list "foo" "bar" "moo" "affe") The order of the elements needs to be preserved - the first occurence of a string may not be removed. The lists I'm dealing wit...

Speed up loading emacs by compiling packages

With packages loading such as orgmode, nxhtml, yasnippet, I see that the loading of emacs slowed down pretty much. I expect I can speed it up with the compilation of the packages. I can I do that with emacs? Normally, how much speed up can I expect? ...

How to make intangible text in emacs to be completely removed by deletion commands?

Hi there! I would like the whole intangible text to be deleted by delete-char and backward-delete-char. Any easy way? (put-text-property (point-at-bol) (point-at-eol) 'intangible t) kill-word and backward-kill-word will delete the intangible text, and I'd like the *-char commands to do the same. In the user interface I am building, ...

How to go about learning Common Lisp and Emacs Lisp?

The last few months I've been using Emacs extensively as my main development environment and I've now come to a point at which I'd like to learn it's own Emacs Lisp to write my own little stuff for Emacs and extend it to my personal needs. Having said that I've also wanted to learn Common Lisp for a while now, to play around with and ex...

How to periodically run a task within emacs?

Is there a way to periodically run an elisp function in a long-running emacs, similar to cron, but within the emacs process? For example I want to "automatically run (recentf-save-list) every half hour" because it otherwise only runs on exit, which sucks when emacs occasionally crashes. (There are other examples as well so looking for a...

Emacs Lisp: Can't set any value to variable named 's'

This is rather queer. I can't set any value to a variable if it is named 's' in an interactive session: (setq s 'foo) => foo s => nil Why? Update 1: Here is the output from describe-variable on s: s is void as a variable. Documentation: Not documented as a variable. Why is it that s is kept void in emacs lisp as a global variab...

Decoding gzip-ed response bodies with url-retrieve

For an Emacs extension, I'd like to retrieve data over HTTP. I'm not particularly fond of the idea of shelling out to things like wget, curl, or w3m to be able to do that, so I'm using the url-retrieve function. One of the HTTP servers i'm talking to happens to ignore Accept-Encoding headers and insists on always sending out its data wi...