* Need Help on Whitespace-mode in Emacs 24.1.1 @ 2012-08-26 3:15 Fan 2012-08-26 8:17 ` Peter Dyballa [not found] ` <mailman.7595.1345969075.855.help-gnu-emacs@gnu.org> 0 siblings, 2 replies; 11+ messages in thread From: Fan @ 2012-08-26 3:15 UTC (permalink / raw) To: help-gnu-emacs Hi I had the following lines in my ~/.emacs and the whitespace mode worked fine in Emacs 23.1.1 previously. (message "Enabling whitespace mode ...") (require 'whitespace) (set-face-background 'whitespace-tab "lime green") (setq-default whitespace-style '(tabs trailing)) (global-whitespace-mode t) (message "Enabled whitespace mode.") However, when I switched to Emacs 24.1.1, the whitespace mode no longer worked. It won't highlight, even if I tried exec whitespace-mode to toggle it on and off again. From reading help on whitespace-style variable, it appears both 'tabs & 'trailing now also require 'face, i.e. (setq-default whitespace-style '(face tabs trailing)) When I tested by eval it and followed by exec whitespace-mode interactively, it worked. BTW, somehow, the mode line now shows my buffer has both WS major mode & ws minor mode after exec whitespace-mode. Why are there 2 whitespace modes? Previously, whitespace works with just only WS major mode in Emacs 23.1.1. I then replaced the old whitespace-style line with the above line in my ~/.emacs. Unfortunately, when I tried to start a new Emacs session, it failed to open properly. Here are the contents displayed in *Warnings* and *Messages* buffers. In *Warnings* buffer: Warning (initialization): An error occurred while loading `/home/.emacs': Symbol's value as variable is void: font-lock-defaults-alist To ensure normal operation, you should investigate and remove the cause of the error in your initialization file. Start Emacs with the `--debug-init' option to view a complete error backtrace. In *Messages* buffer: Enabling whitespace mode ... let: Symbol's value as variable is void: font-lock-defaults-alist Error in post-command-hook (global-font-lock-mode-check-buffers): (void-variable font-lock-defaults-alist) I'm clueless to what went wrong, and how to debug. Please help. If setting whitespace-style variable interactively worked, why would it fail when set in ~/.emacs? Is there something else I need to set to get whitespace mode working in Emacs 24.1.1? Thanks for your help in advance. Fan ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Need Help on Whitespace-mode in Emacs 24.1.1 2012-08-26 3:15 Need Help on Whitespace-mode in Emacs 24.1.1 Fan @ 2012-08-26 8:17 ` Peter Dyballa [not found] ` <mailman.7595.1345969075.855.help-gnu-emacs@gnu.org> 1 sibling, 0 replies; 11+ messages in thread From: Peter Dyballa @ 2012-08-26 8:17 UTC (permalink / raw) To: Fan; +Cc: help-gnu-emacs Am 26.08.2012 um 05:15 schrieb Fan: > In *Warnings* buffer: > > Warning (initialization): An error occurred while loading `/home/.emacs': > > Symbol's value as variable is void: font-lock-defaults-alist This is the actual error! When I have your seven lines (message "Enabling whitespace mode ...") (require 'whitespace) (set-face-background 'whitespace-tab "lime green") (setq-default whitespace-style '(tabs trailing)) (global-whitespace-mode t) (message "Enabled whitespace mode.") (setq-default whitespace-style '(face tabs trailing)) in my .emacs it launches and works correctly, including only one "WS" in the mode-line. Obviously later in your init file something tries to manipulate the variable font-lock-defaults-alist which does not exist in GNU Emacs 24. First correct this error! -- Greetings Pete (: _ / __ - - _/ \__/_/ - - (´`) (´`) - - `´ `´ ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <mailman.7595.1345969075.855.help-gnu-emacs@gnu.org>]
* Re: Need Help on Whitespace-mode in Emacs 24.1.1 [not found] ` <mailman.7595.1345969075.855.help-gnu-emacs@gnu.org> @ 2012-08-26 14:46 ` Fan 2012-08-26 15:04 ` Peter Dyballa ` (2 more replies) 0 siblings, 3 replies; 11+ messages in thread From: Fan @ 2012-08-26 14:46 UTC (permalink / raw) To: help-gnu-emacs On Sunday, August 26, 2012 3:17:49 AM UTC-5, Peter Dyballa wrote: > > in my .emacs it launches and works correctly, including only one "WS" in the mode-line. Obviously later in your init file something tries to manipulate the variable font-lock-defaults-alist which does not exist in GNU Emacs 24. First correct this error! > Hi Pete Using process of elimination, I finally locate the offending line in my "long" ~/.emacs. :) (require 'font-menus) Can you add it to your ~/.emacs and see if you can replicate the same problem I encountered earlier? If I recall correctly, it was added to my ~/.emacs way back when using in Emacs 21.1. It seems that combination of the 3 below can't co-exist. Emacs 24.1.1 (require 'font-menus) (setq-default whitespace-style '(face tabs trailing)) However, any combinations of any 2 of the 3 above are OK. BTW, I can live without font-menus if I have to choose between it and whitespace-mode. But, it'll be nice if I can have both. Thanks. Fan ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Need Help on Whitespace-mode in Emacs 24.1.1 2012-08-26 14:46 ` Fan @ 2012-08-26 15:04 ` Peter Dyballa 2012-08-26 15:17 ` Drew Adams [not found] ` <mailman.7604.1345994243.855.help-gnu-emacs@gnu.org> 2 siblings, 0 replies; 11+ messages in thread From: Peter Dyballa @ 2012-08-26 15:04 UTC (permalink / raw) To: Fan; +Cc: help-gnu-emacs Am 26.08.2012 um 16:46 schrieb Fan: > (require 'font-menus) > > Can you add it to your ~/.emacs and see if you can replicate the same problem I encountered earlier? I have no font-menus related Elisp file. This is not part of GNU Emacs. It must be some old stuff you keep. Locate the file and check why and how it uses font-lock-defaults-alist. Then write its author about that. Maybe he or she has an updated version. -- Greetings Pete Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. – Albert Einstein ^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: Need Help on Whitespace-mode in Emacs 24.1.1 2012-08-26 14:46 ` Fan 2012-08-26 15:04 ` Peter Dyballa @ 2012-08-26 15:17 ` Drew Adams 2012-08-26 15:57 ` Peter Dyballa [not found] ` <mailman.7604.1345994243.855.help-gnu-emacs@gnu.org> 2 siblings, 1 reply; 11+ messages in thread From: Drew Adams @ 2012-08-26 15:17 UTC (permalink / raw) To: 'Fan', help-gnu-emacs > Using process of elimination, I finally locate the offending > line in my "long" ~/.emacs. :) > (require 'font-menus) Funny you should hapen to post this just now. I am in the process of fixing up font-menus.el so it works with Emacs 24. The problem is that it uses `font-lock-defaults-alist' which has just been removed from Emacs. (On n'arrete pas le progres.) Because there are existing copies of font-menus.el out there, which will not benefit from the fix, I am giving my fixed version a new name, `font-menus-da.el'. If Francis J. Wright (the author) incorporates a fix to the original file then I will toss my fixed version. I've just posted my version on Emacs Wiki, as font-menus-da.el. But I will probably tweak it a bit more today. You need only (require 'font-menus), as before, since the new version still provides that same feature. http://www.emacswiki.org/emacs/download/font-menus-da.el ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Need Help on Whitespace-mode in Emacs 24.1.1 2012-08-26 15:17 ` Drew Adams @ 2012-08-26 15:57 ` Peter Dyballa 2012-08-26 16:20 ` Drew Adams 0 siblings, 1 reply; 11+ messages in thread From: Peter Dyballa @ 2012-08-26 15:57 UTC (permalink / raw) To: Drew Adams; +Cc: help-gnu-emacs, 'Fan' Am 26.08.2012 um 17:17 schrieb Drew Adams: > I've just posted my version on Emacs Wiki, as font-menus-da.el. But I will > probably tweak it a bit more today. The output is a list of XLFD names – do they enable GNU Emacs 24 to load these fonts via libfontconfig (and not via the X server), apply libotf and libm17n-* to get full font support and complex type layout? If not, than the fontconfig names (and features as if from fc-list/fc-match) would be a better choice. And another output could be possible, that from this function by Miles Bader: ;;; ---------------------------------------------------------------- ;;; list-fonts-display via font-config (defun list-fonts-display (&optional matching) "Display a list of font-families available via font-config, in a new buffer. If the optional argument MATCHING is non-nil, only font families matching that regexp are displayed; interactively, a prefix argument will prompt for the regexp. The name of each font family is displayed using that family, as well as in the default font (to handle the case where a font cannot be used to display its own name)." (interactive (list (and current-prefix-arg (read-string "Display font families matching regexp: ")))) (let (families) (with-temp-buffer (shell-command "fc-list : family" t) (goto-char (point-min)) (while (not (eobp)) (let ((fam (buffer-substring (line-beginning-position) (line-end-position)))) (when (or (null matching) (string-match matching fam)) (push fam families))) (forward-line))) (setq families (sort families (lambda (x y) (string-lessp (downcase x) (downcase y))))) (let ((buf (get-buffer-create "*Font Families*"))) (with-current-buffer buf (erase-buffer) (dolist (family families) ;; We need to pick one of the comma-separated names to ;; actually use the font; choose the longest one because some ;; fonts have ambiguous general names as well as specific ;; ones. (let ((family-name (car (sort (split-string family ",") (lambda (x y) (> (length x) (length y)))))) (nice-family (replace-regexp-in-string "," ", " family))) (insert (concat (propertize nice-family 'face (list :family family-name)) " (" nice-family ")")) (newline))) (goto-char (point-min))) (display-buffer buf)))) ;; -------------------------------------------------------- -- Greetings Pete No project was ever completed on time and within budget. – Cheops Law ^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: Need Help on Whitespace-mode in Emacs 24.1.1 2012-08-26 15:57 ` Peter Dyballa @ 2012-08-26 16:20 ` Drew Adams 2012-08-26 16:22 ` Drew Adams 0 siblings, 1 reply; 11+ messages in thread From: Drew Adams @ 2012-08-26 16:20 UTC (permalink / raw) To: 'Peter Dyballa'; +Cc: help-gnu-emacs, 'Fan' > > I've just posted my version on Emacs Wiki, as > > font-menus-da.el. But I will probably tweak it a bit more today. > > The output is a list of XLFD names - do they enable GNU Emacs 24 What is "they"? > to load these fonts via libfontconfig (and not via the X > server), apply libotf and libm17n-* to get full font support > and complex type layout? If not, than the fontconfig names > (and features as if from fc-list/fc-match) would be a better choice. Sorry, I have no idea what you are asking. Are you asking about the font display from `font-menus.el'? If so, I have not changed that at all. This is the kind of thing that shows: -outline-Andale Mono-normal-normal-normal-mono-*-*-*-*-c-*-iso10646-1 -outline-Andale Mono-normal-normal-normal-mono-*-*-*-*-c-*-iso8859-1 -outline-Andale Mono-normal-normal-normal-mono-*-*-*-*-c-*-iso8859-2 -outline-Andale Mono-normal-normal-normal-mono-*-*-*-*-c-*-iso8859-4 -outline-Andale Mono-normal-normal-normal-mono-*-*-*-*-c-*-iso8859-5 -outline-Andale Mono-normal-normal-normal-mono-*-*-*-*-c-*-iso8859-7 -outline-Andale Mono-normal-normal-normal-mono-*-*-*-*-c-*-iso8859-9 -outline-Arial Black-normal-italic-normal-sans-*-*-*-*-p-*-iso10646-1 -outline-Arial Black-normal-italic-normal-sans-*-*-*-*-p-*-iso8859-1 -outline-Arial Black-ultra-bold-normal-normal-sans-*-*-*-*-p-*-iso10646-1 -outline-Arial Black-ultra-bold-normal-normal-sans-*-*-*-*-p-*-iso8859-1 -outline-Arial Black-ultra-bold-normal-normal-sans-*-*-*-*-p-*-iso8859-2 -outline-Arial Black-ultra-bold-normal-normal-sans-*-*-*-*-p-*-iso8859-4 ... > And another output could be possible, that from this function > by Miles Bader: I happen to use Mile's function also. That shows a much shorter list of fonts, and it shows only the font names. But the names are shown using their own fonts (WYSIWYG): Bitstream Charter (Bitstream Charter) Bitstream Vera Sans (Bitstream Vera Sans) Bitstream Vera Sans Mono (Bitstream Vera Sans Mono) Bitstream Vera Serif (Bitstream Vera Serif) Charter (Charter) Clean (Clean) ClearlyU (ClearlyU) ClearlyU Alternate Glyphs (ClearlyU Alternate Glyphs) ClearlyU PUA (ClearlyU PUA) Courier (Courier) ... Two different critters, serving different purposes. Again, dunno what you are asking (or whom you are asking). ^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: Need Help on Whitespace-mode in Emacs 24.1.1 2012-08-26 16:20 ` Drew Adams @ 2012-08-26 16:22 ` Drew Adams 0 siblings, 0 replies; 11+ messages in thread From: Drew Adams @ 2012-08-26 16:22 UTC (permalink / raw) To: 'Peter Dyballa'; +Cc: help-gnu-emacs, 'Fan' > I happen to use Mile's function also. That shows a much > shorter list of fonts, and it shows only the font names. I meant font family names, here. > But the names are shown using their own fonts (WYSIWYG): ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <mailman.7604.1345994243.855.help-gnu-emacs@gnu.org>]
* Re: Need Help on Whitespace-mode in Emacs 24.1.1 [not found] ` <mailman.7604.1345994243.855.help-gnu-emacs@gnu.org> @ 2012-08-26 22:45 ` Fan 2012-08-26 22:54 ` Drew Adams 0 siblings, 1 reply; 11+ messages in thread From: Fan @ 2012-08-26 22:45 UTC (permalink / raw) To: help-gnu-emacs On Sunday, August 26, 2012 10:17:02 AM UTC-5, Drew Adams wrote: > > I've just posted my version on Emacs Wiki, as font-menus-da.el. But I will > probably tweak it a bit more today. You need only (require 'font-menus), as > before, since the new version still provides that same feature. > > http://www.emacswiki.org/emacs/download/font-menus-da.el > Thanks, Drew. It works like a charm. I now can have my cake and eat it too. :) Fan ^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: Need Help on Whitespace-mode in Emacs 24.1.1 2012-08-26 22:45 ` Fan @ 2012-08-26 22:54 ` Drew Adams 2012-08-26 23:31 ` Drew Adams 0 siblings, 1 reply; 11+ messages in thread From: Drew Adams @ 2012-08-26 22:54 UTC (permalink / raw) To: 'Fan', help-gnu-emacs > > http://www.emacswiki.org/emacs/download/font-menus-da.el > > > > Thanks, Drew. It works like a charm. I now can have my cake > and eat it too. :) Hm. I don't think it works like a charm yet. So far, what I uploaded does not work with recent Emacs versions (at least on Windows). But I will soon upload something that does work. So stay tuned. ^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: Need Help on Whitespace-mode in Emacs 24.1.1 2012-08-26 22:54 ` Drew Adams @ 2012-08-26 23:31 ` Drew Adams 0 siblings, 0 replies; 11+ messages in thread From: Drew Adams @ 2012-08-26 23:31 UTC (permalink / raw) To: 'Fan', help-gnu-emacs > > > http://www.emacswiki.org/emacs/download/font-menus-da.el > > > > Thanks, Drew. It works like a charm. I now can have my cake > > and eat it too. :) > > Hm. I don't think it works like a charm yet. So far, what I > uploaded does not work with recent Emacs versions (at least on > Windows). But I will soon upload something that does work. > So stay tuned. FYI - Should be OK now. --- La petite histoire - Font lock has changed a _lot_ since Emacs 21 (the last version for which this code really worked, until now). Among other things, in recent Emacs versions, `font-lock-set-defaults', the function that is advised here, is called a zillion times when you turn on font-locking, and most of those calls are in places outside the context that should be advised here (i.e., within function `font-lock-fontify-level'). The result was that you could go down font-lock levels but you could not go back up. `font-lock-set-menu' was getting called (many times) outside the context where `font-lock-maximum-decoration' was bound to the new level, so the level was being treated as if it were `t' (maximum). In Emacs 20/21, `font-lock-set-menu' was called only once. Now it is called many times in the course of switching levels (once). Even by doing nothing for most of those calls (since they are outside `font-lock-fontify-level', I make them no-ops), it is still the case that the code gets repeated three times (IIRC). Not a big deal, but no doubt a slight waste. At least it works again. --- BTW, as I tried to explain on emacs-devel today, you need not treat the so-called "levels" as levels of an amount of highlighting. You can treat them as just different highlighting patterns (not necessarily more or less highlighting). IOW, you can cycle among "levels" 1, 2, 3, etc., but that need not mean increasing or decreasing the amount of highlighting. Think of the 1, 2, 3, etc. the way you would think of switching among desktops or window configurations that are numbered 1, 2, 3, etc.: they're just alternatives you can choose. ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2012-08-26 23:31 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-08-26 3:15 Need Help on Whitespace-mode in Emacs 24.1.1 Fan 2012-08-26 8:17 ` Peter Dyballa [not found] ` <mailman.7595.1345969075.855.help-gnu-emacs@gnu.org> 2012-08-26 14:46 ` Fan 2012-08-26 15:04 ` Peter Dyballa 2012-08-26 15:17 ` Drew Adams 2012-08-26 15:57 ` Peter Dyballa 2012-08-26 16:20 ` Drew Adams 2012-08-26 16:22 ` Drew Adams [not found] ` <mailman.7604.1345994243.855.help-gnu-emacs@gnu.org> 2012-08-26 22:45 ` Fan 2012-08-26 22:54 ` Drew Adams 2012-08-26 23:31 ` Drew Adams
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).