From 53287c2084b3d4ece0870ec1b23f202332801cf4 Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Wed, 27 Mar 2019 23:15:01 -0400 Subject: [PATCH] [LaTeX] Reindent --- global.org | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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)