Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9132801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:22:36+00:00 2026-06-17T08:22:36+00:00

Would it be possible to add a comment-end character to emacs? I’ll take the

  • 0

Would it be possible to add a comment-end character to emacs?

I’ll take the first code I have and apply what I would like as example:

    (defun smart-tab ()
      (interactive)
\1\       (if (minibufferp)
\1a\             (minibuffer-complete)
\2\         (if (eq major-mode 'emacs-lisp-mode) 
            (progn 
              (save-excursion 
                (search-backward "(def")
                (while (not (looking-at "\\s-*)"))
                  (beginning-of-line 1)
                  (indent-for-tab-command)
                  (beginning-of-line 1) 
                  (next-line)
                  (when (looking-at (concat ".*" comment-start))
                    (next-line))))
              (indent-for-tab-command))    
          (yas-expand)))
      )

I would like to add some information in the indentation area before the functions, indicating where the logical parts start.

Would this be possible for emacs-lisp, would there be an easy way to use some little trick to consider the evaluater to skip certain text?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:22:37+00:00Added an answer on June 17, 2026 at 8:22 am

    Emacs Lisp doesn’t have reader macros (or any other way of modifying the reader). But you can do something close to what you want by writing your own macro and using it instead of defun. For example, with this macro definition:

    (defmacro mydefun (name args &rest body)
      "Define NAME as a function.
    Like normal `defun', except BODY may contain |comments|."
      (labels ((uncomment (form)
                 (cond ((not (consp form)) form)
                       ((and (symbolp (car form))
                             (string-match "|.*|$" (symbol-name (car form))))
                        (uncomment (cdr form)))
                       (t (cons (uncomment (car form))
                                (uncomment (cdr form)))))))
        `(defun ,name ,args ,@(uncomment body))))
    

    you can write:

        (mydefun smart-tab ()
          (interactive)
    |1|       (if (minibufferp)
    |1a|             (minibuffer-complete)
    |2|         (if (eq major-mode 'emacs-lisp-mode) 
                (progn 
                  (indent-for-tab-command)))))
    

    (It’s not possible to use \ for this because that character already has a meaning for the Emacs Lisp reader.)

    I have to say, though, that this doesn’t seem like a particularly good idea to me. It would be much better to put your section headings in comments to the right of the source:

    (defun smart-tab ()
      (interactive)
      (if (minibufferp)                         ; 1
          (minibuffer-complete)                 ; 1a
        (if (eq major-mode 'emacs-lisp-mode)    ; 2
            (progn 
              (indent-for-tab-command)))))
    

    This seems just as clear as your proposal, and much easier for other Emacs Lisp programmers to understand.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to simplify my code and add the possible to the css
I would like to know is it possible to add css to one of
I would like to ask you if is possible to add a shadow to
I would like to know if it could be possible to add a file
so I would like to know if in cocos2D it is possible to add
I would like to kwnow if it possible for users to add validation rules
I would like to know how to add a comment on an SSRS report
Would it be possible to add a new operator to the String class that
Would be possible to extend this kind of layout so that I can have
I would like to know if it would be possible to replicate the effect

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.