Function: cperl-find-bad-style

cperl-find-bad-style is an interactive and byte-compiled function defined in cperl-mode.el.gz.

Signature

(cperl-find-bad-style)

Documentation

Find places in the buffer where insertion of a whitespace may help.

Prompts user for insertion of spaces. Currently it is tuned to C and Perl syntax.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cperl-mode.el.gz
(defun cperl-find-bad-style ()
  "Find places in the buffer where insertion of a whitespace may help.
Prompts user for insertion of spaces.
Currently it is tuned to C and Perl syntax."
  (interactive)
  (let (found-bad (p (point)))
    (setq last-nonmenu-event 13)	; To disable popup
    (goto-char (point-min))
    (map-y-or-n-p "Insert space here? "
		  (lambda (_) (insert " "))
		  'cperl-next-bad-style
		  '("location" "locations" "insert a space into")
		  `((?\C-r ,(lambda (_)
			      (let ((buffer-quit-function
				     #'exit-recursive-edit))
                                (message "Exit with Esc Esc")
                                (recursive-edit)
                                t))	; Consider acted upon
			   "edit, exit with Esc Esc")
		    (?e ,(lambda (_)
			   (let ((buffer-quit-function
				  #'exit-recursive-edit))
			     (message "Exit with Esc Esc")
			     (recursive-edit)
			     t))        ; Consider acted upon
			"edit, exit with Esc Esc"))
		  t)
    (if found-bad (goto-char found-bad)
      (goto-char p)
      (message "No appropriate place found"))))