help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Covering of prog-mode


From: Heime
Subject: Re: Covering of prog-mode
Date: Tue, 03 Dec 2024 20:49:06 +0000





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 via email to

[Prev in Thread] Current Thread [Next in Thread]