unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* ELisp Multiline Comments
@ 2020-10-10  9:13 Christopher Dimech
  2020-10-10 14:46 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Christopher Dimech @ 2020-10-10  9:13 UTC (permalink / raw)
  To: Help Gnu Emacs


   I need to use Multiline Comments in my Elisp Codes so I can insert
   Org-Mode Commands,
   and read you can use

   #|
      Multiline Comment
   |#

   What are the options


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

* Re: ELisp Multiline Comments
  2020-10-10  9:13 ELisp Multiline Comments Christopher Dimech
@ 2020-10-10 14:46 ` Stefan Monnier
  2020-10-10 14:49   ` Stefan Monnier
  2020-10-10 16:07   ` Christopher Dimech
  0 siblings, 2 replies; 5+ messages in thread
From: Stefan Monnier @ 2020-10-10 14:46 UTC (permalink / raw)
  To: help-gnu-emacs

>    I need to use Multiline Comments in my Elisp Codes so I can insert
>    Org-Mode Commands,
>    and read you can use
>
>    #|
>       Multiline Comment
>    |#
>
>    What are the options

ELisp does not support multiline comments.
You have two options:

- Use `;;` and make sure to either ignore them or strip them when using the
  comments's content:

      ;; Multiline
      ;; Comment

- Use unused arguments, e.g.:

      (defmacro multiline-comment (&rest _) nil)
      ...
      (multiline-comment
        Multiline
        Comment
      )

  and then make sure you use those uses of `multiline-comment` only
  occur where an ELisp expression is expected (e.g. not within the
  arglist of a function) and make sure the text of those multiline
  comments corresponds to a valid read syntax of some ELisp data
  (e.g. properly matched parentheses and double quotes (but without
  counting those parens that occur after a semi-colon), no single quote
  just before an open paren, ...).

I'd go with the first option.


        Stefan




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

* Re: ELisp Multiline Comments
  2020-10-10 14:46 ` Stefan Monnier
@ 2020-10-10 14:49   ` Stefan Monnier
  2020-10-10 16:07   ` Christopher Dimech
  1 sibling, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2020-10-10 14:49 UTC (permalink / raw)
  To: help-gnu-emacs

> ELisp does not support multiline comments.
> You have two options:
>
> - Use `;;` and make sure to either ignore them or strip them when using the
>   comments's content:
> - Use unused arguments, e.g.:

There's also option 3, use a string:

    "
    Multiline
    Comment
    "

Where you have to be careful to only use at top level (i.e. between
ELisp expressions rather than within an ELisp expression), and you have
to be careful with the use of " within your comment.


        Stefan




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

* Re: ELisp Multiline Comments
  2020-10-10 14:46 ` Stefan Monnier
  2020-10-10 14:49   ` Stefan Monnier
@ 2020-10-10 16:07   ` Christopher Dimech
  2020-10-10 16:11     ` Christopher Dimech
  1 sibling, 1 reply; 5+ messages in thread
