elisp

A+ and Emacs (but *not* XEmacs)

Hello, I have installed A+ and set up XEmacs in Debian, using the aplus-fsf-dev and aplus-fsf-el packages; XEmacs was installed as a dependency. I checked the A+ site (http://www.aplusdev.org/), and there seems to be nothing about running A+ on plain Emacs (and not XEmacs). Does anyone know if there are elisp files somewhere for setti...

Do you have a mnemonic for remembering the meaning of car and cdr?

Most of my Lisp experience comes from Elisp. As such, I find myself writing Lisp only on occasion. By the time I come back to it, I often forget the difference between car and cdr and need to reference the docs to jog my memory. What kinds of clever mnemonics do you use to remember the difference between Lisp functions that have nam...

How to capitalize english string in Emacs

I'm wondering what's people using to correctly capitalize english strings since ''capitalize'' won't do the job: (capitalize "can't") => "Can'T" Although writing this function is trivial, I'm wondering if there's a preferred built-in way to do it. ...

Tracking down max-specpdl-size errors in emacs

I've been randomly getting the following error in emacs: Variable binding depth exceeds max-specpdl-size ...and I've been getting it at very random moments. After researching this, it seems as though some elisp somewhere is recursing too deeply. Are there any strategies for tracking this down? I'm totally at a loss as far as wha...

Make Emacs less aggressive about indentation

Emacs reindents the current line whenever I type certain things, like ";" or "//". This is pretty annoying, since there are a whole lot of places where it isn't smart enough to indent correctly. How do I disable this feature? I still want to be able to indent the line with TAB, but I don't want any source code I type to cause it to re...

Emacs: Adding tooltips to output in subsidiary process (in comint, say)

I have a process (whose output I can customize) running in a comint shell within emacs, and I want to annotate its output so that it includes tooltips. As per http://stackoverflow.com/questions/293853/defining-new-tooltips-in-emacs I might add tooltips to text by using the echo-help property. It looks as if I will have add a filter fun...

Creating a POST with url elisp package in emacs: utf-8 problem

Hello everyone. I'm currently creating a Rest client for making blog posts much in the spirit of pastie.el. The main objective is for me to write a textile in emacs and make a post to a Rails application that will create it. It is working fine until I type anything in either spanish or japanese, then I get a 500 error. pastie.el has this...

How to refer to the file currently being loaded in Emacs Lisp?

I am looking to include a reference to a non-elisp file (a small Python program), and would like to be able to say "it is in the same directory as the current file, but with a different file name." In many scripting languages, there are things like __FILE__ (in PHP) for getting an absolute path to the current file. If the file to be inc...

debug elisp major mode

I'm developing a major mode for Emacs. Is there any way that I can set a break point in the source code when fontification happens, for example? ...

What does "s-[keyname]" refer to in Emacs, and how do I tell Emacs to ignore it?

Background information: I'm on a Mac, and I've just upgraded to Emacs 23.1 via http://emacsformacosx.com/. There are a few issues, notably the lack of full screen ability. I've attempted to get around this last issue by installing Megazoomer, which adds a global input manager bound to Cmd-return. This causes the currently forward appli...

Lisp void-variable error when evaluating function

I'm trying to learn Lisp (elisp, actually), and I tried writing the following function as an exercise (Project Euler #2): (defun sumfib (n fn1 fn2 sum) "Calculate Fibonacci numbers up to 4,000,000 and sum all the even ones" (if (< 4000000 (+ fn1 fn2)) sum (if (equal n 3) (sumfib 1 (+ fn1 fn2) fn1 (+ sum (+fn1 fn2))...

emacs: force ido-mode to forget history...

Hi, I wonder if I can keep ido from not remembering my history and only show completions for files that are in the current directory when I am searching for a file. I understand that this history feature is useful at times, but I often end up editing the incorrect file because I think I am editing file called 'abc.txt' in the current dir...

bignum in emacs/elisp

Does emacs have support for big numbers that don't fit in integers? If it does, how do I use them? ...

In Emacs, how can I load a certain file when (require 'x) is called?

I need CEDET for eassist (eassist-list-methods is quite handy). In eassist.el there's the line (require 'semantic) which fails if CEDET isn't loaded. The thing is that I don't need CEDET all the time and it takes a long time to load so I want to defer loading it until I call eassist-list-methods. Is there a way to run (load "cedet...

multi-character parentheses in syntax table

I know that I can have multi-character comment delimiters, but how about multi-character parentheses, e.g. if I wanted to treat the character sequence "%{" as an opening parenthesis and "}%" as a closing one like this %{ }% ...

emacs: adding modes to hide-show alist

Hi emacs gurus - I wonder if you know how to get hideshow work with new modes. For instance, I have some extraneous code I want to hide with R. With folding-mode it can simply be (load "folding" 'nomessage 'noerror) (folding-add-to-marks-list 'ess-mode "# {{{" "# }}}" nil t) (add-hook 'ess-mode-hook 'turn-on-folding-mode) I thought t...

How to center a string in elisp?

I would like to center justify a given input string to a given size so that what is produced is a string with padded spaces either side (left and right) of the input string. The code I have to do this: (defun center-string (string size) (let* ((padding (/ (- size (length string)) 2)) (lpad (+ (length string) padding)) ...

Emacs: function that writes down an elisp code that adds a keybinding specified by the user.

How can I make an interactive function that interactively read a key from the user (like when you press C-h k) and then writes some line like this: (global-set-key (kbd "C-x C-s") 'hello) where the "C-x C-s" part is replaced appropriately with the read key. Some beginning users have problem making keybindings and in fact I get confus...

Elisp List Contains a Value

How do you check, in elisp, if a list returns a value? so the following would return t: (contains 3 '(1 2 3)) but (contains 5 '(1 2 3)) would return nil. ...

Emacs auto-save on switch buffer

Call me lame, but I'm tired of my subconscious C-x C-s nervous twitch. I am switching buffers often enough and I think I would like to save a certain buffer as soon as I switch to another. I have not had the time yet to learn Emacs-Lisp basics. Any hints on how to do this, or better solutions? (On a related note, I found an autosav...