[Top][All Lists]

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

Re: Doing things only in a particular mode

From: Emanuel Berg
Subject: Re: Doing things only in a particular mode
Date: Tue, 25 Aug 2015 03:30:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Colin Yates <address@hidden> writes:

> Do you have any idea about the more generic emacs
> question? Specifically, how do I achieve the
> following:
> (when (= MAJOR_MODE "mu4e-headers") (do this) (and do
> that))

Pseudo-code that looks like real code but isn't -

;; syntax for `if' with single-form branches

(if (eq major-mode 'mu4e-headers-mode) (do-something)
  (do-something-else) )

;; ditto multiple-form branches

(if (eq major-mode 'mu4e-headers-mode)
    (do-something-step-2) )
    ;; ...
    (else-do-this-step-n) ))

;; syntax for when

(when condition
   (including-this) )

;; group major modes

(unless (member major-mode '(makefile-gmake-mode
                             makefile-mode) ) ; exceptions
    (untabify (point-min) (point-max)))

underground experts united

reply via email to

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