0

This is my first post here.

I have Emacs installed at work and at home. The functionality is slightly different when I use highlighting and I cannot figure out which options to change.

At work, I applied a couple of highlight-regexp for a number of patterns on temporary buffer (C-x b). I am pretty sure that when I posted a new content of another text, Emacs highlighted a new content. Also, when I typed a new word and that word matched one of the regexps, Emacs automatically highlighted the word.

At home, this functionality is missing and I don't know how to turn it on. It's really useful!


Edit.

I have only added a few functions in .emacs to have: a larger window, no welcome screen, and access to MELPA. Apart from that, I installed a custom color theme (the link here). But this extra package is installed in both versions of Emacs i have at home and at work.

The content of .emacs:

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(ansi-color-names-vector ["#242424" "#e5786d" "#95e454" "#cae682" "#8ac6f2" "#333366" "#ccaa8f" "#f6f3e8"])
 '(custom-enabled-themes (quote (atom-dark)))
 '(custom-safe-themes (quote ("ed066c6e5b9d72b2b2acce51bc944b396b82e5338c79135888c584d6979f5cd2" "c64bcaa2a93cf797e7a2f860d0545f8de1833feda24c680bd56ee76d88c06948" default))))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

 ;; Custom wind size
 (if (display-graphic-p)
   (progn
     (setq initial-frame-alist
       '(
         (tool-bar-lines . 0)
         (width . 136) ; chars
         (height . 46) ; lines
         ;;
         ))

   (setq default-frame-alist
     '(
       (tool-bar-lines . 0)
       (width . 136)
       (height . 46)
       ;;
       )))
   (progn
     (setq initial-frame-alist
       '(
         (tool-bar-lines . 0)))
     (setq default-frame-alist
       '(
         (tool-bar-lines . 0)))))

 ;; No welcome text
 (setq inhibit-startup-screen t)

 ;; load emacs 24's package system. Add MELPA repository.
 (when (>= emacs-major-version 24)
   (require 'package)
   (add-to-list
     'package-archives
     ;; '("melpa" . "http://stable.melpa.org/packages/") ; many packages won't show if using stable
     '("melpa" . "http://melpa.milkbox.net/packages/")
     t))

Edit 2.

Possible variables related to hi-lock-*:

hi-lock-archaic-interface-deduce    hi-lock-archaic-interface-message-used
hi-lock-exclude-modes               hi-lock-face-defaults
hi-lock-face-history                hi-lock-file-patterns
hi-lock-file-patterns-policy        hi-lock-file-patterns-prefix
hi-lock-file-patterns-range         hi-lock-highlight-range
hi-lock-interactive-patterns        hi-lock-map
hi-lock-menu                        hi-lock-mode
hi-lock-mode-major-mode             hi-lock-regexp-history
hi-lock-string-serialize-hash       hi-lock-string-serialize-serial

Possible variables related to global-hi-lock-*

global-hi-lock-mode
global-hi-lock-mode-buffers
  • seem to work perfectly here, when you type M-x highlight-regexp does the interactive prompt ask you for the regexp and then for the highlight face? also is Hi-lock mode enabled in the buffer you are trying? – manandearth Mar 24 '18 at 12:31
  • Are versions of Emacs identical? Are you using the same init file on both installations? – DoMiNeLa10 Mar 24 '18 at 13:03
  • @DoMiNeLa10 I use CentOS 7 at both work and home and Emacs is installed from a package (via yum). The version at home is GNU Emacs 24.3.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.22.10). I am sure the same version is at work. – Celdor Mar 24 '18 at 16:02
  • @manandearth It does ask for both regexp and highlight colour. I tried both modes of Hi-lock: on and off. If I turn off hi-lock, highlighting disappears. – Celdor Mar 24 '18 at 16:21
  • I removed .emacs and .emacs.d/, uninstalled and installed Emacs again. I run its fresh version without any packages and the behaviour is the same. It does not highlight new content. Surprisingly, unhighlight-regexp ask for regexp to unhighlight, e.g. if I type highlight-regexp and provide, e.g. "one" for regexp, unhighlight-regexp will ask to remove highlighting this pattern, e.g. "one". – Celdor Mar 24 '18 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.