texts:
When trying to post to GMANE, I get an error message:

441 You need a valid email address to post: Invalid response from
SMTP server mail.inka.de: 550-Verification failed for
auth@gmane-mx.org Couldn’t send message via news: 441 You need a
valid email address to post: Invalid response from SMTP server
mail.inka.de: 550-Verification failed for auth@gmane-mx.org”

Here mail.inka.de is the SMTP server of my provider. It looks like
something tries to connect to it with user name auth@gmane-mx.org.
If that is the case, then it’s no surprise that it’s not working.
My ~/.gnus.el:
(setq gnus-select-method '(nntp "news.gmane.io"))
(setq user-mail-address "felix.klee@inka.de"
      message-send-mail-real-function 'smtpmail-send-it
      message-send-mail-function 'smtpmail-send-it
      send-mail-function 'smtpmail-send-it
      smtpmail-smtp-server "mail.inka.de"
      smtpmail-smtp-service 587
      smtpmail-stream-type 'starttls)

Emacs successfully reads my email address from the environment variable EMAIL and stores it in user-mail-address. Sending emails from GNUS works. Why does posting to GMANE not work?


texts: How to make flycheck checker 'ruby-rubocop' use 'bundle exec rubocop' as executable?

texts:
I want ruby-rubocop Flycheck syntax checker to execute bundle exec rubocop instead of just rubocop.

What I've tried:

(setq flycheck-ruby-rubocop-executable "bundle exec rubocop")

Results in following error:

Error while checking syntax automatically: (error "Output file descriptor of flycheck-ruby-rubocop is closed")

(flycheck-set-checker-executable 'ruby-rubocop "bundle exec rubocop")

I get error:

user-error: bundle exec rubocop is no executable

This answer:

(setq flycheck-command-wrapper-function
  (lambda (command)
    (append '("bundle" "exec") command)))

It broke all checkers, because now it appends "bundle exec" to all checkers, not only ruby-rubocop, and it didn't work in ruby buffer (it still used rubocop without bundle exec). I don't know how to make this variable buffer-local.


texts: Problem when highlighting region using hlt-highlight-region

texts:
The thing I want to do is to highlight regions in a file covered by jest JavaScript tests. For testing I'm in an .emacs buffer, and I'm trying to highlight a single line in another buffer that I have opened in a different window.

I was looking at this question, which uses hlt-highlight-region from library Highlight, but I'm not able to make this work.

I have code like this that should change the single line's background to green:

  (let* ((dir "/home/kuba/projects/jcubic/terminal/repo")
         (buffer (get-file-buffer (concat dir "/js/jquery.terminal-src.js")))
         (start '((line . 3156) (column . 0)))
         (end '((line . 3156) (column . 18))))
    (with-current-buffer buffer
      (let* ((start-line-pos (line-beginning-position (cdr (assoc 'line start))))
             (start-pos (+ start-line-pos (cdr (assoc 'column start))))
             (end-line-pos (line-beginning-position (cdr (assoc 'line end))))
             (end-pos (+ end-line-pos (cdr (assoc 'column end)))))
        (hlt-highlight-region start-pos end-pos '((t (:background "green")))))))

But the code is returning nil and nothing happens. What's wrong with this code?


texts:
I am using company to auto-complete. It works generally fine, with the exception of the M-(digit) shortcuts, which have no impact at all. I have no idea why.

This is my init code:

(defun company--my-insert-spc() (interactive)(company-abort)(insert-char #10r32))
(defun company--my-insert-dot() (interactive)(company-abort)(insert-char #10r46))
(use-package company
  :config
  (global-company-mode)
  (setq company-minimum-prefix-length 3)
  (setq company-auto-complete t)
  (setq company-show-numbers t)
  :bind
  (("C-<tab>" . company-complete)
   :map company-active-map
   ("ESC" . company-abort)
   ;; prevent company from completing on its own when we type regular characters
   ("SPC" . company--my-insert-spc)
   ("."   . company--my-insert-dot)
   )
  )

This is the result of M-x describe-keymap company-active-map:

company-active-map
------------------

For more information check the manuals.

Keymap that is enabled during an active completion.

key             binding
---             -------

C-d             company-show-doc-buffer
C-g             company-abort
C-h             company-show-doc-buffer
TAB             company-complete-common
RET             company-complete-selection
C-s             company-search-candidates
C-w             company-show-location
ESC             company-abort
SPC             company--my-insert-spc
.               company--my-insert-dot
<down>          company-select-next-or-abort
<down-mouse-1>  ignore
<down-mouse-3>  ignore
<f1>            company-show-doc-buffer
<mouse-1>       company-complete-mouse
<mouse-3>       company-select-mouse
<remap>         Prefix Command
<return>        company-complete-selection
<tab>           company-complete-common
<up>            company-select-previous-or-abort
<up-mouse-1>    ignore
<up-mouse-3>    ignore

<remap> <scroll-down-command>   company-previous-page
<remap> <scroll-up-command>     company-next-page

Indeed, the M-(digit) shortcuts are not there. Neither M-n or M-p. I am relatively new to emacs, and I don't know how to pinpoint the cause of this.

I did try to workaround this problem by explicitly setting again the shortcuts in the use-package :config section:

(dotimes (i 10)
  (define-key company-active-map (read-kbd-macro (format "M-%d" i)) 'company-complete-number))

... but I get a really baffling warning: while: Key sequence M-0 starts with non-prefix key ESC. Why does ESC appear here? I also get this same warning for the M-n and M-p shortcuts:

  (define-key company-active-map (kbd "M-n") 'company-select-next)
  (define-key company-active-map (kbd "M-p") 'company-select-previous)

This warning does appear to give a clue, but I can't figure out to what exactly.

Update

Based on the warning above, I commented out the ESC keybinding to company-abort, and it made M-(digit) work as expected. So now the question is: why does this incompatibility between ESC and M-(digit) happen and how can I use both shortcuts?

Update 2

The helpful comments by @TianxiangXiong and @phils identified the problem: ESC is the prefix char for M, so emacs will be confounded by the keybindings I've given it. This is a pity since I really wanted those shortcuts. However, based on this comment, I was able workaround this and get what I wanted by simply changing ("ESC" . company-abort) to ("<escape>" . company-abort) in the :config. At least in my system (Ubuntu 16.04) this worked.


texts: How to bury *Ibuffer* when switching to another buffer?

texts:
M-x ibuffer
Select a buffer
Kill that buffer

The *Ibuffer* buffer re-appears. How can I get it to behave more like a *Help* buffer, which is buried (dropped to the end of the "recently used" list) when you switch away from it (so it doesn't appear undesirably like this)?

I formerly used electric-buffer-list, which had the desired behavior.


texts:
Problematic Behavior

Special characters appear to split words in flyspell even if the words are in my dictionary:

How can I fix this?

Flyspell Configuration Details

I am using the ispell backend for Flyspell. I have added these words to my ispell-personal-dictionary. Adding words without special characters to my personal dictionary works just fine.


texts:
I have a piece of legacy code in Python that uses inconsistent tabs - 2 spaces in some instances and 4 in others.  I have my defaults set in my .emacs file to use 4 spaces, but in this case emacs finds the inconsistent spacing and uses a tab width of 2.

I'm working to update the file in other ways, and I'd like to set the tab width, in this specific file, to 4.  How can I do this?

Thanks!


texts: Tramp login with 2-factor authentication

texts:
To ssh, the server I am connecting to needs a password followed by an RSA-like key.

It goes:

Password:
Verification code:

I've read Tramp with 2-factor authentication, but it does not solve the problem completely.

I've appended "Verification code" into tramp-password-prompt-regexp.

But what happens when I try to login is that I get an opportunity to put in my password, and then I see:

Tramp: Sending Password
Tramp: Sending Verification code
Tramp: Sending Password
Tramp: Sending Verification code
Tramp: Sending Password
Tramp: Sending Verification code
Tramp: Waiting for prompts from remote shell...failed

Before it eventually fails. I feel like it's treating Verification code and Password as one and the same, and instead of prompting me for a Verification code, it just goes ahead and sends the password.

How do I get tramp to prompt a second time for the verification code? I want it to collect a second read-string from the user or something.


texts:
I open Emacs from the command line to inspect 10+ files, say like this:

emacs *.java

However, all the files are listed in reverse order. This is getting kind of annoying--I'd like to start with the A files, not the Z files. Is there any way to just reverse all the buffers? Or even better, a command-line option that opens the files in reverse order, so that Emacs has them the right way around? (Without explicitly typing in every file.)


texts: Changing faces one at a time, outside customize

texts:
Is there a way to change faces one at a time, outside of customize?

In my custom-file I see a big blob of face customizations that starts with:

(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 ...

So I suppose custom-set-faces is not the right function to use for changing just one face, but I'm not sure what is.

Any suggestions?


texts: (org-babel-load-file (expand-file-name "~/.emacs.d/config.org")) behaves strangely on Windows 7

texts:
In my initialization file the line
(when (file-readable-p "~/.emacs.d/config.org")
 (org-babel-load-file (expand-file-name "~/.emacs.d/config.org")))

give me the error:
*Warning (initialization): An error occurred while loading ‘c:/Users/TR/AppData/Roaming/.emacs.d/init.el’:
File is missing: Cannot open load file, No such file or directory, c:/Users/TR/AppData/Roaming/.emacs.d/config.el*
as i understand instead of the file name i gave to it(config.org) it is looking another file with .el extension(config.el).
How can i solve this issue?


texts: Is it possible to link to a function definition in a source code file, rather than a fixed line number?


texts: projectile minor mode is enabled even though all projectile related is commented in init.el

texts:
I did install projectile from melpa and now want to give it try. So I fiddled together this lines to get projectile mode.

 (use-package projectile
   :config
   (setq projectile-enable-caching t)
   (global-set-key (kbd "C-c p f") 'helm-projectile)
   (projectile-global-mode)
   ) ;; end of use-package

I also did "touch ~/.emacs.d/.projectile". Now when I open init.el I have projectile minor mode. Actually whati expected... But when I do

;;     (use-package projectile
;;       :config
;;       (setq projectile-enable-caching t)
;;       (global-set-key (kbd "C-c p f") 'helm-projectile)
;;       (projectile-global-mode)
;;       ) ;; end of use-package

and start a new emacs instance and open init.el it still has projectile minor mode enabled. Now I wonder why is that? Where may this be configured? There is no other version (other then the installed-by-me elpa version) of projectile installed on my hosting machine.


texts:
How can I sum a set of numbers interspersed with text in the region (not a rectangular region).  For example, if the region contains this text:

Widgets 234
Sprockets 44
Nubbins 12
Fork handles 4
4 Candles

I'm looking for a command that will report 298 somehow (298 = 234 + 44 + 12 + 4 + 4) -- I guess either by echoing that to the message area or inserting it in the buffer.

Ideally it would cope with both integers and floating point numbers.


texts: How to bind a keycode to hyper key in Aquamacs

texts: I am using Aquamacs. I have used Seil to change my caps lock key to emit key code 110. I would like to bind that code to super/hyper/another modifier so that I can create more key combinations. How can I do that?


texts: How do you force the width of a fallback font to be the same as the one of the main font, assuming monospace fonts?

texts:
I use Emacs with monospace fonts, and I would like all the characters to have the same width, which is the purpose of monospace fonts. The issue is that the main font may not support all the characters, and a different font may need to be used as a fallback. So I want the width of the fallback font to be the same as the default font, and this needs to be done automatically. To simplify, consider that the fallback font is always the same, say DejaVu Sans Mono (not including a size, which needs to be selected automatically), but the main font may vary in various invocations of Emacs, e.g. with the -fn option + font (possibly with a size), such as:
emacs -fn "DejaVu Sans Mono"
emacs -fn "Fantasque Sans Mono"
emacs -fn "Fantasque Sans Mono-15"

If I just use
(set-fontset-font t 'unicode (font-spec :name "DejaVu Sans Mono"))

in my .emacs, this fallback font will always have the same width, thus may not match the width of the main font, so this is not OK. What can I do?
Note: I'm not requiring the fontsize to be the same. For two different fonts, the fontsizes of the main font and the fallback font may need to be different to get the same width.


texts: How can I create a link that opens `org-roam-find-file` with a specific filter?

texts:
I would like to be able to insert an org link into my roam files which can be clicked on in order to show a certain subset of available roam files (e.g. all those having the tag "foo").  Is there currently any way to accomplish this?
The use-case would be to be able to create a categorized list of tags in my Index.org file that can be clicked on to bring up all files containing a particular tag.


texts:
I have a problem with emacs downloading packages and would appreciate some pointers on how this could be tracked/solved.

disclaimers first: I'm a complete noob at emacs, so if something looks/sounds stupid, it most likely is, please let me know.

Note that I'm running this behind a proxy set-up at $work.

I'm trying to set-up an emacs install to use ENSIME for Scala development.
On the getting started page they have a sample init.el that is causing me problems:

;; global variables
(setq
 inhibit-startup-screen t
 create-lockfiles nil
 make-backup-files nil
 column-number-mode t
 scroll-error-top-bottom t
 show-paren-delay 0.5
 use-package-always-ensure t
 sentence-end-double-space nil)

;; buffer local variables
(setq-default
 indent-tabs-mode nil
 tab-width 4
 c-basic-offset 4)

;; modes
(electric-indent-mode 0)

;; global keybindings
(global-unset-key (kbd "C-z"))

;; the package manager
(require 'package)
(setq
 package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
                    ("org" . "http://orgmode.org/elpa/")
                    ("melpa" . "http://melpa.org/packages/")
                    ("melpa-stable" . "http://stable.melpa.org/packages/"))
 package-archive-priorities '(("melpa-stable" . 1)))

(package-initialize)
(when (not package-archive-contents)
  (package-refresh-contents)
  (package-install 'use-package))
(require 'use-package)

(use-package ensime
  :ensure t
  :pin melpa-stable)

When running emacs --debug-init I get the following error:

Debugger entered--Lisp error: (error "Package `use-package-' is unavailable")
signal(error ("Package `use-package-' is unavailable"))
error("Package `%s-%s' is unavailable" use-package "")
package-compute-transaction(nil ((use-package)))
package-install(use-package)
(progn (package-refresh-contents) (package-install (quote use-package)))
(if (not package-archive-contents) (progn (package-refresh-contents) (package-install ($
eval-buffer(#<buffer  *load*> nil "/home/ubuntu/.emacs.d/init.el" nil t)  ; Reading at $
load-with-code-conversion("/home/ubuntu/.emacs.d/init.el" "/home/ubuntu/.emacs.d/init.e$
load("/home/ubuntu/.emacs.d/init" t t)
#[0 "^H\205\262^@ \306=\203^Q^@\307^H\310Q\202;^@ \311=\204^^^@\307^H\312Q\202;^@\313\3$
command-line()
normal-top-level()

What I understand from this error is that use-package is not available/installed. Which is weird.

If I do: M-x package-refresh-contents I get this:

Loading 00debian-vars...done
Importing package-keyring.gpg...done
Using a proxy for http...
Contacting host: elpa.gnu.org:80 [2 times]
Failed to download `gnu' archive.
Contacting host: orgmode.org:80 [2 times]
Failed to download `org' archive.
Contacting host: melpa.org:80 [2 times]
Failed to download `melpa' archive.
Contacting host: stable.melpa.org:80 [2 times]
Failed to download `melpa-stable' archive.
For information about GNU Emacs and the GNU system, type C-h C-a.

So it seems that emacs understands that it is behind a proxy, but for some reason it fails the download.

How would I go about finding out the root cause of this and fixing it?


texts: Is there a package that show the value of constant variables? C/C++

texts: I would like some package that show the variable value when I put cursor on it. The behavior that I expect can be seen in the image below. The image below is in vscode, I would like some package that do the same.


texts: How to replace the highlighted word in yasnippet?

texts:
After the snippet gets expanded the cursor is put to the first section (long_name).

What key do I need to press in order to replace long_name?

Evil operations like e.g. cw or ce change long or to the line end, while I only want to replace long_name


texts: A non-intrusive way to modify one attribute of the link defined in a function

texts:
The following code from org-ref defines a citation link:

(defun org-ref-define-citation-link (type &optional key)
  "Add a citation link of TYPE for `org-ref'.
With optional KEY, set the reftex binding.  For example:
\(org-ref-define-citation-link \"citez\" ?z) will create a new
citez link, with reftex key of z, and the completion function."
  (interactive "sCitation Type: \ncKey: ")

  ;; create the formatting function
  (eval `(org-ref-make-format-function ,type))

  (eval
   `(if (fboundp 'org-link-set-parameters)
    (org-link-set-parameters
     ,type
     :follow (lambda (_path) (funcall org-ref-cite-onclick-function nil))
     :export (quote ,(intern (format "org-ref-format-%s" type)))
     :complete (quote ,(intern (format "org-%s-complete-link" type)))
     :help-echo (lambda (window object position)
              (when org-ref-show-citation-on-enter
            (save-excursion
              (goto-char position)
              ;; Here we wrap the citation string to a reasonable size.
              (let ((s (org-ref-format-entry
                    (org-ref-get-bibtex-key-under-cursor))))
                (with-temp-buffer
                  (insert s)
                  (fill-paragraph)
                  (buffer-string))))))
     :face 'org-ref-cite-face
     :display 'full
     :keymap org-ref-cite-keymap)
      (org-add-link-type
       ,type
       (lambda (_path) (funcall org-ref-cite-onclick-function nil))
       (quote ,(intern (format "org-ref-format-%s" type))))))

Is there a non-intrusive way to modify only the :export part?


texts: How to condition-case Lisp nesting exceeds `max-lisp-eval-depth'?

texts:
I'd like to catch too big recursive call nesting in elisp, like this:

(condition-case nil
    (potentially-too-recursive-function)
  (xxx (message "Gave up, using defaults")))

What is the symbol in place of xxx to catch too deep recursion?


texts: elisp widgets: Modifying an editable-field's value real time when changing another one

texts:
This is  cross-post from Stack Overflow

I have a simple widget setup:

(setq gobgen-widget-name
      (widget-create 'editable-field
                     :size 25
                     :format "Name:   %v"
                     :notify (lambda (widget &rest ignore)
                               (widget-value-set gobgen-widget-prefix (get-gobject-prefix (widget-value widget))))
                     "g_example_object"))

(widget-insert " ")

(setq gobgen-widget-prefix
      (widget-create 'editable-field
                     :size 10
                     :format "Prefix: %v\n"
                     "g"))

I’d like to update the second widget real time with the return value of get-gobject-prefix.

However, whenever I enter a character in the Name widget, point automatically jumps to the last character of the Prefix field, and inserts my character there.

Is there a way to do what I’m trying to achieve?

(I’m using Emacs 24.3.1)


texts: Issue building Emacs's docs with texi2dvi - '-recorder' and '\openout' not supported

texts:
I'm trying to build the latest version of Emacs from source, but I seem to be running into an issue. The binary itself works fine, but when it comes to building the docs, the make process runs into this issue:

make -C doc/lispref pdf
make[1]: Entering directory '/home/drbluefall/.cache/pikaur/build/emacs-lucid-git/src/emacs/doc/lispref'
  GEN      elisp.pdf
/usr/bin/texi2dvi: TeX neither supports -recorder nor outputs \openout lines in its log file
make[1]: *** [Makefile:161: elisp.pdf] Error 1
make[1]: Leaving directory '/home/drbluefall/.cache/pikaur/build/emacs-lucid-git/src/emacs/doc/lispref'
make: *** [Makefile:976: lispref-pdf] Error 2

I'm not entirely sure what's up here, since I have the needed dependencies, according to Emacs's PKGBUILD.


texts:
Is there some way to find out, what in Emacs is causing spurious cpu usage?

Since a few days I notice Emacs retaining high CPU usage despite not being used actively, having no subprocesses, and not being in blocking state. M-: (all-threads) is empty, except for (current-thread). I also wasn't able to reproduce the issue across sessions.

I am using Emacs on Windows 10, so many unix tools will not be applicable.


texts: Swap two statement on adjacent lines in C when one statement takes multiple lines

texts:
Assume that I have the following code:

int x;
string s = "some very long "
           " string";

I would like to have one command that swaps the order of these without ending up with something like:

string s = "some very long"
int x;
           "string";

Is there an easy way to do it?


texts: Is there a way to use google api fonts in Emacs directly?

texts:
It is a long journey to switch and change fonts in Emacs: download a package of fonts, unpack it, install those fonts in my computer, use commands to find the names of the fonts, and then write functions to switch my Emacs to one of them.

I wonder if there is a way to use a font in googleapi to automatic show fonts in Emacs when I specify the name and/or some options.

If there may be a way to do this, would you mind give me some suggestions about how to do this?


texts: How can I see what Major and Minor modes I'm currently in?

texts: Is there an easy way to see what modes are currently operating in a buffer? And have a list of their names?


texts: Exclude magit autosaves from git log --all?

texts:
I like the idea of (magit-wip-after-save-mode) but it makes git log --all (or la in Magit) very cluttered. Is there a simple way to exclude autosaves from all the autosave "branches"?

On the command-line, I can $ git log --all --not 'refs/wip/wtree/refs/heads/master' but that just excludes the autosaves that happened on the master branch, not autosaves on other branches (and replacing master with * doesn't dwim – I'd rather not have to specify all feature branches explicitly :-/).


texts: How does emacsclient determine what XDG_RUNTIME_DIRS is supposed to be?

texts:
When I run emacsclient I get this error:
$ emacsclient .
emacsclient: Should XDG_RUNTIME_DIR='/run/user/10030' be in the environment?
emacsclient: (Be careful: XDG_RUNTIME_DIR is security-related.)
emacsclient: can't find socket; have you started the server?
emacsclient: To start the server in Emacs, type "M-x server-start".
emacsclient: No socket or alternate editor.  Please use:

    --socket-name
    --server-file      (or environment variable EMACS_SERVER_FILE)
    --alternate-editor (or environment variable ALTERNATE_EDITOR)

Sure enough setting XDG_RUNTIME_DIR='/run/user/10030' and running again fixes the problem but I would like to automate this. I could try running once and parsing this error message but that doesn't seem like the right way to do it. How is emacsclient figuring it out?


texts: How can the list of projects used by Projectile be manually updated?

texts:
I use the command locate --regex '/.git$' | grep username to get a list of all the Git repositories under my $HOME folder.

Is there a way to load them all into Projectile, to make them all instantly available?


texts:
I have been trying to configure emacs to use JetBrains Mono font, unfortunately i can hardly understand the way emacs handles font settings, there are way too many options and stuffs going on. So i got lost and here is my current font settings -
(set-face-attribute 'default nil
                    :family "JetBrains Mono"
                    :height 110
                    :weight 'light)
(set-face-attribute 'variable-pitch nil
                    :family "JetBrains Mono"
                    :height 1.0)
(set-face-attribute 'fixed-pitch nil
                    :family "JetBrains Mono"
                    :height 1.0)

But this seems not as per recommended settings from the jetbrains's site -
Size: 13
Line spacing: 1.2

I don't know to relate :height with Size: 13, couldn't figure that out. I also failed to match the line spacing 1.2. If i use (setq line-spacing 1.2) emacs renders lines way too separated vertically.
I am using emacs 27.1 with harfbuzz.
So if anyone has been using this font with emacs, please share your configuration or point me to some place where i can get/understand how to configure and match the recommended settings.
Thanks in advance.


texts: How to specify allowed column values in orgmode tables?

texts:
I have a table in org-mode:
  | Task                        | Status      | Note |
  |-----------------------------+-------------+------|
  | Prepare environment         | Done        |      |
  | Write a hello world example | In Progress |      |
  | Package it                  | TODO        |      |

Is there any way to force Status Column to limit on [Done, In Progress, TODO] values?


texts: Switch to the most recently selected buffer in the current window

texts:
I am looking for a command that would switch to the buffer I most recently selected in the current window. The command mode-line-other-buffer will switch to the most recently selected buffer not displayed in any window, regardless of whether it was selected in the current window or in some other window.
For illustration, suppose I have two open windows, 1 and 2, and four open buffers, A, B, C, D. Buffer A is displayed in window 1, and buffer C is displayed in window 2. Now suppose that,

with point on A,
I first switch to B, then
select window 2, then
switch to D, and finally
select window 1.

At that point, the command mode-line-other-buffer, if invoked, will switch to C. I would like an alternative command that, if invoked, would switch to A instead. Moreover, repeated invocations of this alternative command should toggle between B and A (just like repeated invocations of mode-line-other-buffer toggle between B and C), since either of these buffers becomes the most recently selected buffer when the other buffer is selected.


texts: Implicitly excluding certain directories in mu4e queries

texts:
Is there an option to exclude certain directories from a mu4e search
without stating this explicitly in the search string?  For example,
could I have

date:today

exclude /archive so long as the option is active?
I know about the possiblility of putting a .noindex in the directory
to be excluded, but I would like to be able to search it too, without doing a whole chore.


texts: How do I read and parse other Lisps in Emacs

texts:
I am playing with LFE language and I try to improve documentation lookup. Some of my efforts can be seen on my Github repo

I have a function sexp-at-point which return a string enclosed by round brackets. That function is used by helpme function, which reads the string converting it to an Elisp list. That in turn, is processed to look up the documentation. The problem is that read sometimes fails on valid LFE syntax. so far I found it fails on vectors

 #(1 2 3)

Is there a better way to parse usually short strings into lists. In LFE number of arguments is important and I try to make documentation lookup reflect arity as well. Also, an LFE function can have different forms.

(model:function arg1) (: model function arg1) (function arg1)

So using something similar to read is the best option in my humble opinion. Please correct me if I am wrong. If you agree with my approach please suggest how I could improve it. Is there a parsing library that I could use?


texts:
These statements lets you set foreground and background colours in a straight forward syntax:

(set-face-foreground 'font-lock-constant-face      "brightwhite")
(set-face-background 'font-lock-constant-face      "cyan")
...

When using custom-set-faces, statements are automatically made like below, in a somewhat more complex form. If I want to re-create the same faces, without relying on custom-set-faces, but using simple statements like above, how can I do this for for example these statements?

(custom-set-faces
 '(dired-directory ((t (:inherit (font-lock-function-name-face default) :foreground "cyan"))))
 '(header-line ((t (:inherit mode-line :inverse-video nil))))
  ...


texts: Read string at current cursor position instead of in minibuffer

texts:
I am trying to simplify user input of Pod formatting sequences in cperl-mode. For example, if you type C<hello>, C<> is a Pod formatting sequence for entering code, similar to the use of backticks in Markdown.

The idea is that the user should only have to type C< and then Emacs will ask for the code text and add the ending > followed by as space automatically. Here is an example; for simplicity I have not added the function to cperl-mode-hook yet, so you can test this by doing emacs -Q -l init.el, where init.el is:

(defun my-perl-pod-format-start ()
  "Simplify entering of Pod formatting sequences."
  (interactive)
  (let ((char (preceding-char)))
    (insert "<")
    (when (or
           (char-equal char ?C)
           (char-equal char ?I)
           (char-equal char ?B))
      (insert (read-string "Pod formatting code: "))
      (insert "> "))))

(global-set-key (kbd "<") #'my-perl-pod-format-start))

This seems to work fine, but there is at least one drawback: the flow of writing is interrupted, since as soon as the user type the < the focus is moved to the minibuffer. So I wondered, is it possible to do this input (similar to read-string) at the current cursor position (for example like in auto-complete-mode) instead of in the minibuffer?


texts: Retrieving a view of org-mode tasks completed within a range and that have a non-nil property

texts: How can I retrieve, over an elisp list of files list-of-files, a view of all org-mode headers that (i) were CLOSED in between start and end such that (ii) these headers have a property P defined (that isn't nil)?


texts: emacs opens ESS/R buffer in random window

texts:
I'm using emacs 26.1 with ESS. Whenever I open a R session with M-x R it opens in a random window. However, I would like it to open in the currently selected window.

It seems to be a similar issue as here emacs opens shells in a random window, how to change this? but the provided solution does not work for me.


texts: What is the org-mode equivalent of \gls{keyword} in LaTeX?

texts:
Is there an org-mode equivalent of the LaTeX glossary package?
Use case - you have an external file with a glossary list, the \gls{keyword} gets expanded at compile time to whatever is referenced in the external file.


texts:
I used the package installer to install sr-speedbar, so I can have the speedbar and editor in a single frame. When I try M-x sr-speedbar-open, it opens a second window (with same file), beeps and says Wrong type argument: stringp, nil in the minibuffer.

If I set debug-on-error to t, I see this:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  set-window-buffer(#<window 148 on study.cljs> nil)
  sr-speedbar-open()
  sr-speedbar-toggle()
  funcall-interactively(sr-speedbar-toggle)
  call-interactively(sr-speedbar-toggle record nil)
  command-execute(sr-speedbar-toggle record)
  ...

Emacs version: GNU Emacs 26.1, macOS
sr-speedbar version: 20140914.2339

Any ideas?


texts: Read find-grep exclusion patterns from a .findignore file

texts:
I am aware that you can customise the "find" command executed when using "find-grep" with "setq grep-find-command" and define which file-patterns to ignore in the search. I would like to take this further and be able to read the patterns to ignore from a file.

Each framework or tool might generate different files that I would like to be ignored in search. For example, SASS generates ".sass-cache" folder, the Symfony framework stores the "logs" and the "cache" in respectively named folders, while Haskell stack creates a ".stack-work" folder.

Instead of customising the "find-grep" command to exclude all patterns from different frameworks/tools, I would prefer a system where you can add a ".findignore" file in the root folder of the project and "find-grep" should be picking up the exclusions from there.

A couple of questions:

1) Is there such a solution already out there?

2) If not, advice on how to go about the following two requirements would help me get started:

How can I detect the .findignore file upwards up to the root folder of the project (just like .gitignore).
How to load each line and sequence it as an argument to "find-grep"

I haven't done advanced emacs customisations so any hints would be appreciated.


texts:
Does anyone here regularly use Emacs to interact with GPG encrypted files and, if so, what has your experience been?

The Problem: I've been using Emacs (on OS X) to regularly edit a couple of GPG encrypted files; however, in doing so, I've had multiple instances in which the correct password returns "gpg: decryption failed: Bad session key".

Note, that this result is not corrected by using gpgconf to restart the service or reset the password cache. In these instances, it appears also as if the hashes between the files differs as well, though I have not confirmed this to myself without a doubt. The only fix that I've been able to achieve is to restore the file using a backup version; however, this does not seem to be a sustainable solution.

Additionally, I'm always using the same computer, so I'm assuming there's not a conflict in GPG/GPG dependency version (which I believe has been noted to cause the same issue), unless somehow the GPG version differs between that used by Emacs and Homebrew. Note, I use homebrew emacs-plus from https://github.com/d12frosted/homebrew-emacs-plus.

The Question: Is it possible that the Emacs interaction with GPG is corrupting the encryption header? I receive the GPG password prompt from the command line or no other indication of an error from GPG (or Emacs), other than the aforementioned error. Else, what could the cause be?

Let me know what y'all think - thanks!


texts:
When I use Emacs with Evil mode for some time, I sometimes get to a point, where I have no choice to what I want to delete when pressing d (or calling evil-delete). The current line gets deleted without that I have pressed d for the line a second time. Same behavior is shown when pressing c or calling evil-change. Both are acting like having pressed dd or cd instead.
Certainly I have accidentally pressed some keyboard shortcuts to activate this mapping, but I have no clue how to find out what is happening there. At the moment my only chance is to restart Emacs to get back to normal behavior. If I only knew what happens, maybe I would be able to switch back to normal behavior without restarting Emacs.


texts: Why are there multiple ways to test for equality in elisp?

texts:
In Logic there is one and only one unambiguously(*) defined notion of equality: two things are equal if and only if they are the same thing.

Programming languages of course try to emulate this concept but unfortunately the limitations imposed by the finitary nature of computers do not allow for a true notion of equality.  In Lisp (I should actually restrict myself to e-lisp which I have made some effort in learning) there are lots of alternatives to choose from, such as equal, eql, eq, =, string-equal, char-equal and the list does not stop here.

It seems to me that this is a bit of an overkill solution, since it could be replaced by a single notion of equality, which in turn could be combined with the various available predicates, such as type-of, to achieve the effects of the various ideas of equality.  By the way, it would be nice to also have a predicate telling the memory address where a variable resides (which I suppose is behind the idea of eq).

This solution works very nicely in other programming languages such as Pascal, where you can compare x=y (same contents) or @x=@y (same addresses).  It is true that Pascal is a lot more rigid than Lisp regarding variable types, but you can still compare say, integers and reals, with correct answers.

My question it thus, what is the justification for so many notions of equality in e-lisp?

(*) Lastly let me make a small disclaimer regarding my above statement about the nature of equality in Logic: we all know that
rational numbers  are defined as equivalent classes of pairs of integer numbers, so the rational number 1 is not technically equal to the integer number 1.  Thus it could be argued that the difficult dilemma about the meaning of equality is also present
in Logic.


texts: org-babel, org-table and package-install: “Package `dired+-' is unavailable

texts:
I'm currently using org-mode to organize my init files — specifically, working off a fork of emacs24-starter-kit. Recently, I had come across the idea of using org-tables to organize some of my things — I've had great success in configuring package-archive, package-pinned-packages and even pretty-symbols-alist for elisp-mode and lisp-interaction-mode.

I've hit a snag, though, in trying to create a list of packages that must be installed on every instance of emacs I use, on all machines I have emacs installed. The code looks like this on org-mode:

#+NAME:package-settings
| name               | repository   |
|--------------------+--------------|
| dired+             | MELPA        |
| form-feed          | MELPA-stable |
| org-bullets        | MELPA-stable |
| org-plus-contrib   | org          |
| powerline          | MELPA-stable |
| rainbow-delimiters | MELPA-stable |
| yasnippet          | MELPA-stable |
| color-theme        | MELPA        |

#+begin_src emacs-lisp :var name=package-settings[,0] repository=package-settings[,1]
  (when (require 'package nil 'noerror)
    (progn
      (require 'cl)
      (setq package-pinned-packages (pairlis name repository))
      (setq *pkg-to-install
            (let (result)
              (dolist (entry name result)
                (setq result (append result (list (make-symbol entry)))))))
      (dolist (pkg *pkg-to-install)
        (when (not (package-installed-p pkg))
          (package-install pkg)))
      (package-initialize))) ; and reinitialize again
#+end_src

However, when I do this, I get the following error message:

package-compute-transaction: Package `dired+-' is unavailable

Pressing C-x C-e on the affected sexp (i.e. (dolist pkg...) gets me this:

Debugger entered--Lisp error: (error "Package `dired+-' is unavailable")
  signal(error ("Package `dired+-' is unavailable"))
  error("Package `%s-%s' is unavailable" dired+ "")
  package-compute-transaction(nil ((dired+)))
  package-install(dired+)
  (progn (package-install pkg))
  (if (not (package-installed-p pkg)) (progn (package-install pkg)))
  (while --dolist-tail-- (setq pkg (car --dolist-tail--)) (if (not  (package-installed-p pkg)) (progn (package-install pkg))) (setq --dolist-tail-- (cdr --dolist-tail--)))
  (let ((--dolist-tail-- *pkg-to-install) pkg) (while --dolist-tail-- (setq pkg (car --dolist-tail--)) (if (not (package-installed-p pkg)) (progn (package-install pkg))) (setq --dolist-tail-- (cdr --dolist-tail--))))
  eval((let ((--dolist-tail-- *pkg-to-install) pkg) (while --dolist-tail-- (setq pkg (car --dolist-tail--)) (if (not (package-installed-p pkg)) (progn (package-install pkg))) (setq --dolist-tail-- (cdr --dolist-tail--)))) nil)
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)

I honestly don't know what could be wrong here. I managed to finangle the fact that org-babel exports the vars as (let ((name (quote ("dired+" "form-feed" ...)))...)...) by using make-symbol, but I've hit the limit in terms of my (admittedly still rather sketchy at places) understanding of elisp.


texts: I am trying to step through code in emacs and am looking for a plugin which will displa the contents of an element when I hover over it. Is there any plugin like this currently? How do you step through code with emacs?


texts: Bookmarking remote directories (tramp+sudo)

texts:
I have to connect to remote computers through ssh. I'm using tramp (C-x d /sshx:user@myhost|su:myhost:/mydirectory) and I can sudo as root on directories in this machine. As it is very convenient, I would like to bookmark the location.

After giving a name to the bookmark, I can see that my latest bookmark looks like 'my newbookmark    /su:root@myhost:/mydirectory', therefore forgetting the first half of the location. And when I try to comeback to it (after closing emacs for example), I have a message "Host 'myhost' looks like a remote host, 'su' can only use the local host".

How would it be possible to bookmark the whole location?

Many thanks.


texts: Skip the first breakpoint in entry file with Geben

texts: Simple question, how can I run the XDebug debugger with Geben without it stopping execution on the first line of the entry file. What I would like is for the scripts to run normally but only stop on a breakpoint I've defined. Is there a setting for that I've missed? Thanks.


texts: Toggle between end of line and beginning of an inline comment

texts:
I'd like to change the default behaviour of pressing C-e so that, If I have an inline comment, pressing  C-e should first go to the end of line and pressing it again should go to the beginning of the first non-space character in the inline comment like so :-

(insert code here) ;; |inline comment.

How can I achieve this (I know very little elisp to be able to code this :( )? This was inspired by smarter-move-beginning-of-line which toggles between the first non-space character in a line and the beginning of line.


texts: Preventing syntax highlighting in the wrap-prefix

texts:
When Emacs wraps long lines, is there a way to prevent the wrap prefix from having syntax highlighting (font-lock) or any such special properties?

Specifically, I have the following settings:

;; Wrap long lines instead of having them truncated and fall off the screen
(setq truncate-lines nil)
;; Make wrapped lines start at half the available text width
(setq wrap-prefix '(space . (:width (0.5 . text))))

Now, long lines appear like (in org-mode):

Or with visual-line-mode:

(No change with adaptive-wrap-prefix-mode turned on or off.)

Is there a way to have the wrapped line not retain the highlighting (the underline in the images above)?


texts: orgtbl-aggregate: how to handle periods (.) in column header names

texts:
I'm new to org mode and have been using Orgtbl Aggregate for tables.  I import space-separated files as org tables, add an hline to make the first row into a header, name them with #+NAME (aside: is there a better way to name a table than to just write this tag by hand above it?) and then I use org-insert-dblock:aggregate to aggregate data in a new table below.

My header-names have periods in them because they are LaTeX pgfplots-friendly.  I can't use spaces, dashes, or underscores.  The MWE below shows that Aggregate doesn't like the periods, and exhibits unpredictable behaviour when I try escaped quotes.

Can/should aggregate dblock work with the periods (how) or should I simply clean my headers first (this is what I ended up doing)?

#+NAME: mwe-table                                                                 |
| A | b.b | cc  |                                                                 |
|---+-----+-----|                                                                 |
| 1 |   3 |   4 |                                                                 |
| 1 |   4 |   5 |                                                                 |
| 2 |   6 |   7 |                                                                 |
| 2 |   8 |   9 |                                                                 |
#+BEGIN: aggregate :table "mwe-table" :cols "A mean(b.b) mean('b.b') mean(\"b.b\")"
| A | mean(b.b)                 | mean('b.b')                    |   mean("b.b") ||
|---+---------------------------+--------------------------------+---------------||
| 1 | error(7, '"Expected `)'") | error(6, '"Expected a number") | 80.6666666667 ||
| 2 | error(7, '"Expected `)'") | error(6, '"Expected a number") | 80.6666666667 ||
#+END:                                                                            |
#+BEGIN: aggregate :table "mwe-table" :cols "A mean(cc) mean(bb) mean(\'b.b\')"   |
| A | mean(cc) | mean(bb)  | mean('b.b')                    |                     |
|---+----------+-----------+--------------------------------|                     |
| 1 |      4.5 | vmean(bb) | error(6, '"Expected a number") |                     |
| 2 |        8 | vmean(bb) | error(6, '"Expected a number") |                     |
#+END:                                                                            |


texts:
I don't know exactly how abbrev-mode works, but I suppose certain
keys --spaces and stops-- cause an examination of the word before
point, and a replacement of it in some cases.  My question is how one
might hook on to that mechanism, say to encrypt every word typed, at
abbreviation-expansion time.  Methods that do not make use of
abbrev-mode are also welcome, and probably preferable.


texts: Is there a string manipulation difference between Emacs 24 and 25.1?

texts:
I'm test-driving Emacs 25.1 and have noticed that a simple concat command, which used to work in v.24 (and v.23), doesn't work in v.25.1:

(setq yas-snippet-dirs (concat user-emacs-directory "snippets"))

In v.25.1 I get the following error message:

byte-code: Wrong type argument: listp, "~/Dropbox/emacs/snippets"

To make it work in v.25.1, I need to do call the function thus:

(setq yas-snippet-dirs (concat user-emacs-directory '("snippets")))

So my question is, why doesn't the latter work in Emacs 25.1 anymore? (Or alternatively, is the former the correct way actually?)


texts: How go to prev search text in minibuffer?

texts:
Emacs 26.1, Ido , smex,

Open scratch buffer.

C-s to find text file
Here result:

C-g

Now I want to find another text: text

Here result:

Nice. It's work fine.
But now I want to backward in search history.
So I need again to search text (in minibuffer): file

How I can do this?


texts:
I'm running code in development using docker.  I do that using the -v flag to docker run to mount my code in the container.

I've set directory-abbrev-alist and configured compilation-error-regexp-alist-alist appropriately, so I can click on links in stack traces and jump to the corresponding place in the source code (e.g. in bt output from M-x pdb).

However, that doesn't give me gud's debug arrow pointing to the current line of the active stack frame.  For example, when I run the bt command in pdb, I don't see a window open visiting the appropriate file with the arrow in the fringe pointing at the line of the python stack frame I'm currently on.

In the past I've resorted to creating symlinks on the docker host (for example from /opt/someproject to /home/me/dev/someproject).  That fixes the problem.  But these may differ from one container to another.  It's inconvenient to keep these up-to-date, not to mention a bit hacky.

How can I fix this using elisp configuration rather than via symlinks?


texts: forward-sexp goes to eol in python mode (but only sometimes)

texts:
When I run the command forward-sexp at the beginning of the line in Python mode, my cursor jumps to the end of the line.  I assume that the line is a statement, and is therefore considered to be a sexp.  Can I modify this behavior so that forward-sexp only jumps to the end of the symbol?

Steps to Reproduce:

Paste the following lines into a buffer in Python mode

def dummy():
    my_count_variable = 0
    (a, b, c) = (1, 2, 3)
    return my_count_variable

Case 1:

Move the cursor to the m at the beginning of my_count_variable
Call forward-sexp (C-M-f)
Notice that the cursor has jumped to the end of the line
(I would prefer to jump to the end of the symbol here)

Case 2:

Place the cursor at the beginning of the second line, just under the d in def
Call forward-sexp (C-M-f)
Notice that the cursor has moved to the end of my_count_variable
(This seems inconsistent with Case 1)

Case 3:

Place the cursor at the first ( on the third line
Call forward-sexp (C-M-f)
Notice that the cursor jumps to the end of the first tuple instead of the end of the statement.
(Again, why not jump to the end of the expression?)

Is there a way to modify the behavior of forward-sexp so that it does not treat a python "statement" as a balanced expression?  There seems to be some inconsistency which causes the command to work how I want, but only sometimes (i.e. cases 2 and 3).

Note: I am using the built-in python-mode from python.el


texts: Can you setup a snippet with two choices, where the second choice depends on the first choice?

texts:
I am trying to setup a snippet to add a src-block header to an emacs org-mode src-block. I want to get a list of possible headers to choose from, which I can get in this snippet (the org-babel-headers function is defined in a .yas-setup.el and just returns a list of the headers).

# -*- mode: snippet -*-
# contributor: John Kitchin <jkitchin@andrew.cmu.edu>
# name: src-block-header
# key: sh
# expand-env: ((headers (org-babel-headers)))
# --
:${1:$$(yas-choose-value headers)} $0

I would also like a second field, right after this, that offers choices that are based on the first choice (i.e. I know the legitimate values each header can take, and I want to offer those as choices).

Is this doable in some way?


texts: How to prevent tramp from blocking when entering password?

texts:
For my speech recognition mode I have emacs listen asynchronously using make-network-process for messages sent by my python client. If I say anything that should translate to emacs taking an action the python client send an elisp snippet to execute. To prevent bad code snippets from causing emacs to go unresponsive I wrap the code in a with-timeout as a failsafe.

The problem is if I use TRAMP to try to open say C-x C-f /sudo::/tmp/foo, emacs completely blocks on waiting for me to enter my password. Any packets sent by the client are ignored -- emacs isn't pulling any data off the socket. This means that if I'm only using my voice with-timeout always fires, and even if I'm typing that day I need to type really quickly. This is weird because 99% of the time minibuffer prompts don't do this -- usually the rest of emacs keeps running.

Is there a way to have tramp mode not completely block? Maybe a custom command prompting for the password that sticks it in tramp's password cache so that tramp's command to ask doesn't fire?


texts: Org mode: How can I add a section-name only frame to beamer slides?

texts:
I currently have:

#+options: H:2

and...

* Introduction
** Some definition
    + list item1
    + list item2

So I get Introduction section in the Outline, and a frame for Some definitionand those two list items in it. In addition, I want a frame containing just Introduction title, is that possible? Thanks in advance.


texts: Markdown Mode: Is there a way to display changes on-the-fly?

texts:
I found two ways to display preview of the markdown files in markdown mode. One is C-c C-c p which requires a parser (currently I use pandoc) to preview using browser. The other is  C-c C-c l which display preview using eww in emacs buffer. However, none of them display changes in a "real-time" way.

For the first one, I have to strike C-c C-c p every time after edited. It will open a new time in my browser each time which is very annoying.

If I use  C-c C-c l I can use  C-c C-c e or simply save file to update changes but still not convenient.

More over, I found some subtle differences between these two commands' outputs. Which one is the real one?


texts: Org-mode: Get src block result inside block definition for clocktable

texts:
I'm trying to create a clocktable that starts recording working time at the date of the last commit. So far I've got a src block and I'm satisfied with the resulting date, I'd like to include this date as the :tstart argument by calling the function.

#+NAME: commit_date
#+BEGIN_SRC emacs-lisp :exports none :tangle no
  (shell-command-to-string "git log -1 --format=%cd --date=format:\"<%Y-%m-%d %a %H:%M>\"")
#+END_SRC

#+RESULTS: commit_date
: <2018-02-09 ven. 10:11>

#+BEGIN: clocktable :maxlevel 3 :tstart (call_commit_date()) :narrow 90 :compact

#+END:

When I try to update the clocktable I get "Format specifier doesn't match argument type"

What am I doing wrong?


texts: Ask for saving contents if scratch buffer is modified before exit

texts:
I had made some random notes in my scratch buffer.
By mistake, I pressed C-x C-c and killed the Emacs session.
All my content in the scratch buffer was gone.

Question:

When I try to close Emacs when the scratch buffer had been edited, I want Emacs to ask for a confirmation (offer to save or something) before it exits the current session.  How can this be done? I'm not conversant with eLisp.

I searched the manual and there seems to be no way to change this behaviour.

Not duplicate:

My question is not duplicate to the question "never close scratch" in that, the other user is referring to killing the scratch buffer intentionally using kill-buffer C-x C-k.  In my case, I unexpectedly exit out of Emacs either by closing the window or giving C-x C-c command.


texts: Org mode To Do's: completed tasks statistics cookie for items more than one level down

texts:
I am working on a project with several steps, each of which has sub-steps; each sub-step has sub-steps as well. The steps and sub-steps are headings; the sub-sub-steps are To Do items. I would like to have the steps' statistics cookie reflect whether the sub-steps are completed. It remains at 0/0, even if the sub-steps show the level of completion of the To-Do items in the sub-sub-steps. Minimal working example, below.

I suspect the key can be found somewhere in the documentation on sub-tasks, but I haven't been able to make this work yet.

Thank you for helping out! This is my first StackExchange question.

** Step 2 EDA (SQL) [0/0]
*** Number of rides 15-16 Nov [3/3]
- [X] Find number of rides for each company 15 - 16 November
- [X] Name the resulting field trips_amount and print it along with the
  company_name field.
- [X] Sort the results by the trips_amount field in descending order.
*** Yellow and Blue cabs [0/3]
- [ ] Find the number of rides for every taxi company whose name contains the
  words "Yellow" or "Blue" for November 1-7, 2017.
- [ ] Name the resulting variable trips_amount.
- [ ] Group the results by the company_name field.


texts: How to add new markup to org-mode HTML export?

texts:
I would like to add a markup to org-mode, to simplify adding <audio> HTML tags. Like other inline markup:

In Thai, /sabai dee mai/ is pronounced as [audio:assets/sabai.mp3]

Which would export as:

In Thai, sabai dee mai is pronounced as <audio src="assets/sabai.mp3"></audio>

I looked at org.el and ox-html.el to perhaps just copy how bold and such inline markup works, but I don't see how the pieces fit together.


texts: org-mode: Duplicate tag groups when filtering agenda

texts:
When filtering org-agenda by tags using org-agenda-filter-by-tag, tag groups specified in org-tag-alist show up multiple times.

org-agenda-filter-by-tag uses the variable org-tag-alist-for-agenda, which is set dynamically based on all available tags in all org buffers (I think). According to org--tag-add-to-alist, which is used to set org-tag-alist-for-agenda, duplicate tag groups are not removed, by design. However, this causes groups I have defined in org-tag-alist to show up as many times as I have org buffers.

Are there any (known) easy ways around this issue, to avoid a very long list of tags when filtering the agenda?


texts: Which class or method or function am I in?

texts:
When navigating a source file with incremental search, I often find myself jumping into some context that is taller than the window.  This raises the question: "Which class am I in?".  Or, if the previous developer is prone to writing tall methods: "Which class and method am I in?"

I currently answer these questions by interrupting my search to start a new regex search in the reverse direction, then cancel this search with C g, then do whatever (usually resume the search).  But, this happens to me so often, I feel like I should have a single command to just print the class/method context in the minibuffer.  Or, even better, if that context was always visible.  (I would give up a line of window for that.)

Is there some Emacs gadget that already scratches this itch?  Or, am I just going about this in completely the wrong way?  If it matters, I happen to be working in Python and Java.


texts: Names of all the keymaps for multilanguage remapping purposes

texts:
How do I extract the names for all of the keymaps in Emacs?

I use English layout for programming.   However I sometimes have to use a Hungarian layout, and I want preserve my keybindings in a physical form, not a symbolic one.  I find quail rather uncomfortable, because it is impossible to make a perfect transition: there are more characters in the Hungarian layout than the English one.

Instead of converting the OS configured English layout characters to Hungarian inside Emacs, I want to translate all of the keymaps to the physical layout of a Hungarian keyboard.

Hopefully, I can write an elisp script for that.  However, what I do not know is: how do I extract all of the global, minor, and major mode keymaps from Emacs?


texts: where does org-mode get the \author field for latex output

texts:
My exported pdf and and .tex file both include a name inherited from the logged-in unix account, I am having trouble over-riding this setting with #+LATEX_HEADER: \author {}  in the .org file.

Watch for Tom Smith vs. Joe Brown in this code.
The question is, where does org-mode derive the Tom Smith from?
my .bib file includes the lines at the top, I don't see any setting to explain this.

% This BibTeX bibliography file was created using BibDesk.
% Created for Tom Smith at YYYY day t
% Saved with string encoding Unicode (UTF-8)

my .org file says

#+LATEX_HEADER:\author{Joe Brown}

When I look in the exported .tex it has 2 lines

\author{Joe Brown}
\author{Tom Smith}

the compiled pdf features Tom Smith
Where does org-mode get the \author field from if it's not declared in

#+LATEX_HEADER:\author{} ?

Is it coming from ~/.emacs.d/.init.d ?
Neither Tom Smith nor author are anywhere in my .spacemacs.


texts: How can I run a subprocess with emacs --script

texts:
I'm trying to write a script using emacs --script and in it I am using start-process, because I want to use set-process-filter.
The following does nothing if run as a script:
#!/usr/bin/env -S emacs -Q --script # -*- mode: emacs-lisp; lexical-binding: t; -*-
 (let ((p (start-process "subcommand" nil "notify-send" "Hello!")))
   (set-process-sentinel p (lambda (process signal)
                             (start-process "notify" nil "notify-send" "Hello again!")))
   (set-process-filter p (lambda (process output)
                           (message output)))
   ;; (while t)
   )

However, if I run that same elisp in my gui emacs I get to notifications (one for hello and one for hello again). I tried to solve this using a no-op loop (commented out), but that only allowed the first hello to be sent out. Basically, I want emacs to wait for it's subprocess to finish before exiting.
I'm not sure where to go from here. Any ideas on how I can get something like this working?


texts: How do you change the default username in message-mode?

texts:
I've been using notmuch, via smtpmail.el and getmail to manage my emails on Emacs, and it all works, although I'm annoyed at how I need to change the name beside my <email@address> (defined by user-mail-address) on the From: header.
I've changed user-full-name in my settings.el, following the examples here:
https://www.emacswiki.org/emacs/SendingMail
https://www.gnu.org/software/emacs/manual/html_node/efaq-w32/Outgoing-mail.html
But whenever I go write a new messsage or reply to one, From: still shows my debian username.


texts:
has someone come across the same issue maybe:

org-drill is a great package for spacemacs and works quite well out of the box for one- and twosided cards as well as clozes.

However, I can for the life of me not figure out how to use org-drill with verbs. the example file spanish.org (see here) does provide a :DRILL_CARD_TYPE: spanish_verb and according to org-drill.el I would expect that running M-x org-drill drills verbs too.

However, on my spacemacs installation (develop branch 0.300.x) org-drill will not run these verbs.

Has somebody come across the same issue and found a possible solution? Could this be a bug?


texts: embark-collect-* showing wrong number of arguements from Selectrum

texts:
I've been trying to get Selectrum, Embark and other packages working together as a completion framework, but am running into a problem with embark-collect-snapshot (and embark-collect-live).
In the minibuffer, using selectrum, when I run the command embark-collect-snapshot I get the error
Wrong number of arguments: (2 . 2), 10

I've tinkered a bit but don't really know how to solve, or diagnose, the problem.
To recreate the issue you can follow the following steps:

Create new .emacs.d directory with the following init.el file:

(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/"))
(when (< emacs-major-version 27)
  (package-initialize))

;; Bootstrap 'use-package'
(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))
(eval-when-compile
  (require 'use-package))

(use-package selectrum
  :ensure t
  :demand t
  :config
  (selectrum-mode t))

(use-package embark
  :ensure t
  :demand t
  :bind (("C-," . embark-act)
         :map selectrum-minibuffer-map
         ("C-," . embark-act)
         ("C->" . embark-become)))

Open emacs
Evoke a function that opens up a Selectrum completion list (for example C-x b)
Run embark-act with C-,
Choose embark-collect-snapshot with S

Other info:
GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.14) of 2020-03-06, modified by Debian

Distributor ID: Ubuntu
Description:    Ubuntu 20.10
Release:    20.10
Codename:   groovy


texts: Update cc-style to use a mix of tabs and spaces, depending on context?

texts:
I'm looking for a way to mix tabs and spaces in my cc-styles.

Whilst I question the sanity of this coding style, and wouldn't ever choose to use it had I the choice (seems other people share my view), in this instance I don't have a choice.

My company has the following coding style wrt tabs and spaces:

Indentation should be made using tabs
Alignment should be made using spaces

As an example, with -> denoting a tab, the following are valid snippets:

tabs for indentation, spaces for vertical alignment of variable names and initialisation:

struct Foo
{
-> int    bar  = 0;
-> char   baz  = 'c';
-> double fizz = .1;
};

tabs for indentation, spaces for vertical alignment of function parameters:

void some_function(int foo,
                   double bar,
                   char baz)
{
-> if (foo == 0)
-> {
-> -> bar *= 2;
-> }
-> ...
}

tabs for indentation, spaces for vertical alignment of logical statements:

void some_function(int foo,
                   double bar,
                   char fizzbuzz)
{
-> if (foo      == 0 &&
->     fizzbuzz == 'a') // note 1 leading tab for indentation level, then spaces
-> {
-> -> bar *= 2;
-> }
-> ...
}

I use the align package by John Wiegley in order to affect the vertical alignment of variables in the example above.

What do I need to have in my cc-styles in order to conform to my company's coding standards?


texts:
I want to use sql-sqlite on a remote database file via TRAMP. According to this website it should be possible, but I cannot get it to work.

I visit the remote directory with Dired and then invoke sql-sqlite:

C-x d /user@host:/directory
M-x sql-sqlite /scp:user@host:/directory/test.db

As expected, this opens an *SQL* buffer with an sqlite prompt. Entering any SQL statements or SQLite commands, however, results in this:

Error: unable to open database "/scp:user@host:/directory/test.db": unable to open database file

Process SQL exited abnormally with code 1

I am using Emacs 25.1 with emacs -Q (the other two versions I have access to, 24.3 and 24.5, behave identically).


texts: How show multiple cursors in the start of all lines?

texts:
Emacs 26.3

Suppose I has the  next text:

ACTION
ADVENTURE
COMEDY
CRIME
DRAMA
FANTASY
HISTORICAL
HISTORICAL
HORROR
MAGICAL
MYSTERY
PARANOID
PHILOSOPHICAL
POLITICAL
ROMANCE
SAGA
SATIRE
SCIENCE
SOCIAL
SPECULATIVE
THRILLER
URBAN
WESTERN

And I want by Multiple cursors https://github.com/magnars/multiple-cursors.el

add mulitple cursors in the start of all lines. I don't know count of all lines.

The result must be like this:


texts:
Why does (keyboard-quit) (bound to C-g) unmark the selected region? And is there a way to stop Emacs from doing so?

The sceneraio I have in mind is the following: suppose I select a region and begin a C-c C- command, but I change my mind and want to cancel. If I call (keyboard-quit), I also lose the selection.


texts:
I'm trying to render the output of a markdown file using C-c C-c p. On doing so, a webpage opens on my browser displaying pandoc: getCurrentDirectory:getWorkingDirectory: permission denied (Operation not permitted)

How do I preview the file and prevent this error?


texts: What are the steps to set up elpy to use the anaconda python distribution on Windows?

texts:
I have anaconda installed on Windows (Windows 7), and it is working well in Jupyter. But of course I'd prefer to work in emacs.

I have elpy installed in emacs, and it successfully sends commands to the correct python. However, the python environment is not set up correctly, and I am unable to import numpy.

What could cause this issue? Below is the configuration I currently have in my .emacs:

(use-package elpy
  :config
  (setq python-shell-virtualenv-path
        "C:/Users/<username>/AppData/Local/Continuum/anaconda3/envs"
        python-shell-interpreter
        "C:/Users/<username>/AppData/Local/Continuum/anaconda3/python.exe"
        elpy-rpc-python-command
        "C:/Users/<username>/AppData/Local/Continuum/anaconda3/python.exe")
  (setenv "PATH" (concat "C:\\Users\\<username>\\AppData\\Local\\Continuum\\anaconda3;\
C:\\Users\\<username>\\AppData\\Local\\Continuum\\anaconda3\\Library\\mingw-w64\\bin;\
C:\\Users\\<username>\\AppData\\Local\\Continuum\\anaconda3\\Scripts;\
C:\\Users\\<username>\\AppData\\Local\\Continuum\\anaconda3\\condabin;"
                         (getenv "PATH")))
  (setenv "PYTHONPATH" "C:\\Users\\<username>\\AppData\\Local\\Continuum\\anaconda3;\
C:\\Users\\<username>\\AppData\\Local\\Continuum\\anaconda3\\Library\\mingw-w64\\bin;\
C:\\Users\\<username>\\AppData\\Local\\Continuum\\anaconda3\\Scripts;\
C:\\Users\\<username>\\AppData\\Local\\Continuum\\anaconda3\\condabin;"))


texts:
Hi everybody roamy :),
I am attempting to combine org-protocol with org-roam.
My chrome bookmark contains: javascript:location.href = 'org-protocol://roam-ref?template=p&ref=' + encodeURIComponent(location.href) + '&title=' + encodeURIComponent(document.title).
Does anybody has a nice template where I could include the selected text too?
Also, I would like the frame to pop up or at least be brought to the front (at the moment, the creation of the capturing happens in the background, so I have to move to Emacs to finish the capture).
Thanks so much for you input!


texts: message of "Log rev,s (tags/8000.123^0):" in magit

texts: I am using magit in spacemacs 105.7. When I press l l from the magit-status buffer to list the commit history, it pops out "Log rev,s (tags/8000.123^0):" in the mini buffer, and when I press enter, then it will list all the commits. Why does this message pop up?


texts: Is there a nice way to write pseudocode?

texts:
I'd like to sketch out some pseudocode and then share it with other people that won't be using emacs.

Is there a nice way to do this? I'm trying to do it in org-mode, but it's not indenting properly, etc...


texts: Troubleshooting "Match data clobbered by buffer modification hooks"

texts:
When running bibtex-reformat I get Match data clobbered by buffer modification hooks. I know according to the post here that one of my change hooks is clobbering the match data. In fact, when I set inhibit-modification-hooks to t, I don't get the error anymore.

I am trying to figure out the culprit for this error. I tried removing all the hooks from after-change-functions, before-change-functions and first-change-hook and set back inhibit-modification-hooks to nil, but then the error comes back. Evidently, there's a change hook that is running which I don't know.

Is there another way of hunting down the culprit? Or somewhere else I should be looking?


texts:
I would like to "augment" the org-refile function in such a way that, once I moved the heading from the source to the destination, a link to this last file is created and inserted in the source, in place of the pre-existing heading.
The source will generally be a TODO item, but in case of a tree, the title of the link should be the top-level heading of course.

I'm new to elisp and don't know much about emacs customization either, so any hint or help towards a solution would be greatly appreciated.
(I'll also try to find my way as soon as I get a minute to work on it, of course).


texts:
How do I autoload the "amsmath" style hook with all my .tex files?
Currently, it is triggered only when I add \usepackage{amsmath} to my .tex file; there are other packages and classes that autoload amsmath and Auctex does not seem to recognise that out of the box.


texts: How do I compose an email using Emacs' keybindings?

texts:
I'm a little nervous that this question is extremely naïve, but I have been continually (every 10 days or so) seeking its answer for months now.
I want to compose emails, preferably to be sent from my Gmail account, using all of the keybindings in Emacs. I do not care about being able to send an email from within Emacs (although I'm not opposed to it) –- I would be happy to be able to write a properly formatted message in Emacs and then copy and paste it into the relevant field of one of Gmail's "New Message" windows. My problem is that, with respect to typesetting, I do not know how to properly format a message for Gmail.
The reason I want to learn how to do this is simple: when I am composing an email, I am editing text, and when I am editing text, Emacs provides my desired macros and keybindings.


texts: Difference between [mouse-1] and [down-mouse-1]

texts:
I noticed two keys: [mouse-1] and [down-mouse-1].
When I use describe-key with a single click, it shows:
There were several key-sequences:

  <down-mouse-1> at that spot runs the command evil-mouse-drag-region
  <mouse-1> at that spot runs the command mouse-set-point

If I want to bind a function to a single click event, which key is better?
Besides, when clicking the mouse, how to only trigger a single key sequence, either <down-mouse-1> or <mouse-1> but not both?


texts: how to make smartparens insert "` and "' instead of ``'' in latex-modes

texts:
Smartparens is quite useful, but I just do not understand its documentation.

How do I make smartparens insert "` and "' instead of `` and '' when pressing " in latex-mode?

Remark (because formating this question is somewhat difficult)
 Smartparens inserts :

``''

on ", but I need:

"`"'

Note: I do use (require 'smartparens-config) to initially set up smartparens stuff. This loads smartparens-latex.el and this sets up the ``'' pair. I'm not able to change the behavior to insert those pairs, which I need. Neither by editing smartparens-latex.el nor by commands in my init.el.
Also note: I'm using auctex.


texts: How to avoid term turn line wrap into line break for long output

texts:
When the output in term is longer than the frame it will wrap the line. But when I copy and paste the output, I found the output will break under the wrap point, because it treat it as line break. How can I avoid this behavior? I test eshell, which is good and will not break the wrap.

I am using zsh under term.


texts: Contstant getting "Blocking call to accept-process-output with quit inhibited!" with flyspell mode

texts:
After I installed aspell with Emacs 26.3 and turned on flyspell mode, I constantly get the message:
Blocking call to accept-process-output with quit inhibited!
How to suppress these messages?


texts: How to unpack a tuple from org-sbe evaluating a python code block into multiple columns of a org-table?

texts:
I often encounter situations where I can easily think of python code that, given some input values, computes multiple output values at once.  As an example, consider the following simple code-block that converts the real and imaginary part (a and b) of a complex number to its polar representation (radius and phase).  In an org-mode file I would write:

#+name: radius_phase_conv
#+begin_src python :exports none :var a=2. :var b=2.
  from cmath import polar
  from math import degrees
  num = complex(a,b)
  r, phi = polar(num)
  phi_deg = degrees(phi)
  return round(r,5), round(phi_deg,5)
#+end_src

#+RESULTS: radius_phase_conv
| 2.82843 | 45.0 |

Now I want to use such a code on a table in org-mode that contains the columns with the input values.  In above example, we might have a table with a and b.

|      a |       b |
|--------+---------|
|      1 |       0 |
|      1 |       1 |

Putting the line

#+TBLFM: $3='(org-sbe "radius_phase_conv" (a $1) (b $2)

below the table, will produce a 3rd column that contains the tuples with the radius and the phase.

|      a |       b |                    |
|--------+---------+--------------------|
|      1 |       0 | (1.0 0.0)          |
|      1 |       1 | (1.41421 45.0)     |
#+TBLFM: $3='(org-sbe "radius_phase_conv" (a $1) (b $2))

How do I need to alter the #+TBLFM: + org-sbe statement in order to produce two columns in the final table, i.e. the desired result would be

| a | b |          |       |
|---+---+----------+-------|
| 1 | 0 | 1.0      |  0.0  |
| 1 | 1 | 1.41421  | 45.0  |
#+TBLFM: ???


texts: How to bash command output that isn't STDOUT from babel shell command

texts:
Is this possible? For example, determining the version of anaconda:

#+BEGIN_SRC sh :results output
  conda -V | grep "conda"
#+END_SRC

If I remove the grep part I get no output at all, with it I at least get an Error Output window showing the conda version.


texts:
I'd like to generate some random passwords using Emacs, and thus need a secure random number generator. I don't like that 'random might be seeded from system time

I'd feel most comfortable just reading from /dev/urandom:

(insert-file-contents-literally "/dev/urandom" nil 0 32)

Unfortunately Emacs complains with insert-file-contents-literally: not a regular file: /dev/urandom

Is there another way of reading from urandom or generating secure numbers?

EDIT: Looking at the source of 'random, I see that it's using libc  rand(), which is another notch against using 'random for passwords (see this question)


texts: Is it possible to read-only Twitter in Emacs?

texts:
I'd like to follow some accounts on Twitter, but would prefer not to open an account with them - I want to use Twitter read-only.  What I'd like is define a list of accounts I want to read, and have a "check for new tweets" functionality.

Is this possible in Emacs? What would I need to do?


texts: When MATLAB mode is installed opening an m file gives a file mode specification error

texts:
I have installed the matlab-mode-20160902.459 package from MELPA and whenever I open an m file (i.e., a file with the file extension .m which is the file extension of most MATLAB/GNU Octave scripts) I get an error message shown in the below screenshot:

Here is my present ~/.emacs file. As you can see on line 129 I have added the line:

(add-to-list 'auto-mode-alist '("\\.m$" . matlab-mode))

to hopefully autoload matlab-mode whenever I open an m file. I really have no idea how to fix this error as I haven't pressed C-x when I opened this file... If relevant I opened my m files using the Emacs directory browser shown in the screenshot.

Is it perhaps that this ~/.emacs line that sets .m files to be handled by matlab-mode conflicts with the default handling of .m files as Objective C files? Regardless of the cause a solution would be wonderful. I don't ever code in objective C (I am a loyal Linux user with no interest in iOS or macOS development), but I do code in GNU Octave / MATLAB, so setting m files as being associated with matlab-mode would be ideal.

EDIT:

I have tried using octave-mod instead by adding:

(setq auto-mode-alist
      (cons '("\\.m$" . octave-mode) auto-mode-alist))
(add-hook 'octave-mode-hook
          (lambda ()
            (abbrev-mode 1)
            (auto-fill-mode 1)
            (if (eq window-system 'x)
                (font-lock-mode 1))))

to my ~/.emacs file (in accordance with this guide). That gave the same error when opening an ~/.emacs file (and yes I did remove the matlab-mode line before I added these lines to make it a fair test of whether it works).

I have seen this question at StackOverflow but neither upvoted answer (which presently are this and this) worked for me: they both returned the same error whenever I opened an m file and neither caused syntax-highlighting of the m file to occur.

The backtrace generated by going to Options→Enter Debugger on Error was, when I opened the m file /home/fusion809/GitHub/mine/scripts/GNU_Octave/first.m:

Debugger entered--Lisp error: (file-error "Cannot open load file" "No such file or directory" "octave-mode")
  octave-mode()
  set-auto-mode-0(octave-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer first.m> "~/GitHub/mine/scripts/GNU_Octave/first.m" nil nil "~/GitHub/mine/scripts/GNU_Octave/first.m" (21370145 2052))
  find-file-noselect("/home/fusion809/GitHub/mine/scripts/GNU_Octave/first.m" nil nil nil)
  find-file-other-window("/home/fusion809/GitHub/mine/scripts/GNU_Octave/first.m")
  dired-mouse-find-file-other-window((mouse-2 (#<window 3 on GNU_Octave> 419 (546 . 123) 39532480 nil 419 (60 . 6) nil (6 . 15) (9 . 18))))
  funcall-interactively(dired-mouse-find-file-other-window (mouse-2 (#<window 3 on GNU_Octave> 419 (546 . 123) 39532480 nil 419 (60 . 6) nil (6 . 15) (9 . 18))))
  call-interactively(dired-mouse-find-file-other-window nil nil)
  command-execute(dired-mouse-find-file-other-window)

With MATLAB mode (instead of Octave mode as in the last backtrace) I get the backtrace http://paste2.org/wDE8VcbV (too long to paste here).


texts: how to expand a yasnippet snippet after punctuation?

texts:
Q: how can I get yasnippet snippets to expand when placed immediately after punctuation?

Consider the snippet SNIP.  It will expand if preceded by whitespace (eg, here's a SNIP expands), but not when preceded immediately by an alphanumeric character (eg, here's a superSNIP does not expand).

Snippets also expand after parentheses and braces, so these all expand:

here's a (SNIP
here's a [SNIP
here's a {SNIP

However, snippets do not seem to expand after punctuation, so, eg, neither here's a ;SNIP nor here's a .SNIP will expand.

I imagine there's a good reason for this, but I'd like to know how to get snippets to fire after punctuation characters (or, more generally, non-alphanumeric characters).  Ideally, this could be mode-specific or buffer-local.


texts: How to call `replace-string` with specific strings from code?

texts: Sometimes I want to replace [$] with \( and [/$] with \) either in the region or in the whole buffer. replace-string works well for that, except for requiring me to type the strings I want to replace. I would like to call it with these specific strings from an elisp function. How can I do that?


texts: Run flyspell when loading new buffer with custom dictionary

texts:
Sometimes it is possible to add commands to the start of an org-mode buffer to customize it.

I would like flyspell to run and stay active with pt_PT dictionary on a specific file whenever I open it. This is an org-mode file opened with emacs.

How can I do that?


texts: Automatically add recipients' mail address to the BBDB database

texts: I am using BBDB3 with Gnus. I want to make BBDB to update the recipient address in its database for each mail I send (just like Gmail does). Is it possible?


texts: Why does this function work with :post but not :pre?

texts:
(defhydra windows (global-map "C-c w" :post flash-active-buffer)
  "window moving"
  ("o" other-window "other"))

(make-face 'flash-active-buffer-face)
(set-face-attribute 'flash-active-buffer-face nil
                    :background "red"
                    :foreground "black")
(defun flash-active-buffer ()
  (interactive)
  (run-at-time "250 millisec" nil
               (lambda (remap-cookie)
                 (face-remap-remove-relative remap-cookie))
               (face-remap-add-relative 'default 'flash-active-buffer-face)))

The above works as you'd expect: when the hydra exits, the final window flashes.  What I'd like is to flash the window as the focus moves about the frame.  However, instead of flashing the window, it will leave all other windows with the flash-color (in this case, completely red).

How can I get each window to flash as expected when using :pre?


texts: Errors in python buffer when type docstrings

texts:
When I type any text in docstring I've got an exception right at cursor place. May be it's some python-mode.el addon, I don't know. How should I fix it?

I use company-jedi and python-mode.el.


texts: How to add killed region to X Window primary selection

texts:
I use Emacs in a terminal window on Linux, using the --no-window-system option.

Prior to version 24, if I clicked the middle mouse button in another application window, it would paste the last-killed region into that application via the X Windows primary selection. In version 24 this no long works; it appears that killing a region does not add that region to the X primary selection when Emacs is run from the shell.

When killing a region in the GUI version the region is added to the primary selection, but I would like to be able to use this feature while running Emacs in the terminal.

What can I add to my ~/.emacs file to make this work again?


texts: Has anyone found or has an idea why Emacs hangs on start up. I see a lot of posts about this issue but it seems that this is not fixed yet. It also appears that this only happens to older machines, and specifically when many apps are running in the same time.


texts: Using auth-source with magit and bitbucket

texts:
The code base I'm working on has recently moved from ssh key controlled git to https bitbucket.

I use Magit to handle my version control in Emacs.

In the old ssh world I was never challenged for my username or password.

However, now I'm prompted for a password (and username depending how I clone) every time I perform an action on the repo.

Prompted for username and password:

git clone https://bitbucket.foo.com:8443/scm/bar.git

Prompted for password only:

git clone https://my.name@bitbucket.foo.com:8443/scm/bar.git

Pretty standard stuff so far.

To avoid typing in my username and password each time, I've found I can use auth-source which I can point to an encrypted file which I'm only challenged to authenticate once per emacs session - this suits me perfectly:

(setq auth-sources '((:source "~/.blah.authinfo.gpg")))
(setq magit-process-find-password-functions '(magit-process-password-auth-source))

The decrypted format of the auth-sources file is:

machine mymachine login myloginname password mypassword port myport

Described here.

What I've found is irrespective of how I clone the repo (with or without username) the only way I can get this to work is to concatenate the protocol, username, and port into the "machine" setting:

machine https://my.name@bitbucket.foo.com:8443 password secret

I would expect to be able to make this work using the following, especially if I clone without specifying the username in the URL, but it doesn't match.  In fact you are prompted for the git username and then the above rule will match instead - so the supplied git username is added to the machine moniker and is not matched against the login moniker:

machine bitbucket.foo.com:8443 login my.name password secret port https

This is using the example (see "For url-auth authentication...").

A spot of debugging shows how the matching is performed:

With:

(setq auth-source-debug t)

Yields:

Decrypting /home/blah/.blah.authinfo.gpg...done
auth-source-search: found 0 results (max 1) matching (:max 1 :host "https://my.name@bitbucket.foo.com:8443" :require (:host))

Machine is mapped to :host

I am aware of alternative non-emacs specific solutions using git credentials, but I have my reasons for wanting to control my authentication on a per-emacs session basis.

My question - is this a genuine glitch with magit's mapping of Git URLs onto auth-source, or have I set something up incorrectly or misunderstood?

Thanks!


texts:
When installing emacs completely from source to a custom prefix (no root), even after the compilation works, it says emacs: Cannot open terminfo database file
. Adding the terminfo to different parts of the PATH/other environment variables doesn't work


texts: How to justify all paragraphs of the currect buffer?

texts:
I would like to fill justify all paragraphs in the current buffer if no region is selected. I wrote the the following function which performs this job.

Is there a better way to write this function? Is there a build-in function which performs this job?

(defun my-fill-buffer ()
  (interactive)
  (if (not (region-active-p))
      (save-excursion
        (mark-whole-buffer)
        (call-interactively 'fill-region))))


texts: Why don't I get a source window using realgud:gdb?

texts:
using GNU Emacs 25.2.1 (x86_64-w64-mingw32) and realgud 20171006.1840 (from marmalade), I can't use realgud for debugging with gdb: I start it as described in the docu:

M-x load-library RET realgud RET
realgud:gdb

In the "Start like this"-Prompt, I just add my binary:

Run gdb (like this): /cygwin64/bin/gdb.exe ../build/tests/tests.exe

... and I get a gdb command window. So far so good. The realgud documentation mentiones, that in order to get a source window with gdb, I have to run the start command, which I do:

Reading symbols from c:/Users/me/Documents/Projects/p/build/tests/tests.exe...done.
(gdb) start
Temporary breakpoint 1 at 0x1004010fa: file /cygdrive/c/Users/me/Documents/Projects/p/tests/main.cc, line 18.
Starting program: /cygdrive/c/Users/me/Documents/Projects/p/build/tests/tests.exe
[New Thread 3528.0x360c]
[New Thread 3528.0x1078]

Temporary breakpoint 1, 0x00000001004010fa in main (ac=1, av=0xffffcbe0)
    at /cygdrive/c/Users/me/Documents/Projects/p/tests/main.cc:18
18  {
(gdb)

But no source window appears. I have no gui element whatsoever: No breakpoints in my sources, no toolbar icons - just the bare gdb prompt. What's wrong there?


texts: Fulfil task if clocked more than X amount of time

texts:
I want to spend 1hr per day, totalling 21hr per week, doing each of my types of homework. (note: +6d/1w is there to give me a day of lee-way a week).

Ideally I'd like to use org-clock to record how much time I spend on each homework per-day, and to fulfil the task if more than 1hr of time is clocked. For example, if I exceed 1hr clocked time for Further Maths, then I want it to be marked as DONE for today.

This is my base org file currently, which I have setup with habits so tasks are automatically rescheduled if they are completed.

* School
** TODO Homework                                              :DAILY:COLLEGE:
   :SCHEDULED: <2016-11-26 Sat +6d/1w>
   :PROPERTIES:
   :STYLE:    habit
   :END:
*** TODO Maths
    :SCHEDULED: <2016-11-26 Sat +1d>
    :PROPERTIES:
    :STYLE:    habit
    :END:
*** TODO Further Maths
    :SCHEDULED: <2016-11-26 Sat +1d>
    :PROPERTIES:
    :STYLE:    habit
    :END:
*** TODO Computing
    :SCHEDULED: <2016-11-26 Sat +1d>
    :PROPERTIES:
    :STYLE:    habit
    :END:


texts: How to force the indentation of the first paragraph on org-mode export?

texts:
I have a simple Org file with this:

#+STARTUP: showall align
#+OPTIONS: todo:nil tasks:all tags:nil
#+AUTHOR: Manoel Vilela
#+TITLE: Super title @@latex:\\@@ Title to be write
#+DATE: <2017-08-24 Thu 03:02>

* Description

Description about what this file is talking about.
This is a paragraph. But the start is not indented

This is another paragraph, but this is ok.

Which I got this on pdf export.

But I expect that first paragraph is indented too. How can makes this directly?


texts: Set the newsticker group hierarchy in the init file

texts:
I've read on how to add each feed using the variable newsticker-url-list. I did something like this in the init file and it works.
(setq newsticker-url-list '(
  ("stackoverflow.com - emacs" "https://stackoverflow.com/feeds/tag?tagnames=emacs&sort=newest" nil nil nil)
  ("archlinux news" "https://www.archlinux.org/feeds/news/" nil nil nil)
  ("archlinux packages" "https://www.archlinux.org/feeds/packages/" nil nil nil)))

But how do you create groups/subgroups and assign these feeds to the created groups/subgroups? I've read on how to do this interactively, But how do you do all this within the init file (non-interactively)?


texts: How to show the beginning and end of a long function name in `which-key`?

texts: By default, in which-key, descriptions that are longer than 27 characters are truncated, and .. is added.  How can I prevent this eliding and show the beginning and end of a long function name?


texts: Get all filenames in current Dired buffer with Elisp

texts: As the title suggests, how do I get all the file entries in a Dired buffer using Elisp?


texts: How to fix columns of org-agenda clock report

texts:
My problem was that the % values in org-agenda clock report are in different columns like the image below.

I wanted the % values of my clock report to be in a single column which looks like this:

I'm not sure if this has something to do with org-agenda-clockreport-parameter-plist but here is my settings for this variable

(setq org-agenda-clockreport-parameter-plist
  (quote (:link t :maxlevel 7 :fileskip0 t :compact t :narrow 80 :formula %)))

I think I messed up my org-mode settings here.

Could you please help me how to fix this?

Thank you.


texts: How to ensure that gnus only check for new messages in my subscribed groups

texts:
Gnus scans thousands of groups on the news server upon startup.  How do I restrict it to only my subscribed groups?
Edit: This happens despite having set gnus-default-subscribed-newsgroups to true in my .gnus.el file.  I have also set gnus-check-new-newsgroups to nil to no avail. I am using Emacs 27.1.


texts: How to start Emacs from the Terminal window as a GUI application (macOS)

texts:
I've installed Emacs via Homebrew. The version that got installed is 25.3.1. It was installed as the file whose full path is /usr/local/bin/emacs. When I execute

emacs

at a Terminal window, Emacs starts inside the self-same window as a console application. How can I cause it to start as a GUI application?

The answer given here won't work, because the version of Emacs installed as /Applications/Emacs is 25.1.1 .

macOS Sierra Version 10.12.6


texts:
I looked to (info "(elisp)Key Binding Conventions") and (info "(elisp)Keymaps and Minor Modes") and (info "(elisp)Major Mode Conventions") and didn't found any restriction to use H- and s- modifier in modes.

I heavily relay on s- (super) key as user customization and recently found that in Magit:

commit 29ff1ec6a0f65caf5c9c5bf4869015946f12f7aa
Author: Jonas Bernoulli <jonas@bernoul.li>
Date:   2016-09-07 17:42:25 +0200

magit-mode-map: bind S-tab to magit-section-cycle-global

It appears this was always the intention.  Keep the bindings
for s-tab and backtab, in case someone actually uses those.

I think it is illegal to define any H- or s- key binding as that can surprise users.

Are super and hyper key modifier permitted in major/minor modes?

BTW I opened issue: https://github.com/magit/magit/issues/3195


texts: Emacs: How to enable toolbar mode and menubar mode only under a certain mode?

texts:
I use Emacs. However, I am not familiar with Lisp although I do know some functional programming, and hence I never really understood how to customize the init.el.

So basically, I want to be able to enable the toolbar mode and menubar mode only if I am in R-mode.

I know that to enable these mode simply requires:

(tool-bar-mode 1) and (menu-bar-mode 1)

but what if I want to do this locally, i.e. enable them only if I am in R-mode.

What should I put in the init.el ?


texts: Assign a function with universal argument to a key (org-timer-start)

texts:
I would like to assing the function org-timer-start with a univeral argument (Ctrl-u) to its own key.
I read here, that one should look into the source code of a function to find out how to pass a universal argument.
Where is this part in the following function, that tells me about the universal argument call?
    (defun org-timer-start (&optional offset)
      "Set the starting time for the relative timer to now.
    When called with prefix argument OFFSET, prompt the user for an offset time,
    with the default taken from a timer stamp at point, if any.
    If OFFSET is a string or an integer, it is directly taken to be the offset
    without user interaction.
    When called with a double prefix arg, all timer strings in the active
    region will be shifted by a specific amount.  You will be prompted for
    the amount, with the default to make the first timer string in
    the region 0:00:00."
      (interactive "P")
      (cond
       ((equal offset '(16))
        (call-interactively 'org-timer-change-times-in-region))
       (org-timer-countdown-timer
        (user-error "Countdown timer is running.  Cancel first"))
       (t
        (let (delta def s)
          (if (not offset)
          (setq org-timer-start-time (current-time))
        (cond
         ((integerp offset) (setq delta offset))
         ((stringp offset) (setq delta (org-timer-hms-to-secs offset)))
         (t
          (setq def (if (org-in-regexp org-timer-re)
                (match-string 0)
                  "0:00:00")
            s (read-string
               (format "Restart timer with offset [%s]: " def)))
          (unless (string-match "\\S-" s) (setq s def))
          (setq delta (org-timer-hms-to-secs (org-timer-fix-incomplete s)))))
        (setq org-timer-start-time (org-time-since delta)))
          (setq org-timer-pause-time nil)
          (org-timer-set-mode-line 'on)
          (message "Timer start time set to %s, current value is %s"
               (format-time-string "%T" org-timer-start-time)
               (org-timer-secs-to-hms (or delta 0)))
          (run-hooks 'org-timer-start-hook)))))

Do I need to make a custom fuction to call org-timer-start with a Ctrl-u prefix?


texts: Auto-add BCC address to notmuch/message-mode messages

texts: I use GNUs for most of my email needs, but also have notmuch for rapid search of my inbox. Trouble is, when I choose a message in that notmuch search, it doesn't open it with gnus but with its own whatever message-mode spinoff called Message[Notmuch]. In GNUS I have an automatically added BCC address (my "sent-mail" inbox, which is downloaded across devices to sync what I've sent). How can I get the same automatic BCC added to anything I send in reply with Message[Notmuch]?