Home | History | Annotate | Download | only in clang

Lines Matching defs:to

8 ;; This package allows to filter code through clang-format to fix its formatting.
9 ;; clang-format is a tool that formats C/C++/Obj-C code according to a set of
23 ;; to your .emacs configuration.
25 ;; You may also want to bind `clang-format-region' to a key:
49 "Style argument to pass to clang-format.
80 (setq offset (string-to-number offset))
81 (setq length (string-to-number length))
84 (setq cursor (string-to-number text)))))))
99 (let ((start (clang-format--filepos-to-bufferpos offset 'exact 'utf-8-unix))
100 (end (clang-format--filepos-to-bufferpos (+ offset length) 'exact
107 ;; ?bufferpos-to-filepos? and ?filepos-to-bufferpos? are new in Emacs 25.1.
109 (defalias 'clang-format--bufferpos-to-filepos
110 (if (fboundp 'bufferpos-to-filepos)
111 'bufferpos-to-filepos
115 (defalias 'clang-format--filepos-to-bufferpos
116 (if (fboundp 'filepos-to-bufferpos)
117 'filepos-to-bufferpos
119 (byte-to-position (1+ byte)))))
123 "Use clang-format to format the code between START and END according to STYLE.
134 (let ((file-start (clang-format--bufferpos-to-filepos start 'approximate
136 (file-end (clang-format--bufferpos-to-filepos end 'approximate
138 (cursor (clang-format--bufferpos-to-filepos (point) 'exact 'utf-8-unix))
142 ;; the encoding used to convert between buffer and file positions,
154 "-offset" (number-to-string file-start)
155 "-length" (number-to-string (- file-end file-start))
156 "-cursor" (number-to-string cursor)))
175 (goto-char (clang-format--filepos-to-bufferpos cursor 'exact
185 "Use clang-format to format the current buffer according to STYLE."