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

[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 <colin.yates@gmail.com> 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 -
run!!!

;; 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)
  (progn
    (do-something-step-1)
    (do-something-step-2) )
  (progn
    (else-do-this-step-1)
    ;; ...
    (else-do-this-step-n) ))

;; syntax for when

(when condition
   (do-this)
   (and-this)
   (including-this) )

;; group major modes

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

-- 
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

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