• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Japanese translation of message catalog for Sawfish Window-Manager


Commit MetaInfo

Revisión0d4c407c4faf1b7bfe0af56aaa6ebc4cb4e83566 (tree)
Tiempo2011-03-01 13:35:15
AutorTeika kazura <teika@lava...>
CommiterTeika kazura

Log Message

Improvements in doc on apps-menu. One minor fix in filtering.

- In apps-menu-filter, it was attempted to accept a lisp expression.

It is deleted, since it didn't work, and it was useless since
the expression can't receive the desktop entry list to process.

- news.texi and OPTIONS are updated, too.
- It includes whitespace fix.

Cambiar Resumen

Diferencia incremental

--- a/OPTIONS
+++ b/OPTIONS
@@ -174,16 +174,10 @@
174174 ;; "Your own applications menu entries. It is followed by auto generated
175175 ;: applications menu.")
176176
177-;; (defvar-setq apps-menu-show-all nil
178-;; "Some entries are hidden from the menu, for example GNOME specific
179-;; applications like eog, nautilus or evince.
180-;;
181-;; Settings this variable to 'nil will generate
182-;; a menu that honours NoDisplay, Hidden OnlyShowIn and NotShowIn fields.
183-;; In other words it generates the same menu like GNOME or KDE.
184-;; If this variable is set to 'maybe the NoDisplay and Hidden fields are
185-;; ignored, while NotShowIn and OnlyShowIn are respected.
186-;; At last if you choose 't all four fields are ignored.")
177+;; (defvar-setq apps-menu-filter 'default
178+;; "The filter to use while generating `apps-menu'. It can be
179+;; a symbol `default', `some', a function, or nil. See the info manual
180+;; \"Applications Menu\" section for the full description.")
187181
188182 ;; (defvar-setq desktop-directory '("/usr/share/applications")
189183 ;; "List of directories to look for *.desktop files")
--- a/lisp/sawfish/wm/ext/apps-menu.jl
+++ b/lisp/sawfish/wm/ext/apps-menu.jl
@@ -58,7 +58,7 @@
5858 sawfish.wm.menus
5959 sawfish.wm.commands
6060 sawfish.wm.commands.launcher)
61-
61+
6262 (define-structure-alias apps-menu sawfish.wm.ext.apps-menu)
6363
6464 ;; User Options
@@ -73,11 +73,11 @@ applications menu.")
7373
7474 (defvar apps-menu-filter 'default
7575 "The filter to use while generating the `apps-menu'. The default filters
76-include `fdo-toplevel-filter' `fdo-nodisplay-filter' `fdo-hidden-filter'
77-`fdo-onlyshowin-filter' and `fdo-notshowin-filter'. Can also be set with
78-'default or 'some, both of which are combinations of the default filters,
79-'default uses them all and 'some only uses `fdo-notshowin-filter' and
80-`fdo-onlyshowin-filter'. This can be set to 'nil or '() to perform no
76+include `fdo-toplevel-filter' `fdo-nodisplay-filter' `fdo-hidden-filter'
77+`fdo-onlyshowin-filter' and `fdo-notshowin-filter'. Can also be set with
78+'default or 'some, both of which are combinations of the default filters,
79+'default uses them all and 'some only uses `fdo-notshowin-filter' and
80+`fdo-onlyshowin-filter'. This can be set to 'nil or '() to perform no
8181 filtering on the `apps-menu'.")
8282
8383 (defvar apps-menu-associate-categories t
@@ -90,7 +90,7 @@ filtering on the `apps-menu'.")
9090 "Sort the apps menu alphabetically.")
9191
9292 (defvar apps-menu-lang nil
93- "Language for applications menu, in string. Default is set from locale.")
93+ "Human language for applications menu, in string. Default is set from locale.")
9494
9595 ;; The Master Category List
9696
@@ -130,7 +130,7 @@ filtering on the `apps-menu'.")
130130 "FileManager" "X-FileSystemMount" "Compression"))
131131 ("System" . ("X-SystemSchedule" "System" "X-SystemMemory" "Emulator"
132132 "TerminalEmulator" "Printing" "Monitor" "Security"))
133- ("Settings" . ("Settings" "HardwareSettings" "PackageManager"
133+ ("Settings" . ("Settings" "HardwareSettings" "PackageManager"
134134 "X-GNOME-PersonalSettings" "DesktopSettings"))
135135 ("Exiles" . ("Exile"))))
136136
@@ -144,7 +144,7 @@ filtering on the `apps-menu'.")
144144 "Return `t' if `instring' should be skipped."
145145 (or (eq (aref instring 0) ?#)
146146 (eq (aref instring 0) ?\n)))
147-
147+
148148 (define (check-if-desktop-stream instream)
149149 "Check for the `[Desktop Entry]' line in `instream'"
150150 (let ((line (read-line instream)))
@@ -153,7 +153,7 @@ filtering on the `apps-menu'.")
153153 't
154154 (when (fdo-skip-line-p line)
155155 (check-if-desktop-stream instream))))))
156-
156+
157157 (define (desktop-file-p directory-file)
158158 "Quickly check if `directory-file' is a `*.desktop' file."
159159 (condition-case nil
@@ -161,9 +161,9 @@ filtering on the `apps-menu'.")
161161 (check-if-desktop-stream this-file))
162162 ;; unreadable -> return nil
163163 (file-error)))
164-
164+
165165 (define (get-key-value-pair instring)
166- "Split a `*.desktop' file line into it's key-value pair.
166+ "Split a `*.desktop' file line into its key-value pair.
167167 Returns (key . value)"
168168 ;; Sorry, \\s doesn't work. Why??
169169 (if (string-match "^([^ \t=]+)[ \t]*=[ \t]*([^\n]+)" instring)
@@ -172,11 +172,11 @@ Returns (key . value)"
172172 (cons "" "")))
173173
174174 (define (fdo-group-p instring)
175- (eq (aref instring 0) ?\[))
175+ (eq (aref instring 0) ?\[))
176176
177177 (define (get-fdo-group instring)
178178 (substring instring 1 (- (length instring) 2)))
179-
179+
180180 (define (parse-fdo-file-line infile)
181181 "Parse a `*.desktop' file list.
182182 Returns (group1 (key1 . value1) ... group2 (keyA . valueA) ...)"
@@ -194,9 +194,9 @@ Returns (group1 (key1 . value1) ... group2 (keyA . valueA) ...)"
194194 (when (desktop-file-p infile)
195195 (let ((d-file (open-file infile 'read)))
196196 (parse-fdo-file-line d-file))))
197-
197+
198198 ;; desktop-file mapping
199-
199+
200200 (define (map-desk-files in-desk-files in-directory #!optional (extension "."))
201201 "Given a list of filenames and a directory, will expand those
202202 filenames to include the full path."
@@ -205,7 +205,7 @@ filenames to include the full path."
205205 (cons (expand-file-name (car in-desk-files) in-directory)
206206 (map-desk-files (cdr in-desk-files) in-directory extension))
207207 (map-desk-files (cdr in-desk-files) in-directory extension))))
208-
208+
209209 (define (map-dir-files directories #!optional (extension "."))
210210 "Given a list of directory paths, will return a list of
211211 files in those direcories with their full pathnames. Optionally
@@ -227,7 +227,7 @@ files in those direcories with their full pathnames. Optionally
227227
228228 (defmacro simplify-mlang (mlang mlevel)
229229 `(and
230- ,(cond
230+ ,(cond
231231 ((or (= 0 mlevel) (not mlevel))
232232 `(or (string-looking-at "([a-z]*)(_?)([A-Z]*?)(@)([A-Z]*[a-z]*)?" ,mlang)
233233 (string-looking-at "([a-z]*)(_..)|([a-z]*)?" ,mlang)
@@ -242,10 +242,10 @@ files in those direcories with their full pathnames. Optionally
242242
243243 (define (find-lang-string)
244244 (let loop ((lang-vars '("LC_ALL" "LC_MESSAGES" "LANG")))
245- (and lang-vars
246- (let ((mlang (getenv (car lang-vars))))
247- (if mlang (simplify-mlang mlang 0)
248- (loop (cdr lang-vars)))))))
245+ (and lang-vars
246+ (let ((mlang (getenv (car lang-vars))))
247+ (if mlang (simplify-mlang mlang 0)
248+ (loop (cdr lang-vars)))))))
249249
250250 ;; Functions for categories
251251
@@ -258,55 +258,55 @@ files in those direcories with their full pathnames. Optionally
258258 (define (merge-list input delimiter)
259259 "Merge a cons list `input' into a string separated by `delimiter'"
260260 (when input
261- (concat (car input) delimiter
261+ (concat (car input) delimiter
262262 (merge-list (cdr input) delimiter))))
263263
264264 (define (associate-categories fdol)
265- "Associate the `Categories' value(s) with the category
265+ "Associate the `Categories' value(s) with the category
266266 master list, `desktop-cat-alist'. Returns a modified desktop-file entry."
267267 (when fdol
268- (let* ((these-categories
269- (delete "" (string-split ";" (cdr (assoc "Categories" fdol)))))
270- (category-list '()))
268+ (let* ((these-categories
269+ (delete "" (string-split ";" (cdr (assoc "Categories" fdol)))))
270+ (category-list '()))
271271 (let loop ((this-category these-categories))
272- (if (null this-category)
273- (let ((cat-string (merge-list (remove-duplicates category-list) ";")))
274- (rplacd (assoc "Categories" fdol)
275- cat-string)
276- fdol)
277- (progn (mapc (lambda (ent)
278- (if (member (car this-category) ent)
279- (setq category-list
280- (append category-list (list (car ent))))))
281- desktop-cat-alist)
282- (loop (cdr this-category))))))))
272+ (if (null this-category)
273+ (let ((cat-string (merge-list (remove-duplicates category-list) ";")))
274+ (rplacd (assoc "Categories" fdol)
275+ cat-string)
276+ fdol)
277+ (progn (mapc (lambda (ent)
278+ (if (member (car this-category) ent)
279+ (setq category-list
280+ (append category-list (list (car ent))))))
281+ desktop-cat-alist)
282+ (loop (cdr this-category))))))))
283283
284284 (define (grab-category input cat)
285- "Remove duplicate categories from a generated apps-menu list by
285+ "Remove duplicate categories from a generated apps-menu list by
286286 category name."
287287 (when input
288288 (let ((cat-list '()))
289289 (setq cat-list (append cat-list (list cat)))
290290 (let loop ((this-line input))
291- (if (not this-line) cat-list
292- (progn (if (string= (caar this-line) cat)
293- (setq cat-list (append cat-list (list (cdr (car this-line))))))
294- (loop (cdr this-line))))))))
291+ (if (not this-line) cat-list
292+ (progn (if (string= (caar this-line) cat)
293+ (setq cat-list (append cat-list (list (cdr (car this-line))))))
294+ (loop (cdr this-line))))))))
295295
296296 (define (make-category-list input)
297297 "Return a list of the categories to be used in the menu."
298298 (when input
299299 (cons (caar input)
300300 (make-category-list (cdr input)))))
301-
302- (define (consolodate-menu input)
303- "Reduce the menu down so that each menu entry is inside a
301+
302+ (define (consolidate-menu input)
303+ "Reduce the menu down so that each menu entry is inside a
304304 single category."
305305 (when input
306306 (let ((cat-list (remove-duplicates (make-category-list input)))
307307 (out-menu nil))
308308 (mapc (lambda (x)
309- (setq out-menu
309+ (setq out-menu
310310 (append out-menu
311311 (list (remove-duplicates (grab-category input x))))))
312312 cat-list)
@@ -323,8 +323,8 @@ single category."
323323 "Alphabetize the entries in the category menus."
324324 (if saw-menu
325325 (cons (cons (car (car saw-menu))
326- (sort (cdr (car saw-menu))
327- (lambda (a b)
326+ (sort (cdr (car saw-menu))
327+ (lambda (a b)
328328 (string< (string-downcase (car a)) (string-downcase (car b))))))
329329 (alphabetize-entries (cdr saw-menu)))))
330330
@@ -357,7 +357,7 @@ with caution, file may be corrupt.\n"))
357357 (not (assoc (concat name-string apps-menu-lang "]") fdo-list)))
358358 (setq fdo-list (append fdo-list (cons (cons "Name" "Unknown")))))
359359 fdo-list))
360-
360+
361361 (define (fdo-check-exile fdo-list)
362362 "If `fdo-list' doesn't have a Categories, Exec, or Name field,
363363 exile it."
@@ -383,7 +383,7 @@ exile it."
383383 (not (stringp (cdr (assoc "Category" fdo-list)))))
384384 (rplacd (assoc "Category" fdo-list) "Exile"))
385385 (append fdo-list (cons (cons "Category" "Exile")))))
386- fdo-list)
386+ fdo-list)
387387
388388 (define (determine-desktop-name fdo-list)
389389 "Get the correct Name[*] entry based on language settings."
@@ -420,7 +420,7 @@ not present in the desktop-file-list"
420420 (if (string-match "[Ff]" (cdr (assoc "NoDisplay" fdol)))
421421 fdol)
422422 fdol))
423-
423+
424424 (define (fdo-hidden-filter fdol)
425425 "Return the desktop-file-list if Hidden is False, or if Hidden is
426426 not present in the desktop-file-list"
@@ -430,7 +430,7 @@ not present in the desktop-file-list"
430430 fdol))
431431
432432 (define (fdo-onlyshowin-filter fdol)
433- "Return the desktop-file-list if OnlyShowIn matches `desktop-environment',
433+ "Return the desktop-file-list if OnlyShowIn matches `desktop-environment',
434434 or if OnlyShowIn is not present in the desktop-file-list"
435435 (if (assoc "OnlyShowIn" fdol)
436436 (if (string-match desktop-environment (string-downcase (cdr (assoc "OnlyShowIn" fdol))))
@@ -438,7 +438,7 @@ or if OnlyShowIn is not present in the desktop-file-list"
438438 fdol))
439439
440440 (define (fdo-notshowin-filter fdol)
441- "Return the desktop-file-list if NotShowIn does not match `desktop-environment',
441+ "Return the desktop-file-list if NotShowIn does not match `desktop-environment',
442442 or if NotShowIn is not present in the desktop-file-list"
443443 (if (assoc "NotShowIn" fdol)
444444 (if (not (string-match desktop-environment (string-downcase (cdr (assoc "NotShowIn" fdol)))))
@@ -454,7 +454,7 @@ desktop-entry through `fdo-associate-categories'."
454454 fdol)))
455455
456456 (define (fdo-toplevel-filter fdol)
457- "Return the desktop-file-list if the `Category' is of the
457+ "Return the desktop-file-list if the `Category' is of the
458458 Top-Level variety."
459459 (when fdol
460460 (if (not (equal "Top-Level" (cdr (assoc "Category" fdol))))
@@ -475,32 +475,30 @@ the NotShowIn and OnlyShowIn keys."
475475 (fdo-notshowin-filter
476476 (fdo-onlyshowin-filter fdol))))
477477
478- (define (fdo-filter-record fdol display-test)
479- "Return the result of `display-test' which can be a pre-set filter,
480-such as `default' or `some' or it can be a pre-defined function of
481-your choosing, which should either return the desktop-file-list or '().
482-If `display-test' is not defined, will return the input desktop-file-list."
483- (if (not display-test) fdol
478+ (define (fdo-filter-record fdol filter)
479+"Let `filter' process `fdol', a desktop file entry, and return the result.
480+`filter' can be a function, or a symbol 'default or 'some. If it isn't set,
481+return `fdol' as-is."
482+ (if (not filter) fdol
484483 (condition-case nil
485484 (let loop ((fdo-entry fdol))
486- (when (consp fdo-entry)
487- (cons
488- ;; Check if entry is valid
489- (fdo-double-check-category
490- (fdo-check-exile
491- ((cond
492- ;; default filter is chosen
493- ((equal display-test 'default)
494- fdo-default-filter)
495- ;; some flter is chosen
496- ((equal display-test 'some)
497- fdo-some-filter)
498- ;; user filter is chosen
499- ((closurep display-test)
500- display-test)
501- (t `progn))
502- (car fdo-entry))))
503- (loop (cdr fdo-entry)))))
485+ (when (consp fdo-entry)
486+ (cons
487+ ;; Check if entry is valid
488+ (fdo-double-check-category
489+ (fdo-check-exile
490+ ((cond
491+ ;; default filter is chosen
492+ ((equal filter 'default)
493+ fdo-default-filter)
494+ ;; some flter is chosen
495+ ((equal filter 'some)
496+ fdo-some-filter)
497+ ;; user filter is chosen
498+ ((closurep filter)
499+ filter))
500+ (car fdo-entry))))
501+ (loop (cdr fdo-entry)))))
504502 (error fdol))))
505503
506504 (define (split-desktop-entry fdol)
@@ -512,10 +510,10 @@ of the categories of the original."
512510 (when (stringp category-string)
513511 (let loop ((categories
514512 (delete "" (string-split ";" category-string))))
515- (when categories
516- (append (list
517- (append new-fdol (list (cons "Category" (car categories)))))
518- (loop (cdr categories)))))))))
513+ (when categories
514+ (append (list
515+ (append new-fdol (list (cons "Category" (car categories)))))
516+ (loop (cdr categories)))))))))
519517
520518 ;; Sawfish-menu generation
521519
@@ -523,7 +521,7 @@ of the categories of the original."
523521 "Return menu-entry list from a fdo-list."
524522 ;; Generate the menu-entry list
525523 (generate-menu-entry
526- ;; Filter entry by pre-made or user function
524+ ;; Filter entry by pre-made or user function
527525 (delete nil
528526 (fdo-filter-record
529527 ;; Split the desktop-entry by category
@@ -539,9 +537,9 @@ of the categories of the original."
539537 desktop file `desk-file'."
540538 (when (car fdo-list)
541539 (cons (list (cdr (assoc "Category" (car fdo-list)))
542- (determine-desktop-name (car fdo-list))
543- (determine-desktop-exec (car fdo-list)))
544- (generate-menu-entry (cdr fdo-list)))))
540+ (determine-desktop-name (car fdo-list))
541+ (determine-desktop-exec (car fdo-list)))
542+ (generate-menu-entry (cdr fdo-list)))))
545543
546544 (define (generate-apps-menu)
547545 "Returns the list of applications menu which can be used for `apps-menu'."
@@ -549,7 +547,7 @@ desktop file `desk-file'."
549547 (setq apps-menu-lang (find-lang-string)))
550548 (let ((desk-files (flatten (map-dir-files desktop-directory ".desktop")))
551549 (local-menu nil))
552- (mapc
550+ (mapc
553551 (lambda (x)
554552 (setq local-menu
555553 (append local-menu
@@ -557,8 +555,8 @@ desktop file `desk-file'."
557555 (parse-fdo-file x)))))
558556 desk-files)
559557 (if apps-menu-alphabetize
560- (alphabetize-entries (consolodate-menu (sort (delete nil local-menu) string<)))
561- (consolodate-menu (sort (delete nil local-menu) string<)))))
558+ (alphabetize-entries (consolidate-menu (sort (delete nil local-menu) string<)))
559+ (consolidate-menu (sort (delete nil local-menu) string<)))))
562560
563561 (define (init-apps-menu)
564562 "If `apps-menu' is nil, then call `update-apps-menu'. This function
@@ -575,4 +573,4 @@ append the auto generated one."
575573 (setq apps-menu user-apps-menu)))
576574
577575 (define-command 'update-apps-menu update-apps-menu)
578- )
\ No newline at end of file
576+ )
--- a/man/news.texi
+++ b/man/news.texi
@@ -67,6 +67,8 @@ The @code{class} and @code{onfocused} parameters are now keys, so pass them as
6767 #:class ''value'' or #:onfocused ''value''. Check @file{jump-or-exec.jl} for
6868 more detailed examples.
6969
70+@item Apps-menu options @code{apps-menu-show-all} is deleted. See below for more.
71+
7072 @item User option @code{focus-ignore-pointer-events} is deleted. [Teika kazura]@*
7173 In fact, it's for internal use, and should not have been a user option. Use your favorite focus mode instead.
7274
@@ -143,7 +145,7 @@ configurator ``Edge Actions'' group. Options must be easy to
143145 understand.
144146
145147 ``Hot-spot'' lets you assign an action to each screen-edge and
146--corner. An action has to be a function, and can be set in
148+-corner. An action has to be a lisp function, and can be set in
147149 @file{~/.sawfish/rc}, like this:
148150
149151 @lisp
@@ -216,6 +218,15 @@ more.
216218
217219 When a lot of windows are open, they should now be more responsive.
218220
221+@item Application menu is fully customizable [Matthew Love]
222+
223+With the new option @code{apps-menu-filter}, you can fully customize
224+the application menu. For the full description, see @xref{Applications
225+Menu}.
226+
227+It replaces former options like @code{apps-menu-show-all} or
228+@code{apps-menu-ignore-no-display}.
229+
219230 @item Per-window animation mode [Teika kazura]
220231
221232 From the configurator ``Window Rules'' you can set the animation
@@ -442,7 +453,8 @@ Applications menu now looks more like that of GNOME / KDE / XFCE if
442453 one is running. (further improvements are planned)
443454
444455 The user option @code{apps-menu-ignore-no-display} is now gone
445-and replaced by @code{apps-menu-show-all}.
456+and replaced by @code{apps-menu-show-all}. [Note: After Sawfish-1.8.0,
457+this option is superseded by @code{apps-menu-filter}.]
446458
447459 If @code{apps-menu-show-all} is @code{nil} (default), the menu
448460 looks much like that of GNOME / KDE / Xfce, by hiding some
--- a/man/sawfish.texi
+++ b/man/sawfish.texi
@@ -4998,7 +4998,7 @@ Note: this is just an example, not all functions in
49984998 ( defvar-setq top-right-corner-function
49994999 ( lambda () ( pager-unhide ) ) )
50005000
5001-( defvar-setq bottom-right-corner-function
5001+( defvar-setq bottom-right-corner-function
50025002 ( lambda () ( show-desktop ) ) )
50035003
50045004 ( defvar-setq bottom-left-corner-function
@@ -5358,12 +5358,16 @@ You can modify menus. @xref{Popup Definitions}.
53585358 @cindex Menus, applications
53595359
53605360 The applications menu lets you invoke installed applications. Sawfish
5361-generates applications menu from @file{*.desktop} files at Sawfish startup.
5361+generates applications menu from @file{*.desktop} files (usually found
5362+in @file{/usr/share/applications/}) at Sawfish startup.
5363+
5364+Functions in this section are defined in the module
5365+@code{sawfish.wm.ext.apps-menu}.
53625366
53635367 @menu
53645368 * Applications Menu Variables::
53655369 * Applications Menu Functions::
5366-* Applications Menu Filtering::
5370+* Desktop File Processing::
53675371 @end menu
53685372
53695373 @node Applications Menu Variables, Applications Menu Functions, Applications Menu, Applications Menu
@@ -5373,37 +5377,49 @@ generates applications menu from @file{*.desktop} files at Sawfish startup.
53735377
53745378 @defvar apps-menu-autogen
53755379 If non-nil, the applications menu is automatically generated from
5376-@code{user-apps-menu} and @file{*.desktop} files, and stored in the
5377-variable @code{apps-menu}.
5378-Default is @code{t}.
5380+the variable @code{user-apps-menu} and @file{*.desktop} files, and
5381+stored in the variable @code{apps-menu}. Default is @code{t}.
53795382
53805383 If you set the applications menu manually to the variable
53815384 @code{apps-menu}, then it won't happen anyway.
53825385 @end defvar
53835386
5387+@defvar desktop-cat-alist
5388+Defines categorization of applications. For example, if a
5389+@file{*.desktop} file's category has an entry ``X-Desktop'', it'll be
5390+classified as ``Desktop'' by Sawfish default.
5391+
5392+If another option @code{apps-menu-associate-categories} is set to nil,
5393+then the original value defined in @file{*.desktop} is respected.
5394+
5395+If you want to customize this variable, see the file
5396+@file{lisp/sawfish/wm/ext/apps-menu.jl} for the default value.
5397+@end defvar
5398+
53845399 @defvar apps-menu-associate-categories
5385-Associate desktop entry categories with the category-master-list.
5386-Default is @code{t}.
5400+See the above. Default is @code{t}.
53875401 @end defvar
53885402
53895403 @defvar apps-menu-filter
5390-The filter to use while generating the @code{apps-menu}. The default filters
5391-include @code{fdo-toplevel-filter} @code{fdo-nodisplay-filter} @code{fdo-hidden-filter}
5392-@code{fdo-onlyshowin-filter} and @code{fdo-notshowin-filter}. Can also be set with
5393-@code{'default} or @code{'some}, both of which are combinations of the default filters,
5394-@code{'default} uses them all and @code{'some} only uses @code{fdo-notshowin-filter} and
5395-@code{fdo-onlyshowin-filter}. This can be set to @code{'nil} or @code{'()} to perform no
5396-filtering on the @code{apps-menu}.
5397-
5398-Also, an arbitrary filter (or combination of filters) can be defined by the user. Set this
5399-variable to the name of the filter, or a lambda expression, and it will be used as the
5400-@code{apps-menu} filter.
5401-Default is @code{'default}.
5404+The filter to use while generating the @code{apps-menu}. For the details,
5405+see @xref{Desktop File Processing}.
5406+
5407+It can be a symbol @code{default}, @code{some}, or a function.
5408+
5409+The @code{default} filters include @code{fdo-toplevel-filter}
5410+@code{fdo-nodisplay-filter} @code{fdo-hidden-filter}
5411+@code{fdo-onlyshowin-filter} and @code{fdo-notshowin-filter}. This is
5412+the default value.
5413+
5414+The @code{some} filter only uses @code{fdo-notshowin-filter} and
5415+@code{fdo-onlyshowin-filter}.
5416+
5417+Or if it is set to nil, no filtering is done.
54025418 @end defvar
54035419
54045420 @defvar desktop-directory
54055421 List of directories to look for *.desktop files. Default is
5406-@code{'("/usr/share/applications")}.
5422+@code{("/usr/share/applications")}.
54075423 @end defvar
54085424
54095425 @defvar kde-desktop-directories
@@ -5411,13 +5427,13 @@ KDE specific directories where *.desktop files are stored.
54115427 @end defvar
54125428
54135429 @defvar apps-menu-alphabetize
5414-Sort the generated Applications menu alphabetically.
5430+Sort the generated applications menu alphabetically.
54155431 Defaults is @code{t}.
54165432 @end defvar
54175433
54185434 @defvar apps-menu-lang
54195435 Human language for applications menu generation, in
5420-string, like ``en''. Default is set from the locale.
5436+string, like ``en'' for English. Default is set from the locale.
54215437 @end defvar
54225438
54235439 You can prepend anything to the applications menu, by setting the
@@ -5440,9 +5456,11 @@ If you set value to @code{apps-menu}, Sawfish doesn't generate
54405456 applications menu from @file{*.desktop} files.
54415457
54425458 @defvar apps-menu
5443-The variable containing the definition of the applications menu. If
5444-you set this, it is exclusively used, and Sawfish doesn't generate
5445-its applications menu.
5459+The variable containing the definition of the applications menu. By default,
5460+Sawfish automatically sets this.
5461+
5462+If you set this variable manually, it is exclusively used, and Sawfish
5463+doesn't generate its applications menu.
54465464 @end defvar
54475465
54485466 @defvar user-apps-menu
@@ -5450,7 +5468,7 @@ Your own applications menu entries. In the applications menu, this is
54505468 followed by auto generated applications menu.
54515469 @end defvar
54525470
5453-@node Applications Menu Functions, Applications Menu Filtering, Applications Menu Variables, Applications Menu
5471+@node Applications Menu Functions, Desktop File Processing, Applications Menu Variables, Applications Menu
54545472 @subsection Applications Menu Functions
54555473 @cindex Applications menu functions
54565474 @cindex Functions, applications menu
@@ -5469,142 +5487,150 @@ Return the applications menu (a list), generated from @file{*.desktop}
54695487 files which can be set to @code{apps-menu}.
54705488 @end defun
54715489
5472-@defun parse-fdo-file
5473-Parse a `*.desktop' file list.
5490+Here're functions to process each desktop file. See also the next
5491+section. (@pxref{Desktop File Processing})
5492+
5493+@defun parse-fdo-file file
5494+Parse an *.desktop file @var{file} list.
54745495 Returns @code{(group1 (key1 . value1) ... group2 (keyA . valueA) ...)}
54755496 @end defun
54765497
54775498 @defun fdo-filter-record fdo-list filter
5478-Return the result of @code{filter} which can be a pre-set filter,
5479-such as @code{default} or @code{some} or it can be a pre-defined function of
5480-your choosing, which should either return a @code{fdo-list} or @code{'()}.
5481-If @code{filter} is not defined, will return the input @code{fdo-list}.
5482-This can be useful for testing filters.
5499+Let @var{filter} process a desktop file entry @var{fdo-list}, and
5500+return the result.
5501+
5502+If @var{filter} is a function, it's executed with the argument
5503+@var{fdo-list}. If it's a symbol @code{default} or @code{some}, then
5504+@code{fdo-default-filter} or @code{fdo-some-filter} is exectuted,
5505+respectively. If @var{filter} is not defined, will return the input
5506+@code{fdo-list}.
5507+
5508+This can be useful for testing filters, and is also used internally.
54835509 @end defun
54845510
5485-@node Applications Menu Filtering, , Applications Menu Functions, Applications Menu
5486-@subsection Applications Menu Filtering
5511+@node Desktop File Processing, , Applications Menu Functions, Applications Menu
5512+@subsection Desktop File Processing
54875513 @cindex Applications menu filtering
54885514 @cindex Filtering, applications menu
54895515
5490-While building the applications menu, sawfish sends a desktop menu
5491-entry through a number of so-called filters. These filters perform
5492-various funtions on the desktop file entry, which is defined as a
5493-list.
5516+In this section it is shown how Sawfish processes desktop file entries
5517+while building the applications menu. Each entry passes through many
5518+@dfn{filters}, and they're what you may want to customize.
54945519
5495-Here is an example of the desktop file entry using the
5520+Desktop file entries are expressed as a list. Here is an example of
54965521 @file{emacs.desktop} file before any filters are performed:
54975522
54985523 @lisp
5499-(``Desktop Entry''
5500- (``Name'' . ``Emacs Text Editor'')
5501- (``Name[de]'' . ``Emacs Texteditor'')
5502- (``GenericName'' . ``Text Editor'')
5503- (``Comment'' . ``Edit text'')
5504- (``Exec'' . ``emacs %f'')
5505- (``Icon'' . ``emacs-icon'')
5506- (``Type'' . ``Application'')
5507- (``Terminal'' . ``false'')
5508- (``Categories'' . ``Development;TextEditor;'')
5509- (``StartupWMClass'' . ``Emacs''))
5524+("Desktop Entry"
5525+ ("Name" . "Emacs Text Editor")
5526+ ("Name[de]" . "Emacs Texteditor")
5527+ ("GenericName" . "Text Editor")
5528+ ("Comment" . "Edit text")
5529+ ("Exec" . "emacs %f")
5530+ ("Icon" . "emacs-icon")
5531+ ("Type" . "Application")
5532+ ("Terminal" . "false")
5533+ ("Categories" . "Development;TextEditor;")
5534+ ("StartupWMClass" . "Emacs"))
55105535 @end lisp
55115536
5512-And here is the same example after the initial filters are
5513-performed, one of the first filters performed on the desktop
5514-entry list is a 'split filter, which splits the entry into
5515-multiple entries based on the number of categories that are
5516-included:
5537+It then gets split into two lists. The original ``Categories'' key
5538+contains several values, and each of new entries has ``Category'' key
5539+which contains only one of the original categories.
55175540
55185541 @lisp
5519-(``Desktop Entry''
5520- (``Name'' . ``Emacs Text Editor'')
5521- (``Name[de]'' . ``Emacs Texteditor'')
5522- (``GenericName'' . ``Text Editor'')
5523- (``Comment'' . ``Edit text'')
5524- (``Exec'' . ``emacs %f'')
5525- (``Icon'' . ``emacs-icon'')
5526- (``Type'' . ``Application'')
5527- (``Terminal'' . ``false'')
5528- (``Categories'' . ``Development;TextEditor;'')
5529- (``Cateogry'' . ``Development'')
5530- (``StartupWMClass'' . ``Emacs''))
5531-
5532-(``Desktop Entry''
5533- (``Name'' . ``Emacs Text Editor'')
5534- (``Name[de]'' . ``Emacs Texteditor'')
5535- (``GenericName'' . ``Text Editor'')
5536- (``Comment'' . ``Edit text'')
5537- (``Exec'' . ``emacs %f'')
5538- (``Icon'' . ``emacs-icon'')
5539- (``Type'' . ``Application'')
5540- (``Terminal'' . ``false'')
5541- (``Categories'' . ``Development;TextEditor;'')
5542- (``Cateogry'' . ``TextEditor'')
5543- (``StartupWMClass'' . ``Emacs''))
5542+("Desktop Entry"
5543+ ("Name" . "Emacs Text Editor")
5544+ ("Name[de]" . "Emacs Texteditor")
5545+ ("GenericName" . "Text Editor")
5546+ ("Comment" . "Edit text")
5547+ ("Exec" . "emacs %f")
5548+ ("Icon" . "emacs-icon")
5549+ ("Type" . "Application")
5550+ ("Terminal" . "false")
5551+ ("Categories" . "Development;TextEditor;")
5552+ ("Cateogry" . "Development") ; Look here
5553+ ("StartupWMClass" . "Emacs"))
5554+
5555+("Desktop Entry"
5556+ ("Name" . "Emacs Text Editor")
5557+ ("Name[de]" . "Emacs Texteditor")
5558+ ("GenericName" . "Text Editor")
5559+ ("Comment" . "Edit text")
5560+ ("Exec" . "emacs %f")
5561+ ("Icon" . "emacs-icon")
5562+ ("Type" . "Application")
5563+ ("Terminal" . "false")
5564+ ("Categories" . "Development;TextEditor;")
5565+ ("Cateogry" . "TextEditor") ; Look here
5566+ ("StartupWMClass" . "Emacs"))
55445567 @end lisp
55455568
55465569 @noindent
5547-This is the entry list format that is used in all of the later filters.
5548-All filtering functions should accept such an entry list as it's argument,
5549-and all filtering functions should either return @code{'()} or an entry list.
5570+This is the entry list format that is used in all of the later filters.
5571+All filtering functions should accept such an entry list as its argument,
5572+and all filtering functions should either return nil or an entry list.
55505573 If @code{fdo-associate-categories} is @code{t} then the ``Category'' key will be
55515574 changed to the main category that will eventually show up in the @code{apps-menu}.
5552-The keys that are used by the Applications Menu are currently,
5575+The keys that are used by the applications menu are currently,
55535576
55545577 @itemize @bullet
55555578 @item Name([])
55565579
5557-The @code{Name} key in the desktop entry list specifies the name to be used
5558-in the top-level of the Applications Menu. If @code{apps-menu-lang} coincides
5559-with one of the Name[lang] keys in the entry list, then that will be the name used.
5580+The name to be displayed in the applications menu. If
5581+@code{apps-menu-lang} or the locale coincides with one of the
5582+Name[lang] keys in the entry list, then that will be the name used.
5583+
55605584 @item Exec
55615585
5562-The @code{Exec} key in the desktop entry list specifies the command to be run
5563-when the entry is called.
5586+The command to be run when the entry is called.
5587+
55645588 @item Terminal
55655589
5566-The @code{Terminal} key in the desktop entry list specifies whether or not to run
5567-the @code{Exec} value inside of a terminal or not, this will use the default terminal.
5590+Whether or not to run the @code{Exec} value inside of a terminal or
5591+not. If it's true, the terminal specified by @code{xterm-program} is
5592+used.
5593+
55685594 @item Category
55695595
5570-The @code{Category} key in the desktop entry list specifies which top-level category
5571-to place the entry in.
5596+Which top-level category to place the entry in.
5597+
55725598 @item Hidden
55735599
5574-The @code{Hidden} key in the desktop entry list specifies whether or not the entry
5575-should be hidden by default.
5600+Whether or not the entry should be hidden by default.
5601+
55765602 @item NoDisplay
55775603
5578-The @code{NoDisplay} key in the desktop entry list specifies whether or not the entry
5579-should be displayed by default.
5604+Whether or not the entry should be displayed by default.
5605+
55805606 @item NotShowIn
55815607
5582-The @code{NotShowIn} key in the desktop entry list, will determine if an item should
5583-not be shown by checking the current desktop enviroment against the value of this key.
5608+If an item should not be shown by checking the current desktop
5609+enviroment against the value of this key.
5610+
55845611 @item OnlyShowIn
55855612
5586-The @code{OnlyShowIn} key in the desktop entry list, will determine if an item should
5587-be shown by checking the current desktop enviroment against the value of this key.
5613+If an item should be shown by checking the current desktop enviroment
5614+against the value of this key.
55885615 @end itemize
55895616
5590-@noindent
5591-The filters can either be pre-defined filters, user-defined functions or a lambda
5592-expression, a user-defined function would likely look like one of the default filters
5593-described below.
5594-
5595-@noindent
5596-Filter examples
5617+@subsubheading Filters
5618+Filters are functions, either pre-defined or user-defined, which take
5619+one argument, a desktop file entry. You can set your filter to the
5620+@code{apps-menu-filter} variable.
55975621
5598-@noindent
5599-A lambda expression, this example will move emacs to the 'util category:
5622+Here we show an example user-defined filter, and all pre-defined
5623+filters, which are also available to user codes.
56005624
56015625 @lisp
5602-(setq apps-menu-filter
5626+;; This will move emacs to the ``util'' category, in addition to the
5627+;; operations done by default filter.
5628+(setq apps-menu-filter
56035629 (lambda (ent)
56045630 (let ((ent (fdo-default-filter ent)))
56055631 (when ent
5606- (cond ((string-match ``[Ee]macs'' (cdr (assoc "Name" ent)) nil t)
5607- (rplacd (assoc ``Category'' ent) ``util'')))
5632+ (cond ((string-match "[Ee]macs" (cdr (assoc "Name" ent)) nil t)
5633+ (rplacd (assoc "Category" ent) "util")))
56085634 ent))))
56095635 @end lisp
56105636
@@ -5613,54 +5639,55 @@ The pre-defined filters:
56135639
56145640 @lisp
56155641 (define (fdo-nodisplay-filter fdol)
5616- ``Return the desktop-file-list if NoDisplay is False, or if NoDisplay is
5617-not present in the desktop-file-list''
5618- (if (assoc ``NoDisplay'' fdol)
5619- (if (string-match ``[Ff]'' (cdr (assoc ``NoDisplay'' fdol)))
5642+ "Return the desktop-file-list if NoDisplay is False, or if NoDisplay is
5643+not present in the desktop-file-list"
5644+ (if (assoc "NoDisplay" fdol)
5645+ ;; [Ff] means match to "false"
5646+ (if (string-match "[Ff]" (cdr (assoc "NoDisplay" fdol)))
56205647 fdol)
56215648 fdol))
56225649
56235650 (define (fdo-hidden-filter fdol)
5624- ``Return the desktop-file-list if Hidden is False, or if Hidden is
5625-not present in the desktop-file-list''
5651+ "Return the desktop-file-list if Hidden is False, or if Hidden is
5652+not present in the desktop-file-list"
56265653 (if (assoc "Hidden" fdol)
5627- (if (string-match ``[Ff]'' (string-downcase (cdr (assoc ``OnlyShowIn'' fdol))))
5654+ (if (string-match "[Ff]" (string-downcase (cdr (assoc "OnlyShowIn" fdol))))
56285655 fdol)
56295656 fdol))
56305657
56315658 (define (fdo-onlyshowin-filter fdol)
5632- ``Return the desktop-file-list if OnlyShowIn matches `desktop-environment',
5633-or if OnlyShowIn is not present in the desktop-file-list''
5634- (if (assoc ``OnlyShowIn'' fdol)
5635- (if (string-match desktop-environment (string-downcase (cdr (assoc ``OnlyShowIn'' fdol))))
5659+ "Return the desktop-file-list if OnlyShowIn matches `desktop-environment',
5660+or if OnlyShowIn is not present in the desktop-file-list"
5661+ (if (assoc "OnlyShowIn" fdol)
5662+ (if (string-match desktop-environment (string-downcase (cdr (assoc "OnlyShowIn" fdol))))
56365663 fdol)
56375664 fdol))
56385665
56395666 (define (fdo-notshowin-filter fdol)
5640- ``Return the desktop-file-list if NotShowIn does not match `desktop-environment',
5641-or if NotShowIn is not present in the desktop-file-list''
5642- (if (assoc ``NotShowIn'' fdol)
5643- (if (not (string-match desktop-environment (string-downcase (cdr (assoc ``NotShowIn'' fdol)))))
5667+ "Return the desktop-file-list if NotShowIn does not match `desktop-environment',
5668+or if NotShowIn is not present in the desktop-file-list"
5669+ (if (assoc "NotShowIn" fdol)
5670+ (if (not (string-match desktop-environment (string-downcase (cdr (assoc "NotShowIn" fdol)))))
56445671 fdol)
56455672 fdol))
56465673
56475674 (define (fdo-associate-categories-filter fdol)
5648- ``If `apps-menu-associate-categories' is true, filter the
5649-desktop-entry through `fdo-associate-categories'.''
5675+ "If `apps-menu-associate-categories' is true, filter the
5676+desktop-entry through `fdo-associate-categories'."
56505677 (when fdol
56515678 (if apps-menu-associate-categories
56525679 (associate-categories fdol)
56535680 fdol)))
56545681
56555682 (define (fdo-toplevel-filter fdol)
5656- ``Return the desktop-file-list if the `Category' is of the
5657-Top-Level variety.''
5683+ "Return the desktop-file-list if the `Category' is of the
5684+Top-Level variety."
56585685 (when fdol
5659- (if (not (equal ``Top-Level'' (cdr (assoc ``Category'' fdol))))
5686+ (if (not (equal "Top-Level" (cdr (assoc "Category" fdol))))
56605687 fdol)))
56615688
56625689 (define (fdo-default-filter fdol)
5663- ``The default fdo-filter, combines the above.''
5690+ "The default fdo-filter, combines the above."
56645691 (fdo-toplevel-filter
56655692 (fdo-hidden-filter
56665693 (fdo-notshowin-filter
@@ -5697,7 +5724,7 @@ The second element specifies the action to take. Possible choices are:
56975724
56985725 @table @asis
56995726 @item Command
5700-If it's a command name (a symbol), then that command is invoked.
5727+If it's a command name (a symbol), then that command is invoked.
57015728 In the window operation menu, if that command takes a window as the
57025729 argument, it's passed.
57035730
@@ -7104,7 +7131,7 @@ the @code{PATH} environmental variable. Example:
71047131
71057132 @defun quit
71067133 @defunx restart
7107-Quits and restart Sawfish.
7134+Quits and restart Sawfish.
71087135
71097136 Restart does exec (3), replacing the current process. All command line
71107137 arguments are used again, except that session management related ones