From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud Newsgroups: gmane.emacs.bugs Subject: bug#50603: 28.0.50; [PATCH] more vc-read-backend usage Date: Wed, 15 Sep 2021 15:47:07 +0200 Message-ID: <87sfy63q90.fsf@elite.giraud> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33665"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (berkeley-unix) To: 50603@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 15 15:48:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mQVGk-0008Uu-Mj for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Sep 2021 15:48:10 +0200 Original-Received: from localhost ([::1]:55454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQVGi-0004p0-SF for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Sep 2021 09:48:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQVGc-0004oc-Fp for bug-gnu-emacs@gnu.org; Wed, 15 Sep 2021 09:48:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39759) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mQVGc-0002T5-8S for bug-gnu-emacs@gnu.org; Wed, 15 Sep 2021 09:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mQVGc-0004gE-7O for bug-gnu-emacs@gnu.org; Wed, 15 Sep 2021 09:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Sep 2021 13:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50603 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.163171364317935 (code B ref -1); Wed, 15 Sep 2021 13:48:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Sep 2021 13:47:23 +0000 Original-Received: from localhost ([127.0.0.1]:51305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQVFy-0004fC-UR for submit@debbugs.gnu.org; Wed, 15 Sep 2021 09:47:23 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:58316) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQVFt-0004ey-OR for submit@debbugs.gnu.org; Wed, 15 Sep 2021 09:47:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQVFr-0004Po-Ss for bug-gnu-emacs@gnu.org; Wed, 15 Sep 2021 09:47:17 -0400 Original-Received: from ledu-giraud.fr ([51.159.28.247]:36671) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQVFn-00020R-4U for bug-gnu-emacs@gnu.org; Wed, 15 Sep 2021 09:47:13 -0400 Original-Received: from elite.giraud ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 7802b789 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Wed, 15 Sep 2021 15:47:08 +0200 (CEST) Received-SPF: pass client-ip=51.159.28.247; envelope-from=manuel@ledu-giraud.fr; helo=ledu-giraud.fr X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:214399 Archived-At: --=-=-= Content-Type: text/plain Hi, This add an optional parameter to vc-read-backend and use it where it makes sense. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-more-vc-read-backend.patch >From dc7fcb64da4e7f2b07b6b962055c49dfe16a5c14 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Wed, 15 Sep 2021 15:32:32 +0200 Subject: [PATCH] more vc-read-backend. --- lisp/vc/vc.el | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index b3a5ff01cf..c88a796e56 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1157,10 +1157,11 @@ vc-compatible-state (eq p q) (and (member p '(edited added removed)) (member q '(edited added removed))))) -(defun vc-read-backend (prompt) - (intern - (completing-read prompt (mapcar #'symbol-name vc-handled-backends) - nil 'require-match))) +(defun vc-read-backend (prompt &optional backends) + (let ((backends (or backends vc-handled-backends))) + (intern + (completing-read prompt (mapcar #'symbol-name backends) + nil 'require-match)))) ;; Here's the major entry point. @@ -1373,14 +1374,7 @@ vc-next-action (defun vc-create-repo (backend) "Create an empty repository in the current directory." - (interactive - (list - (intern - (upcase - (completing-read - "Create repository for: " - (mapcar (lambda (b) (list (downcase (symbol-name b)))) vc-handled-backends) - nil t))))) + (interactive (list (vc-read-backend "Create repository for: "))) (vc-call-backend backend 'create-repo)) ;;;###autoload @@ -2888,12 +2882,7 @@ vc-switch-backend (cond ((null others) (error "No other backend to switch to")) (current-prefix-arg - (intern - (upcase - (completing-read - (format "Switch to backend [%s]: " def) - (mapcar (lambda (b) (list (downcase (symbol-name b)))) backends) - nil t nil nil (downcase (symbol-name def)))))) + (vc-read-backend "Switch to backend: " backends)) (t def)))))) (unless (eq backend (vc-backend file)) (vc-file-clearprops file) -- 2.33.0 --=-=-= Content-Type: text/plain In GNU Emacs 28.0.50 (build 1, x86_64-unknown-openbsd7.0, X toolkit, cairo version 1.16.0, Xaw3d scroll bars) of 2021-09-13 built on elite.giraud Repository revision: 5ee05fa75d517fdd13c9795aa78e12489140e388 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12013000 System Description: OpenBSD elite.giraud 7.0 GENERIC.MP#211 amd64 Configured using: 'configure --prefix=/home/manuel/emacs --bindir=/home/manuel/bin --with-x-toolkit=athena --without-sound --without-json CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib' Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LCMS2 LIBOTF LIBXML2 M17N_FLT MODULES NOTIFY KQUEUE PDUMPER PNG RSVG THREADS TIFF TOOLKIT_SCROLL_BARS X11 XAW3D XDBE XIM XPM LUCID ZLIB Important settings: value of $LC_ALL: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Dired by name Minor modes in effect: gnus-dired-mode: t global-git-commit-mode: t magit-auto-revert-mode: t show-paren-mode: t icomplete-mode: t display-time-mode: t shell-dirtrack-mode: t windmove-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t column-number-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t Load-path shadows: /home/manuel/.el/google-maps.el/google-maps hides /home/manuel/.el/google-maps /home/manuel/.emacs.d/elpa/magit-20210909.434/magit-section-pkg hides /home/manuel/.emacs.d/elpa/magit-section-20210829.1849/magit-section-pkg /home/manuel/.emacs.d/elpa/transient-20210819.2118/transient hides /home/manuel/emacs/share/emacs/28.0.50/lisp/transient Features: (org-agenda org-refile vc-filewise eieio-opt speedbar ezimage dframe shortdoc completion whitespace vc-dir ewoc log-view wdired term ehelp shadow emacsbug gnus-dired pulse tar-mode make-mode shr-color ispell help-fns radix-tree cl-print debug backtrace vc-mtn vc-hg vc-bzr vc-src vc-sccs magit-extras face-remap magit-submodule magit-obsolete magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff smerge-mode diff git-commit rx log-edit pcvs-util magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process with-editor magit-mode transient magit-git magit-section magit-utils dash dabbrev vc-cvs vc-rcs vc misearch multi-isearch vc-git diff-mode bug-reference mailalias bbdb-message gnus-dup debbugs-gnu add-log debbugs soap-client warnings rng-xsd rng-dt rng-util xsd-regexp vc-dispatcher vc-svn sort gnus-cite mail-extr gnus-async gnus-bcklg gnus-ml gnus-topic cursor-sensor mm-archive url-http url-gw url-auth qp utf-7 imap rfc2104 nnrss mm-url nndoc nndraft nnmh gnutls network-stream nsm nnfolder bbdb-gnus nnml gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg nntp gnus-cache w3m w3m-hist w3m-fb bookmark-w3m w3m-ems w3m-favicon w3m-image tab-line w3m-proc w3m-util cl-extra help-mode paredit paren icomplete time battery cus-load exwm-randr xcb-randr exwm-config exwm exwm-input xcb-keysyms exwm-manage exwm-floating xcb-cursor xcb-render exwm-layout exwm-workspace exwm-core xcb-ewmh xcb-icccm xcb xcb-xkb xcb-xproto xcb-types xcb-debug server modus-operandi-theme modus-themes pcase google-maps google-maps-static google-maps-geocode google-maps-base osm-mode url-cache gnuplot info-look transmission color calc-bin calc-ext calc calc-loaddefs rect calc-macs w3m-load mu4e mu4e-org mu4e-main mu4e-view mu4e-view-gnus gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum gnus-group gnus-undo gnus-start gnus-dbus dbus gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range gnus-win gnus nnheader wid-edit mu4e-view-common mu4e-headers mu4e-compose mu4e-context mu4e-draft mu4e-actions ido rfc2368 smtpmail sendmail mu4e-mark mu4e-proc mu4e-utils doc-view jka-compr image-mode exif mu4e-lists mu4e-message shr kinsoku svg xml dom flow-fill mule-util hl-line mu4e-vars message rmc puny rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mail-utils gmm-utils mailheader mu4e-meta supercite regi bbdb-anniv diary-lib diary-loaddefs bbdb-mua bbdb-com crm mailabbrev bbdb bbdb-site timezone org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint org-pcomplete org-list org-faces org-entities org-version ob-emacs-lisp ob-core ob-eval org-table ol org-keys org-compat org-macs org-loaddefs find-func cal-menu calendar cal-loaddefs visual-basic-mode web-mode disp-table erlang-start smart-tabs-mode skeleton cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs movitz-slime cl slime-asdf grep slime-tramp tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat shell pcomplete parse-time iso8601 time-date ls-lisp format-spec slime-fancy slime-indentation slime-cl-indent cl-indent slime-trace-dialog slime-fontifying-fu slime-package-fu slime-references slime-compiler-notes-tree advice slime-scratch slime-presentations bridge slime-macrostep macrostep slime-mdot-fu slime-enclosing-context slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c slime-editing-commands slime-autodoc slime-repl slime-parse slime compile text-property-search etags fileloop generator xref project arc-mode archive-mode noutline outline pp comint ansi-color ring hyperspec thingatpt slime-autoloads dired-aux dired-x dired dired-loaddefs edmacro kmacro windmove easy-mmode tex-site info package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind kqueue lcms2 dynamic-setting system-font-setting font-render-setting cairo x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 1085709 184490) (symbols 48 72774 10) (strings 32 349500 12549) (string-bytes 1 10779365) (vectors 16 128492) (vector-slots 8 2949177 144104) (floats 8 3016 1061) (intervals 56 30248 1956) (buffers 992 85)) -- Manuel Giraud --=-=-=--