28 Commits

Author SHA1 Message Date
Nikos Tsipinakis
7e58e5c64c Add expandtab to vim modelines & expand abbreviations
Add expandtab to vim modelines so that spaces are expanded to tabs, make
life easier for people that have vim configured to use tabs by default.

Expand modeline abbreviations to improve readability.
2016-11-17 20:27:46 +02:00
Yuri D'Elia
cf910b0683 Avoid allocations in string_replace_at when possible. 2016-11-10 00:32:18 -03:00
Yuri D'Elia
98566667c7 Consistent indentation. 2016-11-10 00:32:18 -03:00
Yuri D'Elia
4b53e44d92 Avoid allocations by performing stripping in-place
Introduce a helper function (string_strip_delimited).
2016-11-10 00:32:18 -03:00
Yuri D'Elia
b5e00c43c7 Fix markup handling.
The current "allow_markup" setting will simply strip any markup from the final
notification, which includes formatting elements. On top of that, literal
[<>&..] symbols are not quoted before are being passed onto pango in several
places, resulting in stray error messages.

This patch fixes allow_markup to correctly strip markup only from the incoming
notification, not from the format.

You might also want to treat incoming messages as literal text (supplied by
un-aware programs), in which case you need to properly quote the text before
it's processed by pango. A new setting is introduced, called "plain_text",
which forces incoming messages to be treated literally.

allow_markup/plain_text are complimentary to each other.

The new rule actions allow to narrow down the handling to a specific block,
achieving notification Zen.

The following is done in this patch:

- Fix ruleset initialization in config.def.h.
- Introduce new allow_markup/plain_text actions in the rules.
- Fix handling of allow_markup to strip markup from summary/body only,
  preserving format's markup.
- Fix broken string functions (string_replace_all didn't handle recursive
  replacements correctly).
- Fix quoting of other literal fields (icon name/appname).
- Fix handling of ignore_newline as well (applied only on summary/body).
- Dunstrc update with the same previous defaults.
2014-12-05 16:05:41 +01:00
mickael9
a69354b1aa Add g_strdup to argv elements in string_to_argv 2014-06-20 16:03:03 +02:00
Giuliano Schneider
9e03b5258f fix memory leak in string_to_argv 2014-03-05 13:31:01 +01:00
Sascha Kruse
db27662e78 Revert "replace string_to_argv() with g_strsplit()"
This reverts commit 023473ac2557f37d842c81c67192feac1f898eb8.

Conflicts:
	dunst.c
2013-03-25 13:55:18 +01:00
progandy
00b2be3dc0 cleaner handling of actions in menu 2013-03-08 08:39:22 +01:00
Sascha Kruse
cff9c74e0e License header and vim modeline 2013-02-22 06:09:13 +00:00
Sascha Kruse
e82da9d5e7 indent -linx --no-tabs 2013-02-21 23:23:54 +00:00
Sascha Kruse
ba09fa21f9 strdup -> g_strdup 2013-02-16 10:18:26 +01:00
Sascha Kruse
c4947fc0cd cleanup digit_count() 2013-02-16 06:13:53 +01:00
Sascha Kruse
023473ac25 replace string_to_argv() with g_strsplit() 2013-02-16 06:13:53 +01:00
Sascha Kruse
e2dc1872a7 replace sasprintf with g_* equivalent 2013-02-16 06:13:52 +01:00
Sascha Kruse
78ed4d77c5 replace string strip functions with glib equivalent 2013-02-16 06:13:52 +01:00
Matthew Todd
3beb9e42dc Replace all occurrences of markup in notification.
fix_markup previously would only replace one occurrence of needle in the
notification string. So we'd end up with some markup's making it
through, if there was more than one of a particular kind.

Introduces new function string_replace_all and calls it from fix_markup.
2013-01-16 21:15:23 -08:00
Sascha Kruse
83c523cf53 asprintf wrapper 2012-12-19 22:34:47 +01:00
Sascha Kruse
d519bb6531 get rid of warnings in utils.{c,h} 2012-12-19 16:49:02 +01:00
Sascha Kruse
02bd587935 allow parameters to dmenu and browser calls 2012-12-19 16:38:14 +01:00
Sascha Kruse
42e49a7b34 context menu for urls 2012-12-19 15:56:15 +01:00
Sascha Kruse
ae21145121 non recursive string_replace
Previous to this commit a replacement that also contains the needle
would cause an endless loop
2012-12-07 05:16:48 +01:00
Sascha Kruse
609f20c99c indent --no-tabs -linux 2012-12-05 20:16:33 +01:00
Sascha Kruse
286e0c5104 use own ini parsing 2012-10-08 08:58:47 +02:00
Sascha Kruse
1a4deea501 Update to verbose mode
Remove dead code and print the notifications, when -print is given
2012-09-09 10:39:33 +02:00
Sascha Kruse
79dff42fe1 strtrim -> strtrim_end 2012-08-19 02:53:34 +02:00
Sascha Kruse
2f5d8d7afb cleanup draw_win 2012-08-16 23:18:37 +02:00
Sascha Kruse
d4f38c0533 utils.{c,h} 2012-07-25 10:07:54 +02:00