From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/17616 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.gnus.user Subject: Re: font-locked Gnus browse server Date: Fri, 15 May 2015 16:07:59 +0200 Organization: Aioe.org NNTP Server Message-ID: <878ucqgchs.fsf@debian.uxu> References: <878ucwhw7g.fsf@debian.uxu> <874mngfabn.fsf@debian.uxu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1431698712 25603 80.91.229.3 (15 May 2015 14:05:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 15 May 2015 14:05:12 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Fri May 15 16:05:07 2015 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YtGEd-0001XT-Ag for gegu-info-gnus-english@m.gmane.org; Fri, 15 May 2015 16:05:07 +0200 Original-Received: from localhost ([::1]:59791 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtGEc-0005t2-G0 for gegu-info-gnus-english@m.gmane.org; Fri, 15 May 2015 10:05:06 -0400 Original-Path: usenet.stanford.edu!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.gnus Original-Lines: 44 Original-NNTP-Posting-Host: feB02bRejf23rfBm51Mt7Q.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:2cAsKJYSpjbZ8wmzuM+EmilWJ7A= Mail-Copies-To: never Original-Xref: usenet.stanford.edu gnu.emacs.gnus:88744 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:17616 Archived-At: Tassilo Horn writes: > I think the reason why you need to trigger > font-locking explicitly using > `font-lock-fontify-buffer' (or `font-lock-ensure') > is that `gnus-browse-mode' doesn't set > `font-lock-defaults' which would be used to > initialize `font-lock-keywords'. You mean like this? (defvar gnus-browse-font-lock-keywords '(("^K" . font-lock-builtin-face) ("\\([[:digit:]].*\\):" (1 font-lock-function-name-face)) ("\\(gmane\\.\\)\\(.*\\)" (1 font-lock-comment-face) (2 font-lock-variable-name-face) ) ("\\(gwene\\.\\)\\(.*\\)" (1 font-lock-constant-face) (2 font-lock-type-face)) )) (defun gnus-browse-mode-hook-f () (set (make-local-variable 'font-lock-defaults) '(gnus-browse-font-lock-keywords t)) ) (add-hook 'gnus-browse-mode-hook 'gnus-browse-mode-hook-f) > So calling `font-lock-add-keywords' with MODE = nil > will also trigger font-lock, and indeed ... > > th/gnus-browse-mode-init () (font-lock-add-keywords > nil ... ) > > (add-hook 'gnus-browse-mode-hook > #'th/gnus-browse-mode-init) > > does work for me. With MODE as nil the font lock is done one the basis of the current buffer. It is not related to the mode itself apart from the invocation being placed in the mode entry hook. This means the keywords have to be added every time the mode is entered. -- underground experts united http://user.it.uu.se/~embe8573