all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Run `gap-format-buffer` on specified gap script file without starting Emacs.
@ 2022-05-01  8:53 Hongyi Zhao
  0 siblings, 0 replies; only message in thread
From: Hongyi Zhao @ 2022-05-01  8:53 UTC (permalink / raw)
  To: help-gnu-emacs

I've installed the gap-mode with the following command:

```
(use-package gap-mode
  ;; https://gitlab.com/gvol/gap-mode#configuration
  :config
  (setq
   gap-executable "~/.local/bin/gap"
   ;; gap-start-options (list "-l" "~/Public/repo/github.com/gap-system/gap.git"
   ;;                         "-m" "2m")
   gap-start-options (list "-f" "-m" "2m" "-E")
   )
  )
```

And it defined the following command to format gap script file:

```
gap-format-buffer is an interactive and compiled function defined in
gap-mode.el.

Signature
(gap-format-buffer)

Documentation
Call gap-format-region on entire buffer.

Key Bindings
gap-mode-map C-M-q

References
gap-format-buffer is unused in gap-mode.el.

Find all references Functions used by gap-format-buffer

Debugging
Enable edebug Enable tracing
Disassemble Forget

Source Code
;; Defined in ~/.emacs.d/straight/build/gap-mode/gap-mode.el
(defun gap-format-buffer ()
  "Call `gap-format-region' on entire buffer."
  (interactive)
  (set-mark (point-max))
  (goto-char (point-min))
  (gap-format-region))

Symbol Properties
event-symbol-element-mask
  (gap-format-buffer 0)
event-symbol-elements
  (gap-format-buffer)
modifier-cache
  ((0 . gap-format-buffer))
```

In normal way, the command should be used as follows:

1. Open a gap script file;
2. M-x gap-format-buffer RET

But now I want to write a code formatter by warping the above logic,
so that I can format the gap script file without starting Emacs.

Are there any clues to achieving this goal?

Regards
-- 
Assoc. Prof. Hongsheng Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-01  8:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-01  8:53 Run `gap-format-buffer` on specified gap script file without starting Emacs Hongyi Zhao

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.