unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: Is it alright to define-derived-mode dynamically?
Date: Fri, 25 Dec 2020 12:34:23 -0500	[thread overview]
Message-ID: <jwvlfdlrdug.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: X+XCBP10yvraXyqV@protected.rcdrun.com

> Problem was invoking another derived mode from tabulated-list-mode
> where the other mode did appear and it was populated but it was not
> visible. The text I could not see but entries were there and the lines
> in existence, just everything white.

There can only be one major mode active in a buffer at a time.
So whenever you call a major mode function, it "removes" the previously
set major mode.

>> - Don't use global variables's names for local variables.
>
> Did you mean:
>
> (defvar-local rcd-tabulated-marked-items nil
>   "Collects IDs for tabulated list modes")

So, I meant "local" as in let-bound variables or in your particular case
formal arguments of functions.


        Stefan




  reply	other threads:[~2020-12-25 17:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-24  7:19 Is it alright to define-derived-mode dynamically? Jean Louis
2020-12-24 14:44 ` Stefan Monnier
2020-12-25 10:42   ` Jean Louis
2020-12-25 17:34     ` Stefan Monnier [this message]
2020-12-25 20:03       ` Jean Louis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvlfdlrdug.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).