unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Heime via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: Jean Louis <bugs@gnu.support>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Covering of prog-mode
Date: Tue, 03 Dec 2024 20:49:06 +0000	[thread overview]
Message-ID: <3FVlbW_frgwa08MUN78atk4qqY140FOOT9cvti4x70otitn2AAyYuzjcQgiV-CFyJNykySo1bWTXr27jcE6UlzLPBuGpkSjSh6Mta0U-ZVE=@protonmail.com> (raw)
In-Reply-To: <Z09rjGrtt8DF6LiD@lco2>






Sent with Proton Mail secure email.

On Wednesday, December 4th, 2024 at 8:35 AM, Jean Louis <bugs@gnu.support> wrote:

> * Heime heimeborgia@protonmail.com [2024-12-03 23:28]:
> 
> > If I do so for c-mode, how can I find out if it is included in prog-mode?
> 
> 
> I understand.
> 
> But on my side I cannot find `c-mode': Debugger entered--Lisp error: (file-error "Can't find library" "c-mode") find-library-name("c-mode") find-library("c-mode") funcall-interactively(find-library "c-mode") command-execute(find-library record) execute-extended-command(nil "find-library" nil) funcall-interactively(execute-extended-command nil "find-library" nil) command-execute(execute-extended-command) It is function, and I find it is function by doing: C-h f c-mode RET then I see: c-mode is an autoloaded interactive native-comp-function in ‘cc-mode.el’. (c-mode) Major mode for editing C code. then in that window I see hyperlinked file cc-mode.el so I press there, then I move to top of the file, and I find: ;; This package provides GNU Emacs major modes for editing C, C++, ;; Objective-C, Java, CORBA's IDL, Pike and AWK code. As of the ;; latest Emacs and XEmacs releases, it is the default package for ;; editing these languages. This package is called "CC Mode", and ;; should be spelled exactly this way. and then I put attention on your question to find if it is dependent maybe on` prog-mode', so I use `C-s prog-mode' and indeed I am finding
> occurences.
> 
> When we are by occurences, M-x occur RET prog-mode RET gives me more
> summarized information:
> 
> 11 matches in 10 lines for "prog-mode" in buffer: cc-mode.el
> 339: (when (boundp 'prog-mode-map)
> 340: (c-set-keymap-parent c-mode-base-map prog-mode-map))
> 2829:(unless (fboundp 'prog-mode) (defalias 'prog-mode 'fundamental-mode))
> 2832:(define-derived-mode c-mode prog-mode "C"
> 2928:(define-derived-mode c++-mode prog-mode "C++"
> 2976:(define-derived-mode objc-mode prog-mode "ObjC"
> 3029:(define-derived-mode java-mode prog-mode "Java"
> 3073:(define-derived-mode idl-mode prog-mode "IDL"
> 3118:(define-derived-mode pike-mode prog-mode "Pike"
> 3176:(define-derived-mode awk-mode prog-mode "AWK"
> 
> so yes, the cc-mode.el and c-mode command are all somehow derived from
> prog-mode, you see? - Jean Louis

Ok, so I look for prog-mode in the major mode file I am interested in.

I tried again, this time from fortran-mode.  And found 

(define-derived-mode fortran-mode prog-mode "Fortran"
 
So fortran-mode is derived from prog-mode.  Not the other way round, as I
had thought initially.



  reply	other threads:[~2024-12-03 20:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-02 23:59 Covering of prog-mode Heime via Users list for the GNU Emacs text editor
2024-12-03  6:22 ` Jean Louis
2024-12-03 12:44   ` Heime via Users list for the GNU Emacs text editor
2024-12-03 20:20     ` Jean Louis
2024-12-03 20:27       ` Heime via Users list for the GNU Emacs text editor
2024-12-03 20:35         ` Jean Louis
2024-12-03 20:49           ` Heime via Users list for the GNU Emacs text editor [this message]
2024-12-03 21:05             ` Jean Louis
2024-12-03 21:21               ` Heime via Users list for the GNU Emacs text editor

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='3FVlbW_frgwa08MUN78atk4qqY140FOOT9cvti4x70otitn2AAyYuzjcQgiV-CFyJNykySo1bWTXr27jcE6UlzLPBuGpkSjSh6Mta0U-ZVE=@protonmail.com' \
    --to=help-gnu-emacs@gnu.org \
    --cc=bugs@gnu.support \
    --cc=heimeborgia@protonmail.com \
    /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).