X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/8a152a79984a99e98919ca2c7fcf7f2cf6c8c9f1..faa3255614fbe4a3e5780cc482640cafba59da43:/el/dot-emacs.el diff --git a/el/dot-emacs.el b/el/dot-emacs.el index 2909fdd..ffe360a 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -647,13 +647,13 @@ This is mainly useful in `auto-fill-mode'.") (defun mdw-maybe-tabify (s) "Tabify or untabify the string S, according to `indent-tabs-mode'." - (with-temp-buffer - (save-match-data - (let ((tabfun (if indent-tabs-mode #'tabify #'untabify))) + (let ((tabfun (if indent-tabs-mode #'tabify #'untabify))) + (with-temp-buffer + (save-match-data (insert s "\n") (let ((start (point-min)) (end (point-max))) - (funcall tabfun start end) - (setq s (buffer-substring start (1- end)))))))) + (funcall tabfun (point-min) (point-max)) + (setq s (buffer-substring (point-min) (1- (point-max))))))))) (defun mdw-examine-fill-prefixes (l) "Given a list of dynamic fill prefixes, pick one which matches @@ -1420,17 +1420,17 @@ doesn't match any of the regular expressions in (list ;; Handle the keywords defined above. - (list (concat "\\<\\(" javascript-keywords "\\)\\>") + (list (concat "\\_<\\(" javascript-keywords "\\)\\_>") '(0 font-lock-keyword-face)) ;; Handle the predefined constants defined above. - (list (concat "\\<\\(" javascript-constants "\\)\\>") + (list (concat "\\_<\\(" javascript-constants "\\)\\_>") '(0 font-lock-variable-name-face)) ;; Handle numbers too. ;; ;; The following isn't quite right, but it's close enough. - (list (concat "\\<\\(" + (list (concat "\\_<\\(" "0\\([xX][0-9a-fA-F]+\\|[0-7]+\\)\\|" "[0-9]+\\(\\.[0-9]*\\|\\)" "\\([eE]\\([-+]\\|\\)[0-9]+\\|\\)\\)"