elisp

elisp macro to write function?

hello I have written few functions, which nearly identical, save for names. For example ; x is name, such as function/paragraph/line/etc. (defun my-x-function (interactive) (mark-x) (do-more-stuff) (modify-x)) is there a way to put it automatically to generate function, paragraph, etc. functions? I have a feeling this is what macr...

elisp newbie question: Can't find 'filename' function definition in org.el?

I really love org-mode in emacs and want to customize a few things. While reading thru org.el, I'm finding several references to filename but can't find filename using describe-function? I'm sure there's a simple answer, but I'm just learning elisp and it's not obvious. Any insight into where filename is defined? And/or if it's not a f...

Creating a new buffer with text using EmacsClient

I have a program that can send text to any other program for further analysis (eg sed, grep, etc). I would like it to send the data to Emacs and do analysis there. How would I do that? EmacsClient takes a filename by default, this is a data string not a file and I really don't want to create and delete files just to send data to Emacs...

elisp compile, add a regexp to error detection

I am starting with emacs, and don't know much elisp. Nearly nothing, really. I want to use ack as a replacement of grep. These are the instructions I followed to use ack from within emacs: http://www.rooijan.za.net/?q=ack_el Now I don't like the output format that is used in this el file, I would like the output to be that of ack --gr...

Recenter a named buffer that is not neccessarily the current buffer in emacs Lisp

I'd like to recenter a buffer, called *Lense*, where I've inserted some text. I wished to make it the current buffer by (set-buffer "*Lense*"), then (recenter 0)). By the following code segments: (save-excursion (set-buffer "*Lense*") (recenter 0)) However, it seems that the above code would only recenter the buffer w...

Emacs key binding fallback

Hey, I have a minor mode. If that mode is active and the user hits DEL, I want to do some action, but only if some condition holds. If the condition holds and the action is executed I want to do nothing more after that. But if the condition fails, I don't want to do anything and let the default DEL action execute. Not sure how I could ...

Newbie: Keybindings error in Elisp

Hi, I am trying to make a simple keybinding to the "na" function. When I execute (na) it inserts "å" in the current buffer, which it is supposed to, but the when I try the keybinding as described in the first line I get the error: "Wrong argument: commandp, na". I am not sure if it matters, but I have also put the (local-set-key) comman...

emacs elisp buffer not running font lock mode until opened by user

My problem is I am opening a buffer using (set-buffer (find-tag-noselect (current-word))) and then I try to copy some text out of that buffer. The text that I get back has only the properties (fontified nil). find-tag-noselect automatically opens the buffer found in the TAGS file but it seems it does not run the font lock mode over it....

Implementing a continuous "revert-buffer" aka Textpad

One of my colleagues uses TextPad, and one feature I found really useful is the Auto-Reload. (The feature has been described in this SO quesion: http://stackoverflow.com/questions/1246083/alternative-to-textpads-prompt-to-reload-file). Basically, it keeps reloading the file without any prompt from the user, which is really helpful when m...

How do I create an Emacs SQL buffer?

I can connect manually by doing: M-x sql-postgres and type the User, Database, Host, Server I'd like to do something like: (connect-foo (user "me")(database "bar")(host "earth")) Solution so far: I grabbed some code from sql.el and changed it so I can use it non-interactively. (defun sql-create-buffer (profile) "derived from sql...

Can't activate 'remember' in org-mode

I can't get 'remember' to work in org-mode of emacs. I'm on snow leopard. I added (global-set-key (kbd "C-M-r") 'org-remember) to my .emacs file but when I try to use that shortcut it says: Wrong type argument: commandp, remember So I added (org-remember-insinuate) and when I start emacs it says: symbol's function definition is vo...

How do I get Emacs to evaluate a file when a frame is raised?

Basically I have my Emacs set up so it has a GUI specific elisp, but when starting it in daemon mode this doesn't evaluate. The code is something like: ;; gui.el (when window-system (progn ;; do stuff here )) I'd like this file (or at least the code within it—perhaps a funtion) to be re-evaluated when I run emacsclient -c on...

Emacs: annoying Flymake dialog box.

Hello, I have the following lines in my ~/.emacs.d/init.el (custom-set-variables '(flymake-allowed-file-name-masks (quote ( ("\\.cc\\'" flymake-simple-make-init) ("\\.cpp\\'" flymake-simple-make-init))))) (add-hook 'find-file-hook 'flymake-find-file-hook) When I open a C++ file that has a proper Makefile...

emacs debugger: how can I step-out, step-over ?

I don't know why I'm having so much trouble groking the documentation for the elisp debugger. I see it has a commands to "step-into" (d). But for the life of me, I cannot see a step-out or step-over. Can anyone help? If I have this in the Backtrace buffer: Debugger entered--returning value: 5047 line-beginning-position() * c-p...

How do I instruct emacs to use 4 spaces instead of the tab character for all indentation?

What do I put in my .emacs file to use four spaces instead of the tab character for all indentation? ...

Org-mode properties for Emacs diary anniversaries?

I am trying to have the "Birthday" property of an Org-mode contact entry added to the agenda automatically: * John :PROPERTIES: :Name: John :Birthday: 5 4 1900 :END: This can be done manually for each entry using: %%(diary-anniversary 5 4 1900) John's birthday But I don't want to type the date twice. I would like to use the ...

Import CSV into Org-mode properties

I would like to import a CSV into Org-mode. Others have already asked about importing CSV to Org-mode tables. That's not what I am trying to do. I need to import CSV to Org-mode properties. For example, a CSV like this: Name,Tel,Mobile,Fax John,11111,22222,33333 should become: :PROPERTIES: :Name: John :Tel: 11111 :Mobile: 22222 :Fax...

problem in `delete-directory` with enabled `delete-by-removing-to-trash`

There is a strange behavior of delete-directory function with enabled flag delete-by-removing-to-trash. It deletes files one by one instead of applying move-file-to-trash to the directory. As a result emacs deletes big directories slowly and there are many files in the trash after deleting, so it is impossible to restore the directory. ...

How do I create an empty file in emacs?

How can I create an empty file from emacs, ideally from within a dired buffer? For example, I've just opened a Python module in dired mode, created a new directory, opened that in dired, and now need to add an empty __init__.py file in the directory. If I use C-x C-f __init__.py RET C-x C-s then emacs doesn't create the file because no...

(re)number numbered lists in emacs (muse)

hello, suppose I have a text list in emacs like this: a b c ... d Is there a way to assign numbers to those items in Emacs, by selecting the region? End results should look like: 1. a 2. b 3. c j. ... n. d Thanks. ...