unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* logical not condition in ibuffer config
@ 2018-03-11 20:17 Hikaru Ichijyo
  2018-03-11 20:29 ` Emanuel Berg
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Hikaru Ichijyo @ 2018-03-11 20:17 UTC (permalink / raw)
  To: help-gnu-emacs

I've been setting up ibuffer to group my buffer listing into
categories.  I've encountered a situation where I may want to make an
exception to one of the rules.  This is my config:

--8<---------------cut here---------------start------------->8---
      ibuffer-saved-filter-groups
      (quote (("Default"
	       ("IRC" (mode . erc-mode))
	       ("Web" (mode . w3m-mode))
	       ("Mail & News" (or
			(mode . message-mode)
			(mode . mail-mode)
			(mode . gnus-group-mode)
			(mode . gnus-summary-mode)
			(mode . gnus-article-mode)))
	       ("Dired" (mode . dired-mode))
	       ("Text" (mode . text-mode))
	       ("HTML/CSS" (or
			(mode . html-mode)
			(mode . css-mode)))
	       ("Config" (or
			(mode . conf-space-mode)
			(mode . conf-unix-mode)
			(mode . conf-xdefaults-mode)))
	       ("Shell" (mode . shell-script-mode))
	       ("Perl" (mode . perl-mode))
	       ("Lisp & Emacs" (or
			(mode . emacs-lisp-mode)
			(mode . bookmark-bmenu-mode)
			(name . "^\\*Packages\\*$")))
	       ("Docs" (or
			(name . "^\\*info\\*$")
			(name . "^\\*Man "))))))
--8<---------------cut here---------------end--------------->8---

I am finding that the "Lisp & Emacs" group catches my bbdb buffer,
because it is in Emacs-Lisp mode, but I would rather this went to
Default, since I rarely edit it directly.

So, I want to use a 'not' condition in these rules, to say, "Put
anything in 'Lisp & Emacs' that's in emacs-lisp-mode,
bookmark-bmenu-mode, or is named '*Packages*', except for buffers named
'bbdb'."

The problem is, I'm not really sure how I can use "or" operators here to
begin with, aside from seeing that they work, having based this config
on common configurations I've seen in other people's ~/.emacs files.
This whole section seems to define an alist.  How does it get executed?
When I try to use "and" or "not", it doesn't work, but for some reason,
"or" does work.  Something more is going on here beyond just an alist
definition.  I am still learning Emacs Lisp, obviously.

Is there a way I can use other operators like "not" and "and" in this
ibuffer setup?  It would be useful for cases where you want a rule exception.

-- 
He that would make his own liberty secure must guard even his enemy from
oppression; for if he violates this duty, he establishes a precedent
that will reach to himself.
					--Thomas Paine


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-03-13 17:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-11 20:17 logical not condition in ibuffer config Hikaru Ichijyo
2018-03-11 20:29 ` Emanuel Berg
2018-03-12  5:17   ` Hikaru Ichijyo
2018-03-12  5:30     ` Emanuel Berg
2018-03-12  6:27       ` Emanuel Berg
2018-03-13 17:05     ` Emanuel Berg
2018-03-12  9:12 ` Yuri Khan
     [not found] ` <mailman.10449.1520845963.27995.help-gnu-emacs@gnu.org>
2018-03-12 14:15   ` Hikaru Ichijyo
2018-03-12 18:52     ` Emanuel Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).