From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan =?iso-8859-1?Q?Reich=F6r?= Subject: Re: Use (org-entry-properties) in a mode derived from org-mode Date: Thu, 01 Sep 2011 14:15:04 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:57543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qz6Ay-0005hs-Ai for emacs-orgmode@gnu.org; Thu, 01 Sep 2011 08:15:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qz6Ax-0007G1-C5 for emacs-orgmode@gnu.org; Thu, 01 Sep 2011 08:15:20 -0400 Received: from lo.gmane.org ([80.91.229.12]:42494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qz6Aw-0007Fm-Sh for emacs-orgmode@gnu.org; Thu, 01 Sep 2011 08:15:19 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Qz6At-00050f-Nd for emacs-orgmode@gnu.org; Thu, 01 Sep 2011 14:15:15 +0200 Received: from 193.186.169.68 ([193.186.169.68]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 01 Sep 2011 14:15:15 +0200 Received: from stefan by 193.186.169.68 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 01 Sep 2011 14:15:15 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hello again! > Hi! > > I'd like to derive a mode from org-mode. > > I do something like this: > > (define-derived-mode derived-org-mode org-mode "dorg" "derived org-mode" > (message "derived-org-mode activated") > ) > > When I activate the derived-org-mode, M-: (org-entry-properties) does no longer work. > > Using org-mode it works. > > When I use derived-mode-p in org-mode-p everything works: > > > (defsubst org-mode-p () > "Check if the current buffer is in Org-mode or a derived mode." > ;;(eq major-mode 'org-mode)) > (if (derived-mode-p 'org-mode) t nil)) > > > I think changing org-mode-p should be the correct change to make > deriving from org-mode work. > > Perhaps a (if (symbolp 'derived-mode-p) ...) is necessary to avoid > compatibility problems. > > What do the org developers think of this improvement? > In function org-edit-src-code there is already support for derived modes from org-mode: ,---- | (let ((mark (and (org-region-active-p) (mark))) | (case-fold-search t) | (info (org-edit-src-find-region-and-lang)) | (full-info (org-babel-get-src-block-info)) | (org-mode-p (or (org-mode-p) (derived-mode-p 'org-mode))) `---- (defun org-mode-or-derived-mode-p () "Check if the current buffer is in Org-mode or a derived mode." (if (derived-mode-p 'org-mode) t nil)) Using org-mode-or-derived-mode-p would change the function like this: ,---- | In function org-edit-src-code | (let ((mark (and (org-region-active-p) (mark))) | (case-fold-search t) | (info (org-edit-src-find-region-and-lang)) | (full-info (org-babel-get-src-block-info)) | (org-mode-p (org-mode-or-derived-mode-p)) `---- org-mode-p could be replaced step by step with org-mode-or-derived-mode-p to enhance the support for org-mode derived modes. I need org-mode-or-derived-mode-p instead of org-mode-p in org-entry-properties. It would be great if org-mode-or-derived-mode-p could be added! Thanks, Stefan.