Tassilo Horn <tass...@member.fsf.org> writes:

> Stefan Reichör <ste...@xsteve.at> writes:
>
>> +(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))
>
> The if is superfluous.  And instead of a new function, I'd rather add an
> optional `derived' parameter to `org-mode-p'.

(derived-mode-p 'org-mode) returns either 'org-mode or nil

The reason for the if is, that (org-mode-p) returns either t or nil

The optional derived parameter for org-mode-p is a good idea.
Going one step further I think that using a strict parameter would be
even better.

Because I think that org-mode-p should also return t in derived modes.
Only in some rare cases (org-mode-p t) can be used to allow a strict org-mode 
check.


I'd like to preper a patch. Please tell me, if I should use the derived
or the strict parameter.

Thanks,
  Stefan.


Reply via email to