elisp

function to call same shell command in dired

hi, i'd like to be able to call the same shell command on the marked files in dired without the need for emacs to prompt the command input as the command will always be the same. in particular, the command is "open" (for mac os x). i tried to hack the function dired-do-shell-command in dired-aux.el but i don't understand the interacti...

Emacs Lisp: difference between (function (lambda ...)) and (lambda ...)?

What is the difference between (function (lambda ...)) and (lambda ...) and '(lambda ...) ? It seems three are interchangeable in a lot of cases. ...

Elisp function returning mark instead of the right value

I'm writing a routine to test to see if point is at the practical end of line. (defun end-of-line-p () "T if there is only \w* between point and end of line" (interactive) (save-excursion (set-mark-command nil) ;mark where we are (move-end-of-line nil) ;move to the end of the line (let ((str (buffer-substring (ma...

What do I pass to the switch-to-buffer arguement in my .emacs file?

I am getting an error in my .emacs file at the following line: (switch-to-buffer *Completions*) error: symbols value as variable is void I did a describe-function on switch-to-buffer and found I CAN pass it a BUFFER (and another optional argument which I do not currently need). What am I doing wrong? Just a few notes: a. I also need...

[emacs] How can I copy the end of the line starting one line above the cursor?

I want to copy the line above the cursor, but just from the current column to the end of that line. Here's an illustration: This was my attempt, but it doesn't work so well :-( (defun dupchar() (save-excursion (line-move (-1) nil nil nil) (setq mychar (thing-at-point 'char)) (insert mychar)) ...

What is the simplest, most portable way to send an email in elisp?

I'd like to write a little emacs command to send an email. What's the simplest way to do this? I know there are a lot of mail-sending plugins for emacs, but I really just need to send a simple little email. ...

emacs: is before-save-hook a local variable?

how would I figure this out? I added delete-trailing-whitespace to the before-save-hook in my c-mode-common-hook, but it looks like delete-trailing-whitespace is getting called for every file, not just buffers using c-mode and derivatives. Can I make the before-save-hook buffer local? ...

[emacs] how to know current buffer have set-mark

is there any way know there is set-mark beginning and where is the start point query in lisp ...

Natural order sort for Emacs Lisp

Has anyone implemented a natural order sort in Emacs Lisp? I know it's not hard to write, but it's easier to borrow someone else's work. (Yeah, I can't believe I just searched for an Emacs function and couldn't find it.) ...

height of emacs bottom command line

How do I change the height of the emacs bottom command line. It seems it's a fraction of the whole frame, which takes too much space. Thanks in advance. ...

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

At the top of my elisp module, I want to do something as simple as: (message (concat "Loading " (expand-file-name (current-elisp-module) "."))) ...

how to run certain elisp code after starting a new emacsclient frame?

For how to automatically evaluate certain lisp code every time starting an emacsclient, click here. My problem is different. I want to write a script that opens a new emacs frame (with focus on it) (one way to do this is to run emacsclient -c) and then run the following elisp code in that frame. (org-remember) I tried emacsclient -c...

Processing text with elisp

Hello, guys! Since I've converted to the Church of Emacs, I've been trying to do everything from inside it, and I was wondering how to do some text processing quickly and efficiently with it. As an example, let's take this list that I was editing some minutes ago on org-mode. ** Diego: b QI ** bruno-gil: b QI ** Koma: jo ** um: rsrs ...

Emacs rgrep customization

I have the following custom function in ~/.emacs: (defun xi-rgrep (term) (grep-compute-defaults) (interactive "sSearch Term: ") (rgrep term "*.[ch]*" "../") ) This function just runs rgrep for the term entered in the files/directories I'm interested in. However, I want to match the original rgrep functionality of having the ...

Is there any way to automatically close filename completetion buffers in Emacs?

For example, when you open a file via C-x-C-f, you can TAB complete file names, and if there are more than one possible completions, it will pop open a completion buffer with a list of possible completions. The problem is, after you've opened the file, the window the buffer was in switches back to normal, but it doesn't close. Is there a...

Suppress emacs auto-fill in a selected region

I use emacs to edit everything. On some of my LateX documents I would like to automatically disable auto-fill mode when I am editing tables and code. Basically, I'd like to have two tags, like: %%% BEGIN NO FILL %%% END NO FILL and nothing between them will be autofilled. Can anybody think of a way to do this? I would need to f...

Getting stock prices from Yahoo with Elisp?

I would like to use Yahoo to get stock prices from within an Emacs Lisp program. I have two questions. How do I make the http GET? What is the best what to store the data in Elisp so I can make comparisons of the data? In other words, should I use one hash table, several hash tables, or lists to represent that data returned from Y...

cannot open file cua in second instance of emacs

i get the following error when trying to open a second instance of emacs: File error: "Cannot open load file" , "cua" I guess I don't HAVE to open another instance of emacs (that is the beauty after all), I was just trying to keep some things separated (specifically work - like code and debug - and play - like news). Would there be a...

Set some word with highlight color in emacs

Hi, guys, If I want to highlight some words in my doc in Emacs, how can I do it. For example I have a log file where I recorded some daily information. And I want to make all "TODO" in this log be highlighted. How can I do it? Thank you in advance. ...

emacs function c-forward-sws: Wrong type argument: stringp, nil

Hi, I've been getting this error in emacs whenever I type anything in certain buffers: c-forward-sws: Wrong type argument: stringp, nil It seems to be a syntax highlighting thing; I'm getting it in a buffer that's in sh-mode whenever I type anything -- even return on an empty line. I have also occasionally gotten it in a C++-mode buffe...