all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Printing comment-start of various modes
@ 2024-08-13 20:09 Heime
  2024-08-13 21:13 ` Stephen Berman
  0 siblings, 1 reply; 7+ messages in thread
From: Heime @ 2024-08-13 20:09 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor

This function should print the value of comment-start for various modes,
but I am not getting any comment-start outputs from it.

(defun costart ()
  "Loop through various major modes and print the value of `comment-start`."

  (interactive)

  (let ( (modes '(sh-mode perl-mode python-mode
		 emacs-lisp-mode lisp-interaction-mode
                 org-mode tex-mode latex-mode texi-mode
                 c-mode c++-mode f90-mode fortran-mode
                 html-mode css-mode js-mode
                 java-mode php-mode) )

         (output-buffer (generate-new-buffer "Costart")) )

    (with-current-buffer output-buffer
      (insert "Mode \t\t Comment Start \n")
      (insert "---- \t\t ------------- \n"))

    (dolist (mode modes)
      (with-temp-buffer
        (funcall mode)
        (let ((comment-start (or comment-start "None")))
          (with-current-buffer output-buffer
            (insert (format "%s \t\t %s \n" mode comment-start))))))

    (switch-to-buffer output-buffer)))




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-08-14 15:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-13 20:09 Printing comment-start of various modes Heime
2024-08-13 21:13 ` Stephen Berman
2024-08-13 21:32   ` Heime
2024-08-13 21:55     ` Stephen Berman
2024-08-13 22:10       ` Heime
2024-08-13 22:17         ` Stephen Berman
2024-08-14 15:59           ` Heime

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.