Jiri Pejchal wrote: > "weber" writes: > >> There's probably a faster way, but the way I know is remapping the ';' >> key like this: >> >> (global-set-key ";" 'insert-closepar) >> >> where the function insert-closepar would be something like this >> (tested) : >> >> (defun insert-closepar () >> "Close parenthesis Jiri's way" >> (interactive) >> (if (looking-at ")") >> (forward-char)) >> (insert ";")) >> >> Oh, and you probably don't want to make that binding global map, >> because you are only going to use it on specific modes. Try doing: >> (define-key somelanguage-mode-map ";" 'insert-closepar) > > Thanks a lot! But I would like to keep the electric behaviour of ';' > too. It's bound to c-electric-semi&comma. Try changing it to: (defun insert-closepar () "Close parenthesis Jiri's way" (interactive) (if (looking-at ")") (forward-char)) (c-electric-semi&comma)) Matthew Flaschen