From 5428b5b24c18ea14916a38c9462df79936dea62b Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sat, 6 Feb 2016 14:13:57 +1100 Subject: [PATCH 01/13] Use completion-ignore-case instead of defining command * lisp/erc/erc.el (erc-mode): Set completion-ignore-case so that we get case-insensitive completion. (erc-completion-at-point): Remove. --- lisp/erc/erc.el | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 295c2c055e2..1a126a80343 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -1141,7 +1141,7 @@ which the local user typed." (define-key map "\C-c\C-u" 'erc-kill-input) (define-key map "\C-c\C-x" 'erc-quit-server) (define-key map "\M-\t" 'ispell-complete-word) - (define-key map "\t" 'erc-completion-at-point) + (define-key map "\t" 'completion-at-point) ;; Suppress `font-lock-fontify-block' key binding since it ;; destroys face properties. @@ -1463,6 +1463,7 @@ Defaults to the server buffer." (concat "\C-l\\|\\(^" (regexp-quote (erc-prompt)) "\\)")) (set (make-local-variable 'paragraph-start) (concat "\\(" (regexp-quote (erc-prompt)) "\\)")) + (setq-local completion-ignore-case t) (add-hook 'completion-at-point-functions 'erc-complete-word-at-point nil t)) ;; activation @@ -3991,13 +3992,6 @@ Prompt for one if called interactively." (format "MODE %s +k %s" tgt key) (format "MODE %s -k" tgt))))) -(defun erc-completion-at-point () - "Perform completion on the text around point case-insensitively. -See `completion-at-point'." - (interactive) - (let ((completion-ignore-case t)) - (completion-at-point))) - (defun erc-quit-server (reason) "Disconnect from current server after prompting for REASON. `erc-quit-reason' works with this just like with `erc-cmd-QUIT'." From 3ed423bc352b423960c643f297ec0f0fa3b7d2e1 Mon Sep 17 00:00:00 2001 From: OGAWA Hirofumi Date: Sat, 6 Feb 2016 15:41:05 +1100 Subject: [PATCH 02/13] Display the decoded Gnus group name * lisp/gnus/gnus-sum.el (gnus-summary-read-group-1): Use the decoded group name in the message. Copyright-paperwork-exempt: yes --- lisp/gnus/gnus-sum.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 3dbcc21e65c..5972f29dd88 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -4004,7 +4004,8 @@ If SELECT-ARTICLES, only select those articles from GROUP." (gnus-group-next-unread-group 1)) (gnus-handle-ephemeral-exit quit-config))) (if (null (gnus-list-of-unread-articles group)) - (gnus-message 3 "Group %s contains no messages" group) + (gnus-message 3 "Group %s contains no messages" + (gnus-group-decoded-name group)) (gnus-message 3 "Can't select group")) nil) ;; The user did a `C-g' while prompting for number of articles, From 691feae283223d94dde45f080f9c934e186dae91 Mon Sep 17 00:00:00 2001 From: OGAWA Hirofumi Date: Sat, 6 Feb 2016 15:49:32 +1100 Subject: [PATCH 03/13] Be consistent when using encoded strings in nnimap data * lisp/gnus/nnimap.el (nnimap-encode-gnus-group): New function (nnimap-request-list): Use it. (nnimap-request-newgroups): Ditto. Copyright-paperwork-exempt: yes --- lisp/gnus/nnimap.el | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 05251ed464a..c285befc760 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -113,6 +113,12 @@ some servers.") (defvoo nnimap-current-infos nil) +(defun nnimap-decode-gnus-group (group) + (decode-coding-string group 'utf-8)) + +(defun nnimap-encode-gnus-group (group) + (encode-coding-string group 'utf-8)) + (defvoo nnimap-fetch-partial-articles nil "If non-nil, Gnus will fetch partial articles. If t, Gnus will fetch only the first part. If a string, it @@ -794,9 +800,6 @@ textual parts.") (incf num))) (nreverse parts))) -(defun nnimap-decode-gnus-group (group) - (decode-coding-string group 'utf-8)) - (deffoo nnimap-request-group (group &optional server dont-check info) (setq group (nnimap-decode-gnus-group group)) (let ((result (nnimap-change-group @@ -825,7 +828,7 @@ textual parts.") (- (cdr active) (car active)) (car active) (cdr active) - group)) + (nnimap-encode-gnus-group group))) t)))) (deffoo nnimap-request-group-scan (group &optional server info) @@ -860,7 +863,8 @@ textual parts.") (erase-buffer) (insert (format - "211 %d %d %d %S\n" (1+ (- high low)) low high group)) + "211 %d %d %d %S\n" (1+ (- high low)) low high + (nnimap-encode-gnus-group group))) t)))) (deffoo nnimap-request-create-group (group &optional server _args) @@ -1323,7 +1327,7 @@ If LIMIT, first try to limit the search to the N last articles." (let* ((sequence (car response)) (response (cadr response)) (group (cadr (assoc sequence sequences))) - (egroup (encode-coding-string group 'utf-8))) + (egroup (nnimap-encode-gnus-group group))) (when (and group (equal (caar response) "OK")) (let ((uidnext (nnimap-find-parameter "UIDNEXT" response)) @@ -1354,7 +1358,7 @@ If LIMIT, first try to limit the search to the N last articles." (nnimap-get-groups))) (unless (assoc group nnimap-current-infos) ;; Insert dummy numbers here -- they don't matter. - (insert (format "%S 0 1 y\n" (encode-coding-string group 'utf-8))))) + (insert (format "%S 0 1 y\n" (nnimap-encode-gnus-group group))))) t))) (deffoo nnimap-retrieve-group-data-early (server infos) @@ -1453,8 +1457,9 @@ If LIMIT, first try to limit the search to the N last articles." (active (gnus-active group))) (when active (insert (format "%S %d %d y\n" - (decode-coding-string - (gnus-group-real-name group) 'utf-8) + (nnimap-encode-gnus-group + (nnimap-decode-gnus-group + (gnus-group-real-name group))) (cdr active) (car active)))))))))))) @@ -1672,7 +1677,8 @@ If LIMIT, first try to limit the search to the N last articles." (nreverse result)))) (defun nnimap-store-info (info active) - (let* ((group (gnus-group-real-name (gnus-info-group info))) + (let* ((group (nnimap-decode-gnus-group + (gnus-group-real-name (gnus-info-group info)))) (entry (assoc group nnimap-current-infos))) (if entry (setcdr entry (list info active)) From 6816bfffceb0b5de18a2e364dd9aa47c328c34fe Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sat, 6 Feb 2016 16:02:26 +1100 Subject: [PATCH 04/13] Ensure that Gnus dribble handling allows removing entries * lisp/gnus/gnus-start.el (gnus-dribble-enter): Ensure that each entry is on a single line. --- lisp/gnus/gnus-start.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index 10f93d8e526..34a5ff6cbac 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -862,7 +862,9 @@ If REGEXP is given, lines that match it will be deleted." (goto-char (match-beginning 0)) (delete-region (point-at-bol) end)))) (goto-char (point-max)) - (insert string "\n") + ;; Make sure that each dribble entry is a single line, so that + ;; the "remove" code above works. + (insert (replace-regexp-in-string "\n" "\\\\n" string) "\n") ;; This has been commented by Josh Huber ;; It causes problems with both XEmacs and Emacs 21, and doesn't ;; seem to be of much value. (FIXME: remove this after we make sure From aa35257118a09ff8c90d5dc364e8dc65e2fbd6dd Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sat, 6 Feb 2016 16:11:18 +1100 Subject: [PATCH 05/13] Update publicsuffix.txt. * etc/publicsuffix.txt: Updated from https://publicsuffix.org/list/public_suffix_list.dat. --- etc/publicsuffix.txt | 219 +++++++++++++++++++++++-------------------- 1 file changed, 115 insertions(+), 104 deletions(-) diff --git a/etc/publicsuffix.txt b/etc/publicsuffix.txt index a6f596ad43b..ee0269c3a28 100644 --- a/etc/publicsuffix.txt +++ b/etc/publicsuffix.txt @@ -395,7 +395,7 @@ mil.bo tv.bo // br : http://registro.br/dominio/categoria.html -// Submitted by registry 2014-08-11 +// Submitted by registry br adm.br adv.br @@ -485,7 +485,7 @@ net.bt org.bt // bv : No registrations at this time. -// Submitted by registry 2006-06-16 +// Submitted by registry bv // bw : http://en.wikipedia.org/wiki/.bw @@ -597,7 +597,7 @@ gov.cm net.cm // cn : http://en.wikipedia.org/wiki/.cn -// Submitted by registry 2008-06-11 +// Submitted by registry cn ac.cn com.cn @@ -646,7 +646,7 @@ mo.cn tw.cn // co : http://en.wikipedia.org/wiki/.co -// Submitted by registry 2008-06-11 +// Submitted by registry co arts.co com.co @@ -766,7 +766,7 @@ pol.dz art.dz // ec : http://www.nic.ec/reg/paso1.asp -// Submitted by registry 2008-07-04 +// Submitted by registry ec com.ec info.ec @@ -887,7 +887,7 @@ veterinaire.fr ga // gb : This registry is effectively dormant -// Submitted by registry 2008-06-12 +// Submitted by registry gb // gd : http://en.wikipedia.org/wiki/.gd @@ -946,7 +946,7 @@ org.gl gm // gn : http://psg.com/dns/gn/gn.txt -// Submitted by registry 2008-06-17 +// Submitted by registry gn ac.gn com.gn @@ -971,7 +971,7 @@ asso.gp gq // gr : https://grweb.ics.forth.gr/english/1617-B-2005.html -// Submitted by registry 2008-06-09 +// Submitted by registry gr com.gr edu.gr @@ -1009,7 +1009,7 @@ net.gy org.gy // hk : https://www.hkdnr.hk -// Submitted by registry 2008-06-11 +// Submitted by registry hk com.hk edu.hk @@ -1137,7 +1137,7 @@ net.il org.il // im : https://www.nic.im/ -// Submitted by registry 2013-11-15 +// Submitted by registry im ac.im co.im @@ -1618,7 +1618,7 @@ jobs // jp : http://en.wikipedia.org/wiki/.jp // http://jprs.co.jp/en/jpdomain.html -// Submitted by registry 2014-10-30 +// Submitted by registry jp // jp organizational type names ac.jp @@ -3542,7 +3542,7 @@ mil.kz com.kz // la : http://en.wikipedia.org/wiki/.la -// Submitted by registry 2008-06-10 +// Submitted by registry la int.la net.la @@ -3554,7 +3554,7 @@ com.la org.la // lb : http://en.wikipedia.org/wiki/.lb -// Submitted by registry 2008-06-17 +// Submitted by registry lb com.lb edu.lb @@ -3594,7 +3594,7 @@ hotel.lk ac.lk // lr : http://psg.com/dns/lr/lr.txt -// Submitted by registry 2008-06-17 +// Submitted by registry lr com.lr edu.lr @@ -3748,7 +3748,7 @@ net.ms org.ms // mt : https://www.nic.org.mt/go/policy -// Submitted by registry 2013-11-19 +// Submitted by registry mt com.mt edu.mt @@ -4350,7 +4350,7 @@ net.mw org.mw // mx : http://www.nic.mx/ -// Submitted by registry 2008-06-19 +// Submitted by registry mx com.mx org.mx @@ -4419,17 +4419,18 @@ info.nf other.nf store.nf -// ng : http://psg.com/dns/ng/ +// ng : http://www.nira.org.ng/index.php/join-us/register-ng-domain/189-nira-slds ng com.ng edu.ng +gov.ng +i.ng +mil.ng +mobi.ng name.ng net.ng org.ng sch.ng -gov.ng -mil.ng -mobi.ng // ni : http://www.nic.ni/ com.ni @@ -5226,7 +5227,7 @@ våler.hedmark.no *.np // nr : http://cenpac.net.nr/dns/index.html -// Confirmed by registry 2008-06-17 +// Submitted by registry nr biz.nr info.nr @@ -5240,7 +5241,7 @@ com.nr nu // nz : http://en.wikipedia.org/wiki/.nz -// Confirmed by registry 2014-05-19 +// Submitted by registry nz ac.nz co.nz @@ -5310,7 +5311,7 @@ edu.pf *.pg // ph : http://www.domains.ph/FAQ2.asp -// Submitted by registry 2008-06-13 +// Submitted by registry ph com.ph net.ph @@ -5339,7 +5340,7 @@ gos.pk info.pk // pl http://www.dns.pl/english/index.html -// updated by .PL registry on 2015-04-28 +// Submitted by registry pl com.pl net.pl @@ -5618,7 +5619,7 @@ go.pw belau.pw // py : http://www.nic.py/pautas.html#seccion_9 -// Confirmed by registry 2012-10-03 +// Submitted by registry py com.py coop.py @@ -5641,32 +5642,32 @@ sch.qa // re : http://www.afnic.re/obtenir/chartes/nommage-re/annexe-descriptifs re -com.re asso.re +com.re nom.re // ro : http://www.rotld.ro/ ro -com.ro -org.ro -tm.ro -nt.ro -nom.ro -info.ro -rec.ro arts.ro +com.ro firm.ro +info.ro +nom.ro +nt.ro +org.ro +rec.ro store.ro +tm.ro www.ro -// rs : http://en.wikipedia.org/wiki/.rs +// rs : https://www.rnids.rs/en/domains/national-domains rs -co.rs -org.rs -edu.rs ac.rs +co.rs +edu.rs gov.rs in.rs +org.rs // ru : http://www.cctld.ru/ru/docs/aktiv_8.php // Industry domains @@ -5831,7 +5832,7 @@ edu.sa sch.sa // sb : http://www.sbnic.net.sb/ -// Submitted by registry 2008-06-08 +// Submitted by registry sb com.sb edu.sb @@ -5848,7 +5849,7 @@ org.sc edu.sc // sd : http://www.isoc.sd/sudanic.isoc.sd/billing_pricing.htm -// Submitted by registry 2008-06-17 +// Submitted by registry sd com.sd net.sd @@ -5860,7 +5861,7 @@ gov.sd info.sd // se : http://en.wikipedia.org/wiki/.se -// Submitted by registry 2014-03-18 +// Submitted by registry se a.se ac.se @@ -5923,7 +5924,7 @@ mil.sh si // sj : No registrations at this time. -// Submitted by registry 2008-06-16 +// Submitted by registry sj // sk : http://en.wikipedia.org/wiki/.sk @@ -5931,7 +5932,7 @@ sj sk // sl : http://www.nic.sl -// Submitted by registry 2008-06-12 +// Submitted by registry sl com.sl net.sl @@ -6020,7 +6021,7 @@ org.sv red.sv // sx : http://en.wikipedia.org/wiki/.sx -// Confirmed by registry 2012-05-31 +// Submitted by registry sx gov.sx @@ -6059,7 +6060,7 @@ tf tg // th : http://en.wikipedia.org/wiki/.th -// Submitted by registry 2008-06-17 +// Submitted by registry th ac.th co.th @@ -6130,7 +6131,7 @@ defense.tn turen.tn // to : http://en.wikipedia.org/wiki/.to -// Submitted by registry 2008-06-17 +// Submitted by registry to com.to gov.to @@ -6141,7 +6142,7 @@ mil.to // subTLDs: https://www.nic.tr/forms/eng/policies.pdf // and: https://www.nic.tr/forms/politikalar.pdf -// Submitted by 2014-07-19 +// Submitted by tr com.tr info.tr @@ -6215,7 +6216,7 @@ club.tw 商業.tw // tz : http://www.tznic.or.tz/index.php/domains -// Confirmed by registry 2013-01-22 +// Submitted by registry tz ac.tz co.tz @@ -6231,7 +6232,7 @@ sc.tz tv.tz // ua : https://hostmaster.ua/policy/?ua -// Submitted by registry 2012-04-27 +// Submitted by registry ua // ua 2LD com.ua @@ -6601,7 +6602,7 @@ org.uz va // vc : http://en.wikipedia.org/wiki/.vc -// Submitted by registry 2008-06-13 +// Submitted by registry vc com.vc net.vc @@ -6611,8 +6612,7 @@ mil.vc edu.vc // ve : https://registro.nic.ve/ -// Confirmed by registry 2012-10-04 -// Updated 2014-05-20 - Bug 940478 +// Submitted by registry ve arts.ve co.ve @@ -6826,7 +6826,7 @@ yt فلسطين // xn--90a3ac ("srb", Cyrillic) : RS -// http://www.rnids.rs/en/the-.срб-domain +// https://www.rnids.rs/en/domains/national-domains срб пр.срб орг.срб @@ -6905,7 +6905,7 @@ xxx // za : http://www.zadna.org.za/content/page/domain-information ac.za -agrica.za +agric.za alt.za co.za edu.za @@ -10591,11 +10591,11 @@ zuerich // (Note: these are in alphabetical order by company name) // Amazon CloudFront : https://aws.amazon.com/cloudfront/ -// Submitted by Donavan Miller 2013-03-22 +// Submitted by Donavan Miller cloudfront.net // Amazon Elastic Compute Cloud: https://aws.amazon.com/ec2/ -// Submitted by Osman Surkatty 2014-12-16 +// Submitted by Osman Surkatty ap-northeast-1.compute.amazonaws.com ap-southeast-1.compute.amazonaws.com ap-southeast-2.compute.amazonaws.com @@ -10614,15 +10614,15 @@ z-1.compute-1.amazonaws.com z-2.compute-1.amazonaws.com // Amazon Elastic Beanstalk : https://aws.amazon.com/elasticbeanstalk/ -// Submitted by Adam Stein 2013-04-02 +// Submitted by Adam Stein elasticbeanstalk.com // Amazon Elastic Load Balancing : https://aws.amazon.com/elasticloadbalancing/ -// Submitted by Scott Vidmar 2013-03-27 +// Submitted by Scott Vidmar elb.amazonaws.com // Amazon S3 : https://aws.amazon.com/s3/ -// Submitted by Eric Kinolik 2015-04-08 +// Submitted by Eric Kinolik s3.amazonaws.com s3-ap-northeast-1.amazonaws.com s3-ap-southeast-1.amazonaws.com @@ -10640,11 +10640,11 @@ s3.cn-north-1.amazonaws.com.cn s3.eu-central-1.amazonaws.com // BetaInABox -// Submitted by adrian@betainabox.com 2012-09-13 +// Submitted by Adrian betainabox.com // CentralNic : http://www.centralnic.com/names/domains -// Submitted by registry 2012-09-27 +// Submitted by registry ae.org ar.com br.com @@ -10675,38 +10675,42 @@ za.bz za.com // Africa.com Web Solutions Ltd : https://registry.africa.com -// Submitted by Gavin Brown 2014-02-04 +// Submitted by Gavin Brown africa.com // iDOT Services Limited : http://www.domain.gr.com -// Submitted by Gavin Brown 2014-02-04 +// Submitted by Gavin Brown gr.com // Radix FZC : http://domains.in.net -// Submitted by Gavin Brown 2014-02-04 +// Submitted by Gavin Brown in.net // US REGISTRY LLC : http://us.org -// Submitted by Gavin Brown 2014-02-04 +// Submitted by Gavin Brown us.org // co.com Registry, LLC : https://registry.co.com -// Submitted by Gavin Brown 2014-02-04 +// Submitted by Gavin Brown co.com // c.la : http://www.c.la/ c.la // cloudControl : https://www.cloudcontrol.com/ -// Submitted by Tobias Wilken 2013-07-23 +// Submitted by Tobias Wilken cloudcontrolled.com cloudcontrolapp.com // co.ca : http://registry.co.ca/ co.ca +// i-registry s.r.o. : http://www.i-registry.cz/ +// Submitted by Martin Semrad +co.cz + // CDN77.com : http://www.cdn77.com -// Submitted by Jan Krpes 2015-07-13 +// Submitted by Jan Krpes c.cdn77.org cdn77-ssl.net r.cdn77.net @@ -10718,19 +10722,23 @@ co.nl co.no // Commerce Guys, SAS -// Submitted by Damien Tournoud 2015-01-22 +// Submitted by Damien Tournoud *.platform.sh // Cupcake : https://cupcake.io/ -// Submitted by Jonathan Rudenberg 2013-10-08 +// Submitted by Jonathan Rudenberg cupcake.is // DreamHost : http://www.dreamhost.com/ -// Submitted by Andrew Farmer 2012-10-02 +// Submitted by Andrew Farmer dreamhosters.com +// Drobo : http://www.drobo.com/ +// Submitted by Ricardo Padilha +mydrobo.com + // DuckDNS : http://www.duckdns.org/ -// Submitted by Richard Harper 2015-05-17 +// Submitted by Richard Harper duckdns.org // DynDNS.com : http://www.dyndns.com/services/dns/dyndns/ @@ -11015,8 +11023,7 @@ worse-than.tv writesthisblog.com // EU.org https://eu.org/ -// Submitted by Pierre Beyssac 2015-04-17 - +// Submitted by Pierre Beyssac eu.org al.eu.org asso.eu.org @@ -11075,7 +11082,7 @@ uk.eu.org us.eu.org // Fastly Inc. http://www.fastly.com/ -// Submitted by Vladimir Vuksan 2013-05-31 +// Submitted by Vladimir Vuksan a.ssl.fastly.net b.ssl.fastly.net global.ssl.fastly.net @@ -11083,28 +11090,28 @@ a.prod.fastly.net global.prod.fastly.net // Firebase, Inc. -// Submitted by Chris Raynor 2014-01-21 +// Submitted by Chris Raynor firebaseapp.com // Flynn : https://flynn.io -// Submitted by Jonathan Rudenberg 2014-07-12 +// Submitted by Jonathan Rudenberg flynnhub.com // GDS : https://www.gov.uk/service-manual/operations/operating-servicegovuk-subdomains -// Submitted by David Illsley 2014-08-28 +// Submitted by David Illsley service.gov.uk // GitHub, Inc. -// Submitted by Ben Toews 2014-02-06 +// Submitted by Ben Toews github.io githubusercontent.com // GlobeHosting, Inc. -// Submitted by Zoltan Egresi 2013-07-12 +// Submitted by Zoltan Egresi ro.com // Google, Inc. -// Submitted by Eduardo Vela 2014-12-19 +// Submitted by Eduardo Vela appspot.com blogspot.ae blogspot.al @@ -11192,12 +11199,12 @@ withyoutube.com hashbang.sh // Heroku : https://www.heroku.com/ -// Submitted by Tom Maher 2013-05-02 +// Submitted by Tom Maher herokuapp.com herokussl.com // iki.fi -// Submitted by Hannu Aronsson 2009-11-05 +// Submitted by Hannu Aronsson iki.fi // info.at : http://www.info.at/ @@ -11208,45 +11215,45 @@ info.at co.pl // Microsoft : http://microsoft.com -// Submitted by Barry Dorrans 2014-01-24 +// Submitted by Barry Dorrans azurewebsites.net azure-mobile.net cloudapp.net // Mozilla Foundation : https://mozilla.org/ -// Submited by glob 2015-07-06 +// Submitted by glob bmoattachments.org // Neustar Inc. -// Submitted by Trung Tran 2015-04-23 +// Submitted by Trung Tran 4u.com // ngrok : https://ngrok.com/ -// Submitted by Alan Shreve 2015-11-10 +// Submitted by Alan Shreve ngrok.io // NFSN, Inc. : https://www.NearlyFreeSpeech.NET/ -// Submitted by Jeff Wheelhouse 2014-02-02 +// Submitted by Jeff Wheelhouse nfshost.com // NYC.mn : http://www.information.nyc.mn -// Submitted by Matthew Brown 2013-03-11 +// Submitted by Matthew Brown nyc.mn // One Fold Media : http://www.onefoldmedia.com/ -// Submitted by Eddie Jones 2014-06-10 +// Submitted by Eddie Jones nid.io // Opera Software, A.S.A. -// Submitted by Yngve Pettersen 2009-11-26 +// Submitted by Yngve Pettersen operaunite.com // OutSystems -// Submitted by Duarte Santos 2014-03-11 +// Submitted by Duarte Santos outsystemscloud.com // Pagefront : https://www.pagefronthq.com/ -// Submitted by Jason Kriss 2015-12-02 +// Submitted by Jason Kriss pagefrontapp.com // .pl domains (grandfathered) @@ -11258,45 +11265,49 @@ wroc.pl zakopane.pl // Pantheon Systems, Inc. : https://pantheon.io/ -// Submitted by Gary Dylina 2015-09-14 +// Submitted by Gary Dylina pantheon.io gotpantheon.com +// prgmr.com : https://prgmr.com/ +// Submitted by Sarah Newman +xen.prgmr.com + // priv.at : http://www.nic.priv.at/ -// Submitted by registry 2008-06-09 +// Submitted by registry priv.at // QA2 -// Submitted by Daniel Dent (https://www.danieldent.com/) 2015-07-16 +// Submitted by Daniel Dent (https://www.danieldent.com/) qa2.com // Rackmaze LLC : https://www.rackmaze.com -// Submitted by Kirill Pertsev 2015-12-02 +// Submitted by Kirill Pertsev rackmaze.com rackmaze.net // Red Hat, Inc. OpenShift : https://openshift.redhat.com/ -// Submitted by Tim Kramer 2012-10-24 +// Submitted by Tim Kramer rhcloud.com // Sandstorm Development Group, Inc. : https://sandcats.io/ -// Submitted by Asheesh Laroia 2015-07-21 +// Submitted by Asheesh Laroia sandcats.io // Service Online LLC : http://drs.ua/ -// Submitted by Serhii Bulakh 2015-07-30 +// Submitted by Serhii Bulakh biz.ua co.ua pp.ua // SinaAppEngine : http://sae.sina.com.cn/ -// Submitted by SinaAppEngine 2015-02-02 +// Submitted by SinaAppEngine sinaapp.com vipsinaapp.com 1kapp.com // Synology, Inc. : https://www.synology.com/ -// Submitted by Rony Weng 2015-12-02 +// Submitted by Rony Weng diskstation.me dscloud.biz dscloud.me @@ -11319,18 +11330,18 @@ med.pl sopot.pl // UDR Limited : http://www.udr.hk.com -// Submitted by registry 2014-11-07 +// Submitted by registry hk.com hk.org ltd.hk inc.hk // Yola : https://www.yola.com/ -// Submitted by Stefano Rivera 2014-07-09 +// Submitted by Stefano Rivera yolasite.com // ZaNiC : http://www.za.net/ -// Submitted by registry 2009-10-03 +// Submitted by registry za.net za.org From 87ae21858adc173c129ff8dfec8ce74cd82e77be Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 6 Feb 2016 11:08:20 +0200 Subject: [PATCH 06/13] Extend etags Ruby support for accessors * lib-src/etags.c (Ruby_functions): Support accessors defined with parentheses. (Bug#22563) * test/etags/ruby-src/test1.ru (A::B): Add tests for accessors defined with parentheses. * test/etags/ETAGS.good_1: * test/etags/ETAGS.good_2: * test/etags/ETAGS.good_3: * test/etags/ETAGS.good_4: * test/etags/ETAGS.good_5: * test/etags/ETAGS.good_6: * test/etags/CTAGS.good: Adapt to changes in Ruby tests. --- lib-src/etags.c | 6 +++++- test/etags/CTAGS.good | 8 ++++++-- test/etags/ETAGS.good_1 | 12 ++++++++---- test/etags/ETAGS.good_2 | 12 ++++++++---- test/etags/ETAGS.good_3 | 12 ++++++++---- test/etags/ETAGS.good_4 | 12 ++++++++---- test/etags/ETAGS.good_5 | 12 ++++++++---- test/etags/ETAGS.good_6 | 12 ++++++++---- test/etags/ruby-src/test1.ru | 6 +++++- 9 files changed, 64 insertions(+), 28 deletions(-) diff --git a/lib-src/etags.c b/lib-src/etags.c index 0f5bfa3a951..182cb4cc876 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -4730,8 +4730,12 @@ Ruby_functions (FILE *inf) if (reader || writer || alias) { do { - char *np = cp; + char *np; + cp = skip_spaces (cp); + if (*cp == '(') + cp = skip_spaces (cp + 1); + np = cp; cp = skip_name (cp); if (*np != ':') continue; diff --git a/test/etags/CTAGS.good b/test/etags/CTAGS.good index 58b1db6b0a3..ebde715272a 100644 --- a/test/etags/CTAGS.good +++ b/test/etags/CTAGS.good @@ -454,7 +454,7 @@ Condition_Variable/t ada-src/2ataspri.ads /^ type Condition_Variable is privat Condition_Variable/t ada-src/2ataspri.ads /^ type Condition_Variable is$/ Configure pyt-src/server.py /^class Configure(Frame, ControlEdit):$/ ConfirmQuit pyt-src/server.py /^def ConfirmQuit(frame, context):$/ -Constant ruby-src/test1.ru 38 +Constant ruby-src/test1.ru 42 ControlEdit pyt-src/server.py /^class ControlEdit(Frame):$/ Controls pyt-src/server.py /^class Controls:$/ CopyTextString pas-src/common.pas /^function CopyTextString;(*($/ @@ -2555,6 +2555,7 @@ bar c-src/c.c /^void bar() {while(0) {}}$/ bar c.c 143 bar c-src/h.h 19 bar cp-src/x.cc /^XX::bar()$/ +bar1 ruby-src/test1.ru /^ attr_reader(:foo1, :bar1, # comment$/ bar= ruby-src/test1.ru /^ attr_writer :bar,$/ bas_syn prol-src/natded.prolog /^bas_syn(n(_)).$/ base c-src/emacs/src/lisp.h 2188 @@ -3008,6 +3009,8 @@ foo f-src/entry.strange /^ character*(*) function foo()$/ foo php-src/ptest.php /^foo()$/ foo ruby-src/test1.ru /^ attr_reader :foo$/ foo! ruby-src/test1.ru /^ def foo!$/ +foo1 ruby-src/test1.ru /^ attr_reader(:foo1, :bar1, # comment$/ +foo2 ruby-src/test1.ru /^ alias_method ( :foo2, #cmmt$/ foobar c-src/c.c /^int foobar() {;}$/ foobar c.c /^extern void foobar (void) __attribute__ ((section / foobar2 c-src/h.h 20 @@ -3880,7 +3883,8 @@ questo ../c/c.web 34 quiettest make-src/Makefile /^quiettest:$/ quit_char c-src/emacs/src/keyboard.c 192 quit_throw_to_read_char c-src/emacs/src/keyboard.c /^quit_throw_to_read_char (bool from_signal)$/ -qux ruby-src/test1.ru /^ alias_method :qux, :tee, attr_accessor :bogus$/ +qux ruby-src/test1.ru /^ alias_method :qux, :tee, attr_accessor(:bogus)/ +qux1 ruby-src/test1.ru /^ :qux1)$/ qux= ruby-src/test1.ru /^ def qux=(tee)$/ r0 c-src/sysdep.h 54 r1 c-src/sysdep.h 55 diff --git a/test/etags/ETAGS.good_1 b/test/etags/ETAGS.good_1 index 90bbe774f05..d2550863428 100644 --- a/test/etags/ETAGS.good_1 +++ b/test/etags/ETAGS.good_1 @@ -3061,7 +3061,7 @@ module ModuleExample1,0 def module_instance_method46,1051 def ModuleExample.module_class_methodmodule_class_method49,1131 -ruby-src/test1.ru,785 +ruby-src/test1.ru,935 class A1,0 def a(2,8 def b(5,38 @@ -3084,9 +3084,13 @@ module A9,57 attr_accessor :teetee31,382 attr_accessor :teetee=31,382 alias_method :qux,qux32,405 - alias_method :xyz,xyz33,455 - :tee ; attr_reader :subtlesubtle34,478 -A::Constant Constant38,533 + alias_method :xyz,xyz33,456 + :tee ; attr_reader :subtlesubtle34,479 + attr_reader(:foo1,foo135,523 + attr_reader(:foo1, :bar1,bar135,523 + :qux1)qux136,563 + alias_method ( :foo2,foo237,586 +A::Constant Constant42,655 tex-src/testenv.tex,52 \newcommand{\nm}\nm4,77 diff --git a/test/etags/ETAGS.good_2 b/test/etags/ETAGS.good_2 index d774bb1b190..9eb1d4297c8 100644 --- a/test/etags/ETAGS.good_2 +++ b/test/etags/ETAGS.good_2 @@ -3631,7 +3631,7 @@ module ModuleExample1,0 def module_instance_method46,1051 def ModuleExample.module_class_methodmodule_class_method49,1131 -ruby-src/test1.ru,785 +ruby-src/test1.ru,935 class A1,0 def a(2,8 def b(5,38 @@ -3654,9 +3654,13 @@ module A9,57 attr_accessor :teetee31,382 attr_accessor :teetee=31,382 alias_method :qux,qux32,405 - alias_method :xyz,xyz33,455 - :tee ; attr_reader :subtlesubtle34,478 -A::Constant Constant38,533 + alias_method :xyz,xyz33,456 + :tee ; attr_reader :subtlesubtle34,479 + attr_reader(:foo1,foo135,523 + attr_reader(:foo1, :bar1,bar135,523 + :qux1)qux136,563 + alias_method ( :foo2,foo237,586 +A::Constant Constant42,655 tex-src/testenv.tex,52 \newcommand{\nm}\nm4,77 diff --git a/test/etags/ETAGS.good_3 b/test/etags/ETAGS.good_3 index e3855a59309..1f5a34272e3 100644 --- a/test/etags/ETAGS.good_3 +++ b/test/etags/ETAGS.good_3 @@ -3408,7 +3408,7 @@ module ModuleExample1,0 def module_instance_method46,1051 def ModuleExample.module_class_methodmodule_class_method49,1131 -ruby-src/test1.ru,785 +ruby-src/test1.ru,935 class A1,0 def a(2,8 def b(5,38 @@ -3431,9 +3431,13 @@ module A9,57 attr_accessor :teetee31,382 attr_accessor :teetee=31,382 alias_method :qux,qux32,405 - alias_method :xyz,xyz33,455 - :tee ; attr_reader :subtlesubtle34,478 -A::Constant Constant38,533 + alias_method :xyz,xyz33,456 + :tee ; attr_reader :subtlesubtle34,479 + attr_reader(:foo1,foo135,523 + attr_reader(:foo1, :bar1,bar135,523 + :qux1)qux136,563 + alias_method ( :foo2,foo237,586 +A::Constant Constant42,655 tex-src/testenv.tex,52 \newcommand{\nm}\nm4,77 diff --git a/test/etags/ETAGS.good_4 b/test/etags/ETAGS.good_4 index dbae59bd59e..b8a3d9de6db 100644 --- a/test/etags/ETAGS.good_4 +++ b/test/etags/ETAGS.good_4 @@ -3225,7 +3225,7 @@ module ModuleExample1,0 def module_instance_method46,1051 def ModuleExample.module_class_methodmodule_class_method49,1131 -ruby-src/test1.ru,785 +ruby-src/test1.ru,935 class A1,0 def a(2,8 def b(5,38 @@ -3248,9 +3248,13 @@ module A9,57 attr_accessor :teetee31,382 attr_accessor :teetee=31,382 alias_method :qux,qux32,405 - alias_method :xyz,xyz33,455 - :tee ; attr_reader :subtlesubtle34,478 -A::Constant Constant38,533 + alias_method :xyz,xyz33,456 + :tee ; attr_reader :subtlesubtle34,479 + attr_reader(:foo1,foo135,523 + attr_reader(:foo1, :bar1,bar135,523 + :qux1)qux136,563 + alias_method ( :foo2,foo237,586 +A::Constant Constant42,655 tex-src/testenv.tex,52 \newcommand{\nm}\nm4,77 diff --git a/test/etags/ETAGS.good_5 b/test/etags/ETAGS.good_5 index 9ea77977ab6..9e3b258eabc 100644 --- a/test/etags/ETAGS.good_5 +++ b/test/etags/ETAGS.good_5 @@ -4142,7 +4142,7 @@ module ModuleExample1,0 def module_instance_method46,1051 def ModuleExample.module_class_methodmodule_class_method49,1131 -ruby-src/test1.ru,785 +ruby-src/test1.ru,935 class A1,0 def a(2,8 def b(5,38 @@ -4165,9 +4165,13 @@ module A9,57 attr_accessor :teetee31,382 attr_accessor :teetee=31,382 alias_method :qux,qux32,405 - alias_method :xyz,xyz33,455 - :tee ; attr_reader :subtlesubtle34,478 -A::Constant Constant38,533 + alias_method :xyz,xyz33,456 + :tee ; attr_reader :subtlesubtle34,479 + attr_reader(:foo1,foo135,523 + attr_reader(:foo1, :bar1,bar135,523 + :qux1)qux136,563 + alias_method ( :foo2,foo237,586 +A::Constant Constant42,655 tex-src/testenv.tex,52 \newcommand{\nm}\nm4,77 diff --git a/test/etags/ETAGS.good_6 b/test/etags/ETAGS.good_6 index 7420a41b108..f5e0ad4407f 100644 --- a/test/etags/ETAGS.good_6 +++ b/test/etags/ETAGS.good_6 @@ -4142,7 +4142,7 @@ module ModuleExample1,0 def module_instance_method46,1051 def ModuleExample.module_class_methodmodule_class_method49,1131 -ruby-src/test1.ru,785 +ruby-src/test1.ru,935 class A1,0 def a(2,8 def b(5,38 @@ -4165,9 +4165,13 @@ module A9,57 attr_accessor :teetee31,382 attr_accessor :teetee=31,382 alias_method :qux,qux32,405 - alias_method :xyz,xyz33,455 - :tee ; attr_reader :subtlesubtle34,478 -A::Constant Constant38,533 + alias_method :xyz,xyz33,456 + :tee ; attr_reader :subtlesubtle34,479 + attr_reader(:foo1,foo135,523 + attr_reader(:foo1, :bar1,bar135,523 + :qux1)qux136,563 + alias_method ( :foo2,foo237,586 +A::Constant Constant42,655 tex-src/testenv.tex,52 \newcommand{\nm}\nm4,77 diff --git a/test/etags/ruby-src/test1.ru b/test/etags/ruby-src/test1.ru index 93888c1040b..eafaec6248b 100644 --- a/test/etags/ruby-src/test1.ru +++ b/test/etags/ruby-src/test1.ru @@ -29,9 +29,13 @@ module A :baz, :more attr_accessor :tee - alias_method :qux, :tee, attr_accessor :bogus + alias_method :qux, :tee, attr_accessor(:bogus) alias_method :xyz, :tee ; attr_reader :subtle + attr_reader(:foo1, :bar1, # comment + :qux1) + alias_method ( :foo2, #cmmt + :bar2) end end From be1d87492e2fba479151edcaf7f3818675b1eac7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 6 Feb 2016 18:30:35 +0200 Subject: [PATCH 07/13] Fix issues found by auditing w32notify code * src/w32inevt.c (handle_file_notifications): Count the number of events to be returned. * src/w32notify.c (send_notifications): Don't copy to the file notification buffer more than it can hold. (Bug#22534) --- src/w32inevt.c | 1 + src/w32notify.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/w32inevt.c b/src/w32inevt.c index 54b0b13f54e..e714e27f4bc 100644 --- a/src/w32inevt.c +++ b/src/w32inevt.c @@ -660,6 +660,7 @@ handle_file_notifications (struct input_event *hold_quit) inev.arg = list3 (make_pointer_integer (notifications_desc), action, fname); kbd_buffer_store_event_hold (&inev, hold_quit); + nevents++; if (!fni->NextEntryOffset) break; diff --git a/src/w32notify.c b/src/w32notify.c index 576cf844dab..71787c45db8 100644 --- a/src/w32notify.c +++ b/src/w32notify.c @@ -144,8 +144,9 @@ send_notifications (BYTE *info, DWORD info_size, void *desc, if (!notification_buffer_in_use) { if (info_size) - memcpy (file_notifications, info, info_size); - notifications_size = info_size; + memcpy (file_notifications, info, + min (info_size, sizeof (file_notifications))); + notifications_size = min (info_size, sizeof (file_notifications)); notifications_desc = desc; /* If PostMessage fails, the message queue is full. If that happens, the last thing they will worry about is file From 49e57490d0023b10629cd1a3c2d5f0fc6068a58c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 6 Feb 2016 21:53:38 +0200 Subject: [PATCH 08/13] Fix file-notify-test on MS-Windows * test/automated/file-notify-tests.el (file-notify--test-timeout): Reduce w32notify timeout to 10 sec. (file-notify-test06-many-events): Call read-event after each rename, to keep the w32notify backend happy in batch mode. (Bug#22534) --- test/automated/file-notify-tests.el | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el index 629d85be1ef..5fc4ff8bf42 100644 --- a/test/automated/file-notify-tests.el +++ b/test/automated/file-notify-tests.el @@ -66,7 +66,7 @@ "Timeout to wait for arriving events, in seconds." (cond ((file-remote-p temporary-file-directory) 6) - ((string-equal (file-notify--test-library) "w32notify") 20) + ((string-equal (file-notify--test-library) "w32notify") 10) ((eq system-type 'cygwin) 10) (t 3))) @@ -797,10 +797,7 @@ longer than timeout seconds for the events to be delivered." file-notify--test-tmpfile '(change) 'file-notify--test-event-handler))) (unwind-protect - ;; In case of w32notify, the upper limit of events to handle - ;; seems to be 260. Reason unknown. - (let ((n (if (string-equal (file-notify--test-library) "w32notify") - 250 1000)) + (let ((n 1000) source-file-list target-file-list (default-directory file-notify--test-tmpfile)) (dotimes (i n) @@ -832,10 +829,11 @@ longer than timeout seconds for the events to be delivered." (let ((source-file-list source-file-list) (target-file-list target-file-list)) (while (and source-file-list target-file-list) - (rename-file (pop source-file-list) (pop target-file-list) t)))) + (rename-file (pop source-file-list) (pop target-file-list) t) + (read-event nil nil 0.02)))) (file-notify--test-with-events (make-list n 'deleted) (dolist (file target-file-list) - (delete-file file)))) + (prog1 (delete-file file) (read-event nil nil 0.02))))) (file-notify--test-cleanup))) (file-notify--deftest-remote file-notify-test06-many-events From c77ffc8019bceb850a794c13f2e3ad991cc7e412 Mon Sep 17 00:00:00 2001 From: Oscar Fuentes Date: Sat, 6 Feb 2016 22:12:53 +0100 Subject: [PATCH 09/13] Use monitor's resolution for positioning tooltips * src/xfns.c (compute_tip_xy): Use the resolution of the monitor where the mouse pointer is to avoid placing the tooltip over the border of the monitor on multi-head displays. Fixes bug#22549. --- src/xfns.c | 61 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 49 insertions(+), 12 deletions(-) diff --git a/src/xfns.c b/src/xfns.c index 9624ac5d9ac..20ac6271715 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -5683,6 +5683,7 @@ compute_tip_xy (struct frame *f, Lisp_Object parms, Lisp_Object dx, Lisp_Object int win_x, win_y; Window root, child; unsigned pmask; + int min_x, min_y, max_x, max_y = -1; /* User-specified position? */ left = Fcdr (Fassq (Qleft, parms)); @@ -5695,45 +5696,81 @@ compute_tip_xy (struct frame *f, Lisp_Object parms, Lisp_Object dx, Lisp_Object if ((!INTEGERP (left) && !INTEGERP (right)) || (!INTEGERP (top) && !INTEGERP (bottom))) { + Lisp_Object frame, attributes, monitor, geometry; + block_input (); XQueryPointer (FRAME_X_DISPLAY (f), FRAME_DISPLAY_INFO (f)->root_window, &root, &child, root_x, root_y, &win_x, &win_y, &pmask); unblock_input (); + + XSETFRAME(frame, f); + attributes = Fx_display_monitor_attributes_list (frame); + + /* Try to determine the monitor where the mouse pointer is and + its geometry. See bug#22549. */ + while (CONSP (attributes)) + { + monitor = XCAR (attributes); + geometry = Fassq (Qgeometry, monitor); + if (CONSP (geometry)) + { + min_x = XINT (Fnth (make_number (1), geometry)); + min_y = XINT (Fnth (make_number (2), geometry)); + max_x = min_x + XINT (Fnth (make_number (3), geometry)); + max_y = min_y + XINT (Fnth (make_number (4), geometry)); + if (min_x <= *root_x && *root_x < max_x + && min_y <= *root_y && *root_y < max_y) + { + break; + } + max_y = -1; + } + + attributes = XCDR (attributes); + } + } + + /* It was not possible to determine the monitor's geometry, so we + assign some sane defaults here: */ + if ( max_y < 0 ) + { + min_x = 0; + min_y = 0; + max_x = x_display_pixel_width (FRAME_DISPLAY_INFO (f)); + max_y = x_display_pixel_height (FRAME_DISPLAY_INFO (f)); } if (INTEGERP (top)) *root_y = XINT (top); else if (INTEGERP (bottom)) *root_y = XINT (bottom) - height; - else if (*root_y + XINT (dy) <= 0) - *root_y = 0; /* Can happen for negative dy */ - else if (*root_y + XINT (dy) + height - <= x_display_pixel_height (FRAME_DISPLAY_INFO (f))) + else if (*root_y + XINT (dy) <= min_y) + *root_y = min_y; /* Can happen for negative dy */ + else if (*root_y + XINT (dy) + height <= max_y) /* It fits below the pointer */ *root_y += XINT (dy); - else if (height + XINT (dy) <= *root_y) + else if (height + XINT (dy) + min_y <= *root_y) /* It fits above the pointer. */ *root_y -= height + XINT (dy); else /* Put it on the top. */ - *root_y = 0; + *root_y = min_y; if (INTEGERP (left)) *root_x = XINT (left); else if (INTEGERP (right)) *root_x = XINT (right) - width; - else if (*root_x + XINT (dx) <= 0) + else if (*root_x + XINT (dx) <= min_x) *root_x = 0; /* Can happen for negative dx */ - else if (*root_x + XINT (dx) + width - <= x_display_pixel_width (FRAME_DISPLAY_INFO (f))) + else if (*root_x + XINT (dx) + width <= max_x) /* It fits to the right of the pointer. */ *root_x += XINT (dx); - else if (width + XINT (dx) <= *root_x) + else if (width + XINT (dx) + min_x <= *root_x) /* It fits to the left of the pointer. */ *root_x -= width + XINT (dx); else - /* Put it left-justified on the screen--it ought to fit that way. */ - *root_x = 0; + /* Put it left justified on the screen -- it ought to fit that way. */ + *root_x = min_x; } From 4ea1ea7c73f40a5bb3955273312f337dc332d6aa Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sat, 6 Feb 2016 18:44:22 +0000 Subject: [PATCH 10/13] * lisp/isearch.el: Rename search-default-regexp-mode to search-default-mode (search-default-mode): New variable. (isearch-mode, isearch-define-mode-toggle) (isearch--describe-regexp-mode): Update accordingly. * lisp/menu-bar.el (nonincremental-search-forward): Update accordingly. * etc/NEWS: Update accordingly. * doc/emacs/search.texi: Update accordingly. --- doc/emacs/search.texi | 4 ++-- etc/NEWS | 2 +- lisp/isearch.el | 16 ++++++++-------- lisp/menu-bar.el | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index e854646d056..10c1f73b331 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -1268,7 +1268,7 @@ character sequences}. Generally, search commands in Emacs by default perform character folding, thus matching equivalent character sequences. You can disable this behavior by customizing the variable -@code{search-default-regexp-mode} to @code{nil}. @xref{Search +@code{search-default-mode} to @code{nil}. @xref{Search Customizations}. Within an incremental search, typing @kbd{M-s '} (@code{isearch-toggle-character-fold}) toggles character folding, but only for that search. (Replace commands have a different default, @@ -1800,7 +1800,7 @@ not described elsewhere. @cindex default search mode @cindex search mode, default The default search mode for the incremental search is specified by -the variable @code{search-default-regexp-mode}. It can be @code{nil}, +the variable @code{search-default-mode}. It can be @code{nil}, @code{t}, or a function. If it is @code{nil}, the default mode is to do literal searches without character folding, but with case folding and lax-whitespace matches as determined by @code{case-fold-search} diff --git a/etc/NEWS b/etc/NEWS index c98ef264bdd..e5f34a1d8a0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -586,7 +586,7 @@ item as before. ** Search and Replace +++ -*** New user option `search-default-regexp-mode' +*** New user option `search-default-mode' specifies the default mode for I-search. +++ diff --git a/lisp/isearch.el b/lisp/isearch.el index c36f4631549..1718096957e 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -224,7 +224,7 @@ Default value, nil, means edit the string instead." (autoload 'character-fold-to-regexp "character-fold") -(defcustom search-default-regexp-mode #'character-fold-to-regexp +(defcustom search-default-mode #'character-fold-to-regexp "Default mode to use when starting isearch. Value is nil, t, or a function. @@ -868,11 +868,11 @@ used to set the value of `isearch-regexp-function'." (setq isearch-forward forward isearch-regexp (or regexp (and (not regexp-function) - (eq search-default-regexp-mode t))) + (eq search-default-mode t))) isearch-regexp-function (or regexp-function - (and (functionp search-default-regexp-mode) + (and (functionp search-default-mode) (not regexp) - search-default-regexp-mode)) + search-default-mode)) isearch-op-fun op-fun isearch-last-case-fold-search isearch-case-fold-search isearch-case-fold-search case-fold-search @@ -1506,7 +1506,7 @@ Use `isearch-exit' to quit without signaling." (isearch-repeat 'backward)) -;;; Toggles for `isearch-regexp-function' and `search-default-regexp-mode'. +;;; Toggles for `isearch-regexp-function' and `search-default-mode'. (defmacro isearch-define-mode-toggle (mode key function &optional docstring &rest body) "Define a command called `isearch-toggle-MODE' and bind it to `M-s KEY'. The first line of the command's docstring is auto-generated, the @@ -1538,7 +1538,7 @@ The command then executes BODY and updates the isearch prompt." (cl-callf (lambda (types) (cons 'choice (cons '(const :tag ,(capitalize (format "%s search" mode)) ,function) (cdr types)))) - (get 'search-default-regexp-mode 'custom-type))))))) + (get 'search-default-mode 'custom-type))))))) (isearch-define-mode-toggle word "w" word-search-regexp "\ Turning on word search turns off regexp mode.") @@ -2571,7 +2571,7 @@ the word mode." (setq regexp-function #'word-search-regexp)) (let ((description ;; Don't use a description on the default search mode. - (cond ((equal regexp-function search-default-regexp-mode) "") + (cond ((equal regexp-function search-default-mode) "") (regexp-function (and (symbolp regexp-function) (or (get regexp-function 'isearch-message-prefix) @@ -2579,7 +2579,7 @@ the word mode." (isearch-regexp "regexp ") ;; We're in literal mode. If the default mode is not ;; literal, then describe it. - ((functionp search-default-regexp-mode) "literal ")))) + ((functionp search-default-mode) "literal ")))) (if space-before ;; Move space from the end to the beginning. (replace-regexp-in-string "\\(.*\\) \\'" " \\1" description) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index f9dde5748c2..254bdeecaae 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -244,7 +244,7 @@ (setq menu-bar-last-search-type 'string) ;; Ideally, this whole command would be equivalent to `C-s RET'. (let ((isearch-forward (not backward)) - (isearch-regexp-function search-default-regexp-mode) + (isearch-regexp-function search-default-mode) (isearch-regexp nil)) (if (or (equal string "") (not string)) (funcall (isearch-search-fun-default) (car search-ring)) From 3db6adb174e4b3aa147fc7b260e5e401cb6069fc Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sat, 6 Feb 2016 18:45:21 +0000 Subject: [PATCH 11/13] * lisp/isearch.el (search-default-mode) (isearch-regexp-function): Improve docstrings. --- lisp/isearch.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index 1718096957e..6ef4f72db2f 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -234,9 +234,9 @@ If t, default to regexp searches (as if typing `\\[isearch-toggle-regexp]' durin isearch). If a function, use that function as an `isearch-regexp-function'. -Example functions are `word-search-regexp' \(`\\[isearch-toggle-word]'), -`isearch-symbol-regexp' \(`\\[isearch-toggle-symbol]'), and -`character-fold-to-regexp' \(`\\[isearch-toggle-character-fold]')." +Example functions (and the keys to toggle them during isearch) +are `word-search-regexp' \(`\\[isearch-toggle-word]'), `isearch-symbol-regexp' +\(`\\[isearch-toggle-symbol]'), and `character-fold-to-regexp' \(`\\[isearch-toggle-character-fold]')." ;; :type is set below by `isearch-define-mode-toggle'. :type '(choice (const :tag "Literal search" nil) (const :tag "Regexp search" t) @@ -558,7 +558,11 @@ If the value is a function (e.g. `isearch-symbol-regexp'), it is called to convert a plain search string to a regexp used by regexp search functions. The symbol property `isearch-message-prefix' put on this function -specifies the prefix string displayed in the search message.") +specifies the prefix string displayed in the search message. + +This variable is set and changed during isearch. To change the +default behaviour used for searches, see `search-default-mode' +instead.") ;; We still support setting this to t for backwards compatibility. (define-obsolete-variable-alias 'isearch-word 'isearch-regexp-function "25.1") From 16140f7ecebc82829c9720cb18979fb26063fa56 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sat, 6 Feb 2016 22:45:17 +0000 Subject: [PATCH 12/13] * lisp/menu-bar.el (menu-bar-options-menu): New search submenu (menu-bar-search-options-menu): New variable --- lisp/menu-bar.el | 55 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 6 deletions(-) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 254bdeecaae..6281d7e5453 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -1250,6 +1250,52 @@ mail status in mode line")) :enable (not (truncated-partial-width-window-p)))) menu)) +(defvar menu-bar-search-options-menu + (let ((menu (make-sparse-keymap "Search Options"))) + + (dolist (x '((character-fold-to-regexp "Fold Characters" "Character folding") + (isearch-symbol-regexp "Whole Symbols" "Whole symbol") + (word-search-regexp "Whole Words" "Whole word"))) + (bindings--define-key menu (vector (nth 0 x)) + `(menu-item ,(nth 1 x) + (lambda () + (interactive) + (setq search-default-mode #',(nth 0 x)) + (message ,(format "%s search enabled" (nth 2 x)))) + :help ,(format "Enable %s search" (downcase (nth 2 x))) + :button (:radio . (eq search-default-mode #',(nth 0 x)))))) + + (bindings--define-key menu [regexp-search] + '(menu-item "Regular Expression" + (lambda () + (interactive) + (setq search-default-mode t) + (message "Regular-expression search enabled")) + :help "Enable regular-expression search" + :button (:radio . (eq search-default-mode t)))) + + (bindings--define-key menu [regular-search] + '(menu-item "Literal Search" + (lambda () + (interactive) + (when search-default-mode + (setq search-default-mode nil) + (when (symbolp search-default-mode) + (message "Literal search enabled")))) + :help "Disable special search modes" + :button (:radio . (not search-default-mode)))) + + (bindings--define-key menu [custom-separator] + menu-bar-separator) + (bindings--define-key menu [case-fold-search] + (menu-bar-make-toggle + toggle-case-fold-search case-fold-search + "Ignore Case" + "Case-Insensitive Search %s" + "Ignore letter-case in search commands")) + + menu)) + (defvar menu-bar-options-menu (let ((menu (make-sparse-keymap "Options"))) (bindings--define-key menu [customize] @@ -1361,12 +1407,9 @@ mail status in mode line")) (:visible (and (boundp 'cua-enable-cua-keys) (not cua-enable-cua-keys))))) - (bindings--define-key menu [case-fold-search] - (menu-bar-make-toggle - toggle-case-fold-search case-fold-search - "Ignore Case for Search" - "Case-Insensitive Search %s" - "Ignore letter-case in search commands")) + (bindings--define-key menu [search-options] + `(menu-item "Default Search Options" + ,menu-bar-search-options-menu)) (bindings--define-key menu [line-wrapping] `(menu-item "Line Wrapping in This Buffer" From 9ffe7ddd5e1ba93f327cfe985e9476571d7a2873 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sat, 6 Feb 2016 22:46:16 +0000 Subject: [PATCH 13/13] * lisp/isearch.el (isearch-define-mode-toggle): Improve logic --- lisp/isearch.el | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index 6ef4f72db2f..2efa4c7e8ef 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1528,15 +1528,13 @@ The command then executes BODY and updates the isearch prompt." (if docstring (concat "\n" docstring) "")) (interactive) ,@(when function - `((setq isearch-regexp-function - (unless (eq isearch-regexp-function #',function) - #',function)) - (when isearch-regexp-function (setq isearch-regexp nil)))) + `((setq isearch-regexp-function #',function) + (setq isearch-regexp nil))) ,@body (setq isearch-success t isearch-adjusted t) (isearch-update)) (define-key isearch-mode-map ,key #',command-name) - ,@(when (symbolp function) + ,@(when (and function (symbolp function)) `((put ',function 'isearch-message-prefix ,(format "%s " mode)) (put ',function :advertised-binding ,key) (cl-callf (lambda (types) (cons 'choice