all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Customizing perl array face [cperl-mode]
@ 2017-04-08 22:46 khalil zakaria Zemmoura
  2017-04-10 17:21 ` John Mastro
  0 siblings, 1 reply; 3+ messages in thread
From: khalil zakaria Zemmoura @ 2017-04-08 22:46 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,
I would like to get rid of the array highlight of the array in Cperl mode,
Since i am a begginer in lisp i give you the code that customize the array
face and what i did to solve my problème tomporeraly:

(defface cperl-array-face
  `((((class grayscale) (background light))
     (:background "Gray90" :weight bold))
    (((class grayscale) (background dark))
     (:foreground "Gray80" :weight bold))
    (((class color) (background light))
     (:foreground "Blue" :background "lightyellow2" :weight bold))
    (((class color) (background dark))
     (:foreground "yellow" :background ,cperl-dark-background :weight bold))
    (t (:weight bold)))
  "Font Lock mode face used to highlight array names."
  :group 'cperl-faces)

The code fot the cperl-dark-background is :

(defvar cperl-dark-background
  (cperl-choose-color "navy" "os2blue" "darkgreen"))

when using the easy customization interface here what was added to my
init.el

(custom-set-faces
 '(cperl-array-face ((t (:foreground "yellow" :weight bold)))))

when i copy this (cperl-array-face ((t (:foreground "yellow" :weight
bold)))) in my custominit.org and erase that cusom-set -face part, it don't
work.
I was wondering why this code works only under (custom-set-face)?

Witout using the easy customization interface, I ended setting the
cperl-dark-background to nil that way:
(cperl-dark-background nil)
I feel like there is a better way of doing that.
Can someone help me improuve that

Best Regards
Zakaria


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

* Re: Customizing perl array face [cperl-mode]
  2017-04-08 22:46 Customizing perl array face [cperl-mode] khalil zakaria Zemmoura
@ 2017-04-10 17:21 ` John Mastro
  2017-04-10 19:10   ` khalil zakaria Zemmoura
  0 siblings, 1 reply; 3+ messages in thread
From: John Mastro @ 2017-04-10 17:21 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org; +Cc: khalil zakaria Zemmoura

To:
Subject:
From: John Mastro <jbm@jbm.io>
--text follows this line--

khalil zakaria Zemmoura <zemmoura.khalil@gmail.com> wrote:
> I would like to get rid of the array highlight of the array in Cperl mode,
> Since i am a begginer in lisp i give you the code that customize the array
> face and what i did to solve my problème tomporeraly:

[snip]

> when using the easy customization interface here what was added to my
> init.el
>
> (custom-set-faces
>  '(cperl-array-face ((t (:foreground "yellow" :weight bold)))))
>
> when i copy this (cperl-array-face ((t (:foreground "yellow" :weight
> bold)))) in my custominit.org and erase that cusom-set -face part, it don't
> work.
> I was wondering why this code works only under (custom-set-face)?

`custom-set-faces' is a function that applies a list of face specs. And
this:

    (cperl-array-face ((t (:foreground "yellow" :weight bold))))

is a face spec, where `cperl-array-face' is the name of the face and the
rest specifies how that face will look. The face spec is data (a list),
it doesn't do anything on its own. That's why it's quoted.

> Witout using the easy customization interface, I ended setting the
> cperl-dark-background to nil that way:
> (cperl-dark-background nil)

That doesn't seem right. The expression (cperl-dark-background nil) by
itself would call a function `cperl-dark-background' with the argument
nil, which won't work as there is no such function
`cperl-dark-background'. It's a variable, so you would use something
like (custom-set-variables '(cperl-dark-background nil)) or
(setq cperl-dark-foreground nil).

        John



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

* Re: Customizing perl array face [cperl-mode]
  2017-04-10 17:21 ` John Mastro
@ 2017-04-10 19:10   ` khalil zakaria Zemmoura
  0 siblings, 0 replies; 3+ messages in thread
From: khalil zakaria Zemmoura @ 2017-04-10 19:10 UTC (permalink / raw)
  To: John Mastro; +Cc: help-gnu-emacs@gnu.org

> I would like to get rid of the array highlight of the array in Cperl mode,
> > Since i am a begginer in lisp i give you the code that customize the
> array
> > face and what i did to solve my problème tomporeraly:
>
> [snip]
>
> > when using the easy customization interface here what was added to my
> > init.el
> >
> > (custom-set-faces
> >  '(cperl-array-face ((t (:foreground "yellow" :weight bold)))))
> >
> > when i copy this (cperl-array-face ((t (:foreground "yellow" :weight
> > bold)))) in my custominit.org and erase that cusom-set -face part, it
> don't
> > work.
> > I was wondering why this code works only under (custom-set-face)?
>
> `custom-set-faces' is a function that applies a list of face specs. And
> this:
>
>     (cperl-array-face ((t (:foreground "yellow" :weight bold))))
>
> is a face spec, where `cperl-array-face' is the name of the face and the
> rest specifies how that face will look. The face spec is data (a list),
> it doesn't do anything on its own. That's why it's quoted.
>
> > Witout using the easy customization interface, I ended setting the
> > cperl-dark-background to nil that way:
> > (cperl-dark-background nil)
>
> That doesn't seem right. The expression (cperl-dark-background nil) by
> itself would call a function `cperl-dark-background' with the argument
> nil, which won't work as there is no such function
> `cperl-dark-background'. It's a variable, so you would use something
> like (custom-set-variables '(cperl-dark-background nil)) or
> (setq cperl-dark-foreground nil).
>
>         John
>

Oh yes, i did not metion it in the mail.
I used setq in my custominit.org
and this solved my problem but has some limitations, because i can't change
the color of the forground.
that's why i am interesting to know how can i hack this face to get it
fully costumizable (lispy way)

thank's again for your response


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

end of thread, other threads:[~2017-04-10 19:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-08 22:46 Customizing perl array face [cperl-mode] khalil zakaria Zemmoura
2017-04-10 17:21 ` John Mastro
2017-04-10 19:10   ` khalil zakaria Zemmoura

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.