From: Christopher Dimech @ 2020-10-10 16:07 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs

   Have tried using the following for writing multiline comments, but has
   worked.

   (defmacro multic (&rest _) nil)

   ;;; gungadin-frame.el --- Customisations for Emacs Frame
   ( multic
   * Copyright and License
   ;;;;
   ====================================================================
   ;;;; Copyright and License
   ;;;;
   ====================================================================
     ___            _    _
    / __|_ __ _ _  | |  (_)__
   | (__| '_ \ '_| | |__| / _|
    \___| .__/_|   |____|_\__|
        |_|
   )
   ;; Copyright 2017 Christopher Dimech
   ;; GNU Affero General Public License, Version 3 or any later version





   Sent: Saturday, October 10, 2020 at 4:46 PM
   From: "Stefan Monnier" <monnier@iro.umontreal.ca>
   To: help-gnu-emacs@gnu.org
   Subject: Re: ELisp Multiline Comments
   > I need to use Multiline Comments in my Elisp Codes so I can insert
   > Org-Mode Commands,
   > and read you can use
   >
   > #|
   > Multiline Comment
   > |#
   >
   > What are the options
   ELisp does not support multiline comments.
   You have two options:
   - Use `;;` and make sure to either ignore them or strip them when using
   the
   comments's content:
   ;; Multiline
   ;; Comment
   - Use unused arguments, e.g.:
   (defmacro multiline-comment (&rest _) nil)
   ...
   (multiline-comment
   Multiline
   Comment
   )
   and then make sure you use those uses of `multiline-comment` only
   occur where an ELisp expression is expected (e.g. not within the
   arglist of a function) and make sure the text of those multiline
   comments corresponds to a valid read syntax of some ELisp data
   (e.g. properly matched parentheses and double quotes (but without
   counting those parens that occur after a semi-colon), no single quote
   just before an open paren, ...).
   I'd go with the first option.
   Stefan


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

* Re: ELisp Multiline Comments
  2020-10-10 16:07   ` Christopher Dimech
@ 2020-10-10 16:11     ` Christopher Dimech
  0 siblings, 0 replies; 5+ messages in thread
From: Christopher Dimech @ 2020-10-10 16:11 UTC (permalink / raw)
  To: Christopher Dimech; +Cc: help-gnu-emacs, Stefan Monnier

   Have figured out that the problem originated from the Ascii Art I was
   using, where
   there can appear characters like ( ) etc.

   Commenting the Ascii Art loads the .el file properly.

   Sent: Saturday, October 10, 2020 at 6:07 PM
   From: "Christopher Dimech" <dimech@gmx.com>
   To: "Stefan Monnier" <monnier@iro.umontreal.ca>
   Cc: help-gnu-emacs@gnu.org
   Subject: Re: ELisp Multiline Comments
   Have tried using the following for writing multiline comments, but has
   worked.
   (defmacro multic (&rest _) nil)
   ;;; gungadin-frame.el --- Customisations for Emacs Frame
   ( multic
   * Copyright and License
   ;;;;
   ====================================================================
   ;;;; Copyright and License
   ;;;;
   ====================================================================
   ___ _ _
   / __|_ __ _ _ | | (_)__
   | (__| '_ \ '_| | |__| / _|
   \___| .__/_| |____|_\__|
   |_|
   )
   ;; Copyright 2017 Christopher Dimech
   ;; GNU Affero General Public License, Version 3 or any later version
   Sent: Saturday, October 10, 2020 at 4:46 PM
   From: "Stefan Monnier" <monnier@iro.umontreal.ca>
   To: help-gnu-emacs@gnu.org
   Subject: Re: ELisp Multiline Comments
   > I need to use Multiline Comments in my Elisp Codes so I can insert
   > Org-Mode Commands,
   > and read you can use
   >
   > #|
   > Multiline Comment
   > |#
   >
   > What are the options
   ELisp does not support multiline comments.
   You have two options:
   - Use `;;` and make sure to either ignore them or strip them when using
   the
   comments's content:
   ;; Multiline
   ;; Comment
   - Use unused arguments, e.g.:
   (defmacro multiline-comment (&rest _) nil)
   ...
   (multiline-comment
   Multiline
   Comment
   )
   and then make sure you use those uses of `multiline-comment` only
   occur where an ELisp expression is expected (e.g. not within the
   arglist of a function) and make sure the text of those multiline
   comments corresponds to a valid read syntax of some ELisp data
   (e.g. properly matched parentheses and double quotes (but without
   counting those parens that occur after a semi-colon), no single quote
   just before an open paren, ...).
   I'd go with the first option.
   Stefan


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

end of thread, other threads:[~2020-10-10 16:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-10  9:13 ELisp Multiline Comments Christopher Dimech
2020-10-10 14:46 ` Stefan Monnier
2020-10-10 14:49   ` Stefan Monnier
2020-10-10 16:07   ` Christopher Dimech
2020-10-10 16:11     ` Christopher Dimech

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).