symbols - Emacs. Abbreving "." to ending sentence -


i emacs newbie. trying expand character "." ". " (period 2 spaces in order more effective in ending sentence in emacs) abbrevs. in other words, when type "." followed space, emacs put ". ".

i have put next code in abbrevs file, doesn't work.

(text-mode-abbrev-table)                                     "."            0    ".    "  

anybody can me?

i'm not sure why want this, here is:

put in ~/.emacs:

(defun electric-dot ()   (interactive)   (if (and (looking-back "\\w") (not (looking-back "[0-9]")))       (progn         (self-insert-command 1)         (insert "  "))     (self-insert-command 1)))  (defvar electric-dot-on-p nil)  (defun toggle-electric-dot ()   (interactive)   (global-set-key    "."    (if (setq electric-dot-on-p              (not electric-dot-on-p))        'electric-dot      'self-insert-command))) 

afterwards, use m-xtoggle-electric-dot make each . insert ., if it's after word. can call again restore default behavior.

as side-note, there's ton of much better ways improve text input speed e.g. auto-complete-mode. can install package-install.

upd electric-dot inserts dot after digits.

upd here's electric-space instead:

this 1 insert space if it's looking @ word followed dot.

(defun electric-space ()   (interactive)   (if (looking-back "\\w\\.")       (insert " "))   (self-insert-command 1))  (defvar electric-space-on-p nil)  (defun toggle-electric-space ()   (interactive)   (global-set-key    " "    (if (setq electric-space-on-p              (not electric-space-on-p))        'electric-space      'self-insert-command))) 

Comments

Popular posts from this blog

HTTP/1.0 407 Proxy Authentication Required PHP -

curl - PHP fsockopen help required -

c# - Resource not found error -