aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorFabián Ezequiel Gallina2015-01-28 00:09:39 -0300
committerFabián Ezequiel Gallina2015-01-28 00:09:39 -0300
commit8e9166c92c97e7c2041eecee4e00d412a1eca1be (patch)
tree41dc296808281e0883fcc3f70b4323fbad65b69c /lisp
parentbe2d23e58721b7acc68c0ea654a38e5109df2aa2 (diff)
parenta012c7bbca887c3da837ce3d7ec01be697cffe64 (diff)
downloademacs-8e9166c92c97e7c2041eecee4e00d412a1eca1be.tar.gz
emacs-8e9166c92c97e7c2041eecee4e00d412a1eca1be.zip
Merge from origin/emacs-24
a012c7b Fix copyright years by hand 732fd4c Update copyright year to 2015 Conflicts: INSTALL.REPO admin/notes/lel-TODO doc/man/grep-changelog.1 doc/misc/eww.texi etc/CONTRIBUTE etc/GNU etc/NEWS etc/refcards/emacsver.tex etc/refcards/ru-refcard.tex lib-src/grep-changelog lib-src/test-distrib.c lib/alloca.in.h lib/binary-io.h lib/c-ctype.h lib/c-strcasecmp.c lib/c-strncasecmp.c lib/careadlinkat.c lib/close-stream.c lib/dosname.h lib/dup2.c lib/filemode.h lib/fpending.c lib/fpending.h lib/getgroups.c lib/getloadavg.c lib/getopt.in.h lib/getopt1.c lib/getopt_int.h lib/gettext.h lib/gettime.c lib/gettimeofday.c lib/group-member.c lib/md5.c lib/md5.h lib/memrchr.c lib/sha1.c lib/sig2str.c lib/stdarg.in.h lib/stdbool.in.h lib/stdlib.in.h lib/strftime.c lib/strtoimax.c lib/strtol.c lib/strtoll.c lib/strtoull.c lib/tempname.c lib/time_r.c lib/unsetenv.c lib/xalloc-oversized.h lisp/gnus/gnus-setup.el lisp/progmodes/cap-words.el lisp/w32-common-fns.el m4/alloca.m4 m4/dup2.m4 m4/filemode.m4 m4/getgroups.m4 m4/getloadavg.m4 m4/gettime.m4 m4/gettimeofday.m4 m4/gnulib-common.m4 m4/group-member.m4 m4/manywarnings.m4 m4/memrchr.m4 m4/mktime.m4 m4/pathmax.m4 m4/pthread_sigmask.m4 m4/sig2str.m4 m4/ssize_t.m4 m4/st_dm_mode.m4 m4/stat-time.m4 m4/stdarg.m4 m4/stdbool.m4 m4/stddef_h.m4 m4/stdio_h.m4 m4/strftime.m4 m4/strtoimax.m4 m4/strtoll.m4 m4/strtoull.m4 m4/strtoumax.m4 m4/time_h.m4 m4/timer_time.m4 m4/timespec.m4 m4/unistd_h.m4 m4/utimbuf.m4 nextstep/README nt/addsection.c src/insdel.c src/w32heap.c test/automated/package-x-test.el
Diffstat (limited to 'lisp')
-rw-r--r--lisp/gnus/gnus-setup.el191
-rw-r--r--lisp/progmodes/cap-words.el98
-rw-r--r--lisp/w32-common-fns.el134
3 files changed, 423 insertions, 0 deletions
diff --git a/lisp/gnus/gnus-setup.el b/lisp/gnus/gnus-setup.el
new file mode 100644
index 00000000000..86b3bffcd4a
--- /dev/null
+++ b/lisp/gnus/gnus-setup.el
@@ -0,0 +1,191 @@
1;;; gnus-setup.el --- Initialization & Setup for Gnus 5
2
3;; Copyright (C) 1995-1996, 2000-2015 Free Software Foundation, Inc.
4
5;; Author: Steven L. Baur <steve@miranova.com>
6;; Keywords: news
7
8;; This file is part of GNU Emacs.
9
10;; GNU Emacs is free software: you can redistribute it and/or modify
11;; it under the terms of the GNU General Public License as published by
12;; the Free Software Foundation, either version 3 of the License, or
13;; (at your option) any later version.
14
15;; GNU Emacs is distributed in the hope that it will be useful,
16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;; GNU General Public License for more details.
19
20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22
23;;; Commentary:
24;; My head is starting to spin with all the different mail/news packages.
25;; Stop The Madness!
26
27;; Given that Emacs Lisp byte codes may be diverging, it is probably best
28;; not to byte compile this, and just arrange to have the .el loaded out
29;; of .emacs.
30
31;;; Code:
32
33(eval-when-compile (require 'cl))
34
35(defvar gnus-use-installed-gnus t
36 "*If non-nil use installed version of Gnus.")
37
38(defvar gnus-use-installed-mailcrypt (featurep 'xemacs)
39 "*If non-nil use installed version of mailcrypt.")
40
41(defvar gnus-emacs-lisp-directory (if (featurep 'xemacs)
42 "/usr/local/lib/xemacs/"
43 "/usr/local/share/emacs/")
44 "Directory where Emacs site lisp is located.")
45
46(defvar gnus-gnus-lisp-directory (concat gnus-emacs-lisp-directory
47 "gnus/lisp/")
48 "Directory where Gnus Emacs lisp is found.")
49
50(defvar gnus-mailcrypt-lisp-directory (concat gnus-emacs-lisp-directory
51 "site-lisp/mailcrypt/")
52 "Directory where Mailcrypt Emacs Lisp is found.")
53
54(defvar gnus-bbdb-lisp-directory (concat gnus-emacs-lisp-directory
55 "site-lisp/bbdb/")
56 "Directory where Big Brother Database is found.")
57
58(defvar gnus-use-mhe nil
59 "Set this if you want to use MH-E for mail reading.")
60(defvar gnus-use-rmail nil
61 "Set this if you want to use RMAIL for mail reading.")
62(defvar gnus-use-sendmail nil
63 "Set this if you want to use SENDMAIL for mail reading.")
64(defvar gnus-use-vm nil
65 "Set this if you want to use the VM package for mail reading.")
66(defvar gnus-use-sc nil
67 "Set this if you want to use Supercite.")
68(defvar gnus-use-mailcrypt t
69 "Set this if you want to use Mailcrypt for dealing with PGP messages.")
70(defvar gnus-use-bbdb nil
71 "Set this if you want to use the Big Brother DataBase.")
72
73(when (and (not gnus-use-installed-gnus)
74 (null (member gnus-gnus-lisp-directory load-path)))
75 (push gnus-gnus-lisp-directory load-path))
76
77;;; We can't do this until we know where Gnus is.
78(require 'message)
79
80;;; Mailcrypt by
81;;; Jin Choi <jin@atype.com>
82;;; Patrick LoPresti <patl@lcs.mit.edu>
83
84(when gnus-use-mailcrypt
85 (when (and (not gnus-use-installed-mailcrypt)
86 (null (member gnus-mailcrypt-lisp-directory load-path)))
87 (setq load-path (cons gnus-mailcrypt-lisp-directory load-path)))
88 (autoload 'mc-install-write-mode "mailcrypt" nil t)
89 (autoload 'mc-install-read-mode "mailcrypt" nil t)
90;;; (add-hook 'message-mode-hook 'mc-install-write-mode)
91;;; (add-hook 'gnus-summary-mode-hook 'mc-install-read-mode)
92 (when gnus-use-mhe
93 (add-hook 'mh-folder-mode-hook 'mc-install-read-mode)
94 (add-hook 'mh-letter-mode-hook 'mc-install-write-mode)))
95
96;;; BBDB by
97;;; Jamie Zawinski <jwz@lucid.com>
98
99(when gnus-use-bbdb
100 ;; bbdb will never be installed with emacs.
101 (when (null (member gnus-bbdb-lisp-directory load-path))
102 (setq load-path (cons gnus-bbdb-lisp-directory load-path)))
103 (autoload 'bbdb "bbdb-com"
104 "Insidious Big Brother Database" t)
105 (autoload 'bbdb-name "bbdb-com"
106 "Insidious Big Brother Database" t)
107 (autoload 'bbdb-company "bbdb-com"
108 "Insidious Big Brother Database" t)
109 (autoload 'bbdb-net "bbdb-com"
110 "Insidious Big Brother Database" t)
111 (autoload 'bbdb-notes "bbdb-com"
112 "Insidious Big Brother Database" t)
113
114 (when gnus-use-vm
115 (autoload 'bbdb-insinuate-vm "bbdb-vm"
116 "Hook BBDB into VM" t))
117
118 (when gnus-use-rmail
119 (autoload 'bbdb-insinuate-rmail "bbdb-rmail"
120 "Hook BBDB into RMAIL" t)
121 (add-hook 'rmail-mode-hook 'bbdb-insinuate-rmail))
122
123 (when gnus-use-mhe
124 (autoload 'bbdb-insinuate-mh "bbdb-mh"
125 "Hook BBDB into MH-E" t)
126 (add-hook 'mh-folder-mode-hook 'bbdb-insinuate-mh))
127
128 (autoload 'bbdb-insinuate-gnus "bbdb-gnus"
129 "Hook BBDB into Gnus" t)
130 (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)
131
132 (when gnus-use-sendmail
133 (autoload 'bbdb-insinuate-sendmail "bbdb"
134 "Insidious Big Brother Database" t)
135 (add-hook 'mail-setup-hook 'bbdb-insinuate-sendmail)
136 (add-hook 'message-setup-hook 'bbdb-insinuate-sendmail)))
137
138(when gnus-use-sc
139 (add-hook 'mail-citation-hook 'sc-cite-original)
140 (setq message-cite-function 'sc-cite-original))
141
142;;;### (autoloads (gnus gnus-slave gnus-no-server) "gnus" "lisp/gnus.el" (12473 2137))
143;;; Generated autoloads from lisp/gnus.el
144
145;; Don't redo this if autoloads already exist
146(unless (fboundp 'gnus)
147 (autoload 'gnus-slave-no-server "gnus" "\
148Read network news as a slave without connecting to local server." t nil)
149
150 (autoload 'gnus-no-server "gnus" "\
151Read network news.
152If ARG is a positive number, Gnus will use that as the
153startup level. If ARG is nil, Gnus will be started at level 2.
154If ARG is non-nil and not a positive number, Gnus will
155prompt the user for the name of an NNTP server to use.
156As opposed to `gnus', this command will not connect to the local server." t nil)
157
158 (autoload 'gnus-slave "gnus" "\
159Read news as a slave." t nil)
160
161 (autoload 'gnus "gnus" "\
162Read network news.
163If ARG is non-nil and a positive number, Gnus will use that as the
164startup level. If ARG is non-nil and not a positive number, Gnus will
165prompt the user for the name of an NNTP server to use." t nil)
166
167;;;***
168
169;;; These have moved out of gnus.el into other files.
170;;; FIX FIX FIX: should other things be in gnus-setup? or these not in it?
171 (autoload 'gnus-update-format "gnus-spec" "\
172Update the format specification near point." t nil)
173
174 (autoload 'gnus-fetch-group "gnus-group" "\
175Start Gnus if necessary and enter GROUP.
176Returns whether the fetching was successful or not." t nil)
177
178 (defalias 'gnus-batch-kill 'gnus-batch-score)
179
180 (autoload 'gnus-batch-score "gnus-kill" "\
181Run batched scoring.
182Usage: emacs -batch -l gnus -f gnus-batch-score <newsgroups> ...
183Newsgroups is a list of strings in Bnews format. If you want to score
184the comp hierarchy, you'd say \"comp.all\". If you would not like to
185score the alt hierarchy, you'd say \"!alt.all\"." t nil))
186
187(provide 'gnus-setup)
188
189(run-hooks 'gnus-setup-load-hook)
190
191;;; gnus-setup.el ends here
diff --git a/lisp/progmodes/cap-words.el b/lisp/progmodes/cap-words.el
new file mode 100644
index 00000000000..94e865db62b
--- /dev/null
+++ b/lisp/progmodes/cap-words.el
@@ -0,0 +1,98 @@
1;;; cap-words.el --- minor mode for motion in CapitalizedWordIdentifiers
2
3;; Copyright (C) 2002-2015 Free Software Foundation, Inc.
4
5;; Author: Dave Love <fx@gnu.org>
6;; Keywords: languages
7
8;; This file is part of GNU Emacs.
9
10;; GNU Emacs is free software: you can redistribute it and/or modify
11;; it under the terms of the GNU General Public License as published by
12;; the Free Software Foundation, either version 3 of the License, or
13;; (at your option) any later version.
14
15;; GNU Emacs is distributed in the hope that it will be useful,
16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;; GNU General Public License for more details.
19
20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22
23;;; Commentary:
24
25;; Provides Capitalized Words minor mode for word movement in
26;; identifiers CapitalizedLikeThis.
27
28;; Note that the same effect could be obtained by frobbing the
29;; category of upper case characters to produce word boundaries, but
30;; the necessary processing isn't done for ASCII characters.
31
32;; Fixme: This doesn't work properly for mouse double clicks.
33
34;;; Code:
35
36(defun capitalized-find-word-boundary (pos limit)
37 "Function for use in `find-word-boundary-function-table'.
38Looks for word boundaries before capitals."
39 (save-excursion
40 (goto-char pos)
41 (let (case-fold-search)
42 (if (<= pos limit)
43 ;; Fixme: Are these regexps the best?
44 (or (and (re-search-forward "\\=.\\w*[[:upper:]]"
45 limit t)
46 (progn (backward-char)
47 t))
48 (re-search-forward "\\>" limit t))
49 (or (re-search-backward "[[:upper:]]\\w*\\=" limit t)
50 (re-search-backward "\\<" limit t))))
51 (point)))
52
53
54(defconst capitalized-find-word-boundary-function-table
55 (let ((tab (make-char-table nil)))
56 (set-char-table-range tab t #'capitalized-find-word-boundary)
57 tab)
58 "Assigned to `find-word-boundary-function-table' in Capitalized Words mode.")
59
60;;;###autoload
61(define-minor-mode capitalized-words-mode
62 "Toggle Capitalized Words mode.
63With a prefix argument ARG, enable Capitalized Words mode if ARG
64is positive, and disable it otherwise. If called from Lisp,
65enable the mode if ARG is omitted or nil.
66
67Capitalized Words mode is a buffer-local minor mode. When
68enabled, a word boundary occurs immediately before an uppercase
69letter in a symbol. This is in addition to all the normal
70boundaries given by the syntax and category tables. There is no
71restriction to ASCII.
72
73E.g. the beginning of words in the following identifier are as marked:
74
75 capitalizedWorDD
76 ^ ^ ^^
77
78Note that these word boundaries only apply for word motion and
79marking commands such as \\[forward-word]. This mode does not affect word
80boundaries found by regexp matching (`\\>', `\\w' &c).
81
82This style of identifiers is common in environments like Java ones,
83where underscores aren't trendy enough. Capitalization rules are
84sometimes part of the language, e.g. Haskell, which may thus encourage
85such a style. It is appropriate to add `capitalized-words-mode' to
86the mode hook for programming language modes in which you encounter
87variables like this, e.g. `java-mode-hook'. It's unlikely to cause
88trouble if such identifiers aren't used.
89
90See also `glasses-mode' and `studlify-word'.
91Obsoletes `c-forward-into-nomenclature'."
92 nil " Caps" nil :group 'programming
93 (set (make-local-variable 'find-word-boundary-function-table)
94 capitalized-find-word-boundary-function-table))
95
96(provide 'cap-words)
97
98;;; cap-words.el ends here
diff --git a/lisp/w32-common-fns.el b/lisp/w32-common-fns.el
new file mode 100644
index 00000000000..1e4e9fe5bb1
--- /dev/null
+++ b/lisp/w32-common-fns.el
@@ -0,0 +1,134 @@
1;;; w32-common-fns.el --- Lisp routines for Windows and Cygwin-w32
2
3;; Copyright (C) 1994, 2001-2015 Free Software Foundation, Inc.
4
5;; This file is part of GNU Emacs.
6
7;; GNU Emacs is free software: you can redistribute it and/or modify
8;; it under the terms of the GNU General Public License as published by
9;; the Free Software Foundation, either version 3 of the License, or
10;; (at your option) any later version.
11
12;; GNU Emacs is distributed in the hope that it will be useful,
13;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;; GNU General Public License for more details.
16
17;; You should have received a copy of the GNU General Public License
18;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
19
20;;; Commentary:
21;;;
22;;; This file contains functions that are used by both native NT Emacs
23;;; and Cygwin Emacs compiled to use the native Windows widget
24;;; library.
25
26(declare-function x-server-version "w32fns.c" (&optional terminal))
27
28(defun w32-version ()
29 "Return the MS-Windows version numbers.
30The value is a list of three integers: the major and minor version
31numbers, and the build number."
32 (x-server-version))
33
34(defun w32-using-nt ()
35 "Return non-nil if running on a Windows NT descendant.
36That includes all Windows systems except for 9X/Me."
37 (getenv "SystemRoot"))
38
39(declare-function w32-get-clipboard-data "w32select.c")
40(declare-function w32-set-clipboard-data "w32select.c")
41(declare-function x-server-version "w32fns.c" (&optional display))
42
43;;; Fix interface to (X-specific) mouse.el
44(defun x-set-selection (type data)
45 "Make an X selection of type TYPE and value DATA.
46The argument TYPE (nil means `PRIMARY') says which selection, and
47DATA specifies the contents. TYPE must be a symbol. \(It can also
48be a string, which stands for the symbol with that name, but this
49is considered obsolete.) DATA may be a string, a symbol, an
50integer (or a cons of two integers or list of two integers).
51
52The selection may also be a cons of two markers pointing to the same buffer,
53or an overlay. In these cases, the selection is considered to be the text
54between the markers *at whatever time the selection is examined*.
55Thus, editing done in the buffer after you specify the selection
56can alter the effective value of the selection.
57
58The data may also be a vector of valid non-vector selection values.
59
60The return value is DATA.
61
62Interactively, this command sets the primary selection. Without
63prefix argument, it reads the selection in the minibuffer. With
64prefix argument, it uses the text of the region as the selection value.
65
66Note that on MS-Windows, primary and secondary selections set by Emacs
67are not available to other programs."
68 (put 'x-selections (or type 'PRIMARY) data))
69
70(defun x-get-selection (&optional type _data-type)
71 "Return the value of an X Windows selection.
72The argument TYPE (default `PRIMARY') says which selection,
73and the argument DATA-TYPE (default `STRING') says
74how to convert the data.
75
76TYPE may be any symbol \(but nil stands for `PRIMARY'). However,
77only a few symbols are commonly used. They conventionally have
78all upper-case names. The most often used ones, in addition to
79`PRIMARY', are `SECONDARY' and `CLIPBOARD'.
80
81DATA-TYPE is usually `STRING', but can also be one of the symbols
82in `selection-converter-alist', which see. This argument is
83ignored on MS-Windows and MS-DOS."
84 (get 'x-selections (or type 'PRIMARY)))
85
86;; x-selection-owner-p is used in simple.el
87(defun x-selection-owner-p (&optional selection _terminal)
88 "" ; placeholder for doc.c
89 (and (memq selection '(nil PRIMARY SECONDARY))
90 (get 'x-selections (or selection 'PRIMARY))))
91
92;; The "Windows" keys on newer keyboards bring up the Start menu
93;; whether you want it or not - make Emacs ignore these keystrokes
94;; rather than beep.
95(global-set-key [lwindow] 'ignore)
96(global-set-key [rwindow] 'ignore)
97
98(defvar w32-charset-info-alist) ; w32font.c
99
100
101;;;; Selections
102
103;; We keep track of the last text selected here, so we can check the
104;; current selection against it, and avoid passing back our own text
105;; from x-selection-value.
106(defvar x-last-selected-text nil)
107(defvar x-select-enable-clipboard)
108
109(defun x-get-selection-value ()
110 "Return the value of the current selection.
111Consult the selection. Treat empty strings as if they were unset."
112 (if x-select-enable-clipboard
113 (let (text)
114 ;; Don't die if x-get-selection signals an error.
115 (with-demoted-errors "w32-get-clipboard-data:%s"
116 (setq text (w32-get-clipboard-data)))
117 (if (string= text "") (setq text nil))
118 (cond
119 ((not text) nil)
120 ((eq text x-last-selected-text) nil)
121 ((string= text x-last-selected-text)
122 ;; Record the newer string, so subsequent calls can use the 'eq' test.
123 (setq x-last-selected-text text)
124 nil)
125 (t
126 (setq x-last-selected-text text))))))
127
128(defalias 'x-selection-value 'x-get-selection-value)
129
130;; Arrange for the kill and yank functions to set and check the clipboard.
131(setq interprogram-cut-function 'x-select-text)
132(setq interprogram-paste-function 'x-get-selection-value)
133
134(provide 'w32-common-fns)