diff --git a/global.org b/global.org index a5c7def..1936bd7 100644 --- a/global.org +++ b/global.org @@ -1082,13 +1082,14 @@ #+END_SRC This inserts a char adding some whitespace padding whenever necessary #+BEGIN_SRC emacs-lisp - (defun insert-char-with-padding (arg) + (defun insert-char-with-padding (arg) (interactive "*P") - (if (string= (string (preceding-char)) " ") () - (if (string= (string (preceding-char)) "\&") () (insert " "))) + (unless (string-match (string (preceding-char)) " \&") + (insert " ")) (self-insert-command (prefix-numeric-value arg)) - (if (string= (string (following-char)) " ") () (insert " ")) ;; decide what to do with the point - ) + (unless (char-equal (following-char) ?\s) + (insert " "))) ;; decide what to do with the point + #+END_SRC #+END_SRC This inserts a plain reference (or a reference to an equation with prefix arg)