Skip to content

Instantly share code, notes, and snippets.

@amalloy
Created September 27, 2010 20:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amalloy/599774 to your computer and use it in GitHub Desktop.
Save amalloy/599774 to your computer and use it in GitHub Desktop.
(defun smart-line-beginning ()
"Move point to the beginning of text on the current line; if that is already the current position of point, then move it to the beginning of the line."
(interactive)
(let ((pt (point)))
(beginning-of-line-text)
(when (eq pt (point))
(beginning-of-line))))
(global-set-key "\C-a" 'smart-beginning-of-line)
@klang
Copy link

klang commented Sep 27, 2010

(global-set-key "\C-a" 'smart-line-beginning)

;; of course ..

@amalloy
Copy link
Author

amalloy commented Sep 27, 2010

Bah. Emacs can't just read my mind, or use genius-like fuzzy correction?

@klang
Copy link

klang commented Sep 27, 2010

tab completion .. you must have it!

@amalloy
Copy link
Author

amalloy commented Sep 27, 2010

Well yes. That's the only reason M-x was working for me. But I haven't figured out how to get tab completion in my .emacs file to recognize new symbols I've defined. Is this easy?

@klang
Copy link

klang commented Sep 27, 2010

I am unsure which of these make it work in my setup ..

http://github.com/klang/elisp/blob/master/50-hippie-expand.el

or

http://github.com/klang/elisp/blob/master/52-clojure-extras.el

.. but I think it's the last one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment